aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-29 23:04:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-29 23:04:53 -0400
commit9ff9a26b786c35ee8d2a66222924a807ec851a9f (patch)
treedb432a17bccca1ca2c16907f0ee83ac449ed4012 /arch
parent0a3108beea9143225119d5e7c72a8e2c64f3eb7d (diff)
parent0d34fb8e93ceba7b6dad0062dbb4a0813bacd75b (diff)
Merge commit 'origin/master' into next
Manual merge of: arch/powerpc/include/asm/elf.h drivers/i2c/busses/i2c-mpc.c
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/socket.h3
-rw-r--r--arch/alpha/include/asm/statfs.h2
-rw-r--r--arch/alpha/include/asm/swab.h2
-rw-r--r--arch/alpha/kernel/entry.S3
-rw-r--r--arch/alpha/kernel/irq.c4
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/osf_sys.c2
-rw-r--r--arch/alpha/mm/init.c20
-rw-r--r--arch/arm/Kconfig57
-rw-r--r--arch/arm/Kconfig.debug23
-rw-r--r--arch/arm/Makefile8
-rw-r--r--arch/arm/boot/compressed/head.S44
-rw-r--r--arch/arm/boot/compressed/misc.c15
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in5
-rw-r--r--arch/arm/common/clkdev.c11
-rw-r--r--arch/arm/common/dmabounce.c7
-rw-r--r--arch/arm/common/scoop.c31
-rw-r--r--arch/arm/common/sharpsl_pm.c2
-rw-r--r--arch/arm/configs/acs5k_defconfig1233
-rw-r--r--arch/arm/configs/acs5k_tiny_defconfig941
-rw-r--r--arch/arm/configs/assabet_defconfig1
-rw-r--r--arch/arm/configs/badge4_defconfig1
-rw-r--r--arch/arm/configs/cerfcube_defconfig1
-rw-r--r--arch/arm/configs/cm_x2xx_defconfig (renamed from arch/arm/configs/xm_x2xx_defconfig)466
-rw-r--r--arch/arm/configs/colibri_pxa270_defconfig (renamed from arch/arm/configs/colibri_defconfig)594
-rw-r--r--arch/arm/configs/colibri_pxa300_defconfig1156
-rw-r--r--arch/arm/configs/collie_defconfig1
-rw-r--r--arch/arm/configs/em_x270_defconfig1741
-rw-r--r--arch/arm/configs/h3600_defconfig2
-rw-r--r--arch/arm/configs/hackkit_defconfig1
-rw-r--r--arch/arm/configs/jornada720_defconfig1
-rw-r--r--arch/arm/configs/kirkwood_defconfig245
-rw-r--r--arch/arm/configs/lart_defconfig1
-rw-r--r--arch/arm/configs/magician_defconfig700
-rw-r--r--arch/arm/configs/mv78xx0_defconfig1
-rw-r--r--arch/arm/configs/neponset_defconfig1
-rw-r--r--arch/arm/configs/omap_3430sdp_defconfig2061
-rw-r--r--arch/arm/configs/orion5x_defconfig4
-rw-r--r--arch/arm/configs/pleb_defconfig1
-rw-r--r--arch/arm/configs/pxa168_defconfig891
-rw-r--r--arch/arm/configs/pxa910_defconfig891
-rw-r--r--arch/arm/configs/rx51_defconfig1821
-rw-r--r--arch/arm/configs/shannon_defconfig1
-rw-r--r--arch/arm/configs/shark_defconfig928
-rw-r--r--arch/arm/configs/simpad_defconfig1
-rw-r--r--arch/arm/include/asm/a.out.h2
-rw-r--r--arch/arm/include/asm/cacheflush.h16
-rw-r--r--arch/arm/include/asm/dma-mapping.h14
-rw-r--r--arch/arm/include/asm/dma.h46
-rw-r--r--arch/arm/include/asm/elf.h2
-rw-r--r--arch/arm/include/asm/fixmap.h41
-rw-r--r--arch/arm/include/asm/hardware/scoop.h2
-rw-r--r--arch/arm/include/asm/highmem.h31
-rw-r--r--arch/arm/include/asm/hwcap.h2
-rw-r--r--arch/arm/include/asm/kmap_types.h1
-rw-r--r--arch/arm/include/asm/mach/dma.h35
-rw-r--r--arch/arm/include/asm/mach/map.h1
-rw-r--r--arch/arm/include/asm/memory.h14
-rw-r--r--arch/arm/include/asm/module.h22
-rw-r--r--arch/arm/include/asm/page.h8
-rw-r--r--arch/arm/include/asm/proc-fns.h16
-rw-r--r--arch/arm/include/asm/ptrace.h2
-rw-r--r--arch/arm/include/asm/setup.h2
-rw-r--r--arch/arm/include/asm/sizes.h1
-rw-r--r--arch/arm/include/asm/socket.h3
-rw-r--r--arch/arm/include/asm/stacktrace.h15
-rw-r--r--arch/arm/include/asm/swab.h2
-rw-r--r--arch/arm/include/asm/system.h10
-rw-r--r--arch/arm/include/asm/thread_info.h4
-rw-r--r--arch/arm/include/asm/tlbflush.h38
-rw-r--r--arch/arm/include/asm/traps.h1
-rw-r--r--arch/arm/include/asm/unwind.h69
-rw-r--r--arch/arm/include/asm/user.h9
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/debug.S27
-rw-r--r--arch/arm/kernel/dma-isa.c67
-rw-r--r--arch/arm/kernel/dma.c119
-rw-r--r--arch/arm/kernel/entry-armv.S19
-rw-r--r--arch/arm/kernel/entry-common.S4
-rw-r--r--arch/arm/kernel/irq.c20
-rw-r--r--arch/arm/kernel/module.c73
-rw-r--r--arch/arm/kernel/process.c31
-rw-r--r--arch/arm/kernel/ptrace.c58
-rw-r--r--arch/arm/kernel/setup.c5
-rw-r--r--arch/arm/kernel/smp.c2
-rw-r--r--arch/arm/kernel/stacktrace.c88
-rw-r--r--arch/arm/kernel/stacktrace.h9
-rw-r--r--arch/arm/kernel/time.c21
-rw-r--r--arch/arm/kernel/traps.c44
-rw-r--r--arch/arm/kernel/unwind.c434
-rw-r--r--arch/arm/kernel/vmlinux.lds.S21
-rw-r--r--arch/arm/mach-aaec2000/include/mach/system.h2
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c4
-rw-r--r--arch/arm/mach-at91/generic.h3
-rw-r--r--arch/arm/mach-at91/gpio.c222
-rw-r--r--arch/arm/mach-at91/include/mach/gpio.h28
-rw-r--r--arch/arm/mach-at91/include/mach/system.h2
-rw-r--r--arch/arm/mach-clps711x/include/mach/system.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/system.h2
-rw-r--r--arch/arm/mach-ebsa110/include/mach/system.h2
-rw-r--r--arch/arm/mach-ep93xx/Makefile2
-rw-r--r--arch/arm/mach-ep93xx/clock.c79
-rw-r--r--arch/arm/mach-ep93xx/dma-m2p.c408
-rw-r--r--arch/arm/mach-ep93xx/edb9307a.c12
-rw-r--r--arch/arm/mach-ep93xx/include/mach/dma.h52
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h3
-rw-r--r--arch/arm/mach-ep93xx/include/mach/system.h2
-rw-r--r--arch/arm/mach-footbridge/dma.c12
-rw-r--r--arch/arm/mach-footbridge/include/mach/system.h2
-rw-r--r--arch/arm/mach-gemini/Kconfig19
-rw-r--r--arch/arm/mach-gemini/Makefile10
-rw-r--r--arch/arm/mach-gemini/Makefile.boot9
-rw-r--r--arch/arm/mach-gemini/board-rut1xx.c95
-rw-r--r--arch/arm/mach-gemini/common.h28
-rw-r--r--arch/arm/mach-gemini/devices.c92
-rw-r--r--arch/arm/mach-gemini/gpio.c232
-rw-r--r--arch/arm/mach-gemini/include/mach/debug-macro.S23
-rw-r--r--arch/arm/mach-gemini/include/mach/entry-macro.S39
-rw-r--r--arch/arm/mach-gemini/include/mach/global_reg.h278
-rw-r--r--arch/arm/mach-gemini/include/mach/gpio.h25
-rw-r--r--arch/arm/mach-gemini/include/mach/hardware.h75
-rw-r--r--arch/arm/mach-gemini/include/mach/io.h18
-rw-r--r--arch/arm/mach-gemini/include/mach/irqs.h53
-rw-r--r--arch/arm/mach-gemini/include/mach/memory.h19
-rw-r--r--arch/arm/mach-gemini/include/mach/system.h37
-rw-r--r--arch/arm/mach-gemini/include/mach/timex.h13
-rw-r--r--arch/arm/mach-gemini/include/mach/uncompress.h42
-rw-r--r--arch/arm/mach-gemini/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-gemini/irq.c102
-rw-r--r--arch/arm/mach-gemini/mm.c82
-rw-r--r--arch/arm/mach-gemini/time.c89
-rw-r--r--arch/arm/mach-h720x/include/mach/system.h2
-rw-r--r--arch/arm/mach-imx/generic.c36
-rw-r--r--arch/arm/mach-imx/include/mach/system.h2
-rw-r--r--arch/arm/mach-integrator/include/mach/system.h2
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h5
-rw-r--r--arch/arm/mach-iop13xx/include/mach/system.h2
-rw-r--r--arch/arm/mach-iop13xx/pci.c5
-rw-r--r--arch/arm/mach-iop32x/include/mach/system.h2
-rw-r--r--arch/arm/mach-iop33x/include/mach/system.h2
-rw-r--r--arch/arm/mach-ixp2000/include/mach/system.h2
-rw-r--r--arch/arm/mach-ixp23xx/include/mach/system.h2
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c25
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/cpu.h35
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h42
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/system.h2
-rw-r--r--arch/arm/mach-ixp4xx/ixp4xx_npe.c6
-rw-r--r--arch/arm/mach-kirkwood/Kconfig12
-rw-r--r--arch/arm/mach-kirkwood/Makefile4
-rw-r--r--arch/arm/mach-kirkwood/common.c101
-rw-r--r--arch/arm/mach-kirkwood/common.h7
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c67
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h3
-rw-r--r--arch/arm/mach-kirkwood/include/mach/system.h2
-rw-r--r--arch/arm/mach-kirkwood/mpp.c97
-rw-r--r--arch/arm/mach-kirkwood/mpp.h303
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c9
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c32
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c136
-rw-r--r--arch/arm/mach-kirkwood/ts219-setup.c220
-rw-r--r--arch/arm/mach-ks8695/Kconfig6
-rw-r--r--arch/arm/mach-ks8695/Makefile1
-rw-r--r--arch/arm/mach-ks8695/board-acs5k.c233
-rw-r--r--arch/arm/mach-ks8695/include/mach/memory.h6
-rw-r--r--arch/arm/mach-ks8695/include/mach/system.h2
-rw-r--r--arch/arm/mach-l7200/include/mach/system.h2
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/system.h2
-rw-r--r--arch/arm/mach-loki/include/mach/system.h2
-rw-r--r--arch/arm/mach-mmp/Kconfig47
-rw-r--r--arch/arm/mach-mmp/Makefile15
-rw-r--r--arch/arm/mach-mmp/Makefile.boot1
-rw-r--r--arch/arm/mach-mmp/aspenite.c117
-rw-r--r--arch/arm/mach-mmp/clock.c83
-rw-r--r--arch/arm/mach-mmp/clock.h71
-rw-r--r--arch/arm/mach-mmp/common.c37
-rw-r--r--arch/arm/mach-mmp/common.h13
-rw-r--r--arch/arm/mach-mmp/devices.c69
-rw-r--r--arch/arm/mach-mmp/include/mach/addr-map.h34
-rw-r--r--arch/arm/mach-mmp/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-mmp/include/mach/cputype.h30
-rw-r--r--arch/arm/mach-mmp/include/mach/debug-macro.S23
-rw-r--r--arch/arm/mach-mmp/include/mach/devices.h37
-rw-r--r--arch/arm/mach-mmp/include/mach/dma.h13
-rw-r--r--arch/arm/mach-mmp/include/mach/entry-macro.S25
-rw-r--r--arch/arm/mach-mmp/include/mach/gpio.h36
-rw-r--r--arch/arm/mach-mmp/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-mmp/include/mach/io.h21
-rw-r--r--arch/arm/mach-mmp/include/mach/irqs.h119
-rw-r--r--arch/arm/mach-mmp/include/mach/memory.h14
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa168.h258
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa910.h157
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp.h37
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h23
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h23
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-apbc.h78
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-apmu.h36
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-icu.h31
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-timers.h44
-rw-r--r--arch/arm/mach-mmp/include/mach/system.h21
-rw-r--r--arch/arm/mach-mmp/include/mach/timex.h9
-rw-r--r--arch/arm/mach-mmp/include/mach/uncompress.h41
-rw-r--r--arch/arm/mach-mmp/include/mach/vmalloc.h5
-rw-r--r--arch/arm/mach-mmp/irq.c55
-rw-r--r--arch/arm/mach-mmp/pxa168.c111
-rw-r--r--arch/arm/mach-mmp/pxa910.c158
-rw-r--r--arch/arm/mach-mmp/tavorevb.c109
-rw-r--r--arch/arm/mach-mmp/time.c199
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c47
-rw-r--r--arch/arm/mach-msm/include/mach/system.h2
-rw-r--r--arch/arm/mach-mv78xx0/Kconfig6
-rw-r--r--arch/arm/mach-mv78xx0/Makefile1
-rw-r--r--arch/arm/mach-mv78xx0/common.c132
-rw-r--r--arch/arm/mach-mv78xx0/common.h3
-rw-r--r--arch/arm/mach-mv78xx0/db78x00-bp-setup.c16
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/mv78xx0.h14
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/system.h2
-rw-r--r--arch/arm/mach-mv78xx0/pcie.c6
-rw-r--r--arch/arm/mach-mv78xx0/rd78x00-masa-setup.c88
-rw-r--r--arch/arm/mach-mx1/Kconfig7
-rw-r--r--arch/arm/mach-mx1/Makefile1
-rw-r--r--arch/arm/mach-mx1/clock.c40
-rw-r--r--arch/arm/mach-mx1/devices.c3
-rw-r--r--arch/arm/mach-mx1/mx1ads.c68
-rw-r--r--arch/arm/mach-mx1/scb9328.c160
-rw-r--r--arch/arm/mach-mx2/Kconfig20
-rw-r--r--arch/arm/mach-mx2/Makefile4
-rw-r--r--arch/arm/mach-mx2/Makefile.boot10
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c984
-rw-r--r--arch/arm/mach-mx2/clock_imx27.c1656
-rw-r--r--arch/arm/mach-mx2/cpu_imx27.c4
-rw-r--r--arch/arm/mach-mx2/crm_regs.h313
-rw-r--r--arch/arm/mach-mx2/devices.c194
-rw-r--r--arch/arm/mach-mx2/devices.h8
-rw-r--r--arch/arm/mach-mx2/generic.c1
-rw-r--r--arch/arm/mach-mx2/mx27ads.c19
-rw-r--r--arch/arm/mach-mx2/pcm038.c82
-rw-r--r--arch/arm/mach-mx2/pcm970-baseboard.c133
-rw-r--r--arch/arm/mach-mx2/serial.c3
-rw-r--r--arch/arm/mach-mx3/Kconfig36
-rw-r--r--arch/arm/mach-mx3/Makefile8
-rw-r--r--arch/arm/mach-mx3/clock-imx35.c487
-rw-r--r--arch/arm/mach-mx3/clock.c959
-rw-r--r--arch/arm/mach-mx3/crm_regs.h153
-rw-r--r--arch/arm/mach-mx3/devices.c193
-rw-r--r--arch/arm/mach-mx3/devices.h8
-rw-r--r--arch/arm/mach-mx3/iomux.c88
-rw-r--r--arch/arm/mach-mx3/mm.c37
-rw-r--r--arch/arm/mach-mx3/mx31ads.c328
-rw-r--r--arch/arm/mach-mx3/mx31lite.c13
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c48
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c37
-rw-r--r--arch/arm/mach-mx3/mx31moboard.c74
-rw-r--r--arch/arm/mach-mx3/mx31pdk.c44
-rw-r--r--arch/arm/mach-mx3/pcm037.c138
-rw-r--r--arch/arm/mach-mx3/qong.c312
-rw-r--r--arch/arm/mach-netx/include/mach/system.h2
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/system.h2
-rw-r--r--arch/arm/mach-ns9xxx/irq.c3
-rw-r--r--arch/arm/mach-omap1/Kconfig23
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c2
-rw-r--r--arch/arm/mach-omap1/board-fsample.c34
-rw-r--r--arch/arm/mach-omap1/board-generic.c5
-rw-r--r--arch/arm/mach-omap1/board-h2-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-h2.c7
-rw-r--r--arch/arm/mach-omap1/board-h2.h (renamed from arch/arm/plat-omap/include/mach/board-h2.h)5
-rw-r--r--arch/arm/mach-omap1/board-h3-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-h3.c7
-rw-r--r--arch/arm/mach-omap1/board-h3.h (renamed from arch/arm/plat-omap/include/mach/board-h3.h)5
-rw-r--r--arch/arm/mach-omap1/board-innovator.c8
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c9
-rw-r--r--arch/arm/mach-omap1/board-osk.c17
-rw-r--r--arch/arm/mach-omap1/board-palmte.c17
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c9
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c12
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c1
-rw-r--r--arch/arm/mach-omap1/board-sx1.c3
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c2
-rw-r--r--arch/arm/mach-omap1/clock.c407
-rw-r--r--arch/arm/mach-omap1/clock.h412
-rw-r--r--arch/arm/mach-omap1/devices.c2
-rw-r--r--arch/arm/mach-omap1/id.c4
-rw-r--r--arch/arm/mach-omap1/io.c23
-rw-r--r--arch/arm/mach-omap1/irq.c19
-rw-r--r--arch/arm/mach-omap1/mailbox.c29
-rw-r--r--arch/arm/mach-omap1/mcbsp.c52
-rw-r--r--arch/arm/mach-omap1/mux.c24
-rw-r--r--arch/arm/mach-omap1/serial.c7
-rw-r--r--arch/arm/mach-omap2/Kconfig10
-rw-r--r--arch/arm/mach-omap2/Makefile14
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c17
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c542
-rw-r--r--arch/arm/mach-omap2/board-apollon.c5
-rw-r--r--arch/arm/mach-omap2/board-generic.c2
-rw-r--r--arch/arm/mach-omap2/board-h4.c40
-rw-r--r--arch/arm/mach-omap2/board-ldp.c16
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c7
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c11
-rw-r--r--arch/arm/mach-omap2/board-overo.c72
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c419
-rw-r--r--arch/arm/mach-omap2/board-rx51.c96
-rw-r--r--arch/arm/mach-omap2/clock.c499
-rw-r--r--arch/arm/mach-omap2/clock.h24
-rw-r--r--arch/arm/mach-omap2/clock24xx.c377
-rw-r--r--arch/arm/mach-omap2/clock24xx.h525
-rw-r--r--arch/arm/mach-omap2/clock34xx.c582
-rw-r--r--arch/arm/mach-omap2/clock34xx.h1076
-rw-r--r--arch/arm/mach-omap2/clockdomain.c76
-rw-r--r--arch/arm/mach-omap2/clockdomains.h118
-rw-r--r--arch/arm/mach-omap2/cm-regbits-24xx.h80
-rw-r--r--arch/arm/mach-omap2/cm-regbits-34xx.h121
-rw-r--r--arch/arm/mach-omap2/devices.c152
-rw-r--r--arch/arm/mach-omap2/id.c7
-rw-r--r--arch/arm/mach-omap2/io.c8
-rw-r--r--arch/arm/mach-omap2/mailbox.c195
-rw-r--r--arch/arm/mach-omap2/mcbsp.c26
-rw-r--r--arch/arm/mach-omap2/memory.h43
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c187
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.h6
-rw-r--r--arch/arm/mach-omap2/mux.c27
-rw-r--r--arch/arm/mach-omap2/pm.c2
-rw-r--r--arch/arm/mach-omap2/powerdomains.h8
-rw-r--r--arch/arm/mach-omap2/powerdomains34xx.h68
-rw-r--r--arch/arm/mach-omap2/prcm-common.h198
-rw-r--r--arch/arm/mach-omap2/prm-regbits-34xx.h9
-rw-r--r--arch/arm/mach-omap2/prm.h24
-rw-r--r--arch/arm/mach-omap2/sdrc.c93
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c (renamed from arch/arm/mach-omap2/memory.c)90
-rw-r--r--arch/arm/mach-omap2/usb-musb.c187
-rw-r--r--arch/arm/mach-orion5x/Kconfig1
-rw-r--r--arch/arm/mach-orion5x/common.c34
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c4
-rw-r--r--arch/arm/mach-orion5x/include/mach/system.h2
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c2
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c9
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c10
-rw-r--r--arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c10
-rw-r--r--arch/arm/mach-orion5x/ts78xx-fpga.h35
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c444
-rw-r--r--arch/arm/mach-orion5x/wrt350n-v2-setup.c9
-rw-r--r--arch/arm/mach-pnx4008/include/mach/system.h2
-rw-r--r--arch/arm/mach-pxa/Kconfig58
-rw-r--r--arch/arm/mach-pxa/Makefile14
-rw-r--r--arch/arm/mach-pxa/am200epd.c2
-rw-r--r--arch/arm/mach-pxa/am300epd.c295
-rw-r--r--arch/arm/mach-pxa/clock.c4
-rw-r--r--arch/arm/mach-pxa/clock.h2
-rw-r--r--arch/arm/mach-pxa/cm-x255.c4
-rw-r--r--arch/arm/mach-pxa/cm-x270.c2
-rw-r--r--arch/arm/mach-pxa/cm-x2xx-pci.c1
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c4
-rw-r--r--arch/arm/mach-pxa/cm-x300.c6
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c (renamed from arch/arm/mach-pxa/colibri.c)54
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c190
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c187
-rw-r--r--arch/arm/mach-pxa/colibri-pxa3xx.c121
-rw-r--r--arch/arm/mach-pxa/corgi.c10
-rw-r--r--arch/arm/mach-pxa/corgi_lcd.c1
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c1
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c1
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa2xx.c2
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa3xx.c2
-rw-r--r--arch/arm/mach-pxa/csb701.c61
-rw-r--r--arch/arm/mach-pxa/csb726.c318
-rw-r--r--arch/arm/mach-pxa/devices.c1
-rw-r--r--arch/arm/mach-pxa/e330.c4
-rw-r--r--arch/arm/mach-pxa/e350.c4
-rw-r--r--arch/arm/mach-pxa/e400.c4
-rw-r--r--arch/arm/mach-pxa/e740.c11
-rw-r--r--arch/arm/mach-pxa/e750.c11
-rw-r--r--arch/arm/mach-pxa/e800.c6
-rw-r--r--arch/arm/mach-pxa/em-x270.c607
-rw-r--r--arch/arm/mach-pxa/eseries.c3
-rw-r--r--arch/arm/mach-pxa/ezx.c10
-rw-r--r--arch/arm/mach-pxa/generic.c33
-rw-r--r--arch/arm/mach-pxa/generic.h7
-rw-r--r--arch/arm/mach-pxa/gpio.c453
-rw-r--r--arch/arm/mach-pxa/gumstix.c12
-rw-r--r--arch/arm/mach-pxa/h5000.c14
-rw-r--r--arch/arm/mach-pxa/himalaya.c166
-rw-r--r--arch/arm/mach-pxa/idp.c3
-rw-r--r--arch/arm/mach-pxa/imote2.c5
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h32
-rw-r--r--arch/arm/mach-pxa/include/mach/csb726.h26
-rw-r--r--arch/arm/mach-pxa/include/mach/dma.h33
-rw-r--r--arch/arm/mach-pxa/include/mach/eseries-gpio.h15
-rw-r--r--arch/arm/mach-pxa/include/mach/gpio.h126
-rw-r--r--arch/arm/mach-pxa/include/mach/gumstix.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/lubbock.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/magician.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa25x.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa27x.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa300.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa320.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h130
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa930.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/mtd-xip.h4
-rw-r--r--arch/arm/mach-pxa/include/mach/palmld.h109
-rw-r--r--arch/arm/mach-pxa/include/mach/palmt5.h84
-rw-r--r--arch/arm/mach-pxa/include/mach/pm.h10
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa-regs.h263
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa25x.h8
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa27x.h19
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa2xx-regs.h31
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa300.h8
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa320.h9
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx-regs.h11
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa930.h8
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-intc.h23
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-ost.h34
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-rtc.h23
-rw-r--r--arch/arm/mach-pxa/include/mach/regs-ssp.h8
-rw-r--r--arch/arm/mach-pxa/include/mach/system.h3
-rw-r--r--arch/arm/mach-pxa/include/mach/uncompress.h3
-rw-r--r--arch/arm/mach-pxa/irq.c70
-rw-r--r--arch/arm/mach-pxa/leds-idp.c2
-rw-r--r--arch/arm/mach-pxa/leds-lubbock.c2
-rw-r--r--arch/arm/mach-pxa/leds-mainstone.c2
-rw-r--r--arch/arm/mach-pxa/littleton.c3
-rw-r--r--arch/arm/mach-pxa/lpd270.c5
-rw-r--r--arch/arm/mach-pxa/lubbock.c12
-rw-r--r--arch/arm/mach-pxa/magician.c101
-rw-r--r--arch/arm/mach-pxa/mainstone.c5
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c5
-rw-r--r--arch/arm/mach-pxa/mfp-pxa3xx.c189
-rw-r--r--arch/arm/mach-pxa/mioa701.c53
-rw-r--r--arch/arm/mach-pxa/mp900.c4
-rw-r--r--arch/arm/mach-pxa/palmld.c565
-rw-r--r--arch/arm/mach-pxa/palmt5.c496
-rw-r--r--arch/arm/mach-pxa/palmtx.c3
-rw-r--r--arch/arm/mach-pxa/palmz72.c4
-rw-r--r--arch/arm/mach-pxa/pcm027.c5
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c3
-rw-r--r--arch/arm/mach-pxa/pm.c13
-rw-r--r--arch/arm/mach-pxa/poodle.c10
-rw-r--r--arch/arm/mach-pxa/pwm.c1
-rw-r--r--arch/arm/mach-pxa/pxa25x.c11
-rw-r--r--arch/arm/mach-pxa/pxa27x.c9
-rw-r--r--arch/arm/mach-pxa/pxa2xx.c1
-rw-r--r--arch/arm/mach-pxa/pxa300.c14
-rw-r--r--arch/arm/mach-pxa/pxa320.c11
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c5
-rw-r--r--arch/arm/mach-pxa/pxa930.c9
-rw-r--r--arch/arm/mach-pxa/reset.c4
-rw-r--r--arch/arm/mach-pxa/saar.c6
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c1
-rw-r--r--arch/arm/mach-pxa/sleep.S1
-rw-r--r--arch/arm/mach-pxa/spitz.c14
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c1
-rw-r--r--arch/arm/mach-pxa/ssp.c1
-rw-r--r--arch/arm/mach-pxa/standby.S1
-rw-r--r--arch/arm/mach-pxa/tavorevb.c5
-rw-r--r--arch/arm/mach-pxa/time.c3
-rw-r--r--arch/arm/mach-pxa/tosa.c10
-rw-r--r--arch/arm/mach-pxa/trizeps4.c5
-rw-r--r--arch/arm/mach-pxa/viper.c7
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa300.c4
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa320.c2
-rw-r--r--arch/arm/mach-realview/Kconfig2
-rw-r--r--arch/arm/mach-realview/core.c55
-rw-r--r--arch/arm/mach-realview/core.h2
-rw-r--r--arch/arm/mach-realview/include/mach/board-pba8.h2
-rw-r--r--arch/arm/mach-realview/include/mach/platform.h6
-rw-r--r--arch/arm/mach-realview/include/mach/system.h2
-rw-r--r--arch/arm/mach-realview/realview_eb.c16
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c15
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c25
-rw-r--r--arch/arm/mach-realview/realview_pba8.c25
-rw-r--r--arch/arm/mach-rpc/dma.c213
-rw-r--r--arch/arm/mach-rpc/include/mach/isa-dma.h2
-rw-r--r--arch/arm/mach-rpc/include/mach/system.h2
-rw-r--r--arch/arm/mach-s3c2410/dma.c2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-nrs.h23
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio.h3
-rw-r--r--arch/arm/mach-s3c2410/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-gpio.h11
-rw-r--r--arch/arm/mach-s3c2410/include/mach/system-reset.h2
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c2
-rw-r--r--arch/arm/mach-s3c2410/pm.c13
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c3
-rw-r--r--arch/arm/mach-s3c2412/dma.c4
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c4
-rw-r--r--arch/arm/mach-s3c2412/pm.c4
-rw-r--r--arch/arm/mach-s3c2440/dma.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c2
-rw-r--r--arch/arm/mach-s3c2443/dma.c2
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-s3c6400/include/mach/map.h3
-rw-r--r--arch/arm/mach-s3c6400/include/mach/system.h2
-rw-r--r--arch/arm/mach-sa1100/Kconfig21
-rw-r--r--arch/arm/mach-sa1100/collie.c30
-rw-r--r--arch/arm/mach-sa1100/collie_pm.c12
-rw-r--r--arch/arm/mach-sa1100/h3600.c486
-rw-r--r--arch/arm/mach-sa1100/include/mach/collie.h12
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3600.h73
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3600_gpio.h463
-rw-r--r--arch/arm/mach-sa1100/include/mach/irqs.h22
-rw-r--r--arch/arm/mach-sa1100/include/mach/system.h2
-rw-r--r--arch/arm/mach-sa1100/jornada720.c14
-rw-r--r--arch/arm/mach-shark/core.c48
-rw-r--r--arch/arm/mach-shark/dma.c6
-rw-r--r--arch/arm/mach-shark/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-shark/include/mach/framebuffer.h16
-rw-r--r--arch/arm/mach-shark/include/mach/hardware.h27
-rw-r--r--arch/arm/mach-shark/include/mach/io.h8
-rw-r--r--arch/arm/mach-shark/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-shark/include/mach/isa-dma.h4
-rw-r--r--arch/arm/mach-shark/include/mach/memory.h1
-rw-r--r--arch/arm/mach-shark/include/mach/system.h16
-rw-r--r--arch/arm/mach-shark/include/mach/uncompress.h2
-rw-r--r--arch/arm/mach-shark/leds.c6
-rw-r--r--arch/arm/mach-versatile/core.c16
-rw-r--r--arch/arm/mach-versatile/include/mach/system.h2
-rw-r--r--arch/arm/mach-w90x900/cpu.h39
-rw-r--r--arch/arm/mach-w90x900/include/mach/system.h2
-rw-r--r--arch/arm/mach-w90x900/mach-w90p910evb.c56
-rw-r--r--arch/arm/mach-w90x900/w90p910.c67
-rw-r--r--arch/arm/mm/Kconfig51
-rw-r--r--arch/arm/mm/Makefile6
-rw-r--r--arch/arm/mm/cache-fa.S220
-rw-r--r--arch/arm/mm/cache-feroceon-l2.c54
-rw-r--r--arch/arm/mm/cache-xsc3l2.c107
-rw-r--r--arch/arm/mm/copypage-fa.c86
-rw-r--r--arch/arm/mm/dma-mapping.c72
-rw-r--r--arch/arm/mm/flush.c2
-rw-r--r--arch/arm/mm/highmem.c116
-rw-r--r--arch/arm/mm/init.c21
-rw-r--r--arch/arm/mm/mm.h3
-rw-r--r--arch/arm/mm/mmu.c43
-rw-r--r--arch/arm/mm/proc-fa526.S248
-rw-r--r--arch/arm/mm/proc-mohawk.S416
-rw-r--r--arch/arm/mm/tlb-fa.S75
-rw-r--r--arch/arm/oprofile/backtrace.c14
-rw-r--r--arch/arm/oprofile/op_model_mpcore.c2
-rw-r--r--arch/arm/plat-mxc/Kconfig10
-rw-r--r--arch/arm/plat-mxc/Makefile3
-rw-r--r--arch/arm/plat-mxc/clock.c54
-rw-r--r--arch/arm/plat-mxc/cpu.c11
-rw-r--r--arch/arm/plat-mxc/devices.c1
-rw-r--r--arch/arm/plat-mxc/dma-mx1-mx2.c4
-rw-r--r--arch/arm/plat-mxc/gpio.c2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx27ads.h3
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31ads.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31moboard.h45
-rw-r--r--arch/arm/plat-mxc/include/mach/board-qong.h22
-rw-r--r--arch/arm/plat-mxc/include/mach/clkdev.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/clock.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/debug-macro.S3
-rw-r--r--arch/arm/plat-mxc/include/mach/hardware.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/imxfb.h (renamed from arch/arm/mach-imx/include/mach/imxfb.h)3
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h416
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx1.h166
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx21.h126
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx27.h207
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx2x.h237
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h74
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux.h127
-rw-r--r--arch/arm/plat-mxc/include/mach/memory.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/mx21.h78
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h200
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2x.h200
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h329
-rw-r--r--arch/arm/plat-mxc/include/mach/mx35.h29
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3fb.h26
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3x.h290
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc.h74
-rw-r--r--arch/arm/plat-mxc/include/mach/system.h5
-rw-r--r--arch/arm/plat-mxc/iomux-mx1-mx2.c2
-rw-r--r--arch/arm/plat-mxc/pwm.c300
-rw-r--r--arch/arm/plat-mxc/system.c (renamed from arch/arm/mach-mx2/system.c)52
-rw-r--r--arch/arm/plat-mxc/time.c32
-rw-r--r--arch/arm/plat-omap/Kconfig11
-rw-r--r--arch/arm/plat-omap/clock.c198
-rw-r--r--arch/arm/plat-omap/common.c2
-rw-r--r--arch/arm/plat-omap/cpu-omap.c57
-rw-r--r--arch/arm/plat-omap/devices.c3
-rw-r--r--arch/arm/plat-omap/dma.c28
-rw-r--r--arch/arm/plat-omap/dmtimer.c26
-rw-r--r--arch/arm/plat-omap/gpio.c111
-rw-r--r--arch/arm/plat-omap/i2c.c104
-rw-r--r--arch/arm/plat-omap/include/mach/board-2430sdp.h41
-rw-r--r--arch/arm/plat-omap/include/mach/board-apollon.h46
-rw-r--r--arch/arm/plat-omap/include/mach/board-fsample.h51
-rw-r--r--arch/arm/plat-omap/include/mach/board-h4.h38
-rw-r--r--arch/arm/plat-omap/include/mach/board-innovator.h52
-rw-r--r--arch/arm/plat-omap/include/mach/board-ldp.h39
-rw-r--r--arch/arm/plat-omap/include/mach/board-nokia.h54
-rw-r--r--arch/arm/plat-omap/include/mach/board-omap3beagle.h33
-rw-r--r--arch/arm/plat-omap/include/mach/board-osk.h47
-rw-r--r--arch/arm/plat-omap/include/mach/board-overo.h26
-rw-r--r--arch/arm/plat-omap/include/mach/board-palmte.h32
-rw-r--r--arch/arm/plat-omap/include/mach/board-palmtt.h23
-rw-r--r--arch/arm/plat-omap/include/mach/board-palmz71.h26
-rw-r--r--arch/arm/plat-omap/include/mach/board-perseus2.h39
-rw-r--r--arch/arm/plat-omap/include/mach/board-voiceblue.h1
-rw-r--r--arch/arm/plat-omap/include/mach/board.h4
-rw-r--r--arch/arm/plat-omap/include/mach/clkdev.h13
-rw-r--r--arch/arm/plat-omap/include/mach/clock.h80
-rw-r--r--arch/arm/plat-omap/include/mach/clockdomain.h24
-rw-r--r--arch/arm/plat-omap/include/mach/common.h2
-rw-r--r--arch/arm/plat-omap/include/mach/cpu.h61
-rw-r--r--arch/arm/plat-omap/include/mach/gpio.h3
-rw-r--r--arch/arm/plat-omap/include/mach/gpmc.h2
-rw-r--r--arch/arm/plat-omap/include/mach/hardware.h74
-rw-r--r--arch/arm/plat-omap/include/mach/io.h4
-rw-r--r--arch/arm/plat-omap/include/mach/irqs.h83
-rw-r--r--arch/arm/plat-omap/include/mach/mailbox.h27
-rw-r--r--arch/arm/plat-omap/include/mach/mcbsp.h6
-rw-r--r--arch/arm/plat-omap/include/mach/memory.h8
-rw-r--r--arch/arm/plat-omap/include/mach/mmc.h2
-rw-r--r--arch/arm/plat-omap/include/mach/mux.h65
-rw-r--r--arch/arm/plat-omap/include/mach/omap34xx.h28
-rw-r--r--arch/arm/plat-omap/include/mach/omap850.h102
-rw-r--r--arch/arm/plat-omap/include/mach/pm.h12
-rw-r--r--arch/arm/plat-omap/include/mach/powerdomain.h5
-rw-r--r--arch/arm/plat-omap/include/mach/prcm.h5
-rw-r--r--arch/arm/plat-omap/include/mach/sdrc.h64
-rw-r--r--arch/arm/plat-omap/include/mach/system.h8
-rw-r--r--arch/arm/plat-omap/include/mach/usb.h10
-rw-r--r--arch/arm/plat-omap/mailbox.c152
-rw-r--r--arch/arm/plat-omap/mailbox.h100
-rw-r--r--arch/arm/plat-omap/mcbsp.c90
-rw-r--r--arch/arm/plat-omap/sram.c2
-rw-r--r--arch/arm/plat-omap/usb.c25
-rw-r--r--arch/arm/plat-orion/gpio.c29
-rw-r--r--arch/arm/plat-orion/include/plat/gpio.h6
-rw-r--r--arch/arm/plat-orion/include/plat/mvsdio.h21
-rw-r--r--arch/arm/plat-orion/include/plat/orion5x_wdt.h18
-rw-r--r--arch/arm/plat-pxa/Kconfig3
-rw-r--r--arch/arm/plat-pxa/Makefile9
-rw-r--r--arch/arm/plat-pxa/dma.c (renamed from arch/arm/mach-pxa/dma.c)12
-rw-r--r--arch/arm/plat-pxa/gpio.c337
-rw-r--r--arch/arm/plat-pxa/include/plat/dma.h85
-rw-r--r--arch/arm/plat-pxa/include/plat/gpio.h62
-rw-r--r--arch/arm/plat-pxa/include/plat/mfp.h399
-rw-r--r--arch/arm/plat-pxa/mfp.c278
-rw-r--r--arch/arm/plat-s3c/Makefile5
-rw-r--r--arch/arm/plat-s3c/include/plat/audio.h (renamed from arch/arm/mach-s3c2410/include/mach/audio.h)0
-rw-r--r--arch/arm/plat-s3c/include/plat/pm.h174
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h75
-rw-r--r--arch/arm/plat-s3c/include/plat/uncompress.h5
-rw-r--r--arch/arm/plat-s3c/include/plat/usb-control.h (renamed from arch/arm/mach-s3c2410/include/mach/usb-control.h)6
-rw-r--r--arch/arm/plat-s3c/pm-check.c242
-rw-r--r--arch/arm/plat-s3c/pm.c363
-rw-r--r--arch/arm/plat-s3c24xx/Makefile1
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c6
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/irq.h6
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/map.h2
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/pm-core.h59
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/pm.h73
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/regs-iis.h77
-rw-r--r--arch/arm/plat-s3c24xx/irq-pm.c95
-rw-r--r--arch/arm/plat-s3c24xx/irq.c152
-rw-r--r--arch/arm/plat-s3c24xx/pm-simtec.c2
-rw-r--r--arch/arm/plat-s3c24xx/pm.c503
-rw-r--r--arch/arm/plat-s3c24xx/s3c244x.c4
-rw-r--r--arch/arm/plat-s3c24xx/sleep.S43
-rw-r--r--arch/arm/plat-s3c64xx/cpu.c5
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h25
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/regs-gpio.h186
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/regs-modem.h31
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/regs-sys.h4
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h116
-rw-r--r--arch/arm/plat-s3c64xx/irq-eint.c14
-rw-r--r--arch/arm/tools/mach-types10
-rw-r--r--arch/arm/vfp/vfp.h2
-rw-r--r--arch/arm/vfp/vfphw.S2
-rw-r--r--arch/arm/vfp/vfpmodule.c61
-rw-r--r--arch/avr32/Kconfig2
-rw-r--r--arch/avr32/boards/hammerhead/flash.c1
-rw-r--r--arch/avr32/include/asm/socket.h3
-rw-r--r--arch/avr32/include/asm/swab.h2
-rw-r--r--arch/avr32/include/asm/uaccess.h8
-rw-r--r--arch/avr32/kernel/entry-avr32b.S60
-rw-r--r--arch/avr32/kernel/irq.c2
-rw-r--r--arch/avr32/kernel/syscall-stubs.S14
-rw-r--r--arch/avr32/lib/strnlen_user.S2
-rw-r--r--arch/blackfin/configs/BF518F-EZBRD_defconfig42
-rw-r--r--arch/blackfin/configs/BF526-EZBRD_defconfig140
-rw-r--r--arch/blackfin/configs/BF527-EZKIT_defconfig150
-rw-r--r--arch/blackfin/configs/BF533-EZKIT_defconfig54
-rw-r--r--arch/blackfin/configs/BF533-STAMP_defconfig100
-rw-r--r--arch/blackfin/configs/BF537-STAMP_defconfig97
-rw-r--r--arch/blackfin/configs/BF538-EZKIT_defconfig101
-rw-r--r--arch/blackfin/configs/BF548-EZKIT_defconfig163
-rw-r--r--arch/blackfin/configs/BF561-EZKIT_defconfig54
-rw-r--r--arch/blackfin/configs/BlackStamp_defconfig4
-rw-r--r--arch/blackfin/configs/CM-BF527_defconfig6
-rw-r--r--arch/blackfin/configs/CM-BF533_defconfig4
-rw-r--r--arch/blackfin/configs/CM-BF537E_defconfig4
-rw-r--r--arch/blackfin/configs/CM-BF537U_defconfig4
-rw-r--r--arch/blackfin/configs/CM-BF548_defconfig4
-rw-r--r--arch/blackfin/configs/CM-BF561_defconfig4
-rw-r--r--arch/blackfin/configs/H8606_defconfig4
-rw-r--r--arch/blackfin/configs/IP0X_defconfig4
-rw-r--r--arch/blackfin/configs/PNAV-10_defconfig39
-rw-r--r--arch/blackfin/configs/SRV1_defconfig4
-rw-r--r--arch/blackfin/configs/TCM-BF537_defconfig6
-rw-r--r--arch/blackfin/include/asm/bfin5xx_spi.h2
-rw-r--r--arch/blackfin/include/asm/bfin_sport.h9
-rw-r--r--arch/blackfin/include/asm/gpio.h7
-rw-r--r--arch/blackfin/include/asm/gptimers.h6
-rw-r--r--arch/blackfin/include/asm/percpu.h10
-rw-r--r--arch/blackfin/include/asm/socket.h3
-rw-r--r--arch/blackfin/include/asm/swab.h2
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c78
-rw-r--r--arch/blackfin/kernel/irqchip.c7
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S4
-rw-r--r--arch/blackfin/mach-bf518/include/mach/blackfin.h2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF514.h67
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF516.h67
-rw-r--r--arch/blackfin/mach-bf518/include/mach/defBF514.h135
-rw-r--r--arch/blackfin/mach-bf518/include/mach/defBF516.h135
-rw-r--r--arch/blackfin/mach-bf527/include/mach/blackfin.h2
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c235
-rw-r--r--arch/blackfin/mach-bf548/include/mach/blackfin.h2
-rw-r--r--arch/blackfin/mach-common/pm.c2
-rw-r--r--arch/cris/include/asm/socket.h3
-rw-r--r--arch/cris/kernel/irq.c2
-rw-r--r--arch/frv/kernel/irq.c2
-rw-r--r--arch/h8300/include/asm/socket.h3
-rw-r--r--arch/h8300/include/asm/swab.h2
-rw-r--r--arch/h8300/kernel/irq.c4
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/include/asm/fpu.h2
-rw-r--r--arch/ia64/include/asm/gcc_intrin.h1
-rw-r--r--arch/ia64/include/asm/intrinsics.h1
-rw-r--r--arch/ia64/include/asm/kvm.h52
-rw-r--r--arch/ia64/include/asm/kvm_host.h18
-rw-r--r--arch/ia64/include/asm/msidef.h42
-rw-r--r--arch/ia64/include/asm/percpu.h4
-rw-r--r--arch/ia64/include/asm/socket.h3
-rw-r--r--arch/ia64/include/asm/swab.h2
-rw-r--r--arch/ia64/include/asm/topology.h2
-rw-r--r--arch/ia64/include/asm/uv/uv.h13
-rw-r--r--arch/ia64/kernel/acpi.c4
-rw-r--r--arch/ia64/kernel/iosapic.c2
-rw-r--r--arch/ia64/kernel/irq.c6
-rw-r--r--arch/ia64/kernel/irq_ia64.c31
-rw-r--r--arch/ia64/kernel/msi_ia64.c59
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S11
-rw-r--r--arch/ia64/kvm/Kconfig4
-rw-r--r--arch/ia64/kvm/irq.h2
-rw-r--r--arch/ia64/kvm/kvm-ia64.c125
-rw-r--r--arch/ia64/kvm/kvm_fw.c151
-rw-r--r--arch/ia64/kvm/process.c71
-rw-r--r--arch/ia64/kvm/vcpu.c44
-rw-r--r--arch/ia64/kvm/vcpu.h4
-rw-r--r--arch/ia64/kvm/vtlb.c44
-rw-r--r--arch/ia64/sn/kernel/msi_sn.c2
-rw-r--r--arch/m32r/kernel/irq.c2
-rw-r--r--arch/m68k/Makefile3
-rw-r--r--arch/m68k/include/asm/irq_mm.h3
-rw-r--r--arch/m68k/include/asm/macintosh.h7
-rw-r--r--arch/m68k/include/asm/socket.h3
-rw-r--r--arch/m68k/install.sh52
-rw-r--r--arch/m68k/mac/config.c207
-rw-r--r--arch/m68k/mac/via.c9
-rw-r--r--arch/m68knommu/platform/520x/config.c56
-rw-r--r--arch/m68knommu/platform/523x/config.c51
-rw-r--r--arch/m68knommu/platform/5272/config.c48
-rw-r--r--arch/m68knommu/platform/527x/config.c113
-rw-r--r--arch/m68knommu/platform/528x/config.c58
-rw-r--r--arch/m68knommu/platform/532x/config.c49
-rw-r--r--arch/mips/basler/excite/excite_iodev.c27
-rw-r--r--arch/mips/include/asm/irq.h2
-rw-r--r--arch/mips/include/asm/mipsregs.h22
-rw-r--r--arch/mips/include/asm/sigcontext.h1
-rw-r--r--arch/mips/include/asm/socket.h3
-rw-r--r--arch/mips/include/asm/swab.h2
-rw-r--r--arch/mips/kernel/irq-gic.c2
-rw-r--r--arch/mips/kernel/irq.c2
-rw-r--r--arch/mips/kernel/linux32.c35
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/kernel/smtc.c6
-rw-r--r--arch/mips/kernel/traps.c12
-rw-r--r--arch/mips/mm/c-r4k.c2
-rw-r--r--arch/mips/mm/dma-default.c2
-rw-r--r--arch/mips/mti-malta/malta-smtc.c5
-rw-r--r--arch/mips/sgi-ip22/ip22-int.c2
-rw-r--r--arch/mips/sgi-ip22/ip22-time.c2
-rw-r--r--arch/mips/sibyte/bcm1480/smp.c3
-rw-r--r--arch/mips/sibyte/sb1250/smp.c3
-rw-r--r--arch/mn10300/kernel/irq.c2
-rw-r--r--arch/mn10300/kernel/mn10300-watchdog.c3
-rw-r--r--arch/parisc/include/asm/pdc.h3
-rw-r--r--arch/parisc/include/asm/socket.h3
-rw-r--r--arch/parisc/include/asm/swab.h2
-rw-r--r--arch/parisc/kernel/irq.c4
-rw-r--r--arch/parisc/kernel/syscall_table.S2
-rw-r--r--arch/powerpc/boot/dts/canyonlands.dts7
-rw-r--r--arch/powerpc/boot/dts/kilauea.dts7
-rw-r--r--arch/powerpc/include/asm/kvm.h7
-rw-r--r--arch/powerpc/include/asm/kvm_44x.h7
-rw-r--r--arch/powerpc/include/asm/kvm_asm.h7
-rw-r--r--arch/powerpc/include/asm/kvm_e500.h67
-rw-r--r--arch/powerpc/include/asm/kvm_host.h21
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h15
-rw-r--r--arch/powerpc/include/asm/mmu-book3e.h2
-rw-r--r--arch/powerpc/include/asm/ps3fb.h1
-rw-r--r--arch/powerpc/include/asm/socket.h3
-rw-r--r--arch/powerpc/include/asm/systbl.h2
-rw-r--r--arch/powerpc/kernel/asm-offsets.c4
-rw-r--r--arch/powerpc/kernel/irq.c4
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S8
-rw-r--r--arch/powerpc/kvm/44x.c72
-rw-r--r--arch/powerpc/kvm/44x_emulate.c217
-rw-r--r--arch/powerpc/kvm/44x_tlb.c39
-rw-r--r--arch/powerpc/kvm/44x_tlb.h9
-rw-r--r--arch/powerpc/kvm/Kconfig16
-rw-r--r--arch/powerpc/kvm/Makefile10
-rw-r--r--arch/powerpc/kvm/booke.c50
-rw-r--r--arch/powerpc/kvm/booke.h35
-rw-r--r--arch/powerpc/kvm/booke_emulate.c266
-rw-r--r--arch/powerpc/kvm/booke_interrupts.S5
-rw-r--r--arch/powerpc/kvm/e500.c169
-rw-r--r--arch/powerpc/kvm/e500_emulate.c202
-rw-r--r--arch/powerpc/kvm/e500_tlb.c757
-rw-r--r--arch/powerpc/kvm/e500_tlb.h185
-rw-r--r--arch/powerpc/kvm/emulate.c93
-rw-r--r--arch/powerpc/kvm/powerpc.c31
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c2
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c5
-rw-r--r--arch/powerpc/sysdev/mpic.c3
-rw-r--r--arch/s390/Kconfig11
-rw-r--r--arch/s390/crypto/prng.c3
-rw-r--r--arch/s390/crypto/sha.h6
-rw-r--r--arch/s390/crypto/sha1_s390.c40
-rw-r--r--arch/s390/crypto/sha256_s390.c40
-rw-r--r--arch/s390/crypto/sha512_s390.c81
-rw-r--r--arch/s390/crypto/sha_common.c20
-rw-r--r--arch/s390/include/asm/bitops.h14
-rw-r--r--arch/s390/include/asm/crw.h68
-rw-r--r--arch/s390/include/asm/dasd.h10
-rw-r--r--arch/s390/include/asm/idals.h17
-rw-r--r--arch/s390/include/asm/kvm.h7
-rw-r--r--arch/s390/include/asm/kvm_host.h3
-rw-r--r--arch/s390/include/asm/lowcore.h653
-rw-r--r--arch/s390/include/asm/mmu_context.h2
-rw-r--r--arch/s390/include/asm/nmi.h66
-rw-r--r--arch/s390/include/asm/processor.h16
-rw-r--r--arch/s390/include/asm/ptrace.h4
-rw-r--r--arch/s390/include/asm/qdio.h1
-rw-r--r--arch/s390/include/asm/smp.h7
-rw-r--r--arch/s390/include/asm/socket.h3
-rw-r--r--arch/s390/include/asm/string.h16
-rw-r--r--arch/s390/include/asm/sysinfo.h1
-rw-r--r--arch/s390/include/asm/tlbflush.h4
-rw-r--r--arch/s390/include/asm/topology.h1
-rw-r--r--arch/s390/include/asm/vtoc.h16
-rw-r--r--arch/s390/kernel/Makefile4
-rw-r--r--arch/s390/kernel/bitmap.S56
-rw-r--r--arch/s390/kernel/bitmap.c54
-rw-r--r--arch/s390/kernel/compat_ptrace.h3
-rw-r--r--arch/s390/kernel/compat_wrapper.S2
-rw-r--r--arch/s390/kernel/debug.c9
-rw-r--r--arch/s390/kernel/early.c23
-rw-r--r--arch/s390/kernel/head.S2
-rw-r--r--arch/s390/kernel/head31.S1
-rw-r--r--arch/s390/kernel/head64.S1
-rw-r--r--arch/s390/kernel/ipl.c74
-rw-r--r--arch/s390/kernel/module.c19
-rw-r--r--arch/s390/kernel/nmi.c376
-rw-r--r--arch/s390/kernel/process.c73
-rw-r--r--arch/s390/kernel/processor.c73
-rw-r--r--arch/s390/kernel/reipl64.S11
-rw-r--r--arch/s390/kernel/s390_ksyms.c44
-rw-r--r--arch/s390/kernel/setup.c52
-rw-r--r--arch/s390/kernel/smp.c68
-rw-r--r--arch/s390/kernel/sysinfo.c428
-rw-r--r--arch/s390/kernel/time.c71
-rw-r--r--arch/s390/kernel/topology.c2
-rw-r--r--arch/s390/kernel/traps.c4
-rw-r--r--arch/s390/kernel/vdso.c2
-rw-r--r--arch/s390/kernel/vmlinux.lds.S2
-rw-r--r--arch/s390/kvm/Kconfig3
-rw-r--r--arch/s390/kvm/intercept.c2
-rw-r--r--arch/s390/kvm/interrupt.c7
-rw-r--r--arch/s390/kvm/kvm-s390.c10
-rw-r--r--arch/s390/kvm/kvm-s390.h2
-rw-r--r--arch/s390/kvm/priv.c18
-rw-r--r--arch/s390/kvm/sigp.c2
-rw-r--r--arch/s390/lib/delay.c2
-rw-r--r--arch/s390/lib/string.c8
-rw-r--r--arch/s390/mm/fault.c28
-rw-r--r--arch/s390/mm/init.c2
-rw-r--r--arch/s390/mm/pgtable.c6
-rw-r--r--arch/sh/Kconfig63
-rw-r--r--arch/sh/Kconfig.cpu3
-rw-r--r--arch/sh/Makefile1
-rw-r--r--arch/sh/boards/Kconfig27
-rw-r--r--arch/sh/boards/Makefile3
-rw-r--r--arch/sh/boards/board-ap325rxa.c11
-rw-r--r--arch/sh/boards/board-espt.c102
-rw-r--r--arch/sh/boards/board-polaris.c149
-rw-r--r--arch/sh/boards/board-sh7785lcr.c15
-rw-r--r--arch/sh/boards/board-urquell.c162
-rw-r--r--arch/sh/boards/mach-highlander/Kconfig2
-rw-r--r--arch/sh/boards/mach-hp6xx/pm_wakeup.S31
-rw-r--r--arch/sh/boards/mach-hp6xx/setup.c1
-rw-r--r--arch/sh/boards/mach-migor/setup.c9
-rw-r--r--arch/sh/boards/mach-rsk/Kconfig2
-rw-r--r--arch/sh/boards/mach-sh7763rdp/setup.c10
-rw-r--r--arch/sh/boot/Makefile20
-rw-r--r--arch/sh/cchips/hd6446x/hd64461.c30
-rw-r--r--arch/sh/configs/espt_defconfig1190
-rw-r--r--arch/sh/configs/polaris_defconfig969
-rw-r--r--arch/sh/configs/sh7785lcr_32bit_defconfig1553
-rw-r--r--arch/sh/configs/urquell_defconfig1332
-rw-r--r--arch/sh/drivers/dma/Kconfig40
-rw-r--r--arch/sh/drivers/dma/Makefile3
-rw-r--r--arch/sh/drivers/dma/dma-sh.c169
-rw-r--r--arch/sh/drivers/dma/dma-sh.h75
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c4
-rw-r--r--arch/sh/include/asm/addrspace.h4
-rw-r--r--arch/sh/include/asm/atomic-irq.h16
-rw-r--r--arch/sh/include/asm/bitops-llsc.h72
-rw-r--r--arch/sh/include/asm/clock.h1
-rw-r--r--arch/sh/include/asm/cmpxchg-llsc.h38
-rw-r--r--arch/sh/include/asm/cpu-features.h1
-rw-r--r--arch/sh/include/asm/dma-sh.h118
-rw-r--r--arch/sh/include/asm/dma.h4
-rw-r--r--arch/sh/include/asm/entry-macros.S5
-rw-r--r--arch/sh/include/asm/gpio.h70
-rw-r--r--arch/sh/include/asm/hd64461.h1
-rw-r--r--arch/sh/include/asm/io.h4
-rw-r--r--arch/sh/include/asm/kprobes.h2
-rw-r--r--arch/sh/include/asm/mmu_context.h15
-rw-r--r--arch/sh/include/asm/mmu_context_32.h12
-rw-r--r--arch/sh/include/asm/page.h7
-rw-r--r--arch/sh/include/asm/processor.h2
-rw-r--r--arch/sh/include/asm/processor_32.h15
-rw-r--r--arch/sh/include/asm/processor_64.h14
-rw-r--r--arch/sh/include/asm/ptrace.h8
-rw-r--r--arch/sh/include/asm/sections.h1
-rw-r--r--arch/sh/include/asm/socket.h3
-rw-r--r--arch/sh/include/asm/suspend.h22
-rw-r--r--arch/sh/include/asm/timer.h4
-rw-r--r--arch/sh/include/asm/tlb.h100
-rw-r--r--arch/sh/include/cpu-sh3/cpu/dma.h17
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma-sh4a.h94
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma-sh7780.h39
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma.h30
-rw-r--r--arch/sh/include/cpu-sh4/cpu/freq.h4
-rw-r--r--arch/sh/include/cpu-sh4/cpu/mmu_context.h35
-rw-r--r--arch/sh/include/cpu-sh4/cpu/sh7786.h192
-rw-r--r--arch/sh/include/mach-common/mach/urquell.h68
-rw-r--r--arch/sh/kernel/Makefile_321
-rw-r--r--arch/sh/kernel/asm-offsets.c8
-rw-r--r--arch/sh/kernel/cpu/Makefile1
-rw-r--r--arch/sh/kernel/cpu/clock.c95
-rw-r--r--arch/sh/kernel/cpu/sh2/setup-sh7619.c34
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-mxg.c65
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7201.c224
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7203.c236
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7206.c154
-rw-r--r--arch/sh/kernel/cpu/sh3/Makefile2
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S357
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7705.c61
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh770x.c68
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7710.c69
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7720.c68
-rw-r--r--arch/sh/kernel/cpu/sh3/swsusp.S147
-rw-r--r--arch/sh/kernel/cpu/sh4/Makefile1
-rw-r--r--arch/sh/kernel/cpu/sh4/probe.c7
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c87
-rw-r--r--arch/sh/kernel/cpu/sh4a/Makefile3
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c148
-rw-r--r--arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c950
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7343.c34
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7366.c34
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c34
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c34
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c114
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c97
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c95
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c490
-rw-r--r--arch/sh/kernel/cpu/shmobile/Makefile6
-rw-r--r--arch/sh/kernel/cpu/shmobile/pm.c92
-rw-r--r--arch/sh/kernel/cpu/shmobile/sleep.S125
-rw-r--r--arch/sh/kernel/gpio.c338
-rw-r--r--arch/sh/kernel/irq.c4
-rw-r--r--arch/sh/kernel/machine_kexec.c74
-rw-r--r--arch/sh/kernel/relocate_kernel.S203
-rw-r--r--arch/sh/kernel/setup.c3
-rw-r--r--arch/sh/kernel/swsusp.c38
-rw-r--r--arch/sh/kernel/time_32.c71
-rw-r--r--arch/sh/kernel/timers/timer-mtu2.c3
-rw-r--r--arch/sh/kernel/timers/timer-tmu.c21
-rw-r--r--arch/sh/kernel/vmlinux_32.lds.S5
-rw-r--r--arch/sh/mm/Kconfig29
-rw-r--r--arch/sh/mm/Makefile_327
-rw-r--r--arch/sh/mm/asids-debugfs.c4
-rw-r--r--arch/sh/mm/ioremap_32.c8
-rw-r--r--arch/sh/mm/pmb-fixed.c45
-rw-r--r--arch/sh/mm/pmb.c38
-rw-r--r--arch/sh/mm/tlb-pteaex.c96
-rw-r--r--arch/sh/oprofile/common.c1
-rw-r--r--arch/sh/tools/mach-types3
-rw-r--r--arch/sparc/include/asm/socket.h3
-rw-r--r--arch/sparc/include/asm/tlb_64.h4
-rw-r--r--arch/sparc/kernel/irq_64.c7
-rw-r--r--arch/sparc/kernel/smp_64.c4
-rw-r--r--arch/sparc/kernel/systbls_64.S2
-rw-r--r--arch/sparc/kernel/time_64.c2
-rw-r--r--arch/um/drivers/net_kern.c39
-rw-r--r--arch/um/include/shared/net_kern.h2
-rw-r--r--arch/um/kernel/irq.c2
-rw-r--r--arch/x86/Kconfig660
-rw-r--r--arch/x86/Kconfig.cpu80
-rw-r--r--arch/x86/Kconfig.debug50
-rw-r--r--arch/x86/Makefile43
-rw-r--r--arch/x86/boot/Makefile1
-rw-r--r--arch/x86/boot/a20.c79
-rw-r--r--arch/x86/boot/boot.h3
-rw-r--r--arch/x86/boot/compressed/Makefile21
-rw-r--r--arch/x86/boot/compressed/head_32.S8
-rw-r--r--arch/x86/boot/compressed/head_64.S10
-rw-r--r--arch/x86/boot/compressed/misc.c118
-rw-r--r--arch/x86/boot/copy.S40
-rw-r--r--arch/x86/boot/header.S2
-rw-r--r--arch/x86/boot/main.c5
-rw-r--r--arch/x86/boot/pmjump.S16
-rw-r--r--arch/x86/boot/voyager.c40
-rw-r--r--arch/x86/configs/i386_defconfig419
-rw-r--r--arch/x86/configs/x86_64_defconfig425
-rw-r--r--arch/x86/crypto/Makefile3
-rw-r--r--arch/x86/crypto/aes-i586-asm_32.S18
-rw-r--r--arch/x86/crypto/aes-x86_64-asm_64.S6
-rw-r--r--arch/x86/crypto/aes_glue.c20
-rw-r--r--arch/x86/crypto/aesni-intel_asm.S896
-rw-r--r--arch/x86/crypto/aesni-intel_glue.c461
-rw-r--r--arch/x86/ia32/ia32_signal.c405
-rw-r--r--arch/x86/ia32/ia32entry.S10
-rw-r--r--arch/x86/ia32/sys_ia32.c22
-rw-r--r--arch/x86/include/asm/a.out-core.h2
-rw-r--r--arch/x86/include/asm/acpi.h3
-rw-r--r--arch/x86/include/asm/aes.h11
-rw-r--r--arch/x86/include/asm/apic.h442
-rw-r--r--arch/x86/include/asm/apicnum.h12
-rw-r--r--arch/x86/include/asm/apm.h (renamed from arch/x86/include/asm/mach-default/apm.h)0
-rw-r--r--arch/x86/include/asm/arch_hooks.h26
-rw-r--r--arch/x86/include/asm/bigsmp/apic.h155
-rw-r--r--arch/x86/include/asm/bigsmp/apicdef.h13
-rw-r--r--arch/x86/include/asm/bigsmp/ipi.h22
-rw-r--r--arch/x86/include/asm/boot.h16
-rw-r--r--arch/x86/include/asm/cacheflush.h53
-rw-r--r--arch/x86/include/asm/calling.h56
-rw-r--r--arch/x86/include/asm/cpu.h17
-rw-r--r--arch/x86/include/asm/cpufeature.h1
-rw-r--r--arch/x86/include/asm/cpumask.h32
-rw-r--r--arch/x86/include/asm/current.h24
-rw-r--r--arch/x86/include/asm/do_timer.h (renamed from arch/x86/include/asm/mach-default/do_timer.h)0
-rw-r--r--arch/x86/include/asm/elf.h15
-rw-r--r--arch/x86/include/asm/entry_arch.h (renamed from arch/x86/include/asm/mach-default/entry_arch.h)25
-rw-r--r--arch/x86/include/asm/es7000/apic.h242
-rw-r--r--arch/x86/include/asm/es7000/apicdef.h13
-rw-r--r--arch/x86/include/asm/es7000/ipi.h22
-rw-r--r--arch/x86/include/asm/es7000/mpparse.h29
-rw-r--r--arch/x86/include/asm/es7000/wakecpu.h37
-rw-r--r--arch/x86/include/asm/fixmap.h139
-rw-r--r--arch/x86/include/asm/fixmap_32.h119
-rw-r--r--arch/x86/include/asm/fixmap_64.h79
-rw-r--r--arch/x86/include/asm/genapic.h6
-rw-r--r--arch/x86/include/asm/genapic_32.h148
-rw-r--r--arch/x86/include/asm/genapic_64.h66
-rw-r--r--arch/x86/include/asm/hardirq.h49
-rw-r--r--arch/x86/include/asm/hardirq_32.h30
-rw-r--r--arch/x86/include/asm/hardirq_64.h25
-rw-r--r--arch/x86/include/asm/hw_irq.h24
-rw-r--r--arch/x86/include/asm/i8259.h4
-rw-r--r--arch/x86/include/asm/ia32.h7
-rw-r--r--arch/x86/include/asm/io.h97
-rw-r--r--arch/x86/include/asm/io_32.h88
-rw-r--r--arch/x86/include/asm/io_64.h61
-rw-r--r--arch/x86/include/asm/io_apic.h41
-rw-r--r--arch/x86/include/asm/ipi.h75
-rw-r--r--arch/x86/include/asm/irq.h4
-rw-r--r--arch/x86/include/asm/irq_regs.h36
-rw-r--r--arch/x86/include/asm/irq_regs_32.h31
-rw-r--r--arch/x86/include/asm/irq_regs_64.h1
-rw-r--r--arch/x86/include/asm/irq_vectors.h209
-rw-r--r--arch/x86/include/asm/kexec.h27
-rw-r--r--arch/x86/include/asm/kvm.h24
-rw-r--r--arch/x86/include/asm/kvm_host.h61
-rw-r--r--arch/x86/include/asm/linkage.h64
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h168
-rw-r--r--arch/x86/include/asm/mach-default/mach_apicdef.h24
-rw-r--r--arch/x86/include/asm/mach-default/mach_ipi.h64
-rw-r--r--arch/x86/include/asm/mach-default/mach_mpparse.h17
-rw-r--r--arch/x86/include/asm/mach-default/mach_mpspec.h12
-rw-r--r--arch/x86/include/asm/mach-default/mach_wakecpu.h41
-rw-r--r--arch/x86/include/asm/mach-generic/gpio.h15
-rw-r--r--arch/x86/include/asm/mach-generic/mach_apic.h35
-rw-r--r--arch/x86/include/asm/mach-generic/mach_apicdef.h11
-rw-r--r--arch/x86/include/asm/mach-generic/mach_ipi.h10
-rw-r--r--arch/x86/include/asm/mach-generic/mach_mpparse.h9
-rw-r--r--arch/x86/include/asm/mach-generic/mach_mpspec.h12
-rw-r--r--arch/x86/include/asm/mach-generic/mach_wakecpu.h12
-rw-r--r--arch/x86/include/asm/mach-rdc321x/gpio.h60
-rw-r--r--arch/x86/include/asm/mach-voyager/do_timer.h17
-rw-r--r--arch/x86/include/asm/mach-voyager/entry_arch.h26
-rw-r--r--arch/x86/include/asm/mach-voyager/setup_arch.h12
-rw-r--r--arch/x86/include/asm/mach_timer.h (renamed from arch/x86/include/asm/mach-default/mach_timer.h)0
-rw-r--r--arch/x86/include/asm/mach_traps.h (renamed from arch/x86/include/asm/mach-default/mach_traps.h)0
-rw-r--r--arch/x86/include/asm/mmu_context.h63
-rw-r--r--arch/x86/include/asm/mmu_context_32.h55
-rw-r--r--arch/x86/include/asm/mmu_context_64.h54
-rw-r--r--arch/x86/include/asm/mmzone_32.h43
-rw-r--r--arch/x86/include/asm/mpspec.h33
-rw-r--r--arch/x86/include/asm/mpspec_def.h23
-rw-r--r--arch/x86/include/asm/msr-index.h9
-rw-r--r--arch/x86/include/asm/numa_32.h6
-rw-r--r--arch/x86/include/asm/numaq.h2
-rw-r--r--arch/x86/include/asm/numaq/apic.h142
-rw-r--r--arch/x86/include/asm/numaq/apicdef.h14
-rw-r--r--arch/x86/include/asm/numaq/ipi.h22
-rw-r--r--arch/x86/include/asm/numaq/mpparse.h6
-rw-r--r--arch/x86/include/asm/numaq/wakecpu.h45
-rw-r--r--arch/x86/include/asm/page.h152
-rw-r--r--arch/x86/include/asm/page_32.h87
-rw-r--r--arch/x86/include/asm/page_32_types.h60
-rw-r--r--arch/x86/include/asm/page_64.h101
-rw-r--r--arch/x86/include/asm/page_64_types.h89
-rw-r--r--arch/x86/include/asm/page_types.h57
-rw-r--r--arch/x86/include/asm/paravirt.h465
-rw-r--r--arch/x86/include/asm/pat.h5
-rw-r--r--arch/x86/include/asm/pci-functions.h (renamed from arch/x86/include/asm/mach-default/pci-functions.h)0
-rw-r--r--arch/x86/include/asm/pda.h137
-rw-r--r--arch/x86/include/asm/percpu.h169
-rw-r--r--arch/x86/include/asm/pgtable-2level.h2
-rw-r--r--arch/x86/include/asm/pgtable-2level_types.h (renamed from arch/x86/include/asm/pgtable-2level-defs.h)17
-rw-r--r--arch/x86/include/asm/pgtable-3level.h35
-rw-r--r--arch/x86/include/asm/pgtable-3level_types.h (renamed from arch/x86/include/asm/pgtable-3level-defs.h)20
-rw-r--r--arch/x86/include/asm/pgtable.h509
-rw-r--r--arch/x86/include/asm/pgtable_32.h88
-rw-r--r--arch/x86/include/asm/pgtable_32_types.h46
-rw-r--r--arch/x86/include/asm/pgtable_64.h113
-rw-r--r--arch/x86/include/asm/pgtable_64_types.h63
-rw-r--r--arch/x86/include/asm/pgtable_types.h328
-rw-r--r--arch/x86/include/asm/prctl.h4
-rw-r--r--arch/x86/include/asm/processor.h45
-rw-r--r--arch/x86/include/asm/proto.h4
-rw-r--r--arch/x86/include/asm/ptrace.h4
-rw-r--r--arch/x86/include/asm/rdc321x_defs.h (renamed from arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h)0
-rw-r--r--arch/x86/include/asm/segment.h9
-rw-r--r--arch/x86/include/asm/setup.h62
-rw-r--r--arch/x86/include/asm/setup_arch.h (renamed from arch/x86/include/asm/mach-default/setup_arch.h)0
-rw-r--r--arch/x86/include/asm/smp.h69
-rw-r--r--arch/x86/include/asm/smpboot_hooks.h (renamed from arch/x86/include/asm/mach-default/smpboot_hooks.h)6
-rw-r--r--arch/x86/include/asm/socket.h3
-rw-r--r--arch/x86/include/asm/spinlock.h69
-rw-r--r--arch/x86/include/asm/stackprotector.h124
-rw-r--r--arch/x86/include/asm/summit/apic.h202
-rw-r--r--arch/x86/include/asm/summit/apicdef.h13
-rw-r--r--arch/x86/include/asm/summit/ipi.h26
-rw-r--r--arch/x86/include/asm/summit/mpparse.h109
-rw-r--r--arch/x86/include/asm/svm.h4
-rw-r--r--arch/x86/include/asm/sys_ia32.h2
-rw-r--r--arch/x86/include/asm/syscalls.h23
-rw-r--r--arch/x86/include/asm/system.h70
-rw-r--r--arch/x86/include/asm/thread_info.h21
-rw-r--r--arch/x86/include/asm/timer.h2
-rw-r--r--arch/x86/include/asm/tlbflush.h17
-rw-r--r--arch/x86/include/asm/topology.h31
-rw-r--r--arch/x86/include/asm/trampoline.h1
-rw-r--r--arch/x86/include/asm/traps.h2
-rw-r--r--arch/x86/include/asm/uaccess.h138
-rw-r--r--arch/x86/include/asm/uaccess_64.h10
-rw-r--r--arch/x86/include/asm/uv/uv.h33
-rw-r--r--arch/x86/include/asm/uv/uv_bau.h1
-rw-r--r--arch/x86/include/asm/vic.h61
-rw-r--r--arch/x86/include/asm/virtext.h2
-rw-r--r--arch/x86/include/asm/vmx.h5
-rw-r--r--arch/x86/include/asm/voyager.h529
-rw-r--r--arch/x86/include/asm/xen/events.h6
-rw-r--r--arch/x86/include/asm/xen/hypervisor.h28
-rw-r--r--arch/x86/include/asm/xen/page.h1
-rw-r--r--arch/x86/kernel/Makefile42
-rw-r--r--arch/x86/kernel/acpi/boot.c169
-rw-r--r--arch/x86/kernel/acpi/realmode/wakeup.S4
-rw-r--r--arch/x86/kernel/acpi/sleep.c1
-rw-r--r--arch/x86/kernel/acpi/wakeup_32.S2
-rw-r--r--arch/x86/kernel/acpi/wakeup_64.S4
-rw-r--r--arch/x86/kernel/alternative.c6
-rw-r--r--arch/x86/kernel/apic/Makefile19
-rw-r--r--arch/x86/kernel/apic/apic.c (renamed from arch/x86/kernel/apic.c)299
-rw-r--r--arch/x86/kernel/apic/apic_flat_64.c (renamed from arch/x86/kernel/genapic_flat_64.c)192
-rw-r--r--arch/x86/kernel/apic/bigsmp_32.c267
-rw-r--r--arch/x86/kernel/apic/es7000_32.c780
-rw-r--r--arch/x86/kernel/apic/io_apic.c (renamed from arch/x86/kernel/io_apic.c)443
-rw-r--r--arch/x86/kernel/apic/ipi.c164
-rw-r--r--arch/x86/kernel/apic/nmi.c (renamed from arch/x86/kernel/nmi.c)12
-rw-r--r--arch/x86/kernel/apic/numaq_32.c557
-rw-r--r--arch/x86/kernel/apic/probe_32.c284
-rw-r--r--arch/x86/kernel/apic/probe_64.c (renamed from arch/x86/kernel/genapic_64.c)55
-rw-r--r--arch/x86/kernel/apic/summit_32.c579
-rw-r--r--arch/x86/kernel/apic/x2apic_cluster.c (renamed from arch/x86/kernel/genx2apic_cluster.c)153
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c (renamed from arch/x86/kernel/genx2apic_phys.c)150
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c (renamed from arch/x86/kernel/genx2apic_uv_x.c)161
-rw-r--r--arch/x86/kernel/apm_32.c2
-rw-r--r--arch/x86/kernel/asm-offsets_32.c1
-rw-r--r--arch/x86/kernel/asm-offsets_64.c11
-rw-r--r--arch/x86/kernel/cpu/addon_cpuid_features.c54
-rw-r--r--arch/x86/kernel/cpu/amd.c2
-rw-r--r--arch/x86/kernel/cpu/common.c257
-rw-r--r--arch/x86/kernel/cpu/cpufreq/Kconfig19
-rw-r--r--arch/x86/kernel/cpu/cpufreq/Makefile8
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c38
-rw-r--r--arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c54
-rw-r--r--arch/x86/kernel/cpu/cpufreq/e_powersaver.c27
-rw-r--r--arch/x86/kernel/cpu/cpufreq/elanfreq.c6
-rw-r--r--arch/x86/kernel/cpu/cpufreq/gx-suspmod.c105
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.c193
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.h12
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longrun.c25
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c72
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k6.c44
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.c239
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c386
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.h5
-rw-r--r--arch/x86/kernel/cpu/cpufreq/sc520_freq.c30
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c6
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-ich.c70
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-lib.c163
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-lib.h18
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-smi.c166
-rw-r--r--arch/x86/kernel/cpu/intel.c25
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c63
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd_64.c21
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_intel_64.c7
-rw-r--r--arch/x86/kernel/cpu/mcheck/p4.c4
-rw-r--r--arch/x86/kernel/cpu/perfctr-watchdog.c2
-rw-r--r--arch/x86/kernel/cpu/proc.c20
-rw-r--r--arch/x86/kernel/crash.c4
-rw-r--r--arch/x86/kernel/dumpstack.c2
-rw-r--r--arch/x86/kernel/dumpstack_64.c35
-rw-r--r--arch/x86/kernel/e820.c3
-rw-r--r--arch/x86/kernel/early_printk.c2
-rw-r--r--arch/x86/kernel/efi.c2
-rw-r--r--arch/x86/kernel/efi_64.c1
-rw-r--r--arch/x86/kernel/efi_stub_32.S3
-rw-r--r--arch/x86/kernel/efi_stub_64.S7
-rw-r--r--arch/x86/kernel/entry_32.S455
-rw-r--r--arch/x86/kernel/entry_64.S72
-rw-r--r--arch/x86/kernel/es7000_32.c378
-rw-r--r--arch/x86/kernel/head64.c23
-rw-r--r--arch/x86/kernel/head_32.S44
-rw-r--r--arch/x86/kernel/head_64.S23
-rw-r--r--arch/x86/kernel/hpet.c80
-rw-r--r--arch/x86/kernel/i8259.c1
-rw-r--r--arch/x86/kernel/ioport.c14
-rw-r--r--arch/x86/kernel/ipi.c190
-rw-r--r--arch/x86/kernel/irq.c44
-rw-r--r--arch/x86/kernel/irq_32.c61
-rw-r--r--arch/x86/kernel/irq_64.c43
-rw-r--r--arch/x86/kernel/irqinit_32.c36
-rw-r--r--arch/x86/kernel/kgdb.c4
-rw-r--r--arch/x86/kernel/kvmclock.c1
-rw-r--r--arch/x86/kernel/machine_kexec_32.c2
-rw-r--r--arch/x86/kernel/machine_kexec_64.c82
-rw-r--r--arch/x86/kernel/mca_32.c5
-rw-r--r--arch/x86/kernel/microcode_intel.c10
-rw-r--r--arch/x86/kernel/module_32.c6
-rw-r--r--arch/x86/kernel/module_64.c32
-rw-r--r--arch/x86/kernel/mpparse.c189
-rw-r--r--arch/x86/kernel/msr.c2
-rw-r--r--arch/x86/kernel/numaq_32.c293
-rw-r--r--arch/x86/kernel/paravirt-spinlocks.c10
-rw-r--r--arch/x86/kernel/paravirt.c56
-rw-r--r--arch/x86/kernel/paravirt_patch_32.c12
-rw-r--r--arch/x86/kernel/paravirt_patch_64.c15
-rw-r--r--arch/x86/kernel/probe_roms_32.c2
-rw-r--r--arch/x86/kernel/process.c193
-rw-r--r--arch/x86/kernel/process_32.c241
-rw-r--r--arch/x86/kernel/process_64.c230
-rw-r--r--arch/x86/kernel/ptrace.c21
-rw-r--r--arch/x86/kernel/quirks.c3
-rw-r--r--arch/x86/kernel/reboot.c5
-rw-r--r--arch/x86/kernel/relocate_kernel_32.S2
-rw-r--r--arch/x86/kernel/relocate_kernel_64.S129
-rw-r--r--arch/x86/kernel/setup.c139
-rw-r--r--arch/x86/kernel/setup_percpu.c679
-rw-r--r--arch/x86/kernel/signal.c463
-rw-r--r--arch/x86/kernel/smp.c15
-rw-r--r--arch/x86/kernel/smpboot.c147
-rw-r--r--arch/x86/kernel/smpcommon.c30
-rw-r--r--arch/x86/kernel/stacktrace.c2
-rw-r--r--arch/x86/kernel/summit_32.c188
-rw-r--r--arch/x86/kernel/syscall_table_32.S20
-rw-r--r--arch/x86/kernel/time_32.c8
-rw-r--r--arch/x86/kernel/tlb_32.c256
-rw-r--r--arch/x86/kernel/tlb_uv.c72
-rw-r--r--arch/x86/kernel/trampoline_32.S2
-rw-r--r--arch/x86/kernel/trampoline_64.S23
-rw-r--r--arch/x86/kernel/traps.c64
-rw-r--r--arch/x86/kernel/tsc.c14
-rw-r--r--arch/x86/kernel/visws_quirks.c10
-rw-r--r--arch/x86/kernel/vm86_32.c20
-rw-r--r--arch/x86/kernel/vmi_32.c13
-rw-r--r--arch/x86/kernel/vmiclock_32.c6
-rw-r--r--arch/x86/kernel/vmlinux_32.lds.S11
-rw-r--r--arch/x86/kernel/vmlinux_64.lds.S37
-rw-r--r--arch/x86/kernel/vsmp_64.c24
-rw-r--r--arch/x86/kernel/x8664_ksyms_64.c2
-rw-r--r--arch/x86/kvm/Kconfig4
-rw-r--r--arch/x86/kvm/i8254.c21
-rw-r--r--arch/x86/kvm/i8254.h2
-rw-r--r--arch/x86/kvm/i8259.c25
-rw-r--r--arch/x86/kvm/irq.h2
-rw-r--r--arch/x86/kvm/kvm_svm.h16
-rw-r--r--arch/x86/kvm/mmu.c237
-rw-r--r--arch/x86/kvm/mmu.h2
-rw-r--r--arch/x86/kvm/paging_tmpl.h219
-rw-r--r--arch/x86/kvm/svm.c916
-rw-r--r--arch/x86/kvm/vmx.c393
-rw-r--r--arch/x86/kvm/x86.c432
-rw-r--r--arch/x86/kvm/x86_emulate.c56
-rw-r--r--arch/x86/lguest/Kconfig1
-rw-r--r--arch/x86/lguest/boot.c32
-rw-r--r--arch/x86/lib/getuser.S2
-rw-r--r--arch/x86/mach-default/Makefile5
-rw-r--r--arch/x86/mach-default/setup.c174
-rw-r--r--arch/x86/mach-generic/Makefile11
-rw-r--r--arch/x86/mach-generic/bigsmp.c60
-rw-r--r--arch/x86/mach-generic/default.c27
-rw-r--r--arch/x86/mach-generic/es7000.c103
-rw-r--r--arch/x86/mach-generic/numaq.c53
-rw-r--r--arch/x86/mach-generic/probe.c152
-rw-r--r--arch/x86/mach-generic/summit.c40
-rw-r--r--arch/x86/mach-rdc321x/Makefile5
-rw-r--r--arch/x86/mach-rdc321x/gpio.c194
-rw-r--r--arch/x86/mach-rdc321x/platform.c69
-rw-r--r--arch/x86/mach-voyager/Makefile8
-rw-r--r--arch/x86/mach-voyager/setup.c118
-rw-r--r--arch/x86/mach-voyager/voyager_basic.c317
-rw-r--r--arch/x86/mach-voyager/voyager_cat.c1197
-rw-r--r--arch/x86/mach-voyager/voyager_smp.c1807
-rw-r--r--arch/x86/mach-voyager/voyager_thread.c128
-rw-r--r--arch/x86/math-emu/get_address.c6
-rw-r--r--arch/x86/mm/Makefile4
-rw-r--r--arch/x86/mm/extable.c6
-rw-r--r--arch/x86/mm/fault.c1333
-rw-r--r--arch/x86/mm/highmem_32.c34
-rw-r--r--arch/x86/mm/init.c49
-rw-r--r--arch/x86/mm/init_32.c213
-rw-r--r--arch/x86/mm/init_64.c109
-rw-r--r--arch/x86/mm/ioremap.c2
-rw-r--r--arch/x86/mm/memtest.c156
-rw-r--r--arch/x86/mm/mmap.c2
-rw-r--r--arch/x86/mm/numa_32.c28
-rw-r--r--arch/x86/mm/numa_64.c217
-rw-r--r--arch/x86/mm/pageattr.c7
-rw-r--r--arch/x86/mm/pat.c77
-rw-r--r--arch/x86/mm/pgtable.c18
-rw-r--r--arch/x86/mm/pgtable_32.c18
-rw-r--r--arch/x86/mm/srat_64.c3
-rw-r--r--arch/x86/mm/tlb.c (renamed from arch/x86/kernel/tlb_64.c)123
-rw-r--r--arch/x86/pci/numaq_32.c6
-rw-r--r--arch/x86/pci/pcbios.c2
-rw-r--r--arch/x86/power/hibernate_asm_32.S2
-rw-r--r--arch/x86/power/hibernate_asm_64.S2
-rw-r--r--arch/x86/vdso/Makefile2
-rw-r--r--arch/x86/vdso/vma.c4
-rw-r--r--arch/x86/xen/Kconfig2
-rw-r--r--arch/x86/xen/Makefile3
-rw-r--r--arch/x86/xen/enlighten.c816
-rw-r--r--arch/x86/xen/irq.c39
-rw-r--r--arch/x86/xen/mmu.c757
-rw-r--r--arch/x86/xen/mmu.h3
-rw-r--r--arch/x86/xen/multicalls.c15
-rw-r--r--arch/x86/xen/multicalls.h2
-rw-r--r--arch/x86/xen/smp.c47
-rw-r--r--arch/x86/xen/suspend.c1
-rw-r--r--arch/x86/xen/xen-asm.S142
-rw-r--r--arch/x86/xen/xen-asm.h12
-rw-r--r--arch/x86/xen/xen-asm_32.S343
-rw-r--r--arch/x86/xen/xen-asm_64.S252
-rw-r--r--arch/x86/xen/xen-head.S2
-rw-r--r--arch/x86/xen/xen-ops.h10
-rw-r--r--arch/xtensa/include/asm/socket.h3
-rw-r--r--arch/xtensa/include/asm/swab.h2
-rw-r--r--arch/xtensa/kernel/irq.c2
1391 files changed, 74834 insertions, 34828 deletions
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h
index a1057c2d95e7..3641ec1452f4 100644
--- a/arch/alpha/include/asm/socket.h
+++ b/arch/alpha/include/asm/socket.h
@@ -62,6 +62,9 @@
62 62
63#define SO_MARK 36 63#define SO_MARK 36
64 64
65#define SO_TIMESTAMPING 37
66#define SCM_TIMESTAMPING SO_TIMESTAMPING
67
65/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 68/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
66 * have to define SOCK_NONBLOCK to a different value here. 69 * have to define SOCK_NONBLOCK to a different value here.
67 */ 70 */
diff --git a/arch/alpha/include/asm/statfs.h b/arch/alpha/include/asm/statfs.h
index de35cd438a10..ccd2e186bfd8 100644
--- a/arch/alpha/include/asm/statfs.h
+++ b/arch/alpha/include/asm/statfs.h
@@ -1,6 +1,8 @@
1#ifndef _ALPHA_STATFS_H 1#ifndef _ALPHA_STATFS_H
2#define _ALPHA_STATFS_H 2#define _ALPHA_STATFS_H
3 3
4#include <linux/types.h>
5
4/* Alpha is the only 64-bit platform with 32-bit statfs. And doesn't 6/* Alpha is the only 64-bit platform with 32-bit statfs. And doesn't
5 even seem to implement statfs64 */ 7 even seem to implement statfs64 */
6#define __statfs_word __u32 8#define __statfs_word __u32
diff --git a/arch/alpha/include/asm/swab.h b/arch/alpha/include/asm/swab.h
index 68e7089e02d5..4d682b16c7c4 100644
--- a/arch/alpha/include/asm/swab.h
+++ b/arch/alpha/include/asm/swab.h
@@ -1,7 +1,7 @@
1#ifndef _ALPHA_SWAB_H 1#ifndef _ALPHA_SWAB_H
2#define _ALPHA_SWAB_H 2#define _ALPHA_SWAB_H
3 3
4#include <asm/types.h> 4#include <linux/types.h>
5#include <linux/compiler.h> 5#include <linux/compiler.h>
6#include <asm/compiler.h> 6#include <asm/compiler.h>
7 7
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index e4a54b615894..b45d913a51c3 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -903,8 +903,9 @@ sys_alpha_pipe:
903 stq $26, 0($sp) 903 stq $26, 0($sp)
904 .prologue 0 904 .prologue 0
905 905
906 mov $31, $17
906 lda $16, 8($sp) 907 lda $16, 8($sp)
907 jsr $26, do_pipe 908 jsr $26, do_pipe_flags
908 909
909 ldq $26, 0($sp) 910 ldq $26, 0($sp)
910 bne $0, 1f 911 bne $0, 1f
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 703731accda6..cc7834661427 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -55,7 +55,7 @@ int irq_select_affinity(unsigned int irq)
55 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0); 55 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0);
56 last_cpu = cpu; 56 last_cpu = cpu;
57 57
58 irq_desc[irq].affinity = cpumask_of_cpu(cpu); 58 cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu));
59 irq_desc[irq].chip->set_affinity(irq, cpumask_of(cpu)); 59 irq_desc[irq].chip->set_affinity(irq, cpumask_of(cpu));
60 return 0; 60 return 0;
61} 61}
@@ -90,7 +90,7 @@ show_interrupts(struct seq_file *p, void *v)
90 seq_printf(p, "%10u ", kstat_irqs(irq)); 90 seq_printf(p, "%10u ", kstat_irqs(irq));
91#else 91#else
92 for_each_online_cpu(j) 92 for_each_online_cpu(j)
93 seq_printf(p, "%10u ", kstat_cpu(j).irqs[irq]); 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->typename);
96 seq_printf(p, " %c%s", 96 seq_printf(p, " %c%s",
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index e16aeb6e79ef..67c19f8a9944 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -64,7 +64,7 @@ do_entInt(unsigned long type, unsigned long vector,
64 smp_percpu_timer_interrupt(regs); 64 smp_percpu_timer_interrupt(regs);
65 cpu = smp_processor_id(); 65 cpu = smp_processor_id();
66 if (cpu != boot_cpuid) { 66 if (cpu != boot_cpuid) {
67 kstat_cpu(cpu).irqs[RTC_IRQ]++; 67 kstat_incr_irqs_this_cpu(RTC_IRQ, irq_to_desc(RTC_IRQ));
68 } else { 68 } else {
69 handle_irq(RTC_IRQ); 69 handle_irq(RTC_IRQ);
70 } 70 }
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index ae41f097864b..42ee05981e71 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -46,8 +46,6 @@
46#include <asm/hwrpb.h> 46#include <asm/hwrpb.h>
47#include <asm/processor.h> 47#include <asm/processor.h>
48 48
49extern int do_pipe(int *);
50
51/* 49/*
52 * Brk needs to return an error. Still support Linux's brk(0) query idiom, 50 * Brk needs to return an error. Still support Linux's brk(0) query idiom,
53 * which OSF programs just shouldn't be doing. We're still not quite 51 * which OSF programs just shouldn't be doing. We're still not quite
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 5d7a16eab312..af71d38c8e41 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -189,9 +189,21 @@ callback_init(void * kernel_end)
189 189
190 if (alpha_using_srm) { 190 if (alpha_using_srm) {
191 static struct vm_struct console_remap_vm; 191 static struct vm_struct console_remap_vm;
192 unsigned long vaddr = VMALLOC_START; 192 unsigned long nr_pages = 0;
193 unsigned long vaddr;
193 unsigned long i, j; 194 unsigned long i, j;
194 195
196 /* calculate needed size */
197 for (i = 0; i < crb->map_entries; ++i)
198 nr_pages += crb->map[i].count;
199
200 /* register the vm area */
201 console_remap_vm.flags = VM_ALLOC;
202 console_remap_vm.size = nr_pages << PAGE_SHIFT;
203 vm_area_register_early(&console_remap_vm, PAGE_SIZE);
204
205 vaddr = (unsigned long)console_remap_vm.addr;
206
195 /* Set up the third level PTEs and update the virtual 207 /* Set up the third level PTEs and update the virtual
196 addresses of the CRB entries. */ 208 addresses of the CRB entries. */
197 for (i = 0; i < crb->map_entries; ++i) { 209 for (i = 0; i < crb->map_entries; ++i) {
@@ -213,12 +225,6 @@ callback_init(void * kernel_end)
213 vaddr += PAGE_SIZE; 225 vaddr += PAGE_SIZE;
214 } 226 }
215 } 227 }
216
217 /* Let vmalloc know that we've allocated some space. */
218 console_remap_vm.flags = VM_ALLOC;
219 console_remap_vm.addr = (void *) VMALLOC_START;
220 console_remap_vm.size = vaddr - VMALLOC_START;
221 vmlist = &console_remap_vm;
222 } 228 }
223 229
224 callback_init_done = 1; 230 callback_init_done = 1;
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dbfdf87f993f..e02b893fb909 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -241,6 +241,7 @@ config ARCH_VERSATILE
241config ARCH_AT91 241config ARCH_AT91
242 bool "Atmel AT91" 242 bool "Atmel AT91"
243 select GENERIC_GPIO 243 select GENERIC_GPIO
244 select ARCH_REQUIRE_GPIOLIB
244 select HAVE_CLK 245 select HAVE_CLK
245 help 246 help
246 This enables support for systems based on the Atmel AT91RM9200, 247 This enables support for systems based on the Atmel AT91RM9200,
@@ -275,6 +276,14 @@ config ARCH_EP93XX
275 help 276 help
276 This enables support for the Cirrus EP93xx series of CPUs. 277 This enables support for the Cirrus EP93xx series of CPUs.
277 278
279config ARCH_GEMINI
280 bool "Cortina Systems Gemini"
281 select CPU_FA526
282 select GENERIC_GPIO
283 select ARCH_REQUIRE_GPIOLIB
284 help
285 Support for the Cortina Systems Gemini family SoCs
286
278config ARCH_FOOTBRIDGE 287config ARCH_FOOTBRIDGE
279 bool "FootBridge" 288 bool "FootBridge"
280 select CPU_SA110 289 select CPU_SA110
@@ -477,12 +486,29 @@ config ARCH_PXA
477 select HAVE_CLK 486 select HAVE_CLK
478 select COMMON_CLKDEV 487 select COMMON_CLKDEV
479 select ARCH_REQUIRE_GPIOLIB 488 select ARCH_REQUIRE_GPIOLIB
489 select HAVE_CLK
490 select COMMON_CLKDEV
480 select GENERIC_TIME 491 select GENERIC_TIME
481 select GENERIC_CLOCKEVENTS 492 select GENERIC_CLOCKEVENTS
482 select TICK_ONESHOT 493 select TICK_ONESHOT
494 select PLAT_PXA
483 help 495 help
484 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 496 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
485 497
498config ARCH_MMP
499 bool "Marvell PXA168/910"
500 depends on MMU
501 select GENERIC_GPIO
502 select ARCH_REQUIRE_GPIOLIB
503 select HAVE_CLK
504 select COMMON_CLKDEV
505 select GENERIC_TIME
506 select GENERIC_CLOCKEVENTS
507 select TICK_ONESHOT
508 select PLAT_PXA
509 help
510 Support for Marvell's PXA168/910 processor line.
511
486config ARCH_RPC 512config ARCH_RPC
487 bool "RiscPC" 513 bool "RiscPC"
488 select ARCH_ACORN 514 select ARCH_ACORN
@@ -598,6 +624,8 @@ source "arch/arm/mach-ep93xx/Kconfig"
598 624
599source "arch/arm/mach-footbridge/Kconfig" 625source "arch/arm/mach-footbridge/Kconfig"
600 626
627source "arch/arm/mach-gemini/Kconfig"
628
601source "arch/arm/mach-integrator/Kconfig" 629source "arch/arm/mach-integrator/Kconfig"
602 630
603source "arch/arm/mach-iop32x/Kconfig" 631source "arch/arm/mach-iop32x/Kconfig"
@@ -617,6 +645,9 @@ source "arch/arm/mach-loki/Kconfig"
617source "arch/arm/mach-mv78xx0/Kconfig" 645source "arch/arm/mach-mv78xx0/Kconfig"
618 646
619source "arch/arm/mach-pxa/Kconfig" 647source "arch/arm/mach-pxa/Kconfig"
648source "arch/arm/plat-pxa/Kconfig"
649
650source "arch/arm/mach-mmp/Kconfig"
620 651
621source "arch/arm/mach-sa1100/Kconfig" 652source "arch/arm/mach-sa1100/Kconfig"
622 653
@@ -686,12 +717,15 @@ config PLAT_IOP
686config PLAT_ORION 717config PLAT_ORION
687 bool 718 bool
688 719
720config PLAT_PXA
721 bool
722
689source arch/arm/mm/Kconfig 723source arch/arm/mm/Kconfig
690 724
691config IWMMXT 725config IWMMXT
692 bool "Enable iWMMXt support" 726 bool "Enable iWMMXt support"
693 depends on CPU_XSCALE || CPU_XSC3 727 depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK
694 default y if PXA27x || PXA3xx 728 default y if PXA27x || PXA3xx || ARCH_MMP
695 help 729 help
696 Enable support for iWMMXt context switching at run time if 730 Enable support for iWMMXt context switching at run time if
697 running on a CPU that supports it. 731 running on a CPU that supports it.
@@ -915,6 +949,23 @@ config NODES_SHIFT
915 default "2" 949 default "2"
916 depends on NEED_MULTIPLE_NODES 950 depends on NEED_MULTIPLE_NODES
917 951
952config HIGHMEM
953 bool "High Memory Support (EXPERIMENTAL)"
954 depends on MMU && EXPERIMENTAL
955 help
956 The address space of ARM processors is only 4 Gigabytes large
957 and it has to accommodate user address space, kernel address
958 space as well as some memory mapped IO. That means that, if you
959 have a large amount of physical memory and/or IO, not all of the
960 memory can be "permanently mapped" by the kernel. The physical
961 memory that is not permanently mapped is called "high memory".
962
963 Depending on the selected kernel/user memory split, minimum
964 vmalloc space and actual amount of RAM, you may not need this
965 option which should result in a slightly faster kernel.
966
967 If unsure, say n.
968
918source "mm/Kconfig" 969source "mm/Kconfig"
919 970
920config LEDS 971config LEDS
@@ -1092,7 +1143,7 @@ source "drivers/cpufreq/Kconfig"
1092 1143
1093config CPU_FREQ_SA1100 1144config CPU_FREQ_SA1100
1094 bool 1145 bool
1095 depends on CPU_FREQ && (SA1100_H3100 || SA1100_H3600 || SA1100_H3800 || SA1100_LART || SA1100_PLEB || SA1100_BADGE4 || SA1100_HACKKIT) 1146 depends on CPU_FREQ && (SA1100_H3100 || SA1100_H3600 || SA1100_LART || SA1100_PLEB || SA1100_BADGE4 || SA1100_HACKKIT)
1096 default y 1147 default y
1097 1148
1098config CPU_FREQ_SA1110 1149config CPU_FREQ_SA1110
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 192ee01a9ba2..a71fd941ade7 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -2,18 +2,29 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5# RMK wants arm kernels compiled with frame pointers so hardwire this to y. 5# RMK wants arm kernels compiled with frame pointers or stack unwinding.
6# If you know what you are doing and are willing to live without stack 6# If you know what you are doing and are willing to live without stack
7# traces, you can get a slightly smaller kernel by setting this option to 7# traces, you can get a slightly smaller kernel by setting this option to
8# n, but then RMK will have to kill you ;). 8# n, but then RMK will have to kill you ;).
9config FRAME_POINTER 9config FRAME_POINTER
10 bool 10 bool
11 default y 11 default y if !ARM_UNWIND
12 help 12 help
13 If you say N here, the resulting kernel will be slightly smaller and 13 If you say N here, the resulting kernel will be slightly smaller and
14 faster. However, when a problem occurs with the kernel, the 14 faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled,
15 information that is reported is severely limited. Most people 15 when a problem occurs with the kernel, the information that is
16 should say Y here. 16 reported is severely limited.
17
18config ARM_UNWIND
19 bool "Enable stack unwinding support"
20 depends on AEABI && EXPERIMENTAL
21 default y
22 help
23 This option enables stack unwinding support in the kernel
24 using the information automatically generated by the
25 compiler. The resulting kernel image is slightly bigger but
26 the performance is not affected. Currently, this feature
27 only works with EABI compilers. If unsure say Y.
17 28
18config DEBUG_USER 29config DEBUG_USER
19 bool "Verbose user fault messages" 30 bool "Verbose user fault messages"
@@ -66,7 +77,7 @@ config DEBUG_ICEDCC
66 Say Y here if you want the debug print routines to direct their 77 Say Y here if you want the debug print routines to direct their
67 output to the EmbeddedICE macrocell's DCC channel using 78 output to the EmbeddedICE macrocell's DCC channel using
68 co-processor 14. This is known to work on the ARM9 style ICE 79 co-processor 14. This is known to work on the ARM9 style ICE
69 channel. 80 channel and on the XScale with the PEEDI.
70 81
71 It does include a timeout to ensure that the system does not 82 It does include a timeout to ensure that the system does not
72 totally freeze when there is nothing connected to read. 83 totally freeze when there is nothing connected to read.
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 24e0f0187697..e84729bf13d4 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -72,6 +72,7 @@ tune-$(CONFIG_CPU_ARM920T) :=-mtune=arm9tdmi
72tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi 72tune-$(CONFIG_CPU_ARM922T) :=-mtune=arm9tdmi
73tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi 73tune-$(CONFIG_CPU_ARM925T) :=-mtune=arm9tdmi
74tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi 74tune-$(CONFIG_CPU_ARM926T) :=-mtune=arm9tdmi
75tune-$(CONFIG_CPU_FA526) :=-mtune=arm9tdmi
75tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 76tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110
76tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 77tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100
77tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale 78tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
@@ -85,6 +86,10 @@ else
85CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) 86CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
86endif 87endif
87 88
89ifeq ($(CONFIG_ARM_UNWIND),y)
90CFLAGS_ABI +=-funwind-tables
91endif
92
88# Need -Uarm for gcc < 3.x 93# Need -Uarm for gcc < 3.x
89KBUILD_CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm 94KBUILD_CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
90KBUILD_AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float 95KBUILD_AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
@@ -105,8 +110,11 @@ ifeq ($(CONFIG_ARCH_SA1100),y)
105 textofs-$(CONFIG_SA1111) := 0x00208000 110 textofs-$(CONFIG_SA1111) := 0x00208000
106endif 111endif
107 machine-$(CONFIG_ARCH_PXA) := pxa 112 machine-$(CONFIG_ARCH_PXA) := pxa
113 machine-$(CONFIG_ARCH_MMP) := mmp
114 plat-$(CONFIG_PLAT_PXA) := pxa
108 machine-$(CONFIG_ARCH_L7200) := l7200 115 machine-$(CONFIG_ARCH_L7200) := l7200
109 machine-$(CONFIG_ARCH_INTEGRATOR) := integrator 116 machine-$(CONFIG_ARCH_INTEGRATOR) := integrator
117 machine-$(CONFIG_ARCH_GEMINI) := gemini
110 textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000 118 textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000
111 machine-$(CONFIG_ARCH_CLPS711X) := clps711x 119 machine-$(CONFIG_ARCH_CLPS711X) := clps711x
112 machine-$(CONFIG_ARCH_IOP32X) := iop32x 120 machine-$(CONFIG_ARCH_IOP32X) := iop32x
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 77d614232d81..b371fba1b954 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -27,6 +27,12 @@
27 .macro writeb, ch, rb 27 .macro writeb, ch, rb
28 mcr p14, 0, \ch, c0, c5, 0 28 mcr p14, 0, \ch, c0, c5, 0
29 .endm 29 .endm
30#elif defined(CONFIG_CPU_XSCALE)
31 .macro loadsp, rb
32 .endm
33 .macro writeb, ch, rb
34 mcr p14, 0, \ch, c8, c0, 0
35 .endm
30#else 36#else
31 .macro loadsp, rb 37 .macro loadsp, rb
32 .endm 38 .endm
@@ -459,6 +465,20 @@ __armv7_mmu_cache_on:
459 mcr p15, 0, r0, c7, c5, 4 @ ISB 465 mcr p15, 0, r0, c7, c5, 4 @ ISB
460 mov pc, r12 466 mov pc, r12
461 467
468__fa526_cache_on:
469 mov r12, lr
470 bl __setup_mmu
471 mov r0, #0
472 mcr p15, 0, r0, c7, c7, 0 @ Invalidate whole cache
473 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
474 mcr p15, 0, r0, c8, c7, 0 @ flush UTLB
475 mrc p15, 0, r0, c1, c0, 0 @ read control reg
476 orr r0, r0, #0x1000 @ I-cache enable
477 bl __common_mmu_cache_on
478 mov r0, #0
479 mcr p15, 0, r0, c8, c7, 0 @ flush UTLB
480 mov pc, r12
481
462__arm6_mmu_cache_on: 482__arm6_mmu_cache_on:
463 mov r12, lr 483 mov r12, lr
464 bl __setup_mmu 484 bl __setup_mmu
@@ -630,12 +650,30 @@ proc_types:
630 b __armv4_mmu_cache_off 650 b __armv4_mmu_cache_off
631 b __armv4_mmu_cache_flush 651 b __armv4_mmu_cache_flush
632 652
653 .word 0x56158000 @ PXA168
654 .word 0xfffff000
655 b __armv4_mmu_cache_on
656 b __armv4_mmu_cache_off
657 b __armv5tej_mmu_cache_flush
658
659 .word 0x56056930
660 .word 0xff0ffff0 @ PXA935
661 b __armv4_mmu_cache_on
662 b __armv4_mmu_cache_off
663 b __armv4_mmu_cache_flush
664
633 .word 0x56050000 @ Feroceon 665 .word 0x56050000 @ Feroceon
634 .word 0xff0f0000 666 .word 0xff0f0000
635 b __armv4_mmu_cache_on 667 b __armv4_mmu_cache_on
636 b __armv4_mmu_cache_off 668 b __armv4_mmu_cache_off
637 b __armv5tej_mmu_cache_flush 669 b __armv5tej_mmu_cache_flush
638 670
671 .word 0x66015261 @ FA526
672 .word 0xff01fff1
673 b __fa526_cache_on
674 b __armv4_mmu_cache_off
675 b __fa526_cache_flush
676
639 @ These match on the architecture ID 677 @ These match on the architecture ID
640 678
641 .word 0x00020000 @ ARMv4T 679 .word 0x00020000 @ ARMv4T
@@ -775,6 +813,12 @@ __armv4_mpu_cache_flush:
775 mcr p15, 0, ip, c7, c10, 4 @ drain WB 813 mcr p15, 0, ip, c7, c10, 4 @ drain WB
776 mov pc, lr 814 mov pc, lr
777 815
816__fa526_cache_flush:
817 mov r1, #0
818 mcr p15, 0, r1, c7, c14, 0 @ clean and invalidate D cache
819 mcr p15, 0, r1, c7, c5, 0 @ flush I cache
820 mcr p15, 0, r1, c7, c10, 4 @ drain WB
821 mov pc, lr
778 822
779__armv6_mmu_cache_flush: 823__armv6_mmu_cache_flush:
780 mov r1, #0 824 mov r1, #0
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 3fc08413fff0..393c81641314 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -46,6 +46,21 @@ static void icedcc_putc(int ch)
46 46
47 asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch)); 47 asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch));
48} 48}
49#elif defined(CONFIG_CPU_XSCALE)
50
51static void icedcc_putc(int ch)
52{
53 int status, i = 0x4000000;
54
55 do {
56 if (--i < 0)
57 return;
58
59 asm volatile ("mrc p14, 0, %0, c14, c0, 0" : "=r" (status));
60 } while (status & (1 << 28));
61
62 asm("mcr p14, 0, %0, c8, c0, 0" : : "r" (ch));
63}
49 64
50#else 65#else
51 66
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index 153a07e7222b..a5924b9b88bd 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -11,6 +11,11 @@ OUTPUT_ARCH(arm)
11ENTRY(_start) 11ENTRY(_start)
12SECTIONS 12SECTIONS
13{ 13{
14 /DISCARD/ : {
15 *(.ARM.exidx*)
16 *(.ARM.extab*)
17 }
18
14 . = TEXT_START; 19 . = TEXT_START;
15 _text = .; 20 _text = .;
16 21
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c
index 1037bba18329..5589444ff437 100644
--- a/arch/arm/common/clkdev.c
+++ b/arch/arm/common/clkdev.c
@@ -62,9 +62,8 @@ static struct clk *clk_find(const char *dev_id, const char *con_id)
62 return clk; 62 return clk;
63} 63}
64 64
65struct clk *clk_get(struct device *dev, const char *con_id) 65struct clk *clk_get_sys(const char *dev_id, const char *con_id)
66{ 66{
67 const char *dev_id = dev ? dev_name(dev) : NULL;
68 struct clk *clk; 67 struct clk *clk;
69 68
70 mutex_lock(&clocks_mutex); 69 mutex_lock(&clocks_mutex);
@@ -75,6 +74,14 @@ struct clk *clk_get(struct device *dev, const char *con_id)
75 74
76 return clk ? clk : ERR_PTR(-ENOENT); 75 return clk ? clk : ERR_PTR(-ENOENT);
77} 76}
77EXPORT_SYMBOL(clk_get_sys);
78
79struct clk *clk_get(struct device *dev, const char *con_id)
80{
81 const char *dev_id = dev ? dev_name(dev) : NULL;
82
83 return clk_get_sys(dev_id, con_id);
84}
78EXPORT_SYMBOL(clk_get); 85EXPORT_SYMBOL(clk_get);
79 86
80void clk_put(struct clk *clk) 87void clk_put(struct clk *clk)
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index f030f0775be7..734ac9135998 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -25,6 +25,7 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/page-flags.h>
28#include <linux/device.h> 29#include <linux/device.h>
29#include <linux/dma-mapping.h> 30#include <linux/dma-mapping.h>
30#include <linux/dmapool.h> 31#include <linux/dmapool.h>
@@ -349,6 +350,12 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page,
349 350
350 BUG_ON(!valid_dma_direction(dir)); 351 BUG_ON(!valid_dma_direction(dir));
351 352
353 if (PageHighMem(page)) {
354 dev_err(dev, "DMA buffer bouncing of HIGHMEM pages "
355 "is not supported\n");
356 return ~0;
357 }
358
352 return map_single(dev, page_address(page) + offset, size, dir); 359 return map_single(dev, page_address(page) + offset, size, dir);
353} 360}
354EXPORT_SYMBOL(dma_map_page); 361EXPORT_SYMBOL(dma_map_page);
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 697c64913990..7713a08bb10c 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -124,37 +124,6 @@ static int scoop_gpio_direction_output(struct gpio_chip *chip,
124 return 0; 124 return 0;
125} 125}
126 126
127unsigned short set_scoop_gpio(struct device *dev, unsigned short bit)
128{
129 unsigned short gpio_bit;
130 unsigned long flag;
131 struct scoop_dev *sdev = dev_get_drvdata(dev);
132
133 spin_lock_irqsave(&sdev->scoop_lock, flag);
134 gpio_bit = ioread16(sdev->base + SCOOP_GPWR) | bit;
135 iowrite16(gpio_bit, sdev->base + SCOOP_GPWR);
136 spin_unlock_irqrestore(&sdev->scoop_lock, flag);
137
138 return gpio_bit;
139}
140
141unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit)
142{
143 unsigned short gpio_bit;
144 unsigned long flag;
145 struct scoop_dev *sdev = dev_get_drvdata(dev);
146
147 spin_lock_irqsave(&sdev->scoop_lock, flag);
148 gpio_bit = ioread16(sdev->base + SCOOP_GPWR) & ~bit;
149 iowrite16(gpio_bit, sdev->base + SCOOP_GPWR);
150 spin_unlock_irqrestore(&sdev->scoop_lock, flag);
151
152 return gpio_bit;
153}
154
155EXPORT_SYMBOL(set_scoop_gpio);
156EXPORT_SYMBOL(reset_scoop_gpio);
157
158unsigned short read_scoop_reg(struct device *dev, unsigned short reg) 127unsigned short read_scoop_reg(struct device *dev, unsigned short reg)
159{ 128{
160 struct scoop_dev *sdev = dev_get_drvdata(dev); 129 struct scoop_dev *sdev = dev_get_drvdata(dev);
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index 780bbf7cb26f..140f1d721d50 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -29,8 +29,8 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <mach/pm.h> 31#include <mach/pm.h>
32#include <mach/pxa-regs.h>
33#include <mach/pxa2xx-regs.h> 32#include <mach/pxa2xx-regs.h>
33#include <mach/regs-rtc.h>
34#include <mach/sharpsl.h> 34#include <mach/sharpsl.h>
35#include <asm/hardware/sharpsl_pm.h> 35#include <asm/hardware/sharpsl_pm.h>
36 36
diff --git a/arch/arm/configs/acs5k_defconfig b/arch/arm/configs/acs5k_defconfig
new file mode 100644
index 000000000000..1cab4e79d368
--- /dev/null
+++ b/arch/arm/configs/acs5k_defconfig
@@ -0,0 +1,1233 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.27-simtec-micrel1
4# Tue Dec 16 13:31:34 2008
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
30
31#
32# General setup
33#
34CONFIG_EXPERIMENTAL=y
35CONFIG_BROKEN_ON_SMP=y
36CONFIG_INIT_ENV_ARG_LIMIT=32
37CONFIG_LOCALVERSION=""
38CONFIG_LOCALVERSION_AUTO=y
39# CONFIG_SWAP is not set
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42CONFIG_POSIX_MQUEUE=y
43# CONFIG_BSD_PROCESS_ACCT is not set
44# CONFIG_TASKSTATS is not set
45# CONFIG_AUDIT is not set
46# CONFIG_IKCONFIG is not set
47CONFIG_LOG_BUF_SHIFT=14
48# CONFIG_CGROUPS is not set
49# CONFIG_GROUP_SCHED is not set
50CONFIG_SYSFS_DEPRECATED=y
51CONFIG_SYSFS_DEPRECATED_V2=y
52# CONFIG_RELAY is not set
53CONFIG_NAMESPACES=y
54# CONFIG_UTS_NS is not set
55# CONFIG_IPC_NS is not set
56# CONFIG_USER_NS is not set
57# CONFIG_PID_NS is not set
58CONFIG_BLK_DEV_INITRD=y
59CONFIG_INITRAMFS_SOURCE=""
60CONFIG_CC_OPTIMIZE_FOR_SIZE=y
61CONFIG_SYSCTL=y
62# CONFIG_EMBEDDED is not set
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_COMPAT_BRK=y
73CONFIG_BASE_FULL=y
74CONFIG_FUTEX=y
75CONFIG_ANON_INODES=y
76CONFIG_EPOLL=y
77CONFIG_SIGNALFD=y
78CONFIG_TIMERFD=y
79CONFIG_EVENTFD=y
80CONFIG_SHMEM=y
81CONFIG_VM_EVENT_COUNTERS=y
82CONFIG_SLAB=y
83# CONFIG_SLUB is not set
84# CONFIG_SLOB is not set
85# CONFIG_PROFILING is not set
86# CONFIG_MARKERS is not set
87CONFIG_HAVE_OPROFILE=y
88# CONFIG_KPROBES is not set
89# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
90# CONFIG_HAVE_IOREMAP_PROT is not set
91CONFIG_HAVE_KPROBES=y
92CONFIG_HAVE_KRETPROBES=y
93# CONFIG_HAVE_ARCH_TRACEHOOK is not set
94# CONFIG_HAVE_DMA_ATTRS is not set
95# CONFIG_USE_GENERIC_SMP_HELPERS is not set
96# CONFIG_HAVE_CLK is not set
97CONFIG_PROC_PAGE_MONITOR=y
98CONFIG_HAVE_GENERIC_DMA_COHERENT=y
99CONFIG_SLABINFO=y
100CONFIG_RT_MUTEXES=y
101# CONFIG_TINY_SHMEM is not set
102CONFIG_BASE_SMALL=0
103CONFIG_MODULES=y
104# CONFIG_MODULE_FORCE_LOAD is not set
105CONFIG_MODULE_UNLOAD=y
106# CONFIG_MODULE_FORCE_UNLOAD is not set
107# CONFIG_MODVERSIONS is not set
108# CONFIG_MODULE_SRCVERSION_ALL is not set
109CONFIG_KMOD=y
110CONFIG_BLOCK=y
111# CONFIG_LBD is not set
112# CONFIG_BLK_DEV_IO_TRACE is not set
113# CONFIG_LSF is not set
114# CONFIG_BLK_DEV_BSG is not set
115# CONFIG_BLK_DEV_INTEGRITY is not set
116
117#
118# IO Schedulers
119#
120CONFIG_IOSCHED_NOOP=y
121CONFIG_IOSCHED_AS=y
122# CONFIG_IOSCHED_DEADLINE is not set
123# CONFIG_IOSCHED_CFQ is not set
124CONFIG_DEFAULT_AS=y
125# CONFIG_DEFAULT_DEADLINE is not set
126# CONFIG_DEFAULT_CFQ is not set
127# CONFIG_DEFAULT_NOOP is not set
128CONFIG_DEFAULT_IOSCHED="anticipatory"
129CONFIG_CLASSIC_RCU=y
130
131#
132# System Type
133#
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_CLPS7500 is not set
140# CONFIG_ARCH_CLPS711X 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_NETX is not set
145# CONFIG_ARCH_H720X is not set
146# CONFIG_ARCH_IMX is not set
147# CONFIG_ARCH_IOP13XX is not set
148# CONFIG_ARCH_IOP32X is not set
149# CONFIG_ARCH_IOP33X is not set
150# CONFIG_ARCH_IXP23XX is not set
151# CONFIG_ARCH_IXP2000 is not set
152# CONFIG_ARCH_IXP4XX is not set
153# CONFIG_ARCH_L7200 is not set
154# CONFIG_ARCH_KIRKWOOD is not set
155CONFIG_ARCH_KS8695=y
156# CONFIG_ARCH_NS9XXX is not set
157# CONFIG_ARCH_LOKI is not set
158# CONFIG_ARCH_MV78XX0 is not set
159# CONFIG_ARCH_MXC is not set
160# CONFIG_ARCH_ORION5X is not set
161# CONFIG_ARCH_PNX4008 is not set
162# CONFIG_ARCH_PXA is not set
163# CONFIG_ARCH_RPC is not set
164# CONFIG_ARCH_SA1100 is not set
165# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_SHARK is not set
167# CONFIG_ARCH_LH7A40X is not set
168# CONFIG_ARCH_DAVINCI is not set
169# CONFIG_ARCH_OMAP is not set
170# CONFIG_ARCH_MSM7X00A is not set
171
172#
173# Boot options
174#
175
176#
177# Power management
178#
179
180#
181# Kendin/Micrel KS8695 Implementations
182#
183CONFIG_MACH_KS8695=y
184CONFIG_MACH_DSM320=y
185CONFIG_MACH_ACS5K=y
186
187#
188# Processor Type
189#
190CONFIG_CPU_32=y
191CONFIG_CPU_ARM922T=y
192CONFIG_CPU_32v4T=y
193CONFIG_CPU_ABRT_EV4T=y
194CONFIG_CPU_PABRT_NOIFAR=y
195CONFIG_CPU_CACHE_V4WT=y
196CONFIG_CPU_CACHE_VIVT=y
197CONFIG_CPU_COPY_V4WB=y
198CONFIG_CPU_TLB_V4WBI=y
199CONFIG_CPU_CP15=y
200CONFIG_CPU_CP15_MMU=y
201
202#
203# Processor Features
204#
205# CONFIG_ARM_THUMB is not set
206# CONFIG_CPU_ICACHE_DISABLE is not set
207# CONFIG_CPU_DCACHE_DISABLE is not set
208# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
209# CONFIG_OUTER_CACHE is not set
210
211#
212# Bus support
213#
214CONFIG_PCI=y
215CONFIG_PCI_SYSCALL=y
216# CONFIG_ARCH_SUPPORTS_MSI is not set
217CONFIG_PCI_LEGACY=y
218CONFIG_PCI_DEBUG=y
219CONFIG_PCCARD=y
220# CONFIG_PCMCIA_DEBUG is not set
221CONFIG_PCMCIA=y
222CONFIG_PCMCIA_LOAD_CIS=y
223CONFIG_PCMCIA_IOCTL=y
224CONFIG_CARDBUS=y
225
226#
227# PC-card bridges
228#
229CONFIG_YENTA=y
230CONFIG_YENTA_O2=y
231CONFIG_YENTA_RICOH=y
232CONFIG_YENTA_TI=y
233CONFIG_YENTA_ENE_TUNE=y
234CONFIG_YENTA_TOSHIBA=y
235# CONFIG_PD6729 is not set
236# CONFIG_I82092 is not set
237CONFIG_PCCARD_NONSTATIC=y
238
239#
240# Kernel Features
241#
242# CONFIG_TICK_ONESHOT is not set
243# CONFIG_PREEMPT is not set
244CONFIG_HZ=100
245CONFIG_AEABI=y
246CONFIG_OABI_COMPAT=y
247CONFIG_ARCH_FLATMEM_HAS_HOLES=y
248# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
249CONFIG_SELECT_MEMORY_MODEL=y
250CONFIG_FLATMEM_MANUAL=y
251# CONFIG_DISCONTIGMEM_MANUAL is not set
252# CONFIG_SPARSEMEM_MANUAL is not set
253CONFIG_FLATMEM=y
254CONFIG_FLAT_NODE_MEM_MAP=y
255# CONFIG_SPARSEMEM_STATIC is not set
256# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
257CONFIG_PAGEFLAGS_EXTENDED=y
258CONFIG_SPLIT_PTLOCK_CPUS=4096
259# CONFIG_RESOURCES_64BIT is not set
260CONFIG_ZONE_DMA_FLAG=1
261CONFIG_BOUNCE=y
262CONFIG_VIRT_TO_BUS=y
263# CONFIG_LEDS is not set
264CONFIG_ALIGNMENT_TRAP=y
265
266#
267# Boot options
268#
269CONFIG_ZBOOT_ROM_TEXT=0x0
270CONFIG_ZBOOT_ROM_BSS=0x0
271CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw"
272# CONFIG_XIP_KERNEL is not set
273# CONFIG_KEXEC is not set
274
275#
276# Floating point emulation
277#
278
279#
280# At least one emulation must be selected
281#
282# CONFIG_FPE_NWFPE is not set
283# CONFIG_FPE_FASTFPE is not set
284
285#
286# Userspace binary formats
287#
288CONFIG_BINFMT_ELF=y
289# CONFIG_BINFMT_AOUT is not set
290# CONFIG_BINFMT_MISC is not set
291
292#
293# Power management options
294#
295# CONFIG_PM is not set
296CONFIG_ARCH_SUSPEND_POSSIBLE=y
297CONFIG_NET=y
298
299#
300# Networking options
301#
302CONFIG_PACKET=y
303# CONFIG_PACKET_MMAP is not set
304CONFIG_UNIX=y
305CONFIG_XFRM=y
306# CONFIG_XFRM_USER is not set
307# CONFIG_XFRM_SUB_POLICY is not set
308# CONFIG_XFRM_MIGRATE is not set
309# CONFIG_XFRM_STATISTICS is not set
310# CONFIG_NET_KEY is not set
311CONFIG_INET=y
312# CONFIG_IP_MULTICAST is not set
313# CONFIG_IP_ADVANCED_ROUTER is not set
314CONFIG_IP_FIB_HASH=y
315CONFIG_IP_PNP=y
316CONFIG_IP_PNP_DHCP=y
317# CONFIG_IP_PNP_BOOTP is not set
318# CONFIG_IP_PNP_RARP is not set
319# CONFIG_NET_IPIP is not set
320# CONFIG_NET_IPGRE is not set
321# CONFIG_ARPD is not set
322# CONFIG_SYN_COOKIES is not set
323# CONFIG_INET_AH is not set
324# CONFIG_INET_ESP is not set
325# CONFIG_INET_IPCOMP is not set
326# CONFIG_INET_XFRM_TUNNEL is not set
327# CONFIG_INET_TUNNEL is not set
328CONFIG_INET_XFRM_MODE_TRANSPORT=y
329CONFIG_INET_XFRM_MODE_TUNNEL=y
330CONFIG_INET_XFRM_MODE_BEET=y
331# CONFIG_INET_LRO is not set
332CONFIG_INET_DIAG=y
333CONFIG_INET_TCP_DIAG=y
334# CONFIG_TCP_CONG_ADVANCED is not set
335CONFIG_TCP_CONG_CUBIC=y
336CONFIG_DEFAULT_TCP_CONG="cubic"
337# CONFIG_TCP_MD5SIG is not set
338# CONFIG_IPV6 is not set
339# CONFIG_NETWORK_SECMARK is not set
340# CONFIG_NETFILTER is not set
341# CONFIG_IP_DCCP is not set
342# CONFIG_IP_SCTP is not set
343# CONFIG_TIPC is not set
344# CONFIG_ATM is not set
345# CONFIG_BRIDGE is not set
346# CONFIG_VLAN_8021Q is not set
347# CONFIG_DECNET is not set
348# CONFIG_LLC2 is not set
349# CONFIG_IPX is not set
350# CONFIG_ATALK is not set
351# CONFIG_X25 is not set
352# CONFIG_LAPB is not set
353# CONFIG_ECONET is not set
354# CONFIG_WAN_ROUTER is not set
355# CONFIG_NET_SCHED is not set
356
357#
358# Network testing
359#
360# CONFIG_NET_PKTGEN is not set
361# CONFIG_HAMRADIO is not set
362# CONFIG_CAN is not set
363# CONFIG_IRDA is not set
364# CONFIG_BT is not set
365# CONFIG_AF_RXRPC is not set
366
367#
368# Wireless
369#
370# CONFIG_CFG80211 is not set
371CONFIG_WIRELESS_EXT=y
372CONFIG_WIRELESS_EXT_SYSFS=y
373# CONFIG_MAC80211 is not set
374# CONFIG_IEEE80211 is not set
375# CONFIG_RFKILL is not set
376# CONFIG_NET_9P is not set
377
378#
379# Device Drivers
380#
381
382#
383# Generic Driver Options
384#
385CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
386CONFIG_STANDALONE=y
387CONFIG_PREVENT_FIRMWARE_BUILD=y
388CONFIG_FW_LOADER=y
389CONFIG_FIRMWARE_IN_KERNEL=y
390CONFIG_EXTRA_FIRMWARE=""
391# CONFIG_DEBUG_DRIVER is not set
392# CONFIG_DEBUG_DEVRES is not set
393# CONFIG_SYS_HYPERVISOR is not set
394# CONFIG_CONNECTOR is not set
395CONFIG_MTD=y
396# CONFIG_MTD_DEBUG is not set
397CONFIG_MTD_CONCAT=y
398CONFIG_MTD_PARTITIONS=y
399# CONFIG_MTD_REDBOOT_PARTS is not set
400# CONFIG_MTD_CMDLINE_PARTS is not set
401# CONFIG_MTD_AFS_PARTS is not set
402# CONFIG_MTD_AR7_PARTS is not set
403
404#
405# User Modules And Translation Layers
406#
407CONFIG_MTD_CHAR=y
408CONFIG_MTD_BLKDEVS=y
409CONFIG_MTD_BLOCK=y
410# CONFIG_FTL is not set
411# CONFIG_NFTL is not set
412# CONFIG_INFTL is not set
413# CONFIG_RFD_FTL is not set
414# CONFIG_SSFDC is not set
415# CONFIG_MTD_OOPS is not set
416
417#
418# RAM/ROM/Flash chip drivers
419#
420CONFIG_MTD_CFI=y
421CONFIG_MTD_JEDECPROBE=y
422CONFIG_MTD_GEN_PROBE=y
423CONFIG_MTD_CFI_ADV_OPTIONS=y
424CONFIG_MTD_CFI_NOSWAP=y
425# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
426# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
427# CONFIG_MTD_CFI_GEOMETRY is not set
428CONFIG_MTD_MAP_BANK_WIDTH_1=y
429CONFIG_MTD_MAP_BANK_WIDTH_2=y
430CONFIG_MTD_MAP_BANK_WIDTH_4=y
431# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
432# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
433# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
434CONFIG_MTD_CFI_I1=y
435CONFIG_MTD_CFI_I2=y
436# CONFIG_MTD_CFI_I4 is not set
437# CONFIG_MTD_CFI_I8 is not set
438# CONFIG_MTD_OTP is not set
439CONFIG_MTD_CFI_INTELEXT=y
440CONFIG_MTD_CFI_AMDSTD=y
441# CONFIG_MTD_CFI_STAA is not set
442CONFIG_MTD_CFI_UTIL=y
443# CONFIG_MTD_RAM is not set
444# CONFIG_MTD_ROM is not set
445# CONFIG_MTD_ABSENT is not set
446
447#
448# Mapping drivers for chip access
449#
450# CONFIG_MTD_COMPLEX_MAPPINGS is not set
451CONFIG_MTD_PHYSMAP=y
452CONFIG_MTD_PHYSMAP_START=0x8000000
453CONFIG_MTD_PHYSMAP_LEN=0
454CONFIG_MTD_PHYSMAP_BANKWIDTH=4
455# CONFIG_MTD_ARM_INTEGRATOR is not set
456# CONFIG_MTD_IMPA7 is not set
457# CONFIG_MTD_INTEL_VR_NOR is not set
458# CONFIG_MTD_PLATRAM is not set
459
460#
461# Self-contained MTD device drivers
462#
463# CONFIG_MTD_PMC551 is not set
464# CONFIG_MTD_SLRAM is not set
465# CONFIG_MTD_PHRAM is not set
466# CONFIG_MTD_MTDRAM is not set
467# CONFIG_MTD_BLOCK2MTD is not set
468
469#
470# Disk-On-Chip Device Drivers
471#
472# CONFIG_MTD_DOC2000 is not set
473# CONFIG_MTD_DOC2001 is not set
474# CONFIG_MTD_DOC2001PLUS is not set
475# CONFIG_MTD_NAND is not set
476# CONFIG_MTD_ONENAND is not set
477
478#
479# UBI - Unsorted block images
480#
481# CONFIG_MTD_UBI is not set
482# CONFIG_PARPORT is not set
483CONFIG_BLK_DEV=y
484# CONFIG_BLK_CPQ_DA is not set
485# CONFIG_BLK_CPQ_CISS_DA is not set
486# CONFIG_BLK_DEV_DAC960 is not set
487# CONFIG_BLK_DEV_UMEM is not set
488# CONFIG_BLK_DEV_COW_COMMON is not set
489# CONFIG_BLK_DEV_LOOP is not set
490# CONFIG_BLK_DEV_NBD is not set
491# CONFIG_BLK_DEV_SX8 is not set
492CONFIG_BLK_DEV_RAM=y
493CONFIG_BLK_DEV_RAM_COUNT=16
494CONFIG_BLK_DEV_RAM_SIZE=8192
495# CONFIG_BLK_DEV_XIP is not set
496# CONFIG_CDROM_PKTCDVD is not set
497# CONFIG_ATA_OVER_ETH is not set
498CONFIG_MISC_DEVICES=y
499# CONFIG_PHANTOM is not set
500# CONFIG_EEPROM_93CX6 is not set
501# CONFIG_SGI_IOC4 is not set
502# CONFIG_TIFM_CORE is not set
503# CONFIG_ENCLOSURE_SERVICES is not set
504# CONFIG_HP_ILO is not set
505CONFIG_HAVE_IDE=y
506# CONFIG_IDE is not set
507
508#
509# SCSI device support
510#
511# CONFIG_RAID_ATTRS is not set
512# CONFIG_SCSI is not set
513# CONFIG_SCSI_DMA is not set
514# CONFIG_SCSI_NETLINK is not set
515# CONFIG_ATA is not set
516# CONFIG_MD is not set
517# CONFIG_FUSION is not set
518
519#
520# IEEE 1394 (FireWire) support
521#
522
523#
524# Enable only one of the two stacks, unless you know what you are doing
525#
526# CONFIG_FIREWIRE is not set
527# CONFIG_IEEE1394 is not set
528# CONFIG_I2O is not set
529CONFIG_NETDEVICES=y
530# CONFIG_DUMMY is not set
531# CONFIG_BONDING is not set
532# CONFIG_MACVLAN is not set
533# CONFIG_EQUALIZER is not set
534# CONFIG_TUN is not set
535# CONFIG_VETH is not set
536# CONFIG_ARCNET is not set
537# CONFIG_PHYLIB is not set
538CONFIG_NET_ETHERNET=y
539CONFIG_MII=y
540CONFIG_ARM_KS8695_ETHER=y
541# CONFIG_AX88796 is not set
542# CONFIG_HAPPYMEAL is not set
543# CONFIG_SUNGEM is not set
544# CONFIG_CASSINI is not set
545# CONFIG_NET_VENDOR_3COM is not set
546# CONFIG_SMC91X is not set
547# CONFIG_DM9000 is not set
548# CONFIG_NET_TULIP is not set
549# CONFIG_HP100 is not set
550# CONFIG_IBM_NEW_EMAC_ZMII is not set
551# CONFIG_IBM_NEW_EMAC_RGMII is not set
552# CONFIG_IBM_NEW_EMAC_TAH is not set
553# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
554# CONFIG_NET_PCI is not set
555# CONFIG_B44 is not set
556# CONFIG_NETDEV_1000 is not set
557# CONFIG_NETDEV_10000 is not set
558# CONFIG_TR is not set
559
560#
561# Wireless LAN
562#
563# CONFIG_WLAN_PRE80211 is not set
564CONFIG_WLAN_80211=y
565# CONFIG_PCMCIA_RAYCS is not set
566# CONFIG_IPW2100 is not set
567# CONFIG_IPW2200 is not set
568# CONFIG_LIBERTAS is not set
569# CONFIG_HERMES is not set
570# CONFIG_ATMEL is not set
571# CONFIG_AIRO_CS is not set
572# CONFIG_PCMCIA_WL3501 is not set
573CONFIG_PRISM54=m
574# CONFIG_IWLWIFI_LEDS is not set
575# CONFIG_HOSTAP is not set
576# CONFIG_NET_PCMCIA is not set
577# CONFIG_WAN is not set
578# CONFIG_FDDI is not set
579# CONFIG_HIPPI is not set
580# CONFIG_PPP is not set
581# CONFIG_SLIP is not set
582# CONFIG_NETCONSOLE is not set
583# CONFIG_NETPOLL is not set
584# CONFIG_NET_POLL_CONTROLLER is not set
585# CONFIG_ISDN is not set
586
587#
588# Input device support
589#
590CONFIG_INPUT=y
591# CONFIG_INPUT_FF_MEMLESS is not set
592# CONFIG_INPUT_POLLDEV is not set
593
594#
595# Userland interfaces
596#
597CONFIG_INPUT_MOUSEDEV=y
598# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
599CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
600CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
601# CONFIG_INPUT_JOYDEV is not set
602# CONFIG_INPUT_EVDEV is not set
603# CONFIG_INPUT_EVBUG is not set
604
605#
606# Input Device Drivers
607#
608# CONFIG_INPUT_KEYBOARD is not set
609# CONFIG_INPUT_MOUSE is not set
610# CONFIG_INPUT_JOYSTICK is not set
611# CONFIG_INPUT_TABLET is not set
612# CONFIG_INPUT_TOUCHSCREEN is not set
613# CONFIG_INPUT_MISC is not set
614
615#
616# Hardware I/O ports
617#
618# CONFIG_SERIO is not set
619# CONFIG_GAMEPORT is not set
620
621#
622# Character devices
623#
624CONFIG_VT=y
625CONFIG_CONSOLE_TRANSLATIONS=y
626CONFIG_VT_CONSOLE=y
627CONFIG_HW_CONSOLE=y
628# CONFIG_VT_HW_CONSOLE_BINDING is not set
629CONFIG_DEVKMEM=y
630# CONFIG_SERIAL_NONSTANDARD is not set
631# CONFIG_NOZOMI is not set
632
633#
634# Serial drivers
635#
636# CONFIG_SERIAL_8250 is not set
637
638#
639# Non-8250 serial port support
640#
641CONFIG_SERIAL_KS8695=y
642CONFIG_SERIAL_KS8695_CONSOLE=y
643CONFIG_SERIAL_CORE=y
644CONFIG_SERIAL_CORE_CONSOLE=y
645# CONFIG_SERIAL_JSM is not set
646CONFIG_UNIX98_PTYS=y
647CONFIG_LEGACY_PTYS=y
648CONFIG_LEGACY_PTY_COUNT=256
649# CONFIG_IPMI_HANDLER is not set
650CONFIG_HW_RANDOM=m
651# CONFIG_NVRAM is not set
652# CONFIG_R3964 is not set
653# CONFIG_APPLICOM is not set
654
655#
656# PCMCIA character devices
657#
658# CONFIG_SYNCLINK_CS is not set
659# CONFIG_CARDMAN_4000 is not set
660# CONFIG_CARDMAN_4040 is not set
661# CONFIG_IPWIRELESS is not set
662# CONFIG_RAW_DRIVER is not set
663# CONFIG_TCG_TPM is not set
664CONFIG_DEVPORT=y
665CONFIG_ACS5KCAN=y
666CONFIG_I2C=y
667CONFIG_I2C_BOARDINFO=y
668CONFIG_I2C_CHARDEV=y
669CONFIG_I2C_HELPER_AUTO=y
670CONFIG_I2C_ALGOBIT=y
671
672#
673# I2C Hardware Bus support
674#
675
676#
677# PC SMBus host controller drivers
678#
679# CONFIG_I2C_ALI1535 is not set
680# CONFIG_I2C_ALI1563 is not set
681# CONFIG_I2C_ALI15X3 is not set
682# CONFIG_I2C_AMD756 is not set
683# CONFIG_I2C_AMD8111 is not set
684# CONFIG_I2C_I801 is not set
685# CONFIG_I2C_ISCH is not set
686# CONFIG_I2C_PIIX4 is not set
687# CONFIG_I2C_NFORCE2 is not set
688# CONFIG_I2C_SIS5595 is not set
689# CONFIG_I2C_SIS630 is not set
690# CONFIG_I2C_SIS96X is not set
691# CONFIG_I2C_VIA is not set
692# CONFIG_I2C_VIAPRO is not set
693
694#
695# I2C system bus drivers (mostly embedded / system-on-chip)
696#
697CONFIG_I2C_GPIO=y
698# CONFIG_I2C_OCORES is not set
699# CONFIG_I2C_SIMTEC is not set
700
701#
702# External I2C/SMBus adapter drivers
703#
704# CONFIG_I2C_PARPORT_LIGHT is not set
705# CONFIG_I2C_TAOS_EVM is not set
706
707#
708# Graphics adapter I2C/DDC channel drivers
709#
710# CONFIG_I2C_VOODOO3 is not set
711
712#
713# Other I2C/SMBus bus drivers
714#
715# CONFIG_I2C_PCA_PLATFORM is not set
716# CONFIG_I2C_STUB is not set
717
718#
719# Miscellaneous I2C Chip support
720#
721# CONFIG_DS1682 is not set
722# CONFIG_AT24 is not set
723# CONFIG_SENSORS_EEPROM is not set
724# CONFIG_SENSORS_PCF8574 is not set
725# CONFIG_PCF8575 is not set
726# CONFIG_SENSORS_PCF8591 is not set
727# CONFIG_TPS65010 is not set
728# CONFIG_SENSORS_MAX6875 is not set
729# CONFIG_SENSORS_TSL2550 is not set
730# CONFIG_I2C_DEBUG_CORE is not set
731# CONFIG_I2C_DEBUG_ALGO is not set
732# CONFIG_I2C_DEBUG_BUS is not set
733# CONFIG_I2C_DEBUG_CHIP is not set
734# CONFIG_SPI is not set
735CONFIG_ARCH_REQUIRE_GPIOLIB=y
736CONFIG_GPIOLIB=y
737# CONFIG_DEBUG_GPIO is not set
738CONFIG_GPIO_SYSFS=y
739
740#
741# I2C GPIO expanders:
742#
743# CONFIG_GPIO_MAX732X is not set
744CONFIG_GPIO_PCA953X=y
745# CONFIG_GPIO_PCF857X is not set
746
747#
748# PCI GPIO expanders:
749#
750# CONFIG_GPIO_BT8XX is not set
751
752#
753# SPI GPIO expanders:
754#
755# CONFIG_W1 is not set
756# CONFIG_POWER_SUPPLY is not set
757CONFIG_HWMON=y
758# CONFIG_HWMON_VID is not set
759# CONFIG_SENSORS_AD7414 is not set
760# CONFIG_SENSORS_AD7418 is not set
761# CONFIG_SENSORS_ADM1021 is not set
762# CONFIG_SENSORS_ADM1025 is not set
763# CONFIG_SENSORS_ADM1026 is not set
764# CONFIG_SENSORS_ADM1029 is not set
765# CONFIG_SENSORS_ADM1031 is not set
766# CONFIG_SENSORS_ADM9240 is not set
767# CONFIG_SENSORS_ADT7470 is not set
768# CONFIG_SENSORS_ADT7473 is not set
769# CONFIG_SENSORS_ATXP1 is not set
770# CONFIG_SENSORS_DS1621 is not set
771# CONFIG_SENSORS_I5K_AMB is not set
772# CONFIG_SENSORS_F71805F is not set
773# CONFIG_SENSORS_F71882FG is not set
774# CONFIG_SENSORS_F75375S is not set
775# CONFIG_SENSORS_GL518SM is not set
776# CONFIG_SENSORS_GL520SM is not set
777# CONFIG_SENSORS_IT87 is not set
778# CONFIG_SENSORS_LM63 is not set
779# CONFIG_SENSORS_LM75 is not set
780# CONFIG_SENSORS_LM77 is not set
781# CONFIG_SENSORS_LM78 is not set
782# CONFIG_SENSORS_LM80 is not set
783# CONFIG_SENSORS_LM83 is not set
784# CONFIG_SENSORS_LM85 is not set
785# CONFIG_SENSORS_LM87 is not set
786# CONFIG_SENSORS_LM90 is not set
787# CONFIG_SENSORS_LM92 is not set
788# CONFIG_SENSORS_LM93 is not set
789# CONFIG_SENSORS_MAX1619 is not set
790# CONFIG_SENSORS_MAX6650 is not set
791# CONFIG_SENSORS_PC87360 is not set
792# CONFIG_SENSORS_PC87427 is not set
793# CONFIG_SENSORS_SIS5595 is not set
794# CONFIG_SENSORS_DME1737 is not set
795# CONFIG_SENSORS_SMSC47M1 is not set
796# CONFIG_SENSORS_SMSC47M192 is not set
797# CONFIG_SENSORS_SMSC47B397 is not set
798# CONFIG_SENSORS_ADS7828 is not set
799# CONFIG_SENSORS_THMC50 is not set
800# CONFIG_SENSORS_VIA686A is not set
801# CONFIG_SENSORS_VT1211 is not set
802# CONFIG_SENSORS_VT8231 is not set
803# CONFIG_SENSORS_W83781D is not set
804# CONFIG_SENSORS_W83791D is not set
805# CONFIG_SENSORS_W83792D is not set
806# CONFIG_SENSORS_W83793 is not set
807# CONFIG_SENSORS_W83L785TS is not set
808# CONFIG_SENSORS_W83L786NG is not set
809# CONFIG_SENSORS_W83627HF is not set
810# CONFIG_SENSORS_W83627EHF is not set
811# CONFIG_HWMON_DEBUG_CHIP is not set
812CONFIG_WATCHDOG=y
813# CONFIG_WATCHDOG_NOWAYOUT is not set
814
815#
816# Watchdog Device Drivers
817#
818# CONFIG_SOFT_WATCHDOG is not set
819CONFIG_KS8695_WATCHDOG=y
820# CONFIG_ALIM7101_WDT is not set
821
822#
823# PCI-based Watchdog Cards
824#
825# CONFIG_PCIPCWATCHDOG is not set
826# CONFIG_WDTPCI is not set
827
828#
829# Sonics Silicon Backplane
830#
831CONFIG_SSB_POSSIBLE=y
832# CONFIG_SSB is not set
833
834#
835# Multifunction device drivers
836#
837# CONFIG_MFD_CORE is not set
838# CONFIG_MFD_SM501 is not set
839# CONFIG_MFD_ASIC3 is not set
840# CONFIG_HTC_EGPIO is not set
841# CONFIG_HTC_PASIC3 is not set
842# CONFIG_MFD_TMIO is not set
843# CONFIG_MFD_T7L66XB is not set
844# CONFIG_MFD_TC6387XB is not set
845# CONFIG_MFD_TC6393XB is not set
846
847#
848# Multimedia devices
849#
850
851#
852# Multimedia core support
853#
854# CONFIG_VIDEO_DEV is not set
855# CONFIG_DVB_CORE is not set
856# CONFIG_VIDEO_MEDIA is not set
857
858#
859# Multimedia drivers
860#
861# CONFIG_DAB is not set
862
863#
864# Graphics support
865#
866# CONFIG_DRM is not set
867# CONFIG_VGASTATE is not set
868# CONFIG_VIDEO_OUTPUT_CONTROL is not set
869# CONFIG_FB is not set
870# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
871
872#
873# Display device support
874#
875# CONFIG_DISPLAY_SUPPORT is not set
876
877#
878# Console display driver support
879#
880# CONFIG_VGA_CONSOLE is not set
881CONFIG_DUMMY_CONSOLE=y
882# CONFIG_SOUND is not set
883CONFIG_HID_SUPPORT=y
884CONFIG_HID=y
885CONFIG_HID_DEBUG=y
886# CONFIG_HIDRAW is not set
887CONFIG_USB_SUPPORT=y
888CONFIG_USB_ARCH_HAS_HCD=y
889CONFIG_USB_ARCH_HAS_OHCI=y
890CONFIG_USB_ARCH_HAS_EHCI=y
891# CONFIG_USB is not set
892
893#
894# Enable Host or Gadget support to see Inventra options
895#
896
897#
898# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
899#
900# CONFIG_USB_GADGET is not set
901# CONFIG_MMC is not set
902# CONFIG_NEW_LEDS is not set
903CONFIG_RTC_LIB=y
904CONFIG_RTC_CLASS=y
905CONFIG_RTC_HCTOSYS=y
906CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
907# CONFIG_RTC_DEBUG is not set
908
909#
910# RTC interfaces
911#
912CONFIG_RTC_INTF_SYSFS=y
913CONFIG_RTC_INTF_PROC=y
914CONFIG_RTC_INTF_DEV=y
915# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
916# CONFIG_RTC_DRV_TEST is not set
917
918#
919# I2C RTC drivers
920#
921# CONFIG_RTC_DRV_DS1307 is not set
922# CONFIG_RTC_DRV_DS1374 is not set
923# CONFIG_RTC_DRV_DS1672 is not set
924# CONFIG_RTC_DRV_MAX6900 is not set
925# CONFIG_RTC_DRV_RS5C372 is not set
926# CONFIG_RTC_DRV_ISL1208 is not set
927# CONFIG_RTC_DRV_X1205 is not set
928CONFIG_RTC_DRV_PCF8563=y
929# CONFIG_RTC_DRV_PCF8583 is not set
930# CONFIG_RTC_DRV_M41T80 is not set
931# CONFIG_RTC_DRV_S35390A is not set
932# CONFIG_RTC_DRV_FM3130 is not set
933
934#
935# SPI RTC drivers
936#
937
938#
939# Platform RTC drivers
940#
941# CONFIG_RTC_DRV_CMOS is not set
942# CONFIG_RTC_DRV_DS1511 is not set
943# CONFIG_RTC_DRV_DS1553 is not set
944# CONFIG_RTC_DRV_DS1742 is not set
945# CONFIG_RTC_DRV_STK17TA8 is not set
946# CONFIG_RTC_DRV_M48T86 is not set
947# CONFIG_RTC_DRV_M48T59 is not set
948# CONFIG_RTC_DRV_V3020 is not set
949
950#
951# on-CPU RTC drivers
952#
953# CONFIG_DMADEVICES is not set
954
955#
956# Voltage and Current regulators
957#
958# CONFIG_REGULATOR is not set
959# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
960# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
961# CONFIG_REGULATOR_BQ24022 is not set
962# CONFIG_UIO is not set
963
964#
965# File systems
966#
967CONFIG_EXT2_FS=y
968# CONFIG_EXT2_FS_XATTR is not set
969# CONFIG_EXT2_FS_XIP is not set
970# CONFIG_EXT3_FS is not set
971# CONFIG_EXT4DEV_FS is not set
972# CONFIG_REISERFS_FS is not set
973# CONFIG_JFS_FS is not set
974# CONFIG_FS_POSIX_ACL is not set
975# CONFIG_XFS_FS is not set
976# CONFIG_OCFS2_FS is not set
977CONFIG_DNOTIFY=y
978CONFIG_INOTIFY=y
979CONFIG_INOTIFY_USER=y
980# CONFIG_QUOTA is not set
981# CONFIG_AUTOFS_FS is not set
982# CONFIG_AUTOFS4_FS is not set
983# CONFIG_FUSE_FS is not set
984
985#
986# CD-ROM/DVD Filesystems
987#
988# CONFIG_ISO9660_FS is not set
989# CONFIG_UDF_FS is not set
990
991#
992# DOS/FAT/NT Filesystems
993#
994# CONFIG_MSDOS_FS is not set
995# CONFIG_VFAT_FS is not set
996# CONFIG_NTFS_FS is not set
997
998#
999# Pseudo filesystems
1000#
1001CONFIG_PROC_FS=y
1002CONFIG_PROC_SYSCTL=y
1003CONFIG_SYSFS=y
1004CONFIG_TMPFS=y
1005# CONFIG_TMPFS_POSIX_ACL is not set
1006# CONFIG_HUGETLB_PAGE is not set
1007# CONFIG_CONFIGFS_FS is not set
1008
1009#
1010# Miscellaneous filesystems
1011#
1012# CONFIG_ADFS_FS is not set
1013# CONFIG_AFFS_FS is not set
1014# CONFIG_HFS_FS is not set
1015# CONFIG_HFSPLUS_FS is not set
1016# CONFIG_BEFS_FS is not set
1017# CONFIG_BFS_FS is not set
1018# CONFIG_EFS_FS is not set
1019CONFIG_JFFS2_FS=y
1020CONFIG_JFFS2_FS_DEBUG=0
1021CONFIG_JFFS2_FS_WRITEBUFFER=y
1022# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1023CONFIG_JFFS2_SUMMARY=y
1024# CONFIG_JFFS2_FS_XATTR is not set
1025CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1026CONFIG_JFFS2_ZLIB=y
1027# CONFIG_JFFS2_LZO is not set
1028CONFIG_JFFS2_RTIME=y
1029CONFIG_JFFS2_RUBIN=y
1030# CONFIG_JFFS2_CMODE_NONE is not set
1031CONFIG_JFFS2_CMODE_PRIORITY=y
1032# CONFIG_JFFS2_CMODE_SIZE is not set
1033# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1034CONFIG_CRAMFS=y
1035# CONFIG_VXFS_FS is not set
1036# CONFIG_MINIX_FS is not set
1037# CONFIG_OMFS_FS is not set
1038# CONFIG_HPFS_FS is not set
1039# CONFIG_QNX4FS_FS is not set
1040# CONFIG_ROMFS_FS is not set
1041# CONFIG_SYSV_FS is not set
1042# CONFIG_UFS_FS is not set
1043CONFIG_NETWORK_FILESYSTEMS=y
1044CONFIG_NFS_FS=y
1045CONFIG_NFS_V3=y
1046# CONFIG_NFS_V3_ACL is not set
1047# CONFIG_NFS_V4 is not set
1048CONFIG_ROOT_NFS=y
1049# CONFIG_NFSD is not set
1050CONFIG_LOCKD=y
1051CONFIG_LOCKD_V4=y
1052CONFIG_NFS_COMMON=y
1053CONFIG_SUNRPC=y
1054# CONFIG_RPCSEC_GSS_KRB5 is not set
1055# CONFIG_RPCSEC_GSS_SPKM3 is not set
1056# CONFIG_SMB_FS is not set
1057# CONFIG_CIFS is not set
1058# CONFIG_NCP_FS is not set
1059# CONFIG_CODA_FS is not set
1060# CONFIG_AFS_FS is not set
1061
1062#
1063# Partition Types
1064#
1065# CONFIG_PARTITION_ADVANCED is not set
1066CONFIG_MSDOS_PARTITION=y
1067# CONFIG_NLS is not set
1068# CONFIG_DLM is not set
1069
1070#
1071# Kernel hacking
1072#
1073# CONFIG_PRINTK_TIME is not set
1074CONFIG_ENABLE_WARN_DEPRECATED=y
1075CONFIG_ENABLE_MUST_CHECK=y
1076CONFIG_FRAME_WARN=1024
1077# CONFIG_MAGIC_SYSRQ is not set
1078# CONFIG_UNUSED_SYMBOLS is not set
1079# CONFIG_DEBUG_FS is not set
1080# CONFIG_HEADERS_CHECK is not set
1081CONFIG_DEBUG_KERNEL=y
1082# CONFIG_DEBUG_SHIRQ is not set
1083CONFIG_DETECT_SOFTLOCKUP=y
1084# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1085CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1086CONFIG_SCHED_DEBUG=y
1087# CONFIG_SCHEDSTATS is not set
1088# CONFIG_TIMER_STATS is not set
1089# CONFIG_DEBUG_OBJECTS is not set
1090# CONFIG_DEBUG_SLAB is not set
1091# CONFIG_DEBUG_RT_MUTEXES is not set
1092# CONFIG_RT_MUTEX_TESTER is not set
1093# CONFIG_DEBUG_SPINLOCK is not set
1094CONFIG_DEBUG_MUTEXES=y
1095# CONFIG_DEBUG_LOCK_ALLOC is not set
1096# CONFIG_PROVE_LOCKING is not set
1097# CONFIG_LOCK_STAT is not set
1098# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1099# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1100# CONFIG_DEBUG_KOBJECT is not set
1101CONFIG_DEBUG_BUGVERBOSE=y
1102# CONFIG_DEBUG_INFO is not set
1103# CONFIG_DEBUG_VM is not set
1104# CONFIG_DEBUG_WRITECOUNT is not set
1105CONFIG_DEBUG_MEMORY_INIT=y
1106# CONFIG_DEBUG_LIST is not set
1107# CONFIG_DEBUG_SG is not set
1108CONFIG_FRAME_POINTER=y
1109# CONFIG_BOOT_PRINTK_DELAY is not set
1110# CONFIG_RCU_TORTURE_TEST is not set
1111# CONFIG_BACKTRACE_SELF_TEST is not set
1112# CONFIG_FAULT_INJECTION is not set
1113# CONFIG_LATENCYTOP is not set
1114# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1115CONFIG_HAVE_FTRACE=y
1116CONFIG_HAVE_DYNAMIC_FTRACE=y
1117# CONFIG_FTRACE is not set
1118# CONFIG_SCHED_TRACER is not set
1119# CONFIG_CONTEXT_SWITCH_TRACER is not set
1120# CONFIG_SAMPLES is not set
1121CONFIG_HAVE_ARCH_KGDB=y
1122# CONFIG_KGDB is not set
1123CONFIG_DEBUG_USER=y
1124# CONFIG_DEBUG_ERRORS is not set
1125# CONFIG_DEBUG_STACK_USAGE is not set
1126CONFIG_DEBUG_LL=y
1127# CONFIG_DEBUG_ICEDCC is not set
1128
1129#
1130# Security options
1131#
1132# CONFIG_KEYS is not set
1133# CONFIG_SECURITY is not set
1134# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1135CONFIG_CRYPTO=y
1136
1137#
1138# Crypto core or helper
1139#
1140# CONFIG_CRYPTO_MANAGER is not set
1141# CONFIG_CRYPTO_GF128MUL is not set
1142# CONFIG_CRYPTO_NULL is not set
1143# CONFIG_CRYPTO_CRYPTD is not set
1144# CONFIG_CRYPTO_AUTHENC is not set
1145# CONFIG_CRYPTO_TEST is not set
1146
1147#
1148# Authenticated Encryption with Associated Data
1149#
1150# CONFIG_CRYPTO_CCM is not set
1151# CONFIG_CRYPTO_GCM is not set
1152# CONFIG_CRYPTO_SEQIV is not set
1153
1154#
1155# Block modes
1156#
1157# CONFIG_CRYPTO_CBC is not set
1158# CONFIG_CRYPTO_CTR is not set
1159# CONFIG_CRYPTO_CTS is not set
1160# CONFIG_CRYPTO_ECB is not set
1161# CONFIG_CRYPTO_LRW is not set
1162# CONFIG_CRYPTO_PCBC is not set
1163# CONFIG_CRYPTO_XTS is not set
1164
1165#
1166# Hash modes
1167#
1168# CONFIG_CRYPTO_HMAC is not set
1169# CONFIG_CRYPTO_XCBC is not set
1170
1171#
1172# Digest
1173#
1174# CONFIG_CRYPTO_CRC32C is not set
1175# CONFIG_CRYPTO_MD4 is not set
1176# CONFIG_CRYPTO_MD5 is not set
1177# CONFIG_CRYPTO_MICHAEL_MIC is not set
1178# CONFIG_CRYPTO_RMD128 is not set
1179# CONFIG_CRYPTO_RMD160 is not set
1180# CONFIG_CRYPTO_RMD256 is not set
1181# CONFIG_CRYPTO_RMD320 is not set
1182# CONFIG_CRYPTO_SHA1 is not set
1183# CONFIG_CRYPTO_SHA256 is not set
1184# CONFIG_CRYPTO_SHA512 is not set
1185# CONFIG_CRYPTO_TGR192 is not set
1186# CONFIG_CRYPTO_WP512 is not set
1187
1188#
1189# Ciphers
1190#
1191# CONFIG_CRYPTO_AES is not set
1192# CONFIG_CRYPTO_ANUBIS is not set
1193# CONFIG_CRYPTO_ARC4 is not set
1194# CONFIG_CRYPTO_BLOWFISH is not set
1195# CONFIG_CRYPTO_CAMELLIA is not set
1196# CONFIG_CRYPTO_CAST5 is not set
1197# CONFIG_CRYPTO_CAST6 is not set
1198# CONFIG_CRYPTO_DES is not set
1199# CONFIG_CRYPTO_FCRYPT is not set
1200# CONFIG_CRYPTO_KHAZAD is not set
1201# CONFIG_CRYPTO_SALSA20 is not set
1202# CONFIG_CRYPTO_SEED is not set
1203# CONFIG_CRYPTO_SERPENT is not set
1204# CONFIG_CRYPTO_TEA is not set
1205# CONFIG_CRYPTO_TWOFISH is not set
1206
1207#
1208# Compression
1209#
1210# CONFIG_CRYPTO_DEFLATE is not set
1211# CONFIG_CRYPTO_LZO is not set
1212CONFIG_CRYPTO_HW=y
1213# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1214
1215#
1216# Library routines
1217#
1218CONFIG_BITREVERSE=y
1219# CONFIG_GENERIC_FIND_FIRST_BIT is not set
1220# CONFIG_GENERIC_FIND_NEXT_BIT is not set
1221# CONFIG_CRC_CCITT is not set
1222# CONFIG_CRC16 is not set
1223# CONFIG_CRC_T10DIF is not set
1224# CONFIG_CRC_ITU_T is not set
1225CONFIG_CRC32=y
1226# CONFIG_CRC7 is not set
1227# CONFIG_LIBCRC32C is not set
1228CONFIG_ZLIB_INFLATE=y
1229CONFIG_ZLIB_DEFLATE=y
1230CONFIG_PLIST=y
1231CONFIG_HAS_IOMEM=y
1232CONFIG_HAS_IOPORT=y
1233CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/acs5k_tiny_defconfig b/arch/arm/configs/acs5k_tiny_defconfig
new file mode 100644
index 000000000000..8e3d084afd78
--- /dev/null
+++ b/arch/arm/configs/acs5k_tiny_defconfig
@@ -0,0 +1,941 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.27-simtec-micrel1
4# Tue Jan 6 13:23:07 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
28CONFIG_VECTORS_BASE=0xffff0000
29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
30
31#
32# General setup
33#
34CONFIG_EXPERIMENTAL=y
35CONFIG_BROKEN_ON_SMP=y
36CONFIG_INIT_ENV_ARG_LIMIT=32
37CONFIG_LOCALVERSION=""
38CONFIG_LOCALVERSION_AUTO=y
39# CONFIG_SWAP is not set
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42CONFIG_POSIX_MQUEUE=y
43# CONFIG_BSD_PROCESS_ACCT is not set
44# CONFIG_TASKSTATS is not set
45# CONFIG_AUDIT is not set
46# CONFIG_IKCONFIG is not set
47CONFIG_LOG_BUF_SHIFT=14
48# CONFIG_CGROUPS is not set
49# CONFIG_GROUP_SCHED is not set
50CONFIG_SYSFS_DEPRECATED=y
51CONFIG_SYSFS_DEPRECATED_V2=y
52# CONFIG_RELAY is not set
53CONFIG_NAMESPACES=y
54# CONFIG_UTS_NS is not set
55# CONFIG_IPC_NS is not set
56# CONFIG_USER_NS is not set
57# CONFIG_PID_NS is not set
58# CONFIG_BLK_DEV_INITRD is not set
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60CONFIG_SYSCTL=y
61# CONFIG_EMBEDDED is not set
62CONFIG_UID16=y
63CONFIG_SYSCTL_SYSCALL=y
64CONFIG_KALLSYMS=y
65# CONFIG_KALLSYMS_ALL is not set
66# CONFIG_KALLSYMS_EXTRA_PASS is not set
67CONFIG_HOTPLUG=y
68CONFIG_PRINTK=y
69CONFIG_BUG=y
70CONFIG_ELF_CORE=y
71CONFIG_COMPAT_BRK=y
72CONFIG_BASE_FULL=y
73CONFIG_FUTEX=y
74CONFIG_ANON_INODES=y
75CONFIG_EPOLL=y
76CONFIG_SIGNALFD=y
77CONFIG_TIMERFD=y
78CONFIG_EVENTFD=y
79CONFIG_SHMEM=y
80CONFIG_VM_EVENT_COUNTERS=y
81CONFIG_SLAB=y
82# CONFIG_SLUB is not set
83# CONFIG_SLOB is not set
84# CONFIG_PROFILING is not set
85# CONFIG_MARKERS is not set
86CONFIG_HAVE_OPROFILE=y
87# CONFIG_KPROBES is not set
88# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
89# CONFIG_HAVE_IOREMAP_PROT is not set
90CONFIG_HAVE_KPROBES=y
91CONFIG_HAVE_KRETPROBES=y
92# CONFIG_HAVE_ARCH_TRACEHOOK is not set
93# CONFIG_HAVE_DMA_ATTRS is not set
94# CONFIG_USE_GENERIC_SMP_HELPERS is not set
95# CONFIG_HAVE_CLK is not set
96CONFIG_PROC_PAGE_MONITOR=y
97CONFIG_HAVE_GENERIC_DMA_COHERENT=y
98CONFIG_SLABINFO=y
99CONFIG_RT_MUTEXES=y
100# CONFIG_TINY_SHMEM is not set
101CONFIG_BASE_SMALL=0
102CONFIG_MODULES=y
103# CONFIG_MODULE_FORCE_LOAD is not set
104CONFIG_MODULE_UNLOAD=y
105# CONFIG_MODULE_FORCE_UNLOAD is not set
106# CONFIG_MODVERSIONS is not set
107# CONFIG_MODULE_SRCVERSION_ALL is not set
108CONFIG_KMOD=y
109CONFIG_BLOCK=y
110# CONFIG_LBD is not set
111# CONFIG_BLK_DEV_IO_TRACE is not set
112# CONFIG_LSF is not set
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
121# CONFIG_IOSCHED_DEADLINE is not set
122# CONFIG_IOSCHED_CFQ is not set
123CONFIG_DEFAULT_AS=y
124# CONFIG_DEFAULT_DEADLINE is not set
125# CONFIG_DEFAULT_CFQ is not set
126# CONFIG_DEFAULT_NOOP is not set
127CONFIG_DEFAULT_IOSCHED="anticipatory"
128CONFIG_CLASSIC_RCU=y
129
130#
131# System Type
132#
133# CONFIG_ARCH_AAEC2000 is not set
134# CONFIG_ARCH_INTEGRATOR is not set
135# CONFIG_ARCH_REALVIEW is not set
136# CONFIG_ARCH_VERSATILE is not set
137# CONFIG_ARCH_AT91 is not set
138# CONFIG_ARCH_CLPS7500 is not set
139# CONFIG_ARCH_CLPS711X is not set
140# CONFIG_ARCH_EBSA110 is not set
141# CONFIG_ARCH_EP93XX is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set
143# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set
146# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set
149# CONFIG_ARCH_IXP23XX is not set
150# CONFIG_ARCH_IXP2000 is not set
151# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set
154CONFIG_ARCH_KS8695=y
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_ORION5X is not set
160# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set
162# CONFIG_ARCH_RPC is not set
163# CONFIG_ARCH_SA1100 is not set
164# CONFIG_ARCH_S3C2410 is not set
165# CONFIG_ARCH_SHARK is not set
166# CONFIG_ARCH_LH7A40X is not set
167# CONFIG_ARCH_DAVINCI is not set
168# CONFIG_ARCH_OMAP is not set
169# CONFIG_ARCH_MSM7X00A is not set
170
171#
172# Boot options
173#
174
175#
176# Power management
177#
178
179#
180# Kendin/Micrel KS8695 Implementations
181#
182# CONFIG_MACH_KS8695 is not set
183# CONFIG_MACH_DSM320 is not set
184CONFIG_MACH_ACS5K=y
185
186#
187# Processor Type
188#
189CONFIG_CPU_32=y
190CONFIG_CPU_ARM922T=y
191CONFIG_CPU_32v4T=y
192CONFIG_CPU_ABRT_EV4T=y
193CONFIG_CPU_PABRT_NOIFAR=y
194CONFIG_CPU_CACHE_V4WT=y
195CONFIG_CPU_CACHE_VIVT=y
196CONFIG_CPU_COPY_V4WB=y
197CONFIG_CPU_TLB_V4WBI=y
198CONFIG_CPU_CP15=y
199CONFIG_CPU_CP15_MMU=y
200
201#
202# Processor Features
203#
204# CONFIG_ARM_THUMB is not set
205# CONFIG_CPU_ICACHE_DISABLE is not set
206# CONFIG_CPU_DCACHE_DISABLE is not set
207# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
208# CONFIG_OUTER_CACHE is not set
209
210#
211# Bus support
212#
213# CONFIG_PCI is not set
214# CONFIG_PCI_SYSCALL is not set
215# CONFIG_ARCH_SUPPORTS_MSI is not set
216# CONFIG_PCCARD is not set
217
218#
219# Kernel Features
220#
221# CONFIG_TICK_ONESHOT is not set
222# CONFIG_PREEMPT is not set
223CONFIG_HZ=100
224CONFIG_AEABI=y
225CONFIG_OABI_COMPAT=y
226CONFIG_ARCH_FLATMEM_HAS_HOLES=y
227# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
228CONFIG_SELECT_MEMORY_MODEL=y
229CONFIG_FLATMEM_MANUAL=y
230# CONFIG_DISCONTIGMEM_MANUAL is not set
231# CONFIG_SPARSEMEM_MANUAL is not set
232CONFIG_FLATMEM=y
233CONFIG_FLAT_NODE_MEM_MAP=y
234# CONFIG_SPARSEMEM_STATIC is not set
235# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
236CONFIG_PAGEFLAGS_EXTENDED=y
237CONFIG_SPLIT_PTLOCK_CPUS=4096
238# CONFIG_RESOURCES_64BIT is not set
239CONFIG_ZONE_DMA_FLAG=1
240CONFIG_BOUNCE=y
241CONFIG_VIRT_TO_BUS=y
242# CONFIG_LEDS is not set
243CONFIG_ALIGNMENT_TRAP=y
244
245#
246# Boot options
247#
248CONFIG_ZBOOT_ROM_TEXT=0x0
249CONFIG_ZBOOT_ROM_BSS=0x0
250CONFIG_CMDLINE="console=ttyAM0,115200 init=/bin/sh"
251# CONFIG_XIP_KERNEL is not set
252# CONFIG_KEXEC is not set
253
254#
255# Floating point emulation
256#
257
258#
259# At least one emulation must be selected
260#
261CONFIG_FPE_NWFPE=y
262# CONFIG_FPE_NWFPE_XP is not set
263# CONFIG_FPE_FASTFPE is not set
264
265#
266# Userspace binary formats
267#
268CONFIG_BINFMT_ELF=y
269# CONFIG_BINFMT_AOUT is not set
270# CONFIG_BINFMT_MISC is not set
271
272#
273# Power management options
274#
275# CONFIG_PM is not set
276CONFIG_ARCH_SUSPEND_POSSIBLE=y
277CONFIG_NET=y
278
279#
280# Networking options
281#
282CONFIG_PACKET=y
283# CONFIG_PACKET_MMAP is not set
284CONFIG_UNIX=y
285# CONFIG_NET_KEY is not set
286CONFIG_INET=y
287# CONFIG_IP_MULTICAST is not set
288# CONFIG_IP_ADVANCED_ROUTER is not set
289CONFIG_IP_FIB_HASH=y
290# CONFIG_IP_PNP is not set
291# CONFIG_NET_IPIP is not set
292# CONFIG_NET_IPGRE is not set
293# CONFIG_ARPD is not set
294# CONFIG_SYN_COOKIES is not set
295# CONFIG_INET_AH is not set
296# CONFIG_INET_ESP is not set
297# CONFIG_INET_IPCOMP is not set
298# CONFIG_INET_XFRM_TUNNEL is not set
299# CONFIG_INET_TUNNEL is not set
300# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
301# CONFIG_INET_XFRM_MODE_TUNNEL is not set
302# CONFIG_INET_XFRM_MODE_BEET is not set
303# CONFIG_INET_LRO is not set
304CONFIG_INET_DIAG=y
305CONFIG_INET_TCP_DIAG=y
306# CONFIG_TCP_CONG_ADVANCED is not set
307CONFIG_TCP_CONG_CUBIC=y
308CONFIG_DEFAULT_TCP_CONG="cubic"
309# CONFIG_TCP_MD5SIG is not set
310# CONFIG_IPV6 is not set
311# CONFIG_NETWORK_SECMARK is not set
312# CONFIG_NETFILTER is not set
313# CONFIG_IP_DCCP is not set
314# CONFIG_IP_SCTP is not set
315# CONFIG_TIPC is not set
316# CONFIG_ATM is not set
317# CONFIG_BRIDGE is not set
318# CONFIG_VLAN_8021Q is not set
319# CONFIG_DECNET is not set
320# CONFIG_LLC2 is not set
321# CONFIG_IPX is not set
322# CONFIG_ATALK is not set
323# CONFIG_X25 is not set
324# CONFIG_LAPB is not set
325# CONFIG_ECONET is not set
326# CONFIG_WAN_ROUTER is not set
327# CONFIG_NET_SCHED is not set
328
329#
330# Network testing
331#
332# CONFIG_NET_PKTGEN is not set
333# CONFIG_HAMRADIO is not set
334# CONFIG_CAN is not set
335# CONFIG_IRDA is not set
336# CONFIG_BT is not set
337# CONFIG_AF_RXRPC is not set
338
339#
340# Wireless
341#
342# CONFIG_CFG80211 is not set
343# CONFIG_WIRELESS_EXT is not set
344# CONFIG_MAC80211 is not set
345# CONFIG_IEEE80211 is not set
346# CONFIG_RFKILL is not set
347# CONFIG_NET_9P is not set
348
349#
350# Device Drivers
351#
352
353#
354# Generic Driver Options
355#
356CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
357CONFIG_STANDALONE=y
358CONFIG_PREVENT_FIRMWARE_BUILD=y
359CONFIG_FW_LOADER=y
360CONFIG_FIRMWARE_IN_KERNEL=y
361CONFIG_EXTRA_FIRMWARE=""
362# CONFIG_DEBUG_DRIVER is not set
363# CONFIG_DEBUG_DEVRES is not set
364# CONFIG_SYS_HYPERVISOR is not set
365# CONFIG_CONNECTOR is not set
366CONFIG_MTD=y
367# CONFIG_MTD_DEBUG is not set
368CONFIG_MTD_CONCAT=y
369CONFIG_MTD_PARTITIONS=y
370# CONFIG_MTD_REDBOOT_PARTS is not set
371# CONFIG_MTD_CMDLINE_PARTS is not set
372# CONFIG_MTD_AFS_PARTS is not set
373# CONFIG_MTD_AR7_PARTS is not set
374
375#
376# User Modules And Translation Layers
377#
378CONFIG_MTD_CHAR=y
379CONFIG_MTD_BLKDEVS=y
380CONFIG_MTD_BLOCK=y
381# CONFIG_FTL is not set
382# CONFIG_NFTL is not set
383# CONFIG_INFTL is not set
384# CONFIG_RFD_FTL is not set
385# CONFIG_SSFDC is not set
386# CONFIG_MTD_OOPS is not set
387
388#
389# RAM/ROM/Flash chip drivers
390#
391CONFIG_MTD_CFI=y
392CONFIG_MTD_JEDECPROBE=y
393CONFIG_MTD_GEN_PROBE=y
394CONFIG_MTD_CFI_ADV_OPTIONS=y
395CONFIG_MTD_CFI_NOSWAP=y
396# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
397# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
398# CONFIG_MTD_CFI_GEOMETRY is not set
399CONFIG_MTD_MAP_BANK_WIDTH_1=y
400CONFIG_MTD_MAP_BANK_WIDTH_2=y
401CONFIG_MTD_MAP_BANK_WIDTH_4=y
402# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
403# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
404# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
405CONFIG_MTD_CFI_I1=y
406CONFIG_MTD_CFI_I2=y
407# CONFIG_MTD_CFI_I4 is not set
408# CONFIG_MTD_CFI_I8 is not set
409# CONFIG_MTD_OTP is not set
410CONFIG_MTD_CFI_INTELEXT=y
411CONFIG_MTD_CFI_AMDSTD=y
412# CONFIG_MTD_CFI_STAA is not set
413CONFIG_MTD_CFI_UTIL=y
414# CONFIG_MTD_RAM is not set
415# CONFIG_MTD_ROM is not set
416# CONFIG_MTD_ABSENT is not set
417
418#
419# Mapping drivers for chip access
420#
421# CONFIG_MTD_COMPLEX_MAPPINGS is not set
422CONFIG_MTD_PHYSMAP=y
423CONFIG_MTD_PHYSMAP_START=0x8000000
424CONFIG_MTD_PHYSMAP_LEN=0
425CONFIG_MTD_PHYSMAP_BANKWIDTH=4
426# CONFIG_MTD_ARM_INTEGRATOR is not set
427# CONFIG_MTD_IMPA7 is not set
428# CONFIG_MTD_PLATRAM is not set
429
430#
431# Self-contained MTD device drivers
432#
433# CONFIG_MTD_SLRAM is not set
434# CONFIG_MTD_PHRAM is not set
435# CONFIG_MTD_MTDRAM is not set
436# CONFIG_MTD_BLOCK2MTD is not set
437
438#
439# Disk-On-Chip Device Drivers
440#
441# CONFIG_MTD_DOC2000 is not set
442# CONFIG_MTD_DOC2001 is not set
443# CONFIG_MTD_DOC2001PLUS is not set
444# CONFIG_MTD_NAND is not set
445# CONFIG_MTD_ONENAND is not set
446
447#
448# UBI - Unsorted block images
449#
450# CONFIG_MTD_UBI is not set
451# CONFIG_PARPORT is not set
452# CONFIG_BLK_DEV is not set
453# CONFIG_MISC_DEVICES is not set
454CONFIG_HAVE_IDE=y
455# CONFIG_IDE is not set
456
457#
458# SCSI device support
459#
460# CONFIG_RAID_ATTRS is not set
461# CONFIG_SCSI is not set
462# CONFIG_SCSI_DMA is not set
463# CONFIG_SCSI_NETLINK is not set
464# CONFIG_ATA is not set
465# CONFIG_MD is not set
466CONFIG_NETDEVICES=y
467# CONFIG_DUMMY is not set
468# CONFIG_BONDING is not set
469# CONFIG_MACVLAN is not set
470# CONFIG_EQUALIZER is not set
471# CONFIG_TUN is not set
472# CONFIG_VETH is not set
473# CONFIG_PHYLIB is not set
474CONFIG_NET_ETHERNET=y
475CONFIG_MII=y
476CONFIG_ARM_KS8695_ETHER=y
477# CONFIG_AX88796 is not set
478# CONFIG_SMC91X is not set
479# CONFIG_DM9000 is not set
480# CONFIG_IBM_NEW_EMAC_ZMII is not set
481# CONFIG_IBM_NEW_EMAC_RGMII is not set
482# CONFIG_IBM_NEW_EMAC_TAH is not set
483# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
484# CONFIG_B44 is not set
485# CONFIG_NETDEV_1000 is not set
486# CONFIG_NETDEV_10000 is not set
487
488#
489# Wireless LAN
490#
491# CONFIG_WLAN_PRE80211 is not set
492CONFIG_WLAN_80211=y
493# CONFIG_LIBERTAS is not set
494# CONFIG_IWLWIFI_LEDS is not set
495# CONFIG_HOSTAP is not set
496# CONFIG_WAN is not set
497# CONFIG_PPP is not set
498# CONFIG_SLIP is not set
499# CONFIG_NETCONSOLE is not set
500# CONFIG_NETPOLL is not set
501# CONFIG_NET_POLL_CONTROLLER is not set
502# CONFIG_ISDN is not set
503
504#
505# Input device support
506#
507CONFIG_INPUT=y
508# CONFIG_INPUT_FF_MEMLESS is not set
509# CONFIG_INPUT_POLLDEV is not set
510
511#
512# Userland interfaces
513#
514CONFIG_INPUT_MOUSEDEV=y
515# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
516CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
517CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
518# CONFIG_INPUT_JOYDEV is not set
519# CONFIG_INPUT_EVDEV is not set
520# CONFIG_INPUT_EVBUG is not set
521
522#
523# Input Device Drivers
524#
525# CONFIG_INPUT_KEYBOARD is not set
526# CONFIG_INPUT_MOUSE is not set
527# CONFIG_INPUT_JOYSTICK is not set
528# CONFIG_INPUT_TABLET is not set
529# CONFIG_INPUT_TOUCHSCREEN is not set
530# CONFIG_INPUT_MISC is not set
531
532#
533# Hardware I/O ports
534#
535# CONFIG_SERIO is not set
536# CONFIG_GAMEPORT is not set
537
538#
539# Character devices
540#
541CONFIG_VT=y
542CONFIG_CONSOLE_TRANSLATIONS=y
543CONFIG_VT_CONSOLE=y
544CONFIG_HW_CONSOLE=y
545# CONFIG_VT_HW_CONSOLE_BINDING is not set
546CONFIG_DEVKMEM=y
547# CONFIG_SERIAL_NONSTANDARD is not set
548
549#
550# Serial drivers
551#
552# CONFIG_SERIAL_8250 is not set
553
554#
555# Non-8250 serial port support
556#
557CONFIG_SERIAL_KS8695=y
558CONFIG_SERIAL_KS8695_CONSOLE=y
559CONFIG_SERIAL_CORE=y
560CONFIG_SERIAL_CORE_CONSOLE=y
561CONFIG_UNIX98_PTYS=y
562CONFIG_LEGACY_PTYS=y
563CONFIG_LEGACY_PTY_COUNT=256
564# CONFIG_IPMI_HANDLER is not set
565# CONFIG_HW_RANDOM is not set
566# CONFIG_NVRAM is not set
567# CONFIG_R3964 is not set
568# CONFIG_RAW_DRIVER is not set
569# CONFIG_TCG_TPM is not set
570CONFIG_ACS5KCAN=y
571CONFIG_I2C=y
572CONFIG_I2C_BOARDINFO=y
573CONFIG_I2C_CHARDEV=y
574CONFIG_I2C_HELPER_AUTO=y
575CONFIG_I2C_ALGOBIT=y
576
577#
578# I2C Hardware Bus support
579#
580
581#
582# I2C system bus drivers (mostly embedded / system-on-chip)
583#
584CONFIG_I2C_GPIO=y
585# CONFIG_I2C_OCORES is not set
586# CONFIG_I2C_SIMTEC is not set
587
588#
589# External I2C/SMBus adapter drivers
590#
591# CONFIG_I2C_PARPORT_LIGHT is not set
592# CONFIG_I2C_TAOS_EVM is not set
593
594#
595# Other I2C/SMBus bus drivers
596#
597# CONFIG_I2C_PCA_PLATFORM is not set
598# CONFIG_I2C_STUB is not set
599
600#
601# Miscellaneous I2C Chip support
602#
603# CONFIG_DS1682 is not set
604# CONFIG_AT24 is not set
605# CONFIG_SENSORS_EEPROM is not set
606# CONFIG_SENSORS_PCF8574 is not set
607# CONFIG_PCF8575 is not set
608# CONFIG_SENSORS_PCF8591 is not set
609# CONFIG_TPS65010 is not set
610# CONFIG_SENSORS_MAX6875 is not set
611# CONFIG_SENSORS_TSL2550 is not set
612# CONFIG_I2C_DEBUG_CORE is not set
613# CONFIG_I2C_DEBUG_ALGO is not set
614# CONFIG_I2C_DEBUG_BUS is not set
615# CONFIG_I2C_DEBUG_CHIP is not set
616# CONFIG_SPI is not set
617CONFIG_ARCH_REQUIRE_GPIOLIB=y
618CONFIG_GPIOLIB=y
619# CONFIG_DEBUG_GPIO is not set
620CONFIG_GPIO_SYSFS=y
621
622#
623# I2C GPIO expanders:
624#
625# CONFIG_GPIO_MAX732X is not set
626CONFIG_GPIO_PCA953X=y
627# CONFIG_GPIO_PCF857X is not set
628
629#
630# PCI GPIO expanders:
631#
632
633#
634# SPI GPIO expanders:
635#
636# CONFIG_W1 is not set
637# CONFIG_POWER_SUPPLY is not set
638# CONFIG_HWMON is not set
639CONFIG_WATCHDOG=y
640# CONFIG_WATCHDOG_NOWAYOUT is not set
641
642#
643# Watchdog Device Drivers
644#
645# CONFIG_SOFT_WATCHDOG is not set
646CONFIG_KS8695_WATCHDOG=y
647
648#
649# Sonics Silicon Backplane
650#
651CONFIG_SSB_POSSIBLE=y
652# CONFIG_SSB is not set
653
654#
655# Multifunction device drivers
656#
657# CONFIG_MFD_CORE is not set
658# CONFIG_MFD_SM501 is not set
659# CONFIG_MFD_ASIC3 is not set
660# CONFIG_HTC_EGPIO is not set
661# CONFIG_HTC_PASIC3 is not set
662# CONFIG_MFD_TMIO is not set
663# CONFIG_MFD_T7L66XB is not set
664# CONFIG_MFD_TC6387XB is not set
665# CONFIG_MFD_TC6393XB is not set
666
667#
668# Multimedia devices
669#
670
671#
672# Multimedia core support
673#
674# CONFIG_VIDEO_DEV is not set
675# CONFIG_DVB_CORE is not set
676# CONFIG_VIDEO_MEDIA is not set
677
678#
679# Multimedia drivers
680#
681# CONFIG_DAB is not set
682
683#
684# Graphics support
685#
686# CONFIG_VGASTATE is not set
687# CONFIG_VIDEO_OUTPUT_CONTROL is not set
688# CONFIG_FB is not set
689# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
690
691#
692# Display device support
693#
694# CONFIG_DISPLAY_SUPPORT is not set
695
696#
697# Console display driver support
698#
699# CONFIG_VGA_CONSOLE is not set
700CONFIG_DUMMY_CONSOLE=y
701# CONFIG_SOUND is not set
702# CONFIG_HID_SUPPORT is not set
703# CONFIG_USB_SUPPORT is not set
704# CONFIG_MMC is not set
705# CONFIG_NEW_LEDS is not set
706CONFIG_RTC_LIB=y
707CONFIG_RTC_CLASS=y
708CONFIG_RTC_HCTOSYS=y
709CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
710# CONFIG_RTC_DEBUG is not set
711
712#
713# RTC interfaces
714#
715CONFIG_RTC_INTF_SYSFS=y
716CONFIG_RTC_INTF_PROC=y
717CONFIG_RTC_INTF_DEV=y
718# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
719# CONFIG_RTC_DRV_TEST is not set
720
721#
722# I2C RTC drivers
723#
724# CONFIG_RTC_DRV_DS1307 is not set
725# CONFIG_RTC_DRV_DS1374 is not set
726# CONFIG_RTC_DRV_DS1672 is not set
727# CONFIG_RTC_DRV_MAX6900 is not set
728# CONFIG_RTC_DRV_RS5C372 is not set
729# CONFIG_RTC_DRV_ISL1208 is not set
730# CONFIG_RTC_DRV_X1205 is not set
731CONFIG_RTC_DRV_PCF8563=y
732# CONFIG_RTC_DRV_PCF8583 is not set
733# CONFIG_RTC_DRV_M41T80 is not set
734# CONFIG_RTC_DRV_S35390A is not set
735# CONFIG_RTC_DRV_FM3130 is not set
736
737#
738# SPI RTC drivers
739#
740
741#
742# Platform RTC drivers
743#
744# CONFIG_RTC_DRV_CMOS is not set
745# CONFIG_RTC_DRV_DS1511 is not set
746# CONFIG_RTC_DRV_DS1553 is not set
747# CONFIG_RTC_DRV_DS1742 is not set
748# CONFIG_RTC_DRV_STK17TA8 is not set
749# CONFIG_RTC_DRV_M48T86 is not set
750# CONFIG_RTC_DRV_M48T59 is not set
751# CONFIG_RTC_DRV_V3020 is not set
752
753#
754# on-CPU RTC drivers
755#
756# CONFIG_DMADEVICES is not set
757
758#
759# Voltage and Current regulators
760#
761# CONFIG_REGULATOR is not set
762# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
763# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
764# CONFIG_REGULATOR_BQ24022 is not set
765# CONFIG_UIO is not set
766
767#
768# File systems
769#
770# CONFIG_EXT2_FS is not set
771# CONFIG_EXT3_FS is not set
772# CONFIG_EXT4DEV_FS is not set
773# CONFIG_REISERFS_FS is not set
774# CONFIG_JFS_FS is not set
775# CONFIG_FS_POSIX_ACL is not set
776# CONFIG_XFS_FS is not set
777# CONFIG_OCFS2_FS is not set
778CONFIG_DNOTIFY=y
779CONFIG_INOTIFY=y
780CONFIG_INOTIFY_USER=y
781# CONFIG_QUOTA is not set
782# CONFIG_AUTOFS_FS is not set
783# CONFIG_AUTOFS4_FS is not set
784# CONFIG_FUSE_FS is not set
785
786#
787# CD-ROM/DVD Filesystems
788#
789# CONFIG_ISO9660_FS is not set
790# CONFIG_UDF_FS is not set
791
792#
793# DOS/FAT/NT Filesystems
794#
795# CONFIG_MSDOS_FS is not set
796# CONFIG_VFAT_FS is not set
797# CONFIG_NTFS_FS is not set
798
799#
800# Pseudo filesystems
801#
802CONFIG_PROC_FS=y
803CONFIG_PROC_SYSCTL=y
804CONFIG_SYSFS=y
805CONFIG_TMPFS=y
806# CONFIG_TMPFS_POSIX_ACL is not set
807# CONFIG_HUGETLB_PAGE is not set
808# CONFIG_CONFIGFS_FS is not set
809
810#
811# Miscellaneous filesystems
812#
813# CONFIG_ADFS_FS is not set
814# CONFIG_AFFS_FS is not set
815# CONFIG_HFS_FS is not set
816# CONFIG_HFSPLUS_FS is not set
817# CONFIG_BEFS_FS is not set
818# CONFIG_BFS_FS is not set
819# CONFIG_EFS_FS is not set
820CONFIG_JFFS2_FS=y
821CONFIG_JFFS2_FS_DEBUG=0
822CONFIG_JFFS2_FS_WRITEBUFFER=y
823# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
824CONFIG_JFFS2_SUMMARY=y
825# CONFIG_JFFS2_FS_XATTR is not set
826CONFIG_JFFS2_COMPRESSION_OPTIONS=y
827CONFIG_JFFS2_ZLIB=y
828# CONFIG_JFFS2_LZO is not set
829CONFIG_JFFS2_RTIME=y
830CONFIG_JFFS2_RUBIN=y
831# CONFIG_JFFS2_CMODE_NONE is not set
832CONFIG_JFFS2_CMODE_PRIORITY=y
833# CONFIG_JFFS2_CMODE_SIZE is not set
834# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
835# CONFIG_CRAMFS is not set
836CONFIG_SQUASHFS=y
837# CONFIG_SQUASHFS_EMBEDDED is not set
838CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
839# CONFIG_VXFS_FS is not set
840# CONFIG_MINIX_FS is not set
841# CONFIG_OMFS_FS is not set
842# CONFIG_HPFS_FS is not set
843# CONFIG_QNX4FS_FS is not set
844# CONFIG_ROMFS_FS is not set
845# CONFIG_SYSV_FS is not set
846# CONFIG_UFS_FS is not set
847# CONFIG_NETWORK_FILESYSTEMS is not set
848
849#
850# Partition Types
851#
852# CONFIG_PARTITION_ADVANCED is not set
853CONFIG_MSDOS_PARTITION=y
854# CONFIG_NLS is not set
855# CONFIG_DLM is not set
856
857#
858# Kernel hacking
859#
860# CONFIG_PRINTK_TIME is not set
861CONFIG_ENABLE_WARN_DEPRECATED=y
862CONFIG_ENABLE_MUST_CHECK=y
863CONFIG_FRAME_WARN=1024
864# CONFIG_MAGIC_SYSRQ is not set
865# CONFIG_UNUSED_SYMBOLS is not set
866# CONFIG_DEBUG_FS is not set
867# CONFIG_HEADERS_CHECK is not set
868CONFIG_DEBUG_KERNEL=y
869# CONFIG_DEBUG_SHIRQ is not set
870CONFIG_DETECT_SOFTLOCKUP=y
871# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
872CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
873CONFIG_SCHED_DEBUG=y
874# CONFIG_SCHEDSTATS is not set
875# CONFIG_TIMER_STATS is not set
876# CONFIG_DEBUG_OBJECTS is not set
877# CONFIG_DEBUG_SLAB is not set
878# CONFIG_DEBUG_RT_MUTEXES is not set
879# CONFIG_RT_MUTEX_TESTER is not set
880# CONFIG_DEBUG_SPINLOCK is not set
881CONFIG_DEBUG_MUTEXES=y
882# CONFIG_DEBUG_LOCK_ALLOC is not set
883# CONFIG_PROVE_LOCKING is not set
884# CONFIG_LOCK_STAT is not set
885# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
886# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
887# CONFIG_DEBUG_KOBJECT is not set
888CONFIG_DEBUG_BUGVERBOSE=y
889# CONFIG_DEBUG_INFO is not set
890# CONFIG_DEBUG_VM is not set
891# CONFIG_DEBUG_WRITECOUNT is not set
892CONFIG_DEBUG_MEMORY_INIT=y
893# CONFIG_DEBUG_LIST is not set
894# CONFIG_DEBUG_SG is not set
895CONFIG_FRAME_POINTER=y
896# CONFIG_BOOT_PRINTK_DELAY is not set
897# CONFIG_RCU_TORTURE_TEST is not set
898# CONFIG_BACKTRACE_SELF_TEST is not set
899# CONFIG_FAULT_INJECTION is not set
900# CONFIG_LATENCYTOP is not set
901# CONFIG_SYSCTL_SYSCALL_CHECK is not set
902CONFIG_HAVE_FTRACE=y
903CONFIG_HAVE_DYNAMIC_FTRACE=y
904# CONFIG_FTRACE is not set
905# CONFIG_SCHED_TRACER is not set
906# CONFIG_CONTEXT_SWITCH_TRACER is not set
907# CONFIG_SAMPLES is not set
908CONFIG_HAVE_ARCH_KGDB=y
909# CONFIG_KGDB is not set
910CONFIG_DEBUG_USER=y
911# CONFIG_DEBUG_ERRORS is not set
912# CONFIG_DEBUG_STACK_USAGE is not set
913# CONFIG_DEBUG_LL is not set
914
915#
916# Security options
917#
918# CONFIG_KEYS is not set
919# CONFIG_SECURITY is not set
920# CONFIG_SECURITY_FILE_CAPABILITIES is not set
921# CONFIG_CRYPTO is not set
922
923#
924# Library routines
925#
926CONFIG_BITREVERSE=y
927# CONFIG_GENERIC_FIND_FIRST_BIT is not set
928# CONFIG_GENERIC_FIND_NEXT_BIT is not set
929# CONFIG_CRC_CCITT is not set
930# CONFIG_CRC16 is not set
931# CONFIG_CRC_T10DIF is not set
932# CONFIG_CRC_ITU_T is not set
933CONFIG_CRC32=y
934# CONFIG_CRC7 is not set
935# CONFIG_LIBCRC32C is not set
936CONFIG_ZLIB_INFLATE=y
937CONFIG_ZLIB_DEFLATE=y
938CONFIG_PLIST=y
939CONFIG_HAS_IOMEM=y
940CONFIG_HAS_IOPORT=y
941CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/assabet_defconfig b/arch/arm/configs/assabet_defconfig
index b1cd331aaecf..c66dd399e426 100644
--- a/arch/arm/configs/assabet_defconfig
+++ b/arch/arm/configs/assabet_defconfig
@@ -89,7 +89,6 @@ CONFIG_SA1100_ASSABET=y
89# CONFIG_SA1100_COLLIE is not set 89# CONFIG_SA1100_COLLIE is not set
90# CONFIG_SA1100_H3100 is not set 90# CONFIG_SA1100_H3100 is not set
91# CONFIG_SA1100_H3600 is not set 91# CONFIG_SA1100_H3600 is not set
92# CONFIG_SA1100_H3800 is not set
93# CONFIG_SA1100_BADGE4 is not set 92# CONFIG_SA1100_BADGE4 is not set
94# CONFIG_SA1100_JORNADA720 is not set 93# CONFIG_SA1100_JORNADA720 is not set
95# CONFIG_SA1100_HACKKIT is not set 94# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/badge4_defconfig b/arch/arm/configs/badge4_defconfig
index 80222feb7dad..f264846218a2 100644
--- a/arch/arm/configs/badge4_defconfig
+++ b/arch/arm/configs/badge4_defconfig
@@ -91,7 +91,6 @@ CONFIG_ARCH_SA1100=y
91# CONFIG_SA1100_COLLIE is not set 91# CONFIG_SA1100_COLLIE is not set
92# CONFIG_SA1100_H3100 is not set 92# CONFIG_SA1100_H3100 is not set
93# CONFIG_SA1100_H3600 is not set 93# CONFIG_SA1100_H3600 is not set
94# CONFIG_SA1100_H3800 is not set
95CONFIG_SA1100_BADGE4=y 94CONFIG_SA1100_BADGE4=y
96# CONFIG_SA1100_JORNADA720 is not set 95# CONFIG_SA1100_JORNADA720 is not set
97# CONFIG_SA1100_HACKKIT is not set 96# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/cerfcube_defconfig b/arch/arm/configs/cerfcube_defconfig
index ee130b528bd4..2b4c0668b1b4 100644
--- a/arch/arm/configs/cerfcube_defconfig
+++ b/arch/arm/configs/cerfcube_defconfig
@@ -93,7 +93,6 @@ CONFIG_SA1100_CERF_FLASH_16MB=y
93# CONFIG_SA1100_COLLIE is not set 93# CONFIG_SA1100_COLLIE is not set
94# CONFIG_SA1100_H3100 is not set 94# CONFIG_SA1100_H3100 is not set
95# CONFIG_SA1100_H3600 is not set 95# CONFIG_SA1100_H3600 is not set
96# CONFIG_SA1100_H3800 is not set
97# CONFIG_SA1100_BADGE4 is not set 96# CONFIG_SA1100_BADGE4 is not set
98# CONFIG_SA1100_JORNADA720 is not set 97# CONFIG_SA1100_JORNADA720 is not set
99# CONFIG_SA1100_HACKKIT is not set 98# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/xm_x2xx_defconfig b/arch/arm/configs/cm_x2xx_defconfig
index 1039f366bf8d..797b790cba78 100644
--- a/arch/arm/configs/xm_x2xx_defconfig
+++ b/arch/arm/configs/cm_x2xx_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.27-rc8 3# Linux kernel version: 2.6.29-rc2
4# Sun Oct 5 11:05:36 2008 4# Sun Feb 1 16:31:36 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -22,7 +22,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set 22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 23CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_SUPPORTS_AOUT=y
26CONFIG_ZONE_DMA=y 25CONFIG_ZONE_DMA=y
27CONFIG_ARCH_MTD_XIP=y 26CONFIG_ARCH_MTD_XIP=y
28CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
@@ -47,12 +46,12 @@ CONFIG_SYSVIPC_SYSCTL=y
47CONFIG_IKCONFIG=y 46CONFIG_IKCONFIG=y
48CONFIG_IKCONFIG_PROC=y 47CONFIG_IKCONFIG_PROC=y
49CONFIG_LOG_BUF_SHIFT=14 48CONFIG_LOG_BUF_SHIFT=14
50# CONFIG_CGROUPS is not set
51CONFIG_GROUP_SCHED=y 49CONFIG_GROUP_SCHED=y
52CONFIG_FAIR_GROUP_SCHED=y 50CONFIG_FAIR_GROUP_SCHED=y
53# CONFIG_RT_GROUP_SCHED is not set 51# CONFIG_RT_GROUP_SCHED is not set
54CONFIG_USER_SCHED=y 52CONFIG_USER_SCHED=y
55# CONFIG_CGROUP_SCHED is not set 53# CONFIG_CGROUP_SCHED is not set
54# CONFIG_CGROUPS is not set
56CONFIG_SYSFS_DEPRECATED=y 55CONFIG_SYSFS_DEPRECATED=y
57CONFIG_SYSFS_DEPRECATED_V2=y 56CONFIG_SYSFS_DEPRECATED_V2=y
58# CONFIG_RELAY is not set 57# CONFIG_RELAY is not set
@@ -80,27 +79,21 @@ CONFIG_SIGNALFD=y
80CONFIG_TIMERFD=y 79CONFIG_TIMERFD=y
81CONFIG_EVENTFD=y 80CONFIG_EVENTFD=y
82CONFIG_SHMEM=y 81CONFIG_SHMEM=y
82CONFIG_AIO=y
83# CONFIG_VM_EVENT_COUNTERS is not set 83# CONFIG_VM_EVENT_COUNTERS is not set
84CONFIG_PCI_QUIRKS=y
84# CONFIG_SLUB_DEBUG is not set 85# CONFIG_SLUB_DEBUG is not set
85# CONFIG_SLAB is not set 86# CONFIG_SLAB is not set
86CONFIG_SLUB=y 87CONFIG_SLUB=y
87# CONFIG_SLOB is not set 88# CONFIG_SLOB is not set
88# CONFIG_PROFILING is not set 89# CONFIG_PROFILING is not set
89# CONFIG_MARKERS is not set
90CONFIG_HAVE_OPROFILE=y 90CONFIG_HAVE_OPROFILE=y
91# CONFIG_KPROBES is not set 91# CONFIG_KPROBES is not set
92# CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set
93# CONFIG_HAVE_IOREMAP_PROT is not set
94CONFIG_HAVE_KPROBES=y 92CONFIG_HAVE_KPROBES=y
95CONFIG_HAVE_KRETPROBES=y 93CONFIG_HAVE_KRETPROBES=y
96# CONFIG_HAVE_ARCH_TRACEHOOK is not set
97# CONFIG_HAVE_DMA_ATTRS is not set
98# CONFIG_USE_GENERIC_SMP_HELPERS is not set
99CONFIG_HAVE_CLK=y 94CONFIG_HAVE_CLK=y
100# CONFIG_PROC_PAGE_MONITOR is not set
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y 95CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_RT_MUTEXES=y 96CONFIG_RT_MUTEXES=y
103# CONFIG_TINY_SHMEM is not set
104CONFIG_BASE_SMALL=0 97CONFIG_BASE_SMALL=0
105CONFIG_MODULES=y 98CONFIG_MODULES=y
106# CONFIG_MODULE_FORCE_LOAD is not set 99# CONFIG_MODULE_FORCE_LOAD is not set
@@ -108,11 +101,9 @@ CONFIG_MODULE_UNLOAD=y
108# CONFIG_MODULE_FORCE_UNLOAD is not set 101# CONFIG_MODULE_FORCE_UNLOAD is not set
109# CONFIG_MODVERSIONS is not set 102# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set 103# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_KMOD=y
112CONFIG_BLOCK=y 104CONFIG_BLOCK=y
113# CONFIG_LBD is not set 105# CONFIG_LBD is not set
114# CONFIG_BLK_DEV_IO_TRACE is not set 106# CONFIG_BLK_DEV_IO_TRACE is not set
115# CONFIG_LSF is not set
116# CONFIG_BLK_DEV_BSG is not set 107# CONFIG_BLK_DEV_BSG is not set
117# CONFIG_BLK_DEV_INTEGRITY is not set 108# CONFIG_BLK_DEV_INTEGRITY is not set
118 109
@@ -129,6 +120,11 @@ CONFIG_DEFAULT_CFQ=y
129# CONFIG_DEFAULT_NOOP is not set 120# CONFIG_DEFAULT_NOOP is not set
130CONFIG_DEFAULT_IOSCHED="cfq" 121CONFIG_DEFAULT_IOSCHED="cfq"
131CONFIG_CLASSIC_RCU=y 122CONFIG_CLASSIC_RCU=y
123# CONFIG_TREE_RCU is not set
124# CONFIG_PREEMPT_RCU is not set
125# CONFIG_TREE_RCU_TRACE is not set
126# CONFIG_PREEMPT_RCU_TRACE is not set
127CONFIG_FREEZER=y
132 128
133# 129#
134# System Type 130# System Type
@@ -138,7 +134,6 @@ CONFIG_CLASSIC_RCU=y
138# CONFIG_ARCH_REALVIEW is not set 134# CONFIG_ARCH_REALVIEW is not set
139# CONFIG_ARCH_VERSATILE is not set 135# CONFIG_ARCH_VERSATILE is not set
140# CONFIG_ARCH_AT91 is not set 136# CONFIG_ARCH_AT91 is not set
141# CONFIG_ARCH_CLPS7500 is not set
142# CONFIG_ARCH_CLPS711X is not set 137# CONFIG_ARCH_CLPS711X is not set
143# CONFIG_ARCH_EBSA110 is not set 138# CONFIG_ARCH_EBSA110 is not set
144# CONFIG_ARCH_EP93XX is not set 139# CONFIG_ARCH_EP93XX is not set
@@ -165,17 +160,19 @@ CONFIG_ARCH_PXA=y
165# CONFIG_ARCH_RPC is not set 160# CONFIG_ARCH_RPC is not set
166# CONFIG_ARCH_SA1100 is not set 161# CONFIG_ARCH_SA1100 is not set
167# CONFIG_ARCH_S3C2410 is not set 162# CONFIG_ARCH_S3C2410 is not set
163# CONFIG_ARCH_S3C64XX is not set
168# CONFIG_ARCH_SHARK is not set 164# CONFIG_ARCH_SHARK is not set
169# CONFIG_ARCH_LH7A40X is not set 165# CONFIG_ARCH_LH7A40X is not set
170# CONFIG_ARCH_DAVINCI is not set 166# CONFIG_ARCH_DAVINCI is not set
171# CONFIG_ARCH_OMAP is not set 167# CONFIG_ARCH_OMAP is not set
172# CONFIG_ARCH_MSM7X00A is not set 168# CONFIG_ARCH_MSM is not set
173CONFIG_DMABOUNCE=y 169# CONFIG_ARCH_W90X900 is not set
174 170
175# 171#
176# Intel PXA2xx/PXA3xx Implementations 172# Intel PXA2xx/PXA3xx Implementations
177# 173#
178# CONFIG_ARCH_GUMSTIX is not set 174# CONFIG_ARCH_GUMSTIX is not set
175# CONFIG_MACH_INTELMOTE2 is not set
179# CONFIG_ARCH_LUBBOCK is not set 176# CONFIG_ARCH_LUBBOCK is not set
180# CONFIG_MACH_LOGICPD_PXA270 is not set 177# CONFIG_MACH_LOGICPD_PXA270 is not set
181# CONFIG_MACH_MAINSTONE is not set 178# CONFIG_MACH_MAINSTONE is not set
@@ -185,7 +182,9 @@ CONFIG_DMABOUNCE=y
185# CONFIG_ARCH_VIPER is not set 182# CONFIG_ARCH_VIPER is not set
186# CONFIG_ARCH_PXA_ESERIES is not set 183# CONFIG_ARCH_PXA_ESERIES is not set
187# CONFIG_TRIZEPS_PXA is not set 184# CONFIG_TRIZEPS_PXA is not set
188CONFIG_MACH_EM_X270=y 185# CONFIG_MACH_H5000 is not set
186# CONFIG_MACH_EM_X270 is not set
187# CONFIG_MACH_EXEDA is not set
189# CONFIG_MACH_COLIBRI is not set 188# CONFIG_MACH_COLIBRI is not set
190# CONFIG_MACH_ZYLONITE is not set 189# CONFIG_MACH_ZYLONITE is not set
191# CONFIG_MACH_LITTLETON is not set 190# CONFIG_MACH_LITTLETON is not set
@@ -204,14 +203,6 @@ CONFIG_PXA_SSP=y
204# CONFIG_PXA_PWM is not set 203# CONFIG_PXA_PWM is not set
205 204
206# 205#
207# Boot options
208#
209
210#
211# Power management
212#
213
214#
215# Processor Type 206# Processor Type
216# 207#
217CONFIG_CPU_32=y 208CONFIG_CPU_32=y
@@ -232,6 +223,8 @@ CONFIG_ARM_THUMB=y
232# CONFIG_OUTER_CACHE is not set 223# CONFIG_OUTER_CACHE is not set
233CONFIG_IWMMXT=y 224CONFIG_IWMMXT=y
234CONFIG_XSCALE_PMU=y 225CONFIG_XSCALE_PMU=y
226CONFIG_DMABOUNCE=y
227CONFIG_COMMON_CLKDEV=y
235 228
236# 229#
237# Bus support 230# Bus support
@@ -242,6 +235,7 @@ CONFIG_PCI_HOST_ITE8152=y
242# CONFIG_ARCH_SUPPORTS_MSI is not set 235# CONFIG_ARCH_SUPPORTS_MSI is not set
243CONFIG_PCI_LEGACY=y 236CONFIG_PCI_LEGACY=y
244# CONFIG_PCI_DEBUG is not set 237# CONFIG_PCI_DEBUG is not set
238# CONFIG_PCI_STUB is not set
245CONFIG_PCCARD=m 239CONFIG_PCCARD=m
246# CONFIG_PCMCIA_DEBUG is not set 240# CONFIG_PCMCIA_DEBUG is not set
247CONFIG_PCMCIA=m 241CONFIG_PCMCIA=m
@@ -287,14 +281,13 @@ CONFIG_FLATMEM_MANUAL=y
287# CONFIG_SPARSEMEM_MANUAL is not set 281# CONFIG_SPARSEMEM_MANUAL is not set
288CONFIG_FLATMEM=y 282CONFIG_FLATMEM=y
289CONFIG_FLAT_NODE_MEM_MAP=y 283CONFIG_FLAT_NODE_MEM_MAP=y
290# CONFIG_SPARSEMEM_STATIC is not set
291# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
292CONFIG_PAGEFLAGS_EXTENDED=y 284CONFIG_PAGEFLAGS_EXTENDED=y
293CONFIG_SPLIT_PTLOCK_CPUS=4096 285CONFIG_SPLIT_PTLOCK_CPUS=4096
294# CONFIG_RESOURCES_64BIT is not set 286# CONFIG_PHYS_ADDR_T_64BIT is not set
295CONFIG_ZONE_DMA_FLAG=1 287CONFIG_ZONE_DMA_FLAG=1
296CONFIG_BOUNCE=y 288CONFIG_BOUNCE=y
297CONFIG_VIRT_TO_BUS=y 289CONFIG_VIRT_TO_BUS=y
290CONFIG_UNEVICTABLE_LRU=y
298CONFIG_ALIGNMENT_TRAP=y 291CONFIG_ALIGNMENT_TRAP=y
299 292
300# 293#
@@ -327,6 +320,8 @@ CONFIG_FPE_NWFPE=y
327# Userspace binary formats 320# Userspace binary formats
328# 321#
329CONFIG_BINFMT_ELF=y 322CONFIG_BINFMT_ELF=y
323# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
324CONFIG_HAVE_AOUT=y
330# CONFIG_BINFMT_AOUT is not set 325# CONFIG_BINFMT_AOUT is not set
331# CONFIG_BINFMT_MISC is not set 326# CONFIG_BINFMT_MISC is not set
332 327
@@ -345,6 +340,7 @@ CONFIG_NET=y
345# 340#
346# Networking options 341# Networking options
347# 342#
343CONFIG_COMPAT_NET_DEV_OPS=y
348CONFIG_PACKET=y 344CONFIG_PACKET=y
349CONFIG_PACKET_MMAP=y 345CONFIG_PACKET_MMAP=y
350CONFIG_UNIX=y 346CONFIG_UNIX=y
@@ -389,6 +385,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
389# CONFIG_TIPC is not set 385# CONFIG_TIPC is not set
390# CONFIG_ATM is not set 386# CONFIG_ATM is not set
391# CONFIG_BRIDGE is not set 387# CONFIG_BRIDGE is not set
388# CONFIG_NET_DSA is not set
392# CONFIG_VLAN_8021Q is not set 389# CONFIG_VLAN_8021Q is not set
393# CONFIG_DECNET is not set 390# CONFIG_DECNET is not set
394# CONFIG_LLC2 is not set 391# CONFIG_LLC2 is not set
@@ -399,6 +396,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
399# CONFIG_ECONET is not set 396# CONFIG_ECONET is not set
400# CONFIG_WAN_ROUTER is not set 397# CONFIG_WAN_ROUTER is not set
401# CONFIG_NET_SCHED is not set 398# CONFIG_NET_SCHED is not set
399# CONFIG_DCB is not set
402 400
403# 401#
404# Network testing 402# Network testing
@@ -420,8 +418,6 @@ CONFIG_BT_HIDP=m
420# 418#
421# Bluetooth device drivers 419# Bluetooth device drivers
422# 420#
423CONFIG_BT_HCIUSB=m
424CONFIG_BT_HCIUSB_SCO=y
425# CONFIG_BT_HCIBTUSB is not set 421# CONFIG_BT_HCIBTUSB is not set
426# CONFIG_BT_HCIBTSDIO is not set 422# CONFIG_BT_HCIBTSDIO is not set
427# CONFIG_BT_HCIUART is not set 423# CONFIG_BT_HCIUART is not set
@@ -434,15 +430,15 @@ CONFIG_BT_HCIUSB_SCO=y
434# CONFIG_BT_HCIBTUART is not set 430# CONFIG_BT_HCIBTUART is not set
435# CONFIG_BT_HCIVHCI is not set 431# CONFIG_BT_HCIVHCI is not set
436# CONFIG_AF_RXRPC is not set 432# CONFIG_AF_RXRPC is not set
437 433# CONFIG_PHONET is not set
438# 434CONFIG_WIRELESS=y
439# Wireless
440#
441# CONFIG_CFG80211 is not set 435# CONFIG_CFG80211 is not set
436CONFIG_WIRELESS_OLD_REGULATORY=y
442CONFIG_WIRELESS_EXT=y 437CONFIG_WIRELESS_EXT=y
443CONFIG_WIRELESS_EXT_SYSFS=y 438CONFIG_WIRELESS_EXT_SYSFS=y
439CONFIG_LIB80211=m
444# CONFIG_MAC80211 is not set 440# CONFIG_MAC80211 is not set
445# CONFIG_IEEE80211 is not set 441# CONFIG_WIMAX is not set
446# CONFIG_RFKILL is not set 442# CONFIG_RFKILL is not set
447# CONFIG_NET_9P is not set 443# CONFIG_NET_9P is not set
448 444
@@ -467,6 +463,7 @@ CONFIG_MTD=y
467# CONFIG_MTD_DEBUG is not set 463# CONFIG_MTD_DEBUG is not set
468# CONFIG_MTD_CONCAT is not set 464# CONFIG_MTD_CONCAT is not set
469CONFIG_MTD_PARTITIONS=y 465CONFIG_MTD_PARTITIONS=y
466# CONFIG_MTD_TESTS is not set
470# CONFIG_MTD_REDBOOT_PARTS is not set 467# CONFIG_MTD_REDBOOT_PARTS is not set
471CONFIG_MTD_CMDLINE_PARTS=y 468CONFIG_MTD_CMDLINE_PARTS=y
472# CONFIG_MTD_AFS_PARTS is not set 469# CONFIG_MTD_AFS_PARTS is not set
@@ -521,9 +518,7 @@ CONFIG_MTD_CFI_UTIL=y
521# 518#
522# CONFIG_MTD_COMPLEX_MAPPINGS is not set 519# CONFIG_MTD_COMPLEX_MAPPINGS is not set
523CONFIG_MTD_PHYSMAP=y 520CONFIG_MTD_PHYSMAP=y
524CONFIG_MTD_PHYSMAP_START=0x0 521# CONFIG_MTD_PHYSMAP_COMPAT is not set
525CONFIG_MTD_PHYSMAP_LEN=0x400000
526CONFIG_MTD_PHYSMAP_BANKWIDTH=2
527CONFIG_MTD_PXA2XX=y 522CONFIG_MTD_PXA2XX=y
528# CONFIG_MTD_ARM_INTEGRATOR is not set 523# CONFIG_MTD_ARM_INTEGRATOR is not set
529# CONFIG_MTD_IMPA7 is not set 524# CONFIG_MTD_IMPA7 is not set
@@ -535,6 +530,8 @@ CONFIG_MTD_PXA2XX=y
535# Self-contained MTD device drivers 530# Self-contained MTD device drivers
536# 531#
537# CONFIG_MTD_PMC551 is not set 532# CONFIG_MTD_PMC551 is not set
533# CONFIG_MTD_DATAFLASH is not set
534# CONFIG_MTD_M25P80 is not set
538# CONFIG_MTD_SLRAM is not set 535# CONFIG_MTD_SLRAM is not set
539# CONFIG_MTD_PHRAM is not set 536# CONFIG_MTD_PHRAM is not set
540# CONFIG_MTD_MTDRAM is not set 537# CONFIG_MTD_MTDRAM is not set
@@ -563,6 +560,12 @@ CONFIG_MTD_NAND_PLATFORM=y
563# CONFIG_MTD_ONENAND is not set 560# CONFIG_MTD_ONENAND is not set
564 561
565# 562#
563# LPDDR flash memory drivers
564#
565# CONFIG_MTD_LPDDR is not set
566# CONFIG_MTD_QINFO_PROBE is not set
567
568#
566# UBI - Unsorted block images 569# UBI - Unsorted block images
567# 570#
568# CONFIG_MTD_UBI is not set 571# CONFIG_MTD_UBI is not set
@@ -642,6 +645,8 @@ CONFIG_SCSI_LOWLEVEL=y
642# CONFIG_MEGARAID_LEGACY is not set 645# CONFIG_MEGARAID_LEGACY is not set
643# CONFIG_MEGARAID_SAS is not set 646# CONFIG_MEGARAID_SAS is not set
644# CONFIG_SCSI_HPTIOP is not set 647# CONFIG_SCSI_HPTIOP is not set
648# CONFIG_LIBFC is not set
649# CONFIG_FCOE is not set
645# CONFIG_SCSI_DMX3191D is not set 650# CONFIG_SCSI_DMX3191D is not set
646# CONFIG_SCSI_FUTURE_DOMAIN is not set 651# CONFIG_SCSI_FUTURE_DOMAIN is not set
647# CONFIG_SCSI_IPS is not set 652# CONFIG_SCSI_IPS is not set
@@ -756,26 +761,30 @@ CONFIG_MII=y
756CONFIG_DM9000=y 761CONFIG_DM9000=y
757CONFIG_DM9000_DEBUGLEVEL=1 762CONFIG_DM9000_DEBUGLEVEL=1
758# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set 763# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set
764# CONFIG_ENC28J60 is not set
759# CONFIG_SMC911X is not set 765# CONFIG_SMC911X is not set
766# CONFIG_SMSC911X is not set
760# CONFIG_NET_TULIP is not set 767# CONFIG_NET_TULIP is not set
761# CONFIG_HP100 is not set 768# CONFIG_HP100 is not set
762# CONFIG_IBM_NEW_EMAC_ZMII is not set 769# CONFIG_IBM_NEW_EMAC_ZMII is not set
763# CONFIG_IBM_NEW_EMAC_RGMII is not set 770# CONFIG_IBM_NEW_EMAC_RGMII is not set
764# CONFIG_IBM_NEW_EMAC_TAH is not set 771# CONFIG_IBM_NEW_EMAC_TAH is not set
765# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 772# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
773# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
774# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
775# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
766CONFIG_NET_PCI=y 776CONFIG_NET_PCI=y
767# CONFIG_PCNET32 is not set 777# CONFIG_PCNET32 is not set
768# CONFIG_AMD8111_ETH is not set 778# CONFIG_AMD8111_ETH is not set
769# CONFIG_ADAPTEC_STARFIRE is not set 779# CONFIG_ADAPTEC_STARFIRE is not set
770# CONFIG_B44 is not set 780# CONFIG_B44 is not set
771# CONFIG_FORCEDETH is not set 781# CONFIG_FORCEDETH is not set
772# CONFIG_EEPRO100 is not set
773# CONFIG_E100 is not set 782# CONFIG_E100 is not set
774# CONFIG_FEALNX is not set 783# CONFIG_FEALNX is not set
775# CONFIG_NATSEMI is not set 784# CONFIG_NATSEMI is not set
776# CONFIG_NE2K_PCI is not set 785# CONFIG_NE2K_PCI is not set
777# CONFIG_8139CP is not set 786# CONFIG_8139CP is not set
778CONFIG_8139TOO=y 787CONFIG_8139TOO=m
779# CONFIG_8139TOO_PIO is not set 788# CONFIG_8139TOO_PIO is not set
780# CONFIG_8139TOO_TUNE_TWISTER is not set 789# CONFIG_8139TOO_TUNE_TWISTER is not set
781# CONFIG_8139TOO_8129 is not set 790# CONFIG_8139TOO_8129 is not set
@@ -783,10 +792,12 @@ CONFIG_8139TOO=y
783# CONFIG_R6040 is not set 792# CONFIG_R6040 is not set
784# CONFIG_SIS900 is not set 793# CONFIG_SIS900 is not set
785# CONFIG_EPIC100 is not set 794# CONFIG_EPIC100 is not set
795# CONFIG_SMSC9420 is not set
786# CONFIG_SUNDANCE is not set 796# CONFIG_SUNDANCE is not set
787# CONFIG_TLAN is not set 797# CONFIG_TLAN is not set
788# CONFIG_VIA_RHINE is not set 798# CONFIG_VIA_RHINE is not set
789# CONFIG_SC92031 is not set 799# CONFIG_SC92031 is not set
800# CONFIG_ATL2 is not set
790# CONFIG_NETDEV_1000 is not set 801# CONFIG_NETDEV_1000 is not set
791# CONFIG_NETDEV_10000 is not set 802# CONFIG_NETDEV_10000 is not set
792# CONFIG_TR is not set 803# CONFIG_TR is not set
@@ -797,8 +808,6 @@ CONFIG_8139TOO=y
797# CONFIG_WLAN_PRE80211 is not set 808# CONFIG_WLAN_PRE80211 is not set
798CONFIG_WLAN_80211=y 809CONFIG_WLAN_80211=y
799# CONFIG_PCMCIA_RAYCS is not set 810# CONFIG_PCMCIA_RAYCS is not set
800# CONFIG_IPW2100 is not set
801# CONFIG_IPW2200 is not set
802CONFIG_LIBERTAS=m 811CONFIG_LIBERTAS=m
803# CONFIG_LIBERTAS_USB is not set 812# CONFIG_LIBERTAS_USB is not set
804# CONFIG_LIBERTAS_CS is not set 813# CONFIG_LIBERTAS_CS is not set
@@ -811,10 +820,16 @@ CONFIG_LIBERTAS_SDIO=m
811# CONFIG_PRISM54 is not set 820# CONFIG_PRISM54 is not set
812# CONFIG_USB_ZD1201 is not set 821# CONFIG_USB_ZD1201 is not set
813# CONFIG_USB_NET_RNDIS_WLAN is not set 822# CONFIG_USB_NET_RNDIS_WLAN is not set
823# CONFIG_IPW2100 is not set
824# CONFIG_IPW2200 is not set
814# CONFIG_IWLWIFI_LEDS is not set 825# CONFIG_IWLWIFI_LEDS is not set
815# CONFIG_HOSTAP is not set 826# CONFIG_HOSTAP is not set
816 827
817# 828#
829# Enable WiMAX (Networking options) to see the WiMAX drivers
830#
831
832#
818# USB Network Adapters 833# USB Network Adapters
819# 834#
820# CONFIG_USB_CATC is not set 835# CONFIG_USB_CATC is not set
@@ -879,22 +894,22 @@ CONFIG_KEYBOARD_PXA27x=m
879# CONFIG_INPUT_JOYSTICK is not set 894# CONFIG_INPUT_JOYSTICK is not set
880# CONFIG_INPUT_TABLET is not set 895# CONFIG_INPUT_TABLET is not set
881CONFIG_INPUT_TOUCHSCREEN=y 896CONFIG_INPUT_TOUCHSCREEN=y
897# CONFIG_TOUCHSCREEN_ADS7846 is not set
882# CONFIG_TOUCHSCREEN_FUJITSU is not set 898# CONFIG_TOUCHSCREEN_FUJITSU is not set
883# CONFIG_TOUCHSCREEN_GUNZE is not set 899# CONFIG_TOUCHSCREEN_GUNZE is not set
884# CONFIG_TOUCHSCREEN_ELO is not set 900# CONFIG_TOUCHSCREEN_ELO is not set
901# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
885# CONFIG_TOUCHSCREEN_MTOUCH is not set 902# CONFIG_TOUCHSCREEN_MTOUCH is not set
886# CONFIG_TOUCHSCREEN_INEXIO is not set 903# CONFIG_TOUCHSCREEN_INEXIO is not set
887# CONFIG_TOUCHSCREEN_MK712 is not set 904# CONFIG_TOUCHSCREEN_MK712 is not set
888# CONFIG_TOUCHSCREEN_PENMOUNT is not set 905# CONFIG_TOUCHSCREEN_PENMOUNT is not set
889# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 906# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
890# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 907# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
891CONFIG_TOUCHSCREEN_WM97XX=m 908CONFIG_TOUCHSCREEN_UCB1400=m
892# CONFIG_TOUCHSCREEN_WM9705 is not set 909# CONFIG_TOUCHSCREEN_WM97XX is not set
893CONFIG_TOUCHSCREEN_WM9712=y
894# CONFIG_TOUCHSCREEN_WM9713 is not set
895# CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE is not set
896# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 910# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
897# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 911# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
912# CONFIG_TOUCHSCREEN_TSC2007 is not set
898# CONFIG_INPUT_MISC is not set 913# CONFIG_INPUT_MISC is not set
899 914
900# 915#
@@ -933,6 +948,7 @@ CONFIG_SERIAL_CORE=y
933CONFIG_SERIAL_CORE_CONSOLE=y 948CONFIG_SERIAL_CORE_CONSOLE=y
934# CONFIG_SERIAL_JSM is not set 949# CONFIG_SERIAL_JSM is not set
935CONFIG_UNIX98_PTYS=y 950CONFIG_UNIX98_PTYS=y
951# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
936CONFIG_LEGACY_PTYS=y 952CONFIG_LEGACY_PTYS=y
937CONFIG_LEGACY_PTY_COUNT=16 953CONFIG_LEGACY_PTY_COUNT=16
938# CONFIG_IPMI_HANDLER is not set 954# CONFIG_IPMI_HANDLER is not set
@@ -1009,26 +1025,45 @@ CONFIG_I2C_PXA=y
1009# Miscellaneous I2C Chip support 1025# Miscellaneous I2C Chip support
1010# 1026#
1011# CONFIG_DS1682 is not set 1027# CONFIG_DS1682 is not set
1012# CONFIG_EEPROM_AT24 is not set 1028# CONFIG_AT24 is not set
1013# CONFIG_EEPROM_LEGACY is not set 1029# CONFIG_SENSORS_EEPROM is not set
1014# CONFIG_SENSORS_PCF8574 is not set 1030# CONFIG_SENSORS_PCF8574 is not set
1015# CONFIG_PCF8575 is not set 1031# CONFIG_PCF8575 is not set
1016# CONFIG_SENSORS_PCA9539 is not set 1032# CONFIG_SENSORS_PCA9539 is not set
1017# CONFIG_SENSORS_PCF8591 is not set 1033# CONFIG_SENSORS_PCF8591 is not set
1018# CONFIG_TPS65010 is not set
1019# CONFIG_SENSORS_MAX6875 is not set 1034# CONFIG_SENSORS_MAX6875 is not set
1020# CONFIG_SENSORS_TSL2550 is not set 1035# CONFIG_SENSORS_TSL2550 is not set
1021# CONFIG_I2C_DEBUG_CORE is not set 1036# CONFIG_I2C_DEBUG_CORE is not set
1022# CONFIG_I2C_DEBUG_ALGO is not set 1037# CONFIG_I2C_DEBUG_ALGO is not set
1023# CONFIG_I2C_DEBUG_BUS is not set 1038# CONFIG_I2C_DEBUG_BUS is not set
1024# CONFIG_I2C_DEBUG_CHIP is not set 1039# CONFIG_I2C_DEBUG_CHIP is not set
1025# CONFIG_SPI is not set 1040CONFIG_SPI=y
1041# CONFIG_SPI_DEBUG is not set
1042CONFIG_SPI_MASTER=y
1043
1044#
1045# SPI Master Controller Drivers
1046#
1047# CONFIG_SPI_BITBANG is not set
1048# CONFIG_SPI_GPIO is not set
1049CONFIG_SPI_PXA2XX=m
1050
1051#
1052# SPI Protocol Masters
1053#
1054# CONFIG_SPI_AT25 is not set
1055# CONFIG_SPI_SPIDEV is not set
1056# CONFIG_SPI_TLE62X0 is not set
1026CONFIG_ARCH_REQUIRE_GPIOLIB=y 1057CONFIG_ARCH_REQUIRE_GPIOLIB=y
1027CONFIG_GPIOLIB=y 1058CONFIG_GPIOLIB=y
1028# CONFIG_DEBUG_GPIO is not set 1059# CONFIG_DEBUG_GPIO is not set
1029# CONFIG_GPIO_SYSFS is not set 1060# CONFIG_GPIO_SYSFS is not set
1030 1061
1031# 1062#
1063# Memory mapped GPIO expanders:
1064#
1065
1066#
1032# I2C GPIO expanders: 1067# I2C GPIO expanders:
1033# 1068#
1034# CONFIG_GPIO_MAX732X is not set 1069# CONFIG_GPIO_MAX732X is not set
@@ -1043,17 +1078,19 @@ CONFIG_GPIOLIB=y
1043# 1078#
1044# SPI GPIO expanders: 1079# SPI GPIO expanders:
1045# 1080#
1081# CONFIG_GPIO_MAX7301 is not set
1082# CONFIG_GPIO_MCP23S08 is not set
1046# CONFIG_W1 is not set 1083# CONFIG_W1 is not set
1047# CONFIG_POWER_SUPPLY is not set 1084# CONFIG_POWER_SUPPLY is not set
1048# CONFIG_HWMON is not set 1085# CONFIG_HWMON is not set
1049# CONFIG_THERMAL is not set 1086# CONFIG_THERMAL is not set
1050# CONFIG_THERMAL_HWMON is not set 1087# CONFIG_THERMAL_HWMON is not set
1051# CONFIG_WATCHDOG is not set 1088# CONFIG_WATCHDOG is not set
1089CONFIG_SSB_POSSIBLE=y
1052 1090
1053# 1091#
1054# Sonics Silicon Backplane 1092# Sonics Silicon Backplane
1055# 1093#
1056CONFIG_SSB_POSSIBLE=y
1057# CONFIG_SSB is not set 1094# CONFIG_SSB is not set
1058 1095
1059# 1096#
@@ -1064,11 +1101,17 @@ CONFIG_SSB_POSSIBLE=y
1064# CONFIG_MFD_ASIC3 is not set 1101# CONFIG_MFD_ASIC3 is not set
1065# CONFIG_HTC_EGPIO is not set 1102# CONFIG_HTC_EGPIO is not set
1066# CONFIG_HTC_PASIC3 is not set 1103# CONFIG_HTC_PASIC3 is not set
1067# CONFIG_UCB1400_CORE is not set 1104CONFIG_UCB1400_CORE=m
1105# CONFIG_TPS65010 is not set
1106# CONFIG_TWL4030_CORE is not set
1068# CONFIG_MFD_TMIO is not set 1107# CONFIG_MFD_TMIO is not set
1069# CONFIG_MFD_T7L66XB is not set 1108# CONFIG_MFD_T7L66XB is not set
1070# CONFIG_MFD_TC6387XB is not set 1109# CONFIG_MFD_TC6387XB is not set
1071# CONFIG_MFD_TC6393XB is not set 1110# CONFIG_MFD_TC6393XB is not set
1111# CONFIG_PMIC_DA903X is not set
1112# CONFIG_MFD_WM8400 is not set
1113# CONFIG_MFD_WM8350_I2C is not set
1114# CONFIG_MFD_PCF50633 is not set
1072 1115
1073# 1116#
1074# Multimedia devices 1117# Multimedia devices
@@ -1077,13 +1120,117 @@ CONFIG_SSB_POSSIBLE=y
1077# 1120#
1078# Multimedia core support 1121# Multimedia core support
1079# 1122#
1080# CONFIG_VIDEO_DEV is not set 1123CONFIG_VIDEO_DEV=m
1124CONFIG_VIDEO_V4L2_COMMON=m
1125# CONFIG_VIDEO_ALLOW_V4L1 is not set
1126CONFIG_VIDEO_V4L1_COMPAT=y
1081# CONFIG_DVB_CORE is not set 1127# CONFIG_DVB_CORE is not set
1082# CONFIG_VIDEO_MEDIA is not set 1128CONFIG_VIDEO_MEDIA=m
1083 1129
1084# 1130#
1085# Multimedia drivers 1131# Multimedia drivers
1086# 1132#
1133# CONFIG_MEDIA_ATTACH is not set
1134CONFIG_MEDIA_TUNER=m
1135CONFIG_MEDIA_TUNER_CUSTOMIZE=y
1136# CONFIG_MEDIA_TUNER_SIMPLE is not set
1137# CONFIG_MEDIA_TUNER_TDA8290 is not set
1138# CONFIG_MEDIA_TUNER_TDA827X is not set
1139# CONFIG_MEDIA_TUNER_TDA18271 is not set
1140# CONFIG_MEDIA_TUNER_TDA9887 is not set
1141# CONFIG_MEDIA_TUNER_TEA5761 is not set
1142# CONFIG_MEDIA_TUNER_TEA5767 is not set
1143# CONFIG_MEDIA_TUNER_MT20XX is not set
1144# CONFIG_MEDIA_TUNER_MT2060 is not set
1145# CONFIG_MEDIA_TUNER_MT2266 is not set
1146# CONFIG_MEDIA_TUNER_MT2131 is not set
1147# CONFIG_MEDIA_TUNER_QT1010 is not set
1148# CONFIG_MEDIA_TUNER_XC2028 is not set
1149# CONFIG_MEDIA_TUNER_XC5000 is not set
1150# CONFIG_MEDIA_TUNER_MXL5005S is not set
1151# CONFIG_MEDIA_TUNER_MXL5007T is not set
1152CONFIG_VIDEO_V4L2=m
1153CONFIG_VIDEOBUF_GEN=m
1154CONFIG_VIDEOBUF_DMA_SG=m
1155CONFIG_VIDEO_CAPTURE_DRIVERS=y
1156# CONFIG_VIDEO_ADV_DEBUG is not set
1157# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
1158# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
1159
1160#
1161# Encoders/decoders and other helper chips
1162#
1163
1164#
1165# Audio decoders
1166#
1167# CONFIG_VIDEO_TVAUDIO is not set
1168# CONFIG_VIDEO_TDA7432 is not set
1169# CONFIG_VIDEO_TDA9840 is not set
1170# CONFIG_VIDEO_TDA9875 is not set
1171# CONFIG_VIDEO_TEA6415C is not set
1172# CONFIG_VIDEO_TEA6420 is not set
1173# CONFIG_VIDEO_MSP3400 is not set
1174# CONFIG_VIDEO_CS5345 is not set
1175# CONFIG_VIDEO_CS53L32A is not set
1176# CONFIG_VIDEO_M52790 is not set
1177# CONFIG_VIDEO_TLV320AIC23B is not set
1178# CONFIG_VIDEO_WM8775 is not set
1179# CONFIG_VIDEO_WM8739 is not set
1180# CONFIG_VIDEO_VP27SMPX is not set
1181
1182#
1183# Video decoders
1184#
1185# CONFIG_VIDEO_OV7670 is not set
1186# CONFIG_VIDEO_TCM825X is not set
1187# CONFIG_VIDEO_SAA711X is not set
1188# CONFIG_VIDEO_SAA717X is not set
1189# CONFIG_VIDEO_TVP514X is not set
1190# CONFIG_VIDEO_TVP5150 is not set
1191
1192#
1193# Video and audio decoders
1194#
1195# CONFIG_VIDEO_CX25840 is not set
1196
1197#
1198# MPEG video encoders
1199#
1200# CONFIG_VIDEO_CX2341X is not set
1201
1202#
1203# Video encoders
1204#
1205# CONFIG_VIDEO_SAA7127 is not set
1206
1207#
1208# Video improvement chips
1209#
1210# CONFIG_VIDEO_UPD64031A is not set
1211# CONFIG_VIDEO_UPD64083 is not set
1212# CONFIG_VIDEO_VIVI is not set
1213# CONFIG_VIDEO_BT848 is not set
1214# CONFIG_VIDEO_SAA5246A is not set
1215# CONFIG_VIDEO_SAA5249 is not set
1216# CONFIG_VIDEO_SAA7134 is not set
1217# CONFIG_VIDEO_HEXIUM_ORION is not set
1218# CONFIG_VIDEO_HEXIUM_GEMINI is not set
1219# CONFIG_VIDEO_CX88 is not set
1220# CONFIG_VIDEO_IVTV is not set
1221# CONFIG_VIDEO_CAFE_CCIC is not set
1222CONFIG_SOC_CAMERA=m
1223# CONFIG_SOC_CAMERA_MT9M001 is not set
1224CONFIG_SOC_CAMERA_MT9M111=m
1225# CONFIG_SOC_CAMERA_MT9T031 is not set
1226# CONFIG_SOC_CAMERA_MT9V022 is not set
1227# CONFIG_SOC_CAMERA_TW9910 is not set
1228# CONFIG_SOC_CAMERA_PLATFORM is not set
1229# CONFIG_SOC_CAMERA_OV772X is not set
1230CONFIG_VIDEO_PXA27x=m
1231# CONFIG_VIDEO_SH_MOBILE_CEU is not set
1232# CONFIG_V4L_USB_DRIVERS is not set
1233# CONFIG_RADIO_ADAPTERS is not set
1087# CONFIG_DAB is not set 1234# CONFIG_DAB is not set
1088 1235
1089# 1236#
@@ -1095,6 +1242,7 @@ CONFIG_SSB_POSSIBLE=y
1095CONFIG_FB=y 1242CONFIG_FB=y
1096# CONFIG_FIRMWARE_EDID is not set 1243# CONFIG_FIRMWARE_EDID is not set
1097# CONFIG_FB_DDC is not set 1244# CONFIG_FB_DDC is not set
1245# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1098CONFIG_FB_CFB_FILLRECT=y 1246CONFIG_FB_CFB_FILLRECT=y
1099CONFIG_FB_CFB_COPYAREA=y 1247CONFIG_FB_CFB_COPYAREA=y
1100CONFIG_FB_CFB_IMAGEBLIT=y 1248CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1128,6 +1276,7 @@ CONFIG_FB_CFB_IMAGEBLIT=y
1128# CONFIG_FB_S3 is not set 1276# CONFIG_FB_S3 is not set
1129# CONFIG_FB_SAVAGE is not set 1277# CONFIG_FB_SAVAGE is not set
1130# CONFIG_FB_SIS is not set 1278# CONFIG_FB_SIS is not set
1279# CONFIG_FB_VIA is not set
1131# CONFIG_FB_NEOMAGIC is not set 1280# CONFIG_FB_NEOMAGIC is not set
1132# CONFIG_FB_KYRO is not set 1281# CONFIG_FB_KYRO is not set
1133# CONFIG_FB_3DFX is not set 1282# CONFIG_FB_3DFX is not set
@@ -1138,13 +1287,17 @@ CONFIG_FB_CFB_IMAGEBLIT=y
1138# CONFIG_FB_PM3 is not set 1287# CONFIG_FB_PM3 is not set
1139# CONFIG_FB_CARMINE is not set 1288# CONFIG_FB_CARMINE is not set
1140CONFIG_FB_PXA=y 1289CONFIG_FB_PXA=y
1290# CONFIG_FB_PXA_OVERLAY is not set
1141# CONFIG_FB_PXA_SMARTPANEL is not set 1291# CONFIG_FB_PXA_SMARTPANEL is not set
1142CONFIG_FB_PXA_PARAMETERS=y 1292CONFIG_FB_PXA_PARAMETERS=y
1143CONFIG_FB_MBX=m 1293CONFIG_FB_MBX=m
1144# CONFIG_FB_W100 is not set 1294# CONFIG_FB_W100 is not set
1145# CONFIG_FB_VIRTUAL is not set 1295# CONFIG_FB_VIRTUAL is not set
1146# CONFIG_FB_METRONOME is not set 1296# CONFIG_FB_METRONOME is not set
1147# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1297# CONFIG_FB_MB862XX is not set
1298CONFIG_BACKLIGHT_LCD_SUPPORT=y
1299# CONFIG_LCD_CLASS_DEVICE is not set
1300# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
1148 1301
1149# 1302#
1150# Display device support 1303# Display device support
@@ -1167,6 +1320,7 @@ CONFIG_LOGO_LINUX_MONO=y
1167CONFIG_LOGO_LINUX_VGA16=y 1320CONFIG_LOGO_LINUX_VGA16=y
1168CONFIG_LOGO_LINUX_CLUT224=y 1321CONFIG_LOGO_LINUX_CLUT224=y
1169CONFIG_SOUND=m 1322CONFIG_SOUND=m
1323CONFIG_SOUND_OSS_CORE=y
1170CONFIG_SND=m 1324CONFIG_SND=m
1171CONFIG_SND_TIMER=m 1325CONFIG_SND_TIMER=m
1172CONFIG_SND_PCM=m 1326CONFIG_SND_PCM=m
@@ -1182,81 +1336,16 @@ CONFIG_SND_VERBOSE_PROCFS=y
1182# CONFIG_SND_DEBUG is not set 1336# CONFIG_SND_DEBUG is not set
1183CONFIG_SND_VMASTER=y 1337CONFIG_SND_VMASTER=y
1184CONFIG_SND_AC97_CODEC=m 1338CONFIG_SND_AC97_CODEC=m
1185CONFIG_SND_DRIVERS=y 1339# CONFIG_SND_DRIVERS is not set
1186# CONFIG_SND_DUMMY is not set 1340# CONFIG_SND_PCI is not set
1187# CONFIG_SND_MTPAV is not set
1188# CONFIG_SND_SERIAL_U16550 is not set
1189# CONFIG_SND_MPU401 is not set
1190# CONFIG_SND_AC97_POWER_SAVE is not set
1191CONFIG_SND_PCI=y
1192# CONFIG_SND_AD1889 is not set
1193# CONFIG_SND_ALS300 is not set
1194# CONFIG_SND_ALI5451 is not set
1195# CONFIG_SND_ATIIXP is not set
1196# CONFIG_SND_ATIIXP_MODEM is not set
1197# CONFIG_SND_AU8810 is not set
1198# CONFIG_SND_AU8820 is not set
1199# CONFIG_SND_AU8830 is not set
1200# CONFIG_SND_AW2 is not set
1201# CONFIG_SND_AZT3328 is not set
1202# CONFIG_SND_BT87X is not set
1203# CONFIG_SND_CA0106 is not set
1204# CONFIG_SND_CMIPCI is not set
1205# CONFIG_SND_OXYGEN is not set
1206# CONFIG_SND_CS4281 is not set
1207# CONFIG_SND_CS46XX is not set
1208# CONFIG_SND_DARLA20 is not set
1209# CONFIG_SND_GINA20 is not set
1210# CONFIG_SND_LAYLA20 is not set
1211# CONFIG_SND_DARLA24 is not set
1212# CONFIG_SND_GINA24 is not set
1213# CONFIG_SND_LAYLA24 is not set
1214# CONFIG_SND_MONA is not set
1215# CONFIG_SND_MIA is not set
1216# CONFIG_SND_ECHO3G is not set
1217# CONFIG_SND_INDIGO is not set
1218# CONFIG_SND_INDIGOIO is not set
1219# CONFIG_SND_INDIGODJ is not set
1220# CONFIG_SND_EMU10K1 is not set
1221# CONFIG_SND_EMU10K1X is not set
1222# CONFIG_SND_ENS1370 is not set
1223# CONFIG_SND_ENS1371 is not set
1224# CONFIG_SND_ES1938 is not set
1225# CONFIG_SND_ES1968 is not set
1226# CONFIG_SND_FM801 is not set
1227# CONFIG_SND_HDA_INTEL is not set
1228# CONFIG_SND_HDSP is not set
1229# CONFIG_SND_HDSPM is not set
1230# CONFIG_SND_HIFIER is not set
1231# CONFIG_SND_ICE1712 is not set
1232# CONFIG_SND_ICE1724 is not set
1233# CONFIG_SND_INTEL8X0 is not set
1234# CONFIG_SND_INTEL8X0M is not set
1235# CONFIG_SND_KORG1212 is not set
1236# CONFIG_SND_MAESTRO3 is not set
1237# CONFIG_SND_MIXART is not set
1238# CONFIG_SND_NM256 is not set
1239# CONFIG_SND_PCXHR is not set
1240# CONFIG_SND_RIPTIDE is not set
1241# CONFIG_SND_RME32 is not set
1242# CONFIG_SND_RME96 is not set
1243# CONFIG_SND_RME9652 is not set
1244# CONFIG_SND_SONICVIBES is not set
1245# CONFIG_SND_TRIDENT is not set
1246# CONFIG_SND_VIA82XX is not set
1247# CONFIG_SND_VIA82XX_MODEM is not set
1248# CONFIG_SND_VIRTUOSO is not set
1249# CONFIG_SND_VX222 is not set
1250# CONFIG_SND_YMFPCI is not set
1251CONFIG_SND_ARM=y 1341CONFIG_SND_ARM=y
1252CONFIG_SND_PXA2XX_PCM=m 1342CONFIG_SND_PXA2XX_PCM=m
1343CONFIG_SND_PXA2XX_LIB=m
1344CONFIG_SND_PXA2XX_LIB_AC97=y
1253CONFIG_SND_PXA2XX_AC97=m 1345CONFIG_SND_PXA2XX_AC97=m
1254CONFIG_SND_USB=y 1346# CONFIG_SND_SPI is not set
1255# CONFIG_SND_USB_AUDIO is not set 1347# CONFIG_SND_USB is not set
1256# CONFIG_SND_USB_CAIAQ is not set 1348# CONFIG_SND_PCMCIA is not set
1257CONFIG_SND_PCMCIA=y
1258# CONFIG_SND_VXPOCKET is not set
1259# CONFIG_SND_PDAUDIOCF is not set
1260# CONFIG_SND_SOC is not set 1349# CONFIG_SND_SOC is not set
1261# CONFIG_SOUND_PRIME is not set 1350# CONFIG_SOUND_PRIME is not set
1262CONFIG_AC97_BUS=m 1351CONFIG_AC97_BUS=m
@@ -1269,9 +1358,37 @@ CONFIG_HID_DEBUG=y
1269# USB Input Devices 1358# USB Input Devices
1270# 1359#
1271CONFIG_USB_HID=y 1360CONFIG_USB_HID=y
1272# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1361# CONFIG_HID_PID is not set
1273# CONFIG_HID_FF is not set
1274# CONFIG_USB_HIDDEV is not set 1362# CONFIG_USB_HIDDEV is not set
1363
1364#
1365# Special HID drivers
1366#
1367CONFIG_HID_COMPAT=y
1368CONFIG_HID_A4TECH=y
1369CONFIG_HID_APPLE=y
1370CONFIG_HID_BELKIN=y
1371CONFIG_HID_CHERRY=y
1372CONFIG_HID_CHICONY=y
1373CONFIG_HID_CYPRESS=y
1374CONFIG_HID_EZKEY=y
1375CONFIG_HID_GYRATION=y
1376CONFIG_HID_LOGITECH=y
1377# CONFIG_LOGITECH_FF is not set
1378# CONFIG_LOGIRUMBLEPAD2_FF is not set
1379CONFIG_HID_MICROSOFT=y
1380CONFIG_HID_MONTEREY=y
1381# CONFIG_HID_NTRIG is not set
1382CONFIG_HID_PANTHERLORD=y
1383# CONFIG_PANTHERLORD_FF is not set
1384CONFIG_HID_PETALYNX=y
1385CONFIG_HID_SAMSUNG=y
1386CONFIG_HID_SONY=y
1387CONFIG_HID_SUNPLUS=y
1388# CONFIG_GREENASIA_FF is not set
1389# CONFIG_HID_TOPSEED is not set
1390# CONFIG_THRUSTMASTER_FF is not set
1391# CONFIG_ZEROPLUS_FF is not set
1275CONFIG_USB_SUPPORT=y 1392CONFIG_USB_SUPPORT=y
1276CONFIG_USB_ARCH_HAS_HCD=y 1393CONFIG_USB_ARCH_HAS_HCD=y
1277CONFIG_USB_ARCH_HAS_OHCI=y 1394CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1291,12 +1408,15 @@ CONFIG_USB_DEVICEFS=y
1291# CONFIG_USB_OTG_WHITELIST is not set 1408# CONFIG_USB_OTG_WHITELIST is not set
1292# CONFIG_USB_OTG_BLACKLIST_HUB is not set 1409# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1293CONFIG_USB_MON=y 1410CONFIG_USB_MON=y
1411# CONFIG_USB_WUSB is not set
1412# CONFIG_USB_WUSB_CBAF is not set
1294 1413
1295# 1414#
1296# USB Host Controller Drivers 1415# USB Host Controller Drivers
1297# 1416#
1298# CONFIG_USB_C67X00_HCD is not set 1417# CONFIG_USB_C67X00_HCD is not set
1299# CONFIG_USB_EHCI_HCD is not set 1418# CONFIG_USB_EHCI_HCD is not set
1419# CONFIG_USB_OXU210HP_HCD is not set
1300# CONFIG_USB_ISP116X_HCD is not set 1420# CONFIG_USB_ISP116X_HCD is not set
1301# CONFIG_USB_ISP1760_HCD is not set 1421# CONFIG_USB_ISP1760_HCD is not set
1302CONFIG_USB_OHCI_HCD=y 1422CONFIG_USB_OHCI_HCD=y
@@ -1306,6 +1426,8 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1306# CONFIG_USB_UHCI_HCD is not set 1426# CONFIG_USB_UHCI_HCD is not set
1307# CONFIG_USB_SL811_HCD is not set 1427# CONFIG_USB_SL811_HCD is not set
1308# CONFIG_USB_R8A66597_HCD is not set 1428# CONFIG_USB_R8A66597_HCD is not set
1429# CONFIG_USB_WHCI_HCD is not set
1430# CONFIG_USB_HWA_HCD is not set
1309# CONFIG_USB_MUSB_HDRC is not set 1431# CONFIG_USB_MUSB_HDRC is not set
1310 1432
1311# 1433#
@@ -1314,20 +1436,20 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1314# CONFIG_USB_ACM is not set 1436# CONFIG_USB_ACM is not set
1315# CONFIG_USB_PRINTER is not set 1437# CONFIG_USB_PRINTER is not set
1316# CONFIG_USB_WDM is not set 1438# CONFIG_USB_WDM is not set
1439# CONFIG_USB_TMC is not set
1317 1440
1318# 1441#
1319# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1442# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1320# 1443#
1321 1444
1322# 1445#
1323# may also be needed; see USB_STORAGE Help for more information 1446# see USB_STORAGE Help for more information
1324# 1447#
1325CONFIG_USB_STORAGE=y 1448CONFIG_USB_STORAGE=y
1326# CONFIG_USB_STORAGE_DEBUG is not set 1449# CONFIG_USB_STORAGE_DEBUG is not set
1327# CONFIG_USB_STORAGE_DATAFAB is not set 1450# CONFIG_USB_STORAGE_DATAFAB is not set
1328# CONFIG_USB_STORAGE_FREECOM is not set 1451# CONFIG_USB_STORAGE_FREECOM is not set
1329# CONFIG_USB_STORAGE_ISD200 is not set 1452# CONFIG_USB_STORAGE_ISD200 is not set
1330# CONFIG_USB_STORAGE_DPCM is not set
1331# CONFIG_USB_STORAGE_USBAT is not set 1453# CONFIG_USB_STORAGE_USBAT is not set
1332# CONFIG_USB_STORAGE_SDDR09 is not set 1454# CONFIG_USB_STORAGE_SDDR09 is not set
1333# CONFIG_USB_STORAGE_SDDR55 is not set 1455# CONFIG_USB_STORAGE_SDDR55 is not set
@@ -1355,6 +1477,7 @@ CONFIG_USB_STORAGE=y
1355# CONFIG_USB_EMI62 is not set 1477# CONFIG_USB_EMI62 is not set
1356# CONFIG_USB_EMI26 is not set 1478# CONFIG_USB_EMI26 is not set
1357# CONFIG_USB_ADUTUX is not set 1479# CONFIG_USB_ADUTUX is not set
1480# CONFIG_USB_SEVSEG is not set
1358# CONFIG_USB_RIO500 is not set 1481# CONFIG_USB_RIO500 is not set
1359# CONFIG_USB_LEGOTOWER is not set 1482# CONFIG_USB_LEGOTOWER is not set
1360# CONFIG_USB_LCD is not set 1483# CONFIG_USB_LCD is not set
@@ -1371,13 +1494,20 @@ CONFIG_USB_STORAGE=y
1371# CONFIG_USB_IOWARRIOR is not set 1494# CONFIG_USB_IOWARRIOR is not set
1372# CONFIG_USB_TEST is not set 1495# CONFIG_USB_TEST is not set
1373# CONFIG_USB_ISIGHTFW is not set 1496# CONFIG_USB_ISIGHTFW is not set
1497# CONFIG_USB_VST is not set
1374# CONFIG_USB_GADGET is not set 1498# CONFIG_USB_GADGET is not set
1499
1500#
1501# OTG and related infrastructure
1502#
1503# CONFIG_USB_GPIO_VBUS is not set
1504# CONFIG_UWB is not set
1375CONFIG_MMC=m 1505CONFIG_MMC=m
1376# CONFIG_MMC_DEBUG is not set 1506# CONFIG_MMC_DEBUG is not set
1377# CONFIG_MMC_UNSAFE_RESUME is not set 1507# CONFIG_MMC_UNSAFE_RESUME is not set
1378 1508
1379# 1509#
1380# MMC/SD Card Drivers 1510# MMC/SD/SDIO Card Drivers
1381# 1511#
1382CONFIG_MMC_BLOCK=m 1512CONFIG_MMC_BLOCK=m
1383CONFIG_MMC_BLOCK_BOUNCE=y 1513CONFIG_MMC_BLOCK_BOUNCE=y
@@ -1385,11 +1515,12 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1385# CONFIG_MMC_TEST is not set 1515# CONFIG_MMC_TEST is not set
1386 1516
1387# 1517#
1388# MMC/SD Host Controller Drivers 1518# MMC/SD/SDIO Host Controller Drivers
1389# 1519#
1390CONFIG_MMC_PXA=m 1520CONFIG_MMC_PXA=m
1391# CONFIG_MMC_SDHCI is not set 1521# CONFIG_MMC_SDHCI is not set
1392# CONFIG_MMC_TIFM_SD is not set 1522# CONFIG_MMC_TIFM_SD is not set
1523# CONFIG_MMC_SPI is not set
1393# CONFIG_MMC_SDRICOH_CS is not set 1524# CONFIG_MMC_SDRICOH_CS is not set
1394# CONFIG_MEMSTICK is not set 1525# CONFIG_MEMSTICK is not set
1395# CONFIG_ACCESSIBILITY is not set 1526# CONFIG_ACCESSIBILITY is not set
@@ -1400,8 +1531,7 @@ CONFIG_LEDS_CLASS=y
1400# LED drivers 1531# LED drivers
1401# 1532#
1402# CONFIG_LEDS_PCA9532 is not set 1533# CONFIG_LEDS_PCA9532 is not set
1403# CONFIG_LEDS_GPIO is not set 1534CONFIG_LEDS_GPIO=m
1404CONFIG_LEDS_CM_X270=y
1405# CONFIG_LEDS_PCA955X is not set 1535# CONFIG_LEDS_PCA955X is not set
1406 1536
1407# 1537#
@@ -1410,6 +1540,7 @@ CONFIG_LEDS_CM_X270=y
1410CONFIG_LEDS_TRIGGERS=y 1540CONFIG_LEDS_TRIGGERS=y
1411# CONFIG_LEDS_TRIGGER_TIMER is not set 1541# CONFIG_LEDS_TRIGGER_TIMER is not set
1412CONFIG_LEDS_TRIGGER_HEARTBEAT=y 1542CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1543# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1413# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set 1544# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1414CONFIG_RTC_LIB=y 1545CONFIG_RTC_LIB=y
1415CONFIG_RTC_CLASS=y 1546CONFIG_RTC_CLASS=y
@@ -1441,37 +1572,43 @@ CONFIG_RTC_INTF_DEV=y
1441# CONFIG_RTC_DRV_M41T80 is not set 1572# CONFIG_RTC_DRV_M41T80 is not set
1442# CONFIG_RTC_DRV_S35390A is not set 1573# CONFIG_RTC_DRV_S35390A is not set
1443# CONFIG_RTC_DRV_FM3130 is not set 1574# CONFIG_RTC_DRV_FM3130 is not set
1575# CONFIG_RTC_DRV_RX8581 is not set
1444 1576
1445# 1577#
1446# SPI RTC drivers 1578# SPI RTC drivers
1447# 1579#
1580# CONFIG_RTC_DRV_M41T94 is not set
1581# CONFIG_RTC_DRV_DS1305 is not set
1582# CONFIG_RTC_DRV_DS1390 is not set
1583# CONFIG_RTC_DRV_MAX6902 is not set
1584# CONFIG_RTC_DRV_R9701 is not set
1585# CONFIG_RTC_DRV_RS5C348 is not set
1586# CONFIG_RTC_DRV_DS3234 is not set
1448 1587
1449# 1588#
1450# Platform RTC drivers 1589# Platform RTC drivers
1451# 1590#
1452# CONFIG_RTC_DRV_CMOS is not set 1591# CONFIG_RTC_DRV_CMOS is not set
1592# CONFIG_RTC_DRV_DS1286 is not set
1453# CONFIG_RTC_DRV_DS1511 is not set 1593# CONFIG_RTC_DRV_DS1511 is not set
1454# CONFIG_RTC_DRV_DS1553 is not set 1594# CONFIG_RTC_DRV_DS1553 is not set
1455# CONFIG_RTC_DRV_DS1742 is not set 1595# CONFIG_RTC_DRV_DS1742 is not set
1456# CONFIG_RTC_DRV_STK17TA8 is not set 1596# CONFIG_RTC_DRV_STK17TA8 is not set
1457# CONFIG_RTC_DRV_M48T86 is not set 1597# CONFIG_RTC_DRV_M48T86 is not set
1598# CONFIG_RTC_DRV_M48T35 is not set
1458# CONFIG_RTC_DRV_M48T59 is not set 1599# CONFIG_RTC_DRV_M48T59 is not set
1600# CONFIG_RTC_DRV_BQ4802 is not set
1459CONFIG_RTC_DRV_V3020=y 1601CONFIG_RTC_DRV_V3020=y
1460 1602
1461# 1603#
1462# on-CPU RTC drivers 1604# on-CPU RTC drivers
1463# 1605#
1464CONFIG_RTC_DRV_SA1100=y 1606CONFIG_RTC_DRV_SA1100=y
1607# CONFIG_RTC_DRV_PXA is not set
1465# CONFIG_DMADEVICES is not set 1608# CONFIG_DMADEVICES is not set
1466
1467#
1468# Voltage and Current regulators
1469#
1470# CONFIG_REGULATOR is not set 1609# CONFIG_REGULATOR is not set
1471# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1472# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1473# CONFIG_REGULATOR_BQ24022 is not set
1474# CONFIG_UIO is not set 1610# CONFIG_UIO is not set
1611# CONFIG_STAGING is not set
1475 1612
1476# 1613#
1477# File systems 1614# File systems
@@ -1483,14 +1620,16 @@ CONFIG_EXT3_FS=y
1483CONFIG_EXT3_FS_XATTR=y 1620CONFIG_EXT3_FS_XATTR=y
1484# CONFIG_EXT3_FS_POSIX_ACL is not set 1621# CONFIG_EXT3_FS_POSIX_ACL is not set
1485# CONFIG_EXT3_FS_SECURITY is not set 1622# CONFIG_EXT3_FS_SECURITY is not set
1486# CONFIG_EXT4DEV_FS is not set 1623# CONFIG_EXT4_FS is not set
1487CONFIG_JBD=y 1624CONFIG_JBD=y
1488CONFIG_FS_MBCACHE=y 1625CONFIG_FS_MBCACHE=y
1489# CONFIG_REISERFS_FS is not set 1626# CONFIG_REISERFS_FS is not set
1490# CONFIG_JFS_FS is not set 1627# CONFIG_JFS_FS is not set
1491# CONFIG_FS_POSIX_ACL is not set 1628# CONFIG_FS_POSIX_ACL is not set
1629CONFIG_FILE_LOCKING=y
1492# CONFIG_XFS_FS is not set 1630# CONFIG_XFS_FS is not set
1493# CONFIG_OCFS2_FS is not set 1631# CONFIG_OCFS2_FS is not set
1632# CONFIG_BTRFS_FS is not set
1494CONFIG_DNOTIFY=y 1633CONFIG_DNOTIFY=y
1495CONFIG_INOTIFY=y 1634CONFIG_INOTIFY=y
1496CONFIG_INOTIFY_USER=y 1635CONFIG_INOTIFY_USER=y
@@ -1520,15 +1659,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1520# 1659#
1521CONFIG_PROC_FS=y 1660CONFIG_PROC_FS=y
1522CONFIG_PROC_SYSCTL=y 1661CONFIG_PROC_SYSCTL=y
1662# CONFIG_PROC_PAGE_MONITOR is not set
1523CONFIG_SYSFS=y 1663CONFIG_SYSFS=y
1524CONFIG_TMPFS=y 1664CONFIG_TMPFS=y
1525# CONFIG_TMPFS_POSIX_ACL is not set 1665# CONFIG_TMPFS_POSIX_ACL is not set
1526# CONFIG_HUGETLB_PAGE is not set 1666# CONFIG_HUGETLB_PAGE is not set
1527# CONFIG_CONFIGFS_FS is not set 1667# CONFIG_CONFIGFS_FS is not set
1528 1668CONFIG_MISC_FILESYSTEMS=y
1529#
1530# Miscellaneous filesystems
1531#
1532# CONFIG_ADFS_FS is not set 1669# CONFIG_ADFS_FS is not set
1533# CONFIG_AFFS_FS is not set 1670# CONFIG_AFFS_FS is not set
1534# CONFIG_HFS_FS is not set 1671# CONFIG_HFS_FS is not set
@@ -1548,6 +1685,7 @@ CONFIG_JFFS2_ZLIB=y
1548CONFIG_JFFS2_RTIME=y 1685CONFIG_JFFS2_RTIME=y
1549# CONFIG_JFFS2_RUBIN is not set 1686# CONFIG_JFFS2_RUBIN is not set
1550# CONFIG_CRAMFS is not set 1687# CONFIG_CRAMFS is not set
1688# CONFIG_SQUASHFS is not set
1551# CONFIG_VXFS_FS is not set 1689# CONFIG_VXFS_FS is not set
1552# CONFIG_MINIX_FS is not set 1690# CONFIG_MINIX_FS is not set
1553# CONFIG_OMFS_FS is not set 1691# CONFIG_OMFS_FS is not set
@@ -1567,6 +1705,7 @@ CONFIG_LOCKD=y
1567CONFIG_LOCKD_V4=y 1705CONFIG_LOCKD_V4=y
1568CONFIG_NFS_COMMON=y 1706CONFIG_NFS_COMMON=y
1569CONFIG_SUNRPC=y 1707CONFIG_SUNRPC=y
1708# CONFIG_SUNRPC_REGISTER_V4 is not set
1570# CONFIG_RPCSEC_GSS_KRB5 is not set 1709# CONFIG_RPCSEC_GSS_KRB5 is not set
1571# CONFIG_RPCSEC_GSS_SPKM3 is not set 1710# CONFIG_RPCSEC_GSS_SPKM3 is not set
1572# CONFIG_SMB_FS is not set 1711# CONFIG_SMB_FS is not set
@@ -1678,19 +1817,29 @@ CONFIG_DEBUG_KERNEL=y
1678# CONFIG_DEBUG_MEMORY_INIT is not set 1817# CONFIG_DEBUG_MEMORY_INIT is not set
1679# CONFIG_DEBUG_LIST is not set 1818# CONFIG_DEBUG_LIST is not set
1680# CONFIG_DEBUG_SG is not set 1819# CONFIG_DEBUG_SG is not set
1820# CONFIG_DEBUG_NOTIFIERS is not set
1681CONFIG_FRAME_POINTER=y 1821CONFIG_FRAME_POINTER=y
1682# CONFIG_BOOT_PRINTK_DELAY is not set 1822# CONFIG_BOOT_PRINTK_DELAY is not set
1683# CONFIG_RCU_TORTURE_TEST is not set 1823# CONFIG_RCU_TORTURE_TEST is not set
1824# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1684# CONFIG_BACKTRACE_SELF_TEST is not set 1825# CONFIG_BACKTRACE_SELF_TEST is not set
1826# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1685# CONFIG_FAULT_INJECTION is not set 1827# CONFIG_FAULT_INJECTION is not set
1686# CONFIG_LATENCYTOP is not set 1828# CONFIG_LATENCYTOP is not set
1687CONFIG_SYSCTL_SYSCALL_CHECK=y 1829CONFIG_SYSCTL_SYSCALL_CHECK=y
1688CONFIG_HAVE_FTRACE=y 1830CONFIG_HAVE_FUNCTION_TRACER=y
1689CONFIG_HAVE_DYNAMIC_FTRACE=y 1831
1690# CONFIG_FTRACE is not set 1832#
1833# Tracers
1834#
1835# CONFIG_FUNCTION_TRACER is not set
1691# CONFIG_IRQSOFF_TRACER is not set 1836# CONFIG_IRQSOFF_TRACER is not set
1692# CONFIG_SCHED_TRACER is not set 1837# CONFIG_SCHED_TRACER is not set
1693# CONFIG_CONTEXT_SWITCH_TRACER is not set 1838# CONFIG_CONTEXT_SWITCH_TRACER is not set
1839# CONFIG_BOOT_TRACER is not set
1840# CONFIG_TRACE_BRANCH_PROFILING is not set
1841# CONFIG_STACK_TRACER is not set
1842# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1694# CONFIG_SAMPLES is not set 1843# CONFIG_SAMPLES is not set
1695CONFIG_HAVE_ARCH_KGDB=y 1844CONFIG_HAVE_ARCH_KGDB=y
1696# CONFIG_KGDB is not set 1845# CONFIG_KGDB is not set
@@ -1705,13 +1854,16 @@ CONFIG_DEBUG_LL=y
1705# 1854#
1706# CONFIG_KEYS is not set 1855# CONFIG_KEYS is not set
1707# CONFIG_SECURITY is not set 1856# CONFIG_SECURITY is not set
1857# CONFIG_SECURITYFS is not set
1708# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1858# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1709CONFIG_CRYPTO=y 1859CONFIG_CRYPTO=y
1710 1860
1711# 1861#
1712# Crypto core or helper 1862# Crypto core or helper
1713# 1863#
1864# CONFIG_CRYPTO_FIPS is not set
1714# CONFIG_CRYPTO_MANAGER is not set 1865# CONFIG_CRYPTO_MANAGER is not set
1866# CONFIG_CRYPTO_MANAGER2 is not set
1715# CONFIG_CRYPTO_GF128MUL is not set 1867# CONFIG_CRYPTO_GF128MUL is not set
1716# CONFIG_CRYPTO_NULL is not set 1868# CONFIG_CRYPTO_NULL is not set
1717# CONFIG_CRYPTO_CRYPTD is not set 1869# CONFIG_CRYPTO_CRYPTD is not set
@@ -1783,14 +1935,18 @@ CONFIG_CRYPTO=y
1783# 1935#
1784# CONFIG_CRYPTO_DEFLATE is not set 1936# CONFIG_CRYPTO_DEFLATE is not set
1785# CONFIG_CRYPTO_LZO is not set 1937# CONFIG_CRYPTO_LZO is not set
1938
1939#
1940# Random Number Generation
1941#
1942# CONFIG_CRYPTO_ANSI_CPRNG is not set
1786# CONFIG_CRYPTO_HW is not set 1943# CONFIG_CRYPTO_HW is not set
1787 1944
1788# 1945#
1789# Library routines 1946# Library routines
1790# 1947#
1791CONFIG_BITREVERSE=y 1948CONFIG_BITREVERSE=y
1792# CONFIG_GENERIC_FIND_FIRST_BIT is not set 1949CONFIG_GENERIC_FIND_LAST_BIT=y
1793# CONFIG_GENERIC_FIND_NEXT_BIT is not set
1794CONFIG_CRC_CCITT=m 1950CONFIG_CRC_CCITT=m
1795# CONFIG_CRC16 is not set 1951# CONFIG_CRC16 is not set
1796# CONFIG_CRC_T10DIF is not set 1952# CONFIG_CRC_T10DIF is not set
diff --git a/arch/arm/configs/colibri_defconfig b/arch/arm/configs/colibri_pxa270_defconfig
index 744086fff414..4cf3bde1c522 100644
--- a/arch/arm/configs/colibri_defconfig
+++ b/arch/arm/configs/colibri_pxa270_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.24-rc3 3# Linux kernel version: 2.6.29-rc8
4# Mon Dec 3 13:36:09 2007 4# Fri Mar 13 16:18:17 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -12,6 +12,7 @@ CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set 12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y 16CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y 17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y 18CONFIG_HARDIRQS_SW_RESEND=y
@@ -21,8 +22,8 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U64 is not set 22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
22CONFIG_GENERIC_HWEIGHT=y 23CONFIG_GENERIC_HWEIGHT=y
23CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ZONE_DMA=y
25CONFIG_ARCH_MTD_XIP=y 25CONFIG_ARCH_MTD_XIP=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 27CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28 29
@@ -42,22 +43,30 @@ CONFIG_POSIX_MQUEUE=y
42CONFIG_BSD_PROCESS_ACCT=y 43CONFIG_BSD_PROCESS_ACCT=y
43CONFIG_BSD_PROCESS_ACCT_V3=y 44CONFIG_BSD_PROCESS_ACCT_V3=y
44# CONFIG_TASKSTATS is not set 45# CONFIG_TASKSTATS is not set
45# CONFIG_USER_NS is not set
46# CONFIG_PID_NS is not set
47# CONFIG_AUDIT is not set 46# CONFIG_AUDIT is not set
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
48CONFIG_IKCONFIG=y 56CONFIG_IKCONFIG=y
49CONFIG_IKCONFIG_PROC=y 57CONFIG_IKCONFIG_PROC=y
50CONFIG_LOG_BUF_SHIFT=14 58CONFIG_LOG_BUF_SHIFT=14
59# CONFIG_GROUP_SCHED is not set
51# CONFIG_CGROUPS is not set 60# CONFIG_CGROUPS is not set
52CONFIG_FAIR_GROUP_SCHED=y
53CONFIG_FAIR_USER_SCHED=y
54# CONFIG_FAIR_CGROUP_SCHED is not set
55CONFIG_SYSFS_DEPRECATED=y 61CONFIG_SYSFS_DEPRECATED=y
62CONFIG_SYSFS_DEPRECATED_V2=y
56# CONFIG_RELAY is not set 63# CONFIG_RELAY is not set
64# CONFIG_NAMESPACES is not set
57CONFIG_BLK_DEV_INITRD=y 65CONFIG_BLK_DEV_INITRD=y
58CONFIG_INITRAMFS_SOURCE="" 66CONFIG_INITRAMFS_SOURCE=""
59CONFIG_CC_OPTIMIZE_FOR_SIZE=y 67CONFIG_CC_OPTIMIZE_FOR_SIZE=y
60CONFIG_SYSCTL=y 68CONFIG_SYSCTL=y
69CONFIG_ANON_INODES=y
61CONFIG_EMBEDDED=y 70CONFIG_EMBEDDED=y
62CONFIG_UID16=y 71CONFIG_UID16=y
63CONFIG_SYSCTL_SYSCALL=y 72CONFIG_SYSCTL_SYSCALL=y
@@ -70,29 +79,38 @@ CONFIG_BUG=y
70CONFIG_ELF_CORE=y 79CONFIG_ELF_CORE=y
71CONFIG_BASE_FULL=y 80CONFIG_BASE_FULL=y
72CONFIG_FUTEX=y 81CONFIG_FUTEX=y
73CONFIG_ANON_INODES=y
74CONFIG_EPOLL=y 82CONFIG_EPOLL=y
75CONFIG_SIGNALFD=y 83CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y
76CONFIG_EVENTFD=y 85CONFIG_EVENTFD=y
77CONFIG_SHMEM=y 86CONFIG_SHMEM=y
87CONFIG_AIO=y
78CONFIG_VM_EVENT_COUNTERS=y 88CONFIG_VM_EVENT_COUNTERS=y
89CONFIG_COMPAT_BRK=y
79CONFIG_SLAB=y 90CONFIG_SLAB=y
80# CONFIG_SLUB is not set 91# CONFIG_SLUB is not set
81# CONFIG_SLOB is not set 92# CONFIG_SLOB is not set
93# CONFIG_PROFILING is not set
94CONFIG_HAVE_OPROFILE=y
95# CONFIG_KPROBES is not set
96CONFIG_HAVE_KPROBES=y
97CONFIG_HAVE_KRETPROBES=y
98CONFIG_HAVE_CLK=y
99CONFIG_HAVE_GENERIC_DMA_COHERENT=y
100CONFIG_SLABINFO=y
82CONFIG_RT_MUTEXES=y 101CONFIG_RT_MUTEXES=y
83# CONFIG_TINY_SHMEM is not set
84CONFIG_BASE_SMALL=0 102CONFIG_BASE_SMALL=0
85CONFIG_MODULES=y 103CONFIG_MODULES=y
104# CONFIG_MODULE_FORCE_LOAD is not set
86CONFIG_MODULE_UNLOAD=y 105CONFIG_MODULE_UNLOAD=y
87CONFIG_MODULE_FORCE_UNLOAD=y 106CONFIG_MODULE_FORCE_UNLOAD=y
88CONFIG_MODVERSIONS=y 107CONFIG_MODVERSIONS=y
89CONFIG_MODULE_SRCVERSION_ALL=y 108CONFIG_MODULE_SRCVERSION_ALL=y
90CONFIG_KMOD=y
91CONFIG_BLOCK=y 109CONFIG_BLOCK=y
92CONFIG_LBD=y 110CONFIG_LBD=y
93# CONFIG_BLK_DEV_IO_TRACE is not set 111# CONFIG_BLK_DEV_IO_TRACE is not set
94CONFIG_LSF=y
95# CONFIG_BLK_DEV_BSG is not set 112# CONFIG_BLK_DEV_BSG is not set
113# CONFIG_BLK_DEV_INTEGRITY is not set
96 114
97# 115#
98# IO Schedulers 116# IO Schedulers
@@ -106,6 +124,7 @@ CONFIG_DEFAULT_AS=y
106# CONFIG_DEFAULT_CFQ is not set 124# CONFIG_DEFAULT_CFQ is not set
107# CONFIG_DEFAULT_NOOP is not set 125# CONFIG_DEFAULT_NOOP is not set
108CONFIG_DEFAULT_IOSCHED="anticipatory" 126CONFIG_DEFAULT_IOSCHED="anticipatory"
127CONFIG_FREEZER=y
109 128
110# 129#
111# System Type 130# System Type
@@ -115,9 +134,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
115# CONFIG_ARCH_REALVIEW is not set 134# CONFIG_ARCH_REALVIEW is not set
116# CONFIG_ARCH_VERSATILE is not set 135# CONFIG_ARCH_VERSATILE is not set
117# CONFIG_ARCH_AT91 is not set 136# CONFIG_ARCH_AT91 is not set
118# CONFIG_ARCH_CLPS7500 is not set
119# CONFIG_ARCH_CLPS711X is not set 137# CONFIG_ARCH_CLPS711X is not set
120# CONFIG_ARCH_CO285 is not set
121# CONFIG_ARCH_EBSA110 is not set 138# CONFIG_ARCH_EBSA110 is not set
122# CONFIG_ARCH_EP93XX is not set 139# CONFIG_ARCH_EP93XX is not set
123# CONFIG_ARCH_FOOTBRIDGE is not set 140# CONFIG_ARCH_FOOTBRIDGE is not set
@@ -131,41 +148,58 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
131# CONFIG_ARCH_IXP2000 is not set 148# CONFIG_ARCH_IXP2000 is not set
132# CONFIG_ARCH_IXP4XX is not set 149# CONFIG_ARCH_IXP4XX is not set
133# CONFIG_ARCH_L7200 is not set 150# CONFIG_ARCH_L7200 is not set
151# CONFIG_ARCH_KIRKWOOD is not set
134# CONFIG_ARCH_KS8695 is not set 152# CONFIG_ARCH_KS8695 is not set
135# CONFIG_ARCH_NS9XXX is not set 153# CONFIG_ARCH_NS9XXX is not set
154# CONFIG_ARCH_LOKI is not set
155# CONFIG_ARCH_MV78XX0 is not set
136# CONFIG_ARCH_MXC is not set 156# CONFIG_ARCH_MXC is not set
157# CONFIG_ARCH_ORION5X is not set
137# CONFIG_ARCH_PNX4008 is not set 158# CONFIG_ARCH_PNX4008 is not set
138CONFIG_ARCH_PXA=y 159CONFIG_ARCH_PXA=y
139# CONFIG_ARCH_RPC is not set 160# CONFIG_ARCH_RPC is not set
140# CONFIG_ARCH_SA1100 is not set 161# CONFIG_ARCH_SA1100 is not set
141# CONFIG_ARCH_S3C2410 is not set 162# CONFIG_ARCH_S3C2410 is not set
163# CONFIG_ARCH_S3C64XX is not set
142# CONFIG_ARCH_SHARK is not set 164# CONFIG_ARCH_SHARK is not set
143# CONFIG_ARCH_LH7A40X is not set 165# CONFIG_ARCH_LH7A40X is not set
144# CONFIG_ARCH_DAVINCI is not set 166# CONFIG_ARCH_DAVINCI is not set
145# CONFIG_ARCH_OMAP is not set 167# CONFIG_ARCH_OMAP is not set
168# CONFIG_ARCH_MSM is not set
169# CONFIG_ARCH_W90X900 is not set
146 170
147# 171#
148# Intel PXA2xx/PXA3xx Implementations 172# Intel PXA2xx/PXA3xx Implementations
149# 173#
174# CONFIG_ARCH_GUMSTIX is not set
175# CONFIG_MACH_INTELMOTE2 is not set
150# CONFIG_ARCH_LUBBOCK is not set 176# CONFIG_ARCH_LUBBOCK is not set
151# CONFIG_MACH_LOGICPD_PXA270 is not set 177# CONFIG_MACH_LOGICPD_PXA270 is not set
152# CONFIG_MACH_MAINSTONE is not set 178# CONFIG_MACH_MAINSTONE is not set
179# CONFIG_MACH_MP900C is not set
153# CONFIG_ARCH_PXA_IDP is not set 180# CONFIG_ARCH_PXA_IDP is not set
154# CONFIG_PXA_SHARPSL is not set 181# CONFIG_PXA_SHARPSL is not set
155# CONFIG_MACH_TRIZEPS4 is not set 182# CONFIG_ARCH_VIPER is not set
183# CONFIG_ARCH_PXA_ESERIES is not set
184# CONFIG_TRIZEPS_PXA is not set
185# CONFIG_MACH_H5000 is not set
156# CONFIG_MACH_EM_X270 is not set 186# CONFIG_MACH_EM_X270 is not set
157CONFIG_MACH_COLIBRI=y 187CONFIG_MACH_COLIBRI=y
188# CONFIG_MACH_COLIBRI300 is not set
158# CONFIG_MACH_ZYLONITE is not set 189# CONFIG_MACH_ZYLONITE is not set
190# CONFIG_MACH_LITTLETON is not set
191# CONFIG_MACH_RAUMFELD_PROTO is not set
192# CONFIG_MACH_TAVOREVB is not set
193# CONFIG_MACH_SAAR is not set
159# CONFIG_MACH_ARMCORE is not set 194# CONFIG_MACH_ARMCORE is not set
195# CONFIG_MACH_CM_X300 is not set
196# CONFIG_MACH_MAGICIAN is not set
197# CONFIG_MACH_MIOA701 is not set
198# CONFIG_MACH_PCM027 is not set
199# CONFIG_ARCH_PXA_PALM is not set
200# CONFIG_PXA_EZX is not set
160CONFIG_PXA27x=y 201CONFIG_PXA27x=y
161 202# CONFIG_PXA_PWM is not set
162#
163# Boot options
164#
165
166#
167# Power management
168#
169 203
170# 204#
171# Processor Type 205# Processor Type
@@ -174,6 +208,7 @@ CONFIG_CPU_32=y
174CONFIG_CPU_XSCALE=y 208CONFIG_CPU_XSCALE=y
175CONFIG_CPU_32v5=y 209CONFIG_CPU_32v5=y
176CONFIG_CPU_ABRT_EV5T=y 210CONFIG_CPU_ABRT_EV5T=y
211CONFIG_CPU_PABRT_NOIFAR=y
177CONFIG_CPU_CACHE_VIVT=y 212CONFIG_CPU_CACHE_VIVT=y
178CONFIG_CPU_TLB_V4WBI=y 213CONFIG_CPU_TLB_V4WBI=y
179CONFIG_CPU_CP15=y 214CONFIG_CPU_CP15=y
@@ -187,6 +222,7 @@ CONFIG_ARM_THUMB=y
187# CONFIG_OUTER_CACHE is not set 222# CONFIG_OUTER_CACHE is not set
188CONFIG_IWMMXT=y 223CONFIG_IWMMXT=y
189CONFIG_XSCALE_PMU=y 224CONFIG_XSCALE_PMU=y
225CONFIG_COMMON_CLKDEV=y
190 226
191# 227#
192# Bus support 228# Bus support
@@ -198,28 +234,33 @@ CONFIG_XSCALE_PMU=y
198# 234#
199# Kernel Features 235# Kernel Features
200# 236#
201# CONFIG_TICK_ONESHOT is not set 237CONFIG_TICK_ONESHOT=y
202# CONFIG_NO_HZ is not set 238# CONFIG_NO_HZ is not set
203# CONFIG_HIGH_RES_TIMERS is not set 239# CONFIG_HIGH_RES_TIMERS is not set
204CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 240CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
241CONFIG_VMSPLIT_3G=y
242# CONFIG_VMSPLIT_2G is not set
243# CONFIG_VMSPLIT_1G is not set
244CONFIG_PAGE_OFFSET=0xC0000000
205CONFIG_PREEMPT=y 245CONFIG_PREEMPT=y
206CONFIG_HZ=100 246CONFIG_HZ=100
207CONFIG_AEABI=y 247CONFIG_AEABI=y
208CONFIG_OABI_COMPAT=y 248CONFIG_OABI_COMPAT=y
209# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 249CONFIG_ARCH_FLATMEM_HAS_HOLES=y
250# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
251# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
210CONFIG_SELECT_MEMORY_MODEL=y 252CONFIG_SELECT_MEMORY_MODEL=y
211CONFIG_FLATMEM_MANUAL=y 253CONFIG_FLATMEM_MANUAL=y
212# CONFIG_DISCONTIGMEM_MANUAL is not set 254# CONFIG_DISCONTIGMEM_MANUAL is not set
213# CONFIG_SPARSEMEM_MANUAL is not set 255# CONFIG_SPARSEMEM_MANUAL is not set
214CONFIG_FLATMEM=y 256CONFIG_FLATMEM=y
215CONFIG_FLAT_NODE_MEM_MAP=y 257CONFIG_FLAT_NODE_MEM_MAP=y
216# CONFIG_SPARSEMEM_STATIC is not set 258CONFIG_PAGEFLAGS_EXTENDED=y
217# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
218CONFIG_SPLIT_PTLOCK_CPUS=4096 259CONFIG_SPLIT_PTLOCK_CPUS=4096
219# CONFIG_RESOURCES_64BIT is not set 260# CONFIG_PHYS_ADDR_T_64BIT is not set
220CONFIG_ZONE_DMA_FLAG=1 261CONFIG_ZONE_DMA_FLAG=0
221CONFIG_BOUNCE=y
222CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
263CONFIG_UNEVICTABLE_LRU=y
223CONFIG_ALIGNMENT_TRAP=y 264CONFIG_ALIGNMENT_TRAP=y
224 265
225# 266#
@@ -232,6 +273,12 @@ CONFIG_CMDLINE=""
232# CONFIG_KEXEC is not set 273# CONFIG_KEXEC is not set
233 274
234# 275#
276# CPU Power Management
277#
278# CONFIG_CPU_FREQ is not set
279# CONFIG_CPU_IDLE is not set
280
281#
235# Floating point emulation 282# Floating point emulation
236# 283#
237 284
@@ -246,6 +293,8 @@ CONFIG_FPE_NWFPE=y
246# Userspace binary formats 293# Userspace binary formats
247# 294#
248CONFIG_BINFMT_ELF=y 295CONFIG_BINFMT_ELF=y
296# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
297CONFIG_HAVE_AOUT=y
249# CONFIG_BINFMT_AOUT is not set 298# CONFIG_BINFMT_AOUT is not set
250# CONFIG_BINFMT_MISC is not set 299# CONFIG_BINFMT_MISC is not set
251 300
@@ -253,21 +302,18 @@ CONFIG_BINFMT_ELF=y
253# Power management options 302# Power management options
254# 303#
255CONFIG_PM=y 304CONFIG_PM=y
256# CONFIG_PM_LEGACY is not set
257# CONFIG_PM_DEBUG is not set 305# CONFIG_PM_DEBUG is not set
258CONFIG_PM_SLEEP=y 306CONFIG_PM_SLEEP=y
259CONFIG_SUSPEND_UP_POSSIBLE=y
260CONFIG_SUSPEND=y 307CONFIG_SUSPEND=y
308CONFIG_SUSPEND_FREEZER=y
261# CONFIG_APM_EMULATION is not set 309# CONFIG_APM_EMULATION is not set
262 310CONFIG_ARCH_SUSPEND_POSSIBLE=y
263#
264# Networking
265#
266CONFIG_NET=y 311CONFIG_NET=y
267 312
268# 313#
269# Networking options 314# Networking options
270# 315#
316CONFIG_COMPAT_NET_DEV_OPS=y
271CONFIG_PACKET=y 317CONFIG_PACKET=y
272CONFIG_PACKET_MMAP=y 318CONFIG_PACKET_MMAP=y
273CONFIG_UNIX=y 319CONFIG_UNIX=y
@@ -275,6 +321,7 @@ CONFIG_XFRM=y
275CONFIG_XFRM_USER=m 321CONFIG_XFRM_USER=m
276# CONFIG_XFRM_SUB_POLICY is not set 322# CONFIG_XFRM_SUB_POLICY is not set
277# CONFIG_XFRM_MIGRATE is not set 323# CONFIG_XFRM_MIGRATE is not set
324# CONFIG_XFRM_STATISTICS is not set
278CONFIG_NET_KEY=y 325CONFIG_NET_KEY=y
279# CONFIG_NET_KEY_MIGRATE is not set 326# CONFIG_NET_KEY_MIGRATE is not set
280CONFIG_INET=y 327CONFIG_INET=y
@@ -304,26 +351,26 @@ CONFIG_INET_TCP_DIAG=y
304CONFIG_TCP_CONG_CUBIC=y 351CONFIG_TCP_CONG_CUBIC=y
305CONFIG_DEFAULT_TCP_CONG="cubic" 352CONFIG_DEFAULT_TCP_CONG="cubic"
306# CONFIG_TCP_MD5SIG is not set 353# CONFIG_TCP_MD5SIG is not set
307# CONFIG_IP_VS is not set
308# CONFIG_IPV6 is not set 354# CONFIG_IPV6 is not set
309# CONFIG_INET6_XFRM_TUNNEL is not set
310# CONFIG_INET6_TUNNEL is not set
311# CONFIG_NETLABEL is not set 355# CONFIG_NETLABEL is not set
312# CONFIG_NETWORK_SECMARK is not set 356# CONFIG_NETWORK_SECMARK is not set
313CONFIG_NETFILTER=y 357CONFIG_NETFILTER=y
314# CONFIG_NETFILTER_DEBUG is not set 358# CONFIG_NETFILTER_DEBUG is not set
359CONFIG_NETFILTER_ADVANCED=y
315 360
316# 361#
317# Core Netfilter Configuration 362# Core Netfilter Configuration
318# 363#
319# CONFIG_NETFILTER_NETLINK is not set 364# CONFIG_NETFILTER_NETLINK_QUEUE is not set
320# CONFIG_NF_CONNTRACK_ENABLED is not set 365# CONFIG_NETFILTER_NETLINK_LOG is not set
321# CONFIG_NF_CONNTRACK is not set 366# CONFIG_NF_CONNTRACK is not set
322# CONFIG_NETFILTER_XTABLES is not set 367# CONFIG_NETFILTER_XTABLES is not set
368# CONFIG_IP_VS is not set
323 369
324# 370#
325# IP: Netfilter Configuration 371# IP: Netfilter Configuration
326# 372#
373# CONFIG_NF_DEFRAG_IPV4 is not set
327CONFIG_IP_NF_QUEUE=m 374CONFIG_IP_NF_QUEUE=m
328# CONFIG_IP_NF_IPTABLES is not set 375# CONFIG_IP_NF_IPTABLES is not set
329# CONFIG_IP_NF_ARPTABLES is not set 376# CONFIG_IP_NF_ARPTABLES is not set
@@ -332,7 +379,9 @@ CONFIG_IP_NF_QUEUE=m
332# CONFIG_TIPC is not set 379# CONFIG_TIPC is not set
333# CONFIG_ATM is not set 380# CONFIG_ATM is not set
334# CONFIG_BRIDGE is not set 381# CONFIG_BRIDGE is not set
382# CONFIG_NET_DSA is not set
335CONFIG_VLAN_8021Q=m 383CONFIG_VLAN_8021Q=m
384# CONFIG_VLAN_8021Q_GVRP is not set
336# CONFIG_DECNET is not set 385# CONFIG_DECNET is not set
337# CONFIG_LLC2 is not set 386# CONFIG_LLC2 is not set
338# CONFIG_IPX is not set 387# CONFIG_IPX is not set
@@ -342,12 +391,14 @@ CONFIG_VLAN_8021Q=m
342# CONFIG_ECONET is not set 391# CONFIG_ECONET is not set
343# CONFIG_WAN_ROUTER is not set 392# CONFIG_WAN_ROUTER is not set
344# CONFIG_NET_SCHED is not set 393# CONFIG_NET_SCHED is not set
394# CONFIG_DCB is not set
345 395
346# 396#
347# Network testing 397# Network testing
348# 398#
349# CONFIG_NET_PKTGEN is not set 399# CONFIG_NET_PKTGEN is not set
350# CONFIG_HAMRADIO is not set 400# CONFIG_HAMRADIO is not set
401# CONFIG_CAN is not set
351CONFIG_IRDA=m 402CONFIG_IRDA=m
352 403
353# 404#
@@ -382,15 +433,6 @@ CONFIG_IRTTY_SIR=m
382# CONFIG_KS959_DONGLE is not set 433# CONFIG_KS959_DONGLE is not set
383 434
384# 435#
385# Old SIR device drivers
386#
387# CONFIG_IRPORT_SIR is not set
388
389#
390# Old Serial dongle support
391#
392
393#
394# FIR device drivers 436# FIR device drivers
395# 437#
396# CONFIG_USB_IRDA is not set 438# CONFIG_USB_IRDA is not set
@@ -410,7 +452,6 @@ CONFIG_BT_HIDP=m
410# 452#
411# Bluetooth device drivers 453# Bluetooth device drivers
412# 454#
413# CONFIG_BT_HCIUSB is not set
414# CONFIG_BT_HCIBTUSB is not set 455# CONFIG_BT_HCIBTUSB is not set
415# CONFIG_BT_HCIBTSDIO is not set 456# CONFIG_BT_HCIBTSDIO is not set
416# CONFIG_BT_HCIUART is not set 457# CONFIG_BT_HCIUART is not set
@@ -419,21 +460,20 @@ CONFIG_BT_HIDP=m
419# CONFIG_BT_HCIBFUSB is not set 460# CONFIG_BT_HCIBFUSB is not set
420# CONFIG_BT_HCIVHCI is not set 461# CONFIG_BT_HCIVHCI is not set
421# CONFIG_AF_RXRPC is not set 462# CONFIG_AF_RXRPC is not set
422 463# CONFIG_PHONET is not set
423# 464CONFIG_WIRELESS=y
424# Wireless
425#
426CONFIG_CFG80211=y 465CONFIG_CFG80211=y
466# CONFIG_CFG80211_REG_DEBUG is not set
427CONFIG_NL80211=y 467CONFIG_NL80211=y
468CONFIG_WIRELESS_OLD_REGULATORY=y
428CONFIG_WIRELESS_EXT=y 469CONFIG_WIRELESS_EXT=y
470CONFIG_WIRELESS_EXT_SYSFS=y
471CONFIG_LIB80211=y
472CONFIG_LIB80211_CRYPT_WEP=y
473CONFIG_LIB80211_CRYPT_CCMP=y
474CONFIG_LIB80211_CRYPT_TKIP=y
429# CONFIG_MAC80211 is not set 475# CONFIG_MAC80211 is not set
430CONFIG_IEEE80211=y 476# CONFIG_WIMAX is not set
431# CONFIG_IEEE80211_DEBUG is not set
432CONFIG_IEEE80211_CRYPT_WEP=y
433CONFIG_IEEE80211_CRYPT_CCMP=m
434CONFIG_IEEE80211_CRYPT_TKIP=m
435CONFIG_IEEE80211_SOFTMAC=m
436# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
437# CONFIG_RFKILL is not set 477# CONFIG_RFKILL is not set
438# CONFIG_NET_9P is not set 478# CONFIG_NET_9P is not set
439 479
@@ -448,6 +488,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
448CONFIG_STANDALONE=y 488CONFIG_STANDALONE=y
449CONFIG_PREVENT_FIRMWARE_BUILD=y 489CONFIG_PREVENT_FIRMWARE_BUILD=y
450CONFIG_FW_LOADER=y 490CONFIG_FW_LOADER=y
491CONFIG_FIRMWARE_IN_KERNEL=y
492CONFIG_EXTRA_FIRMWARE=""
451# CONFIG_DEBUG_DRIVER is not set 493# CONFIG_DEBUG_DRIVER is not set
452# CONFIG_DEBUG_DEVRES is not set 494# CONFIG_DEBUG_DEVRES is not set
453# CONFIG_SYS_HYPERVISOR is not set 495# CONFIG_SYS_HYPERVISOR is not set
@@ -457,9 +499,11 @@ CONFIG_MTD=y
457# CONFIG_MTD_DEBUG is not set 499# CONFIG_MTD_DEBUG is not set
458CONFIG_MTD_CONCAT=y 500CONFIG_MTD_CONCAT=y
459CONFIG_MTD_PARTITIONS=y 501CONFIG_MTD_PARTITIONS=y
502# CONFIG_MTD_TESTS is not set
460# CONFIG_MTD_REDBOOT_PARTS is not set 503# CONFIG_MTD_REDBOOT_PARTS is not set
461# CONFIG_MTD_CMDLINE_PARTS is not set 504# CONFIG_MTD_CMDLINE_PARTS is not set
462# CONFIG_MTD_AFS_PARTS is not set 505# CONFIG_MTD_AFS_PARTS is not set
506# CONFIG_MTD_AR7_PARTS is not set
463 507
464# 508#
465# User Modules And Translation Layers 509# User Modules And Translation Layers
@@ -510,9 +554,7 @@ CONFIG_MTD_CFI_UTIL=y
510# 554#
511CONFIG_MTD_COMPLEX_MAPPINGS=y 555CONFIG_MTD_COMPLEX_MAPPINGS=y
512CONFIG_MTD_PHYSMAP=y 556CONFIG_MTD_PHYSMAP=y
513CONFIG_MTD_PHYSMAP_START=0x0 557# CONFIG_MTD_PHYSMAP_COMPAT is not set
514CONFIG_MTD_PHYSMAP_LEN=0x0
515CONFIG_MTD_PHYSMAP_BANKWIDTH=2
516CONFIG_MTD_PXA2XX=y 558CONFIG_MTD_PXA2XX=y
517# CONFIG_MTD_ARM_INTEGRATOR is not set 559# CONFIG_MTD_ARM_INTEGRATOR is not set
518# CONFIG_MTD_IMPA7 is not set 560# CONFIG_MTD_IMPA7 is not set
@@ -538,6 +580,7 @@ CONFIG_MTD_NAND=y
538# CONFIG_MTD_NAND_ECC_SMC is not set 580# CONFIG_MTD_NAND_ECC_SMC is not set
539# CONFIG_MTD_NAND_MUSEUM_IDS is not set 581# CONFIG_MTD_NAND_MUSEUM_IDS is not set
540# CONFIG_MTD_NAND_H1900 is not set 582# CONFIG_MTD_NAND_H1900 is not set
583# CONFIG_MTD_NAND_GPIO is not set
541CONFIG_MTD_NAND_IDS=y 584CONFIG_MTD_NAND_IDS=y
542CONFIG_MTD_NAND_DISKONCHIP=y 585CONFIG_MTD_NAND_DISKONCHIP=y
543CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED=y 586CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED=y
@@ -556,6 +599,11 @@ CONFIG_MTD_ONENAND=y
556# CONFIG_MTD_ONENAND_SIM is not set 599# CONFIG_MTD_ONENAND_SIM is not set
557 600
558# 601#
602# LPDDR flash memory drivers
603#
604# CONFIG_MTD_LPDDR is not set
605
606#
559# UBI - Unsorted block images 607# UBI - Unsorted block images
560# 608#
561# CONFIG_MTD_UBI is not set 609# CONFIG_MTD_UBI is not set
@@ -569,36 +617,41 @@ CONFIG_BLK_DEV_NBD=y
569CONFIG_BLK_DEV_RAM=y 617CONFIG_BLK_DEV_RAM=y
570CONFIG_BLK_DEV_RAM_COUNT=8 618CONFIG_BLK_DEV_RAM_COUNT=8
571CONFIG_BLK_DEV_RAM_SIZE=4096 619CONFIG_BLK_DEV_RAM_SIZE=4096
572CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 620# CONFIG_BLK_DEV_XIP is not set
573# CONFIG_CDROM_PKTCDVD is not set 621# CONFIG_CDROM_PKTCDVD is not set
574# CONFIG_ATA_OVER_ETH is not set 622# CONFIG_ATA_OVER_ETH is not set
575CONFIG_MISC_DEVICES=y 623CONFIG_MISC_DEVICES=y
624# CONFIG_ICS932S401 is not set
625# CONFIG_ENCLOSURE_SERVICES is not set
626# CONFIG_ISL29003 is not set
627# CONFIG_C2PORT is not set
628
629#
630# EEPROM support
631#
632# CONFIG_EEPROM_AT24 is not set
633# CONFIG_EEPROM_LEGACY is not set
576# CONFIG_EEPROM_93CX6 is not set 634# CONFIG_EEPROM_93CX6 is not set
635CONFIG_HAVE_IDE=y
577CONFIG_IDE=y 636CONFIG_IDE=y
578CONFIG_IDE_MAX_HWIFS=4
579CONFIG_BLK_DEV_IDE=y
580 637
581# 638#
582# Please see Documentation/ide.txt for help/info on IDE drives 639# Please see Documentation/ide/ide.txt for help/info on IDE drives
583# 640#
584# CONFIG_BLK_DEV_IDE_SATA is not set 641# CONFIG_BLK_DEV_IDE_SATA is not set
585CONFIG_BLK_DEV_IDEDISK=y 642CONFIG_IDE_GD=y
586CONFIG_IDEDISK_MULTI_MODE=y 643CONFIG_IDE_GD_ATA=y
644# CONFIG_IDE_GD_ATAPI is not set
587# CONFIG_BLK_DEV_IDECD is not set 645# CONFIG_BLK_DEV_IDECD is not set
588# CONFIG_BLK_DEV_IDETAPE is not set 646# CONFIG_BLK_DEV_IDETAPE is not set
589# CONFIG_BLK_DEV_IDEFLOPPY is not set
590# CONFIG_IDE_TASK_IOCTL is not set 647# CONFIG_IDE_TASK_IOCTL is not set
591CONFIG_IDE_PROC_FS=y 648CONFIG_IDE_PROC_FS=y
592 649
593# 650#
594# IDE chipset support/bugfixes 651# IDE chipset support/bugfixes
595# 652#
596CONFIG_IDE_GENERIC=y
597# CONFIG_BLK_DEV_PLATFORM is not set 653# CONFIG_BLK_DEV_PLATFORM is not set
598# CONFIG_IDE_ARM is not set
599# CONFIG_BLK_DEV_IDEDMA is not set 654# CONFIG_BLK_DEV_IDEDMA is not set
600CONFIG_IDE_ARCH_OBSOLETE_INIT=y
601# CONFIG_BLK_DEV_HD is not set
602 655
603# 656#
604# SCSI device support 657# SCSI device support
@@ -610,7 +663,6 @@ CONFIG_IDE_ARCH_OBSOLETE_INIT=y
610# CONFIG_ATA is not set 663# CONFIG_ATA is not set
611# CONFIG_MD is not set 664# CONFIG_MD is not set
612CONFIG_NETDEVICES=y 665CONFIG_NETDEVICES=y
613# CONFIG_NETDEVICES_MULTIQUEUE is not set
614# CONFIG_DUMMY is not set 666# CONFIG_DUMMY is not set
615# CONFIG_BONDING is not set 667# CONFIG_BONDING is not set
616# CONFIG_MACVLAN is not set 668# CONFIG_MACVLAN is not set
@@ -631,6 +683,10 @@ CONFIG_PHYLIB=y
631# CONFIG_SMSC_PHY is not set 683# CONFIG_SMSC_PHY is not set
632# CONFIG_BROADCOM_PHY is not set 684# CONFIG_BROADCOM_PHY is not set
633# CONFIG_ICPLUS_PHY is not set 685# CONFIG_ICPLUS_PHY is not set
686# CONFIG_REALTEK_PHY is not set
687# CONFIG_NATIONAL_PHY is not set
688# CONFIG_STE10XP is not set
689# CONFIG_LSI_ET1011C_PHY is not set
634# CONFIG_FIXED_PHY is not set 690# CONFIG_FIXED_PHY is not set
635# CONFIG_MDIO_BITBANG is not set 691# CONFIG_MDIO_BITBANG is not set
636CONFIG_NET_ETHERNET=y 692CONFIG_NET_ETHERNET=y
@@ -638,11 +694,17 @@ CONFIG_MII=y
638# CONFIG_AX88796 is not set 694# CONFIG_AX88796 is not set
639# CONFIG_SMC91X is not set 695# CONFIG_SMC91X is not set
640CONFIG_DM9000=y 696CONFIG_DM9000=y
697CONFIG_DM9000_DEBUGLEVEL=4
698# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set
641# CONFIG_SMC911X is not set 699# CONFIG_SMC911X is not set
700# CONFIG_SMSC911X is not set
642# CONFIG_IBM_NEW_EMAC_ZMII is not set 701# CONFIG_IBM_NEW_EMAC_ZMII is not set
643# CONFIG_IBM_NEW_EMAC_RGMII is not set 702# CONFIG_IBM_NEW_EMAC_RGMII is not set
644# CONFIG_IBM_NEW_EMAC_TAH is not set 703# CONFIG_IBM_NEW_EMAC_TAH is not set
645# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 704# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
705# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
706# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
707# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
646# CONFIG_B44 is not set 708# CONFIG_B44 is not set
647# CONFIG_NETDEV_1000 is not set 709# CONFIG_NETDEV_1000 is not set
648# CONFIG_NETDEV_10000 is not set 710# CONFIG_NETDEV_10000 is not set
@@ -654,10 +716,15 @@ CONFIG_DM9000=y
654CONFIG_WLAN_80211=y 716CONFIG_WLAN_80211=y
655# CONFIG_LIBERTAS is not set 717# CONFIG_LIBERTAS is not set
656# CONFIG_USB_ZD1201 is not set 718# CONFIG_USB_ZD1201 is not set
719# CONFIG_USB_NET_RNDIS_WLAN is not set
720# CONFIG_IWLWIFI_LEDS is not set
657CONFIG_HOSTAP=y 721CONFIG_HOSTAP=y
658CONFIG_HOSTAP_FIRMWARE=y 722CONFIG_HOSTAP_FIRMWARE=y
659CONFIG_HOSTAP_FIRMWARE_NVRAM=y 723CONFIG_HOSTAP_FIRMWARE_NVRAM=y
660# CONFIG_ZD1211RW is not set 724
725#
726# Enable WiMAX (Networking options) to see the WiMAX drivers
727#
661 728
662# 729#
663# USB Network Adapters 730# USB Network Adapters
@@ -670,7 +737,6 @@ CONFIG_HOSTAP_FIRMWARE_NVRAM=y
670# CONFIG_WAN is not set 737# CONFIG_WAN is not set
671# CONFIG_PPP is not set 738# CONFIG_PPP is not set
672# CONFIG_SLIP is not set 739# CONFIG_SLIP is not set
673# CONFIG_SHAPER is not set
674# CONFIG_NETCONSOLE is not set 740# CONFIG_NETCONSOLE is not set
675# CONFIG_NETPOLL is not set 741# CONFIG_NETPOLL is not set
676# CONFIG_NET_POLL_CONTROLLER is not set 742# CONFIG_NET_POLL_CONTROLLER is not set
@@ -710,6 +776,7 @@ CONFIG_INPUT_MOUSE=y
710# CONFIG_MOUSE_PS2 is not set 776# CONFIG_MOUSE_PS2 is not set
711CONFIG_MOUSE_SERIAL=m 777CONFIG_MOUSE_SERIAL=m
712# CONFIG_MOUSE_APPLETOUCH is not set 778# CONFIG_MOUSE_APPLETOUCH is not set
779# CONFIG_MOUSE_BCM5974 is not set
713# CONFIG_MOUSE_VSXXXAA is not set 780# CONFIG_MOUSE_VSXXXAA is not set
714# CONFIG_MOUSE_GPIO is not set 781# CONFIG_MOUSE_GPIO is not set
715# CONFIG_INPUT_JOYSTICK is not set 782# CONFIG_INPUT_JOYSTICK is not set
@@ -718,20 +785,25 @@ CONFIG_INPUT_TOUCHSCREEN=y
718# CONFIG_TOUCHSCREEN_FUJITSU is not set 785# CONFIG_TOUCHSCREEN_FUJITSU is not set
719# CONFIG_TOUCHSCREEN_GUNZE is not set 786# CONFIG_TOUCHSCREEN_GUNZE is not set
720# CONFIG_TOUCHSCREEN_ELO is not set 787# CONFIG_TOUCHSCREEN_ELO is not set
788# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
721# CONFIG_TOUCHSCREEN_MTOUCH is not set 789# CONFIG_TOUCHSCREEN_MTOUCH is not set
790# CONFIG_TOUCHSCREEN_INEXIO is not set
722# CONFIG_TOUCHSCREEN_MK712 is not set 791# CONFIG_TOUCHSCREEN_MK712 is not set
723# CONFIG_TOUCHSCREEN_PENMOUNT is not set 792# CONFIG_TOUCHSCREEN_PENMOUNT is not set
724# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 793# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
725# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 794# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
726CONFIG_TOUCHSCREEN_UCB1400=y
727# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 795# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
796# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
797# CONFIG_TOUCHSCREEN_TSC2007 is not set
728CONFIG_INPUT_MISC=y 798CONFIG_INPUT_MISC=y
729# CONFIG_INPUT_ATI_REMOTE is not set 799# CONFIG_INPUT_ATI_REMOTE is not set
730# CONFIG_INPUT_ATI_REMOTE2 is not set 800# CONFIG_INPUT_ATI_REMOTE2 is not set
731# CONFIG_INPUT_KEYSPAN_REMOTE is not set 801# CONFIG_INPUT_KEYSPAN_REMOTE is not set
732# CONFIG_INPUT_POWERMATE is not set 802# CONFIG_INPUT_POWERMATE is not set
733# CONFIG_INPUT_YEALINK is not set 803# CONFIG_INPUT_YEALINK is not set
804# CONFIG_INPUT_CM109 is not set
734CONFIG_INPUT_UINPUT=m 805CONFIG_INPUT_UINPUT=m
806# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
735 807
736# 808#
737# Hardware I/O ports 809# Hardware I/O ports
@@ -746,9 +818,11 @@ CONFIG_SERIO_LIBPS2=y
746# Character devices 818# Character devices
747# 819#
748CONFIG_VT=y 820CONFIG_VT=y
821CONFIG_CONSOLE_TRANSLATIONS=y
749CONFIG_VT_CONSOLE=y 822CONFIG_VT_CONSOLE=y
750CONFIG_HW_CONSOLE=y 823CONFIG_HW_CONSOLE=y
751# CONFIG_VT_HW_CONSOLE_BINDING is not set 824# CONFIG_VT_HW_CONSOLE_BINDING is not set
825CONFIG_DEVKMEM=y
752# CONFIG_SERIAL_NONSTANDARD is not set 826# CONFIG_SERIAL_NONSTANDARD is not set
753 827
754# 828#
@@ -764,45 +838,50 @@ CONFIG_SERIAL_PXA_CONSOLE=y
764CONFIG_SERIAL_CORE=y 838CONFIG_SERIAL_CORE=y
765CONFIG_SERIAL_CORE_CONSOLE=y 839CONFIG_SERIAL_CORE_CONSOLE=y
766CONFIG_UNIX98_PTYS=y 840CONFIG_UNIX98_PTYS=y
841# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
767CONFIG_LEGACY_PTYS=y 842CONFIG_LEGACY_PTYS=y
768CONFIG_LEGACY_PTY_COUNT=256 843CONFIG_LEGACY_PTY_COUNT=256
769# CONFIG_IPMI_HANDLER is not set 844# CONFIG_IPMI_HANDLER is not set
770CONFIG_HW_RANDOM=y 845CONFIG_HW_RANDOM=y
771# CONFIG_NVRAM is not set
772# CONFIG_R3964 is not set 846# CONFIG_R3964 is not set
773# CONFIG_RAW_DRIVER is not set 847# CONFIG_RAW_DRIVER is not set
774# CONFIG_TCG_TPM is not set 848# CONFIG_TCG_TPM is not set
775CONFIG_I2C=y 849CONFIG_I2C=y
776CONFIG_I2C_BOARDINFO=y 850CONFIG_I2C_BOARDINFO=y
777CONFIG_I2C_CHARDEV=y 851CONFIG_I2C_CHARDEV=y
852CONFIG_I2C_HELPER_AUTO=y
778 853
779# 854#
780# I2C Algorithms 855# I2C Hardware Bus support
781# 856#
782# CONFIG_I2C_ALGOBIT is not set
783# CONFIG_I2C_ALGOPCF is not set
784# CONFIG_I2C_ALGOPCA is not set
785 857
786# 858#
787# I2C Hardware Bus support 859# I2C system bus drivers (mostly embedded / system-on-chip)
788# 860#
789# CONFIG_I2C_GPIO is not set 861# CONFIG_I2C_GPIO is not set
790# CONFIG_I2C_PXA is not set
791# CONFIG_I2C_OCORES is not set 862# CONFIG_I2C_OCORES is not set
792# CONFIG_I2C_PARPORT_LIGHT is not set 863# CONFIG_I2C_PXA is not set
793# CONFIG_I2C_SIMTEC is not set 864# CONFIG_I2C_SIMTEC is not set
865
866#
867# External I2C/SMBus adapter drivers
868#
869# CONFIG_I2C_PARPORT_LIGHT is not set
794# CONFIG_I2C_TAOS_EVM is not set 870# CONFIG_I2C_TAOS_EVM is not set
795# CONFIG_I2C_STUB is not set
796# CONFIG_I2C_TINY_USB is not set 871# CONFIG_I2C_TINY_USB is not set
797 872
798# 873#
874# Other I2C/SMBus bus drivers
875#
876# CONFIG_I2C_PCA_PLATFORM is not set
877# CONFIG_I2C_STUB is not set
878
879#
799# Miscellaneous I2C Chip support 880# Miscellaneous I2C Chip support
800# 881#
801# CONFIG_SENSORS_DS1337 is not set
802# CONFIG_SENSORS_DS1374 is not set
803# CONFIG_DS1682 is not set 882# CONFIG_DS1682 is not set
804# CONFIG_EEPROM_LEGACY is not set
805# CONFIG_SENSORS_PCF8574 is not set 883# CONFIG_SENSORS_PCF8574 is not set
884# CONFIG_PCF8575 is not set
806# CONFIG_SENSORS_PCA9539 is not set 885# CONFIG_SENSORS_PCA9539 is not set
807# CONFIG_SENSORS_PCF8591 is not set 886# CONFIG_SENSORS_PCF8591 is not set
808# CONFIG_SENSORS_MAX6875 is not set 887# CONFIG_SENSORS_MAX6875 is not set
@@ -811,16 +890,35 @@ CONFIG_I2C_CHARDEV=y
811# CONFIG_I2C_DEBUG_ALGO is not set 890# CONFIG_I2C_DEBUG_ALGO is not set
812# CONFIG_I2C_DEBUG_BUS is not set 891# CONFIG_I2C_DEBUG_BUS is not set
813# CONFIG_I2C_DEBUG_CHIP is not set 892# CONFIG_I2C_DEBUG_CHIP is not set
893# CONFIG_SPI is not set
894CONFIG_ARCH_REQUIRE_GPIOLIB=y
895CONFIG_GPIOLIB=y
896# CONFIG_DEBUG_GPIO is not set
897# CONFIG_GPIO_SYSFS is not set
814 898
815# 899#
816# SPI support 900# Memory mapped GPIO expanders:
901#
902
903#
904# I2C GPIO expanders:
905#
906# CONFIG_GPIO_MAX732X is not set
907# CONFIG_GPIO_PCA953X is not set
908# CONFIG_GPIO_PCF857X is not set
909
910#
911# PCI GPIO expanders:
912#
913
914#
915# SPI GPIO expanders:
817# 916#
818# CONFIG_SPI is not set
819# CONFIG_SPI_MASTER is not set
820# CONFIG_W1 is not set 917# CONFIG_W1 is not set
821# CONFIG_POWER_SUPPLY is not set 918# CONFIG_POWER_SUPPLY is not set
822CONFIG_HWMON=y 919CONFIG_HWMON=y
823# CONFIG_HWMON_VID is not set 920# CONFIG_HWMON_VID is not set
921# CONFIG_SENSORS_AD7414 is not set
824# CONFIG_SENSORS_AD7418 is not set 922# CONFIG_SENSORS_AD7418 is not set
825# CONFIG_SENSORS_ADM1021 is not set 923# CONFIG_SENSORS_ADM1021 is not set
826# CONFIG_SENSORS_ADM1025 is not set 924# CONFIG_SENSORS_ADM1025 is not set
@@ -828,7 +926,10 @@ CONFIG_HWMON=y
828# CONFIG_SENSORS_ADM1029 is not set 926# CONFIG_SENSORS_ADM1029 is not set
829# CONFIG_SENSORS_ADM1031 is not set 927# CONFIG_SENSORS_ADM1031 is not set
830# CONFIG_SENSORS_ADM9240 is not set 928# CONFIG_SENSORS_ADM9240 is not set
929# CONFIG_SENSORS_ADT7462 is not set
831# CONFIG_SENSORS_ADT7470 is not set 930# CONFIG_SENSORS_ADT7470 is not set
931# CONFIG_SENSORS_ADT7473 is not set
932# CONFIG_SENSORS_ADT7475 is not set
832# CONFIG_SENSORS_ATXP1 is not set 933# CONFIG_SENSORS_ATXP1 is not set
833# CONFIG_SENSORS_DS1621 is not set 934# CONFIG_SENSORS_DS1621 is not set
834# CONFIG_SENSORS_F71805F is not set 935# CONFIG_SENSORS_F71805F is not set
@@ -848,6 +949,7 @@ CONFIG_HWMON=y
848# CONFIG_SENSORS_LM90 is not set 949# CONFIG_SENSORS_LM90 is not set
849# CONFIG_SENSORS_LM92 is not set 950# CONFIG_SENSORS_LM92 is not set
850# CONFIG_SENSORS_LM93 is not set 951# CONFIG_SENSORS_LM93 is not set
952# CONFIG_SENSORS_LTC4245 is not set
851# CONFIG_SENSORS_MAX1619 is not set 953# CONFIG_SENSORS_MAX1619 is not set
852# CONFIG_SENSORS_MAX6650 is not set 954# CONFIG_SENSORS_MAX6650 is not set
853# CONFIG_SENSORS_PC87360 is not set 955# CONFIG_SENSORS_PC87360 is not set
@@ -856,6 +958,7 @@ CONFIG_HWMON=y
856# CONFIG_SENSORS_SMSC47M1 is not set 958# CONFIG_SENSORS_SMSC47M1 is not set
857# CONFIG_SENSORS_SMSC47M192 is not set 959# CONFIG_SENSORS_SMSC47M192 is not set
858# CONFIG_SENSORS_SMSC47B397 is not set 960# CONFIG_SENSORS_SMSC47B397 is not set
961# CONFIG_SENSORS_ADS7828 is not set
859# CONFIG_SENSORS_THMC50 is not set 962# CONFIG_SENSORS_THMC50 is not set
860# CONFIG_SENSORS_VT1211 is not set 963# CONFIG_SENSORS_VT1211 is not set
861# CONFIG_SENSORS_W83781D is not set 964# CONFIG_SENSORS_W83781D is not set
@@ -863,9 +966,12 @@ CONFIG_HWMON=y
863# CONFIG_SENSORS_W83792D is not set 966# CONFIG_SENSORS_W83792D is not set
864# CONFIG_SENSORS_W83793 is not set 967# CONFIG_SENSORS_W83793 is not set
865# CONFIG_SENSORS_W83L785TS is not set 968# CONFIG_SENSORS_W83L785TS is not set
969# CONFIG_SENSORS_W83L786NG is not set
866# CONFIG_SENSORS_W83627HF is not set 970# CONFIG_SENSORS_W83627HF is not set
867# CONFIG_SENSORS_W83627EHF is not set 971# CONFIG_SENSORS_W83627EHF is not set
868# CONFIG_HWMON_DEBUG_CHIP is not set 972# CONFIG_HWMON_DEBUG_CHIP is not set
973# CONFIG_THERMAL is not set
974# CONFIG_THERMAL_HWMON is not set
869CONFIG_WATCHDOG=y 975CONFIG_WATCHDOG=y
870# CONFIG_WATCHDOG_NOWAYOUT is not set 976# CONFIG_WATCHDOG_NOWAYOUT is not set
871 977
@@ -879,23 +985,46 @@ CONFIG_WATCHDOG=y
879# USB-based Watchdog Cards 985# USB-based Watchdog Cards
880# 986#
881# CONFIG_USBPCWATCHDOG is not set 987# CONFIG_USBPCWATCHDOG is not set
988CONFIG_SSB_POSSIBLE=y
882 989
883# 990#
884# Sonics Silicon Backplane 991# Sonics Silicon Backplane
885# 992#
886CONFIG_SSB_POSSIBLE=y
887# CONFIG_SSB is not set 993# CONFIG_SSB is not set
888 994
889# 995#
890# Multifunction device drivers 996# Multifunction device drivers
891# 997#
998# CONFIG_MFD_CORE is not set
892# CONFIG_MFD_SM501 is not set 999# CONFIG_MFD_SM501 is not set
1000# CONFIG_MFD_ASIC3 is not set
1001# CONFIG_HTC_EGPIO is not set
1002# CONFIG_HTC_PASIC3 is not set
1003# CONFIG_TPS65010 is not set
1004# CONFIG_TWL4030_CORE is not set
1005# CONFIG_MFD_TMIO is not set
1006# CONFIG_MFD_T7L66XB is not set
1007# CONFIG_MFD_TC6387XB is not set
1008# CONFIG_MFD_TC6393XB is not set
1009# CONFIG_PMIC_DA903X is not set
1010# CONFIG_MFD_WM8400 is not set
1011# CONFIG_MFD_WM8350_I2C is not set
1012# CONFIG_MFD_PCF50633 is not set
893 1013
894# 1014#
895# Multimedia devices 1015# Multimedia devices
896# 1016#
1017
1018#
1019# Multimedia core support
1020#
897# CONFIG_VIDEO_DEV is not set 1021# CONFIG_VIDEO_DEV is not set
898# CONFIG_DVB_CORE is not set 1022# CONFIG_DVB_CORE is not set
1023# CONFIG_VIDEO_MEDIA is not set
1024
1025#
1026# Multimedia drivers
1027#
899CONFIG_DAB=y 1028CONFIG_DAB=y
900# CONFIG_USB_DABUSB is not set 1029# CONFIG_USB_DABUSB is not set
901 1030
@@ -907,6 +1036,7 @@ CONFIG_DAB=y
907CONFIG_FB=y 1036CONFIG_FB=y
908CONFIG_FIRMWARE_EDID=y 1037CONFIG_FIRMWARE_EDID=y
909# CONFIG_FB_DDC is not set 1038# CONFIG_FB_DDC is not set
1039# CONFIG_FB_BOOT_VESA_SUPPORT is not set
910CONFIG_FB_CFB_FILLRECT=y 1040CONFIG_FB_CFB_FILLRECT=y
911CONFIG_FB_CFB_COPYAREA=y 1041CONFIG_FB_CFB_COPYAREA=y
912CONFIG_FB_CFB_IMAGEBLIT=y 1042CONFIG_FB_CFB_IMAGEBLIT=y
@@ -914,8 +1044,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
914# CONFIG_FB_SYS_FILLRECT is not set 1044# CONFIG_FB_SYS_FILLRECT is not set
915# CONFIG_FB_SYS_COPYAREA is not set 1045# CONFIG_FB_SYS_COPYAREA is not set
916# CONFIG_FB_SYS_IMAGEBLIT is not set 1046# CONFIG_FB_SYS_IMAGEBLIT is not set
1047# CONFIG_FB_FOREIGN_ENDIAN is not set
917# CONFIG_FB_SYS_FOPS is not set 1048# CONFIG_FB_SYS_FOPS is not set
918CONFIG_FB_DEFERRED_IO=y
919# CONFIG_FB_SVGALIB is not set 1049# CONFIG_FB_SVGALIB is not set
920# CONFIG_FB_MACMODES is not set 1050# CONFIG_FB_MACMODES is not set
921# CONFIG_FB_BACKLIGHT is not set 1051# CONFIG_FB_BACKLIGHT is not set
@@ -928,13 +1058,20 @@ CONFIG_FB_DEFERRED_IO=y
928# CONFIG_FB_UVESA is not set 1058# CONFIG_FB_UVESA is not set
929# CONFIG_FB_S1D13XXX is not set 1059# CONFIG_FB_S1D13XXX is not set
930CONFIG_FB_PXA=y 1060CONFIG_FB_PXA=y
1061# CONFIG_FB_PXA_OVERLAY is not set
1062# CONFIG_FB_PXA_SMARTPANEL is not set
931# CONFIG_FB_PXA_PARAMETERS is not set 1063# CONFIG_FB_PXA_PARAMETERS is not set
932# CONFIG_FB_MBX is not set 1064# CONFIG_FB_MBX is not set
1065# CONFIG_FB_W100 is not set
933# CONFIG_FB_VIRTUAL is not set 1066# CONFIG_FB_VIRTUAL is not set
1067# CONFIG_FB_METRONOME is not set
1068# CONFIG_FB_MB862XX is not set
934CONFIG_BACKLIGHT_LCD_SUPPORT=y 1069CONFIG_BACKLIGHT_LCD_SUPPORT=y
935CONFIG_LCD_CLASS_DEVICE=y 1070CONFIG_LCD_CLASS_DEVICE=y
1071# CONFIG_LCD_ILI9320 is not set
1072# CONFIG_LCD_PLATFORM is not set
936CONFIG_BACKLIGHT_CLASS_DEVICE=y 1073CONFIG_BACKLIGHT_CLASS_DEVICE=y
937# CONFIG_BACKLIGHT_CORGI is not set 1074CONFIG_BACKLIGHT_GENERIC=y
938 1075
939# 1076#
940# Display device support 1077# Display device support
@@ -964,12 +1101,7 @@ CONFIG_LOGO=y
964CONFIG_LOGO_LINUX_MONO=y 1101CONFIG_LOGO_LINUX_MONO=y
965CONFIG_LOGO_LINUX_VGA16=y 1102CONFIG_LOGO_LINUX_VGA16=y
966CONFIG_LOGO_LINUX_CLUT224=y 1103CONFIG_LOGO_LINUX_CLUT224=y
967
968#
969# Sound
970#
971# CONFIG_SOUND is not set 1104# CONFIG_SOUND is not set
972CONFIG_AC97_BUS=y
973CONFIG_HID_SUPPORT=y 1105CONFIG_HID_SUPPORT=y
974CONFIG_HID=y 1106CONFIG_HID=y
975# CONFIG_HID_DEBUG is not set 1107# CONFIG_HID_DEBUG is not set
@@ -979,18 +1111,26 @@ CONFIG_HID=y
979# USB Input Devices 1111# USB Input Devices
980# 1112#
981# CONFIG_USB_HID is not set 1113# CONFIG_USB_HID is not set
1114# CONFIG_HID_PID is not set
982 1115
983# 1116#
984# USB HID Boot Protocol drivers 1117# USB HID Boot Protocol drivers
985# 1118#
986# CONFIG_USB_KBD is not set 1119# CONFIG_USB_KBD is not set
987# CONFIG_USB_MOUSE is not set 1120# CONFIG_USB_MOUSE is not set
1121
1122#
1123# Special HID drivers
1124#
1125CONFIG_HID_COMPAT=y
1126# CONFIG_HID_APPLE is not set
988CONFIG_USB_SUPPORT=y 1127CONFIG_USB_SUPPORT=y
989CONFIG_USB_ARCH_HAS_HCD=y 1128CONFIG_USB_ARCH_HAS_HCD=y
990CONFIG_USB_ARCH_HAS_OHCI=y 1129CONFIG_USB_ARCH_HAS_OHCI=y
991# CONFIG_USB_ARCH_HAS_EHCI is not set 1130# CONFIG_USB_ARCH_HAS_EHCI is not set
992CONFIG_USB=y 1131CONFIG_USB=y
993# CONFIG_USB_DEBUG is not set 1132# CONFIG_USB_DEBUG is not set
1133# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
994 1134
995# 1135#
996# Miscellaneous USB options 1136# Miscellaneous USB options
@@ -999,29 +1139,40 @@ CONFIG_USB_DEVICEFS=y
999# CONFIG_USB_DEVICE_CLASS is not set 1139# CONFIG_USB_DEVICE_CLASS is not set
1000# CONFIG_USB_DYNAMIC_MINORS is not set 1140# CONFIG_USB_DYNAMIC_MINORS is not set
1001# CONFIG_USB_SUSPEND is not set 1141# CONFIG_USB_SUSPEND is not set
1002# CONFIG_USB_PERSIST is not set
1003# CONFIG_USB_OTG is not set 1142# CONFIG_USB_OTG is not set
1143# CONFIG_USB_OTG_WHITELIST is not set
1144# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1145# CONFIG_USB_MON is not set
1146# CONFIG_USB_WUSB is not set
1147# CONFIG_USB_WUSB_CBAF is not set
1004 1148
1005# 1149#
1006# USB Host Controller Drivers 1150# USB Host Controller Drivers
1007# 1151#
1152# CONFIG_USB_C67X00_HCD is not set
1153# CONFIG_USB_OXU210HP_HCD is not set
1008# CONFIG_USB_ISP116X_HCD is not set 1154# CONFIG_USB_ISP116X_HCD is not set
1009# CONFIG_USB_OHCI_HCD is not set 1155# CONFIG_USB_OHCI_HCD is not set
1010# CONFIG_USB_SL811_HCD is not set 1156# CONFIG_USB_SL811_HCD is not set
1011# CONFIG_USB_R8A66597_HCD is not set 1157# CONFIG_USB_R8A66597_HCD is not set
1158# CONFIG_USB_HWA_HCD is not set
1159# CONFIG_USB_MUSB_HDRC is not set
1160# CONFIG_USB_GADGET_MUSB_HDRC is not set
1012 1161
1013# 1162#
1014# USB Device Class drivers 1163# USB Device Class drivers
1015# 1164#
1016# CONFIG_USB_ACM is not set 1165# CONFIG_USB_ACM is not set
1017# CONFIG_USB_PRINTER is not set 1166# CONFIG_USB_PRINTER is not set
1167# CONFIG_USB_WDM is not set
1168# CONFIG_USB_TMC is not set
1018 1169
1019# 1170#
1020# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1171# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1021# 1172#
1022 1173
1023# 1174#
1024# may also be needed; see USB_STORAGE Help for more information 1175# see USB_STORAGE Help for more information
1025# 1176#
1026# CONFIG_USB_LIBUSUAL is not set 1177# CONFIG_USB_LIBUSUAL is not set
1027 1178
@@ -1029,19 +1180,14 @@ CONFIG_USB_DEVICEFS=y
1029# USB Imaging devices 1180# USB Imaging devices
1030# 1181#
1031# CONFIG_USB_MDC800 is not set 1182# CONFIG_USB_MDC800 is not set
1032# CONFIG_USB_MON is not set
1033 1183
1034# 1184#
1035# USB port drivers 1185# USB port drivers
1036# 1186#
1037
1038#
1039# USB Serial Converter support
1040#
1041CONFIG_USB_SERIAL=m 1187CONFIG_USB_SERIAL=m
1188# CONFIG_USB_EZUSB is not set
1042# CONFIG_USB_SERIAL_GENERIC is not set 1189# CONFIG_USB_SERIAL_GENERIC is not set
1043# CONFIG_USB_SERIAL_AIRCABLE is not set 1190# CONFIG_USB_SERIAL_AIRCABLE is not set
1044# CONFIG_USB_SERIAL_AIRPRIME is not set
1045# CONFIG_USB_SERIAL_ARK3116 is not set 1191# CONFIG_USB_SERIAL_ARK3116 is not set
1046# CONFIG_USB_SERIAL_BELKIN is not set 1192# CONFIG_USB_SERIAL_BELKIN is not set
1047# CONFIG_USB_SERIAL_CH341 is not set 1193# CONFIG_USB_SERIAL_CH341 is not set
@@ -1059,6 +1205,7 @@ CONFIG_USB_SERIAL=m
1059# CONFIG_USB_SERIAL_EDGEPORT_TI is not set 1205# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
1060# CONFIG_USB_SERIAL_GARMIN is not set 1206# CONFIG_USB_SERIAL_GARMIN is not set
1061# CONFIG_USB_SERIAL_IPW is not set 1207# CONFIG_USB_SERIAL_IPW is not set
1208# CONFIG_USB_SERIAL_IUU is not set
1062# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set 1209# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
1063# CONFIG_USB_SERIAL_KEYSPAN is not set 1210# CONFIG_USB_SERIAL_KEYSPAN is not set
1064# CONFIG_USB_SERIAL_KLSI is not set 1211# CONFIG_USB_SERIAL_KLSI is not set
@@ -1066,17 +1213,21 @@ CONFIG_USB_SERIAL=m
1066# CONFIG_USB_SERIAL_MCT_U232 is not set 1213# CONFIG_USB_SERIAL_MCT_U232 is not set
1067# CONFIG_USB_SERIAL_MOS7720 is not set 1214# CONFIG_USB_SERIAL_MOS7720 is not set
1068# CONFIG_USB_SERIAL_MOS7840 is not set 1215# CONFIG_USB_SERIAL_MOS7840 is not set
1216# CONFIG_USB_SERIAL_MOTOROLA is not set
1069# CONFIG_USB_SERIAL_NAVMAN is not set 1217# CONFIG_USB_SERIAL_NAVMAN is not set
1070# CONFIG_USB_SERIAL_PL2303 is not set 1218# CONFIG_USB_SERIAL_PL2303 is not set
1071# CONFIG_USB_SERIAL_OTI6858 is not set 1219# CONFIG_USB_SERIAL_OTI6858 is not set
1220# CONFIG_USB_SERIAL_SPCP8X5 is not set
1072# CONFIG_USB_SERIAL_HP4X is not set 1221# CONFIG_USB_SERIAL_HP4X is not set
1073# CONFIG_USB_SERIAL_SAFE is not set 1222# CONFIG_USB_SERIAL_SAFE is not set
1223# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
1074# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set 1224# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
1075# CONFIG_USB_SERIAL_TI is not set 1225# CONFIG_USB_SERIAL_TI is not set
1076# CONFIG_USB_SERIAL_CYBERJACK is not set 1226# CONFIG_USB_SERIAL_CYBERJACK is not set
1077# CONFIG_USB_SERIAL_XIRCOM is not set 1227# CONFIG_USB_SERIAL_XIRCOM is not set
1078# CONFIG_USB_SERIAL_OPTION is not set 1228# CONFIG_USB_SERIAL_OPTION is not set
1079# CONFIG_USB_SERIAL_OMNINET is not set 1229# CONFIG_USB_SERIAL_OMNINET is not set
1230# CONFIG_USB_SERIAL_OPTICON is not set
1080# CONFIG_USB_SERIAL_DEBUG is not set 1231# CONFIG_USB_SERIAL_DEBUG is not set
1081 1232
1082# 1233#
@@ -1085,7 +1236,7 @@ CONFIG_USB_SERIAL=m
1085# CONFIG_USB_EMI62 is not set 1236# CONFIG_USB_EMI62 is not set
1086# CONFIG_USB_EMI26 is not set 1237# CONFIG_USB_EMI26 is not set
1087# CONFIG_USB_ADUTUX is not set 1238# CONFIG_USB_ADUTUX is not set
1088# CONFIG_USB_AUERSWALD is not set 1239# CONFIG_USB_SEVSEG is not set
1089# CONFIG_USB_RIO500 is not set 1240# CONFIG_USB_RIO500 is not set
1090# CONFIG_USB_LEGOTOWER is not set 1241# CONFIG_USB_LEGOTOWER is not set
1091# CONFIG_USB_LCD is not set 1242# CONFIG_USB_LCD is not set
@@ -1101,30 +1252,29 @@ CONFIG_USB_SERIAL=m
1101# CONFIG_USB_TRANCEVIBRATOR is not set 1252# CONFIG_USB_TRANCEVIBRATOR is not set
1102# CONFIG_USB_IOWARRIOR is not set 1253# CONFIG_USB_IOWARRIOR is not set
1103# CONFIG_USB_TEST is not set 1254# CONFIG_USB_TEST is not set
1104 1255# CONFIG_USB_ISIGHTFW is not set
1105# 1256# CONFIG_USB_VST is not set
1106# USB DSL modem support
1107#
1108
1109#
1110# USB Gadget Support
1111#
1112CONFIG_USB_GADGET=m 1257CONFIG_USB_GADGET=m
1113# CONFIG_USB_GADGET_DEBUG is not set 1258# CONFIG_USB_GADGET_DEBUG is not set
1114# CONFIG_USB_GADGET_DEBUG_FILES is not set 1259# CONFIG_USB_GADGET_DEBUG_FILES is not set
1115# CONFIG_USB_GADGET_DEBUG_FS is not set 1260# CONFIG_USB_GADGET_DEBUG_FS is not set
1261CONFIG_USB_GADGET_VBUS_DRAW=2
1116CONFIG_USB_GADGET_SELECTED=y 1262CONFIG_USB_GADGET_SELECTED=y
1117# CONFIG_USB_GADGET_AMD5536UDC is not set 1263# CONFIG_USB_GADGET_AT91 is not set
1118# CONFIG_USB_GADGET_ATMEL_USBA is not set 1264# CONFIG_USB_GADGET_ATMEL_USBA is not set
1119# CONFIG_USB_GADGET_FSL_USB2 is not set 1265# CONFIG_USB_GADGET_FSL_USB2 is not set
1120# CONFIG_USB_GADGET_NET2280 is not set
1121# CONFIG_USB_GADGET_PXA2XX is not set
1122# CONFIG_USB_GADGET_M66592 is not set
1123# CONFIG_USB_GADGET_GOKU is not set
1124# CONFIG_USB_GADGET_LH7A40X is not set 1266# CONFIG_USB_GADGET_LH7A40X is not set
1125# CONFIG_USB_GADGET_OMAP is not set 1267# CONFIG_USB_GADGET_OMAP is not set
1268# CONFIG_USB_GADGET_PXA25X is not set
1269# CONFIG_USB_GADGET_PXA27X is not set
1126# CONFIG_USB_GADGET_S3C2410 is not set 1270# CONFIG_USB_GADGET_S3C2410 is not set
1127# CONFIG_USB_GADGET_AT91 is not set 1271# CONFIG_USB_GADGET_IMX is not set
1272# CONFIG_USB_GADGET_M66592 is not set
1273# CONFIG_USB_GADGET_AMD5536UDC is not set
1274# CONFIG_USB_GADGET_FSL_QE is not set
1275# CONFIG_USB_GADGET_CI13XXX is not set
1276# CONFIG_USB_GADGET_NET2280 is not set
1277# CONFIG_USB_GADGET_GOKU is not set
1128CONFIG_USB_GADGET_DUMMY_HCD=y 1278CONFIG_USB_GADGET_DUMMY_HCD=y
1129CONFIG_USB_DUMMY_HCD=m 1279CONFIG_USB_DUMMY_HCD=m
1130CONFIG_USB_GADGET_DUALSPEED=y 1280CONFIG_USB_GADGET_DUALSPEED=y
@@ -1134,21 +1284,32 @@ CONFIG_USB_GADGET_DUALSPEED=y
1134# CONFIG_USB_FILE_STORAGE is not set 1284# CONFIG_USB_FILE_STORAGE is not set
1135# CONFIG_USB_G_SERIAL is not set 1285# CONFIG_USB_G_SERIAL is not set
1136# CONFIG_USB_MIDI_GADGET is not set 1286# CONFIG_USB_MIDI_GADGET is not set
1287# CONFIG_USB_G_PRINTER is not set
1288# CONFIG_USB_CDC_COMPOSITE is not set
1289
1290#
1291# OTG and related infrastructure
1292#
1293# CONFIG_USB_GPIO_VBUS is not set
1137CONFIG_MMC=y 1294CONFIG_MMC=y
1138# CONFIG_MMC_DEBUG is not set 1295# CONFIG_MMC_DEBUG is not set
1139# CONFIG_MMC_UNSAFE_RESUME is not set 1296# CONFIG_MMC_UNSAFE_RESUME is not set
1140 1297
1141# 1298#
1142# MMC/SD Card Drivers 1299# MMC/SD/SDIO Card Drivers
1143# 1300#
1144CONFIG_MMC_BLOCK=y 1301CONFIG_MMC_BLOCK=y
1145CONFIG_MMC_BLOCK_BOUNCE=y 1302CONFIG_MMC_BLOCK_BOUNCE=y
1146# CONFIG_SDIO_UART is not set 1303# CONFIG_SDIO_UART is not set
1304# CONFIG_MMC_TEST is not set
1147 1305
1148# 1306#
1149# MMC/SD Host Controller Drivers 1307# MMC/SD/SDIO Host Controller Drivers
1150# 1308#
1151# CONFIG_MMC_PXA is not set 1309# CONFIG_MMC_PXA is not set
1310# CONFIG_MMC_SDHCI is not set
1311# CONFIG_MEMSTICK is not set
1312# CONFIG_ACCESSIBILITY is not set
1152CONFIG_NEW_LEDS=y 1313CONFIG_NEW_LEDS=y
1153# CONFIG_LEDS_CLASS is not set 1314# CONFIG_LEDS_CLASS is not set
1154 1315
@@ -1163,6 +1324,8 @@ CONFIG_LEDS_TRIGGERS=y
1163CONFIG_LEDS_TRIGGER_TIMER=y 1324CONFIG_LEDS_TRIGGER_TIMER=y
1164# CONFIG_LEDS_TRIGGER_IDE_DISK is not set 1325# CONFIG_LEDS_TRIGGER_IDE_DISK is not set
1165CONFIG_LEDS_TRIGGER_HEARTBEAT=y 1326CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1327# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1328# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1166CONFIG_RTC_LIB=y 1329CONFIG_RTC_LIB=y
1167CONFIG_RTC_CLASS=y 1330CONFIG_RTC_CLASS=y
1168# CONFIG_RTC_HCTOSYS is not set 1331# CONFIG_RTC_HCTOSYS is not set
@@ -1190,6 +1353,9 @@ CONFIG_RTC_INTF_DEV=y
1190# CONFIG_RTC_DRV_PCF8563 is not set 1353# CONFIG_RTC_DRV_PCF8563 is not set
1191CONFIG_RTC_DRV_PCF8583=m 1354CONFIG_RTC_DRV_PCF8583=m
1192# CONFIG_RTC_DRV_M41T80 is not set 1355# CONFIG_RTC_DRV_M41T80 is not set
1356# CONFIG_RTC_DRV_S35390A is not set
1357# CONFIG_RTC_DRV_FM3130 is not set
1358# CONFIG_RTC_DRV_RX8581 is not set
1193 1359
1194# 1360#
1195# SPI RTC drivers 1361# SPI RTC drivers
@@ -1199,36 +1365,45 @@ CONFIG_RTC_DRV_PCF8583=m
1199# Platform RTC drivers 1365# Platform RTC drivers
1200# 1366#
1201# CONFIG_RTC_DRV_CMOS is not set 1367# CONFIG_RTC_DRV_CMOS is not set
1368# CONFIG_RTC_DRV_DS1286 is not set
1369# CONFIG_RTC_DRV_DS1511 is not set
1202# CONFIG_RTC_DRV_DS1553 is not set 1370# CONFIG_RTC_DRV_DS1553 is not set
1203# CONFIG_RTC_DRV_STK17TA8 is not set
1204# CONFIG_RTC_DRV_DS1742 is not set 1371# CONFIG_RTC_DRV_DS1742 is not set
1372# CONFIG_RTC_DRV_STK17TA8 is not set
1205# CONFIG_RTC_DRV_M48T86 is not set 1373# CONFIG_RTC_DRV_M48T86 is not set
1374# CONFIG_RTC_DRV_M48T35 is not set
1206# CONFIG_RTC_DRV_M48T59 is not set 1375# CONFIG_RTC_DRV_M48T59 is not set
1376# CONFIG_RTC_DRV_BQ4802 is not set
1207# CONFIG_RTC_DRV_V3020 is not set 1377# CONFIG_RTC_DRV_V3020 is not set
1208 1378
1209# 1379#
1210# on-CPU RTC drivers 1380# on-CPU RTC drivers
1211# 1381#
1212# CONFIG_RTC_DRV_SA1100 is not set 1382# CONFIG_RTC_DRV_SA1100 is not set
1383# CONFIG_RTC_DRV_PXA is not set
1384# CONFIG_DMADEVICES is not set
1385# CONFIG_REGULATOR is not set
1386# CONFIG_UIO is not set
1387# CONFIG_STAGING is not set
1213 1388
1214# 1389#
1215# File systems 1390# File systems
1216# 1391#
1217# CONFIG_EXT2_FS is not set 1392# CONFIG_EXT2_FS is not set
1218# CONFIG_EXT3_FS is not set 1393# CONFIG_EXT3_FS is not set
1219# CONFIG_EXT4DEV_FS is not set 1394# CONFIG_EXT4_FS is not set
1220# CONFIG_REISERFS_FS is not set 1395# CONFIG_REISERFS_FS is not set
1221# CONFIG_JFS_FS is not set 1396# CONFIG_JFS_FS is not set
1222CONFIG_FS_POSIX_ACL=y 1397CONFIG_FS_POSIX_ACL=y
1398CONFIG_FILE_LOCKING=y
1223# CONFIG_XFS_FS is not set 1399# CONFIG_XFS_FS is not set
1224# CONFIG_GFS2_FS is not set 1400# CONFIG_GFS2_FS is not set
1225# CONFIG_OCFS2_FS is not set 1401# CONFIG_OCFS2_FS is not set
1226# CONFIG_MINIX_FS is not set 1402# CONFIG_BTRFS_FS is not set
1227# CONFIG_ROMFS_FS is not set 1403CONFIG_DNOTIFY=y
1228CONFIG_INOTIFY=y 1404CONFIG_INOTIFY=y
1229CONFIG_INOTIFY_USER=y 1405CONFIG_INOTIFY_USER=y
1230# CONFIG_QUOTA is not set 1406# CONFIG_QUOTA is not set
1231CONFIG_DNOTIFY=y
1232# CONFIG_AUTOFS_FS is not set 1407# CONFIG_AUTOFS_FS is not set
1233CONFIG_AUTOFS4_FS=y 1408CONFIG_AUTOFS4_FS=y
1234# CONFIG_FUSE_FS is not set 1409# CONFIG_FUSE_FS is not set
@@ -1254,15 +1429,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15"
1254# 1429#
1255CONFIG_PROC_FS=y 1430CONFIG_PROC_FS=y
1256CONFIG_PROC_SYSCTL=y 1431CONFIG_PROC_SYSCTL=y
1432CONFIG_PROC_PAGE_MONITOR=y
1257CONFIG_SYSFS=y 1433CONFIG_SYSFS=y
1258CONFIG_TMPFS=y 1434CONFIG_TMPFS=y
1259# CONFIG_TMPFS_POSIX_ACL is not set 1435# CONFIG_TMPFS_POSIX_ACL is not set
1260# CONFIG_HUGETLB_PAGE is not set 1436# CONFIG_HUGETLB_PAGE is not set
1261CONFIG_CONFIGFS_FS=y 1437CONFIG_CONFIGFS_FS=y
1262 1438CONFIG_MISC_FILESYSTEMS=y
1263#
1264# Miscellaneous filesystems
1265#
1266# CONFIG_ADFS_FS is not set 1439# CONFIG_ADFS_FS is not set
1267# CONFIG_AFFS_FS is not set 1440# CONFIG_AFFS_FS is not set
1268# CONFIG_ECRYPT_FS is not set 1441# CONFIG_ECRYPT_FS is not set
@@ -1283,9 +1456,13 @@ CONFIG_JFFS2_ZLIB=y
1283CONFIG_JFFS2_RTIME=y 1456CONFIG_JFFS2_RTIME=y
1284# CONFIG_JFFS2_RUBIN is not set 1457# CONFIG_JFFS2_RUBIN is not set
1285# CONFIG_CRAMFS is not set 1458# CONFIG_CRAMFS is not set
1459# CONFIG_SQUASHFS is not set
1286# CONFIG_VXFS_FS is not set 1460# CONFIG_VXFS_FS is not set
1461# CONFIG_MINIX_FS is not set
1462# CONFIG_OMFS_FS is not set
1287# CONFIG_HPFS_FS is not set 1463# CONFIG_HPFS_FS is not set
1288# CONFIG_QNX4FS_FS is not set 1464# CONFIG_QNX4FS_FS is not set
1465# CONFIG_ROMFS_FS is not set
1289# CONFIG_SYSV_FS is not set 1466# CONFIG_SYSV_FS is not set
1290# CONFIG_UFS_FS is not set 1467# CONFIG_UFS_FS is not set
1291CONFIG_NETWORK_FILESYSTEMS=y 1468CONFIG_NETWORK_FILESYSTEMS=y
@@ -1293,20 +1470,18 @@ CONFIG_NFS_FS=y
1293CONFIG_NFS_V3=y 1470CONFIG_NFS_V3=y
1294# CONFIG_NFS_V3_ACL is not set 1471# CONFIG_NFS_V3_ACL is not set
1295CONFIG_NFS_V4=y 1472CONFIG_NFS_V4=y
1296# CONFIG_NFS_DIRECTIO is not set 1473CONFIG_ROOT_NFS=y
1297CONFIG_NFSD=y 1474CONFIG_NFSD=y
1298CONFIG_NFSD_V3=y 1475CONFIG_NFSD_V3=y
1299# CONFIG_NFSD_V3_ACL is not set 1476# CONFIG_NFSD_V3_ACL is not set
1300CONFIG_NFSD_V4=y 1477CONFIG_NFSD_V4=y
1301CONFIG_NFSD_TCP=y
1302CONFIG_ROOT_NFS=y
1303CONFIG_LOCKD=y 1478CONFIG_LOCKD=y
1304CONFIG_LOCKD_V4=y 1479CONFIG_LOCKD_V4=y
1305CONFIG_EXPORTFS=y 1480CONFIG_EXPORTFS=y
1306CONFIG_NFS_COMMON=y 1481CONFIG_NFS_COMMON=y
1307CONFIG_SUNRPC=y 1482CONFIG_SUNRPC=y
1308CONFIG_SUNRPC_GSS=y 1483CONFIG_SUNRPC_GSS=y
1309# CONFIG_SUNRPC_BIND34 is not set 1484# CONFIG_SUNRPC_REGISTER_V4 is not set
1310CONFIG_RPCSEC_GSS_KRB5=y 1485CONFIG_RPCSEC_GSS_KRB5=y
1311# CONFIG_RPCSEC_GSS_SPKM3 is not set 1486# CONFIG_RPCSEC_GSS_SPKM3 is not set
1312# CONFIG_SMB_FS is not set 1487# CONFIG_SMB_FS is not set
@@ -1361,9 +1536,6 @@ CONFIG_NLS_ISO8859_15=m
1361# CONFIG_NLS_KOI8_U is not set 1536# CONFIG_NLS_KOI8_U is not set
1362CONFIG_NLS_UTF8=m 1537CONFIG_NLS_UTF8=m
1363# CONFIG_DLM is not set 1538# CONFIG_DLM is not set
1364CONFIG_INSTRUMENTATION=y
1365# CONFIG_PROFILING is not set
1366# CONFIG_MARKERS is not set
1367 1539
1368# 1540#
1369# Kernel hacking 1541# Kernel hacking
@@ -1371,6 +1543,7 @@ CONFIG_INSTRUMENTATION=y
1371CONFIG_PRINTK_TIME=y 1543CONFIG_PRINTK_TIME=y
1372CONFIG_ENABLE_WARN_DEPRECATED=y 1544CONFIG_ENABLE_WARN_DEPRECATED=y
1373CONFIG_ENABLE_MUST_CHECK=y 1545CONFIG_ENABLE_MUST_CHECK=y
1546CONFIG_FRAME_WARN=1024
1374CONFIG_MAGIC_SYSRQ=y 1547CONFIG_MAGIC_SYSRQ=y
1375# CONFIG_UNUSED_SYMBOLS is not set 1548# CONFIG_UNUSED_SYMBOLS is not set
1376CONFIG_DEBUG_FS=y 1549CONFIG_DEBUG_FS=y
@@ -1378,9 +1551,12 @@ CONFIG_DEBUG_FS=y
1378CONFIG_DEBUG_KERNEL=y 1551CONFIG_DEBUG_KERNEL=y
1379# CONFIG_DEBUG_SHIRQ is not set 1552# CONFIG_DEBUG_SHIRQ is not set
1380CONFIG_DETECT_SOFTLOCKUP=y 1553CONFIG_DETECT_SOFTLOCKUP=y
1554# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1555CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1381CONFIG_SCHED_DEBUG=y 1556CONFIG_SCHED_DEBUG=y
1382# CONFIG_SCHEDSTATS is not set 1557# CONFIG_SCHEDSTATS is not set
1383# CONFIG_TIMER_STATS is not set 1558# CONFIG_TIMER_STATS is not set
1559# CONFIG_DEBUG_OBJECTS is not set
1384# CONFIG_DEBUG_SLAB is not set 1560# CONFIG_DEBUG_SLAB is not set
1385CONFIG_DEBUG_PREEMPT=y 1561CONFIG_DEBUG_PREEMPT=y
1386# CONFIG_DEBUG_RT_MUTEXES is not set 1562# CONFIG_DEBUG_RT_MUTEXES is not set
@@ -1396,16 +1572,40 @@ CONFIG_DEBUG_PREEMPT=y
1396CONFIG_DEBUG_BUGVERBOSE=y 1572CONFIG_DEBUG_BUGVERBOSE=y
1397CONFIG_DEBUG_INFO=y 1573CONFIG_DEBUG_INFO=y
1398# CONFIG_DEBUG_VM is not set 1574# CONFIG_DEBUG_VM is not set
1575# CONFIG_DEBUG_WRITECOUNT is not set
1576# CONFIG_DEBUG_MEMORY_INIT is not set
1399# CONFIG_DEBUG_LIST is not set 1577# CONFIG_DEBUG_LIST is not set
1400# CONFIG_DEBUG_SG is not set 1578# CONFIG_DEBUG_SG is not set
1579# CONFIG_DEBUG_NOTIFIERS is not set
1401CONFIG_FRAME_POINTER=y 1580CONFIG_FRAME_POINTER=y
1402CONFIG_FORCED_INLINING=y
1403# CONFIG_BOOT_PRINTK_DELAY is not set 1581# CONFIG_BOOT_PRINTK_DELAY is not set
1404# CONFIG_RCU_TORTURE_TEST is not set 1582# CONFIG_RCU_TORTURE_TEST is not set
1583# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1584# CONFIG_BACKTRACE_SELF_TEST is not set
1585# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1405# CONFIG_FAULT_INJECTION is not set 1586# CONFIG_FAULT_INJECTION is not set
1587# CONFIG_LATENCYTOP is not set
1588# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1589CONFIG_HAVE_FUNCTION_TRACER=y
1590
1591#
1592# Tracers
1593#
1594# CONFIG_FUNCTION_TRACER is not set
1595# CONFIG_IRQSOFF_TRACER is not set
1596# CONFIG_PREEMPT_TRACER is not set
1597# CONFIG_SCHED_TRACER is not set
1598# CONFIG_CONTEXT_SWITCH_TRACER is not set
1599# CONFIG_BOOT_TRACER is not set
1600# CONFIG_TRACE_BRANCH_PROFILING is not set
1601# CONFIG_STACK_TRACER is not set
1602# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1406# CONFIG_SAMPLES is not set 1603# CONFIG_SAMPLES is not set
1604CONFIG_HAVE_ARCH_KGDB=y
1605# CONFIG_KGDB is not set
1407CONFIG_DEBUG_USER=y 1606CONFIG_DEBUG_USER=y
1408CONFIG_DEBUG_ERRORS=y 1607CONFIG_DEBUG_ERRORS=y
1608# CONFIG_DEBUG_STACK_USAGE is not set
1409CONFIG_DEBUG_LL=y 1609CONFIG_DEBUG_LL=y
1410# CONFIG_DEBUG_ICEDCC is not set 1610# CONFIG_DEBUG_ICEDCC is not set
1411 1611
@@ -1415,58 +1615,114 @@ CONFIG_DEBUG_LL=y
1415CONFIG_KEYS=y 1615CONFIG_KEYS=y
1416CONFIG_KEYS_DEBUG_PROC_KEYS=y 1616CONFIG_KEYS_DEBUG_PROC_KEYS=y
1417CONFIG_SECURITY=y 1617CONFIG_SECURITY=y
1618# CONFIG_SECURITYFS is not set
1418# CONFIG_SECURITY_NETWORK is not set 1619# CONFIG_SECURITY_NETWORK is not set
1419CONFIG_SECURITY_CAPABILITIES=y 1620# CONFIG_SECURITY_PATH is not set
1420# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1621# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1421# CONFIG_SECURITY_ROOTPLUG is not set 1622# CONFIG_SECURITY_ROOTPLUG is not set
1623CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1422CONFIG_CRYPTO=y 1624CONFIG_CRYPTO=y
1625
1626#
1627# Crypto core or helper
1628#
1629# CONFIG_CRYPTO_FIPS is not set
1423CONFIG_CRYPTO_ALGAPI=y 1630CONFIG_CRYPTO_ALGAPI=y
1631CONFIG_CRYPTO_ALGAPI2=y
1632CONFIG_CRYPTO_AEAD2=y
1424CONFIG_CRYPTO_BLKCIPHER=y 1633CONFIG_CRYPTO_BLKCIPHER=y
1634CONFIG_CRYPTO_BLKCIPHER2=y
1635CONFIG_CRYPTO_HASH=y
1636CONFIG_CRYPTO_HASH2=y
1637CONFIG_CRYPTO_RNG2=y
1425CONFIG_CRYPTO_MANAGER=y 1638CONFIG_CRYPTO_MANAGER=y
1639CONFIG_CRYPTO_MANAGER2=y
1640# CONFIG_CRYPTO_GF128MUL is not set
1641# CONFIG_CRYPTO_NULL is not set
1642# CONFIG_CRYPTO_CRYPTD is not set
1643# CONFIG_CRYPTO_AUTHENC is not set
1644# CONFIG_CRYPTO_TEST is not set
1645
1646#
1647# Authenticated Encryption with Associated Data
1648#
1649# CONFIG_CRYPTO_CCM is not set
1650# CONFIG_CRYPTO_GCM is not set
1651# CONFIG_CRYPTO_SEQIV is not set
1652
1653#
1654# Block modes
1655#
1656CONFIG_CRYPTO_CBC=y
1657# CONFIG_CRYPTO_CTR is not set
1658# CONFIG_CRYPTO_CTS is not set
1659CONFIG_CRYPTO_ECB=y
1660# CONFIG_CRYPTO_LRW is not set
1661CONFIG_CRYPTO_PCBC=m
1662# CONFIG_CRYPTO_XTS is not set
1663
1664#
1665# Hash modes
1666#
1426# CONFIG_CRYPTO_HMAC is not set 1667# CONFIG_CRYPTO_HMAC is not set
1427# CONFIG_CRYPTO_XCBC is not set 1668# CONFIG_CRYPTO_XCBC is not set
1428# CONFIG_CRYPTO_NULL is not set 1669
1670#
1671# Digest
1672#
1673CONFIG_CRYPTO_CRC32C=y
1429# CONFIG_CRYPTO_MD4 is not set 1674# CONFIG_CRYPTO_MD4 is not set
1430CONFIG_CRYPTO_MD5=y 1675CONFIG_CRYPTO_MD5=y
1676CONFIG_CRYPTO_MICHAEL_MIC=y
1677# CONFIG_CRYPTO_RMD128 is not set
1678# CONFIG_CRYPTO_RMD160 is not set
1679# CONFIG_CRYPTO_RMD256 is not set
1680# CONFIG_CRYPTO_RMD320 is not set
1431CONFIG_CRYPTO_SHA1=m 1681CONFIG_CRYPTO_SHA1=m
1432CONFIG_CRYPTO_SHA256=m 1682CONFIG_CRYPTO_SHA256=m
1433CONFIG_CRYPTO_SHA512=m 1683CONFIG_CRYPTO_SHA512=m
1434# CONFIG_CRYPTO_WP512 is not set
1435# CONFIG_CRYPTO_TGR192 is not set 1684# CONFIG_CRYPTO_TGR192 is not set
1436# CONFIG_CRYPTO_GF128MUL is not set 1685# CONFIG_CRYPTO_WP512 is not set
1437CONFIG_CRYPTO_ECB=y 1686
1438CONFIG_CRYPTO_CBC=y 1687#
1439CONFIG_CRYPTO_PCBC=m 1688# Ciphers
1440# CONFIG_CRYPTO_LRW is not set 1689#
1441# CONFIG_CRYPTO_XTS is not set 1690CONFIG_CRYPTO_AES=y
1442# CONFIG_CRYPTO_CRYPTD is not set 1691# CONFIG_CRYPTO_ANUBIS is not set
1443CONFIG_CRYPTO_DES=y 1692CONFIG_CRYPTO_ARC4=y
1444# CONFIG_CRYPTO_FCRYPT is not set
1445# CONFIG_CRYPTO_BLOWFISH is not set 1693# CONFIG_CRYPTO_BLOWFISH is not set
1446# CONFIG_CRYPTO_TWOFISH is not set 1694# CONFIG_CRYPTO_CAMELLIA is not set
1447# CONFIG_CRYPTO_SERPENT is not set
1448CONFIG_CRYPTO_AES=m
1449# CONFIG_CRYPTO_CAST5 is not set 1695# CONFIG_CRYPTO_CAST5 is not set
1450# CONFIG_CRYPTO_CAST6 is not set 1696# CONFIG_CRYPTO_CAST6 is not set
1451# CONFIG_CRYPTO_TEA is not set 1697CONFIG_CRYPTO_DES=y
1452CONFIG_CRYPTO_ARC4=y 1698# CONFIG_CRYPTO_FCRYPT is not set
1453# CONFIG_CRYPTO_KHAZAD is not set 1699# CONFIG_CRYPTO_KHAZAD is not set
1454# CONFIG_CRYPTO_ANUBIS is not set 1700# CONFIG_CRYPTO_SALSA20 is not set
1455# CONFIG_CRYPTO_SEED is not set 1701# CONFIG_CRYPTO_SEED is not set
1702# CONFIG_CRYPTO_SERPENT is not set
1703# CONFIG_CRYPTO_TEA is not set
1704# CONFIG_CRYPTO_TWOFISH is not set
1705
1706#
1707# Compression
1708#
1456CONFIG_CRYPTO_DEFLATE=m 1709CONFIG_CRYPTO_DEFLATE=m
1457CONFIG_CRYPTO_MICHAEL_MIC=m 1710# CONFIG_CRYPTO_LZO is not set
1458CONFIG_CRYPTO_CRC32C=y 1711
1459# CONFIG_CRYPTO_CAMELLIA is not set 1712#
1460# CONFIG_CRYPTO_TEST is not set 1713# Random Number Generation
1461# CONFIG_CRYPTO_AUTHENC is not set 1714#
1715# CONFIG_CRYPTO_ANSI_CPRNG is not set
1462CONFIG_CRYPTO_HW=y 1716CONFIG_CRYPTO_HW=y
1463 1717
1464# 1718#
1465# Library routines 1719# Library routines
1466# 1720#
1467CONFIG_BITREVERSE=y 1721CONFIG_BITREVERSE=y
1722CONFIG_GENERIC_FIND_LAST_BIT=y
1468CONFIG_CRC_CCITT=y 1723CONFIG_CRC_CCITT=y
1469CONFIG_CRC16=y 1724CONFIG_CRC16=y
1725# CONFIG_CRC_T10DIF is not set
1470# CONFIG_CRC_ITU_T is not set 1726# CONFIG_CRC_ITU_T is not set
1471CONFIG_CRC32=y 1727CONFIG_CRC32=y
1472# CONFIG_CRC7 is not set 1728# CONFIG_CRC7 is not set
diff --git a/arch/arm/configs/colibri_pxa300_defconfig b/arch/arm/configs/colibri_pxa300_defconfig
new file mode 100644
index 000000000000..4774a36fa740
--- /dev/null
+++ b/arch/arm/configs/colibri_pxa300_defconfig
@@ -0,0 +1,1156 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc8
4# Fri Mar 13 16:13:20 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_MTD_XIP=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29
30#
31# General setup
32#
33CONFIG_EXPERIMENTAL=y
34CONFIG_BROKEN_ON_SMP=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y
38CONFIG_SWAP=y
39# CONFIG_SYSVIPC is not set
40# CONFIG_POSIX_MQUEUE is not set
41# CONFIG_BSD_PROCESS_ACCT is not set
42# CONFIG_TASKSTATS is not set
43# CONFIG_AUDIT is not set
44
45#
46# RCU Subsystem
47#
48CONFIG_CLASSIC_RCU=y
49# CONFIG_TREE_RCU is not set
50# CONFIG_PREEMPT_RCU is not set
51# CONFIG_TREE_RCU_TRACE is not set
52# CONFIG_PREEMPT_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=17
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_USER_NS is not set
62# CONFIG_PID_NS is not set
63# CONFIG_NET_NS is not set
64# CONFIG_BLK_DEV_INITRD is not set
65CONFIG_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68# CONFIG_EMBEDDED is not set
69CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set
73# CONFIG_KALLSYMS_EXTRA_PASS is not set
74CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y
76CONFIG_BUG=y
77CONFIG_ELF_CORE=y
78CONFIG_BASE_FULL=y
79CONFIG_FUTEX=y
80CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y
84CONFIG_SHMEM=y
85CONFIG_AIO=y
86CONFIG_VM_EVENT_COUNTERS=y
87CONFIG_SLUB_DEBUG=y
88CONFIG_COMPAT_BRK=y
89# CONFIG_SLAB is not set
90CONFIG_SLUB=y
91# CONFIG_SLOB is not set
92# CONFIG_PROFILING is not set
93CONFIG_HAVE_OPROFILE=y
94# CONFIG_KPROBES is not set
95CONFIG_HAVE_KPROBES=y
96CONFIG_HAVE_KRETPROBES=y
97CONFIG_HAVE_CLK=y
98CONFIG_HAVE_GENERIC_DMA_COHERENT=y
99CONFIG_SLABINFO=y
100CONFIG_RT_MUTEXES=y
101CONFIG_BASE_SMALL=0
102CONFIG_MODULES=y
103# CONFIG_MODULE_FORCE_LOAD is not set
104CONFIG_MODULE_UNLOAD=y
105# CONFIG_MODULE_FORCE_UNLOAD is not set
106# CONFIG_MODVERSIONS is not set
107# CONFIG_MODULE_SRCVERSION_ALL is not set
108CONFIG_BLOCK=y
109# CONFIG_LBD is not set
110# CONFIG_BLK_DEV_IO_TRACE is not set
111# CONFIG_BLK_DEV_BSG is not set
112# CONFIG_BLK_DEV_INTEGRITY is not set
113
114#
115# IO Schedulers
116#
117CONFIG_IOSCHED_NOOP=y
118CONFIG_IOSCHED_AS=y
119CONFIG_IOSCHED_DEADLINE=y
120CONFIG_IOSCHED_CFQ=y
121# CONFIG_DEFAULT_AS is not set
122# CONFIG_DEFAULT_DEADLINE is not set
123CONFIG_DEFAULT_CFQ=y
124# CONFIG_DEFAULT_NOOP is not set
125CONFIG_DEFAULT_IOSCHED="cfq"
126# CONFIG_FREEZER is not set
127
128#
129# System Type
130#
131# CONFIG_ARCH_AAEC2000 is not set
132# CONFIG_ARCH_INTEGRATOR is not set
133# CONFIG_ARCH_REALVIEW is not set
134# CONFIG_ARCH_VERSATILE is not set
135# CONFIG_ARCH_AT91 is not set
136# CONFIG_ARCH_CLPS711X is not set
137# CONFIG_ARCH_EBSA110 is not set
138# CONFIG_ARCH_EP93XX is not set
139# CONFIG_ARCH_FOOTBRIDGE is not set
140# CONFIG_ARCH_NETX is not set
141# CONFIG_ARCH_H720X is not set
142# CONFIG_ARCH_IMX is not set
143# CONFIG_ARCH_IOP13XX is not set
144# CONFIG_ARCH_IOP32X is not set
145# CONFIG_ARCH_IOP33X is not set
146# CONFIG_ARCH_IXP23XX is not set
147# CONFIG_ARCH_IXP2000 is not set
148# CONFIG_ARCH_IXP4XX is not set
149# CONFIG_ARCH_L7200 is not set
150# CONFIG_ARCH_KIRKWOOD is not set
151# CONFIG_ARCH_KS8695 is not set
152# CONFIG_ARCH_NS9XXX is not set
153# CONFIG_ARCH_LOKI is not set
154# CONFIG_ARCH_MV78XX0 is not set
155# CONFIG_ARCH_MXC is not set
156# CONFIG_ARCH_ORION5X is not set
157# CONFIG_ARCH_PNX4008 is not set
158CONFIG_ARCH_PXA=y
159# CONFIG_ARCH_RPC is not set
160# CONFIG_ARCH_SA1100 is not set
161# CONFIG_ARCH_S3C2410 is not set
162# CONFIG_ARCH_S3C64XX is not set
163# CONFIG_ARCH_SHARK is not set
164# CONFIG_ARCH_LH7A40X is not set
165# CONFIG_ARCH_DAVINCI is not set
166# CONFIG_ARCH_OMAP is not set
167# CONFIG_ARCH_MSM is not set
168# CONFIG_ARCH_W90X900 is not set
169
170#
171# Intel PXA2xx/PXA3xx Implementations
172#
173
174#
175# Supported PXA3xx Processor Variants
176#
177CONFIG_CPU_PXA300=y
178# CONFIG_CPU_PXA310 is not set
179# CONFIG_CPU_PXA320 is not set
180# CONFIG_CPU_PXA930 is not set
181# CONFIG_CPU_PXA935 is not set
182# CONFIG_ARCH_GUMSTIX is not set
183# CONFIG_MACH_INTELMOTE2 is not set
184# CONFIG_ARCH_LUBBOCK is not set
185# CONFIG_MACH_LOGICPD_PXA270 is not set
186# CONFIG_MACH_MAINSTONE is not set
187# CONFIG_MACH_MP900C is not set
188# CONFIG_ARCH_PXA_IDP is not set
189# CONFIG_PXA_SHARPSL is not set
190# CONFIG_ARCH_VIPER is not set
191# CONFIG_ARCH_PXA_ESERIES is not set
192# CONFIG_TRIZEPS_PXA is not set
193# CONFIG_MACH_H5000 is not set
194# CONFIG_MACH_EM_X270 is not set
195# CONFIG_MACH_COLIBRI is not set
196CONFIG_MACH_COLIBRI300=y
197# CONFIG_MACH_ZYLONITE is not set
198# CONFIG_MACH_LITTLETON is not set
199# CONFIG_MACH_RAUMFELD_PROTO is not set
200# CONFIG_MACH_TAVOREVB is not set
201# CONFIG_MACH_SAAR is not set
202# CONFIG_MACH_ARMCORE is not set
203# CONFIG_MACH_CM_X300 is not set
204# CONFIG_MACH_MAGICIAN is not set
205# CONFIG_MACH_MIOA701 is not set
206# CONFIG_MACH_PCM027 is not set
207# CONFIG_ARCH_PXA_PALM is not set
208# CONFIG_PXA_EZX is not set
209CONFIG_PXA3xx=y
210# CONFIG_PXA_PWM is not set
211
212#
213# Processor Type
214#
215CONFIG_CPU_32=y
216CONFIG_CPU_XSC3=y
217CONFIG_CPU_32v5=y
218CONFIG_CPU_ABRT_EV5T=y
219CONFIG_CPU_PABRT_NOIFAR=y
220CONFIG_CPU_CACHE_VIVT=y
221CONFIG_CPU_TLB_V4WBI=y
222CONFIG_CPU_CP15=y
223CONFIG_CPU_CP15_MMU=y
224CONFIG_IO_36=y
225
226#
227# Processor Features
228#
229CONFIG_ARM_THUMB=y
230# CONFIG_CPU_DCACHE_DISABLE is not set
231# CONFIG_CPU_BPREDICT_DISABLE is not set
232CONFIG_OUTER_CACHE=y
233CONFIG_CACHE_XSC3L2=y
234CONFIG_IWMMXT=y
235CONFIG_COMMON_CLKDEV=y
236
237#
238# Bus support
239#
240# CONFIG_PCI_SYSCALL is not set
241# CONFIG_ARCH_SUPPORTS_MSI is not set
242# CONFIG_PCCARD is not set
243
244#
245# Kernel Features
246#
247CONFIG_TICK_ONESHOT=y
248# CONFIG_NO_HZ is not set
249# CONFIG_HIGH_RES_TIMERS is not set
250CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
251CONFIG_VMSPLIT_3G=y
252# CONFIG_VMSPLIT_2G is not set
253# CONFIG_VMSPLIT_1G is not set
254CONFIG_PAGE_OFFSET=0xC0000000
255# CONFIG_PREEMPT is not set
256CONFIG_HZ=100
257CONFIG_AEABI=y
258CONFIG_OABI_COMPAT=y
259CONFIG_ARCH_FLATMEM_HAS_HOLES=y
260# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
261# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
262CONFIG_SELECT_MEMORY_MODEL=y
263CONFIG_FLATMEM_MANUAL=y
264# CONFIG_DISCONTIGMEM_MANUAL is not set
265# CONFIG_SPARSEMEM_MANUAL is not set
266CONFIG_FLATMEM=y
267CONFIG_FLAT_NODE_MEM_MAP=y
268CONFIG_PAGEFLAGS_EXTENDED=y
269CONFIG_SPLIT_PTLOCK_CPUS=4096
270# CONFIG_PHYS_ADDR_T_64BIT is not set
271CONFIG_ZONE_DMA_FLAG=0
272CONFIG_VIRT_TO_BUS=y
273CONFIG_UNEVICTABLE_LRU=y
274CONFIG_ALIGNMENT_TRAP=y
275
276#
277# Boot options
278#
279CONFIG_ZBOOT_ROM_TEXT=0
280CONFIG_ZBOOT_ROM_BSS=0
281CONFIG_CMDLINE="console=ttyS0,115200 rw"
282# CONFIG_XIP_KERNEL is not set
283# CONFIG_KEXEC is not set
284
285#
286# CPU Power Management
287#
288# CONFIG_CPU_FREQ is not set
289CONFIG_CPU_IDLE=y
290CONFIG_CPU_IDLE_GOV_LADDER=y
291
292#
293# Floating point emulation
294#
295
296#
297# At least one emulation must be selected
298#
299CONFIG_FPE_NWFPE=y
300# CONFIG_FPE_NWFPE_XP is not set
301# CONFIG_FPE_FASTFPE is not set
302
303#
304# Userspace binary formats
305#
306CONFIG_BINFMT_ELF=y
307# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
308CONFIG_HAVE_AOUT=y
309# CONFIG_BINFMT_AOUT is not set
310# CONFIG_BINFMT_MISC is not set
311
312#
313# Power management options
314#
315# CONFIG_PM is not set
316CONFIG_ARCH_SUSPEND_POSSIBLE=y
317CONFIG_NET=y
318
319#
320# Networking options
321#
322CONFIG_COMPAT_NET_DEV_OPS=y
323# CONFIG_PACKET is not set
324CONFIG_UNIX=y
325CONFIG_XFRM=y
326# CONFIG_XFRM_USER is not set
327# CONFIG_XFRM_SUB_POLICY is not set
328# CONFIG_XFRM_MIGRATE is not set
329# CONFIG_XFRM_STATISTICS is not set
330# CONFIG_NET_KEY is not set
331CONFIG_INET=y
332CONFIG_IP_MULTICAST=y
333# CONFIG_IP_ADVANCED_ROUTER is not set
334CONFIG_IP_FIB_HASH=y
335CONFIG_IP_PNP=y
336# CONFIG_IP_PNP_DHCP is not set
337# CONFIG_IP_PNP_BOOTP is not set
338# CONFIG_IP_PNP_RARP is not set
339# CONFIG_NET_IPIP is not set
340# CONFIG_NET_IPGRE is not set
341# CONFIG_IP_MROUTE is not set
342# CONFIG_ARPD is not set
343CONFIG_SYN_COOKIES=y
344# CONFIG_INET_AH is not set
345# CONFIG_INET_ESP is not set
346# CONFIG_INET_IPCOMP is not set
347# CONFIG_INET_XFRM_TUNNEL is not set
348CONFIG_INET_TUNNEL=y
349CONFIG_INET_XFRM_MODE_TRANSPORT=y
350CONFIG_INET_XFRM_MODE_TUNNEL=y
351CONFIG_INET_XFRM_MODE_BEET=y
352# CONFIG_INET_LRO is not set
353CONFIG_INET_DIAG=y
354CONFIG_INET_TCP_DIAG=y
355# CONFIG_TCP_CONG_ADVANCED is not set
356CONFIG_TCP_CONG_CUBIC=y
357CONFIG_DEFAULT_TCP_CONG="cubic"
358# CONFIG_TCP_MD5SIG is not set
359CONFIG_IPV6=y
360# CONFIG_IPV6_PRIVACY is not set
361# CONFIG_IPV6_ROUTER_PREF is not set
362# CONFIG_IPV6_OPTIMISTIC_DAD is not set
363# CONFIG_INET6_AH is not set
364# CONFIG_INET6_ESP is not set
365# CONFIG_INET6_IPCOMP is not set
366# CONFIG_IPV6_MIP6 is not set
367# CONFIG_INET6_XFRM_TUNNEL is not set
368# CONFIG_INET6_TUNNEL is not set
369CONFIG_INET6_XFRM_MODE_TRANSPORT=y
370CONFIG_INET6_XFRM_MODE_TUNNEL=y
371CONFIG_INET6_XFRM_MODE_BEET=y
372# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
373CONFIG_IPV6_SIT=y
374CONFIG_IPV6_NDISC_NODETYPE=y
375# CONFIG_IPV6_TUNNEL is not set
376# CONFIG_IPV6_MULTIPLE_TABLES is not set
377# CONFIG_IPV6_MROUTE is not set
378# CONFIG_NETWORK_SECMARK is not set
379# CONFIG_NETFILTER is not set
380# CONFIG_IP_DCCP is not set
381# CONFIG_IP_SCTP is not set
382# CONFIG_TIPC is not set
383# CONFIG_ATM is not set
384# CONFIG_BRIDGE is not set
385# CONFIG_NET_DSA is not set
386# CONFIG_VLAN_8021Q is not set
387# CONFIG_DECNET is not set
388# CONFIG_LLC2 is not set
389# CONFIG_IPX is not set
390# CONFIG_ATALK is not set
391# CONFIG_X25 is not set
392# CONFIG_LAPB is not set
393# CONFIG_ECONET is not set
394# CONFIG_WAN_ROUTER is not set
395# CONFIG_NET_SCHED is not set
396# CONFIG_DCB is not set
397
398#
399# Network testing
400#
401# CONFIG_NET_PKTGEN is not set
402# CONFIG_HAMRADIO is not set
403# CONFIG_CAN is not set
404# CONFIG_IRDA is not set
405# CONFIG_BT is not set
406# CONFIG_AF_RXRPC is not set
407# CONFIG_PHONET is not set
408# CONFIG_WIRELESS is not set
409# CONFIG_WIMAX is not set
410# CONFIG_RFKILL is not set
411# CONFIG_NET_9P is not set
412
413#
414# Device Drivers
415#
416
417#
418# Generic Driver Options
419#
420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
421CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y
423CONFIG_FW_LOADER=y
424CONFIG_FIRMWARE_IN_KERNEL=y
425CONFIG_EXTRA_FIRMWARE=""
426# CONFIG_DEBUG_DRIVER is not set
427# CONFIG_DEBUG_DEVRES is not set
428# CONFIG_SYS_HYPERVISOR is not set
429# CONFIG_CONNECTOR is not set
430# CONFIG_MTD is not set
431# CONFIG_PARPORT is not set
432CONFIG_BLK_DEV=y
433# CONFIG_BLK_DEV_COW_COMMON is not set
434# CONFIG_BLK_DEV_LOOP is not set
435# CONFIG_BLK_DEV_NBD is not set
436# CONFIG_BLK_DEV_UB is not set
437# CONFIG_BLK_DEV_RAM is not set
438# CONFIG_CDROM_PKTCDVD is not set
439# CONFIG_ATA_OVER_ETH is not set
440# CONFIG_MISC_DEVICES is not set
441CONFIG_HAVE_IDE=y
442# CONFIG_IDE is not set
443
444#
445# SCSI device support
446#
447# CONFIG_RAID_ATTRS is not set
448CONFIG_SCSI=y
449CONFIG_SCSI_DMA=y
450# CONFIG_SCSI_TGT is not set
451# CONFIG_SCSI_NETLINK is not set
452CONFIG_SCSI_PROC_FS=y
453
454#
455# SCSI support type (disk, tape, CD-ROM)
456#
457CONFIG_BLK_DEV_SD=y
458# CONFIG_CHR_DEV_ST is not set
459# CONFIG_CHR_DEV_OSST is not set
460# CONFIG_BLK_DEV_SR is not set
461CONFIG_CHR_DEV_SG=y
462# CONFIG_CHR_DEV_SCH is not set
463
464#
465# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
466#
467# CONFIG_SCSI_MULTI_LUN is not set
468# CONFIG_SCSI_CONSTANTS is not set
469# CONFIG_SCSI_LOGGING is not set
470# CONFIG_SCSI_SCAN_ASYNC is not set
471CONFIG_SCSI_WAIT_SCAN=m
472
473#
474# SCSI Transports
475#
476# CONFIG_SCSI_SPI_ATTRS is not set
477# CONFIG_SCSI_FC_ATTRS is not set
478# CONFIG_SCSI_ISCSI_ATTRS is not set
479# CONFIG_SCSI_SAS_LIBSAS is not set
480# CONFIG_SCSI_SRP_ATTRS is not set
481CONFIG_SCSI_LOWLEVEL=y
482# CONFIG_ISCSI_TCP is not set
483# CONFIG_LIBFC is not set
484# CONFIG_SCSI_DEBUG is not set
485# CONFIG_SCSI_DH is not set
486# CONFIG_ATA is not set
487# CONFIG_MD is not set
488CONFIG_NETDEVICES=y
489# CONFIG_DUMMY is not set
490# CONFIG_BONDING is not set
491# CONFIG_MACVLAN is not set
492# CONFIG_EQUALIZER is not set
493# CONFIG_TUN is not set
494# CONFIG_VETH is not set
495# CONFIG_PHYLIB is not set
496CONFIG_NET_ETHERNET=y
497CONFIG_MII=y
498CONFIG_AX88796=y
499# CONFIG_AX88796_93CX6 is not set
500# CONFIG_SMC91X is not set
501# CONFIG_DM9000 is not set
502# CONFIG_SMC911X is not set
503# CONFIG_SMSC911X is not set
504# CONFIG_IBM_NEW_EMAC_ZMII is not set
505# CONFIG_IBM_NEW_EMAC_RGMII is not set
506# CONFIG_IBM_NEW_EMAC_TAH is not set
507# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
508# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
509# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
510# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
511# CONFIG_B44 is not set
512# CONFIG_NETDEV_1000 is not set
513# CONFIG_NETDEV_10000 is not set
514
515#
516# Wireless LAN
517#
518# CONFIG_WLAN_PRE80211 is not set
519# CONFIG_WLAN_80211 is not set
520# CONFIG_IWLWIFI_LEDS is not set
521
522#
523# Enable WiMAX (Networking options) to see the WiMAX drivers
524#
525
526#
527# USB Network Adapters
528#
529# CONFIG_USB_CATC is not set
530# CONFIG_USB_KAWETH is not set
531# CONFIG_USB_PEGASUS is not set
532# CONFIG_USB_RTL8150 is not set
533# CONFIG_USB_USBNET is not set
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
542#
543# Input device support
544#
545CONFIG_INPUT=y
546# CONFIG_INPUT_FF_MEMLESS is not set
547# CONFIG_INPUT_POLLDEV is not set
548
549#
550# Userland interfaces
551#
552CONFIG_INPUT_MOUSEDEV=y
553CONFIG_INPUT_MOUSEDEV_PSAUX=y
554CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
555CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
556# CONFIG_INPUT_JOYDEV is not set
557CONFIG_INPUT_EVDEV=y
558# CONFIG_INPUT_EVBUG is not set
559
560#
561# Input Device Drivers
562#
563# CONFIG_INPUT_KEYBOARD is not set
564# CONFIG_INPUT_MOUSE is not set
565# CONFIG_INPUT_JOYSTICK is not set
566# CONFIG_INPUT_TABLET is not set
567# CONFIG_INPUT_TOUCHSCREEN is not set
568CONFIG_INPUT_MISC=y
569# CONFIG_INPUT_ATI_REMOTE is not set
570# CONFIG_INPUT_ATI_REMOTE2 is not set
571# CONFIG_INPUT_KEYSPAN_REMOTE is not set
572# CONFIG_INPUT_POWERMATE is not set
573# CONFIG_INPUT_YEALINK is not set
574# CONFIG_INPUT_CM109 is not set
575# CONFIG_INPUT_UINPUT is not set
576CONFIG_INPUT_GPIO_ROTARY_ENCODER=y
577
578#
579# Hardware I/O ports
580#
581CONFIG_SERIO=y
582CONFIG_SERIO_SERPORT=y
583# CONFIG_SERIO_RAW is not set
584# CONFIG_GAMEPORT is not set
585
586#
587# Character devices
588#
589CONFIG_VT=y
590CONFIG_CONSOLE_TRANSLATIONS=y
591CONFIG_VT_CONSOLE=y
592CONFIG_HW_CONSOLE=y
593# CONFIG_VT_HW_CONSOLE_BINDING is not set
594CONFIG_DEVKMEM=y
595# CONFIG_SERIAL_NONSTANDARD is not set
596
597#
598# Serial drivers
599#
600# CONFIG_SERIAL_8250 is not set
601
602#
603# Non-8250 serial port support
604#
605CONFIG_SERIAL_PXA=y
606CONFIG_SERIAL_PXA_CONSOLE=y
607CONFIG_SERIAL_CORE=y
608CONFIG_SERIAL_CORE_CONSOLE=y
609CONFIG_UNIX98_PTYS=y
610# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
611CONFIG_LEGACY_PTYS=y
612CONFIG_LEGACY_PTY_COUNT=256
613# CONFIG_IPMI_HANDLER is not set
614CONFIG_HW_RANDOM=y
615# CONFIG_R3964 is not set
616# CONFIG_RAW_DRIVER is not set
617# CONFIG_TCG_TPM is not set
618# CONFIG_I2C is not set
619# CONFIG_SPI is not set
620CONFIG_ARCH_REQUIRE_GPIOLIB=y
621CONFIG_GPIOLIB=y
622CONFIG_DEBUG_GPIO=y
623# CONFIG_GPIO_SYSFS is not set
624
625#
626# Memory mapped GPIO expanders:
627#
628
629#
630# I2C GPIO expanders:
631#
632
633#
634# PCI GPIO expanders:
635#
636
637#
638# SPI GPIO expanders:
639#
640# CONFIG_W1 is not set
641# CONFIG_POWER_SUPPLY is not set
642# CONFIG_HWMON is not set
643# CONFIG_THERMAL is not set
644# CONFIG_THERMAL_HWMON is not set
645# CONFIG_WATCHDOG is not set
646CONFIG_SSB_POSSIBLE=y
647
648#
649# Sonics Silicon Backplane
650#
651# CONFIG_SSB is not set
652
653#
654# Multifunction device drivers
655#
656# CONFIG_MFD_CORE is not set
657# CONFIG_MFD_SM501 is not set
658# CONFIG_MFD_ASIC3 is not set
659# CONFIG_HTC_EGPIO is not set
660# CONFIG_HTC_PASIC3 is not set
661# CONFIG_MFD_TMIO is not set
662# CONFIG_MFD_T7L66XB is not set
663# CONFIG_MFD_TC6387XB is not set
664# CONFIG_MFD_TC6393XB is not set
665
666#
667# Multimedia devices
668#
669
670#
671# Multimedia core support
672#
673# CONFIG_VIDEO_DEV is not set
674# CONFIG_DVB_CORE is not set
675# CONFIG_VIDEO_MEDIA is not set
676
677#
678# Multimedia drivers
679#
680# CONFIG_DAB is not set
681
682#
683# Graphics support
684#
685# CONFIG_VGASTATE is not set
686# CONFIG_VIDEO_OUTPUT_CONTROL is not set
687CONFIG_FB=y
688# CONFIG_FIRMWARE_EDID is not set
689# CONFIG_FB_DDC is not set
690# CONFIG_FB_BOOT_VESA_SUPPORT is not set
691CONFIG_FB_CFB_FILLRECT=y
692CONFIG_FB_CFB_COPYAREA=y
693CONFIG_FB_CFB_IMAGEBLIT=y
694# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
695# CONFIG_FB_SYS_FILLRECT is not set
696# CONFIG_FB_SYS_COPYAREA is not set
697# CONFIG_FB_SYS_IMAGEBLIT is not set
698# CONFIG_FB_FOREIGN_ENDIAN is not set
699# CONFIG_FB_SYS_FOPS is not set
700# CONFIG_FB_SVGALIB is not set
701# CONFIG_FB_MACMODES is not set
702# CONFIG_FB_BACKLIGHT is not set
703# CONFIG_FB_MODE_HELPERS is not set
704# CONFIG_FB_TILEBLITTING is not set
705
706#
707# Frame buffer hardware drivers
708#
709# CONFIG_FB_S1D13XXX is not set
710CONFIG_FB_PXA=y
711# CONFIG_FB_PXA_OVERLAY is not set
712# CONFIG_FB_PXA_SMARTPANEL is not set
713# CONFIG_FB_PXA_PARAMETERS is not set
714# CONFIG_FB_MBX is not set
715# CONFIG_FB_W100 is not set
716# CONFIG_FB_VIRTUAL is not set
717# CONFIG_FB_METRONOME is not set
718# CONFIG_FB_MB862XX is not set
719CONFIG_BACKLIGHT_LCD_SUPPORT=y
720# CONFIG_LCD_CLASS_DEVICE is not set
721CONFIG_BACKLIGHT_CLASS_DEVICE=y
722# CONFIG_BACKLIGHT_GENERIC is not set
723
724#
725# Display device support
726#
727# CONFIG_DISPLAY_SUPPORT is not set
728
729#
730# Console display driver support
731#
732# CONFIG_VGA_CONSOLE is not set
733CONFIG_DUMMY_CONSOLE=y
734CONFIG_FRAMEBUFFER_CONSOLE=y
735# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
736# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
737# CONFIG_FONTS is not set
738CONFIG_FONT_8x8=y
739CONFIG_FONT_8x16=y
740CONFIG_LOGO=y
741CONFIG_LOGO_LINUX_MONO=y
742CONFIG_LOGO_LINUX_VGA16=y
743CONFIG_LOGO_LINUX_CLUT224=y
744# CONFIG_SOUND is not set
745# CONFIG_HID_SUPPORT is not set
746CONFIG_USB_SUPPORT=y
747CONFIG_USB_ARCH_HAS_HCD=y
748CONFIG_USB_ARCH_HAS_OHCI=y
749# CONFIG_USB_ARCH_HAS_EHCI is not set
750CONFIG_USB=y
751CONFIG_USB_DEBUG=y
752CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
753
754#
755# Miscellaneous USB options
756#
757CONFIG_USB_DEVICEFS=y
758CONFIG_USB_DEVICE_CLASS=y
759# CONFIG_USB_DYNAMIC_MINORS is not set
760# CONFIG_USB_OTG is not set
761CONFIG_USB_MON=y
762# CONFIG_USB_WUSB is not set
763# CONFIG_USB_WUSB_CBAF is not set
764
765#
766# USB Host Controller Drivers
767#
768# CONFIG_USB_C67X00_HCD is not set
769# CONFIG_USB_OXU210HP_HCD is not set
770# CONFIG_USB_ISP116X_HCD is not set
771# CONFIG_USB_OHCI_HCD is not set
772# CONFIG_USB_SL811_HCD is not set
773# CONFIG_USB_R8A66597_HCD is not set
774# CONFIG_USB_HWA_HCD is not set
775# CONFIG_USB_MUSB_HDRC is not set
776
777#
778# USB Device Class drivers
779#
780# CONFIG_USB_ACM is not set
781# CONFIG_USB_PRINTER is not set
782# CONFIG_USB_WDM is not set
783# CONFIG_USB_TMC is not set
784
785#
786# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
787#
788
789#
790# see USB_STORAGE Help for more information
791#
792CONFIG_USB_STORAGE=y
793# CONFIG_USB_STORAGE_DEBUG is not set
794# CONFIG_USB_STORAGE_DATAFAB is not set
795# CONFIG_USB_STORAGE_FREECOM is not set
796# CONFIG_USB_STORAGE_ISD200 is not set
797# CONFIG_USB_STORAGE_USBAT is not set
798# CONFIG_USB_STORAGE_SDDR09 is not set
799# CONFIG_USB_STORAGE_SDDR55 is not set
800# CONFIG_USB_STORAGE_JUMPSHOT is not set
801# CONFIG_USB_STORAGE_ALAUDA is not set
802# CONFIG_USB_STORAGE_ONETOUCH is not set
803# CONFIG_USB_STORAGE_KARMA is not set
804# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
805# CONFIG_USB_LIBUSUAL is not set
806
807#
808# USB Imaging devices
809#
810# CONFIG_USB_MDC800 is not set
811# CONFIG_USB_MICROTEK is not set
812
813#
814# USB port drivers
815#
816# CONFIG_USB_SERIAL is not set
817
818#
819# USB Miscellaneous drivers
820#
821# CONFIG_USB_EMI62 is not set
822# CONFIG_USB_EMI26 is not set
823# CONFIG_USB_ADUTUX is not set
824# CONFIG_USB_SEVSEG is not set
825# CONFIG_USB_RIO500 is not set
826# CONFIG_USB_LEGOTOWER is not set
827# CONFIG_USB_LCD is not set
828# CONFIG_USB_BERRY_CHARGE is not set
829# CONFIG_USB_LED is not set
830# CONFIG_USB_CYPRESS_CY7C63 is not set
831# CONFIG_USB_CYTHERM is not set
832# CONFIG_USB_PHIDGET is not set
833# CONFIG_USB_IDMOUSE is not set
834# CONFIG_USB_FTDI_ELAN is not set
835# CONFIG_USB_APPLEDISPLAY is not set
836# CONFIG_USB_LD is not set
837# CONFIG_USB_TRANCEVIBRATOR is not set
838# CONFIG_USB_IOWARRIOR is not set
839# CONFIG_USB_TEST is not set
840# CONFIG_USB_ISIGHTFW is not set
841# CONFIG_USB_VST is not set
842# CONFIG_USB_GADGET is not set
843
844#
845# OTG and related infrastructure
846#
847# CONFIG_USB_GPIO_VBUS is not set
848CONFIG_MMC=y
849# CONFIG_MMC_DEBUG is not set
850# CONFIG_MMC_UNSAFE_RESUME is not set
851
852#
853# MMC/SD/SDIO Card Drivers
854#
855CONFIG_MMC_BLOCK=y
856# CONFIG_MMC_BLOCK_BOUNCE is not set
857# CONFIG_SDIO_UART is not set
858# CONFIG_MMC_TEST is not set
859
860#
861# MMC/SD/SDIO Host Controller Drivers
862#
863CONFIG_MMC_PXA=y
864# CONFIG_MMC_SDHCI is not set
865# CONFIG_MEMSTICK is not set
866# CONFIG_ACCESSIBILITY is not set
867# CONFIG_NEW_LEDS is not set
868CONFIG_RTC_LIB=y
869# CONFIG_RTC_CLASS is not set
870# CONFIG_DMADEVICES is not set
871# CONFIG_REGULATOR is not set
872# CONFIG_UIO is not set
873# CONFIG_STAGING is not set
874
875#
876# File systems
877#
878# CONFIG_EXT2_FS is not set
879CONFIG_EXT3_FS=y
880CONFIG_EXT3_FS_XATTR=y
881# CONFIG_EXT3_FS_POSIX_ACL is not set
882# CONFIG_EXT3_FS_SECURITY is not set
883# CONFIG_EXT4_FS is not set
884CONFIG_JBD=y
885CONFIG_FS_MBCACHE=y
886# CONFIG_REISERFS_FS is not set
887# CONFIG_JFS_FS is not set
888# CONFIG_FS_POSIX_ACL is not set
889CONFIG_FILE_LOCKING=y
890# CONFIG_XFS_FS is not set
891# CONFIG_OCFS2_FS is not set
892# CONFIG_BTRFS_FS is not set
893CONFIG_DNOTIFY=y
894CONFIG_INOTIFY=y
895CONFIG_INOTIFY_USER=y
896# CONFIG_QUOTA is not set
897# CONFIG_AUTOFS_FS is not set
898# CONFIG_AUTOFS4_FS is not set
899# CONFIG_FUSE_FS is not set
900
901#
902# CD-ROM/DVD Filesystems
903#
904# CONFIG_ISO9660_FS is not set
905# CONFIG_UDF_FS is not set
906
907#
908# DOS/FAT/NT Filesystems
909#
910# CONFIG_MSDOS_FS is not set
911# CONFIG_VFAT_FS is not set
912# CONFIG_NTFS_FS is not set
913
914#
915# Pseudo filesystems
916#
917CONFIG_PROC_FS=y
918CONFIG_PROC_SYSCTL=y
919CONFIG_PROC_PAGE_MONITOR=y
920CONFIG_SYSFS=y
921# CONFIG_TMPFS is not set
922# CONFIG_HUGETLB_PAGE is not set
923# CONFIG_CONFIGFS_FS is not set
924CONFIG_MISC_FILESYSTEMS=y
925# CONFIG_ADFS_FS is not set
926# CONFIG_AFFS_FS is not set
927# CONFIG_HFS_FS is not set
928# CONFIG_HFSPLUS_FS is not set
929# CONFIG_BEFS_FS is not set
930# CONFIG_BFS_FS is not set
931# CONFIG_EFS_FS is not set
932# CONFIG_CRAMFS is not set
933# CONFIG_SQUASHFS is not set
934# CONFIG_VXFS_FS is not set
935# CONFIG_MINIX_FS is not set
936# CONFIG_OMFS_FS is not set
937# CONFIG_HPFS_FS is not set
938# CONFIG_QNX4FS_FS is not set
939# CONFIG_ROMFS_FS is not set
940# CONFIG_SYSV_FS is not set
941# CONFIG_UFS_FS is not set
942CONFIG_NETWORK_FILESYSTEMS=y
943CONFIG_NFS_FS=y
944CONFIG_NFS_V3=y
945# CONFIG_NFS_V3_ACL is not set
946# CONFIG_NFS_V4 is not set
947CONFIG_ROOT_NFS=y
948# CONFIG_NFSD is not set
949CONFIG_LOCKD=y
950CONFIG_LOCKD_V4=y
951CONFIG_NFS_COMMON=y
952CONFIG_SUNRPC=y
953# CONFIG_SUNRPC_REGISTER_V4 is not set
954# CONFIG_RPCSEC_GSS_KRB5 is not set
955# CONFIG_RPCSEC_GSS_SPKM3 is not set
956# CONFIG_SMB_FS is not set
957# CONFIG_CIFS is not set
958# CONFIG_NCP_FS is not set
959# CONFIG_CODA_FS is not set
960# CONFIG_AFS_FS is not set
961
962#
963# Partition Types
964#
965# CONFIG_PARTITION_ADVANCED is not set
966CONFIG_MSDOS_PARTITION=y
967# CONFIG_NLS is not set
968# CONFIG_DLM is not set
969
970#
971# Kernel hacking
972#
973CONFIG_PRINTK_TIME=y
974CONFIG_ENABLE_WARN_DEPRECATED=y
975CONFIG_ENABLE_MUST_CHECK=y
976CONFIG_FRAME_WARN=1024
977# CONFIG_MAGIC_SYSRQ is not set
978# CONFIG_UNUSED_SYMBOLS is not set
979# CONFIG_DEBUG_FS is not set
980# CONFIG_HEADERS_CHECK is not set
981CONFIG_DEBUG_KERNEL=y
982# CONFIG_DEBUG_SHIRQ is not set
983CONFIG_DETECT_SOFTLOCKUP=y
984# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
985CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
986CONFIG_SCHED_DEBUG=y
987# CONFIG_SCHEDSTATS is not set
988# CONFIG_TIMER_STATS is not set
989# CONFIG_DEBUG_OBJECTS is not set
990# CONFIG_SLUB_DEBUG_ON is not set
991# CONFIG_SLUB_STATS is not set
992# CONFIG_DEBUG_RT_MUTEXES is not set
993# CONFIG_RT_MUTEX_TESTER is not set
994# CONFIG_DEBUG_SPINLOCK is not set
995# CONFIG_DEBUG_MUTEXES is not set
996# CONFIG_DEBUG_LOCK_ALLOC is not set
997# CONFIG_PROVE_LOCKING is not set
998# CONFIG_LOCK_STAT is not set
999# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1000# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1001# CONFIG_DEBUG_KOBJECT is not set
1002CONFIG_DEBUG_BUGVERBOSE=y
1003CONFIG_DEBUG_INFO=y
1004# CONFIG_DEBUG_VM is not set
1005# CONFIG_DEBUG_WRITECOUNT is not set
1006CONFIG_DEBUG_MEMORY_INIT=y
1007# CONFIG_DEBUG_LIST is not set
1008# CONFIG_DEBUG_SG is not set
1009# CONFIG_DEBUG_NOTIFIERS is not set
1010CONFIG_FRAME_POINTER=y
1011# CONFIG_BOOT_PRINTK_DELAY is not set
1012# CONFIG_RCU_TORTURE_TEST is not set
1013# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1014# CONFIG_BACKTRACE_SELF_TEST is not set
1015# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1016# CONFIG_FAULT_INJECTION is not set
1017# CONFIG_LATENCYTOP is not set
1018# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1019CONFIG_HAVE_FUNCTION_TRACER=y
1020
1021#
1022# Tracers
1023#
1024# CONFIG_FUNCTION_TRACER is not set
1025# CONFIG_IRQSOFF_TRACER is not set
1026# CONFIG_SCHED_TRACER is not set
1027# CONFIG_CONTEXT_SWITCH_TRACER is not set
1028# CONFIG_BOOT_TRACER is not set
1029# CONFIG_TRACE_BRANCH_PROFILING is not set
1030# CONFIG_STACK_TRACER is not set
1031# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1032# CONFIG_SAMPLES is not set
1033CONFIG_HAVE_ARCH_KGDB=y
1034# CONFIG_KGDB is not set
1035CONFIG_DEBUG_USER=y
1036CONFIG_DEBUG_ERRORS=y
1037# CONFIG_DEBUG_STACK_USAGE is not set
1038CONFIG_DEBUG_LL=y
1039# CONFIG_DEBUG_ICEDCC is not set
1040
1041#
1042# Security options
1043#
1044# CONFIG_KEYS is not set
1045# CONFIG_SECURITY is not set
1046# CONFIG_SECURITYFS is not set
1047# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1048CONFIG_CRYPTO=y
1049
1050#
1051# Crypto core or helper
1052#
1053# CONFIG_CRYPTO_FIPS is not set
1054CONFIG_CRYPTO_ALGAPI=y
1055CONFIG_CRYPTO_ALGAPI2=y
1056CONFIG_CRYPTO_AEAD2=y
1057CONFIG_CRYPTO_BLKCIPHER=y
1058CONFIG_CRYPTO_BLKCIPHER2=y
1059CONFIG_CRYPTO_HASH2=y
1060CONFIG_CRYPTO_RNG2=y
1061CONFIG_CRYPTO_MANAGER=y
1062CONFIG_CRYPTO_MANAGER2=y
1063# CONFIG_CRYPTO_GF128MUL is not set
1064# CONFIG_CRYPTO_NULL is not set
1065# CONFIG_CRYPTO_CRYPTD is not set
1066# CONFIG_CRYPTO_AUTHENC is not set
1067# CONFIG_CRYPTO_TEST is not set
1068
1069#
1070# Authenticated Encryption with Associated Data
1071#
1072# CONFIG_CRYPTO_CCM is not set
1073# CONFIG_CRYPTO_GCM is not set
1074# CONFIG_CRYPTO_SEQIV is not set
1075
1076#
1077# Block modes
1078#
1079# CONFIG_CRYPTO_CBC is not set
1080# CONFIG_CRYPTO_CTR is not set
1081# CONFIG_CRYPTO_CTS is not set
1082CONFIG_CRYPTO_ECB=y
1083# CONFIG_CRYPTO_LRW is not set
1084# CONFIG_CRYPTO_PCBC is not set
1085# CONFIG_CRYPTO_XTS is not set
1086
1087#
1088# Hash modes
1089#
1090# CONFIG_CRYPTO_HMAC is not set
1091# CONFIG_CRYPTO_XCBC is not set
1092
1093#
1094# Digest
1095#
1096# CONFIG_CRYPTO_CRC32C is not set
1097# CONFIG_CRYPTO_MD4 is not set
1098# CONFIG_CRYPTO_MD5 is not set
1099# CONFIG_CRYPTO_MICHAEL_MIC is not set
1100# CONFIG_CRYPTO_RMD128 is not set
1101# CONFIG_CRYPTO_RMD160 is not set
1102# CONFIG_CRYPTO_RMD256 is not set
1103# CONFIG_CRYPTO_RMD320 is not set
1104# CONFIG_CRYPTO_SHA1 is not set
1105# CONFIG_CRYPTO_SHA256 is not set
1106# CONFIG_CRYPTO_SHA512 is not set
1107# CONFIG_CRYPTO_TGR192 is not set
1108# CONFIG_CRYPTO_WP512 is not set
1109
1110#
1111# Ciphers
1112#
1113CONFIG_CRYPTO_AES=y
1114# CONFIG_CRYPTO_ANUBIS is not set
1115CONFIG_CRYPTO_ARC4=y
1116# CONFIG_CRYPTO_BLOWFISH is not set
1117# CONFIG_CRYPTO_CAMELLIA is not set
1118# CONFIG_CRYPTO_CAST5 is not set
1119# CONFIG_CRYPTO_CAST6 is not set
1120# CONFIG_CRYPTO_DES is not set
1121# CONFIG_CRYPTO_FCRYPT is not set
1122# CONFIG_CRYPTO_KHAZAD is not set
1123# CONFIG_CRYPTO_SALSA20 is not set
1124# CONFIG_CRYPTO_SEED is not set
1125# CONFIG_CRYPTO_SERPENT is not set
1126# CONFIG_CRYPTO_TEA is not set
1127# CONFIG_CRYPTO_TWOFISH is not set
1128
1129#
1130# Compression
1131#
1132# CONFIG_CRYPTO_DEFLATE is not set
1133# CONFIG_CRYPTO_LZO is not set
1134
1135#
1136# Random Number Generation
1137#
1138# CONFIG_CRYPTO_ANSI_CPRNG is not set
1139CONFIG_CRYPTO_HW=y
1140
1141#
1142# Library routines
1143#
1144CONFIG_BITREVERSE=y
1145CONFIG_GENERIC_FIND_LAST_BIT=y
1146# CONFIG_CRC_CCITT is not set
1147# CONFIG_CRC16 is not set
1148# CONFIG_CRC_T10DIF is not set
1149# CONFIG_CRC_ITU_T is not set
1150CONFIG_CRC32=y
1151# CONFIG_CRC7 is not set
1152# CONFIG_LIBCRC32C is not set
1153CONFIG_PLIST=y
1154CONFIG_HAS_IOMEM=y
1155CONFIG_HAS_IOPORT=y
1156CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/collie_defconfig b/arch/arm/configs/collie_defconfig
index f7622e658163..1aa62249031b 100644
--- a/arch/arm/configs/collie_defconfig
+++ b/arch/arm/configs/collie_defconfig
@@ -113,7 +113,6 @@ CONFIG_ARCH_SA1100=y
113CONFIG_SA1100_COLLIE=y 113CONFIG_SA1100_COLLIE=y
114# CONFIG_SA1100_H3100 is not set 114# CONFIG_SA1100_H3100 is not set
115# CONFIG_SA1100_H3600 is not set 115# CONFIG_SA1100_H3600 is not set
116# CONFIG_SA1100_H3800 is not set
117# CONFIG_SA1100_BADGE4 is not set 116# CONFIG_SA1100_BADGE4 is not set
118# CONFIG_SA1100_JORNADA720 is not set 117# CONFIG_SA1100_JORNADA720 is not set
119# CONFIG_SA1100_HACKKIT is not set 118# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/em_x270_defconfig b/arch/arm/configs/em_x270_defconfig
new file mode 100644
index 000000000000..e9955b786c80
--- /dev/null
+++ b/arch/arm/configs/em_x270_defconfig
@@ -0,0 +1,1741 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc2
4# Sun Feb 1 16:43:31 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ARCH_MTD_XIP=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29
30#
31# General setup
32#
33CONFIG_EXPERIMENTAL=y
34CONFIG_BROKEN_ON_SMP=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37# CONFIG_LOCALVERSION_AUTO is not set
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_POSIX_MQUEUE is not set
42# CONFIG_BSD_PROCESS_ACCT is not set
43# CONFIG_TASKSTATS is not set
44# CONFIG_AUDIT is not set
45CONFIG_IKCONFIG=y
46CONFIG_IKCONFIG_PROC=y
47CONFIG_LOG_BUF_SHIFT=14
48CONFIG_GROUP_SCHED=y
49CONFIG_FAIR_GROUP_SCHED=y
50# CONFIG_RT_GROUP_SCHED is not set
51CONFIG_USER_SCHED=y
52# CONFIG_CGROUP_SCHED is not set
53# CONFIG_CGROUPS is not set
54CONFIG_SYSFS_DEPRECATED=y
55CONFIG_SYSFS_DEPRECATED_V2=y
56# CONFIG_RELAY is not set
57# CONFIG_NAMESPACES is not set
58CONFIG_BLK_DEV_INITRD=y
59CONFIG_INITRAMFS_SOURCE=""
60CONFIG_CC_OPTIMIZE_FOR_SIZE=y
61CONFIG_SYSCTL=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
72# CONFIG_COMPAT_BRK is not set
73CONFIG_BASE_FULL=y
74CONFIG_FUTEX=y
75CONFIG_ANON_INODES=y
76CONFIG_EPOLL=y
77CONFIG_SIGNALFD=y
78CONFIG_TIMERFD=y
79CONFIG_EVENTFD=y
80CONFIG_SHMEM=y
81CONFIG_AIO=y
82# CONFIG_VM_EVENT_COUNTERS is not set
83# CONFIG_SLUB_DEBUG is not set
84# CONFIG_SLAB is not set
85CONFIG_SLUB=y
86# CONFIG_SLOB is not set
87# CONFIG_PROFILING is not set
88CONFIG_HAVE_OPROFILE=y
89# CONFIG_KPROBES is not set
90CONFIG_HAVE_KPROBES=y
91CONFIG_HAVE_KRETPROBES=y
92CONFIG_HAVE_CLK=y
93CONFIG_HAVE_GENERIC_DMA_COHERENT=y
94CONFIG_RT_MUTEXES=y
95CONFIG_BASE_SMALL=0
96CONFIG_MODULES=y
97# CONFIG_MODULE_FORCE_LOAD is not set
98CONFIG_MODULE_UNLOAD=y
99# CONFIG_MODULE_FORCE_UNLOAD is not set
100# CONFIG_MODVERSIONS is not set
101# CONFIG_MODULE_SRCVERSION_ALL is not set
102CONFIG_BLOCK=y
103# CONFIG_LBD is not set
104# CONFIG_BLK_DEV_IO_TRACE is not set
105# CONFIG_BLK_DEV_BSG is not set
106# CONFIG_BLK_DEV_INTEGRITY is not set
107
108#
109# IO Schedulers
110#
111CONFIG_IOSCHED_NOOP=y
112CONFIG_IOSCHED_AS=y
113CONFIG_IOSCHED_DEADLINE=y
114CONFIG_IOSCHED_CFQ=y
115# CONFIG_DEFAULT_AS is not set
116# CONFIG_DEFAULT_DEADLINE is not set
117CONFIG_DEFAULT_CFQ=y
118# CONFIG_DEFAULT_NOOP is not set
119CONFIG_DEFAULT_IOSCHED="cfq"
120CONFIG_CLASSIC_RCU=y
121# CONFIG_TREE_RCU is not set
122# CONFIG_PREEMPT_RCU is not set
123# CONFIG_TREE_RCU_TRACE is not set
124# CONFIG_PREEMPT_RCU_TRACE is not set
125CONFIG_FREEZER=y
126
127#
128# System Type
129#
130# CONFIG_ARCH_AAEC2000 is not set
131# CONFIG_ARCH_INTEGRATOR is not set
132# CONFIG_ARCH_REALVIEW is not set
133# CONFIG_ARCH_VERSATILE is not set
134# CONFIG_ARCH_AT91 is not set
135# CONFIG_ARCH_CLPS711X is not set
136# CONFIG_ARCH_EBSA110 is not set
137# CONFIG_ARCH_EP93XX is not set
138# CONFIG_ARCH_FOOTBRIDGE is not set
139# CONFIG_ARCH_NETX is not set
140# CONFIG_ARCH_H720X is not set
141# CONFIG_ARCH_IMX is not set
142# CONFIG_ARCH_IOP13XX is not set
143# CONFIG_ARCH_IOP32X is not set
144# CONFIG_ARCH_IOP33X is not set
145# CONFIG_ARCH_IXP23XX is not set
146# CONFIG_ARCH_IXP2000 is not set
147# CONFIG_ARCH_IXP4XX is not set
148# CONFIG_ARCH_L7200 is not set
149# CONFIG_ARCH_KIRKWOOD is not set
150# CONFIG_ARCH_KS8695 is not set
151# CONFIG_ARCH_NS9XXX is not set
152# CONFIG_ARCH_LOKI is not set
153# CONFIG_ARCH_MV78XX0 is not set
154# CONFIG_ARCH_MXC is not set
155# CONFIG_ARCH_ORION5X is not set
156# CONFIG_ARCH_PNX4008 is not set
157CONFIG_ARCH_PXA=y
158# CONFIG_ARCH_RPC is not set
159# CONFIG_ARCH_SA1100 is not set
160# CONFIG_ARCH_S3C2410 is not set
161# CONFIG_ARCH_S3C64XX is not set
162# CONFIG_ARCH_SHARK is not set
163# CONFIG_ARCH_LH7A40X is not set
164# CONFIG_ARCH_DAVINCI is not set
165# CONFIG_ARCH_OMAP is not set
166# CONFIG_ARCH_MSM is not set
167# CONFIG_ARCH_W90X900 is not set
168
169#
170# Intel PXA2xx/PXA3xx Implementations
171#
172# CONFIG_ARCH_GUMSTIX is not set
173# CONFIG_MACH_INTELMOTE2 is not set
174# CONFIG_ARCH_LUBBOCK is not set
175# CONFIG_MACH_LOGICPD_PXA270 is not set
176# CONFIG_MACH_MAINSTONE is not set
177# CONFIG_MACH_MP900C is not set
178# CONFIG_ARCH_PXA_IDP is not set
179# CONFIG_PXA_SHARPSL is not set
180# CONFIG_ARCH_VIPER is not set
181# CONFIG_ARCH_PXA_ESERIES is not set
182# CONFIG_TRIZEPS_PXA is not set
183# CONFIG_MACH_H5000 is not set
184CONFIG_MACH_EM_X270=y
185CONFIG_MACH_EXEDA=y
186# CONFIG_MACH_COLIBRI is not set
187# CONFIG_MACH_ZYLONITE is not set
188# CONFIG_MACH_LITTLETON is not set
189# CONFIG_MACH_TAVOREVB is not set
190# CONFIG_MACH_SAAR is not set
191# CONFIG_MACH_ARMCORE is not set
192# CONFIG_MACH_CM_X300 is not set
193# CONFIG_MACH_MAGICIAN is not set
194# CONFIG_MACH_MIOA701 is not set
195# CONFIG_MACH_PCM027 is not set
196# CONFIG_ARCH_PXA_PALM is not set
197# CONFIG_PXA_EZX is not set
198CONFIG_PXA27x=y
199CONFIG_PXA_SSP=y
200# CONFIG_PXA_PWM is not set
201
202#
203# Processor Type
204#
205CONFIG_CPU_32=y
206CONFIG_CPU_XSCALE=y
207CONFIG_CPU_32v5=y
208CONFIG_CPU_ABRT_EV5T=y
209CONFIG_CPU_PABRT_NOIFAR=y
210CONFIG_CPU_CACHE_VIVT=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_DCACHE_DISABLE is not set
220# CONFIG_OUTER_CACHE is not set
221CONFIG_IWMMXT=y
222CONFIG_XSCALE_PMU=y
223CONFIG_COMMON_CLKDEV=y
224
225#
226# Bus support
227#
228# CONFIG_PCI_SYSCALL is not set
229# CONFIG_ARCH_SUPPORTS_MSI is not set
230# CONFIG_PCCARD is not set
231
232#
233# Kernel Features
234#
235CONFIG_TICK_ONESHOT=y
236CONFIG_NO_HZ=y
237# CONFIG_HIGH_RES_TIMERS is not set
238CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
239CONFIG_VMSPLIT_3G=y
240# CONFIG_VMSPLIT_2G is not set
241# CONFIG_VMSPLIT_1G is not set
242CONFIG_PAGE_OFFSET=0xC0000000
243# CONFIG_PREEMPT is not set
244CONFIG_HZ=100
245CONFIG_AEABI=y
246CONFIG_OABI_COMPAT=y
247CONFIG_ARCH_FLATMEM_HAS_HOLES=y
248# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
249# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
250CONFIG_SELECT_MEMORY_MODEL=y
251CONFIG_FLATMEM_MANUAL=y
252# CONFIG_DISCONTIGMEM_MANUAL is not set
253# CONFIG_SPARSEMEM_MANUAL is not set
254CONFIG_FLATMEM=y
255CONFIG_FLAT_NODE_MEM_MAP=y
256CONFIG_PAGEFLAGS_EXTENDED=y
257CONFIG_SPLIT_PTLOCK_CPUS=4096
258# CONFIG_PHYS_ADDR_T_64BIT is not set
259CONFIG_ZONE_DMA_FLAG=0
260CONFIG_VIRT_TO_BUS=y
261CONFIG_UNEVICTABLE_LRU=y
262CONFIG_ALIGNMENT_TRAP=y
263
264#
265# Boot options
266#
267CONFIG_ZBOOT_ROM_TEXT=0x0
268CONFIG_ZBOOT_ROM_BSS=0x0
269CONFIG_CMDLINE="root=1f03 mem=32M"
270# CONFIG_XIP_KERNEL is not set
271# CONFIG_KEXEC is not set
272
273#
274# CPU Power Management
275#
276CONFIG_CPU_FREQ=y
277CONFIG_CPU_FREQ_TABLE=y
278# CONFIG_CPU_FREQ_DEBUG is not set
279CONFIG_CPU_FREQ_STAT=y
280# CONFIG_CPU_FREQ_STAT_DETAILS is not set
281CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
282# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
283# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
284# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
285# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
286CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
287# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
288CONFIG_CPU_FREQ_GOV_USERSPACE=m
289# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
290# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
291# CONFIG_CPU_IDLE is not set
292
293#
294# Floating point emulation
295#
296
297#
298# At least one emulation must be selected
299#
300CONFIG_FPE_NWFPE=y
301# CONFIG_FPE_NWFPE_XP is not set
302# CONFIG_FPE_FASTFPE is not set
303
304#
305# Userspace binary formats
306#
307CONFIG_BINFMT_ELF=y
308# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
309CONFIG_HAVE_AOUT=y
310# CONFIG_BINFMT_AOUT is not set
311# CONFIG_BINFMT_MISC is not set
312
313#
314# Power management options
315#
316CONFIG_PM=y
317# CONFIG_PM_DEBUG is not set
318CONFIG_PM_SLEEP=y
319CONFIG_SUSPEND=y
320CONFIG_SUSPEND_FREEZER=y
321CONFIG_APM_EMULATION=y
322CONFIG_ARCH_SUSPEND_POSSIBLE=y
323CONFIG_NET=y
324
325#
326# Networking options
327#
328CONFIG_COMPAT_NET_DEV_OPS=y
329CONFIG_PACKET=y
330CONFIG_PACKET_MMAP=y
331CONFIG_UNIX=y
332CONFIG_XFRM=y
333# CONFIG_XFRM_USER is not set
334# CONFIG_XFRM_SUB_POLICY is not set
335# CONFIG_XFRM_MIGRATE is not set
336# CONFIG_XFRM_STATISTICS is not set
337# CONFIG_NET_KEY is not set
338CONFIG_INET=y
339CONFIG_IP_MULTICAST=y
340# CONFIG_IP_ADVANCED_ROUTER is not set
341CONFIG_IP_FIB_HASH=y
342CONFIG_IP_PNP=y
343CONFIG_IP_PNP_DHCP=y
344CONFIG_IP_PNP_BOOTP=y
345# CONFIG_IP_PNP_RARP is not set
346# CONFIG_NET_IPIP is not set
347# CONFIG_NET_IPGRE is not set
348# CONFIG_IP_MROUTE is not set
349# CONFIG_ARPD is not set
350# CONFIG_SYN_COOKIES is not set
351# CONFIG_INET_AH is not set
352# CONFIG_INET_ESP is not set
353# CONFIG_INET_IPCOMP is not set
354# CONFIG_INET_XFRM_TUNNEL is not set
355# CONFIG_INET_TUNNEL is not set
356CONFIG_INET_XFRM_MODE_TRANSPORT=y
357CONFIG_INET_XFRM_MODE_TUNNEL=y
358CONFIG_INET_XFRM_MODE_BEET=y
359# CONFIG_INET_LRO is not set
360# CONFIG_INET_DIAG is not set
361# CONFIG_TCP_CONG_ADVANCED is not set
362CONFIG_TCP_CONG_CUBIC=y
363CONFIG_DEFAULT_TCP_CONG="cubic"
364# CONFIG_TCP_MD5SIG is not set
365# CONFIG_IPV6 is not set
366# CONFIG_NETWORK_SECMARK is not set
367# CONFIG_NETFILTER is not set
368# CONFIG_IP_DCCP is not set
369# CONFIG_IP_SCTP is not set
370# CONFIG_TIPC is not set
371# CONFIG_ATM is not set
372# CONFIG_BRIDGE is not set
373# CONFIG_NET_DSA is not set
374# CONFIG_VLAN_8021Q is not set
375# CONFIG_DECNET is not set
376# CONFIG_LLC2 is not set
377# CONFIG_IPX is not set
378# CONFIG_ATALK is not set
379# CONFIG_X25 is not set
380# CONFIG_LAPB is not set
381# CONFIG_ECONET is not set
382# CONFIG_WAN_ROUTER is not set
383# CONFIG_NET_SCHED is not set
384# CONFIG_DCB is not set
385
386#
387# Network testing
388#
389# CONFIG_NET_PKTGEN is not set
390# CONFIG_HAMRADIO is not set
391# CONFIG_CAN is not set
392# CONFIG_IRDA is not set
393CONFIG_BT=m
394CONFIG_BT_L2CAP=m
395CONFIG_BT_SCO=m
396CONFIG_BT_RFCOMM=m
397# CONFIG_BT_RFCOMM_TTY is not set
398CONFIG_BT_BNEP=m
399# CONFIG_BT_BNEP_MC_FILTER is not set
400# CONFIG_BT_BNEP_PROTO_FILTER is not set
401CONFIG_BT_HIDP=m
402
403#
404# Bluetooth device drivers
405#
406CONFIG_BT_HCIBTUSB=m
407# CONFIG_BT_HCIBTSDIO is not set
408# CONFIG_BT_HCIUART is not set
409# CONFIG_BT_HCIBCM203X is not set
410# CONFIG_BT_HCIBPA10X is not set
411# CONFIG_BT_HCIBFUSB is not set
412# CONFIG_BT_HCIVHCI is not set
413# CONFIG_AF_RXRPC is not set
414# CONFIG_PHONET is not set
415CONFIG_WIRELESS=y
416# CONFIG_CFG80211 is not set
417CONFIG_WIRELESS_OLD_REGULATORY=y
418CONFIG_WIRELESS_EXT=y
419CONFIG_WIRELESS_EXT_SYSFS=y
420CONFIG_LIB80211=m
421# CONFIG_MAC80211 is not set
422# CONFIG_WIMAX is not set
423# CONFIG_RFKILL is not set
424# CONFIG_NET_9P is not set
425
426#
427# Device Drivers
428#
429
430#
431# Generic Driver Options
432#
433CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
434CONFIG_STANDALONE=y
435CONFIG_PREVENT_FIRMWARE_BUILD=y
436CONFIG_FW_LOADER=m
437CONFIG_FIRMWARE_IN_KERNEL=y
438CONFIG_EXTRA_FIRMWARE=""
439# CONFIG_DEBUG_DRIVER is not set
440# CONFIG_DEBUG_DEVRES is not set
441# CONFIG_SYS_HYPERVISOR is not set
442# CONFIG_CONNECTOR is not set
443CONFIG_MTD=y
444# CONFIG_MTD_DEBUG is not set
445# CONFIG_MTD_CONCAT is not set
446CONFIG_MTD_PARTITIONS=y
447# CONFIG_MTD_TESTS is not set
448# CONFIG_MTD_REDBOOT_PARTS is not set
449CONFIG_MTD_CMDLINE_PARTS=y
450# CONFIG_MTD_AFS_PARTS is not set
451# CONFIG_MTD_AR7_PARTS is not set
452
453#
454# User Modules And Translation Layers
455#
456CONFIG_MTD_CHAR=y
457CONFIG_MTD_BLKDEVS=y
458CONFIG_MTD_BLOCK=y
459# CONFIG_FTL is not set
460# CONFIG_NFTL is not set
461# CONFIG_INFTL is not set
462# CONFIG_RFD_FTL is not set
463# CONFIG_SSFDC is not set
464# CONFIG_MTD_OOPS is not set
465
466#
467# RAM/ROM/Flash chip drivers
468#
469CONFIG_MTD_CFI=y
470CONFIG_MTD_JEDECPROBE=y
471CONFIG_MTD_GEN_PROBE=y
472CONFIG_MTD_CFI_ADV_OPTIONS=y
473CONFIG_MTD_CFI_NOSWAP=y
474# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
475# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
476# CONFIG_MTD_CFI_GEOMETRY is not set
477CONFIG_MTD_MAP_BANK_WIDTH_1=y
478CONFIG_MTD_MAP_BANK_WIDTH_2=y
479CONFIG_MTD_MAP_BANK_WIDTH_4=y
480# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
481# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
482# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
483CONFIG_MTD_CFI_I1=y
484CONFIG_MTD_CFI_I2=y
485# CONFIG_MTD_CFI_I4 is not set
486# CONFIG_MTD_CFI_I8 is not set
487# CONFIG_MTD_OTP is not set
488CONFIG_MTD_CFI_INTELEXT=y
489CONFIG_MTD_CFI_AMDSTD=y
490CONFIG_MTD_CFI_STAA=y
491CONFIG_MTD_CFI_UTIL=y
492# CONFIG_MTD_RAM is not set
493# CONFIG_MTD_ROM is not set
494# CONFIG_MTD_ABSENT is not set
495# CONFIG_MTD_XIP is not set
496
497#
498# Mapping drivers for chip access
499#
500# CONFIG_MTD_COMPLEX_MAPPINGS is not set
501CONFIG_MTD_PHYSMAP=y
502# CONFIG_MTD_PHYSMAP_COMPAT is not set
503CONFIG_MTD_PXA2XX=y
504# CONFIG_MTD_ARM_INTEGRATOR is not set
505# CONFIG_MTD_IMPA7 is not set
506# CONFIG_MTD_SHARP_SL is not set
507# CONFIG_MTD_PLATRAM is not set
508
509#
510# Self-contained MTD device drivers
511#
512# CONFIG_MTD_DATAFLASH is not set
513# CONFIG_MTD_M25P80 is not set
514# CONFIG_MTD_SLRAM is not set
515# CONFIG_MTD_PHRAM is not set
516# CONFIG_MTD_MTDRAM is not set
517# CONFIG_MTD_BLOCK2MTD is not set
518
519#
520# Disk-On-Chip Device Drivers
521#
522# CONFIG_MTD_DOC2000 is not set
523# CONFIG_MTD_DOC2001 is not set
524# CONFIG_MTD_DOC2001PLUS is not set
525CONFIG_MTD_NAND=y
526# CONFIG_MTD_NAND_VERIFY_WRITE is not set
527# CONFIG_MTD_NAND_ECC_SMC is not set
528# CONFIG_MTD_NAND_MUSEUM_IDS is not set
529# CONFIG_MTD_NAND_H1900 is not set
530# CONFIG_MTD_NAND_GPIO is not set
531CONFIG_MTD_NAND_IDS=y
532# CONFIG_MTD_NAND_DISKONCHIP is not set
533# CONFIG_MTD_NAND_SHARPSL is not set
534# CONFIG_MTD_NAND_NANDSIM is not set
535CONFIG_MTD_NAND_PLATFORM=y
536# CONFIG_MTD_ALAUDA is not set
537# CONFIG_MTD_ONENAND is not set
538
539#
540# LPDDR flash memory drivers
541#
542# CONFIG_MTD_LPDDR is not set
543# CONFIG_MTD_QINFO_PROBE is not set
544
545#
546# UBI - Unsorted block images
547#
548# CONFIG_MTD_UBI is not set
549# CONFIG_PARPORT is not set
550CONFIG_BLK_DEV=y
551# CONFIG_BLK_DEV_COW_COMMON is not set
552CONFIG_BLK_DEV_LOOP=y
553# CONFIG_BLK_DEV_CRYPTOLOOP is not set
554# CONFIG_BLK_DEV_NBD is not set
555# CONFIG_BLK_DEV_UB is not set
556CONFIG_BLK_DEV_RAM=y
557CONFIG_BLK_DEV_RAM_COUNT=16
558CONFIG_BLK_DEV_RAM_SIZE=4096
559# CONFIG_BLK_DEV_XIP is not set
560# CONFIG_CDROM_PKTCDVD is not set
561# CONFIG_ATA_OVER_ETH is not set
562# CONFIG_MISC_DEVICES is not set
563CONFIG_HAVE_IDE=y
564# CONFIG_IDE is not set
565
566#
567# SCSI device support
568#
569# CONFIG_RAID_ATTRS is not set
570CONFIG_SCSI=y
571CONFIG_SCSI_DMA=y
572# CONFIG_SCSI_TGT is not set
573# CONFIG_SCSI_NETLINK is not set
574CONFIG_SCSI_PROC_FS=y
575
576#
577# SCSI support type (disk, tape, CD-ROM)
578#
579CONFIG_BLK_DEV_SD=y
580# CONFIG_CHR_DEV_ST is not set
581# CONFIG_CHR_DEV_OSST is not set
582# CONFIG_BLK_DEV_SR is not set
583# CONFIG_CHR_DEV_SG is not set
584# CONFIG_CHR_DEV_SCH is not set
585
586#
587# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
588#
589# CONFIG_SCSI_MULTI_LUN is not set
590# CONFIG_SCSI_CONSTANTS is not set
591# CONFIG_SCSI_LOGGING is not set
592# CONFIG_SCSI_SCAN_ASYNC is not set
593CONFIG_SCSI_WAIT_SCAN=m
594
595#
596# SCSI Transports
597#
598# CONFIG_SCSI_SPI_ATTRS is not set
599# CONFIG_SCSI_FC_ATTRS is not set
600# CONFIG_SCSI_ISCSI_ATTRS is not set
601# CONFIG_SCSI_SAS_LIBSAS is not set
602# CONFIG_SCSI_SRP_ATTRS is not set
603# CONFIG_SCSI_LOWLEVEL is not set
604# CONFIG_SCSI_DH is not set
605# CONFIG_ATA is not set
606# CONFIG_MD is not set
607CONFIG_NETDEVICES=y
608# CONFIG_DUMMY is not set
609# CONFIG_BONDING is not set
610# CONFIG_MACVLAN is not set
611# CONFIG_EQUALIZER is not set
612# CONFIG_TUN is not set
613# CONFIG_VETH is not set
614# CONFIG_PHYLIB is not set
615CONFIG_NET_ETHERNET=y
616CONFIG_MII=y
617# CONFIG_AX88796 is not set
618# CONFIG_SMC91X is not set
619CONFIG_DM9000=y
620CONFIG_DM9000_DEBUGLEVEL=1
621# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set
622# CONFIG_ENC28J60 is not set
623# CONFIG_SMC911X is not set
624# CONFIG_SMSC911X is not set
625# CONFIG_IBM_NEW_EMAC_ZMII is not set
626# CONFIG_IBM_NEW_EMAC_RGMII is not set
627# CONFIG_IBM_NEW_EMAC_TAH is not set
628# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
629# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
630# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
631# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
632# CONFIG_B44 is not set
633# CONFIG_NETDEV_1000 is not set
634# CONFIG_NETDEV_10000 is not set
635
636#
637# Wireless LAN
638#
639# CONFIG_WLAN_PRE80211 is not set
640CONFIG_WLAN_80211=y
641CONFIG_LIBERTAS=m
642# CONFIG_LIBERTAS_USB is not set
643CONFIG_LIBERTAS_SDIO=m
644# CONFIG_LIBERTAS_DEBUG is not set
645# CONFIG_USB_ZD1201 is not set
646# CONFIG_USB_NET_RNDIS_WLAN is not set
647# CONFIG_IWLWIFI_LEDS is not set
648# CONFIG_HOSTAP is not set
649
650#
651# Enable WiMAX (Networking options) to see the WiMAX drivers
652#
653
654#
655# USB Network Adapters
656#
657# CONFIG_USB_CATC is not set
658# CONFIG_USB_KAWETH is not set
659# CONFIG_USB_PEGASUS is not set
660# CONFIG_USB_RTL8150 is not set
661# CONFIG_USB_USBNET is not set
662# CONFIG_WAN is not set
663CONFIG_PPP=m
664CONFIG_PPP_MULTILINK=y
665CONFIG_PPP_FILTER=y
666CONFIG_PPP_ASYNC=m
667# CONFIG_PPP_SYNC_TTY is not set
668CONFIG_PPP_DEFLATE=m
669CONFIG_PPP_BSDCOMP=m
670# CONFIG_PPP_MPPE is not set
671# CONFIG_PPPOE is not set
672# CONFIG_PPPOL2TP is not set
673# CONFIG_SLIP is not set
674CONFIG_SLHC=m
675# CONFIG_NETCONSOLE is not set
676# CONFIG_NETPOLL is not set
677# CONFIG_NET_POLL_CONTROLLER is not set
678# CONFIG_ISDN is not set
679
680#
681# Input device support
682#
683CONFIG_INPUT=y
684# CONFIG_INPUT_FF_MEMLESS is not set
685# CONFIG_INPUT_POLLDEV is not set
686
687#
688# Userland interfaces
689#
690CONFIG_INPUT_MOUSEDEV=y
691CONFIG_INPUT_MOUSEDEV_PSAUX=y
692CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
693CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
694# CONFIG_INPUT_JOYDEV is not set
695CONFIG_INPUT_EVDEV=y
696# CONFIG_INPUT_EVBUG is not set
697CONFIG_INPUT_APMPOWER=y
698
699#
700# Input Device Drivers
701#
702CONFIG_INPUT_KEYBOARD=y
703CONFIG_KEYBOARD_ATKBD=y
704# CONFIG_KEYBOARD_SUNKBD is not set
705# CONFIG_KEYBOARD_LKKBD is not set
706# CONFIG_KEYBOARD_XTKBD is not set
707# CONFIG_KEYBOARD_NEWTON is not set
708# CONFIG_KEYBOARD_STOWAWAY is not set
709CONFIG_KEYBOARD_PXA27x=y
710CONFIG_KEYBOARD_GPIO=y
711# CONFIG_INPUT_MOUSE is not set
712# CONFIG_INPUT_JOYSTICK is not set
713# CONFIG_INPUT_TABLET is not set
714CONFIG_INPUT_TOUCHSCREEN=y
715# CONFIG_TOUCHSCREEN_ADS7846 is not set
716# CONFIG_TOUCHSCREEN_DA9034 is not set
717# CONFIG_TOUCHSCREEN_FUJITSU is not set
718# CONFIG_TOUCHSCREEN_GUNZE is not set
719# CONFIG_TOUCHSCREEN_ELO is not set
720# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
721# CONFIG_TOUCHSCREEN_MTOUCH is not set
722# CONFIG_TOUCHSCREEN_INEXIO is not set
723# CONFIG_TOUCHSCREEN_MK712 is not set
724# CONFIG_TOUCHSCREEN_PENMOUNT is not set
725# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
726# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
727CONFIG_TOUCHSCREEN_WM97XX=m
728# CONFIG_TOUCHSCREEN_WM9705 is not set
729CONFIG_TOUCHSCREEN_WM9712=y
730# CONFIG_TOUCHSCREEN_WM9713 is not set
731# CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE is not set
732# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
733# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
734# CONFIG_TOUCHSCREEN_TSC2007 is not set
735# CONFIG_INPUT_MISC is not set
736
737#
738# Hardware I/O ports
739#
740CONFIG_SERIO=y
741# CONFIG_SERIO_SERPORT is not set
742CONFIG_SERIO_LIBPS2=y
743# CONFIG_SERIO_RAW is not set
744# CONFIG_GAMEPORT is not set
745
746#
747# Character devices
748#
749CONFIG_VT=y
750CONFIG_CONSOLE_TRANSLATIONS=y
751CONFIG_VT_CONSOLE=y
752CONFIG_HW_CONSOLE=y
753# CONFIG_VT_HW_CONSOLE_BINDING is not set
754CONFIG_DEVKMEM=y
755# CONFIG_SERIAL_NONSTANDARD is not set
756
757#
758# Serial drivers
759#
760# CONFIG_SERIAL_8250 is not set
761
762#
763# Non-8250 serial port support
764#
765CONFIG_SERIAL_PXA=y
766CONFIG_SERIAL_PXA_CONSOLE=y
767CONFIG_SERIAL_CORE=y
768CONFIG_SERIAL_CORE_CONSOLE=y
769CONFIG_UNIX98_PTYS=y
770# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
771CONFIG_LEGACY_PTYS=y
772CONFIG_LEGACY_PTY_COUNT=16
773# CONFIG_IPMI_HANDLER is not set
774# CONFIG_HW_RANDOM is not set
775# CONFIG_NVRAM is not set
776# CONFIG_R3964 is not set
777# CONFIG_RAW_DRIVER is not set
778# CONFIG_TCG_TPM is not set
779CONFIG_I2C=y
780CONFIG_I2C_BOARDINFO=y
781CONFIG_I2C_CHARDEV=m
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_GPIO is not set
792# CONFIG_I2C_OCORES is not set
793CONFIG_I2C_PXA=y
794# CONFIG_I2C_PXA_SLAVE is not set
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_EEPROM_AT24 is not set
815# CONFIG_EEPROM_LEGACY is not set
816# CONFIG_SENSORS_PCF8574 is not set
817# CONFIG_PCF8575 is not set
818# CONFIG_SENSORS_PCA9539 is not set
819# CONFIG_SENSORS_PCF8591 is not set
820# CONFIG_SENSORS_MAX6875 is not set
821# CONFIG_SENSORS_TSL2550 is not set
822# CONFIG_I2C_DEBUG_CORE is not set
823# CONFIG_I2C_DEBUG_ALGO is not set
824# CONFIG_I2C_DEBUG_BUS is not set
825# CONFIG_I2C_DEBUG_CHIP is not set
826CONFIG_SPI=y
827# CONFIG_SPI_DEBUG is not set
828CONFIG_SPI_MASTER=y
829
830#
831# SPI Master Controller Drivers
832#
833# CONFIG_SPI_BITBANG is not set
834# CONFIG_SPI_GPIO is not set
835CONFIG_SPI_PXA2XX=y
836
837#
838# SPI Protocol Masters
839#
840# CONFIG_SPI_AT25 is not set
841# CONFIG_SPI_SPIDEV is not set
842# CONFIG_SPI_TLE62X0 is not set
843CONFIG_ARCH_REQUIRE_GPIOLIB=y
844CONFIG_GPIOLIB=y
845# CONFIG_DEBUG_GPIO is not set
846# CONFIG_GPIO_SYSFS is not set
847
848#
849# Memory mapped GPIO expanders:
850#
851
852#
853# I2C GPIO expanders:
854#
855# CONFIG_GPIO_MAX732X is not set
856# CONFIG_GPIO_PCA953X is not set
857# CONFIG_GPIO_PCF857X is not set
858
859#
860# PCI GPIO expanders:
861#
862
863#
864# SPI GPIO expanders:
865#
866# CONFIG_GPIO_MAX7301 is not set
867# CONFIG_GPIO_MCP23S08 is not set
868# CONFIG_W1 is not set
869CONFIG_POWER_SUPPLY=y
870# CONFIG_POWER_SUPPLY_DEBUG is not set
871# CONFIG_PDA_POWER is not set
872# CONFIG_APM_POWER is not set
873# CONFIG_BATTERY_DS2760 is not set
874# CONFIG_BATTERY_BQ27x00 is not set
875CONFIG_BATTERY_DA9030=y
876# CONFIG_HWMON is not set
877# CONFIG_THERMAL is not set
878# CONFIG_THERMAL_HWMON is not set
879# CONFIG_WATCHDOG is not set
880CONFIG_SSB_POSSIBLE=y
881
882#
883# Sonics Silicon Backplane
884#
885# CONFIG_SSB is not set
886
887#
888# Multifunction device drivers
889#
890# CONFIG_MFD_CORE is not set
891# CONFIG_MFD_SM501 is not set
892# CONFIG_MFD_ASIC3 is not set
893# CONFIG_HTC_EGPIO is not set
894# CONFIG_HTC_PASIC3 is not set
895# CONFIG_UCB1400_CORE is not set
896# CONFIG_TPS65010 is not set
897# CONFIG_TWL4030_CORE is not set
898# CONFIG_MFD_TMIO is not set
899# CONFIG_MFD_T7L66XB is not set
900# CONFIG_MFD_TC6387XB is not set
901# CONFIG_MFD_TC6393XB is not set
902CONFIG_PMIC_DA903X=y
903# CONFIG_MFD_WM8400 is not set
904# CONFIG_MFD_WM8350_I2C is not set
905# CONFIG_MFD_PCF50633 is not set
906
907#
908# Multimedia devices
909#
910
911#
912# Multimedia core support
913#
914CONFIG_VIDEO_DEV=m
915CONFIG_VIDEO_V4L2_COMMON=m
916# CONFIG_VIDEO_ALLOW_V4L1 is not set
917CONFIG_VIDEO_V4L1_COMPAT=y
918# CONFIG_DVB_CORE is not set
919CONFIG_VIDEO_MEDIA=m
920
921#
922# Multimedia drivers
923#
924# CONFIG_MEDIA_ATTACH is not set
925CONFIG_MEDIA_TUNER=m
926CONFIG_MEDIA_TUNER_CUSTOMIZE=y
927# CONFIG_MEDIA_TUNER_SIMPLE is not set
928# CONFIG_MEDIA_TUNER_TDA8290 is not set
929# CONFIG_MEDIA_TUNER_TDA827X is not set
930# CONFIG_MEDIA_TUNER_TDA18271 is not set
931# CONFIG_MEDIA_TUNER_TDA9887 is not set
932# CONFIG_MEDIA_TUNER_TEA5761 is not set
933# CONFIG_MEDIA_TUNER_TEA5767 is not set
934# CONFIG_MEDIA_TUNER_MT20XX is not set
935# CONFIG_MEDIA_TUNER_MT2060 is not set
936# CONFIG_MEDIA_TUNER_MT2266 is not set
937# CONFIG_MEDIA_TUNER_MT2131 is not set
938# CONFIG_MEDIA_TUNER_QT1010 is not set
939# CONFIG_MEDIA_TUNER_XC2028 is not set
940# CONFIG_MEDIA_TUNER_XC5000 is not set
941# CONFIG_MEDIA_TUNER_MXL5005S is not set
942# CONFIG_MEDIA_TUNER_MXL5007T is not set
943CONFIG_VIDEO_V4L2=m
944CONFIG_VIDEOBUF_GEN=m
945CONFIG_VIDEOBUF_DMA_SG=m
946CONFIG_VIDEO_CAPTURE_DRIVERS=y
947# CONFIG_VIDEO_ADV_DEBUG is not set
948# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
949# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
950
951#
952# Encoders/decoders and other helper chips
953#
954
955#
956# Audio decoders
957#
958# CONFIG_VIDEO_TVAUDIO is not set
959# CONFIG_VIDEO_TDA7432 is not set
960# CONFIG_VIDEO_TDA9840 is not set
961# CONFIG_VIDEO_TDA9875 is not set
962# CONFIG_VIDEO_TEA6415C is not set
963# CONFIG_VIDEO_TEA6420 is not set
964# CONFIG_VIDEO_MSP3400 is not set
965# CONFIG_VIDEO_CS5345 is not set
966# CONFIG_VIDEO_CS53L32A is not set
967# CONFIG_VIDEO_M52790 is not set
968# CONFIG_VIDEO_TLV320AIC23B is not set
969# CONFIG_VIDEO_WM8775 is not set
970# CONFIG_VIDEO_WM8739 is not set
971# CONFIG_VIDEO_VP27SMPX is not set
972
973#
974# Video decoders
975#
976# CONFIG_VIDEO_OV7670 is not set
977# CONFIG_VIDEO_TCM825X is not set
978# CONFIG_VIDEO_SAA711X is not set
979# CONFIG_VIDEO_SAA717X is not set
980# CONFIG_VIDEO_TVP514X is not set
981# CONFIG_VIDEO_TVP5150 is not set
982
983#
984# Video and audio decoders
985#
986# CONFIG_VIDEO_CX25840 is not set
987
988#
989# MPEG video encoders
990#
991# CONFIG_VIDEO_CX2341X is not set
992
993#
994# Video encoders
995#
996# CONFIG_VIDEO_SAA7127 is not set
997
998#
999# Video improvement chips
1000#
1001# CONFIG_VIDEO_UPD64031A is not set
1002# CONFIG_VIDEO_UPD64083 is not set
1003# CONFIG_VIDEO_VIVI is not set
1004# CONFIG_VIDEO_SAA5246A is not set
1005# CONFIG_VIDEO_SAA5249 is not set
1006CONFIG_SOC_CAMERA=m
1007# CONFIG_SOC_CAMERA_MT9M001 is not set
1008CONFIG_SOC_CAMERA_MT9M111=m
1009# CONFIG_SOC_CAMERA_MT9T031 is not set
1010# CONFIG_SOC_CAMERA_MT9V022 is not set
1011# CONFIG_SOC_CAMERA_TW9910 is not set
1012# CONFIG_SOC_CAMERA_PLATFORM is not set
1013# CONFIG_SOC_CAMERA_OV772X is not set
1014CONFIG_VIDEO_PXA27x=m
1015# CONFIG_VIDEO_SH_MOBILE_CEU is not set
1016# CONFIG_V4L_USB_DRIVERS is not set
1017# CONFIG_RADIO_ADAPTERS is not set
1018# CONFIG_DAB is not set
1019
1020#
1021# Graphics support
1022#
1023# CONFIG_VGASTATE is not set
1024# CONFIG_VIDEO_OUTPUT_CONTROL is not set
1025CONFIG_FB=y
1026# CONFIG_FIRMWARE_EDID is not set
1027# CONFIG_FB_DDC is not set
1028# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1029CONFIG_FB_CFB_FILLRECT=y
1030CONFIG_FB_CFB_COPYAREA=y
1031CONFIG_FB_CFB_IMAGEBLIT=y
1032# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
1033# CONFIG_FB_SYS_FILLRECT is not set
1034# CONFIG_FB_SYS_COPYAREA is not set
1035# CONFIG_FB_SYS_IMAGEBLIT is not set
1036# CONFIG_FB_FOREIGN_ENDIAN is not set
1037# CONFIG_FB_SYS_FOPS is not set
1038# CONFIG_FB_SVGALIB is not set
1039# CONFIG_FB_MACMODES is not set
1040# CONFIG_FB_BACKLIGHT is not set
1041# CONFIG_FB_MODE_HELPERS is not set
1042# CONFIG_FB_TILEBLITTING is not set
1043
1044#
1045# Frame buffer hardware drivers
1046#
1047# CONFIG_FB_S1D13XXX is not set
1048CONFIG_FB_PXA=y
1049# CONFIG_FB_PXA_OVERLAY is not set
1050# CONFIG_FB_PXA_SMARTPANEL is not set
1051CONFIG_FB_PXA_PARAMETERS=y
1052CONFIG_FB_MBX=m
1053# CONFIG_FB_MBX_DEBUG is not set
1054# CONFIG_FB_W100 is not set
1055# CONFIG_FB_VIRTUAL is not set
1056# CONFIG_FB_METRONOME is not set
1057# CONFIG_FB_MB862XX is not set
1058CONFIG_BACKLIGHT_LCD_SUPPORT=y
1059CONFIG_LCD_CLASS_DEVICE=y
1060# CONFIG_LCD_LTV350QV is not set
1061# CONFIG_LCD_ILI9320 is not set
1062CONFIG_LCD_TDO24M=y
1063# CONFIG_LCD_VGG2432A4 is not set
1064# CONFIG_LCD_PLATFORM is not set
1065CONFIG_BACKLIGHT_CLASS_DEVICE=m
1066# CONFIG_BACKLIGHT_GENERIC is not set
1067CONFIG_BACKLIGHT_DA903X=m
1068
1069#
1070# Display device support
1071#
1072# CONFIG_DISPLAY_SUPPORT is not set
1073
1074#
1075# Console display driver support
1076#
1077# CONFIG_VGA_CONSOLE is not set
1078CONFIG_DUMMY_CONSOLE=y
1079CONFIG_FRAMEBUFFER_CONSOLE=y
1080# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
1081# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1082# CONFIG_FONTS is not set
1083CONFIG_FONT_8x8=y
1084CONFIG_FONT_8x16=y
1085CONFIG_LOGO=y
1086CONFIG_LOGO_LINUX_MONO=y
1087CONFIG_LOGO_LINUX_VGA16=y
1088CONFIG_LOGO_LINUX_CLUT224=y
1089CONFIG_SOUND=m
1090CONFIG_SOUND_OSS_CORE=y
1091CONFIG_SND=m
1092CONFIG_SND_TIMER=m
1093CONFIG_SND_PCM=m
1094# CONFIG_SND_SEQUENCER is not set
1095CONFIG_SND_OSSEMUL=y
1096CONFIG_SND_MIXER_OSS=m
1097CONFIG_SND_PCM_OSS=m
1098CONFIG_SND_PCM_OSS_PLUGINS=y
1099# CONFIG_SND_DYNAMIC_MINORS is not set
1100CONFIG_SND_SUPPORT_OLD_API=y
1101CONFIG_SND_VERBOSE_PROCFS=y
1102# CONFIG_SND_VERBOSE_PRINTK is not set
1103# CONFIG_SND_DEBUG is not set
1104CONFIG_SND_VMASTER=y
1105CONFIG_SND_AC97_CODEC=m
1106# CONFIG_SND_DRIVERS is not set
1107CONFIG_SND_ARM=y
1108CONFIG_SND_PXA2XX_LIB=m
1109CONFIG_SND_PXA2XX_LIB_AC97=y
1110# CONFIG_SND_PXA2XX_AC97 is not set
1111# CONFIG_SND_SPI is not set
1112# CONFIG_SND_USB is not set
1113CONFIG_SND_SOC=m
1114CONFIG_SND_SOC_AC97_BUS=y
1115CONFIG_SND_PXA2XX_SOC=m
1116CONFIG_SND_PXA2XX_SOC_AC97=m
1117CONFIG_SND_PXA2XX_SOC_EM_X270=m
1118CONFIG_SND_SOC_I2C_AND_SPI=m
1119# CONFIG_SND_SOC_ALL_CODECS is not set
1120CONFIG_SND_SOC_WM9712=m
1121# CONFIG_SOUND_PRIME is not set
1122CONFIG_AC97_BUS=m
1123CONFIG_HID_SUPPORT=y
1124CONFIG_HID=y
1125CONFIG_HID_DEBUG=y
1126# CONFIG_HIDRAW is not set
1127
1128#
1129# USB Input Devices
1130#
1131CONFIG_USB_HID=y
1132# CONFIG_HID_PID is not set
1133# CONFIG_USB_HIDDEV is not set
1134
1135#
1136# Special HID drivers
1137#
1138CONFIG_HID_COMPAT=y
1139CONFIG_HID_A4TECH=y
1140CONFIG_HID_APPLE=y
1141CONFIG_HID_BELKIN=y
1142CONFIG_HID_CHERRY=y
1143CONFIG_HID_CHICONY=y
1144CONFIG_HID_CYPRESS=y
1145CONFIG_HID_EZKEY=y
1146CONFIG_HID_GYRATION=y
1147CONFIG_HID_LOGITECH=y
1148# CONFIG_LOGITECH_FF is not set
1149# CONFIG_LOGIRUMBLEPAD2_FF is not set
1150CONFIG_HID_MICROSOFT=y
1151CONFIG_HID_MONTEREY=y
1152# CONFIG_HID_NTRIG is not set
1153CONFIG_HID_PANTHERLORD=y
1154# CONFIG_PANTHERLORD_FF is not set
1155CONFIG_HID_PETALYNX=y
1156CONFIG_HID_SAMSUNG=y
1157CONFIG_HID_SONY=y
1158CONFIG_HID_SUNPLUS=y
1159# CONFIG_GREENASIA_FF is not set
1160# CONFIG_HID_TOPSEED is not set
1161# CONFIG_THRUSTMASTER_FF is not set
1162# CONFIG_ZEROPLUS_FF is not set
1163CONFIG_USB_SUPPORT=y
1164CONFIG_USB_ARCH_HAS_HCD=y
1165CONFIG_USB_ARCH_HAS_OHCI=y
1166# CONFIG_USB_ARCH_HAS_EHCI is not set
1167CONFIG_USB=y
1168# CONFIG_USB_DEBUG is not set
1169# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1170
1171#
1172# Miscellaneous USB options
1173#
1174CONFIG_USB_DEVICEFS=y
1175# CONFIG_USB_DEVICE_CLASS is not set
1176# CONFIG_USB_DYNAMIC_MINORS is not set
1177# CONFIG_USB_SUSPEND is not set
1178# CONFIG_USB_OTG is not set
1179# CONFIG_USB_OTG_WHITELIST is not set
1180# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1181CONFIG_USB_MON=y
1182# CONFIG_USB_WUSB is not set
1183# CONFIG_USB_WUSB_CBAF is not set
1184
1185#
1186# USB Host Controller Drivers
1187#
1188# CONFIG_USB_C67X00_HCD is not set
1189# CONFIG_USB_OXU210HP_HCD is not set
1190# CONFIG_USB_ISP116X_HCD is not set
1191CONFIG_USB_OHCI_HCD=y
1192# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1193# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1194CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1195# CONFIG_USB_SL811_HCD is not set
1196# CONFIG_USB_R8A66597_HCD is not set
1197# CONFIG_USB_HWA_HCD is not set
1198# CONFIG_USB_MUSB_HDRC is not set
1199
1200#
1201# USB Device Class drivers
1202#
1203# CONFIG_USB_ACM is not set
1204# CONFIG_USB_PRINTER is not set
1205# CONFIG_USB_WDM is not set
1206# CONFIG_USB_TMC is not set
1207
1208#
1209# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1210#
1211
1212#
1213# see USB_STORAGE Help for more information
1214#
1215CONFIG_USB_STORAGE=y
1216# CONFIG_USB_STORAGE_DEBUG is not set
1217# CONFIG_USB_STORAGE_DATAFAB is not set
1218# CONFIG_USB_STORAGE_FREECOM is not set
1219# CONFIG_USB_STORAGE_ISD200 is not set
1220# CONFIG_USB_STORAGE_USBAT is not set
1221# CONFIG_USB_STORAGE_SDDR09 is not set
1222# CONFIG_USB_STORAGE_SDDR55 is not set
1223# CONFIG_USB_STORAGE_JUMPSHOT is not set
1224# CONFIG_USB_STORAGE_ALAUDA is not set
1225# CONFIG_USB_STORAGE_ONETOUCH is not set
1226# CONFIG_USB_STORAGE_KARMA is not set
1227# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1228# CONFIG_USB_LIBUSUAL is not set
1229
1230#
1231# USB Imaging devices
1232#
1233# CONFIG_USB_MDC800 is not set
1234# CONFIG_USB_MICROTEK is not set
1235
1236#
1237# USB port drivers
1238#
1239# CONFIG_USB_SERIAL is not set
1240
1241#
1242# USB Miscellaneous drivers
1243#
1244# CONFIG_USB_EMI62 is not set
1245# CONFIG_USB_EMI26 is not set
1246# CONFIG_USB_ADUTUX is not set
1247# CONFIG_USB_SEVSEG is not set
1248# CONFIG_USB_RIO500 is not set
1249# CONFIG_USB_LEGOTOWER is not set
1250# CONFIG_USB_LCD is not set
1251# CONFIG_USB_BERRY_CHARGE is not set
1252# CONFIG_USB_LED is not set
1253# CONFIG_USB_CYPRESS_CY7C63 is not set
1254# CONFIG_USB_CYTHERM is not set
1255# CONFIG_USB_PHIDGET is not set
1256# CONFIG_USB_IDMOUSE is not set
1257# CONFIG_USB_FTDI_ELAN is not set
1258# CONFIG_USB_APPLEDISPLAY is not set
1259# CONFIG_USB_LD is not set
1260# CONFIG_USB_TRANCEVIBRATOR is not set
1261# CONFIG_USB_IOWARRIOR is not set
1262# CONFIG_USB_TEST is not set
1263# CONFIG_USB_ISIGHTFW is not set
1264# CONFIG_USB_VST is not set
1265# CONFIG_USB_GADGET is not set
1266
1267#
1268# OTG and related infrastructure
1269#
1270# CONFIG_USB_GPIO_VBUS is not set
1271CONFIG_MMC=m
1272# CONFIG_MMC_DEBUG is not set
1273# CONFIG_MMC_UNSAFE_RESUME is not set
1274
1275#
1276# MMC/SD/SDIO Card Drivers
1277#
1278CONFIG_MMC_BLOCK=m
1279CONFIG_MMC_BLOCK_BOUNCE=y
1280# CONFIG_SDIO_UART is not set
1281# CONFIG_MMC_TEST is not set
1282
1283#
1284# MMC/SD/SDIO Host Controller Drivers
1285#
1286CONFIG_MMC_PXA=m
1287# CONFIG_MMC_SDHCI is not set
1288# CONFIG_MMC_SPI is not set
1289# CONFIG_MEMSTICK is not set
1290# CONFIG_ACCESSIBILITY is not set
1291CONFIG_NEW_LEDS=y
1292CONFIG_LEDS_CLASS=y
1293
1294#
1295# LED drivers
1296#
1297# CONFIG_LEDS_PCA9532 is not set
1298# CONFIG_LEDS_GPIO is not set
1299# CONFIG_LEDS_PCA955X is not set
1300CONFIG_LEDS_DA903X=y
1301
1302#
1303# LED Triggers
1304#
1305CONFIG_LEDS_TRIGGERS=y
1306# CONFIG_LEDS_TRIGGER_TIMER is not set
1307CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1308# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1309# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1310CONFIG_RTC_LIB=y
1311CONFIG_RTC_CLASS=y
1312CONFIG_RTC_HCTOSYS=y
1313CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1314# CONFIG_RTC_DEBUG is not set
1315
1316#
1317# RTC interfaces
1318#
1319CONFIG_RTC_INTF_SYSFS=y
1320CONFIG_RTC_INTF_PROC=y
1321CONFIG_RTC_INTF_DEV=y
1322# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1323# CONFIG_RTC_DRV_TEST is not set
1324
1325#
1326# I2C RTC drivers
1327#
1328# CONFIG_RTC_DRV_DS1307 is not set
1329# CONFIG_RTC_DRV_DS1374 is not set
1330# CONFIG_RTC_DRV_DS1672 is not set
1331# CONFIG_RTC_DRV_MAX6900 is not set
1332# CONFIG_RTC_DRV_RS5C372 is not set
1333# CONFIG_RTC_DRV_ISL1208 is not set
1334# CONFIG_RTC_DRV_X1205 is not set
1335# CONFIG_RTC_DRV_PCF8563 is not set
1336# CONFIG_RTC_DRV_PCF8583 is not set
1337# CONFIG_RTC_DRV_M41T80 is not set
1338# CONFIG_RTC_DRV_S35390A is not set
1339# CONFIG_RTC_DRV_FM3130 is not set
1340# CONFIG_RTC_DRV_RX8581 is not set
1341
1342#
1343# SPI RTC drivers
1344#
1345# CONFIG_RTC_DRV_M41T94 is not set
1346# CONFIG_RTC_DRV_DS1305 is not set
1347# CONFIG_RTC_DRV_DS1390 is not set
1348# CONFIG_RTC_DRV_MAX6902 is not set
1349# CONFIG_RTC_DRV_R9701 is not set
1350# CONFIG_RTC_DRV_RS5C348 is not set
1351# CONFIG_RTC_DRV_DS3234 is not set
1352
1353#
1354# Platform RTC drivers
1355#
1356# CONFIG_RTC_DRV_CMOS is not set
1357# CONFIG_RTC_DRV_DS1286 is not set
1358# CONFIG_RTC_DRV_DS1511 is not set
1359# CONFIG_RTC_DRV_DS1553 is not set
1360# CONFIG_RTC_DRV_DS1742 is not set
1361# CONFIG_RTC_DRV_STK17TA8 is not set
1362# CONFIG_RTC_DRV_M48T86 is not set
1363# CONFIG_RTC_DRV_M48T35 is not set
1364# CONFIG_RTC_DRV_M48T59 is not set
1365# CONFIG_RTC_DRV_BQ4802 is not set
1366CONFIG_RTC_DRV_V3020=y
1367
1368#
1369# on-CPU RTC drivers
1370#
1371CONFIG_RTC_DRV_SA1100=y
1372# CONFIG_RTC_DRV_PXA is not set
1373# CONFIG_DMADEVICES is not set
1374CONFIG_REGULATOR=y
1375# CONFIG_REGULATOR_DEBUG is not set
1376# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1377# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1378# CONFIG_REGULATOR_BQ24022 is not set
1379CONFIG_REGULATOR_DA903X=y
1380# CONFIG_UIO is not set
1381# CONFIG_STAGING is not set
1382
1383#
1384# File systems
1385#
1386CONFIG_EXT2_FS=y
1387# CONFIG_EXT2_FS_XATTR is not set
1388# CONFIG_EXT2_FS_XIP is not set
1389CONFIG_EXT3_FS=y
1390CONFIG_EXT3_FS_XATTR=y
1391# CONFIG_EXT3_FS_POSIX_ACL is not set
1392# CONFIG_EXT3_FS_SECURITY is not set
1393# CONFIG_EXT4_FS is not set
1394CONFIG_JBD=y
1395# CONFIG_JBD_DEBUG is not set
1396CONFIG_FS_MBCACHE=y
1397# CONFIG_REISERFS_FS is not set
1398# CONFIG_JFS_FS is not set
1399# CONFIG_FS_POSIX_ACL is not set
1400CONFIG_FILE_LOCKING=y
1401# CONFIG_XFS_FS is not set
1402# CONFIG_OCFS2_FS is not set
1403# CONFIG_BTRFS_FS is not set
1404CONFIG_DNOTIFY=y
1405CONFIG_INOTIFY=y
1406CONFIG_INOTIFY_USER=y
1407# CONFIG_QUOTA is not set
1408# CONFIG_AUTOFS_FS is not set
1409# CONFIG_AUTOFS4_FS is not set
1410# CONFIG_FUSE_FS is not set
1411
1412#
1413# CD-ROM/DVD Filesystems
1414#
1415# CONFIG_ISO9660_FS is not set
1416# CONFIG_UDF_FS is not set
1417
1418#
1419# DOS/FAT/NT Filesystems
1420#
1421CONFIG_FAT_FS=m
1422# CONFIG_MSDOS_FS is not set
1423CONFIG_VFAT_FS=m
1424CONFIG_FAT_DEFAULT_CODEPAGE=437
1425CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1426# CONFIG_NTFS_FS is not set
1427
1428#
1429# Pseudo filesystems
1430#
1431CONFIG_PROC_FS=y
1432CONFIG_PROC_SYSCTL=y
1433# CONFIG_PROC_PAGE_MONITOR is not set
1434CONFIG_SYSFS=y
1435CONFIG_TMPFS=y
1436# CONFIG_TMPFS_POSIX_ACL is not set
1437# CONFIG_HUGETLB_PAGE is not set
1438# CONFIG_CONFIGFS_FS is not set
1439CONFIG_MISC_FILESYSTEMS=y
1440# CONFIG_ADFS_FS is not set
1441# CONFIG_AFFS_FS is not set
1442# CONFIG_HFS_FS is not set
1443# CONFIG_HFSPLUS_FS is not set
1444# CONFIG_BEFS_FS is not set
1445# CONFIG_BFS_FS is not set
1446# CONFIG_EFS_FS is not set
1447CONFIG_JFFS2_FS=y
1448CONFIG_JFFS2_FS_DEBUG=0
1449CONFIG_JFFS2_FS_WRITEBUFFER=y
1450# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1451CONFIG_JFFS2_SUMMARY=y
1452# CONFIG_JFFS2_FS_XATTR is not set
1453# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1454CONFIG_JFFS2_ZLIB=y
1455# CONFIG_JFFS2_LZO is not set
1456CONFIG_JFFS2_RTIME=y
1457# CONFIG_JFFS2_RUBIN is not set
1458# CONFIG_CRAMFS is not set
1459# CONFIG_SQUASHFS is not set
1460# CONFIG_VXFS_FS is not set
1461# CONFIG_MINIX_FS is not set
1462# CONFIG_OMFS_FS is not set
1463# CONFIG_HPFS_FS is not set
1464# CONFIG_QNX4FS_FS is not set
1465# CONFIG_ROMFS_FS is not set
1466# CONFIG_SYSV_FS is not set
1467# CONFIG_UFS_FS is not set
1468CONFIG_NETWORK_FILESYSTEMS=y
1469CONFIG_NFS_FS=y
1470CONFIG_NFS_V3=y
1471# CONFIG_NFS_V3_ACL is not set
1472# CONFIG_NFS_V4 is not set
1473CONFIG_ROOT_NFS=y
1474# CONFIG_NFSD is not set
1475CONFIG_LOCKD=y
1476CONFIG_LOCKD_V4=y
1477CONFIG_NFS_COMMON=y
1478CONFIG_SUNRPC=y
1479# CONFIG_SUNRPC_REGISTER_V4 is not set
1480# CONFIG_RPCSEC_GSS_KRB5 is not set
1481# CONFIG_RPCSEC_GSS_SPKM3 is not set
1482# CONFIG_SMB_FS is not set
1483CONFIG_CIFS=m
1484# CONFIG_CIFS_STATS is not set
1485# CONFIG_CIFS_WEAK_PW_HASH is not set
1486# CONFIG_CIFS_XATTR is not set
1487# CONFIG_CIFS_DEBUG2 is not set
1488# CONFIG_CIFS_EXPERIMENTAL is not set
1489# CONFIG_NCP_FS is not set
1490# CONFIG_CODA_FS is not set
1491# CONFIG_AFS_FS is not set
1492
1493#
1494# Partition Types
1495#
1496CONFIG_PARTITION_ADVANCED=y
1497# CONFIG_ACORN_PARTITION is not set
1498# CONFIG_OSF_PARTITION is not set
1499# CONFIG_AMIGA_PARTITION is not set
1500# CONFIG_ATARI_PARTITION is not set
1501# CONFIG_MAC_PARTITION is not set
1502CONFIG_MSDOS_PARTITION=y
1503# CONFIG_BSD_DISKLABEL is not set
1504# CONFIG_MINIX_SUBPARTITION is not set
1505# CONFIG_SOLARIS_X86_PARTITION is not set
1506# CONFIG_UNIXWARE_DISKLABEL is not set
1507# CONFIG_LDM_PARTITION is not set
1508# CONFIG_SGI_PARTITION is not set
1509# CONFIG_ULTRIX_PARTITION is not set
1510# CONFIG_SUN_PARTITION is not set
1511# CONFIG_KARMA_PARTITION is not set
1512# CONFIG_EFI_PARTITION is not set
1513# CONFIG_SYSV68_PARTITION is not set
1514CONFIG_NLS=m
1515CONFIG_NLS_DEFAULT="iso8859-1"
1516CONFIG_NLS_CODEPAGE_437=m
1517# CONFIG_NLS_CODEPAGE_737 is not set
1518# CONFIG_NLS_CODEPAGE_775 is not set
1519# CONFIG_NLS_CODEPAGE_850 is not set
1520# CONFIG_NLS_CODEPAGE_852 is not set
1521# CONFIG_NLS_CODEPAGE_855 is not set
1522# CONFIG_NLS_CODEPAGE_857 is not set
1523# CONFIG_NLS_CODEPAGE_860 is not set
1524# CONFIG_NLS_CODEPAGE_861 is not set
1525# CONFIG_NLS_CODEPAGE_862 is not set
1526# CONFIG_NLS_CODEPAGE_863 is not set
1527# CONFIG_NLS_CODEPAGE_864 is not set
1528# CONFIG_NLS_CODEPAGE_865 is not set
1529# CONFIG_NLS_CODEPAGE_866 is not set
1530# CONFIG_NLS_CODEPAGE_869 is not set
1531# CONFIG_NLS_CODEPAGE_936 is not set
1532# CONFIG_NLS_CODEPAGE_950 is not set
1533# CONFIG_NLS_CODEPAGE_932 is not set
1534# CONFIG_NLS_CODEPAGE_949 is not set
1535# CONFIG_NLS_CODEPAGE_874 is not set
1536# CONFIG_NLS_ISO8859_8 is not set
1537# CONFIG_NLS_CODEPAGE_1250 is not set
1538# CONFIG_NLS_CODEPAGE_1251 is not set
1539# CONFIG_NLS_ASCII is not set
1540CONFIG_NLS_ISO8859_1=m
1541# CONFIG_NLS_ISO8859_2 is not set
1542# CONFIG_NLS_ISO8859_3 is not set
1543# CONFIG_NLS_ISO8859_4 is not set
1544# CONFIG_NLS_ISO8859_5 is not set
1545# CONFIG_NLS_ISO8859_6 is not set
1546# CONFIG_NLS_ISO8859_7 is not set
1547# CONFIG_NLS_ISO8859_9 is not set
1548# CONFIG_NLS_ISO8859_13 is not set
1549# CONFIG_NLS_ISO8859_14 is not set
1550# CONFIG_NLS_ISO8859_15 is not set
1551# CONFIG_NLS_KOI8_R is not set
1552# CONFIG_NLS_KOI8_U is not set
1553CONFIG_NLS_UTF8=m
1554# CONFIG_DLM is not set
1555
1556#
1557# Kernel hacking
1558#
1559# CONFIG_PRINTK_TIME is not set
1560CONFIG_ENABLE_WARN_DEPRECATED=y
1561CONFIG_ENABLE_MUST_CHECK=y
1562CONFIG_FRAME_WARN=0
1563# CONFIG_MAGIC_SYSRQ is not set
1564# CONFIG_UNUSED_SYMBOLS is not set
1565CONFIG_DEBUG_FS=y
1566# CONFIG_HEADERS_CHECK is not set
1567CONFIG_DEBUG_KERNEL=y
1568# CONFIG_DEBUG_SHIRQ is not set
1569# CONFIG_DETECT_SOFTLOCKUP is not set
1570# CONFIG_SCHED_DEBUG is not set
1571# CONFIG_SCHEDSTATS is not set
1572# CONFIG_TIMER_STATS is not set
1573# CONFIG_DEBUG_OBJECTS is not set
1574# CONFIG_DEBUG_RT_MUTEXES is not set
1575# CONFIG_RT_MUTEX_TESTER is not set
1576# CONFIG_DEBUG_SPINLOCK is not set
1577# CONFIG_DEBUG_MUTEXES is not set
1578# CONFIG_DEBUG_LOCK_ALLOC is not set
1579# CONFIG_PROVE_LOCKING is not set
1580# CONFIG_LOCK_STAT is not set
1581# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1582# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1583# CONFIG_DEBUG_KOBJECT is not set
1584# CONFIG_DEBUG_BUGVERBOSE is not set
1585# CONFIG_DEBUG_INFO is not set
1586# CONFIG_DEBUG_VM is not set
1587# CONFIG_DEBUG_WRITECOUNT is not set
1588# CONFIG_DEBUG_MEMORY_INIT is not set
1589# CONFIG_DEBUG_LIST is not set
1590# CONFIG_DEBUG_SG is not set
1591# CONFIG_DEBUG_NOTIFIERS is not set
1592CONFIG_FRAME_POINTER=y
1593# CONFIG_BOOT_PRINTK_DELAY is not set
1594# CONFIG_RCU_TORTURE_TEST is not set
1595# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1596# CONFIG_BACKTRACE_SELF_TEST is not set
1597# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1598# CONFIG_FAULT_INJECTION is not set
1599# CONFIG_LATENCYTOP is not set
1600CONFIG_SYSCTL_SYSCALL_CHECK=y
1601CONFIG_HAVE_FUNCTION_TRACER=y
1602
1603#
1604# Tracers
1605#
1606# CONFIG_FUNCTION_TRACER is not set
1607# CONFIG_IRQSOFF_TRACER is not set
1608# CONFIG_SCHED_TRACER is not set
1609# CONFIG_CONTEXT_SWITCH_TRACER is not set
1610# CONFIG_BOOT_TRACER is not set
1611# CONFIG_TRACE_BRANCH_PROFILING is not set
1612# CONFIG_STACK_TRACER is not set
1613# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1614# CONFIG_SAMPLES is not set
1615CONFIG_HAVE_ARCH_KGDB=y
1616# CONFIG_KGDB is not set
1617CONFIG_DEBUG_USER=y
1618CONFIG_DEBUG_ERRORS=y
1619# CONFIG_DEBUG_STACK_USAGE is not set
1620CONFIG_DEBUG_LL=y
1621# CONFIG_DEBUG_ICEDCC is not set
1622
1623#
1624# Security options
1625#
1626# CONFIG_KEYS is not set
1627# CONFIG_SECURITY is not set
1628# CONFIG_SECURITYFS is not set
1629# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1630CONFIG_CRYPTO=y
1631
1632#
1633# Crypto core or helper
1634#
1635# CONFIG_CRYPTO_FIPS is not set
1636CONFIG_CRYPTO_ALGAPI=m
1637CONFIG_CRYPTO_ALGAPI2=m
1638CONFIG_CRYPTO_AEAD2=m
1639CONFIG_CRYPTO_BLKCIPHER=m
1640CONFIG_CRYPTO_BLKCIPHER2=m
1641CONFIG_CRYPTO_HASH=m
1642CONFIG_CRYPTO_HASH2=m
1643CONFIG_CRYPTO_RNG2=m
1644CONFIG_CRYPTO_MANAGER=m
1645CONFIG_CRYPTO_MANAGER2=m
1646# CONFIG_CRYPTO_GF128MUL is not set
1647# CONFIG_CRYPTO_NULL is not set
1648# CONFIG_CRYPTO_CRYPTD is not set
1649# CONFIG_CRYPTO_AUTHENC is not set
1650# CONFIG_CRYPTO_TEST is not set
1651
1652#
1653# Authenticated Encryption with Associated Data
1654#
1655# CONFIG_CRYPTO_CCM is not set
1656# CONFIG_CRYPTO_GCM is not set
1657# CONFIG_CRYPTO_SEQIV is not set
1658
1659#
1660# Block modes
1661#
1662# CONFIG_CRYPTO_CBC is not set
1663# CONFIG_CRYPTO_CTR is not set
1664# CONFIG_CRYPTO_CTS is not set
1665CONFIG_CRYPTO_ECB=m
1666# CONFIG_CRYPTO_LRW is not set
1667# CONFIG_CRYPTO_PCBC is not set
1668# CONFIG_CRYPTO_XTS is not set
1669
1670#
1671# Hash modes
1672#
1673# CONFIG_CRYPTO_HMAC is not set
1674# CONFIG_CRYPTO_XCBC is not set
1675
1676#
1677# Digest
1678#
1679# CONFIG_CRYPTO_CRC32C is not set
1680# CONFIG_CRYPTO_MD4 is not set
1681# CONFIG_CRYPTO_MD5 is not set
1682CONFIG_CRYPTO_MICHAEL_MIC=m
1683# CONFIG_CRYPTO_RMD128 is not set
1684# CONFIG_CRYPTO_RMD160 is not set
1685# CONFIG_CRYPTO_RMD256 is not set
1686# CONFIG_CRYPTO_RMD320 is not set
1687# CONFIG_CRYPTO_SHA1 is not set
1688# CONFIG_CRYPTO_SHA256 is not set
1689# CONFIG_CRYPTO_SHA512 is not set
1690# CONFIG_CRYPTO_TGR192 is not set
1691# CONFIG_CRYPTO_WP512 is not set
1692
1693#
1694# Ciphers
1695#
1696CONFIG_CRYPTO_AES=m
1697# CONFIG_CRYPTO_ANUBIS is not set
1698CONFIG_CRYPTO_ARC4=m
1699# CONFIG_CRYPTO_BLOWFISH is not set
1700# CONFIG_CRYPTO_CAMELLIA is not set
1701# CONFIG_CRYPTO_CAST5 is not set
1702# CONFIG_CRYPTO_CAST6 is not set
1703# CONFIG_CRYPTO_DES is not set
1704# CONFIG_CRYPTO_FCRYPT is not set
1705# CONFIG_CRYPTO_KHAZAD is not set
1706# CONFIG_CRYPTO_SALSA20 is not set
1707# CONFIG_CRYPTO_SEED is not set
1708# CONFIG_CRYPTO_SERPENT is not set
1709# CONFIG_CRYPTO_TEA is not set
1710# CONFIG_CRYPTO_TWOFISH is not set
1711
1712#
1713# Compression
1714#
1715# CONFIG_CRYPTO_DEFLATE is not set
1716# CONFIG_CRYPTO_LZO is not set
1717
1718#
1719# Random Number Generation
1720#
1721# CONFIG_CRYPTO_ANSI_CPRNG is not set
1722# CONFIG_CRYPTO_HW is not set
1723
1724#
1725# Library routines
1726#
1727CONFIG_BITREVERSE=y
1728CONFIG_GENERIC_FIND_LAST_BIT=y
1729CONFIG_CRC_CCITT=m
1730# CONFIG_CRC16 is not set
1731# CONFIG_CRC_T10DIF is not set
1732# CONFIG_CRC_ITU_T is not set
1733CONFIG_CRC32=y
1734# CONFIG_CRC7 is not set
1735# CONFIG_LIBCRC32C is not set
1736CONFIG_ZLIB_INFLATE=y
1737CONFIG_ZLIB_DEFLATE=y
1738CONFIG_PLIST=y
1739CONFIG_HAS_IOMEM=y
1740CONFIG_HAS_IOPORT=y
1741CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
index 8f986e9f1c62..1502957db2c3 100644
--- a/arch/arm/configs/h3600_defconfig
+++ b/arch/arm/configs/h3600_defconfig
@@ -90,7 +90,6 @@ CONFIG_ARCH_SA1100=y
90# CONFIG_SA1100_COLLIE is not set 90# CONFIG_SA1100_COLLIE is not set
91# CONFIG_SA1100_H3100 is not set 91# CONFIG_SA1100_H3100 is not set
92CONFIG_SA1100_H3600=y 92CONFIG_SA1100_H3600=y
93# CONFIG_SA1100_H3800 is not set
94CONFIG_SA1100_H3XXX=y 93CONFIG_SA1100_H3XXX=y
95# CONFIG_SA1100_BADGE4 is not set 94# CONFIG_SA1100_BADGE4 is not set
96# CONFIG_SA1100_JORNADA720 is not set 95# CONFIG_SA1100_JORNADA720 is not set
@@ -100,7 +99,6 @@ CONFIG_SA1100_H3XXX=y
100# CONFIG_SA1100_SHANNON is not set 99# CONFIG_SA1100_SHANNON is not set
101# CONFIG_SA1100_SIMPAD is not set 100# CONFIG_SA1100_SIMPAD is not set
102# CONFIG_SA1100_SSP is not set 101# CONFIG_SA1100_SSP is not set
103# CONFIG_H3600_SLEEVE is not set
104 102
105# 103#
106# Processor Type 104# Processor Type
diff --git a/arch/arm/configs/hackkit_defconfig b/arch/arm/configs/hackkit_defconfig
index 1c8fb89a6730..db0708d5cbea 100644
--- a/arch/arm/configs/hackkit_defconfig
+++ b/arch/arm/configs/hackkit_defconfig
@@ -91,7 +91,6 @@ CONFIG_ARCH_SA1100=y
91# CONFIG_SA1100_COLLIE is not set 91# CONFIG_SA1100_COLLIE is not set
92# CONFIG_SA1100_H3100 is not set 92# CONFIG_SA1100_H3100 is not set
93# CONFIG_SA1100_H3600 is not set 93# CONFIG_SA1100_H3600 is not set
94# CONFIG_SA1100_H3800 is not set
95# CONFIG_SA1100_BADGE4 is not set 94# CONFIG_SA1100_BADGE4 is not set
96# CONFIG_SA1100_JORNADA720 is not set 95# CONFIG_SA1100_JORNADA720 is not set
97CONFIG_SA1100_HACKKIT=y 96CONFIG_SA1100_HACKKIT=y
diff --git a/arch/arm/configs/jornada720_defconfig b/arch/arm/configs/jornada720_defconfig
index 81fadafae02d..f3074e49f2fa 100644
--- a/arch/arm/configs/jornada720_defconfig
+++ b/arch/arm/configs/jornada720_defconfig
@@ -178,7 +178,6 @@ CONFIG_DMABOUNCE=y
178# CONFIG_SA1100_COLLIE is not set 178# CONFIG_SA1100_COLLIE is not set
179# CONFIG_SA1100_H3100 is not set 179# CONFIG_SA1100_H3100 is not set
180# CONFIG_SA1100_H3600 is not set 180# CONFIG_SA1100_H3600 is not set
181# CONFIG_SA1100_H3800 is not set
182# CONFIG_SA1100_BADGE4 is not set 181# CONFIG_SA1100_BADGE4 is not set
183CONFIG_SA1100_JORNADA720=y 182CONFIG_SA1100_JORNADA720=y
184CONFIG_SA1100_JORNADA720_SSP=y 183CONFIG_SA1100_JORNADA720_SSP=y
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 4bc38078d580..c367ae44012e 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -1,11 +1,11 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc7 3# Linux kernel version: 2.6.29-rc5
4# Thu Dec 4 15:27:39 2008 4# Tue Mar 3 21:45:57 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set 8CONFIG_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
@@ -42,10 +42,19 @@ CONFIG_SYSVIPC_SYSCTL=y
42# CONFIG_BSD_PROCESS_ACCT is not set 42# CONFIG_BSD_PROCESS_ACCT is not set
43# CONFIG_TASKSTATS is not set 43# CONFIG_TASKSTATS is not set
44# CONFIG_AUDIT is not set 44# CONFIG_AUDIT is not set
45
46#
47# RCU Subsystem
48#
49CONFIG_CLASSIC_RCU=y
50# CONFIG_TREE_RCU is not set
51# CONFIG_PREEMPT_RCU is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
45# CONFIG_IKCONFIG is not set 54# CONFIG_IKCONFIG is not set
46CONFIG_LOG_BUF_SHIFT=14 55CONFIG_LOG_BUF_SHIFT=19
47# CONFIG_CGROUPS is not set
48# CONFIG_GROUP_SCHED is not set 56# CONFIG_GROUP_SCHED is not set
57# CONFIG_CGROUPS is not set
49# CONFIG_SYSFS_DEPRECATED_V2 is not set 58# CONFIG_SYSFS_DEPRECATED_V2 is not set
50# CONFIG_RELAY is not set 59# CONFIG_RELAY is not set
51CONFIG_NAMESPACES=y 60CONFIG_NAMESPACES=y
@@ -53,6 +62,7 @@ CONFIG_NAMESPACES=y
53# CONFIG_IPC_NS is not set 62# CONFIG_IPC_NS is not set
54# CONFIG_USER_NS is not set 63# CONFIG_USER_NS is not set
55# CONFIG_PID_NS is not set 64# CONFIG_PID_NS is not set
65# CONFIG_NET_NS is not set
56# CONFIG_BLK_DEV_INITRD is not set 66# CONFIG_BLK_DEV_INITRD is not set
57CONFIG_CC_OPTIMIZE_FOR_SIZE=y 67CONFIG_CC_OPTIMIZE_FOR_SIZE=y
58CONFIG_SYSCTL=y 68CONFIG_SYSCTL=y
@@ -83,6 +93,7 @@ CONFIG_SLUB_DEBUG=y
83CONFIG_SLUB=y 93CONFIG_SLUB=y
84# CONFIG_SLOB is not set 94# CONFIG_SLOB is not set
85CONFIG_PROFILING=y 95CONFIG_PROFILING=y
96CONFIG_TRACEPOINTS=y
86# CONFIG_MARKERS is not set 97# CONFIG_MARKERS is not set
87CONFIG_OPROFILE=y 98CONFIG_OPROFILE=y
88CONFIG_HAVE_OPROFILE=y 99CONFIG_HAVE_OPROFILE=y
@@ -93,7 +104,6 @@ CONFIG_HAVE_KRETPROBES=y
93CONFIG_HAVE_GENERIC_DMA_COHERENT=y 104CONFIG_HAVE_GENERIC_DMA_COHERENT=y
94CONFIG_SLABINFO=y 105CONFIG_SLABINFO=y
95CONFIG_RT_MUTEXES=y 106CONFIG_RT_MUTEXES=y
96# CONFIG_TINY_SHMEM is not set
97CONFIG_BASE_SMALL=0 107CONFIG_BASE_SMALL=0
98CONFIG_MODULES=y 108CONFIG_MODULES=y
99# CONFIG_MODULE_FORCE_LOAD is not set 109# CONFIG_MODULE_FORCE_LOAD is not set
@@ -101,11 +111,9 @@ CONFIG_MODULE_UNLOAD=y
101# CONFIG_MODULE_FORCE_UNLOAD is not set 111# CONFIG_MODULE_FORCE_UNLOAD is not set
102# CONFIG_MODVERSIONS is not set 112# CONFIG_MODVERSIONS is not set
103# CONFIG_MODULE_SRCVERSION_ALL is not set 113# CONFIG_MODULE_SRCVERSION_ALL is not set
104CONFIG_KMOD=y
105CONFIG_BLOCK=y 114CONFIG_BLOCK=y
106# CONFIG_LBD is not set 115# CONFIG_LBD is not set
107# CONFIG_BLK_DEV_IO_TRACE is not set 116# CONFIG_BLK_DEV_IO_TRACE is not set
108# CONFIG_LSF is not set
109# CONFIG_BLK_DEV_BSG is not set 117# CONFIG_BLK_DEV_BSG is not set
110# CONFIG_BLK_DEV_INTEGRITY is not set 118# CONFIG_BLK_DEV_INTEGRITY is not set
111 119
@@ -121,7 +129,6 @@ CONFIG_IOSCHED_CFQ=y
121CONFIG_DEFAULT_CFQ=y 129CONFIG_DEFAULT_CFQ=y
122# CONFIG_DEFAULT_NOOP is not set 130# CONFIG_DEFAULT_NOOP is not set
123CONFIG_DEFAULT_IOSCHED="cfq" 131CONFIG_DEFAULT_IOSCHED="cfq"
124CONFIG_CLASSIC_RCU=y
125# CONFIG_FREEZER is not set 132# CONFIG_FREEZER is not set
126 133
127# 134#
@@ -132,7 +139,6 @@ CONFIG_CLASSIC_RCU=y
132# CONFIG_ARCH_REALVIEW is not set 139# CONFIG_ARCH_REALVIEW is not set
133# CONFIG_ARCH_VERSATILE is not set 140# CONFIG_ARCH_VERSATILE is not set
134# CONFIG_ARCH_AT91 is not set 141# CONFIG_ARCH_AT91 is not set
135# CONFIG_ARCH_CLPS7500 is not set
136# CONFIG_ARCH_CLPS711X is not set 142# CONFIG_ARCH_CLPS711X is not set
137# CONFIG_ARCH_EBSA110 is not set 143# CONFIG_ARCH_EBSA110 is not set
138# CONFIG_ARCH_EP93XX is not set 144# CONFIG_ARCH_EP93XX is not set
@@ -159,11 +165,13 @@ CONFIG_ARCH_KIRKWOOD=y
159# CONFIG_ARCH_RPC is not set 165# CONFIG_ARCH_RPC is not set
160# CONFIG_ARCH_SA1100 is not set 166# CONFIG_ARCH_SA1100 is not set
161# CONFIG_ARCH_S3C2410 is not set 167# CONFIG_ARCH_S3C2410 is not set
168# CONFIG_ARCH_S3C64XX is not set
162# CONFIG_ARCH_SHARK is not set 169# CONFIG_ARCH_SHARK is not set
163# CONFIG_ARCH_LH7A40X is not set 170# CONFIG_ARCH_LH7A40X is not set
164# CONFIG_ARCH_DAVINCI is not set 171# CONFIG_ARCH_DAVINCI is not set
165# CONFIG_ARCH_OMAP is not set 172# CONFIG_ARCH_OMAP is not set
166# CONFIG_ARCH_MSM is not set 173# CONFIG_ARCH_MSM is not set
174# CONFIG_ARCH_W90X900 is not set
167 175
168# 176#
169# Marvell Kirkwood Implementations 177# Marvell Kirkwood Implementations
@@ -171,14 +179,8 @@ CONFIG_ARCH_KIRKWOOD=y
171CONFIG_MACH_DB88F6281_BP=y 179CONFIG_MACH_DB88F6281_BP=y
172CONFIG_MACH_RD88F6192_NAS=y 180CONFIG_MACH_RD88F6192_NAS=y
173CONFIG_MACH_RD88F6281=y 181CONFIG_MACH_RD88F6281=y
174 182CONFIG_MACH_SHEEVAPLUG=y
175# 183CONFIG_MACH_TS219=y
176# Boot options
177#
178
179#
180# Power management
181#
182CONFIG_PLAT_ORION=y 184CONFIG_PLAT_ORION=y
183 185
184# 186#
@@ -214,6 +216,7 @@ CONFIG_PCI_SYSCALL=y
214# CONFIG_ARCH_SUPPORTS_MSI is not set 216# CONFIG_ARCH_SUPPORTS_MSI is not set
215CONFIG_PCI_LEGACY=y 217CONFIG_PCI_LEGACY=y
216# CONFIG_PCI_DEBUG is not set 218# CONFIG_PCI_DEBUG is not set
219# CONFIG_PCI_STUB is not set
217# CONFIG_PCCARD is not set 220# CONFIG_PCCARD is not set
218 221
219# 222#
@@ -242,7 +245,6 @@ CONFIG_FLATMEM=y
242CONFIG_FLAT_NODE_MEM_MAP=y 245CONFIG_FLAT_NODE_MEM_MAP=y
243CONFIG_PAGEFLAGS_EXTENDED=y 246CONFIG_PAGEFLAGS_EXTENDED=y
244CONFIG_SPLIT_PTLOCK_CPUS=4096 247CONFIG_SPLIT_PTLOCK_CPUS=4096
245# CONFIG_RESOURCES_64BIT is not set
246# CONFIG_PHYS_ADDR_T_64BIT is not set 248# CONFIG_PHYS_ADDR_T_64BIT is not set
247CONFIG_ZONE_DMA_FLAG=0 249CONFIG_ZONE_DMA_FLAG=0
248CONFIG_VIRT_TO_BUS=y 250CONFIG_VIRT_TO_BUS=y
@@ -291,6 +293,7 @@ CONFIG_NET=y
291# 293#
292# Networking options 294# Networking options
293# 295#
296CONFIG_COMPAT_NET_DEV_OPS=y
294CONFIG_PACKET=y 297CONFIG_PACKET=y
295CONFIG_PACKET_MMAP=y 298CONFIG_PACKET_MMAP=y
296CONFIG_UNIX=y 299CONFIG_UNIX=y
@@ -355,6 +358,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=y
355# CONFIG_ECONET is not set 358# CONFIG_ECONET is not set
356# CONFIG_WAN_ROUTER is not set 359# CONFIG_WAN_ROUTER is not set
357# CONFIG_NET_SCHED is not set 360# CONFIG_NET_SCHED is not set
361# CONFIG_DCB is not set
358 362
359# 363#
360# Network testing 364# Network testing
@@ -368,12 +372,27 @@ CONFIG_NET_PKTGEN=m
368# CONFIG_AF_RXRPC is not set 372# CONFIG_AF_RXRPC is not set
369# CONFIG_PHONET is not set 373# CONFIG_PHONET is not set
370CONFIG_WIRELESS=y 374CONFIG_WIRELESS=y
371# CONFIG_CFG80211 is not set 375CONFIG_CFG80211=y
376# CONFIG_CFG80211_REG_DEBUG is not set
377# CONFIG_NL80211 is not set
372CONFIG_WIRELESS_OLD_REGULATORY=y 378CONFIG_WIRELESS_OLD_REGULATORY=y
373CONFIG_WIRELESS_EXT=y 379CONFIG_WIRELESS_EXT=y
374CONFIG_WIRELESS_EXT_SYSFS=y 380CONFIG_WIRELESS_EXT_SYSFS=y
375# CONFIG_MAC80211 is not set 381CONFIG_LIB80211=y
376# CONFIG_IEEE80211 is not set 382CONFIG_MAC80211=y
383
384#
385# Rate control algorithm selection
386#
387CONFIG_MAC80211_RC_MINSTREL=y
388# CONFIG_MAC80211_RC_DEFAULT_PID is not set
389CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
390CONFIG_MAC80211_RC_DEFAULT="minstrel"
391# CONFIG_MAC80211_MESH is not set
392# CONFIG_MAC80211_LEDS is not set
393# CONFIG_MAC80211_DEBUGFS is not set
394# CONFIG_MAC80211_DEBUG_MENU is not set
395# CONFIG_WIMAX is not set
377# CONFIG_RFKILL is not set 396# CONFIG_RFKILL is not set
378# CONFIG_NET_9P is not set 397# CONFIG_NET_9P is not set
379 398
@@ -398,6 +417,7 @@ CONFIG_MTD=y
398# CONFIG_MTD_DEBUG is not set 417# CONFIG_MTD_DEBUG is not set
399# CONFIG_MTD_CONCAT is not set 418# CONFIG_MTD_CONCAT is not set
400CONFIG_MTD_PARTITIONS=y 419CONFIG_MTD_PARTITIONS=y
420# CONFIG_MTD_TESTS is not set
401# CONFIG_MTD_REDBOOT_PARTS is not set 421# CONFIG_MTD_REDBOOT_PARTS is not set
402CONFIG_MTD_CMDLINE_PARTS=y 422CONFIG_MTD_CMDLINE_PARTS=y
403# CONFIG_MTD_AFS_PARTS is not set 423# CONFIG_MTD_AFS_PARTS is not set
@@ -451,9 +471,7 @@ CONFIG_MTD_CFI_UTIL=y
451# 471#
452# CONFIG_MTD_COMPLEX_MAPPINGS is not set 472# CONFIG_MTD_COMPLEX_MAPPINGS is not set
453CONFIG_MTD_PHYSMAP=y 473CONFIG_MTD_PHYSMAP=y
454CONFIG_MTD_PHYSMAP_START=0x0 474# CONFIG_MTD_PHYSMAP_COMPAT is not set
455CONFIG_MTD_PHYSMAP_LEN=0x0
456CONFIG_MTD_PHYSMAP_BANKWIDTH=0
457# CONFIG_MTD_ARM_INTEGRATOR is not set 475# CONFIG_MTD_ARM_INTEGRATOR is not set
458# CONFIG_MTD_IMPA7 is not set 476# CONFIG_MTD_IMPA7 is not set
459# CONFIG_MTD_INTEL_VR_NOR is not set 477# CONFIG_MTD_INTEL_VR_NOR is not set
@@ -481,6 +499,7 @@ CONFIG_MTD_NAND=y
481# CONFIG_MTD_NAND_VERIFY_WRITE is not set 499# CONFIG_MTD_NAND_VERIFY_WRITE is not set
482# CONFIG_MTD_NAND_ECC_SMC is not set 500# CONFIG_MTD_NAND_ECC_SMC is not set
483# CONFIG_MTD_NAND_MUSEUM_IDS is not set 501# CONFIG_MTD_NAND_MUSEUM_IDS is not set
502# CONFIG_MTD_NAND_GPIO is not set
484CONFIG_MTD_NAND_IDS=y 503CONFIG_MTD_NAND_IDS=y
485# CONFIG_MTD_NAND_DISKONCHIP is not set 504# CONFIG_MTD_NAND_DISKONCHIP is not set
486# CONFIG_MTD_NAND_CAFE is not set 505# CONFIG_MTD_NAND_CAFE is not set
@@ -491,6 +510,12 @@ CONFIG_MTD_NAND_ORION=y
491# CONFIG_MTD_ONENAND is not set 510# CONFIG_MTD_ONENAND is not set
492 511
493# 512#
513# LPDDR flash memory drivers
514#
515# CONFIG_MTD_LPDDR is not set
516# CONFIG_MTD_QINFO_PROBE is not set
517
518#
494# UBI - Unsorted block images 519# UBI - Unsorted block images
495# 520#
496# CONFIG_MTD_UBI is not set 521# CONFIG_MTD_UBI is not set
@@ -568,6 +593,8 @@ CONFIG_SCSI_LOWLEVEL=y
568# CONFIG_MEGARAID_LEGACY is not set 593# CONFIG_MEGARAID_LEGACY is not set
569# CONFIG_MEGARAID_SAS is not set 594# CONFIG_MEGARAID_SAS is not set
570# CONFIG_SCSI_HPTIOP is not set 595# CONFIG_SCSI_HPTIOP is not set
596# CONFIG_LIBFC is not set
597# CONFIG_FCOE is not set
571# CONFIG_SCSI_DMX3191D is not set 598# CONFIG_SCSI_DMX3191D is not set
572# CONFIG_SCSI_FUTURE_DOMAIN is not set 599# CONFIG_SCSI_FUTURE_DOMAIN is not set
573# CONFIG_SCSI_IPS is not set 600# CONFIG_SCSI_IPS is not set
@@ -682,6 +709,9 @@ CONFIG_MARVELL_PHY=y
682# CONFIG_BROADCOM_PHY is not set 709# CONFIG_BROADCOM_PHY is not set
683# CONFIG_ICPLUS_PHY is not set 710# CONFIG_ICPLUS_PHY is not set
684# CONFIG_REALTEK_PHY is not set 711# CONFIG_REALTEK_PHY is not set
712# CONFIG_NATIONAL_PHY is not set
713# CONFIG_STE10XP is not set
714# CONFIG_LSI_ET1011C_PHY is not set
685# CONFIG_FIXED_PHY is not set 715# CONFIG_FIXED_PHY is not set
686# CONFIG_MDIO_BITBANG is not set 716# CONFIG_MDIO_BITBANG is not set
687CONFIG_NET_ETHERNET=y 717CONFIG_NET_ETHERNET=y
@@ -695,6 +725,7 @@ CONFIG_MII=y
695# CONFIG_DM9000 is not set 725# CONFIG_DM9000 is not set
696# CONFIG_ENC28J60 is not set 726# CONFIG_ENC28J60 is not set
697# CONFIG_SMC911X is not set 727# CONFIG_SMC911X is not set
728# CONFIG_SMSC911X is not set
698# CONFIG_NET_TULIP is not set 729# CONFIG_NET_TULIP is not set
699# CONFIG_HP100 is not set 730# CONFIG_HP100 is not set
700# CONFIG_IBM_NEW_EMAC_ZMII is not set 731# CONFIG_IBM_NEW_EMAC_ZMII is not set
@@ -710,7 +741,6 @@ CONFIG_NET_PCI=y
710# CONFIG_ADAPTEC_STARFIRE is not set 741# CONFIG_ADAPTEC_STARFIRE is not set
711# CONFIG_B44 is not set 742# CONFIG_B44 is not set
712# CONFIG_FORCEDETH is not set 743# CONFIG_FORCEDETH is not set
713# CONFIG_EEPRO100 is not set
714# CONFIG_E100 is not set 744# CONFIG_E100 is not set
715# CONFIG_FEALNX is not set 745# CONFIG_FEALNX is not set
716# CONFIG_NATSEMI is not set 746# CONFIG_NATSEMI is not set
@@ -720,6 +750,7 @@ CONFIG_NET_PCI=y
720# CONFIG_R6040 is not set 750# CONFIG_R6040 is not set
721# CONFIG_SIS900 is not set 751# CONFIG_SIS900 is not set
722# CONFIG_EPIC100 is not set 752# CONFIG_EPIC100 is not set
753# CONFIG_SMSC9420 is not set
723# CONFIG_SUNDANCE is not set 754# CONFIG_SUNDANCE is not set
724# CONFIG_TLAN is not set 755# CONFIG_TLAN is not set
725# CONFIG_VIA_RHINE is not set 756# CONFIG_VIA_RHINE is not set
@@ -754,8 +785,39 @@ CONFIG_MV643XX_ETH=y
754# Wireless LAN 785# Wireless LAN
755# 786#
756# CONFIG_WLAN_PRE80211 is not set 787# CONFIG_WLAN_PRE80211 is not set
757# CONFIG_WLAN_80211 is not set 788CONFIG_WLAN_80211=y
789CONFIG_LIBERTAS=y
790# CONFIG_LIBERTAS_USB is not set
791CONFIG_LIBERTAS_SDIO=y
792# CONFIG_LIBERTAS_DEBUG is not set
793# CONFIG_LIBERTAS_THINFIRM is not set
794# CONFIG_HERMES is not set
795# CONFIG_ATMEL is not set
796# CONFIG_PRISM54 is not set
797# CONFIG_USB_ZD1201 is not set
798# CONFIG_USB_NET_RNDIS_WLAN is not set
799# CONFIG_RTL8180 is not set
800# CONFIG_RTL8187 is not set
801# CONFIG_ADM8211 is not set
802# CONFIG_MAC80211_HWSIM is not set
803# CONFIG_P54_COMMON is not set
804# CONFIG_ATH5K is not set
805# CONFIG_ATH9K is not set
806# CONFIG_IPW2100 is not set
807# CONFIG_IPW2200 is not set
808# CONFIG_IWLCORE is not set
758# CONFIG_IWLWIFI_LEDS is not set 809# CONFIG_IWLWIFI_LEDS is not set
810# CONFIG_IWLAGN is not set
811# CONFIG_IWL3945 is not set
812# CONFIG_HOSTAP is not set
813# CONFIG_B43 is not set
814# CONFIG_B43LEGACY is not set
815# CONFIG_ZD1211RW is not set
816# CONFIG_RT2X00 is not set
817
818#
819# Enable WiMAX (Networking options) to see the WiMAX drivers
820#
759 821
760# 822#
761# USB Network Adapters 823# USB Network Adapters
@@ -791,13 +853,20 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
791CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 853CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
792CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 854CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
793# CONFIG_INPUT_JOYDEV is not set 855# CONFIG_INPUT_JOYDEV is not set
794# CONFIG_INPUT_EVDEV is not set 856CONFIG_INPUT_EVDEV=y
795# CONFIG_INPUT_EVBUG is not set 857# CONFIG_INPUT_EVBUG is not set
796 858
797# 859#
798# Input Device Drivers 860# Input Device Drivers
799# 861#
800# CONFIG_INPUT_KEYBOARD is not set 862CONFIG_INPUT_KEYBOARD=y
863CONFIG_KEYBOARD_ATKBD=y
864# CONFIG_KEYBOARD_SUNKBD is not set
865# CONFIG_KEYBOARD_LKKBD is not set
866# CONFIG_KEYBOARD_XTKBD is not set
867# CONFIG_KEYBOARD_NEWTON is not set
868# CONFIG_KEYBOARD_STOWAWAY is not set
869CONFIG_KEYBOARD_GPIO=y
801# CONFIG_INPUT_MOUSE is not set 870# CONFIG_INPUT_MOUSE is not set
802# CONFIG_INPUT_JOYSTICK is not set 871# CONFIG_INPUT_JOYSTICK is not set
803# CONFIG_INPUT_TABLET is not set 872# CONFIG_INPUT_TABLET is not set
@@ -807,7 +876,11 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
807# 876#
808# Hardware I/O ports 877# Hardware I/O ports
809# 878#
810# CONFIG_SERIO is not set 879CONFIG_SERIO=y
880CONFIG_SERIO_SERPORT=y
881# CONFIG_SERIO_PCIPS2 is not set
882CONFIG_SERIO_LIBPS2=y
883# CONFIG_SERIO_RAW is not set
811# CONFIG_GAMEPORT is not set 884# CONFIG_GAMEPORT is not set
812 885
813# 886#
@@ -839,11 +912,11 @@ CONFIG_SERIAL_CORE=y
839CONFIG_SERIAL_CORE_CONSOLE=y 912CONFIG_SERIAL_CORE_CONSOLE=y
840# CONFIG_SERIAL_JSM is not set 913# CONFIG_SERIAL_JSM is not set
841CONFIG_UNIX98_PTYS=y 914CONFIG_UNIX98_PTYS=y
915# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
842CONFIG_LEGACY_PTYS=y 916CONFIG_LEGACY_PTYS=y
843CONFIG_LEGACY_PTY_COUNT=16 917CONFIG_LEGACY_PTY_COUNT=16
844# CONFIG_IPMI_HANDLER is not set 918# CONFIG_IPMI_HANDLER is not set
845# CONFIG_HW_RANDOM is not set 919# CONFIG_HW_RANDOM is not set
846# CONFIG_NVRAM is not set
847# CONFIG_R3964 is not set 920# CONFIG_R3964 is not set
848# CONFIG_APPLICOM is not set 921# CONFIG_APPLICOM is not set
849# CONFIG_RAW_DRIVER is not set 922# CONFIG_RAW_DRIVER is not set
@@ -879,6 +952,7 @@ CONFIG_I2C_HELPER_AUTO=y
879# 952#
880# I2C system bus drivers (mostly embedded / system-on-chip) 953# I2C system bus drivers (mostly embedded / system-on-chip)
881# 954#
955# CONFIG_I2C_GPIO is not set
882CONFIG_I2C_MV64XXX=y 956CONFIG_I2C_MV64XXX=y
883# CONFIG_I2C_OCORES is not set 957# CONFIG_I2C_OCORES is not set
884# CONFIG_I2C_SIMTEC is not set 958# CONFIG_I2C_SIMTEC is not set
@@ -905,8 +979,6 @@ CONFIG_I2C_MV64XXX=y
905# Miscellaneous I2C Chip support 979# Miscellaneous I2C Chip support
906# 980#
907# CONFIG_DS1682 is not set 981# CONFIG_DS1682 is not set
908# CONFIG_EEPROM_AT24 is not set
909# CONFIG_EEPROM_LEGACY is not set
910# CONFIG_SENSORS_PCF8574 is not set 982# CONFIG_SENSORS_PCF8574 is not set
911# CONFIG_PCF8575 is not set 983# CONFIG_PCF8575 is not set
912# CONFIG_SENSORS_PCA9539 is not set 984# CONFIG_SENSORS_PCA9539 is not set
@@ -925,12 +997,12 @@ CONFIG_SPI_MASTER=y
925# SPI Master Controller Drivers 997# SPI Master Controller Drivers
926# 998#
927# CONFIG_SPI_BITBANG is not set 999# CONFIG_SPI_BITBANG is not set
1000# CONFIG_SPI_GPIO is not set
928CONFIG_SPI_ORION=y 1001CONFIG_SPI_ORION=y
929 1002
930# 1003#
931# SPI Protocol Masters 1004# SPI Protocol Masters
932# 1005#
933# CONFIG_EEPROM_AT25 is not set
934# CONFIG_SPI_SPIDEV is not set 1006# CONFIG_SPI_SPIDEV is not set
935# CONFIG_SPI_TLE62X0 is not set 1007# CONFIG_SPI_TLE62X0 is not set
936# CONFIG_W1 is not set 1008# CONFIG_W1 is not set
@@ -952,10 +1024,12 @@ CONFIG_SSB_POSSIBLE=y
952# CONFIG_MFD_CORE is not set 1024# CONFIG_MFD_CORE is not set
953# CONFIG_MFD_SM501 is not set 1025# CONFIG_MFD_SM501 is not set
954# CONFIG_HTC_PASIC3 is not set 1026# CONFIG_HTC_PASIC3 is not set
1027# CONFIG_TWL4030_CORE is not set
955# CONFIG_MFD_TMIO is not set 1028# CONFIG_MFD_TMIO is not set
956# CONFIG_PMIC_DA903X is not set 1029# CONFIG_PMIC_DA903X is not set
957# CONFIG_MFD_WM8400 is not set 1030# CONFIG_MFD_WM8400 is not set
958# CONFIG_MFD_WM8350_I2C is not set 1031# CONFIG_MFD_WM8350_I2C is not set
1032# CONFIG_MFD_PCF50633 is not set
959 1033
960# 1034#
961# Multimedia devices 1035# Multimedia devices
@@ -1012,11 +1086,9 @@ CONFIG_HID_COMPAT=y
1012CONFIG_HID_A4TECH=y 1086CONFIG_HID_A4TECH=y
1013CONFIG_HID_APPLE=y 1087CONFIG_HID_APPLE=y
1014CONFIG_HID_BELKIN=y 1088CONFIG_HID_BELKIN=y
1015CONFIG_HID_BRIGHT=y
1016CONFIG_HID_CHERRY=y 1089CONFIG_HID_CHERRY=y
1017CONFIG_HID_CHICONY=y 1090CONFIG_HID_CHICONY=y
1018CONFIG_HID_CYPRESS=y 1091CONFIG_HID_CYPRESS=y
1019CONFIG_HID_DELL=y
1020CONFIG_HID_EZKEY=y 1092CONFIG_HID_EZKEY=y
1021CONFIG_HID_GYRATION=y 1093CONFIG_HID_GYRATION=y
1022CONFIG_HID_LOGITECH=y 1094CONFIG_HID_LOGITECH=y
@@ -1024,12 +1096,15 @@ CONFIG_HID_LOGITECH=y
1024# CONFIG_LOGIRUMBLEPAD2_FF is not set 1096# CONFIG_LOGIRUMBLEPAD2_FF is not set
1025CONFIG_HID_MICROSOFT=y 1097CONFIG_HID_MICROSOFT=y
1026CONFIG_HID_MONTEREY=y 1098CONFIG_HID_MONTEREY=y
1099CONFIG_HID_NTRIG=y
1027CONFIG_HID_PANTHERLORD=y 1100CONFIG_HID_PANTHERLORD=y
1028# CONFIG_PANTHERLORD_FF is not set 1101# CONFIG_PANTHERLORD_FF is not set
1029CONFIG_HID_PETALYNX=y 1102CONFIG_HID_PETALYNX=y
1030CONFIG_HID_SAMSUNG=y 1103CONFIG_HID_SAMSUNG=y
1031CONFIG_HID_SONY=y 1104CONFIG_HID_SONY=y
1032CONFIG_HID_SUNPLUS=y 1105CONFIG_HID_SUNPLUS=y
1106# CONFIG_GREENASIA_FF is not set
1107CONFIG_HID_TOPSEED=y
1033# CONFIG_THRUSTMASTER_FF is not set 1108# CONFIG_THRUSTMASTER_FF is not set
1034# CONFIG_ZEROPLUS_FF is not set 1109# CONFIG_ZEROPLUS_FF is not set
1035CONFIG_USB_SUPPORT=y 1110CONFIG_USB_SUPPORT=y
@@ -1058,6 +1133,7 @@ CONFIG_USB_DEVICE_CLASS=y
1058CONFIG_USB_EHCI_HCD=y 1133CONFIG_USB_EHCI_HCD=y
1059CONFIG_USB_EHCI_ROOT_HUB_TT=y 1134CONFIG_USB_EHCI_ROOT_HUB_TT=y
1060CONFIG_USB_EHCI_TT_NEWSCHED=y 1135CONFIG_USB_EHCI_TT_NEWSCHED=y
1136# CONFIG_USB_OXU210HP_HCD is not set
1061# CONFIG_USB_ISP116X_HCD is not set 1137# CONFIG_USB_ISP116X_HCD is not set
1062# CONFIG_USB_ISP1760_HCD is not set 1138# CONFIG_USB_ISP1760_HCD is not set
1063# CONFIG_USB_OHCI_HCD is not set 1139# CONFIG_USB_OHCI_HCD is not set
@@ -1087,7 +1163,6 @@ CONFIG_USB_STORAGE=y
1087CONFIG_USB_STORAGE_DATAFAB=y 1163CONFIG_USB_STORAGE_DATAFAB=y
1088CONFIG_USB_STORAGE_FREECOM=y 1164CONFIG_USB_STORAGE_FREECOM=y
1089# CONFIG_USB_STORAGE_ISD200 is not set 1165# CONFIG_USB_STORAGE_ISD200 is not set
1090CONFIG_USB_STORAGE_DPCM=y
1091# CONFIG_USB_STORAGE_USBAT is not set 1166# CONFIG_USB_STORAGE_USBAT is not set
1092CONFIG_USB_STORAGE_SDDR09=y 1167CONFIG_USB_STORAGE_SDDR09=y
1093CONFIG_USB_STORAGE_SDDR55=y 1168CONFIG_USB_STORAGE_SDDR55=y
@@ -1135,21 +1210,51 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
1135# CONFIG_USB_ISIGHTFW is not set 1210# CONFIG_USB_ISIGHTFW is not set
1136# CONFIG_USB_VST is not set 1211# CONFIG_USB_VST is not set
1137# CONFIG_USB_GADGET is not set 1212# CONFIG_USB_GADGET is not set
1213
1214#
1215# OTG and related infrastructure
1216#
1217# CONFIG_USB_GPIO_VBUS is not set
1138# CONFIG_UWB is not set 1218# CONFIG_UWB is not set
1139# CONFIG_MMC is not set 1219CONFIG_MMC=y
1220# CONFIG_MMC_DEBUG is not set
1221# CONFIG_MMC_UNSAFE_RESUME is not set
1222
1223#
1224# MMC/SD/SDIO Card Drivers
1225#
1226CONFIG_MMC_BLOCK=y
1227CONFIG_MMC_BLOCK_BOUNCE=y
1228CONFIG_SDIO_UART=y
1229# CONFIG_MMC_TEST is not set
1230
1231#
1232# MMC/SD/SDIO Host Controller Drivers
1233#
1234# CONFIG_MMC_SDHCI is not set
1235# CONFIG_MMC_TIFM_SD is not set
1236CONFIG_MMC_MVSDIO=y
1237# CONFIG_MMC_SPI is not set
1140# CONFIG_MEMSTICK is not set 1238# CONFIG_MEMSTICK is not set
1141# CONFIG_ACCESSIBILITY is not set 1239# CONFIG_ACCESSIBILITY is not set
1142CONFIG_NEW_LEDS=y 1240CONFIG_NEW_LEDS=y
1143# CONFIG_LEDS_CLASS is not set 1241CONFIG_LEDS_CLASS=y
1144 1242
1145# 1243#
1146# LED drivers 1244# LED drivers
1147# 1245#
1246# CONFIG_LEDS_PCA9532 is not set
1247CONFIG_LEDS_GPIO=y
1248# CONFIG_LEDS_PCA955X is not set
1148 1249
1149# 1250#
1150# LED Triggers 1251# LED Triggers
1151# 1252#
1152# CONFIG_LEDS_TRIGGERS is not set 1253CONFIG_LEDS_TRIGGERS=y
1254CONFIG_LEDS_TRIGGER_TIMER=y
1255CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1256# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1257CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1153CONFIG_RTC_LIB=y 1258CONFIG_RTC_LIB=y
1154CONFIG_RTC_CLASS=y 1259CONFIG_RTC_CLASS=y
1155CONFIG_RTC_HCTOSYS=y 1260CONFIG_RTC_HCTOSYS=y
@@ -1178,7 +1283,7 @@ CONFIG_RTC_INTF_DEV=y
1178# CONFIG_RTC_DRV_PCF8563 is not set 1283# CONFIG_RTC_DRV_PCF8563 is not set
1179# CONFIG_RTC_DRV_PCF8583 is not set 1284# CONFIG_RTC_DRV_PCF8583 is not set
1180# CONFIG_RTC_DRV_M41T80 is not set 1285# CONFIG_RTC_DRV_M41T80 is not set
1181# CONFIG_RTC_DRV_S35390A is not set 1286CONFIG_RTC_DRV_S35390A=y
1182# CONFIG_RTC_DRV_FM3130 is not set 1287# CONFIG_RTC_DRV_FM3130 is not set
1183# CONFIG_RTC_DRV_RX8581 is not set 1288# CONFIG_RTC_DRV_RX8581 is not set
1184 1289
@@ -1227,6 +1332,7 @@ CONFIG_DMA_ENGINE=y
1227# CONFIG_DMATEST is not set 1332# CONFIG_DMATEST is not set
1228# CONFIG_REGULATOR is not set 1333# CONFIG_REGULATOR is not set
1229# CONFIG_UIO is not set 1334# CONFIG_UIO is not set
1335# CONFIG_STAGING is not set
1230 1336
1231# 1337#
1232# File systems 1338# File systems
@@ -1238,16 +1344,14 @@ CONFIG_EXT3_FS=y
1238# CONFIG_EXT3_FS_XATTR is not set 1344# CONFIG_EXT3_FS_XATTR is not set
1239# CONFIG_EXT4_FS is not set 1345# CONFIG_EXT4_FS is not set
1240CONFIG_JBD=y 1346CONFIG_JBD=y
1347# CONFIG_JBD_DEBUG is not set
1241# CONFIG_REISERFS_FS is not set 1348# CONFIG_REISERFS_FS is not set
1242# CONFIG_JFS_FS is not set 1349# CONFIG_JFS_FS is not set
1243# CONFIG_FS_POSIX_ACL is not set 1350# CONFIG_FS_POSIX_ACL is not set
1244CONFIG_FILE_LOCKING=y 1351CONFIG_FILE_LOCKING=y
1245CONFIG_XFS_FS=y 1352# CONFIG_XFS_FS is not set
1246# CONFIG_XFS_QUOTA is not set
1247# CONFIG_XFS_POSIX_ACL is not set
1248# CONFIG_XFS_RT is not set
1249# CONFIG_XFS_DEBUG is not set
1250# CONFIG_OCFS2_FS is not set 1353# CONFIG_OCFS2_FS is not set
1354# CONFIG_BTRFS_FS is not set
1251CONFIG_DNOTIFY=y 1355CONFIG_DNOTIFY=y
1252CONFIG_INOTIFY=y 1356CONFIG_INOTIFY=y
1253CONFIG_INOTIFY_USER=y 1357CONFIG_INOTIFY_USER=y
@@ -1268,9 +1372,9 @@ CONFIG_UDF_NLS=y
1268# 1372#
1269# DOS/FAT/NT Filesystems 1373# DOS/FAT/NT Filesystems
1270# 1374#
1271CONFIG_FAT_FS=m 1375CONFIG_FAT_FS=y
1272CONFIG_MSDOS_FS=m 1376CONFIG_MSDOS_FS=y
1273CONFIG_VFAT_FS=m 1377CONFIG_VFAT_FS=y
1274CONFIG_FAT_DEFAULT_CODEPAGE=437 1378CONFIG_FAT_DEFAULT_CODEPAGE=437
1275CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1379CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1276# CONFIG_NTFS_FS is not set 1380# CONFIG_NTFS_FS is not set
@@ -1286,10 +1390,7 @@ CONFIG_TMPFS=y
1286# CONFIG_TMPFS_POSIX_ACL is not set 1390# CONFIG_TMPFS_POSIX_ACL is not set
1287# CONFIG_HUGETLB_PAGE is not set 1391# CONFIG_HUGETLB_PAGE is not set
1288# CONFIG_CONFIGFS_FS is not set 1392# CONFIG_CONFIGFS_FS is not set
1289 1393CONFIG_MISC_FILESYSTEMS=y
1290#
1291# Miscellaneous filesystems
1292#
1293# CONFIG_ADFS_FS is not set 1394# CONFIG_ADFS_FS is not set
1294# CONFIG_AFFS_FS is not set 1395# CONFIG_AFFS_FS is not set
1295# CONFIG_HFS_FS is not set 1396# CONFIG_HFS_FS is not set
@@ -1309,6 +1410,7 @@ CONFIG_JFFS2_ZLIB=y
1309CONFIG_JFFS2_RTIME=y 1410CONFIG_JFFS2_RTIME=y
1310# CONFIG_JFFS2_RUBIN is not set 1411# CONFIG_JFFS2_RUBIN is not set
1311CONFIG_CRAMFS=y 1412CONFIG_CRAMFS=y
1413# CONFIG_SQUASHFS is not set
1312# CONFIG_VXFS_FS is not set 1414# CONFIG_VXFS_FS is not set
1313# CONFIG_MINIX_FS is not set 1415# CONFIG_MINIX_FS is not set
1314# CONFIG_OMFS_FS is not set 1416# CONFIG_OMFS_FS is not set
@@ -1393,7 +1495,7 @@ CONFIG_ENABLE_MUST_CHECK=y
1393CONFIG_FRAME_WARN=1024 1495CONFIG_FRAME_WARN=1024
1394CONFIG_MAGIC_SYSRQ=y 1496CONFIG_MAGIC_SYSRQ=y
1395# CONFIG_UNUSED_SYMBOLS is not set 1497# CONFIG_UNUSED_SYMBOLS is not set
1396# CONFIG_DEBUG_FS is not set 1498CONFIG_DEBUG_FS=y
1397# CONFIG_HEADERS_CHECK is not set 1499# CONFIG_HEADERS_CHECK is not set
1398CONFIG_DEBUG_KERNEL=y 1500CONFIG_DEBUG_KERNEL=y
1399# CONFIG_DEBUG_SHIRQ is not set 1501# CONFIG_DEBUG_SHIRQ is not set
@@ -1416,6 +1518,7 @@ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1416# CONFIG_LOCK_STAT is not set 1518# CONFIG_LOCK_STAT is not set
1417# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1519# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1418# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1520# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1521CONFIG_STACKTRACE=y
1419# CONFIG_DEBUG_KOBJECT is not set 1522# CONFIG_DEBUG_KOBJECT is not set
1420CONFIG_DEBUG_BUGVERBOSE=y 1523CONFIG_DEBUG_BUGVERBOSE=y
1421CONFIG_DEBUG_INFO=y 1524CONFIG_DEBUG_INFO=y
@@ -1424,7 +1527,7 @@ CONFIG_DEBUG_INFO=y
1424CONFIG_DEBUG_MEMORY_INIT=y 1527CONFIG_DEBUG_MEMORY_INIT=y
1425# CONFIG_DEBUG_LIST is not set 1528# CONFIG_DEBUG_LIST is not set
1426# CONFIG_DEBUG_SG is not set 1529# CONFIG_DEBUG_SG is not set
1427CONFIG_FRAME_POINTER=y 1530# CONFIG_DEBUG_NOTIFIERS is not set
1428# CONFIG_BOOT_PRINTK_DELAY is not set 1531# CONFIG_BOOT_PRINTK_DELAY is not set
1429# CONFIG_RCU_TORTURE_TEST is not set 1532# CONFIG_RCU_TORTURE_TEST is not set
1430# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1533# CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -1435,7 +1538,10 @@ CONFIG_FRAME_POINTER=y
1435# CONFIG_FAULT_INJECTION is not set 1538# CONFIG_FAULT_INJECTION is not set
1436# CONFIG_LATENCYTOP is not set 1539# CONFIG_LATENCYTOP is not set
1437CONFIG_SYSCTL_SYSCALL_CHECK=y 1540CONFIG_SYSCTL_SYSCALL_CHECK=y
1541CONFIG_NOP_TRACER=y
1438CONFIG_HAVE_FUNCTION_TRACER=y 1542CONFIG_HAVE_FUNCTION_TRACER=y
1543CONFIG_RING_BUFFER=y
1544CONFIG_TRACING=y
1439 1545
1440# 1546#
1441# Tracers 1547# Tracers
@@ -1446,11 +1552,14 @@ CONFIG_HAVE_FUNCTION_TRACER=y
1446# CONFIG_SCHED_TRACER is not set 1552# CONFIG_SCHED_TRACER is not set
1447# CONFIG_CONTEXT_SWITCH_TRACER is not set 1553# CONFIG_CONTEXT_SWITCH_TRACER is not set
1448# CONFIG_BOOT_TRACER is not set 1554# CONFIG_BOOT_TRACER is not set
1555# CONFIG_TRACE_BRANCH_PROFILING is not set
1449# CONFIG_STACK_TRACER is not set 1556# CONFIG_STACK_TRACER is not set
1557# CONFIG_FTRACE_STARTUP_TEST is not set
1450# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1558# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1451# CONFIG_SAMPLES is not set 1559# CONFIG_SAMPLES is not set
1452CONFIG_HAVE_ARCH_KGDB=y 1560CONFIG_HAVE_ARCH_KGDB=y
1453# CONFIG_KGDB is not set 1561# CONFIG_KGDB is not set
1562CONFIG_ARM_UNWIND=y
1454CONFIG_DEBUG_USER=y 1563CONFIG_DEBUG_USER=y
1455CONFIG_DEBUG_ERRORS=y 1564CONFIG_DEBUG_ERRORS=y
1456# CONFIG_DEBUG_STACK_USAGE is not set 1565# CONFIG_DEBUG_STACK_USAGE is not set
@@ -1464,19 +1573,22 @@ CONFIG_DEBUG_LL=y
1464# CONFIG_SECURITY is not set 1573# CONFIG_SECURITY is not set
1465# CONFIG_SECURITYFS is not set 1574# CONFIG_SECURITYFS is not set
1466# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1575# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1467CONFIG_ASYNC_CORE=y
1468CONFIG_CRYPTO=y 1576CONFIG_CRYPTO=y
1469 1577
1470# 1578#
1471# Crypto core or helper 1579# Crypto core or helper
1472# 1580#
1473# CONFIG_CRYPTO_FIPS is not set 1581# CONFIG_CRYPTO_FIPS is not set
1474CONFIG_CRYPTO_ALGAPI=m 1582CONFIG_CRYPTO_ALGAPI=y
1475CONFIG_CRYPTO_AEAD=m 1583CONFIG_CRYPTO_ALGAPI2=y
1476CONFIG_CRYPTO_BLKCIPHER=m 1584CONFIG_CRYPTO_AEAD2=y
1477CONFIG_CRYPTO_HASH=m 1585CONFIG_CRYPTO_BLKCIPHER=y
1478CONFIG_CRYPTO_RNG=m 1586CONFIG_CRYPTO_BLKCIPHER2=y
1479CONFIG_CRYPTO_MANAGER=m 1587CONFIG_CRYPTO_HASH=y
1588CONFIG_CRYPTO_HASH2=y
1589CONFIG_CRYPTO_RNG2=y
1590CONFIG_CRYPTO_MANAGER=y
1591CONFIG_CRYPTO_MANAGER2=y
1480# CONFIG_CRYPTO_GF128MUL is not set 1592# CONFIG_CRYPTO_GF128MUL is not set
1481# CONFIG_CRYPTO_NULL is not set 1593# CONFIG_CRYPTO_NULL is not set
1482# CONFIG_CRYPTO_CRYPTD is not set 1594# CONFIG_CRYPTO_CRYPTD is not set
@@ -1496,7 +1608,7 @@ CONFIG_CRYPTO_MANAGER=m
1496CONFIG_CRYPTO_CBC=m 1608CONFIG_CRYPTO_CBC=m
1497# CONFIG_CRYPTO_CTR is not set 1609# CONFIG_CRYPTO_CTR is not set
1498# CONFIG_CRYPTO_CTS is not set 1610# CONFIG_CRYPTO_CTS is not set
1499CONFIG_CRYPTO_ECB=m 1611CONFIG_CRYPTO_ECB=y
1500# CONFIG_CRYPTO_LRW is not set 1612# CONFIG_CRYPTO_LRW is not set
1501CONFIG_CRYPTO_PCBC=m 1613CONFIG_CRYPTO_PCBC=m
1502# CONFIG_CRYPTO_XTS is not set 1614# CONFIG_CRYPTO_XTS is not set
@@ -1510,7 +1622,7 @@ CONFIG_CRYPTO_PCBC=m
1510# 1622#
1511# Digest 1623# Digest
1512# 1624#
1513# CONFIG_CRYPTO_CRC32C is not set 1625CONFIG_CRYPTO_CRC32C=y
1514# CONFIG_CRYPTO_MD4 is not set 1626# CONFIG_CRYPTO_MD4 is not set
1515# CONFIG_CRYPTO_MD5 is not set 1627# CONFIG_CRYPTO_MD5 is not set
1516# CONFIG_CRYPTO_MICHAEL_MIC is not set 1628# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -1527,9 +1639,9 @@ CONFIG_CRYPTO_PCBC=m
1527# 1639#
1528# Ciphers 1640# Ciphers
1529# 1641#
1530# CONFIG_CRYPTO_AES is not set 1642CONFIG_CRYPTO_AES=y
1531# CONFIG_CRYPTO_ANUBIS is not set 1643# CONFIG_CRYPTO_ANUBIS is not set
1532# CONFIG_CRYPTO_ARC4 is not set 1644CONFIG_CRYPTO_ARC4=y
1533# CONFIG_CRYPTO_BLOWFISH is not set 1645# CONFIG_CRYPTO_BLOWFISH is not set
1534# CONFIG_CRYPTO_CAMELLIA is not set 1646# CONFIG_CRYPTO_CAMELLIA is not set
1535# CONFIG_CRYPTO_CAST5 is not set 1647# CONFIG_CRYPTO_CAST5 is not set
@@ -1560,6 +1672,7 @@ CONFIG_CRYPTO_HW=y
1560# Library routines 1672# Library routines
1561# 1673#
1562CONFIG_BITREVERSE=y 1674CONFIG_BITREVERSE=y
1675CONFIG_GENERIC_FIND_LAST_BIT=y
1563CONFIG_CRC_CCITT=y 1676CONFIG_CRC_CCITT=y
1564CONFIG_CRC16=y 1677CONFIG_CRC16=y
1565# CONFIG_CRC_T10DIF is not set 1678# CONFIG_CRC_T10DIF is not set
diff --git a/arch/arm/configs/lart_defconfig b/arch/arm/configs/lart_defconfig
index a1cc34f25602..56ae56899d2e 100644
--- a/arch/arm/configs/lart_defconfig
+++ b/arch/arm/configs/lart_defconfig
@@ -87,7 +87,6 @@ CONFIG_ARCH_SA1100=y
87# CONFIG_SA1100_COLLIE is not set 87# CONFIG_SA1100_COLLIE is not set
88# CONFIG_SA1100_H3100 is not set 88# CONFIG_SA1100_H3100 is not set
89# CONFIG_SA1100_H3600 is not set 89# CONFIG_SA1100_H3600 is not set
90# CONFIG_SA1100_H3800 is not set
91# CONFIG_SA1100_BADGE4 is not set 90# CONFIG_SA1100_BADGE4 is not set
92# CONFIG_SA1100_JORNADA720 is not set 91# CONFIG_SA1100_JORNADA720 is not set
93# CONFIG_SA1100_HACKKIT is not set 92# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
index 73ba62b71063..82428c2f234c 100644
--- a/arch/arm/configs/magician_defconfig
+++ b/arch/arm/configs/magician_defconfig
@@ -1,9 +1,10 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24-rc6 3# Linux kernel version: 2.6.29-rc3
4# Sun Dec 30 13:02:54 2007 4# Fri Jan 30 12:42:03 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 8CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 9CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 10CONFIG_GENERIC_TIME=y
@@ -12,6 +13,7 @@ CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set 13# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 15CONFIG_STACKTRACE_SUPPORT=y
16CONFIG_HAVE_LATENCYTOP_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y 17CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y 18CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y 19CONFIG_HARDIRQS_SW_RESEND=y
@@ -21,8 +23,8 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U64 is not set 23# CONFIG_ARCH_HAS_ILOG2_U64 is not set
22CONFIG_GENERIC_HWEIGHT=y 24CONFIG_GENERIC_HWEIGHT=y
23CONFIG_GENERIC_CALIBRATE_DELAY=y 25CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ZONE_DMA=y
25CONFIG_ARCH_MTD_XIP=y 26CONFIG_ARCH_MTD_XIP=y
27CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 28CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 29CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28 30
@@ -41,16 +43,24 @@ CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_POSIX_MQUEUE is not set 43# CONFIG_POSIX_MQUEUE is not set
42# CONFIG_BSD_PROCESS_ACCT is not set 44# CONFIG_BSD_PROCESS_ACCT is not set
43# CONFIG_TASKSTATS is not set 45# CONFIG_TASKSTATS is not set
44# CONFIG_USER_NS is not set
45# CONFIG_PID_NS is not set
46# CONFIG_AUDIT is not set 46# CONFIG_AUDIT is not set
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
47CONFIG_IKCONFIG=y 56CONFIG_IKCONFIG=y
48CONFIG_IKCONFIG_PROC=y 57CONFIG_IKCONFIG_PROC=y
49CONFIG_LOG_BUF_SHIFT=16 58CONFIG_LOG_BUF_SHIFT=16
59# CONFIG_GROUP_SCHED is not set
50# CONFIG_CGROUPS is not set 60# CONFIG_CGROUPS is not set
51# CONFIG_FAIR_GROUP_SCHED is not set 61# CONFIG_SYSFS_DEPRECATED_V2 is not set
52# CONFIG_SYSFS_DEPRECATED is not set
53# CONFIG_RELAY is not set 62# CONFIG_RELAY is not set
63# CONFIG_NAMESPACES is not set
54CONFIG_BLK_DEV_INITRD=y 64CONFIG_BLK_DEV_INITRD=y
55CONFIG_INITRAMFS_SOURCE="" 65CONFIG_INITRAMFS_SOURCE=""
56CONFIG_CC_OPTIMIZE_FOR_SIZE=y 66CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -65,31 +75,41 @@ CONFIG_HOTPLUG=y
65CONFIG_PRINTK=y 75CONFIG_PRINTK=y
66CONFIG_BUG=y 76CONFIG_BUG=y
67CONFIG_ELF_CORE=y 77CONFIG_ELF_CORE=y
78CONFIG_COMPAT_BRK=y
68CONFIG_BASE_FULL=y 79CONFIG_BASE_FULL=y
69CONFIG_FUTEX=y 80CONFIG_FUTEX=y
70CONFIG_ANON_INODES=y 81CONFIG_ANON_INODES=y
71CONFIG_EPOLL=y 82CONFIG_EPOLL=y
72CONFIG_SIGNALFD=y 83CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y
73CONFIG_EVENTFD=y 85CONFIG_EVENTFD=y
74CONFIG_SHMEM=y 86CONFIG_SHMEM=y
87CONFIG_AIO=y
75CONFIG_VM_EVENT_COUNTERS=y 88CONFIG_VM_EVENT_COUNTERS=y
76CONFIG_SLAB=y 89CONFIG_SLAB=y
77# CONFIG_SLUB is not set 90# CONFIG_SLUB is not set
78# CONFIG_SLOB is not set 91# CONFIG_SLOB is not set
92# CONFIG_PROFILING is not set
93CONFIG_HAVE_OPROFILE=y
94# CONFIG_KPROBES is not set
95CONFIG_HAVE_KPROBES=y
96CONFIG_HAVE_KRETPROBES=y
97CONFIG_HAVE_CLK=y
98CONFIG_HAVE_GENERIC_DMA_COHERENT=y
99CONFIG_SLABINFO=y
79CONFIG_RT_MUTEXES=y 100CONFIG_RT_MUTEXES=y
80# CONFIG_TINY_SHMEM is not set
81CONFIG_BASE_SMALL=0 101CONFIG_BASE_SMALL=0
82CONFIG_MODULES=y 102CONFIG_MODULES=y
103# CONFIG_MODULE_FORCE_LOAD is not set
83CONFIG_MODULE_UNLOAD=y 104CONFIG_MODULE_UNLOAD=y
84CONFIG_MODULE_FORCE_UNLOAD=y 105# CONFIG_MODULE_FORCE_UNLOAD is not set
85# CONFIG_MODVERSIONS is not set 106# CONFIG_MODVERSIONS is not set
86# CONFIG_MODULE_SRCVERSION_ALL is not set 107# CONFIG_MODULE_SRCVERSION_ALL is not set
87CONFIG_KMOD=y
88CONFIG_BLOCK=y 108CONFIG_BLOCK=y
89# CONFIG_LBD is not set 109# CONFIG_LBD is not set
90# CONFIG_BLK_DEV_IO_TRACE is not set 110# CONFIG_BLK_DEV_IO_TRACE is not set
91# CONFIG_LSF is not set
92# CONFIG_BLK_DEV_BSG is not set 111# CONFIG_BLK_DEV_BSG is not set
112# CONFIG_BLK_DEV_INTEGRITY is not set
93 113
94# 114#
95# IO Schedulers 115# IO Schedulers
@@ -103,8 +123,7 @@ CONFIG_IOSCHED_NOOP=y
103# CONFIG_DEFAULT_CFQ is not set 123# CONFIG_DEFAULT_CFQ is not set
104CONFIG_DEFAULT_NOOP=y 124CONFIG_DEFAULT_NOOP=y
105CONFIG_DEFAULT_IOSCHED="noop" 125CONFIG_DEFAULT_IOSCHED="noop"
106CONFIG_CLASSIC_RCU=y 126CONFIG_FREEZER=y
107# CONFIG_PREEMPT_RCU is not set
108 127
109# 128#
110# System Type 129# System Type
@@ -114,9 +133,7 @@ CONFIG_CLASSIC_RCU=y
114# CONFIG_ARCH_REALVIEW is not set 133# CONFIG_ARCH_REALVIEW is not set
115# CONFIG_ARCH_VERSATILE is not set 134# CONFIG_ARCH_VERSATILE is not set
116# CONFIG_ARCH_AT91 is not set 135# CONFIG_ARCH_AT91 is not set
117# CONFIG_ARCH_CLPS7500 is not set
118# CONFIG_ARCH_CLPS711X is not set 136# CONFIG_ARCH_CLPS711X is not set
119# CONFIG_ARCH_CO285 is not set
120# CONFIG_ARCH_EBSA110 is not set 137# CONFIG_ARCH_EBSA110 is not set
121# CONFIG_ARCH_EP93XX is not set 138# CONFIG_ARCH_EP93XX is not set
122# CONFIG_ARCH_FOOTBRIDGE is not set 139# CONFIG_ARCH_FOOTBRIDGE is not set
@@ -130,41 +147,58 @@ CONFIG_CLASSIC_RCU=y
130# CONFIG_ARCH_IXP2000 is not set 147# CONFIG_ARCH_IXP2000 is not set
131# CONFIG_ARCH_IXP4XX is not set 148# CONFIG_ARCH_IXP4XX is not set
132# CONFIG_ARCH_L7200 is not set 149# CONFIG_ARCH_L7200 is not set
150# CONFIG_ARCH_KIRKWOOD is not set
133# CONFIG_ARCH_KS8695 is not set 151# CONFIG_ARCH_KS8695 is not set
134# CONFIG_ARCH_NS9XXX is not set 152# CONFIG_ARCH_NS9XXX is not set
153# CONFIG_ARCH_LOKI is not set
154# CONFIG_ARCH_MV78XX0 is not set
135# CONFIG_ARCH_MXC is not set 155# CONFIG_ARCH_MXC is not set
156# CONFIG_ARCH_ORION5X is not set
136# CONFIG_ARCH_PNX4008 is not set 157# CONFIG_ARCH_PNX4008 is not set
137CONFIG_ARCH_PXA=y 158CONFIG_ARCH_PXA=y
138# CONFIG_ARCH_RPC is not set 159# CONFIG_ARCH_RPC is not set
139# CONFIG_ARCH_SA1100 is not set 160# CONFIG_ARCH_SA1100 is not set
140# CONFIG_ARCH_S3C2410 is not set 161# CONFIG_ARCH_S3C2410 is not set
162# CONFIG_ARCH_S3C64XX is not set
141# CONFIG_ARCH_SHARK is not set 163# CONFIG_ARCH_SHARK is not set
142# CONFIG_ARCH_LH7A40X is not set 164# CONFIG_ARCH_LH7A40X is not set
143# CONFIG_ARCH_DAVINCI is not set 165# CONFIG_ARCH_DAVINCI is not set
144# CONFIG_ARCH_OMAP is not set 166# CONFIG_ARCH_OMAP is not set
167# CONFIG_ARCH_MSM is not set
168# CONFIG_ARCH_W90X900 is not set
145 169
146# 170#
147# Intel PXA2xx/PXA3xx Implementations 171# Intel PXA2xx/PXA3xx Implementations
148# 172#
173# CONFIG_ARCH_GUMSTIX is not set
174# CONFIG_MACH_INTELMOTE2 is not set
149# CONFIG_ARCH_LUBBOCK is not set 175# CONFIG_ARCH_LUBBOCK is not set
150# CONFIG_MACH_LOGICPD_PXA270 is not set 176# CONFIG_MACH_LOGICPD_PXA270 is not set
151# CONFIG_MACH_MAINSTONE is not set 177# CONFIG_MACH_MAINSTONE is not set
178# CONFIG_MACH_MP900C is not set
152# CONFIG_ARCH_PXA_IDP is not set 179# CONFIG_ARCH_PXA_IDP is not set
153# CONFIG_PXA_SHARPSL is not set 180# CONFIG_PXA_SHARPSL is not set
154# CONFIG_MACH_TRIZEPS4 is not set 181# CONFIG_ARCH_VIPER is not set
182# CONFIG_ARCH_PXA_ESERIES is not set
183# CONFIG_TRIZEPS_PXA is not set
184# CONFIG_MACH_H5000 is not set
155# CONFIG_MACH_EM_X270 is not set 185# CONFIG_MACH_EM_X270 is not set
186# CONFIG_MACH_COLIBRI is not set
156# CONFIG_MACH_ZYLONITE is not set 187# CONFIG_MACH_ZYLONITE is not set
188# CONFIG_MACH_LITTLETON is not set
189# CONFIG_MACH_TAVOREVB is not set
190# CONFIG_MACH_SAAR is not set
157# CONFIG_MACH_ARMCORE is not set 191# CONFIG_MACH_ARMCORE is not set
192# CONFIG_MACH_CM_X300 is not set
158CONFIG_MACH_MAGICIAN=y 193CONFIG_MACH_MAGICIAN=y
194# CONFIG_MACH_MIOA701 is not set
195# CONFIG_MACH_PCM027 is not set
196# CONFIG_ARCH_PXA_PALM is not set
197# CONFIG_PXA_EZX is not set
159CONFIG_PXA27x=y 198CONFIG_PXA27x=y
160 199CONFIG_PXA_SSP=y
161# 200CONFIG_PXA_PWM=y
162# Boot options 201CONFIG_PXA_HAVE_BOARD_IRQS=y
163#
164
165#
166# Power management
167#
168 202
169# 203#
170# Processor Type 204# Processor Type
@@ -173,6 +207,7 @@ CONFIG_CPU_32=y
173CONFIG_CPU_XSCALE=y 207CONFIG_CPU_XSCALE=y
174CONFIG_CPU_32v5=y 208CONFIG_CPU_32v5=y
175CONFIG_CPU_ABRT_EV5T=y 209CONFIG_CPU_ABRT_EV5T=y
210CONFIG_CPU_PABRT_NOIFAR=y
176CONFIG_CPU_CACHE_VIVT=y 211CONFIG_CPU_CACHE_VIVT=y
177CONFIG_CPU_TLB_V4WBI=y 212CONFIG_CPU_TLB_V4WBI=y
178CONFIG_CPU_CP15=y 213CONFIG_CPU_CP15=y
@@ -186,6 +221,7 @@ CONFIG_ARM_THUMB=y
186# CONFIG_OUTER_CACHE is not set 221# CONFIG_OUTER_CACHE is not set
187CONFIG_IWMMXT=y 222CONFIG_IWMMXT=y
188CONFIG_XSCALE_PMU=y 223CONFIG_XSCALE_PMU=y
224CONFIG_COMMON_CLKDEV=y
189 225
190# 226#
191# Bus support 227# Bus support
@@ -197,28 +233,33 @@ CONFIG_XSCALE_PMU=y
197# 233#
198# Kernel Features 234# Kernel Features
199# 235#
200# CONFIG_TICK_ONESHOT is not set 236CONFIG_TICK_ONESHOT=y
201# CONFIG_NO_HZ is not set 237CONFIG_NO_HZ=y
202# CONFIG_HIGH_RES_TIMERS is not set 238# CONFIG_HIGH_RES_TIMERS is not set
203CONFIG_GENERIC_CLOCKEVENTS_BUILD=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
204CONFIG_PREEMPT=y 244CONFIG_PREEMPT=y
205CONFIG_HZ=100 245CONFIG_HZ=100
206CONFIG_AEABI=y 246CONFIG_AEABI=y
207CONFIG_OABI_COMPAT=y 247CONFIG_OABI_COMPAT=y
208# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 248CONFIG_ARCH_FLATMEM_HAS_HOLES=y
249# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
250# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
209CONFIG_SELECT_MEMORY_MODEL=y 251CONFIG_SELECT_MEMORY_MODEL=y
210CONFIG_FLATMEM_MANUAL=y 252CONFIG_FLATMEM_MANUAL=y
211# CONFIG_DISCONTIGMEM_MANUAL is not set 253# CONFIG_DISCONTIGMEM_MANUAL is not set
212# CONFIG_SPARSEMEM_MANUAL is not set 254# CONFIG_SPARSEMEM_MANUAL is not set
213CONFIG_FLATMEM=y 255CONFIG_FLATMEM=y
214CONFIG_FLAT_NODE_MEM_MAP=y 256CONFIG_FLAT_NODE_MEM_MAP=y
215# CONFIG_SPARSEMEM_STATIC is not set 257CONFIG_PAGEFLAGS_EXTENDED=y
216# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
217CONFIG_SPLIT_PTLOCK_CPUS=4096 258CONFIG_SPLIT_PTLOCK_CPUS=4096
218# CONFIG_RESOURCES_64BIT is not set 259# CONFIG_PHYS_ADDR_T_64BIT is not set
219CONFIG_ZONE_DMA_FLAG=1 260CONFIG_ZONE_DMA_FLAG=0
220CONFIG_BOUNCE=y
221CONFIG_VIRT_TO_BUS=y 261CONFIG_VIRT_TO_BUS=y
262CONFIG_UNEVICTABLE_LRU=y
222CONFIG_ALIGNMENT_TRAP=y 263CONFIG_ALIGNMENT_TRAP=y
223 264
224# 265#
@@ -229,9 +270,10 @@ CONFIG_ZBOOT_ROM_BSS=0x0
229CONFIG_CMDLINE="keepinitrd" 270CONFIG_CMDLINE="keepinitrd"
230# CONFIG_XIP_KERNEL is not set 271# CONFIG_XIP_KERNEL is not set
231CONFIG_KEXEC=y 272CONFIG_KEXEC=y
273CONFIG_ATAGS_PROC=y
232 274
233# 275#
234# CPU Frequency scaling 276# CPU Power Management
235# 277#
236CONFIG_CPU_FREQ=y 278CONFIG_CPU_FREQ=y
237CONFIG_CPU_FREQ_TABLE=y 279CONFIG_CPU_FREQ_TABLE=y
@@ -239,6 +281,7 @@ CONFIG_CPU_FREQ_TABLE=y
239CONFIG_CPU_FREQ_STAT=y 281CONFIG_CPU_FREQ_STAT=y
240# CONFIG_CPU_FREQ_STAT_DETAILS is not set 282# CONFIG_CPU_FREQ_STAT_DETAILS is not set
241CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y 283CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
284# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
242# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set 285# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
243# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set 286# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
244# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set 287# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
@@ -247,6 +290,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
247# CONFIG_CPU_FREQ_GOV_USERSPACE is not set 290# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
248CONFIG_CPU_FREQ_GOV_ONDEMAND=y 291CONFIG_CPU_FREQ_GOV_ONDEMAND=y
249# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set 292# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
293# CONFIG_CPU_IDLE is not set
250 294
251# 295#
252# Floating point emulation 296# Floating point emulation
@@ -263,6 +307,8 @@ CONFIG_FPE_NWFPE=y
263# Userspace binary formats 307# Userspace binary formats
264# 308#
265CONFIG_BINFMT_ELF=y 309CONFIG_BINFMT_ELF=y
310# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
311CONFIG_HAVE_AOUT=y
266# CONFIG_BINFMT_AOUT is not set 312# CONFIG_BINFMT_AOUT is not set
267# CONFIG_BINFMT_MISC is not set 313# CONFIG_BINFMT_MISC is not set
268 314
@@ -270,21 +316,18 @@ CONFIG_BINFMT_ELF=y
270# Power management options 316# Power management options
271# 317#
272CONFIG_PM=y 318CONFIG_PM=y
273# CONFIG_PM_LEGACY is not set
274# CONFIG_PM_DEBUG is not set 319# CONFIG_PM_DEBUG is not set
275CONFIG_PM_SLEEP=y 320CONFIG_PM_SLEEP=y
276CONFIG_SUSPEND_UP_POSSIBLE=y
277CONFIG_SUSPEND=y 321CONFIG_SUSPEND=y
278CONFIG_APM_EMULATION=y 322CONFIG_SUSPEND_FREEZER=y
279 323# CONFIG_APM_EMULATION is not set
280# 324CONFIG_ARCH_SUSPEND_POSSIBLE=y
281# Networking
282#
283CONFIG_NET=y 325CONFIG_NET=y
284 326
285# 327#
286# Networking options 328# Networking options
287# 329#
330CONFIG_COMPAT_NET_DEV_OPS=y
288CONFIG_PACKET=y 331CONFIG_PACKET=y
289CONFIG_PACKET_MMAP=y 332CONFIG_PACKET_MMAP=y
290CONFIG_UNIX=y 333CONFIG_UNIX=y
@@ -316,33 +359,15 @@ CONFIG_IP_PNP=y
316CONFIG_TCP_CONG_CUBIC=y 359CONFIG_TCP_CONG_CUBIC=y
317CONFIG_DEFAULT_TCP_CONG="cubic" 360CONFIG_DEFAULT_TCP_CONG="cubic"
318# CONFIG_TCP_MD5SIG is not set 361# CONFIG_TCP_MD5SIG is not set
319# CONFIG_IP_VS is not set
320# CONFIG_IPV6 is not set 362# CONFIG_IPV6 is not set
321# CONFIG_INET6_XFRM_TUNNEL is not set
322# CONFIG_INET6_TUNNEL is not set
323# CONFIG_NETWORK_SECMARK is not set 363# CONFIG_NETWORK_SECMARK is not set
324CONFIG_NETFILTER=y 364# CONFIG_NETFILTER is not set
325# CONFIG_NETFILTER_DEBUG is not set
326
327#
328# Core Netfilter Configuration
329#
330# CONFIG_NETFILTER_NETLINK is not set
331# CONFIG_NF_CONNTRACK_ENABLED is not set
332# CONFIG_NF_CONNTRACK is not set
333# CONFIG_NETFILTER_XTABLES is not set
334
335#
336# IP: Netfilter Configuration
337#
338# CONFIG_IP_NF_QUEUE is not set
339# CONFIG_IP_NF_IPTABLES is not set
340# CONFIG_IP_NF_ARPTABLES is not set
341# CONFIG_IP_DCCP is not set 365# CONFIG_IP_DCCP is not set
342# CONFIG_IP_SCTP is not set 366# CONFIG_IP_SCTP is not set
343# CONFIG_TIPC is not set 367# CONFIG_TIPC is not set
344# CONFIG_ATM is not set 368# CONFIG_ATM is not set
345# CONFIG_BRIDGE is not set 369# CONFIG_BRIDGE is not set
370# CONFIG_NET_DSA is not set
346# CONFIG_VLAN_8021Q is not set 371# CONFIG_VLAN_8021Q is not set
347# CONFIG_DECNET is not set 372# CONFIG_DECNET is not set
348# CONFIG_LLC2 is not set 373# CONFIG_LLC2 is not set
@@ -353,6 +378,7 @@ CONFIG_NETFILTER=y
353# CONFIG_ECONET is not set 378# CONFIG_ECONET is not set
354# CONFIG_WAN_ROUTER is not set 379# CONFIG_WAN_ROUTER is not set
355# CONFIG_NET_SCHED is not set 380# CONFIG_NET_SCHED is not set
381# CONFIG_DCB is not set
356 382
357# 383#
358# Network testing 384# Network testing
@@ -390,20 +416,17 @@ CONFIG_IRTTY_SIR=m
390# Dongle support 416# Dongle support
391# 417#
392# CONFIG_DONGLE is not set 418# CONFIG_DONGLE is not set
393 419# CONFIG_KINGSUN_DONGLE is not set
394# 420# CONFIG_KSDAZZLE_DONGLE is not set
395# Old SIR device drivers 421# CONFIG_KS959_DONGLE is not set
396#
397# CONFIG_IRPORT_SIR is not set
398
399#
400# Old Serial dongle support
401#
402 422
403# 423#
404# FIR device drivers 424# FIR device drivers
405# 425#
426# CONFIG_USB_IRDA is not set
427# CONFIG_SIGMATEL_FIR is not set
406CONFIG_PXA_FICP=m 428CONFIG_PXA_FICP=m
429# CONFIG_MCS_FIR is not set
407CONFIG_BT=m 430CONFIG_BT=m
408CONFIG_BT_L2CAP=m 431CONFIG_BT_L2CAP=m
409CONFIG_BT_SCO=m 432CONFIG_BT_SCO=m
@@ -417,17 +440,17 @@ CONFIG_BT_HIDP=m
417# 440#
418# Bluetooth device drivers 441# Bluetooth device drivers
419# 442#
443CONFIG_BT_HCIBTUSB=m
444# CONFIG_BT_HCIBTSDIO is not set
420# CONFIG_BT_HCIUART is not set 445# CONFIG_BT_HCIUART is not set
446# CONFIG_BT_HCIBCM203X is not set
447# CONFIG_BT_HCIBPA10X is not set
448# CONFIG_BT_HCIBFUSB is not set
421# CONFIG_BT_HCIVHCI is not set 449# CONFIG_BT_HCIVHCI is not set
422# CONFIG_AF_RXRPC is not set 450# CONFIG_AF_RXRPC is not set
423 451# CONFIG_PHONET is not set
424# 452# CONFIG_WIRELESS is not set
425# Wireless 453# CONFIG_WIMAX is not set
426#
427# CONFIG_CFG80211 is not set
428# CONFIG_WIRELESS_EXT is not set
429# CONFIG_MAC80211 is not set
430# CONFIG_IEEE80211 is not set
431# CONFIG_RFKILL is not set 454# CONFIG_RFKILL is not set
432# CONFIG_NET_9P is not set 455# CONFIG_NET_9P is not set
433 456
@@ -442,25 +465,28 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
442CONFIG_STANDALONE=y 465CONFIG_STANDALONE=y
443CONFIG_PREVENT_FIRMWARE_BUILD=y 466CONFIG_PREVENT_FIRMWARE_BUILD=y
444CONFIG_FW_LOADER=y 467CONFIG_FW_LOADER=y
468# CONFIG_FIRMWARE_IN_KERNEL is not set
469CONFIG_EXTRA_FIRMWARE=""
445# CONFIG_DEBUG_DRIVER is not set 470# CONFIG_DEBUG_DRIVER is not set
446# CONFIG_DEBUG_DEVRES is not set 471# CONFIG_DEBUG_DEVRES is not set
447# CONFIG_SYS_HYPERVISOR is not set 472# CONFIG_SYS_HYPERVISOR is not set
448# CONFIG_CONNECTOR is not set 473# CONFIG_CONNECTOR is not set
449CONFIG_MTD=y 474CONFIG_MTD=y
450CONFIG_MTD_DEBUG=y 475# CONFIG_MTD_DEBUG is not set
451CONFIG_MTD_DEBUG_VERBOSE=0
452# CONFIG_MTD_CONCAT is not set 476# CONFIG_MTD_CONCAT is not set
453CONFIG_MTD_PARTITIONS=y 477CONFIG_MTD_PARTITIONS=y
478# CONFIG_MTD_TESTS is not set
454# CONFIG_MTD_REDBOOT_PARTS is not set 479# CONFIG_MTD_REDBOOT_PARTS is not set
455CONFIG_MTD_CMDLINE_PARTS=y 480CONFIG_MTD_CMDLINE_PARTS=y
456# CONFIG_MTD_AFS_PARTS is not set 481# CONFIG_MTD_AFS_PARTS is not set
482# CONFIG_MTD_AR7_PARTS is not set
457 483
458# 484#
459# User Modules And Translation Layers 485# User Modules And Translation Layers
460# 486#
461CONFIG_MTD_CHAR=m 487CONFIG_MTD_CHAR=y
462CONFIG_MTD_BLKDEVS=m 488CONFIG_MTD_BLKDEVS=y
463CONFIG_MTD_BLOCK=m 489CONFIG_MTD_BLOCK=y
464# CONFIG_FTL is not set 490# CONFIG_FTL is not set
465# CONFIG_NFTL is not set 491# CONFIG_NFTL is not set
466# CONFIG_INFTL is not set 492# CONFIG_INFTL is not set
@@ -473,6 +499,7 @@ CONFIG_MTD_BLOCK=m
473# 499#
474CONFIG_MTD_CFI=y 500CONFIG_MTD_CFI=y
475# CONFIG_MTD_JEDECPROBE is not set 501# CONFIG_MTD_JEDECPROBE is not set
502CONFIG_MTD_GEN_PROBE=y
476# CONFIG_MTD_CFI_ADV_OPTIONS is not set 503# CONFIG_MTD_CFI_ADV_OPTIONS is not set
477CONFIG_MTD_MAP_BANK_WIDTH_1=y 504CONFIG_MTD_MAP_BANK_WIDTH_1=y
478CONFIG_MTD_MAP_BANK_WIDTH_2=y 505CONFIG_MTD_MAP_BANK_WIDTH_2=y
@@ -487,6 +514,7 @@ CONFIG_MTD_CFI_I2=y
487CONFIG_MTD_CFI_INTELEXT=y 514CONFIG_MTD_CFI_INTELEXT=y
488# CONFIG_MTD_CFI_AMDSTD is not set 515# CONFIG_MTD_CFI_AMDSTD is not set
489# CONFIG_MTD_CFI_STAA is not set 516# CONFIG_MTD_CFI_STAA is not set
517CONFIG_MTD_CFI_UTIL=y
490# CONFIG_MTD_RAM is not set 518# CONFIG_MTD_RAM is not set
491# CONFIG_MTD_ROM is not set 519# CONFIG_MTD_ROM is not set
492# CONFIG_MTD_ABSENT is not set 520# CONFIG_MTD_ABSENT is not set
@@ -497,9 +525,7 @@ CONFIG_MTD_CFI_INTELEXT=y
497# 525#
498# CONFIG_MTD_COMPLEX_MAPPINGS is not set 526# CONFIG_MTD_COMPLEX_MAPPINGS is not set
499CONFIG_MTD_PHYSMAP=y 527CONFIG_MTD_PHYSMAP=y
500CONFIG_MTD_PHYSMAP_START=0x00000000 528# CONFIG_MTD_PHYSMAP_COMPAT is not set
501CONFIG_MTD_PHYSMAP_LEN=0x04000000
502CONFIG_MTD_PHYSMAP_BANKWIDTH=4
503# CONFIG_MTD_PXA2XX is not set 529# CONFIG_MTD_PXA2XX is not set
504# CONFIG_MTD_ARM_INTEGRATOR is not set 530# CONFIG_MTD_ARM_INTEGRATOR is not set
505# CONFIG_MTD_SHARP_SL is not set 531# CONFIG_MTD_SHARP_SL is not set
@@ -523,6 +549,12 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=4
523# CONFIG_MTD_ONENAND is not set 549# CONFIG_MTD_ONENAND is not set
524 550
525# 551#
552# LPDDR flash memory drivers
553#
554# CONFIG_MTD_LPDDR is not set
555# CONFIG_MTD_QINFO_PROBE is not set
556
557#
526# UBI - Unsorted block images 558# UBI - Unsorted block images
527# 559#
528# CONFIG_MTD_UBI is not set 560# CONFIG_MTD_UBI is not set
@@ -531,10 +563,12 @@ CONFIG_BLK_DEV=y
531# CONFIG_BLK_DEV_COW_COMMON is not set 563# CONFIG_BLK_DEV_COW_COMMON is not set
532# CONFIG_BLK_DEV_LOOP is not set 564# CONFIG_BLK_DEV_LOOP is not set
533# CONFIG_BLK_DEV_NBD is not set 565# CONFIG_BLK_DEV_NBD is not set
566# CONFIG_BLK_DEV_UB is not set
534# CONFIG_BLK_DEV_RAM is not set 567# CONFIG_BLK_DEV_RAM is not set
535# CONFIG_CDROM_PKTCDVD is not set 568# CONFIG_CDROM_PKTCDVD is not set
536# CONFIG_ATA_OVER_ETH is not set 569# CONFIG_ATA_OVER_ETH is not set
537# CONFIG_MISC_DEVICES is not set 570# CONFIG_MISC_DEVICES is not set
571CONFIG_HAVE_IDE=y
538# CONFIG_IDE is not set 572# CONFIG_IDE is not set
539 573
540# 574#
@@ -547,7 +581,6 @@ CONFIG_BLK_DEV=y
547# CONFIG_ATA is not set 581# CONFIG_ATA is not set
548# CONFIG_MD is not set 582# CONFIG_MD is not set
549CONFIG_NETDEVICES=y 583CONFIG_NETDEVICES=y
550# CONFIG_NETDEVICES_MULTIQUEUE is not set
551# CONFIG_DUMMY is not set 584# CONFIG_DUMMY is not set
552# CONFIG_BONDING is not set 585# CONFIG_BONDING is not set
553# CONFIG_MACVLAN is not set 586# CONFIG_MACVLAN is not set
@@ -563,6 +596,20 @@ CONFIG_NETDEVICES=y
563# 596#
564# CONFIG_WLAN_PRE80211 is not set 597# CONFIG_WLAN_PRE80211 is not set
565# CONFIG_WLAN_80211 is not set 598# CONFIG_WLAN_80211 is not set
599# CONFIG_IWLWIFI_LEDS is not set
600
601#
602# Enable WiMAX (Networking options) to see the WiMAX drivers
603#
604
605#
606# USB Network Adapters
607#
608# CONFIG_USB_CATC is not set
609# CONFIG_USB_KAWETH is not set
610# CONFIG_USB_PEGASUS is not set
611# CONFIG_USB_RTL8150 is not set
612# CONFIG_USB_USBNET is not set
566# CONFIG_WAN is not set 613# CONFIG_WAN is not set
567CONFIG_PPP=m 614CONFIG_PPP=m
568# CONFIG_PPP_MULTILINK is not set 615# CONFIG_PPP_MULTILINK is not set
@@ -612,7 +659,26 @@ CONFIG_KEYBOARD_GPIO=y
612# CONFIG_INPUT_JOYSTICK is not set 659# CONFIG_INPUT_JOYSTICK is not set
613# CONFIG_INPUT_TABLET is not set 660# CONFIG_INPUT_TABLET is not set
614CONFIG_INPUT_TOUCHSCREEN=y 661CONFIG_INPUT_TOUCHSCREEN=y
662# CONFIG_TOUCHSCREEN_FUJITSU is not set
663# CONFIG_TOUCHSCREEN_GUNZE is not set
664# CONFIG_TOUCHSCREEN_ELO is not set
665# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
666# CONFIG_TOUCHSCREEN_MTOUCH is not set
667# CONFIG_TOUCHSCREEN_INEXIO is not set
668# CONFIG_TOUCHSCREEN_MK712 is not set
669# CONFIG_TOUCHSCREEN_PENMOUNT is not set
670# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
671# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
672# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
673# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
674# CONFIG_TOUCHSCREEN_TSC2007 is not set
615CONFIG_INPUT_MISC=y 675CONFIG_INPUT_MISC=y
676# CONFIG_INPUT_ATI_REMOTE is not set
677# CONFIG_INPUT_ATI_REMOTE2 is not set
678# CONFIG_INPUT_KEYSPAN_REMOTE is not set
679# CONFIG_INPUT_POWERMATE is not set
680# CONFIG_INPUT_YEALINK is not set
681# CONFIG_INPUT_CM109 is not set
616CONFIG_INPUT_UINPUT=m 682CONFIG_INPUT_UINPUT=m
617 683
618# 684#
@@ -625,9 +691,11 @@ CONFIG_INPUT_UINPUT=m
625# Character devices 691# Character devices
626# 692#
627CONFIG_VT=y 693CONFIG_VT=y
694CONFIG_CONSOLE_TRANSLATIONS=y
628CONFIG_VT_CONSOLE=y 695CONFIG_VT_CONSOLE=y
629CONFIG_HW_CONSOLE=y 696CONFIG_HW_CONSOLE=y
630# CONFIG_VT_HW_CONSOLE_BINDING is not set 697# CONFIG_VT_HW_CONSOLE_BINDING is not set
698# CONFIG_DEVKMEM is not set
631# CONFIG_SERIAL_NONSTANDARD is not set 699# CONFIG_SERIAL_NONSTANDARD is not set
632 700
633# 701#
@@ -642,6 +710,7 @@ CONFIG_SERIAL_PXA=y
642# CONFIG_SERIAL_PXA_CONSOLE is not set 710# CONFIG_SERIAL_PXA_CONSOLE is not set
643CONFIG_SERIAL_CORE=y 711CONFIG_SERIAL_CORE=y
644CONFIG_UNIX98_PTYS=y 712CONFIG_UNIX98_PTYS=y
713# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
645# CONFIG_LEGACY_PTYS is not set 714# CONFIG_LEGACY_PTYS is not set
646# CONFIG_IPMI_HANDLER is not set 715# CONFIG_IPMI_HANDLER is not set
647# CONFIG_HW_RANDOM is not set 716# CONFIG_HW_RANDOM is not set
@@ -649,37 +718,45 @@ CONFIG_UNIX98_PTYS=y
649# CONFIG_R3964 is not set 718# CONFIG_R3964 is not set
650# CONFIG_RAW_DRIVER is not set 719# CONFIG_RAW_DRIVER is not set
651# CONFIG_TCG_TPM is not set 720# CONFIG_TCG_TPM is not set
652CONFIG_I2C=m 721CONFIG_I2C=y
653CONFIG_I2C_BOARDINFO=y 722CONFIG_I2C_BOARDINFO=y
654CONFIG_I2C_CHARDEV=m 723CONFIG_I2C_CHARDEV=m
724CONFIG_I2C_HELPER_AUTO=y
655 725
656# 726#
657# I2C Algorithms 727# I2C Hardware Bus support
658# 728#
659# CONFIG_I2C_ALGOBIT is not set
660# CONFIG_I2C_ALGOPCF is not set
661# CONFIG_I2C_ALGOPCA is not set
662 729
663# 730#
664# I2C Hardware Bus support 731# I2C system bus drivers (mostly embedded / system-on-chip)
665# 732#
666# CONFIG_I2C_GPIO is not set 733# CONFIG_I2C_GPIO is not set
667CONFIG_I2C_PXA=m
668# CONFIG_I2C_PXA_SLAVE is not set
669# CONFIG_I2C_OCORES is not set 734# CONFIG_I2C_OCORES is not set
670# CONFIG_I2C_PARPORT_LIGHT is not set 735CONFIG_I2C_PXA=y
736# CONFIG_I2C_PXA_SLAVE is not set
671# CONFIG_I2C_SIMTEC is not set 737# CONFIG_I2C_SIMTEC is not set
738
739#
740# External I2C/SMBus adapter drivers
741#
742# CONFIG_I2C_PARPORT_LIGHT is not set
672# CONFIG_I2C_TAOS_EVM is not set 743# CONFIG_I2C_TAOS_EVM is not set
744# CONFIG_I2C_TINY_USB is not set
745
746#
747# Other I2C/SMBus bus drivers
748#
749# CONFIG_I2C_PCA_PLATFORM is not set
673# CONFIG_I2C_STUB is not set 750# CONFIG_I2C_STUB is not set
674 751
675# 752#
676# Miscellaneous I2C Chip support 753# Miscellaneous I2C Chip support
677# 754#
678# CONFIG_SENSORS_DS1337 is not set
679# CONFIG_SENSORS_DS1374 is not set
680# CONFIG_DS1682 is not set 755# CONFIG_DS1682 is not set
756# CONFIG_AT24 is not set
681# CONFIG_EEPROM_LEGACY is not set 757# CONFIG_EEPROM_LEGACY is not set
682# CONFIG_SENSORS_PCF8574 is not set 758# CONFIG_SENSORS_PCF8574 is not set
759# CONFIG_PCF8575 is not set
683# CONFIG_SENSORS_PCA9539 is not set 760# CONFIG_SENSORS_PCA9539 is not set
684# CONFIG_SENSORS_PCF8591 is not set 761# CONFIG_SENSORS_PCF8591 is not set
685# CONFIG_SENSORS_MAX6875 is not set 762# CONFIG_SENSORS_MAX6875 is not set
@@ -688,19 +765,39 @@ CONFIG_I2C_PXA=m
688# CONFIG_I2C_DEBUG_ALGO is not set 765# CONFIG_I2C_DEBUG_ALGO is not set
689# CONFIG_I2C_DEBUG_BUS is not set 766# CONFIG_I2C_DEBUG_BUS is not set
690# CONFIG_I2C_DEBUG_CHIP is not set 767# CONFIG_I2C_DEBUG_CHIP is not set
768# CONFIG_SPI is not set
769CONFIG_ARCH_REQUIRE_GPIOLIB=y
770CONFIG_GPIOLIB=y
771# CONFIG_DEBUG_GPIO is not set
772# CONFIG_GPIO_SYSFS is not set
691 773
692# 774#
693# SPI support 775# Memory mapped GPIO expanders:
776#
777
778#
779# I2C GPIO expanders:
780#
781# CONFIG_GPIO_MAX732X is not set
782# CONFIG_GPIO_PCA953X is not set
783# CONFIG_GPIO_PCF857X is not set
784
785#
786# PCI GPIO expanders:
787#
788
789#
790# SPI GPIO expanders:
694# 791#
695# CONFIG_SPI is not set
696# CONFIG_SPI_MASTER is not set
697CONFIG_W1=y 792CONFIG_W1=y
698 793
699# 794#
700# 1-wire Bus Masters 795# 1-wire Bus Masters
701# 796#
797# CONFIG_W1_MASTER_DS2490 is not set
702# CONFIG_W1_MASTER_DS2482 is not set 798# CONFIG_W1_MASTER_DS2482 is not set
703CONFIG_W1_MASTER_DS1WM=y 799CONFIG_W1_MASTER_DS1WM=y
800# CONFIG_W1_MASTER_GPIO is not set
704 801
705# 802#
706# 1-wire Slaves 803# 1-wire Slaves
@@ -709,32 +806,56 @@ CONFIG_W1_MASTER_DS1WM=y
709# CONFIG_W1_SLAVE_SMEM is not set 806# CONFIG_W1_SLAVE_SMEM is not set
710# CONFIG_W1_SLAVE_DS2433 is not set 807# CONFIG_W1_SLAVE_DS2433 is not set
711CONFIG_W1_SLAVE_DS2760=y 808CONFIG_W1_SLAVE_DS2760=y
809# CONFIG_W1_SLAVE_BQ27000 is not set
712CONFIG_POWER_SUPPLY=y 810CONFIG_POWER_SUPPLY=y
713# CONFIG_POWER_SUPPLY_DEBUG is not set 811# CONFIG_POWER_SUPPLY_DEBUG is not set
714CONFIG_PDA_POWER=y 812CONFIG_PDA_POWER=y
715# CONFIG_APM_POWER is not set
716CONFIG_BATTERY_DS2760=y 813CONFIG_BATTERY_DS2760=y
814# CONFIG_BATTERY_BQ27x00 is not set
717# CONFIG_HWMON is not set 815# CONFIG_HWMON is not set
816# CONFIG_THERMAL is not set
817# CONFIG_THERMAL_HWMON is not set
718# CONFIG_WATCHDOG is not set 818# CONFIG_WATCHDOG is not set
819CONFIG_SSB_POSSIBLE=y
719 820
720# 821#
721# Sonics Silicon Backplane 822# Sonics Silicon Backplane
722# 823#
723CONFIG_SSB_POSSIBLE=y
724# CONFIG_SSB is not set 824# CONFIG_SSB is not set
725 825
726# 826#
727# Multifunction device drivers 827# Multifunction device drivers
728# 828#
829# CONFIG_MFD_CORE is not set
729# CONFIG_MFD_SM501 is not set 830# CONFIG_MFD_SM501 is not set
831# CONFIG_MFD_ASIC3 is not set
730CONFIG_HTC_EGPIO=y 832CONFIG_HTC_EGPIO=y
731CONFIG_HTC_PASIC3=y 833CONFIG_HTC_PASIC3=y
834# CONFIG_TPS65010 is not set
835# CONFIG_TWL4030_CORE is not set
836# CONFIG_MFD_TMIO is not set
837# CONFIG_MFD_T7L66XB is not set
838# CONFIG_MFD_TC6387XB is not set
839# CONFIG_MFD_TC6393XB is not set
840# CONFIG_PMIC_DA903X is not set
841# CONFIG_MFD_WM8400 is not set
842# CONFIG_MFD_WM8350_I2C is not set
843# CONFIG_MFD_PCF50633 is not set
732 844
733# 845#
734# Multimedia devices 846# Multimedia devices
735# 847#
848
849#
850# Multimedia core support
851#
736# CONFIG_VIDEO_DEV is not set 852# CONFIG_VIDEO_DEV is not set
737# CONFIG_DVB_CORE is not set 853# CONFIG_DVB_CORE is not set
854# CONFIG_VIDEO_MEDIA is not set
855
856#
857# Multimedia drivers
858#
738# CONFIG_DAB is not set 859# CONFIG_DAB is not set
739 860
740# 861#
@@ -745,6 +866,7 @@ CONFIG_HTC_PASIC3=y
745CONFIG_FB=y 866CONFIG_FB=y
746# CONFIG_FIRMWARE_EDID is not set 867# CONFIG_FIRMWARE_EDID is not set
747# CONFIG_FB_DDC is not set 868# CONFIG_FB_DDC is not set
869# CONFIG_FB_BOOT_VESA_SUPPORT is not set
748CONFIG_FB_CFB_FILLRECT=y 870CONFIG_FB_CFB_FILLRECT=y
749CONFIG_FB_CFB_COPYAREA=y 871CONFIG_FB_CFB_COPYAREA=y
750CONFIG_FB_CFB_IMAGEBLIT=y 872CONFIG_FB_CFB_IMAGEBLIT=y
@@ -752,8 +874,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
752# CONFIG_FB_SYS_FILLRECT is not set 874# CONFIG_FB_SYS_FILLRECT is not set
753# CONFIG_FB_SYS_COPYAREA is not set 875# CONFIG_FB_SYS_COPYAREA is not set
754# CONFIG_FB_SYS_IMAGEBLIT is not set 876# CONFIG_FB_SYS_IMAGEBLIT is not set
877# CONFIG_FB_FOREIGN_ENDIAN is not set
755# CONFIG_FB_SYS_FOPS is not set 878# CONFIG_FB_SYS_FOPS is not set
756CONFIG_FB_DEFERRED_IO=y
757# CONFIG_FB_SVGALIB is not set 879# CONFIG_FB_SVGALIB is not set
758# CONFIG_FB_MACMODES is not set 880# CONFIG_FB_MACMODES is not set
759# CONFIG_FB_BACKLIGHT is not set 881# CONFIG_FB_BACKLIGHT is not set
@@ -765,13 +887,21 @@ CONFIG_FB_DEFERRED_IO=y
765# 887#
766# CONFIG_FB_S1D13XXX is not set 888# CONFIG_FB_S1D13XXX is not set
767CONFIG_FB_PXA=y 889CONFIG_FB_PXA=y
890CONFIG_FB_PXA_OVERLAY=y
891# CONFIG_FB_PXA_SMARTPANEL is not set
768# CONFIG_FB_PXA_PARAMETERS is not set 892# CONFIG_FB_PXA_PARAMETERS is not set
769# CONFIG_FB_MBX is not set 893# CONFIG_FB_MBX is not set
894# CONFIG_FB_W100 is not set
770# CONFIG_FB_VIRTUAL is not set 895# CONFIG_FB_VIRTUAL is not set
896# CONFIG_FB_METRONOME is not set
897# CONFIG_FB_MB862XX is not set
771CONFIG_BACKLIGHT_LCD_SUPPORT=y 898CONFIG_BACKLIGHT_LCD_SUPPORT=y
772CONFIG_LCD_CLASS_DEVICE=y 899CONFIG_LCD_CLASS_DEVICE=y
900# CONFIG_LCD_ILI9320 is not set
901# CONFIG_LCD_PLATFORM is not set
773CONFIG_BACKLIGHT_CLASS_DEVICE=y 902CONFIG_BACKLIGHT_CLASS_DEVICE=y
774CONFIG_BACKLIGHT_CORGI=y 903# CONFIG_BACKLIGHT_GENERIC is not set
904CONFIG_BACKLIGHT_PWM=y
775 905
776# 906#
777# Display device support 907# Display device support
@@ -802,15 +932,8 @@ CONFIG_FONT_MINI_4x6=y
802# CONFIG_FONT_SUN12x22 is not set 932# CONFIG_FONT_SUN12x22 is not set
803# CONFIG_FONT_10x18 is not set 933# CONFIG_FONT_10x18 is not set
804# CONFIG_LOGO is not set 934# CONFIG_LOGO is not set
805
806#
807# Sound
808#
809CONFIG_SOUND=y 935CONFIG_SOUND=y
810 936CONFIG_SOUND_OSS_CORE=y
811#
812# Advanced Linux Sound Architecture
813#
814CONFIG_SND=m 937CONFIG_SND=m
815CONFIG_SND_TIMER=m 938CONFIG_SND_TIMER=m
816CONFIG_SND_PCM=m 939CONFIG_SND_PCM=m
@@ -824,53 +947,185 @@ CONFIG_SND_SUPPORT_OLD_API=y
824CONFIG_SND_VERBOSE_PROCFS=y 947CONFIG_SND_VERBOSE_PROCFS=y
825# CONFIG_SND_VERBOSE_PRINTK is not set 948# CONFIG_SND_VERBOSE_PRINTK is not set
826# CONFIG_SND_DEBUG is not set 949# CONFIG_SND_DEBUG is not set
827 950CONFIG_SND_DRIVERS=y
828#
829# Generic devices
830#
831# CONFIG_SND_DUMMY is not set 951# CONFIG_SND_DUMMY is not set
832# CONFIG_SND_MTPAV is not set 952# CONFIG_SND_MTPAV is not set
833# CONFIG_SND_SERIAL_U16550 is not set 953# CONFIG_SND_SERIAL_U16550 is not set
834# CONFIG_SND_MPU401 is not set 954# CONFIG_SND_MPU401 is not set
835 955# CONFIG_SND_ARM is not set
836# 956CONFIG_SND_PXA2XX_LIB=m
837# ALSA ARM devices 957# CONFIG_SND_USB is not set
838#
839# CONFIG_SND_PXA2XX_AC97 is not set
840
841#
842# System on Chip audio support
843#
844CONFIG_SND_SOC=m 958CONFIG_SND_SOC=m
845CONFIG_SND_PXA2XX_SOC=m 959CONFIG_SND_PXA2XX_SOC=m
846 960CONFIG_SND_SOC_I2C_AND_SPI=m
847# 961# CONFIG_SND_SOC_ALL_CODECS is not set
848# SoC Audio support for SuperH
849#
850
851#
852# Open Sound System
853#
854# CONFIG_SOUND_PRIME is not set 962# CONFIG_SOUND_PRIME is not set
855# CONFIG_HID_SUPPORT is not set 963# CONFIG_HID_SUPPORT is not set
856CONFIG_HID=m 964CONFIG_HID=m
857# CONFIG_USB_SUPPORT is not set 965CONFIG_USB_SUPPORT=y
966CONFIG_USB_ARCH_HAS_HCD=y
967CONFIG_USB_ARCH_HAS_OHCI=y
968# CONFIG_USB_ARCH_HAS_EHCI is not set
969CONFIG_USB=y
970# CONFIG_USB_DEBUG is not set
971# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
972
973#
974# Miscellaneous USB options
975#
976# CONFIG_USB_DEVICEFS is not set
977# CONFIG_USB_DEVICE_CLASS is not set
978# CONFIG_USB_DYNAMIC_MINORS is not set
979# CONFIG_USB_SUSPEND is not set
980# CONFIG_USB_OTG is not set
981# CONFIG_USB_OTG_WHITELIST is not set
982# CONFIG_USB_OTG_BLACKLIST_HUB is not set
983CONFIG_USB_MON=m
984# CONFIG_USB_WUSB is not set
985# CONFIG_USB_WUSB_CBAF is not set
986
987#
988# USB Host Controller Drivers
989#
990# CONFIG_USB_C67X00_HCD is not set
991# CONFIG_USB_OXU210HP_HCD is not set
992# CONFIG_USB_ISP116X_HCD is not set
993CONFIG_USB_OHCI_HCD=y
994# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
995# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
996CONFIG_USB_OHCI_LITTLE_ENDIAN=y
997# CONFIG_USB_SL811_HCD is not set
998# CONFIG_USB_R8A66597_HCD is not set
999# CONFIG_USB_HWA_HCD is not set
1000# CONFIG_USB_MUSB_HDRC is not set
1001# CONFIG_USB_GADGET_MUSB_HDRC is not set
1002
1003#
1004# USB Device Class drivers
1005#
1006# CONFIG_USB_ACM is not set
1007# CONFIG_USB_PRINTER is not set
1008# CONFIG_USB_WDM is not set
1009# CONFIG_USB_TMC is not set
1010
1011#
1012# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1013#
1014
1015#
1016# see USB_STORAGE Help for more information
1017#
1018# CONFIG_USB_LIBUSUAL is not set
1019
1020#
1021# USB Imaging devices
1022#
1023# CONFIG_USB_MDC800 is not set
1024
1025#
1026# USB port drivers
1027#
1028# CONFIG_USB_SERIAL is not set
1029
1030#
1031# USB Miscellaneous drivers
1032#
1033# CONFIG_USB_EMI62 is not set
1034# CONFIG_USB_EMI26 is not set
1035# CONFIG_USB_ADUTUX is not set
1036# CONFIG_USB_SEVSEG is not set
1037# CONFIG_USB_RIO500 is not set
1038# CONFIG_USB_LEGOTOWER is not set
1039# CONFIG_USB_LCD is not set
1040# CONFIG_USB_BERRY_CHARGE is not set
1041# CONFIG_USB_LED is not set
1042# CONFIG_USB_CYPRESS_CY7C63 is not set
1043# CONFIG_USB_CYTHERM is not set
1044# CONFIG_USB_PHIDGET is not set
1045# CONFIG_USB_IDMOUSE is not set
1046# CONFIG_USB_FTDI_ELAN is not set
1047# CONFIG_USB_APPLEDISPLAY is not set
1048# CONFIG_USB_LD is not set
1049# CONFIG_USB_TRANCEVIBRATOR is not set
1050# CONFIG_USB_IOWARRIOR is not set
1051# CONFIG_USB_ISIGHTFW is not set
1052# CONFIG_USB_VST is not set
1053CONFIG_USB_GADGET=y
1054# CONFIG_USB_GADGET_DEBUG is not set
1055# CONFIG_USB_GADGET_DEBUG_FILES is not set
1056CONFIG_USB_GADGET_VBUS_DRAW=500
1057CONFIG_USB_GADGET_SELECTED=y
1058# CONFIG_USB_GADGET_AT91 is not set
1059# CONFIG_USB_GADGET_ATMEL_USBA is not set
1060# CONFIG_USB_GADGET_FSL_USB2 is not set
1061# CONFIG_USB_GADGET_LH7A40X is not set
1062# CONFIG_USB_GADGET_OMAP is not set
1063# CONFIG_USB_GADGET_PXA25X is not set
1064CONFIG_USB_GADGET_PXA27X=y
1065CONFIG_USB_PXA27X=y
1066# CONFIG_USB_GADGET_S3C2410 is not set
1067# CONFIG_USB_GADGET_IMX is not set
1068# CONFIG_USB_GADGET_M66592 is not set
1069# CONFIG_USB_GADGET_AMD5536UDC is not set
1070# CONFIG_USB_GADGET_FSL_QE is not set
1071# CONFIG_USB_GADGET_CI13XXX is not set
1072# CONFIG_USB_GADGET_NET2280 is not set
1073# CONFIG_USB_GADGET_GOKU is not set
1074# CONFIG_USB_GADGET_DUMMY_HCD is not set
1075# CONFIG_USB_GADGET_DUALSPEED is not set
1076# CONFIG_USB_ZERO is not set
1077CONFIG_USB_ETH=m
1078# CONFIG_USB_ETH_RNDIS is not set
1079CONFIG_USB_GADGETFS=m
1080CONFIG_USB_FILE_STORAGE=m
1081# CONFIG_USB_FILE_STORAGE_TEST is not set
1082CONFIG_USB_G_SERIAL=m
1083# CONFIG_USB_MIDI_GADGET is not set
1084# CONFIG_USB_G_PRINTER is not set
1085CONFIG_USB_CDC_COMPOSITE=m
1086
1087#
1088# OTG and related infrastructure
1089#
1090CONFIG_USB_OTG_UTILS=y
1091CONFIG_USB_GPIO_VBUS=y
858CONFIG_MMC=y 1092CONFIG_MMC=y
859# CONFIG_MMC_DEBUG is not set 1093# CONFIG_MMC_DEBUG is not set
860# CONFIG_MMC_UNSAFE_RESUME is not set 1094# CONFIG_MMC_UNSAFE_RESUME is not set
861 1095
862# 1096#
863# MMC/SD Card Drivers 1097# MMC/SD/SDIO Card Drivers
864# 1098#
865CONFIG_MMC_BLOCK=y 1099CONFIG_MMC_BLOCK=y
866CONFIG_MMC_BLOCK_BOUNCE=y 1100CONFIG_MMC_BLOCK_BOUNCE=y
867CONFIG_SDIO_UART=m 1101CONFIG_SDIO_UART=m
1102# CONFIG_MMC_TEST is not set
868 1103
869# 1104#
870# MMC/SD Host Controller Drivers 1105# MMC/SD/SDIO Host Controller Drivers
871# 1106#
872CONFIG_MMC_PXA=y 1107CONFIG_MMC_PXA=y
1108# CONFIG_MMC_SDHCI is not set
1109# CONFIG_MEMSTICK is not set
1110# CONFIG_ACCESSIBILITY is not set
873CONFIG_NEW_LEDS=y 1111CONFIG_NEW_LEDS=y
1112CONFIG_LEDS_CLASS=y
1113
1114#
1115# LED drivers
1116#
1117# CONFIG_LEDS_PCA9532 is not set
1118CONFIG_LEDS_GPIO=y
1119# CONFIG_LEDS_PCA955X is not set
1120
1121#
1122# LED Triggers
1123#
1124CONFIG_LEDS_TRIGGERS=y
1125# CONFIG_LEDS_TRIGGER_TIMER is not set
1126# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1127CONFIG_LEDS_TRIGGER_BACKLIGHT=y
1128# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
874CONFIG_RTC_LIB=y 1129CONFIG_RTC_LIB=y
875CONFIG_RTC_CLASS=y 1130CONFIG_RTC_CLASS=y
876CONFIG_RTC_HCTOSYS=y 1131CONFIG_RTC_HCTOSYS=y
@@ -899,6 +1154,9 @@ CONFIG_RTC_INTF_DEV=y
899# CONFIG_RTC_DRV_PCF8563 is not set 1154# CONFIG_RTC_DRV_PCF8563 is not set
900# CONFIG_RTC_DRV_PCF8583 is not set 1155# CONFIG_RTC_DRV_PCF8583 is not set
901# CONFIG_RTC_DRV_M41T80 is not set 1156# CONFIG_RTC_DRV_M41T80 is not set
1157# CONFIG_RTC_DRV_S35390A is not set
1158# CONFIG_RTC_DRV_FM3130 is not set
1159# CONFIG_RTC_DRV_RX8581 is not set
902 1160
903# 1161#
904# SPI RTC drivers 1162# SPI RTC drivers
@@ -908,17 +1166,26 @@ CONFIG_RTC_INTF_DEV=y
908# Platform RTC drivers 1166# Platform RTC drivers
909# 1167#
910# CONFIG_RTC_DRV_CMOS is not set 1168# CONFIG_RTC_DRV_CMOS is not set
1169# CONFIG_RTC_DRV_DS1286 is not set
1170# CONFIG_RTC_DRV_DS1511 is not set
911# CONFIG_RTC_DRV_DS1553 is not set 1171# CONFIG_RTC_DRV_DS1553 is not set
912# CONFIG_RTC_DRV_STK17TA8 is not set
913# CONFIG_RTC_DRV_DS1742 is not set 1172# CONFIG_RTC_DRV_DS1742 is not set
1173# CONFIG_RTC_DRV_STK17TA8 is not set
914# CONFIG_RTC_DRV_M48T86 is not set 1174# CONFIG_RTC_DRV_M48T86 is not set
1175# CONFIG_RTC_DRV_M48T35 is not set
915# CONFIG_RTC_DRV_M48T59 is not set 1176# CONFIG_RTC_DRV_M48T59 is not set
1177# CONFIG_RTC_DRV_BQ4802 is not set
916# CONFIG_RTC_DRV_V3020 is not set 1178# CONFIG_RTC_DRV_V3020 is not set
917 1179
918# 1180#
919# on-CPU RTC drivers 1181# on-CPU RTC drivers
920# 1182#
921CONFIG_RTC_DRV_SA1100=y 1183CONFIG_RTC_DRV_SA1100=y
1184# CONFIG_RTC_DRV_PXA is not set
1185# CONFIG_DMADEVICES is not set
1186# CONFIG_REGULATOR is not set
1187# CONFIG_UIO is not set
1188# CONFIG_STAGING is not set
922 1189
923# 1190#
924# File systems 1191# File systems
@@ -927,19 +1194,18 @@ CONFIG_EXT2_FS=y
927# CONFIG_EXT2_FS_XATTR is not set 1194# CONFIG_EXT2_FS_XATTR is not set
928# CONFIG_EXT2_FS_XIP is not set 1195# CONFIG_EXT2_FS_XIP is not set
929# CONFIG_EXT3_FS is not set 1196# CONFIG_EXT3_FS is not set
930# CONFIG_EXT4DEV_FS is not set 1197# CONFIG_EXT4_FS is not set
931# CONFIG_REISERFS_FS is not set 1198# CONFIG_REISERFS_FS is not set
932# CONFIG_JFS_FS is not set 1199# CONFIG_JFS_FS is not set
933# CONFIG_FS_POSIX_ACL is not set 1200# CONFIG_FS_POSIX_ACL is not set
1201CONFIG_FILE_LOCKING=y
934# CONFIG_XFS_FS is not set 1202# CONFIG_XFS_FS is not set
935# CONFIG_GFS2_FS is not set
936# CONFIG_OCFS2_FS is not set 1203# CONFIG_OCFS2_FS is not set
937# CONFIG_MINIX_FS is not set 1204# CONFIG_BTRFS_FS is not set
938# CONFIG_ROMFS_FS is not set 1205CONFIG_DNOTIFY=y
939CONFIG_INOTIFY=y 1206CONFIG_INOTIFY=y
940CONFIG_INOTIFY_USER=y 1207CONFIG_INOTIFY_USER=y
941# CONFIG_QUOTA is not set 1208# CONFIG_QUOTA is not set
942CONFIG_DNOTIFY=y
943# CONFIG_AUTOFS_FS is not set 1209# CONFIG_AUTOFS_FS is not set
944# CONFIG_AUTOFS4_FS is not set 1210# CONFIG_AUTOFS4_FS is not set
945# CONFIG_FUSE_FS is not set 1211# CONFIG_FUSE_FS is not set
@@ -965,15 +1231,13 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
965# 1231#
966CONFIG_PROC_FS=y 1232CONFIG_PROC_FS=y
967CONFIG_PROC_SYSCTL=y 1233CONFIG_PROC_SYSCTL=y
1234CONFIG_PROC_PAGE_MONITOR=y
968CONFIG_SYSFS=y 1235CONFIG_SYSFS=y
969CONFIG_TMPFS=y 1236CONFIG_TMPFS=y
970# CONFIG_TMPFS_POSIX_ACL is not set 1237# CONFIG_TMPFS_POSIX_ACL is not set
971# CONFIG_HUGETLB_PAGE is not set 1238# CONFIG_HUGETLB_PAGE is not set
972# CONFIG_CONFIGFS_FS is not set 1239# CONFIG_CONFIGFS_FS is not set
973 1240CONFIG_MISC_FILESYSTEMS=y
974#
975# Miscellaneous filesystems
976#
977# CONFIG_ADFS_FS is not set 1241# CONFIG_ADFS_FS is not set
978# CONFIG_AFFS_FS is not set 1242# CONFIG_AFFS_FS is not set
979# CONFIG_HFS_FS is not set 1243# CONFIG_HFS_FS is not set
@@ -997,9 +1261,13 @@ CONFIG_JFFS2_CMODE_PRIORITY=y
997# CONFIG_JFFS2_CMODE_SIZE is not set 1261# CONFIG_JFFS2_CMODE_SIZE is not set
998# CONFIG_JFFS2_CMODE_FAVOURLZO is not set 1262# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
999# CONFIG_CRAMFS is not set 1263# CONFIG_CRAMFS is not set
1264# CONFIG_SQUASHFS is not set
1000# CONFIG_VXFS_FS is not set 1265# CONFIG_VXFS_FS is not set
1266# CONFIG_MINIX_FS is not set
1267# CONFIG_OMFS_FS is not set
1001# CONFIG_HPFS_FS is not set 1268# CONFIG_HPFS_FS is not set
1002# CONFIG_QNX4FS_FS is not set 1269# CONFIG_QNX4FS_FS is not set
1270# CONFIG_ROMFS_FS is not set
1003# CONFIG_SYSV_FS is not set 1271# CONFIG_SYSV_FS is not set
1004# CONFIG_UFS_FS is not set 1272# CONFIG_UFS_FS is not set
1005CONFIG_NETWORK_FILESYSTEMS=y 1273CONFIG_NETWORK_FILESYSTEMS=y
@@ -1007,14 +1275,13 @@ CONFIG_NFS_FS=y
1007CONFIG_NFS_V3=y 1275CONFIG_NFS_V3=y
1008# CONFIG_NFS_V3_ACL is not set 1276# CONFIG_NFS_V3_ACL is not set
1009# CONFIG_NFS_V4 is not set 1277# CONFIG_NFS_V4 is not set
1010# CONFIG_NFS_DIRECTIO is not set
1011# CONFIG_NFSD is not set
1012CONFIG_ROOT_NFS=y 1278CONFIG_ROOT_NFS=y
1279# CONFIG_NFSD is not set
1013CONFIG_LOCKD=y 1280CONFIG_LOCKD=y
1014CONFIG_LOCKD_V4=y 1281CONFIG_LOCKD_V4=y
1015CONFIG_NFS_COMMON=y 1282CONFIG_NFS_COMMON=y
1016CONFIG_SUNRPC=y 1283CONFIG_SUNRPC=y
1017# CONFIG_SUNRPC_BIND34 is not set 1284# CONFIG_SUNRPC_REGISTER_V4 is not set
1018# CONFIG_RPCSEC_GSS_KRB5 is not set 1285# CONFIG_RPCSEC_GSS_KRB5 is not set
1019# CONFIG_RPCSEC_GSS_SPKM3 is not set 1286# CONFIG_RPCSEC_GSS_SPKM3 is not set
1020# CONFIG_SMB_FS is not set 1287# CONFIG_SMB_FS is not set
@@ -1076,6 +1343,7 @@ CONFIG_NLS_UTF8=y
1076CONFIG_PRINTK_TIME=y 1343CONFIG_PRINTK_TIME=y
1077CONFIG_ENABLE_WARN_DEPRECATED=y 1344CONFIG_ENABLE_WARN_DEPRECATED=y
1078CONFIG_ENABLE_MUST_CHECK=y 1345CONFIG_ENABLE_MUST_CHECK=y
1346CONFIG_FRAME_WARN=1024
1079# CONFIG_MAGIC_SYSRQ is not set 1347# CONFIG_MAGIC_SYSRQ is not set
1080# CONFIG_UNUSED_SYMBOLS is not set 1348# CONFIG_UNUSED_SYMBOLS is not set
1081# CONFIG_DEBUG_FS is not set 1349# CONFIG_DEBUG_FS is not set
@@ -1083,15 +1351,18 @@ CONFIG_ENABLE_MUST_CHECK=y
1083CONFIG_DEBUG_KERNEL=y 1351CONFIG_DEBUG_KERNEL=y
1084# CONFIG_DEBUG_SHIRQ is not set 1352# CONFIG_DEBUG_SHIRQ is not set
1085CONFIG_DETECT_SOFTLOCKUP=y 1353CONFIG_DETECT_SOFTLOCKUP=y
1354# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1355CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1086# CONFIG_SCHED_DEBUG is not set 1356# CONFIG_SCHED_DEBUG is not set
1087# CONFIG_SCHEDSTATS is not set 1357# CONFIG_SCHEDSTATS is not set
1088CONFIG_TIMER_STATS=y 1358CONFIG_TIMER_STATS=y
1359# CONFIG_DEBUG_OBJECTS is not set
1089# CONFIG_DEBUG_SLAB is not set 1360# CONFIG_DEBUG_SLAB is not set
1090CONFIG_DEBUG_PREEMPT=y 1361# CONFIG_DEBUG_PREEMPT is not set
1091# CONFIG_DEBUG_RT_MUTEXES is not set 1362# CONFIG_DEBUG_RT_MUTEXES is not set
1092# CONFIG_RT_MUTEX_TESTER is not set 1363# CONFIG_RT_MUTEX_TESTER is not set
1093# CONFIG_DEBUG_SPINLOCK is not set 1364# CONFIG_DEBUG_SPINLOCK is not set
1094CONFIG_DEBUG_MUTEXES=y 1365# CONFIG_DEBUG_MUTEXES is not set
1095# CONFIG_DEBUG_LOCK_ALLOC is not set 1366# CONFIG_DEBUG_LOCK_ALLOC is not set
1096# CONFIG_PROVE_LOCKING is not set 1367# CONFIG_PROVE_LOCKING is not set
1097# CONFIG_LOCK_STAT is not set 1368# CONFIG_LOCK_STAT is not set
@@ -1100,17 +1371,41 @@ CONFIG_DEBUG_MUTEXES=y
1100# CONFIG_DEBUG_KOBJECT is not set 1371# CONFIG_DEBUG_KOBJECT is not set
1101CONFIG_DEBUG_BUGVERBOSE=y 1372CONFIG_DEBUG_BUGVERBOSE=y
1102# CONFIG_DEBUG_INFO is not set 1373# CONFIG_DEBUG_INFO is not set
1103CONFIG_DEBUG_VM=y 1374# CONFIG_DEBUG_VM is not set
1375# CONFIG_DEBUG_WRITECOUNT is not set
1376# CONFIG_DEBUG_MEMORY_INIT is not set
1104# CONFIG_DEBUG_LIST is not set 1377# CONFIG_DEBUG_LIST is not set
1105# CONFIG_DEBUG_SG is not set 1378# CONFIG_DEBUG_SG is not set
1379# CONFIG_DEBUG_NOTIFIERS is not set
1106CONFIG_FRAME_POINTER=y 1380CONFIG_FRAME_POINTER=y
1107CONFIG_FORCED_INLINING=y
1108# CONFIG_BOOT_PRINTK_DELAY is not set 1381# CONFIG_BOOT_PRINTK_DELAY is not set
1109# CONFIG_RCU_TORTURE_TEST is not set 1382# CONFIG_RCU_TORTURE_TEST is not set
1383# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1384# CONFIG_BACKTRACE_SELF_TEST is not set
1385# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1110# CONFIG_FAULT_INJECTION is not set 1386# CONFIG_FAULT_INJECTION is not set
1387# CONFIG_LATENCYTOP is not set
1388# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1389CONFIG_HAVE_FUNCTION_TRACER=y
1390
1391#
1392# Tracers
1393#
1394# CONFIG_FUNCTION_TRACER is not set
1395# CONFIG_IRQSOFF_TRACER is not set
1396# CONFIG_PREEMPT_TRACER is not set
1397# CONFIG_SCHED_TRACER is not set
1398# CONFIG_CONTEXT_SWITCH_TRACER is not set
1399# CONFIG_BOOT_TRACER is not set
1400# CONFIG_TRACE_BRANCH_PROFILING is not set
1401# CONFIG_STACK_TRACER is not set
1402# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1111# CONFIG_SAMPLES is not set 1403# CONFIG_SAMPLES is not set
1404CONFIG_HAVE_ARCH_KGDB=y
1405# CONFIG_KGDB is not set
1112CONFIG_DEBUG_USER=y 1406CONFIG_DEBUG_USER=y
1113CONFIG_DEBUG_ERRORS=y 1407CONFIG_DEBUG_ERRORS=y
1408# CONFIG_DEBUG_STACK_USAGE is not set
1114CONFIG_DEBUG_LL=y 1409CONFIG_DEBUG_LL=y
1115# CONFIG_DEBUG_ICEDCC is not set 1410# CONFIG_DEBUG_ICEDCC is not set
1116 1411
@@ -1119,55 +1414,110 @@ CONFIG_DEBUG_LL=y
1119# 1414#
1120# CONFIG_KEYS is not set 1415# CONFIG_KEYS is not set
1121# CONFIG_SECURITY is not set 1416# CONFIG_SECURITY is not set
1417# CONFIG_SECURITYFS is not set
1122# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1418# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1123CONFIG_CRYPTO=y 1419CONFIG_CRYPTO=y
1420
1421#
1422# Crypto core or helper
1423#
1424# CONFIG_CRYPTO_FIPS is not set
1124CONFIG_CRYPTO_ALGAPI=m 1425CONFIG_CRYPTO_ALGAPI=m
1426CONFIG_CRYPTO_ALGAPI2=m
1427CONFIG_CRYPTO_AEAD2=m
1125CONFIG_CRYPTO_BLKCIPHER=m 1428CONFIG_CRYPTO_BLKCIPHER=m
1429CONFIG_CRYPTO_BLKCIPHER2=m
1430CONFIG_CRYPTO_HASH=m
1431CONFIG_CRYPTO_HASH2=m
1432CONFIG_CRYPTO_RNG2=m
1126CONFIG_CRYPTO_MANAGER=m 1433CONFIG_CRYPTO_MANAGER=m
1434CONFIG_CRYPTO_MANAGER2=m
1435# CONFIG_CRYPTO_GF128MUL is not set
1436# CONFIG_CRYPTO_NULL is not set
1437# CONFIG_CRYPTO_CRYPTD is not set
1438# CONFIG_CRYPTO_AUTHENC is not set
1439# CONFIG_CRYPTO_TEST is not set
1440
1441#
1442# Authenticated Encryption with Associated Data
1443#
1444# CONFIG_CRYPTO_CCM is not set
1445# CONFIG_CRYPTO_GCM is not set
1446# CONFIG_CRYPTO_SEQIV is not set
1447
1448#
1449# Block modes
1450#
1451# CONFIG_CRYPTO_CBC is not set
1452# CONFIG_CRYPTO_CTR is not set
1453# CONFIG_CRYPTO_CTS is not set
1454CONFIG_CRYPTO_ECB=m
1455# CONFIG_CRYPTO_LRW is not set
1456# CONFIG_CRYPTO_PCBC is not set
1457# CONFIG_CRYPTO_XTS is not set
1458
1459#
1460# Hash modes
1461#
1127# CONFIG_CRYPTO_HMAC is not set 1462# CONFIG_CRYPTO_HMAC is not set
1128# CONFIG_CRYPTO_XCBC is not set 1463# CONFIG_CRYPTO_XCBC is not set
1129# CONFIG_CRYPTO_NULL is not set 1464
1465#
1466# Digest
1467#
1468# CONFIG_CRYPTO_CRC32C is not set
1130# CONFIG_CRYPTO_MD4 is not set 1469# CONFIG_CRYPTO_MD4 is not set
1131# CONFIG_CRYPTO_MD5 is not set 1470# CONFIG_CRYPTO_MD5 is not set
1471# CONFIG_CRYPTO_MICHAEL_MIC is not set
1472# CONFIG_CRYPTO_RMD128 is not set
1473# CONFIG_CRYPTO_RMD160 is not set
1474# CONFIG_CRYPTO_RMD256 is not set
1475# CONFIG_CRYPTO_RMD320 is not set
1132CONFIG_CRYPTO_SHA1=m 1476CONFIG_CRYPTO_SHA1=m
1133# CONFIG_CRYPTO_SHA256 is not set 1477# CONFIG_CRYPTO_SHA256 is not set
1134# CONFIG_CRYPTO_SHA512 is not set 1478# CONFIG_CRYPTO_SHA512 is not set
1135# CONFIG_CRYPTO_WP512 is not set
1136# CONFIG_CRYPTO_TGR192 is not set 1479# CONFIG_CRYPTO_TGR192 is not set
1137# CONFIG_CRYPTO_GF128MUL is not set 1480# CONFIG_CRYPTO_WP512 is not set
1138CONFIG_CRYPTO_ECB=m 1481
1139# CONFIG_CRYPTO_CBC is not set 1482#
1140CONFIG_CRYPTO_PCBC=m 1483# Ciphers
1141# CONFIG_CRYPTO_LRW is not set 1484#
1142# CONFIG_CRYPTO_XTS is not set
1143# CONFIG_CRYPTO_CRYPTD is not set
1144# CONFIG_CRYPTO_DES is not set
1145# CONFIG_CRYPTO_FCRYPT is not set
1146# CONFIG_CRYPTO_BLOWFISH is not set
1147# CONFIG_CRYPTO_TWOFISH is not set
1148# CONFIG_CRYPTO_SERPENT is not set
1149# CONFIG_CRYPTO_AES is not set 1485# CONFIG_CRYPTO_AES is not set
1486# CONFIG_CRYPTO_ANUBIS is not set
1487CONFIG_CRYPTO_ARC4=m
1488# CONFIG_CRYPTO_BLOWFISH is not set
1489# CONFIG_CRYPTO_CAMELLIA is not set
1150# CONFIG_CRYPTO_CAST5 is not set 1490# CONFIG_CRYPTO_CAST5 is not set
1151# CONFIG_CRYPTO_CAST6 is not set 1491# CONFIG_CRYPTO_CAST6 is not set
1152# CONFIG_CRYPTO_TEA is not set 1492# CONFIG_CRYPTO_DES is not set
1153CONFIG_CRYPTO_ARC4=m 1493# CONFIG_CRYPTO_FCRYPT is not set
1154# CONFIG_CRYPTO_KHAZAD is not set 1494# CONFIG_CRYPTO_KHAZAD is not set
1155# CONFIG_CRYPTO_ANUBIS is not set 1495# CONFIG_CRYPTO_SALSA20 is not set
1156# CONFIG_CRYPTO_SEED is not set 1496# CONFIG_CRYPTO_SEED is not set
1497# CONFIG_CRYPTO_SERPENT is not set
1498# CONFIG_CRYPTO_TEA is not set
1499# CONFIG_CRYPTO_TWOFISH is not set
1500
1501#
1502# Compression
1503#
1157# CONFIG_CRYPTO_DEFLATE is not set 1504# CONFIG_CRYPTO_DEFLATE is not set
1158# CONFIG_CRYPTO_MICHAEL_MIC is not set 1505# CONFIG_CRYPTO_LZO is not set
1159# CONFIG_CRYPTO_CRC32C is not set 1506
1160# CONFIG_CRYPTO_CAMELLIA is not set 1507#
1161# CONFIG_CRYPTO_TEST is not set 1508# Random Number Generation
1162# CONFIG_CRYPTO_AUTHENC is not set 1509#
1510# CONFIG_CRYPTO_ANSI_CPRNG is not set
1163# CONFIG_CRYPTO_HW is not set 1511# CONFIG_CRYPTO_HW is not set
1164 1512
1165# 1513#
1166# Library routines 1514# Library routines
1167# 1515#
1168CONFIG_BITREVERSE=y 1516CONFIG_BITREVERSE=y
1517CONFIG_GENERIC_FIND_LAST_BIT=y
1169CONFIG_CRC_CCITT=y 1518CONFIG_CRC_CCITT=y
1170# CONFIG_CRC16 is not set 1519# CONFIG_CRC16 is not set
1520# CONFIG_CRC_T10DIF is not set
1171# CONFIG_CRC_ITU_T is not set 1521# CONFIG_CRC_ITU_T is not set
1172CONFIG_CRC32=y 1522CONFIG_CRC32=y
1173# CONFIG_CRC7 is not set 1523# CONFIG_CRC7 is not set
diff --git a/arch/arm/configs/mv78xx0_defconfig b/arch/arm/configs/mv78xx0_defconfig
index 83c817f31bcc..b0698722e0cb 100644
--- a/arch/arm/configs/mv78xx0_defconfig
+++ b/arch/arm/configs/mv78xx0_defconfig
@@ -165,6 +165,7 @@ CONFIG_ARCH_MV78XX0=y
165# Marvell MV78xx0 Implementations 165# Marvell MV78xx0 Implementations
166# 166#
167CONFIG_MACH_DB78X00_BP=y 167CONFIG_MACH_DB78X00_BP=y
168CONFIG_MACH_RD78X00_MASA=y
168 169
169# 170#
170# Boot options 171# Boot options
diff --git a/arch/arm/configs/neponset_defconfig b/arch/arm/configs/neponset_defconfig
index d81ea219c934..36cd62edd05c 100644
--- a/arch/arm/configs/neponset_defconfig
+++ b/arch/arm/configs/neponset_defconfig
@@ -91,7 +91,6 @@ CONFIG_ASSABET_NEPONSET=y
91# CONFIG_SA1100_COLLIE is not set 91# CONFIG_SA1100_COLLIE is not set
92# CONFIG_SA1100_H3100 is not set 92# CONFIG_SA1100_H3100 is not set
93# CONFIG_SA1100_H3600 is not set 93# CONFIG_SA1100_H3600 is not set
94# CONFIG_SA1100_H3800 is not set
95# CONFIG_SA1100_BADGE4 is not set 94# CONFIG_SA1100_BADGE4 is not set
96# CONFIG_SA1100_JORNADA720 is not set 95# CONFIG_SA1100_JORNADA720 is not set
97# CONFIG_SA1100_HACKKIT is not set 96# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/omap_3430sdp_defconfig b/arch/arm/configs/omap_3430sdp_defconfig
new file mode 100644
index 000000000000..8fb918d9ba65
--- /dev/null
+++ b/arch/arm/configs/omap_3430sdp_defconfig
@@ -0,0 +1,2061 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc8
4# Fri Mar 13 14:17: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_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_OPROFILE_ARMV7=y
27CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29
30#
31# General setup
32#
33CONFIG_EXPERIMENTAL=y
34CONFIG_BROKEN_ON_SMP=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_POSIX_MQUEUE is not set
42CONFIG_BSD_PROCESS_ACCT=y
43# CONFIG_BSD_PROCESS_ACCT_V3 is not set
44# CONFIG_TASKSTATS is not set
45# CONFIG_AUDIT is not set
46
47#
48# RCU Subsystem
49#
50CONFIG_CLASSIC_RCU=y
51# CONFIG_TREE_RCU is not set
52# CONFIG_PREEMPT_RCU is not set
53# CONFIG_TREE_RCU_TRACE is not set
54# CONFIG_PREEMPT_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
64CONFIG_SYSFS_DEPRECATED=y
65CONFIG_SYSFS_DEPRECATED_V2=y
66# CONFIG_RELAY is not set
67# CONFIG_NAMESPACES is not set
68CONFIG_BLK_DEV_INITRD=y
69CONFIG_INITRAMFS_SOURCE=""
70CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71CONFIG_SYSCTL=y
72CONFIG_ANON_INODES=y
73CONFIG_EMBEDDED=y
74CONFIG_UID16=y
75# CONFIG_SYSCTL_SYSCALL is not set
76CONFIG_KALLSYMS=y
77# CONFIG_KALLSYMS_ALL is not set
78# CONFIG_KALLSYMS_EXTRA_PASS is not set
79CONFIG_HOTPLUG=y
80CONFIG_PRINTK=y
81CONFIG_BUG=y
82# CONFIG_ELF_CORE is not set
83CONFIG_BASE_FULL=y
84CONFIG_FUTEX=y
85CONFIG_EPOLL=y
86CONFIG_SIGNALFD=y
87CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y
90CONFIG_AIO=y
91CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_SLUB_DEBUG=y
93# CONFIG_COMPAT_BRK is not set
94# CONFIG_SLAB is not set
95CONFIG_SLUB=y
96# CONFIG_SLOB is not set
97CONFIG_PROFILING=y
98CONFIG_TRACEPOINTS=y
99# CONFIG_MARKERS is not set
100CONFIG_OPROFILE=y
101CONFIG_HAVE_OPROFILE=y
102# CONFIG_KPROBES is not set
103CONFIG_HAVE_KPROBES=y
104CONFIG_HAVE_KRETPROBES=y
105CONFIG_HAVE_CLK=y
106CONFIG_HAVE_GENERIC_DMA_COHERENT=y
107CONFIG_SLABINFO=y
108CONFIG_RT_MUTEXES=y
109CONFIG_BASE_SMALL=0
110CONFIG_MODULES=y
111# CONFIG_MODULE_FORCE_LOAD is not set
112CONFIG_MODULE_UNLOAD=y
113CONFIG_MODULE_FORCE_UNLOAD=y
114CONFIG_MODVERSIONS=y
115CONFIG_MODULE_SRCVERSION_ALL=y
116CONFIG_BLOCK=y
117CONFIG_LBD=y
118# CONFIG_BLK_DEV_IO_TRACE is not set
119# CONFIG_BLK_DEV_BSG is not set
120# CONFIG_BLK_DEV_INTEGRITY is not set
121
122#
123# IO Schedulers
124#
125CONFIG_IOSCHED_NOOP=y
126CONFIG_IOSCHED_AS=y
127CONFIG_IOSCHED_DEADLINE=y
128CONFIG_IOSCHED_CFQ=y
129# CONFIG_DEFAULT_AS is not set
130# CONFIG_DEFAULT_DEADLINE is not set
131CONFIG_DEFAULT_CFQ=y
132# CONFIG_DEFAULT_NOOP is not set
133CONFIG_DEFAULT_IOSCHED="cfq"
134CONFIG_FREEZER=y
135
136#
137# System Type
138#
139# CONFIG_ARCH_AAEC2000 is not set
140# CONFIG_ARCH_INTEGRATOR is not set
141# CONFIG_ARCH_REALVIEW is not set
142# CONFIG_ARCH_VERSATILE is not set
143# CONFIG_ARCH_AT91 is not set
144# CONFIG_ARCH_CLPS711X is not set
145# CONFIG_ARCH_EBSA110 is not set
146# CONFIG_ARCH_EP93XX is not set
147# CONFIG_ARCH_FOOTBRIDGE is not set
148# CONFIG_ARCH_NETX is not set
149# CONFIG_ARCH_H720X is not set
150# CONFIG_ARCH_IMX is not set
151# CONFIG_ARCH_IOP13XX is not set
152# CONFIG_ARCH_IOP32X is not set
153# CONFIG_ARCH_IOP33X is not set
154# CONFIG_ARCH_IXP23XX is not set
155# CONFIG_ARCH_IXP2000 is not set
156# CONFIG_ARCH_IXP4XX is not set
157# CONFIG_ARCH_L7200 is not set
158# 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
162# CONFIG_ARCH_MV78XX0 is not set
163# CONFIG_ARCH_MXC is not set
164# CONFIG_ARCH_ORION5X is not set
165# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set
167# CONFIG_ARCH_RPC is not set
168# CONFIG_ARCH_SA1100 is not set
169# CONFIG_ARCH_S3C2410 is not set
170# CONFIG_ARCH_S3C64XX is not set
171# CONFIG_ARCH_SHARK is not set
172# CONFIG_ARCH_LH7A40X is not set
173# CONFIG_ARCH_DAVINCI is not set
174CONFIG_ARCH_OMAP=y
175# CONFIG_ARCH_MSM is not set
176# CONFIG_ARCH_W90X900 is not set
177
178#
179# TI OMAP Implementations
180#
181CONFIG_ARCH_OMAP_OTG=y
182# CONFIG_ARCH_OMAP1 is not set
183# CONFIG_ARCH_OMAP2 is not set
184CONFIG_ARCH_OMAP3=y
185
186#
187# OMAP Feature Selections
188#
189# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
190# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
191# CONFIG_OMAP_RESET_CLOCKS is not set
192CONFIG_OMAP_MUX=y
193CONFIG_OMAP_MUX_DEBUG=y
194CONFIG_OMAP_MUX_WARNINGS=y
195CONFIG_OMAP_MCBSP=y
196# CONFIG_OMAP_MPU_TIMER is not set
197CONFIG_OMAP_32K_TIMER=y
198CONFIG_OMAP_32K_TIMER_HZ=128
199CONFIG_OMAP_DM_TIMER=y
200# CONFIG_OMAP_LL_DEBUG_UART1 is not set
201# CONFIG_OMAP_LL_DEBUG_UART2 is not set
202CONFIG_OMAP_LL_DEBUG_UART3=y
203CONFIG_OMAP_SERIAL_WAKE=y
204CONFIG_ARCH_OMAP34XX=y
205CONFIG_ARCH_OMAP3430=y
206
207#
208# OMAP Board Type
209#
210CONFIG_MACH_OMAP3_BEAGLE=y
211CONFIG_MACH_OMAP_LDP=y
212CONFIG_MACH_OVERO=y
213CONFIG_MACH_OMAP3_PANDORA=y
214CONFIG_MACH_OMAP_3430SDP=y
215
216#
217# Processor Type
218#
219CONFIG_CPU_32=y
220CONFIG_CPU_32v6K=y
221CONFIG_CPU_V7=y
222CONFIG_CPU_32v7=y
223CONFIG_CPU_ABRT_EV7=y
224CONFIG_CPU_PABRT_IFAR=y
225CONFIG_CPU_CACHE_V7=y
226CONFIG_CPU_CACHE_VIPT=y
227CONFIG_CPU_COPY_V6=y
228CONFIG_CPU_TLB_V7=y
229CONFIG_CPU_HAS_ASID=y
230CONFIG_CPU_CP15=y
231CONFIG_CPU_CP15_MMU=y
232
233#
234# Processor Features
235#
236CONFIG_ARM_THUMB=y
237CONFIG_ARM_THUMBEE=y
238# CONFIG_CPU_ICACHE_DISABLE is not set
239# CONFIG_CPU_DCACHE_DISABLE is not set
240# CONFIG_CPU_BPREDICT_DISABLE is not set
241CONFIG_HAS_TLS_REG=y
242# CONFIG_OUTER_CACHE is not set
243
244#
245# Bus support
246#
247# CONFIG_PCI_SYSCALL is not set
248# CONFIG_ARCH_SUPPORTS_MSI is not set
249# CONFIG_PCCARD is not set
250
251#
252# Kernel Features
253#
254CONFIG_TICK_ONESHOT=y
255CONFIG_NO_HZ=y
256CONFIG_HIGH_RES_TIMERS=y
257CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
258CONFIG_VMSPLIT_3G=y
259# CONFIG_VMSPLIT_2G is not set
260# CONFIG_VMSPLIT_1G is not set
261CONFIG_PAGE_OFFSET=0xC0000000
262# CONFIG_PREEMPT is not set
263CONFIG_HZ=128
264CONFIG_AEABI=y
265# CONFIG_OABI_COMPAT is not set
266CONFIG_ARCH_FLATMEM_HAS_HOLES=y
267# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
268# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
269CONFIG_SELECT_MEMORY_MODEL=y
270CONFIG_FLATMEM_MANUAL=y
271# CONFIG_DISCONTIGMEM_MANUAL is not set
272# CONFIG_SPARSEMEM_MANUAL is not set
273CONFIG_FLATMEM=y
274CONFIG_FLAT_NODE_MEM_MAP=y
275CONFIG_PAGEFLAGS_EXTENDED=y
276CONFIG_SPLIT_PTLOCK_CPUS=4
277# CONFIG_PHYS_ADDR_T_64BIT is not set
278CONFIG_ZONE_DMA_FLAG=0
279CONFIG_VIRT_TO_BUS=y
280CONFIG_UNEVICTABLE_LRU=y
281CONFIG_LEDS=y
282CONFIG_ALIGNMENT_TRAP=y
283
284#
285# Boot options
286#
287CONFIG_ZBOOT_ROM_TEXT=0x0
288CONFIG_ZBOOT_ROM_BSS=0x0
289CONFIG_CMDLINE="console=ttyS2,115200 root=/dev/mmcblk0p3 rootwait debug"
290# CONFIG_XIP_KERNEL is not set
291CONFIG_KEXEC=y
292CONFIG_ATAGS_PROC=y
293
294#
295# CPU Power Management
296#
297CONFIG_CPU_FREQ=y
298CONFIG_CPU_FREQ_TABLE=y
299# CONFIG_CPU_FREQ_DEBUG is not set
300CONFIG_CPU_FREQ_STAT=y
301CONFIG_CPU_FREQ_STAT_DETAILS=y
302CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
303# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
304# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
305# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
306# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
307CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
308# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
309CONFIG_CPU_FREQ_GOV_USERSPACE=y
310CONFIG_CPU_FREQ_GOV_ONDEMAND=y
311# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
312# CONFIG_CPU_IDLE is not set
313
314#
315# Floating point emulation
316#
317
318#
319# At least one emulation must be selected
320#
321CONFIG_VFP=y
322CONFIG_VFPv3=y
323CONFIG_NEON=y
324
325#
326# Userspace binary formats
327#
328CONFIG_BINFMT_ELF=y
329CONFIG_HAVE_AOUT=y
330CONFIG_BINFMT_AOUT=m
331CONFIG_BINFMT_MISC=y
332
333#
334# Power management options
335#
336CONFIG_PM=y
337# CONFIG_PM_DEBUG is not set
338CONFIG_PM_SLEEP=y
339CONFIG_SUSPEND=y
340CONFIG_SUSPEND_FREEZER=y
341# CONFIG_APM_EMULATION is not set
342CONFIG_ARCH_SUSPEND_POSSIBLE=y
343CONFIG_NET=y
344
345#
346# Networking options
347#
348CONFIG_COMPAT_NET_DEV_OPS=y
349CONFIG_PACKET=y
350CONFIG_PACKET_MMAP=y
351CONFIG_UNIX=y
352CONFIG_XFRM=y
353# CONFIG_XFRM_USER is not set
354# CONFIG_XFRM_SUB_POLICY is not set
355# CONFIG_XFRM_MIGRATE is not set
356# CONFIG_XFRM_STATISTICS is not set
357CONFIG_NET_KEY=y
358# CONFIG_NET_KEY_MIGRATE is not set
359CONFIG_INET=y
360# CONFIG_IP_MULTICAST is not set
361# CONFIG_IP_ADVANCED_ROUTER is not set
362CONFIG_IP_FIB_HASH=y
363CONFIG_IP_PNP=y
364CONFIG_IP_PNP_DHCP=y
365CONFIG_IP_PNP_BOOTP=y
366CONFIG_IP_PNP_RARP=y
367# CONFIG_NET_IPIP is not set
368# CONFIG_NET_IPGRE is not set
369# CONFIG_ARPD is not set
370# CONFIG_SYN_COOKIES is not set
371# CONFIG_INET_AH is not set
372# CONFIG_INET_ESP is not set
373# CONFIG_INET_IPCOMP is not set
374# CONFIG_INET_XFRM_TUNNEL is not set
375CONFIG_INET_TUNNEL=m
376CONFIG_INET_XFRM_MODE_TRANSPORT=y
377CONFIG_INET_XFRM_MODE_TUNNEL=y
378CONFIG_INET_XFRM_MODE_BEET=y
379# CONFIG_INET_LRO is not set
380CONFIG_INET_DIAG=y
381CONFIG_INET_TCP_DIAG=y
382# CONFIG_TCP_CONG_ADVANCED is not set
383CONFIG_TCP_CONG_CUBIC=y
384CONFIG_DEFAULT_TCP_CONG="cubic"
385# CONFIG_TCP_MD5SIG is not set
386CONFIG_IPV6=m
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
406# CONFIG_NETFILTER is not set
407# CONFIG_IP_DCCP is not set
408# CONFIG_IP_SCTP is not set
409# CONFIG_TIPC is not set
410# CONFIG_ATM is not set
411# CONFIG_BRIDGE is not set
412# CONFIG_NET_DSA is not set
413# CONFIG_VLAN_8021Q is not set
414# CONFIG_DECNET is not set
415# CONFIG_LLC2 is not set
416# CONFIG_IPX is not set
417# CONFIG_ATALK is not set
418# CONFIG_X25 is not set
419# CONFIG_LAPB is not set
420# CONFIG_ECONET is not set
421# CONFIG_WAN_ROUTER 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
432CONFIG_BT=y
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
456# CONFIG_PHONET 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
483# CONFIG_RFKILL is not set
484# CONFIG_NET_9P is not set
485
486#
487# Device Drivers
488#
489
490#
491# Generic Driver Options
492#
493CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
494CONFIG_STANDALONE=y
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
502# CONFIG_CONNECTOR is not set
503CONFIG_MTD=y
504# CONFIG_MTD_DEBUG is not set
505CONFIG_MTD_CONCAT=y
506CONFIG_MTD_PARTITIONS=y
507# CONFIG_MTD_TESTS is not set
508# CONFIG_MTD_REDBOOT_PARTS is not set
509# CONFIG_MTD_CMDLINE_PARTS is not set
510# CONFIG_MTD_AFS_PARTS is not set
511# CONFIG_MTD_AR7_PARTS is not set
512
513#
514# User Modules And Translation Layers
515#
516CONFIG_MTD_CHAR=y
517CONFIG_MTD_BLKDEVS=y
518CONFIG_MTD_BLOCK=y
519# CONFIG_FTL is not set
520# CONFIG_NFTL is not set
521# CONFIG_INFTL is not set
522# CONFIG_RFD_FTL is not set
523# CONFIG_SSFDC is not set
524# CONFIG_MTD_OOPS is not set
525
526#
527# RAM/ROM/Flash chip drivers
528#
529# CONFIG_MTD_CFI is not set
530# CONFIG_MTD_JEDECPROBE is not set
531CONFIG_MTD_MAP_BANK_WIDTH_1=y
532CONFIG_MTD_MAP_BANK_WIDTH_2=y
533CONFIG_MTD_MAP_BANK_WIDTH_4=y
534# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
535# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
536# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
537CONFIG_MTD_CFI_I1=y
538CONFIG_MTD_CFI_I2=y
539# CONFIG_MTD_CFI_I4 is not set
540# CONFIG_MTD_CFI_I8 is not set
541# CONFIG_MTD_RAM is not set
542# CONFIG_MTD_ROM is not set
543# CONFIG_MTD_ABSENT is not set
544
545#
546# Mapping drivers for chip access
547#
548# CONFIG_MTD_COMPLEX_MAPPINGS is not set
549# CONFIG_MTD_PLATRAM is not set
550
551#
552# Self-contained MTD device drivers
553#
554# CONFIG_MTD_DATAFLASH is not set
555# CONFIG_MTD_M25P80 is not set
556# CONFIG_MTD_SLRAM is not set
557# CONFIG_MTD_PHRAM is not set
558# CONFIG_MTD_MTDRAM is not set
559# CONFIG_MTD_BLOCK2MTD is not set
560
561#
562# Disk-On-Chip Device Drivers
563#
564# CONFIG_MTD_DOC2000 is not set
565# CONFIG_MTD_DOC2001 is not set
566# CONFIG_MTD_DOC2001PLUS is not set
567CONFIG_MTD_NAND=y
568# CONFIG_MTD_NAND_VERIFY_WRITE is not set
569# CONFIG_MTD_NAND_ECC_SMC is not set
570# CONFIG_MTD_NAND_MUSEUM_IDS is not set
571# CONFIG_MTD_NAND_GPIO is not set
572CONFIG_MTD_NAND_IDS=y
573# CONFIG_MTD_NAND_DISKONCHIP is not set
574# CONFIG_MTD_NAND_NANDSIM is not set
575# CONFIG_MTD_NAND_PLATFORM is not set
576# CONFIG_MTD_ALAUDA is not set
577# CONFIG_MTD_ONENAND is not set
578
579#
580# LPDDR flash memory drivers
581#
582# CONFIG_MTD_LPDDR is not set
583
584#
585# UBI - Unsorted block images
586#
587# CONFIG_MTD_UBI is not set
588# CONFIG_PARPORT is not set
589CONFIG_BLK_DEV=y
590# CONFIG_BLK_DEV_COW_COMMON is not set
591CONFIG_BLK_DEV_LOOP=y
592CONFIG_BLK_DEV_CRYPTOLOOP=m
593# CONFIG_BLK_DEV_NBD is not set
594# CONFIG_BLK_DEV_UB is not set
595CONFIG_BLK_DEV_RAM=y
596CONFIG_BLK_DEV_RAM_COUNT=16
597CONFIG_BLK_DEV_RAM_SIZE=16384
598# CONFIG_BLK_DEV_XIP is not set
599CONFIG_CDROM_PKTCDVD=m
600CONFIG_CDROM_PKTCDVD_BUFFERS=8
601# CONFIG_CDROM_PKTCDVD_WCACHE is not set
602# CONFIG_ATA_OVER_ETH is not set
603CONFIG_MISC_DEVICES=y
604# CONFIG_ICS932S401 is not set
605# CONFIG_ENCLOSURE_SERVICES is not set
606# CONFIG_C2PORT is not set
607
608#
609# EEPROM support
610#
611# CONFIG_EEPROM_AT24 is not set
612# CONFIG_EEPROM_AT25 is not set
613# CONFIG_EEPROM_LEGACY is not set
614CONFIG_EEPROM_93CX6=m
615CONFIG_HAVE_IDE=y
616# CONFIG_IDE is not set
617
618#
619# SCSI device support
620#
621CONFIG_RAID_ATTRS=m
622CONFIG_SCSI=y
623CONFIG_SCSI_DMA=y
624# CONFIG_SCSI_TGT is not set
625# CONFIG_SCSI_NETLINK is not set
626CONFIG_SCSI_PROC_FS=y
627
628#
629# SCSI support type (disk, tape, CD-ROM)
630#
631CONFIG_BLK_DEV_SD=y
632# CONFIG_CHR_DEV_ST is not set
633# CONFIG_CHR_DEV_OSST is not set
634# CONFIG_BLK_DEV_SR is not set
635CONFIG_CHR_DEV_SG=m
636# 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
642# CONFIG_SCSI_CONSTANTS is not set
643# CONFIG_SCSI_LOGGING is not set
644# CONFIG_SCSI_SCAN_ASYNC is not set
645CONFIG_SCSI_WAIT_SCAN=m
646
647#
648# SCSI Transports
649#
650# CONFIG_SCSI_SPI_ATTRS is not set
651# CONFIG_SCSI_FC_ATTRS is not set
652# CONFIG_SCSI_ISCSI_ATTRS is not set
653# CONFIG_SCSI_SAS_LIBSAS is not set
654# CONFIG_SCSI_SRP_ATTRS is not set
655CONFIG_SCSI_LOWLEVEL=y
656# CONFIG_ISCSI_TCP is not set
657# CONFIG_LIBFC is not set
658# CONFIG_SCSI_DEBUG is not set
659# CONFIG_SCSI_DH is not set
660# CONFIG_ATA is not set
661CONFIG_MD=y
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
681CONFIG_DUMMY=m
682# CONFIG_BONDING is not set
683# CONFIG_MACVLAN is not set
684# CONFIG_EQUALIZER is not set
685CONFIG_TUN=m
686# CONFIG_VETH is not set
687CONFIG_PHYLIB=y
688
689#
690# MII PHY device drivers
691#
692# CONFIG_MARVELL_PHY is not set
693# CONFIG_DAVICOM_PHY is not set
694# CONFIG_QSEMI_PHY is not set
695# CONFIG_LXT_PHY is not set
696# CONFIG_CICADA_PHY is not set
697# CONFIG_VITESSE_PHY is not set
698CONFIG_SMSC_PHY=y
699# CONFIG_BROADCOM_PHY is not set
700# CONFIG_ICPLUS_PHY is not set
701# CONFIG_REALTEK_PHY is not set
702# CONFIG_NATIONAL_PHY is not set
703# CONFIG_STE10XP is not set
704# CONFIG_LSI_ET1011C_PHY is not set
705# CONFIG_FIXED_PHY is not set
706# CONFIG_MDIO_BITBANG is not set
707CONFIG_NET_ETHERNET=y
708CONFIG_MII=y
709# CONFIG_AX88796 is not set
710CONFIG_SMC91X=y
711# CONFIG_DM9000 is not set
712# CONFIG_ENC28J60 is not set
713CONFIG_SMC911X=m
714CONFIG_SMSC911X=m
715# CONFIG_IBM_NEW_EMAC_ZMII is not set
716# CONFIG_IBM_NEW_EMAC_RGMII is not set
717# CONFIG_IBM_NEW_EMAC_TAH is not set
718# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
719# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
720# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
721# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
722# CONFIG_B44 is not set
723# CONFIG_NETDEV_1000 is not set
724# CONFIG_NETDEV_10000 is not set
725
726#
727# Wireless LAN
728#
729# CONFIG_WLAN_PRE80211 is not set
730CONFIG_WLAN_80211=y
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
751#
752# Enable WiMAX (Networking options) to see the WiMAX drivers
753#
754
755#
756# USB Network Adapters
757#
758CONFIG_USB_CATC=m
759CONFIG_USB_KAWETH=m
760CONFIG_USB_PEGASUS=m
761CONFIG_USB_RTL8150=m
762CONFIG_USB_USBNET=y
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
781CONFIG_PPP=m
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
792CONFIG_SLHC=m
793# CONFIG_NETCONSOLE is not set
794# CONFIG_NETPOLL is not set
795# CONFIG_NET_POLL_CONTROLLER is not set
796# CONFIG_ISDN is not set
797
798#
799# Input device support
800#
801CONFIG_INPUT=y
802# CONFIG_INPUT_FF_MEMLESS is not set
803# CONFIG_INPUT_POLLDEV is not set
804
805#
806# Userland interfaces
807#
808CONFIG_INPUT_MOUSEDEV=y
809CONFIG_INPUT_MOUSEDEV_PSAUX=y
810CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
811CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
812# CONFIG_INPUT_JOYDEV is not set
813CONFIG_INPUT_EVDEV=y
814# CONFIG_INPUT_EVBUG is not set
815
816#
817# Input Device Drivers
818#
819CONFIG_INPUT_KEYBOARD=y
820# CONFIG_KEYBOARD_ATKBD is not set
821# CONFIG_KEYBOARD_SUNKBD is not set
822# CONFIG_KEYBOARD_LKKBD is not set
823# CONFIG_KEYBOARD_XTKBD is not set
824# CONFIG_KEYBOARD_NEWTON is not set
825# CONFIG_KEYBOARD_STOWAWAY is not set
826# CONFIG_KEYBOARD_GPIO is not set
827CONFIG_INPUT_MOUSE=y
828CONFIG_MOUSE_PS2=y
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
841# CONFIG_INPUT_TABLET is not set
842# CONFIG_INPUT_TOUCHSCREEN is not set
843# CONFIG_INPUT_MISC is not set
844
845#
846# Hardware I/O ports
847#
848CONFIG_SERIO=y
849CONFIG_SERIO_SERPORT=y
850CONFIG_SERIO_LIBPS2=y
851# CONFIG_SERIO_RAW is not set
852# CONFIG_GAMEPORT is not set
853
854#
855# Character devices
856#
857CONFIG_VT=y
858CONFIG_CONSOLE_TRANSLATIONS=y
859CONFIG_VT_CONSOLE=y
860CONFIG_HW_CONSOLE=y
861CONFIG_VT_HW_CONSOLE_BINDING=y
862CONFIG_DEVKMEM=y
863# CONFIG_SERIAL_NONSTANDARD is not set
864
865#
866# Serial drivers
867#
868CONFIG_SERIAL_8250=y
869CONFIG_SERIAL_8250_CONSOLE=y
870CONFIG_SERIAL_8250_NR_UARTS=32
871CONFIG_SERIAL_8250_RUNTIME_UARTS=4
872CONFIG_SERIAL_8250_EXTENDED=y
873CONFIG_SERIAL_8250_MANY_PORTS=y
874CONFIG_SERIAL_8250_SHARE_IRQ=y
875CONFIG_SERIAL_8250_DETECT_IRQ=y
876CONFIG_SERIAL_8250_RSA=y
877
878#
879# Non-8250 serial port support
880#
881CONFIG_SERIAL_CORE=y
882CONFIG_SERIAL_CORE_CONSOLE=y
883CONFIG_UNIX98_PTYS=y
884# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
885# CONFIG_LEGACY_PTYS is not set
886# CONFIG_IPMI_HANDLER is not set
887CONFIG_HW_RANDOM=y
888# CONFIG_R3964 is not set
889# CONFIG_RAW_DRIVER is not set
890# CONFIG_TCG_TPM is not set
891CONFIG_I2C=y
892CONFIG_I2C_BOARDINFO=y
893CONFIG_I2C_CHARDEV=y
894CONFIG_I2C_HELPER_AUTO=y
895
896#
897# I2C Hardware Bus support
898#
899
900#
901# I2C system bus drivers (mostly embedded / system-on-chip)
902#
903# CONFIG_I2C_GPIO is not set
904# CONFIG_I2C_OCORES is not set
905CONFIG_I2C_OMAP=y
906# CONFIG_I2C_SIMTEC is not set
907
908#
909# External I2C/SMBus adapter drivers
910#
911# CONFIG_I2C_PARPORT_LIGHT is not set
912# CONFIG_I2C_TAOS_EVM is not set
913# CONFIG_I2C_TINY_USB is not set
914
915#
916# Other I2C/SMBus bus drivers
917#
918# CONFIG_I2C_PCA_PLATFORM is not set
919# CONFIG_I2C_STUB is not set
920
921#
922# Miscellaneous I2C Chip support
923#
924# CONFIG_DS1682 is not set
925# CONFIG_SENSORS_PCF8574 is not set
926# CONFIG_PCF8575 is not set
927# 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
931# CONFIG_I2C_DEBUG_CORE is not set
932# CONFIG_I2C_DEBUG_ALGO is not set
933# CONFIG_I2C_DEBUG_BUS is not set
934# CONFIG_I2C_DEBUG_CHIP is not set
935CONFIG_SPI=y
936# CONFIG_SPI_DEBUG is not set
937CONFIG_SPI_MASTER=y
938
939#
940# SPI Master Controller Drivers
941#
942# CONFIG_SPI_BITBANG is not set
943# CONFIG_SPI_GPIO is not set
944CONFIG_SPI_OMAP24XX=y
945
946#
947# SPI Protocol Masters
948#
949# CONFIG_SPI_SPIDEV is not set
950# CONFIG_SPI_TLE62X0 is not set
951CONFIG_ARCH_REQUIRE_GPIOLIB=y
952CONFIG_GPIOLIB=y
953CONFIG_DEBUG_GPIO=y
954CONFIG_GPIO_SYSFS=y
955
956#
957# Memory mapped GPIO expanders:
958#
959
960#
961# I2C GPIO expanders:
962#
963# CONFIG_GPIO_MAX732X is not set
964# CONFIG_GPIO_PCA953X is not set
965# CONFIG_GPIO_PCF857X is not set
966CONFIG_GPIO_TWL4030=y
967
968#
969# PCI GPIO expanders:
970#
971
972#
973# SPI GPIO expanders:
974#
975# CONFIG_GPIO_MAX7301 is not set
976# CONFIG_GPIO_MCP23S08 is not set
977# CONFIG_W1 is not set
978CONFIG_POWER_SUPPLY=m
979# CONFIG_POWER_SUPPLY_DEBUG 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
1041# CONFIG_THERMAL_HWMON is not set
1042CONFIG_WATCHDOG=y
1043CONFIG_WATCHDOG_NOWAYOUT=y
1044
1045#
1046# Watchdog Device Drivers
1047#
1048# CONFIG_SOFT_WATCHDOG is not set
1049# CONFIG_OMAP_WATCHDOG is not set
1050
1051#
1052# USB-based Watchdog Cards
1053#
1054# CONFIG_USBPCWATCHDOG is not set
1055CONFIG_SSB_POSSIBLE=y
1056
1057#
1058# Sonics Silicon Backplane
1059#
1060# CONFIG_SSB is not set
1061
1062#
1063# Multifunction device drivers
1064#
1065# CONFIG_MFD_CORE is not set
1066# CONFIG_MFD_SM501 is not set
1067# CONFIG_MFD_ASIC3 is not set
1068# CONFIG_HTC_EGPIO is not set
1069# CONFIG_HTC_PASIC3 is not set
1070# CONFIG_TPS65010 is not set
1071CONFIG_TWL4030_CORE=y
1072# CONFIG_MFD_TMIO is not set
1073# CONFIG_MFD_T7L66XB is not set
1074# CONFIG_MFD_TC6387XB is not set
1075# CONFIG_MFD_TC6393XB is not set
1076# CONFIG_PMIC_DA903X is not set
1077# CONFIG_MFD_WM8400 is not set
1078# CONFIG_MFD_WM8350_I2C is not set
1079# CONFIG_MFD_PCF50633 is not set
1080
1081#
1082# Multimedia devices
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
1312#
1313# Graphics support
1314#
1315# CONFIG_VGASTATE is not set
1316# CONFIG_VIDEO_OUTPUT_CONTROL is not set
1317# CONFIG_FB is not set
1318# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1319
1320#
1321# Display device support
1322#
1323CONFIG_DISPLAY_SUPPORT=y
1324
1325#
1326# Display hardware drivers
1327#
1328
1329#
1330# Console display driver support
1331#
1332# CONFIG_VGA_CONSOLE is not set
1333CONFIG_DUMMY_CONSOLE=y
1334CONFIG_SOUND=y
1335CONFIG_SOUND_OSS_CORE=y
1336CONFIG_SND=y
1337CONFIG_SND_TIMER=y
1338CONFIG_SND_PCM=y
1339CONFIG_SND_HWDEP=y
1340CONFIG_SND_RAWMIDI=y
1341CONFIG_SND_SEQUENCER=m
1342# CONFIG_SND_SEQ_DUMMY is not set
1343CONFIG_SND_OSSEMUL=y
1344CONFIG_SND_MIXER_OSS=y
1345CONFIG_SND_PCM_OSS=y
1346CONFIG_SND_PCM_OSS_PLUGINS=y
1347CONFIG_SND_SEQUENCER_OSS=y
1348# CONFIG_SND_HRTIMER is not set
1349# CONFIG_SND_DYNAMIC_MINORS is not set
1350CONFIG_SND_SUPPORT_OLD_API=y
1351CONFIG_SND_VERBOSE_PROCFS=y
1352CONFIG_SND_VERBOSE_PRINTK=y
1353CONFIG_SND_DEBUG=y
1354# CONFIG_SND_DEBUG_VERBOSE is not set
1355# CONFIG_SND_PCM_XRUN_DEBUG is not set
1356CONFIG_SND_DRIVERS=y
1357# CONFIG_SND_DUMMY is not set
1358# CONFIG_SND_VIRMIDI is not set
1359# CONFIG_SND_MTPAV is not set
1360# CONFIG_SND_SERIAL_U16550 is not set
1361# CONFIG_SND_MPU401 is not set
1362CONFIG_SND_ARM=y
1363CONFIG_SND_SPI=y
1364CONFIG_SND_USB=y
1365CONFIG_SND_USB_AUDIO=y
1366CONFIG_SND_USB_CAIAQ=m
1367CONFIG_SND_USB_CAIAQ_INPUT=y
1368CONFIG_SND_SOC=y
1369CONFIG_SND_OMAP_SOC=y
1370CONFIG_SND_OMAP_SOC_MCBSP=y
1371# CONFIG_SND_OMAP_SOC_OVERO is not set
1372CONFIG_SND_OMAP_SOC_SDP3430=y
1373CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y
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
1380CONFIG_HID_DEBUG=y
1381# CONFIG_HIDRAW is not set
1382
1383#
1384# USB Input Devices
1385#
1386CONFIG_USB_HID=y
1387# CONFIG_HID_PID is not set
1388# CONFIG_USB_HIDDEV is not set
1389
1390#
1391# Special HID drivers
1392#
1393CONFIG_HID_COMPAT=y
1394CONFIG_HID_A4TECH=y
1395CONFIG_HID_APPLE=y
1396CONFIG_HID_BELKIN=y
1397CONFIG_HID_CHERRY=y
1398CONFIG_HID_CHICONY=y
1399CONFIG_HID_CYPRESS=y
1400CONFIG_HID_EZKEY=y
1401CONFIG_HID_GYRATION=y
1402CONFIG_HID_LOGITECH=y
1403# CONFIG_LOGITECH_FF is not set
1404# CONFIG_LOGIRUMBLEPAD2_FF is not set
1405CONFIG_HID_MICROSOFT=y
1406CONFIG_HID_MONTEREY=y
1407# CONFIG_HID_NTRIG is not set
1408CONFIG_HID_PANTHERLORD=y
1409# CONFIG_PANTHERLORD_FF is not set
1410CONFIG_HID_PETALYNX=y
1411CONFIG_HID_SAMSUNG=y
1412CONFIG_HID_SONY=y
1413CONFIG_HID_SUNPLUS=y
1414# CONFIG_GREENASIA_FF is not set
1415# CONFIG_HID_TOPSEED is not set
1416# CONFIG_THRUSTMASTER_FF is not set
1417# CONFIG_ZEROPLUS_FF is not set
1418CONFIG_USB_SUPPORT=y
1419CONFIG_USB_ARCH_HAS_HCD=y
1420CONFIG_USB_ARCH_HAS_OHCI=y
1421# CONFIG_USB_ARCH_HAS_EHCI is not set
1422CONFIG_USB=y
1423CONFIG_USB_DEBUG=y
1424CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1425
1426#
1427# Miscellaneous USB options
1428#
1429CONFIG_USB_DEVICEFS=y
1430CONFIG_USB_DEVICE_CLASS=y
1431CONFIG_USB_DYNAMIC_MINORS=y
1432CONFIG_USB_SUSPEND=y
1433CONFIG_USB_OTG=y
1434# CONFIG_USB_OTG_WHITELIST is not set
1435# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1436CONFIG_USB_MON=y
1437# CONFIG_USB_WUSB is not set
1438# CONFIG_USB_WUSB_CBAF is not set
1439
1440#
1441# USB Host Controller Drivers
1442#
1443# CONFIG_USB_C67X00_HCD is not set
1444# CONFIG_USB_OXU210HP_HCD is not set
1445# CONFIG_USB_ISP116X_HCD is not set
1446# CONFIG_USB_OHCI_HCD is not set
1447# CONFIG_USB_SL811_HCD is not set
1448# CONFIG_USB_R8A66597_HCD is not set
1449# CONFIG_USB_HWA_HCD is not set
1450CONFIG_USB_MUSB_HDRC=y
1451CONFIG_USB_MUSB_SOC=y
1452
1453#
1454# OMAP 343x high speed USB support
1455#
1456# CONFIG_USB_MUSB_HOST is not set
1457# CONFIG_USB_MUSB_PERIPHERAL is not set
1458CONFIG_USB_MUSB_OTG=y
1459CONFIG_USB_GADGET_MUSB_HDRC=y
1460CONFIG_USB_MUSB_HDRC_HCD=y
1461CONFIG_MUSB_PIO_ONLY=y
1462# CONFIG_USB_MUSB_DEBUG is not set
1463
1464#
1465# USB Device Class drivers
1466#
1467# CONFIG_USB_ACM is not set
1468CONFIG_USB_PRINTER=y
1469CONFIG_USB_WDM=y
1470# CONFIG_USB_TMC is not set
1471
1472#
1473# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1474#
1475
1476#
1477# see USB_STORAGE Help for more information
1478#
1479CONFIG_USB_STORAGE=y
1480# CONFIG_USB_STORAGE_DEBUG is not set
1481# CONFIG_USB_STORAGE_DATAFAB is not set
1482# CONFIG_USB_STORAGE_FREECOM is not set
1483# CONFIG_USB_STORAGE_ISD200 is not set
1484# CONFIG_USB_STORAGE_USBAT is not set
1485# CONFIG_USB_STORAGE_SDDR09 is not set
1486# CONFIG_USB_STORAGE_SDDR55 is not set
1487# CONFIG_USB_STORAGE_JUMPSHOT is not set
1488# CONFIG_USB_STORAGE_ALAUDA is not set
1489# CONFIG_USB_STORAGE_ONETOUCH is not set
1490# CONFIG_USB_STORAGE_KARMA is not set
1491# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1492# CONFIG_USB_LIBUSUAL is not set
1493
1494#
1495# USB Imaging devices
1496#
1497# CONFIG_USB_MDC800 is not set
1498# CONFIG_USB_MICROTEK is not set
1499
1500#
1501# USB port drivers
1502#
1503# CONFIG_USB_SERIAL is not set
1504
1505#
1506# USB Miscellaneous drivers
1507#
1508# CONFIG_USB_EMI62 is not set
1509# CONFIG_USB_EMI26 is not set
1510# CONFIG_USB_ADUTUX is not set
1511# CONFIG_USB_SEVSEG is not set
1512# CONFIG_USB_RIO500 is not set
1513# CONFIG_USB_LEGOTOWER is not set
1514# CONFIG_USB_LCD is not set
1515# CONFIG_USB_BERRY_CHARGE is not set
1516# CONFIG_USB_LED is not set
1517# CONFIG_USB_CYPRESS_CY7C63 is not set
1518# CONFIG_USB_CYTHERM is not set
1519# CONFIG_USB_PHIDGET is not set
1520# CONFIG_USB_IDMOUSE is not set
1521# CONFIG_USB_FTDI_ELAN is not set
1522# CONFIG_USB_APPLEDISPLAY is not set
1523# CONFIG_USB_LD is not set
1524# CONFIG_USB_TRANCEVIBRATOR is not set
1525# CONFIG_USB_IOWARRIOR is not set
1526# CONFIG_USB_TEST is not set
1527# CONFIG_USB_ISIGHTFW is not set
1528# CONFIG_USB_VST is not set
1529CONFIG_USB_GADGET=y
1530# CONFIG_USB_GADGET_DEBUG is not set
1531# CONFIG_USB_GADGET_DEBUG_FILES is not set
1532# CONFIG_USB_GADGET_DEBUG_FS is not set
1533CONFIG_USB_GADGET_VBUS_DRAW=2
1534CONFIG_USB_GADGET_SELECTED=y
1535# CONFIG_USB_GADGET_AT91 is not set
1536# CONFIG_USB_GADGET_ATMEL_USBA is not set
1537# CONFIG_USB_GADGET_FSL_USB2 is not set
1538# CONFIG_USB_GADGET_LH7A40X is not set
1539# CONFIG_USB_GADGET_OMAP is not set
1540# CONFIG_USB_GADGET_PXA25X is not set
1541# CONFIG_USB_GADGET_PXA27X is not set
1542# CONFIG_USB_GADGET_S3C2410 is not set
1543# CONFIG_USB_GADGET_IMX is not set
1544# CONFIG_USB_GADGET_M66592 is not set
1545# CONFIG_USB_GADGET_AMD5536UDC is not set
1546# CONFIG_USB_GADGET_FSL_QE is not set
1547# CONFIG_USB_GADGET_CI13XXX is not set
1548# CONFIG_USB_GADGET_NET2280 is not set
1549# CONFIG_USB_GADGET_GOKU is not set
1550# CONFIG_USB_GADGET_DUMMY_HCD is not set
1551CONFIG_USB_GADGET_DUALSPEED=y
1552# CONFIG_USB_ZERO is not set
1553CONFIG_USB_ETH=y
1554CONFIG_USB_ETH_RNDIS=y
1555# CONFIG_USB_GADGETFS is not set
1556# CONFIG_USB_FILE_STORAGE is not set
1557# CONFIG_USB_G_SERIAL is not set
1558# CONFIG_USB_MIDI_GADGET is not set
1559# CONFIG_USB_G_PRINTER is not set
1560# CONFIG_USB_CDC_COMPOSITE is not set
1561
1562#
1563# OTG and related infrastructure
1564#
1565CONFIG_USB_OTG_UTILS=y
1566# CONFIG_USB_GPIO_VBUS is not set
1567# CONFIG_ISP1301_OMAP is not set
1568CONFIG_TWL4030_USB=y
1569CONFIG_MMC=y
1570# CONFIG_MMC_DEBUG is not set
1571CONFIG_MMC_UNSAFE_RESUME=y
1572
1573#
1574# MMC/SD/SDIO Card Drivers
1575#
1576CONFIG_MMC_BLOCK=y
1577CONFIG_MMC_BLOCK_BOUNCE=y
1578CONFIG_SDIO_UART=y
1579# CONFIG_MMC_TEST is not set
1580
1581#
1582# MMC/SD/SDIO Host Controller Drivers
1583#
1584# CONFIG_MMC_SDHCI is not set
1585# CONFIG_MMC_OMAP is not set
1586CONFIG_MMC_OMAP_HS=y
1587# CONFIG_MMC_SPI is not set
1588# CONFIG_MEMSTICK is not set
1589# CONFIG_ACCESSIBILITY is not set
1590CONFIG_NEW_LEDS=y
1591CONFIG_LEDS_CLASS=y
1592
1593#
1594# LED drivers
1595#
1596# CONFIG_LEDS_PCA9532 is not set
1597CONFIG_LEDS_GPIO=y
1598# CONFIG_LEDS_PCA955X is not set
1599
1600#
1601# LED Triggers
1602#
1603CONFIG_LEDS_TRIGGERS=y
1604CONFIG_LEDS_TRIGGER_TIMER=y
1605CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1606# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1607# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1608CONFIG_RTC_LIB=y
1609CONFIG_RTC_CLASS=y
1610CONFIG_RTC_HCTOSYS=y
1611CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1612# CONFIG_RTC_DEBUG is not set
1613
1614#
1615# RTC interfaces
1616#
1617CONFIG_RTC_INTF_SYSFS=y
1618CONFIG_RTC_INTF_PROC=y
1619CONFIG_RTC_INTF_DEV=y
1620# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1621# CONFIG_RTC_DRV_TEST is not set
1622
1623#
1624# I2C RTC drivers
1625#
1626# CONFIG_RTC_DRV_DS1307 is not set
1627# CONFIG_RTC_DRV_DS1374 is not set
1628# CONFIG_RTC_DRV_DS1672 is not set
1629# CONFIG_RTC_DRV_MAX6900 is not set
1630# CONFIG_RTC_DRV_RS5C372 is not set
1631# CONFIG_RTC_DRV_ISL1208 is not set
1632# CONFIG_RTC_DRV_X1205 is not set
1633# CONFIG_RTC_DRV_PCF8563 is not set
1634# CONFIG_RTC_DRV_PCF8583 is not set
1635# CONFIG_RTC_DRV_M41T80 is not set
1636CONFIG_RTC_DRV_TWL4030=y
1637# CONFIG_RTC_DRV_S35390A is not set
1638# CONFIG_RTC_DRV_FM3130 is not set
1639# CONFIG_RTC_DRV_RX8581 is not set
1640
1641#
1642# SPI RTC drivers
1643#
1644# CONFIG_RTC_DRV_M41T94 is not set
1645# CONFIG_RTC_DRV_DS1305 is not set
1646# CONFIG_RTC_DRV_DS1390 is not set
1647# CONFIG_RTC_DRV_MAX6902 is not set
1648# CONFIG_RTC_DRV_R9701 is not set
1649# CONFIG_RTC_DRV_RS5C348 is not set
1650# CONFIG_RTC_DRV_DS3234 is not set
1651
1652#
1653# Platform RTC drivers
1654#
1655# CONFIG_RTC_DRV_CMOS is not set
1656# CONFIG_RTC_DRV_DS1286 is not set
1657# CONFIG_RTC_DRV_DS1511 is not set
1658# CONFIG_RTC_DRV_DS1553 is not set
1659# CONFIG_RTC_DRV_DS1742 is not set
1660# CONFIG_RTC_DRV_STK17TA8 is not set
1661# CONFIG_RTC_DRV_M48T86 is not set
1662# CONFIG_RTC_DRV_M48T35 is not set
1663# CONFIG_RTC_DRV_M48T59 is not set
1664# CONFIG_RTC_DRV_BQ4802 is not set
1665# CONFIG_RTC_DRV_V3020 is not set
1666
1667#
1668# on-CPU RTC drivers
1669#
1670# CONFIG_DMADEVICES is not set
1671# CONFIG_REGULATOR is not set
1672# CONFIG_UIO is not set
1673# CONFIG_STAGING is not set
1674
1675#
1676# File systems
1677#
1678CONFIG_EXT2_FS=y
1679# CONFIG_EXT2_FS_XATTR is not set
1680# CONFIG_EXT2_FS_XIP is not set
1681CONFIG_EXT3_FS=y
1682# CONFIG_EXT3_FS_XATTR is not set
1683# CONFIG_EXT4_FS is not set
1684CONFIG_JBD=y
1685# CONFIG_JBD_DEBUG is not set
1686# CONFIG_REISERFS_FS is not set
1687# CONFIG_JFS_FS is not set
1688CONFIG_FS_POSIX_ACL=y
1689CONFIG_FILE_LOCKING=y
1690CONFIG_XFS_FS=m
1691# CONFIG_XFS_QUOTA is not set
1692# CONFIG_XFS_POSIX_ACL is not set
1693# CONFIG_XFS_RT is not set
1694# CONFIG_XFS_DEBUG is not set
1695# CONFIG_GFS2_FS is not set
1696# CONFIG_OCFS2_FS is not set
1697# CONFIG_BTRFS_FS is not set
1698CONFIG_DNOTIFY=y
1699CONFIG_INOTIFY=y
1700CONFIG_INOTIFY_USER=y
1701CONFIG_QUOTA=y
1702# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1703CONFIG_PRINT_QUOTA_WARNING=y
1704CONFIG_QUOTA_TREE=y
1705# CONFIG_QFMT_V1 is not set
1706CONFIG_QFMT_V2=y
1707CONFIG_QUOTACTL=y
1708# CONFIG_AUTOFS_FS is not set
1709# CONFIG_AUTOFS4_FS is not set
1710CONFIG_FUSE_FS=m
1711
1712#
1713# CD-ROM/DVD Filesystems
1714#
1715CONFIG_ISO9660_FS=m
1716CONFIG_JOLIET=y
1717CONFIG_ZISOFS=y
1718CONFIG_UDF_FS=m
1719CONFIG_UDF_NLS=y
1720
1721#
1722# DOS/FAT/NT Filesystems
1723#
1724CONFIG_FAT_FS=y
1725CONFIG_MSDOS_FS=y
1726CONFIG_VFAT_FS=y
1727CONFIG_FAT_DEFAULT_CODEPAGE=437
1728CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1729# CONFIG_NTFS_FS is not set
1730
1731#
1732# Pseudo filesystems
1733#
1734CONFIG_PROC_FS=y
1735CONFIG_PROC_SYSCTL=y
1736CONFIG_PROC_PAGE_MONITOR=y
1737CONFIG_SYSFS=y
1738CONFIG_TMPFS=y
1739# CONFIG_TMPFS_POSIX_ACL is not set
1740# CONFIG_HUGETLB_PAGE is not set
1741# CONFIG_CONFIGFS_FS is not set
1742CONFIG_MISC_FILESYSTEMS=y
1743# CONFIG_ADFS_FS is not set
1744# CONFIG_AFFS_FS is not set
1745# CONFIG_HFS_FS is not set
1746# CONFIG_HFSPLUS_FS is not set
1747# CONFIG_BEFS_FS is not set
1748# CONFIG_BFS_FS is not set
1749# CONFIG_EFS_FS is not set
1750CONFIG_JFFS2_FS=y
1751CONFIG_JFFS2_FS_DEBUG=0
1752CONFIG_JFFS2_FS_WRITEBUFFER=y
1753# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1754CONFIG_JFFS2_SUMMARY=y
1755CONFIG_JFFS2_FS_XATTR=y
1756CONFIG_JFFS2_FS_POSIX_ACL=y
1757CONFIG_JFFS2_FS_SECURITY=y
1758CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1759CONFIG_JFFS2_ZLIB=y
1760CONFIG_JFFS2_LZO=y
1761CONFIG_JFFS2_RTIME=y
1762CONFIG_JFFS2_RUBIN=y
1763# CONFIG_JFFS2_CMODE_NONE is not set
1764CONFIG_JFFS2_CMODE_PRIORITY=y
1765# CONFIG_JFFS2_CMODE_SIZE is not set
1766# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1767# CONFIG_CRAMFS is not set
1768# CONFIG_SQUASHFS is not set
1769# CONFIG_VXFS_FS is not set
1770# CONFIG_MINIX_FS is not set
1771# CONFIG_OMFS_FS is not set
1772# CONFIG_HPFS_FS is not set
1773# CONFIG_QNX4FS_FS is not set
1774# CONFIG_ROMFS_FS is not set
1775# CONFIG_SYSV_FS is not set
1776# CONFIG_UFS_FS is not set
1777CONFIG_NETWORK_FILESYSTEMS=y
1778CONFIG_NFS_FS=y
1779CONFIG_NFS_V3=y
1780# CONFIG_NFS_V3_ACL is not set
1781CONFIG_NFS_V4=y
1782CONFIG_ROOT_NFS=y
1783# CONFIG_NFSD is not set
1784CONFIG_LOCKD=y
1785CONFIG_LOCKD_V4=y
1786CONFIG_EXPORTFS=m
1787CONFIG_NFS_COMMON=y
1788CONFIG_SUNRPC=y
1789CONFIG_SUNRPC_GSS=y
1790# CONFIG_SUNRPC_REGISTER_V4 is not set
1791CONFIG_RPCSEC_GSS_KRB5=y
1792# CONFIG_RPCSEC_GSS_SPKM3 is not set
1793# CONFIG_SMB_FS is not set
1794# CONFIG_CIFS is not set
1795# CONFIG_NCP_FS is not set
1796# CONFIG_CODA_FS is not set
1797# CONFIG_AFS_FS is not set
1798
1799#
1800# Partition Types
1801#
1802CONFIG_PARTITION_ADVANCED=y
1803# CONFIG_ACORN_PARTITION is not set
1804# CONFIG_OSF_PARTITION is not set
1805# CONFIG_AMIGA_PARTITION is not set
1806# CONFIG_ATARI_PARTITION is not set
1807# CONFIG_MAC_PARTITION is not set
1808CONFIG_MSDOS_PARTITION=y
1809# CONFIG_BSD_DISKLABEL is not set
1810# CONFIG_MINIX_SUBPARTITION is not set
1811# CONFIG_SOLARIS_X86_PARTITION is not set
1812# CONFIG_UNIXWARE_DISKLABEL is not set
1813# CONFIG_LDM_PARTITION is not set
1814# CONFIG_SGI_PARTITION is not set
1815# CONFIG_ULTRIX_PARTITION is not set
1816# CONFIG_SUN_PARTITION is not set
1817# CONFIG_KARMA_PARTITION is not set
1818# CONFIG_EFI_PARTITION is not set
1819# CONFIG_SYSV68_PARTITION is not set
1820CONFIG_NLS=y
1821CONFIG_NLS_DEFAULT="iso8859-1"
1822CONFIG_NLS_CODEPAGE_437=y
1823# CONFIG_NLS_CODEPAGE_737 is not set
1824# CONFIG_NLS_CODEPAGE_775 is not set
1825# CONFIG_NLS_CODEPAGE_850 is not set
1826# CONFIG_NLS_CODEPAGE_852 is not set
1827# CONFIG_NLS_CODEPAGE_855 is not set
1828# CONFIG_NLS_CODEPAGE_857 is not set
1829# CONFIG_NLS_CODEPAGE_860 is not set
1830# CONFIG_NLS_CODEPAGE_861 is not set
1831# CONFIG_NLS_CODEPAGE_862 is not set
1832# CONFIG_NLS_CODEPAGE_863 is not set
1833# CONFIG_NLS_CODEPAGE_864 is not set
1834# CONFIG_NLS_CODEPAGE_865 is not set
1835# CONFIG_NLS_CODEPAGE_866 is not set
1836# CONFIG_NLS_CODEPAGE_869 is not set
1837# CONFIG_NLS_CODEPAGE_936 is not set
1838# CONFIG_NLS_CODEPAGE_950 is not set
1839# CONFIG_NLS_CODEPAGE_932 is not set
1840# CONFIG_NLS_CODEPAGE_949 is not set
1841# CONFIG_NLS_CODEPAGE_874 is not set
1842# CONFIG_NLS_ISO8859_8 is not set
1843# CONFIG_NLS_CODEPAGE_1250 is not set
1844# CONFIG_NLS_CODEPAGE_1251 is not set
1845# CONFIG_NLS_ASCII is not set
1846CONFIG_NLS_ISO8859_1=y
1847# CONFIG_NLS_ISO8859_2 is not set
1848# CONFIG_NLS_ISO8859_3 is not set
1849# CONFIG_NLS_ISO8859_4 is not set
1850# CONFIG_NLS_ISO8859_5 is not set
1851# CONFIG_NLS_ISO8859_6 is not set
1852# CONFIG_NLS_ISO8859_7 is not set
1853# CONFIG_NLS_ISO8859_9 is not set
1854# CONFIG_NLS_ISO8859_13 is not set
1855# CONFIG_NLS_ISO8859_14 is not set
1856# CONFIG_NLS_ISO8859_15 is not set
1857# CONFIG_NLS_KOI8_R is not set
1858# CONFIG_NLS_KOI8_U is not set
1859# CONFIG_NLS_UTF8 is not set
1860# CONFIG_DLM is not set
1861
1862#
1863# Kernel hacking
1864#
1865# CONFIG_PRINTK_TIME is not set
1866CONFIG_ENABLE_WARN_DEPRECATED=y
1867CONFIG_ENABLE_MUST_CHECK=y
1868CONFIG_FRAME_WARN=1024
1869CONFIG_MAGIC_SYSRQ=y
1870# CONFIG_UNUSED_SYMBOLS is not set
1871CONFIG_DEBUG_FS=y
1872# CONFIG_HEADERS_CHECK is not set
1873CONFIG_DEBUG_KERNEL=y
1874# CONFIG_DEBUG_SHIRQ is not set
1875CONFIG_DETECT_SOFTLOCKUP=y
1876# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1877CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1878CONFIG_SCHED_DEBUG=y
1879CONFIG_SCHEDSTATS=y
1880CONFIG_TIMER_STATS=y
1881# CONFIG_DEBUG_OBJECTS is not set
1882# CONFIG_SLUB_DEBUG_ON is not set
1883# CONFIG_SLUB_STATS is not set
1884# CONFIG_DEBUG_RT_MUTEXES is not set
1885# CONFIG_RT_MUTEX_TESTER is not set
1886# CONFIG_DEBUG_SPINLOCK is not set
1887CONFIG_DEBUG_MUTEXES=y
1888# CONFIG_DEBUG_LOCK_ALLOC is not set
1889# CONFIG_PROVE_LOCKING is not set
1890# CONFIG_LOCK_STAT is not set
1891# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1892# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1893CONFIG_STACKTRACE=y
1894# CONFIG_DEBUG_KOBJECT is not set
1895# CONFIG_DEBUG_BUGVERBOSE is not set
1896# CONFIG_DEBUG_INFO is not set
1897# CONFIG_DEBUG_VM is not set
1898# CONFIG_DEBUG_WRITECOUNT is not set
1899# CONFIG_DEBUG_MEMORY_INIT is not set
1900# CONFIG_DEBUG_LIST is not set
1901# CONFIG_DEBUG_SG is not set
1902# CONFIG_DEBUG_NOTIFIERS is not set
1903CONFIG_FRAME_POINTER=y
1904# CONFIG_BOOT_PRINTK_DELAY is not set
1905# CONFIG_RCU_TORTURE_TEST is not set
1906# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1907# CONFIG_BACKTRACE_SELF_TEST is not set
1908# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1909# CONFIG_FAULT_INJECTION is not set
1910# CONFIG_LATENCYTOP is not set
1911CONFIG_NOP_TRACER=y
1912CONFIG_HAVE_FUNCTION_TRACER=y
1913CONFIG_RING_BUFFER=y
1914CONFIG_TRACING=y
1915
1916#
1917# Tracers
1918#
1919# CONFIG_FUNCTION_TRACER is not set
1920# CONFIG_IRQSOFF_TRACER is not set
1921# CONFIG_SCHED_TRACER is not set
1922# CONFIG_CONTEXT_SWITCH_TRACER is not set
1923# CONFIG_BOOT_TRACER is not set
1924# CONFIG_TRACE_BRANCH_PROFILING is not set
1925# CONFIG_STACK_TRACER is not set
1926# CONFIG_FTRACE_STARTUP_TEST is not set
1927# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1928# CONFIG_SAMPLES is not set
1929CONFIG_HAVE_ARCH_KGDB=y
1930# CONFIG_KGDB is not set
1931# CONFIG_DEBUG_USER is not set
1932# CONFIG_DEBUG_ERRORS is not set
1933# CONFIG_DEBUG_STACK_USAGE is not set
1934# CONFIG_DEBUG_LL is not set
1935
1936#
1937# Security options
1938#
1939# CONFIG_KEYS is not set
1940# CONFIG_SECURITY is not set
1941# CONFIG_SECURITYFS is not set
1942# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1943CONFIG_XOR_BLOCKS=m
1944CONFIG_ASYNC_CORE=m
1945CONFIG_ASYNC_MEMCPY=m
1946CONFIG_ASYNC_XOR=m
1947CONFIG_CRYPTO=y
1948
1949#
1950# Crypto core or helper
1951#
1952# CONFIG_CRYPTO_FIPS is not set
1953CONFIG_CRYPTO_ALGAPI=y
1954CONFIG_CRYPTO_ALGAPI2=y
1955CONFIG_CRYPTO_AEAD2=y
1956CONFIG_CRYPTO_BLKCIPHER=y
1957CONFIG_CRYPTO_BLKCIPHER2=y
1958CONFIG_CRYPTO_HASH=y
1959CONFIG_CRYPTO_HASH2=y
1960CONFIG_CRYPTO_RNG2=y
1961CONFIG_CRYPTO_MANAGER=y
1962CONFIG_CRYPTO_MANAGER2=y
1963CONFIG_CRYPTO_GF128MUL=m
1964CONFIG_CRYPTO_NULL=m
1965CONFIG_CRYPTO_CRYPTD=m
1966# CONFIG_CRYPTO_AUTHENC is not set
1967CONFIG_CRYPTO_TEST=m
1968
1969#
1970# Authenticated Encryption with Associated Data
1971#
1972# CONFIG_CRYPTO_CCM is not set
1973# CONFIG_CRYPTO_GCM is not set
1974# CONFIG_CRYPTO_SEQIV is not set
1975
1976#
1977# Block modes
1978#
1979CONFIG_CRYPTO_CBC=y
1980# CONFIG_CRYPTO_CTR is not set
1981# CONFIG_CRYPTO_CTS is not set
1982CONFIG_CRYPTO_ECB=y
1983CONFIG_CRYPTO_LRW=m
1984CONFIG_CRYPTO_PCBC=m
1985# CONFIG_CRYPTO_XTS is not set
1986
1987#
1988# Hash modes
1989#
1990CONFIG_CRYPTO_HMAC=m
1991CONFIG_CRYPTO_XCBC=m
1992
1993#
1994# Digest
1995#
1996CONFIG_CRYPTO_CRC32C=y
1997CONFIG_CRYPTO_MD4=m
1998CONFIG_CRYPTO_MD5=y
1999CONFIG_CRYPTO_MICHAEL_MIC=y
2000# CONFIG_CRYPTO_RMD128 is not set
2001# CONFIG_CRYPTO_RMD160 is not set
2002# CONFIG_CRYPTO_RMD256 is not set
2003# CONFIG_CRYPTO_RMD320 is not set
2004CONFIG_CRYPTO_SHA1=m
2005CONFIG_CRYPTO_SHA256=m
2006CONFIG_CRYPTO_SHA512=m
2007CONFIG_CRYPTO_TGR192=m
2008CONFIG_CRYPTO_WP512=m
2009
2010#
2011# Ciphers
2012#
2013CONFIG_CRYPTO_AES=y
2014CONFIG_CRYPTO_ANUBIS=m
2015CONFIG_CRYPTO_ARC4=y
2016CONFIG_CRYPTO_BLOWFISH=m
2017CONFIG_CRYPTO_CAMELLIA=m
2018CONFIG_CRYPTO_CAST5=m
2019CONFIG_CRYPTO_CAST6=m
2020CONFIG_CRYPTO_DES=y
2021CONFIG_CRYPTO_FCRYPT=m
2022CONFIG_CRYPTO_KHAZAD=m
2023# CONFIG_CRYPTO_SALSA20 is not set
2024# CONFIG_CRYPTO_SEED is not set
2025CONFIG_CRYPTO_SERPENT=m
2026CONFIG_CRYPTO_TEA=m
2027CONFIG_CRYPTO_TWOFISH=m
2028CONFIG_CRYPTO_TWOFISH_COMMON=m
2029
2030#
2031# Compression
2032#
2033CONFIG_CRYPTO_DEFLATE=m
2034# CONFIG_CRYPTO_LZO is not set
2035
2036#
2037# Random Number Generation
2038#
2039# CONFIG_CRYPTO_ANSI_CPRNG is not set
2040CONFIG_CRYPTO_HW=y
2041
2042#
2043# Library routines
2044#
2045CONFIG_BITREVERSE=y
2046CONFIG_GENERIC_FIND_LAST_BIT=y
2047CONFIG_CRC_CCITT=y
2048CONFIG_CRC16=m
2049CONFIG_CRC_T10DIF=y
2050CONFIG_CRC_ITU_T=y
2051CONFIG_CRC32=y
2052CONFIG_CRC7=y
2053CONFIG_LIBCRC32C=y
2054CONFIG_ZLIB_INFLATE=y
2055CONFIG_ZLIB_DEFLATE=y
2056CONFIG_LZO_COMPRESS=y
2057CONFIG_LZO_DECOMPRESS=y
2058CONFIG_PLIST=y
2059CONFIG_HAS_IOMEM=y
2060CONFIG_HAS_IOPORT=y
2061CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index a8ee6984a09e..020e6a8a9e5c 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -481,7 +481,7 @@ CONFIG_MTD_NAND_IDS=y
481# CONFIG_MTD_NAND_DISKONCHIP is not set 481# CONFIG_MTD_NAND_DISKONCHIP is not set
482# CONFIG_MTD_NAND_CAFE is not set 482# CONFIG_MTD_NAND_CAFE is not set
483# CONFIG_MTD_NAND_NANDSIM is not set 483# CONFIG_MTD_NAND_NANDSIM is not set
484# CONFIG_MTD_NAND_PLATFORM is not set 484CONFIG_MTD_NAND_PLATFORM=y
485# CONFIG_MTD_ALAUDA is not set 485# CONFIG_MTD_ALAUDA is not set
486CONFIG_MTD_NAND_ORION=y 486CONFIG_MTD_NAND_ORION=y
487# CONFIG_MTD_ONENAND is not set 487# CONFIG_MTD_ONENAND is not set
@@ -1177,7 +1177,7 @@ CONFIG_RTC_DRV_S35390A=y
1177# CONFIG_RTC_DRV_DS1553 is not set 1177# CONFIG_RTC_DRV_DS1553 is not set
1178# CONFIG_RTC_DRV_DS1742 is not set 1178# CONFIG_RTC_DRV_DS1742 is not set
1179# CONFIG_RTC_DRV_STK17TA8 is not set 1179# CONFIG_RTC_DRV_STK17TA8 is not set
1180# CONFIG_RTC_DRV_M48T86 is not set 1180CONFIG_RTC_DRV_M48T86=y
1181# CONFIG_RTC_DRV_M48T59 is not set 1181# CONFIG_RTC_DRV_M48T59 is not set
1182# CONFIG_RTC_DRV_V3020 is not set 1182# CONFIG_RTC_DRV_V3020 is not set
1183 1183
diff --git a/arch/arm/configs/pleb_defconfig b/arch/arm/configs/pleb_defconfig
index a6b47ea8e465..f2d2dda25949 100644
--- a/arch/arm/configs/pleb_defconfig
+++ b/arch/arm/configs/pleb_defconfig
@@ -88,7 +88,6 @@ CONFIG_ARCH_SA1100=y
88# CONFIG_SA1100_COLLIE is not set 88# CONFIG_SA1100_COLLIE is not set
89# CONFIG_SA1100_H3100 is not set 89# CONFIG_SA1100_H3100 is not set
90# CONFIG_SA1100_H3600 is not set 90# CONFIG_SA1100_H3600 is not set
91# CONFIG_SA1100_H3800 is not set
92# CONFIG_SA1100_BADGE4 is not set 91# CONFIG_SA1100_BADGE4 is not set
93# CONFIG_SA1100_JORNADA720 is not set 92# CONFIG_SA1100_JORNADA720 is not set
94# CONFIG_SA1100_HACKKIT is not set 93# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/pxa168_defconfig b/arch/arm/configs/pxa168_defconfig
new file mode 100644
index 000000000000..db5faeaec96c
--- /dev/null
+++ b/arch/arm/configs/pxa168_defconfig
@@ -0,0 +1,891 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc3
4# Fri Mar 20 13:43:13 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_POSIX_MQUEUE is not set
42# CONFIG_BSD_PROCESS_ACCT is not set
43# CONFIG_TASKSTATS is not set
44# CONFIG_AUDIT is not set
45
46#
47# RCU Subsystem
48#
49CONFIG_CLASSIC_RCU=y
50# CONFIG_TREE_RCU is not set
51# CONFIG_PREEMPT_RCU is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set
55CONFIG_LOG_BUF_SHIFT=14
56# CONFIG_GROUP_SCHED is not set
57# CONFIG_CGROUPS is not set
58CONFIG_SYSFS_DEPRECATED=y
59CONFIG_SYSFS_DEPRECATED_V2=y
60# CONFIG_RELAY is not set
61CONFIG_NAMESPACES=y
62# CONFIG_UTS_NS is not set
63# CONFIG_IPC_NS is not set
64# CONFIG_USER_NS is not set
65# CONFIG_PID_NS is not set
66# CONFIG_NET_NS is not set
67CONFIG_BLK_DEV_INITRD=y
68CONFIG_INITRAMFS_SOURCE=""
69CONFIG_CC_OPTIMIZE_FOR_SIZE=y
70CONFIG_SYSCTL=y
71# CONFIG_EMBEDDED is not set
72CONFIG_UID16=y
73CONFIG_SYSCTL_SYSCALL=y
74CONFIG_KALLSYMS=y
75# CONFIG_KALLSYMS_ALL is not set
76# CONFIG_KALLSYMS_EXTRA_PASS is not set
77CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y
79CONFIG_BUG=y
80CONFIG_ELF_CORE=y
81CONFIG_COMPAT_BRK=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_ANON_INODES=y
85CONFIG_EPOLL=y
86CONFIG_SIGNALFD=y
87CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y
90CONFIG_AIO=y
91CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_SLAB=y
93# CONFIG_SLUB is not set
94# CONFIG_SLOB is not set
95# CONFIG_PROFILING is not set
96CONFIG_HAVE_OPROFILE=y
97# CONFIG_KPROBES is not set
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y
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
108CONFIG_MODULE_FORCE_UNLOAD=y
109# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_BLOCK=y
112# CONFIG_LBD is not set
113# CONFIG_BLK_DEV_IO_TRACE is not set
114# CONFIG_BLK_DEV_BSG is not set
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#
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_EBSA110 is not set
141# CONFIG_ARCH_EP93XX is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set
143# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set
146# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set
149# CONFIG_ARCH_IXP23XX is not set
150# CONFIG_ARCH_IXP2000 is not set
151# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set
154# CONFIG_ARCH_KS8695 is not set
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_ORION5X is not set
160# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set
162CONFIG_ARCH_MMP=y
163# CONFIG_ARCH_RPC is not set
164# CONFIG_ARCH_SA1100 is not set
165# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_S3C64XX is not set
167# CONFIG_ARCH_SHARK is not set
168# CONFIG_ARCH_LH7A40X is not set
169# CONFIG_ARCH_DAVINCI is not set
170# CONFIG_ARCH_OMAP is not set
171# CONFIG_ARCH_MSM is not set
172# CONFIG_ARCH_W90X900 is not set
173# CONFIG_MACH_TAVOREVB is not set
174
175#
176# Marvell PXA168/910 Implmentations
177#
178CONFIG_MACH_ASPENITE=y
179CONFIG_MACH_ZYLONITE2=y
180# CONFIG_MACH_TTC_DKB is not set
181CONFIG_CPU_PXA168=y
182CONFIG_PLAT_PXA=y
183
184#
185# Processor Type
186#
187CONFIG_CPU_32=y
188CONFIG_CPU_MOHAWK=y
189CONFIG_CPU_32v5=y
190CONFIG_CPU_ABRT_EV5T=y
191CONFIG_CPU_PABRT_NOIFAR=y
192CONFIG_CPU_CACHE_VIVT=y
193CONFIG_CPU_COPY_V4WB=y
194CONFIG_CPU_TLB_V4WBI=y
195CONFIG_CPU_CP15=y
196CONFIG_CPU_CP15_MMU=y
197
198#
199# Processor Features
200#
201CONFIG_ARM_THUMB=y
202# CONFIG_CPU_ICACHE_DISABLE is not set
203# CONFIG_CPU_DCACHE_DISABLE is not set
204# CONFIG_CPU_BPREDICT_DISABLE is not set
205# CONFIG_OUTER_CACHE is not set
206CONFIG_IWMMXT=y
207CONFIG_COMMON_CLKDEV=y
208
209#
210# Bus support
211#
212# CONFIG_PCI_SYSCALL is not set
213# CONFIG_ARCH_SUPPORTS_MSI is not set
214# CONFIG_PCCARD is not set
215
216#
217# Kernel Features
218#
219CONFIG_TICK_ONESHOT=y
220CONFIG_NO_HZ=y
221CONFIG_HIGH_RES_TIMERS=y
222CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
223CONFIG_VMSPLIT_3G=y
224# CONFIG_VMSPLIT_2G is not set
225# CONFIG_VMSPLIT_1G is not set
226CONFIG_PAGE_OFFSET=0xC0000000
227CONFIG_PREEMPT=y
228CONFIG_HZ=100
229CONFIG_AEABI=y
230CONFIG_OABI_COMPAT=y
231CONFIG_ARCH_FLATMEM_HAS_HOLES=y
232# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
233# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
234CONFIG_SELECT_MEMORY_MODEL=y
235CONFIG_FLATMEM_MANUAL=y
236# CONFIG_DISCONTIGMEM_MANUAL is not set
237# CONFIG_SPARSEMEM_MANUAL is not set
238CONFIG_FLATMEM=y
239CONFIG_FLAT_NODE_MEM_MAP=y
240CONFIG_PAGEFLAGS_EXTENDED=y
241CONFIG_SPLIT_PTLOCK_CPUS=4096
242# CONFIG_PHYS_ADDR_T_64BIT is not set
243CONFIG_ZONE_DMA_FLAG=0
244CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_ALIGNMENT_TRAP=y
247
248#
249# Boot options
250#
251CONFIG_ZBOOT_ROM_TEXT=0x0
252CONFIG_ZBOOT_ROM_BSS=0x0
253CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.2.100:/nfsroot/ ip=192.168.2.101:192.168.2.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M"
254# CONFIG_XIP_KERNEL is not set
255# CONFIG_KEXEC is not set
256
257#
258# CPU Power Management
259#
260# CONFIG_CPU_IDLE is not set
261
262#
263# Floating point emulation
264#
265
266#
267# At least one emulation must be selected
268#
269CONFIG_FPE_NWFPE=y
270# CONFIG_FPE_NWFPE_XP is not set
271# CONFIG_FPE_FASTFPE is not set
272
273#
274# Userspace binary formats
275#
276CONFIG_BINFMT_ELF=y
277# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
278CONFIG_HAVE_AOUT=y
279# CONFIG_BINFMT_AOUT is not set
280# CONFIG_BINFMT_MISC is not set
281
282#
283# Power management options
284#
285# CONFIG_PM is not set
286CONFIG_ARCH_SUSPEND_POSSIBLE=y
287CONFIG_NET=y
288
289#
290# Networking options
291#
292CONFIG_COMPAT_NET_DEV_OPS=y
293CONFIG_PACKET=y
294# CONFIG_PACKET_MMAP is not set
295CONFIG_UNIX=y
296CONFIG_XFRM=y
297# CONFIG_XFRM_USER is not set
298# CONFIG_XFRM_SUB_POLICY is not set
299# CONFIG_XFRM_MIGRATE is not set
300# CONFIG_XFRM_STATISTICS is not set
301# CONFIG_NET_KEY is not set
302CONFIG_INET=y
303# CONFIG_IP_MULTICAST is not set
304# CONFIG_IP_ADVANCED_ROUTER is not set
305CONFIG_IP_FIB_HASH=y
306CONFIG_IP_PNP=y
307# CONFIG_IP_PNP_DHCP is not set
308# CONFIG_IP_PNP_BOOTP is not set
309# CONFIG_IP_PNP_RARP is not set
310# CONFIG_NET_IPIP is not set
311# CONFIG_NET_IPGRE is not set
312# CONFIG_ARPD is not set
313# CONFIG_SYN_COOKIES is not set
314# CONFIG_INET_AH is not set
315# CONFIG_INET_ESP is not set
316# CONFIG_INET_IPCOMP is not set
317# CONFIG_INET_XFRM_TUNNEL is not set
318# CONFIG_INET_TUNNEL is not set
319CONFIG_INET_XFRM_MODE_TRANSPORT=y
320CONFIG_INET_XFRM_MODE_TUNNEL=y
321CONFIG_INET_XFRM_MODE_BEET=y
322# CONFIG_INET_LRO is not set
323CONFIG_INET_DIAG=y
324CONFIG_INET_TCP_DIAG=y
325# CONFIG_TCP_CONG_ADVANCED is not set
326CONFIG_TCP_CONG_CUBIC=y
327CONFIG_DEFAULT_TCP_CONG="cubic"
328# CONFIG_TCP_MD5SIG is not set
329# CONFIG_IPV6 is not set
330# CONFIG_NETWORK_SECMARK is not set
331# CONFIG_NETFILTER is not set
332# CONFIG_IP_DCCP is not set
333# CONFIG_IP_SCTP is not set
334# CONFIG_TIPC is not set
335# CONFIG_ATM is not set
336# CONFIG_BRIDGE is not set
337# CONFIG_NET_DSA is not set
338# CONFIG_VLAN_8021Q is not set
339# CONFIG_DECNET is not set
340# CONFIG_LLC2 is not set
341# CONFIG_IPX is not set
342# CONFIG_ATALK is not set
343# CONFIG_X25 is not set
344# CONFIG_LAPB is not set
345# CONFIG_ECONET is not set
346# CONFIG_WAN_ROUTER is not set
347# CONFIG_NET_SCHED is not set
348# CONFIG_DCB is not set
349
350#
351# Network testing
352#
353# CONFIG_NET_PKTGEN is not set
354# CONFIG_HAMRADIO is not set
355# CONFIG_CAN is not set
356# CONFIG_IRDA is not set
357# CONFIG_BT is not set
358# CONFIG_AF_RXRPC is not set
359# CONFIG_PHONET is not set
360CONFIG_WIRELESS=y
361# CONFIG_CFG80211 is not set
362CONFIG_WIRELESS_OLD_REGULATORY=y
363# CONFIG_WIRELESS_EXT is not set
364# CONFIG_LIB80211 is not set
365# CONFIG_MAC80211 is not set
366# CONFIG_WIMAX is not set
367# CONFIG_RFKILL is not set
368# CONFIG_NET_9P is not set
369
370#
371# Device Drivers
372#
373
374#
375# Generic Driver Options
376#
377CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
378# CONFIG_STANDALONE is not set
379# CONFIG_PREVENT_FIRMWARE_BUILD is not set
380CONFIG_FW_LOADER=y
381CONFIG_FIRMWARE_IN_KERNEL=y
382CONFIG_EXTRA_FIRMWARE=""
383# CONFIG_DEBUG_DRIVER is not set
384# CONFIG_DEBUG_DEVRES is not set
385# CONFIG_SYS_HYPERVISOR is not set
386# CONFIG_CONNECTOR is not set
387# CONFIG_MTD is not set
388# CONFIG_PARPORT is not set
389# CONFIG_BLK_DEV is not set
390# CONFIG_MISC_DEVICES is not set
391CONFIG_HAVE_IDE=y
392# CONFIG_IDE is not set
393
394#
395# SCSI device support
396#
397# CONFIG_RAID_ATTRS is not set
398# CONFIG_SCSI is not set
399# CONFIG_SCSI_DMA is not set
400# CONFIG_SCSI_NETLINK is not set
401# CONFIG_ATA is not set
402# CONFIG_MD is not set
403CONFIG_NETDEVICES=y
404# CONFIG_DUMMY is not set
405# CONFIG_BONDING is not set
406# CONFIG_MACVLAN is not set
407# CONFIG_EQUALIZER is not set
408# CONFIG_TUN is not set
409# CONFIG_VETH is not set
410# CONFIG_PHYLIB is not set
411CONFIG_NET_ETHERNET=y
412CONFIG_MII=y
413# CONFIG_AX88796 is not set
414CONFIG_SMC91X=y
415# CONFIG_DM9000 is not set
416# CONFIG_SMC911X is not set
417# CONFIG_SMSC911X is not set
418# CONFIG_IBM_NEW_EMAC_ZMII is not set
419# CONFIG_IBM_NEW_EMAC_RGMII is not set
420# CONFIG_IBM_NEW_EMAC_TAH is not set
421# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
422# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
423# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
424# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
425# CONFIG_B44 is not set
426# CONFIG_NETDEV_1000 is not set
427# CONFIG_NETDEV_10000 is not set
428
429#
430# Wireless LAN
431#
432# CONFIG_WLAN_PRE80211 is not set
433# CONFIG_WLAN_80211 is not set
434# CONFIG_IWLWIFI_LEDS is not set
435
436#
437# Enable WiMAX (Networking options) to see the WiMAX drivers
438#
439# CONFIG_WAN is not set
440# CONFIG_PPP is not set
441# CONFIG_SLIP is not set
442# CONFIG_NETCONSOLE is not set
443# CONFIG_NETPOLL is not set
444# CONFIG_NET_POLL_CONTROLLER is not set
445# CONFIG_ISDN is not set
446
447#
448# Input device support
449#
450CONFIG_INPUT=y
451# CONFIG_INPUT_FF_MEMLESS is not set
452# CONFIG_INPUT_POLLDEV is not set
453
454#
455# Userland interfaces
456#
457CONFIG_INPUT_MOUSEDEV=y
458# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
459CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
460CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
461# CONFIG_INPUT_JOYDEV is not set
462# CONFIG_INPUT_EVDEV is not set
463# CONFIG_INPUT_EVBUG is not set
464
465#
466# Input Device Drivers
467#
468# CONFIG_INPUT_KEYBOARD is not set
469# CONFIG_INPUT_MOUSE is not set
470# CONFIG_INPUT_JOYSTICK is not set
471# CONFIG_INPUT_TABLET is not set
472# CONFIG_INPUT_TOUCHSCREEN is not set
473# CONFIG_INPUT_MISC is not set
474
475#
476# Hardware I/O ports
477#
478# CONFIG_SERIO is not set
479# CONFIG_GAMEPORT is not set
480
481#
482# Character devices
483#
484CONFIG_VT=y
485CONFIG_CONSOLE_TRANSLATIONS=y
486CONFIG_VT_CONSOLE=y
487CONFIG_HW_CONSOLE=y
488# CONFIG_VT_HW_CONSOLE_BINDING is not set
489CONFIG_DEVKMEM=y
490# CONFIG_SERIAL_NONSTANDARD is not set
491
492#
493# Serial drivers
494#
495# CONFIG_SERIAL_8250 is not set
496
497#
498# Non-8250 serial port support
499#
500CONFIG_SERIAL_PXA=y
501CONFIG_SERIAL_PXA_CONSOLE=y
502CONFIG_SERIAL_CORE=y
503CONFIG_SERIAL_CORE_CONSOLE=y
504CONFIG_UNIX98_PTYS=y
505# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
506# CONFIG_LEGACY_PTYS is not set
507# CONFIG_IPMI_HANDLER is not set
508# CONFIG_HW_RANDOM is not set
509# CONFIG_R3964 is not set
510# CONFIG_RAW_DRIVER is not set
511# CONFIG_TCG_TPM is not set
512# CONFIG_I2C is not set
513# CONFIG_SPI is not set
514CONFIG_ARCH_REQUIRE_GPIOLIB=y
515CONFIG_GPIOLIB=y
516# CONFIG_DEBUG_GPIO is not set
517# CONFIG_GPIO_SYSFS is not set
518
519#
520# Memory mapped GPIO expanders:
521#
522
523#
524# I2C GPIO expanders:
525#
526
527#
528# PCI GPIO expanders:
529#
530
531#
532# SPI GPIO expanders:
533#
534# CONFIG_W1 is not set
535# CONFIG_POWER_SUPPLY is not set
536# CONFIG_HWMON is not set
537# CONFIG_THERMAL is not set
538# CONFIG_THERMAL_HWMON is not set
539# CONFIG_WATCHDOG is not set
540CONFIG_SSB_POSSIBLE=y
541
542#
543# Sonics Silicon Backplane
544#
545# CONFIG_SSB is not set
546
547#
548# Multifunction device drivers
549#
550# CONFIG_MFD_CORE is not set
551# CONFIG_MFD_SM501 is not set
552# CONFIG_MFD_ASIC3 is not set
553# CONFIG_HTC_EGPIO is not set
554# CONFIG_HTC_PASIC3 is not set
555# CONFIG_MFD_TMIO is not set
556# CONFIG_MFD_T7L66XB is not set
557# CONFIG_MFD_TC6387XB is not set
558# CONFIG_MFD_TC6393XB is not set
559
560#
561# Multimedia devices
562#
563
564#
565# Multimedia core support
566#
567# CONFIG_VIDEO_DEV is not set
568# CONFIG_DVB_CORE is not set
569# CONFIG_VIDEO_MEDIA is not set
570
571#
572# Multimedia drivers
573#
574# CONFIG_DAB is not set
575
576#
577# Graphics support
578#
579# CONFIG_VGASTATE is not set
580# CONFIG_VIDEO_OUTPUT_CONTROL is not set
581# CONFIG_FB is not set
582# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
583
584#
585# Display device support
586#
587# CONFIG_DISPLAY_SUPPORT is not set
588
589#
590# Console display driver support
591#
592# CONFIG_VGA_CONSOLE is not set
593CONFIG_DUMMY_CONSOLE=y
594# CONFIG_SOUND is not set
595# CONFIG_HID_SUPPORT is not set
596# CONFIG_USB_SUPPORT is not set
597# CONFIG_MMC is not set
598# CONFIG_MEMSTICK is not set
599# CONFIG_ACCESSIBILITY is not set
600# CONFIG_NEW_LEDS is not set
601CONFIG_RTC_LIB=y
602# CONFIG_RTC_CLASS is not set
603# CONFIG_DMADEVICES is not set
604# CONFIG_REGULATOR is not set
605# CONFIG_UIO is not set
606# CONFIG_STAGING is not set
607
608#
609# File systems
610#
611# CONFIG_EXT2_FS is not set
612# CONFIG_EXT3_FS is not set
613# CONFIG_EXT4_FS is not set
614# CONFIG_REISERFS_FS is not set
615# CONFIG_JFS_FS is not set
616CONFIG_FS_POSIX_ACL=y
617CONFIG_FILE_LOCKING=y
618# CONFIG_XFS_FS is not set
619# CONFIG_OCFS2_FS is not set
620# CONFIG_BTRFS_FS is not set
621CONFIG_DNOTIFY=y
622CONFIG_INOTIFY=y
623CONFIG_INOTIFY_USER=y
624# CONFIG_QUOTA is not set
625# CONFIG_AUTOFS_FS is not set
626# CONFIG_AUTOFS4_FS is not set
627# CONFIG_FUSE_FS is not set
628CONFIG_GENERIC_ACL=y
629
630#
631# CD-ROM/DVD Filesystems
632#
633# CONFIG_ISO9660_FS is not set
634# CONFIG_UDF_FS is not set
635
636#
637# DOS/FAT/NT Filesystems
638#
639# CONFIG_MSDOS_FS is not set
640# CONFIG_VFAT_FS is not set
641# CONFIG_NTFS_FS is not set
642
643#
644# Pseudo filesystems
645#
646CONFIG_PROC_FS=y
647CONFIG_PROC_SYSCTL=y
648CONFIG_PROC_PAGE_MONITOR=y
649CONFIG_SYSFS=y
650CONFIG_TMPFS=y
651CONFIG_TMPFS_POSIX_ACL=y
652# CONFIG_HUGETLB_PAGE is not set
653# CONFIG_CONFIGFS_FS is not set
654CONFIG_MISC_FILESYSTEMS=y
655# CONFIG_ADFS_FS is not set
656# CONFIG_AFFS_FS is not set
657# CONFIG_HFS_FS is not set
658# CONFIG_HFSPLUS_FS is not set
659# CONFIG_BEFS_FS is not set
660# CONFIG_BFS_FS is not set
661# CONFIG_EFS_FS is not set
662CONFIG_CRAMFS=y
663# CONFIG_SQUASHFS is not set
664# CONFIG_VXFS_FS is not set
665# CONFIG_MINIX_FS is not set
666# CONFIG_OMFS_FS is not set
667# CONFIG_HPFS_FS is not set
668# CONFIG_QNX4FS_FS is not set
669# CONFIG_ROMFS_FS is not set
670# CONFIG_SYSV_FS is not set
671# CONFIG_UFS_FS is not set
672CONFIG_NETWORK_FILESYSTEMS=y
673CONFIG_NFS_FS=y
674CONFIG_NFS_V3=y
675CONFIG_NFS_V3_ACL=y
676CONFIG_NFS_V4=y
677CONFIG_ROOT_NFS=y
678# CONFIG_NFSD is not set
679CONFIG_LOCKD=y
680CONFIG_LOCKD_V4=y
681CONFIG_NFS_ACL_SUPPORT=y
682CONFIG_NFS_COMMON=y
683CONFIG_SUNRPC=y
684CONFIG_SUNRPC_GSS=y
685# CONFIG_SUNRPC_REGISTER_V4 is not set
686CONFIG_RPCSEC_GSS_KRB5=y
687# CONFIG_RPCSEC_GSS_SPKM3 is not set
688# CONFIG_SMB_FS is not set
689# CONFIG_CIFS is not set
690# CONFIG_NCP_FS is not set
691# CONFIG_CODA_FS is not set
692# CONFIG_AFS_FS is not set
693
694#
695# Partition Types
696#
697# CONFIG_PARTITION_ADVANCED is not set
698CONFIG_MSDOS_PARTITION=y
699# CONFIG_NLS is not set
700# CONFIG_DLM is not set
701
702#
703# Kernel hacking
704#
705CONFIG_PRINTK_TIME=y
706CONFIG_ENABLE_WARN_DEPRECATED=y
707CONFIG_ENABLE_MUST_CHECK=y
708CONFIG_FRAME_WARN=1024
709CONFIG_MAGIC_SYSRQ=y
710# CONFIG_UNUSED_SYMBOLS is not set
711# CONFIG_DEBUG_FS is not set
712# CONFIG_HEADERS_CHECK is not set
713CONFIG_DEBUG_KERNEL=y
714# CONFIG_DEBUG_SHIRQ is not set
715CONFIG_DETECT_SOFTLOCKUP=y
716# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
717CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
718CONFIG_SCHED_DEBUG=y
719# CONFIG_SCHEDSTATS is not set
720# CONFIG_TIMER_STATS is not set
721# CONFIG_DEBUG_OBJECTS is not set
722# CONFIG_DEBUG_SLAB is not set
723# CONFIG_DEBUG_PREEMPT is not set
724# CONFIG_DEBUG_RT_MUTEXES is not set
725# CONFIG_RT_MUTEX_TESTER is not set
726# CONFIG_DEBUG_SPINLOCK is not set
727# CONFIG_DEBUG_MUTEXES is not set
728# CONFIG_DEBUG_LOCK_ALLOC is not set
729# CONFIG_PROVE_LOCKING is not set
730# CONFIG_LOCK_STAT is not set
731# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
732# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
733# CONFIG_DEBUG_KOBJECT is not set
734CONFIG_DEBUG_BUGVERBOSE=y
735CONFIG_DEBUG_INFO=y
736# CONFIG_DEBUG_VM is not set
737# CONFIG_DEBUG_WRITECOUNT is not set
738CONFIG_DEBUG_MEMORY_INIT=y
739# CONFIG_DEBUG_LIST is not set
740# CONFIG_DEBUG_SG is not set
741# CONFIG_DEBUG_NOTIFIERS is not set
742# CONFIG_BOOT_PRINTK_DELAY is not set
743# CONFIG_RCU_TORTURE_TEST is not set
744# CONFIG_RCU_CPU_STALL_DETECTOR is not set
745# CONFIG_BACKTRACE_SELF_TEST is not set
746# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
747# CONFIG_FAULT_INJECTION is not set
748# CONFIG_LATENCYTOP is not set
749# CONFIG_SYSCTL_SYSCALL_CHECK is not set
750CONFIG_HAVE_FUNCTION_TRACER=y
751
752#
753# Tracers
754#
755# CONFIG_FUNCTION_TRACER is not set
756# CONFIG_IRQSOFF_TRACER is not set
757# CONFIG_PREEMPT_TRACER is not set
758# CONFIG_SCHED_TRACER is not set
759# CONFIG_CONTEXT_SWITCH_TRACER is not set
760# CONFIG_BOOT_TRACER is not set
761# CONFIG_TRACE_BRANCH_PROFILING is not set
762# CONFIG_STACK_TRACER is not set
763# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
764# CONFIG_SAMPLES is not set
765CONFIG_HAVE_ARCH_KGDB=y
766# CONFIG_KGDB is not set
767CONFIG_ARM_UNWIND=y
768CONFIG_DEBUG_USER=y
769CONFIG_DEBUG_ERRORS=y
770# CONFIG_DEBUG_STACK_USAGE is not set
771CONFIG_DEBUG_LL=y
772# CONFIG_DEBUG_ICEDCC is not set
773
774#
775# Security options
776#
777# CONFIG_KEYS is not set
778# CONFIG_SECURITY is not set
779# CONFIG_SECURITYFS is not set
780# CONFIG_SECURITY_FILE_CAPABILITIES is not set
781CONFIG_CRYPTO=y
782
783#
784# Crypto core or helper
785#
786# CONFIG_CRYPTO_FIPS is not set
787CONFIG_CRYPTO_ALGAPI=y
788CONFIG_CRYPTO_ALGAPI2=y
789CONFIG_CRYPTO_AEAD2=y
790CONFIG_CRYPTO_BLKCIPHER=y
791CONFIG_CRYPTO_BLKCIPHER2=y
792CONFIG_CRYPTO_HASH=y
793CONFIG_CRYPTO_HASH2=y
794CONFIG_CRYPTO_RNG2=y
795CONFIG_CRYPTO_MANAGER=y
796CONFIG_CRYPTO_MANAGER2=y
797# CONFIG_CRYPTO_GF128MUL is not set
798# CONFIG_CRYPTO_NULL is not set
799# CONFIG_CRYPTO_CRYPTD is not set
800# CONFIG_CRYPTO_AUTHENC is not set
801# CONFIG_CRYPTO_TEST is not set
802
803#
804# Authenticated Encryption with Associated Data
805#
806# CONFIG_CRYPTO_CCM is not set
807# CONFIG_CRYPTO_GCM is not set
808# CONFIG_CRYPTO_SEQIV is not set
809
810#
811# Block modes
812#
813CONFIG_CRYPTO_CBC=y
814# CONFIG_CRYPTO_CTR is not set
815# CONFIG_CRYPTO_CTS is not set
816# CONFIG_CRYPTO_ECB is not set
817# CONFIG_CRYPTO_LRW is not set
818# CONFIG_CRYPTO_PCBC is not set
819# CONFIG_CRYPTO_XTS is not set
820
821#
822# Hash modes
823#
824# CONFIG_CRYPTO_HMAC is not set
825# CONFIG_CRYPTO_XCBC is not set
826
827#
828# Digest
829#
830# CONFIG_CRYPTO_CRC32C is not set
831# CONFIG_CRYPTO_MD4 is not set
832CONFIG_CRYPTO_MD5=y
833# CONFIG_CRYPTO_MICHAEL_MIC is not set
834# CONFIG_CRYPTO_RMD128 is not set
835# CONFIG_CRYPTO_RMD160 is not set
836# CONFIG_CRYPTO_RMD256 is not set
837# CONFIG_CRYPTO_RMD320 is not set
838# CONFIG_CRYPTO_SHA1 is not set
839# CONFIG_CRYPTO_SHA256 is not set
840# CONFIG_CRYPTO_SHA512 is not set
841# CONFIG_CRYPTO_TGR192 is not set
842# CONFIG_CRYPTO_WP512 is not set
843
844#
845# Ciphers
846#
847# CONFIG_CRYPTO_AES is not set
848# CONFIG_CRYPTO_ANUBIS is not set
849# CONFIG_CRYPTO_ARC4 is not set
850# CONFIG_CRYPTO_BLOWFISH is not set
851# CONFIG_CRYPTO_CAMELLIA is not set
852# CONFIG_CRYPTO_CAST5 is not set
853# CONFIG_CRYPTO_CAST6 is not set
854CONFIG_CRYPTO_DES=y
855# CONFIG_CRYPTO_FCRYPT is not set
856# CONFIG_CRYPTO_KHAZAD is not set
857# CONFIG_CRYPTO_SALSA20 is not set
858# CONFIG_CRYPTO_SEED is not set
859# CONFIG_CRYPTO_SERPENT is not set
860# CONFIG_CRYPTO_TEA is not set
861# CONFIG_CRYPTO_TWOFISH is not set
862
863#
864# Compression
865#
866# CONFIG_CRYPTO_DEFLATE is not set
867# CONFIG_CRYPTO_LZO is not set
868
869#
870# Random Number Generation
871#
872# CONFIG_CRYPTO_ANSI_CPRNG is not set
873CONFIG_CRYPTO_HW=y
874
875#
876# Library routines
877#
878CONFIG_BITREVERSE=y
879CONFIG_GENERIC_FIND_LAST_BIT=y
880CONFIG_CRC_CCITT=y
881# CONFIG_CRC16 is not set
882# CONFIG_CRC_T10DIF is not set
883# CONFIG_CRC_ITU_T is not set
884CONFIG_CRC32=y
885# CONFIG_CRC7 is not set
886# CONFIG_LIBCRC32C is not set
887CONFIG_ZLIB_INFLATE=y
888CONFIG_PLIST=y
889CONFIG_HAS_IOMEM=y
890CONFIG_HAS_IOPORT=y
891CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/pxa910_defconfig b/arch/arm/configs/pxa910_defconfig
new file mode 100644
index 000000000000..8c7e299f1d66
--- /dev/null
+++ b/arch/arm/configs/pxa910_defconfig
@@ -0,0 +1,891 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc3
4# Fri Mar 20 13:45:12 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_POSIX_MQUEUE is not set
42# CONFIG_BSD_PROCESS_ACCT is not set
43# CONFIG_TASKSTATS is not set
44# CONFIG_AUDIT is not set
45
46#
47# RCU Subsystem
48#
49CONFIG_CLASSIC_RCU=y
50# CONFIG_TREE_RCU is not set
51# CONFIG_PREEMPT_RCU is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set
55CONFIG_LOG_BUF_SHIFT=14
56# CONFIG_GROUP_SCHED is not set
57# CONFIG_CGROUPS is not set
58CONFIG_SYSFS_DEPRECATED=y
59CONFIG_SYSFS_DEPRECATED_V2=y
60# CONFIG_RELAY is not set
61CONFIG_NAMESPACES=y
62# CONFIG_UTS_NS is not set
63# CONFIG_IPC_NS is not set
64# CONFIG_USER_NS is not set
65# CONFIG_PID_NS is not set
66# CONFIG_NET_NS is not set
67CONFIG_BLK_DEV_INITRD=y
68CONFIG_INITRAMFS_SOURCE=""
69CONFIG_CC_OPTIMIZE_FOR_SIZE=y
70CONFIG_SYSCTL=y
71# CONFIG_EMBEDDED is not set
72CONFIG_UID16=y
73CONFIG_SYSCTL_SYSCALL=y
74CONFIG_KALLSYMS=y
75# CONFIG_KALLSYMS_ALL is not set
76# CONFIG_KALLSYMS_EXTRA_PASS is not set
77CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y
79CONFIG_BUG=y
80CONFIG_ELF_CORE=y
81CONFIG_COMPAT_BRK=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_ANON_INODES=y
85CONFIG_EPOLL=y
86CONFIG_SIGNALFD=y
87CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y
90CONFIG_AIO=y
91CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_SLAB=y
93# CONFIG_SLUB is not set
94# CONFIG_SLOB is not set
95# CONFIG_PROFILING is not set
96CONFIG_HAVE_OPROFILE=y
97# CONFIG_KPROBES is not set
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y
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
108CONFIG_MODULE_FORCE_UNLOAD=y
109# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_BLOCK=y
112# CONFIG_LBD is not set
113# CONFIG_BLK_DEV_IO_TRACE is not set
114# CONFIG_BLK_DEV_BSG is not set
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#
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_EBSA110 is not set
141# CONFIG_ARCH_EP93XX is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set
143# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set
146# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set
149# CONFIG_ARCH_IXP23XX is not set
150# CONFIG_ARCH_IXP2000 is not set
151# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set
154# CONFIG_ARCH_KS8695 is not set
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_ORION5X is not set
160# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set
162CONFIG_ARCH_MMP=y
163# CONFIG_ARCH_RPC is not set
164# CONFIG_ARCH_SA1100 is not set
165# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_S3C64XX is not set
167# CONFIG_ARCH_SHARK is not set
168# CONFIG_ARCH_LH7A40X is not set
169# CONFIG_ARCH_DAVINCI is not set
170# CONFIG_ARCH_OMAP is not set
171# CONFIG_ARCH_MSM is not set
172# CONFIG_ARCH_W90X900 is not set
173CONFIG_MACH_TAVOREVB=y
174
175#
176# Marvell PXA168/910 Implmentations
177#
178# CONFIG_MACH_ASPENITE is not set
179# CONFIG_MACH_ZYLONITE2 is not set
180CONFIG_MACH_TTC_DKB=y
181CONFIG_CPU_PXA910=y
182CONFIG_PLAT_PXA=y
183
184#
185# Processor Type
186#
187CONFIG_CPU_32=y
188CONFIG_CPU_MOHAWK=y
189CONFIG_CPU_32v5=y
190CONFIG_CPU_ABRT_EV5T=y
191CONFIG_CPU_PABRT_NOIFAR=y
192CONFIG_CPU_CACHE_VIVT=y
193CONFIG_CPU_COPY_V4WB=y
194CONFIG_CPU_TLB_V4WBI=y
195CONFIG_CPU_CP15=y
196CONFIG_CPU_CP15_MMU=y
197
198#
199# Processor Features
200#
201CONFIG_ARM_THUMB=y
202# CONFIG_CPU_ICACHE_DISABLE is not set
203# CONFIG_CPU_DCACHE_DISABLE is not set
204# CONFIG_CPU_BPREDICT_DISABLE is not set
205# CONFIG_OUTER_CACHE is not set
206CONFIG_IWMMXT=y
207CONFIG_COMMON_CLKDEV=y
208
209#
210# Bus support
211#
212# CONFIG_PCI_SYSCALL is not set
213# CONFIG_ARCH_SUPPORTS_MSI is not set
214# CONFIG_PCCARD is not set
215
216#
217# Kernel Features
218#
219CONFIG_TICK_ONESHOT=y
220CONFIG_NO_HZ=y
221CONFIG_HIGH_RES_TIMERS=y
222CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
223CONFIG_VMSPLIT_3G=y
224# CONFIG_VMSPLIT_2G is not set
225# CONFIG_VMSPLIT_1G is not set
226CONFIG_PAGE_OFFSET=0xC0000000
227CONFIG_PREEMPT=y
228CONFIG_HZ=100
229CONFIG_AEABI=y
230CONFIG_OABI_COMPAT=y
231CONFIG_ARCH_FLATMEM_HAS_HOLES=y
232# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
233# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
234CONFIG_SELECT_MEMORY_MODEL=y
235CONFIG_FLATMEM_MANUAL=y
236# CONFIG_DISCONTIGMEM_MANUAL is not set
237# CONFIG_SPARSEMEM_MANUAL is not set
238CONFIG_FLATMEM=y
239CONFIG_FLAT_NODE_MEM_MAP=y
240CONFIG_PAGEFLAGS_EXTENDED=y
241CONFIG_SPLIT_PTLOCK_CPUS=4096
242# CONFIG_PHYS_ADDR_T_64BIT is not set
243CONFIG_ZONE_DMA_FLAG=0
244CONFIG_VIRT_TO_BUS=y
245CONFIG_UNEVICTABLE_LRU=y
246CONFIG_ALIGNMENT_TRAP=y
247
248#
249# Boot options
250#
251CONFIG_ZBOOT_ROM_TEXT=0x0
252CONFIG_ZBOOT_ROM_BSS=0x0
253CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.2.100:/nfsroot/ ip=192.168.2.101:192.168.2.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M"
254# CONFIG_XIP_KERNEL is not set
255# CONFIG_KEXEC is not set
256
257#
258# CPU Power Management
259#
260# CONFIG_CPU_IDLE is not set
261
262#
263# Floating point emulation
264#
265
266#
267# At least one emulation must be selected
268#
269CONFIG_FPE_NWFPE=y
270# CONFIG_FPE_NWFPE_XP is not set
271# CONFIG_FPE_FASTFPE is not set
272
273#
274# Userspace binary formats
275#
276CONFIG_BINFMT_ELF=y
277# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
278CONFIG_HAVE_AOUT=y
279# CONFIG_BINFMT_AOUT is not set
280# CONFIG_BINFMT_MISC is not set
281
282#
283# Power management options
284#
285# CONFIG_PM is not set
286CONFIG_ARCH_SUSPEND_POSSIBLE=y
287CONFIG_NET=y
288
289#
290# Networking options
291#
292CONFIG_COMPAT_NET_DEV_OPS=y
293CONFIG_PACKET=y
294# CONFIG_PACKET_MMAP is not set
295CONFIG_UNIX=y
296CONFIG_XFRM=y
297# CONFIG_XFRM_USER is not set
298# CONFIG_XFRM_SUB_POLICY is not set
299# CONFIG_XFRM_MIGRATE is not set
300# CONFIG_XFRM_STATISTICS is not set
301# CONFIG_NET_KEY is not set
302CONFIG_INET=y
303# CONFIG_IP_MULTICAST is not set
304# CONFIG_IP_ADVANCED_ROUTER is not set
305CONFIG_IP_FIB_HASH=y
306CONFIG_IP_PNP=y
307# CONFIG_IP_PNP_DHCP is not set
308# CONFIG_IP_PNP_BOOTP is not set
309# CONFIG_IP_PNP_RARP is not set
310# CONFIG_NET_IPIP is not set
311# CONFIG_NET_IPGRE is not set
312# CONFIG_ARPD is not set
313# CONFIG_SYN_COOKIES is not set
314# CONFIG_INET_AH is not set
315# CONFIG_INET_ESP is not set
316# CONFIG_INET_IPCOMP is not set
317# CONFIG_INET_XFRM_TUNNEL is not set
318# CONFIG_INET_TUNNEL is not set
319CONFIG_INET_XFRM_MODE_TRANSPORT=y
320CONFIG_INET_XFRM_MODE_TUNNEL=y
321CONFIG_INET_XFRM_MODE_BEET=y
322# CONFIG_INET_LRO is not set
323CONFIG_INET_DIAG=y
324CONFIG_INET_TCP_DIAG=y
325# CONFIG_TCP_CONG_ADVANCED is not set
326CONFIG_TCP_CONG_CUBIC=y
327CONFIG_DEFAULT_TCP_CONG="cubic"
328# CONFIG_TCP_MD5SIG is not set
329# CONFIG_IPV6 is not set
330# CONFIG_NETWORK_SECMARK is not set
331# CONFIG_NETFILTER is not set
332# CONFIG_IP_DCCP is not set
333# CONFIG_IP_SCTP is not set
334# CONFIG_TIPC is not set
335# CONFIG_ATM is not set
336# CONFIG_BRIDGE is not set
337# CONFIG_NET_DSA is not set
338# CONFIG_VLAN_8021Q is not set
339# CONFIG_DECNET is not set
340# CONFIG_LLC2 is not set
341# CONFIG_IPX is not set
342# CONFIG_ATALK is not set
343# CONFIG_X25 is not set
344# CONFIG_LAPB is not set
345# CONFIG_ECONET is not set
346# CONFIG_WAN_ROUTER is not set
347# CONFIG_NET_SCHED is not set
348# CONFIG_DCB is not set
349
350#
351# Network testing
352#
353# CONFIG_NET_PKTGEN is not set
354# CONFIG_HAMRADIO is not set
355# CONFIG_CAN is not set
356# CONFIG_IRDA is not set
357# CONFIG_BT is not set
358# CONFIG_AF_RXRPC is not set
359# CONFIG_PHONET is not set
360CONFIG_WIRELESS=y
361# CONFIG_CFG80211 is not set
362CONFIG_WIRELESS_OLD_REGULATORY=y
363# CONFIG_WIRELESS_EXT is not set
364# CONFIG_LIB80211 is not set
365# CONFIG_MAC80211 is not set
366# CONFIG_WIMAX is not set
367# CONFIG_RFKILL is not set
368# CONFIG_NET_9P is not set
369
370#
371# Device Drivers
372#
373
374#
375# Generic Driver Options
376#
377CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
378# CONFIG_STANDALONE is not set
379# CONFIG_PREVENT_FIRMWARE_BUILD is not set
380CONFIG_FW_LOADER=y
381CONFIG_FIRMWARE_IN_KERNEL=y
382CONFIG_EXTRA_FIRMWARE=""
383# CONFIG_DEBUG_DRIVER is not set
384# CONFIG_DEBUG_DEVRES is not set
385# CONFIG_SYS_HYPERVISOR is not set
386# CONFIG_CONNECTOR is not set
387# CONFIG_MTD is not set
388# CONFIG_PARPORT is not set
389# CONFIG_BLK_DEV is not set
390# CONFIG_MISC_DEVICES is not set
391CONFIG_HAVE_IDE=y
392# CONFIG_IDE is not set
393
394#
395# SCSI device support
396#
397# CONFIG_RAID_ATTRS is not set
398# CONFIG_SCSI is not set
399# CONFIG_SCSI_DMA is not set
400# CONFIG_SCSI_NETLINK is not set
401# CONFIG_ATA is not set
402# CONFIG_MD is not set
403CONFIG_NETDEVICES=y
404# CONFIG_DUMMY is not set
405# CONFIG_BONDING is not set
406# CONFIG_MACVLAN is not set
407# CONFIG_EQUALIZER is not set
408# CONFIG_TUN is not set
409# CONFIG_VETH is not set
410# CONFIG_PHYLIB is not set
411CONFIG_NET_ETHERNET=y
412CONFIG_MII=y
413# CONFIG_AX88796 is not set
414CONFIG_SMC91X=y
415# CONFIG_DM9000 is not set
416# CONFIG_SMC911X is not set
417# CONFIG_SMSC911X is not set
418# CONFIG_IBM_NEW_EMAC_ZMII is not set
419# CONFIG_IBM_NEW_EMAC_RGMII is not set
420# CONFIG_IBM_NEW_EMAC_TAH is not set
421# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
422# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
423# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
424# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
425# CONFIG_B44 is not set
426# CONFIG_NETDEV_1000 is not set
427# CONFIG_NETDEV_10000 is not set
428
429#
430# Wireless LAN
431#
432# CONFIG_WLAN_PRE80211 is not set
433# CONFIG_WLAN_80211 is not set
434# CONFIG_IWLWIFI_LEDS is not set
435
436#
437# Enable WiMAX (Networking options) to see the WiMAX drivers
438#
439# CONFIG_WAN is not set
440# CONFIG_PPP is not set
441# CONFIG_SLIP is not set
442# CONFIG_NETCONSOLE is not set
443# CONFIG_NETPOLL is not set
444# CONFIG_NET_POLL_CONTROLLER is not set
445# CONFIG_ISDN is not set
446
447#
448# Input device support
449#
450CONFIG_INPUT=y
451# CONFIG_INPUT_FF_MEMLESS is not set
452# CONFIG_INPUT_POLLDEV is not set
453
454#
455# Userland interfaces
456#
457CONFIG_INPUT_MOUSEDEV=y
458# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
459CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
460CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
461# CONFIG_INPUT_JOYDEV is not set
462# CONFIG_INPUT_EVDEV is not set
463# CONFIG_INPUT_EVBUG is not set
464
465#
466# Input Device Drivers
467#
468# CONFIG_INPUT_KEYBOARD is not set
469# CONFIG_INPUT_MOUSE is not set
470# CONFIG_INPUT_JOYSTICK is not set
471# CONFIG_INPUT_TABLET is not set
472# CONFIG_INPUT_TOUCHSCREEN is not set
473# CONFIG_INPUT_MISC is not set
474
475#
476# Hardware I/O ports
477#
478# CONFIG_SERIO is not set
479# CONFIG_GAMEPORT is not set
480
481#
482# Character devices
483#
484CONFIG_VT=y
485CONFIG_CONSOLE_TRANSLATIONS=y
486CONFIG_VT_CONSOLE=y
487CONFIG_HW_CONSOLE=y
488# CONFIG_VT_HW_CONSOLE_BINDING is not set
489CONFIG_DEVKMEM=y
490# CONFIG_SERIAL_NONSTANDARD is not set
491
492#
493# Serial drivers
494#
495# CONFIG_SERIAL_8250 is not set
496
497#
498# Non-8250 serial port support
499#
500CONFIG_SERIAL_PXA=y
501CONFIG_SERIAL_PXA_CONSOLE=y
502CONFIG_SERIAL_CORE=y
503CONFIG_SERIAL_CORE_CONSOLE=y
504CONFIG_UNIX98_PTYS=y
505# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
506# CONFIG_LEGACY_PTYS is not set
507# CONFIG_IPMI_HANDLER is not set
508# CONFIG_HW_RANDOM is not set
509# CONFIG_R3964 is not set
510# CONFIG_RAW_DRIVER is not set
511# CONFIG_TCG_TPM is not set
512# CONFIG_I2C is not set
513# CONFIG_SPI is not set
514CONFIG_ARCH_REQUIRE_GPIOLIB=y
515CONFIG_GPIOLIB=y
516# CONFIG_DEBUG_GPIO is not set
517# CONFIG_GPIO_SYSFS is not set
518
519#
520# Memory mapped GPIO expanders:
521#
522
523#
524# I2C GPIO expanders:
525#
526
527#
528# PCI GPIO expanders:
529#
530
531#
532# SPI GPIO expanders:
533#
534# CONFIG_W1 is not set
535# CONFIG_POWER_SUPPLY is not set
536# CONFIG_HWMON is not set
537# CONFIG_THERMAL is not set
538# CONFIG_THERMAL_HWMON is not set
539# CONFIG_WATCHDOG is not set
540CONFIG_SSB_POSSIBLE=y
541
542#
543# Sonics Silicon Backplane
544#
545# CONFIG_SSB is not set
546
547#
548# Multifunction device drivers
549#
550# CONFIG_MFD_CORE is not set
551# CONFIG_MFD_SM501 is not set
552# CONFIG_MFD_ASIC3 is not set
553# CONFIG_HTC_EGPIO is not set
554# CONFIG_HTC_PASIC3 is not set
555# CONFIG_MFD_TMIO is not set
556# CONFIG_MFD_T7L66XB is not set
557# CONFIG_MFD_TC6387XB is not set
558# CONFIG_MFD_TC6393XB is not set
559
560#
561# Multimedia devices
562#
563
564#
565# Multimedia core support
566#
567# CONFIG_VIDEO_DEV is not set
568# CONFIG_DVB_CORE is not set
569# CONFIG_VIDEO_MEDIA is not set
570
571#
572# Multimedia drivers
573#
574# CONFIG_DAB is not set
575
576#
577# Graphics support
578#
579# CONFIG_VGASTATE is not set
580# CONFIG_VIDEO_OUTPUT_CONTROL is not set
581# CONFIG_FB is not set
582# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
583
584#
585# Display device support
586#
587# CONFIG_DISPLAY_SUPPORT is not set
588
589#
590# Console display driver support
591#
592# CONFIG_VGA_CONSOLE is not set
593CONFIG_DUMMY_CONSOLE=y
594# CONFIG_SOUND is not set
595# CONFIG_HID_SUPPORT is not set
596# CONFIG_USB_SUPPORT is not set
597# CONFIG_MMC is not set
598# CONFIG_MEMSTICK is not set
599# CONFIG_ACCESSIBILITY is not set
600# CONFIG_NEW_LEDS is not set
601CONFIG_RTC_LIB=y
602# CONFIG_RTC_CLASS is not set
603# CONFIG_DMADEVICES is not set
604# CONFIG_REGULATOR is not set
605# CONFIG_UIO is not set
606# CONFIG_STAGING is not set
607
608#
609# File systems
610#
611# CONFIG_EXT2_FS is not set
612# CONFIG_EXT3_FS is not set
613# CONFIG_EXT4_FS is not set
614# CONFIG_REISERFS_FS is not set
615# CONFIG_JFS_FS is not set
616CONFIG_FS_POSIX_ACL=y
617CONFIG_FILE_LOCKING=y
618# CONFIG_XFS_FS is not set
619# CONFIG_OCFS2_FS is not set
620# CONFIG_BTRFS_FS is not set
621CONFIG_DNOTIFY=y
622CONFIG_INOTIFY=y
623CONFIG_INOTIFY_USER=y
624# CONFIG_QUOTA is not set
625# CONFIG_AUTOFS_FS is not set
626# CONFIG_AUTOFS4_FS is not set
627# CONFIG_FUSE_FS is not set
628CONFIG_GENERIC_ACL=y
629
630#
631# CD-ROM/DVD Filesystems
632#
633# CONFIG_ISO9660_FS is not set
634# CONFIG_UDF_FS is not set
635
636#
637# DOS/FAT/NT Filesystems
638#
639# CONFIG_MSDOS_FS is not set
640# CONFIG_VFAT_FS is not set
641# CONFIG_NTFS_FS is not set
642
643#
644# Pseudo filesystems
645#
646CONFIG_PROC_FS=y
647CONFIG_PROC_SYSCTL=y
648CONFIG_PROC_PAGE_MONITOR=y
649CONFIG_SYSFS=y
650CONFIG_TMPFS=y
651CONFIG_TMPFS_POSIX_ACL=y
652# CONFIG_HUGETLB_PAGE is not set
653# CONFIG_CONFIGFS_FS is not set
654CONFIG_MISC_FILESYSTEMS=y
655# CONFIG_ADFS_FS is not set
656# CONFIG_AFFS_FS is not set
657# CONFIG_HFS_FS is not set
658# CONFIG_HFSPLUS_FS is not set
659# CONFIG_BEFS_FS is not set
660# CONFIG_BFS_FS is not set
661# CONFIG_EFS_FS is not set
662CONFIG_CRAMFS=y
663# CONFIG_SQUASHFS is not set
664# CONFIG_VXFS_FS is not set
665# CONFIG_MINIX_FS is not set
666# CONFIG_OMFS_FS is not set
667# CONFIG_HPFS_FS is not set
668# CONFIG_QNX4FS_FS is not set
669# CONFIG_ROMFS_FS is not set
670# CONFIG_SYSV_FS is not set
671# CONFIG_UFS_FS is not set
672CONFIG_NETWORK_FILESYSTEMS=y
673CONFIG_NFS_FS=y
674CONFIG_NFS_V3=y
675CONFIG_NFS_V3_ACL=y
676CONFIG_NFS_V4=y
677CONFIG_ROOT_NFS=y
678# CONFIG_NFSD is not set
679CONFIG_LOCKD=y
680CONFIG_LOCKD_V4=y
681CONFIG_NFS_ACL_SUPPORT=y
682CONFIG_NFS_COMMON=y
683CONFIG_SUNRPC=y
684CONFIG_SUNRPC_GSS=y
685# CONFIG_SUNRPC_REGISTER_V4 is not set
686CONFIG_RPCSEC_GSS_KRB5=y
687# CONFIG_RPCSEC_GSS_SPKM3 is not set
688# CONFIG_SMB_FS is not set
689# CONFIG_CIFS is not set
690# CONFIG_NCP_FS is not set
691# CONFIG_CODA_FS is not set
692# CONFIG_AFS_FS is not set
693
694#
695# Partition Types
696#
697# CONFIG_PARTITION_ADVANCED is not set
698CONFIG_MSDOS_PARTITION=y
699# CONFIG_NLS is not set
700# CONFIG_DLM is not set
701
702#
703# Kernel hacking
704#
705CONFIG_PRINTK_TIME=y
706CONFIG_ENABLE_WARN_DEPRECATED=y
707CONFIG_ENABLE_MUST_CHECK=y
708CONFIG_FRAME_WARN=1024
709CONFIG_MAGIC_SYSRQ=y
710# CONFIG_UNUSED_SYMBOLS is not set
711# CONFIG_DEBUG_FS is not set
712# CONFIG_HEADERS_CHECK is not set
713CONFIG_DEBUG_KERNEL=y
714# CONFIG_DEBUG_SHIRQ is not set
715CONFIG_DETECT_SOFTLOCKUP=y
716# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
717CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
718CONFIG_SCHED_DEBUG=y
719# CONFIG_SCHEDSTATS is not set
720# CONFIG_TIMER_STATS is not set
721# CONFIG_DEBUG_OBJECTS is not set
722# CONFIG_DEBUG_SLAB is not set
723# CONFIG_DEBUG_PREEMPT is not set
724# CONFIG_DEBUG_RT_MUTEXES is not set
725# CONFIG_RT_MUTEX_TESTER is not set
726# CONFIG_DEBUG_SPINLOCK is not set
727# CONFIG_DEBUG_MUTEXES is not set
728# CONFIG_DEBUG_LOCK_ALLOC is not set
729# CONFIG_PROVE_LOCKING is not set
730# CONFIG_LOCK_STAT is not set
731# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
732# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
733# CONFIG_DEBUG_KOBJECT is not set
734CONFIG_DEBUG_BUGVERBOSE=y
735CONFIG_DEBUG_INFO=y
736# CONFIG_DEBUG_VM is not set
737# CONFIG_DEBUG_WRITECOUNT is not set
738CONFIG_DEBUG_MEMORY_INIT=y
739# CONFIG_DEBUG_LIST is not set
740# CONFIG_DEBUG_SG is not set
741# CONFIG_DEBUG_NOTIFIERS is not set
742# CONFIG_BOOT_PRINTK_DELAY is not set
743# CONFIG_RCU_TORTURE_TEST is not set
744# CONFIG_RCU_CPU_STALL_DETECTOR is not set
745# CONFIG_BACKTRACE_SELF_TEST is not set
746# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
747# CONFIG_FAULT_INJECTION is not set
748# CONFIG_LATENCYTOP is not set
749# CONFIG_SYSCTL_SYSCALL_CHECK is not set
750CONFIG_HAVE_FUNCTION_TRACER=y
751
752#
753# Tracers
754#
755# CONFIG_FUNCTION_TRACER is not set
756# CONFIG_IRQSOFF_TRACER is not set
757# CONFIG_PREEMPT_TRACER is not set
758# CONFIG_SCHED_TRACER is not set
759# CONFIG_CONTEXT_SWITCH_TRACER is not set
760# CONFIG_BOOT_TRACER is not set
761# CONFIG_TRACE_BRANCH_PROFILING is not set
762# CONFIG_STACK_TRACER is not set
763# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
764# CONFIG_SAMPLES is not set
765CONFIG_HAVE_ARCH_KGDB=y
766# CONFIG_KGDB is not set
767CONFIG_ARM_UNWIND=y
768CONFIG_DEBUG_USER=y
769CONFIG_DEBUG_ERRORS=y
770# CONFIG_DEBUG_STACK_USAGE is not set
771CONFIG_DEBUG_LL=y
772# CONFIG_DEBUG_ICEDCC is not set
773
774#
775# Security options
776#
777# CONFIG_KEYS is not set
778# CONFIG_SECURITY is not set
779# CONFIG_SECURITYFS is not set
780# CONFIG_SECURITY_FILE_CAPABILITIES is not set
781CONFIG_CRYPTO=y
782
783#
784# Crypto core or helper
785#
786# CONFIG_CRYPTO_FIPS is not set
787CONFIG_CRYPTO_ALGAPI=y
788CONFIG_CRYPTO_ALGAPI2=y
789CONFIG_CRYPTO_AEAD2=y
790CONFIG_CRYPTO_BLKCIPHER=y
791CONFIG_CRYPTO_BLKCIPHER2=y
792CONFIG_CRYPTO_HASH=y
793CONFIG_CRYPTO_HASH2=y
794CONFIG_CRYPTO_RNG2=y
795CONFIG_CRYPTO_MANAGER=y
796CONFIG_CRYPTO_MANAGER2=y
797# CONFIG_CRYPTO_GF128MUL is not set
798# CONFIG_CRYPTO_NULL is not set
799# CONFIG_CRYPTO_CRYPTD is not set
800# CONFIG_CRYPTO_AUTHENC is not set
801# CONFIG_CRYPTO_TEST is not set
802
803#
804# Authenticated Encryption with Associated Data
805#
806# CONFIG_CRYPTO_CCM is not set
807# CONFIG_CRYPTO_GCM is not set
808# CONFIG_CRYPTO_SEQIV is not set
809
810#
811# Block modes
812#
813CONFIG_CRYPTO_CBC=y
814# CONFIG_CRYPTO_CTR is not set
815# CONFIG_CRYPTO_CTS is not set
816# CONFIG_CRYPTO_ECB is not set
817# CONFIG_CRYPTO_LRW is not set
818# CONFIG_CRYPTO_PCBC is not set
819# CONFIG_CRYPTO_XTS is not set
820
821#
822# Hash modes
823#
824# CONFIG_CRYPTO_HMAC is not set
825# CONFIG_CRYPTO_XCBC is not set
826
827#
828# Digest
829#
830# CONFIG_CRYPTO_CRC32C is not set
831# CONFIG_CRYPTO_MD4 is not set
832CONFIG_CRYPTO_MD5=y
833# CONFIG_CRYPTO_MICHAEL_MIC is not set
834# CONFIG_CRYPTO_RMD128 is not set
835# CONFIG_CRYPTO_RMD160 is not set
836# CONFIG_CRYPTO_RMD256 is not set
837# CONFIG_CRYPTO_RMD320 is not set
838# CONFIG_CRYPTO_SHA1 is not set
839# CONFIG_CRYPTO_SHA256 is not set
840# CONFIG_CRYPTO_SHA512 is not set
841# CONFIG_CRYPTO_TGR192 is not set
842# CONFIG_CRYPTO_WP512 is not set
843
844#
845# Ciphers
846#
847# CONFIG_CRYPTO_AES is not set
848# CONFIG_CRYPTO_ANUBIS is not set
849# CONFIG_CRYPTO_ARC4 is not set
850# CONFIG_CRYPTO_BLOWFISH is not set
851# CONFIG_CRYPTO_CAMELLIA is not set
852# CONFIG_CRYPTO_CAST5 is not set
853# CONFIG_CRYPTO_CAST6 is not set
854CONFIG_CRYPTO_DES=y
855# CONFIG_CRYPTO_FCRYPT is not set
856# CONFIG_CRYPTO_KHAZAD is not set
857# CONFIG_CRYPTO_SALSA20 is not set
858# CONFIG_CRYPTO_SEED is not set
859# CONFIG_CRYPTO_SERPENT is not set
860# CONFIG_CRYPTO_TEA is not set
861# CONFIG_CRYPTO_TWOFISH is not set
862
863#
864# Compression
865#
866# CONFIG_CRYPTO_DEFLATE is not set
867# CONFIG_CRYPTO_LZO is not set
868
869#
870# Random Number Generation
871#
872# CONFIG_CRYPTO_ANSI_CPRNG is not set
873CONFIG_CRYPTO_HW=y
874
875#
876# Library routines
877#
878CONFIG_BITREVERSE=y
879CONFIG_GENERIC_FIND_LAST_BIT=y
880CONFIG_CRC_CCITT=y
881# CONFIG_CRC16 is not set
882# CONFIG_CRC_T10DIF is not set
883# CONFIG_CRC_ITU_T is not set
884CONFIG_CRC32=y
885# CONFIG_CRC7 is not set
886# CONFIG_LIBCRC32C is not set
887CONFIG_ZLIB_INFLATE=y
888CONFIG_PLIST=y
889CONFIG_HAS_IOMEM=y
890CONFIG_HAS_IOPORT=y
891CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/rx51_defconfig b/arch/arm/configs/rx51_defconfig
new file mode 100644
index 000000000000..593102da8cd7
--- /dev/null
+++ b/arch/arm/configs/rx51_defconfig
@@ -0,0 +1,1821 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc8
4# Fri Mar 13 15:28:56 2009
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_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
24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_INIT_ENV_ARG_LIMIT=32
35CONFIG_LOCALVERSION=""
36CONFIG_LOCALVERSION_AUTO=y
37CONFIG_SWAP=y
38CONFIG_SYSVIPC=y
39CONFIG_SYSVIPC_SYSCTL=y
40CONFIG_POSIX_MQUEUE=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_CLASSIC_RCU=y
50# CONFIG_TREE_RCU is not set
51# CONFIG_PREEMPT_RCU is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set
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_CC_OPTIMIZE_FOR_SIZE=y
69CONFIG_SYSCTL=y
70CONFIG_ANON_INODES=y
71CONFIG_EMBEDDED=y
72CONFIG_UID16=y
73# CONFIG_SYSCTL_SYSCALL is not set
74CONFIG_KALLSYMS=y
75CONFIG_KALLSYMS_ALL=y
76CONFIG_KALLSYMS_EXTRA_PASS=y
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
89CONFIG_VM_EVENT_COUNTERS=y
90CONFIG_COMPAT_BRK=y
91CONFIG_SLAB=y
92# CONFIG_SLUB is not set
93# CONFIG_SLOB is not set
94# CONFIG_PROFILING is not set
95CONFIG_HAVE_OPROFILE=y
96CONFIG_KPROBES=y
97CONFIG_KRETPROBES=y
98CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_SLABINFO=y
103CONFIG_RT_MUTEXES=y
104CONFIG_BASE_SMALL=0
105CONFIG_MODULES=y
106CONFIG_MODULE_FORCE_LOAD=y
107CONFIG_MODULE_UNLOAD=y
108CONFIG_MODULE_FORCE_UNLOAD=y
109CONFIG_MODVERSIONS=y
110CONFIG_MODULE_SRCVERSION_ALL=y
111CONFIG_BLOCK=y
112# CONFIG_LBD is not set
113# CONFIG_BLK_DEV_IO_TRACE is not set
114# CONFIG_BLK_DEV_BSG is not set
115# CONFIG_BLK_DEV_INTEGRITY is not set
116
117#
118# IO Schedulers
119#
120CONFIG_IOSCHED_NOOP=y
121# CONFIG_IOSCHED_AS is not set
122# CONFIG_IOSCHED_DEADLINE is not set
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"
129CONFIG_FREEZER=y
130
131#
132# System Type
133#
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_EBSA110 is not set
141# CONFIG_ARCH_EP93XX is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set
143# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set
146# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set
149# CONFIG_ARCH_IXP23XX is not set
150# CONFIG_ARCH_IXP2000 is not set
151# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set
154# CONFIG_ARCH_KS8695 is not set
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_ORION5X is not set
160# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set
162# CONFIG_ARCH_RPC is not set
163# CONFIG_ARCH_SA1100 is not set
164# CONFIG_ARCH_S3C2410 is not set
165# CONFIG_ARCH_S3C64XX is not set
166# CONFIG_ARCH_SHARK is not set
167# CONFIG_ARCH_LH7A40X is not set
168# CONFIG_ARCH_DAVINCI is not set
169CONFIG_ARCH_OMAP=y
170# CONFIG_ARCH_MSM is not set
171# CONFIG_ARCH_W90X900 is not set
172
173#
174# TI OMAP Implementations
175#
176CONFIG_ARCH_OMAP_OTG=y
177# CONFIG_ARCH_OMAP1 is not set
178# CONFIG_ARCH_OMAP2 is not set
179CONFIG_ARCH_OMAP3=y
180
181#
182# OMAP Feature Selections
183#
184# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
185# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
186CONFIG_OMAP_RESET_CLOCKS=y
187CONFIG_OMAP_MUX=y
188CONFIG_OMAP_MUX_DEBUG=y
189CONFIG_OMAP_MUX_WARNINGS=y
190CONFIG_OMAP_MCBSP=y
191# CONFIG_OMAP_MPU_TIMER is not set
192CONFIG_OMAP_32K_TIMER=y
193CONFIG_OMAP_32K_TIMER_HZ=128
194CONFIG_OMAP_DM_TIMER=y
195# CONFIG_OMAP_LL_DEBUG_UART1 is not set
196# CONFIG_OMAP_LL_DEBUG_UART2 is not set
197CONFIG_OMAP_LL_DEBUG_UART3=y
198CONFIG_OMAP_SERIAL_WAKE=y
199CONFIG_ARCH_OMAP34XX=y
200CONFIG_ARCH_OMAP3430=y
201
202#
203# OMAP Board Type
204#
205# CONFIG_MACH_OMAP3_BEAGLE is not set
206# CONFIG_MACH_OMAP_LDP is not set
207# CONFIG_MACH_OVERO is not set
208# CONFIG_MACH_OMAP3_PANDORA is not set
209# CONFIG_MACH_OMAP_3430SDP is not set
210CONFIG_MACH_NOKIA_RX51=y
211
212#
213# Processor Type
214#
215CONFIG_CPU_32=y
216CONFIG_CPU_32v6K=y
217CONFIG_CPU_V7=y
218CONFIG_CPU_32v7=y
219CONFIG_CPU_ABRT_EV7=y
220CONFIG_CPU_PABRT_IFAR=y
221CONFIG_CPU_CACHE_V7=y
222CONFIG_CPU_CACHE_VIPT=y
223CONFIG_CPU_COPY_V6=y
224CONFIG_CPU_TLB_V7=y
225CONFIG_CPU_HAS_ASID=y
226CONFIG_CPU_CP15=y
227CONFIG_CPU_CP15_MMU=y
228
229#
230# Processor Features
231#
232CONFIG_ARM_THUMB=y
233# CONFIG_ARM_THUMBEE is not set
234# CONFIG_CPU_ICACHE_DISABLE is not set
235# CONFIG_CPU_DCACHE_DISABLE is not set
236# CONFIG_CPU_BPREDICT_DISABLE is not set
237CONFIG_HAS_TLS_REG=y
238# CONFIG_OUTER_CACHE is not set
239
240#
241# Bus support
242#
243# CONFIG_PCI_SYSCALL is not set
244# CONFIG_ARCH_SUPPORTS_MSI is not set
245# CONFIG_PCCARD is not set
246
247#
248# Kernel Features
249#
250CONFIG_TICK_ONESHOT=y
251CONFIG_NO_HZ=y
252CONFIG_HIGH_RES_TIMERS=y
253CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
254CONFIG_VMSPLIT_3G=y
255# CONFIG_VMSPLIT_2G is not set
256# CONFIG_VMSPLIT_1G is not set
257CONFIG_PAGE_OFFSET=0xC0000000
258# CONFIG_PREEMPT is not set
259CONFIG_HZ=128
260CONFIG_AEABI=y
261# CONFIG_OABI_COMPAT is not set
262CONFIG_ARCH_FLATMEM_HAS_HOLES=y
263# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
264# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
265CONFIG_SELECT_MEMORY_MODEL=y
266CONFIG_FLATMEM_MANUAL=y
267# CONFIG_DISCONTIGMEM_MANUAL is not set
268# CONFIG_SPARSEMEM_MANUAL is not set
269CONFIG_FLATMEM=y
270CONFIG_FLAT_NODE_MEM_MAP=y
271CONFIG_PAGEFLAGS_EXTENDED=y
272CONFIG_SPLIT_PTLOCK_CPUS=4
273# CONFIG_PHYS_ADDR_T_64BIT is not set
274CONFIG_ZONE_DMA_FLAG=0
275CONFIG_VIRT_TO_BUS=y
276CONFIG_UNEVICTABLE_LRU=y
277# CONFIG_LEDS is not set
278CONFIG_ALIGNMENT_TRAP=y
279
280#
281# Boot options
282#
283CONFIG_ZBOOT_ROM_TEXT=0x0
284CONFIG_ZBOOT_ROM_BSS=0x0
285CONFIG_CMDLINE="init=/sbin/preinit ubi.mtd=4 root=ubi0:rootfs rootfstype=ubifs rw console=ttyMTD5"
286# CONFIG_XIP_KERNEL is not set
287# CONFIG_KEXEC is not set
288
289#
290# CPU Power Management
291#
292# CONFIG_CPU_FREQ is not set
293# CONFIG_CPU_IDLE is not set
294
295#
296# Floating point emulation
297#
298
299#
300# At least one emulation must be selected
301#
302CONFIG_VFP=y
303CONFIG_VFPv3=y
304CONFIG_NEON=y
305
306#
307# Userspace binary formats
308#
309CONFIG_BINFMT_ELF=y
310# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
311CONFIG_HAVE_AOUT=y
312# CONFIG_BINFMT_AOUT is not set
313CONFIG_BINFMT_MISC=y
314
315#
316# Power management options
317#
318CONFIG_PM=y
319CONFIG_PM_DEBUG=y
320# CONFIG_PM_VERBOSE is not set
321CONFIG_CAN_PM_TRACE=y
322CONFIG_PM_SLEEP=y
323CONFIG_SUSPEND=y
324CONFIG_SUSPEND_FREEZER=y
325# CONFIG_APM_EMULATION is not set
326CONFIG_ARCH_SUSPEND_POSSIBLE=y
327CONFIG_NET=y
328
329#
330# Networking options
331#
332CONFIG_COMPAT_NET_DEV_OPS=y
333CONFIG_PACKET=y
334# CONFIG_PACKET_MMAP is not set
335CONFIG_UNIX=y
336CONFIG_XFRM=y
337# CONFIG_XFRM_USER is not set
338# CONFIG_XFRM_SUB_POLICY is not set
339# CONFIG_XFRM_MIGRATE is not set
340# CONFIG_XFRM_STATISTICS is not set
341CONFIG_NET_KEY=y
342# CONFIG_NET_KEY_MIGRATE is not set
343CONFIG_INET=y
344# CONFIG_IP_MULTICAST is not set
345# CONFIG_IP_ADVANCED_ROUTER is not set
346CONFIG_IP_FIB_HASH=y
347CONFIG_IP_PNP=y
348CONFIG_IP_PNP_DHCP=y
349CONFIG_IP_PNP_BOOTP=y
350CONFIG_IP_PNP_RARP=y
351# CONFIG_NET_IPIP is not set
352# CONFIG_NET_IPGRE is not set
353# CONFIG_ARPD is not set
354# CONFIG_SYN_COOKIES is not set
355# CONFIG_INET_AH is not set
356# CONFIG_INET_ESP is not set
357# CONFIG_INET_IPCOMP is not set
358# CONFIG_INET_XFRM_TUNNEL is not set
359# CONFIG_INET_TUNNEL is not set
360CONFIG_INET_XFRM_MODE_TRANSPORT=y
361CONFIG_INET_XFRM_MODE_TUNNEL=y
362CONFIG_INET_XFRM_MODE_BEET=y
363# CONFIG_INET_LRO is not set
364CONFIG_INET_DIAG=y
365CONFIG_INET_TCP_DIAG=y
366# CONFIG_TCP_CONG_ADVANCED is not set
367CONFIG_TCP_CONG_CUBIC=y
368CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_TCP_MD5SIG is not set
370# CONFIG_IPV6 is not set
371# CONFIG_NETLABEL is not set
372# CONFIG_NETWORK_SECMARK is not set
373CONFIG_NETFILTER=y
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
383CONFIG_NETFILTER_XTABLES=m
384# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
385# CONFIG_NETFILTER_XT_TARGET_MARK is not set
386# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
387# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
388# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
389# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
390# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
391# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
392# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
393# CONFIG_NETFILTER_XT_MATCH_ESP is not set
394# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
395# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
396# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
397# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
398# CONFIG_NETFILTER_XT_MATCH_MAC is not set
399# CONFIG_NETFILTER_XT_MATCH_MARK is not set
400# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
401# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
402# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
403# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
404# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
405# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
406# CONFIG_NETFILTER_XT_MATCH_REALM is not set
407# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
408# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
409# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
410# CONFIG_NETFILTER_XT_MATCH_STRING is not set
411# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
412# CONFIG_NETFILTER_XT_MATCH_TIME is not set
413# CONFIG_NETFILTER_XT_MATCH_U32 is not set
414# CONFIG_IP_VS is not set
415
416#
417# IP: Netfilter Configuration
418#
419# CONFIG_NF_DEFRAG_IPV4 is not set
420# CONFIG_IP_NF_QUEUE is not set
421CONFIG_IP_NF_IPTABLES=m
422# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
423# CONFIG_IP_NF_MATCH_AH is not set
424# CONFIG_IP_NF_MATCH_ECN is not set
425# CONFIG_IP_NF_MATCH_TTL is not set
426CONFIG_IP_NF_FILTER=m
427# CONFIG_IP_NF_TARGET_REJECT is not set
428# CONFIG_IP_NF_TARGET_LOG is not set
429# CONFIG_IP_NF_TARGET_ULOG is not set
430# CONFIG_IP_NF_MANGLE is not set
431# CONFIG_IP_NF_RAW is not set
432# CONFIG_IP_NF_SECURITY is not set
433# CONFIG_IP_NF_ARPTABLES is not set
434# CONFIG_IP_DCCP is not set
435# CONFIG_IP_SCTP is not set
436# CONFIG_TIPC is not set
437# CONFIG_ATM is not set
438# CONFIG_BRIDGE is not set
439# CONFIG_NET_DSA is not set
440# CONFIG_VLAN_8021Q is not set
441# CONFIG_DECNET is not set
442# CONFIG_LLC2 is not set
443# CONFIG_IPX is not set
444# CONFIG_ATALK is not set
445# CONFIG_X25 is not set
446# CONFIG_LAPB is not set
447# CONFIG_ECONET is not set
448# CONFIG_WAN_ROUTER is not set
449# CONFIG_NET_SCHED is not set
450# CONFIG_DCB is not set
451
452#
453# Network testing
454#
455# CONFIG_NET_PKTGEN is not set
456# CONFIG_NET_TCPPROBE is not set
457# CONFIG_HAMRADIO is not set
458# CONFIG_CAN is not set
459# CONFIG_IRDA is not set
460CONFIG_BT=m
461CONFIG_BT_L2CAP=m
462CONFIG_BT_SCO=m
463CONFIG_BT_RFCOMM=m
464CONFIG_BT_RFCOMM_TTY=y
465CONFIG_BT_BNEP=m
466CONFIG_BT_BNEP_MC_FILTER=y
467CONFIG_BT_BNEP_PROTO_FILTER=y
468CONFIG_BT_HIDP=m
469
470#
471# Bluetooth device drivers
472#
473# CONFIG_BT_HCIBTUSB is not set
474# CONFIG_BT_HCIBTSDIO is not set
475# CONFIG_BT_HCIUART is not set
476# CONFIG_BT_HCIBCM203X is not set
477# CONFIG_BT_HCIBPA10X is not set
478# CONFIG_BT_HCIBFUSB is not set
479# CONFIG_BT_HCIVHCI is not set
480# CONFIG_AF_RXRPC is not set
481# CONFIG_PHONET is not set
482CONFIG_WIRELESS=y
483CONFIG_CFG80211=y
484# CONFIG_CFG80211_REG_DEBUG is not set
485CONFIG_NL80211=y
486CONFIG_WIRELESS_OLD_REGULATORY=y
487CONFIG_WIRELESS_EXT=y
488CONFIG_WIRELESS_EXT_SYSFS=y
489# CONFIG_LIB80211 is not set
490CONFIG_MAC80211=m
491
492#
493# Rate control algorithm selection
494#
495CONFIG_MAC80211_RC_PID=y
496# CONFIG_MAC80211_RC_MINSTREL is not set
497CONFIG_MAC80211_RC_DEFAULT_PID=y
498# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
499CONFIG_MAC80211_RC_DEFAULT="pid"
500# CONFIG_MAC80211_MESH is not set
501# CONFIG_MAC80211_LEDS is not set
502# CONFIG_MAC80211_DEBUGFS is not set
503# CONFIG_MAC80211_DEBUG_MENU is not set
504# CONFIG_WIMAX is not set
505# CONFIG_RFKILL is not set
506# CONFIG_NET_9P is not set
507
508#
509# Device Drivers
510#
511
512#
513# Generic Driver Options
514#
515CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
516CONFIG_STANDALONE=y
517CONFIG_PREVENT_FIRMWARE_BUILD=y
518CONFIG_FW_LOADER=y
519CONFIG_FIRMWARE_IN_KERNEL=y
520CONFIG_EXTRA_FIRMWARE=""
521# CONFIG_DEBUG_DRIVER is not set
522# CONFIG_DEBUG_DEVRES is not set
523# CONFIG_SYS_HYPERVISOR is not set
524# CONFIG_CONNECTOR is not set
525CONFIG_MTD=y
526# CONFIG_MTD_DEBUG is not set
527CONFIG_MTD_CONCAT=y
528CONFIG_MTD_PARTITIONS=y
529# CONFIG_MTD_TESTS is not set
530# CONFIG_MTD_REDBOOT_PARTS is not set
531CONFIG_MTD_CMDLINE_PARTS=y
532# CONFIG_MTD_AFS_PARTS is not set
533# CONFIG_MTD_AR7_PARTS is not set
534
535#
536# User Modules And Translation Layers
537#
538CONFIG_MTD_CHAR=y
539CONFIG_MTD_BLKDEVS=y
540CONFIG_MTD_BLOCK=y
541# CONFIG_FTL is not set
542# CONFIG_NFTL is not set
543# CONFIG_INFTL is not set
544# CONFIG_RFD_FTL is not set
545# CONFIG_SSFDC is not set
546CONFIG_MTD_OOPS=y
547
548#
549# RAM/ROM/Flash chip drivers
550#
551CONFIG_MTD_CFI=y
552# CONFIG_MTD_JEDECPROBE is not set
553CONFIG_MTD_GEN_PROBE=y
554# CONFIG_MTD_CFI_ADV_OPTIONS is not set
555CONFIG_MTD_MAP_BANK_WIDTH_1=y
556CONFIG_MTD_MAP_BANK_WIDTH_2=y
557CONFIG_MTD_MAP_BANK_WIDTH_4=y
558# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
559# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
560# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
561CONFIG_MTD_CFI_I1=y
562CONFIG_MTD_CFI_I2=y
563# CONFIG_MTD_CFI_I4 is not set
564# CONFIG_MTD_CFI_I8 is not set
565CONFIG_MTD_CFI_INTELEXT=y
566# CONFIG_MTD_CFI_AMDSTD is not set
567# CONFIG_MTD_CFI_STAA is not set
568CONFIG_MTD_CFI_UTIL=y
569# CONFIG_MTD_RAM is not set
570# CONFIG_MTD_ROM is not set
571# CONFIG_MTD_ABSENT is not set
572
573#
574# Mapping drivers for chip access
575#
576# CONFIG_MTD_COMPLEX_MAPPINGS is not set
577# CONFIG_MTD_PHYSMAP is not set
578# CONFIG_MTD_ARM_INTEGRATOR is not set
579# CONFIG_MTD_OMAP_NOR is not set
580# CONFIG_MTD_PLATRAM is not set
581
582#
583# Self-contained MTD device drivers
584#
585# CONFIG_MTD_DATAFLASH is not set
586# CONFIG_MTD_M25P80 is not set
587# CONFIG_MTD_SLRAM is not set
588# CONFIG_MTD_PHRAM is not set
589# CONFIG_MTD_MTDRAM is not set
590# CONFIG_MTD_BLOCK2MTD is not set
591
592#
593# Disk-On-Chip Device Drivers
594#
595# CONFIG_MTD_DOC2000 is not set
596# CONFIG_MTD_DOC2001 is not set
597# CONFIG_MTD_DOC2001PLUS is not set
598# CONFIG_MTD_NAND is not set
599CONFIG_MTD_ONENAND=y
600# CONFIG_MTD_ONENAND_VERIFY_WRITE is not set
601# CONFIG_MTD_ONENAND_GENERIC is not set
602CONFIG_MTD_ONENAND_OMAP2=y
603# CONFIG_MTD_ONENAND_OTP is not set
604# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
605# CONFIG_MTD_ONENAND_SIM is not set
606
607#
608# LPDDR flash memory drivers
609#
610# CONFIG_MTD_LPDDR is not set
611
612#
613# UBI - Unsorted block images
614#
615CONFIG_MTD_UBI=y
616CONFIG_MTD_UBI_WL_THRESHOLD=4096
617CONFIG_MTD_UBI_BEB_RESERVE=1
618# CONFIG_MTD_UBI_GLUEBI is not set
619
620#
621# UBI debugging options
622#
623# CONFIG_MTD_UBI_DEBUG is not set
624# CONFIG_PARPORT is not set
625CONFIG_BLK_DEV=y
626# CONFIG_BLK_DEV_COW_COMMON is not set
627CONFIG_BLK_DEV_LOOP=y
628# CONFIG_BLK_DEV_CRYPTOLOOP is not set
629# CONFIG_BLK_DEV_NBD is not set
630# CONFIG_BLK_DEV_UB is not set
631CONFIG_BLK_DEV_RAM=y
632CONFIG_BLK_DEV_RAM_COUNT=16
633CONFIG_BLK_DEV_RAM_SIZE=4096
634# CONFIG_BLK_DEV_XIP is not set
635# CONFIG_CDROM_PKTCDVD is not set
636# CONFIG_ATA_OVER_ETH is not set
637CONFIG_MISC_DEVICES=y
638# CONFIG_ICS932S401 is not set
639# CONFIG_ENCLOSURE_SERVICES is not set
640# CONFIG_C2PORT is not set
641
642#
643# EEPROM support
644#
645# CONFIG_EEPROM_AT24 is not set
646# CONFIG_EEPROM_AT25 is not set
647# CONFIG_EEPROM_LEGACY is not set
648# CONFIG_EEPROM_93CX6 is not set
649CONFIG_HAVE_IDE=y
650# CONFIG_IDE is not set
651
652#
653# SCSI device support
654#
655# CONFIG_RAID_ATTRS is not set
656CONFIG_SCSI=m
657CONFIG_SCSI_DMA=y
658# CONFIG_SCSI_TGT is not set
659# CONFIG_SCSI_NETLINK is not set
660CONFIG_SCSI_PROC_FS=y
661
662#
663# SCSI support type (disk, tape, CD-ROM)
664#
665CONFIG_BLK_DEV_SD=m
666# CONFIG_CHR_DEV_ST is not set
667# CONFIG_CHR_DEV_OSST is not set
668# CONFIG_BLK_DEV_SR is not set
669# CONFIG_CHR_DEV_SG is not set
670# CONFIG_CHR_DEV_SCH is not set
671
672#
673# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
674#
675CONFIG_SCSI_MULTI_LUN=y
676# CONFIG_SCSI_CONSTANTS is not set
677# CONFIG_SCSI_LOGGING is not set
678CONFIG_SCSI_SCAN_ASYNC=y
679CONFIG_SCSI_WAIT_SCAN=m
680
681#
682# SCSI Transports
683#
684# CONFIG_SCSI_SPI_ATTRS is not set
685# CONFIG_SCSI_FC_ATTRS is not set
686# CONFIG_SCSI_ISCSI_ATTRS is not set
687# CONFIG_SCSI_SAS_LIBSAS is not set
688# CONFIG_SCSI_SRP_ATTRS is not set
689CONFIG_SCSI_LOWLEVEL=y
690# CONFIG_ISCSI_TCP is not set
691# CONFIG_LIBFC is not set
692# CONFIG_SCSI_DEBUG is not set
693# CONFIG_SCSI_DH is not set
694# CONFIG_ATA is not set
695# CONFIG_MD is not set
696CONFIG_NETDEVICES=y
697# CONFIG_DUMMY is not set
698# CONFIG_BONDING is not set
699# CONFIG_MACVLAN is not set
700# CONFIG_EQUALIZER is not set
701CONFIG_TUN=m
702# CONFIG_VETH is not set
703# CONFIG_PHYLIB is not set
704CONFIG_NET_ETHERNET=y
705CONFIG_MII=m
706# CONFIG_AX88796 is not set
707CONFIG_SMC91X=m
708# CONFIG_DM9000 is not set
709# CONFIG_ENC28J60 is not set
710# CONFIG_SMC911X is not set
711# CONFIG_SMSC911X is not set
712# CONFIG_IBM_NEW_EMAC_ZMII is not set
713# CONFIG_IBM_NEW_EMAC_RGMII is not set
714# CONFIG_IBM_NEW_EMAC_TAH is not set
715# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
716# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
717# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
718# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
719# CONFIG_B44 is not set
720# CONFIG_NETDEV_1000 is not set
721# CONFIG_NETDEV_10000 is not set
722
723#
724# Wireless LAN
725#
726# CONFIG_WLAN_PRE80211 is not set
727CONFIG_WLAN_80211=y
728# CONFIG_LIBERTAS is not set
729# CONFIG_LIBERTAS_THINFIRM is not set
730# CONFIG_USB_ZD1201 is not set
731# CONFIG_USB_NET_RNDIS_WLAN is not set
732# CONFIG_RTL8187 is not set
733# CONFIG_MAC80211_HWSIM is not set
734# CONFIG_P54_COMMON is not set
735# CONFIG_IWLWIFI_LEDS is not set
736# CONFIG_HOSTAP is not set
737# CONFIG_B43 is not set
738# CONFIG_B43LEGACY is not set
739# CONFIG_ZD1211RW is not set
740# CONFIG_RT2X00 is not set
741
742#
743# Enable WiMAX (Networking options) to see the WiMAX drivers
744#
745
746#
747# USB Network Adapters
748#
749# CONFIG_USB_CATC is not set
750# CONFIG_USB_KAWETH is not set
751# CONFIG_USB_PEGASUS is not set
752# CONFIG_USB_RTL8150 is not set
753# CONFIG_USB_USBNET is not set
754# CONFIG_WAN is not set
755# CONFIG_PPP is not set
756# CONFIG_SLIP is not set
757# CONFIG_NETCONSOLE is not set
758# CONFIG_NETPOLL is not set
759# CONFIG_NET_POLL_CONTROLLER is not set
760# CONFIG_ISDN is not set
761
762#
763# Input device support
764#
765CONFIG_INPUT=y
766# CONFIG_INPUT_FF_MEMLESS is not set
767# CONFIG_INPUT_POLLDEV is not set
768
769#
770# Userland interfaces
771#
772# CONFIG_INPUT_MOUSEDEV is not set
773# CONFIG_INPUT_JOYDEV is not set
774CONFIG_INPUT_EVDEV=y
775# CONFIG_INPUT_EVBUG is not set
776
777#
778# Input Device Drivers
779#
780CONFIG_INPUT_KEYBOARD=y
781# CONFIG_KEYBOARD_ATKBD is not set
782# CONFIG_KEYBOARD_SUNKBD is not set
783# CONFIG_KEYBOARD_LKKBD is not set
784# CONFIG_KEYBOARD_XTKBD is not set
785# CONFIG_KEYBOARD_NEWTON is not set
786# CONFIG_KEYBOARD_STOWAWAY is not set
787# CONFIG_KEYBOARD_GPIO is not set
788# CONFIG_INPUT_MOUSE is not set
789# CONFIG_INPUT_JOYSTICK is not set
790# CONFIG_INPUT_TABLET is not set
791CONFIG_INPUT_TOUCHSCREEN=y
792# CONFIG_TOUCHSCREEN_ADS7846 is not set
793# CONFIG_TOUCHSCREEN_FUJITSU is not set
794# CONFIG_TOUCHSCREEN_GUNZE is not set
795# CONFIG_TOUCHSCREEN_ELO is not set
796# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
797# CONFIG_TOUCHSCREEN_MTOUCH is not set
798# CONFIG_TOUCHSCREEN_INEXIO is not set
799# CONFIG_TOUCHSCREEN_MK712 is not set
800# CONFIG_TOUCHSCREEN_PENMOUNT is not set
801# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
802# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
803# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
804# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
805# CONFIG_TOUCHSCREEN_TSC2007 is not set
806CONFIG_INPUT_MISC=y
807# CONFIG_INPUT_ATI_REMOTE is not set
808# CONFIG_INPUT_ATI_REMOTE2 is not set
809# CONFIG_INPUT_KEYSPAN_REMOTE is not set
810# CONFIG_INPUT_POWERMATE is not set
811# CONFIG_INPUT_YEALINK is not set
812# CONFIG_INPUT_CM109 is not set
813CONFIG_INPUT_UINPUT=m
814
815#
816# Hardware I/O ports
817#
818# CONFIG_SERIO is not set
819# CONFIG_GAMEPORT is not set
820
821#
822# Character devices
823#
824CONFIG_VT=y
825CONFIG_CONSOLE_TRANSLATIONS=y
826CONFIG_VT_CONSOLE=y
827CONFIG_HW_CONSOLE=y
828# CONFIG_VT_HW_CONSOLE_BINDING is not set
829CONFIG_DEVKMEM=y
830# CONFIG_SERIAL_NONSTANDARD is not set
831
832#
833# Serial drivers
834#
835CONFIG_SERIAL_8250=y
836CONFIG_SERIAL_8250_CONSOLE=y
837CONFIG_SERIAL_8250_NR_UARTS=4
838CONFIG_SERIAL_8250_RUNTIME_UARTS=4
839# CONFIG_SERIAL_8250_EXTENDED is not set
840
841#
842# Non-8250 serial port support
843#
844CONFIG_SERIAL_CORE=y
845CONFIG_SERIAL_CORE_CONSOLE=y
846CONFIG_UNIX98_PTYS=y
847# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
848# CONFIG_LEGACY_PTYS is not set
849# CONFIG_IPMI_HANDLER is not set
850CONFIG_HW_RANDOM=m
851# CONFIG_R3964 is not set
852# CONFIG_RAW_DRIVER is not set
853# CONFIG_TCG_TPM is not set
854CONFIG_I2C=y
855CONFIG_I2C_BOARDINFO=y
856CONFIG_I2C_CHARDEV=y
857CONFIG_I2C_HELPER_AUTO=y
858
859#
860# I2C Hardware Bus support
861#
862
863#
864# I2C system bus drivers (mostly embedded / system-on-chip)
865#
866# CONFIG_I2C_GPIO is not set
867# CONFIG_I2C_OCORES is not set
868CONFIG_I2C_OMAP=y
869# CONFIG_I2C_SIMTEC is not set
870
871#
872# External I2C/SMBus adapter drivers
873#
874# CONFIG_I2C_PARPORT_LIGHT is not set
875# CONFIG_I2C_TAOS_EVM is not set
876# CONFIG_I2C_TINY_USB is not set
877
878#
879# Other I2C/SMBus bus drivers
880#
881# CONFIG_I2C_PCA_PLATFORM is not set
882# CONFIG_I2C_STUB is not set
883
884#
885# Miscellaneous I2C Chip support
886#
887# CONFIG_DS1682 is not set
888# CONFIG_SENSORS_PCF8574 is not set
889# CONFIG_PCF8575 is not set
890# CONFIG_SENSORS_PCA9539 is not set
891# CONFIG_SENSORS_PCF8591 is not set
892# CONFIG_SENSORS_MAX6875 is not set
893# CONFIG_SENSORS_TSL2550 is not set
894# CONFIG_I2C_DEBUG_CORE is not set
895# CONFIG_I2C_DEBUG_ALGO is not set
896# CONFIG_I2C_DEBUG_BUS is not set
897# CONFIG_I2C_DEBUG_CHIP is not set
898CONFIG_SPI=y
899# CONFIG_SPI_DEBUG is not set
900CONFIG_SPI_MASTER=y
901
902#
903# SPI Master Controller Drivers
904#
905# CONFIG_SPI_BITBANG is not set
906# CONFIG_SPI_GPIO is not set
907CONFIG_SPI_OMAP24XX=y
908
909#
910# SPI Protocol Masters
911#
912# CONFIG_SPI_SPIDEV is not set
913# CONFIG_SPI_TLE62X0 is not set
914CONFIG_ARCH_REQUIRE_GPIOLIB=y
915CONFIG_GPIOLIB=y
916# CONFIG_DEBUG_GPIO is not set
917CONFIG_GPIO_SYSFS=y
918
919#
920# Memory mapped GPIO expanders:
921#
922
923#
924# I2C GPIO expanders:
925#
926# CONFIG_GPIO_MAX732X is not set
927# CONFIG_GPIO_PCA953X is not set
928# CONFIG_GPIO_PCF857X is not set
929CONFIG_GPIO_TWL4030=y
930
931#
932# PCI GPIO expanders:
933#
934
935#
936# SPI GPIO expanders:
937#
938# CONFIG_GPIO_MAX7301 is not set
939# CONFIG_GPIO_MCP23S08 is not set
940# CONFIG_W1 is not set
941# CONFIG_POWER_SUPPLY is not set
942CONFIG_HWMON=y
943# CONFIG_HWMON_VID is not set
944# CONFIG_SENSORS_AD7414 is not set
945# CONFIG_SENSORS_AD7418 is not set
946# CONFIG_SENSORS_ADCXX is not set
947# CONFIG_SENSORS_ADM1021 is not set
948# CONFIG_SENSORS_ADM1025 is not set
949# CONFIG_SENSORS_ADM1026 is not set
950# CONFIG_SENSORS_ADM1029 is not set
951# CONFIG_SENSORS_ADM1031 is not set
952# CONFIG_SENSORS_ADM9240 is not set
953# CONFIG_SENSORS_ADT7462 is not set
954# CONFIG_SENSORS_ADT7470 is not set
955# CONFIG_SENSORS_ADT7473 is not set
956# CONFIG_SENSORS_ADT7475 is not set
957# CONFIG_SENSORS_ATXP1 is not set
958# CONFIG_SENSORS_DS1621 is not set
959# CONFIG_SENSORS_F71805F is not set
960# CONFIG_SENSORS_F71882FG is not set
961# CONFIG_SENSORS_F75375S is not set
962# CONFIG_SENSORS_GL518SM is not set
963# CONFIG_SENSORS_GL520SM is not set
964# CONFIG_SENSORS_IT87 is not set
965# CONFIG_SENSORS_LM63 is not set
966# CONFIG_SENSORS_LM70 is not set
967# CONFIG_SENSORS_LM75 is not set
968# CONFIG_SENSORS_LM77 is not set
969# CONFIG_SENSORS_LM78 is not set
970# CONFIG_SENSORS_LM80 is not set
971# CONFIG_SENSORS_LM83 is not set
972# CONFIG_SENSORS_LM85 is not set
973# CONFIG_SENSORS_LM87 is not set
974# CONFIG_SENSORS_LM90 is not set
975# CONFIG_SENSORS_LM92 is not set
976# CONFIG_SENSORS_LM93 is not set
977# CONFIG_SENSORS_LTC4245 is not set
978# CONFIG_SENSORS_MAX1111 is not set
979# CONFIG_SENSORS_MAX1619 is not set
980# CONFIG_SENSORS_MAX6650 is not set
981# CONFIG_SENSORS_PC87360 is not set
982# CONFIG_SENSORS_PC87427 is not set
983# CONFIG_SENSORS_DME1737 is not set
984# CONFIG_SENSORS_SMSC47M1 is not set
985# CONFIG_SENSORS_SMSC47M192 is not set
986# CONFIG_SENSORS_SMSC47B397 is not set
987# CONFIG_SENSORS_ADS7828 is not set
988# CONFIG_SENSORS_THMC50 is not set
989# CONFIG_SENSORS_VT1211 is not set
990# CONFIG_SENSORS_W83781D is not set
991# CONFIG_SENSORS_W83791D is not set
992# CONFIG_SENSORS_W83792D is not set
993# CONFIG_SENSORS_W83793 is not set
994# CONFIG_SENSORS_W83L785TS is not set
995# CONFIG_SENSORS_W83L786NG is not set
996# CONFIG_SENSORS_W83627HF is not set
997# CONFIG_SENSORS_W83627EHF is not set
998# CONFIG_HWMON_DEBUG_CHIP is not set
999# CONFIG_THERMAL is not set
1000# CONFIG_THERMAL_HWMON is not set
1001CONFIG_WATCHDOG=y
1002# CONFIG_WATCHDOG_NOWAYOUT is not set
1003
1004#
1005# Watchdog Device Drivers
1006#
1007# CONFIG_SOFT_WATCHDOG is not set
1008CONFIG_OMAP_WATCHDOG=m
1009
1010#
1011# USB-based Watchdog Cards
1012#
1013# CONFIG_USBPCWATCHDOG is not set
1014CONFIG_SSB_POSSIBLE=y
1015
1016#
1017# Sonics Silicon Backplane
1018#
1019# CONFIG_SSB is not set
1020
1021#
1022# Multifunction device drivers
1023#
1024# CONFIG_MFD_CORE is not set
1025# CONFIG_MFD_SM501 is not set
1026# CONFIG_MFD_ASIC3 is not set
1027# CONFIG_HTC_EGPIO is not set
1028# CONFIG_HTC_PASIC3 is not set
1029# CONFIG_TPS65010 is not set
1030CONFIG_TWL4030_CORE=y
1031# CONFIG_MFD_TMIO is not set
1032# CONFIG_MFD_T7L66XB is not set
1033# CONFIG_MFD_TC6387XB is not set
1034# CONFIG_MFD_TC6393XB is not set
1035# CONFIG_PMIC_DA903X is not set
1036# CONFIG_MFD_WM8400 is not set
1037# CONFIG_MFD_WM8350_I2C is not set
1038# CONFIG_MFD_PCF50633 is not set
1039
1040#
1041# Multimedia devices
1042#
1043
1044#
1045# Multimedia core support
1046#
1047CONFIG_VIDEO_DEV=m
1048CONFIG_VIDEO_V4L2_COMMON=m
1049CONFIG_VIDEO_ALLOW_V4L1=y
1050CONFIG_VIDEO_V4L1_COMPAT=y
1051# CONFIG_DVB_CORE is not set
1052CONFIG_VIDEO_MEDIA=m
1053
1054#
1055# Multimedia drivers
1056#
1057# CONFIG_MEDIA_ATTACH is not set
1058CONFIG_MEDIA_TUNER=m
1059# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set
1060CONFIG_MEDIA_TUNER_SIMPLE=m
1061CONFIG_MEDIA_TUNER_TDA8290=m
1062CONFIG_MEDIA_TUNER_TDA9887=m
1063CONFIG_MEDIA_TUNER_TEA5761=m
1064CONFIG_MEDIA_TUNER_TEA5767=m
1065CONFIG_MEDIA_TUNER_MT20XX=m
1066CONFIG_MEDIA_TUNER_XC2028=m
1067CONFIG_MEDIA_TUNER_XC5000=m
1068CONFIG_VIDEO_V4L2=m
1069CONFIG_VIDEO_V4L1=m
1070CONFIG_VIDEO_CAPTURE_DRIVERS=y
1071# CONFIG_VIDEO_ADV_DEBUG is not set
1072# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
1073CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
1074# CONFIG_VIDEO_VIVI is not set
1075# CONFIG_VIDEO_CPIA is not set
1076# CONFIG_VIDEO_CPIA2 is not set
1077# CONFIG_VIDEO_SAA5246A is not set
1078# CONFIG_VIDEO_SAA5249 is not set
1079# CONFIG_SOC_CAMERA is not set
1080CONFIG_V4L_USB_DRIVERS=y
1081# CONFIG_USB_VIDEO_CLASS is not set
1082# CONFIG_USB_GSPCA is not set
1083# CONFIG_VIDEO_PVRUSB2 is not set
1084# CONFIG_VIDEO_EM28XX is not set
1085# CONFIG_VIDEO_USBVISION is not set
1086# CONFIG_USB_VICAM is not set
1087# CONFIG_USB_IBMCAM is not set
1088# CONFIG_USB_KONICAWC is not set
1089# CONFIG_USB_QUICKCAM_MESSENGER is not set
1090# CONFIG_USB_ET61X251 is not set
1091# CONFIG_VIDEO_OVCAMCHIP is not set
1092# CONFIG_USB_OV511 is not set
1093# CONFIG_USB_SE401 is not set
1094# CONFIG_USB_SN9C102 is not set
1095# CONFIG_USB_STV680 is not set
1096# CONFIG_USB_ZC0301 is not set
1097# CONFIG_USB_PWC is not set
1098# CONFIG_USB_ZR364XX is not set
1099# CONFIG_USB_STKWEBCAM is not set
1100# CONFIG_USB_S2255 is not set
1101CONFIG_RADIO_ADAPTERS=y
1102# CONFIG_USB_DSBR is not set
1103# CONFIG_USB_SI470X is not set
1104# CONFIG_USB_MR800 is not set
1105# CONFIG_RADIO_TEA5764 is not set
1106# CONFIG_DAB is not set
1107
1108#
1109# Graphics support
1110#
1111# CONFIG_VGASTATE is not set
1112# CONFIG_VIDEO_OUTPUT_CONTROL is not set
1113# CONFIG_FB is not set
1114# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1115
1116#
1117# Display device support
1118#
1119CONFIG_DISPLAY_SUPPORT=y
1120
1121#
1122# Display hardware drivers
1123#
1124
1125#
1126# Console display driver support
1127#
1128# CONFIG_VGA_CONSOLE is not set
1129CONFIG_DUMMY_CONSOLE=y
1130CONFIG_SOUND=y
1131# CONFIG_SOUND_OSS_CORE is not set
1132CONFIG_SND=y
1133CONFIG_SND_TIMER=y
1134CONFIG_SND_PCM=y
1135# CONFIG_SND_SEQUENCER is not set
1136# CONFIG_SND_MIXER_OSS is not set
1137# CONFIG_SND_PCM_OSS is not set
1138# CONFIG_SND_HRTIMER is not set
1139# CONFIG_SND_DYNAMIC_MINORS is not set
1140CONFIG_SND_SUPPORT_OLD_API=y
1141CONFIG_SND_VERBOSE_PROCFS=y
1142# CONFIG_SND_VERBOSE_PRINTK is not set
1143# CONFIG_SND_DEBUG is not set
1144CONFIG_SND_DRIVERS=y
1145# CONFIG_SND_DUMMY is not set
1146# CONFIG_SND_MTPAV is not set
1147# CONFIG_SND_SERIAL_U16550 is not set
1148# CONFIG_SND_MPU401 is not set
1149CONFIG_SND_ARM=y
1150CONFIG_SND_SPI=y
1151# CONFIG_SND_USB is not set
1152CONFIG_SND_SOC=y
1153CONFIG_SND_OMAP_SOC=y
1154CONFIG_SND_SOC_I2C_AND_SPI=y
1155# CONFIG_SND_SOC_ALL_CODECS is not set
1156# CONFIG_SOUND_PRIME is not set
1157CONFIG_HID_SUPPORT=y
1158CONFIG_HID=m
1159# CONFIG_HID_DEBUG is not set
1160# CONFIG_HIDRAW is not set
1161
1162#
1163# USB Input Devices
1164#
1165CONFIG_USB_HID=m
1166# CONFIG_HID_PID is not set
1167# CONFIG_USB_HIDDEV is not set
1168
1169#
1170# USB HID Boot Protocol drivers
1171#
1172# CONFIG_USB_KBD is not set
1173# CONFIG_USB_MOUSE is not set
1174
1175#
1176# Special HID drivers
1177#
1178CONFIG_HID_COMPAT=y
1179CONFIG_HID_A4TECH=m
1180CONFIG_HID_APPLE=m
1181CONFIG_HID_BELKIN=m
1182CONFIG_HID_CHERRY=m
1183CONFIG_HID_CHICONY=m
1184CONFIG_HID_CYPRESS=m
1185CONFIG_HID_EZKEY=m
1186CONFIG_HID_GYRATION=m
1187CONFIG_HID_LOGITECH=m
1188# CONFIG_LOGITECH_FF is not set
1189# CONFIG_LOGIRUMBLEPAD2_FF is not set
1190CONFIG_HID_MICROSOFT=m
1191CONFIG_HID_MONTEREY=m
1192# CONFIG_HID_NTRIG is not set
1193CONFIG_HID_PANTHERLORD=m
1194# CONFIG_PANTHERLORD_FF is not set
1195CONFIG_HID_PETALYNX=m
1196CONFIG_HID_SAMSUNG=m
1197CONFIG_HID_SONY=m
1198CONFIG_HID_SUNPLUS=m
1199# CONFIG_GREENASIA_FF is not set
1200# CONFIG_HID_TOPSEED is not set
1201# CONFIG_THRUSTMASTER_FF is not set
1202# CONFIG_ZEROPLUS_FF is not set
1203CONFIG_USB_SUPPORT=y
1204CONFIG_USB_ARCH_HAS_HCD=y
1205CONFIG_USB_ARCH_HAS_OHCI=y
1206# CONFIG_USB_ARCH_HAS_EHCI is not set
1207CONFIG_USB=y
1208CONFIG_USB_DEBUG=y
1209CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1210
1211#
1212# Miscellaneous USB options
1213#
1214CONFIG_USB_DEVICEFS=y
1215CONFIG_USB_DEVICE_CLASS=y
1216# CONFIG_USB_DYNAMIC_MINORS is not set
1217CONFIG_USB_SUSPEND=y
1218CONFIG_USB_OTG=y
1219CONFIG_USB_OTG_WHITELIST=y
1220CONFIG_USB_OTG_BLACKLIST_HUB=y
1221CONFIG_USB_MON=y
1222# CONFIG_USB_WUSB is not set
1223# CONFIG_USB_WUSB_CBAF is not set
1224
1225#
1226# USB Host Controller Drivers
1227#
1228# CONFIG_USB_C67X00_HCD is not set
1229# CONFIG_USB_OXU210HP_HCD is not set
1230# CONFIG_USB_ISP116X_HCD is not set
1231# CONFIG_USB_OHCI_HCD is not set
1232# CONFIG_USB_SL811_HCD is not set
1233# CONFIG_USB_R8A66597_HCD is not set
1234# CONFIG_USB_HWA_HCD is not set
1235CONFIG_USB_MUSB_HDRC=y
1236CONFIG_USB_MUSB_SOC=y
1237
1238#
1239# OMAP 343x high speed USB support
1240#
1241# CONFIG_USB_MUSB_HOST is not set
1242# CONFIG_USB_MUSB_PERIPHERAL is not set
1243CONFIG_USB_MUSB_OTG=y
1244CONFIG_USB_GADGET_MUSB_HDRC=y
1245CONFIG_USB_MUSB_HDRC_HCD=y
1246# CONFIG_MUSB_PIO_ONLY is not set
1247CONFIG_USB_INVENTRA_DMA=y
1248# CONFIG_USB_TI_CPPI_DMA is not set
1249# CONFIG_USB_MUSB_DEBUG is not set
1250
1251#
1252# USB Device Class drivers
1253#
1254# CONFIG_USB_ACM is not set
1255# CONFIG_USB_PRINTER is not set
1256# CONFIG_USB_WDM is not set
1257# CONFIG_USB_TMC is not set
1258
1259#
1260# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1261#
1262
1263#
1264# see USB_STORAGE Help for more information
1265#
1266CONFIG_USB_STORAGE=m
1267# CONFIG_USB_STORAGE_DEBUG is not set
1268# CONFIG_USB_STORAGE_DATAFAB is not set
1269# CONFIG_USB_STORAGE_FREECOM is not set
1270# CONFIG_USB_STORAGE_ISD200 is not set
1271# CONFIG_USB_STORAGE_USBAT is not set
1272# CONFIG_USB_STORAGE_SDDR09 is not set
1273# CONFIG_USB_STORAGE_SDDR55 is not set
1274# CONFIG_USB_STORAGE_JUMPSHOT is not set
1275# CONFIG_USB_STORAGE_ALAUDA is not set
1276# CONFIG_USB_STORAGE_ONETOUCH is not set
1277# CONFIG_USB_STORAGE_KARMA is not set
1278# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1279CONFIG_USB_LIBUSUAL=y
1280
1281#
1282# USB Imaging devices
1283#
1284# CONFIG_USB_MDC800 is not set
1285# CONFIG_USB_MICROTEK is not set
1286
1287#
1288# USB port drivers
1289#
1290# CONFIG_USB_SERIAL is not set
1291
1292#
1293# USB Miscellaneous drivers
1294#
1295# CONFIG_USB_EMI62 is not set
1296# CONFIG_USB_EMI26 is not set
1297# CONFIG_USB_ADUTUX is not set
1298# CONFIG_USB_SEVSEG is not set
1299# CONFIG_USB_RIO500 is not set
1300# CONFIG_USB_LEGOTOWER is not set
1301# CONFIG_USB_LCD is not set
1302# CONFIG_USB_BERRY_CHARGE is not set
1303# CONFIG_USB_LED is not set
1304# CONFIG_USB_CYPRESS_CY7C63 is not set
1305# CONFIG_USB_CYTHERM is not set
1306# CONFIG_USB_PHIDGET is not set
1307# CONFIG_USB_IDMOUSE is not set
1308# CONFIG_USB_FTDI_ELAN is not set
1309# CONFIG_USB_APPLEDISPLAY is not set
1310# CONFIG_USB_LD is not set
1311# CONFIG_USB_TRANCEVIBRATOR is not set
1312# CONFIG_USB_IOWARRIOR is not set
1313CONFIG_USB_TEST=m
1314# CONFIG_USB_ISIGHTFW is not set
1315# CONFIG_USB_VST is not set
1316CONFIG_USB_GADGET=m
1317CONFIG_USB_GADGET_DEBUG=y
1318CONFIG_USB_GADGET_DEBUG_FILES=y
1319CONFIG_USB_GADGET_DEBUG_FS=y
1320CONFIG_USB_GADGET_VBUS_DRAW=2
1321CONFIG_USB_GADGET_SELECTED=y
1322# CONFIG_USB_GADGET_AT91 is not set
1323# CONFIG_USB_GADGET_ATMEL_USBA is not set
1324# CONFIG_USB_GADGET_FSL_USB2 is not set
1325# CONFIG_USB_GADGET_LH7A40X is not set
1326# CONFIG_USB_GADGET_OMAP is not set
1327# CONFIG_USB_GADGET_PXA25X is not set
1328# CONFIG_USB_GADGET_PXA27X is not set
1329# CONFIG_USB_GADGET_S3C2410 is not set
1330# CONFIG_USB_GADGET_IMX is not set
1331# CONFIG_USB_GADGET_M66592 is not set
1332# CONFIG_USB_GADGET_AMD5536UDC is not set
1333# CONFIG_USB_GADGET_FSL_QE is not set
1334# CONFIG_USB_GADGET_CI13XXX is not set
1335# CONFIG_USB_GADGET_NET2280 is not set
1336# CONFIG_USB_GADGET_GOKU is not set
1337# CONFIG_USB_GADGET_DUMMY_HCD is not set
1338CONFIG_USB_GADGET_DUALSPEED=y
1339CONFIG_USB_ZERO=m
1340# CONFIG_USB_ZERO_HNPTEST is not set
1341# CONFIG_USB_ETH is not set
1342# CONFIG_USB_GADGETFS is not set
1343CONFIG_USB_FILE_STORAGE=m
1344# CONFIG_USB_FILE_STORAGE_TEST is not set
1345# CONFIG_USB_G_SERIAL is not set
1346# CONFIG_USB_MIDI_GADGET is not set
1347# CONFIG_USB_G_PRINTER is not set
1348# CONFIG_USB_CDC_COMPOSITE is not set
1349
1350#
1351# OTG and related infrastructure
1352#
1353CONFIG_USB_OTG_UTILS=y
1354# CONFIG_USB_GPIO_VBUS is not set
1355# CONFIG_ISP1301_OMAP is not set
1356CONFIG_TWL4030_USB=y
1357CONFIG_MMC=m
1358# CONFIG_MMC_DEBUG is not set
1359# CONFIG_MMC_UNSAFE_RESUME is not set
1360
1361#
1362# MMC/SD/SDIO Card Drivers
1363#
1364CONFIG_MMC_BLOCK=m
1365CONFIG_MMC_BLOCK_BOUNCE=y
1366# CONFIG_SDIO_UART is not set
1367# CONFIG_MMC_TEST is not set
1368
1369#
1370# MMC/SD/SDIO Host Controller Drivers
1371#
1372# CONFIG_MMC_SDHCI is not set
1373# CONFIG_MMC_OMAP is not set
1374CONFIG_MMC_OMAP_HS=m
1375# CONFIG_MMC_SPI is not set
1376# CONFIG_MEMSTICK is not set
1377# CONFIG_ACCESSIBILITY is not set
1378CONFIG_NEW_LEDS=y
1379CONFIG_LEDS_CLASS=m
1380
1381#
1382# LED drivers
1383#
1384# CONFIG_LEDS_PCA9532 is not set
1385# CONFIG_LEDS_GPIO is not set
1386# CONFIG_LEDS_PCA955X is not set
1387
1388#
1389# LED Triggers
1390#
1391# CONFIG_LEDS_TRIGGERS is not set
1392CONFIG_RTC_LIB=y
1393CONFIG_RTC_CLASS=m
1394
1395#
1396# RTC interfaces
1397#
1398CONFIG_RTC_INTF_SYSFS=y
1399CONFIG_RTC_INTF_PROC=y
1400CONFIG_RTC_INTF_DEV=y
1401# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1402# CONFIG_RTC_DRV_TEST is not set
1403
1404#
1405# I2C RTC drivers
1406#
1407# CONFIG_RTC_DRV_DS1307 is not set
1408# CONFIG_RTC_DRV_DS1374 is not set
1409# CONFIG_RTC_DRV_DS1672 is not set
1410# CONFIG_RTC_DRV_MAX6900 is not set
1411# CONFIG_RTC_DRV_RS5C372 is not set
1412# CONFIG_RTC_DRV_ISL1208 is not set
1413# CONFIG_RTC_DRV_X1205 is not set
1414# CONFIG_RTC_DRV_PCF8563 is not set
1415# CONFIG_RTC_DRV_PCF8583 is not set
1416# CONFIG_RTC_DRV_M41T80 is not set
1417CONFIG_RTC_DRV_TWL4030=m
1418# CONFIG_RTC_DRV_S35390A is not set
1419# CONFIG_RTC_DRV_FM3130 is not set
1420# CONFIG_RTC_DRV_RX8581 is not set
1421
1422#
1423# SPI RTC drivers
1424#
1425# CONFIG_RTC_DRV_M41T94 is not set
1426# CONFIG_RTC_DRV_DS1305 is not set
1427# CONFIG_RTC_DRV_DS1390 is not set
1428# CONFIG_RTC_DRV_MAX6902 is not set
1429# CONFIG_RTC_DRV_R9701 is not set
1430# CONFIG_RTC_DRV_RS5C348 is not set
1431# CONFIG_RTC_DRV_DS3234 is not set
1432
1433#
1434# Platform RTC drivers
1435#
1436# CONFIG_RTC_DRV_CMOS is not set
1437# CONFIG_RTC_DRV_DS1286 is not set
1438# CONFIG_RTC_DRV_DS1511 is not set
1439# CONFIG_RTC_DRV_DS1553 is not set
1440# CONFIG_RTC_DRV_DS1742 is not set
1441# CONFIG_RTC_DRV_STK17TA8 is not set
1442# CONFIG_RTC_DRV_M48T86 is not set
1443# CONFIG_RTC_DRV_M48T35 is not set
1444# CONFIG_RTC_DRV_M48T59 is not set
1445# CONFIG_RTC_DRV_BQ4802 is not set
1446# CONFIG_RTC_DRV_V3020 is not set
1447
1448#
1449# on-CPU RTC drivers
1450#
1451# CONFIG_DMADEVICES is not set
1452# CONFIG_REGULATOR is not set
1453# CONFIG_UIO is not set
1454# CONFIG_STAGING is not set
1455
1456#
1457# File systems
1458#
1459CONFIG_EXT2_FS=m
1460# CONFIG_EXT2_FS_XATTR is not set
1461# CONFIG_EXT2_FS_XIP is not set
1462CONFIG_EXT3_FS=m
1463# CONFIG_EXT3_FS_XATTR is not set
1464# CONFIG_EXT4_FS is not set
1465CONFIG_JBD=m
1466# CONFIG_JBD_DEBUG is not set
1467# CONFIG_REISERFS_FS is not set
1468# CONFIG_JFS_FS is not set
1469# CONFIG_FS_POSIX_ACL is not set
1470CONFIG_FILE_LOCKING=y
1471# CONFIG_XFS_FS is not set
1472# CONFIG_OCFS2_FS is not set
1473# CONFIG_BTRFS_FS is not set
1474CONFIG_DNOTIFY=y
1475CONFIG_INOTIFY=y
1476CONFIG_INOTIFY_USER=y
1477CONFIG_QUOTA=y
1478# CONFIG_QUOTA_NETLINK_INTERFACE is not set
1479CONFIG_PRINT_QUOTA_WARNING=y
1480CONFIG_QUOTA_TREE=y
1481# CONFIG_QFMT_V1 is not set
1482CONFIG_QFMT_V2=y
1483CONFIG_QUOTACTL=y
1484# CONFIG_AUTOFS_FS is not set
1485# CONFIG_AUTOFS4_FS is not set
1486CONFIG_FUSE_FS=m
1487
1488#
1489# CD-ROM/DVD Filesystems
1490#
1491# CONFIG_ISO9660_FS is not set
1492# CONFIG_UDF_FS is not set
1493
1494#
1495# DOS/FAT/NT Filesystems
1496#
1497CONFIG_FAT_FS=m
1498CONFIG_MSDOS_FS=m
1499CONFIG_VFAT_FS=m
1500CONFIG_FAT_DEFAULT_CODEPAGE=437
1501CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1502# CONFIG_NTFS_FS is not set
1503
1504#
1505# Pseudo filesystems
1506#
1507CONFIG_PROC_FS=y
1508CONFIG_PROC_SYSCTL=y
1509CONFIG_PROC_PAGE_MONITOR=y
1510CONFIG_SYSFS=y
1511CONFIG_TMPFS=y
1512# CONFIG_TMPFS_POSIX_ACL is not set
1513# CONFIG_HUGETLB_PAGE is not set
1514# CONFIG_CONFIGFS_FS is not set
1515CONFIG_MISC_FILESYSTEMS=y
1516# CONFIG_ADFS_FS is not set
1517# CONFIG_AFFS_FS is not set
1518# CONFIG_HFS_FS is not set
1519# CONFIG_HFSPLUS_FS is not set
1520# CONFIG_BEFS_FS is not set
1521# CONFIG_BFS_FS is not set
1522# CONFIG_EFS_FS is not set
1523# CONFIG_JFFS2_FS is not set
1524CONFIG_UBIFS_FS=y
1525# CONFIG_UBIFS_FS_XATTR is not set
1526# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1527CONFIG_UBIFS_FS_LZO=y
1528CONFIG_UBIFS_FS_ZLIB=y
1529# CONFIG_UBIFS_FS_DEBUG is not set
1530CONFIG_CRAMFS=y
1531# CONFIG_SQUASHFS is not set
1532# CONFIG_VXFS_FS is not set
1533# CONFIG_MINIX_FS is not set
1534# CONFIG_OMFS_FS is not set
1535# CONFIG_HPFS_FS is not set
1536# CONFIG_QNX4FS_FS is not set
1537# CONFIG_ROMFS_FS is not set
1538# CONFIG_SYSV_FS is not set
1539# CONFIG_UFS_FS is not set
1540CONFIG_NETWORK_FILESYSTEMS=y
1541CONFIG_NFS_FS=m
1542CONFIG_NFS_V3=y
1543# CONFIG_NFS_V3_ACL is not set
1544CONFIG_NFS_V4=y
1545# CONFIG_NFSD is not set
1546CONFIG_LOCKD=m
1547CONFIG_LOCKD_V4=y
1548CONFIG_NFS_COMMON=y
1549CONFIG_SUNRPC=m
1550CONFIG_SUNRPC_GSS=m
1551# CONFIG_SUNRPC_REGISTER_V4 is not set
1552CONFIG_RPCSEC_GSS_KRB5=m
1553# CONFIG_RPCSEC_GSS_SPKM3 is not set
1554# CONFIG_SMB_FS is not set
1555# CONFIG_CIFS is not set
1556# CONFIG_NCP_FS is not set
1557# CONFIG_CODA_FS is not set
1558# CONFIG_AFS_FS is not set
1559
1560#
1561# Partition Types
1562#
1563CONFIG_PARTITION_ADVANCED=y
1564# CONFIG_ACORN_PARTITION is not set
1565# CONFIG_OSF_PARTITION is not set
1566# CONFIG_AMIGA_PARTITION is not set
1567# CONFIG_ATARI_PARTITION is not set
1568# CONFIG_MAC_PARTITION is not set
1569CONFIG_MSDOS_PARTITION=y
1570# CONFIG_BSD_DISKLABEL is not set
1571# CONFIG_MINIX_SUBPARTITION is not set
1572# CONFIG_SOLARIS_X86_PARTITION is not set
1573# CONFIG_UNIXWARE_DISKLABEL is not set
1574# CONFIG_LDM_PARTITION is not set
1575# CONFIG_SGI_PARTITION is not set
1576# CONFIG_ULTRIX_PARTITION is not set
1577# CONFIG_SUN_PARTITION is not set
1578# CONFIG_KARMA_PARTITION is not set
1579# CONFIG_EFI_PARTITION is not set
1580# CONFIG_SYSV68_PARTITION is not set
1581CONFIG_NLS=y
1582CONFIG_NLS_DEFAULT="iso8859-1"
1583CONFIG_NLS_CODEPAGE_437=y
1584# CONFIG_NLS_CODEPAGE_737 is not set
1585# CONFIG_NLS_CODEPAGE_775 is not set
1586# CONFIG_NLS_CODEPAGE_850 is not set
1587# CONFIG_NLS_CODEPAGE_852 is not set
1588# CONFIG_NLS_CODEPAGE_855 is not set
1589# CONFIG_NLS_CODEPAGE_857 is not set
1590# CONFIG_NLS_CODEPAGE_860 is not set
1591# CONFIG_NLS_CODEPAGE_861 is not set
1592# CONFIG_NLS_CODEPAGE_862 is not set
1593# CONFIG_NLS_CODEPAGE_863 is not set
1594# CONFIG_NLS_CODEPAGE_864 is not set
1595# CONFIG_NLS_CODEPAGE_865 is not set
1596# CONFIG_NLS_CODEPAGE_866 is not set
1597# CONFIG_NLS_CODEPAGE_869 is not set
1598# CONFIG_NLS_CODEPAGE_936 is not set
1599# CONFIG_NLS_CODEPAGE_950 is not set
1600# CONFIG_NLS_CODEPAGE_932 is not set
1601# CONFIG_NLS_CODEPAGE_949 is not set
1602# CONFIG_NLS_CODEPAGE_874 is not set
1603# CONFIG_NLS_ISO8859_8 is not set
1604# CONFIG_NLS_CODEPAGE_1250 is not set
1605# CONFIG_NLS_CODEPAGE_1251 is not set
1606# CONFIG_NLS_ASCII is not set
1607CONFIG_NLS_ISO8859_1=y
1608# CONFIG_NLS_ISO8859_2 is not set
1609# CONFIG_NLS_ISO8859_3 is not set
1610# CONFIG_NLS_ISO8859_4 is not set
1611# CONFIG_NLS_ISO8859_5 is not set
1612# CONFIG_NLS_ISO8859_6 is not set
1613# CONFIG_NLS_ISO8859_7 is not set
1614# CONFIG_NLS_ISO8859_9 is not set
1615# CONFIG_NLS_ISO8859_13 is not set
1616# CONFIG_NLS_ISO8859_14 is not set
1617# CONFIG_NLS_ISO8859_15 is not set
1618# CONFIG_NLS_KOI8_R is not set
1619# CONFIG_NLS_KOI8_U is not set
1620# CONFIG_NLS_UTF8 is not set
1621# CONFIG_DLM is not set
1622
1623#
1624# Kernel hacking
1625#
1626CONFIG_PRINTK_TIME=y
1627CONFIG_ENABLE_WARN_DEPRECATED=y
1628CONFIG_ENABLE_MUST_CHECK=y
1629CONFIG_FRAME_WARN=1024
1630CONFIG_MAGIC_SYSRQ=y
1631# CONFIG_UNUSED_SYMBOLS is not set
1632CONFIG_DEBUG_FS=y
1633# CONFIG_HEADERS_CHECK is not set
1634CONFIG_DEBUG_KERNEL=y
1635# CONFIG_DEBUG_SHIRQ is not set
1636CONFIG_DETECT_SOFTLOCKUP=y
1637# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1638CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1639CONFIG_SCHED_DEBUG=y
1640# CONFIG_SCHEDSTATS is not set
1641CONFIG_TIMER_STATS=y
1642# CONFIG_DEBUG_OBJECTS is not set
1643# CONFIG_DEBUG_SLAB is not set
1644# CONFIG_DEBUG_RT_MUTEXES is not set
1645# CONFIG_RT_MUTEX_TESTER is not set
1646CONFIG_DEBUG_SPINLOCK=y
1647CONFIG_DEBUG_MUTEXES=y
1648CONFIG_DEBUG_LOCK_ALLOC=y
1649CONFIG_PROVE_LOCKING=y
1650CONFIG_LOCKDEP=y
1651CONFIG_LOCK_STAT=y
1652# CONFIG_DEBUG_LOCKDEP is not set
1653CONFIG_TRACE_IRQFLAGS=y
1654CONFIG_DEBUG_SPINLOCK_SLEEP=y
1655# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1656CONFIG_STACKTRACE=y
1657# CONFIG_DEBUG_KOBJECT is not set
1658# CONFIG_DEBUG_BUGVERBOSE is not set
1659CONFIG_DEBUG_INFO=y
1660# CONFIG_DEBUG_VM is not set
1661# CONFIG_DEBUG_WRITECOUNT is not set
1662# CONFIG_DEBUG_MEMORY_INIT is not set
1663# CONFIG_DEBUG_LIST is not set
1664# CONFIG_DEBUG_SG is not set
1665# CONFIG_DEBUG_NOTIFIERS is not set
1666CONFIG_FRAME_POINTER=y
1667# CONFIG_BOOT_PRINTK_DELAY is not set
1668# CONFIG_RCU_TORTURE_TEST is not set
1669# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1670# CONFIG_KPROBES_SANITY_TEST is not set
1671# CONFIG_BACKTRACE_SELF_TEST is not set
1672# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1673# CONFIG_LKDTM is not set
1674# CONFIG_FAULT_INJECTION is not set
1675# CONFIG_LATENCYTOP is not set
1676CONFIG_HAVE_FUNCTION_TRACER=y
1677
1678#
1679# Tracers
1680#
1681# CONFIG_FUNCTION_TRACER is not set
1682# CONFIG_IRQSOFF_TRACER is not set
1683# CONFIG_SCHED_TRACER is not set
1684# CONFIG_CONTEXT_SWITCH_TRACER is not set
1685# CONFIG_BOOT_TRACER is not set
1686# CONFIG_TRACE_BRANCH_PROFILING is not set
1687# CONFIG_STACK_TRACER is not set
1688# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1689# CONFIG_SAMPLES is not set
1690CONFIG_HAVE_ARCH_KGDB=y
1691# CONFIG_KGDB is not set
1692# CONFIG_DEBUG_USER is not set
1693# CONFIG_DEBUG_ERRORS is not set
1694# CONFIG_DEBUG_STACK_USAGE is not set
1695# CONFIG_DEBUG_LL is not set
1696
1697#
1698# Security options
1699#
1700# CONFIG_KEYS is not set
1701CONFIG_SECURITY=y
1702# CONFIG_SECURITYFS is not set
1703# CONFIG_SECURITY_NETWORK is not set
1704# CONFIG_SECURITY_PATH is not set
1705# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1706# CONFIG_SECURITY_ROOTPLUG is not set
1707CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1708CONFIG_CRYPTO=y
1709
1710#
1711# Crypto core or helper
1712#
1713# CONFIG_CRYPTO_FIPS is not set
1714CONFIG_CRYPTO_ALGAPI=y
1715CONFIG_CRYPTO_ALGAPI2=y
1716CONFIG_CRYPTO_AEAD2=y
1717CONFIG_CRYPTO_BLKCIPHER=y
1718CONFIG_CRYPTO_BLKCIPHER2=y
1719CONFIG_CRYPTO_HASH=y
1720CONFIG_CRYPTO_HASH2=y
1721CONFIG_CRYPTO_RNG2=y
1722CONFIG_CRYPTO_MANAGER=y
1723CONFIG_CRYPTO_MANAGER2=y
1724# CONFIG_CRYPTO_GF128MUL is not set
1725# CONFIG_CRYPTO_NULL is not set
1726# CONFIG_CRYPTO_CRYPTD is not set
1727# CONFIG_CRYPTO_AUTHENC is not set
1728# CONFIG_CRYPTO_TEST is not set
1729
1730#
1731# Authenticated Encryption with Associated Data
1732#
1733# CONFIG_CRYPTO_CCM is not set
1734# CONFIG_CRYPTO_GCM is not set
1735# CONFIG_CRYPTO_SEQIV is not set
1736
1737#
1738# Block modes
1739#
1740CONFIG_CRYPTO_CBC=y
1741# CONFIG_CRYPTO_CTR is not set
1742# CONFIG_CRYPTO_CTS is not set
1743CONFIG_CRYPTO_ECB=y
1744# CONFIG_CRYPTO_LRW is not set
1745CONFIG_CRYPTO_PCBC=m
1746# CONFIG_CRYPTO_XTS is not set
1747
1748#
1749# Hash modes
1750#
1751# CONFIG_CRYPTO_HMAC is not set
1752# CONFIG_CRYPTO_XCBC is not set
1753
1754#
1755# Digest
1756#
1757CONFIG_CRYPTO_CRC32C=y
1758# CONFIG_CRYPTO_MD4 is not set
1759CONFIG_CRYPTO_MD5=y
1760# CONFIG_CRYPTO_MICHAEL_MIC is not set
1761# CONFIG_CRYPTO_RMD128 is not set
1762# CONFIG_CRYPTO_RMD160 is not set
1763# CONFIG_CRYPTO_RMD256 is not set
1764# CONFIG_CRYPTO_RMD320 is not set
1765# CONFIG_CRYPTO_SHA1 is not set
1766# CONFIG_CRYPTO_SHA256 is not set
1767# CONFIG_CRYPTO_SHA512 is not set
1768# CONFIG_CRYPTO_TGR192 is not set
1769# CONFIG_CRYPTO_WP512 is not set
1770
1771#
1772# Ciphers
1773#
1774CONFIG_CRYPTO_AES=y
1775# CONFIG_CRYPTO_ANUBIS is not set
1776CONFIG_CRYPTO_ARC4=y
1777# CONFIG_CRYPTO_BLOWFISH is not set
1778# CONFIG_CRYPTO_CAMELLIA is not set
1779# CONFIG_CRYPTO_CAST5 is not set
1780# CONFIG_CRYPTO_CAST6 is not set
1781CONFIG_CRYPTO_DES=y
1782# CONFIG_CRYPTO_FCRYPT is not set
1783# CONFIG_CRYPTO_KHAZAD is not set
1784# CONFIG_CRYPTO_SALSA20 is not set
1785# CONFIG_CRYPTO_SEED is not set
1786# CONFIG_CRYPTO_SERPENT is not set
1787# CONFIG_CRYPTO_TEA is not set
1788# CONFIG_CRYPTO_TWOFISH is not set
1789
1790#
1791# Compression
1792#
1793CONFIG_CRYPTO_DEFLATE=y
1794CONFIG_CRYPTO_LZO=y
1795
1796#
1797# Random Number Generation
1798#
1799# CONFIG_CRYPTO_ANSI_CPRNG is not set
1800CONFIG_CRYPTO_HW=y
1801
1802#
1803# Library routines
1804#
1805CONFIG_BITREVERSE=y
1806CONFIG_GENERIC_FIND_LAST_BIT=y
1807CONFIG_CRC_CCITT=y
1808CONFIG_CRC16=y
1809# CONFIG_CRC_T10DIF is not set
1810# CONFIG_CRC_ITU_T is not set
1811CONFIG_CRC32=y
1812CONFIG_CRC7=m
1813CONFIG_LIBCRC32C=y
1814CONFIG_ZLIB_INFLATE=y
1815CONFIG_ZLIB_DEFLATE=y
1816CONFIG_LZO_COMPRESS=y
1817CONFIG_LZO_DECOMPRESS=y
1818CONFIG_PLIST=y
1819CONFIG_HAS_IOMEM=y
1820CONFIG_HAS_IOPORT=y
1821CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/shannon_defconfig b/arch/arm/configs/shannon_defconfig
index d052c8f80515..984f7096a533 100644
--- a/arch/arm/configs/shannon_defconfig
+++ b/arch/arm/configs/shannon_defconfig
@@ -87,7 +87,6 @@ CONFIG_ARCH_SA1100=y
87# CONFIG_SA1100_COLLIE is not set 87# CONFIG_SA1100_COLLIE is not set
88# CONFIG_SA1100_H3100 is not set 88# CONFIG_SA1100_H3100 is not set
89# CONFIG_SA1100_H3600 is not set 89# CONFIG_SA1100_H3600 is not set
90# CONFIG_SA1100_H3800 is not set
91# CONFIG_SA1100_BADGE4 is not set 90# CONFIG_SA1100_BADGE4 is not set
92# CONFIG_SA1100_JORNADA720 is not set 91# CONFIG_SA1100_JORNADA720 is not set
93# CONFIG_SA1100_HACKKIT is not set 92# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig
index 9b6561d119af..90235bf7a1de 100644
--- a/arch/arm/configs/shark_defconfig
+++ b/arch/arm/configs/shark_defconfig
@@ -1,88 +1,174 @@
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-git3 3# Linux kernel version: 2.6.28-git6
4# Sat Jul 16 15:21:47 2005 4# Thu Jan 8 17:14:47 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set
9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
7CONFIG_MMU=y 11CONFIG_MMU=y
8CONFIG_UID16=y 12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 20CONFIG_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
10CONFIG_GENERIC_CALIBRATE_DELAY=y 24CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_ZONE_DMA=y
26CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
27CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
11 29
12# 30#
13# Code maturity level options 31# General setup
14# 32#
15CONFIG_EXPERIMENTAL=y 33CONFIG_EXPERIMENTAL=y
16CONFIG_CLEAN_COMPILE=y
17CONFIG_BROKEN_ON_SMP=y 34CONFIG_BROKEN_ON_SMP=y
18CONFIG_INIT_ENV_ARG_LIMIT=32 35CONFIG_INIT_ENV_ARG_LIMIT=32
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION="" 36CONFIG_LOCALVERSION=""
37# CONFIG_LOCALVERSION_AUTO is not set
24CONFIG_SWAP=y 38CONFIG_SWAP=y
25CONFIG_SYSVIPC=y 39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
26# CONFIG_POSIX_MQUEUE is not set 41# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set 42# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y 43# CONFIG_TASKSTATS is not set
29# CONFIG_AUDIT is not set 44# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set 45# CONFIG_IKCONFIG is not set
46CONFIG_LOG_BUF_SHIFT=14
47# CONFIG_CGROUPS is not set
48CONFIG_GROUP_SCHED=y
49CONFIG_FAIR_GROUP_SCHED=y
50# CONFIG_RT_GROUP_SCHED is not set
51CONFIG_USER_SCHED=y
52# CONFIG_CGROUP_SCHED is not set
53CONFIG_SYSFS_DEPRECATED=y
54CONFIG_SYSFS_DEPRECATED_V2=y
55# CONFIG_RELAY is not set
56CONFIG_NAMESPACES=y
57# CONFIG_UTS_NS is not set
58# CONFIG_IPC_NS is not set
59# CONFIG_USER_NS is not set
60# CONFIG_PID_NS is not set
61# CONFIG_BLK_DEV_INITRD is not set
62CONFIG_CC_OPTIMIZE_FOR_SIZE=y
63CONFIG_SYSCTL=y
33# CONFIG_EMBEDDED is not set 64# CONFIG_EMBEDDED is not set
65CONFIG_UID16=y
66CONFIG_SYSCTL_SYSCALL=y
34CONFIG_KALLSYMS=y 67CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_ALL is not set 68# CONFIG_KALLSYMS_ALL is not set
36# CONFIG_KALLSYMS_EXTRA_PASS is not set 69# CONFIG_KALLSYMS_EXTRA_PASS is not set
70CONFIG_HOTPLUG=y
37CONFIG_PRINTK=y 71CONFIG_PRINTK=y
38CONFIG_BUG=y 72CONFIG_BUG=y
73CONFIG_ELF_CORE=y
74CONFIG_COMPAT_BRK=y
39CONFIG_BASE_FULL=y 75CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 76CONFIG_FUTEX=y
77CONFIG_ANON_INODES=y
41CONFIG_EPOLL=y 78CONFIG_EPOLL=y
42CONFIG_CC_OPTIMIZE_FOR_SIZE=y 79CONFIG_SIGNALFD=y
80CONFIG_TIMERFD=y
81CONFIG_EVENTFD=y
43CONFIG_SHMEM=y 82CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0 83CONFIG_AIO=y
45CONFIG_CC_ALIGN_LABELS=0 84CONFIG_VM_EVENT_COUNTERS=y
46CONFIG_CC_ALIGN_LOOPS=0 85CONFIG_PCI_QUIRKS=y
47CONFIG_CC_ALIGN_JUMPS=0 86CONFIG_SLAB=y
87# CONFIG_SLUB is not set
88# CONFIG_SLOB is not set
89# CONFIG_PROFILING is not set
90CONFIG_HAVE_OPROFILE=y
91# CONFIG_KPROBES is not set
92CONFIG_HAVE_KPROBES=y
93CONFIG_HAVE_KRETPROBES=y
94CONFIG_HAVE_GENERIC_DMA_COHERENT=y
95CONFIG_SLABINFO=y
96CONFIG_RT_MUTEXES=y
48# CONFIG_TINY_SHMEM is not set 97# CONFIG_TINY_SHMEM is not set
49CONFIG_BASE_SMALL=0 98CONFIG_BASE_SMALL=0
50
51#
52# Loadable module support
53#
54CONFIG_MODULES=y 99CONFIG_MODULES=y
100# CONFIG_MODULE_FORCE_LOAD is not set
55CONFIG_MODULE_UNLOAD=y 101CONFIG_MODULE_UNLOAD=y
56CONFIG_MODULE_FORCE_UNLOAD=y 102CONFIG_MODULE_FORCE_UNLOAD=y
57CONFIG_OBSOLETE_MODPARM=y
58# CONFIG_MODVERSIONS is not set 103# CONFIG_MODVERSIONS is not set
59# CONFIG_MODULE_SRCVERSION_ALL is not set 104# CONFIG_MODULE_SRCVERSION_ALL is not set
60CONFIG_KMOD=y 105CONFIG_KMOD=y
106CONFIG_BLOCK=y
107# CONFIG_LBD is not set
108# CONFIG_BLK_DEV_IO_TRACE is not set
109# CONFIG_BLK_DEV_BSG is not set
110# CONFIG_BLK_DEV_INTEGRITY is not set
111
112#
113# IO Schedulers
114#
115CONFIG_IOSCHED_NOOP=y
116CONFIG_IOSCHED_AS=y
117CONFIG_IOSCHED_DEADLINE=y
118CONFIG_IOSCHED_CFQ=y
119# CONFIG_DEFAULT_AS is not set
120# CONFIG_DEFAULT_DEADLINE is not set
121CONFIG_DEFAULT_CFQ=y
122# CONFIG_DEFAULT_NOOP is not set
123CONFIG_DEFAULT_IOSCHED="cfq"
124CONFIG_CLASSIC_RCU=y
125# CONFIG_TREE_RCU is not set
126# CONFIG_PREEMPT_RCU is not set
127# CONFIG_TREE_RCU_TRACE is not set
128# CONFIG_PREEMPT_RCU_TRACE is not set
129# CONFIG_FREEZER is not set
61 130
62# 131#
63# System Type 132# System Type
64# 133#
65# CONFIG_ARCH_CLPS7500 is not set 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
66# CONFIG_ARCH_CLPS711X is not set 139# CONFIG_ARCH_CLPS711X is not set
67# CONFIG_ARCH_CO285 is not set
68# CONFIG_ARCH_EBSA110 is not set 140# CONFIG_ARCH_EBSA110 is not set
141# CONFIG_ARCH_EP93XX is not set
69# CONFIG_ARCH_FOOTBRIDGE is not set 142# CONFIG_ARCH_FOOTBRIDGE is not set
70# CONFIG_ARCH_INTEGRATOR is not set 143# CONFIG_ARCH_NETX is not set
71# CONFIG_ARCH_IOP3XX is not set 144# CONFIG_ARCH_H720X is not set
72# CONFIG_ARCH_IXP4XX is not set 145# CONFIG_ARCH_IMX is not set
146# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set
149# CONFIG_ARCH_IXP23XX is not set
73# CONFIG_ARCH_IXP2000 is not set 150# CONFIG_ARCH_IXP2000 is not set
151# CONFIG_ARCH_IXP4XX is not set
74# CONFIG_ARCH_L7200 is not set 152# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set
154# CONFIG_ARCH_KS8695 is not set
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_ORION5X is not set
160# CONFIG_ARCH_PNX4008 is not set
75# CONFIG_ARCH_PXA is not set 161# CONFIG_ARCH_PXA is not set
76# CONFIG_ARCH_RPC is not set 162# CONFIG_ARCH_RPC is not set
77# CONFIG_ARCH_SA1100 is not set 163# CONFIG_ARCH_SA1100 is not set
78# CONFIG_ARCH_S3C2410 is not set 164# CONFIG_ARCH_S3C2410 is not set
165# CONFIG_ARCH_S3C64XX is not set
79CONFIG_ARCH_SHARK=y 166CONFIG_ARCH_SHARK=y
80# CONFIG_ARCH_LH7A40X is not set 167# CONFIG_ARCH_LH7A40X is not set
168# CONFIG_ARCH_DAVINCI is not set
81# CONFIG_ARCH_OMAP is not set 169# CONFIG_ARCH_OMAP is not set
82# CONFIG_ARCH_VERSATILE is not set 170# CONFIG_ARCH_MSM is not set
83# CONFIG_ARCH_IMX is not set 171# CONFIG_ARCH_W90X900 is not set
84# CONFIG_ARCH_H720X is not set
85# CONFIG_ARCH_AAEC2000 is not set
86 172
87# 173#
88# Processor Type 174# Processor Type
@@ -91,14 +177,20 @@ CONFIG_CPU_32=y
91CONFIG_CPU_SA110=y 177CONFIG_CPU_SA110=y
92CONFIG_CPU_32v4=y 178CONFIG_CPU_32v4=y
93CONFIG_CPU_ABRT_EV4=y 179CONFIG_CPU_ABRT_EV4=y
180CONFIG_CPU_PABRT_NOIFAR=y
94CONFIG_CPU_CACHE_V4WB=y 181CONFIG_CPU_CACHE_V4WB=y
95CONFIG_CPU_CACHE_VIVT=y 182CONFIG_CPU_CACHE_VIVT=y
96CONFIG_CPU_COPY_V4WB=y 183CONFIG_CPU_COPY_V4WB=y
97CONFIG_CPU_TLB_V4WB=y 184CONFIG_CPU_TLB_V4WB=y
185CONFIG_CPU_CP15=y
186CONFIG_CPU_CP15_MMU=y
98 187
99# 188#
100# Processor Features 189# Processor Features
101# 190#
191# CONFIG_CPU_ICACHE_DISABLE is not set
192# CONFIG_CPU_DCACHE_DISABLE is not set
193# CONFIG_OUTER_CACHE is not set
102 194
103# 195#
104# Bus support 196# Bus support
@@ -107,22 +199,40 @@ CONFIG_ISA=y
107CONFIG_ISA_DMA=y 199CONFIG_ISA_DMA=y
108CONFIG_ISA_DMA_API=y 200CONFIG_ISA_DMA_API=y
109CONFIG_PCI=y 201CONFIG_PCI=y
202CONFIG_PCI_SYSCALL=y
110CONFIG_PCI_HOST_VIA82C505=y 203CONFIG_PCI_HOST_VIA82C505=y
111CONFIG_PCI_LEGACY_PROC=y 204# CONFIG_ARCH_SUPPORTS_MSI is not set
112# CONFIG_PCI_NAMES is not set 205CONFIG_PCI_LEGACY=y
113# CONFIG_PCI_DEBUG is not set 206# CONFIG_PCI_DEBUG is not set
114
115#
116# PCCARD (PCMCIA/CardBus) support
117#
118# CONFIG_PCCARD is not set 207# CONFIG_PCCARD is not set
119 208
120# 209#
121# Kernel Features 210# Kernel Features
122# 211#
123# CONFIG_SMP is not set 212CONFIG_VMSPLIT_3G=y
213# CONFIG_VMSPLIT_2G is not set
214# CONFIG_VMSPLIT_1G is not set
215CONFIG_PAGE_OFFSET=0xC0000000
124# CONFIG_PREEMPT is not set 216# CONFIG_PREEMPT is not set
125# CONFIG_DISCONTIGMEM is not set 217CONFIG_HZ=100
218# CONFIG_AEABI is not set
219CONFIG_ARCH_FLATMEM_HAS_HOLES=y
220# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
221# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
222CONFIG_SELECT_MEMORY_MODEL=y
223CONFIG_FLATMEM_MANUAL=y
224# CONFIG_DISCONTIGMEM_MANUAL is not set
225# CONFIG_SPARSEMEM_MANUAL is not set
226CONFIG_FLATMEM=y
227CONFIG_FLAT_NODE_MEM_MAP=y
228CONFIG_PAGEFLAGS_EXTENDED=y
229CONFIG_SPLIT_PTLOCK_CPUS=4096
230# CONFIG_RESOURCES_64BIT is not set
231# CONFIG_PHYS_ADDR_T_64BIT is not set
232CONFIG_ZONE_DMA_FLAG=1
233CONFIG_BOUNCE=y
234CONFIG_VIRT_TO_BUS=y
235CONFIG_UNEVICTABLE_LRU=y
126CONFIG_LEDS=y 236CONFIG_LEDS=y
127CONFIG_LEDS_TIMER=y 237CONFIG_LEDS_TIMER=y
128# CONFIG_LEDS_CPU is not set 238# CONFIG_LEDS_CPU is not set
@@ -135,6 +245,12 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
135CONFIG_ZBOOT_ROM_BSS=0x0 245CONFIG_ZBOOT_ROM_BSS=0x0
136CONFIG_CMDLINE="" 246CONFIG_CMDLINE=""
137# CONFIG_XIP_KERNEL is not set 247# CONFIG_XIP_KERNEL is not set
248# CONFIG_KEXEC is not set
249
250#
251# CPU Power Management
252#
253# CONFIG_CPU_IDLE is not set
138 254
139# 255#
140# Floating point emulation 256# Floating point emulation
@@ -143,13 +259,16 @@ CONFIG_CMDLINE=""
143# 259#
144# At least one emulation must be selected 260# At least one emulation must be selected
145# 261#
146# CONFIG_FPE_NWFPE is not set 262CONFIG_FPE_NWFPE=y
147CONFIG_FPE_FASTFPE=y 263# CONFIG_FPE_NWFPE_XP is not set
264# CONFIG_FPE_FASTFPE is not set
148 265
149# 266#
150# Userspace binary formats 267# Userspace binary formats
151# 268#
152CONFIG_BINFMT_ELF=y 269CONFIG_BINFMT_ELF=y
270# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
271CONFIG_HAVE_AOUT=y
153# CONFIG_BINFMT_AOUT is not set 272# CONFIG_BINFMT_AOUT is not set
154# CONFIG_BINFMT_MISC is not set 273# CONFIG_BINFMT_MISC is not set
155# CONFIG_ARTHUR is not set 274# CONFIG_ARTHUR is not set
@@ -158,44 +277,104 @@ CONFIG_BINFMT_ELF=y
158# Power management options 277# Power management options
159# 278#
160# CONFIG_PM is not set 279# CONFIG_PM is not set
280CONFIG_ARCH_SUSPEND_POSSIBLE=y
281CONFIG_NET=y
161 282
162# 283#
163# Device Drivers 284# Networking options
164# 285#
286# CONFIG_NET_NS is not set
287CONFIG_COMPAT_NET_DEV_OPS=y
288CONFIG_PACKET=y
289# CONFIG_PACKET_MMAP is not set
290CONFIG_UNIX=y
291# CONFIG_NET_KEY is not set
292CONFIG_INET=y
293# CONFIG_IP_MULTICAST is not set
294# CONFIG_IP_ADVANCED_ROUTER is not set
295CONFIG_IP_FIB_HASH=y
296# CONFIG_IP_PNP is not set
297# CONFIG_NET_IPIP is not set
298# CONFIG_NET_IPGRE is not set
299# CONFIG_ARPD is not set
300# CONFIG_SYN_COOKIES is not set
301# CONFIG_INET_AH is not set
302# CONFIG_INET_ESP is not set
303# CONFIG_INET_IPCOMP is not set
304# CONFIG_INET_XFRM_TUNNEL is not set
305# CONFIG_INET_TUNNEL is not set
306# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
307# CONFIG_INET_XFRM_MODE_TUNNEL is not set
308# CONFIG_INET_XFRM_MODE_BEET is not set
309# CONFIG_INET_LRO is not set
310# CONFIG_INET_DIAG is not set
311# CONFIG_TCP_CONG_ADVANCED is not set
312CONFIG_TCP_CONG_CUBIC=y
313CONFIG_DEFAULT_TCP_CONG="cubic"
314# CONFIG_TCP_MD5SIG is not set
315# CONFIG_IPV6 is not set
316# CONFIG_NETWORK_SECMARK is not set
317# CONFIG_NETFILTER is not set
318# CONFIG_IP_DCCP is not set
319# CONFIG_IP_SCTP is not set
320# CONFIG_TIPC is not set
321# CONFIG_ATM is not set
322# CONFIG_BRIDGE is not set
323# CONFIG_NET_DSA is not set
324# CONFIG_VLAN_8021Q is not set
325# CONFIG_DECNET is not set
326# CONFIG_LLC2 is not set
327# CONFIG_IPX is not set
328# CONFIG_ATALK is not set
329# CONFIG_X25 is not set
330# CONFIG_LAPB is not set
331# CONFIG_ECONET is not set
332# CONFIG_WAN_ROUTER is not set
333# CONFIG_NET_SCHED is not set
334# CONFIG_DCB is not set
165 335
166# 336#
167# Generic Driver Options 337# Network testing
168# 338#
169# CONFIG_STANDALONE is not set 339# CONFIG_NET_PKTGEN is not set
170CONFIG_PREVENT_FIRMWARE_BUILD=y 340# CONFIG_HAMRADIO is not set
171# CONFIG_FW_LOADER is not set 341# CONFIG_CAN is not set
172# CONFIG_DEBUG_DRIVER is not set 342# CONFIG_IRDA is not set
343# CONFIG_BT is not set
344# CONFIG_AF_RXRPC is not set
345# CONFIG_PHONET is not set
346# CONFIG_WIRELESS is not set
347# CONFIG_RFKILL is not set
348# CONFIG_NET_9P is not set
173 349
174# 350#
175# Memory Technology Devices (MTD) 351# Device Drivers
176# 352#
177# CONFIG_MTD is not set
178 353
179# 354#
180# Parallel port support 355# Generic Driver Options
181# 356#
357CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
358# CONFIG_STANDALONE is not set
359CONFIG_PREVENT_FIRMWARE_BUILD=y
360CONFIG_FW_LOADER=y
361# CONFIG_FIRMWARE_IN_KERNEL is not set
362CONFIG_EXTRA_FIRMWARE=""
363# CONFIG_DEBUG_DRIVER is not set
364# CONFIG_DEBUG_DEVRES is not set
365# CONFIG_SYS_HYPERVISOR is not set
366# CONFIG_CONNECTOR is not set
367# CONFIG_MTD is not set
182CONFIG_PARPORT=m 368CONFIG_PARPORT=m
183CONFIG_PARPORT_PC=m 369CONFIG_PARPORT_PC=m
184# CONFIG_PARPORT_SERIAL is not set 370# CONFIG_PARPORT_SERIAL is not set
185# CONFIG_PARPORT_PC_FIFO is not set 371# CONFIG_PARPORT_PC_FIFO is not set
186# CONFIG_PARPORT_PC_SUPERIO is not set 372# CONFIG_PARPORT_PC_SUPERIO is not set
187# CONFIG_PARPORT_ARC is not set
188# CONFIG_PARPORT_GSC is not set 373# CONFIG_PARPORT_GSC is not set
374# CONFIG_PARPORT_AX88796 is not set
189# CONFIG_PARPORT_1284 is not set 375# CONFIG_PARPORT_1284 is not set
190
191#
192# Plug and Play support
193#
194# CONFIG_PNP is not set 376# CONFIG_PNP is not set
195 377CONFIG_BLK_DEV=y
196#
197# Block devices
198#
199# CONFIG_BLK_DEV_XD is not set 378# CONFIG_BLK_DEV_XD is not set
200# CONFIG_PARIDE is not set 379# CONFIG_PARIDE is not set
201# CONFIG_BLK_CPQ_DA is not set 380# CONFIG_BLK_CPQ_DA is not set
@@ -210,52 +389,78 @@ CONFIG_BLK_DEV_LOOP=y
210CONFIG_BLK_DEV_RAM=y 389CONFIG_BLK_DEV_RAM=y
211CONFIG_BLK_DEV_RAM_COUNT=16 390CONFIG_BLK_DEV_RAM_COUNT=16
212CONFIG_BLK_DEV_RAM_SIZE=4096 391CONFIG_BLK_DEV_RAM_SIZE=4096
213# CONFIG_BLK_DEV_INITRD is not set 392# CONFIG_BLK_DEV_XIP is not set
214CONFIG_INITRAMFS_SOURCE=""
215# CONFIG_CDROM_PKTCDVD is not set 393# CONFIG_CDROM_PKTCDVD is not set
216
217#
218# IO Schedulers
219#
220CONFIG_IOSCHED_NOOP=y
221CONFIG_IOSCHED_AS=y
222CONFIG_IOSCHED_DEADLINE=y
223CONFIG_IOSCHED_CFQ=y
224# CONFIG_ATA_OVER_ETH is not set 394# CONFIG_ATA_OVER_ETH is not set
225 395# CONFIG_BLK_DEV_HD is not set
226# 396CONFIG_MISC_DEVICES=y
227# ATA/ATAPI/MFM/RLL support 397# CONFIG_PHANTOM is not set
228# 398# CONFIG_EEPROM_93CX6 is not set
399# CONFIG_SGI_IOC4 is not set
400# CONFIG_TIFM_CORE is not set
401# CONFIG_ENCLOSURE_SERVICES is not set
402# CONFIG_HP_ILO is not set
403# CONFIG_C2PORT is not set
404CONFIG_HAVE_IDE=y
229CONFIG_IDE=y 405CONFIG_IDE=y
230CONFIG_BLK_DEV_IDE=y
231 406
232# 407#
233# Please see Documentation/ide.txt for help/info on IDE drives 408# Please see Documentation/ide/ide.txt for help/info on IDE drives
234# 409#
410CONFIG_IDE_ATAPI=y
235# CONFIG_BLK_DEV_IDE_SATA is not set 411# CONFIG_BLK_DEV_IDE_SATA is not set
236CONFIG_BLK_DEV_IDEDISK=y 412CONFIG_IDE_GD=y
237# CONFIG_IDEDISK_MULTI_MODE is not set 413CONFIG_IDE_GD_ATA=y
414# CONFIG_IDE_GD_ATAPI is not set
238CONFIG_BLK_DEV_IDECD=m 415CONFIG_BLK_DEV_IDECD=m
416CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
239# CONFIG_BLK_DEV_IDETAPE is not set 417# CONFIG_BLK_DEV_IDETAPE is not set
240CONFIG_BLK_DEV_IDEFLOPPY=y
241# CONFIG_BLK_DEV_IDESCSI is not set
242# CONFIG_IDE_TASK_IOCTL is not set 418# CONFIG_IDE_TASK_IOCTL is not set
419CONFIG_IDE_PROC_FS=y
243 420
244# 421#
245# IDE chipset support/bugfixes 422# IDE chipset support/bugfixes
246# 423#
247CONFIG_IDE_GENERIC=y 424# CONFIG_BLK_DEV_PLATFORM is not set
248# CONFIG_BLK_DEV_IDEPCI is not set 425
426#
427# PCI IDE chipsets support
428#
429# CONFIG_BLK_DEV_GENERIC is not set
430# CONFIG_BLK_DEV_OPTI621 is not set
431# CONFIG_BLK_DEV_AEC62XX is not set
432# CONFIG_BLK_DEV_ALI15X3 is not set
433# CONFIG_BLK_DEV_CMD64X is not set
434# CONFIG_BLK_DEV_TRIFLEX is not set
435# CONFIG_BLK_DEV_CS5520 is not set
436# CONFIG_BLK_DEV_CS5530 is not set
437# CONFIG_BLK_DEV_HPT366 is not set
438# CONFIG_BLK_DEV_JMICRON is not set
439# CONFIG_BLK_DEV_SC1200 is not set
440# CONFIG_BLK_DEV_PIIX is not set
441# CONFIG_BLK_DEV_IT8213 is not set
442# CONFIG_BLK_DEV_IT821X is not set
443# CONFIG_BLK_DEV_NS87415 is not set
444# CONFIG_BLK_DEV_PDC202XX_OLD is not set
445# CONFIG_BLK_DEV_PDC202XX_NEW is not set
446# CONFIG_BLK_DEV_SVWKS is not set
447# CONFIG_BLK_DEV_SIIMAGE is not set
448# CONFIG_BLK_DEV_SL82C105 is not set
449# CONFIG_BLK_DEV_SLC90E66 is not set
450# CONFIG_BLK_DEV_TRM290 is not set
451# CONFIG_BLK_DEV_VIA82CXXX is not set
452# CONFIG_BLK_DEV_TC86C001 is not set
249CONFIG_IDE_ARM=y 453CONFIG_IDE_ARM=y
250# CONFIG_IDE_CHIPSETS is not set
251# CONFIG_BLK_DEV_IDEDMA is not set 454# CONFIG_BLK_DEV_IDEDMA is not set
252# CONFIG_IDEDMA_AUTO is not set
253# CONFIG_BLK_DEV_HD is not set
254 455
255# 456#
256# SCSI device support 457# SCSI device support
257# 458#
459# CONFIG_RAID_ATTRS is not set
258CONFIG_SCSI=m 460CONFIG_SCSI=m
461CONFIG_SCSI_DMA=y
462# CONFIG_SCSI_TGT is not set
463# CONFIG_SCSI_NETLINK is not set
259CONFIG_SCSI_PROC_FS=y 464CONFIG_SCSI_PROC_FS=y
260 465
261# 466#
@@ -275,17 +480,20 @@ CONFIG_CHR_DEV_SG=m
275# CONFIG_SCSI_MULTI_LUN is not set 480# CONFIG_SCSI_MULTI_LUN is not set
276# CONFIG_SCSI_CONSTANTS is not set 481# CONFIG_SCSI_CONSTANTS is not set
277# CONFIG_SCSI_LOGGING is not set 482# CONFIG_SCSI_LOGGING is not set
483# CONFIG_SCSI_SCAN_ASYNC is not set
484CONFIG_SCSI_WAIT_SCAN=m
278 485
279# 486#
280# SCSI Transport Attributes 487# SCSI Transports
281# 488#
282# CONFIG_SCSI_SPI_ATTRS is not set 489# CONFIG_SCSI_SPI_ATTRS is not set
283# CONFIG_SCSI_FC_ATTRS is not set 490# CONFIG_SCSI_FC_ATTRS is not set
284# CONFIG_SCSI_ISCSI_ATTRS is not set 491# CONFIG_SCSI_ISCSI_ATTRS is not set
285 492# CONFIG_SCSI_SAS_LIBSAS is not set
286# 493# CONFIG_SCSI_SRP_ATTRS is not set
287# SCSI low-level drivers 494CONFIG_SCSI_LOWLEVEL=y
288# 495# CONFIG_ISCSI_TCP is not set
496# CONFIG_SCSI_CXGB3_ISCSI is not set
289# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 497# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
290# CONFIG_SCSI_3W_9XXX is not set 498# CONFIG_SCSI_3W_9XXX is not set
291# CONFIG_SCSI_7000FASST is not set 499# CONFIG_SCSI_7000FASST is not set
@@ -296,12 +504,18 @@ CONFIG_CHR_DEV_SG=m
296# CONFIG_SCSI_AIC7XXX is not set 504# CONFIG_SCSI_AIC7XXX is not set
297# CONFIG_SCSI_AIC7XXX_OLD is not set 505# CONFIG_SCSI_AIC7XXX_OLD is not set
298# CONFIG_SCSI_AIC79XX is not set 506# CONFIG_SCSI_AIC79XX is not set
507# CONFIG_SCSI_AIC94XX is not set
299# CONFIG_SCSI_DPT_I2O is not set 508# CONFIG_SCSI_DPT_I2O is not set
509# CONFIG_SCSI_ADVANSYS is not set
300# CONFIG_SCSI_IN2000 is not set 510# CONFIG_SCSI_IN2000 is not set
511# CONFIG_SCSI_ARCMSR is not set
301# CONFIG_MEGARAID_NEWGEN is not set 512# CONFIG_MEGARAID_NEWGEN is not set
302# CONFIG_MEGARAID_LEGACY is not set 513# CONFIG_MEGARAID_LEGACY is not set
303# CONFIG_SCSI_SATA is not set 514# CONFIG_MEGARAID_SAS is not set
515# CONFIG_SCSI_HPTIOP is not set
304# CONFIG_SCSI_BUSLOGIC is not set 516# CONFIG_SCSI_BUSLOGIC is not set
517# CONFIG_LIBFC is not set
518# CONFIG_FCOE is not set
305# CONFIG_SCSI_DMX3191D is not set 519# CONFIG_SCSI_DMX3191D is not set
306# CONFIG_SCSI_DTC3280 is not set 520# CONFIG_SCSI_DTC3280 is not set
307# CONFIG_SCSI_EATA is not set 521# CONFIG_SCSI_EATA is not set
@@ -314,20 +528,15 @@ CONFIG_CHR_DEV_SG=m
314# CONFIG_SCSI_INIA100 is not set 528# CONFIG_SCSI_INIA100 is not set
315# CONFIG_SCSI_PPA is not set 529# CONFIG_SCSI_PPA is not set
316# CONFIG_SCSI_IMM is not set 530# CONFIG_SCSI_IMM is not set
531# CONFIG_SCSI_MVSAS is not set
317# CONFIG_SCSI_NCR53C406A is not set 532# CONFIG_SCSI_NCR53C406A is not set
533# CONFIG_SCSI_STEX is not set
318# CONFIG_SCSI_SYM53C8XX_2 is not set 534# CONFIG_SCSI_SYM53C8XX_2 is not set
319# CONFIG_SCSI_IPR is not set
320# CONFIG_SCSI_PAS16 is not set 535# CONFIG_SCSI_PAS16 is not set
321# CONFIG_SCSI_PSI240I is not set
322# CONFIG_SCSI_QLOGIC_FAS is not set 536# CONFIG_SCSI_QLOGIC_FAS is not set
323# CONFIG_SCSI_QLOGIC_FC is not set
324# CONFIG_SCSI_QLOGIC_1280 is not set 537# CONFIG_SCSI_QLOGIC_1280 is not set
325CONFIG_SCSI_QLA2XXX=m 538# CONFIG_SCSI_QLA_FC is not set
326# CONFIG_SCSI_QLA21XX is not set 539# CONFIG_SCSI_QLA_ISCSI is not set
327# CONFIG_SCSI_QLA22XX is not set
328# CONFIG_SCSI_QLA2300 is not set
329# CONFIG_SCSI_QLA2322 is not set
330# CONFIG_SCSI_QLA6312 is not set
331# CONFIG_SCSI_LPFC is not set 540# CONFIG_SCSI_LPFC is not set
332# CONFIG_SCSI_SYM53C416 is not set 541# CONFIG_SCSI_SYM53C416 is not set
333# CONFIG_SCSI_DC395x is not set 542# CONFIG_SCSI_DC395x is not set
@@ -336,123 +545,57 @@ CONFIG_SCSI_QLA2XXX=m
336# CONFIG_SCSI_U14_34F is not set 545# CONFIG_SCSI_U14_34F is not set
337# CONFIG_SCSI_NSP32 is not set 546# CONFIG_SCSI_NSP32 is not set
338# CONFIG_SCSI_DEBUG is not set 547# CONFIG_SCSI_DEBUG is not set
339 548# CONFIG_SCSI_SRP is not set
340# 549# CONFIG_SCSI_DH is not set
341# Multi-device support (RAID and LVM) 550# CONFIG_ATA is not set
342#
343# CONFIG_MD is not set 551# CONFIG_MD is not set
344
345#
346# Fusion MPT device support
347#
348# CONFIG_FUSION is not set 552# CONFIG_FUSION is not set
349# CONFIG_FUSION_SPI is not set
350# CONFIG_FUSION_FC is not set
351 553
352# 554#
353# IEEE 1394 (FireWire) support 555# IEEE 1394 (FireWire) support
354# 556#
355# CONFIG_IEEE1394 is not set
356 557
357# 558#
358# I2O device support 559# Enable only one of the two stacks, unless you know what you are doing
359# 560#
561# CONFIG_FIREWIRE is not set
562# CONFIG_IEEE1394 is not set
360# CONFIG_I2O is not set 563# CONFIG_I2O is not set
361
362#
363# Networking support
364#
365CONFIG_NET=y
366
367#
368# Networking options
369#
370CONFIG_PACKET=y
371# CONFIG_PACKET_MMAP is not set
372CONFIG_UNIX=y
373# CONFIG_NET_KEY is not set
374CONFIG_INET=y
375# CONFIG_IP_MULTICAST is not set
376# CONFIG_IP_ADVANCED_ROUTER is not set
377# CONFIG_IP_PNP is not set
378# CONFIG_NET_IPIP is not set
379# CONFIG_NET_IPGRE is not set
380# CONFIG_ARPD is not set
381# CONFIG_SYN_COOKIES is not set
382# CONFIG_INET_AH is not set
383# CONFIG_INET_ESP is not set
384# CONFIG_INET_IPCOMP is not set
385# CONFIG_INET_TUNNEL is not set
386CONFIG_IP_TCPDIAG=y
387# CONFIG_IP_TCPDIAG_IPV6 is not set
388# CONFIG_IPV6 is not set
389# CONFIG_NETFILTER is not set
390
391#
392# SCTP Configuration (EXPERIMENTAL)
393#
394# CONFIG_IP_SCTP is not set
395# CONFIG_ATM is not set
396# CONFIG_BRIDGE is not set
397# CONFIG_VLAN_8021Q is not set
398# CONFIG_DECNET is not set
399# CONFIG_LLC2 is not set
400# CONFIG_IPX is not set
401# CONFIG_ATALK is not set
402# CONFIG_X25 is not set
403# CONFIG_LAPB is not set
404# CONFIG_NET_DIVERT is not set
405# CONFIG_ECONET is not set
406# CONFIG_WAN_ROUTER is not set
407
408#
409# QoS and/or fair queueing
410#
411# CONFIG_NET_SCHED is not set
412# CONFIG_NET_CLS_ROUTE is not set
413
414#
415# Network testing
416#
417# CONFIG_NET_PKTGEN is not set
418# CONFIG_NETPOLL is not set
419# CONFIG_NET_POLL_CONTROLLER is not set
420# CONFIG_HAMRADIO is not set
421# CONFIG_IRDA is not set
422# CONFIG_BT is not set
423CONFIG_NETDEVICES=y 564CONFIG_NETDEVICES=y
424# CONFIG_DUMMY is not set 565# CONFIG_DUMMY is not set
425# CONFIG_BONDING is not set 566# CONFIG_BONDING is not set
567# CONFIG_MACVLAN is not set
426# CONFIG_EQUALIZER is not set 568# CONFIG_EQUALIZER is not set
427# CONFIG_TUN is not set 569# CONFIG_TUN is not set
428 570# CONFIG_VETH is not set
429#
430# ARCnet devices
431#
432# CONFIG_ARCNET is not set 571# CONFIG_ARCNET is not set
433 572# CONFIG_PHYLIB is not set
434#
435# Ethernet (10 or 100Mbit)
436#
437CONFIG_NET_ETHERNET=y 573CONFIG_NET_ETHERNET=y
438# CONFIG_MII is not set 574# CONFIG_MII is not set
575# CONFIG_AX88796 is not set
439# CONFIG_HAPPYMEAL is not set 576# CONFIG_HAPPYMEAL is not set
440# CONFIG_SUNGEM is not set 577# CONFIG_SUNGEM is not set
578# CONFIG_CASSINI is not set
441# CONFIG_NET_VENDOR_3COM is not set 579# CONFIG_NET_VENDOR_3COM is not set
442# CONFIG_LANCE is not set 580# CONFIG_LANCE is not set
443# CONFIG_NET_VENDOR_SMC is not set 581# CONFIG_NET_VENDOR_SMC is not set
444# CONFIG_SMC91X is not set 582# CONFIG_SMC91X is not set
445# CONFIG_DM9000 is not set 583# CONFIG_DM9000 is not set
584# CONFIG_SMC911X is not set
585# CONFIG_SMSC911X is not set
446# CONFIG_NET_VENDOR_RACAL is not set 586# CONFIG_NET_VENDOR_RACAL is not set
447
448#
449# Tulip family network device support
450#
451# CONFIG_NET_TULIP is not set 587# CONFIG_NET_TULIP is not set
452# CONFIG_AT1700 is not set 588# CONFIG_AT1700 is not set
453# CONFIG_DEPCA is not set 589# CONFIG_DEPCA is not set
454# CONFIG_HP100 is not set 590# CONFIG_HP100 is not set
455# CONFIG_NET_ISA is not set 591# CONFIG_NET_ISA is not set
592# CONFIG_IBM_NEW_EMAC_ZMII is not set
593# CONFIG_IBM_NEW_EMAC_RGMII is not set
594# CONFIG_IBM_NEW_EMAC_TAH is not set
595# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
596# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
597# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
598# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
456CONFIG_NET_PCI=y 599CONFIG_NET_PCI=y
457# CONFIG_PCNET32 is not set 600# CONFIG_PCNET32 is not set
458# CONFIG_AMD8111_ETH is not set 601# CONFIG_AMD8111_ETH is not set
@@ -462,56 +605,69 @@ CONFIG_NET_PCI=y
462# CONFIG_B44 is not set 605# CONFIG_B44 is not set
463# CONFIG_FORCEDETH is not set 606# CONFIG_FORCEDETH is not set
464CONFIG_CS89x0=y 607CONFIG_CS89x0=y
465# CONFIG_DGRS is not set 608CONFIG_CS89x0_NOEEPROM=y
466# CONFIG_EEPRO100 is not set
467# CONFIG_E100 is not set 609# CONFIG_E100 is not set
468# CONFIG_FEALNX is not set 610# CONFIG_FEALNX is not set
469# CONFIG_NATSEMI is not set 611# CONFIG_NATSEMI is not set
470# CONFIG_NE2K_PCI is not set 612# CONFIG_NE2K_PCI is not set
471# CONFIG_8139CP is not set 613# CONFIG_8139CP is not set
472# CONFIG_8139TOO is not set 614# CONFIG_8139TOO is not set
615# CONFIG_R6040 is not set
473# CONFIG_SIS900 is not set 616# CONFIG_SIS900 is not set
474# CONFIG_EPIC100 is not set 617# CONFIG_EPIC100 is not set
618# CONFIG_SMSC9420 is not set
475# CONFIG_SUNDANCE is not set 619# CONFIG_SUNDANCE is not set
476# CONFIG_TLAN is not set 620# CONFIG_TLAN is not set
477# CONFIG_VIA_RHINE is not set 621# CONFIG_VIA_RHINE is not set
622# CONFIG_SC92031 is not set
478# CONFIG_NET_POCKET is not set 623# CONFIG_NET_POCKET is not set
479 624# CONFIG_ATL2 is not set
480# 625CONFIG_NETDEV_1000=y
481# Ethernet (1000 Mbit)
482#
483# CONFIG_ACENIC is not set 626# CONFIG_ACENIC is not set
484# CONFIG_DL2K is not set 627# CONFIG_DL2K is not set
485# CONFIG_E1000 is not set 628# CONFIG_E1000 is not set
629# CONFIG_E1000E is not set
630# CONFIG_IP1000 is not set
631# CONFIG_IGB is not set
486# CONFIG_NS83820 is not set 632# CONFIG_NS83820 is not set
487# CONFIG_HAMACHI is not set 633# CONFIG_HAMACHI is not set
488# CONFIG_YELLOWFIN is not set 634# CONFIG_YELLOWFIN is not set
489# CONFIG_R8169 is not set 635# CONFIG_R8169 is not set
636# CONFIG_SIS190 is not set
490# CONFIG_SKGE is not set 637# CONFIG_SKGE is not set
491# CONFIG_SK98LIN is not set 638# CONFIG_SKY2 is not set
492# CONFIG_VIA_VELOCITY is not set 639# CONFIG_VIA_VELOCITY is not set
493# CONFIG_TIGON3 is not set 640# CONFIG_TIGON3 is not set
494# CONFIG_BNX2 is not set 641# CONFIG_BNX2 is not set
495 642# CONFIG_QLA3XXX is not set
496# 643# CONFIG_ATL1 is not set
497# Ethernet (10000 Mbit) 644# CONFIG_ATL1E is not set
498# 645# CONFIG_JME is not set
646CONFIG_NETDEV_10000=y
647# CONFIG_CHELSIO_T1 is not set
648CONFIG_CHELSIO_T3_DEPENDS=y
649# CONFIG_CHELSIO_T3 is not set
650# CONFIG_ENIC is not set
651# CONFIG_IXGBE is not set
499# CONFIG_IXGB is not set 652# CONFIG_IXGB is not set
500# CONFIG_S2IO is not set 653# CONFIG_S2IO is not set
501 654# CONFIG_MYRI10GE is not set
502# 655# CONFIG_NETXEN_NIC is not set
503# Token Ring devices 656# CONFIG_NIU is not set
504# 657# CONFIG_MLX4_EN is not set
658# CONFIG_MLX4_CORE is not set
659# CONFIG_TEHUTI is not set
660# CONFIG_BNX2X is not set
661# CONFIG_QLGE is not set
662# CONFIG_SFC is not set
505# CONFIG_TR is not set 663# CONFIG_TR is not set
506 664
507# 665#
508# Wireless LAN (non-hamradio) 666# Wireless LAN
509#
510# CONFIG_NET_RADIO is not set
511
512#
513# Wan interfaces
514# 667#
668# CONFIG_WLAN_PRE80211 is not set
669# CONFIG_WLAN_80211 is not set
670# CONFIG_IWLWIFI_LEDS is not set
515# CONFIG_WAN is not set 671# CONFIG_WAN is not set
516# CONFIG_FDDI is not set 672# CONFIG_FDDI is not set
517# CONFIG_HIPPI is not set 673# CONFIG_HIPPI is not set
@@ -519,18 +675,17 @@ CONFIG_CS89x0=y
519# CONFIG_PPP is not set 675# CONFIG_PPP is not set
520# CONFIG_SLIP is not set 676# CONFIG_SLIP is not set
521# CONFIG_NET_FC is not set 677# CONFIG_NET_FC is not set
522# CONFIG_SHAPER is not set
523# CONFIG_NETCONSOLE is not set 678# CONFIG_NETCONSOLE is not set
524 679# CONFIG_NETPOLL is not set
525# 680# CONFIG_NET_POLL_CONTROLLER is not set
526# ISDN subsystem
527#
528# CONFIG_ISDN is not set 681# CONFIG_ISDN is not set
529 682
530# 683#
531# Input device support 684# Input device support
532# 685#
533CONFIG_INPUT=y 686CONFIG_INPUT=y
687# CONFIG_INPUT_FF_MEMLESS is not set
688# CONFIG_INPUT_POLLDEV is not set
534 689
535# 690#
536# Userland interfaces 691# Userland interfaces
@@ -540,7 +695,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
540CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 695CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
541CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 696CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
542# CONFIG_INPUT_JOYDEV is not set 697# CONFIG_INPUT_JOYDEV is not set
543# CONFIG_INPUT_TSDEV is not set
544# CONFIG_INPUT_EVDEV is not set 698# CONFIG_INPUT_EVDEV is not set
545# CONFIG_INPUT_EVBUG is not set 699# CONFIG_INPUT_EVBUG is not set
546 700
@@ -553,14 +707,25 @@ CONFIG_KEYBOARD_ATKBD=y
553# CONFIG_KEYBOARD_LKKBD is not set 707# CONFIG_KEYBOARD_LKKBD is not set
554# CONFIG_KEYBOARD_XTKBD is not set 708# CONFIG_KEYBOARD_XTKBD is not set
555# CONFIG_KEYBOARD_NEWTON is not set 709# CONFIG_KEYBOARD_NEWTON is not set
710# CONFIG_KEYBOARD_STOWAWAY is not set
556CONFIG_INPUT_MOUSE=y 711CONFIG_INPUT_MOUSE=y
557CONFIG_MOUSE_PS2=y 712CONFIG_MOUSE_PS2=y
713CONFIG_MOUSE_PS2_ALPS=y
714CONFIG_MOUSE_PS2_LOGIPS2PP=y
715CONFIG_MOUSE_PS2_SYNAPTICS=y
716CONFIG_MOUSE_PS2_LIFEBOOK=y
717CONFIG_MOUSE_PS2_TRACKPOINT=y
718# CONFIG_MOUSE_PS2_ELANTECH is not set
719# CONFIG_MOUSE_PS2_TOUCHKIT is not set
558# CONFIG_MOUSE_SERIAL is not set 720# CONFIG_MOUSE_SERIAL is not set
721# CONFIG_MOUSE_APPLETOUCH is not set
722# CONFIG_MOUSE_BCM5974 is not set
559# CONFIG_MOUSE_INPORT is not set 723# CONFIG_MOUSE_INPORT is not set
560# CONFIG_MOUSE_LOGIBM is not set 724# CONFIG_MOUSE_LOGIBM is not set
561# CONFIG_MOUSE_PC110PAD is not set 725# CONFIG_MOUSE_PC110PAD is not set
562# CONFIG_MOUSE_VSXXXAA is not set 726# CONFIG_MOUSE_VSXXXAA is not set
563# CONFIG_INPUT_JOYSTICK is not set 727# CONFIG_INPUT_JOYSTICK is not set
728# CONFIG_INPUT_TABLET is not set
564# CONFIG_INPUT_TOUCHSCREEN is not set 729# CONFIG_INPUT_TOUCHSCREEN is not set
565# CONFIG_INPUT_MISC is not set 730# CONFIG_INPUT_MISC is not set
566 731
@@ -580,16 +745,22 @@ CONFIG_SERIO_LIBPS2=y
580# Character devices 745# Character devices
581# 746#
582CONFIG_VT=y 747CONFIG_VT=y
748CONFIG_CONSOLE_TRANSLATIONS=y
583CONFIG_VT_CONSOLE=y 749CONFIG_VT_CONSOLE=y
584CONFIG_HW_CONSOLE=y 750CONFIG_HW_CONSOLE=y
751# CONFIG_VT_HW_CONSOLE_BINDING is not set
752CONFIG_DEVKMEM=y
585# CONFIG_SERIAL_NONSTANDARD is not set 753# CONFIG_SERIAL_NONSTANDARD is not set
754# CONFIG_NOZOMI is not set
586 755
587# 756#
588# Serial drivers 757# Serial drivers
589# 758#
590CONFIG_SERIAL_8250=y 759CONFIG_SERIAL_8250=y
591CONFIG_SERIAL_8250_CONSOLE=y 760CONFIG_SERIAL_8250_CONSOLE=y
761CONFIG_SERIAL_8250_PCI=y
592CONFIG_SERIAL_8250_NR_UARTS=4 762CONFIG_SERIAL_8250_NR_UARTS=4
763CONFIG_SERIAL_8250_RUNTIME_UARTS=4
593# CONFIG_SERIAL_8250_EXTENDED is not set 764# CONFIG_SERIAL_8250_EXTENDED is not set
594 765
595# 766#
@@ -599,90 +770,122 @@ CONFIG_SERIAL_CORE=y
599CONFIG_SERIAL_CORE_CONSOLE=y 770CONFIG_SERIAL_CORE_CONSOLE=y
600# CONFIG_SERIAL_JSM is not set 771# CONFIG_SERIAL_JSM is not set
601CONFIG_UNIX98_PTYS=y 772CONFIG_UNIX98_PTYS=y
773# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
602CONFIG_LEGACY_PTYS=y 774CONFIG_LEGACY_PTYS=y
603CONFIG_LEGACY_PTY_COUNT=256 775CONFIG_LEGACY_PTY_COUNT=256
604CONFIG_PRINTER=m 776CONFIG_PRINTER=m
605# CONFIG_LP_CONSOLE is not set 777# CONFIG_LP_CONSOLE is not set
606# CONFIG_PPDEV is not set 778# CONFIG_PPDEV is not set
607# CONFIG_TIPAR is not set
608
609#
610# IPMI
611#
612# CONFIG_IPMI_HANDLER is not set 779# CONFIG_IPMI_HANDLER is not set
613 780CONFIG_HW_RANDOM=m
614#
615# Watchdog Cards
616#
617# CONFIG_WATCHDOG is not set
618# CONFIG_NVRAM is not set 781# CONFIG_NVRAM is not set
619CONFIG_RTC=y
620# CONFIG_DTLK is not set 782# CONFIG_DTLK is not set
621# CONFIG_R3964 is not set 783# CONFIG_R3964 is not set
622# CONFIG_APPLICOM is not set 784# CONFIG_APPLICOM is not set
623
624#
625# Ftape, the floppy tape device driver
626#
627# CONFIG_DRM is not set
628# CONFIG_RAW_DRIVER is not set 785# CONFIG_RAW_DRIVER is not set
786# CONFIG_TCG_TPM is not set
787CONFIG_DEVPORT=y
788# CONFIG_I2C is not set
789# CONFIG_SPI is not set
790# CONFIG_W1 is not set
791# CONFIG_POWER_SUPPLY is not set
792# CONFIG_HWMON is not set
793# CONFIG_THERMAL is not set
794# CONFIG_THERMAL_HWMON is not set
795# CONFIG_WATCHDOG is not set
796CONFIG_SSB_POSSIBLE=y
629 797
630# 798#
631# TPM devices 799# Sonics Silicon Backplane
632# 800#
633# CONFIG_TCG_TPM is not set 801# CONFIG_SSB is not set
634 802
635# 803#
636# I2C support 804# Multifunction device drivers
637# 805#
638# CONFIG_I2C is not set 806# CONFIG_MFD_CORE is not set
807# CONFIG_MFD_SM501 is not set
808# CONFIG_HTC_PASIC3 is not set
809# CONFIG_MFD_TMIO is not set
639 810
640# 811#
641# Misc devices 812# Multimedia devices
642# 813#
643 814
644# 815#
645# Multimedia devices 816# Multimedia core support
646# 817#
647# CONFIG_VIDEO_DEV is not set 818# CONFIG_VIDEO_DEV is not set
819# CONFIG_DVB_CORE is not set
820# CONFIG_VIDEO_MEDIA is not set
648 821
649# 822#
650# Digital Video Broadcasting Devices 823# Multimedia drivers
651# 824#
652# CONFIG_DVB is not set 825# CONFIG_DAB is not set
653 826
654# 827#
655# Graphics support 828# Graphics support
656# 829#
830# CONFIG_DRM is not set
831# CONFIG_VGASTATE is not set
832# CONFIG_VIDEO_OUTPUT_CONTROL is not set
657CONFIG_FB=y 833CONFIG_FB=y
834# CONFIG_FIRMWARE_EDID is not set
835# CONFIG_FB_DDC is not set
836# CONFIG_FB_BOOT_VESA_SUPPORT is not set
658CONFIG_FB_CFB_FILLRECT=y 837CONFIG_FB_CFB_FILLRECT=y
659CONFIG_FB_CFB_COPYAREA=y 838CONFIG_FB_CFB_COPYAREA=y
660CONFIG_FB_CFB_IMAGEBLIT=y 839CONFIG_FB_CFB_IMAGEBLIT=y
661CONFIG_FB_SOFT_CURSOR=y 840# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
841# CONFIG_FB_SYS_FILLRECT is not set
842# CONFIG_FB_SYS_COPYAREA is not set
843# CONFIG_FB_SYS_IMAGEBLIT is not set
844# CONFIG_FB_FOREIGN_ENDIAN is not set
845# CONFIG_FB_SYS_FOPS is not set
846# CONFIG_FB_SVGALIB is not set
662# CONFIG_FB_MACMODES is not set 847# CONFIG_FB_MACMODES is not set
848# CONFIG_FB_BACKLIGHT is not set
663# CONFIG_FB_MODE_HELPERS is not set 849# CONFIG_FB_MODE_HELPERS is not set
664# CONFIG_FB_TILEBLITTING is not set 850# CONFIG_FB_TILEBLITTING is not set
851
852#
853# Frame buffer hardware drivers
854#
665# CONFIG_FB_CIRRUS is not set 855# CONFIG_FB_CIRRUS is not set
666# CONFIG_FB_PM2 is not set 856# CONFIG_FB_PM2 is not set
667CONFIG_FB_CYBER2000=y 857CONFIG_FB_CYBER2000=y
668# CONFIG_FB_ASILIANT is not set 858# CONFIG_FB_ASILIANT is not set
669# CONFIG_FB_IMSTT is not set 859# CONFIG_FB_IMSTT is not set
860# CONFIG_FB_S1D13XXX is not set
670# CONFIG_FB_NVIDIA is not set 861# CONFIG_FB_NVIDIA is not set
671# CONFIG_FB_RIVA is not set 862# CONFIG_FB_RIVA is not set
672# CONFIG_FB_MATROX is not set 863# CONFIG_FB_MATROX is not set
673# CONFIG_FB_RADEON_OLD is not set
674# CONFIG_FB_RADEON is not set 864# CONFIG_FB_RADEON is not set
675# CONFIG_FB_ATY128 is not set 865# CONFIG_FB_ATY128 is not set
676# CONFIG_FB_ATY is not set 866# CONFIG_FB_ATY is not set
867# CONFIG_FB_S3 is not set
677# CONFIG_FB_SAVAGE is not set 868# CONFIG_FB_SAVAGE is not set
678# CONFIG_FB_SIS is not set 869# CONFIG_FB_SIS is not set
870# CONFIG_FB_VIA is not set
679# CONFIG_FB_NEOMAGIC is not set 871# CONFIG_FB_NEOMAGIC is not set
680# CONFIG_FB_KYRO is not set 872# CONFIG_FB_KYRO is not set
681# CONFIG_FB_3DFX is not set 873# CONFIG_FB_3DFX is not set
682# CONFIG_FB_VOODOO1 is not set 874# CONFIG_FB_VOODOO1 is not set
875# CONFIG_FB_VT8623 is not set
683# CONFIG_FB_TRIDENT is not set 876# CONFIG_FB_TRIDENT is not set
684# CONFIG_FB_S1D13XXX is not set 877# CONFIG_FB_ARK is not set
878# CONFIG_FB_PM3 is not set
879# CONFIG_FB_CARMINE is not set
685# CONFIG_FB_VIRTUAL is not set 880# CONFIG_FB_VIRTUAL is not set
881# CONFIG_FB_METRONOME is not set
882# CONFIG_FB_MB862XX is not set
883# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
884
885#
886# Display device support
887#
888# CONFIG_DISPLAY_SUPPORT is not set
686 889
687# 890#
688# Console display driver support 891# Console display driver support
@@ -691,126 +894,132 @@ CONFIG_FB_CYBER2000=y
691# CONFIG_MDA_CONSOLE is not set 894# CONFIG_MDA_CONSOLE is not set
692CONFIG_DUMMY_CONSOLE=y 895CONFIG_DUMMY_CONSOLE=y
693CONFIG_FRAMEBUFFER_CONSOLE=y 896CONFIG_FRAMEBUFFER_CONSOLE=y
897# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
898# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
694# CONFIG_FONTS is not set 899# CONFIG_FONTS is not set
695CONFIG_FONT_8x8=y 900CONFIG_FONT_8x8=y
696CONFIG_FONT_8x16=y 901CONFIG_FONT_8x16=y
697
698#
699# Logo configuration
700#
701CONFIG_LOGO=y 902CONFIG_LOGO=y
702# CONFIG_LOGO_LINUX_MONO is not set 903# CONFIG_LOGO_LINUX_MONO is not set
703# CONFIG_LOGO_LINUX_VGA16 is not set 904# CONFIG_LOGO_LINUX_VGA16 is not set
704CONFIG_LOGO_LINUX_CLUT224=y 905CONFIG_LOGO_LINUX_CLUT224=y
705# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
706
707#
708# Sound
709#
710CONFIG_SOUND=m 906CONFIG_SOUND=m
711 907CONFIG_SOUND_OSS_CORE=y
712#
713# Advanced Linux Sound Architecture
714#
715# CONFIG_SND is not set 908# CONFIG_SND is not set
716
717#
718# Open Sound System
719#
720CONFIG_SOUND_PRIME=m 909CONFIG_SOUND_PRIME=m
721# CONFIG_SOUND_BT878 is not set
722# CONFIG_SOUND_CMPCI is not set
723# CONFIG_SOUND_EMU10K1 is not set
724# CONFIG_SOUND_FUSION is not set
725# CONFIG_SOUND_CS4281 is not set
726# CONFIG_SOUND_ES1370 is not set
727# CONFIG_SOUND_ES1371 is not set
728# CONFIG_SOUND_ESSSOLO1 is not set
729# CONFIG_SOUND_MAESTRO is not set
730# CONFIG_SOUND_MAESTRO3 is not set
731# CONFIG_SOUND_ICH is not set
732# CONFIG_SOUND_SONICVIBES is not set
733# CONFIG_SOUND_TRIDENT is not set
734# CONFIG_SOUND_MSNDCLAS is not set 910# CONFIG_SOUND_MSNDCLAS is not set
735# CONFIG_SOUND_MSNDPIN is not set 911# CONFIG_SOUND_MSNDPIN is not set
736# CONFIG_SOUND_VIA82CXXX is not set
737CONFIG_SOUND_OSS=m 912CONFIG_SOUND_OSS=m
738# CONFIG_SOUND_TRACEINIT is not set 913# CONFIG_SOUND_TRACEINIT is not set
739# CONFIG_SOUND_DMAP is not set 914# CONFIG_SOUND_DMAP is not set
740# CONFIG_SOUND_AD1816 is not set
741# CONFIG_SOUND_AD1889 is not set
742# CONFIG_SOUND_SGALAXY is not set
743CONFIG_SOUND_ADLIB=m
744# CONFIG_SOUND_ACI_MIXER is not set
745# CONFIG_SOUND_CS4232 is not set
746# CONFIG_SOUND_SSCAPE is not set 915# CONFIG_SOUND_SSCAPE is not set
747# CONFIG_SOUND_GUS is not set
748# CONFIG_SOUND_VMIDI is not set 916# CONFIG_SOUND_VMIDI is not set
749# CONFIG_SOUND_TRIX is not set 917# CONFIG_SOUND_TRIX is not set
750# CONFIG_SOUND_MSS is not set 918# CONFIG_SOUND_MSS is not set
751# CONFIG_SOUND_MPU401 is not set 919# CONFIG_SOUND_MPU401 is not set
752# CONFIG_SOUND_NM256 is not set
753# CONFIG_SOUND_MAD16 is not set
754# CONFIG_SOUND_PAS is not set 920# CONFIG_SOUND_PAS is not set
755# CONFIG_SOUND_PSS is not set 921# CONFIG_SOUND_PSS is not set
756CONFIG_SOUND_SB=m 922CONFIG_SOUND_SB=m
757# CONFIG_SOUND_AWE32_SYNTH is not set
758# CONFIG_SOUND_WAVEFRONT is not set
759# CONFIG_SOUND_MAUI is not set
760# CONFIG_SOUND_YM3812 is not set 923# CONFIG_SOUND_YM3812 is not set
761# CONFIG_SOUND_OPL3SA1 is not set
762# CONFIG_SOUND_OPL3SA2 is not set
763# CONFIG_SOUND_YMFPCI is not set
764# CONFIG_SOUND_UART6850 is not set 924# CONFIG_SOUND_UART6850 is not set
765# CONFIG_SOUND_AEDSP16 is not set 925# CONFIG_SOUND_AEDSP16 is not set
766# CONFIG_SOUND_KAHLUA is not set 926# CONFIG_SOUND_KAHLUA is not set
767# CONFIG_SOUND_ALI5455 is not set 927CONFIG_HID_SUPPORT=y
768# CONFIG_SOUND_FORTE is not set 928CONFIG_HID=y
769# CONFIG_SOUND_RME96XX is not set 929# CONFIG_HID_DEBUG is not set
770# CONFIG_SOUND_AD1980 is not set 930# CONFIG_HIDRAW is not set
931# CONFIG_HID_PID is not set
771 932
772# 933#
773# USB support 934# Special HID drivers
774# 935#
936CONFIG_HID_COMPAT=y
937CONFIG_USB_SUPPORT=y
775CONFIG_USB_ARCH_HAS_HCD=y 938CONFIG_USB_ARCH_HAS_HCD=y
776CONFIG_USB_ARCH_HAS_OHCI=y 939CONFIG_USB_ARCH_HAS_OHCI=y
940CONFIG_USB_ARCH_HAS_EHCI=y
777# CONFIG_USB is not set 941# CONFIG_USB is not set
778 942
779# 943#
780# USB Gadget Support 944# Enable Host or Gadget support to see Inventra options
781# 945#
782# CONFIG_USB_GADGET is not set
783 946
784# 947#
785# MMC/SD Card support 948# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
786# 949#
950# CONFIG_USB_GADGET is not set
951# CONFIG_UWB is not set
787# CONFIG_MMC is not set 952# CONFIG_MMC is not set
953# CONFIG_MEMSTICK is not set
954# CONFIG_ACCESSIBILITY is not set
955# CONFIG_NEW_LEDS is not set
956CONFIG_RTC_LIB=y
957CONFIG_RTC_CLASS=y
958CONFIG_RTC_HCTOSYS=y
959CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
960# CONFIG_RTC_DEBUG is not set
961
962#
963# RTC interfaces
964#
965CONFIG_RTC_INTF_SYSFS=y
966CONFIG_RTC_INTF_PROC=y
967CONFIG_RTC_INTF_DEV=y
968# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
969# CONFIG_RTC_DRV_TEST is not set
970
971#
972# SPI RTC drivers
973#
974
975#
976# Platform RTC drivers
977#
978CONFIG_RTC_DRV_CMOS=y
979# CONFIG_RTC_DRV_DS1286 is not set
980# CONFIG_RTC_DRV_DS1511 is not set
981# CONFIG_RTC_DRV_DS1553 is not set
982# CONFIG_RTC_DRV_DS1742 is not set
983# CONFIG_RTC_DRV_STK17TA8 is not set
984# CONFIG_RTC_DRV_M48T86 is not set
985# CONFIG_RTC_DRV_M48T35 is not set
986# CONFIG_RTC_DRV_M48T59 is not set
987# CONFIG_RTC_DRV_BQ4802 is not set
988# CONFIG_RTC_DRV_V3020 is not set
989
990#
991# on-CPU RTC drivers
992#
993# CONFIG_DMADEVICES is not set
994# CONFIG_AUXDISPLAY is not set
995# CONFIG_REGULATOR is not set
996# CONFIG_UIO is not set
788 997
789# 998#
790# File systems 999# File systems
791# 1000#
792CONFIG_EXT2_FS=y 1001CONFIG_EXT2_FS=y
793# CONFIG_EXT2_FS_XATTR is not set 1002# CONFIG_EXT2_FS_XATTR is not set
1003# CONFIG_EXT2_FS_XIP is not set
794CONFIG_EXT3_FS=y 1004CONFIG_EXT3_FS=y
795CONFIG_EXT3_FS_XATTR=y 1005CONFIG_EXT3_FS_XATTR=y
796# CONFIG_EXT3_FS_POSIX_ACL is not set 1006# CONFIG_EXT3_FS_POSIX_ACL is not set
797# CONFIG_EXT3_FS_SECURITY is not set 1007# CONFIG_EXT3_FS_SECURITY is not set
1008# CONFIG_EXT4_FS is not set
798CONFIG_JBD=y 1009CONFIG_JBD=y
799# CONFIG_JBD_DEBUG is not set
800CONFIG_FS_MBCACHE=y 1010CONFIG_FS_MBCACHE=y
801# CONFIG_REISERFS_FS is not set 1011# CONFIG_REISERFS_FS is not set
802# CONFIG_JFS_FS is not set 1012# CONFIG_JFS_FS is not set
803 1013# CONFIG_FS_POSIX_ACL is not set
804# 1014CONFIG_FILE_LOCKING=y
805# XFS support
806#
807# CONFIG_XFS_FS is not set 1015# CONFIG_XFS_FS is not set
808# CONFIG_MINIX_FS is not set 1016# CONFIG_OCFS2_FS is not set
809# CONFIG_ROMFS_FS is not set
810# CONFIG_QUOTA is not set
811CONFIG_DNOTIFY=y 1017CONFIG_DNOTIFY=y
1018# CONFIG_INOTIFY is not set
1019# CONFIG_QUOTA is not set
812# CONFIG_AUTOFS_FS is not set 1020# CONFIG_AUTOFS_FS is not set
813# CONFIG_AUTOFS4_FS is not set 1021# CONFIG_AUTOFS4_FS is not set
1022# CONFIG_FUSE_FS is not set
814 1023
815# 1024#
816# CD-ROM/DVD Filesystems 1025# CD-ROM/DVD Filesystems
@@ -834,14 +1043,12 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
834# Pseudo filesystems 1043# Pseudo filesystems
835# 1044#
836CONFIG_PROC_FS=y 1045CONFIG_PROC_FS=y
1046CONFIG_PROC_SYSCTL=y
1047CONFIG_PROC_PAGE_MONITOR=y
837CONFIG_SYSFS=y 1048CONFIG_SYSFS=y
838CONFIG_DEVFS_FS=y
839CONFIG_DEVFS_MOUNT=y
840# CONFIG_DEVFS_DEBUG is not set
841# CONFIG_DEVPTS_FS_XATTR is not set
842# CONFIG_TMPFS is not set 1049# CONFIG_TMPFS is not set
843# CONFIG_HUGETLB_PAGE is not set 1050# CONFIG_HUGETLB_PAGE is not set
844CONFIG_RAMFS=y 1051# CONFIG_CONFIGFS_FS is not set
845 1052
846# 1053#
847# Miscellaneous filesystems 1054# Miscellaneous filesystems
@@ -855,22 +1062,27 @@ CONFIG_RAMFS=y
855# CONFIG_EFS_FS is not set 1062# CONFIG_EFS_FS is not set
856# CONFIG_CRAMFS is not set 1063# CONFIG_CRAMFS is not set
857# CONFIG_VXFS_FS is not set 1064# CONFIG_VXFS_FS is not set
1065# CONFIG_MINIX_FS is not set
1066# CONFIG_OMFS_FS is not set
858# CONFIG_HPFS_FS is not set 1067# CONFIG_HPFS_FS is not set
859# CONFIG_QNX4FS_FS is not set 1068# CONFIG_QNX4FS_FS is not set
1069# CONFIG_ROMFS_FS is not set
860# CONFIG_SYSV_FS is not set 1070# CONFIG_SYSV_FS is not set
861# CONFIG_UFS_FS is not set 1071# CONFIG_UFS_FS is not set
862 1072CONFIG_NETWORK_FILESYSTEMS=y
863# 1073CONFIG_NFS_FS=y
864# Network File Systems
865#
866CONFIG_NFS_FS=m
867CONFIG_NFS_V3=y 1074CONFIG_NFS_V3=y
1075# CONFIG_NFS_V3_ACL is not set
868# CONFIG_NFS_V4 is not set 1076# CONFIG_NFS_V4 is not set
869# CONFIG_NFS_DIRECTIO is not set 1077CONFIG_NFSD=m
870# CONFIG_NFSD is not set 1078# CONFIG_NFSD_V3 is not set
871CONFIG_LOCKD=m 1079# CONFIG_NFSD_V4 is not set
1080CONFIG_LOCKD=y
872CONFIG_LOCKD_V4=y 1081CONFIG_LOCKD_V4=y
873CONFIG_SUNRPC=m 1082CONFIG_EXPORTFS=m
1083CONFIG_NFS_COMMON=y
1084CONFIG_SUNRPC=y
1085# CONFIG_SUNRPC_REGISTER_V4 is not set
874# CONFIG_RPCSEC_GSS_KRB5 is not set 1086# CONFIG_RPCSEC_GSS_KRB5 is not set
875# CONFIG_RPCSEC_GSS_SPKM3 is not set 1087# CONFIG_RPCSEC_GSS_SPKM3 is not set
876# CONFIG_SMB_FS is not set 1088# CONFIG_SMB_FS is not set
@@ -897,11 +1109,9 @@ CONFIG_MSDOS_PARTITION=y
897# CONFIG_SGI_PARTITION is not set 1109# CONFIG_SGI_PARTITION is not set
898# CONFIG_ULTRIX_PARTITION is not set 1110# CONFIG_ULTRIX_PARTITION is not set
899# CONFIG_SUN_PARTITION is not set 1111# CONFIG_SUN_PARTITION is not set
1112# CONFIG_KARMA_PARTITION is not set
900# CONFIG_EFI_PARTITION is not set 1113# CONFIG_EFI_PARTITION is not set
901 1114# CONFIG_SYSV68_PARTITION is not set
902#
903# Native Language Support
904#
905CONFIG_NLS=m 1115CONFIG_NLS=m
906CONFIG_NLS_DEFAULT="iso8859-1" 1116CONFIG_NLS_DEFAULT="iso8859-1"
907CONFIG_NLS_CODEPAGE_437=m 1117CONFIG_NLS_CODEPAGE_437=m
@@ -942,30 +1152,74 @@ CONFIG_NLS_ISO8859_1=m
942# CONFIG_NLS_KOI8_R is not set 1152# CONFIG_NLS_KOI8_R is not set
943# CONFIG_NLS_KOI8_U is not set 1153# CONFIG_NLS_KOI8_U is not set
944# CONFIG_NLS_UTF8 is not set 1154# CONFIG_NLS_UTF8 is not set
945 1155# CONFIG_DLM is not set
946#
947# Profiling support
948#
949# CONFIG_PROFILING is not set
950 1156
951# 1157#
952# Kernel hacking 1158# Kernel hacking
953# 1159#
954# CONFIG_PRINTK_TIME is not set 1160# CONFIG_PRINTK_TIME is not set
955CONFIG_DEBUG_KERNEL=y 1161# CONFIG_ENABLE_WARN_DEPRECATED is not set
1162# CONFIG_ENABLE_MUST_CHECK is not set
1163CONFIG_FRAME_WARN=1024
956# CONFIG_MAGIC_SYSRQ is not set 1164# CONFIG_MAGIC_SYSRQ is not set
957CONFIG_LOG_BUF_SHIFT=14 1165# CONFIG_UNUSED_SYMBOLS is not set
1166# CONFIG_DEBUG_FS is not set
1167# CONFIG_HEADERS_CHECK is not set
1168CONFIG_DEBUG_KERNEL=y
1169# CONFIG_DEBUG_SHIRQ is not set
1170CONFIG_DETECT_SOFTLOCKUP=y
1171# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1172CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1173# CONFIG_SCHED_DEBUG is not set
958# CONFIG_SCHEDSTATS is not set 1174# CONFIG_SCHEDSTATS is not set
1175# CONFIG_TIMER_STATS is not set
1176# CONFIG_DEBUG_OBJECTS is not set
959# CONFIG_DEBUG_SLAB is not set 1177# CONFIG_DEBUG_SLAB is not set
1178# CONFIG_DEBUG_RT_MUTEXES is not set
1179# CONFIG_RT_MUTEX_TESTER is not set
960# CONFIG_DEBUG_SPINLOCK is not set 1180# CONFIG_DEBUG_SPINLOCK is not set
1181# CONFIG_DEBUG_MUTEXES is not set
1182# CONFIG_DEBUG_LOCK_ALLOC is not set
1183# CONFIG_PROVE_LOCKING is not set
1184# CONFIG_LOCK_STAT is not set
961# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1185# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1186# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
962# CONFIG_DEBUG_KOBJECT is not set 1187# CONFIG_DEBUG_KOBJECT is not set
963CONFIG_DEBUG_BUGVERBOSE=y 1188CONFIG_DEBUG_BUGVERBOSE=y
964# CONFIG_DEBUG_INFO is not set 1189# CONFIG_DEBUG_INFO is not set
965# CONFIG_DEBUG_FS is not set 1190# CONFIG_DEBUG_VM is not set
1191# CONFIG_DEBUG_WRITECOUNT is not set
1192CONFIG_DEBUG_MEMORY_INIT=y
1193# CONFIG_DEBUG_LIST is not set
1194# CONFIG_DEBUG_SG is not set
1195# CONFIG_DEBUG_NOTIFIERS is not set
966CONFIG_FRAME_POINTER=y 1196CONFIG_FRAME_POINTER=y
1197# CONFIG_BOOT_PRINTK_DELAY is not set
1198# CONFIG_RCU_TORTURE_TEST is not set
1199# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1200# CONFIG_BACKTRACE_SELF_TEST is not set
1201# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1202# CONFIG_FAULT_INJECTION is not set
1203# CONFIG_LATENCYTOP is not set
1204# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1205CONFIG_HAVE_FUNCTION_TRACER=y
1206
1207#
1208# Tracers
1209#
1210# CONFIG_FUNCTION_TRACER is not set
1211# CONFIG_SCHED_TRACER is not set
1212# CONFIG_CONTEXT_SWITCH_TRACER is not set
1213# CONFIG_BOOT_TRACER is not set
1214# CONFIG_TRACE_BRANCH_PROFILING is not set
1215# CONFIG_STACK_TRACER is not set
1216# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1217# CONFIG_SAMPLES is not set
1218CONFIG_HAVE_ARCH_KGDB=y
1219# CONFIG_KGDB is not set
967CONFIG_DEBUG_USER=y 1220CONFIG_DEBUG_USER=y
968# CONFIG_DEBUG_ERRORS is not set 1221# CONFIG_DEBUG_ERRORS is not set
1222# CONFIG_DEBUG_STACK_USAGE is not set
969# CONFIG_DEBUG_LL is not set 1223# CONFIG_DEBUG_LL is not set
970 1224
971# 1225#
@@ -973,19 +1227,23 @@ CONFIG_DEBUG_USER=y
973# 1227#
974# CONFIG_KEYS is not set 1228# CONFIG_KEYS is not set
975# CONFIG_SECURITY is not set 1229# CONFIG_SECURITY is not set
976 1230# CONFIG_SECURITYFS is not set
977# 1231# CONFIG_SECURITY_FILE_CAPABILITIES is not set
978# Cryptographic options
979#
980# CONFIG_CRYPTO is not set 1232# CONFIG_CRYPTO is not set
981 1233
982# 1234#
983# Hardware crypto devices
984#
985
986#
987# Library routines 1235# Library routines
988# 1236#
1237CONFIG_BITREVERSE=y
1238CONFIG_GENERIC_FIND_LAST_BIT=y
989# CONFIG_CRC_CCITT is not set 1239# CONFIG_CRC_CCITT is not set
1240# CONFIG_CRC16 is not set
1241# CONFIG_CRC_T10DIF is not set
1242# CONFIG_CRC_ITU_T is not set
990CONFIG_CRC32=y 1243CONFIG_CRC32=y
1244# CONFIG_CRC7 is not set
991# CONFIG_LIBCRC32C is not set 1245# CONFIG_LIBCRC32C is not set
1246CONFIG_PLIST=y
1247CONFIG_HAS_IOMEM=y
1248CONFIG_HAS_IOPORT=y
1249CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/simpad_defconfig b/arch/arm/configs/simpad_defconfig
index 03f783e696b3..685d2b513206 100644
--- a/arch/arm/configs/simpad_defconfig
+++ b/arch/arm/configs/simpad_defconfig
@@ -89,7 +89,6 @@ CONFIG_ARCH_SA1100=y
89# CONFIG_SA1100_COLLIE is not set 89# CONFIG_SA1100_COLLIE is not set
90# CONFIG_SA1100_H3100 is not set 90# CONFIG_SA1100_H3100 is not set
91# CONFIG_SA1100_H3600 is not set 91# CONFIG_SA1100_H3600 is not set
92# CONFIG_SA1100_H3800 is not set
93# CONFIG_SA1100_BADGE4 is not set 92# CONFIG_SA1100_BADGE4 is not set
94# CONFIG_SA1100_JORNADA720 is not set 93# CONFIG_SA1100_JORNADA720 is not set
95# CONFIG_SA1100_HACKKIT is not set 94# CONFIG_SA1100_HACKKIT is not set
diff --git a/arch/arm/include/asm/a.out.h b/arch/arm/include/asm/a.out.h
index 79489fdcc8b8..083894b2e3bc 100644
--- a/arch/arm/include/asm/a.out.h
+++ b/arch/arm/include/asm/a.out.h
@@ -2,7 +2,7 @@
2#define __ARM_A_OUT_H__ 2#define __ARM_A_OUT_H__
3 3
4#include <linux/personality.h> 4#include <linux/personality.h>
5#include <asm/types.h> 5#include <linux/types.h>
6 6
7struct exec 7struct exec
8{ 8{
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index 6cbd8fdc9f1f..bb7d695f3900 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -46,6 +46,14 @@
46# define MULTI_CACHE 1 46# define MULTI_CACHE 1
47#endif 47#endif
48 48
49#if defined(CONFIG_CPU_FA526)
50# ifdef _CACHE
51# define MULTI_CACHE 1
52# else
53# define _CACHE fa
54# endif
55#endif
56
49#if defined(CONFIG_CPU_ARM926T) 57#if defined(CONFIG_CPU_ARM926T)
50# ifdef _CACHE 58# ifdef _CACHE
51# define MULTI_CACHE 1 59# define MULTI_CACHE 1
@@ -94,6 +102,14 @@
94# endif 102# endif
95#endif 103#endif
96 104
105#if defined(CONFIG_CPU_MOHAWK)
106# ifdef _CACHE
107# define MULTI_CACHE 1
108# else
109# define _CACHE mohawk
110# endif
111#endif
112
97#if defined(CONFIG_CPU_FEROCEON) 113#if defined(CONFIG_CPU_FEROCEON)
98# define MULTI_CACHE 1 114# define MULTI_CACHE 1
99#endif 115#endif
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index 22cb14ec3438..ff46dfa68a97 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -15,10 +15,20 @@
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)
18static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) 20static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
19{ 21{
20 return (dma_addr_t)__virt_to_bus((unsigned long)page_address(page)); 22 return (dma_addr_t)__virt_to_bus((unsigned long)page_address(page));
21} 23}
24#elif defined(__pfn_to_bus)
25static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
26{
27 return (dma_addr_t)__pfn_to_bus(page_to_pfn(page));
28}
29#else
30#error "this machine class needs to define __arch_page_to_dma to use HIGHMEM"
31#endif
22 32
23static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) 33static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
24{ 34{
@@ -57,6 +67,8 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
57 * Use the driver DMA support - see dma-mapping.h (dma_sync_*) 67 * Use the driver DMA support - see dma-mapping.h (dma_sync_*)
58 */ 68 */
59extern void dma_cache_maint(const void *kaddr, size_t size, int rw); 69extern void dma_cache_maint(const void *kaddr, size_t size, int rw);
70extern void dma_cache_maint_page(struct page *page, unsigned long offset,
71 size_t size, int rw);
60 72
61/* 73/*
62 * Return whether the given device DMA address mask can be supported 74 * Return whether the given device DMA address mask can be supported
@@ -316,7 +328,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
316 BUG_ON(!valid_dma_direction(dir)); 328 BUG_ON(!valid_dma_direction(dir));
317 329
318 if (!arch_is_coherent()) 330 if (!arch_is_coherent())
319 dma_cache_maint(page_address(page) + offset, size, dir); 331 dma_cache_maint_page(page, offset, size, dir);
320 332
321 return page_to_dma(dev, page) + offset; 333 return page_to_dma(dev, page) + offset;
322} 334}
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index df5638f3643a..7edf3536df24 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -19,21 +19,17 @@
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/scatterlist.h> 20#include <asm/scatterlist.h>
21 21
22typedef unsigned int dmach_t;
23
24#include <mach/isa-dma.h> 22#include <mach/isa-dma.h>
25 23
26/* 24/*
27 * DMA modes 25 * The DMA modes reflect the settings for the ISA DMA controller
28 */ 26 */
29typedef unsigned int dmamode_t; 27#define DMA_MODE_MASK 0xcc
30
31#define DMA_MODE_MASK 3
32 28
33#define DMA_MODE_READ 0 29#define DMA_MODE_READ 0x44
34#define DMA_MODE_WRITE 1 30#define DMA_MODE_WRITE 0x48
35#define DMA_MODE_CASCADE 2 31#define DMA_MODE_CASCADE 0xc0
36#define DMA_AUTOINIT 4 32#define DMA_AUTOINIT 0x10
37 33
38extern spinlock_t dma_spin_lock; 34extern spinlock_t dma_spin_lock;
39 35
@@ -52,44 +48,44 @@ static inline void release_dma_lock(unsigned long flags)
52/* Clear the 'DMA Pointer Flip Flop'. 48/* Clear the 'DMA Pointer Flip Flop'.
53 * Write 0 for LSB/MSB, 1 for MSB/LSB access. 49 * Write 0 for LSB/MSB, 1 for MSB/LSB access.
54 */ 50 */
55#define clear_dma_ff(channel) 51#define clear_dma_ff(chan)
56 52
57/* Set only the page register bits of the transfer address. 53/* Set only the page register bits of the transfer address.
58 * 54 *
59 * NOTE: This is an architecture specific function, and should 55 * NOTE: This is an architecture specific function, and should
60 * be hidden from the drivers 56 * be hidden from the drivers
61 */ 57 */
62extern void set_dma_page(dmach_t channel, char pagenr); 58extern void set_dma_page(unsigned int chan, char pagenr);
63 59
64/* Request a DMA channel 60/* Request a DMA channel
65 * 61 *
66 * Some architectures may need to do allocate an interrupt 62 * Some architectures may need to do allocate an interrupt
67 */ 63 */
68extern int request_dma(dmach_t channel, const char * device_id); 64extern int request_dma(unsigned int chan, const char * device_id);
69 65
70/* Free a DMA channel 66/* Free a DMA channel
71 * 67 *
72 * Some architectures may need to do free an interrupt 68 * Some architectures may need to do free an interrupt
73 */ 69 */
74extern void free_dma(dmach_t channel); 70extern void free_dma(unsigned int chan);
75 71
76/* Enable DMA for this channel 72/* Enable DMA for this channel
77 * 73 *
78 * On some architectures, this may have other side effects like 74 * On some architectures, this may have other side effects like
79 * enabling an interrupt and setting the DMA registers. 75 * enabling an interrupt and setting the DMA registers.
80 */ 76 */
81extern void enable_dma(dmach_t channel); 77extern void enable_dma(unsigned int chan);
82 78
83/* Disable DMA for this channel 79/* Disable DMA for this channel
84 * 80 *
85 * On some architectures, this may have other side effects like 81 * On some architectures, this may have other side effects like
86 * disabling an interrupt or whatever. 82 * disabling an interrupt or whatever.
87 */ 83 */
88extern void disable_dma(dmach_t channel); 84extern void disable_dma(unsigned int chan);
89 85
90/* Test whether the specified channel has an active DMA transfer 86/* Test whether the specified channel has an active DMA transfer
91 */ 87 */
92extern int dma_channel_active(dmach_t channel); 88extern int dma_channel_active(unsigned int chan);
93 89
94/* Set the DMA scatter gather list for this channel 90/* Set the DMA scatter gather list for this channel
95 * 91 *
@@ -97,7 +93,7 @@ extern int dma_channel_active(dmach_t channel);
97 * especially since some DMA architectures don't update the 93 * especially since some DMA architectures don't update the
98 * DMA address immediately, but defer it to the enable_dma(). 94 * DMA address immediately, but defer it to the enable_dma().
99 */ 95 */
100extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg); 96extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);
101 97
102/* Set the DMA address for this channel 98/* Set the DMA address for this channel
103 * 99 *
@@ -105,9 +101,9 @@ extern void set_dma_sg(dmach_t channel, struct scatterlist *sg, int nr_sg);
105 * especially since some DMA architectures don't update the 101 * especially since some DMA architectures don't update the
106 * DMA address immediately, but defer it to the enable_dma(). 102 * DMA address immediately, but defer it to the enable_dma().
107 */ 103 */
108extern void __set_dma_addr(dmach_t channel, void *addr); 104extern void __set_dma_addr(unsigned int chan, void *addr);
109#define set_dma_addr(channel, addr) \ 105#define set_dma_addr(chan, addr) \
110 __set_dma_addr(channel, bus_to_virt(addr)) 106 __set_dma_addr(chan, bus_to_virt(addr))
111 107
112/* Set the DMA byte count for this channel 108/* Set the DMA byte count for this channel
113 * 109 *
@@ -115,7 +111,7 @@ extern void __set_dma_addr(dmach_t channel, void *addr);
115 * especially since some DMA architectures don't update the 111 * especially since some DMA architectures don't update the
116 * DMA count immediately, but defer it to the enable_dma(). 112 * DMA count immediately, but defer it to the enable_dma().
117 */ 113 */
118extern void set_dma_count(dmach_t channel, unsigned long count); 114extern void set_dma_count(unsigned int chan, unsigned long count);
119 115
120/* Set the transfer direction for this channel 116/* Set the transfer direction for this channel
121 * 117 *
@@ -124,11 +120,11 @@ extern void set_dma_count(dmach_t channel, unsigned long count);
124 * DMA transfer direction immediately, but defer it to the 120 * DMA transfer direction immediately, but defer it to the
125 * enable_dma(). 121 * enable_dma().
126 */ 122 */
127extern void set_dma_mode(dmach_t channel, dmamode_t mode); 123extern void set_dma_mode(unsigned int chan, unsigned int mode);
128 124
129/* Set the transfer speed for this channel 125/* Set the transfer speed for this channel
130 */ 126 */
131extern void set_dma_speed(dmach_t channel, int cycle_ns); 127extern void set_dma_speed(unsigned int chan, int cycle_ns);
132 128
133/* Get DMA residue count. After a DMA transfer, this 129/* Get DMA residue count. After a DMA transfer, this
134 * should return zero. Reading this while a DMA transfer is 130 * should return zero. Reading this while a DMA transfer is
@@ -136,7 +132,7 @@ extern void set_dma_speed(dmach_t channel, int cycle_ns);
136 * If called before the channel has been used, it may return 1. 132 * If called before the channel has been used, it may return 1.
137 * Otherwise, it returns the number of _bytes_ left to transfer. 133 * Otherwise, it returns the number of _bytes_ left to transfer.
138 */ 134 */
139extern int get_dma_residue(dmach_t channel); 135extern int get_dma_residue(unsigned int chan);
140 136
141#ifndef NO_DMA 137#ifndef NO_DMA
142#define NO_DMA 255 138#define NO_DMA 255
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
index a58378c343b9..d7da19bcf928 100644
--- a/arch/arm/include/asm/elf.h
+++ b/arch/arm/include/asm/elf.h
@@ -50,6 +50,8 @@ typedef struct user_fp elf_fpregset_t;
50#define R_ARM_ABS32 2 50#define R_ARM_ABS32 2
51#define R_ARM_CALL 28 51#define R_ARM_CALL 28
52#define R_ARM_JUMP24 29 52#define R_ARM_JUMP24 29
53#define R_ARM_V4BX 40
54#define R_ARM_PREL31 42
53 55
54/* 56/*
55 * These are used to set parameters in the core dumps. 57 * These are used to set parameters in the core dumps.
diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h
new file mode 100644
index 000000000000..bbae919bceb4
--- /dev/null
+++ b/arch/arm/include/asm/fixmap.h
@@ -0,0 +1,41 @@
1#ifndef _ASM_FIXMAP_H
2#define _ASM_FIXMAP_H
3
4/*
5 * Nothing too fancy for now.
6 *
7 * On ARM we already have well known fixed virtual addresses imposed by
8 * the architecture such as the vector page which is located at 0xffff0000,
9 * therefore a second level page table is already allocated covering
10 * 0xfff00000 upwards.
11 *
12 * The cache flushing code in proc-xscale.S uses the virtual area between
13 * 0xfffe0000 and 0xfffeffff.
14 */
15
16#define FIXADDR_START 0xfff00000UL
17#define FIXADDR_TOP 0xfffe0000UL
18#define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START)
19
20#define FIX_KMAP_BEGIN 0
21#define FIX_KMAP_END (FIXADDR_SIZE >> PAGE_SHIFT)
22
23#define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT))
24#define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT)
25
26extern void __this_fixmap_does_not_exist(void);
27
28static inline unsigned long fix_to_virt(const unsigned int idx)
29{
30 if (idx >= FIX_KMAP_END)
31 __this_fixmap_does_not_exist();
32 return __fix_to_virt(idx);
33}
34
35static inline unsigned int virt_to_fix(const unsigned long vaddr)
36{
37 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
38 return __virt_to_fix(vaddr);
39}
40
41#endif
diff --git a/arch/arm/include/asm/hardware/scoop.h b/arch/arm/include/asm/hardware/scoop.h
index dfb8330599f9..46492a63a7c4 100644
--- a/arch/arm/include/asm/hardware/scoop.h
+++ b/arch/arm/include/asm/hardware/scoop.h
@@ -63,7 +63,5 @@ struct scoop_pcmcia_config {
63extern struct scoop_pcmcia_config *platform_scoop_config; 63extern struct scoop_pcmcia_config *platform_scoop_config;
64 64
65void reset_scoop(struct device *dev); 65void reset_scoop(struct device *dev);
66unsigned short __deprecated set_scoop_gpio(struct device *dev, unsigned short bit);
67unsigned short __deprecated reset_scoop_gpio(struct device *dev, unsigned short bit);
68unsigned short read_scoop_reg(struct device *dev, unsigned short reg); 66unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
69void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data); 67void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h
new file mode 100644
index 000000000000..7f36d00600b4
--- /dev/null
+++ b/arch/arm/include/asm/highmem.h
@@ -0,0 +1,31 @@
1#ifndef _ASM_HIGHMEM_H
2#define _ASM_HIGHMEM_H
3
4#include <asm/kmap_types.h>
5
6#define PKMAP_BASE (PAGE_OFFSET - PMD_SIZE)
7#define LAST_PKMAP PTRS_PER_PTE
8#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
9#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
10#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
11
12#define kmap_prot PAGE_KERNEL
13
14#define flush_cache_kmaps() flush_cache_all()
15
16extern pte_t *pkmap_page_table;
17
18#define ARCH_NEEDS_KMAP_HIGH_GET
19
20extern void *kmap_high(struct page *page);
21extern void *kmap_high_get(struct page *page);
22extern void kunmap_high(struct page *page);
23
24extern void *kmap(struct page *page);
25extern void kunmap(struct page *page);
26extern void *kmap_atomic(struct page *page, enum km_type type);
27extern void kunmap_atomic(void *kvaddr, enum km_type type);
28extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
29extern struct page *kmap_atomic_to_page(const void *ptr);
30
31#endif
diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
index bda489f9f017..f7bd52b1c365 100644
--- a/arch/arm/include/asm/hwcap.h
+++ b/arch/arm/include/asm/hwcap.h
@@ -17,6 +17,8 @@
17#define HWCAP_CRUNCH 1024 17#define HWCAP_CRUNCH 1024
18#define HWCAP_THUMBEE 2048 18#define HWCAP_THUMBEE 2048
19#define HWCAP_NEON 4096 19#define HWCAP_NEON 4096
20#define HWCAP_VFPv3 8192
21#define HWCAP_VFPv3D16 16384
20 22
21#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 23#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
22/* 24/*
diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
index 45def13ee17a..d16ec97ec9a9 100644
--- a/arch/arm/include/asm/kmap_types.h
+++ b/arch/arm/include/asm/kmap_types.h
@@ -18,6 +18,7 @@ enum km_type {
18 KM_IRQ1, 18 KM_IRQ1,
19 KM_SOFTIRQ0, 19 KM_SOFTIRQ0,
20 KM_SOFTIRQ1, 20 KM_SOFTIRQ1,
21 KM_L2_CACHE,
21 KM_TYPE_NR 22 KM_TYPE_NR
22}; 23};
23 24
diff --git a/arch/arm/include/asm/mach/dma.h b/arch/arm/include/asm/mach/dma.h
index fc7278ea7146..9e614a18e680 100644
--- a/arch/arm/include/asm/mach/dma.h
+++ b/arch/arm/include/asm/mach/dma.h
@@ -15,13 +15,13 @@ struct dma_struct;
15typedef struct dma_struct dma_t; 15typedef struct dma_struct dma_t;
16 16
17struct dma_ops { 17struct dma_ops {
18 int (*request)(dmach_t, dma_t *); /* optional */ 18 int (*request)(unsigned int, dma_t *); /* optional */
19 void (*free)(dmach_t, dma_t *); /* optional */ 19 void (*free)(unsigned int, dma_t *); /* optional */
20 void (*enable)(dmach_t, dma_t *); /* mandatory */ 20 void (*enable)(unsigned int, dma_t *); /* mandatory */
21 void (*disable)(dmach_t, dma_t *); /* mandatory */ 21 void (*disable)(unsigned int, dma_t *); /* mandatory */
22 int (*residue)(dmach_t, dma_t *); /* optional */ 22 int (*residue)(unsigned int, dma_t *); /* optional */
23 int (*setspeed)(dmach_t, dma_t *, int); /* optional */ 23 int (*setspeed)(unsigned int, dma_t *, int); /* optional */
24 char *type; 24 const char *type;
25}; 25};
26 26
27struct dma_struct { 27struct dma_struct {
@@ -34,24 +34,21 @@ struct dma_struct {
34 unsigned int active:1; /* Transfer active */ 34 unsigned int active:1; /* Transfer active */
35 unsigned int invalid:1; /* Address/Count changed */ 35 unsigned int invalid:1; /* Address/Count changed */
36 36
37 dmamode_t dma_mode; /* DMA mode */ 37 unsigned int dma_mode; /* DMA mode */
38 int speed; /* DMA speed */ 38 int speed; /* DMA speed */
39 39
40 unsigned int lock; /* Device is allocated */ 40 unsigned int lock; /* Device is allocated */
41 const char *device_id; /* Device name */ 41 const char *device_id; /* Device name */
42 42
43 unsigned int dma_base; /* Controller base address */ 43 const struct dma_ops *d_ops;
44 int dma_irq; /* Controller IRQ */
45 struct scatterlist cur_sg; /* Current controller buffer */
46 unsigned int state;
47
48 struct dma_ops *d_ops;
49}; 44};
50 45
51/* Prototype: void arch_dma_init(dma) 46/*
52 * Purpose : Initialise architecture specific DMA 47 * isa_dma_add - add an ISA-style DMA channel
53 * Params : dma - pointer to array of DMA structures
54 */ 48 */
55extern void arch_dma_init(dma_t *dma); 49extern int isa_dma_add(unsigned int, dma_t *dma);
56 50
57extern void isa_init_dma(dma_t *dma); 51/*
52 * Add the ISA DMA controller. Always takes channels 0-7.
53 */
54extern void isa_init_dma(void);
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 39d949b63e80..58cf91f38e6f 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -26,6 +26,7 @@ struct map_desc {
26#define MT_HIGH_VECTORS 8 26#define MT_HIGH_VECTORS 8
27#define MT_MEMORY 9 27#define MT_MEMORY 9
28#define MT_ROM 10 28#define MT_ROM 10
29#define MT_MEMORY_NONCACHED 11
29 30
30#ifdef CONFIG_MMU 31#ifdef CONFIG_MMU
31extern void iotable_init(struct map_desc *, int); 32extern void iotable_init(struct map_desc *, int);
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 0202a7c20e62..85763db87449 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -44,14 +44,21 @@
44 * The module space lives between the addresses given by TASK_SIZE 44 * The module space lives between the addresses given by TASK_SIZE
45 * and PAGE_OFFSET - it must be within 32MB of the kernel text. 45 * and PAGE_OFFSET - it must be within 32MB of the kernel text.
46 */ 46 */
47#define MODULES_END (PAGE_OFFSET) 47#define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024)
48#define MODULES_VADDR (MODULES_END - 16*1048576)
49
50#if TASK_SIZE > MODULES_VADDR 48#if TASK_SIZE > MODULES_VADDR
51#error Top of user space clashes with start of module space 49#error Top of user space clashes with start of module space
52#endif 50#endif
53 51
54/* 52/*
53 * The highmem pkmap virtual space shares the end of the module area.
54 */
55#ifdef CONFIG_HIGHMEM
56#define MODULES_END (PAGE_OFFSET - PMD_SIZE)
57#else
58#define MODULES_END (PAGE_OFFSET)
59#endif
60
61/*
55 * The XIP kernel gets mapped at the bottom of the module vm area. 62 * The XIP kernel gets mapped at the bottom of the module vm area.
56 * Since we use sections to map it, this macro replaces the physical address 63 * Since we use sections to map it, this macro replaces the physical address
57 * with its virtual address while keeping offset from the base section. 64 * with its virtual address while keeping offset from the base section.
@@ -181,6 +188,7 @@ static inline void *phys_to_virt(unsigned long x)
181#ifndef __virt_to_bus 188#ifndef __virt_to_bus
182#define __virt_to_bus __virt_to_phys 189#define __virt_to_bus __virt_to_phys
183#define __bus_to_virt __phys_to_virt 190#define __bus_to_virt __phys_to_virt
191#define __pfn_to_bus(x) ((x) << PAGE_SHIFT)
184#endif 192#endif
185 193
186static inline __deprecated unsigned long virt_to_bus(void *x) 194static inline __deprecated unsigned long virt_to_bus(void *x)
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 24b168dc31a3..e4dfa69abb68 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -1,15 +1,27 @@
1#ifndef _ASM_ARM_MODULE_H 1#ifndef _ASM_ARM_MODULE_H
2#define _ASM_ARM_MODULE_H 2#define _ASM_ARM_MODULE_H
3 3
4struct mod_arch_specific
5{
6 int foo;
7};
8
9#define Elf_Shdr Elf32_Shdr 4#define Elf_Shdr Elf32_Shdr
10#define Elf_Sym Elf32_Sym 5#define Elf_Sym Elf32_Sym
11#define Elf_Ehdr Elf32_Ehdr 6#define Elf_Ehdr Elf32_Ehdr
12 7
8struct unwind_table;
9
10struct mod_arch_specific
11{
12#ifdef CONFIG_ARM_UNWIND
13 Elf_Shdr *unw_sec_init;
14 Elf_Shdr *unw_sec_devinit;
15 Elf_Shdr *unw_sec_core;
16 Elf_Shdr *sec_init_text;
17 Elf_Shdr *sec_devinit_text;
18 Elf_Shdr *sec_core_text;
19 struct unwind_table *unwind_init;
20 struct unwind_table *unwind_devinit;
21 struct unwind_table *unwind_core;
22#endif
23};
24
13/* 25/*
14 * Include the ARM architecture version. 26 * Include the ARM architecture version.
15 */ 27 */
diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
index f341c9dbd662..e6eb8a67b807 100644
--- a/arch/arm/include/asm/page.h
+++ b/arch/arm/include/asm/page.h
@@ -76,6 +76,14 @@
76# endif 76# endif
77#endif 77#endif
78 78
79#ifdef CONFIG_CPU_COPY_FA
80# ifdef _USER
81# define MULTI_USER 1
82# else
83# define _USER fa
84# endif
85#endif
86
79#ifdef CONFIG_CPU_SA1100 87#ifdef CONFIG_CPU_SA1100
80# ifdef _USER 88# ifdef _USER
81# define MULTI_USER 1 89# define MULTI_USER 1
diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h
index db80203b68e0..3976412685f8 100644
--- a/arch/arm/include/asm/proc-fns.h
+++ b/arch/arm/include/asm/proc-fns.h
@@ -89,6 +89,14 @@
89# define CPU_NAME cpu_arm922 89# define CPU_NAME cpu_arm922
90# endif 90# endif
91# endif 91# endif
92# ifdef CONFIG_CPU_FA526
93# ifdef CPU_NAME
94# undef MULTI_CPU
95# define MULTI_CPU
96# else
97# define CPU_NAME cpu_fa526
98# endif
99# endif
92# ifdef CONFIG_CPU_ARM925T 100# ifdef CONFIG_CPU_ARM925T
93# ifdef CPU_NAME 101# ifdef CPU_NAME
94# undef MULTI_CPU 102# undef MULTI_CPU
@@ -185,6 +193,14 @@
185# define CPU_NAME cpu_xsc3 193# define CPU_NAME cpu_xsc3
186# endif 194# endif
187# endif 195# endif
196# ifdef CONFIG_CPU_MOHAWK
197# ifdef CPU_NAME
198# undef MULTI_CPU
199# define MULTI_CPU
200# else
201# define CPU_NAME cpu_mohawk
202# endif
203# endif
188# ifdef CONFIG_CPU_FEROCEON 204# ifdef CONFIG_CPU_FEROCEON
189# ifdef CPU_NAME 205# ifdef CPU_NAME
190# undef MULTI_CPU 206# undef MULTI_CPU
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 73192618f1c2..236a06b9b7ce 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -27,6 +27,8 @@
27/* PTRACE_SYSCALL is 24 */ 27/* PTRACE_SYSCALL is 24 */
28#define PTRACE_GETCRUNCHREGS 25 28#define PTRACE_GETCRUNCHREGS 25
29#define PTRACE_SETCRUNCHREGS 26 29#define PTRACE_SETCRUNCHREGS 26
30#define PTRACE_GETVFPREGS 27
31#define PTRACE_SETVFPREGS 28
30 32
31/* 33/*
32 * PSR bits 34 * PSR bits
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index f2cd18a0932b..ee1304f22f94 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -14,7 +14,7 @@
14#ifndef __ASMARM_SETUP_H 14#ifndef __ASMARM_SETUP_H
15#define __ASMARM_SETUP_H 15#define __ASMARM_SETUP_H
16 16
17#include <asm/types.h> 17#include <linux/types.h>
18 18
19#define COMMAND_LINE_SIZE 1024 19#define COMMAND_LINE_SIZE 1024
20 20
diff --git a/arch/arm/include/asm/sizes.h b/arch/arm/include/asm/sizes.h
index 503843db1565..c10d1aa4b487 100644
--- a/arch/arm/include/asm/sizes.h
+++ b/arch/arm/include/asm/sizes.h
@@ -43,6 +43,7 @@
43#define SZ_8M 0x00800000 43#define SZ_8M 0x00800000
44#define SZ_16M 0x01000000 44#define SZ_16M 0x01000000
45#define SZ_32M 0x02000000 45#define SZ_32M 0x02000000
46#define SZ_48M 0x03000000
46#define SZ_64M 0x04000000 47#define SZ_64M 0x04000000
47#define SZ_128M 0x08000000 48#define SZ_128M 0x08000000
48#define SZ_256M 0x10000000 49#define SZ_256M 0x10000000
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h
index 6817be9573a6..537de4e0ef50 100644
--- a/arch/arm/include/asm/socket.h
+++ b/arch/arm/include/asm/socket.h
@@ -54,4 +54,7 @@
54 54
55#define SO_MARK 36 55#define SO_MARK 36
56 56
57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
57#endif /* _ASM_SOCKET_H */ 60#endif /* _ASM_SOCKET_H */
diff --git a/arch/arm/include/asm/stacktrace.h b/arch/arm/include/asm/stacktrace.h
new file mode 100644
index 000000000000..4d0a16441b29
--- /dev/null
+++ b/arch/arm/include/asm/stacktrace.h
@@ -0,0 +1,15 @@
1#ifndef __ASM_STACKTRACE_H
2#define __ASM_STACKTRACE_H
3
4struct stackframe {
5 unsigned long fp;
6 unsigned long sp;
7 unsigned long lr;
8 unsigned long pc;
9};
10
11extern int unwind_frame(struct stackframe *frame);
12extern void walk_stackframe(struct stackframe *frame,
13 int (*fn)(struct stackframe *, void *), void *data);
14
15#endif /* __ASM_STACKTRACE_H */
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index 27a689be0856..ca2bf2f6d6ea 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -16,7 +16,7 @@
16#define __ASM_ARM_SWAB_H 16#define __ASM_ARM_SWAB_H
17 17
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <asm/types.h> 19#include <linux/types.h>
20 20
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__) 21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __SWAB_64_THRU_32__ 22# define __SWAB_64_THRU_32__
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 811be55f338e..bd4dc8ed53d5 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -97,8 +97,8 @@ extern void __show_regs(struct pt_regs *);
97extern int cpu_architecture(void); 97extern int cpu_architecture(void);
98extern void cpu_init(void); 98extern void cpu_init(void);
99 99
100void arm_machine_restart(char mode); 100void arm_machine_restart(char mode, const char *cmd);
101extern void (*arm_pm_restart)(char str); 101extern void (*arm_pm_restart)(char str, const char *cmd);
102 102
103#define UDBG_UNDEFINED (1 << 0) 103#define UDBG_UNDEFINED (1 << 0)
104#define UDBG_SYSCALL (1 << 1) 104#define UDBG_SYSCALL (1 << 1)
@@ -125,6 +125,12 @@ extern unsigned int user_debug;
125 : : "r" (0) : "memory") 125 : : "r" (0) : "memory")
126#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \ 126#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
127 : : "r" (0) : "memory") 127 : : "r" (0) : "memory")
128#elif defined(CONFIG_CPU_FA526)
129#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
130 : : "r" (0) : "memory")
131#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
132 : : "r" (0) : "memory")
133#define dmb() __asm__ __volatile__ ("" : : : "memory")
128#else 134#else
129#define isb() __asm__ __volatile__ ("" : : : "memory") 135#define isb() __asm__ __volatile__ ("" : : : "memory")
130#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ 136#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 68b9ec82a37f..4f8848260ee2 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -99,6 +99,8 @@ static inline struct thread_info *current_thread_info(void)
99 99
100#define thread_saved_pc(tsk) \ 100#define thread_saved_pc(tsk) \
101 ((unsigned long)(task_thread_info(tsk)->cpu_context.pc)) 101 ((unsigned long)(task_thread_info(tsk)->cpu_context.pc))
102#define thread_saved_sp(tsk) \
103 ((unsigned long)(task_thread_info(tsk)->cpu_context.sp))
102#define thread_saved_fp(tsk) \ 104#define thread_saved_fp(tsk) \
103 ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) 105 ((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
104 106
@@ -113,6 +115,8 @@ extern void iwmmxt_task_restore(struct thread_info *, void *);
113extern void iwmmxt_task_release(struct thread_info *); 115extern void iwmmxt_task_release(struct thread_info *);
114extern void iwmmxt_task_switch(struct thread_info *); 116extern void iwmmxt_task_switch(struct thread_info *);
115 117
118extern void vfp_sync_state(struct thread_info *thread);
119
116#endif 120#endif
117 121
118/* 122/*
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index b543a054a17e..a62218013c78 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -39,6 +39,7 @@
39#define TLB_V6_D_ASID (1 << 17) 39#define TLB_V6_D_ASID (1 << 17)
40#define TLB_V6_I_ASID (1 << 18) 40#define TLB_V6_I_ASID (1 << 18)
41 41
42#define TLB_BTB (1 << 28)
42#define TLB_L2CLEAN_FR (1 << 29) /* Feroceon */ 43#define TLB_L2CLEAN_FR (1 << 29) /* Feroceon */
43#define TLB_DCLEAN (1 << 30) 44#define TLB_DCLEAN (1 << 30)
44#define TLB_WB (1 << 31) 45#define TLB_WB (1 << 31)
@@ -53,6 +54,7 @@
53 * v4wb - ARMv4 with write buffer without I TLB flush entry instruction 54 * v4wb - ARMv4 with write buffer without I TLB flush entry instruction
54 * v4wbi - ARMv4 with write buffer with I TLB flush entry instruction 55 * v4wbi - ARMv4 with write buffer with I TLB flush entry instruction
55 * fr - Feroceon (v4wbi with non-outer-cacheable page table walks) 56 * fr - Feroceon (v4wbi with non-outer-cacheable page table walks)
57 * fa - Faraday (v4 with write buffer with UTLB and branch target buffer (BTB))
56 * v6wbi - ARMv6 with write buffer with I TLB flush entry instruction 58 * v6wbi - ARMv6 with write buffer with I TLB flush entry instruction
57 * v7wbi - identical to v6wbi 59 * v7wbi - identical to v6wbi
58 */ 60 */
@@ -89,6 +91,22 @@
89# define v4_always_flags (-1UL) 91# define v4_always_flags (-1UL)
90#endif 92#endif
91 93
94#define fa_tlb_flags (TLB_WB | TLB_BTB | TLB_DCLEAN | \
95 TLB_V4_U_FULL | TLB_V4_U_PAGE)
96
97#ifdef CONFIG_CPU_TLB_FA
98# define fa_possible_flags fa_tlb_flags
99# define fa_always_flags fa_tlb_flags
100# ifdef _TLB
101# define MULTI_TLB 1
102# else
103# define _TLB fa
104# endif
105#else
106# define fa_possible_flags 0
107# define fa_always_flags (-1UL)
108#endif
109
92#define v4wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \ 110#define v4wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \
93 TLB_V4_I_FULL | TLB_V4_D_FULL | \ 111 TLB_V4_I_FULL | TLB_V4_D_FULL | \
94 TLB_V4_I_PAGE | TLB_V4_D_PAGE) 112 TLB_V4_I_PAGE | TLB_V4_D_PAGE)
@@ -140,7 +158,7 @@
140# define v4wb_always_flags (-1UL) 158# define v4wb_always_flags (-1UL)
141#endif 159#endif
142 160
143#define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | \ 161#define v6wbi_tlb_flags (TLB_WB | TLB_DCLEAN | TLB_BTB | \
144 TLB_V6_I_FULL | TLB_V6_D_FULL | \ 162 TLB_V6_I_FULL | TLB_V6_D_FULL | \
145 TLB_V6_I_PAGE | TLB_V6_D_PAGE | \ 163 TLB_V6_I_PAGE | TLB_V6_D_PAGE | \
146 TLB_V6_I_ASID | TLB_V6_D_ASID) 164 TLB_V6_I_ASID | TLB_V6_D_ASID)
@@ -267,6 +285,7 @@ extern struct cpu_tlb_fns cpu_tlb;
267 v4wbi_possible_flags | \ 285 v4wbi_possible_flags | \
268 fr_possible_flags | \ 286 fr_possible_flags | \
269 v4wb_possible_flags | \ 287 v4wb_possible_flags | \
288 fa_possible_flags | \
270 v6wbi_possible_flags | \ 289 v6wbi_possible_flags | \
271 v7wbi_possible_flags) 290 v7wbi_possible_flags)
272 291
@@ -275,6 +294,7 @@ extern struct cpu_tlb_fns cpu_tlb;
275 v4wbi_always_flags & \ 294 v4wbi_always_flags & \
276 fr_always_flags & \ 295 fr_always_flags & \
277 v4wb_always_flags & \ 296 v4wb_always_flags & \
297 fa_always_flags & \
278 v6wbi_always_flags & \ 298 v6wbi_always_flags & \
279 v7wbi_always_flags) 299 v7wbi_always_flags)
280 300
@@ -297,9 +317,7 @@ static inline void local_flush_tlb_all(void)
297 if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL)) 317 if (tlb_flag(TLB_V4_I_FULL | TLB_V6_I_FULL))
298 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc"); 318 asm("mcr p15, 0, %0, c8, c5, 0" : : "r" (zero) : "cc");
299 319
300 if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | 320 if (tlb_flag(TLB_BTB)) {
301 TLB_V6_I_PAGE | TLB_V6_D_PAGE |
302 TLB_V6_I_ASID | TLB_V6_D_ASID)) {
303 /* flush the branch target cache */ 321 /* flush the branch target cache */
304 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); 322 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
305 dsb(); 323 dsb();
@@ -334,9 +352,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
334 if (tlb_flag(TLB_V6_I_ASID)) 352 if (tlb_flag(TLB_V6_I_ASID))
335 asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc"); 353 asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
336 354
337 if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | 355 if (tlb_flag(TLB_BTB)) {
338 TLB_V6_I_PAGE | TLB_V6_D_PAGE |
339 TLB_V6_I_ASID | TLB_V6_D_ASID)) {
340 /* flush the branch target cache */ 356 /* flush the branch target cache */
341 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); 357 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
342 dsb(); 358 dsb();
@@ -374,9 +390,7 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
374 if (tlb_flag(TLB_V6_I_PAGE)) 390 if (tlb_flag(TLB_V6_I_PAGE))
375 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc"); 391 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
376 392
377 if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | 393 if (tlb_flag(TLB_BTB)) {
378 TLB_V6_I_PAGE | TLB_V6_D_PAGE |
379 TLB_V6_I_ASID | TLB_V6_D_ASID)) {
380 /* flush the branch target cache */ 394 /* flush the branch target cache */
381 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); 395 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
382 dsb(); 396 dsb();
@@ -411,9 +425,7 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
411 if (tlb_flag(TLB_V6_I_PAGE)) 425 if (tlb_flag(TLB_V6_I_PAGE))
412 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc"); 426 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (kaddr) : "cc");
413 427
414 if (tlb_flag(TLB_V6_I_FULL | TLB_V6_D_FULL | 428 if (tlb_flag(TLB_BTB)) {
415 TLB_V6_I_PAGE | TLB_V6_D_PAGE |
416 TLB_V6_I_ASID | TLB_V6_D_ASID)) {
417 /* flush the branch target cache */ 429 /* flush the branch target cache */
418 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc"); 430 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero) : "cc");
419 dsb(); 431 dsb();
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h
index aa399aec568e..491960bf4260 100644
--- a/arch/arm/include/asm/traps.h
+++ b/arch/arm/include/asm/traps.h
@@ -25,5 +25,6 @@ static inline int in_exception_text(unsigned long ptr)
25} 25}
26 26
27extern void __init early_trap_init(void); 27extern void __init early_trap_init(void);
28extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
28 29
29#endif 30#endif
diff --git a/arch/arm/include/asm/unwind.h b/arch/arm/include/asm/unwind.h
new file mode 100644
index 000000000000..a5edf421005c
--- /dev/null
+++ b/arch/arm/include/asm/unwind.h
@@ -0,0 +1,69 @@
1/*
2 * arch/arm/include/asm/unwind.h
3 *
4 * Copyright (C) 2008 ARM Limited
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 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __ASM_UNWIND_H
21#define __ASM_UNWIND_H
22
23#ifndef __ASSEMBLY__
24
25/* Unwind reason code according the the ARM EABI documents */
26enum unwind_reason_code {
27 URC_OK = 0, /* operation completed successfully */
28 URC_CONTINUE_UNWIND = 8,
29 URC_FAILURE = 9 /* unspecified failure of some kind */
30};
31
32struct unwind_idx {
33 unsigned long addr;
34 unsigned long insn;
35};
36
37struct unwind_table {
38 struct list_head list;
39 struct unwind_idx *start;
40 struct unwind_idx *stop;
41 unsigned long begin_addr;
42 unsigned long end_addr;
43};
44
45extern struct unwind_table *unwind_table_add(unsigned long start,
46 unsigned long size,
47 unsigned long text_addr,
48 unsigned long text_size);
49extern void unwind_table_del(struct unwind_table *tab);
50extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk);
51
52#ifdef CONFIG_ARM_UNWIND
53extern int __init unwind_init(void);
54#else
55static inline int __init unwind_init(void)
56{
57 return 0;
58}
59#endif
60
61#endif /* !__ASSEMBLY__ */
62
63#ifdef CONFIG_ARM_UNWIND
64#define UNWIND(code...) code
65#else
66#define UNWIND(code...)
67#endif
68
69#endif /* __ASM_UNWIND_H */
diff --git a/arch/arm/include/asm/user.h b/arch/arm/include/asm/user.h
index 825c1e7c582d..df95e050f9dd 100644
--- a/arch/arm/include/asm/user.h
+++ b/arch/arm/include/asm/user.h
@@ -81,4 +81,13 @@ struct user{
81#define HOST_TEXT_START_ADDR (u.start_code) 81#define HOST_TEXT_START_ADDR (u.start_code)
82#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 82#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
83 83
84/*
85 * User specific VFP registers. If only VFPv2 is present, registers 16 to 31
86 * are ignored by the ptrace system call.
87 */
88struct user_vfp {
89 unsigned long long fpregs[32];
90 unsigned long fpscr;
91};
92
84#endif /* _ARM_USER_H */ 93#endif /* _ARM_USER_H */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 4305345987d3..11a5197a221f 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -29,12 +29,14 @@ obj-$(CONFIG_ATAGS_PROC) += atags.o
29obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o 29obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
30obj-$(CONFIG_ARM_THUMBEE) += thumbee.o 30obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
31obj-$(CONFIG_KGDB) += kgdb.o 31obj-$(CONFIG_KGDB) += kgdb.o
32obj-$(CONFIG_ARM_UNWIND) += unwind.o
32 33
33obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o 34obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
34AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 35AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
35 36
36obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o 37obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
37obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o 38obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
39obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
38obj-$(CONFIG_IWMMXT) += iwmmxt.o 40obj-$(CONFIG_IWMMXT) += iwmmxt.o
39AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 41AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
40 42
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index f53c58290543..b121b6053cce 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -49,6 +49,33 @@
491002: 491002:
50 .endm 50 .endm
51 51
52#elif defined(CONFIG_CPU_XSCALE)
53
54 .macro addruart, rx
55 .endm
56
57 .macro senduart, rd, rx
58 mcr p14, 0, \rd, c8, c0, 0
59 .endm
60
61 .macro busyuart, rd, rx
621001:
63 mrc p14, 0, \rx, c14, c0, 0
64 tst \rx, #0x10000000
65 beq 1001b
66 .endm
67
68 .macro waituart, rd, rx
69 mov \rd, #0x10000000
701001:
71 subs \rd, \rd, #1
72 bmi 1002f
73 mrc p14, 0, \rx, c14, c0, 0
74 tst \rx, #0x10000000
75 bne 1001b
761002:
77 .endm
78
52#else 79#else
53 80
54 .macro addruart, rx 81 .macro addruart, rx
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c
index 4a3a50495c60..0e88e46fc732 100644
--- a/arch/arm/kernel/dma-isa.c
+++ b/arch/arm/kernel/dma-isa.c
@@ -24,11 +24,6 @@
24#include <asm/dma.h> 24#include <asm/dma.h>
25#include <asm/mach/dma.h> 25#include <asm/mach/dma.h>
26 26
27#define ISA_DMA_MODE_READ 0x44
28#define ISA_DMA_MODE_WRITE 0x48
29#define ISA_DMA_MODE_CASCADE 0xc0
30#define ISA_DMA_AUTOINIT 0x10
31
32#define ISA_DMA_MASK 0 27#define ISA_DMA_MASK 0
33#define ISA_DMA_MODE 1 28#define ISA_DMA_MODE 1
34#define ISA_DMA_CLRFF 2 29#define ISA_DMA_CLRFF 2
@@ -49,38 +44,35 @@ static unsigned int isa_dma_port[8][7] = {
49 { 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce } 44 { 0xd4, 0xd6, 0xd8, 0x48a, 0x08a, 0xcc, 0xce }
50}; 45};
51 46
52static int isa_get_dma_residue(dmach_t channel, dma_t *dma) 47static int isa_get_dma_residue(unsigned int chan, dma_t *dma)
53{ 48{
54 unsigned int io_port = isa_dma_port[channel][ISA_DMA_COUNT]; 49 unsigned int io_port = isa_dma_port[chan][ISA_DMA_COUNT];
55 int count; 50 int count;
56 51
57 count = 1 + inb(io_port); 52 count = 1 + inb(io_port);
58 count |= inb(io_port) << 8; 53 count |= inb(io_port) << 8;
59 54
60 return channel < 4 ? count : (count << 1); 55 return chan < 4 ? count : (count << 1);
61} 56}
62 57
63static void isa_enable_dma(dmach_t channel, dma_t *dma) 58static void isa_enable_dma(unsigned int chan, dma_t *dma)
64{ 59{
65 if (dma->invalid) { 60 if (dma->invalid) {
66 unsigned long address, length; 61 unsigned long address, length;
67 unsigned int mode; 62 unsigned int mode;
68 enum dma_data_direction direction; 63 enum dma_data_direction direction;
69 64
70 mode = channel & 3; 65 mode = (chan & 3) | dma->dma_mode;
71 switch (dma->dma_mode & DMA_MODE_MASK) { 66 switch (dma->dma_mode & DMA_MODE_MASK) {
72 case DMA_MODE_READ: 67 case DMA_MODE_READ:
73 mode |= ISA_DMA_MODE_READ;
74 direction = DMA_FROM_DEVICE; 68 direction = DMA_FROM_DEVICE;
75 break; 69 break;
76 70
77 case DMA_MODE_WRITE: 71 case DMA_MODE_WRITE:
78 mode |= ISA_DMA_MODE_WRITE;
79 direction = DMA_TO_DEVICE; 72 direction = DMA_TO_DEVICE;
80 break; 73 break;
81 74
82 case DMA_MODE_CASCADE: 75 case DMA_MODE_CASCADE:
83 mode |= ISA_DMA_MODE_CASCADE;
84 direction = DMA_BIDIRECTIONAL; 76 direction = DMA_BIDIRECTIONAL;
85 break; 77 break;
86 78
@@ -105,34 +97,31 @@ static void isa_enable_dma(dmach_t channel, dma_t *dma)
105 address = dma->buf.dma_address; 97 address = dma->buf.dma_address;
106 length = dma->buf.length - 1; 98 length = dma->buf.length - 1;
107 99
108 outb(address >> 16, isa_dma_port[channel][ISA_DMA_PGLO]); 100 outb(address >> 16, isa_dma_port[chan][ISA_DMA_PGLO]);
109 outb(address >> 24, isa_dma_port[channel][ISA_DMA_PGHI]); 101 outb(address >> 24, isa_dma_port[chan][ISA_DMA_PGHI]);
110 102
111 if (channel >= 4) { 103 if (chan >= 4) {
112 address >>= 1; 104 address >>= 1;
113 length >>= 1; 105 length >>= 1;
114 } 106 }
115 107
116 outb(0, isa_dma_port[channel][ISA_DMA_CLRFF]); 108 outb(0, isa_dma_port[chan][ISA_DMA_CLRFF]);
117
118 outb(address, isa_dma_port[channel][ISA_DMA_ADDR]);
119 outb(address >> 8, isa_dma_port[channel][ISA_DMA_ADDR]);
120 109
121 outb(length, isa_dma_port[channel][ISA_DMA_COUNT]); 110 outb(address, isa_dma_port[chan][ISA_DMA_ADDR]);
122 outb(length >> 8, isa_dma_port[channel][ISA_DMA_COUNT]); 111 outb(address >> 8, isa_dma_port[chan][ISA_DMA_ADDR]);
123 112
124 if (dma->dma_mode & DMA_AUTOINIT) 113 outb(length, isa_dma_port[chan][ISA_DMA_COUNT]);
125 mode |= ISA_DMA_AUTOINIT; 114 outb(length >> 8, isa_dma_port[chan][ISA_DMA_COUNT]);
126 115
127 outb(mode, isa_dma_port[channel][ISA_DMA_MODE]); 116 outb(mode, isa_dma_port[chan][ISA_DMA_MODE]);
128 dma->invalid = 0; 117 dma->invalid = 0;
129 } 118 }
130 outb(channel & 3, isa_dma_port[channel][ISA_DMA_MASK]); 119 outb(chan & 3, isa_dma_port[chan][ISA_DMA_MASK]);
131} 120}
132 121
133static void isa_disable_dma(dmach_t channel, dma_t *dma) 122static void isa_disable_dma(unsigned int chan, dma_t *dma)
134{ 123{
135 outb(channel | 4, isa_dma_port[channel][ISA_DMA_MASK]); 124 outb(chan | 4, isa_dma_port[chan][ISA_DMA_MASK]);
136} 125}
137 126
138static struct dma_ops isa_dma_ops = { 127static struct dma_ops isa_dma_ops = {
@@ -160,7 +149,12 @@ static struct resource dma_resources[] = { {
160 .end = 0x048f 149 .end = 0x048f
161} }; 150} };
162 151
163void __init isa_init_dma(dma_t *dma) 152static dma_t isa_dma[8];
153
154/*
155 * ISA DMA always starts at channel 0
156 */
157void __init isa_init_dma(void)
164{ 158{
165 /* 159 /*
166 * Try to autodetect presence of an ISA DMA controller. 160 * Try to autodetect presence of an ISA DMA controller.
@@ -178,11 +172,11 @@ void __init isa_init_dma(dma_t *dma)
178 outb(0xaa, 0x00); 172 outb(0xaa, 0x00);
179 173
180 if (inb(0) == 0x55 && inb(0) == 0xaa) { 174 if (inb(0) == 0x55 && inb(0) == 0xaa) {
181 int channel, i; 175 unsigned int chan, i;
182 176
183 for (channel = 0; channel < 8; channel++) { 177 for (chan = 0; chan < 8; chan++) {
184 dma[channel].d_ops = &isa_dma_ops; 178 isa_dma[chan].d_ops = &isa_dma_ops;
185 isa_disable_dma(channel, NULL); 179 isa_disable_dma(chan, NULL);
186 } 180 }
187 181
188 outb(0x40, 0x0b); 182 outb(0x40, 0x0b);
@@ -217,5 +211,12 @@ void __init isa_init_dma(dma_t *dma)
217 211
218 for (i = 0; i < ARRAY_SIZE(dma_resources); i++) 212 for (i = 0; i < ARRAY_SIZE(dma_resources); i++)
219 request_resource(&ioport_resource, dma_resources + i); 213 request_resource(&ioport_resource, dma_resources + i);
214
215 for (chan = 0; chan < 8; chan++) {
216 int ret = isa_dma_add(chan, &isa_dma[chan]);
217 if (ret)
218 printk(KERN_ERR "ISADMA%u: unable to register: %d\n",
219 chan, ret);
220 }
220 } 221 }
221} 222}
diff --git a/arch/arm/kernel/dma.c b/arch/arm/kernel/dma.c
index d006085ed7e7..7d5b9fb01e71 100644
--- a/arch/arm/kernel/dma.c
+++ b/arch/arm/kernel/dma.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/scatterlist.h>
18 19
19#include <asm/dma.h> 20#include <asm/dma.h>
20 21
@@ -23,19 +24,40 @@
23DEFINE_SPINLOCK(dma_spin_lock); 24DEFINE_SPINLOCK(dma_spin_lock);
24EXPORT_SYMBOL(dma_spin_lock); 25EXPORT_SYMBOL(dma_spin_lock);
25 26
26static dma_t dma_chan[MAX_DMA_CHANNELS]; 27static dma_t *dma_chan[MAX_DMA_CHANNELS];
28
29static inline dma_t *dma_channel(unsigned int chan)
30{
31 if (chan >= MAX_DMA_CHANNELS)
32 return NULL;
33
34 return dma_chan[chan];
35}
36
37int __init isa_dma_add(unsigned int chan, dma_t *dma)
38{
39 if (!dma->d_ops)
40 return -EINVAL;
41
42 sg_init_table(&dma->buf, 1);
43
44 if (dma_chan[chan])
45 return -EBUSY;
46 dma_chan[chan] = dma;
47 return 0;
48}
27 49
28/* 50/*
29 * Request DMA channel 51 * Request DMA channel
30 * 52 *
31 * On certain platforms, we have to allocate an interrupt as well... 53 * On certain platforms, we have to allocate an interrupt as well...
32 */ 54 */
33int request_dma(dmach_t channel, const char *device_id) 55int request_dma(unsigned int chan, const char *device_id)
34{ 56{
35 dma_t *dma = dma_chan + channel; 57 dma_t *dma = dma_channel(chan);
36 int ret; 58 int ret;
37 59
38 if (channel >= MAX_DMA_CHANNELS || !dma->d_ops) 60 if (!dma)
39 goto bad_dma; 61 goto bad_dma;
40 62
41 if (xchg(&dma->lock, 1) != 0) 63 if (xchg(&dma->lock, 1) != 0)
@@ -47,7 +69,7 @@ int request_dma(dmach_t channel, const char *device_id)
47 69
48 ret = 0; 70 ret = 0;
49 if (dma->d_ops->request) 71 if (dma->d_ops->request)
50 ret = dma->d_ops->request(channel, dma); 72 ret = dma->d_ops->request(chan, dma);
51 73
52 if (ret) 74 if (ret)
53 xchg(&dma->lock, 0); 75 xchg(&dma->lock, 0);
@@ -55,7 +77,7 @@ int request_dma(dmach_t channel, const char *device_id)
55 return ret; 77 return ret;
56 78
57bad_dma: 79bad_dma:
58 printk(KERN_ERR "dma: trying to allocate DMA%d\n", channel); 80 printk(KERN_ERR "dma: trying to allocate DMA%d\n", chan);
59 return -EINVAL; 81 return -EINVAL;
60 82
61busy: 83busy:
@@ -68,42 +90,42 @@ EXPORT_SYMBOL(request_dma);
68 * 90 *
69 * On certain platforms, we have to free interrupt as well... 91 * On certain platforms, we have to free interrupt as well...
70 */ 92 */
71void free_dma(dmach_t channel) 93void free_dma(unsigned int chan)
72{ 94{
73 dma_t *dma = dma_chan + channel; 95 dma_t *dma = dma_channel(chan);
74 96
75 if (channel >= MAX_DMA_CHANNELS || !dma->d_ops) 97 if (!dma)
76 goto bad_dma; 98 goto bad_dma;
77 99
78 if (dma->active) { 100 if (dma->active) {
79 printk(KERN_ERR "dma%d: freeing active DMA\n", channel); 101 printk(KERN_ERR "dma%d: freeing active DMA\n", chan);
80 dma->d_ops->disable(channel, dma); 102 dma->d_ops->disable(chan, dma);
81 dma->active = 0; 103 dma->active = 0;
82 } 104 }
83 105
84 if (xchg(&dma->lock, 0) != 0) { 106 if (xchg(&dma->lock, 0) != 0) {
85 if (dma->d_ops->free) 107 if (dma->d_ops->free)
86 dma->d_ops->free(channel, dma); 108 dma->d_ops->free(chan, dma);
87 return; 109 return;
88 } 110 }
89 111
90 printk(KERN_ERR "dma%d: trying to free free DMA\n", channel); 112 printk(KERN_ERR "dma%d: trying to free free DMA\n", chan);
91 return; 113 return;
92 114
93bad_dma: 115bad_dma:
94 printk(KERN_ERR "dma: trying to free DMA%d\n", channel); 116 printk(KERN_ERR "dma: trying to free DMA%d\n", chan);
95} 117}
96EXPORT_SYMBOL(free_dma); 118EXPORT_SYMBOL(free_dma);
97 119
98/* Set DMA Scatter-Gather list 120/* Set DMA Scatter-Gather list
99 */ 121 */
100void set_dma_sg (dmach_t channel, struct scatterlist *sg, int nr_sg) 122void set_dma_sg (unsigned int chan, struct scatterlist *sg, int nr_sg)
101{ 123{
102 dma_t *dma = dma_chan + channel; 124 dma_t *dma = dma_channel(chan);
103 125
104 if (dma->active) 126 if (dma->active)
105 printk(KERN_ERR "dma%d: altering DMA SG while " 127 printk(KERN_ERR "dma%d: altering DMA SG while "
106 "DMA active\n", channel); 128 "DMA active\n", chan);
107 129
108 dma->sg = sg; 130 dma->sg = sg;
109 dma->sgcount = nr_sg; 131 dma->sgcount = nr_sg;
@@ -115,13 +137,13 @@ EXPORT_SYMBOL(set_dma_sg);
115 * 137 *
116 * Copy address to the structure, and set the invalid bit 138 * Copy address to the structure, and set the invalid bit
117 */ 139 */
118void __set_dma_addr (dmach_t channel, void *addr) 140void __set_dma_addr (unsigned int chan, void *addr)
119{ 141{
120 dma_t *dma = dma_chan + channel; 142 dma_t *dma = dma_channel(chan);
121 143
122 if (dma->active) 144 if (dma->active)
123 printk(KERN_ERR "dma%d: altering DMA address while " 145 printk(KERN_ERR "dma%d: altering DMA address while "
124 "DMA active\n", channel); 146 "DMA active\n", chan);
125 147
126 dma->sg = NULL; 148 dma->sg = NULL;
127 dma->addr = addr; 149 dma->addr = addr;
@@ -133,13 +155,13 @@ EXPORT_SYMBOL(__set_dma_addr);
133 * 155 *
134 * Copy address to the structure, and set the invalid bit 156 * Copy address to the structure, and set the invalid bit
135 */ 157 */
136void set_dma_count (dmach_t channel, unsigned long count) 158void set_dma_count (unsigned int chan, unsigned long count)
137{ 159{
138 dma_t *dma = dma_chan + channel; 160 dma_t *dma = dma_channel(chan);
139 161
140 if (dma->active) 162 if (dma->active)
141 printk(KERN_ERR "dma%d: altering DMA count while " 163 printk(KERN_ERR "dma%d: altering DMA count while "
142 "DMA active\n", channel); 164 "DMA active\n", chan);
143 165
144 dma->sg = NULL; 166 dma->sg = NULL;
145 dma->count = count; 167 dma->count = count;
@@ -149,13 +171,13 @@ EXPORT_SYMBOL(set_dma_count);
149 171
150/* Set DMA direction mode 172/* Set DMA direction mode
151 */ 173 */
152void set_dma_mode (dmach_t channel, dmamode_t mode) 174void set_dma_mode (unsigned int chan, unsigned int mode)
153{ 175{
154 dma_t *dma = dma_chan + channel; 176 dma_t *dma = dma_channel(chan);
155 177
156 if (dma->active) 178 if (dma->active)
157 printk(KERN_ERR "dma%d: altering DMA mode while " 179 printk(KERN_ERR "dma%d: altering DMA mode while "
158 "DMA active\n", channel); 180 "DMA active\n", chan);
159 181
160 dma->dma_mode = mode; 182 dma->dma_mode = mode;
161 dma->invalid = 1; 183 dma->invalid = 1;
@@ -164,42 +186,42 @@ EXPORT_SYMBOL(set_dma_mode);
164 186
165/* Enable DMA channel 187/* Enable DMA channel
166 */ 188 */
167void enable_dma (dmach_t channel) 189void enable_dma (unsigned int chan)
168{ 190{
169 dma_t *dma = dma_chan + channel; 191 dma_t *dma = dma_channel(chan);
170 192
171 if (!dma->lock) 193 if (!dma->lock)
172 goto free_dma; 194 goto free_dma;
173 195
174 if (dma->active == 0) { 196 if (dma->active == 0) {
175 dma->active = 1; 197 dma->active = 1;
176 dma->d_ops->enable(channel, dma); 198 dma->d_ops->enable(chan, dma);
177 } 199 }
178 return; 200 return;
179 201
180free_dma: 202free_dma:
181 printk(KERN_ERR "dma%d: trying to enable free DMA\n", channel); 203 printk(KERN_ERR "dma%d: trying to enable free DMA\n", chan);
182 BUG(); 204 BUG();
183} 205}
184EXPORT_SYMBOL(enable_dma); 206EXPORT_SYMBOL(enable_dma);
185 207
186/* Disable DMA channel 208/* Disable DMA channel
187 */ 209 */
188void disable_dma (dmach_t channel) 210void disable_dma (unsigned int chan)
189{ 211{
190 dma_t *dma = dma_chan + channel; 212 dma_t *dma = dma_channel(chan);
191 213
192 if (!dma->lock) 214 if (!dma->lock)
193 goto free_dma; 215 goto free_dma;
194 216
195 if (dma->active == 1) { 217 if (dma->active == 1) {
196 dma->active = 0; 218 dma->active = 0;
197 dma->d_ops->disable(channel, dma); 219 dma->d_ops->disable(chan, dma);
198 } 220 }
199 return; 221 return;
200 222
201free_dma: 223free_dma:
202 printk(KERN_ERR "dma%d: trying to disable free DMA\n", channel); 224 printk(KERN_ERR "dma%d: trying to disable free DMA\n", chan);
203 BUG(); 225 BUG();
204} 226}
205EXPORT_SYMBOL(disable_dma); 227EXPORT_SYMBOL(disable_dma);
@@ -207,45 +229,38 @@ EXPORT_SYMBOL(disable_dma);
207/* 229/*
208 * Is the specified DMA channel active? 230 * Is the specified DMA channel active?
209 */ 231 */
210int dma_channel_active(dmach_t channel) 232int dma_channel_active(unsigned int chan)
211{ 233{
212 return dma_chan[channel].active; 234 dma_t *dma = dma_channel(chan);
235 return dma->active;
213} 236}
214EXPORT_SYMBOL(dma_channel_active); 237EXPORT_SYMBOL(dma_channel_active);
215 238
216void set_dma_page(dmach_t channel, char pagenr) 239void set_dma_page(unsigned int chan, char pagenr)
217{ 240{
218 printk(KERN_ERR "dma%d: trying to set_dma_page\n", channel); 241 printk(KERN_ERR "dma%d: trying to set_dma_page\n", chan);
219} 242}
220EXPORT_SYMBOL(set_dma_page); 243EXPORT_SYMBOL(set_dma_page);
221 244
222void set_dma_speed(dmach_t channel, int cycle_ns) 245void set_dma_speed(unsigned int chan, int cycle_ns)
223{ 246{
224 dma_t *dma = dma_chan + channel; 247 dma_t *dma = dma_channel(chan);
225 int ret = 0; 248 int ret = 0;
226 249
227 if (dma->d_ops->setspeed) 250 if (dma->d_ops->setspeed)
228 ret = dma->d_ops->setspeed(channel, dma, cycle_ns); 251 ret = dma->d_ops->setspeed(chan, dma, cycle_ns);
229 dma->speed = ret; 252 dma->speed = ret;
230} 253}
231EXPORT_SYMBOL(set_dma_speed); 254EXPORT_SYMBOL(set_dma_speed);
232 255
233int get_dma_residue(dmach_t channel) 256int get_dma_residue(unsigned int chan)
234{ 257{
235 dma_t *dma = dma_chan + channel; 258 dma_t *dma = dma_channel(chan);
236 int ret = 0; 259 int ret = 0;
237 260
238 if (dma->d_ops->residue) 261 if (dma->d_ops->residue)
239 ret = dma->d_ops->residue(channel, dma); 262 ret = dma->d_ops->residue(chan, dma);
240 263
241 return ret; 264 return ret;
242} 265}
243EXPORT_SYMBOL(get_dma_residue); 266EXPORT_SYMBOL(get_dma_residue);
244
245static int __init init_dma(void)
246{
247 arch_dma_init(dma_chan);
248 return 0;
249}
250
251core_initcall(init_dma);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 85040cfeb5e5..d662a2f1fd85 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -20,6 +20,7 @@
20#include <asm/vfpmacros.h> 20#include <asm/vfpmacros.h>
21#include <mach/entry-macro.S> 21#include <mach/entry-macro.S>
22#include <asm/thread_notify.h> 22#include <asm/thread_notify.h>
23#include <asm/unwind.h>
23 24
24#include "entry-header.S" 25#include "entry-header.S"
25 26
@@ -123,6 +124,8 @@ ENDPROC(__und_invalid)
123#endif 124#endif
124 125
125 .macro svc_entry, stack_hole=0 126 .macro svc_entry, stack_hole=0
127 UNWIND(.fnstart )
128 UNWIND(.save {r0 - pc} )
126 sub sp, sp, #(S_FRAME_SIZE + \stack_hole) 129 sub sp, sp, #(S_FRAME_SIZE + \stack_hole)
127 SPFIX( tst sp, #4 ) 130 SPFIX( tst sp, #4 )
128 SPFIX( bicne sp, sp, #4 ) 131 SPFIX( bicne sp, sp, #4 )
@@ -196,6 +199,7 @@ __dabt_svc:
196 ldr r0, [sp, #S_PSR] 199 ldr r0, [sp, #S_PSR]
197 msr spsr_cxsf, r0 200 msr spsr_cxsf, r0
198 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 201 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
202 UNWIND(.fnend )
199ENDPROC(__dabt_svc) 203ENDPROC(__dabt_svc)
200 204
201 .align 5 205 .align 5
@@ -228,6 +232,7 @@ __irq_svc:
228 bleq trace_hardirqs_on 232 bleq trace_hardirqs_on
229#endif 233#endif
230 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 234 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
235 UNWIND(.fnend )
231ENDPROC(__irq_svc) 236ENDPROC(__irq_svc)
232 237
233 .ltorg 238 .ltorg
@@ -278,6 +283,7 @@ __und_svc:
278 ldr lr, [sp, #S_PSR] @ Get SVC cpsr 283 ldr lr, [sp, #S_PSR] @ Get SVC cpsr
279 msr spsr_cxsf, lr 284 msr spsr_cxsf, lr
280 ldmia sp, {r0 - pc}^ @ Restore SVC registers 285 ldmia sp, {r0 - pc}^ @ Restore SVC registers
286 UNWIND(.fnend )
281ENDPROC(__und_svc) 287ENDPROC(__und_svc)
282 288
283 .align 5 289 .align 5
@@ -320,6 +326,7 @@ __pabt_svc:
320 ldr r0, [sp, #S_PSR] 326 ldr r0, [sp, #S_PSR]
321 msr spsr_cxsf, r0 327 msr spsr_cxsf, r0
322 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 328 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
329 UNWIND(.fnend )
323ENDPROC(__pabt_svc) 330ENDPROC(__pabt_svc)
324 331
325 .align 5 332 .align 5
@@ -343,6 +350,8 @@ ENDPROC(__pabt_svc)
343#endif 350#endif
344 351
345 .macro usr_entry 352 .macro usr_entry
353 UNWIND(.fnstart )
354 UNWIND(.cantunwind ) @ don't unwind the user space
346 sub sp, sp, #S_FRAME_SIZE 355 sub sp, sp, #S_FRAME_SIZE
347 stmib sp, {r1 - r12} 356 stmib sp, {r1 - r12}
348 357
@@ -420,6 +429,7 @@ __dabt_usr:
420 mov r2, sp 429 mov r2, sp
421 adr lr, ret_from_exception 430 adr lr, ret_from_exception
422 b do_DataAbort 431 b do_DataAbort
432 UNWIND(.fnend )
423ENDPROC(__dabt_usr) 433ENDPROC(__dabt_usr)
424 434
425 .align 5 435 .align 5
@@ -450,6 +460,7 @@ __irq_usr:
450 460
451 mov why, #0 461 mov why, #0
452 b ret_to_user 462 b ret_to_user
463 UNWIND(.fnend )
453ENDPROC(__irq_usr) 464ENDPROC(__irq_usr)
454 465
455 .ltorg 466 .ltorg
@@ -484,6 +495,7 @@ __und_usr:
484#else 495#else
485 b __und_usr_unknown 496 b __und_usr_unknown
486#endif 497#endif
498 UNWIND(.fnend )
487ENDPROC(__und_usr) 499ENDPROC(__und_usr)
488 500
489 @ 501 @
@@ -671,14 +683,18 @@ __pabt_usr:
671 enable_irq @ Enable interrupts 683 enable_irq @ Enable interrupts
672 mov r1, sp @ regs 684 mov r1, sp @ regs
673 bl do_PrefetchAbort @ call abort handler 685 bl do_PrefetchAbort @ call abort handler
686 UNWIND(.fnend )
674 /* fall through */ 687 /* fall through */
675/* 688/*
676 * This is the return code to user mode for abort handlers 689 * This is the return code to user mode for abort handlers
677 */ 690 */
678ENTRY(ret_from_exception) 691ENTRY(ret_from_exception)
692 UNWIND(.fnstart )
693 UNWIND(.cantunwind )
679 get_thread_info tsk 694 get_thread_info tsk
680 mov why, #0 695 mov why, #0
681 b ret_to_user 696 b ret_to_user
697 UNWIND(.fnend )
682ENDPROC(__pabt_usr) 698ENDPROC(__pabt_usr)
683ENDPROC(ret_from_exception) 699ENDPROC(ret_from_exception)
684 700
@@ -688,6 +704,8 @@ ENDPROC(ret_from_exception)
688 * previous and next are guaranteed not to be the same. 704 * previous and next are guaranteed not to be the same.
689 */ 705 */
690ENTRY(__switch_to) 706ENTRY(__switch_to)
707 UNWIND(.fnstart )
708 UNWIND(.cantunwind )
691 add ip, r1, #TI_CPU_SAVE 709 add ip, r1, #TI_CPU_SAVE
692 ldr r3, [r2, #TI_TP_VALUE] 710 ldr r3, [r2, #TI_TP_VALUE]
693 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack 711 stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack
@@ -717,6 +735,7 @@ ENTRY(__switch_to)
717 bl atomic_notifier_call_chain 735 bl atomic_notifier_call_chain
718 mov r0, r5 736 mov r0, r5
719 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously 737 ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously
738 UNWIND(.fnend )
720ENDPROC(__switch_to) 739ENDPROC(__switch_to)
721 740
722 __INIT 741 __INIT
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 159d0416f270..b55cb0331809 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -11,6 +11,7 @@
11#include <asm/unistd.h> 11#include <asm/unistd.h>
12#include <asm/ftrace.h> 12#include <asm/ftrace.h>
13#include <mach/entry-macro.S> 13#include <mach/entry-macro.S>
14#include <asm/unwind.h>
14 15
15#include "entry-header.S" 16#include "entry-header.S"
16 17
@@ -22,6 +23,8 @@
22 * stack. 23 * stack.
23 */ 24 */
24ret_fast_syscall: 25ret_fast_syscall:
26 UNWIND(.fnstart )
27 UNWIND(.cantunwind )
25 disable_irq @ disable interrupts 28 disable_irq @ disable interrupts
26 ldr r1, [tsk, #TI_FLAGS] 29 ldr r1, [tsk, #TI_FLAGS]
27 tst r1, #_TIF_WORK_MASK 30 tst r1, #_TIF_WORK_MASK
@@ -38,6 +41,7 @@ ret_fast_syscall:
38 mov r0, r0 41 mov r0, r0
39 add sp, sp, #S_FRAME_SIZE - S_PC 42 add sp, sp, #S_FRAME_SIZE - S_PC
40 movs pc, lr @ return & move spsr_svc into cpsr 43 movs pc, lr @ return & move spsr_svc into cpsr
44 UNWIND(.fnend )
41 45
42/* 46/*
43 * Ok, we need to do extra processing, enter the slow path. 47 * Ok, we need to do extra processing, enter the slow path.
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 363db186cb93..6874c7dca75a 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -76,7 +76,7 @@ int show_interrupts(struct seq_file *p, void *v)
76 76
77 seq_printf(p, "%3d: ", i); 77 seq_printf(p, "%3d: ", i);
78 for_each_present_cpu(cpu) 78 for_each_present_cpu(cpu)
79 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]); 79 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
80 seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-"); 80 seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-");
81 seq_printf(p, " %s", action->name); 81 seq_printf(p, " %s", action->name);
82 for (action = action->next; action; action = action->next) 82 for (action = action->next; action; action = action->next)
@@ -104,6 +104,11 @@ static struct irq_desc bad_irq_desc = {
104 .lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock), 104 .lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock),
105}; 105};
106 106
107#ifdef CONFIG_CPUMASK_OFFSTACK
108/* We are not allocating bad_irq_desc.affinity or .pending_mask */
109#error "ARM architecture does not support CONFIG_CPUMASK_OFFSTACK."
110#endif
111
107/* 112/*
108 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not 113 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not
109 * come via this function. Instead, they should provide their 114 * come via this function. Instead, they should provide their
@@ -161,7 +166,7 @@ void __init init_IRQ(void)
161 irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE; 166 irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_NOPROBE;
162 167
163#ifdef CONFIG_SMP 168#ifdef CONFIG_SMP
164 bad_irq_desc.affinity = CPU_MASK_ALL; 169 cpumask_setall(bad_irq_desc.affinity);
165 bad_irq_desc.cpu = smp_processor_id(); 170 bad_irq_desc.cpu = smp_processor_id();
166#endif 171#endif
167 init_arch_irq(); 172 init_arch_irq();
@@ -191,15 +196,16 @@ void migrate_irqs(void)
191 struct irq_desc *desc = irq_desc + i; 196 struct irq_desc *desc = irq_desc + i;
192 197
193 if (desc->cpu == cpu) { 198 if (desc->cpu == cpu) {
194 unsigned int newcpu = any_online_cpu(desc->affinity); 199 unsigned int newcpu = cpumask_any_and(desc->affinity,
195 200 cpu_online_mask);
196 if (newcpu == NR_CPUS) { 201 if (newcpu >= nr_cpu_ids) {
197 if (printk_ratelimit()) 202 if (printk_ratelimit())
198 printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n", 203 printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n",
199 i, cpu); 204 i, cpu);
200 205
201 cpus_setall(desc->affinity); 206 cpumask_setall(desc->affinity);
202 newcpu = any_online_cpu(desc->affinity); 207 newcpu = cpumask_any_and(desc->affinity,
208 cpu_online_mask);
203 } 209 }
204 210
205 route_irq(desc, i, newcpu); 211 route_irq(desc, i, newcpu);
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index dab48f27263f..d1731e39b496 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -22,6 +22,7 @@
22 22
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/sections.h> 24#include <asm/sections.h>
25#include <asm/unwind.h>
25 26
26#ifdef CONFIG_XIP_KERNEL 27#ifdef CONFIG_XIP_KERNEL
27/* 28/*
@@ -66,6 +67,24 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
66 char *secstrings, 67 char *secstrings,
67 struct module *mod) 68 struct module *mod)
68{ 69{
70#ifdef CONFIG_ARM_UNWIND
71 Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum;
72
73 for (s = sechdrs; s < sechdrs_end; s++) {
74 if (strcmp(".ARM.exidx.init.text", secstrings + s->sh_name) == 0)
75 mod->arch.unw_sec_init = s;
76 else if (strcmp(".ARM.exidx.devinit.text", secstrings + s->sh_name) == 0)
77 mod->arch.unw_sec_devinit = s;
78 else if (strcmp(".ARM.exidx", secstrings + s->sh_name) == 0)
79 mod->arch.unw_sec_core = s;
80 else if (strcmp(".init.text", secstrings + s->sh_name) == 0)
81 mod->arch.sec_init_text = s;
82 else if (strcmp(".devinit.text", secstrings + s->sh_name) == 0)
83 mod->arch.sec_devinit_text = s;
84 else if (strcmp(".text", secstrings + s->sh_name) == 0)
85 mod->arch.sec_core_text = s;
86 }
87#endif
69 return 0; 88 return 0;
70} 89}
71 90
@@ -104,6 +123,10 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
104 loc = dstsec->sh_addr + rel->r_offset; 123 loc = dstsec->sh_addr + rel->r_offset;
105 124
106 switch (ELF32_R_TYPE(rel->r_info)) { 125 switch (ELF32_R_TYPE(rel->r_info)) {
126 case R_ARM_NONE:
127 /* ignore */
128 break;
129
107 case R_ARM_ABS32: 130 case R_ARM_ABS32:
108 *(u32 *)loc += sym->st_value; 131 *(u32 *)loc += sym->st_value;
109 break; 132 break;
@@ -132,6 +155,20 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
132 *(u32 *)loc |= offset & 0x00ffffff; 155 *(u32 *)loc |= offset & 0x00ffffff;
133 break; 156 break;
134 157
158 case R_ARM_V4BX:
159 /* Preserve Rm and the condition code. Alter
160 * other bits to re-code instruction as
161 * MOV PC,Rm.
162 */
163 *(u32 *)loc &= 0xf000000f;
164 *(u32 *)loc |= 0x01a0f000;
165 break;
166
167 case R_ARM_PREL31:
168 offset = *(u32 *)loc + sym->st_value - loc;
169 *(u32 *)loc = offset & 0x7fffffff;
170 break;
171
135 default: 172 default:
136 printk(KERN_ERR "%s: unknown relocation: %u\n", 173 printk(KERN_ERR "%s: unknown relocation: %u\n",
137 module->name, ELF32_R_TYPE(rel->r_info)); 174 module->name, ELF32_R_TYPE(rel->r_info));
@@ -150,14 +187,50 @@ apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
150 return -ENOEXEC; 187 return -ENOEXEC;
151} 188}
152 189
190#ifdef CONFIG_ARM_UNWIND
191static void register_unwind_tables(struct module *mod)
192{
193 if (mod->arch.unw_sec_init && mod->arch.sec_init_text)
194 mod->arch.unwind_init =
195 unwind_table_add(mod->arch.unw_sec_init->sh_addr,
196 mod->arch.unw_sec_init->sh_size,
197 mod->arch.sec_init_text->sh_addr,
198 mod->arch.sec_init_text->sh_size);
199 if (mod->arch.unw_sec_devinit && mod->arch.sec_devinit_text)
200 mod->arch.unwind_devinit =
201 unwind_table_add(mod->arch.unw_sec_devinit->sh_addr,
202 mod->arch.unw_sec_devinit->sh_size,
203 mod->arch.sec_devinit_text->sh_addr,
204 mod->arch.sec_devinit_text->sh_size);
205 if (mod->arch.unw_sec_core && mod->arch.sec_core_text)
206 mod->arch.unwind_core =
207 unwind_table_add(mod->arch.unw_sec_core->sh_addr,
208 mod->arch.unw_sec_core->sh_size,
209 mod->arch.sec_core_text->sh_addr,
210 mod->arch.sec_core_text->sh_size);
211}
212
213static void unregister_unwind_tables(struct module *mod)
214{
215 unwind_table_del(mod->arch.unwind_init);
216 unwind_table_del(mod->arch.unwind_devinit);
217 unwind_table_del(mod->arch.unwind_core);
218}
219#else
220static inline void register_unwind_tables(struct module *mod) { }
221static inline void unregister_unwind_tables(struct module *mod) { }
222#endif
223
153int 224int
154module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, 225module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
155 struct module *module) 226 struct module *module)
156{ 227{
228 register_unwind_tables(module);
157 return 0; 229 return 0;
158} 230}
159 231
160void 232void
161module_arch_cleanup(struct module *mod) 233module_arch_cleanup(struct module *mod)
162{ 234{
235 unregister_unwind_tables(mod);
163} 236}
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index d3ea6fa89521..2de14e2afdc5 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -34,6 +34,7 @@
34#include <asm/processor.h> 34#include <asm/processor.h>
35#include <asm/system.h> 35#include <asm/system.h>
36#include <asm/thread_notify.h> 36#include <asm/thread_notify.h>
37#include <asm/stacktrace.h>
37#include <asm/mach/time.h> 38#include <asm/mach/time.h>
38 39
39static const char *processor_modes[] = { 40static const char *processor_modes[] = {
@@ -82,7 +83,7 @@ static int __init hlt_setup(char *__unused)
82__setup("nohlt", nohlt_setup); 83__setup("nohlt", nohlt_setup);
83__setup("hlt", hlt_setup); 84__setup("hlt", hlt_setup);
84 85
85void arm_machine_restart(char mode) 86void arm_machine_restart(char mode, const char *cmd)
86{ 87{
87 /* 88 /*
88 * Clean and disable cache, and turn off interrupts 89 * Clean and disable cache, and turn off interrupts
@@ -99,7 +100,7 @@ void arm_machine_restart(char mode)
99 /* 100 /*
100 * Now call the architecture specific reboot code. 101 * Now call the architecture specific reboot code.
101 */ 102 */
102 arch_reset(mode); 103 arch_reset(mode, cmd);
103 104
104 /* 105 /*
105 * Whoops - the architecture was unable to reboot. 106 * Whoops - the architecture was unable to reboot.
@@ -119,7 +120,7 @@ EXPORT_SYMBOL(pm_idle);
119void (*pm_power_off)(void); 120void (*pm_power_off)(void);
120EXPORT_SYMBOL(pm_power_off); 121EXPORT_SYMBOL(pm_power_off);
121 122
122void (*arm_pm_restart)(char str) = arm_machine_restart; 123void (*arm_pm_restart)(char str, const char *cmd) = arm_machine_restart;
123EXPORT_SYMBOL_GPL(arm_pm_restart); 124EXPORT_SYMBOL_GPL(arm_pm_restart);
124 125
125 126
@@ -194,9 +195,9 @@ void machine_power_off(void)
194 pm_power_off(); 195 pm_power_off();
195} 196}
196 197
197void machine_restart(char * __unused) 198void machine_restart(char *cmd)
198{ 199{
199 arm_pm_restart(reboot_mode); 200 arm_pm_restart(reboot_mode, cmd);
200} 201}
201 202
202void __show_regs(struct pt_regs *regs) 203void __show_regs(struct pt_regs *regs)
@@ -372,23 +373,21 @@ EXPORT_SYMBOL(kernel_thread);
372 373
373unsigned long get_wchan(struct task_struct *p) 374unsigned long get_wchan(struct task_struct *p)
374{ 375{
375 unsigned long fp, lr; 376 struct stackframe frame;
376 unsigned long stack_start, stack_end;
377 int count = 0; 377 int count = 0;
378 if (!p || p == current || p->state == TASK_RUNNING) 378 if (!p || p == current || p->state == TASK_RUNNING)
379 return 0; 379 return 0;
380 380
381 stack_start = (unsigned long)end_of_stack(p); 381 frame.fp = thread_saved_fp(p);
382 stack_end = (unsigned long)task_stack_page(p) + THREAD_SIZE; 382 frame.sp = thread_saved_sp(p);
383 383 frame.lr = 0; /* recovered from the stack */
384 fp = thread_saved_fp(p); 384 frame.pc = thread_saved_pc(p);
385 do { 385 do {
386 if (fp < stack_start || fp > stack_end) 386 int ret = unwind_frame(&frame);
387 if (ret < 0)
387 return 0; 388 return 0;
388 lr = ((unsigned long *)fp)[-1]; 389 if (!in_sched_functions(frame.pc))
389 if (!in_sched_functions(lr)) 390 return frame.pc;
390 return lr;
391 fp = *(unsigned long *) (fp - 12);
392 } while (count ++ < 16); 391 } while (count ++ < 16);
393 return 0; 392 return 0;
394} 393}
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index df653ea59250..89882a1d0187 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -653,6 +653,54 @@ static int ptrace_setcrunchregs(struct task_struct *tsk, void __user *ufp)
653} 653}
654#endif 654#endif
655 655
656#ifdef CONFIG_VFP
657/*
658 * Get the child VFP state.
659 */
660static int ptrace_getvfpregs(struct task_struct *tsk, void __user *data)
661{
662 struct thread_info *thread = task_thread_info(tsk);
663 union vfp_state *vfp = &thread->vfpstate;
664 struct user_vfp __user *ufp = data;
665
666 vfp_sync_state(thread);
667
668 /* copy the floating point registers */
669 if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs,
670 sizeof(vfp->hard.fpregs)))
671 return -EFAULT;
672
673 /* copy the status and control register */
674 if (put_user(vfp->hard.fpscr, &ufp->fpscr))
675 return -EFAULT;
676
677 return 0;
678}
679
680/*
681 * Set the child VFP state.
682 */
683static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
684{
685 struct thread_info *thread = task_thread_info(tsk);
686 union vfp_state *vfp = &thread->vfpstate;
687 struct user_vfp __user *ufp = data;
688
689 vfp_sync_state(thread);
690
691 /* copy the floating point registers */
692 if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs,
693 sizeof(vfp->hard.fpregs)))
694 return -EFAULT;
695
696 /* copy the status and control register */
697 if (get_user(vfp->hard.fpscr, &ufp->fpscr))
698 return -EFAULT;
699
700 return 0;
701}
702#endif
703
656long arch_ptrace(struct task_struct *child, long request, long addr, long data) 704long arch_ptrace(struct task_struct *child, long request, long addr, long data)
657{ 705{
658 int ret; 706 int ret;
@@ -775,6 +823,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
775 break; 823 break;
776#endif 824#endif
777 825
826#ifdef CONFIG_VFP
827 case PTRACE_GETVFPREGS:
828 ret = ptrace_getvfpregs(child, (void __user *)data);
829 break;
830
831 case PTRACE_SETVFPREGS:
832 ret = ptrace_setvfpregs(child, (void __user *)data);
833 break;
834#endif
835
778 default: 836 default:
779 ret = ptrace_request(child, request, addr, data); 837 ret = ptrace_request(child, request, addr, data);
780 break; 838 break;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 68d6494c0389..bc5e4128f9f3 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -40,6 +40,7 @@
40#include <asm/mach/irq.h> 40#include <asm/mach/irq.h>
41#include <asm/mach/time.h> 41#include <asm/mach/time.h>
42#include <asm/traps.h> 42#include <asm/traps.h>
43#include <asm/unwind.h>
43 44
44#include "compat.h" 45#include "compat.h"
45#include "atags.h" 46#include "atags.h"
@@ -685,6 +686,8 @@ void __init setup_arch(char **cmdline_p)
685 struct machine_desc *mdesc; 686 struct machine_desc *mdesc;
686 char *from = default_command_line; 687 char *from = default_command_line;
687 688
689 unwind_init();
690
688 setup_processor(); 691 setup_processor();
689 mdesc = setup_machine(machine_arch_type); 692 mdesc = setup_machine(machine_arch_type);
690 machine_name = mdesc->name; 693 machine_name = mdesc->name;
@@ -780,6 +783,8 @@ static const char *hwcap_str[] = {
780 "crunch", 783 "crunch",
781 "thumbee", 784 "thumbee",
782 "neon", 785 "neon",
786 "vfpv3",
787 "vfpv3d16",
783 NULL 788 NULL
784}; 789};
785 790
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 55fa7ff96a3e..7801aac3c043 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -93,6 +93,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
93 pmd = pmd_offset(pgd + pgd_index(PHYS_OFFSET), PHYS_OFFSET); 93 pmd = pmd_offset(pgd + pgd_index(PHYS_OFFSET), PHYS_OFFSET);
94 *pmd = __pmd((PHYS_OFFSET & PGDIR_MASK) | 94 *pmd = __pmd((PHYS_OFFSET & PGDIR_MASK) |
95 PMD_TYPE_SECT | PMD_SECT_AP_WRITE); 95 PMD_TYPE_SECT | PMD_SECT_AP_WRITE);
96 flush_pmd_entry(pmd);
96 97
97 /* 98 /*
98 * We need to tell the secondary core where to find 99 * We need to tell the secondary core where to find
@@ -130,6 +131,7 @@ int __cpuinit __cpu_up(unsigned int cpu)
130 secondary_data.pgdir = 0; 131 secondary_data.pgdir = 0;
131 132
132 *pmd = __pmd(0); 133 *pmd = __pmd(0);
134 clean_pmd_entry(pmd);
133 pgd_free(&init_mm, pgd); 135 pgd_free(&init_mm, pgd);
134 136
135 if (ret) { 137 if (ret) {
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
index fc650f64df43..9f444e5cc165 100644
--- a/arch/arm/kernel/stacktrace.c
+++ b/arch/arm/kernel/stacktrace.c
@@ -2,35 +2,60 @@
2#include <linux/sched.h> 2#include <linux/sched.h>
3#include <linux/stacktrace.h> 3#include <linux/stacktrace.h>
4 4
5#include "stacktrace.h" 5#include <asm/stacktrace.h>
6 6
7int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high, 7#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
8 int (*fn)(struct stackframe *, void *), void *data) 8/*
9 * Unwind the current stack frame and store the new register values in the
10 * structure passed as argument. Unwinding is equivalent to a function return,
11 * hence the new PC value rather than LR should be used for backtrace.
12 *
13 * With framepointer enabled, a simple function prologue looks like this:
14 * mov ip, sp
15 * stmdb sp!, {fp, ip, lr, pc}
16 * sub fp, ip, #4
17 *
18 * A simple function epilogue looks like this:
19 * ldm sp, {fp, sp, pc}
20 *
21 * Note that with framepointer enabled, even the leaf functions have the same
22 * prologue and epilogue, therefore we can ignore the LR value in this case.
23 */
24int unwind_frame(struct stackframe *frame)
9{ 25{
10 struct stackframe *frame; 26 unsigned long high, low;
11 27 unsigned long fp = frame->fp;
12 do {
13 /*
14 * Check current frame pointer is within bounds
15 */
16 if (fp < (low + 12) || fp + 4 >= high)
17 break;
18 28
19 frame = (struct stackframe *)(fp - 12); 29 /* only go to a higher address on the stack */
30 low = frame->sp;
31 high = ALIGN(low, THREAD_SIZE) + THREAD_SIZE;
20 32
21 if (fn(frame, data)) 33 /* check current frame pointer is within bounds */
22 break; 34 if (fp < (low + 12) || fp + 4 >= high)
35 return -EINVAL;
23 36
24 /* 37 /* restore the registers from the stack frame */
25 * Update the low bound - the next frame must always 38 frame->fp = *(unsigned long *)(fp - 12);
26 * be at a higher address than the current frame. 39 frame->sp = *(unsigned long *)(fp - 8);
27 */ 40 frame->pc = *(unsigned long *)(fp - 4);
28 low = fp + 4;
29 fp = frame->fp;
30 } while (fp);
31 41
32 return 0; 42 return 0;
33} 43}
44#endif
45
46void walk_stackframe(struct stackframe *frame,
47 int (*fn)(struct stackframe *, void *), void *data)
48{
49 while (1) {
50 int ret;
51
52 if (fn(frame, data))
53 break;
54 ret = unwind_frame(frame);
55 if (ret < 0)
56 break;
57 }
58}
34EXPORT_SYMBOL(walk_stackframe); 59EXPORT_SYMBOL(walk_stackframe);
35 60
36#ifdef CONFIG_STACKTRACE 61#ifdef CONFIG_STACKTRACE
@@ -44,7 +69,7 @@ static int save_trace(struct stackframe *frame, void *d)
44{ 69{
45 struct stack_trace_data *data = d; 70 struct stack_trace_data *data = d;
46 struct stack_trace *trace = data->trace; 71 struct stack_trace *trace = data->trace;
47 unsigned long addr = frame->lr; 72 unsigned long addr = frame->pc;
48 73
49 if (data->no_sched_functions && in_sched_functions(addr)) 74 if (data->no_sched_functions && in_sched_functions(addr))
50 return 0; 75 return 0;
@@ -61,11 +86,10 @@ static int save_trace(struct stackframe *frame, void *d)
61void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) 86void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
62{ 87{
63 struct stack_trace_data data; 88 struct stack_trace_data data;
64 unsigned long fp, base; 89 struct stackframe frame;
65 90
66 data.trace = trace; 91 data.trace = trace;
67 data.skip = trace->skip; 92 data.skip = trace->skip;
68 base = (unsigned long)task_stack_page(tsk);
69 93
70 if (tsk != current) { 94 if (tsk != current) {
71#ifdef CONFIG_SMP 95#ifdef CONFIG_SMP
@@ -76,14 +100,22 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
76 BUG(); 100 BUG();
77#else 101#else
78 data.no_sched_functions = 1; 102 data.no_sched_functions = 1;
79 fp = thread_saved_fp(tsk); 103 frame.fp = thread_saved_fp(tsk);
104 frame.sp = thread_saved_sp(tsk);
105 frame.lr = 0; /* recovered from the stack */
106 frame.pc = thread_saved_pc(tsk);
80#endif 107#endif
81 } else { 108 } else {
109 register unsigned long current_sp asm ("sp");
110
82 data.no_sched_functions = 0; 111 data.no_sched_functions = 0;
83 asm("mov %0, fp" : "=r" (fp)); 112 frame.fp = (unsigned long)__builtin_frame_address(0);
113 frame.sp = current_sp;
114 frame.lr = (unsigned long)__builtin_return_address(0);
115 frame.pc = (unsigned long)save_stack_trace_tsk;
84 } 116 }
85 117
86 walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data); 118 walk_stackframe(&frame, save_trace, &data);
87 if (trace->nr_entries < trace->max_entries) 119 if (trace->nr_entries < trace->max_entries)
88 trace->entries[trace->nr_entries++] = ULONG_MAX; 120 trace->entries[trace->nr_entries++] = ULONG_MAX;
89} 121}
diff --git a/arch/arm/kernel/stacktrace.h b/arch/arm/kernel/stacktrace.h
deleted file mode 100644
index e9fd20cb5662..000000000000
--- a/arch/arm/kernel/stacktrace.h
+++ /dev/null
@@ -1,9 +0,0 @@
1struct stackframe {
2 unsigned long fp;
3 unsigned long sp;
4 unsigned long lr;
5 unsigned long pc;
6};
7
8int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high,
9 int (*fn)(struct stackframe *, void *), void *data);
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index c68b44aa88d2..4cdc4a0bd02d 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -33,6 +33,7 @@
33 33
34#include <asm/leds.h> 34#include <asm/leds.h>
35#include <asm/thread_info.h> 35#include <asm/thread_info.h>
36#include <asm/stacktrace.h>
36#include <asm/mach/time.h> 37#include <asm/mach/time.h>
37 38
38/* 39/*
@@ -55,14 +56,22 @@ EXPORT_SYMBOL(rtc_lock);
55#ifdef CONFIG_SMP 56#ifdef CONFIG_SMP
56unsigned long profile_pc(struct pt_regs *regs) 57unsigned long profile_pc(struct pt_regs *regs)
57{ 58{
58 unsigned long fp, pc = instruction_pointer(regs); 59 struct stackframe frame;
59 60
60 if (in_lock_functions(pc)) { 61 if (!in_lock_functions(regs->ARM_pc))
61 fp = regs->ARM_fp; 62 return regs->ARM_pc;
62 pc = ((unsigned long *)fp)[-1]; 63
63 } 64 frame.fp = regs->ARM_fp;
65 frame.sp = regs->ARM_sp;
66 frame.lr = regs->ARM_lr;
67 frame.pc = regs->ARM_pc;
68 do {
69 int ret = unwind_frame(&frame);
70 if (ret < 0)
71 return 0;
72 } while (in_lock_functions(frame.pc));
64 73
65 return pc; 74 return frame.pc;
66} 75}
67EXPORT_SYMBOL(profile_pc); 76EXPORT_SYMBOL(profile_pc);
68#endif 77#endif
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 79abc4ddc0cf..57eb0f6f6005 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -27,6 +27,7 @@
27#include <asm/system.h> 27#include <asm/system.h>
28#include <asm/unistd.h> 28#include <asm/unistd.h>
29#include <asm/traps.h> 29#include <asm/traps.h>
30#include <asm/unwind.h>
30 31
31#include "ptrace.h" 32#include "ptrace.h"
32#include "signal.h" 33#include "signal.h"
@@ -61,6 +62,7 @@ void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long
61 dump_mem("Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); 62 dump_mem("Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs));
62} 63}
63 64
65#ifndef CONFIG_ARM_UNWIND
64/* 66/*
65 * Stack pointers should always be within the kernels view of 67 * Stack pointers should always be within the kernels view of
66 * physical memory. If it is not there, then we can't dump 68 * physical memory. If it is not there, then we can't dump
@@ -74,6 +76,7 @@ static int verify_stack(unsigned long sp)
74 76
75 return 0; 77 return 0;
76} 78}
79#endif
77 80
78/* 81/*
79 * Dump out the contents of some memory nicely... 82 * Dump out the contents of some memory nicely...
@@ -150,13 +153,33 @@ static void dump_instr(struct pt_regs *regs)
150 set_fs(fs); 153 set_fs(fs);
151} 154}
152 155
156#ifdef CONFIG_ARM_UNWIND
157static inline void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
158{
159 unwind_backtrace(regs, tsk);
160}
161#else
153static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) 162static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
154{ 163{
155 unsigned int fp; 164 unsigned int fp, mode;
156 int ok = 1; 165 int ok = 1;
157 166
158 printk("Backtrace: "); 167 printk("Backtrace: ");
159 fp = regs->ARM_fp; 168
169 if (!tsk)
170 tsk = current;
171
172 if (regs) {
173 fp = regs->ARM_fp;
174 mode = processor_mode(regs);
175 } else if (tsk != current) {
176 fp = thread_saved_fp(tsk);
177 mode = 0x10;
178 } else {
179 asm("mov %0, fp" : "=r" (fp) : : "cc");
180 mode = 0x10;
181 }
182
160 if (!fp) { 183 if (!fp) {
161 printk("no frame pointer"); 184 printk("no frame pointer");
162 ok = 0; 185 ok = 0;
@@ -168,29 +191,20 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
168 printk("\n"); 191 printk("\n");
169 192
170 if (ok) 193 if (ok)
171 c_backtrace(fp, processor_mode(regs)); 194 c_backtrace(fp, mode);
172} 195}
196#endif
173 197
174void dump_stack(void) 198void dump_stack(void)
175{ 199{
176 __backtrace(); 200 dump_backtrace(NULL, NULL);
177} 201}
178 202
179EXPORT_SYMBOL(dump_stack); 203EXPORT_SYMBOL(dump_stack);
180 204
181void show_stack(struct task_struct *tsk, unsigned long *sp) 205void show_stack(struct task_struct *tsk, unsigned long *sp)
182{ 206{
183 unsigned long fp; 207 dump_backtrace(NULL, tsk);
184
185 if (!tsk)
186 tsk = current;
187
188 if (tsk != current)
189 fp = thread_saved_fp(tsk);
190 else
191 asm("mov %0, fp" : "=r" (fp) : : "cc");
192
193 c_backtrace(fp, 0x10);
194 barrier(); 208 barrier();
195} 209}
196 210
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
new file mode 100644
index 000000000000..1dedc2c7ff49
--- /dev/null
+++ b/arch/arm/kernel/unwind.c
@@ -0,0 +1,434 @@
1/*
2 * arch/arm/kernel/unwind.c
3 *
4 * Copyright (C) 2008 ARM Limited
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 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 *
20 * Stack unwinding support for ARM
21 *
22 * An ARM EABI version of gcc is required to generate the unwind
23 * tables. For information about the structure of the unwind tables,
24 * see "Exception Handling ABI for the ARM Architecture" at:
25 *
26 * http://infocenter.arm.com/help/topic/com.arm.doc.subset.swdev.abi/index.html
27 */
28
29#include <linux/kernel.h>
30#include <linux/init.h>
31#include <linux/module.h>
32#include <linux/sched.h>
33#include <linux/slab.h>
34#include <linux/spinlock.h>
35#include <linux/list.h>
36
37#include <asm/stacktrace.h>
38#include <asm/traps.h>
39#include <asm/unwind.h>
40
41/* Dummy functions to avoid linker complaints */
42void __aeabi_unwind_cpp_pr0(void)
43{
44};
45EXPORT_SYMBOL(__aeabi_unwind_cpp_pr0);
46
47void __aeabi_unwind_cpp_pr1(void)
48{
49};
50EXPORT_SYMBOL(__aeabi_unwind_cpp_pr1);
51
52void __aeabi_unwind_cpp_pr2(void)
53{
54};
55EXPORT_SYMBOL(__aeabi_unwind_cpp_pr2);
56
57struct unwind_ctrl_block {
58 unsigned long vrs[16]; /* virtual register set */
59 unsigned long *insn; /* pointer to the current instructions word */
60 int entries; /* number of entries left to interpret */
61 int byte; /* current byte number in the instructions word */
62};
63
64enum regs {
65 FP = 11,
66 SP = 13,
67 LR = 14,
68 PC = 15
69};
70
71extern struct unwind_idx __start_unwind_idx[];
72extern struct unwind_idx __stop_unwind_idx[];
73
74static DEFINE_SPINLOCK(unwind_lock);
75static LIST_HEAD(unwind_tables);
76
77/* Convert a prel31 symbol to an absolute address */
78#define prel31_to_addr(ptr) \
79({ \
80 /* sign-extend to 32 bits */ \
81 long offset = (((long)*(ptr)) << 1) >> 1; \
82 (unsigned long)(ptr) + offset; \
83})
84
85/*
86 * Binary search in the unwind index. The entries entries are
87 * guaranteed to be sorted in ascending order by the linker.
88 */
89static struct unwind_idx *search_index(unsigned long addr,
90 struct unwind_idx *first,
91 struct unwind_idx *last)
92{
93 pr_debug("%s(%08lx, %p, %p)\n", __func__, addr, first, last);
94
95 if (addr < first->addr) {
96 pr_warning("unwind: Unknown symbol address %08lx\n", addr);
97 return NULL;
98 } else if (addr >= last->addr)
99 return last;
100
101 while (first < last - 1) {
102 struct unwind_idx *mid = first + ((last - first + 1) >> 1);
103
104 if (addr < mid->addr)
105 last = mid;
106 else
107 first = mid;
108 }
109
110 return first;
111}
112
113static struct unwind_idx *unwind_find_idx(unsigned long addr)
114{
115 struct unwind_idx *idx = NULL;
116 unsigned long flags;
117
118 pr_debug("%s(%08lx)\n", __func__, addr);
119
120 if (core_kernel_text(addr))
121 /* main unwind table */
122 idx = search_index(addr, __start_unwind_idx,
123 __stop_unwind_idx - 1);
124 else {
125 /* module unwind tables */
126 struct unwind_table *table;
127
128 spin_lock_irqsave(&unwind_lock, flags);
129 list_for_each_entry(table, &unwind_tables, list) {
130 if (addr >= table->begin_addr &&
131 addr < table->end_addr) {
132 idx = search_index(addr, table->start,
133 table->stop - 1);
134 break;
135 }
136 }
137 spin_unlock_irqrestore(&unwind_lock, flags);
138 }
139
140 pr_debug("%s: idx = %p\n", __func__, idx);
141 return idx;
142}
143
144static unsigned long unwind_get_byte(struct unwind_ctrl_block *ctrl)
145{
146 unsigned long ret;
147
148 if (ctrl->entries <= 0) {
149 pr_warning("unwind: Corrupt unwind table\n");
150 return 0;
151 }
152
153 ret = (*ctrl->insn >> (ctrl->byte * 8)) & 0xff;
154
155 if (ctrl->byte == 0) {
156 ctrl->insn++;
157 ctrl->entries--;
158 ctrl->byte = 3;
159 } else
160 ctrl->byte--;
161
162 return ret;
163}
164
165/*
166 * Execute the current unwind instruction.
167 */
168static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
169{
170 unsigned long insn = unwind_get_byte(ctrl);
171
172 pr_debug("%s: insn = %08lx\n", __func__, insn);
173
174 if ((insn & 0xc0) == 0x00)
175 ctrl->vrs[SP] += ((insn & 0x3f) << 2) + 4;
176 else if ((insn & 0xc0) == 0x40)
177 ctrl->vrs[SP] -= ((insn & 0x3f) << 2) + 4;
178 else if ((insn & 0xf0) == 0x80) {
179 unsigned long mask;
180 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
181 int load_sp, reg = 4;
182
183 insn = (insn << 8) | unwind_get_byte(ctrl);
184 mask = insn & 0x0fff;
185 if (mask == 0) {
186 pr_warning("unwind: 'Refuse to unwind' instruction %04lx\n",
187 insn);
188 return -URC_FAILURE;
189 }
190
191 /* pop R4-R15 according to mask */
192 load_sp = mask & (1 << (13 - 4));
193 while (mask) {
194 if (mask & 1)
195 ctrl->vrs[reg] = *vsp++;
196 mask >>= 1;
197 reg++;
198 }
199 if (!load_sp)
200 ctrl->vrs[SP] = (unsigned long)vsp;
201 } else if ((insn & 0xf0) == 0x90 &&
202 (insn & 0x0d) != 0x0d)
203 ctrl->vrs[SP] = ctrl->vrs[insn & 0x0f];
204 else if ((insn & 0xf0) == 0xa0) {
205 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
206 int reg;
207
208 /* pop R4-R[4+bbb] */
209 for (reg = 4; reg <= 4 + (insn & 7); reg++)
210 ctrl->vrs[reg] = *vsp++;
211 if (insn & 0x80)
212 ctrl->vrs[14] = *vsp++;
213 ctrl->vrs[SP] = (unsigned long)vsp;
214 } else if (insn == 0xb0) {
215 ctrl->vrs[PC] = ctrl->vrs[LR];
216 /* no further processing */
217 ctrl->entries = 0;
218 } else if (insn == 0xb1) {
219 unsigned long mask = unwind_get_byte(ctrl);
220 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
221 int reg = 0;
222
223 if (mask == 0 || mask & 0xf0) {
224 pr_warning("unwind: Spare encoding %04lx\n",
225 (insn << 8) | mask);
226 return -URC_FAILURE;
227 }
228
229 /* pop R0-R3 according to mask */
230 while (mask) {
231 if (mask & 1)
232 ctrl->vrs[reg] = *vsp++;
233 mask >>= 1;
234 reg++;
235 }
236 ctrl->vrs[SP] = (unsigned long)vsp;
237 } else if (insn == 0xb2) {
238 unsigned long uleb128 = unwind_get_byte(ctrl);
239
240 ctrl->vrs[SP] += 0x204 + (uleb128 << 2);
241 } else {
242 pr_warning("unwind: Unhandled instruction %02lx\n", insn);
243 return -URC_FAILURE;
244 }
245
246 pr_debug("%s: fp = %08lx sp = %08lx lr = %08lx pc = %08lx\n", __func__,
247 ctrl->vrs[FP], ctrl->vrs[SP], ctrl->vrs[LR], ctrl->vrs[PC]);
248
249 return URC_OK;
250}
251
252/*
253 * Unwind a single frame starting with *sp for the symbol at *pc. It
254 * updates the *pc and *sp with the new values.
255 */
256int unwind_frame(struct stackframe *frame)
257{
258 unsigned long high, low;
259 struct unwind_idx *idx;
260 struct unwind_ctrl_block ctrl;
261
262 /* only go to a higher address on the stack */
263 low = frame->sp;
264 high = ALIGN(low, THREAD_SIZE) + THREAD_SIZE;
265
266 pr_debug("%s(pc = %08lx lr = %08lx sp = %08lx)\n", __func__,
267 frame->pc, frame->lr, frame->sp);
268
269 if (!kernel_text_address(frame->pc))
270 return -URC_FAILURE;
271
272 idx = unwind_find_idx(frame->pc);
273 if (!idx) {
274 pr_warning("unwind: Index not found %08lx\n", frame->pc);
275 return -URC_FAILURE;
276 }
277
278 ctrl.vrs[FP] = frame->fp;
279 ctrl.vrs[SP] = frame->sp;
280 ctrl.vrs[LR] = frame->lr;
281 ctrl.vrs[PC] = 0;
282
283 if (idx->insn == 1)
284 /* can't unwind */
285 return -URC_FAILURE;
286 else if ((idx->insn & 0x80000000) == 0)
287 /* prel31 to the unwind table */
288 ctrl.insn = (unsigned long *)prel31_to_addr(&idx->insn);
289 else if ((idx->insn & 0xff000000) == 0x80000000)
290 /* only personality routine 0 supported in the index */
291 ctrl.insn = &idx->insn;
292 else {
293 pr_warning("unwind: Unsupported personality routine %08lx in the index at %p\n",
294 idx->insn, idx);
295 return -URC_FAILURE;
296 }
297
298 /* check the personality routine */
299 if ((*ctrl.insn & 0xff000000) == 0x80000000) {
300 ctrl.byte = 2;
301 ctrl.entries = 1;
302 } else if ((*ctrl.insn & 0xff000000) == 0x81000000) {
303 ctrl.byte = 1;
304 ctrl.entries = 1 + ((*ctrl.insn & 0x00ff0000) >> 16);
305 } else {
306 pr_warning("unwind: Unsupported personality routine %08lx at %p\n",
307 *ctrl.insn, ctrl.insn);
308 return -URC_FAILURE;
309 }
310
311 while (ctrl.entries > 0) {
312 int urc;
313
314 if (ctrl.vrs[SP] < low || ctrl.vrs[SP] >= high)
315 return -URC_FAILURE;
316 urc = unwind_exec_insn(&ctrl);
317 if (urc < 0)
318 return urc;
319 }
320
321 if (ctrl.vrs[PC] == 0)
322 ctrl.vrs[PC] = ctrl.vrs[LR];
323
324 frame->fp = ctrl.vrs[FP];
325 frame->sp = ctrl.vrs[SP];
326 frame->lr = ctrl.vrs[LR];
327 frame->pc = ctrl.vrs[PC];
328
329 return URC_OK;
330}
331
332void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk)
333{
334 struct stackframe frame;
335 unsigned long high, low;
336 register unsigned long current_sp asm ("sp");
337
338 pr_debug("%s(regs = %p tsk = %p)\n", __func__, regs, tsk);
339
340 if (!tsk)
341 tsk = current;
342
343 if (regs) {
344 frame.fp = regs->ARM_fp;
345 frame.sp = regs->ARM_sp;
346 frame.lr = regs->ARM_lr;
347 frame.pc = regs->ARM_pc;
348 } else if (tsk == current) {
349 frame.fp = (unsigned long)__builtin_frame_address(0);
350 frame.sp = current_sp;
351 frame.lr = (unsigned long)__builtin_return_address(0);
352 frame.pc = (unsigned long)unwind_backtrace;
353 } else {
354 /* task blocked in __switch_to */
355 frame.fp = thread_saved_fp(tsk);
356 frame.sp = thread_saved_sp(tsk);
357 /*
358 * The function calling __switch_to cannot be a leaf function
359 * so LR is recovered from the stack.
360 */
361 frame.lr = 0;
362 frame.pc = thread_saved_pc(tsk);
363 }
364
365 low = frame.sp & ~(THREAD_SIZE - 1);
366 high = low + THREAD_SIZE;
367
368 while (1) {
369 int urc;
370 unsigned long where = frame.pc;
371
372 urc = unwind_frame(&frame);
373 if (urc < 0)
374 break;
375 dump_backtrace_entry(where, frame.pc, frame.sp - 4);
376 }
377}
378
379struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
380 unsigned long text_addr,
381 unsigned long text_size)
382{
383 unsigned long flags;
384 struct unwind_idx *idx;
385 struct unwind_table *tab = kmalloc(sizeof(*tab), GFP_KERNEL);
386
387 pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size,
388 text_addr, text_size);
389
390 if (!tab)
391 return tab;
392
393 tab->start = (struct unwind_idx *)start;
394 tab->stop = (struct unwind_idx *)(start + size);
395 tab->begin_addr = text_addr;
396 tab->end_addr = text_addr + text_size;
397
398 /* Convert the symbol addresses to absolute values */
399 for (idx = tab->start; idx < tab->stop; idx++)
400 idx->addr = prel31_to_addr(&idx->addr);
401
402 spin_lock_irqsave(&unwind_lock, flags);
403 list_add_tail(&tab->list, &unwind_tables);
404 spin_unlock_irqrestore(&unwind_lock, flags);
405
406 return tab;
407}
408
409void unwind_table_del(struct unwind_table *tab)
410{
411 unsigned long flags;
412
413 if (!tab)
414 return;
415
416 spin_lock_irqsave(&unwind_lock, flags);
417 list_del(&tab->list);
418 spin_unlock_irqrestore(&unwind_lock, flags);
419
420 kfree(tab);
421}
422
423int __init unwind_init(void)
424{
425 struct unwind_idx *idx;
426
427 /* Convert the symbol addresses to absolute values */
428 for (idx = __start_unwind_idx; idx < __stop_unwind_idx; idx++)
429 idx->addr = prel31_to_addr(&idx->addr);
430
431 pr_debug("unwind: ARM stack unwinding initialised\n");
432
433 return 0;
434}
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 00216071eaf7..c90f27250ead 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -64,7 +64,9 @@ SECTIONS
64 __initramfs_end = .; 64 __initramfs_end = .;
65#endif 65#endif
66 . = ALIGN(4096); 66 . = ALIGN(4096);
67 __per_cpu_load = .;
67 __per_cpu_start = .; 68 __per_cpu_start = .;
69 *(.data.percpu.page_aligned)
68 *(.data.percpu) 70 *(.data.percpu)
69 *(.data.percpu.shared_aligned) 71 *(.data.percpu.shared_aligned)
70 __per_cpu_end = .; 72 __per_cpu_end = .;
@@ -80,6 +82,8 @@ SECTIONS
80 EXIT_TEXT 82 EXIT_TEXT
81 EXIT_DATA 83 EXIT_DATA
82 *(.exitcall.exit) 84 *(.exitcall.exit)
85 *(.ARM.exidx.exit.text)
86 *(.ARM.extab.exit.text)
83#ifndef CONFIG_MMU 87#ifndef CONFIG_MMU
84 *(.fixup) 88 *(.fixup)
85 *(__ex_table) 89 *(__ex_table)
@@ -110,6 +114,23 @@ SECTIONS
110 114
111 _etext = .; /* End of text and rodata section */ 115 _etext = .; /* End of text and rodata section */
112 116
117#ifdef CONFIG_ARM_UNWIND
118 /*
119 * Stack unwinding tables
120 */
121 . = ALIGN(8);
122 .ARM.unwind_idx : {
123 __start_unwind_idx = .;
124 *(.ARM.exidx*)
125 __stop_unwind_idx = .;
126 }
127 .ARM.unwind_tab : {
128 __start_unwind_tab = .;
129 *(.ARM.extab*)
130 __stop_unwind_tab = .;
131 }
132#endif
133
113#ifdef CONFIG_XIP_KERNEL 134#ifdef CONFIG_XIP_KERNEL
114 __data_loc = ALIGN(4); /* location in binary */ 135 __data_loc = ALIGN(4); /* location in binary */
115 . = PAGE_OFFSET + TEXT_OFFSET; 136 . = PAGE_OFFSET + TEXT_OFFSET;
diff --git a/arch/arm/mach-aaec2000/include/mach/system.h b/arch/arm/mach-aaec2000/include/mach/system.h
index 8f4115d734ce..fe08ca1add6f 100644
--- a/arch/arm/mach-aaec2000/include/mach/system.h
+++ b/arch/arm/mach-aaec2000/include/mach/system.h
@@ -16,7 +16,7 @@ static inline void arch_idle(void)
16 cpu_do_idle(); 16 cpu_do_idle();
17} 17}
18 18
19static inline void arch_reset(char mode) 19static inline void arch_reset(char mode, const char *cmd)
20{ 20{
21 cpu_reset(0); 21 cpu_reset(0);
22} 22}
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 81439fe6fb3d..438efbb17482 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -238,6 +238,10 @@ static void __init ek_board_init(void)
238 at91_add_device_i2c(NULL, 0); 238 at91_add_device_i2c(NULL, 0);
239 /* LEDs */ 239 /* LEDs */
240 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); 240 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
241 /* PCK0 provides MCLK to the WM8731 */
242 at91_set_B_periph(AT91_PIN_PC1, 0);
243 /* SSC (for WM8731) */
244 at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
241} 245}
242 246
243MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK") 247MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 7b9ce7a336b0..b5daf7f5e011 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -47,9 +47,6 @@ extern void at91_irq_resume(void);
47#define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ 47#define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */
48 48
49struct at91_gpio_bank { 49struct at91_gpio_bank {
50 unsigned chipbase; /* bank's first GPIO number */
51 void __iomem *regbase; /* base of register bank */
52 struct at91_gpio_bank *next; /* bank sharing same IRQ/clock/... */
53 unsigned short id; /* peripheral ID */ 50 unsigned short id; /* peripheral ID */
54 unsigned long offset; /* offset from system peripheral base */ 51 unsigned long offset; /* offset from system peripheral base */
55 struct clk *clock; /* associated clock */ 52 struct clk *clock; /* associated clock */
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index 2f7d4977dce9..f2236f0e101f 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -24,19 +24,59 @@
24#include <mach/at91_pio.h> 24#include <mach/at91_pio.h>
25#include <mach/gpio.h> 25#include <mach/gpio.h>
26 26
27#include <asm/gpio.h>
28
27#include "generic.h" 29#include "generic.h"
28 30
31struct at91_gpio_chip {
32 struct gpio_chip chip;
33 struct at91_gpio_chip *next; /* Bank sharing same clock */
34 struct at91_gpio_bank *bank; /* Bank definition */
35 void __iomem *regbase; /* Base of register bank */
36};
29 37
30static struct at91_gpio_bank *gpio; 38#define to_at91_gpio_chip(c) container_of(c, struct at91_gpio_chip, chip)
31static int gpio_banks; 39
40static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip);
41static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val);
42static int at91_gpiolib_get(struct gpio_chip *chip, unsigned offset);
43static int at91_gpiolib_direction_output(struct gpio_chip *chip,
44 unsigned offset, int val);
45static int at91_gpiolib_direction_input(struct gpio_chip *chip,
46 unsigned offset);
47static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset);
48
49#define AT91_GPIO_CHIP(name, base_gpio, nr_gpio) \
50 { \
51 .chip = { \
52 .label = name, \
53 .request = at91_gpiolib_request, \
54 .direction_input = at91_gpiolib_direction_input, \
55 .direction_output = at91_gpiolib_direction_output, \
56 .get = at91_gpiolib_get, \
57 .set = at91_gpiolib_set, \
58 .dbg_show = at91_gpiolib_dbg_show, \
59 .base = base_gpio, \
60 .ngpio = nr_gpio, \
61 }, \
62 }
63
64static struct at91_gpio_chip gpio_chip[] = {
65 AT91_GPIO_CHIP("A", 0x00 + PIN_BASE, 32),
66 AT91_GPIO_CHIP("B", 0x20 + PIN_BASE, 32),
67 AT91_GPIO_CHIP("C", 0x40 + PIN_BASE, 32),
68 AT91_GPIO_CHIP("D", 0x60 + PIN_BASE, 32),
69 AT91_GPIO_CHIP("E", 0x80 + PIN_BASE, 32),
70};
32 71
72static int gpio_banks;
33 73
34static inline void __iomem *pin_to_controller(unsigned pin) 74static inline void __iomem *pin_to_controller(unsigned pin)
35{ 75{
36 pin -= PIN_BASE; 76 pin -= PIN_BASE;
37 pin /= 32; 77 pin /= 32;
38 if (likely(pin < gpio_banks)) 78 if (likely(pin < gpio_banks))
39 return gpio[pin].regbase; 79 return gpio_chip[pin].regbase;
40 80
41 return NULL; 81 return NULL;
42} 82}
@@ -197,39 +237,6 @@ int __init_or_module at91_set_multi_drive(unsigned pin, int is_on)
197} 237}
198EXPORT_SYMBOL(at91_set_multi_drive); 238EXPORT_SYMBOL(at91_set_multi_drive);
199 239
200/*--------------------------------------------------------------------------*/
201
202/* new-style GPIO calls; these expect at91_set_GPIO_periph to have been
203 * called, and maybe at91_set_multi_drive() for putout pins.
204 */
205
206int gpio_direction_input(unsigned pin)
207{
208 void __iomem *pio = pin_to_controller(pin);
209 unsigned mask = pin_to_mask(pin);
210
211 if (!pio || !(__raw_readl(pio + PIO_PSR) & mask))
212 return -EINVAL;
213 __raw_writel(mask, pio + PIO_ODR);
214 return 0;
215}
216EXPORT_SYMBOL(gpio_direction_input);
217
218int gpio_direction_output(unsigned pin, int value)
219{
220 void __iomem *pio = pin_to_controller(pin);
221 unsigned mask = pin_to_mask(pin);
222
223 if (!pio || !(__raw_readl(pio + PIO_PSR) & mask))
224 return -EINVAL;
225 __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
226 __raw_writel(mask, pio + PIO_OER);
227 return 0;
228}
229EXPORT_SYMBOL(gpio_direction_output);
230
231/*--------------------------------------------------------------------------*/
232
233/* 240/*
234 * assuming the pin is muxed as a gpio output, set its value. 241 * assuming the pin is muxed as a gpio output, set its value.
235 */ 242 */
@@ -282,7 +289,7 @@ static int gpio_irq_set_wake(unsigned pin, unsigned state)
282 else 289 else
283 wakeups[bank] &= ~mask; 290 wakeups[bank] &= ~mask;
284 291
285 set_irq_wake(gpio[bank].id, state); 292 set_irq_wake(gpio_chip[bank].bank->id, state);
286 293
287 return 0; 294 return 0;
288} 295}
@@ -292,14 +299,14 @@ void at91_gpio_suspend(void)
292 int i; 299 int i;
293 300
294 for (i = 0; i < gpio_banks; i++) { 301 for (i = 0; i < gpio_banks; i++) {
295 void __iomem *pio = gpio[i].regbase; 302 void __iomem *pio = gpio_chip[i].regbase;
296 303
297 backups[i] = __raw_readl(pio + PIO_IMR); 304 backups[i] = __raw_readl(pio + PIO_IMR);
298 __raw_writel(backups[i], pio + PIO_IDR); 305 __raw_writel(backups[i], pio + PIO_IDR);
299 __raw_writel(wakeups[i], pio + PIO_IER); 306 __raw_writel(wakeups[i], pio + PIO_IER);
300 307
301 if (!wakeups[i]) 308 if (!wakeups[i])
302 clk_disable(gpio[i].clock); 309 clk_disable(gpio_chip[i].bank->clock);
303 else { 310 else {
304#ifdef CONFIG_PM_DEBUG 311#ifdef CONFIG_PM_DEBUG
305 printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]); 312 printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]);
@@ -313,10 +320,10 @@ void at91_gpio_resume(void)
313 int i; 320 int i;
314 321
315 for (i = 0; i < gpio_banks; i++) { 322 for (i = 0; i < gpio_banks; i++) {
316 void __iomem *pio = gpio[i].regbase; 323 void __iomem *pio = gpio_chip[i].regbase;
317 324
318 if (!wakeups[i]) 325 if (!wakeups[i])
319 clk_enable(gpio[i].clock); 326 clk_enable(gpio_chip[i].bank->clock);
320 327
321 __raw_writel(wakeups[i], pio + PIO_IDR); 328 __raw_writel(wakeups[i], pio + PIO_IDR);
322 __raw_writel(backups[i], pio + PIO_IER); 329 __raw_writel(backups[i], pio + PIO_IER);
@@ -380,12 +387,12 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
380{ 387{
381 unsigned pin; 388 unsigned pin;
382 struct irq_desc *gpio; 389 struct irq_desc *gpio;
383 struct at91_gpio_bank *bank; 390 struct at91_gpio_chip *at91_gpio;
384 void __iomem *pio; 391 void __iomem *pio;
385 u32 isr; 392 u32 isr;
386 393
387 bank = get_irq_chip_data(irq); 394 at91_gpio = get_irq_chip_data(irq);
388 pio = bank->regbase; 395 pio = at91_gpio->regbase;
389 396
390 /* temporarily mask (level sensitive) parent IRQ */ 397 /* temporarily mask (level sensitive) parent IRQ */
391 desc->chip->ack(irq); 398 desc->chip->ack(irq);
@@ -396,14 +403,14 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
396 */ 403 */
397 isr = __raw_readl(pio + PIO_ISR) & __raw_readl(pio + PIO_IMR); 404 isr = __raw_readl(pio + PIO_ISR) & __raw_readl(pio + PIO_IMR);
398 if (!isr) { 405 if (!isr) {
399 if (!bank->next) 406 if (!at91_gpio->next)
400 break; 407 break;
401 bank = bank->next; 408 at91_gpio = at91_gpio->next;
402 pio = bank->regbase; 409 pio = at91_gpio->regbase;
403 continue; 410 continue;
404 } 411 }
405 412
406 pin = bank->chipbase; 413 pin = at91_gpio->chip.base;
407 gpio = &irq_desc[pin]; 414 gpio = &irq_desc[pin];
408 415
409 while (isr) { 416 while (isr) {
@@ -502,17 +509,17 @@ static struct lock_class_key gpio_lock_class;
502void __init at91_gpio_irq_setup(void) 509void __init at91_gpio_irq_setup(void)
503{ 510{
504 unsigned pioc, pin; 511 unsigned pioc, pin;
505 struct at91_gpio_bank *this, *prev; 512 struct at91_gpio_chip *this, *prev;
506 513
507 for (pioc = 0, pin = PIN_BASE, this = gpio, prev = NULL; 514 for (pioc = 0, pin = PIN_BASE, this = gpio_chip, prev = NULL;
508 pioc++ < gpio_banks; 515 pioc++ < gpio_banks;
509 prev = this, this++) { 516 prev = this, this++) {
510 unsigned id = this->id; 517 unsigned id = this->bank->id;
511 unsigned i; 518 unsigned i;
512 519
513 __raw_writel(~0, this->regbase + PIO_IDR); 520 __raw_writel(~0, this->regbase + PIO_IDR);
514 521
515 for (i = 0, pin = this->chipbase; i < 32; i++, pin++) { 522 for (i = 0, pin = this->chip.base; i < 32; i++, pin++) {
516 lockdep_set_class(&irq_desc[pin].lock, &gpio_lock_class); 523 lockdep_set_class(&irq_desc[pin].lock, &gpio_lock_class);
517 524
518 /* 525 /*
@@ -537,32 +544,117 @@ void __init at91_gpio_irq_setup(void)
537 pr_info("AT91: %d gpio irqs in %d banks\n", pin - PIN_BASE, gpio_banks); 544 pr_info("AT91: %d gpio irqs in %d banks\n", pin - PIN_BASE, gpio_banks);
538} 545}
539 546
547/* gpiolib support */
548static int at91_gpiolib_direction_input(struct gpio_chip *chip,
549 unsigned offset)
550{
551 struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
552 void __iomem *pio = at91_gpio->regbase;
553 unsigned mask = 1 << offset;
554
555 __raw_writel(mask, pio + PIO_ODR);
556 return 0;
557}
558
559static int at91_gpiolib_direction_output(struct gpio_chip *chip,
560 unsigned offset, int val)
561{
562 struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
563 void __iomem *pio = at91_gpio->regbase;
564 unsigned mask = 1 << offset;
565
566 __raw_writel(mask, pio + (val ? PIO_SODR : PIO_CODR));
567 __raw_writel(mask, pio + PIO_OER);
568 return 0;
569}
570
571static int at91_gpiolib_get(struct gpio_chip *chip, unsigned offset)
572{
573 struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
574 void __iomem *pio = at91_gpio->regbase;
575 unsigned mask = 1 << offset;
576 u32 pdsr;
577
578 pdsr = __raw_readl(pio + PIO_PDSR);
579 return (pdsr & mask) != 0;
580}
581
582static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val)
583{
584 struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);
585 void __iomem *pio = at91_gpio->regbase;
586 unsigned mask = 1 << offset;
587
588 __raw_writel(mask, pio + (val ? PIO_SODR : PIO_CODR));
589}
590
591static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset)
592{
593 unsigned pin = chip->base + offset;
594 void __iomem *pio = pin_to_controller(pin);
595 unsigned mask = pin_to_mask(pin);
596
597 /* Cannot request GPIOs that are in alternate function mode */
598 if (!(__raw_readl(pio + PIO_PSR) & mask))
599 return -EPERM;
600
601 return 0;
602}
603
604static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
605{
606 int i;
607
608 for (i = 0; i < chip->ngpio; i++) {
609 unsigned pin = chip->base + i;
610 void __iomem *pio = pin_to_controller(pin);
611 unsigned mask = pin_to_mask(pin);
612 const char *gpio_label;
613
614 gpio_label = gpiochip_is_requested(chip, i);
615 if (gpio_label) {
616 seq_printf(s, "[%s] GPIO%s%d: ",
617 gpio_label, chip->label, i);
618 if (__raw_readl(pio + PIO_PSR) & mask)
619 seq_printf(s, "[gpio] %s\n",
620 at91_get_gpio_value(pin) ?
621 "set" : "clear");
622 else
623 seq_printf(s, "[periph %s]\n",
624 __raw_readl(pio + PIO_ABSR) &
625 mask ? "B" : "A");
626 }
627 }
628}
629
540/* 630/*
541 * Called from the processor-specific init to enable GPIO pin support. 631 * Called from the processor-specific init to enable GPIO pin support.
542 */ 632 */
543void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks) 633void __init at91_gpio_init(struct at91_gpio_bank *data, int nr_banks)
544{ 634{
545 unsigned i; 635 unsigned i;
546 struct at91_gpio_bank *last; 636 struct at91_gpio_chip *at91_gpio, *last = NULL;
547 637
548 BUG_ON(nr_banks > MAX_GPIO_BANKS); 638 BUG_ON(nr_banks > MAX_GPIO_BANKS);
549 639
550 gpio = data;
551 gpio_banks = nr_banks; 640 gpio_banks = nr_banks;
552 641
553 for (i = 0, last = NULL; i < nr_banks; i++, last = data, data++) { 642 for (i = 0; i < nr_banks; i++) {
554 data->chipbase = PIN_BASE + i * 32; 643 at91_gpio = &gpio_chip[i];
555 data->regbase = data->offset + (void __iomem *)AT91_VA_BASE_SYS; 644
645 at91_gpio->bank = &data[i];
646 at91_gpio->chip.base = PIN_BASE + i * 32;
647 at91_gpio->regbase = at91_gpio->bank->offset +
648 (void __iomem *)AT91_VA_BASE_SYS;
556 649
557 /* enable PIO controller's clock */ 650 /* enable PIO controller's clock */
558 clk_enable(data->clock); 651 clk_enable(at91_gpio->bank->clock);
559 652
560 /* 653 /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */
561 * Some processors share peripheral ID between multiple GPIO banks. 654 if (last && last->bank->id == at91_gpio->bank->id)
562 * SAM9263 (PIOC, PIOD, PIOE) 655 last->next = at91_gpio;
563 * CAP9 (PIOA, PIOB, PIOC, PIOD) 656 last = at91_gpio;
564 */ 657
565 if (last && last->id == data->id) 658 gpiochip_add(&at91_gpio->chip);
566 last->next = data;
567 } 659 }
568} 660}
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
index bffa6741a751..04c91e31c9c5 100644
--- a/arch/arm/mach-at91/include/mach/gpio.h
+++ b/arch/arm/mach-at91/include/mach/gpio.h
@@ -213,32 +213,12 @@ extern void at91_gpio_resume(void);
213 */ 213 */
214 214
215#include <asm/errno.h> 215#include <asm/errno.h>
216
217static inline int gpio_request(unsigned gpio, const char *label)
218{
219 return 0;
220}
221
222static inline void gpio_free(unsigned gpio)
223{
224 might_sleep();
225}
226
227extern int gpio_direction_input(unsigned gpio);
228extern int gpio_direction_output(unsigned gpio, int value);
229
230static inline int gpio_get_value(unsigned gpio)
231{
232 return at91_get_gpio_value(gpio);
233}
234
235static inline void gpio_set_value(unsigned gpio, int value)
236{
237 at91_set_gpio_value(gpio, value);
238}
239
240#include <asm-generic/gpio.h> /* cansleep wrappers */ 216#include <asm-generic/gpio.h> /* cansleep wrappers */
241 217
218#define gpio_get_value __gpio_get_value
219#define gpio_set_value __gpio_set_value
220#define gpio_cansleep __gpio_cansleep
221
242static inline int gpio_to_irq(unsigned gpio) 222static inline int gpio_to_irq(unsigned gpio)
243{ 223{
244 return gpio; 224 return gpio;
diff --git a/arch/arm/mach-at91/include/mach/system.h b/arch/arm/mach-at91/include/mach/system.h
index e712658d966c..5268af3933c2 100644
--- a/arch/arm/mach-at91/include/mach/system.h
+++ b/arch/arm/mach-at91/include/mach/system.h
@@ -43,7 +43,7 @@ static inline void arch_idle(void)
43 43
44void (*at91_arch_reset)(void); 44void (*at91_arch_reset)(void);
45 45
46static inline void arch_reset(char mode) 46static inline void arch_reset(char mode, const char *cmd)
47{ 47{
48 /* call the CPU-specific reset function */ 48 /* call the CPU-specific reset function */
49 if (at91_arch_reset) 49 if (at91_arch_reset)
diff --git a/arch/arm/mach-clps711x/include/mach/system.h b/arch/arm/mach-clps711x/include/mach/system.h
index 24e96159e3e7..f916cd7a477d 100644
--- a/arch/arm/mach-clps711x/include/mach/system.h
+++ b/arch/arm/mach-clps711x/include/mach/system.h
@@ -32,7 +32,7 @@ static inline void arch_idle(void)
32 mov r0, r0"); 32 mov r0, r0");
33} 33}
34 34
35static inline void arch_reset(char mode) 35static inline void arch_reset(char mode, const char *cmd)
36{ 36{
37 cpu_reset(0); 37 cpu_reset(0);
38} 38}
diff --git a/arch/arm/mach-davinci/include/mach/system.h b/arch/arm/mach-davinci/include/mach/system.h
index 17ca41dc2c53..b7e7036674fa 100644
--- a/arch/arm/mach-davinci/include/mach/system.h
+++ b/arch/arm/mach-davinci/include/mach/system.h
@@ -21,7 +21,7 @@ static void arch_idle(void)
21 cpu_do_idle(); 21 cpu_do_idle();
22} 22}
23 23
24static void arch_reset(char mode) 24static void arch_reset(char mode, const char *cmd)
25{ 25{
26 davinci_watchdog_reset(); 26 davinci_watchdog_reset();
27} 27}
diff --git a/arch/arm/mach-ebsa110/include/mach/system.h b/arch/arm/mach-ebsa110/include/mach/system.h
index 350a028997ef..9a26245bf1fc 100644
--- a/arch/arm/mach-ebsa110/include/mach/system.h
+++ b/arch/arm/mach-ebsa110/include/mach/system.h
@@ -34,6 +34,6 @@ static inline void arch_idle(void)
34 asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc"); 34 asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
35} 35}
36 36
37#define arch_reset(mode) cpu_reset(0x80000000) 37#define arch_reset(mode, cmd) cpu_reset(0x80000000)
38 38
39#endif 39#endif
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index 944e42d51646..9522e205b73f 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -1,7 +1,7 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4obj-y := core.o clock.o gpio.o 4obj-y := core.o clock.o dma-m2p.o gpio.o
5obj-m := 5obj-m :=
6obj-n := 6obj-n :=
7obj- := 7obj- :=
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index 96049283a10a..e8ebeaea6c48 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -41,6 +41,56 @@ static struct clk clk_usb_host = {
41 .enable_mask = EP93XX_SYSCON_CLOCK_USH_EN, 41 .enable_mask = EP93XX_SYSCON_CLOCK_USH_EN,
42}; 42};
43 43
44/* DMA Clocks */
45static struct clk clk_m2p0 = {
46 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
47 .enable_mask = 0x00020000,
48};
49static struct clk clk_m2p1 = {
50 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
51 .enable_mask = 0x00010000,
52};
53static struct clk clk_m2p2 = {
54 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
55 .enable_mask = 0x00080000,
56};
57static struct clk clk_m2p3 = {
58 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
59 .enable_mask = 0x00040000,
60};
61static struct clk clk_m2p4 = {
62 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
63 .enable_mask = 0x00200000,
64};
65static struct clk clk_m2p5 = {
66 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
67 .enable_mask = 0x00100000,
68};
69static struct clk clk_m2p6 = {
70 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
71 .enable_mask = 0x00800000,
72};
73static struct clk clk_m2p7 = {
74 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
75 .enable_mask = 0x00400000,
76};
77static struct clk clk_m2p8 = {
78 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
79 .enable_mask = 0x02000000,
80};
81static struct clk clk_m2p9 = {
82 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
83 .enable_mask = 0x01000000,
84};
85static struct clk clk_m2m0 = {
86 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
87 .enable_mask = 0x04000000,
88};
89static struct clk clk_m2m1 = {
90 .enable_reg = EP93XX_SYSCON_CLOCK_CONTROL,
91 .enable_mask = 0x08000000,
92};
93
44#define INIT_CK(dev,con,ck) \ 94#define INIT_CK(dev,con,ck) \
45 { .dev_id = dev, .con_id = con, .clk = ck } 95 { .dev_id = dev, .con_id = con, .clk = ck }
46 96
@@ -54,6 +104,18 @@ static struct clk_lookup clocks[] = {
54 INIT_CK(NULL, "pclk", &clk_p), 104 INIT_CK(NULL, "pclk", &clk_p),
55 INIT_CK(NULL, "pll2", &clk_pll2), 105 INIT_CK(NULL, "pll2", &clk_pll2),
56 INIT_CK(NULL, "usb_host", &clk_usb_host), 106 INIT_CK(NULL, "usb_host", &clk_usb_host),
107 INIT_CK(NULL, "m2p0", &clk_m2p0),
108 INIT_CK(NULL, "m2p1", &clk_m2p1),
109 INIT_CK(NULL, "m2p2", &clk_m2p2),
110 INIT_CK(NULL, "m2p3", &clk_m2p3),
111 INIT_CK(NULL, "m2p4", &clk_m2p4),
112 INIT_CK(NULL, "m2p5", &clk_m2p5),
113 INIT_CK(NULL, "m2p6", &clk_m2p6),
114 INIT_CK(NULL, "m2p7", &clk_m2p7),
115 INIT_CK(NULL, "m2p8", &clk_m2p8),
116 INIT_CK(NULL, "m2p9", &clk_m2p9),
117 INIT_CK(NULL, "m2m0", &clk_m2m0),
118 INIT_CK(NULL, "m2m1", &clk_m2m1),
57}; 119};
58 120
59 121
@@ -110,6 +172,22 @@ static unsigned long calc_pll_rate(u32 config_word)
110 return (unsigned long)rate; 172 return (unsigned long)rate;
111} 173}
112 174
175static void __init ep93xx_dma_clock_init(void)
176{
177 clk_m2p0.rate = clk_h.rate;
178 clk_m2p1.rate = clk_h.rate;
179 clk_m2p2.rate = clk_h.rate;
180 clk_m2p3.rate = clk_h.rate;
181 clk_m2p4.rate = clk_h.rate;
182 clk_m2p5.rate = clk_h.rate;
183 clk_m2p6.rate = clk_h.rate;
184 clk_m2p7.rate = clk_h.rate;
185 clk_m2p8.rate = clk_h.rate;
186 clk_m2p9.rate = clk_h.rate;
187 clk_m2m0.rate = clk_h.rate;
188 clk_m2m1.rate = clk_h.rate;
189}
190
113static int __init ep93xx_clock_init(void) 191static int __init ep93xx_clock_init(void)
114{ 192{
115 u32 value; 193 u32 value;
@@ -124,6 +202,7 @@ static int __init ep93xx_clock_init(void)
124 clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7]; 202 clk_f.rate = clk_pll1.rate / fclk_divisors[(value >> 25) & 0x7];
125 clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7]; 203 clk_h.rate = clk_pll1.rate / hclk_divisors[(value >> 20) & 0x7];
126 clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3]; 204 clk_p.rate = clk_h.rate / pclk_divisors[(value >> 18) & 0x3];
205 ep93xx_dma_clock_init();
127 206
128 value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2); 207 value = __raw_readl(EP93XX_SYSCON_CLOCK_SET2);
129 if (!(value & 0x00080000)) { /* PLL2 bypassed? */ 208 if (!(value & 0x00080000)) { /* PLL2 bypassed? */
diff --git a/arch/arm/mach-ep93xx/dma-m2p.c b/arch/arm/mach-ep93xx/dma-m2p.c
new file mode 100644
index 000000000000..a2df5bb7dff0
--- /dev/null
+++ b/arch/arm/mach-ep93xx/dma-m2p.c
@@ -0,0 +1,408 @@
1/*
2 * arch/arm/mach-ep93xx/dma-m2p.c
3 * M2P DMA handling for Cirrus EP93xx chips.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 * Copyright (C) 2006 Applied Data Systems
7 *
8 * Copyright (C) 2009 Ryan Mallon <ryan@bluewatersys.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 as published by
12 * the Free Software Foundation; either version 2 of the License, or (at
13 * your option) any later version.
14 */
15
16/*
17 * On the EP93xx chip the following peripherals my be allocated to the 10
18 * Memory to Internal Peripheral (M2P) channels (5 transmit + 5 receive).
19 *
20 * I2S contains 3 Tx and 3 Rx DMA Channels
21 * AAC contains 3 Tx and 3 Rx DMA Channels
22 * UART1 contains 1 Tx and 1 Rx DMA Channels
23 * UART2 contains 1 Tx and 1 Rx DMA Channels
24 * UART3 contains 1 Tx and 1 Rx DMA Channels
25 * IrDA contains 1 Tx and 1 Rx DMA Channels
26 *
27 * SSP and IDE use the Memory to Memory (M2M) channels and are not covered
28 * with this implementation.
29 */
30
31#include <linux/kernel.h>
32#include <linux/clk.h>
33#include <linux/err.h>
34#include <linux/interrupt.h>
35#include <linux/module.h>
36
37#include <mach/dma.h>
38#include <mach/hardware.h>
39
40#define M2P_CONTROL 0x00
41#define M2P_CONTROL_STALL_IRQ_EN (1 << 0)
42#define M2P_CONTROL_NFB_IRQ_EN (1 << 1)
43#define M2P_CONTROL_ERROR_IRQ_EN (1 << 3)
44#define M2P_CONTROL_ENABLE (1 << 4)
45#define M2P_INTERRUPT 0x04
46#define M2P_INTERRUPT_STALL (1 << 0)
47#define M2P_INTERRUPT_NFB (1 << 1)
48#define M2P_INTERRUPT_ERROR (1 << 3)
49#define M2P_PPALLOC 0x08
50#define M2P_STATUS 0x0c
51#define M2P_REMAIN 0x14
52#define M2P_MAXCNT0 0x20
53#define M2P_BASE0 0x24
54#define M2P_MAXCNT1 0x30
55#define M2P_BASE1 0x34
56
57#define STATE_IDLE 0 /* Channel is inactive. */
58#define STATE_STALL 1 /* Channel is active, no buffers pending. */
59#define STATE_ON 2 /* Channel is active, one buffer pending. */
60#define STATE_NEXT 3 /* Channel is active, two buffers pending. */
61
62struct m2p_channel {
63 char *name;
64 void __iomem *base;
65 int irq;
66
67 struct clk *clk;
68 spinlock_t lock;
69
70 void *client;
71 unsigned next_slot:1;
72 struct ep93xx_dma_buffer *buffer_xfer;
73 struct ep93xx_dma_buffer *buffer_next;
74 struct list_head buffers_pending;
75};
76
77static struct m2p_channel m2p_rx[] = {
78 {"m2p1", EP93XX_DMA_BASE + 0x0040, IRQ_EP93XX_DMAM2P1},
79 {"m2p3", EP93XX_DMA_BASE + 0x00c0, IRQ_EP93XX_DMAM2P3},
80 {"m2p5", EP93XX_DMA_BASE + 0x0200, IRQ_EP93XX_DMAM2P5},
81 {"m2p7", EP93XX_DMA_BASE + 0x0280, IRQ_EP93XX_DMAM2P7},
82 {"m2p9", EP93XX_DMA_BASE + 0x0300, IRQ_EP93XX_DMAM2P9},
83 {NULL},
84};
85
86static struct m2p_channel m2p_tx[] = {
87 {"m2p0", EP93XX_DMA_BASE + 0x0000, IRQ_EP93XX_DMAM2P0},
88 {"m2p2", EP93XX_DMA_BASE + 0x0080, IRQ_EP93XX_DMAM2P2},
89 {"m2p4", EP93XX_DMA_BASE + 0x0240, IRQ_EP93XX_DMAM2P4},
90 {"m2p6", EP93XX_DMA_BASE + 0x02c0, IRQ_EP93XX_DMAM2P6},
91 {"m2p8", EP93XX_DMA_BASE + 0x0340, IRQ_EP93XX_DMAM2P8},
92 {NULL},
93};
94
95static void feed_buf(struct m2p_channel *ch, struct ep93xx_dma_buffer *buf)
96{
97 if (ch->next_slot == 0) {
98 writel(buf->size, ch->base + M2P_MAXCNT0);
99 writel(buf->bus_addr, ch->base + M2P_BASE0);
100 } else {
101 writel(buf->size, ch->base + M2P_MAXCNT1);
102 writel(buf->bus_addr, ch->base + M2P_BASE1);
103 }
104 ch->next_slot ^= 1;
105}
106
107static void choose_buffer_xfer(struct m2p_channel *ch)
108{
109 struct ep93xx_dma_buffer *buf;
110
111 ch->buffer_xfer = NULL;
112 if (!list_empty(&ch->buffers_pending)) {
113 buf = list_entry(ch->buffers_pending.next,
114 struct ep93xx_dma_buffer, list);
115 list_del(&buf->list);
116 feed_buf(ch, buf);
117 ch->buffer_xfer = buf;
118 }
119}
120
121static void choose_buffer_next(struct m2p_channel *ch)
122{
123 struct ep93xx_dma_buffer *buf;
124
125 ch->buffer_next = NULL;
126 if (!list_empty(&ch->buffers_pending)) {
127 buf = list_entry(ch->buffers_pending.next,
128 struct ep93xx_dma_buffer, list);
129 list_del(&buf->list);
130 feed_buf(ch, buf);
131 ch->buffer_next = buf;
132 }
133}
134
135static inline void m2p_set_control(struct m2p_channel *ch, u32 v)
136{
137 /*
138 * The control register must be read immediately after being written so
139 * that the internal state machine is correctly updated. See the ep93xx
140 * users' guide for details.
141 */
142 writel(v, ch->base + M2P_CONTROL);
143 readl(ch->base + M2P_CONTROL);
144}
145
146static inline int m2p_channel_state(struct m2p_channel *ch)
147{
148 return (readl(ch->base + M2P_STATUS) >> 4) & 0x3;
149}
150
151static irqreturn_t m2p_irq(int irq, void *dev_id)
152{
153 struct m2p_channel *ch = dev_id;
154 struct ep93xx_dma_m2p_client *cl;
155 u32 irq_status, v;
156 int error = 0;
157
158 cl = ch->client;
159
160 spin_lock(&ch->lock);
161 irq_status = readl(ch->base + M2P_INTERRUPT);
162
163 if (irq_status & M2P_INTERRUPT_ERROR) {
164 writel(M2P_INTERRUPT_ERROR, ch->base + M2P_INTERRUPT);
165 error = 1;
166 }
167
168 if ((irq_status & (M2P_INTERRUPT_STALL | M2P_INTERRUPT_NFB)) == 0) {
169 spin_unlock(&ch->lock);
170 return IRQ_NONE;
171 }
172
173 switch (m2p_channel_state(ch)) {
174 case STATE_IDLE:
175 pr_crit("m2p_irq: dma interrupt without a dma buffer\n");
176 BUG();
177 break;
178
179 case STATE_STALL:
180 cl->buffer_finished(cl->cookie, ch->buffer_xfer, 0, error);
181 if (ch->buffer_next != NULL) {
182 cl->buffer_finished(cl->cookie, ch->buffer_next,
183 0, error);
184 }
185 choose_buffer_xfer(ch);
186 choose_buffer_next(ch);
187 if (ch->buffer_xfer != NULL)
188 cl->buffer_started(cl->cookie, ch->buffer_xfer);
189 break;
190
191 case STATE_ON:
192 cl->buffer_finished(cl->cookie, ch->buffer_xfer, 0, error);
193 ch->buffer_xfer = ch->buffer_next;
194 choose_buffer_next(ch);
195 cl->buffer_started(cl->cookie, ch->buffer_xfer);
196 break;
197
198 case STATE_NEXT:
199 pr_crit("m2p_irq: dma interrupt while next\n");
200 BUG();
201 break;
202 }
203
204 v = readl(ch->base + M2P_CONTROL) & ~(M2P_CONTROL_STALL_IRQ_EN |
205 M2P_CONTROL_NFB_IRQ_EN);
206 if (ch->buffer_xfer != NULL)
207 v |= M2P_CONTROL_STALL_IRQ_EN;
208 if (ch->buffer_next != NULL)
209 v |= M2P_CONTROL_NFB_IRQ_EN;
210 m2p_set_control(ch, v);
211
212 spin_unlock(&ch->lock);
213 return IRQ_HANDLED;
214}
215
216static struct m2p_channel *find_free_channel(struct ep93xx_dma_m2p_client *cl)
217{
218 struct m2p_channel *ch;
219 int i;
220
221 if (cl->flags & EP93XX_DMA_M2P_RX)
222 ch = m2p_rx;
223 else
224 ch = m2p_tx;
225
226 for (i = 0; ch[i].base; i++) {
227 struct ep93xx_dma_m2p_client *client;
228
229 client = ch[i].client;
230 if (client != NULL) {
231 int port;
232
233 port = cl->flags & EP93XX_DMA_M2P_PORT_MASK;
234 if (port == (client->flags &
235 EP93XX_DMA_M2P_PORT_MASK)) {
236 pr_warning("DMA channel already used by %s\n",
237 cl->name ? : "unknown client");
238 return ERR_PTR(-EBUSY);
239 }
240 }
241 }
242
243 for (i = 0; ch[i].base; i++) {
244 if (ch[i].client == NULL)
245 return ch + i;
246 }
247
248 pr_warning("No free DMA channel for %s\n",
249 cl->name ? : "unknown client");
250 return ERR_PTR(-ENODEV);
251}
252
253static void channel_enable(struct m2p_channel *ch)
254{
255 struct ep93xx_dma_m2p_client *cl = ch->client;
256 u32 v;
257
258 clk_enable(ch->clk);
259
260 v = cl->flags & EP93XX_DMA_M2P_PORT_MASK;
261 writel(v, ch->base + M2P_PPALLOC);
262
263 v = cl->flags & EP93XX_DMA_M2P_ERROR_MASK;
264 v |= M2P_CONTROL_ENABLE | M2P_CONTROL_ERROR_IRQ_EN;
265 m2p_set_control(ch, v);
266}
267
268static void channel_disable(struct m2p_channel *ch)
269{
270 u32 v;
271
272 v = readl(ch->base + M2P_CONTROL);
273 v &= ~(M2P_CONTROL_STALL_IRQ_EN | M2P_CONTROL_NFB_IRQ_EN);
274 m2p_set_control(ch, v);
275
276 while (m2p_channel_state(ch) == STATE_ON)
277 cpu_relax();
278
279 m2p_set_control(ch, 0x0);
280
281 while (m2p_channel_state(ch) == STATE_STALL)
282 cpu_relax();
283
284 clk_disable(ch->clk);
285}
286
287int ep93xx_dma_m2p_client_register(struct ep93xx_dma_m2p_client *cl)
288{
289 struct m2p_channel *ch;
290 int err;
291
292 ch = find_free_channel(cl);
293 if (IS_ERR(ch))
294 return PTR_ERR(ch);
295
296 err = request_irq(ch->irq, m2p_irq, 0, cl->name ? : "dma-m2p", ch);
297 if (err)
298 return err;
299
300 ch->client = cl;
301 ch->next_slot = 0;
302 ch->buffer_xfer = NULL;
303 ch->buffer_next = NULL;
304 INIT_LIST_HEAD(&ch->buffers_pending);
305
306 cl->channel = ch;
307
308 channel_enable(ch);
309
310 return 0;
311}
312EXPORT_SYMBOL_GPL(ep93xx_dma_m2p_client_register);
313
314void ep93xx_dma_m2p_client_unregister(struct ep93xx_dma_m2p_client *cl)
315{
316 struct m2p_channel *ch = cl->channel;
317
318 channel_disable(ch);
319 free_irq(ch->irq, ch);
320 ch->client = NULL;
321}
322EXPORT_SYMBOL_GPL(ep93xx_dma_m2p_client_unregister);
323
324void ep93xx_dma_m2p_submit(struct ep93xx_dma_m2p_client *cl,
325 struct ep93xx_dma_buffer *buf)
326{
327 struct m2p_channel *ch = cl->channel;
328 unsigned long flags;
329 u32 v;
330
331 spin_lock_irqsave(&ch->lock, flags);
332 v = readl(ch->base + M2P_CONTROL);
333 if (ch->buffer_xfer == NULL) {
334 ch->buffer_xfer = buf;
335 feed_buf(ch, buf);
336 cl->buffer_started(cl->cookie, buf);
337
338 v |= M2P_CONTROL_STALL_IRQ_EN;
339 m2p_set_control(ch, v);
340
341 } else if (ch->buffer_next == NULL) {
342 ch->buffer_next = buf;
343 feed_buf(ch, buf);
344
345 v |= M2P_CONTROL_NFB_IRQ_EN;
346 m2p_set_control(ch, v);
347 } else {
348 list_add_tail(&buf->list, &ch->buffers_pending);
349 }
350 spin_unlock_irqrestore(&ch->lock, flags);
351}
352EXPORT_SYMBOL_GPL(ep93xx_dma_m2p_submit);
353
354void ep93xx_dma_m2p_submit_recursive(struct ep93xx_dma_m2p_client *cl,
355 struct ep93xx_dma_buffer *buf)
356{
357 struct m2p_channel *ch = cl->channel;
358
359 list_add_tail(&buf->list, &ch->buffers_pending);
360}
361EXPORT_SYMBOL_GPL(ep93xx_dma_m2p_submit_recursive);
362
363void ep93xx_dma_m2p_flush(struct ep93xx_dma_m2p_client *cl)
364{
365 struct m2p_channel *ch = cl->channel;
366
367 channel_disable(ch);
368 ch->next_slot = 0;
369 ch->buffer_xfer = NULL;
370 ch->buffer_next = NULL;
371 INIT_LIST_HEAD(&ch->buffers_pending);
372 channel_enable(ch);
373}
374EXPORT_SYMBOL_GPL(ep93xx_dma_m2p_flush);
375
376static int init_channel(struct m2p_channel *ch)
377{
378 ch->clk = clk_get(NULL, ch->name);
379 if (IS_ERR(ch->clk))
380 return PTR_ERR(ch->clk);
381
382 spin_lock_init(&ch->lock);
383 ch->client = NULL;
384
385 return 0;
386}
387
388static int __init ep93xx_dma_m2p_init(void)
389{
390 int i;
391 int ret;
392
393 for (i = 0; m2p_rx[i].base; i++) {
394 ret = init_channel(m2p_rx + i);
395 if (ret)
396 return ret;
397 }
398
399 for (i = 0; m2p_tx[i].base; i++) {
400 ret = init_channel(m2p_tx + i);
401 if (ret)
402 return ret;
403 }
404
405 pr_info("M2P DMA subsystem initialized\n");
406 return 0;
407}
408arch_initcall(ep93xx_dma_m2p_init);
diff --git a/arch/arm/mach-ep93xx/edb9307a.c b/arch/arm/mach-ep93xx/edb9307a.c
index 5b5c22b681be..6171167d3315 100644
--- a/arch/arm/mach-ep93xx/edb9307a.c
+++ b/arch/arm/mach-ep93xx/edb9307a.c
@@ -48,12 +48,24 @@ static struct ep93xx_eth_data edb9307a_eth_data = {
48 .phy_id = 1, 48 .phy_id = 1,
49}; 49};
50 50
51static struct i2c_board_info __initdata edb9307a_i2c_data[] = {
52 {
53 /* On-board battery backed RTC */
54 I2C_BOARD_INFO("isl1208", 0x6f),
55 },
56 /*
57 * The I2C signals are also routed to the Expansion Connector (J4)
58 */
59};
60
51static void __init edb9307a_init_machine(void) 61static void __init edb9307a_init_machine(void)
52{ 62{
53 ep93xx_init_devices(); 63 ep93xx_init_devices();
54 platform_device_register(&edb9307a_flash); 64 platform_device_register(&edb9307a_flash);
55 65
56 ep93xx_register_eth(&edb9307a_eth_data, 1); 66 ep93xx_register_eth(&edb9307a_eth_data, 1);
67
68 ep93xx_init_i2c(edb9307a_i2c_data, ARRAY_SIZE(edb9307a_i2c_data));
57} 69}
58 70
59MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board") 71MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
diff --git a/arch/arm/mach-ep93xx/include/mach/dma.h b/arch/arm/mach-ep93xx/include/mach/dma.h
new file mode 100644
index 000000000000..ef6bd9d13148
--- /dev/null
+++ b/arch/arm/mach-ep93xx/include/mach/dma.h
@@ -0,0 +1,52 @@
1#ifndef __ASM_ARCH_DMA_H
2#define __ASM_ARCH_DMA_H
3
4#include <linux/list.h>
5#include <linux/types.h>
6
7struct ep93xx_dma_buffer {
8 struct list_head list;
9 u32 bus_addr;
10 u16 size;
11};
12
13struct ep93xx_dma_m2p_client {
14 char *name;
15 u8 flags;
16 void *cookie;
17 void (*buffer_started)(void *cookie,
18 struct ep93xx_dma_buffer *buf);
19 void (*buffer_finished)(void *cookie,
20 struct ep93xx_dma_buffer *buf,
21 int bytes, int error);
22
23 /* Internal to the DMA code. */
24 void *channel;
25};
26
27#define EP93XX_DMA_M2P_PORT_I2S1 0x00
28#define EP93XX_DMA_M2P_PORT_I2S2 0x01
29#define EP93XX_DMA_M2P_PORT_AAC1 0x02
30#define EP93XX_DMA_M2P_PORT_AAC2 0x03
31#define EP93XX_DMA_M2P_PORT_AAC3 0x04
32#define EP93XX_DMA_M2P_PORT_I2S3 0x05
33#define EP93XX_DMA_M2P_PORT_UART1 0x06
34#define EP93XX_DMA_M2P_PORT_UART2 0x07
35#define EP93XX_DMA_M2P_PORT_UART3 0x08
36#define EP93XX_DMA_M2P_PORT_IRDA 0x09
37#define EP93XX_DMA_M2P_PORT_MASK 0x0f
38#define EP93XX_DMA_M2P_TX 0x00
39#define EP93XX_DMA_M2P_RX 0x10
40#define EP93XX_DMA_M2P_ABORT_ON_ERROR 0x20
41#define EP93XX_DMA_M2P_IGNORE_ERROR 0x40
42#define EP93XX_DMA_M2P_ERROR_MASK 0x60
43
44int ep93xx_dma_m2p_client_register(struct ep93xx_dma_m2p_client *m2p);
45void ep93xx_dma_m2p_client_unregister(struct ep93xx_dma_m2p_client *m2p);
46void ep93xx_dma_m2p_submit(struct ep93xx_dma_m2p_client *m2p,
47 struct ep93xx_dma_buffer *buf);
48void ep93xx_dma_m2p_submit_recursive(struct ep93xx_dma_m2p_client *m2p,
49 struct ep93xx_dma_buffer *buf);
50void ep93xx_dma_m2p_flush(struct ep93xx_dma_m2p_client *m2p);
51
52#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index 22d6c9a6e4ca..f66be12b856e 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -58,7 +58,8 @@
58 58
59 59
60/* AHB peripherals */ 60/* AHB peripherals */
61#define EP93XX_DMA_BASE (EP93XX_AHB_VIRT_BASE + 0x00000000) 61#define EP93XX_DMA_BASE ((void __iomem *) \
62 (EP93XX_AHB_VIRT_BASE + 0x00000000))
62 63
63#define EP93XX_ETHERNET_BASE (EP93XX_AHB_VIRT_BASE + 0x00010000) 64#define EP93XX_ETHERNET_BASE (EP93XX_AHB_VIRT_BASE + 0x00010000)
64#define EP93XX_ETHERNET_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00010000) 65#define EP93XX_ETHERNET_PHYS_BASE (EP93XX_AHB_PHYS_BASE + 0x00010000)
diff --git a/arch/arm/mach-ep93xx/include/mach/system.h b/arch/arm/mach-ep93xx/include/mach/system.h
index 67789d0f329e..ed8f35e4f068 100644
--- a/arch/arm/mach-ep93xx/include/mach/system.h
+++ b/arch/arm/mach-ep93xx/include/mach/system.h
@@ -9,7 +9,7 @@ static inline void arch_idle(void)
9 cpu_do_idle(); 9 cpu_do_idle();
10} 10}
11 11
12static inline void arch_reset(char mode) 12static inline void arch_reset(char mode, const char *cmd)
13{ 13{
14 u32 devicecfg; 14 u32 devicecfg;
15 15
diff --git a/arch/arm/mach-footbridge/dma.c b/arch/arm/mach-footbridge/dma.c
index 4f3506346969..e2e0df8bcee2 100644
--- a/arch/arm/mach-footbridge/dma.c
+++ b/arch/arm/mach-footbridge/dma.c
@@ -21,16 +21,16 @@
21#include <asm/hardware/dec21285.h> 21#include <asm/hardware/dec21285.h>
22 22
23#if 0 23#if 0
24static int fb_dma_request(dmach_t channel, dma_t *dma) 24static int fb_dma_request(unsigned int chan, dma_t *dma)
25{ 25{
26 return -EINVAL; 26 return -EINVAL;
27} 27}
28 28
29static void fb_dma_enable(dmach_t channel, dma_t *dma) 29static void fb_dma_enable(unsigned int chan, dma_t *dma)
30{ 30{
31} 31}
32 32
33static void fb_dma_disable(dmach_t channel, dma_t *dma) 33static void fb_dma_disable(unsigned int chan, dma_t *dma)
34{ 34{
35} 35}
36 36
@@ -42,7 +42,7 @@ static struct dma_ops fb_dma_ops = {
42}; 42};
43#endif 43#endif
44 44
45void __init arch_dma_init(dma_t *dma) 45static int __init fb_dma_init(void)
46{ 46{
47#if 0 47#if 0
48 dma[_DC21285_DMA(0)].d_ops = &fb_dma_ops; 48 dma[_DC21285_DMA(0)].d_ops = &fb_dma_ops;
@@ -50,6 +50,8 @@ void __init arch_dma_init(dma_t *dma)
50#endif 50#endif
51#ifdef CONFIG_ISA_DMA 51#ifdef CONFIG_ISA_DMA
52 if (footbridge_cfn_mode()) 52 if (footbridge_cfn_mode())
53 isa_init_dma(dma + _ISA_DMA(0)); 53 isa_init_dma();
54#endif 54#endif
55 return 0;
55} 56}
57core_initcall(fb_dma_init);
diff --git a/arch/arm/mach-footbridge/include/mach/system.h b/arch/arm/mach-footbridge/include/mach/system.h
index 2db7f36bd6ca..0b2931566209 100644
--- a/arch/arm/mach-footbridge/include/mach/system.h
+++ b/arch/arm/mach-footbridge/include/mach/system.h
@@ -18,7 +18,7 @@ static inline void arch_idle(void)
18 cpu_do_idle(); 18 cpu_do_idle();
19} 19}
20 20
21static inline void arch_reset(char mode) 21static inline void arch_reset(char mode, const char *cmd)
22{ 22{
23 if (mode == 's') { 23 if (mode == 's') {
24 /* 24 /*
diff --git a/arch/arm/mach-gemini/Kconfig b/arch/arm/mach-gemini/Kconfig
new file mode 100644
index 000000000000..515b75cf2e8b
--- /dev/null
+++ b/arch/arm/mach-gemini/Kconfig
@@ -0,0 +1,19 @@
1if ARCH_GEMINI
2
3menu "Cortina Systems Gemini Implementations"
4
5config MACH_RUT100
6 bool "Teltonika RUT100"
7 select GEMINI_MEM_SWAP
8 help
9 Say Y here if you intend to run this kernel on a
10 Teltonika 3G Router RUT100.
11
12endmenu
13
14config GEMINI_MEM_SWAP
15 bool "Gemini memory is swapped"
16 help
17 Say Y here if Gemini memory is swapped by bootloader.
18
19endif
diff --git a/arch/arm/mach-gemini/Makefile b/arch/arm/mach-gemini/Makefile
new file mode 100644
index 000000000000..719505b81821
--- /dev/null
+++ b/arch/arm/mach-gemini/Makefile
@@ -0,0 +1,10 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := irq.o mm.o time.o devices.o gpio.o
8
9# Board-specific support
10obj-$(CONFIG_MACH_RUT100) += board-rut1xx.o
diff --git a/arch/arm/mach-gemini/Makefile.boot b/arch/arm/mach-gemini/Makefile.boot
new file mode 100644
index 000000000000..22a52c228d93
--- /dev/null
+++ b/arch/arm/mach-gemini/Makefile.boot
@@ -0,0 +1,9 @@
1ifeq ($(CONFIG_GEMINI_MEM_SWAP),y)
2 zreladdr-y := 0x00008000
3params_phys-y := 0x00000100
4initrd_phys-y := 0x00800000
5else
6 zreladdr-y := 0x10008000
7params_phys-y := 0x10000100
8initrd_phys-y := 0x10800000
9endif
diff --git a/arch/arm/mach-gemini/board-rut1xx.c b/arch/arm/mach-gemini/board-rut1xx.c
new file mode 100644
index 000000000000..e0de968e32a6
--- /dev/null
+++ b/arch/arm/mach-gemini/board-rut1xx.c
@@ -0,0 +1,95 @@
1/*
2 * Support for Teltonika RUT1xx
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/leds.h>
15#include <linux/input.h>
16#include <linux/gpio_keys.h>
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/time.h>
21
22#include "common.h"
23
24static struct gpio_keys_button rut1xx_keys[] = {
25 {
26 .code = KEY_SETUP,
27 .gpio = 60,
28 .active_low = 1,
29 .desc = "Reset to defaults",
30 .type = EV_KEY,
31 },
32};
33
34static struct gpio_keys_platform_data rut1xx_keys_data = {
35 .buttons = rut1xx_keys,
36 .nbuttons = ARRAY_SIZE(rut1xx_keys),
37};
38
39static struct platform_device rut1xx_keys_device = {
40 .name = "gpio-keys",
41 .id = -1,
42 .dev = {
43 .platform_data = &rut1xx_keys_data,
44 },
45};
46
47static struct gpio_led rut100_leds[] = {
48 {
49 .name = "Power",
50 .default_trigger = "heartbeat",
51 .gpio = 17,
52 },
53 {
54 .name = "GSM",
55 .default_trigger = "default-on",
56 .gpio = 7,
57 .active_low = 1,
58 },
59};
60
61static struct gpio_led_platform_data rut100_leds_data = {
62 .num_leds = ARRAY_SIZE(rut100_leds),
63 .leds = rut100_leds,
64};
65
66static struct platform_device rut1xx_leds = {
67 .name = "leds-gpio",
68 .id = -1,
69 .dev = {
70 .platform_data = &rut100_leds_data,
71 },
72};
73
74static struct sys_timer rut1xx_timer = {
75 .init = gemini_timer_init,
76};
77
78static void __init rut1xx_init(void)
79{
80 gemini_gpio_init();
81 platform_register_uart();
82 platform_register_pflash(SZ_8M, NULL, 0);
83 platform_device_register(&rut1xx_leds);
84 platform_device_register(&rut1xx_keys_device);
85}
86
87MACHINE_START(RUT100, "Teltonika RUT100")
88 .phys_io = 0x7fffc000,
89 .io_pg_offst = ((0xffffc000) >> 18) & 0xfffc,
90 .boot_params = 0x100,
91 .map_io = gemini_map_io,
92 .init_irq = gemini_init_irq,
93 .timer = &rut1xx_timer,
94 .init_machine = rut1xx_init,
95MACHINE_END
diff --git a/arch/arm/mach-gemini/common.h b/arch/arm/mach-gemini/common.h
new file mode 100644
index 000000000000..9392834a214f
--- /dev/null
+++ b/arch/arm/mach-gemini/common.h
@@ -0,0 +1,28 @@
1/*
2 * Common Gemini architecture functions
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#ifndef __GEMINI_COMMON_H__
13#define __GEMINI_COMMON_H__
14
15struct mtd_partition;
16
17extern void gemini_map_io(void);
18extern void gemini_init_irq(void);
19extern void gemini_timer_init(void);
20extern void gemini_gpio_init(void);
21
22/* Common platform devices registration functions */
23extern int platform_register_uart(void);
24extern int platform_register_pflash(unsigned int size,
25 struct mtd_partition *parts,
26 unsigned int nr_parts);
27
28#endif /* __GEMINI_COMMON_H__ */
diff --git a/arch/arm/mach-gemini/devices.c b/arch/arm/mach-gemini/devices.c
new file mode 100644
index 000000000000..6b525253d027
--- /dev/null
+++ b/arch/arm/mach-gemini/devices.c
@@ -0,0 +1,92 @@
1/*
2 * Common devices definition for Gemini
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/io.h>
13#include <linux/platform_device.h>
14#include <linux/serial_8250.h>
15#include <linux/mtd/physmap.h>
16
17#include <mach/irqs.h>
18#include <mach/hardware.h>
19#include <mach/global_reg.h>
20
21static struct plat_serial8250_port serial_platform_data[] = {
22 {
23 .membase = (void *)IO_ADDRESS(GEMINI_UART_BASE),
24 .mapbase = GEMINI_UART_BASE,
25 .irq = IRQ_UART,
26 .uartclk = UART_CLK,
27 .regshift = 2,
28 .iotype = UPIO_MEM,
29 .type = PORT_16550A,
30 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_FIXED_TYPE,
31 },
32 {},
33};
34
35static struct platform_device serial_device = {
36 .name = "serial8250",
37 .id = PLAT8250_DEV_PLATFORM,
38 .dev = {
39 .platform_data = serial_platform_data,
40 },
41};
42
43int platform_register_uart(void)
44{
45 return platform_device_register(&serial_device);
46}
47
48static struct resource flash_resource = {
49 .start = GEMINI_FLASH_BASE,
50 .flags = IORESOURCE_MEM,
51};
52
53static struct physmap_flash_data pflash_platform_data = {};
54
55static struct platform_device pflash_device = {
56 .name = "physmap-flash",
57 .id = 0,
58 .dev = {
59 .platform_data = &pflash_platform_data,
60 },
61 .resource = &flash_resource,
62 .num_resources = 1,
63};
64
65int platform_register_pflash(unsigned int size, struct mtd_partition *parts,
66 unsigned int nr_parts)
67{
68 unsigned int reg;
69
70 reg = __raw_readl(IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_STATUS);
71
72 if ((reg & FLASH_TYPE_MASK) != FLASH_TYPE_PARALLEL)
73 return -ENXIO;
74
75 if (reg & FLASH_WIDTH_16BIT)
76 pflash_platform_data.width = 2;
77 else
78 pflash_platform_data.width = 1;
79
80 /* enable parallel flash pins and disable others */
81 reg = __raw_readl(IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_MISC_CTRL);
82 reg &= ~PFLASH_PADS_DISABLE;
83 reg |= SFLASH_PADS_DISABLE | NAND_PADS_DISABLE;
84 __raw_writel(reg, IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_MISC_CTRL);
85
86 flash_resource.end = flash_resource.start + size - 1;
87
88 pflash_platform_data.parts = parts;
89 pflash_platform_data.nr_parts = nr_parts;
90
91 return platform_device_register(&pflash_device);
92}
diff --git a/arch/arm/mach-gemini/gpio.c b/arch/arm/mach-gemini/gpio.c
new file mode 100644
index 000000000000..e7263854bc7b
--- /dev/null
+++ b/arch/arm/mach-gemini/gpio.c
@@ -0,0 +1,232 @@
1/*
2 * Gemini gpiochip and interrupt routines
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
5 *
6 * Based on plat-mxc/gpio.c:
7 * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
8 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
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
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/io.h>
19#include <linux/irq.h>
20#include <linux/gpio.h>
21
22#include <mach/hardware.h>
23#include <mach/irqs.h>
24
25#define GPIO_BASE(x) IO_ADDRESS(GEMINI_GPIO_BASE(x))
26
27/* GPIO registers definition */
28#define GPIO_DATA_OUT 0x0
29#define GPIO_DATA_IN 0x4
30#define GPIO_DIR 0x8
31#define GPIO_DATA_SET 0x10
32#define GPIO_DATA_CLR 0x14
33#define GPIO_PULL_EN 0x18
34#define GPIO_PULL_TYPE 0x1C
35#define GPIO_INT_EN 0x20
36#define GPIO_INT_STAT 0x24
37#define GPIO_INT_MASK 0x2C
38#define GPIO_INT_CLR 0x30
39#define GPIO_INT_TYPE 0x34
40#define GPIO_INT_BOTH_EDGE 0x38
41#define GPIO_INT_LEVEL 0x3C
42#define GPIO_DEBOUNCE_EN 0x40
43#define GPIO_DEBOUNCE_PRESCALE 0x44
44
45#define GPIO_PORT_NUM 3
46
47static void _set_gpio_irqenable(unsigned int base, unsigned int index,
48 int enable)
49{
50 unsigned int reg;
51
52 reg = __raw_readl(base + GPIO_INT_EN);
53 reg = (reg & (~(1 << index))) | (!!enable << index);
54 __raw_writel(reg, base + GPIO_INT_EN);
55}
56
57static void gpio_ack_irq(unsigned int irq)
58{
59 unsigned int gpio = irq_to_gpio(irq);
60 unsigned int base = GPIO_BASE(gpio / 32);
61
62 __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR);
63}
64
65static void gpio_mask_irq(unsigned int irq)
66{
67 unsigned int gpio = irq_to_gpio(irq);
68 unsigned int base = GPIO_BASE(gpio / 32);
69
70 _set_gpio_irqenable(base, gpio % 32, 0);
71}
72
73static void gpio_unmask_irq(unsigned int irq)
74{
75 unsigned int gpio = irq_to_gpio(irq);
76 unsigned int base = GPIO_BASE(gpio / 32);
77
78 _set_gpio_irqenable(base, gpio % 32, 1);
79}
80
81static int gpio_set_irq_type(unsigned int irq, unsigned int type)
82{
83 unsigned int gpio = irq_to_gpio(irq);
84 unsigned int gpio_mask = 1 << (gpio % 32);
85 unsigned int base = GPIO_BASE(gpio / 32);
86 unsigned int reg_both, reg_level, reg_type;
87
88 reg_type = __raw_readl(base + GPIO_INT_TYPE);
89 reg_level = __raw_readl(base + GPIO_INT_BOTH_EDGE);
90 reg_both = __raw_readl(base + GPIO_INT_BOTH_EDGE);
91
92 switch (type) {
93 case IRQ_TYPE_EDGE_BOTH:
94 reg_type &= ~gpio_mask;
95 reg_both |= gpio_mask;
96 break;
97 case IRQ_TYPE_EDGE_RISING:
98 reg_type &= ~gpio_mask;
99 reg_both &= ~gpio_mask;
100 reg_level &= ~gpio_mask;
101 break;
102 case IRQ_TYPE_EDGE_FALLING:
103 reg_type &= ~gpio_mask;
104 reg_both &= ~gpio_mask;
105 reg_level |= gpio_mask;
106 break;
107 case IRQ_TYPE_LEVEL_HIGH:
108 reg_type |= gpio_mask;
109 reg_level &= ~gpio_mask;
110 break;
111 case IRQ_TYPE_LEVEL_LOW:
112 reg_type |= gpio_mask;
113 reg_level |= gpio_mask;
114 break;
115 default:
116 return -EINVAL;
117 }
118
119 __raw_writel(reg_type, base + GPIO_INT_TYPE);
120 __raw_writel(reg_level, base + GPIO_INT_BOTH_EDGE);
121 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE);
122
123 gpio_ack_irq(irq);
124
125 return 0;
126}
127
128static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
129{
130 unsigned int gpio_irq_no, irq_stat;
131 unsigned int port = (unsigned int)get_irq_data(irq);
132
133 irq_stat = __raw_readl(GPIO_BASE(port) + GPIO_INT_STAT);
134
135 gpio_irq_no = GPIO_IRQ_BASE + port * 32;
136 for (; irq_stat != 0; irq_stat >>= 1, gpio_irq_no++) {
137
138 if ((irq_stat & 1) == 0)
139 continue;
140
141 BUG_ON(!(irq_desc[gpio_irq_no].handle_irq));
142 irq_desc[gpio_irq_no].handle_irq(gpio_irq_no,
143 &irq_desc[gpio_irq_no]);
144 }
145}
146
147static struct irq_chip gpio_irq_chip = {
148 .name = "GPIO",
149 .ack = gpio_ack_irq,
150 .mask = gpio_mask_irq,
151 .unmask = gpio_unmask_irq,
152 .set_type = gpio_set_irq_type,
153};
154
155static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
156 int dir)
157{
158 unsigned int base = GPIO_BASE(offset / 32);
159 unsigned int reg;
160
161 reg = __raw_readl(base + GPIO_DIR);
162 if (dir)
163 reg |= 1 << (offset % 32);
164 else
165 reg &= ~(1 << (offset % 32));
166 __raw_writel(reg, base + GPIO_DIR);
167}
168
169static void gemini_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
170{
171 unsigned int base = GPIO_BASE(offset / 32);
172
173 if (value)
174 __raw_writel(1 << (offset % 32), base + GPIO_DATA_SET);
175 else
176 __raw_writel(1 << (offset % 32), base + GPIO_DATA_CLR);
177}
178
179static int gemini_gpio_get(struct gpio_chip *chip, unsigned offset)
180{
181 unsigned int base = GPIO_BASE(offset / 32);
182
183 return (__raw_readl(base + GPIO_DATA_IN) >> (offset % 32)) & 1;
184}
185
186static int gemini_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
187{
188 _set_gpio_direction(chip, offset, 0);
189 return 0;
190}
191
192static int gemini_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
193 int value)
194{
195 _set_gpio_direction(chip, offset, 1);
196 gemini_gpio_set(chip, offset, value);
197 return 0;
198}
199
200static struct gpio_chip gemini_gpio_chip = {
201 .label = "Gemini",
202 .direction_input = gemini_gpio_direction_input,
203 .get = gemini_gpio_get,
204 .direction_output = gemini_gpio_direction_output,
205 .set = gemini_gpio_set,
206 .base = 0,
207 .ngpio = GPIO_PORT_NUM * 32,
208};
209
210void __init gemini_gpio_init(void)
211{
212 int i, j;
213
214 for (i = 0; i < GPIO_PORT_NUM; i++) {
215 /* disable, unmask and clear all interrupts */
216 __raw_writel(0x0, GPIO_BASE(i) + GPIO_INT_EN);
217 __raw_writel(0x0, GPIO_BASE(i) + GPIO_INT_MASK);
218 __raw_writel(~0x0, GPIO_BASE(i) + GPIO_INT_CLR);
219
220 for (j = GPIO_IRQ_BASE + i * 32;
221 j < GPIO_IRQ_BASE + (i + 1) * 32; j++) {
222 set_irq_chip(j, &gpio_irq_chip);
223 set_irq_handler(j, handle_edge_irq);
224 set_irq_flags(j, IRQF_VALID);
225 }
226
227 set_irq_chained_handler(IRQ_GPIO(i), gpio_irq_handler);
228 set_irq_data(IRQ_GPIO(i), (void *)i);
229 }
230
231 BUG_ON(gpiochip_add(&gemini_gpio_chip));
232}
diff --git a/arch/arm/mach-gemini/include/mach/debug-macro.S b/arch/arm/mach-gemini/include/mach/debug-macro.S
new file mode 100644
index 000000000000..d04a6eaeae14
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/debug-macro.S
@@ -0,0 +1,23 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 1994-1999 Russell King
5 * Copyright (C) 2001-2006 Storlink, Corp.
6 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <mach/hardware.h>
13
14 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 ldreq \rx, =GEMINI_UART_BASE @ physical
18 ldrne \rx, =IO_ADDRESS(GEMINI_UART_BASE) @ virtual
19 .endm
20
21#define UART_SHIFT 2
22#define FLOW_CONTROL
23#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-gemini/include/mach/entry-macro.S b/arch/arm/mach-gemini/include/mach/entry-macro.S
new file mode 100644
index 000000000000..1624f91a2b8b
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/entry-macro.S
@@ -0,0 +1,39 @@
1/*
2 * Low-level IRQ helper macros for Gemini platform.
3 *
4 * Copyright (C) 2001-2006 Storlink, Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11#include <mach/hardware.h>
12
13#define IRQ_STATUS 0x14
14
15 .macro disable_fiq
16 .endm
17
18 .macro get_irqnr_preamble, base, tmp
19 .endm
20
21 .macro arch_ret_to_user, tmp1, tmp2
22 .endm
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 ldr \irqstat, =IO_ADDRESS(GEMINI_INTERRUPT_BASE + IRQ_STATUS)
26 ldr \irqnr, [\irqstat]
27 cmp \irqnr, #0
28 beq 2313f
29 mov \tmp, \irqnr
30 mov \irqnr, #0
312312:
32 tst \tmp, #1
33 bne 2313f
34 add \irqnr, \irqnr, #1
35 mov \tmp, \tmp, lsr #1
36 cmp \irqnr, #31
37 bcc 2312b
382313:
39 .endm
diff --git a/arch/arm/mach-gemini/include/mach/global_reg.h b/arch/arm/mach-gemini/include/mach/global_reg.h
new file mode 100644
index 000000000000..de7ff7e849fc
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/global_reg.h
@@ -0,0 +1,278 @@
1/*
2 * This file contains the hardware definitions for Gemini.
3 *
4 * Copyright (C) 2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#ifndef __MACH_GLOBAL_REG_H
12#define __MACH_GLOBAL_REG_H
13
14/* Global Word ID Register*/
15#define GLOBAL_ID 0x00
16
17#define CHIP_ID(reg) ((reg) >> 8)
18#define CHIP_REVISION(reg) ((reg) & 0xFF)
19
20/* Global Status Register */
21#define GLOBAL_STATUS 0x04
22
23#define CPU_BIG_ENDIAN (1 << 31)
24#define PLL_OSC_30M (1 << 30) /* else 60MHz */
25
26#define OPERATION_MODE_MASK (0xF << 26)
27#define OPM_IDDQ (0xF << 26)
28#define OPM_NAND (0xE << 26)
29#define OPM_RING (0xD << 26)
30#define OPM_DIRECT_BOOT (0xC << 26)
31#define OPM_USB1_PHY_TEST (0xB << 26)
32#define OPM_USB0_PHY_TEST (0xA << 26)
33#define OPM_SATA1_PHY_TEST (0x9 << 26)
34#define OPM_SATA0_PHY_TEST (0x8 << 26)
35#define OPM_ICE_ARM (0x7 << 26)
36#define OPM_ICE_FARADAY (0x6 << 26)
37#define OPM_PLL_BYPASS (0x5 << 26)
38#define OPM_DEBUG (0x4 << 26)
39#define OPM_BURN_IN (0x3 << 26)
40#define OPM_MBIST (0x2 << 26)
41#define OPM_SCAN (0x1 << 26)
42#define OPM_REAL (0x0 << 26)
43
44#define FLASH_TYPE_MASK (0x3 << 24)
45#define FLASH_TYPE_NAND_2K (0x3 << 24)
46#define FLASH_TYPE_NAND_512 (0x2 << 24)
47#define FLASH_TYPE_PARALLEL (0x1 << 24)
48#define FLASH_TYPE_SERIAL (0x0 << 24)
49/* if parallel */
50#define FLASH_WIDTH_16BIT (1 << 23) /* else 8 bit */
51/* if serial */
52#define FLASH_ATMEL (1 << 23) /* else STM */
53
54#define FLASH_SIZE_MASK (0x3 << 21)
55#define NAND_256M (0x3 << 21) /* and more */
56#define NAND_128M (0x2 << 21)
57#define NAND_64M (0x1 << 21)
58#define NAND_32M (0x0 << 21)
59#define ATMEL_16M (0x3 << 21) /* and more */
60#define ATMEL_8M (0x2 << 21)
61#define ATMEL_4M_2M (0x1 << 21)
62#define ATMEL_1M (0x0 << 21) /* and less */
63#define STM_32M (1 << 22) /* and more */
64#define STM_16M (0 << 22) /* and less */
65
66#define FLASH_PARALLEL_HIGH_PIN_CNT (1 << 20) /* else low pin cnt */
67
68#define CPU_AHB_RATIO_MASK (0x3 << 18)
69#define CPU_AHB_1_1 (0x0 << 18)
70#define CPU_AHB_3_2 (0x1 << 18)
71#define CPU_AHB_24_13 (0x2 << 18)
72#define CPU_AHB_2_1 (0x3 << 18)
73
74#define REG_TO_AHB_SPEED(reg) ((((reg) >> 15) & 0x7) * 10 + 130)
75#define AHB_SPEED_TO_REG(x) ((((x - 130)) / 10) << 15)
76
77/* it is posible to override some settings, use >> OVERRIDE_xxxx_SHIFT */
78#define OVERRIDE_FLASH_TYPE_SHIFT 16
79#define OVERRIDE_FLASH_WIDTH_SHIFT 16
80#define OVERRIDE_FLASH_SIZE_SHIFT 16
81#define OVERRIDE_CPU_AHB_RATIO_SHIFT 15
82#define OVERRIDE_AHB_SPEED_SHIFT 15
83
84/* Global PLL Control Register */
85#define GLOBAL_PLL_CTRL 0x08
86
87#define PLL_BYPASS (1 << 31)
88#define PLL_POWER_DOWN (1 << 8)
89#define PLL_CONTROL_Q (0x1F << 0)
90
91/* Global Soft Reset Control Register */
92#define GLOBAL_RESET 0x0C
93
94#define RESET_GLOBAL (1 << 31)
95#define RESET_CPU1 (1 << 30)
96#define RESET_TVE (1 << 28)
97#define RESET_SATA1 (1 << 27)
98#define RESET_SATA0 (1 << 26)
99#define RESET_CIR (1 << 25)
100#define RESET_EXT_DEV (1 << 24)
101#define RESET_WD (1 << 23)
102#define RESET_GPIO2 (1 << 22)
103#define RESET_GPIO1 (1 << 21)
104#define RESET_GPIO0 (1 << 20)
105#define RESET_SSP (1 << 19)
106#define RESET_UART (1 << 18)
107#define RESET_TIMER (1 << 17)
108#define RESET_RTC (1 << 16)
109#define RESET_INT1 (1 << 15)
110#define RESET_INT0 (1 << 14)
111#define RESET_LCD (1 << 13)
112#define RESET_LPC (1 << 12)
113#define RESET_APB (1 << 11)
114#define RESET_DMA (1 << 10)
115#define RESET_USB1 (1 << 9)
116#define RESET_USB0 (1 << 8)
117#define RESET_PCI (1 << 7)
118#define RESET_GMAC1 (1 << 6)
119#define RESET_GMAC0 (1 << 5)
120#define RESET_SECURITY (1 << 4)
121#define RESET_RAID (1 << 3)
122#define RESET_IDE (1 << 2)
123#define RESET_FLASH (1 << 1)
124#define RESET_DRAM (1 << 0)
125
126/* Global IO Pad Driving Capability Control Register */
127#define GLOBAL_IO_DRIVING_CTRL 0x10
128
129#define DRIVING_CURRENT_MASK 0x3
130
131/* here 00-4mA, 01-8mA, 10-12mA, 11-16mA */
132#define GPIO1_PADS_31_28_SHIFT 28
133#define GPIO0_PADS_31_16_SHIFT 26
134#define GPIO0_PADS_15_0_SHIFT 24
135#define PCI_AND_EXT_RESET_PADS_SHIFT 22
136#define IDE_PADS_SHIFT 20
137#define GMAC1_PADS_SHIFT 18
138#define GMAC0_PADS_SHIFT 16
139/* DRAM is not in mA and poorly documented */
140#define DRAM_CLOCK_PADS_SHIFT 8
141#define DRAM_DATA_PADS_SHIFT 4
142#define DRAM_CONTROL_PADS_SHIFT 0
143
144/* Global IO Pad Slew Rate Control Register */
145#define GLOBAL_IO_SLEW_RATE_CTRL 0x14
146
147#define GPIO1_PADS_31_28_SLOW (1 << 10)
148#define GPIO0_PADS_31_16_SLOW (1 << 9)
149#define GPIO0_PADS_15_0_SLOW (1 << 8)
150#define PCI_PADS_SLOW (1 << 7)
151#define IDE_PADS_SLOW (1 << 6)
152#define GMAC1_PADS_SLOW (1 << 5)
153#define GMAC0_PADS_SLOW (1 << 4)
154#define DRAM_CLOCK_PADS_SLOW (1 << 1)
155#define DRAM_IO_PADS_SLOW (1 << 0)
156
157/*
158 * General skew control defines
159 * 16 steps, each step is around 0.2ns
160 */
161#define SKEW_MASK 0xF
162
163/* Global IDE PAD Skew Control Register */
164#define GLOBAL_IDE_SKEW_CTRL 0x18
165
166#define IDE1_HOST_STROBE_DELAY_SHIFT 28
167#define IDE1_DEVICE_STROBE_DELAY_SHIFT 24
168#define IDE1_OUTPUT_IO_SKEW_SHIFT 20
169#define IDE1_INPUT_IO_SKEW_SHIFT 16
170#define IDE0_HOST_STROBE_DELAY_SHIFT 12
171#define IDE0_DEVICE_STROBE_DELAY_SHIFT 8
172#define IDE0_OUTPUT_IO_SKEW_SHIFT 4
173#define IDE0_INPUT_IO_SKEW_SHIFT 0
174
175/* Global GMAC Control Pad Skew Control Register */
176#define GLOBAL_GMAC_CTRL_SKEW_CTRL 0x1C
177
178#define GMAC1_TXC_SKEW_SHIFT 28
179#define GMAC1_TXEN_SKEW_SHIFT 24
180#define GMAC1_RXC_SKEW_SHIFT 20
181#define GMAC1_RXDV_SKEW_SHIFT 16
182#define GMAC0_TXC_SKEW_SHIFT 12
183#define GMAC0_TXEN_SKEW_SHIFT 8
184#define GMAC0_RXC_SKEW_SHIFT 4
185#define GMAC0_RXDV_SKEW_SHIFT 0
186
187/* Global GMAC0 Data PAD Skew Control Register */
188#define GLOBAL_GMAC0_DATA_SKEW_CTRL 0x20
189/* Global GMAC1 Data PAD Skew Control Register */
190#define GLOBAL_GMAC1_DATA_SKEW_CTRL 0x24
191
192#define GMAC_TXD_SKEW_SHIFT(x) (((x) * 4) + 16)
193#define GMAC_RXD_SKEW_SHIFT(x) ((x) * 4)
194
195/* CPU has two AHB busses. */
196
197/* Global Arbitration0 Control Register */
198#define GLOBAL_ARBITRATION0_CTRL 0x28
199
200#define BOOT_CONTROLLER_HIGH_PRIO (1 << 3)
201#define DMA_BUS1_HIGH_PRIO (1 << 2)
202#define CPU0_HIGH_PRIO (1 << 0)
203
204/* Global Arbitration1 Control Register */
205#define GLOBAL_ARBITRATION1_CTRL 0x2C
206
207#define TVE_HIGH_PRIO (1 << 9)
208#define PCI_HIGH_PRIO (1 << 8)
209#define USB1_HIGH_PRIO (1 << 7)
210#define USB0_HIGH_PRIO (1 << 6)
211#define GMAC1_HIGH_PRIO (1 << 5)
212#define GMAC0_HIGH_PRIO (1 << 4)
213#define SECURITY_HIGH_PRIO (1 << 3)
214#define RAID_HIGH_PRIO (1 << 2)
215#define IDE_HIGH_PRIO (1 << 1)
216#define DMA_BUS2_HIGH_PRIO (1 << 0)
217
218/* Common bits for both arbitration registers */
219#define BURST_LENGTH_SHIFT 16
220#define BURST_LENGTH_MASK (0x3F << 16)
221
222/* Miscellaneous Control Register */
223#define GLOBAL_MISC_CTRL 0x30
224
225#define MEMORY_SPACE_SWAP (1 << 31)
226#define USB1_PLUG_MINIB (1 << 30) /* else plug is mini-A */
227#define USB0_PLUG_MINIB (1 << 29)
228#define GMAC_GMII (1 << 28)
229#define GMAC_1_ENABLE (1 << 27)
230/* TODO: define ATA/SATA bits */
231#define USB1_VBUS_ON (1 << 23)
232#define USB0_VBUS_ON (1 << 22)
233#define APB_CLKOUT_ENABLE (1 << 21)
234#define TVC_CLKOUT_ENABLE (1 << 20)
235#define EXT_CLKIN_ENABLE (1 << 19)
236#define PCI_66MHZ (1 << 18) /* else 33 MHz */
237#define PCI_CLKOUT_ENABLE (1 << 17)
238#define LPC_CLKOUT_ENABLE (1 << 16)
239#define USB1_WAKEUP_ON (1 << 15)
240#define USB0_WAKEUP_ON (1 << 14)
241/* TODO: define PCI idle detect bits */
242#define TVC_PADS_ENABLE (1 << 9)
243#define SSP_PADS_ENABLE (1 << 8)
244#define LCD_PADS_ENABLE (1 << 7)
245#define LPC_PADS_ENABLE (1 << 6)
246#define PCI_PADS_ENABLE (1 << 5)
247#define IDE_PADS_ENABLE (1 << 4)
248#define DRAM_PADS_POWER_DOWN (1 << 3)
249#define NAND_PADS_DISABLE (1 << 2)
250#define PFLASH_PADS_DISABLE (1 << 1)
251#define SFLASH_PADS_DISABLE (1 << 0)
252
253/* Global Clock Control Register */
254#define GLOBAL_CLOCK_CTRL 0x34
255
256#define POWER_STATE_G0 (1 << 31)
257#define POWER_STATE_S1 (1 << 30) /* else it is S3/S4 state */
258#define SECURITY_APB_AHB (1 << 29)
259/* else Security APB clk will be 0.75xAHB */
260/* TODO: TVC clock divider */
261#define PCI_CLKRUN_ENABLE (1 << 16)
262#define BOOT_CLK_DISABLE (1 << 13)
263#define TVC_CLK_DISABLE (1 << 12)
264#define FLASH_CLK_DISABLE (1 << 11)
265#define DDR_CLK_DISABLE (1 << 10)
266#define PCI_CLK_DISABLE (1 << 9)
267#define IDE_CLK_DISABLE (1 << 8)
268#define USB1_CLK_DISABLE (1 << 7)
269#define USB0_CLK_DISABLE (1 << 6)
270#define SATA1_CLK_DISABLE (1 << 5)
271#define SATA0_CLK_DISABLE (1 << 4)
272#define GMAC1_CLK_DISABLE (1 << 3)
273#define GMAC0_CLK_DISABLE (1 << 2)
274#define SECURITY_CLK_DISABLE (1 << 1)
275
276/* TODO: other registers definitions if needed */
277
278#endif /* __MACH_GLOBAL_REG_H */
diff --git a/arch/arm/mach-gemini/include/mach/gpio.h b/arch/arm/mach-gemini/include/mach/gpio.h
new file mode 100644
index 000000000000..3bc2c70f2989
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/gpio.h
@@ -0,0 +1,25 @@
1/*
2 * Gemini gpiolib specific defines
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#ifndef __MACH_GPIO_H__
13#define __MACH_GPIO_H__
14
15#include <mach/irqs.h>
16#include <asm-generic/gpio.h>
17
18#define gpio_get_value __gpio_get_value
19#define gpio_set_value __gpio_set_value
20#define gpio_cansleep __gpio_cansleep
21
22#define gpio_to_irq(x) ((x) + GPIO_IRQ_BASE)
23#define irq_to_gpio(x) ((x) - GPIO_IRQ_BASE)
24
25#endif /* __MACH_GPIO_H__ */
diff --git a/arch/arm/mach-gemini/include/mach/hardware.h b/arch/arm/mach-gemini/include/mach/hardware.h
new file mode 100644
index 000000000000..de6752674c05
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/hardware.h
@@ -0,0 +1,75 @@
1/*
2 * This file contains the hardware definitions for Gemini.
3 *
4 * Copyright (C) 2001-2006 Storlink, Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12#ifndef __MACH_HARDWARE_H
13#define __MACH_HARDWARE_H
14
15/*
16 * Memory Map definitions
17 */
18/* FIXME: Does it really swap SRAM like this? */
19#ifdef CONFIG_GEMINI_MEM_SWAP
20# define GEMINI_DRAM_BASE 0x00000000
21# define GEMINI_SRAM_BASE 0x20000000
22#else
23# define GEMINI_SRAM_BASE 0x00000000
24# define GEMINI_DRAM_BASE 0x10000000
25#endif
26#define GEMINI_FLASH_BASE 0x30000000
27#define GEMINI_GLOBAL_BASE 0x40000000
28#define GEMINI_WAQTCHDOG_BASE 0x41000000
29#define GEMINI_UART_BASE 0x42000000
30#define GEMINI_TIMER_BASE 0x43000000
31#define GEMINI_LCD_BASE 0x44000000
32#define GEMINI_RTC_BASE 0x45000000
33#define GEMINI_SATA_BASE 0x46000000
34#define GEMINI_LPC_HOST_BASE 0x47000000
35#define GEMINI_LPC_IO_BASE 0x47800000
36#define GEMINI_INTERRUPT_BASE 0x48000000
37/* TODO: Different interrupt controlers when SMP
38 * #define GEMINI_INTERRUPT0_BASE 0x48000000
39 * #define GEMINI_INTERRUPT1_BASE 0x49000000
40 */
41#define GEMINI_SSP_CTRL_BASE 0x4A000000
42#define GEMINI_POWER_CTRL_BASE 0x4B000000
43#define GEMINI_CIR_BASE 0x4C000000
44#define GEMINI_GPIO_BASE(x) (0x4D000000 + (x) * 0x1000000)
45#define GEMINI_PCI_IO_BASE 0x50000000
46#define GEMINI_PCI_MEM_BASE 0x58000000
47#define GEMINI_TOE_BASE 0x60000000
48#define GEMINI_GMAC0_BASE 0x6000A000
49#define GEMINI_GMAC1_BASE 0x6000E000
50#define GEMINI_SECURITY_BASE 0x62000000
51#define GEMINI_IDE0_BASE 0x63000000
52#define GEMINI_IDE1_BASE 0x63400000
53#define GEMINI_RAID_BASE 0x64000000
54#define GEMINI_FLASH_CTRL_BASE 0x65000000
55#define GEMINI_DRAM_CTRL_BASE 0x66000000
56#define GEMINI_GENERAL_DMA_BASE 0x67000000
57#define GEMINI_USB0_BASE 0x68000000
58#define GEMINI_USB1_BASE 0x69000000
59#define GEMINI_BIG_ENDIAN_BASE 0x80000000
60
61#define GEMINI_TIMER1_BASE GEMINI_TIMER_BASE
62#define GEMINI_TIMER2_BASE (GEMINI_TIMER_BASE + 0x10)
63#define GEMINI_TIMER3_BASE (GEMINI_TIMER_BASE + 0x20)
64
65/*
66 * UART Clock when System clk is 150MHz
67 */
68#define UART_CLK 48000000
69
70/*
71 * macro to get at IO space when running virtually
72 */
73#define IO_ADDRESS(x) ((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000)
74
75#endif
diff --git a/arch/arm/mach-gemini/include/mach/io.h b/arch/arm/mach-gemini/include/mach/io.h
new file mode 100644
index 000000000000..c548056b98b2
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/io.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright (C) 2001-2006 Storlink, Corp.
3 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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 __MACH_IO_H
11#define __MACH_IO_H
12
13#define IO_SPACE_LIMIT 0xffffffff
14
15#define __io(a) __typesafe_io(a)
16#define __mem_pci(a) (a)
17
18#endif /* __MACH_IO_H */
diff --git a/arch/arm/mach-gemini/include/mach/irqs.h b/arch/arm/mach-gemini/include/mach/irqs.h
new file mode 100644
index 000000000000..06bc47e77e8b
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/irqs.h
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2001-2006 Storlink, Corp.
3 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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
11#ifndef __MACH_IRQS_H__
12#define __MACH_IRQS_H__
13
14#define IRQ_SERIRQ1 31
15#define IRQ_SERIRQ0 30
16#define IRQ_PCID 29
17#define IRQ_PCIC 28
18#define IRQ_PCIB 27
19#define IRQ_PWR 26
20#define IRQ_CIR 25
21#define IRQ_GPIO(x) (22 + (x))
22#define IRQ_SSP 21
23#define IRQ_LPC 20
24#define IRQ_LCD 19
25#define IRQ_UART 18
26#define IRQ_RTC 17
27#define IRQ_TIMER3 16
28#define IRQ_TIMER2 15
29#define IRQ_TIMER1 14
30#define IRQ_FLASH 12
31#define IRQ_USB1 11
32#define IRQ_USB0 10
33#define IRQ_DMA 9
34#define IRQ_PCI 8
35#define IRQ_IPSEC 7
36#define IRQ_RAID 6
37#define IRQ_IDE1 5
38#define IRQ_IDE0 4
39#define IRQ_WATCHDOG 3
40#define IRQ_GMAC1 2
41#define IRQ_GMAC0 1
42#define IRQ_IPI 0
43
44#define NORMAL_IRQ_NUM 32
45
46#define GPIO_IRQ_BASE NORMAL_IRQ_NUM
47#define GPIO_IRQ_NUM (3 * 32)
48
49#define ARCH_TIMER_IRQ IRQ_TIMER2
50
51#define NR_IRQS (NORMAL_IRQ_NUM + GPIO_IRQ_NUM)
52
53#endif /* __MACH_IRQS_H__ */
diff --git a/arch/arm/mach-gemini/include/mach/memory.h b/arch/arm/mach-gemini/include/mach/memory.h
new file mode 100644
index 000000000000..2d14d5bf1f9f
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/memory.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) 2001-2006 Storlink, Corp.
3 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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 __MACH_MEMORY_H
11#define __MACH_MEMORY_H
12
13#ifdef CONFIG_GEMINI_MEM_SWAP
14# define PHYS_OFFSET UL(0x00000000)
15#else
16# define PHYS_OFFSET UL(0x10000000)
17#endif
18
19#endif /* __MACH_MEMORY_H */
diff --git a/arch/arm/mach-gemini/include/mach/system.h b/arch/arm/mach-gemini/include/mach/system.h
new file mode 100644
index 000000000000..bbbd72767a02
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/system.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2001-2006 Storlink, Corp.
3 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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 __MACH_SYSTEM_H
11#define __MACH_SYSTEM_H
12
13#include <linux/io.h>
14#include <mach/hardware.h>
15#include <mach/global_reg.h>
16
17static inline void arch_idle(void)
18{
19 /*
20 * Because of broken hardware we have to enable interrupts or the CPU
21 * will never wakeup... Acctualy it is not very good to enable
22 * interrupts here since scheduler can miss a tick, but there is
23 * no other way around this. Platforms that needs it for power saving
24 * should call enable_hlt() in init code, since by default it is
25 * disabled.
26 */
27 local_irq_enable();
28 cpu_do_idle();
29}
30
31static inline void arch_reset(char mode)
32{
33 __raw_writel(RESET_GLOBAL | RESET_CPU1,
34 IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET);
35}
36
37#endif /* __MACH_SYSTEM_H */
diff --git a/arch/arm/mach-gemini/include/mach/timex.h b/arch/arm/mach-gemini/include/mach/timex.h
new file mode 100644
index 000000000000..dc5690ba975c
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/timex.h
@@ -0,0 +1,13 @@
1/*
2 * Gemini timex specifications
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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/* When AHB bus frequency is 150MHz */
13#define CLOCK_TICK_RATE 38000000
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
new file mode 100644
index 000000000000..59c5df7e716c
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
3 *
4 * Based on mach-pxa/include/mach/uncompress.h:
5 * Copyright: (C) 2001 MontaVista Software Inc.
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
13#ifndef __MACH_UNCOMPRESS_H
14#define __MACH_UNCOMPRESS_H
15
16#include <linux/serial_reg.h>
17#include <mach/hardware.h>
18
19static volatile unsigned long *UART = (unsigned long *)GEMINI_UART_BASE;
20
21/*
22 * The following code assumes the serial port has already been
23 * initialized by the bootloader. If you didn't setup a port in
24 * your bootloader then nothing will appear (which might be desired).
25 */
26static inline void putc(char c)
27{
28 while (!(UART[UART_LSR] & UART_LSR_THRE))
29 barrier();
30 UART[UART_TX] = c;
31}
32
33#define flush() do { } while (0)
34
35/*
36 * nothing to do
37 */
38#define arch_decomp_setup()
39
40#define arch_decomp_wdog()
41
42#endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-gemini/include/mach/vmalloc.h b/arch/arm/mach-gemini/include/mach/vmalloc.h
new file mode 100644
index 000000000000..83e536d9436c
--- /dev/null
+++ b/arch/arm/mach-gemini/include/mach/vmalloc.h
@@ -0,0 +1,10 @@
1/*
2 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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
10#define VMALLOC_END 0xF0000000
diff --git a/arch/arm/mach-gemini/irq.c b/arch/arm/mach-gemini/irq.c
new file mode 100644
index 000000000000..9e613ca8120d
--- /dev/null
+++ b/arch/arm/mach-gemini/irq.c
@@ -0,0 +1,102 @@
1/*
2 * Interrupt routines for Gemini
3 *
4 * Copyright (C) 2001-2006 Storlink, Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#include <linux/init.h>
13#include <linux/io.h>
14#include <linux/ioport.h>
15#include <linux/stddef.h>
16#include <linux/list.h>
17#include <linux/sched.h>
18#include <asm/irq.h>
19#include <asm/mach/irq.h>
20#include <mach/hardware.h>
21
22#define IRQ_SOURCE(base_addr) (base_addr + 0x00)
23#define IRQ_MASK(base_addr) (base_addr + 0x04)
24#define IRQ_CLEAR(base_addr) (base_addr + 0x08)
25#define IRQ_TMODE(base_addr) (base_addr + 0x0C)
26#define IRQ_TLEVEL(base_addr) (base_addr + 0x10)
27#define IRQ_STATUS(base_addr) (base_addr + 0x14)
28#define FIQ_SOURCE(base_addr) (base_addr + 0x20)
29#define FIQ_MASK(base_addr) (base_addr + 0x24)
30#define FIQ_CLEAR(base_addr) (base_addr + 0x28)
31#define FIQ_TMODE(base_addr) (base_addr + 0x2C)
32#define FIQ_LEVEL(base_addr) (base_addr + 0x30)
33#define FIQ_STATUS(base_addr) (base_addr + 0x34)
34
35static void gemini_ack_irq(unsigned int irq)
36{
37 __raw_writel(1 << irq, IRQ_CLEAR(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
38}
39
40static void gemini_mask_irq(unsigned int irq)
41{
42 unsigned int mask;
43
44 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
45 mask &= ~(1 << irq);
46 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
47}
48
49static void gemini_unmask_irq(unsigned int irq)
50{
51 unsigned int mask;
52
53 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
54 mask |= (1 << irq);
55 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
56}
57
58static struct irq_chip gemini_irq_chip = {
59 .name = "INTC",
60 .ack = gemini_ack_irq,
61 .mask = gemini_mask_irq,
62 .unmask = gemini_unmask_irq,
63};
64
65static struct resource irq_resource = {
66 .name = "irq_handler",
67 .start = IO_ADDRESS(GEMINI_INTERRUPT_BASE),
68 .end = IO_ADDRESS(FIQ_STATUS(GEMINI_INTERRUPT_BASE)) + 4,
69};
70
71void __init gemini_init_irq(void)
72{
73 unsigned int i, mode = 0, level = 0;
74
75 /*
76 * Disable arch_idle() by default since it is buggy
77 * For more info see arch/arm/mach-gemini/include/mach/system.h
78 */
79 disable_hlt();
80
81 request_resource(&iomem_resource, &irq_resource);
82
83 for (i = 0; i < NR_IRQS; i++) {
84 set_irq_chip(i, &gemini_irq_chip);
85 if((i >= IRQ_TIMER1 && i <= IRQ_TIMER3) || (i >= IRQ_SERIRQ0 && i <= IRQ_SERIRQ1)) {
86 set_irq_handler(i, handle_edge_irq);
87 mode |= 1 << i;
88 level |= 1 << i;
89 } else {
90 set_irq_handler(i, handle_level_irq);
91 }
92 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
93 }
94
95 /* Disable all interrupts */
96 __raw_writel(0, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
97 __raw_writel(0, FIQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
98
99 /* Set interrupt mode */
100 __raw_writel(mode, IRQ_TMODE(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
101 __raw_writel(level, IRQ_TLEVEL(IO_ADDRESS(GEMINI_INTERRUPT_BASE)));
102}
diff --git a/arch/arm/mach-gemini/mm.c b/arch/arm/mach-gemini/mm.c
new file mode 100644
index 000000000000..51948242ec09
--- /dev/null
+++ b/arch/arm/mach-gemini/mm.c
@@ -0,0 +1,82 @@
1/*
2 * Static mappings for Gemini
3 *
4 * Copyright (C) 2001-2006 Storlink, Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#include <linux/mm.h>
13#include <linux/init.h>
14
15#include <asm/mach/map.h>
16
17#include <mach/hardware.h>
18
19/* Page table mapping for I/O region */
20static struct map_desc gemini_io_desc[] __initdata = {
21 {
22 .virtual = IO_ADDRESS(GEMINI_GLOBAL_BASE),
23 .pfn =__phys_to_pfn(GEMINI_GLOBAL_BASE),
24 .length = SZ_512K,
25 .type = MT_DEVICE,
26 }, {
27 .virtual = IO_ADDRESS(GEMINI_UART_BASE),
28 .pfn = __phys_to_pfn(GEMINI_UART_BASE),
29 .length = SZ_512K,
30 .type = MT_DEVICE,
31 }, {
32 .virtual = IO_ADDRESS(GEMINI_TIMER_BASE),
33 .pfn = __phys_to_pfn(GEMINI_TIMER_BASE),
34 .length = SZ_512K,
35 .type = MT_DEVICE,
36 }, {
37 .virtual = IO_ADDRESS(GEMINI_INTERRUPT_BASE),
38 .pfn = __phys_to_pfn(GEMINI_INTERRUPT_BASE),
39 .length = SZ_512K,
40 .type = MT_DEVICE,
41 }, {
42 .virtual = IO_ADDRESS(GEMINI_POWER_CTRL_BASE),
43 .pfn = __phys_to_pfn(GEMINI_POWER_CTRL_BASE),
44 .length = SZ_512K,
45 .type = MT_DEVICE,
46 }, {
47 .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(0)),
48 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(0)),
49 .length = SZ_512K,
50 .type = MT_DEVICE,
51 }, {
52 .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(1)),
53 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(1)),
54 .length = SZ_512K,
55 .type = MT_DEVICE,
56 }, {
57 .virtual = IO_ADDRESS(GEMINI_GPIO_BASE(2)),
58 .pfn = __phys_to_pfn(GEMINI_GPIO_BASE(2)),
59 .length = SZ_512K,
60 .type = MT_DEVICE,
61 }, {
62 .virtual = IO_ADDRESS(GEMINI_FLASH_CTRL_BASE),
63 .pfn = __phys_to_pfn(GEMINI_FLASH_CTRL_BASE),
64 .length = SZ_512K,
65 .type = MT_DEVICE,
66 }, {
67 .virtual = IO_ADDRESS(GEMINI_DRAM_CTRL_BASE),
68 .pfn = __phys_to_pfn(GEMINI_DRAM_CTRL_BASE),
69 .length = SZ_512K,
70 .type = MT_DEVICE,
71 }, {
72 .virtual = IO_ADDRESS(GEMINI_GENERAL_DMA_BASE),
73 .pfn = __phys_to_pfn(GEMINI_GENERAL_DMA_BASE),
74 .length = SZ_512K,
75 .type = MT_DEVICE,
76 },
77};
78
79void __init gemini_map_io(void)
80{
81 iotable_init(gemini_io_desc, ARRAY_SIZE(gemini_io_desc));
82}
diff --git a/arch/arm/mach-gemini/time.c b/arch/arm/mach-gemini/time.c
new file mode 100644
index 000000000000..21dc5a89d1c4
--- /dev/null
+++ b/arch/arm/mach-gemini/time.c
@@ -0,0 +1,89 @@
1/*
2 * Copyright (C) 2001-2006 Storlink, Corp.
3 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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#include <linux/interrupt.h>
11#include <linux/irq.h>
12#include <linux/io.h>
13#include <mach/hardware.h>
14#include <mach/global_reg.h>
15#include <asm/mach/time.h>
16
17/*
18 * Register definitions for the timers
19 */
20#define TIMER_COUNT(BASE_ADDR) (BASE_ADDR + 0x00)
21#define TIMER_LOAD(BASE_ADDR) (BASE_ADDR + 0x04)
22#define TIMER_MATCH1(BASE_ADDR) (BASE_ADDR + 0x08)
23#define TIMER_MATCH2(BASE_ADDR) (BASE_ADDR + 0x0C)
24#define TIMER_CR(BASE_ADDR) (BASE_ADDR + 0x30)
25
26#define TIMER_1_CR_ENABLE (1 << 0)
27#define TIMER_1_CR_CLOCK (1 << 1)
28#define TIMER_1_CR_INT (1 << 2)
29#define TIMER_2_CR_ENABLE (1 << 3)
30#define TIMER_2_CR_CLOCK (1 << 4)
31#define TIMER_2_CR_INT (1 << 5)
32#define TIMER_3_CR_ENABLE (1 << 6)
33#define TIMER_3_CR_CLOCK (1 << 7)
34#define TIMER_3_CR_INT (1 << 8)
35
36/*
37 * IRQ handler for the timer
38 */
39static irqreturn_t gemini_timer_interrupt(int irq, void *dev_id)
40{
41 timer_tick();
42
43 return IRQ_HANDLED;
44}
45
46static struct irqaction gemini_timer_irq = {
47 .name = "Gemini Timer Tick",
48 .flags = IRQF_DISABLED | IRQF_TIMER,
49 .handler = gemini_timer_interrupt,
50};
51
52/*
53 * Set up timer interrupt, and return the current time in seconds.
54 */
55void __init gemini_timer_init(void)
56{
57 unsigned int tick_rate, reg_v;
58
59 reg_v = __raw_readl(IO_ADDRESS(GEMINI_GLOBAL_BASE + GLOBAL_STATUS));
60 tick_rate = REG_TO_AHB_SPEED(reg_v) * 1000000;
61
62 printk(KERN_INFO "Bus: %dMHz", tick_rate / 1000000);
63
64 tick_rate /= 6; /* APB bus run AHB*(1/6) */
65
66 switch(reg_v & CPU_AHB_RATIO_MASK) {
67 case CPU_AHB_1_1:
68 printk(KERN_CONT "(1/1)\n");
69 break;
70 case CPU_AHB_3_2:
71 printk(KERN_CONT "(3/2)\n");
72 break;
73 case CPU_AHB_24_13:
74 printk(KERN_CONT "(24/13)\n");
75 break;
76 case CPU_AHB_2_1:
77 printk(KERN_CONT "(2/1)\n");
78 break;
79 }
80
81 /*
82 * Make irqs happen for the system timer
83 */
84 setup_irq(IRQ_TIMER2, &gemini_timer_irq);
85 /* Start the timer */
86 __raw_writel(tick_rate / HZ, TIMER_COUNT(IO_ADDRESS(GEMINI_TIMER2_BASE)));
87 __raw_writel(tick_rate / HZ, TIMER_LOAD(IO_ADDRESS(GEMINI_TIMER2_BASE)));
88 __raw_writel(TIMER_2_CR_ENABLE | TIMER_2_CR_INT, TIMER_CR(IO_ADDRESS(GEMINI_TIMER_BASE)));
89}
diff --git a/arch/arm/mach-h720x/include/mach/system.h b/arch/arm/mach-h720x/include/mach/system.h
index e4a7c760d52a..a708d24ee46d 100644
--- a/arch/arm/mach-h720x/include/mach/system.h
+++ b/arch/arm/mach-h720x/include/mach/system.h
@@ -25,7 +25,7 @@ static void arch_idle(void)
25} 25}
26 26
27 27
28static __inline__ void arch_reset(char mode) 28static __inline__ void arch_reset(char mode, const char *cmd)
29{ 29{
30 CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET; 30 CPU_REG (PMU_BASE, PMU_STAT) |= PMU_WARMRESET;
31} 31}
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c
index 887cb21f75b0..05f1739ee127 100644
--- a/arch/arm/mach-imx/generic.c
+++ b/arch/arm/mach-imx/generic.c
@@ -29,7 +29,6 @@
29#include <linux/string.h> 29#include <linux/string.h>
30 30
31#include <asm/errno.h> 31#include <asm/errno.h>
32#include <mach/imxfb.h>
33#include <mach/hardware.h> 32#include <mach/hardware.h>
34#include <mach/imx-regs.h> 33#include <mach/imx-regs.h>
35 34
@@ -245,43 +244,8 @@ void __init imx_set_mmc_info(struct imxmmc_platform_data *info)
245 imx_mmc_device.dev.platform_data = info; 244 imx_mmc_device.dev.platform_data = info;
246} 245}
247 246
248static struct imx_fb_platform_data imx_fb_info;
249
250void __init set_imx_fb_info(struct imx_fb_platform_data *hard_imx_fb_info)
251{
252 memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imx_fb_platform_data));
253}
254
255static struct resource imxfb_resources[] = {
256 [0] = {
257 .start = 0x00205000,
258 .end = 0x002050FF,
259 .flags = IORESOURCE_MEM,
260 },
261 [1] = {
262 .start = LCDC_INT,
263 .end = LCDC_INT,
264 .flags = IORESOURCE_IRQ,
265 },
266};
267
268static u64 fb_dma_mask = ~(u64)0;
269
270static struct platform_device imxfb_device = {
271 .name = "imx-fb",
272 .id = 0,
273 .dev = {
274 .platform_data = &imx_fb_info,
275 .dma_mask = &fb_dma_mask,
276 .coherent_dma_mask = 0xffffffff,
277 },
278 .num_resources = ARRAY_SIZE(imxfb_resources),
279 .resource = imxfb_resources,
280};
281
282static struct platform_device *devices[] __initdata = { 247static struct platform_device *devices[] __initdata = {
283 &imx_mmc_device, 248 &imx_mmc_device,
284 &imxfb_device,
285}; 249};
286 250
287static struct map_desc imx_io_desc[] __initdata = { 251static struct map_desc imx_io_desc[] __initdata = {
diff --git a/arch/arm/mach-imx/include/mach/system.h b/arch/arm/mach-imx/include/mach/system.h
index adee7e51bab2..46d4ca91af79 100644
--- a/arch/arm/mach-imx/include/mach/system.h
+++ b/arch/arm/mach-imx/include/mach/system.h
@@ -32,7 +32,7 @@ arch_idle(void)
32} 32}
33 33
34static inline void 34static inline void
35arch_reset(char mode) 35arch_reset(char mode, const char *cmd)
36{ 36{
37 cpu_reset(0); 37 cpu_reset(0);
38} 38}
diff --git a/arch/arm/mach-integrator/include/mach/system.h b/arch/arm/mach-integrator/include/mach/system.h
index c485345c8c77..e1551b8dab77 100644
--- a/arch/arm/mach-integrator/include/mach/system.h
+++ b/arch/arm/mach-integrator/include/mach/system.h
@@ -32,7 +32,7 @@ static inline void arch_idle(void)
32 cpu_do_idle(); 32 cpu_do_idle();
33} 33}
34 34
35static inline void arch_reset(char mode) 35static inline void arch_reset(char mode, const char *cmd)
36{ 36{
37 /* 37 /*
38 * To reset, we hit the on-board reset register 38 * To reset, we hit the on-board reset register
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
index e012bf13c955..42ae29b288a1 100644
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ b/arch/arm/mach-iop13xx/include/mach/memory.h
@@ -59,7 +59,10 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
59 }) 59 })
60 60
61#define __arch_page_to_dma(dev, page) \ 61#define __arch_page_to_dma(dev, page) \
62 __arch_virt_to_dma(dev, page_address(page)) 62 ({ \
63 /* __is_lbus_virt() can never be true for RAM pages */ \
64 (dma_addr_t)page_to_phys(page); \
65 })
63 66
64#endif /* CONFIG_ARCH_IOP13XX */ 67#endif /* CONFIG_ARCH_IOP13XX */
65#endif /* !ASSEMBLY */ 68#endif /* !ASSEMBLY */
diff --git a/arch/arm/mach-iop13xx/include/mach/system.h b/arch/arm/mach-iop13xx/include/mach/system.h
index c7127f416e1f..d0c66ef450a7 100644
--- a/arch/arm/mach-iop13xx/include/mach/system.h
+++ b/arch/arm/mach-iop13xx/include/mach/system.h
@@ -13,7 +13,7 @@ static inline void arch_idle(void)
13 cpu_do_idle(); 13 cpu_do_idle();
14} 14}
15 15
16static inline void arch_reset(char mode) 16static inline void arch_reset(char mode, const char *cmd)
17{ 17{
18 /* 18 /*
19 * Reset the internal bus (warning both cores are reset) 19 * Reset the internal bus (warning both cores are reset)
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 673b0db22034..4873f26a42e1 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -1026,8 +1026,10 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1026 which_atu = 0; 1026 which_atu = 0;
1027 } 1027 }
1028 1028
1029 if (!which_atu) 1029 if (!which_atu) {
1030 kfree(res);
1030 return 0; 1031 return 0;
1032 }
1031 1033
1032 switch(which_atu) { 1034 switch(which_atu) {
1033 case IOP13XX_INIT_ATU_ATUX: 1035 case IOP13XX_INIT_ATU_ATUX:
@@ -1074,6 +1076,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1074 sys->map_irq = iop13xx_pcie_map_irq; 1076 sys->map_irq = iop13xx_pcie_map_irq;
1075 break; 1077 break;
1076 default: 1078 default:
1079 kfree(res);
1077 return 0; 1080 return 0;
1078 } 1081 }
1079 1082
diff --git a/arch/arm/mach-iop32x/include/mach/system.h b/arch/arm/mach-iop32x/include/mach/system.h
index 32d9e5b0a28d..a4b808fe0d81 100644
--- a/arch/arm/mach-iop32x/include/mach/system.h
+++ b/arch/arm/mach-iop32x/include/mach/system.h
@@ -16,7 +16,7 @@ static inline void arch_idle(void)
16 cpu_do_idle(); 16 cpu_do_idle();
17} 17}
18 18
19static inline void arch_reset(char mode) 19static inline void arch_reset(char mode, const char *cmd)
20{ 20{
21 local_irq_disable(); 21 local_irq_disable();
22 22
diff --git a/arch/arm/mach-iop33x/include/mach/system.h b/arch/arm/mach-iop33x/include/mach/system.h
index 0cb3ad862acd..f192a34be073 100644
--- a/arch/arm/mach-iop33x/include/mach/system.h
+++ b/arch/arm/mach-iop33x/include/mach/system.h
@@ -14,7 +14,7 @@ static inline void arch_idle(void)
14 cpu_do_idle(); 14 cpu_do_idle();
15} 15}
16 16
17static inline void arch_reset(char mode) 17static inline void arch_reset(char mode, const char *cmd)
18{ 18{
19 *IOP3XX_PCSR = 0x30; 19 *IOP3XX_PCSR = 0x30;
20 20
diff --git a/arch/arm/mach-ixp2000/include/mach/system.h b/arch/arm/mach-ixp2000/include/mach/system.h
index 2e9c68f95a24..de370992c848 100644
--- a/arch/arm/mach-ixp2000/include/mach/system.h
+++ b/arch/arm/mach-ixp2000/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
17 cpu_do_idle(); 17 cpu_do_idle();
18} 18}
19 19
20static inline void arch_reset(char mode) 20static inline void arch_reset(char mode, const char *cmd)
21{ 21{
22 local_irq_disable(); 22 local_irq_disable();
23 23
diff --git a/arch/arm/mach-ixp23xx/include/mach/system.h b/arch/arm/mach-ixp23xx/include/mach/system.h
index d57c3fc10f1f..8920ff2dff1f 100644
--- a/arch/arm/mach-ixp23xx/include/mach/system.h
+++ b/arch/arm/mach-ixp23xx/include/mach/system.h
@@ -19,7 +19,7 @@ static inline void arch_idle(void)
19#endif 19#endif
20} 20}
21 21
22static inline void arch_reset(char mode) 22static inline void arch_reset(char mode, const char *cmd)
23{ 23{
24 /* First try machine specific support */ 24 /* First try machine specific support */
25 if (machine_is_ixdp2351()) { 25 if (machine_is_ixdp2351()) {
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index d816c51320c7..70afcfe5b881 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -366,7 +366,7 @@ void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size,
366} 366}
367 367
368void __init ixp4xx_pci_preinit(void) 368void __init ixp4xx_pci_preinit(void)
369{ 369{
370 unsigned long cpuid = read_cpuid_id(); 370 unsigned long cpuid = read_cpuid_id();
371 371
372 /* 372 /*
@@ -386,17 +386,17 @@ void __init ixp4xx_pci_preinit(void)
386 386
387 pr_debug("setup PCI-AHB(inbound) and AHB-PCI(outbound) address mappings\n"); 387 pr_debug("setup PCI-AHB(inbound) and AHB-PCI(outbound) address mappings\n");
388 388
389 /* 389 /*
390 * We use identity AHB->PCI address translation 390 * We use identity AHB->PCI address translation
391 * in the 0x48000000 to 0x4bffffff address space 391 * in the 0x48000000 to 0x4bffffff address space
392 */ 392 */
393 *PCI_PCIMEMBASE = 0x48494A4B; 393 *PCI_PCIMEMBASE = 0x48494A4B;
394 394
395 /* 395 /*
396 * We also use identity PCI->AHB address translation 396 * We also use identity PCI->AHB address translation
397 * in 4 16MB BARs that begin at the physical memory start 397 * in 4 16MB BARs that begin at the physical memory start
398 */ 398 */
399 *PCI_AHBMEMBASE = (PHYS_OFFSET & 0xFF000000) + 399 *PCI_AHBMEMBASE = (PHYS_OFFSET & 0xFF000000) +
400 ((PHYS_OFFSET & 0xFF000000) >> 8) + 400 ((PHYS_OFFSET & 0xFF000000) >> 8) +
401 ((PHYS_OFFSET & 0xFF000000) >> 16) + 401 ((PHYS_OFFSET & 0xFF000000) >> 16) +
402 ((PHYS_OFFSET & 0xFF000000) >> 24) + 402 ((PHYS_OFFSET & 0xFF000000) >> 24) +
@@ -408,18 +408,19 @@ void __init ixp4xx_pci_preinit(void)
408 pr_debug("setup BARs in controller\n"); 408 pr_debug("setup BARs in controller\n");
409 409
410 /* 410 /*
411 * We configure the PCI inbound memory windows to be 411 * We configure the PCI inbound memory windows to be
412 * 1:1 mapped to SDRAM 412 * 1:1 mapped to SDRAM
413 */ 413 */
414 local_write_config(PCI_BASE_ADDRESS_0, 4, PHYS_OFFSET + 0x00000000); 414 local_write_config(PCI_BASE_ADDRESS_0, 4, PHYS_OFFSET);
415 local_write_config(PCI_BASE_ADDRESS_1, 4, PHYS_OFFSET + 0x01000000); 415 local_write_config(PCI_BASE_ADDRESS_1, 4, PHYS_OFFSET + SZ_16M);
416 local_write_config(PCI_BASE_ADDRESS_2, 4, PHYS_OFFSET + 0x02000000); 416 local_write_config(PCI_BASE_ADDRESS_2, 4, PHYS_OFFSET + SZ_32M);
417 local_write_config(PCI_BASE_ADDRESS_3, 4, PHYS_OFFSET + 0x03000000); 417 local_write_config(PCI_BASE_ADDRESS_3, 4, PHYS_OFFSET + SZ_48M);
418 418
419 /* 419 /*
420 * Enable CSR window at 0xff000000. 420 * Enable CSR window at 64 MiB to allow PCI masters
421 * to continue prefetching past 64 MiB boundary.
421 */ 422 */
422 local_write_config(PCI_BASE_ADDRESS_4, 4, 0xff000008); 423 local_write_config(PCI_BASE_ADDRESS_4, 4, PHYS_OFFSET + SZ_64M);
423 424
424 /* 425 /*
425 * Enable the IO window to be way up high, at 0xfffffc00 426 * Enable the IO window to be way up high, at 0xfffffc00
@@ -500,7 +501,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
500 return 1; 501 return 1;
501} 502}
502 503
503struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys) 504struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys)
504{ 505{
505 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); 506 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys);
506} 507}
diff --git a/arch/arm/mach-ixp4xx/include/mach/cpu.h b/arch/arm/mach-ixp4xx/include/mach/cpu.h
index 51bd69c46d94..def7773be67c 100644
--- a/arch/arm/mach-ixp4xx/include/mach/cpu.h
+++ b/arch/arm/mach-ixp4xx/include/mach/cpu.h
@@ -17,26 +17,31 @@
17#include <asm/cputype.h> 17#include <asm/cputype.h>
18 18
19/* Processor id value in CP15 Register 0 */ 19/* Processor id value in CP15 Register 0 */
20#define IXP425_PROCESSOR_ID_VALUE 0x690541c0 20#define IXP42X_PROCESSOR_ID_VALUE 0x690541c0 /* including unused 0x690541Ex */
21#define IXP435_PROCESSOR_ID_VALUE 0x69054040 21#define IXP42X_PROCESSOR_ID_MASK 0xffffffc0
22#define IXP465_PROCESSOR_ID_VALUE 0x69054200 22
23#define IXP4XX_PROCESSOR_ID_MASK 0xfffffff0 23#define IXP43X_PROCESSOR_ID_VALUE 0x69054040
24 24#define IXP43X_PROCESSOR_ID_MASK 0xfffffff0
25#define cpu_is_ixp42x() ((read_cpuid_id() & IXP4XX_PROCESSOR_ID_MASK) == \ 25
26 IXP425_PROCESSOR_ID_VALUE) 26#define IXP46X_PROCESSOR_ID_VALUE 0x69054200 /* including IXP455 */
27#define cpu_is_ixp43x() ((read_cpuid_id() & IXP4XX_PROCESSOR_ID_MASK) == \ 27#define IXP46X_PROCESSOR_ID_MASK 0xfffffff0
28 IXP435_PROCESSOR_ID_VALUE) 28
29#define cpu_is_ixp46x() ((read_cpuid_id() & IXP4XX_PROCESSOR_ID_MASK) == \ 29#define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \
30 IXP465_PROCESSOR_ID_VALUE) 30 IXP42X_PROCESSOR_ID_VALUE)
31#define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \
32 IXP43X_PROCESSOR_ID_VALUE)
33#define cpu_is_ixp46x() ((read_cpuid_id() & IXP46X_PROCESSOR_ID_MASK) == \
34 IXP46X_PROCESSOR_ID_VALUE)
31 35
32static inline u32 ixp4xx_read_feature_bits(void) 36static inline u32 ixp4xx_read_feature_bits(void)
33{ 37{
34 unsigned int val = ~*IXP4XX_EXP_CFG2; 38 unsigned int val = ~*IXP4XX_EXP_CFG2;
35 val &= ~IXP4XX_FEATURE_RESERVED;
36 if (!cpu_is_ixp46x())
37 val &= ~IXP4XX_FEATURE_IXP46X_ONLY;
38 39
39 return val; 40 if (cpu_is_ixp42x())
41 return val & IXP42X_FEATURE_MASK;
42 if (cpu_is_ixp43x())
43 return val & IXP43X_FEATURE_MASK;
44 return val & IXP46X_FEATURE_MASK;
40} 45}
41 46
42static inline void ixp4xx_write_feature_bits(u32 value) 47static inline void ixp4xx_write_feature_bits(u32 value)
diff --git a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
index ad9c888dd850..97c530f66e78 100644
--- a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
+++ b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
@@ -604,6 +604,7 @@
604#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ 604#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
605 605
606/* "fuse" bits of IXP_EXP_CFG2 */ 606/* "fuse" bits of IXP_EXP_CFG2 */
607/* All IXP4xx CPUs */
607#define IXP4XX_FEATURE_RCOMP (1 << 0) 608#define IXP4XX_FEATURE_RCOMP (1 << 0)
608#define IXP4XX_FEATURE_USB_DEVICE (1 << 1) 609#define IXP4XX_FEATURE_USB_DEVICE (1 << 1)
609#define IXP4XX_FEATURE_HASH (1 << 2) 610#define IXP4XX_FEATURE_HASH (1 << 2)
@@ -619,20 +620,41 @@
619#define IXP4XX_FEATURE_RESET_NPEB (1 << 12) 620#define IXP4XX_FEATURE_RESET_NPEB (1 << 12)
620#define IXP4XX_FEATURE_RESET_NPEC (1 << 13) 621#define IXP4XX_FEATURE_RESET_NPEC (1 << 13)
621#define IXP4XX_FEATURE_PCI (1 << 14) 622#define IXP4XX_FEATURE_PCI (1 << 14)
622#define IXP4XX_FEATURE_ECC_TIMESYNC (1 << 15)
623#define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16) 623#define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16)
624#define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22)
625#define IXP42X_FEATURE_MASK (IXP4XX_FEATURE_RCOMP | \
626 IXP4XX_FEATURE_USB_DEVICE | \
627 IXP4XX_FEATURE_HASH | \
628 IXP4XX_FEATURE_AES | \
629 IXP4XX_FEATURE_DES | \
630 IXP4XX_FEATURE_HDLC | \
631 IXP4XX_FEATURE_AAL | \
632 IXP4XX_FEATURE_HSS | \
633 IXP4XX_FEATURE_UTOPIA | \
634 IXP4XX_FEATURE_NPEB_ETH0 | \
635 IXP4XX_FEATURE_NPEC_ETH | \
636 IXP4XX_FEATURE_RESET_NPEA | \
637 IXP4XX_FEATURE_RESET_NPEB | \
638 IXP4XX_FEATURE_RESET_NPEC | \
639 IXP4XX_FEATURE_PCI | \
640 IXP4XX_FEATURE_UTOPIA_PHY_LIMIT | \
641 IXP4XX_FEATURE_XSCALE_MAX_FREQ)
642
643
644/* IXP43x/46x CPUs */
645#define IXP4XX_FEATURE_ECC_TIMESYNC (1 << 15)
624#define IXP4XX_FEATURE_USB_HOST (1 << 18) 646#define IXP4XX_FEATURE_USB_HOST (1 << 18)
625#define IXP4XX_FEATURE_NPEA_ETH (1 << 19) 647#define IXP4XX_FEATURE_NPEA_ETH (1 << 19)
648#define IXP43X_FEATURE_MASK (IXP42X_FEATURE_MASK | \
649 IXP4XX_FEATURE_ECC_TIMESYNC | \
650 IXP4XX_FEATURE_USB_HOST | \
651 IXP4XX_FEATURE_NPEA_ETH)
652
653/* IXP46x CPU (including IXP455) only */
626#define IXP4XX_FEATURE_NPEB_ETH_1_TO_3 (1 << 20) 654#define IXP4XX_FEATURE_NPEB_ETH_1_TO_3 (1 << 20)
627#define IXP4XX_FEATURE_RSA (1 << 21) 655#define IXP4XX_FEATURE_RSA (1 << 21)
628#define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22) 656#define IXP46X_FEATURE_MASK (IXP43X_FEATURE_MASK | \
629#define IXP4XX_FEATURE_RESERVED (0xFF << 24) 657 IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
630 658 IXP4XX_FEATURE_RSA)
631#define IXP4XX_FEATURE_IXP46X_ONLY (IXP4XX_FEATURE_ECC_TIMESYNC | \
632 IXP4XX_FEATURE_USB_HOST | \
633 IXP4XX_FEATURE_NPEA_ETH | \
634 IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
635 IXP4XX_FEATURE_RSA | \
636 IXP4XX_FEATURE_XSCALE_MAX_FREQ)
637 659
638#endif 660#endif
diff --git a/arch/arm/mach-ixp4xx/include/mach/system.h b/arch/arm/mach-ixp4xx/include/mach/system.h
index 92a7e8ddf69a..d2aa26f5acd7 100644
--- a/arch/arm/mach-ixp4xx/include/mach/system.h
+++ b/arch/arm/mach-ixp4xx/include/mach/system.h
@@ -20,7 +20,7 @@ static inline void arch_idle(void)
20} 20}
21 21
22 22
23static inline void arch_reset(char mode) 23static inline void arch_reset(char mode, const char *cmd)
24{ 24{
25 if ( 1 && mode == 's') { 25 if ( 1 && mode == 's') {
26 /* Jump into ROM at address 0 */ 26 /* Jump into ROM at address 0 */
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_npe.c b/arch/arm/mach-ixp4xx/ixp4xx_npe.c
index c73a94d0ca2b..252310234903 100644
--- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c
+++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c
@@ -575,8 +575,8 @@ int npe_load_firmware(struct npe *npe, const char *name, struct device *dev)
575 for (i = 0; i < image->size; i++) 575 for (i = 0; i < image->size; i++)
576 image->data[i] = swab32(image->data[i]); 576 image->data[i] = swab32(image->data[i]);
577 577
578 if (!cpu_is_ixp46x() && ((image->id >> 28) & 0xF /* device ID */)) { 578 if (cpu_is_ixp42x() && ((image->id >> 28) & 0xF /* device ID */)) {
579 print_npe(KERN_INFO, npe, "IXP46x firmware ignored on " 579 print_npe(KERN_INFO, npe, "IXP43x/IXP46x firmware ignored on "
580 "IXP42x\n"); 580 "IXP42x\n");
581 goto err; 581 goto err;
582 } 582 }
@@ -596,7 +596,7 @@ int npe_load_firmware(struct npe *npe, const char *name, struct device *dev)
596 "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, 596 "revision 0x%X:%X\n", (image->id >> 16) & 0xFF,
597 (image->id >> 8) & 0xFF, image->id & 0xFF); 597 (image->id >> 8) & 0xFF, image->id & 0xFF);
598 598
599 if (!cpu_is_ixp46x()) { 599 if (cpu_is_ixp42x()) {
600 if (!npe->id) 600 if (!npe->id)
601 instr_size = NPE_A_42X_INSTR_SIZE; 601 instr_size = NPE_A_42X_INSTR_SIZE;
602 else 602 else
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 3600cd9f0519..b5421cccd7e1 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -20,6 +20,18 @@ config MACH_RD88F6281
20 Say 'Y' here if you want your kernel to support the 20 Say 'Y' here if you want your kernel to support the
21 Marvell RD-88F6281 Reference Board. 21 Marvell RD-88F6281 Reference Board.
22 22
23config MACH_SHEEVAPLUG
24 bool "Marvell SheevaPlug Reference Board"
25 help
26 Say 'Y' here if you want your kernel to support the
27 Marvell SheevaPlug Reference Board.
28
29config MACH_TS219
30 bool "QNAP TS-119 and TS-219 Turbo NAS"
31 help
32 Say 'Y' here if you want your kernel to support the
33 QNAP TS-119 and TS-219 Turbo NAS devices.
34
23endmenu 35endmenu
24 36
25endif 37endif
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index b96c55dad343..8f03c9b9bdd9 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,5 +1,7 @@
1obj-y += common.o addr-map.o irq.o pcie.o 1obj-y += common.o addr-map.o irq.o pcie.o mpp.o
2 2
3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o 3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o
4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o 4obj-$(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_SHEEVAPLUG) += sheevaplug-setup.o
7obj-$(CONFIG_MACH_TS219) += ts219-setup.o
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index b3404b7775b3..3d2fae846512 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -14,6 +14,7 @@
14#include <linux/serial_8250.h> 14#include <linux/serial_8250.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/mv643xx_i2c.h>
17#include <linux/ata_platform.h> 18#include <linux/ata_platform.h>
18#include <linux/spi/orion_spi.h> 19#include <linux/spi/orion_spi.h>
19#include <net/dsa.h> 20#include <net/dsa.h>
@@ -24,6 +25,7 @@
24#include <mach/kirkwood.h> 25#include <mach/kirkwood.h>
25#include <plat/cache-feroceon-l2.h> 26#include <plat/cache-feroceon-l2.h>
26#include <plat/ehci-orion.h> 27#include <plat/ehci-orion.h>
28#include <plat/mvsdio.h>
27#include <plat/mv_xor.h> 29#include <plat/mv_xor.h>
28#include <plat/orion_nand.h> 30#include <plat/orion_nand.h>
29#include <plat/time.h> 31#include <plat/time.h>
@@ -231,14 +233,17 @@ static struct platform_device kirkwood_switch_device = {
231 233
232void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq) 234void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq)
233{ 235{
236 int i;
237
234 if (irq != NO_IRQ) { 238 if (irq != NO_IRQ) {
235 kirkwood_switch_resources[0].start = irq; 239 kirkwood_switch_resources[0].start = irq;
236 kirkwood_switch_resources[0].end = irq; 240 kirkwood_switch_resources[0].end = irq;
237 kirkwood_switch_device.num_resources = 1; 241 kirkwood_switch_device.num_resources = 1;
238 } 242 }
239 243
240 d->mii_bus = &kirkwood_ge00_shared.dev;
241 d->netdev = &kirkwood_ge00.dev; 244 d->netdev = &kirkwood_ge00.dev;
245 for (i = 0; i < d->nr_chips; i++)
246 d->chip[i].mii_bus = &kirkwood_ge00_shared.dev;
242 kirkwood_switch_device.dev.platform_data = d; 247 kirkwood_switch_device.dev.platform_data = d;
243 248
244 platform_device_register(&kirkwood_switch_device); 249 platform_device_register(&kirkwood_switch_device);
@@ -254,7 +259,7 @@ static struct resource kirkwood_rtc_resource = {
254 .flags = IORESOURCE_MEM, 259 .flags = IORESOURCE_MEM,
255}; 260};
256 261
257void __init kirkwood_rtc_init(void) 262static void __init kirkwood_rtc_init(void)
258{ 263{
259 platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1); 264 platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1);
260} 265}
@@ -296,6 +301,50 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
296 301
297 302
298/***************************************************************************** 303/*****************************************************************************
304 * SD/SDIO/MMC
305 ****************************************************************************/
306static struct resource mvsdio_resources[] = {
307 [0] = {
308 .start = SDIO_PHYS_BASE,
309 .end = SDIO_PHYS_BASE + SZ_1K - 1,
310 .flags = IORESOURCE_MEM,
311 },
312 [1] = {
313 .start = IRQ_KIRKWOOD_SDIO,
314 .end = IRQ_KIRKWOOD_SDIO,
315 .flags = IORESOURCE_IRQ,
316 },
317};
318
319static u64 mvsdio_dmamask = 0xffffffffUL;
320
321static struct platform_device kirkwood_sdio = {
322 .name = "mvsdio",
323 .id = -1,
324 .dev = {
325 .dma_mask = &mvsdio_dmamask,
326 .coherent_dma_mask = 0xffffffff,
327 },
328 .num_resources = ARRAY_SIZE(mvsdio_resources),
329 .resource = mvsdio_resources,
330};
331
332void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
333{
334 u32 dev, rev;
335
336 kirkwood_pcie_id(&dev, &rev);
337 if (rev == 0) /* catch all Kirkwood Z0's */
338 mvsdio_data->clock = 100000000;
339 else
340 mvsdio_data->clock = 200000000;
341 mvsdio_data->dram = &kirkwood_mbus_dram_info;
342 kirkwood_sdio.dev.platform_data = mvsdio_data;
343 platform_device_register(&kirkwood_sdio);
344}
345
346
347/*****************************************************************************
299 * SPI 348 * SPI
300 ****************************************************************************/ 349 ****************************************************************************/
301static struct orion_spi_info kirkwood_spi_plat_data = { 350static struct orion_spi_info kirkwood_spi_plat_data = {
@@ -326,6 +375,45 @@ void __init kirkwood_spi_init()
326 375
327 376
328/***************************************************************************** 377/*****************************************************************************
378 * I2C
379 ****************************************************************************/
380static struct mv64xxx_i2c_pdata kirkwood_i2c_pdata = {
381 .freq_m = 8, /* assumes 166 MHz TCLK */
382 .freq_n = 3,
383 .timeout = 1000, /* Default timeout of 1 second */
384};
385
386static struct resource kirkwood_i2c_resources[] = {
387 {
388 .name = "i2c",
389 .start = I2C_PHYS_BASE,
390 .end = I2C_PHYS_BASE + 0x1f,
391 .flags = IORESOURCE_MEM,
392 }, {
393 .name = "i2c",
394 .start = IRQ_KIRKWOOD_TWSI,
395 .end = IRQ_KIRKWOOD_TWSI,
396 .flags = IORESOURCE_IRQ,
397 },
398};
399
400static struct platform_device kirkwood_i2c = {
401 .name = MV64XXX_I2C_CTLR_NAME,
402 .id = 0,
403 .num_resources = ARRAY_SIZE(kirkwood_i2c_resources),
404 .resource = kirkwood_i2c_resources,
405 .dev = {
406 .platform_data = &kirkwood_i2c_pdata,
407 },
408};
409
410void __init kirkwood_i2c_init(void)
411{
412 platform_device_register(&kirkwood_i2c);
413}
414
415
416/*****************************************************************************
329 * UART0 417 * UART0
330 ****************************************************************************/ 418 ****************************************************************************/
331static struct plat_serial8250_port kirkwood_uart0_data[] = { 419static struct plat_serial8250_port kirkwood_uart0_data[] = {
@@ -502,7 +590,7 @@ static struct platform_device kirkwood_xor01_channel = {
502 }, 590 },
503}; 591};
504 592
505void __init kirkwood_xor0_init(void) 593static void __init kirkwood_xor0_init(void)
506{ 594{
507 platform_device_register(&kirkwood_xor0_shared); 595 platform_device_register(&kirkwood_xor0_shared);
508 596
@@ -600,7 +688,7 @@ static struct platform_device kirkwood_xor11_channel = {
600 }, 688 },
601}; 689};
602 690
603void __init kirkwood_xor1_init(void) 691static void __init kirkwood_xor1_init(void)
604{ 692{
605 platform_device_register(&kirkwood_xor1_shared); 693 platform_device_register(&kirkwood_xor1_shared);
606 694
@@ -708,4 +796,9 @@ void __init kirkwood_init(void)
708#ifdef CONFIG_CACHE_FEROCEON_L2 796#ifdef CONFIG_CACHE_FEROCEON_L2
709 kirkwood_l2_init(); 797 kirkwood_l2_init();
710#endif 798#endif
799
800 /* internal devices that every board has */
801 kirkwood_rtc_init();
802 kirkwood_xor0_init();
803 kirkwood_xor1_init();
711} 804}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index fe367c18e722..6ee88406f381 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -14,6 +14,7 @@
14struct dsa_platform_data; 14struct dsa_platform_data;
15struct mv643xx_eth_platform_data; 15struct mv643xx_eth_platform_data;
16struct mv_sata_platform_data; 16struct mv_sata_platform_data;
17struct mvsdio_platform_data;
17 18
18/* 19/*
19 * Basic Kirkwood init functions used early by machine-setup. 20 * Basic Kirkwood init functions used early by machine-setup.
@@ -33,14 +34,14 @@ void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
33void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data); 34void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data);
34void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq); 35void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq);
35void kirkwood_pcie_init(void); 36void kirkwood_pcie_init(void);
36void kirkwood_rtc_init(void);
37void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); 37void kirkwood_sata_init(struct mv_sata_platform_data *sata_data);
38void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data);
38void kirkwood_spi_init(void); 39void kirkwood_spi_init(void);
40void kirkwood_i2c_init(void);
39void kirkwood_uart0_init(void); 41void kirkwood_uart0_init(void);
40void kirkwood_uart1_init(void); 42void kirkwood_uart1_init(void);
41void kirkwood_xor0_init(void);
42void kirkwood_xor1_init(void);
43 43
44extern int kirkwood_tclk;
44extern struct sys_timer kirkwood_timer; 45extern struct sys_timer kirkwood_timer;
45 46
46 47
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index a14c2948c62a..5505d5837752 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -11,18 +11,59 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/nand.h> 14#include <linux/mtd/nand.h>
18#include <linux/timer.h> 15#include <linux/mtd/partitions.h>
19#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
20#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
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#include <asm/mach/pci.h>
24#include <mach/kirkwood.h> 20#include <mach/kirkwood.h>
21#include <plat/orion_nand.h>
22#include <plat/mvsdio.h>
25#include "common.h" 23#include "common.h"
24#include "mpp.h"
25
26static struct mtd_partition db88f6281_nand_parts[] = {
27 {
28 .name = "u-boot",
29 .offset = 0,
30 .size = SZ_1M
31 }, {
32 .name = "uImage",
33 .offset = MTDPART_OFS_NXTBLK,
34 .size = SZ_4M
35 }, {
36 .name = "root",
37 .offset = MTDPART_OFS_NXTBLK,
38 .size = MTDPART_SIZ_FULL
39 },
40};
41
42static struct resource db88f6281_nand_resource = {
43 .flags = IORESOURCE_MEM,
44 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
45 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
46 KIRKWOOD_NAND_MEM_SIZE - 1,
47};
48
49static struct orion_nand_data db88f6281_nand_data = {
50 .parts = db88f6281_nand_parts,
51 .nr_parts = ARRAY_SIZE(db88f6281_nand_parts),
52 .cle = 0,
53 .ale = 1,
54 .width = 8,
55 .chip_delay = 25,
56};
57
58static struct platform_device db88f6281_nand_flash = {
59 .name = "orion_nand",
60 .id = -1,
61 .dev = {
62 .platform_data = &db88f6281_nand_data,
63 },
64 .resource = &db88f6281_nand_resource,
65 .num_resources = 1,
66};
26 67
27static struct mv643xx_eth_platform_data db88f6281_ge00_data = { 68static struct mv643xx_eth_platform_data db88f6281_ge00_data = {
28 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 69 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
@@ -32,18 +73,32 @@ static struct mv_sata_platform_data db88f6281_sata_data = {
32 .n_ports = 2, 73 .n_ports = 2,
33}; 74};
34 75
76static struct mvsdio_platform_data db88f6281_mvsdio_data = {
77 .gpio_write_protect = 37,
78 .gpio_card_detect = 38,
79};
80
81static unsigned int db88f6281_mpp_config[] __initdata = {
82 MPP37_GPIO,
83 MPP38_GPIO,
84 0
85};
86
35static void __init db88f6281_init(void) 87static void __init db88f6281_init(void)
36{ 88{
37 /* 89 /*
38 * Basic setup. Needs to be called early. 90 * Basic setup. Needs to be called early.
39 */ 91 */
40 kirkwood_init(); 92 kirkwood_init();
93 kirkwood_mpp_conf(db88f6281_mpp_config);
41 94
42 kirkwood_ehci_init(); 95 kirkwood_ehci_init();
43 kirkwood_ge00_init(&db88f6281_ge00_data); 96 kirkwood_ge00_init(&db88f6281_ge00_data);
44 kirkwood_rtc_init();
45 kirkwood_sata_init(&db88f6281_sata_data); 97 kirkwood_sata_init(&db88f6281_sata_data);
46 kirkwood_uart0_init(); 98 kirkwood_uart0_init();
99 kirkwood_sdio_init(&db88f6281_mvsdio_data);
100
101 platform_device_register(&db88f6281_nand_flash);
47} 102}
48 103
49static int __init db88f6281_pci_init(void) 104static int __init db88f6281_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index ada480c0e197..38c986853590 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -93,6 +93,7 @@
93#define DEVICE_ID (DEV_BUS_VIRT_BASE | 0x0034) 93#define DEVICE_ID (DEV_BUS_VIRT_BASE | 0x0034)
94#define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0300) 94#define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0300)
95#define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0600) 95#define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0600)
96#define I2C_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000)
96#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) 97#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000)
97#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) 98#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000)
98#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) 99#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100)
@@ -116,5 +117,7 @@
116 117
117#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) 118#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000)
118 119
120#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000)
121
119 122
120#endif 123#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/system.h b/arch/arm/mach-kirkwood/include/mach/system.h
index 8510f6cfdabf..23a1914c1da8 100644
--- a/arch/arm/mach-kirkwood/include/mach/system.h
+++ b/arch/arm/mach-kirkwood/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
17 cpu_do_idle(); 17 cpu_do_idle();
18} 18}
19 19
20static inline void arch_reset(char mode) 20static inline void arch_reset(char mode, const char *cmd)
21{ 21{
22 /* 22 /*
23 * Enable soft reset to assert RSTOUTn. 23 * Enable soft reset to assert RSTOUTn.
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c
new file mode 100644
index 000000000000..63c44934391a
--- /dev/null
+++ b/arch/arm/mach-kirkwood/mpp.c
@@ -0,0 +1,97 @@
1/*
2 * arch/arm/mach-kirkwood/mpp.c
3 *
4 * MPP functions for Marvell Kirkwood SoCs
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/gpio.h>
16#include <mach/hardware.h>
17#include "common.h"
18#include "mpp.h"
19
20static unsigned int __init kirkwood_variant(void)
21{
22 u32 dev, rev;
23
24 kirkwood_pcie_id(&dev, &rev);
25
26 if (dev == MV88F6281_DEV_ID && rev >= MV88F6281_REV_A0)
27 return MPP_F6281_MASK;
28 if (dev == MV88F6192_DEV_ID && rev >= MV88F6192_REV_A0)
29 return MPP_F6192_MASK;
30 if (dev == MV88F6180_DEV_ID)
31 return MPP_F6180_MASK;
32
33 printk(KERN_ERR "MPP setup: unknown kirkwood variant "
34 "(dev %#x rev %#x)\n", dev, rev);
35 return 0;
36}
37
38#define MPP_CTRL(i) (DEV_BUS_VIRT_BASE + (i) * 4)
39#define MPP_NR_REGS (1 + MPP_MAX/8)
40
41void __init kirkwood_mpp_conf(unsigned int *mpp_list)
42{
43 u32 mpp_ctrl[MPP_NR_REGS];
44 unsigned int variant_mask;
45 int i;
46
47 variant_mask = kirkwood_variant();
48 if (!variant_mask)
49 return;
50
51 printk(KERN_DEBUG "initial MPP regs:");
52 for (i = 0; i < MPP_NR_REGS; i++) {
53 mpp_ctrl[i] = readl(MPP_CTRL(i));
54 printk(" %08x", mpp_ctrl[i]);
55 }
56 printk("\n");
57
58 while (*mpp_list) {
59 unsigned int num = MPP_NUM(*mpp_list);
60 unsigned int sel = MPP_SEL(*mpp_list);
61 int shift, gpio_mode;
62
63 if (num > MPP_MAX) {
64 printk(KERN_ERR "kirkwood_mpp_conf: invalid MPP "
65 "number (%u)\n", num);
66 continue;
67 }
68 if (!(*mpp_list & variant_mask)) {
69 printk(KERN_WARNING
70 "kirkwood_mpp_conf: requested MPP%u config "
71 "unavailable on this hardware\n", num);
72 continue;
73 }
74
75 shift = (num & 7) << 2;
76 mpp_ctrl[num / 8] &= ~(0xf << shift);
77 mpp_ctrl[num / 8] |= sel << shift;
78
79 gpio_mode = 0;
80 if (*mpp_list & MPP_INPUT_MASK)
81 gpio_mode |= GPIO_INPUT_OK;
82 if (*mpp_list & MPP_OUTPUT_MASK)
83 gpio_mode |= GPIO_OUTPUT_OK;
84 if (sel != 0)
85 gpio_mode = 0;
86 orion_gpio_set_valid(num, gpio_mode);
87
88 mpp_list++;
89 }
90
91 printk(KERN_DEBUG " final MPP regs:");
92 for (i = 0; i < MPP_NR_REGS; i++) {
93 writel(mpp_ctrl[i], MPP_CTRL(i));
94 printk(" %08x", mpp_ctrl[i]);
95 }
96 printk("\n");
97}
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h
new file mode 100644
index 000000000000..e021a80c2caf
--- /dev/null
+++ b/arch/arm/mach-kirkwood/mpp.h
@@ -0,0 +1,303 @@
1/*
2 * linux/arch/arm/mach-kirkwood/mpp.h -- Multi Purpose Pins
3 *
4 * Copyright 2009: Marvell Technology Group Ltd.
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 __KIRKWOOD_MPP_H
12#define __KIRKWOOD_MPP_H
13
14#define MPP(_num, _sel, _in, _out, _F6180, _F6190, _F6192, _F6281) ( \
15 /* MPP number */ ((_num) & 0xff) | \
16 /* MPP select value */ (((_sel) & 0xf) << 8) | \
17 /* may be input signal */ ((!!(_in)) << 12) | \
18 /* may be output signal */ ((!!(_out)) << 13) | \
19 /* available on F6180 */ ((!!(_F6180)) << 14) | \
20 /* available on F6190 */ ((!!(_F6190)) << 15) | \
21 /* available on F6192 */ ((!!(_F6192)) << 16) | \
22 /* available on F6281 */ ((!!(_F6281)) << 17))
23
24#define MPP_NUM(x) ((x) & 0xff)
25#define MPP_SEL(x) (((x) >> 8) & 0xf)
26
27 /* num sel i o 6180 6190 6192 6281 */
28
29#define MPP_INPUT_MASK MPP( 0, 0x0, 1, 0, 0, 0, 0, 0 )
30#define MPP_OUTPUT_MASK MPP( 0, 0x0, 0, 1, 0, 0, 0, 0 )
31
32#define MPP_F6180_MASK MPP( 0, 0x0, 0, 0, 1, 0, 0, 0 )
33#define MPP_F6190_MASK MPP( 0, 0x0, 0, 0, 0, 1, 0, 0 )
34#define MPP_F6192_MASK MPP( 0, 0x0, 0, 0, 0, 0, 1, 0 )
35#define MPP_F6281_MASK MPP( 0, 0x0, 0, 0, 0, 0, 0, 1 )
36
37#define MPP0_GPIO MPP( 0, 0x0, 1, 1, 1, 1, 1, 1 )
38#define MPP0_NF_IO2 MPP( 0, 0x1, 1, 1, 1, 1, 1, 1 )
39#define MPP0_SPI_SCn MPP( 0, 0x2, 0, 1, 1, 1, 1, 1 )
40
41#define MPP1_GPO MPP( 1, 0x0, 0, 1, 1, 1, 1, 1 )
42#define MPP1_NF_IO3 MPP( 1, 0x1, 1, 1, 1, 1, 1, 1 )
43#define MPP1_SPI_MOSI MPP( 1, 0x2, 0, 1, 1, 1, 1, 1 )
44
45#define MPP2_GPO MPP( 2, 0x0, 0, 1, 1, 1, 1, 1 )
46#define MPP2_NF_IO4 MPP( 2, 0x1, 1, 1, 1, 1, 1, 1 )
47#define MPP2_SPI_SCK MPP( 2, 0x2, 0, 1, 1, 1, 1, 1 )
48
49#define MPP3_GPO MPP( 3, 0x0, 0, 1, 1, 1, 1, 1 )
50#define MPP3_NF_IO5 MPP( 3, 0x1, 1, 1, 1, 1, 1, 1 )
51#define MPP3_SPI_MISO MPP( 3, 0x2, 1, 0, 1, 1, 1, 1 )
52
53#define MPP4_GPIO MPP( 4, 0x0, 1, 1, 1, 1, 1, 1 )
54#define MPP4_NF_IO6 MPP( 4, 0x1, 1, 1, 1, 1, 1, 1 )
55#define MPP4_UART0_RXD MPP( 4, 0x2, 1, 0, 1, 1, 1, 1 )
56#define MPP4_SATA1_ACTn MPP( 4, 0x5, 0, 1, 0, 0, 1, 1 )
57#define MPP4_PTP_CLK MPP( 4, 0xd, 1, 0, 1, 1, 1, 1 )
58
59#define MPP5_GPO MPP( 5, 0x0, 0, 1, 1, 1, 1, 1 )
60#define MPP5_NF_IO7 MPP( 5, 0x1, 1, 1, 1, 1, 1, 1 )
61#define MPP5_UART0_TXD MPP( 5, 0x2, 0, 1, 1, 1, 1, 1 )
62#define MPP5_PTP_TRIG_GEN MPP( 5, 0x4, 0, 1, 1, 1, 1, 1 )
63#define MPP5_SATA0_ACTn MPP( 5, 0x5, 0, 1, 0, 1, 1, 1 )
64
65#define MPP6_SYSRST_OUTn MPP( 6, 0x1, 0, 1, 1, 1, 1, 1 )
66#define MPP6_SPI_MOSI MPP( 6, 0x2, 0, 1, 1, 1, 1, 1 )
67#define MPP6_PTP_TRIG_GEN MPP( 6, 0x3, 0, 1, 1, 1, 1, 1 )
68
69#define MPP7_GPO MPP( 7, 0x0, 0, 1, 1, 1, 1, 1 )
70#define MPP7_PEX_RST_OUTn MPP( 7, 0x1, 0, 1, 1, 1, 1, 1 )
71#define MPP7_SPI_SCn MPP( 7, 0x2, 0, 1, 1, 1, 1, 1 )
72#define MPP7_PTP_TRIG_GEN MPP( 7, 0x3, 0, 1, 1, 1, 1, 1 )
73
74#define MPP8_GPIO MPP( 8, 0x0, 1, 1, 1, 1, 1, 1 )
75#define MPP8_TW_SDA MPP( 8, 0x1, 1, 1, 1, 1, 1, 1 )
76#define MPP8_UART0_RTS MPP( 8, 0x2, 0, 1, 1, 1, 1, 1 )
77#define MPP8_UART1_RTS MPP( 8, 0x3, 0, 1, 1, 1, 1, 1 )
78#define MPP8_MII0_RXERR MPP( 8, 0x4, 1, 0, 0, 1, 1, 1 )
79#define MPP8_SATA1_PRESENTn MPP( 8, 0x5, 0, 1, 0, 0, 1, 1 )
80#define MPP8_PTP_CLK MPP( 8, 0xc, 1, 0, 1, 1, 1, 1 )
81#define MPP8_MII0_COL MPP( 8, 0xd, 1, 0, 1, 1, 1, 1 )
82
83#define MPP9_GPIO MPP( 9, 0x0, 1, 1, 1, 1, 1, 1 )
84#define MPP9_TW_SCK MPP( 9, 0x1, 1, 1, 1, 1, 1, 1 )
85#define MPP9_UART0_CTS MPP( 9, 0x2, 1, 0, 1, 1, 1, 1 )
86#define MPP9_UART1_CTS MPP( 9, 0x3, 1, 0, 1, 1, 1, 1 )
87#define MPP9_SATA0_PRESENTn MPP( 9, 0x5, 0, 1, 0, 1, 1, 1 )
88#define MPP9_PTP_EVENT_REQ MPP( 9, 0xc, 1, 0, 1, 1, 1, 1 )
89#define MPP9_MII0_CRS MPP( 9, 0xd, 1, 0, 1, 1, 1, 1 )
90
91#define MPP10_GPO MPP( 10, 0x0, 0, 1, 1, 1, 1, 1 )
92#define MPP10_SPI_SCK MPP( 10, 0x2, 0, 1, 1, 1, 1, 1 )
93#define MPP10_UART0_TXD MPP( 10, 0X3, 0, 1, 1, 1, 1, 1 )
94#define MPP10_SATA1_ACTn MPP( 10, 0x5, 0, 1, 0, 0, 1, 1 )
95#define MPP10_PTP_TRIG_GEN MPP( 10, 0xc, 0, 1, 1, 1, 1, 1 )
96
97#define MPP11_GPIO MPP( 11, 0x0, 1, 1, 1, 1, 1, 1 )
98#define MPP11_SPI_MISO MPP( 11, 0x2, 1, 0, 1, 1, 1, 1 )
99#define MPP11_UART0_RXD MPP( 11, 0x3, 1, 0, 1, 1, 1, 1 )
100#define MPP11_PTP_EVENT_REQ MPP( 11, 0x4, 1, 0, 1, 1, 1, 1 )
101#define MPP11_PTP_TRIG_GEN MPP( 11, 0xc, 0, 1, 1, 1, 1, 1 )
102#define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1 )
103#define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1 )
104
105#define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1 )
106#define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1 )
107
108#define MPP13_GPIO MPP( 13, 0x0, 1, 1, 1, 1, 1, 1 )
109#define MPP13_SD_CMD MPP( 13, 0x1, 1, 1, 1, 1, 1, 1 )
110#define MPP13_UART1_TXD MPP( 13, 0x3, 0, 1, 1, 1, 1, 1 )
111
112#define MPP14_GPIO MPP( 14, 0x0, 1, 1, 1, 1, 1, 1 )
113#define MPP14_SD_D0 MPP( 14, 0x1, 1, 1, 1, 1, 1, 1 )
114#define MPP14_UART1_RXD MPP( 14, 0x3, 1, 0, 1, 1, 1, 1 )
115#define MPP14_SATA1_PRESENTn MPP( 14, 0x4, 0, 1, 0, 0, 1, 1 )
116#define MPP14_MII0_COL MPP( 14, 0xd, 1, 0, 1, 1, 1, 1 )
117
118#define MPP15_GPIO MPP( 15, 0x0, 1, 1, 1, 1, 1, 1 )
119#define MPP15_SD_D1 MPP( 15, 0x1, 1, 1, 1, 1, 1, 1 )
120#define MPP15_UART0_RTS MPP( 15, 0x2, 0, 1, 1, 1, 1, 1 )
121#define MPP15_UART1_TXD MPP( 15, 0x3, 0, 1, 1, 1, 1, 1 )
122#define MPP15_SATA0_ACTn MPP( 15, 0x4, 0, 1, 0, 1, 1, 1 )
123
124#define MPP16_GPIO MPP( 16, 0x0, 1, 1, 1, 1, 1, 1 )
125#define MPP16_SD_D2 MPP( 16, 0x1, 1, 1, 1, 1, 1, 1 )
126#define MPP16_UART0_CTS MPP( 16, 0x2, 1, 0, 1, 1, 1, 1 )
127#define MPP16_UART1_RXD MPP( 16, 0x3, 1, 0, 1, 1, 1, 1 )
128#define MPP16_SATA1_ACTn MPP( 16, 0x4, 0, 1, 0, 0, 1, 1 )
129#define MPP16_MII0_CRS MPP( 16, 0xd, 1, 0, 1, 1, 1, 1 )
130
131#define MPP17_GPIO MPP( 17, 0x0, 1, 1, 1, 1, 1, 1 )
132#define MPP17_SD_D3 MPP( 17, 0x1, 1, 1, 1, 1, 1, 1 )
133#define MPP17_SATA0_PRESENTn MPP( 17, 0x4, 0, 1, 0, 1, 1, 1 )
134
135#define MPP18_GPO MPP( 18, 0x0, 0, 1, 1, 1, 1, 1 )
136#define MPP18_NF_IO0 MPP( 18, 0x1, 1, 1, 1, 1, 1, 1 )
137
138#define MPP19_GPO MPP( 19, 0x0, 0, 1, 1, 1, 1, 1 )
139#define MPP19_NF_IO1 MPP( 19, 0x1, 1, 1, 1, 1, 1, 1 )
140
141#define MPP20_GPIO MPP( 20, 0x0, 1, 1, 0, 1, 1, 1 )
142#define MPP20_TSMP0 MPP( 20, 0x1, 1, 1, 0, 0, 1, 1 )
143#define MPP20_TDM_CH0_TX_QL MPP( 20, 0x2, 0, 1, 0, 0, 1, 1 )
144#define MPP20_GE1_0 MPP( 20, 0x3, 0, 0, 0, 1, 1, 1 )
145#define MPP20_AUDIO_SPDIFI MPP( 20, 0x4, 1, 0, 0, 0, 1, 1 )
146#define MPP20_SATA1_ACTn MPP( 20, 0x5, 0, 1, 0, 0, 1, 1 )
147
148#define MPP21_GPIO MPP( 21, 0x0, 1, 1, 0, 1, 1, 1 )
149#define MPP21_TSMP1 MPP( 21, 0x1, 1, 1, 0, 0, 1, 1 )
150#define MPP21_TDM_CH0_RX_QL MPP( 21, 0x2, 0, 1, 0, 0, 1, 1 )
151#define MPP21_GE1_1 MPP( 21, 0x3, 0, 0, 0, 1, 1, 1 )
152#define MPP21_AUDIO_SPDIFO MPP( 21, 0x4, 0, 1, 0, 0, 1, 1 )
153#define MPP21_SATA0_ACTn MPP( 21, 0x5, 0, 1, 0, 1, 1, 1 )
154
155#define MPP22_GPIO MPP( 22, 0x0, 1, 1, 0, 1, 1, 1 )
156#define MPP22_TSMP2 MPP( 22, 0x1, 1, 1, 0, 0, 1, 1 )
157#define MPP22_TDM_CH2_TX_QL MPP( 22, 0x2, 0, 1, 0, 0, 1, 1 )
158#define MPP22_GE1_2 MPP( 22, 0x3, 0, 0, 0, 1, 1, 1 )
159#define MPP22_AUDIO_SPDIFRMKCLK MPP( 22, 0x4, 0, 1, 0, 0, 1, 1 )
160#define MPP22_SATA1_PRESENTn MPP( 22, 0x5, 0, 1, 0, 0, 1, 1 )
161
162#define MPP23_GPIO MPP( 23, 0x0, 1, 1, 0, 1, 1, 1 )
163#define MPP23_TSMP3 MPP( 23, 0x1, 1, 1, 0, 0, 1, 1 )
164#define MPP23_TDM_CH2_RX_QL MPP( 23, 0x2, 1, 0, 0, 0, 1, 1 )
165#define MPP23_GE1_3 MPP( 23, 0x3, 0, 0, 0, 1, 1, 1 )
166#define MPP23_AUDIO_I2SBCLK MPP( 23, 0x4, 0, 1, 0, 0, 1, 1 )
167#define MPP23_SATA0_PRESENTn MPP( 23, 0x5, 0, 1, 0, 1, 1, 1 )
168
169#define MPP24_GPIO MPP( 24, 0x0, 1, 1, 0, 1, 1, 1 )
170#define MPP24_TSMP4 MPP( 24, 0x1, 1, 1, 0, 0, 1, 1 )
171#define MPP24_TDM_SPI_CS0 DEV( 24, 0x2, 0, 1, 0, 0, 1, 1 )
172#define MPP24_GE1_4 MPP( 24, 0x3, 0, 0, 0, 1, 1, 1 )
173#define MPP24_AUDIO_I2SDO MPP( 24, 0x4, 0, 1, 0, 0, 1, 1 )
174
175#define MPP25_GPIO MPP( 25, 0x0, 1, 1, 0, 1, 1, 1 )
176#define MPP25_TSMP5 MPP( 25, 0x1, 1, 1, 0, 0, 1, 1 )
177#define MPP25_TDM_SPI_SCK MPP( 25, 0x2, 0, 1, 0, 0, 1, 1 )
178#define MPP25_GE1_5 MPP( 25, 0x3, 0, 0, 0, 1, 1, 1 )
179#define MPP25_AUDIO_I2SLRCLK MPP( 25, 0x4, 0, 1, 0, 0, 1, 1 )
180
181#define MPP26_GPIO MPP( 26, 0x0, 1, 1, 0, 1, 1, 1 )
182#define MPP26_TSMP6 MPP( 26, 0x1, 1, 1, 0, 0, 1, 1 )
183#define MPP26_TDM_SPI_MISO MPP( 26, 0x2, 1, 0, 0, 0, 1, 1 )
184#define MPP26_GE1_6 MPP( 26, 0x3, 0, 0, 0, 1, 1, 1 )
185#define MPP26_AUDIO_I2SMCLK MPP( 26, 0x4, 0, 1, 0, 0, 1, 1 )
186
187#define MPP27_GPIO MPP( 27, 0x0, 1, 1, 0, 1, 1, 1 )
188#define MPP27_TSMP7 MPP( 27, 0x1, 1, 1, 0, 0, 1, 1 )
189#define MPP27_TDM_SPI_MOSI MPP( 27, 0x2, 0, 1, 0, 0, 1, 1 )
190#define MPP27_GE1_7 MPP( 27, 0x3, 0, 0, 0, 1, 1, 1 )
191#define MPP27_AUDIO_I2SDI MPP( 27, 0x4, 1, 0, 0, 0, 1, 1 )
192
193#define MPP28_GPIO MPP( 28, 0x0, 1, 1, 0, 1, 1, 1 )
194#define MPP28_TSMP8 MPP( 28, 0x1, 1, 1, 0, 0, 1, 1 )
195#define MPP28_TDM_CODEC_INTn MPP( 28, 0x2, 0, 0, 0, 0, 1, 1 )
196#define MPP28_GE1_8 MPP( 28, 0x3, 0, 0, 0, 1, 1, 1 )
197#define MPP28_AUDIO_EXTCLK MPP( 28, 0x4, 1, 0, 0, 0, 1, 1 )
198
199#define MPP29_GPIO MPP( 29, 0x0, 1, 1, 0, 1, 1, 1 )
200#define MPP29_TSMP9 MPP( 29, 0x1, 1, 1, 0, 0, 1, 1 )
201#define MPP29_TDM_CODEC_RSTn MPP( 29, 0x2, 0, 0, 0, 0, 1, 1 )
202#define MPP29_GE1_9 MPP( 29, 0x3, 0, 0, 0, 1, 1, 1 )
203
204#define MPP30_GPIO MPP( 30, 0x0, 1, 1, 0, 1, 1, 1 )
205#define MPP30_TSMP10 MPP( 30, 0x1, 1, 1, 0, 0, 1, 1 )
206#define MPP30_TDM_PCLK MPP( 30, 0x2, 1, 1, 0, 0, 1, 1 )
207#define MPP30_GE1_10 MPP( 30, 0x3, 0, 0, 0, 1, 1, 1 )
208
209#define MPP31_GPIO MPP( 31, 0x0, 1, 1, 0, 1, 1, 1 )
210#define MPP31_TSMP11 MPP( 31, 0x1, 1, 1, 0, 0, 1, 1 )
211#define MPP31_TDM_FS MPP( 31, 0x2, 1, 1, 0, 0, 1, 1 )
212#define MPP31_GE1_11 MPP( 31, 0x3, 0, 0, 0, 1, 1, 1 )
213
214#define MPP32_GPIO MPP( 32, 0x0, 1, 1, 0, 1, 1, 1 )
215#define MPP32_TSMP12 MPP( 32, 0x1, 1, 1, 0, 0, 1, 1 )
216#define MPP32_TDM_DRX MPP( 32, 0x2, 1, 0, 0, 0, 1, 1 )
217#define MPP32_GE1_12 MPP( 32, 0x3, 0, 0, 0, 1, 1, 1 )
218
219#define MPP33_GPIO MPP( 33, 0x0, 1, 1, 0, 1, 1, 1 )
220#define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 )
221#define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 )
222
223#define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1 )
224#define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1 )
225#define MPP34_GE1_14 MPP( 34, 0x3, 0, 0, 0, 1, 1, 1 )
226
227#define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1 )
228#define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1 )
229#define MPP35_GE1_15 MPP( 35, 0x3, 0, 0, 0, 1, 1, 1 )
230#define MPP35_SATA0_ACTn MPP( 35, 0x5, 0, 1, 0, 1, 1, 1 )
231#define MPP35_MII0_RXERR MPP( 35, 0xc, 1, 0, 1, 1, 1, 1 )
232
233#define MPP36_GPIO MPP( 36, 0x0, 1, 1, 1, 0, 0, 1 )
234#define MPP36_TSMP0 MPP( 36, 0x1, 1, 1, 0, 0, 0, 1 )
235#define MPP36_TDM_SPI_CS1 MPP( 36, 0x2, 0, 1, 0, 0, 0, 1 )
236#define MPP36_AUDIO_SPDIFI MPP( 36, 0x4, 1, 0, 1, 0, 0, 1 )
237
238#define MPP37_GPIO MPP( 37, 0x0, 1, 1, 1, 0, 0, 1 )
239#define MPP37_TSMP1 MPP( 37, 0x1, 1, 1, 0, 0, 0, 1 )
240#define MPP37_TDM_CH2_TX_QL MPP( 37, 0x2, 0, 1, 0, 0, 0, 1 )
241#define MPP37_AUDIO_SPDIFO MPP( 37, 0x4, 0, 1, 1, 0, 0, 1 )
242
243#define MPP38_GPIO MPP( 38, 0x0, 1, 1, 1, 0, 0, 1 )
244#define MPP38_TSMP2 MPP( 38, 0x1, 1, 1, 0, 0, 0, 1 )
245#define MPP38_TDM_CH2_RX_QL MPP( 38, 0x2, 0, 1, 0, 0, 0, 1 )
246#define MPP38_AUDIO_SPDIFRMLCLK MPP( 38, 0x4, 0, 1, 1, 0, 0, 1 )
247
248#define MPP39_GPIO MPP( 39, 0x0, 1, 1, 1, 0, 0, 1 )
249#define MPP39_TSMP3 MPP( 39, 0x1, 1, 1, 0, 0, 0, 1 )
250#define MPP39_TDM_SPI_CS0 MPP( 39, 0x2, 0, 1, 0, 0, 0, 1 )
251#define MPP39_AUDIO_I2SBCLK MPP( 39, 0x4, 0, 1, 1, 0, 0, 1 )
252
253#define MPP40_GPIO MPP( 40, 0x0, 1, 1, 1, 0, 0, 1 )
254#define MPP40_TSMP4 MPP( 40, 0x1, 1, 1, 0, 0, 0, 1 )
255#define MPP40_TDM_SPI_SCK MPP( 40, 0x2, 0, 1, 0, 0, 0, 1 )
256#define MPP40_AUDIO_I2SDO MPP( 40, 0x4, 0, 1, 1, 0, 0, 1 )
257
258#define MPP41_GPIO MPP( 41, 0x0, 1, 1, 1, 0, 0, 1 )
259#define MPP41_TSMP5 MPP( 41, 0x1, 1, 1, 0, 0, 0, 1 )
260#define MPP41_TDM_SPI_MISO MPP( 41, 0x2, 1, 0, 0, 0, 0, 1 )
261#define MPP41_AUDIO_I2SLRC MPP( 41, 0x4, 0, 1, 1, 0, 0, 1 )
262
263#define MPP42_GPIO MPP( 42, 0x0, 1, 1, 1, 0, 0, 1 )
264#define MPP42_TSMP6 MPP( 42, 0x1, 1, 1, 0, 0, 0, 1 )
265#define MPP42_TDM_SPI_MOSI MPP( 42, 0x2, 0, 1, 0, 0, 0, 1 )
266#define MPP42_AUDIO_I2SMCLK MPP( 42, 0x4, 0, 1, 1, 0, 0, 1 )
267
268#define MPP43_GPIO MPP( 43, 0x0, 1, 1, 1, 0, 0, 1 )
269#define MPP43_TSMP7 MPP( 43, 0x1, 1, 1, 0, 0, 0, 1 )
270#define MPP43_TDM_CODEC_INTn MPP( 43, 0x2, 0, 0, 0, 0, 0, 1 )
271#define MPP43_AUDIO_I2SDI MPP( 43, 0x4, 1, 0, 1, 0, 0, 1 )
272
273#define MPP44_GPIO MPP( 44, 0x0, 1, 1, 1, 0, 0, 1 )
274#define MPP44_TSMP8 MPP( 44, 0x1, 1, 1, 0, 0, 0, 1 )
275#define MPP44_TDM_CODEC_RSTn MPP( 44, 0x2, 0, 0, 0, 0, 0, 1 )
276#define MPP44_AUDIO_EXTCLK MPP( 44, 0x4, 1, 0, 1, 0, 0, 1 )
277
278#define MPP45_GPIO MPP( 45, 0x0, 1, 1, 0, 0, 0, 1 )
279#define MPP45_TSMP9 MPP( 45, 0x1, 1, 1, 0, 0, 0, 1 )
280#define MPP45_TDM_PCLK MPP( 45, 0x2, 1, 1, 0, 0, 0, 1 )
281
282#define MPP46_GPIO MPP( 46, 0x0, 1, 1, 0, 0, 0, 1 )
283#define MPP46_TSMP10 MPP( 46, 0x1, 1, 1, 0, 0, 0, 1 )
284#define MPP46_TDM_FS MPP( 46, 0x2, 1, 1, 0, 0, 0, 1 )
285
286#define MPP47_GPIO MPP( 47, 0x0, 1, 1, 0, 0, 0, 1 )
287#define MPP47_TSMP11 MPP( 47, 0x1, 1, 1, 0, 0, 0, 1 )
288#define MPP47_TDM_DRX MPP( 47, 0x2, 1, 0, 0, 0, 0, 1 )
289
290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 )
291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 )
292#define MPP48_TDM_DTX MPP( 48. 0x2, 0, 1, 0, 0, 0, 1 )
293
294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 )
295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 )
296#define MPP49_TDM_CH0_RX_QL MPP( 49, 0x2, 0, 1, 0, 0, 0, 1 )
297#define MPP49_PTP_CLK MPP( 49, 0x5, 1, 0, 0, 0, 0, 1 )
298
299#define MPP_MAX 49
300
301void kirkwood_mpp_conf(unsigned int *mpp_list);
302
303#endif
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index b1d1a87a6821..2f0e4ef3db0f 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -11,11 +11,8 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/nand.h> 14#include <linux/mtd/nand.h>
18#include <linux/timer.h> 15#include <linux/mtd/partitions.h>
19#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
20#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
21#include <linux/spi/flash.h> 18#include <linux/spi/flash.h>
@@ -23,7 +20,6 @@
23#include <linux/spi/orion_spi.h> 20#include <linux/spi/orion_spi.h>
24#include <asm/mach-types.h> 21#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
26#include <asm/mach/pci.h>
27#include <mach/kirkwood.h> 23#include <mach/kirkwood.h>
28#include "common.h" 24#include "common.h"
29 25
@@ -61,14 +57,11 @@ static void __init rd88f6192_init(void)
61 57
62 kirkwood_ehci_init(); 58 kirkwood_ehci_init();
63 kirkwood_ge00_init(&rd88f6192_ge00_data); 59 kirkwood_ge00_init(&rd88f6192_ge00_data);
64 kirkwood_rtc_init();
65 kirkwood_sata_init(&rd88f6192_sata_data); 60 kirkwood_sata_init(&rd88f6192_sata_data);
66 spi_register_board_info(rd88F6192_spi_slave_info, 61 spi_register_board_info(rd88F6192_spi_slave_info,
67 ARRAY_SIZE(rd88F6192_spi_slave_info)); 62 ARRAY_SIZE(rd88F6192_spi_slave_info));
68 kirkwood_spi_init(); 63 kirkwood_spi_init();
69 kirkwood_uart0_init(); 64 kirkwood_uart0_init();
70 kirkwood_xor0_init();
71 kirkwood_xor1_init();
72} 65}
73 66
74static int __init rd88f6192_pci_init(void) 67static int __init rd88f6192_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 9a0e905d10cd..31e996d65fc4 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -11,21 +11,20 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h> 14#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/nand.h> 15#include <linux/mtd/nand.h>
18#include <linux/timer.h> 16#include <linux/mtd/partitions.h>
19#include <linux/ata_platform.h> 17#include <linux/ata_platform.h>
20#include <linux/mv643xx_eth.h> 18#include <linux/mv643xx_eth.h>
21#include <linux/ethtool.h> 19#include <linux/ethtool.h>
22#include <net/dsa.h> 20#include <net/dsa.h>
23#include <asm/mach-types.h> 21#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
25#include <asm/mach/pci.h>
26#include <mach/kirkwood.h> 23#include <mach/kirkwood.h>
24#include <plat/mvsdio.h>
27#include <plat/orion_nand.h> 25#include <plat/orion_nand.h>
28#include "common.h" 26#include "common.h"
27#include "mpp.h"
29 28
30static struct mtd_partition rd88f6281_nand_parts[] = { 29static struct mtd_partition rd88f6281_nand_parts[] = {
31 { 30 {
@@ -75,7 +74,7 @@ static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {
75 .duplex = DUPLEX_FULL, 74 .duplex = DUPLEX_FULL,
76}; 75};
77 76
78static struct dsa_platform_data rd88f6281_switch_data = { 77static struct dsa_chip_data rd88f6281_switch_chip_data = {
79 .port_names[0] = "lan1", 78 .port_names[0] = "lan1",
80 .port_names[1] = "lan2", 79 .port_names[1] = "lan2",
81 .port_names[2] = "lan3", 80 .port_names[2] = "lan3",
@@ -83,6 +82,11 @@ static struct dsa_platform_data rd88f6281_switch_data = {
83 .port_names[5] = "cpu", 82 .port_names[5] = "cpu",
84}; 83};
85 84
85static struct dsa_platform_data rd88f6281_switch_plat_data = {
86 .nr_chips = 1,
87 .chip = &rd88f6281_switch_chip_data,
88};
89
86static struct mv643xx_eth_platform_data rd88f6281_ge01_data = { 90static struct mv643xx_eth_platform_data rd88f6281_ge01_data = {
87 .phy_addr = MV643XX_ETH_PHY_ADDR(11), 91 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
88}; 92};
@@ -91,6 +95,15 @@ static struct mv_sata_platform_data rd88f6281_sata_data = {
91 .n_ports = 2, 95 .n_ports = 2,
92}; 96};
93 97
98static struct mvsdio_platform_data rd88f6281_mvsdio_data = {
99 .gpio_card_detect = 28,
100};
101
102static unsigned int rd88f6281_mpp_config[] __initdata = {
103 MPP28_GPIO,
104 0
105};
106
94static void __init rd88f6281_init(void) 107static void __init rd88f6281_init(void)
95{ 108{
96 u32 dev, rev; 109 u32 dev, rev;
@@ -99,21 +112,22 @@ static void __init rd88f6281_init(void)
99 * Basic setup. Needs to be called early. 112 * Basic setup. Needs to be called early.
100 */ 113 */
101 kirkwood_init(); 114 kirkwood_init();
115 kirkwood_mpp_conf(rd88f6281_mpp_config);
102 116
103 kirkwood_ehci_init(); 117 kirkwood_ehci_init();
104 118
105 kirkwood_ge00_init(&rd88f6281_ge00_data); 119 kirkwood_ge00_init(&rd88f6281_ge00_data);
106 kirkwood_pcie_id(&dev, &rev); 120 kirkwood_pcie_id(&dev, &rev);
107 if (rev == MV88F6281_REV_A0) { 121 if (rev == MV88F6281_REV_A0) {
108 rd88f6281_switch_data.sw_addr = 10; 122 rd88f6281_switch_chip_data.sw_addr = 10;
109 kirkwood_ge01_init(&rd88f6281_ge01_data); 123 kirkwood_ge01_init(&rd88f6281_ge01_data);
110 } else { 124 } else {
111 rd88f6281_switch_data.port_names[4] = "wan"; 125 rd88f6281_switch_chip_data.port_names[4] = "wan";
112 } 126 }
113 kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ); 127 kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ);
114 128
115 kirkwood_rtc_init();
116 kirkwood_sata_init(&rd88f6281_sata_data); 129 kirkwood_sata_init(&rd88f6281_sata_data);
130 kirkwood_sdio_init(&rd88f6281_mvsdio_data);
117 kirkwood_uart0_init(); 131 kirkwood_uart0_init();
118 132
119 platform_device_register(&rd88f6281_nand_flash); 133 platform_device_register(&rd88f6281_nand_flash);
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
new file mode 100644
index 000000000000..831e4a56cae1
--- /dev/null
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -0,0 +1,136 @@
1/*
2 * arch/arm/mach-kirkwood/sheevaplug-setup.c
3 *
4 * Marvell SheevaPlug Reference 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/mtd/nand.h>
15#include <linux/mtd/partitions.h>
16#include <linux/mv643xx_eth.h>
17#include <linux/gpio.h>
18#include <linux/leds.h>
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <mach/kirkwood.h>
22#include <plat/mvsdio.h>
23#include <plat/orion_nand.h>
24#include "common.h"
25#include "mpp.h"
26
27static struct mtd_partition sheevaplug_nand_parts[] = {
28 {
29 .name = "u-boot",
30 .offset = 0,
31 .size = SZ_1M
32 }, {
33 .name = "uImage",
34 .offset = MTDPART_OFS_NXTBLK,
35 .size = SZ_4M
36 }, {
37 .name = "root",
38 .offset = MTDPART_OFS_NXTBLK,
39 .size = MTDPART_SIZ_FULL
40 },
41};
42
43static struct resource sheevaplug_nand_resource = {
44 .flags = IORESOURCE_MEM,
45 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
46 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
47 KIRKWOOD_NAND_MEM_SIZE - 1,
48};
49
50static struct orion_nand_data sheevaplug_nand_data = {
51 .parts = sheevaplug_nand_parts,
52 .nr_parts = ARRAY_SIZE(sheevaplug_nand_parts),
53 .cle = 0,
54 .ale = 1,
55 .width = 8,
56 .chip_delay = 25,
57};
58
59static struct platform_device sheevaplug_nand_flash = {
60 .name = "orion_nand",
61 .id = -1,
62 .dev = {
63 .platform_data = &sheevaplug_nand_data,
64 },
65 .resource = &sheevaplug_nand_resource,
66 .num_resources = 1,
67};
68
69static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
70 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
71};
72
73static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
74 // unfortunately the CD signal has not been connected */
75};
76
77static struct gpio_led sheevaplug_led_pins[] = {
78 {
79 .name = "plug:green:health",
80 .default_trigger = "default-on",
81 .gpio = 49,
82 .active_low = 1,
83 },
84};
85
86static struct gpio_led_platform_data sheevaplug_led_data = {
87 .leds = sheevaplug_led_pins,
88 .num_leds = ARRAY_SIZE(sheevaplug_led_pins),
89};
90
91static struct platform_device sheevaplug_leds = {
92 .name = "leds-gpio",
93 .id = -1,
94 .dev = {
95 .platform_data = &sheevaplug_led_data,
96 }
97};
98
99static unsigned int sheevaplug_mpp_config[] __initdata = {
100 MPP29_GPIO, /* USB Power Enable */
101 MPP49_GPIO, /* LED */
102 0
103};
104
105static void __init sheevaplug_init(void)
106{
107 /*
108 * Basic setup. Needs to be called early.
109 */
110 kirkwood_init();
111 kirkwood_mpp_conf(sheevaplug_mpp_config);
112
113 kirkwood_uart0_init();
114
115 if (gpio_request(29, "USB Power Enable") != 0 ||
116 gpio_direction_output(29, 1) != 0)
117 printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
118 kirkwood_ehci_init();
119
120 kirkwood_ge00_init(&sheevaplug_ge00_data);
121 kirkwood_sdio_init(&sheevaplug_mvsdio_data);
122
123 platform_device_register(&sheevaplug_nand_flash);
124 platform_device_register(&sheevaplug_leds);
125}
126
127MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
128 /* Maintainer: shadi Ammouri <shadi@marvell.com> */
129 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
130 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
131 .boot_params = 0x00000100,
132 .init_machine = sheevaplug_init,
133 .map_io = kirkwood_map_io,
134 .init_irq = kirkwood_init_irq,
135 .timer = &kirkwood_timer,
136MACHINE_END
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
new file mode 100644
index 000000000000..dda5743cf3e0
--- /dev/null
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -0,0 +1,220 @@
1/*
2 *
3 * QNAP TS-119/TS-219 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/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>
22#include <linux/mv643xx_eth.h>
23#include <linux/ata_platform.h>
24#include <linux/gpio_keys.h>
25#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>
30#include <asm/mach/arch.h>
31#include <mach/kirkwood.h>
32#include "common.h"
33#include "mpp.h"
34
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
99static struct i2c_board_info __initdata qnap_ts219_i2c_rtc = {
100 I2C_BOARD_INFO("s35390a", 0x30),
101};
102
103static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = {
104 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
105};
106
107static struct mv_sata_platform_data qnap_ts219_sata_data = {
108 .n_ports = 2,
109};
110
111static struct gpio_keys_button qnap_ts219_buttons[] = {
112 {
113 .code = KEY_COPY,
114 .gpio = 15,
115 .desc = "USB Copy",
116 .active_low = 1,
117 },
118 {
119 .code = KEY_RESTART,
120 .gpio = 16,
121 .desc = "Reset",
122 .active_low = 1,
123 },
124};
125
126static struct gpio_keys_platform_data qnap_ts219_button_data = {
127 .buttons = qnap_ts219_buttons,
128 .nbuttons = ARRAY_SIZE(qnap_ts219_buttons),
129};
130
131static struct platform_device qnap_ts219_button_device = {
132 .name = "gpio-keys",
133 .id = -1,
134 .num_resources = 0,
135 .dev = {
136 .platform_data = &qnap_ts219_button_data,
137 }
138};
139
140static unsigned int qnap_ts219_mpp_config[] __initdata = {
141 MPP0_SPI_SCn,
142 MPP1_SPI_MOSI,
143 MPP2_SPI_SCK,
144 MPP3_SPI_MISO,
145 MPP8_TW_SDA,
146 MPP9_TW_SCK,
147 MPP10_UART0_TXD,
148 MPP11_UART0_RXD,
149 MPP13_UART1_TXD, /* PIC controller */
150 MPP14_UART1_RXD, /* PIC controller */
151 MPP15_GPIO, /* USB Copy button */
152 MPP16_GPIO, /* Reset button */
153 MPP20_SATA1_ACTn,
154 MPP21_SATA0_ACTn,
155 MPP22_SATA1_PRESENTn,
156 MPP23_SATA0_PRESENTn,
157 0
158};
159
160
161/*****************************************************************************
162 * QNAP TS-x19 specific power off method via UART1-attached PIC
163 ****************************************************************************/
164
165#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2))
166
167void qnap_ts219_power_off(void)
168{
169 /* 19200 baud divisor */
170 const unsigned divisor = ((kirkwood_tclk + (8 * 19200)) / (16 * 19200));
171
172 pr_info("%s: triggering power-off...\n", __func__);
173
174 /* hijack UART1 and reset into sane state (19200,8n1) */
175 writel(0x83, UART1_REG(LCR));
176 writel(divisor & 0xff, UART1_REG(DLL));
177 writel((divisor >> 8) & 0xff, UART1_REG(DLM));
178 writel(0x03, UART1_REG(LCR));
179 writel(0x00, UART1_REG(IER));
180 writel(0x00, UART1_REG(FCR));
181 writel(0x00, UART1_REG(MCR));
182
183 /* send the power-off command 'A' to PIC */
184 writel('A', UART1_REG(TX));
185}
186
187static void __init qnap_ts219_init(void)
188{
189 /*
190 * Basic setup. Needs to be called early.
191 */
192 kirkwood_init();
193 kirkwood_mpp_conf(qnap_ts219_mpp_config);
194
195 kirkwood_uart0_init();
196 kirkwood_uart1_init(); /* A PIC controller is connected here. */
197 spi_register_board_info(qnap_ts219_spi_slave_info,
198 ARRAY_SIZE(qnap_ts219_spi_slave_info));
199 kirkwood_spi_init();
200 kirkwood_i2c_init();
201 i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1);
202 kirkwood_ge00_init(&qnap_ts219_ge00_data);
203 kirkwood_sata_init(&qnap_ts219_sata_data);
204 kirkwood_ehci_init();
205 platform_device_register(&qnap_ts219_button_device);
206
207 pm_power_off = qnap_ts219_power_off;
208
209}
210
211MACHINE_START(TS219, "QNAP TS-119/TS-219")
212 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
213 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
214 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
215 .boot_params = 0x00000100,
216 .init_machine = qnap_ts219_init,
217 .map_io = kirkwood_map_io,
218 .init_irq = kirkwood_init_irq,
219 .timer = &kirkwood_timer,
220MACHINE_END
diff --git a/arch/arm/mach-ks8695/Kconfig b/arch/arm/mach-ks8695/Kconfig
index 2754daabda55..fe0c82e30b2d 100644
--- a/arch/arm/mach-ks8695/Kconfig
+++ b/arch/arm/mach-ks8695/Kconfig
@@ -14,6 +14,12 @@ config MACH_DSM320
14 Say 'Y' here if you want your kernel to run on the D-Link 14 Say 'Y' here if you want your kernel to run on the D-Link
15 DSM-320 Wireless Media Player. 15 DSM-320 Wireless Media Player.
16 16
17config MACH_ACS5K
18 bool "Brivo Systems LLC, ACS-5000 Master board"
19 help
20 say 'Y' here if you want your kernel to run on the Brivo
21 Systems LLC, ACS-5000 Master board.
22
17endmenu 23endmenu
18 24
19endif 25endif
diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile
index f735d2cc0294..7e3e8160ed30 100644
--- a/arch/arm/mach-ks8695/Makefile
+++ b/arch/arm/mach-ks8695/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_LEDS) += leds.o
17# Board-specific support 17# Board-specific support
18obj-$(CONFIG_MACH_KS8695) += board-micrel.o 18obj-$(CONFIG_MACH_KS8695) += board-micrel.o
19obj-$(CONFIG_MACH_DSM320) += board-dsm320.o 19obj-$(CONFIG_MACH_DSM320) += board-dsm320.o
20obj-$(CONFIG_MACH_ACS5K) += board-acs5k.o
diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c
new file mode 100644
index 000000000000..9e3e5a640ad2
--- /dev/null
+++ b/arch/arm/mach-ks8695/board-acs5k.c
@@ -0,0 +1,233 @@
1/*
2 * arch/arm/mach-ks8695/board-acs5k.c
3 *
4 * Brivo Systems LLC, ACS-5000 Master Board
5 *
6 * Copyright 2008 Simtec Electronics
7 * Daniel Silverstone <dsilvers@simtec.co.uk>
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/init.h>
18#include <linux/platform_device.h>
19
20#include <linux/i2c.h>
21#include <linux/i2c-algo-bit.h>
22#include <linux/i2c-gpio.h>
23#include <linux/i2c/pca953x.h>
24
25#include <linux/mtd/mtd.h>
26#include <linux/mtd/map.h>
27#include <linux/mtd/physmap.h>
28#include <linux/mtd/partitions.h>
29
30#include <asm/mach-types.h>
31
32#include <asm/mach/arch.h>
33#include <asm/mach/map.h>
34#include <asm/mach/irq.h>
35
36#include <mach/devices.h>
37#include <mach/gpio.h>
38
39#include "generic.h"
40
41static struct i2c_gpio_platform_data acs5k_i2c_device_platdata = {
42 .sda_pin = 4,
43 .scl_pin = 5,
44 .udelay = 10,
45};
46
47static struct platform_device acs5k_i2c_device = {
48 .name = "i2c-gpio",
49 .id = -1,
50 .num_resources = 0,
51 .resource = NULL,
52 .dev = {
53 .platform_data = &acs5k_i2c_device_platdata,
54 },
55};
56
57static int acs5k_pca9555_setup(struct i2c_client *client,
58 unsigned gpio_base, unsigned ngpio,
59 void *context)
60{
61 static int acs5k_gpio_value[] = {
62 -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, -1, 0, 1, 0, -1, -1
63 };
64 int n;
65
66 for (n = 0; n < ARRAY_SIZE(acs5k_gpio_value); ++n) {
67 gpio_request(gpio_base + n, "ACS-5000 GPIO Expander");
68 if (acs5k_gpio_value[n] < 0)
69 gpio_direction_input(gpio_base + n);
70 else
71 gpio_direction_output(gpio_base + n,
72 acs5k_gpio_value[n]);
73 gpio_export(gpio_base + n, 0); /* Export, direction locked down */
74 }
75
76 return 0;
77}
78
79static struct pca953x_platform_data acs5k_i2c_pca9555_platdata = {
80 .gpio_base = 16, /* Start directly after the CPU's GPIO */
81 .invert = 0, /* Do not invert */
82 .setup = acs5k_pca9555_setup,
83};
84
85static struct i2c_board_info acs5k_i2c_devs[] __initdata = {
86 {
87 I2C_BOARD_INFO("pcf8563", 0x51),
88 },
89 {
90 I2C_BOARD_INFO("pca9555", 0x20),
91 .platform_data = &acs5k_i2c_pca9555_platdata,
92 },
93};
94
95static void __devinit acs5k_i2c_init(void)
96{
97 /* The gpio interface */
98 platform_device_register(&acs5k_i2c_device);
99 /* I2C devices */
100 i2c_register_board_info(0, acs5k_i2c_devs,
101 ARRAY_SIZE(acs5k_i2c_devs));
102}
103
104static struct mtd_partition acs5k_nor_partitions[] = {
105 [0] = {
106 .name = "Boot Agent and config",
107 .size = SZ_256K,
108 .offset = 0,
109 .mask_flags = MTD_WRITEABLE,
110 },
111 [1] = {
112 .name = "Kernel",
113 .size = SZ_1M,
114 .offset = SZ_256K,
115 },
116 [2] = {
117 .name = "SquashFS1",
118 .size = SZ_2M,
119 .offset = SZ_256K + SZ_1M,
120 },
121 [3] = {
122 .name = "SquashFS2",
123 .size = SZ_4M + SZ_2M,
124 .offset = SZ_256K + SZ_1M + SZ_2M,
125 },
126 [4] = {
127 .name = "Data",
128 .size = SZ_16M + SZ_4M + SZ_2M + SZ_512K, /* 22.5 MB */
129 .offset = SZ_256K + SZ_8M + SZ_1M,
130 }
131};
132
133static struct physmap_flash_data acs5k_nor_pdata = {
134 .width = 4,
135 .nr_parts = ARRAY_SIZE(acs5k_nor_partitions),
136 .parts = acs5k_nor_partitions,
137};
138
139static struct resource acs5k_nor_resource[] = {
140 [0] = {
141 .start = SZ_32M, /* We expect the bootloader to map
142 * the flash here.
143 */
144 .end = SZ_32M + SZ_16M - 1,
145 .flags = IORESOURCE_MEM,
146 },
147 [1] = {
148 .start = SZ_32M + SZ_16M,
149 .end = SZ_32M + SZ_32M - SZ_256K - 1,
150 .flags = IORESOURCE_MEM,
151 }
152};
153
154static struct platform_device acs5k_device_nor = {
155 .name = "physmap-flash",
156 .id = -1,
157 .num_resources = ARRAY_SIZE(acs5k_nor_resource),
158 .resource = acs5k_nor_resource,
159 .dev = {
160 .platform_data = &acs5k_nor_pdata,
161 },
162};
163
164static void __init acs5k_register_nor(void)
165{
166 int ret;
167
168 if (acs5k_nor_partitions[0].mask_flags == 0)
169 printk(KERN_WARNING "Warning: Unprotecting bootloader and configuration partition\n");
170
171 ret = platform_device_register(&acs5k_device_nor);
172 if (ret < 0)
173 printk(KERN_ERR "failed to register physmap-flash device\n");
174}
175
176static int __init acs5k_protection_setup(char *s)
177{
178 /* We can't allocate anything here but we should be able
179 * to trivially parse s and decide if we can protect the
180 * bootloader partition or not
181 */
182 if (strcmp(s, "no") == 0)
183 acs5k_nor_partitions[0].mask_flags = 0;
184
185 return 1;
186}
187
188__setup("protect_bootloader=", acs5k_protection_setup);
189
190static void __init acs5k_init_gpio(void)
191{
192 int i;
193
194 ks8695_register_gpios();
195 for (i = 0; i < 4; ++i)
196 gpio_request(i, "ACS5K IRQ");
197 gpio_request(7, "ACS5K KS_FRDY");
198 for (i = 8; i < 16; ++i)
199 gpio_request(i, "ACS5K Unused");
200
201 gpio_request(3, "ACS5K CAN Control");
202 gpio_request(6, "ACS5K Heartbeat");
203 gpio_direction_output(3, 1); /* Default CAN_RESET high */
204 gpio_direction_output(6, 0); /* Default KS8695_ACTIVE low */
205 gpio_export(3, 0); /* export CAN_RESET as output only */
206 gpio_export(6, 0); /* export KS8695_ACTIVE as output only */
207}
208
209static void __init acs5k_init(void)
210{
211 acs5k_init_gpio();
212
213 /* Network device */
214 ks8695_add_device_lan(); /* eth0 = LAN */
215 ks8695_add_device_wan(); /* ethX = WAN */
216
217 /* NOR devices */
218 acs5k_register_nor();
219
220 /* I2C bus */
221 acs5k_i2c_init();
222}
223
224MACHINE_START(ACS5K, "Brivo Systems LLC ACS-5000 Master board")
225 /* Maintainer: Simtec Electronics. */
226 .phys_io = KS8695_IO_PA,
227 .io_pg_offst = (KS8695_IO_VA >> 18) & 0xfffc,
228 .boot_params = KS8695_SDRAM_PA + 0x100,
229 .map_io = ks8695_map_io,
230 .init_irq = ks8695_init_irq,
231 .init_machine = acs5k_init,
232 .timer = &ks8695_timer,
233MACHINE_END
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h
index 6d5887cf5742..76e5308685a4 100644
--- a/arch/arm/mach-ks8695/include/mach/memory.h
+++ b/arch/arm/mach-ks8695/include/mach/memory.h
@@ -35,7 +35,11 @@ extern struct bus_type platform_bus_type;
35 __phys_to_virt(x) : __bus_to_virt(x)); }) 35 __phys_to_virt(x) : __bus_to_virt(x)); })
36#define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \ 36#define __arch_virt_to_dma(dev, x) ({ is_lbus_device(dev) ? \
37 (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); }) 37 (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); })
38#define __arch_page_to_dma(dev, x) __arch_virt_to_dma(dev, page_address(x)) 38#define __arch_page_to_dma(dev, x) \
39 ({ dma_addr_t __dma = page_to_phys(page); \
40 if (!is_lbus_device(dev)) \
41 __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
42 __dma; })
39 43
40#endif 44#endif
41 45
diff --git a/arch/arm/mach-ks8695/include/mach/system.h b/arch/arm/mach-ks8695/include/mach/system.h
index 5a9b032bdbeb..fb1dda9be2d0 100644
--- a/arch/arm/mach-ks8695/include/mach/system.h
+++ b/arch/arm/mach-ks8695/include/mach/system.h
@@ -27,7 +27,7 @@ static void arch_idle(void)
27 27
28} 28}
29 29
30static void arch_reset(char mode) 30static void arch_reset(char mode, const char *cmd)
31{ 31{
32 unsigned int reg; 32 unsigned int reg;
33 33
diff --git a/arch/arm/mach-l7200/include/mach/system.h b/arch/arm/mach-l7200/include/mach/system.h
index 5272abee0d0e..e0dd3b6ae4aa 100644
--- a/arch/arm/mach-l7200/include/mach/system.h
+++ b/arch/arm/mach-l7200/include/mach/system.h
@@ -19,7 +19,7 @@ static inline void arch_idle(void)
19 *(unsigned long *)(IO_BASE + 0x50004) = 1; /* idle mode */ 19 *(unsigned long *)(IO_BASE + 0x50004) = 1; /* idle mode */
20} 20}
21 21
22static inline void arch_reset(char mode) 22static inline void arch_reset(char mode, const char *cmd)
23{ 23{
24 if (mode == 's') { 24 if (mode == 's') {
25 cpu_reset(0); 25 cpu_reset(0);
diff --git a/arch/arm/mach-lh7a40x/include/mach/system.h b/arch/arm/mach-lh7a40x/include/mach/system.h
index fa46bb1ef07b..45a56d3b93d7 100644
--- a/arch/arm/mach-lh7a40x/include/mach/system.h
+++ b/arch/arm/mach-lh7a40x/include/mach/system.h
@@ -13,7 +13,7 @@ static inline void arch_idle(void)
13 cpu_do_idle (); 13 cpu_do_idle ();
14} 14}
15 15
16static inline void arch_reset(char mode) 16static inline void arch_reset(char mode, const char *cmd)
17{ 17{
18 cpu_reset (0); 18 cpu_reset (0);
19} 19}
diff --git a/arch/arm/mach-loki/include/mach/system.h b/arch/arm/mach-loki/include/mach/system.h
index 8db1147d4ec5..c1de36fe9b37 100644
--- a/arch/arm/mach-loki/include/mach/system.h
+++ b/arch/arm/mach-loki/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
17 cpu_do_idle(); 17 cpu_do_idle();
18} 18}
19 19
20static inline void arch_reset(char mode) 20static inline void arch_reset(char mode, const char *cmd)
21{ 21{
22 /* 22 /*
23 * Enable soft reset to assert RSTOUTn. 23 * Enable soft reset to assert RSTOUTn.
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig
new file mode 100644
index 000000000000..c6a564fc4a7c
--- /dev/null
+++ b/arch/arm/mach-mmp/Kconfig
@@ -0,0 +1,47 @@
1if ARCH_MMP
2
3menu "Marvell PXA168/910 Implmentations"
4
5config MACH_ASPENITE
6 bool "Marvell's PXA168 Aspenite Development Board"
7 select CPU_PXA168
8 help
9 Say 'Y' here if you want to support the Marvell PXA168-based
10 Aspenite Development Board.
11
12config MACH_ZYLONITE2
13 bool "Marvell's PXA168 Zylonite2 Development Board"
14 select CPU_PXA168
15 help
16 Say 'Y' here if you want to support the Marvell PXA168-based
17 Zylonite2 Development Board.
18
19config MACH_TAVOREVB
20 bool "Marvell's PXA910 TavorEVB Development Board"
21 select CPU_PXA910
22 help
23 Say 'Y' here if you want to support the Marvell PXA910-based
24 TavorEVB Development Board.
25
26config MACH_TTC_DKB
27 bool "Marvell's PXA910 TavorEVB Development Board"
28 select CPU_PXA910
29 help
30 Say 'Y' here if you want to support the Marvell PXA910-based
31 TTC_DKB Development Board.
32
33endmenu
34
35config CPU_PXA168
36 bool
37 select CPU_MOHAWK
38 help
39 Select code specific to PXA168
40
41config CPU_PXA910
42 bool
43 select CPU_MOHAWK
44 help
45 Select code specific to PXA910
46
47endif
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
new file mode 100644
index 000000000000..6883e6584883
--- /dev/null
+++ b/arch/arm/mach-mmp/Makefile
@@ -0,0 +1,15 @@
1#
2# Makefile for Marvell's PXA168 processors line
3#
4
5obj-y += common.o clock.o devices.o irq.o time.o
6
7# SoC support
8obj-$(CONFIG_CPU_PXA168) += pxa168.o
9obj-$(CONFIG_CPU_PXA910) += pxa910.o
10
11# board support
12obj-$(CONFIG_MACH_ASPENITE) += aspenite.o
13obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.o
14obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
15obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o
diff --git a/arch/arm/mach-mmp/Makefile.boot b/arch/arm/mach-mmp/Makefile.boot
new file mode 100644
index 000000000000..574a4aa8321a
--- /dev/null
+++ b/arch/arm/mach-mmp/Makefile.boot
@@ -0,0 +1 @@
zreladdr-y := 0x00008000
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
new file mode 100644
index 000000000000..4562452d4074
--- /dev/null
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -0,0 +1,117 @@
1/*
2 * linux/arch/arm/mach-mmp/aspenite.c
3 *
4 * Support for the Marvell PXA168-based Aspenite and Zylonite2
5 * Development Platform.
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 * publishhed by the Free Software Foundation.
10 */
11
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/smc91x.h>
16
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <mach/addr-map.h>
20#include <mach/mfp-pxa168.h>
21#include <mach/pxa168.h>
22#include <mach/gpio.h>
23
24#include "common.h"
25
26static unsigned long common_pin_config[] __initdata = {
27 /* Data Flash Interface */
28 GPIO0_DFI_D15,
29 GPIO1_DFI_D14,
30 GPIO2_DFI_D13,
31 GPIO3_DFI_D12,
32 GPIO4_DFI_D11,
33 GPIO5_DFI_D10,
34 GPIO6_DFI_D9,
35 GPIO7_DFI_D8,
36 GPIO8_DFI_D7,
37 GPIO9_DFI_D6,
38 GPIO10_DFI_D5,
39 GPIO11_DFI_D4,
40 GPIO12_DFI_D3,
41 GPIO13_DFI_D2,
42 GPIO14_DFI_D1,
43 GPIO15_DFI_D0,
44
45 /* Static Memory Controller */
46 GPIO18_SMC_nCS0,
47 GPIO34_SMC_nCS1,
48 GPIO23_SMC_nLUA,
49 GPIO25_SMC_nLLA,
50 GPIO28_SMC_RDY,
51 GPIO29_SMC_SCLK,
52 GPIO35_SMC_BE1,
53 GPIO36_SMC_BE2,
54 GPIO27_GPIO, /* Ethernet IRQ */
55
56 /* UART1 */
57 GPIO107_UART1_RXD,
58 GPIO108_UART1_TXD,
59};
60
61static struct smc91x_platdata smc91x_info = {
62 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
63};
64
65static struct resource smc91x_resources[] = {
66 [0] = {
67 .start = SMC_CS1_PHYS_BASE + 0x300,
68 .end = SMC_CS1_PHYS_BASE + 0xfffff,
69 .flags = IORESOURCE_MEM,
70 },
71 [1] = {
72 .start = gpio_to_irq(27),
73 .end = gpio_to_irq(27),
74 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
75 }
76};
77
78static struct platform_device smc91x_device = {
79 .name = "smc91x",
80 .id = 0,
81 .dev = {
82 .platform_data = &smc91x_info,
83 },
84 .num_resources = ARRAY_SIZE(smc91x_resources),
85 .resource = smc91x_resources,
86};
87
88static void __init common_init(void)
89{
90 mfp_config(ARRAY_AND_SIZE(common_pin_config));
91
92 /* on-chip devices */
93 pxa168_add_uart(1);
94
95 /* off-chip devices */
96 platform_device_register(&smc91x_device);
97}
98
99MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
100 .phys_io = APB_PHYS_BASE,
101 .boot_params = 0x00000100,
102 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
103 .map_io = pxa_map_io,
104 .init_irq = pxa168_init_irq,
105 .timer = &pxa168_timer,
106 .init_machine = common_init,
107MACHINE_END
108
109MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
110 .phys_io = APB_PHYS_BASE,
111 .boot_params = 0x00000100,
112 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
113 .map_io = pxa_map_io,
114 .init_irq = pxa168_init_irq,
115 .timer = &pxa168_timer,
116 .init_machine = common_init,
117MACHINE_END
diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c
new file mode 100644
index 000000000000..2d9cc5a7122f
--- /dev/null
+++ b/arch/arm/mach-mmp/clock.c
@@ -0,0 +1,83 @@
1/*
2 * linux/arch/arm/mach-mmp/clock.c
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/module.h>
10#include <linux/kernel.h>
11#include <linux/list.h>
12#include <linux/spinlock.h>
13#include <linux/clk.h>
14#include <linux/io.h>
15
16#include <mach/regs-apbc.h>
17#include "clock.h"
18
19static void apbc_clk_enable(struct clk *clk)
20{
21 uint32_t clk_rst;
22
23 clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(clk->fnclksel);
24 __raw_writel(clk_rst, clk->clk_rst);
25}
26
27static void apbc_clk_disable(struct clk *clk)
28{
29 __raw_writel(0, clk->clk_rst);
30}
31
32struct clkops apbc_clk_ops = {
33 .enable = apbc_clk_enable,
34 .disable = apbc_clk_disable,
35};
36
37static DEFINE_SPINLOCK(clocks_lock);
38
39int clk_enable(struct clk *clk)
40{
41 unsigned long flags;
42
43 spin_lock_irqsave(&clocks_lock, flags);
44 if (clk->enabled++ == 0)
45 clk->ops->enable(clk);
46 spin_unlock_irqrestore(&clocks_lock, flags);
47 return 0;
48}
49EXPORT_SYMBOL(clk_enable);
50
51void clk_disable(struct clk *clk)
52{
53 unsigned long flags;
54
55 WARN_ON(clk->enabled == 0);
56
57 spin_lock_irqsave(&clocks_lock, flags);
58 if (--clk->enabled == 0)
59 clk->ops->disable(clk);
60 spin_unlock_irqrestore(&clocks_lock, flags);
61}
62EXPORT_SYMBOL(clk_disable);
63
64unsigned long clk_get_rate(struct clk *clk)
65{
66 unsigned long rate;
67
68 if (clk->ops->getrate)
69 rate = clk->ops->getrate(clk);
70 else
71 rate = clk->rate;
72
73 return rate;
74}
75EXPORT_SYMBOL(clk_get_rate);
76
77void clks_register(struct clk_lookup *clks, size_t num)
78{
79 int i;
80
81 for (i = 0; i < num; i++)
82 clkdev_add(&clks[i]);
83}
diff --git a/arch/arm/mach-mmp/clock.h b/arch/arm/mach-mmp/clock.h
new file mode 100644
index 000000000000..ed967e78e6a8
--- /dev/null
+++ b/arch/arm/mach-mmp/clock.h
@@ -0,0 +1,71 @@
1/*
2 * linux/arch/arm/mach-mmp/clock.h
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 <asm/clkdev.h>
10
11struct clkops {
12 void (*enable)(struct clk *);
13 void (*disable)(struct clk *);
14 unsigned long (*getrate)(struct clk *);
15};
16
17struct clk {
18 const struct clkops *ops;
19
20 void __iomem *clk_rst; /* clock reset control register */
21 int fnclksel; /* functional clock select (APBC) */
22 uint32_t enable_val; /* value for clock enable (APMU) */
23 unsigned long rate;
24 int enabled;
25};
26
27extern struct clkops apbc_clk_ops;
28
29#define APBC_CLK(_name, _reg, _fnclksel, _rate) \
30struct clk clk_##_name = { \
31 .clk_rst = (void __iomem *)APBC_##_reg, \
32 .fnclksel = _fnclksel, \
33 .rate = _rate, \
34 .ops = &apbc_clk_ops, \
35}
36
37#define APBC_CLK_OPS(_name, _reg, _fnclksel, _rate, _ops) \
38struct clk clk_##_name = { \
39 .clk_rst = (void __iomem *)APBC_##_reg, \
40 .fnclksel = _fnclksel, \
41 .rate = _rate, \
42 .ops = _ops, \
43}
44
45#define APMU_CLK(_name, _reg, _eval, _rate) \
46struct clk clk_##_name = { \
47 .clk_rst = (void __iomem *)APMU_##_reg, \
48 .enable_val = _eval, \
49 .rate = _rate, \
50 .ops = &apmu_clk_ops, \
51}
52
53#define APMU_CLK_OPS(_name, _reg, _eval, _rate, _ops) \
54struct clk clk_##_name = { \
55 .clk_rst = (void __iomem *)APMU_##_reg, \
56 .enable_val = _eval, \
57 .rate = _rate, \
58 .ops = _ops, \
59}
60
61#define INIT_CLKREG(_clk, _devname, _conname) \
62 { \
63 .clk = _clk, \
64 .dev_id = _devname, \
65 .con_id = _conname, \
66 }
67
68extern struct clk clk_pxa168_gpio;
69extern struct clk clk_pxa168_timers;
70
71extern void clks_register(struct clk_lookup *, size_t);
diff --git a/arch/arm/mach-mmp/common.c b/arch/arm/mach-mmp/common.c
new file mode 100644
index 000000000000..e1e66c18b446
--- /dev/null
+++ b/arch/arm/mach-mmp/common.c
@@ -0,0 +1,37 @@
1/*
2 * linux/arch/arm/mach-mmp/common.c
3 *
4 * Code common to PXA168 processor lines
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/init.h>
12#include <linux/kernel.h>
13
14#include <asm/page.h>
15#include <asm/mach/map.h>
16#include <mach/addr-map.h>
17
18#include "common.h"
19
20static struct map_desc standard_io_desc[] __initdata = {
21 {
22 .pfn = __phys_to_pfn(APB_PHYS_BASE),
23 .virtual = APB_VIRT_BASE,
24 .length = APB_PHYS_SIZE,
25 .type = MT_DEVICE,
26 }, {
27 .pfn = __phys_to_pfn(AXI_PHYS_BASE),
28 .virtual = AXI_VIRT_BASE,
29 .length = AXI_PHYS_SIZE,
30 .type = MT_DEVICE,
31 },
32};
33
34void __init pxa_map_io(void)
35{
36 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
37}
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
new file mode 100644
index 000000000000..c33fbbc49417
--- /dev/null
+++ b/arch/arm/mach-mmp/common.h
@@ -0,0 +1,13 @@
1#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
2
3struct sys_timer;
4
5extern void timer_init(int irq);
6
7extern struct sys_timer pxa168_timer;
8extern struct sys_timer pxa910_timer;
9extern void __init pxa168_init_irq(void);
10extern void __init pxa910_init_irq(void);
11
12extern void __init icu_init_irq(void);
13extern void __init pxa_map_io(void);
diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c
new file mode 100644
index 000000000000..191d9dea8731
--- /dev/null
+++ b/arch/arm/mach-mmp/devices.c
@@ -0,0 +1,69 @@
1/*
2 * linux/arch/arm/mach-mmp/devices.c
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/init.h>
10#include <linux/platform_device.h>
11#include <linux/dma-mapping.h>
12
13#include <asm/irq.h>
14#include <mach/devices.h>
15
16int __init pxa_register_device(struct pxa_device_desc *desc,
17 void *data, size_t size)
18{
19 struct platform_device *pdev;
20 struct resource res[2 + MAX_RESOURCE_DMA];
21 int i, ret = 0, nres = 0;
22
23 pdev = platform_device_alloc(desc->drv_name, desc->id);
24 if (pdev == NULL)
25 return -ENOMEM;
26
27 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
28
29 memset(res, 0, sizeof(res));
30
31 if (desc->start != -1ul && desc->size > 0) {
32 res[nres].start = desc->start;
33 res[nres].end = desc->start + desc->size - 1;
34 res[nres].flags = IORESOURCE_MEM;
35 nres++;
36 }
37
38 if (desc->irq != NO_IRQ) {
39 res[nres].start = desc->irq;
40 res[nres].end = desc->irq;
41 res[nres].flags = IORESOURCE_IRQ;
42 nres++;
43 }
44
45 for (i = 0; i < MAX_RESOURCE_DMA; i++, nres++) {
46 if (desc->dma[i] == 0)
47 break;
48
49 res[nres].start = desc->dma[i];
50 res[nres].end = desc->dma[i];
51 res[nres].flags = IORESOURCE_DMA;
52 }
53
54 ret = platform_device_add_resources(pdev, res, nres);
55 if (ret) {
56 platform_device_put(pdev);
57 return ret;
58 }
59
60 if (data && size) {
61 ret = platform_device_add_data(pdev, data, size);
62 if (ret) {
63 platform_device_put(pdev);
64 return ret;
65 }
66 }
67
68 return platform_device_add(pdev);
69}
diff --git a/arch/arm/mach-mmp/include/mach/addr-map.h b/arch/arm/mach-mmp/include/mach/addr-map.h
new file mode 100644
index 000000000000..3254089a644d
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/addr-map.h
@@ -0,0 +1,34 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/addr-map.h
3 *
4 * Common address map definitions
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 __ASM_MACH_ADDR_MAP_H
12#define __ASM_MACH_ADDR_MAP_H
13
14/* APB - Application Subsystem Peripheral Bus
15 *
16 * NOTE: the DMA controller registers are actually on the AXI fabric #1
17 * slave port to AHB/APB bridge, due to its close relationship to those
18 * peripherals on APB, let's count it into the ABP mapping area.
19 */
20#define APB_PHYS_BASE 0xd4000000
21#define APB_VIRT_BASE 0xfe000000
22#define APB_PHYS_SIZE 0x00200000
23
24#define AXI_PHYS_BASE 0xd4200000
25#define AXI_VIRT_BASE 0xfe200000
26#define AXI_PHYS_SIZE 0x00200000
27
28/* Static Memory Controller - Chip Select 0 and 1 */
29#define SMC_CS0_PHYS_BASE 0x80000000
30#define SMC_CS0_PHYS_SIZE 0x10000000
31#define SMC_CS1_PHYS_BASE 0x90000000
32#define SMC_CS1_PHYS_SIZE 0x10000000
33
34#endif /* __ASM_MACH_ADDR_MAP_H */
diff --git a/arch/arm/mach-mmp/include/mach/clkdev.h b/arch/arm/mach-mmp/include/mach/clkdev.h
new file mode 100644
index 000000000000..2fb354e54e0d
--- /dev/null
+++ b/arch/arm/mach-mmp/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 /* __ASM_MACH_CLKDEV_H */
diff --git a/arch/arm/mach-mmp/include/mach/cputype.h b/arch/arm/mach-mmp/include/mach/cputype.h
new file mode 100644
index 000000000000..25e797b09083
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/cputype.h
@@ -0,0 +1,30 @@
1#ifndef __ASM_MACH_CPUTYPE_H
2#define __ASM_MACH_CPUTYPE_H
3
4#include <asm/cputype.h>
5
6/*
7 * CPU Stepping OLD_ID CPU_ID CHIP_ID
8 *
9 * PXA168 A0 0x41159263 0x56158400 0x00A0A333
10 * PXA910 Y0 0x41159262 0x56158000 0x00F0C910
11 */
12
13#ifdef CONFIG_CPU_PXA168
14# define __cpu_is_pxa168(id) \
15 ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x84; })
16#else
17# define __cpu_is_pxa168(id) (0)
18#endif
19
20#ifdef CONFIG_CPU_PXA910
21# define __cpu_is_pxa910(id) \
22 ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x80; })
23#else
24# define __cpu_is_pxa910(id) (0)
25#endif
26
27#define cpu_is_pxa168() ({ __cpu_is_pxa168(read_cpuid_id()); })
28#define cpu_is_pxa910() ({ __cpu_is_pxa910(read_cpuid_id()); })
29
30#endif /* __ASM_MACH_CPUTYPE_H */
diff --git a/arch/arm/mach-mmp/include/mach/debug-macro.S b/arch/arm/mach-mmp/include/mach/debug-macro.S
new file mode 100644
index 000000000000..a850f87de51d
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/debug-macro.S
@@ -0,0 +1,23 @@
1/* arch/arm/mach-mmp/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copied from arch/arm/mach-pxa/include/mach/debug.S
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 <mach/addr-map.h>
13
14 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled?
17 ldreq \rx, =APB_PHYS_BASE @ physical
18 ldrne \rx, =APB_VIRT_BASE @ virtual
19 orr \rx, \rx, #0x00017000
20 .endm
21
22#define UART_SHIFT 2
23#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-mmp/include/mach/devices.h b/arch/arm/mach-mmp/include/mach/devices.h
new file mode 100644
index 000000000000..24585397217e
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/devices.h
@@ -0,0 +1,37 @@
1#include <linux/types.h>
2
3#define MAX_RESOURCE_DMA 2
4
5/* structure for describing the on-chip devices */
6struct pxa_device_desc {
7 const char *dev_name;
8 const char *drv_name;
9 int id;
10 int irq;
11 unsigned long start;
12 unsigned long size;
13 int dma[MAX_RESOURCE_DMA];
14};
15
16#define PXA168_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
17struct pxa_device_desc pxa168_device_##_name __initdata = { \
18 .dev_name = "pxa168-" #_name, \
19 .drv_name = _drv, \
20 .id = _id, \
21 .irq = IRQ_PXA168_##_irq, \
22 .start = _start, \
23 .size = _size, \
24 .dma = { _dma }, \
25};
26
27#define PXA910_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
28struct pxa_device_desc pxa910_device_##_name __initdata = { \
29 .dev_name = "pxa910-" #_name, \
30 .drv_name = _drv, \
31 .id = _id, \
32 .irq = IRQ_PXA910_##_irq, \
33 .start = _start, \
34 .size = _size, \
35 .dma = { _dma }, \
36};
37extern int pxa_register_device(struct pxa_device_desc *, void *, size_t);
diff --git a/arch/arm/mach-mmp/include/mach/dma.h b/arch/arm/mach-mmp/include/mach/dma.h
new file mode 100644
index 000000000000..1d6914544da4
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/dma.h
@@ -0,0 +1,13 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/dma.h
3 */
4
5#ifndef __ASM_MACH_DMA_H
6#define __ASM_MACH_DMA_H
7
8#include <mach/addr-map.h>
9
10#define DMAC_REGS_VIRT (APB_VIRT_BASE + 0x00000)
11
12#include <plat/dma.h>
13#endif /* __ASM_MACH_DMA_H */
diff --git a/arch/arm/mach-mmp/include/mach/entry-macro.S b/arch/arm/mach-mmp/include/mach/entry-macro.S
new file mode 100644
index 000000000000..6d3cd35478b5
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/entry-macro.S
@@ -0,0 +1,25 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/entry-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/regs-icu.h>
10
11 .macro disable_fiq
12 .endm
13
14 .macro arch_ret_to_user, tmp1, tmp2
15 .endm
16
17 .macro get_irqnr_preamble, base, tmp
18 ldr \base, =ICU_AP_IRQ_SEL_INT_NUM
19 .endm
20
21 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
22 ldr \tmp, [\base, #0]
23 and \irqnr, \tmp, #0x3f
24 tst \tmp, #(1 << 6)
25 .endm
diff --git a/arch/arm/mach-mmp/include/mach/gpio.h b/arch/arm/mach-mmp/include/mach/gpio.h
new file mode 100644
index 000000000000..ab26d13295c4
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/gpio.h
@@ -0,0 +1,36 @@
1#ifndef __ASM_MACH_GPIO_H
2#define __ASM_MACH_GPIO_H
3
4#include <mach/addr-map.h>
5#include <mach/irqs.h>
6#include <asm-generic/gpio.h>
7
8#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)
9
10#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
11#define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x))))
12
13#define NR_BUILTIN_GPIO (128)
14
15#define gpio_to_bank(gpio) ((gpio) >> 5)
16#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))
17#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)
18
19
20#define __gpio_is_inverted(gpio) (0)
21#define __gpio_is_occupied(gpio) (0)
22
23/* NOTE: these macros are defined here to make optimization of
24 * gpio_{get,set}_value() to work when 'gpio' is a constant.
25 * Usage of these macros otherwise is no longer recommended,
26 * use generic GPIO API whenever possible.
27 */
28#define GPIO_bit(gpio) (1 << ((gpio) & 0x1f))
29
30#define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00)
31#define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c)
32#define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18)
33#define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24)
34
35#include <plat/gpio.h>
36#endif /* __ASM_MACH_GPIO_H */
diff --git a/arch/arm/mach-mmp/include/mach/hardware.h b/arch/arm/mach-mmp/include/mach/hardware.h
new file mode 100644
index 000000000000..99264a5ce5e4
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/hardware.h
@@ -0,0 +1,4 @@
1#ifndef __ASM_MACH_HARDWARE_H
2#define __ASM_MACH_HARDWARE_H
3
4#endif /* __ASM_MACH_HARDWARE_H */
diff --git a/arch/arm/mach-mmp/include/mach/io.h b/arch/arm/mach-mmp/include/mach/io.h
new file mode 100644
index 000000000000..e7adf3d012c1
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/io.h
@@ -0,0 +1,21 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/io.h
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#ifndef __ASM_MACH_IO_H
10#define __ASM_MACH_IO_H
11
12#define IO_SPACE_LIMIT 0xffffffff
13
14/*
15 * We don't actually have real ISA nor PCI buses, but there is so many
16 * drivers out there that might just work if we fake them...
17 */
18#define __io(a) __typesafe_io(a)
19#define __mem_pci(a) (a)
20
21#endif /* __ASM_MACH_IO_H */
diff --git a/arch/arm/mach-mmp/include/mach/irqs.h b/arch/arm/mach-mmp/include/mach/irqs.h
new file mode 100644
index 000000000000..e83e45ebf7a4
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/irqs.h
@@ -0,0 +1,119 @@
1#ifndef __ASM_MACH_IRQS_H
2#define __ASM_MACH_IRQS_H
3
4/*
5 * Interrupt numbers for PXA168
6 */
7#define IRQ_PXA168_NONE (-1)
8#define IRQ_PXA168_SSP3 0
9#define IRQ_PXA168_SSP2 1
10#define IRQ_PXA168_SSP1 2
11#define IRQ_PXA168_SSP0 3
12#define IRQ_PXA168_PMIC_INT 4
13#define IRQ_PXA168_RTC_INT 5
14#define IRQ_PXA168_RTC_ALARM 6
15#define IRQ_PXA168_TWSI0 7
16#define IRQ_PXA168_GPU 8
17#define IRQ_PXA168_KEYPAD 9
18#define IRQ_PXA168_ONEWIRE 12
19#define IRQ_PXA168_TIMER1 13
20#define IRQ_PXA168_TIMER2 14
21#define IRQ_PXA168_TIMER3 15
22#define IRQ_PXA168_CMU 16
23#define IRQ_PXA168_SSP4 17
24#define IRQ_PXA168_MSP_WAKEUP 19
25#define IRQ_PXA168_CF_WAKEUP 20
26#define IRQ_PXA168_XD_WAKEUP 21
27#define IRQ_PXA168_MFU 22
28#define IRQ_PXA168_MSP 23
29#define IRQ_PXA168_CF 24
30#define IRQ_PXA168_XD 25
31#define IRQ_PXA168_DDR_INT 26
32#define IRQ_PXA168_UART1 27
33#define IRQ_PXA168_UART2 28
34#define IRQ_PXA168_WDT 35
35#define IRQ_PXA168_FRQ_CHANGE 38
36#define IRQ_PXA168_SDH1 39
37#define IRQ_PXA168_SDH2 40
38#define IRQ_PXA168_LCD 41
39#define IRQ_PXA168_CI 42
40#define IRQ_PXA168_USB1 44
41#define IRQ_PXA168_NAND 45
42#define IRQ_PXA168_HIFI_DMA 46
43#define IRQ_PXA168_DMA_INT0 47
44#define IRQ_PXA168_DMA_INT1 48
45#define IRQ_PXA168_GPIOX 49
46#define IRQ_PXA168_USB2 51
47#define IRQ_PXA168_AC97 57
48#define IRQ_PXA168_TWSI1 58
49#define IRQ_PXA168_PMU 60
50#define IRQ_PXA168_SM_INT 63
51
52/*
53 * Interrupt numbers for PXA910
54 */
55#define IRQ_PXA910_AIRQ 0
56#define IRQ_PXA910_SSP3 1
57#define IRQ_PXA910_SSP2 2
58#define IRQ_PXA910_SSP1 3
59#define IRQ_PXA910_PMIC_INT 4
60#define IRQ_PXA910_RTC_INT 5
61#define IRQ_PXA910_RTC_ALARM 6
62#define IRQ_PXA910_TWSI0 7
63#define IRQ_PXA910_GPU 8
64#define IRQ_PXA910_KEYPAD 9
65#define IRQ_PXA910_ROTARY 10
66#define IRQ_PXA910_TRACKBALL 11
67#define IRQ_PXA910_ONEWIRE 12
68#define IRQ_PXA910_AP1_TIMER1 13
69#define IRQ_PXA910_AP1_TIMER2 14
70#define IRQ_PXA910_AP1_TIMER3 15
71#define IRQ_PXA910_IPC_AP0 16
72#define IRQ_PXA910_IPC_AP1 17
73#define IRQ_PXA910_IPC_AP2 18
74#define IRQ_PXA910_IPC_AP3 19
75#define IRQ_PXA910_IPC_AP4 20
76#define IRQ_PXA910_IPC_CP0 21
77#define IRQ_PXA910_IPC_CP1 22
78#define IRQ_PXA910_IPC_CP2 23
79#define IRQ_PXA910_IPC_CP3 24
80#define IRQ_PXA910_IPC_CP4 25
81#define IRQ_PXA910_L2_DDR 26
82#define IRQ_PXA910_UART2 27
83#define IRQ_PXA910_UART3 28
84#define IRQ_PXA910_AP2_TIMER1 29
85#define IRQ_PXA910_AP2_TIMER2 30
86#define IRQ_PXA910_CP2_TIMER1 31
87#define IRQ_PXA910_CP2_TIMER2 32
88#define IRQ_PXA910_CP2_TIMER3 33
89#define IRQ_PXA910_GSSP 34
90#define IRQ_PXA910_CP2_WDT 35
91#define IRQ_PXA910_MAIN_PMU 36
92#define IRQ_PXA910_CP_FREQ_CHG 37
93#define IRQ_PXA910_AP_FREQ_CHG 38
94#define IRQ_PXA910_MMC 39
95#define IRQ_PXA910_AEU 40
96#define IRQ_PXA910_LCD 41
97#define IRQ_PXA910_CCIC 42
98#define IRQ_PXA910_IRE 43
99#define IRQ_PXA910_USB1 44
100#define IRQ_PXA910_NAND 45
101#define IRQ_PXA910_HIFI_DMA 46
102#define IRQ_PXA910_DMA_INT0 47
103#define IRQ_PXA910_DMA_INT1 48
104#define IRQ_PXA910_AP_GPIO 49
105#define IRQ_PXA910_AP2_TIMER3 50
106#define IRQ_PXA910_USB2 51
107#define IRQ_PXA910_TWSI1 54
108#define IRQ_PXA910_CP_GPIO 55
109#define IRQ_PXA910_UART1 59 /* Slow UART */
110#define IRQ_PXA910_AP_PMU 60
111#define IRQ_PXA910_SM_INT 63 /* from PinMux */
112
113#define IRQ_GPIO_START 64
114#define IRQ_GPIO_NUM 128
115#define IRQ_GPIO(x) (IRQ_GPIO_START + (x))
116
117#define NR_IRQS (IRQ_GPIO_START + IRQ_GPIO_NUM)
118
119#endif /* __ASM_MACH_IRQS_H */
diff --git a/arch/arm/mach-mmp/include/mach/memory.h b/arch/arm/mach-mmp/include/mach/memory.h
new file mode 100644
index 000000000000..bdb21d70714c
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/memory.h
@@ -0,0 +1,14 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/memory.h
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#ifndef __ASM_MACH_MEMORY_H
10#define __ASM_MACH_MEMORY_H
11
12#define PHYS_OFFSET UL(0x00000000)
13
14#endif /* __ASM_MACH_MEMORY_H */
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
new file mode 100644
index 000000000000..d0bdb6e3682b
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
@@ -0,0 +1,258 @@
1#ifndef __ASM_MACH_MFP_PXA168_H
2#define __ASM_MACH_MFP_PXA168_H
3
4#include <mach/mfp.h>
5
6/* GPIO */
7#define GPIO0_GPIO MFP_CFG(GPIO0, AF5)
8#define GPIO1_GPIO MFP_CFG(GPIO1, AF5)
9#define GPIO2_GPIO MFP_CFG(GPIO2, AF5)
10#define GPIO3_GPIO MFP_CFG(GPIO3, AF5)
11#define GPIO4_GPIO MFP_CFG(GPIO4, AF5)
12#define GPIO5_GPIO MFP_CFG(GPIO5, AF5)
13#define GPIO6_GPIO MFP_CFG(GPIO6, AF5)
14#define GPIO7_GPIO MFP_CFG(GPIO7, AF5)
15#define GPIO8_GPIO MFP_CFG(GPIO8, AF5)
16#define GPIO9_GPIO MFP_CFG(GPIO9, AF5)
17#define GPIO10_GPIO MFP_CFG(GPIO10, AF5)
18#define GPIO11_GPIO MFP_CFG(GPIO11, AF5)
19#define GPIO12_GPIO MFP_CFG(GPIO12, AF5)
20#define GPIO13_GPIO MFP_CFG(GPIO13, AF5)
21#define GPIO14_GPIO MFP_CFG(GPIO14, AF5)
22#define GPIO15_GPIO MFP_CFG(GPIO15, AF5)
23#define GPIO16_GPIO MFP_CFG(GPIO16, AF0)
24#define GPIO17_GPIO MFP_CFG(GPIO17, AF5)
25#define GPIO18_GPIO MFP_CFG(GPIO18, AF0)
26#define GPIO19_GPIO MFP_CFG(GPIO19, AF5)
27#define GPIO20_GPIO MFP_CFG(GPIO20, AF0)
28#define GPIO21_GPIO MFP_CFG(GPIO21, AF5)
29#define GPIO22_GPIO MFP_CFG(GPIO22, AF5)
30#define GPIO23_GPIO MFP_CFG(GPIO23, AF5)
31#define GPIO24_GPIO MFP_CFG(GPIO24, AF5)
32#define GPIO25_GPIO MFP_CFG(GPIO25, AF5)
33#define GPIO26_GPIO MFP_CFG(GPIO26, AF0)
34#define GPIO27_GPIO MFP_CFG(GPIO27, AF5)
35#define GPIO28_GPIO MFP_CFG(GPIO28, AF5)
36#define GPIO29_GPIO MFP_CFG(GPIO29, AF5)
37#define GPIO30_GPIO MFP_CFG(GPIO30, AF5)
38#define GPIO31_GPIO MFP_CFG(GPIO31, AF5)
39#define GPIO32_GPIO MFP_CFG(GPIO32, AF5)
40#define GPIO33_GPIO MFP_CFG(GPIO33, AF5)
41#define GPIO34_GPIO MFP_CFG(GPIO34, AF0)
42#define GPIO35_GPIO MFP_CFG(GPIO35, AF0)
43#define GPIO36_GPIO MFP_CFG(GPIO36, AF0)
44#define GPIO37_GPIO MFP_CFG(GPIO37, AF0)
45#define GPIO38_GPIO MFP_CFG(GPIO38, AF0)
46#define GPIO39_GPIO MFP_CFG(GPIO39, AF0)
47#define GPIO40_GPIO MFP_CFG(GPIO40, AF0)
48#define GPIO41_GPIO MFP_CFG(GPIO41, AF0)
49#define GPIO42_GPIO MFP_CFG(GPIO42, AF0)
50#define GPIO43_GPIO MFP_CFG(GPIO43, AF0)
51#define GPIO44_GPIO MFP_CFG(GPIO44, AF0)
52#define GPIO45_GPIO MFP_CFG(GPIO45, AF0)
53#define GPIO46_GPIO MFP_CFG(GPIO46, AF0)
54#define GPIO47_GPIO MFP_CFG(GPIO47, AF0)
55#define GPIO48_GPIO MFP_CFG(GPIO48, AF0)
56#define GPIO49_GPIO MFP_CFG(GPIO49, AF0)
57#define GPIO50_GPIO MFP_CFG(GPIO50, AF0)
58#define GPIO51_GPIO MFP_CFG(GPIO51, AF0)
59#define GPIO52_GPIO MFP_CFG(GPIO52, AF0)
60#define GPIO53_GPIO MFP_CFG(GPIO53, AF0)
61#define GPIO54_GPIO MFP_CFG(GPIO54, AF0)
62#define GPIO55_GPIO MFP_CFG(GPIO55, AF0)
63#define GPIO56_GPIO MFP_CFG(GPIO56, AF0)
64#define GPIO57_GPIO MFP_CFG(GPIO57, AF0)
65#define GPIO58_GPIO MFP_CFG(GPIO58, AF0)
66#define GPIO59_GPIO MFP_CFG(GPIO59, AF0)
67#define GPIO60_GPIO MFP_CFG(GPIO60, AF0)
68#define GPIO61_GPIO MFP_CFG(GPIO61, AF0)
69#define GPIO62_GPIO MFP_CFG(GPIO62, AF0)
70#define GPIO63_GPIO MFP_CFG(GPIO63, AF0)
71#define GPIO64_GPIO MFP_CFG(GPIO64, AF0)
72#define GPIO65_GPIO MFP_CFG(GPIO65, AF0)
73#define GPIO66_GPIO MFP_CFG(GPIO66, AF0)
74#define GPIO67_GPIO MFP_CFG(GPIO67, AF0)
75#define GPIO68_GPIO MFP_CFG(GPIO68, AF0)
76#define GPIO69_GPIO MFP_CFG(GPIO69, AF0)
77#define GPIO70_GPIO MFP_CFG(GPIO70, AF0)
78#define GPIO71_GPIO MFP_CFG(GPIO71, AF0)
79#define GPIO72_GPIO MFP_CFG(GPIO72, AF0)
80#define GPIO73_GPIO MFP_CFG(GPIO73, AF0)
81#define GPIO74_GPIO MFP_CFG(GPIO74, AF0)
82#define GPIO75_GPIO MFP_CFG(GPIO75, AF0)
83#define GPIO76_GPIO MFP_CFG(GPIO76, AF0)
84#define GPIO77_GPIO MFP_CFG(GPIO77, AF0)
85#define GPIO78_GPIO MFP_CFG(GPIO78, AF0)
86#define GPIO79_GPIO MFP_CFG(GPIO79, AF0)
87#define GPIO80_GPIO MFP_CFG(GPIO80, AF0)
88#define GPIO81_GPIO MFP_CFG(GPIO81, AF0)
89#define GPIO82_GPIO MFP_CFG(GPIO82, AF0)
90#define GPIO83_GPIO MFP_CFG(GPIO83, AF0)
91#define GPIO84_GPIO MFP_CFG(GPIO84, AF0)
92#define GPIO85_GPIO MFP_CFG(GPIO85, AF0)
93#define GPIO86_GPIO MFP_CFG(GPIO86, AF0)
94#define GPIO87_GPIO MFP_CFG(GPIO87, AF0)
95#define GPIO88_GPIO MFP_CFG(GPIO88, AF0)
96#define GPIO89_GPIO MFP_CFG(GPIO89, AF0)
97#define GPIO90_GPIO MFP_CFG(GPIO90, AF0)
98#define GPIO91_GPIO MFP_CFG(GPIO91, AF0)
99#define GPIO92_GPIO MFP_CFG(GPIO92, AF0)
100#define GPIO93_GPIO MFP_CFG(GPIO93, AF0)
101#define GPIO94_GPIO MFP_CFG(GPIO94, AF0)
102#define GPIO95_GPIO MFP_CFG(GPIO95, AF0)
103#define GPIO96_GPIO MFP_CFG(GPIO96, AF0)
104#define GPIO97_GPIO MFP_CFG(GPIO97, AF0)
105#define GPIO98_GPIO MFP_CFG(GPIO98, AF0)
106#define GPIO99_GPIO MFP_CFG(GPIO99, AF0)
107#define GPIO100_GPIO MFP_CFG(GPIO100, AF0)
108#define GPIO101_GPIO MFP_CFG(GPIO101, AF0)
109#define GPIO102_GPIO MFP_CFG(GPIO102, AF0)
110#define GPIO103_GPIO MFP_CFG(GPIO103, AF0)
111#define GPIO104_GPIO MFP_CFG(GPIO104, AF0)
112#define GPIO105_GPIO MFP_CFG(GPIO105, AF0)
113#define GPIO106_GPIO MFP_CFG(GPIO106, AF0)
114#define GPIO107_GPIO MFP_CFG(GPIO107, AF0)
115#define GPIO108_GPIO MFP_CFG(GPIO108, AF0)
116#define GPIO109_GPIO MFP_CFG(GPIO109, AF0)
117#define GPIO110_GPIO MFP_CFG(GPIO110, AF0)
118#define GPIO111_GPIO MFP_CFG(GPIO111, AF0)
119#define GPIO112_GPIO MFP_CFG(GPIO112, AF0)
120#define GPIO113_GPIO MFP_CFG(GPIO113, AF0)
121#define GPIO114_GPIO MFP_CFG(GPIO114, AF0)
122#define GPIO115_GPIO MFP_CFG(GPIO115, AF0)
123#define GPIO116_GPIO MFP_CFG(GPIO116, AF0)
124#define GPIO117_GPIO MFP_CFG(GPIO117, AF0)
125#define GPIO118_GPIO MFP_CFG(GPIO118, AF0)
126#define GPIO119_GPIO MFP_CFG(GPIO119, AF0)
127#define GPIO120_GPIO MFP_CFG(GPIO120, AF0)
128#define GPIO121_GPIO MFP_CFG(GPIO121, AF0)
129#define GPIO122_GPIO MFP_CFG(GPIO122, AF0)
130
131/* DFI */
132#define GPIO0_DFI_D15 MFP_CFG(GPIO0, AF0)
133#define GPIO1_DFI_D14 MFP_CFG(GPIO1, AF0)
134#define GPIO2_DFI_D13 MFP_CFG(GPIO2, AF0)
135#define GPIO3_DFI_D12 MFP_CFG(GPIO3, AF0)
136#define GPIO4_DFI_D11 MFP_CFG(GPIO4, AF0)
137#define GPIO5_DFI_D10 MFP_CFG(GPIO5, AF0)
138#define GPIO6_DFI_D9 MFP_CFG(GPIO6, AF0)
139#define GPIO7_DFI_D8 MFP_CFG(GPIO7, AF0)
140#define GPIO8_DFI_D7 MFP_CFG(GPIO8, AF0)
141#define GPIO9_DFI_D6 MFP_CFG(GPIO9, AF0)
142#define GPIO10_DFI_D5 MFP_CFG(GPIO10, AF0)
143#define GPIO11_DFI_D4 MFP_CFG(GPIO11, AF0)
144#define GPIO12_DFI_D3 MFP_CFG(GPIO12, AF0)
145#define GPIO13_DFI_D2 MFP_CFG(GPIO13, AF0)
146#define GPIO14_DFI_D1 MFP_CFG(GPIO14, AF0)
147#define GPIO15_DFI_D0 MFP_CFG(GPIO15, AF0)
148
149#define GPIO30_DFI_ADDR0 MFP_CFG(GPIO30, AF0)
150#define GPIO31_DFI_ADDR1 MFP_CFG(GPIO31, AF0)
151#define GPIO32_DFI_ADDR2 MFP_CFG(GPIO32, AF0)
152#define GPIO33_DFI_ADDR3 MFP_CFG(GPIO33, AF0)
153
154/* NAND */
155#define GPIO16_ND_nCS0 MFP_CFG(GPIO16, AF1)
156#define GPIO17_ND_nWE MFP_CFG(GPIO17, AF0)
157#define GPIO21_ND_ALE MFP_CFG(GPIO21, AF0)
158#define GPIO22_ND_CLE MFP_CFG(GPIO22, AF0)
159#define GPIO24_ND_nRE MFP_CFG(GPIO24, AF0)
160#define GPIO26_ND_RnB1 MFP_CFG(GPIO26, AF1)
161#define GPIO27_ND_RnB2 MFP_CFG(GPIO27, AF1)
162
163/* Static Memory Controller */
164#define GPIO18_SMC_nCS0 MFP_CFG(GPIO18, AF3)
165#define GPIO18_SMC_nCS1 MFP_CFG(GPIO18, AF2)
166#define GPIO16_SMC_nCS0 MFP_CFG(GPIO16, AF2)
167#define GPIO16_SMC_nCS1 MFP_CFG(GPIO16, AF3)
168#define GPIO19_SMC_nCS0 MFP_CFG(GPIO19, AF0)
169#define GPIO20_SMC_nCS1 MFP_CFG(GPIO20, AF2)
170#define GPIO23_SMC_nLUA MFP_CFG(GPIO23, AF0)
171#define GPIO25_SMC_nLLA MFP_CFG(GPIO25, AF0)
172#define GPIO27_SMC_IRQ MFP_CFG(GPIO27, AF0)
173#define GPIO28_SMC_RDY MFP_CFG(GPIO28, AF0)
174#define GPIO29_SMC_SCLK MFP_CFG(GPIO29, AF0)
175#define GPIO34_SMC_nCS1 MFP_CFG(GPIO34, AF2)
176#define GPIO35_SMC_BE1 MFP_CFG(GPIO35, AF2)
177#define GPIO36_SMC_BE2 MFP_CFG(GPIO36, AF2)
178
179/* Compact Flash */
180#define GPIO19_CF_nCE1 MFP_CFG(GPIO19, AF3)
181#define GPIO20_CF_nCE2 MFP_CFG(GPIO20, AF3)
182#define GPIO23_CF_nALE MFP_CFG(GPIO23, AF3)
183#define GPIO25_CF_nRESET MFP_CFG(GPIO25, AF3)
184#define GPIO28_CF_RDY MFP_CFG(GPIO28, AF3)
185#define GPIO29_CF_STSCH MFP_CFG(GPIO29, AF3)
186#define GPIO30_CF_nREG MFP_CFG(GPIO30, AF3)
187#define GPIO31_CF_nIOIS16 MFP_CFG(GPIO31, AF3)
188#define GPIO32_CF_nCD1 MFP_CFG(GPIO32, AF3)
189#define GPIO33_CF_nCD2 MFP_CFG(GPIO33, AF3)
190
191/* UART1 */
192#define GPIO107_UART1_TXD MFP_CFG_DRV(GPIO107, AF1, FAST)
193#define GPIO107_UART1_RXD MFP_CFG_DRV(GPIO107, AF2, FAST)
194#define GPIO108_UART1_RXD MFP_CFG_DRV(GPIO108, AF1, FAST)
195#define GPIO108_UART1_TXD MFP_CFG_DRV(GPIO108, AF2, FAST)
196#define GPIO109_UART1_CTS MFP_CFG(GPIO109, AF1)
197#define GPIO109_UART1_RTS MFP_CFG(GPIO109, AF2)
198#define GPIO110_UART1_RTS MFP_CFG(GPIO110, AF1)
199#define GPIO110_UART1_CTS MFP_CFG(GPIO110, AF2)
200#define GPIO111_UART1_RI MFP_CFG(GPIO111, AF1)
201#define GPIO111_UART1_DSR MFP_CFG(GPIO111, AF2)
202#define GPIO112_UART1_DTR MFP_CFG(GPIO111, AF1)
203#define GPIO112_UART1_DCD MFP_CFG(GPIO112, AF2)
204
205/* MMC1 */
206#define GPIO37_MMC1_DAT7 MFP_CFG(GPIO37, AF1)
207#define GPIO38_MMC1_DAT6 MFP_CFG(GPIO38, AF1)
208#define GPIO54_MMC1_DAT5 MFP_CFG(GPIO54, AF1)
209#define GPIO48_MMC1_DAT4 MFP_CFG(GPIO48, AF1)
210#define GPIO51_MMC1_DAT3 MFP_CFG(GPIO51, AF1)
211#define GPIO52_MMC1_DAT2 MFP_CFG(GPIO52, AF1)
212#define GPIO40_MMC1_DAT1 MFP_CFG(GPIO40, AF1)
213#define GPIO41_MMC1_DAT0 MFP_CFG(GPIO41, AF1)
214#define GPIO49_MMC1_CMD MFP_CFG(GPIO49, AF1)
215#define GPIO43_MMC1_CLK MFP_CFG(GPIO43, AF1)
216#define GPIO53_MMC1_CD MFP_CFG(GPIO53, AF1)
217#define GPIO46_MMC1_WP MFP_CFG(GPIO46, AF1)
218
219/* LCD */
220#define GPIO84_LCD_CS MFP_CFG(GPIO84, AF1)
221#define GPIO60_LCD_DD0 MFP_CFG(GPIO60, AF1)
222#define GPIO61_LCD_DD1 MFP_CFG(GPIO61, AF1)
223#define GPIO70_LCD_DD10 MFP_CFG(GPIO70, AF1)
224#define GPIO71_LCD_DD11 MFP_CFG(GPIO71, AF1)
225#define GPIO72_LCD_DD12 MFP_CFG(GPIO72, AF1)
226#define GPIO73_LCD_DD13 MFP_CFG(GPIO73, AF1)
227#define GPIO74_LCD_DD14 MFP_CFG(GPIO74, AF1)
228#define GPIO75_LCD_DD15 MFP_CFG(GPIO75, AF1)
229#define GPIO76_LCD_DD16 MFP_CFG(GPIO76, AF1)
230#define GPIO77_LCD_DD17 MFP_CFG(GPIO77, AF1)
231#define GPIO78_LCD_DD18 MFP_CFG(GPIO78, AF1)
232#define GPIO79_LCD_DD19 MFP_CFG(GPIO79, AF1)
233#define GPIO62_LCD_DD2 MFP_CFG(GPIO62, AF1)
234#define GPIO80_LCD_DD20 MFP_CFG(GPIO80, AF1)
235#define GPIO81_LCD_DD21 MFP_CFG(GPIO81, AF1)
236#define GPIO82_LCD_DD22 MFP_CFG(GPIO82, AF1)
237#define GPIO83_LCD_DD23 MFP_CFG(GPIO83, AF1)
238#define GPIO63_LCD_DD3 MFP_CFG(GPIO63, AF1)
239#define GPIO64_LCD_DD4 MFP_CFG(GPIO64, AF1)
240#define GPIO65_LCD_DD5 MFP_CFG(GPIO65, AF1)
241#define GPIO66_LCD_DD6 MFP_CFG(GPIO66, AF1)
242#define GPIO67_LCD_DD7 MFP_CFG(GPIO67, AF1)
243#define GPIO68_LCD_DD8 MFP_CFG(GPIO68, AF1)
244#define GPIO69_LCD_DD9 MFP_CFG(GPIO69, AF1)
245#define GPIO59_LCD_DENA_BIAS MFP_CFG(GPIO59, AF1)
246#define GPIO56_LCD_FCLK_RD MFP_CFG(GPIO56, AF1)
247#define GPIO57_LCD_LCLK_A0 MFP_CFG(GPIO57, AF1)
248#define GPIO58_LCD_PCLK_WR MFP_CFG(GPIO58, AF1)
249#define GPIO85_LCD_VSYNC MFP_CFG(GPIO85, AF1)
250
251/* I2S */
252#define GPIO113_I2S_MCLK MFP_CFG(GPIO113,AF6)
253#define GPIO114_I2S_FRM MFP_CFG(GPIO114,AF1)
254#define GPIO115_I2S_BCLK MFP_CFG(GPIO115,AF1)
255#define GPIO116_I2S_RXD MFP_CFG(GPIO116,AF2)
256#define GPIO117_I2S_TXD MFP_CFG(GPIO117,AF2)
257
258#endif /* __ASM_MACH_MFP_PXA168_H */
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
new file mode 100644
index 000000000000..48a1cbc7c56b
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
@@ -0,0 +1,157 @@
1#ifndef __ASM_MACH_MFP_PXA910_H
2#define __ASM_MACH_MFP_PXA910_H
3
4#include <mach/mfp.h>
5
6/* UART2 */
7#define GPIO47_UART2_RXD MFP_CFG(GPIO47, AF6)
8#define GPIO48_UART2_TXD MFP_CFG(GPIO48, AF6)
9
10/* UART3 */
11#define GPIO31_UART3_RXD MFP_CFG(GPIO31, AF4)
12#define GPIO32_UART3_TXD MFP_CFG(GPIO32, AF4)
13
14/*IRDA*/
15#define GPIO51_IRDA_SHDN MFP_CFG(GPIO51, AF0)
16
17/* SMC */
18#define SM_nCS0_nCS0 MFP_CFG(SM_nCS0, AF0)
19#define SM_ADV_SM_ADV MFP_CFG(SM_ADV, AF0)
20#define SM_SCLK_SM_SCLK MFP_CFG(SM_SCLK, AF0)
21#define SM_SCLK_SM_SCLK MFP_CFG(SM_SCLK, AF0)
22#define SM_BE0_SM_BE0 MFP_CFG(SM_BE0, AF1)
23#define SM_BE1_SM_BE1 MFP_CFG(SM_BE1, AF1)
24
25/* I2C */
26#define GPIO53_CI2C_SCL MFP_CFG(GPIO53, AF2)
27#define GPIO54_CI2C_SDA MFP_CFG(GPIO54, AF2)
28
29/* SSP1 (I2S) */
30#define GPIO24_SSP1_SDATA_IN MFP_CFG_DRV(GPIO24, AF1, MEDIUM)
31#define GPIO21_SSP1_BITCLK MFP_CFG_DRV(GPIO21, AF1, MEDIUM)
32#define GPIO20_SSP1_SYSCLK MFP_CFG_DRV(GPIO20, AF1, MEDIUM)
33#define GPIO22_SSP1_SYNC MFP_CFG_DRV(GPIO22, AF1, MEDIUM)
34#define GPIO23_SSP1_DATA_OUT MFP_CFG_DRV(GPIO23, AF1, MEDIUM)
35#define GPIO124_MN_CLK_OUT MFP_CFG_DRV(GPIO124, AF1, MEDIUM)
36#define GPIO123_CLK_REQ MFP_CFG_DRV(GPIO123, AF0, MEDIUM)
37
38/* DFI */
39#define DF_IO0_ND_IO0 MFP_CFG(DF_IO0, AF0)
40#define DF_IO1_ND_IO1 MFP_CFG(DF_IO1, AF0)
41#define DF_IO2_ND_IO2 MFP_CFG(DF_IO2, AF0)
42#define DF_IO3_ND_IO3 MFP_CFG(DF_IO3, AF0)
43#define DF_IO4_ND_IO4 MFP_CFG(DF_IO4, AF0)
44#define DF_IO5_ND_IO5 MFP_CFG(DF_IO5, AF0)
45#define DF_IO6_ND_IO6 MFP_CFG(DF_IO6, AF0)
46#define DF_IO7_ND_IO7 MFP_CFG(DF_IO7, AF0)
47#define DF_IO8_ND_IO8 MFP_CFG(DF_IO8, AF0)
48#define DF_IO9_ND_IO9 MFP_CFG(DF_IO9, AF0)
49#define DF_IO10_ND_IO10 MFP_CFG(DF_IO10, AF0)
50#define DF_IO11_ND_IO11 MFP_CFG(DF_IO11, AF0)
51#define DF_IO12_ND_IO12 MFP_CFG(DF_IO12, AF0)
52#define DF_IO13_ND_IO13 MFP_CFG(DF_IO13, AF0)
53#define DF_IO14_ND_IO14 MFP_CFG(DF_IO14, AF0)
54#define DF_IO15_ND_IO15 MFP_CFG(DF_IO15, AF0)
55#define DF_nCS0_SM_nCS2_nCS0 MFP_CFG(DF_nCS0_SM_nCS2, AF0)
56#define DF_ALE_SM_WEn_ND_ALE MFP_CFG(DF_ALE_SM_WEn, AF1)
57#define DF_CLE_SM_OEn_ND_CLE MFP_CFG(DF_CLE_SM_OEn, AF0)
58#define DF_WEn_DF_WEn MFP_CFG(DF_WEn, AF1)
59#define DF_REn_DF_REn MFP_CFG(DF_REn, AF1)
60#define DF_RDY0_DF_RDY0 MFP_CFG(DF_RDY0, AF0)
61
62/*keypad*/
63#define GPIO00_KP_MKIN0 MFP_CFG(GPIO0, AF1)
64#define GPIO01_KP_MKOUT0 MFP_CFG(GPIO1, AF1)
65#define GPIO02_KP_MKIN1 MFP_CFG(GPIO2, AF1)
66#define GPIO03_KP_MKOUT1 MFP_CFG(GPIO3, AF1)
67#define GPIO04_KP_MKIN2 MFP_CFG(GPIO4, AF1)
68#define GPIO05_KP_MKOUT2 MFP_CFG(GPIO5, AF1)
69#define GPIO06_KP_MKIN3 MFP_CFG(GPIO6, AF1)
70#define GPIO07_KP_MKOUT3 MFP_CFG(GPIO7, AF1)
71#define GPIO08_KP_MKIN4 MFP_CFG(GPIO8, AF1)
72#define GPIO09_KP_MKOUT4 MFP_CFG(GPIO9, AF1)
73#define GPIO10_KP_MKIN5 MFP_CFG(GPIO10, AF1)
74#define GPIO11_KP_MKOUT5 MFP_CFG(GPIO11, AF1)
75#define GPIO12_KP_MKIN6 MFP_CFG(GPIO12, AF1)
76#define GPIO13_KP_MKOUT6 MFP_CFG(GPIO13, AF1)
77#define GPIO14_KP_MKIN7 MFP_CFG(GPIO14, AF1)
78#define GPIO15_KP_MKOUT7 MFP_CFG(GPIO15, AF1)
79#define GPIO16_KP_DKIN0 MFP_CFG(GPIO16, AF1)
80#define GPIO17_KP_DKIN1 MFP_CFG(GPIO17, AF1)
81#define GPIO18_KP_DKIN2 MFP_CFG(GPIO18, AF1)
82#define GPIO19_KP_DKIN3 MFP_CFG(GPIO19, AF1)
83
84/* LCD */
85#define GPIO81_LCD_FCLK MFP_CFG(GPIO81, AF1)
86#define GPIO82_LCD_LCLK MFP_CFG(GPIO82, AF1)
87#define GPIO83_LCD_PCLK MFP_CFG(GPIO83, AF1)
88#define GPIO84_LCD_DENA MFP_CFG(GPIO84, AF1)
89#define GPIO85_LCD_DD0 MFP_CFG(GPIO85, AF1)
90#define GPIO86_LCD_DD1 MFP_CFG(GPIO86, AF1)
91#define GPIO87_LCD_DD2 MFP_CFG(GPIO87, AF1)
92#define GPIO88_LCD_DD3 MFP_CFG(GPIO88, AF1)
93#define GPIO89_LCD_DD4 MFP_CFG(GPIO89, AF1)
94#define GPIO90_LCD_DD5 MFP_CFG(GPIO90, AF1)
95#define GPIO91_LCD_DD6 MFP_CFG(GPIO91, AF1)
96#define GPIO92_LCD_DD7 MFP_CFG(GPIO92, AF1)
97#define GPIO93_LCD_DD8 MFP_CFG(GPIO93, AF1)
98#define GPIO94_LCD_DD9 MFP_CFG(GPIO94, AF1)
99#define GPIO95_LCD_DD10 MFP_CFG(GPIO95, AF1)
100#define GPIO96_LCD_DD11 MFP_CFG(GPIO96, AF1)
101#define GPIO97_LCD_DD12 MFP_CFG(GPIO97, AF1)
102#define GPIO98_LCD_DD13 MFP_CFG(GPIO98, AF1)
103#define GPIO100_LCD_DD14 MFP_CFG(GPIO100, AF1)
104#define GPIO101_LCD_DD15 MFP_CFG(GPIO101, AF1)
105#define GPIO102_LCD_DD16 MFP_CFG(GPIO102, AF1)
106#define GPIO103_LCD_DD17 MFP_CFG(GPIO103, AF1)
107#define GPIO104_LCD_DD18 MFP_CFG(GPIO104, AF1)
108#define GPIO105_LCD_DD19 MFP_CFG(GPIO105, AF1)
109#define GPIO106_LCD_DD20 MFP_CFG(GPIO106, AF1)
110#define GPIO107_LCD_DD21 MFP_CFG(GPIO107, AF1)
111#define GPIO108_LCD_DD22 MFP_CFG(GPIO108, AF1)
112#define GPIO109_LCD_DD23 MFP_CFG(GPIO109, AF1)
113
114#define GPIO104_LCD_SPIDOUT MFP_CFG(GPIO104, AF3)
115#define GPIO105_LCD_SPIDIN MFP_CFG(GPIO105, AF3)
116#define GPIO107_LCD_CS1 MFP_CFG(GPIO107, AF3)
117#define GPIO108_LCD_DCLK MFP_CFG(GPIO108, AF3)
118
119#define GPIO106_LCD_RESET MFP_CFG(GPIO106, AF0)
120
121/*smart panel*/
122#define GPIO82_LCD_A0 MFP_CFG(GPIO82, AF0)
123#define GPIO83_LCD_WR MFP_CFG(GPIO83, AF0)
124#define GPIO103_LCD_CS MFP_CFG(GPIO103, AF0)
125
126/*1wire*/
127#define GPIO106_1WIRE MFP_CFG(GPIO106, AF3)
128
129/*CCIC*/
130#define GPIO67_CCIC_IN7 MFP_CFG_DRV(GPIO67, AF1, MEDIUM)
131#define GPIO68_CCIC_IN6 MFP_CFG_DRV(GPIO68, AF1, MEDIUM)
132#define GPIO69_CCIC_IN5 MFP_CFG_DRV(GPIO69, AF1, MEDIUM)
133#define GPIO70_CCIC_IN4 MFP_CFG_DRV(GPIO70, AF1, MEDIUM)
134#define GPIO71_CCIC_IN3 MFP_CFG_DRV(GPIO71, AF1, MEDIUM)
135#define GPIO72_CCIC_IN2 MFP_CFG_DRV(GPIO72, AF1, MEDIUM)
136#define GPIO73_CCIC_IN1 MFP_CFG_DRV(GPIO73, AF1, MEDIUM)
137#define GPIO74_CCIC_IN0 MFP_CFG_DRV(GPIO74, AF1, MEDIUM)
138#define GPIO75_CAM_HSYNC MFP_CFG_DRV(GPIO75, AF1, MEDIUM)
139#define GPIO76_CAM_VSYNC MFP_CFG_DRV(GPIO76, AF1, MEDIUM)
140#define GPIO77_CAM_MCLK MFP_CFG_DRV(GPIO77, AF1, MEDIUM)
141#define GPIO78_CAM_PCLK MFP_CFG_DRV(GPIO78, AF1, MEDIUM)
142
143/* MMC1 */
144#define MMC1_DAT7_MMC1_DAT7 MFP_CFG_DRV(MMC1_DAT7, AF0, MEDIUM)
145#define MMC1_DAT6_MMC1_DAT6 MFP_CFG_DRV(MMC1_DAT6, AF0, MEDIUM)
146#define MMC1_DAT5_MMC1_DAT5 MFP_CFG_DRV(MMC1_DAT5, AF0, MEDIUM)
147#define MMC1_DAT4_MMC1_DAT4 MFP_CFG_DRV(MMC1_DAT4, AF0, MEDIUM)
148#define MMC1_DAT3_MMC1_DAT3 MFP_CFG_DRV(MMC1_DAT3, AF0, MEDIUM)
149#define MMC1_DAT2_MMC1_DAT2 MFP_CFG_DRV(MMC1_DAT2, AF0, MEDIUM)
150#define MMC1_DAT1_MMC1_DAT1 MFP_CFG_DRV(MMC1_DAT1, AF0, MEDIUM)
151#define MMC1_DAT0_MMC1_DAT0 MFP_CFG_DRV(MMC1_DAT0, AF0, MEDIUM)
152#define MMC1_CMD_MMC1_CMD MFP_CFG_DRV(MMC1_CMD, AF0, MEDIUM)
153#define MMC1_CLK_MMC1_CLK MFP_CFG_DRV(MMC1_CLK, AF0, MEDIUM)
154#define MMC1_CD_MMC1_CD MFP_CFG_DRV(MMC1_CD, AF0, MEDIUM)
155#define MMC1_WP_MMC1_WP MFP_CFG_DRV(MMC1_WP, AF0, MEDIUM)
156
157#endif /* __ASM_MACH MFP_PXA910_H */
diff --git a/arch/arm/mach-mmp/include/mach/mfp.h b/arch/arm/mach-mmp/include/mach/mfp.h
new file mode 100644
index 000000000000..277ea4cd0f9f
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/mfp.h
@@ -0,0 +1,37 @@
1#ifndef __ASM_MACH_MFP_H
2#define __ASM_MACH_MFP_H
3
4#include <plat/mfp.h>
5
6/*
7 * NOTE: the MFPR register bit definitions on PXA168 processor lines are a
8 * bit different from those on PXA3xx. Bit [7:10] are now reserved, which
9 * were SLEEP_OE_N, SLEEP_DATA, SLEEP_SEL and the LSB of DRIVE bits.
10 *
11 * To cope with this difference and re-use the pxa3xx mfp code as much as
12 * possible, we make the following compromise:
13 *
14 * 1. SLEEP_OE_N will always be programmed to '1' (by MFP_LPM_FLOAT)
15 * 2. DRIVE strength definitions redefined to include the reserved bit10
16 * 3. Override MFP_CFG() and MFP_CFG_DRV()
17 * 4. Drop the use of MFP_CFG_LPM() and MFP_CFG_X()
18 */
19
20#define MFP_DRIVE_VERY_SLOW (0x0 << 13)
21#define MFP_DRIVE_SLOW (0x2 << 13)
22#define MFP_DRIVE_MEDIUM (0x4 << 13)
23#define MFP_DRIVE_FAST (0x8 << 13)
24
25#undef MFP_CFG
26#undef MFP_CFG_DRV
27#undef MFP_CFG_LPM
28#undef MFP_CFG_X
29#undef MFP_CFG_DEFAULT
30
31#define MFP_CFG(pin, af) \
32 (MFP_LPM_FLOAT | MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DRIVE_MEDIUM)
33
34#define MFP_CFG_DRV(pin, af, drv) \
35 (MFP_LPM_FLOAT | MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DRIVE_##drv)
36
37#endif /* __ASM_MACH_MFP_H */
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
new file mode 100644
index 000000000000..ef0a8a2076e9
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -0,0 +1,23 @@
1#ifndef __ASM_MACH_PXA168_H
2#define __ASM_MACH_PXA168_H
3
4#include <mach/devices.h>
5
6extern struct pxa_device_desc pxa168_device_uart1;
7extern struct pxa_device_desc pxa168_device_uart2;
8
9static inline int pxa168_add_uart(int id)
10{
11 struct pxa_device_desc *d = NULL;
12
13 switch (id) {
14 case 1: d = &pxa168_device_uart1; break;
15 case 2: d = &pxa168_device_uart2; break;
16 }
17
18 if (d == NULL)
19 return -EINVAL;
20
21 return pxa_register_device(d, NULL, 0);
22}
23#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
new file mode 100644
index 000000000000..b7aeaf574c36
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -0,0 +1,23 @@
1#ifndef __ASM_MACH_PXA910_H
2#define __ASM_MACH_PXA910_H
3
4#include <mach/devices.h>
5
6extern struct pxa_device_desc pxa910_device_uart1;
7extern struct pxa_device_desc pxa910_device_uart2;
8
9static inline int pxa910_add_uart(int id)
10{
11 struct pxa_device_desc *d = NULL;
12
13 switch (id) {
14 case 1: d = &pxa910_device_uart1; break;
15 case 2: d = &pxa910_device_uart2; break;
16 }
17
18 if (d == NULL)
19 return -EINVAL;
20
21 return pxa_register_device(d, NULL, 0);
22}
23#endif /* __ASM_MACH_PXA910_H */
diff --git a/arch/arm/mach-mmp/include/mach/regs-apbc.h b/arch/arm/mach-mmp/include/mach/regs-apbc.h
new file mode 100644
index 000000000000..c6b8c9dc2026
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/regs-apbc.h
@@ -0,0 +1,78 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/regs-apbc.h
3 *
4 * Application Peripheral Bus Clock Unit
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 __ASM_MACH_REGS_APBC_H
12#define __ASM_MACH_REGS_APBC_H
13
14#include <mach/addr-map.h>
15
16#define APBC_VIRT_BASE (APB_VIRT_BASE + 0x015000)
17#define APBC_REG(x) (APBC_VIRT_BASE + (x))
18
19/*
20 * APB clock register offsets for PXA168
21 */
22#define APBC_PXA168_UART1 APBC_REG(0x000)
23#define APBC_PXA168_UART2 APBC_REG(0x004)
24#define APBC_PXA168_GPIO APBC_REG(0x008)
25#define APBC_PXA168_PWM0 APBC_REG(0x00c)
26#define APBC_PXA168_PWM1 APBC_REG(0x010)
27#define APBC_PXA168_SSP1 APBC_REG(0x01c)
28#define APBC_PXA168_SSP2 APBC_REG(0x020)
29#define APBC_PXA168_RTC APBC_REG(0x028)
30#define APBC_PXA168_TWSI0 APBC_REG(0x02c)
31#define APBC_PXA168_KPC APBC_REG(0x030)
32#define APBC_PXA168_TIMERS APBC_REG(0x034)
33#define APBC_PXA168_AIB APBC_REG(0x03c)
34#define APBC_PXA168_SW_JTAG APBC_REG(0x040)
35#define APBC_PXA168_ONEWIRE APBC_REG(0x048)
36#define APBC_PXA168_SSP3 APBC_REG(0x04c)
37#define APBC_PXA168_ASFAR APBC_REG(0x050)
38#define APBC_PXA168_ASSAR APBC_REG(0x054)
39#define APBC_PXA168_SSP4 APBC_REG(0x058)
40#define APBC_PXA168_SSP5 APBC_REG(0x05c)
41#define APBC_PXA168_TWSI1 APBC_REG(0x06c)
42#define APBC_PXA168_UART3 APBC_REG(0x070)
43#define APBC_PXA168_AC97 APBC_REG(0x084)
44
45/*
46 * APB Clock register offsets for PXA910
47 */
48#define APBC_PXA910_UART0 APBC_REG(0x000)
49#define APBC_PXA910_UART1 APBC_REG(0x004)
50#define APBC_PXA910_GPIO APBC_REG(0x008)
51#define APBC_PXA910_PWM0 APBC_REG(0x00c)
52#define APBC_PXA910_PWM1 APBC_REG(0x010)
53#define APBC_PXA910_PWM2 APBC_REG(0x014)
54#define APBC_PXA910_PWM3 APBC_REG(0x018)
55#define APBC_PXA910_SSP1 APBC_REG(0x01c)
56#define APBC_PXA910_SSP2 APBC_REG(0x020)
57#define APBC_PXA910_IPC APBC_REG(0x024)
58#define APBC_PXA910_TWSI0 APBC_REG(0x02c)
59#define APBC_PXA910_KPC APBC_REG(0x030)
60#define APBC_PXA910_TIMERS APBC_REG(0x034)
61#define APBC_PXA910_TBROT APBC_REG(0x038)
62#define APBC_PXA910_AIB APBC_REG(0x03c)
63#define APBC_PXA910_SW_JTAG APBC_REG(0x040)
64#define APBC_PXA910_TIMERS1 APBC_REG(0x044)
65#define APBC_PXA910_ONEWIRE APBC_REG(0x048)
66#define APBC_PXA910_SSP3 APBC_REG(0x04c)
67#define APBC_PXA910_ASFAR APBC_REG(0x050)
68#define APBC_PXA910_ASSAR APBC_REG(0x054)
69
70/* Common APB clock register bit definitions */
71#define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */
72#define APBC_FNCLK (1 << 1) /* Functional Clock Enable */
73#define APBC_RST (1 << 2) /* Reset Generation */
74
75/* Functional Clock Selection Mask */
76#define APBC_FNCLKSEL(x) (((x) & 0xf) << 4)
77
78#endif /* __ASM_MACH_REGS_APBC_H */
diff --git a/arch/arm/mach-mmp/include/mach/regs-apmu.h b/arch/arm/mach-mmp/include/mach/regs-apmu.h
new file mode 100644
index 000000000000..919030514120
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/regs-apmu.h
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/regs-apmu.h
3 *
4 * Application Subsystem Power Management Unit
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 __ASM_MACH_REGS_APMU_H
12#define __ASM_MACH_REGS_APMU_H
13
14#include <mach/addr-map.h>
15
16#define APMU_VIRT_BASE (AXI_VIRT_BASE + 0x82800)
17#define APMU_REG(x) (APMU_VIRT_BASE + (x))
18
19/* Clock Reset Control */
20#define APMU_IRE APMU_REG(0x048)
21#define APMU_LCD APMU_REG(0x04c)
22#define APMU_CCIC APMU_REG(0x050)
23#define APMU_SDH0 APMU_REG(0x054)
24#define APMU_SDH1 APMU_REG(0x058)
25#define APMU_USB APMU_REG(0x05c)
26#define APMU_NAND APMU_REG(0x060)
27#define APMU_DMA APMU_REG(0x064)
28#define APMU_GEU APMU_REG(0x068)
29#define APMU_BUS APMU_REG(0x06c)
30
31#define APMU_FNCLK_EN (1 << 4)
32#define APMU_AXICLK_EN (1 << 3)
33#define APMU_FNRST_DIS (1 << 1)
34#define APMU_AXIRST_DIS (1 << 0)
35
36#endif /* __ASM_MACH_REGS_APMU_H */
diff --git a/arch/arm/mach-mmp/include/mach/regs-icu.h b/arch/arm/mach-mmp/include/mach/regs-icu.h
new file mode 100644
index 000000000000..e5f08723e0cc
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/regs-icu.h
@@ -0,0 +1,31 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/regs-icu.h
3 *
4 * Interrupt Control Unit
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 __ASM_MACH_ICU_H
12#define __ASM_MACH_ICU_H
13
14#include <mach/addr-map.h>
15
16#define ICU_VIRT_BASE (AXI_VIRT_BASE + 0x82000)
17#define ICU_REG(x) (ICU_VIRT_BASE + (x))
18
19#define ICU_INT_CONF(n) ICU_REG((n) << 2)
20#define ICU_INT_CONF_AP_INT (1 << 6)
21#define ICU_INT_CONF_CP_INT (1 << 5)
22#define ICU_INT_CONF_IRQ (1 << 4)
23#define ICU_INT_CONF_MASK (0xf)
24
25#define ICU_AP_FIQ_SEL_INT_NUM ICU_REG(0x108) /* AP FIQ Selected Interrupt */
26#define ICU_AP_IRQ_SEL_INT_NUM ICU_REG(0x10C) /* AP IRQ Selected Interrupt */
27#define ICU_AP_GBL_IRQ_MSK ICU_REG(0x114) /* AP Global Interrupt Mask */
28#define ICU_INT_STATUS_0 ICU_REG(0x128) /* Interrupt Stuats 0 */
29#define ICU_INT_STATUS_1 ICU_REG(0x12C) /* Interrupt Status 1 */
30
31#endif /* __ASM_MACH_ICU_H */
diff --git a/arch/arm/mach-mmp/include/mach/regs-timers.h b/arch/arm/mach-mmp/include/mach/regs-timers.h
new file mode 100644
index 000000000000..45589fec9fc7
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/regs-timers.h
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/regs-timers.h
3 *
4 * Timers Module
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 __ASM_MACH_REGS_TIMERS_H
12#define __ASM_MACH_REGS_TIMERS_H
13
14#include <mach/addr-map.h>
15
16#define TIMERS1_VIRT_BASE (APB_VIRT_BASE + 0x14000)
17#define TIMERS2_VIRT_BASE (APB_VIRT_BASE + 0x16000)
18
19#define TMR_CCR (0x0000)
20#define TMR_TN_MM(n, m) (0x0004 + ((n) << 3) + (((n) + (m)) << 2))
21#define TMR_CR(n) (0x0028 + ((n) << 2))
22#define TMR_SR(n) (0x0034 + ((n) << 2))
23#define TMR_IER(n) (0x0040 + ((n) << 2))
24#define TMR_PLVR(n) (0x004c + ((n) << 2))
25#define TMR_PLCR(n) (0x0058 + ((n) << 2))
26#define TMR_WMER (0x0064)
27#define TMR_WMR (0x0068)
28#define TMR_WVR (0x006c)
29#define TMR_WSR (0x0070)
30#define TMR_ICR(n) (0x0074 + ((n) << 2))
31#define TMR_WICR (0x0080)
32#define TMR_CER (0x0084)
33#define TMR_CMR (0x0088)
34#define TMR_ILR(n) (0x008c + ((n) << 2))
35#define TMR_WCR (0x0098)
36#define TMR_WFAR (0x009c)
37#define TMR_WSAR (0x00A0)
38#define TMR_CVWR(n) (0x00A4 + ((n) << 2))
39
40#define TMR_CCR_CS_0(x) (((x) & 0x3) << 0)
41#define TMR_CCR_CS_1(x) (((x) & 0x7) << 2)
42#define TMR_CCR_CS_2(x) (((x) & 0x3) << 5)
43
44#endif /* __ASM_MACH_REGS_TIMERS_H */
diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h
new file mode 100644
index 000000000000..001edfefec19
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/system.h
@@ -0,0 +1,21 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/system.h
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#ifndef __ASM_MACH_SYSTEM_H
10#define __ASM_MACH_SYSTEM_H
11
12static inline void arch_idle(void)
13{
14 cpu_do_idle();
15}
16
17static inline void arch_reset(char mode)
18{
19 cpu_reset(0);
20}
21#endif /* __ASM_MACH_SYSTEM_H */
diff --git a/arch/arm/mach-mmp/include/mach/timex.h b/arch/arm/mach-mmp/include/mach/timex.h
new file mode 100644
index 000000000000..6cebbd0ca8f4
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/timex.h
@@ -0,0 +1,9 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/timex.h
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#define CLOCK_TICK_RATE 3250000
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
new file mode 100644
index 000000000000..c93d5fa5865c
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -0,0 +1,41 @@
1/*
2 * arch/arm/mach-mmp/include/mach/uncompress.h
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/serial_reg.h>
10#include <mach/addr-map.h>
11
12#define UART1_BASE (APB_PHYS_BASE + 0x36000)
13#define UART2_BASE (APB_PHYS_BASE + 0x17000)
14#define UART3_BASE (APB_PHYS_BASE + 0x18000)
15
16static inline void putc(char c)
17{
18 volatile unsigned long *UART = (unsigned long *)UART2_BASE;
19
20 /* UART enabled? */
21 if (!(UART[UART_IER] & UART_IER_UUE))
22 return;
23
24 while (!(UART[UART_LSR] & UART_LSR_THRE))
25 barrier();
26
27 UART[UART_TX] = c;
28}
29
30/*
31 * This does not append a newline
32 */
33static inline void flush(void)
34{
35}
36
37/*
38 * nothing to do
39 */
40#define arch_decomp_setup()
41#define arch_decomp_wdog()
diff --git a/arch/arm/mach-mmp/include/mach/vmalloc.h b/arch/arm/mach-mmp/include/mach/vmalloc.h
new file mode 100644
index 000000000000..b60ccaf9fee7
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/vmalloc.h
@@ -0,0 +1,5 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/vmalloc.h
3 */
4
5#define VMALLOC_END 0xfe000000
diff --git a/arch/arm/mach-mmp/irq.c b/arch/arm/mach-mmp/irq.c
new file mode 100644
index 000000000000..52ff2f065eba
--- /dev/null
+++ b/arch/arm/mach-mmp/irq.c
@@ -0,0 +1,55 @@
1/*
2 * linux/arch/arm/mach-mmp/irq.c
3 *
4 * Generic IRQ handling, GPIO IRQ demultiplexing, etc.
5 *
6 * Author: Bin Yang <bin.yang@marvell.com>
7 * Created: Sep 30, 2008
8 * Copyright: Marvell International Ltd.
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/init.h>
16#include <linux/irq.h>
17#include <linux/io.h>
18
19#include <mach/regs-icu.h>
20
21#include "common.h"
22
23#define IRQ_ROUTE_TO_AP (ICU_INT_CONF_AP_INT | ICU_INT_CONF_IRQ)
24
25#define PRIORITY_DEFAULT 0x1
26#define PRIORITY_NONE 0x0 /* means IRQ disabled */
27
28static void icu_mask_irq(unsigned int irq)
29{
30 __raw_writel(PRIORITY_NONE, ICU_INT_CONF(irq));
31}
32
33static void icu_unmask_irq(unsigned int irq)
34{
35 __raw_writel(IRQ_ROUTE_TO_AP | PRIORITY_DEFAULT, ICU_INT_CONF(irq));
36}
37
38static struct irq_chip icu_irq_chip = {
39 .name = "icu_irq",
40 .ack = icu_mask_irq,
41 .mask = icu_mask_irq,
42 .unmask = icu_unmask_irq,
43};
44
45void __init icu_init_irq(void)
46{
47 int irq;
48
49 for (irq = 0; irq < 64; irq++) {
50 icu_mask_irq(irq);
51 set_irq_chip(irq, &icu_irq_chip);
52 set_irq_handler(irq, handle_level_irq);
53 set_irq_flags(irq, IRQF_VALID);
54 }
55}
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
new file mode 100644
index 000000000000..ae924468658c
--- /dev/null
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -0,0 +1,111 @@
1/*
2 * linux/arch/arm/mach-mmp/pxa168.c
3 *
4 * Code specific to PXA168
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/module.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/list.h>
15#include <linux/io.h>
16#include <linux/clk.h>
17
18#include <asm/mach/time.h>
19#include <mach/addr-map.h>
20#include <mach/cputype.h>
21#include <mach/regs-apbc.h>
22#include <mach/irqs.h>
23#include <mach/gpio.h>
24#include <mach/dma.h>
25#include <mach/devices.h>
26#include <mach/mfp.h>
27
28#include "common.h"
29#include "clock.h"
30
31#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
32
33static struct mfp_addr_map pxa168_mfp_addr_map[] __initdata =
34{
35 MFP_ADDR_X(GPIO0, GPIO36, 0x04c),
36 MFP_ADDR_X(GPIO37, GPIO55, 0x000),
37 MFP_ADDR_X(GPIO56, GPIO123, 0x0e0),
38 MFP_ADDR_X(GPIO124, GPIO127, 0x0f4),
39
40 MFP_ADDR_END,
41};
42
43#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
44
45static void __init pxa168_init_gpio(void)
46{
47 int i;
48
49 /* enable GPIO clock */
50 __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA168_GPIO);
51
52 /* unmask GPIO edge detection for all 4 banks - APMASKx */
53 for (i = 0; i < 4; i++)
54 __raw_writel(0xffffffff, APMASK(i));
55
56 pxa_init_gpio(IRQ_PXA168_GPIOX, 0, 127, NULL);
57}
58
59void __init pxa168_init_irq(void)
60{
61 icu_init_irq();
62 pxa168_init_gpio();
63}
64
65/* APB peripheral clocks */
66static APBC_CLK(uart1, PXA168_UART1, 1, 14745600);
67static APBC_CLK(uart2, PXA168_UART2, 1, 14745600);
68
69/* device and clock bindings */
70static struct clk_lookup pxa168_clkregs[] = {
71 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
72 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
73};
74
75static int __init pxa168_init(void)
76{
77 if (cpu_is_pxa168()) {
78 mfp_init_base(MFPR_VIRT_BASE);
79 mfp_init_addr(pxa168_mfp_addr_map);
80 pxa_init_dma(IRQ_PXA168_DMA_INT0, 32);
81 clks_register(ARRAY_AND_SIZE(pxa168_clkregs));
82 }
83
84 return 0;
85}
86postcore_initcall(pxa168_init);
87
88/* system timer - clock enabled, 3.25MHz */
89#define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3))
90
91static void __init pxa168_timer_init(void)
92{
93 /* this is early, we have to initialize the CCU registers by
94 * ourselves instead of using clk_* API. Clock rate is defined
95 * by APBC_TIMERS_CLK_RST (3.25MHz) and enabled free-running
96 */
97 __raw_writel(APBC_APBCLK | APBC_RST, APBC_PXA168_TIMERS);
98
99 /* 3.25MHz, bus/functional clock enabled, release reset */
100 __raw_writel(TIMER_CLK_RST, APBC_PXA168_TIMERS);
101
102 timer_init(IRQ_PXA168_TIMER1);
103}
104
105struct sys_timer pxa168_timer = {
106 .init = pxa168_timer_init,
107};
108
109/* on-chip devices */
110PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22);
111PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24);
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
new file mode 100644
index 000000000000..453f8f7758bf
--- /dev/null
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -0,0 +1,158 @@
1/*
2 * linux/arch/arm/mach-mmp/pxa910.c
3 *
4 * Code specific to PXA910
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/module.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/list.h>
15#include <linux/io.h>
16
17#include <asm/mach/time.h>
18#include <mach/addr-map.h>
19#include <mach/regs-apbc.h>
20#include <mach/regs-apmu.h>
21#include <mach/cputype.h>
22#include <mach/irqs.h>
23#include <mach/gpio.h>
24#include <mach/dma.h>
25#include <mach/mfp.h>
26#include <mach/devices.h>
27
28#include "common.h"
29#include "clock.h"
30
31#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
32
33static struct mfp_addr_map pxa910_mfp_addr_map[] __initdata =
34{
35 MFP_ADDR_X(GPIO0, GPIO54, 0xdc),
36 MFP_ADDR_X(GPIO67, GPIO98, 0x1b8),
37 MFP_ADDR_X(GPIO100, GPIO109, 0x238),
38
39 MFP_ADDR(GPIO123, 0xcc),
40 MFP_ADDR(GPIO124, 0xd0),
41
42 MFP_ADDR(DF_IO0, 0x40),
43 MFP_ADDR(DF_IO1, 0x3c),
44 MFP_ADDR(DF_IO2, 0x38),
45 MFP_ADDR(DF_IO3, 0x34),
46 MFP_ADDR(DF_IO4, 0x30),
47 MFP_ADDR(DF_IO5, 0x2c),
48 MFP_ADDR(DF_IO6, 0x28),
49 MFP_ADDR(DF_IO7, 0x24),
50 MFP_ADDR(DF_IO8, 0x20),
51 MFP_ADDR(DF_IO9, 0x1c),
52 MFP_ADDR(DF_IO10, 0x18),
53 MFP_ADDR(DF_IO11, 0x14),
54 MFP_ADDR(DF_IO12, 0x10),
55 MFP_ADDR(DF_IO13, 0xc),
56 MFP_ADDR(DF_IO14, 0x8),
57 MFP_ADDR(DF_IO15, 0x4),
58
59 MFP_ADDR(DF_nCS0_SM_nCS2, 0x44),
60 MFP_ADDR(DF_nCS1_SM_nCS3, 0x48),
61 MFP_ADDR(SM_nCS0, 0x4c),
62 MFP_ADDR(SM_nCS1, 0x50),
63 MFP_ADDR(DF_WEn, 0x54),
64 MFP_ADDR(DF_REn, 0x58),
65 MFP_ADDR(DF_CLE_SM_OEn, 0x5c),
66 MFP_ADDR(DF_ALE_SM_WEn, 0x60),
67 MFP_ADDR(SM_SCLK, 0x64),
68 MFP_ADDR(DF_RDY0, 0x68),
69 MFP_ADDR(SM_BE0, 0x6c),
70 MFP_ADDR(SM_BE1, 0x70),
71 MFP_ADDR(SM_ADV, 0x74),
72 MFP_ADDR(DF_RDY1, 0x78),
73 MFP_ADDR(SM_ADVMUX, 0x7c),
74 MFP_ADDR(SM_RDY, 0x80),
75
76 MFP_ADDR_X(MMC1_DAT7, MMC1_WP, 0x84),
77
78 MFP_ADDR_END,
79};
80
81#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x09c)
82
83static void __init pxa910_init_gpio(void)
84{
85 int i;
86
87 /* enable GPIO clock */
88 __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_PXA910_GPIO);
89
90 /* unmask GPIO edge detection for all 4 banks - APMASKx */
91 for (i = 0; i < 4; i++)
92 __raw_writel(0xffffffff, APMASK(i));
93
94 pxa_init_gpio(IRQ_PXA910_AP_GPIO, 0, 127, NULL);
95}
96
97void __init pxa910_init_irq(void)
98{
99 icu_init_irq();
100 pxa910_init_gpio();
101}
102
103/* APB peripheral clocks */
104static APBC_CLK(uart1, PXA910_UART0, 1, 14745600);
105static APBC_CLK(uart2, PXA910_UART1, 1, 14745600);
106
107/* device and clock bindings */
108static struct clk_lookup pxa910_clkregs[] = {
109 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
110 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
111};
112
113static int __init pxa910_init(void)
114{
115 if (cpu_is_pxa910()) {
116 mfp_init_base(MFPR_VIRT_BASE);
117 mfp_init_addr(pxa910_mfp_addr_map);
118 pxa_init_dma(IRQ_PXA910_DMA_INT0, 32);
119 clks_register(ARRAY_AND_SIZE(pxa910_clkregs));
120 }
121
122 return 0;
123}
124postcore_initcall(pxa910_init);
125
126/* system timer - clock enabled, 3.25MHz */
127#define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3))
128
129static void __init pxa910_timer_init(void)
130{
131 /* reset and configure */
132 __raw_writel(APBC_APBCLK | APBC_RST, APBC_PXA910_TIMERS);
133 __raw_writel(TIMER_CLK_RST, APBC_PXA910_TIMERS);
134
135 timer_init(IRQ_PXA910_AP1_TIMER1);
136}
137
138struct sys_timer pxa910_timer = {
139 .init = pxa910_timer_init,
140};
141
142/* on-chip devices */
143
144/* NOTE: there are totally 3 UARTs on PXA910:
145 *
146 * UART1 - Slow UART (can be used both by AP and CP)
147 * UART2/3 - Fast UART
148 *
149 * To be backward compatible with the legacy FFUART/BTUART/STUART sequence,
150 * they are re-ordered as:
151 *
152 * pxa910_device_uart1 - UART2 as FFUART
153 * pxa910_device_uart2 - UART3 as BTUART
154 *
155 * UART1 is not used by AP for the moment.
156 */
157PXA910_DEVICE(uart1, "pxa2xx-uart", 0, UART2, 0xd4017000, 0x30, 21, 22);
158PXA910_DEVICE(uart2, "pxa2xx-uart", 1, UART3, 0xd4018000, 0x30, 23, 24);
diff --git a/arch/arm/mach-mmp/tavorevb.c b/arch/arm/mach-mmp/tavorevb.c
new file mode 100644
index 000000000000..0e0c9220eaba
--- /dev/null
+++ b/arch/arm/mach-mmp/tavorevb.c
@@ -0,0 +1,109 @@
1/*
2 * linux/arch/arm/mach-mmp/tavorevb.c
3 *
4 * Support for the Marvell PXA910-based TavorEVB Development Platform.
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 * publishhed by the Free Software Foundation.
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/platform_device.h>
14#include <linux/smc91x.h>
15
16#include <asm/mach-types.h>
17#include <asm/mach/arch.h>
18#include <mach/addr-map.h>
19#include <mach/mfp-pxa910.h>
20#include <mach/pxa910.h>
21#include <mach/gpio.h>
22
23#include "common.h"
24
25static unsigned long tavorevb_pin_config[] __initdata = {
26 /* UART2 */
27 GPIO47_UART2_RXD,
28 GPIO48_UART2_TXD,
29
30 /* SMC */
31 SM_nCS0_nCS0,
32 SM_ADV_SM_ADV,
33 SM_SCLK_SM_SCLK,
34 SM_SCLK_SM_SCLK,
35 SM_BE0_SM_BE0,
36 SM_BE1_SM_BE1,
37
38 /* DFI */
39 DF_IO0_ND_IO0,
40 DF_IO1_ND_IO1,
41 DF_IO2_ND_IO2,
42 DF_IO3_ND_IO3,
43 DF_IO4_ND_IO4,
44 DF_IO5_ND_IO5,
45 DF_IO6_ND_IO6,
46 DF_IO7_ND_IO7,
47 DF_IO8_ND_IO8,
48 DF_IO9_ND_IO9,
49 DF_IO10_ND_IO10,
50 DF_IO11_ND_IO11,
51 DF_IO12_ND_IO12,
52 DF_IO13_ND_IO13,
53 DF_IO14_ND_IO14,
54 DF_IO15_ND_IO15,
55 DF_nCS0_SM_nCS2_nCS0,
56 DF_ALE_SM_WEn_ND_ALE,
57 DF_CLE_SM_OEn_ND_CLE,
58 DF_WEn_DF_WEn,
59 DF_REn_DF_REn,
60 DF_RDY0_DF_RDY0,
61};
62
63static struct smc91x_platdata tavorevb_smc91x_info = {
64 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
65};
66
67static struct resource smc91x_resources[] = {
68 [0] = {
69 .start = SMC_CS1_PHYS_BASE + 0x300,
70 .end = SMC_CS1_PHYS_BASE + 0xfffff,
71 .flags = IORESOURCE_MEM,
72 },
73 [1] = {
74 .start = gpio_to_irq(80),
75 .end = gpio_to_irq(80),
76 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
77 }
78};
79
80static struct platform_device smc91x_device = {
81 .name = "smc91x",
82 .id = 0,
83 .dev = {
84 .platform_data = &tavorevb_smc91x_info,
85 },
86 .num_resources = ARRAY_SIZE(smc91x_resources),
87 .resource = smc91x_resources,
88};
89
90static void __init tavorevb_init(void)
91{
92 mfp_config(ARRAY_AND_SIZE(tavorevb_pin_config));
93
94 /* on-chip devices */
95 pxa910_add_uart(1);
96
97 /* off-chip devices */
98 platform_device_register(&smc91x_device);
99}
100
101MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)")
102 .phys_io = APB_PHYS_BASE,
103 .boot_params = 0x00000100,
104 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
105 .map_io = pxa_map_io,
106 .init_irq = pxa910_init_irq,
107 .timer = &pxa910_timer,
108 .init_machine = tavorevb_init,
109MACHINE_END
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
new file mode 100644
index 000000000000..b03a6eda7419
--- /dev/null
+++ b/arch/arm/mach-mmp/time.c
@@ -0,0 +1,199 @@
1/*
2 * linux/arch/arm/mach-mmp/time.c
3 *
4 * Support for clocksource and clockevents
5 *
6 * Copyright (C) 2008 Marvell International Ltd.
7 * All rights reserved.
8 *
9 * 2008-04-11: Jason Chagas <Jason.chagas@marvell.com>
10 * 2008-10-08: Bin Yang <bin.yang@marvell.com>
11 *
12 * The timers module actually includes three timers, each timer with upto
13 * three match comparators. Timer #0 is used here in free-running mode as
14 * the clock source, and match comparator #1 used as clock event device.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 */
20
21#include <linux/init.h>
22#include <linux/kernel.h>
23#include <linux/interrupt.h>
24#include <linux/clockchips.h>
25
26#include <linux/io.h>
27#include <linux/irq.h>
28#include <linux/sched.h>
29#include <linux/cnt32_to_63.h>
30
31#include <mach/addr-map.h>
32#include <mach/regs-timers.h>
33#include <mach/irqs.h>
34
35#include "clock.h"
36
37#define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE
38
39#define MAX_DELTA (0xfffffffe)
40#define MIN_DELTA (16)
41
42#define TCR2NS_SCALE_FACTOR 10
43
44static unsigned long tcr2ns_scale;
45
46static void __init set_tcr2ns_scale(unsigned long tcr_rate)
47{
48 unsigned long long v = 1000000000ULL << TCR2NS_SCALE_FACTOR;
49 do_div(v, tcr_rate);
50 tcr2ns_scale = v;
51 /*
52 * We want an even value to automatically clear the top bit
53 * returned by cnt32_to_63() without an additional run time
54 * instruction. So if the LSB is 1 then round it up.
55 */
56 if (tcr2ns_scale & 1)
57 tcr2ns_scale++;
58}
59
60/*
61 * FIXME: the timer needs some delay to stablize the counter capture
62 */
63static inline uint32_t timer_read(void)
64{
65 int delay = 100;
66
67 __raw_writel(1, TIMERS_VIRT_BASE + TMR_CVWR(0));
68
69 while (delay--)
70 cpu_relax();
71
72 return __raw_readl(TIMERS_VIRT_BASE + TMR_CVWR(0));
73}
74
75unsigned long long sched_clock(void)
76{
77 unsigned long long v = cnt32_to_63(timer_read());
78 return (v * tcr2ns_scale) >> TCR2NS_SCALE_FACTOR;
79}
80
81static irqreturn_t timer_interrupt(int irq, void *dev_id)
82{
83 struct clock_event_device *c = dev_id;
84
85 /* disable and clear pending interrupt status */
86 __raw_writel(0x0, TIMERS_VIRT_BASE + TMR_IER(0));
87 __raw_writel(0x1, TIMERS_VIRT_BASE + TMR_ICR(0));
88 c->event_handler(c);
89 return IRQ_HANDLED;
90}
91
92static int timer_set_next_event(unsigned long delta,
93 struct clock_event_device *dev)
94{
95 unsigned long flags, next;
96
97 local_irq_save(flags);
98
99 /* clear pending interrupt status and enable */
100 __raw_writel(0x01, TIMERS_VIRT_BASE + TMR_ICR(0));
101 __raw_writel(0x01, TIMERS_VIRT_BASE + TMR_IER(0));
102
103 next = timer_read() + delta;
104 __raw_writel(next, TIMERS_VIRT_BASE + TMR_TN_MM(0, 0));
105
106 local_irq_restore(flags);
107 return 0;
108}
109
110static void timer_set_mode(enum clock_event_mode mode,
111 struct clock_event_device *dev)
112{
113 unsigned long flags;
114
115 local_irq_save(flags);
116 switch (mode) {
117 case CLOCK_EVT_MODE_ONESHOT:
118 case CLOCK_EVT_MODE_UNUSED:
119 case CLOCK_EVT_MODE_SHUTDOWN:
120 /* disable the matching interrupt */
121 __raw_writel(0x00, TIMERS_VIRT_BASE + TMR_IER(0));
122 break;
123 case CLOCK_EVT_MODE_RESUME:
124 case CLOCK_EVT_MODE_PERIODIC:
125 break;
126 }
127 local_irq_restore(flags);
128}
129
130static struct clock_event_device ckevt = {
131 .name = "clockevent",
132 .features = CLOCK_EVT_FEAT_ONESHOT,
133 .shift = 32,
134 .rating = 200,
135 .set_next_event = timer_set_next_event,
136 .set_mode = timer_set_mode,
137};
138
139static cycle_t clksrc_read(void)
140{
141 return timer_read();
142}
143
144static struct clocksource cksrc = {
145 .name = "clocksource",
146 .shift = 20,
147 .rating = 200,
148 .read = clksrc_read,
149 .mask = CLOCKSOURCE_MASK(32),
150 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
151};
152
153static void __init timer_config(void)
154{
155 uint32_t ccr = __raw_readl(TIMERS_VIRT_BASE + TMR_CCR);
156 uint32_t cer = __raw_readl(TIMERS_VIRT_BASE + TMR_CER);
157 uint32_t cmr = __raw_readl(TIMERS_VIRT_BASE + TMR_CMR);
158
159 __raw_writel(cer & ~0x1, TIMERS_VIRT_BASE + TMR_CER); /* disable */
160
161 ccr &= TMR_CCR_CS_0(0x3);
162 __raw_writel(ccr, TIMERS_VIRT_BASE + TMR_CCR);
163
164 /* free-running mode */
165 __raw_writel(cmr | 0x01, TIMERS_VIRT_BASE + TMR_CMR);
166
167 __raw_writel(0x0, TIMERS_VIRT_BASE + TMR_PLCR(0)); /* free-running */
168 __raw_writel(0x7, TIMERS_VIRT_BASE + TMR_ICR(0)); /* clear status */
169 __raw_writel(0x0, TIMERS_VIRT_BASE + TMR_IER(0));
170
171 /* enable timer counter */
172 __raw_writel(cer | 0x01, TIMERS_VIRT_BASE + TMR_CER);
173}
174
175static struct irqaction timer_irq = {
176 .name = "timer",
177 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
178 .handler = timer_interrupt,
179 .dev_id = &ckevt,
180};
181
182void __init timer_init(int irq)
183{
184 timer_config();
185
186 set_tcr2ns_scale(CLOCK_TICK_RATE);
187
188 ckevt.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, ckevt.shift);
189 ckevt.max_delta_ns = clockevent_delta2ns(MAX_DELTA, &ckevt);
190 ckevt.min_delta_ns = clockevent_delta2ns(MIN_DELTA, &ckevt);
191 ckevt.cpumask = cpumask_of(0);
192
193 cksrc.mult = clocksource_hz2mult(CLOCK_TICK_RATE, cksrc.shift);
194
195 setup_irq(irq, &timer_irq);
196
197 clocksource_register(&cksrc);
198 clockevents_register_device(&ckevt);
199}
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
new file mode 100644
index 000000000000..08cfef6c92a2
--- /dev/null
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -0,0 +1,47 @@
1/*
2 * linux/arch/arm/mach-mmp/ttc_dkb.c
3 *
4 * Support for the Marvell PXA910-based TTC_DKB Development Platform.
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 * publishhed by the Free Software Foundation.
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/platform_device.h>
14
15#include <asm/mach-types.h>
16#include <asm/mach/arch.h>
17#include <mach/addr-map.h>
18#include <mach/mfp-pxa910.h>
19#include <mach/pxa910.h>
20
21#include "common.h"
22
23#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
24
25static unsigned long ttc_dkb_pin_config[] __initdata = {
26 /* UART2 */
27 GPIO47_UART2_RXD,
28 GPIO48_UART2_TXD,
29};
30
31static void __init ttc_dkb_init(void)
32{
33 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
34
35 /* on-chip devices */
36 pxa910_add_uart(1);
37}
38
39MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
40 .phys_io = APB_PHYS_BASE,
41 .boot_params = 0x00000100,
42 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
43 .map_io = pxa_map_io,
44 .init_irq = pxa910_init_irq,
45 .timer = &pxa910_timer,
46 .init_machine = ttc_dkb_init,
47MACHINE_END
diff --git a/arch/arm/mach-msm/include/mach/system.h b/arch/arm/mach-msm/include/mach/system.h
index f05ad2e0f235..574ccc493daf 100644
--- a/arch/arm/mach-msm/include/mach/system.h
+++ b/arch/arm/mach-msm/include/mach/system.h
@@ -17,7 +17,7 @@
17 17
18void arch_idle(void); 18void arch_idle(void);
19 19
20static inline void arch_reset(char mode) 20static inline void arch_reset(char mode, const char *cmd)
21{ 21{
22 for (;;) ; /* depends on IPC w/ other core */ 22 for (;;) ; /* depends on IPC w/ other core */
23} 23}
diff --git a/arch/arm/mach-mv78xx0/Kconfig b/arch/arm/mach-mv78xx0/Kconfig
index d83cb86837db..6fbe68fe4412 100644
--- a/arch/arm/mach-mv78xx0/Kconfig
+++ b/arch/arm/mach-mv78xx0/Kconfig
@@ -8,6 +8,12 @@ config MACH_DB78X00_BP
8 Say 'Y' here if you want your kernel to support the 8 Say 'Y' here if you want your kernel to support the
9 Marvell DB-78x00-BP Development Board. 9 Marvell DB-78x00-BP Development Board.
10 10
11config MACH_RD78X00_MASA
12 bool "Marvell RD-78x00-mASA Reference Design"
13 help
14 Say 'Y' here if you want your kernel to support the
15 Marvell RD-78x00-mASA Reference Design.
16
11endmenu 17endmenu
12 18
13endif 19endif
diff --git a/arch/arm/mach-mv78xx0/Makefile b/arch/arm/mach-mv78xx0/Makefile
index ec16c05c3b1b..da628b7f3bb6 100644
--- a/arch/arm/mach-mv78xx0/Makefile
+++ b/arch/arm/mach-mv78xx0/Makefile
@@ -1,2 +1,3 @@
1obj-y += common.o addr-map.o irq.o pcie.o 1obj-y += common.o addr-map.o irq.o pcie.o
2obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o 2obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o
3obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index b0e4e0d8f506..a575daaa62d1 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -14,7 +14,9 @@
14#include <linux/serial_8250.h> 14#include <linux/serial_8250.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
17#include <linux/mv643xx_i2c.h>
17#include <linux/ata_platform.h> 18#include <linux/ata_platform.h>
19#include <linux/ethtool.h>
18#include <asm/mach/map.h> 20#include <asm/mach/map.h>
19#include <asm/mach/time.h> 21#include <asm/mach/time.h>
20#include <mach/mv78xx0.h> 22#include <mach/mv78xx0.h>
@@ -430,9 +432,22 @@ static struct platform_device mv78xx0_ge10 = {
430 432
431void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data) 433void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
432{ 434{
435 u32 dev, rev;
436
433 eth_data->shared = &mv78xx0_ge10_shared; 437 eth_data->shared = &mv78xx0_ge10_shared;
434 mv78xx0_ge10.dev.platform_data = eth_data; 438 mv78xx0_ge10.dev.platform_data = eth_data;
435 439
440 /*
441 * On the Z0, ge10 and ge11 are internally connected back
442 * to back, and not brought out.
443 */
444 mv78xx0_pcie_id(&dev, &rev);
445 if (dev == MV78X00_Z0_DEV_ID) {
446 eth_data->phy_addr = MV643XX_ETH_PHY_NONE;
447 eth_data->speed = SPEED_1000;
448 eth_data->duplex = DUPLEX_FULL;
449 }
450
436 platform_device_register(&mv78xx0_ge10_shared); 451 platform_device_register(&mv78xx0_ge10_shared);
437 platform_device_register(&mv78xx0_ge10); 452 platform_device_register(&mv78xx0_ge10);
438} 453}
@@ -484,13 +499,101 @@ static struct platform_device mv78xx0_ge11 = {
484 499
485void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data) 500void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
486{ 501{
502 u32 dev, rev;
503
487 eth_data->shared = &mv78xx0_ge11_shared; 504 eth_data->shared = &mv78xx0_ge11_shared;
488 mv78xx0_ge11.dev.platform_data = eth_data; 505 mv78xx0_ge11.dev.platform_data = eth_data;
489 506
507 /*
508 * On the Z0, ge10 and ge11 are internally connected back
509 * to back, and not brought out.
510 */
511 mv78xx0_pcie_id(&dev, &rev);
512 if (dev == MV78X00_Z0_DEV_ID) {
513 eth_data->phy_addr = MV643XX_ETH_PHY_NONE;
514 eth_data->speed = SPEED_1000;
515 eth_data->duplex = DUPLEX_FULL;
516 }
517
490 platform_device_register(&mv78xx0_ge11_shared); 518 platform_device_register(&mv78xx0_ge11_shared);
491 platform_device_register(&mv78xx0_ge11); 519 platform_device_register(&mv78xx0_ge11);
492} 520}
493 521
522/*****************************************************************************
523 * I2C bus 0
524 ****************************************************************************/
525
526static struct mv64xxx_i2c_pdata mv78xx0_i2c_0_pdata = {
527 .freq_m = 8, /* assumes 166 MHz TCLK */
528 .freq_n = 3,
529 .timeout = 1000, /* Default timeout of 1 second */
530};
531
532static struct resource mv78xx0_i2c_0_resources[] = {
533 {
534 .name = "i2c 0 base",
535 .start = I2C_0_PHYS_BASE,
536 .end = I2C_0_PHYS_BASE + 0x1f,
537 .flags = IORESOURCE_MEM,
538 }, {
539 .name = "i2c 0 irq",
540 .start = IRQ_MV78XX0_I2C_0,
541 .end = IRQ_MV78XX0_I2C_0,
542 .flags = IORESOURCE_IRQ,
543 },
544};
545
546
547static struct platform_device mv78xx0_i2c_0 = {
548 .name = MV64XXX_I2C_CTLR_NAME,
549 .id = 0,
550 .num_resources = ARRAY_SIZE(mv78xx0_i2c_0_resources),
551 .resource = mv78xx0_i2c_0_resources,
552 .dev = {
553 .platform_data = &mv78xx0_i2c_0_pdata,
554 },
555};
556
557/*****************************************************************************
558 * I2C bus 1
559 ****************************************************************************/
560
561static struct mv64xxx_i2c_pdata mv78xx0_i2c_1_pdata = {
562 .freq_m = 8, /* assumes 166 MHz TCLK */
563 .freq_n = 3,
564 .timeout = 1000, /* Default timeout of 1 second */
565};
566
567static struct resource mv78xx0_i2c_1_resources[] = {
568 {
569 .name = "i2c 1 base",
570 .start = I2C_1_PHYS_BASE,
571 .end = I2C_1_PHYS_BASE + 0x1f,
572 .flags = IORESOURCE_MEM,
573 }, {
574 .name = "i2c 1 irq",
575 .start = IRQ_MV78XX0_I2C_1,
576 .end = IRQ_MV78XX0_I2C_1,
577 .flags = IORESOURCE_IRQ,
578 },
579};
580
581
582static struct platform_device mv78xx0_i2c_1 = {
583 .name = MV64XXX_I2C_CTLR_NAME,
584 .id = 1,
585 .num_resources = ARRAY_SIZE(mv78xx0_i2c_1_resources),
586 .resource = mv78xx0_i2c_1_resources,
587 .dev = {
588 .platform_data = &mv78xx0_i2c_1_pdata,
589 },
590};
591
592void __init mv78xx0_i2c_init(void)
593{
594 platform_device_register(&mv78xx0_i2c_0);
595 platform_device_register(&mv78xx0_i2c_1);
596}
494 597
495/***************************************************************************** 598/*****************************************************************************
496 * SATA 599 * SATA
@@ -719,6 +822,32 @@ struct sys_timer mv78xx0_timer = {
719/***************************************************************************** 822/*****************************************************************************
720 * General 823 * General
721 ****************************************************************************/ 824 ****************************************************************************/
825static char * __init mv78xx0_id(void)
826{
827 u32 dev, rev;
828
829 mv78xx0_pcie_id(&dev, &rev);
830
831 if (dev == MV78X00_Z0_DEV_ID) {
832 if (rev == MV78X00_REV_Z0)
833 return "MV78X00-Z0";
834 else
835 return "MV78X00-Rev-Unsupported";
836 } else if (dev == MV78100_DEV_ID) {
837 if (rev == MV78100_REV_A0)
838 return "MV78100-A0";
839 else
840 return "MV78100-Rev-Unsupported";
841 } else if (dev == MV78200_DEV_ID) {
842 if (rev == MV78100_REV_A0)
843 return "MV78200-A0";
844 else
845 return "MV78200-Rev-Unsupported";
846 } else {
847 return "Device-Unknown";
848 }
849}
850
722static int __init is_l2_writethrough(void) 851static int __init is_l2_writethrough(void)
723{ 852{
724 return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH); 853 return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH);
@@ -737,7 +866,8 @@ void __init mv78xx0_init(void)
737 get_pclk_l2clk(hclk, core_index, &pclk, &l2clk); 866 get_pclk_l2clk(hclk, core_index, &pclk, &l2clk);
738 tclk = get_tclk(); 867 tclk = get_tclk();
739 868
740 printk(KERN_INFO "MV78xx0 core #%d, ", core_index); 869 printk(KERN_INFO "%s ", mv78xx0_id());
870 printk("core #%d, ", core_index);
741 printk("PCLK = %dMHz, ", (pclk + 499999) / 1000000); 871 printk("PCLK = %dMHz, ", (pclk + 499999) / 1000000);
742 printk("L2 = %dMHz, ", (l2clk + 499999) / 1000000); 872 printk("L2 = %dMHz, ", (l2clk + 499999) / 1000000);
743 printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000); 873 printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000);
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
index 78af5de319dd..befc22475469 100644
--- a/arch/arm/mach-mv78xx0/common.h
+++ b/arch/arm/mach-mv78xx0/common.h
@@ -29,6 +29,8 @@ void mv78xx0_setup_pcie_io_win(int window, u32 base, u32 size,
29void mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size, 29void mv78xx0_setup_pcie_mem_win(int window, u32 base, u32 size,
30 int maj, int min); 30 int maj, int min);
31 31
32void mv78xx0_pcie_id(u32 *dev, u32 *rev);
33
32void mv78xx0_ehci0_init(void); 34void mv78xx0_ehci0_init(void);
33void mv78xx0_ehci1_init(void); 35void mv78xx0_ehci1_init(void);
34void mv78xx0_ehci2_init(void); 36void mv78xx0_ehci2_init(void);
@@ -42,6 +44,7 @@ void mv78xx0_uart0_init(void);
42void mv78xx0_uart1_init(void); 44void mv78xx0_uart1_init(void);
43void mv78xx0_uart2_init(void); 45void mv78xx0_uart2_init(void);
44void mv78xx0_uart3_init(void); 46void mv78xx0_uart3_init(void);
47void mv78xx0_i2c_init(void);
45 48
46extern struct sys_timer mv78xx0_timer; 49extern struct sys_timer mv78xx0_timer;
47 50
diff --git a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
index 2e285bbb7bbd..efdabe04c69e 100644
--- a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
+++ b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
@@ -14,6 +14,7 @@
14#include <linux/ata_platform.h> 14#include <linux/ata_platform.h>
15#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
16#include <linux/ethtool.h> 16#include <linux/ethtool.h>
17#include <linux/i2c.h>
17#include <mach/mv78xx0.h> 18#include <mach/mv78xx0.h>
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
@@ -28,21 +29,22 @@ static struct mv643xx_eth_platform_data db78x00_ge01_data = {
28}; 29};
29 30
30static struct mv643xx_eth_platform_data db78x00_ge10_data = { 31static struct mv643xx_eth_platform_data db78x00_ge10_data = {
31 .phy_addr = MV643XX_ETH_PHY_NONE, 32 .phy_addr = MV643XX_ETH_PHY_ADDR(10),
32 .speed = SPEED_1000,
33 .duplex = DUPLEX_FULL,
34}; 33};
35 34
36static struct mv643xx_eth_platform_data db78x00_ge11_data = { 35static struct mv643xx_eth_platform_data db78x00_ge11_data = {
37 .phy_addr = MV643XX_ETH_PHY_NONE, 36 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
38 .speed = SPEED_1000,
39 .duplex = DUPLEX_FULL,
40}; 37};
41 38
42static struct mv_sata_platform_data db78x00_sata_data = { 39static struct mv_sata_platform_data db78x00_sata_data = {
43 .n_ports = 2, 40 .n_ports = 2,
44}; 41};
45 42
43static struct i2c_board_info __initdata db78x00_i2c_rtc = {
44 I2C_BOARD_INFO("ds1338", 0x68),
45};
46
47
46static void __init db78x00_init(void) 48static void __init db78x00_init(void)
47{ 49{
48 /* 50 /*
@@ -64,6 +66,8 @@ static void __init db78x00_init(void)
64 mv78xx0_sata_init(&db78x00_sata_data); 66 mv78xx0_sata_init(&db78x00_sata_data);
65 mv78xx0_uart0_init(); 67 mv78xx0_uart0_init();
66 mv78xx0_uart2_init(); 68 mv78xx0_uart2_init();
69 mv78xx0_i2c_init();
70 i2c_register_board_info(0, &db78x00_i2c_rtc, 1);
67 } else { 71 } else {
68 mv78xx0_uart1_init(); 72 mv78xx0_uart1_init();
69 mv78xx0_uart3_init(); 73 mv78xx0_uart3_init();
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
index e930ea5330a2..582cffc733ad 100644
--- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
+++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
@@ -80,6 +80,18 @@
80#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300) 80#define TIMER_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0300)
81 81
82/* 82/*
83 * Supported devices and revisions.
84 */
85#define MV78X00_Z0_DEV_ID 0x6381
86#define MV78X00_REV_Z0 1
87
88#define MV78100_DEV_ID 0x7810
89#define MV78100_REV_A0 1
90
91#define MV78200_DEV_ID 0x7820
92#define MV78200_REV_A0 1
93
94/*
83 * Register Map 95 * Register Map
84 */ 96 */
85#define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000) 97#define DDR_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x00000)
@@ -90,6 +102,8 @@
90#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000) 102#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000)
91#define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE | 0x0030) 103#define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE | 0x0030)
92#define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE | 0x0034) 104#define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE | 0x0034)
105#define I2C_0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000)
106#define I2C_1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1100)
93#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) 107#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000)
94#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) 108#define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000)
95#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) 109#define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100)
diff --git a/arch/arm/mach-mv78xx0/include/mach/system.h b/arch/arm/mach-mv78xx0/include/mach/system.h
index 7d5179408832..1d6350b22d0b 100644
--- a/arch/arm/mach-mv78xx0/include/mach/system.h
+++ b/arch/arm/mach-mv78xx0/include/mach/system.h
@@ -17,7 +17,7 @@ static inline void arch_idle(void)
17 cpu_do_idle(); 17 cpu_do_idle();
18} 18}
19 19
20static inline void arch_reset(char mode) 20static inline void arch_reset(char mode, const char *cmd)
21{ 21{
22 /* 22 /*
23 * Enable soft reset to assert RSTOUTn. 23 * Enable soft reset to assert RSTOUTn.
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c
index aad3a7a2f830..a560439dcc3c 100644
--- a/arch/arm/mach-mv78xx0/pcie.c
+++ b/arch/arm/mach-mv78xx0/pcie.c
@@ -33,6 +33,12 @@ static struct resource pcie_io_space;
33static struct resource pcie_mem_space; 33static struct resource pcie_mem_space;
34 34
35 35
36void __init mv78xx0_pcie_id(u32 *dev, u32 *rev)
37{
38 *dev = orion_pcie_dev_id((void __iomem *)PCIE00_VIRT_BASE);
39 *rev = orion_pcie_rev((void __iomem *)PCIE00_VIRT_BASE);
40}
41
36static void __init mv78xx0_pcie_preinit(void) 42static void __init mv78xx0_pcie_preinit(void)
37{ 43{
38 int i; 44 int i;
diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
new file mode 100644
index 000000000000..e136b7a03355
--- /dev/null
+++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
@@ -0,0 +1,88 @@
1/*
2 * arch/arm/mach-mv78x00/rd78x00-masa-setup.c
3 *
4 * Marvell RD-78x00-mASA 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/ata_platform.h>
15#include <linux/mv643xx_eth.h>
16#include <linux/ethtool.h>
17#include <mach/mv78xx0.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include "common.h"
21
22static struct mv643xx_eth_platform_data rd78x00_masa_ge00_data = {
23 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
24};
25
26static struct mv643xx_eth_platform_data rd78x00_masa_ge01_data = {
27 .phy_addr = MV643XX_ETH_PHY_ADDR(9),
28};
29
30static struct mv643xx_eth_platform_data rd78x00_masa_ge10_data = {
31};
32
33static struct mv643xx_eth_platform_data rd78x00_masa_ge11_data = {
34};
35
36static struct mv_sata_platform_data rd78x00_masa_sata_data = {
37 .n_ports = 2,
38};
39
40static void __init rd78x00_masa_init(void)
41{
42 /*
43 * Basic MV78x00 setup. Needs to be called early.
44 */
45 mv78xx0_init();
46
47 /*
48 * Partition on-chip peripherals between the two CPU cores.
49 */
50 if (mv78xx0_core_index() == 0) {
51 mv78xx0_ehci0_init();
52 mv78xx0_ehci1_init();
53 mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
54 mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
55 mv78xx0_sata_init(&rd78x00_masa_sata_data);
56 mv78xx0_uart0_init();
57 mv78xx0_uart2_init();
58 } else {
59 mv78xx0_ehci2_init();
60 mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
61 mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
62 mv78xx0_uart1_init();
63 mv78xx0_uart3_init();
64 }
65}
66
67static int __init rd78x00_pci_init(void)
68{
69 /*
70 * Assign all PCIe devices to CPU core #0.
71 */
72 if (machine_is_rd78x00_masa() && mv78xx0_core_index() == 0)
73 mv78xx0_pcie_init(1, 1);
74
75 return 0;
76}
77subsys_initcall(rd78x00_pci_init);
78
79MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
80 /* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
81 .phys_io = MV78XX0_REGS_PHYS_BASE,
82 .io_pg_offst = ((MV78XX0_REGS_VIRT_BASE) >> 18) & 0xfffc,
83 .boot_params = 0x00000100,
84 .init_machine = rd78x00_masa_init,
85 .map_io = mv78xx0_map_io,
86 .init_irq = mv78xx0_init_irq,
87 .timer = &mv78xx0_timer,
88MACHINE_END
diff --git a/arch/arm/mach-mx1/Kconfig b/arch/arm/mach-mx1/Kconfig
index 2b59fc74784f..eb7660f5d4b7 100644
--- a/arch/arm/mach-mx1/Kconfig
+++ b/arch/arm/mach-mx1/Kconfig
@@ -1,6 +1,6 @@
1if ARCH_MX1 1if ARCH_MX1
2 2
3comment "MX1 Platforms" 3comment "MX1 platforms:"
4 4
5config MACH_MXLADS 5config MACH_MXLADS
6 bool 6 bool
@@ -11,4 +11,9 @@ config ARCH_MX1ADS
11 help 11 help
12 Say Y here if you are using Motorola MX1ADS/MXLADS boards 12 Say Y here if you are using Motorola MX1ADS/MXLADS boards
13 13
14config MACH_SCB9328
15 bool "Synertronixx scb9328"
16 help
17 Say Y here if you are using a Synertronixx scb9328 board
18
14endif 19endif
diff --git a/arch/arm/mach-mx1/Makefile b/arch/arm/mach-mx1/Makefile
index b969719011fa..82f1309568ef 100644
--- a/arch/arm/mach-mx1/Makefile
+++ b/arch/arm/mach-mx1/Makefile
@@ -8,3 +8,4 @@ obj-y += generic.o clock.o devices.o
8 8
9# Specific board support 9# Specific board support
10obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o 10obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o
11obj-$(CONFIG_MACH_SCB9328) += scb9328.o \ No newline at end of file
diff --git a/arch/arm/mach-mx1/clock.c b/arch/arm/mach-mx1/clock.c
index 4bcd1ece55f5..0d0f306851d0 100644
--- a/arch/arm/mach-mx1/clock.c
+++ b/arch/arm/mach-mx1/clock.c
@@ -25,6 +25,7 @@
25 25
26#include <mach/clock.h> 26#include <mach/clock.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/common.h>
28#include "crm_regs.h" 29#include "crm_regs.h"
29 30
30static int _clk_enable(struct clk *clk) 31static int _clk_enable(struct clk *clk)
@@ -87,33 +88,6 @@ static int _clk_parent_set_rate(struct clk *clk, unsigned long rate)
87 return clk->parent->set_rate(clk->parent, rate); 88 return clk->parent->set_rate(clk->parent, rate);
88} 89}
89 90
90/*
91 * get the system pll clock in Hz
92 *
93 * mfi + mfn / (mfd +1)
94 * f = 2 * f_ref * --------------------
95 * pd + 1
96 */
97static unsigned long mx1_decode_pll(unsigned int pll, u32 f_ref)
98{
99 unsigned long long ll;
100 unsigned long quot;
101
102 u32 mfi = (pll >> 10) & 0xf;
103 u32 mfn = pll & 0x3ff;
104 u32 mfd = (pll >> 16) & 0x3ff;
105 u32 pd = (pll >> 26) & 0xf;
106
107 mfi = mfi <= 5 ? 5 : mfi;
108
109 ll = 2 * (unsigned long long)f_ref *
110 ((mfi << 16) + (mfn << 16) / (mfd + 1));
111 quot = (pd + 1) * (1 << 16);
112 ll += quot / 2;
113 do_div(ll, quot);
114 return (unsigned long)ll;
115}
116
117static unsigned long clk16m_get_rate(struct clk *clk) 91static unsigned long clk16m_get_rate(struct clk *clk)
118{ 92{
119 return 16000000; 93 return 16000000;
@@ -188,7 +162,7 @@ static struct clk prem_clk = {
188 162
189static unsigned long system_clk_get_rate(struct clk *clk) 163static unsigned long system_clk_get_rate(struct clk *clk)
190{ 164{
191 return mx1_decode_pll(__raw_readl(CCM_SPCTL0), 165 return mxc_decode_pll(__raw_readl(CCM_SPCTL0),
192 clk_get_rate(clk->parent)); 166 clk_get_rate(clk->parent));
193} 167}
194 168
@@ -200,7 +174,7 @@ static struct clk system_clk = {
200 174
201static unsigned long mcu_clk_get_rate(struct clk *clk) 175static unsigned long mcu_clk_get_rate(struct clk *clk)
202{ 176{
203 return mx1_decode_pll(__raw_readl(CCM_MPCTL0), 177 return mxc_decode_pll(__raw_readl(CCM_MPCTL0),
204 clk_get_rate(clk->parent)); 178 clk_get_rate(clk->parent));
205} 179}
206 180
@@ -488,7 +462,7 @@ static struct clk clko_clk = {
488}; 462};
489 463
490static struct clk dma_clk = { 464static struct clk dma_clk = {
491 .name = "dma_clk", 465 .name = "dma",
492 .parent = &hclk, 466 .parent = &hclk,
493 .round_rate = _clk_parent_round_rate, 467 .round_rate = _clk_parent_round_rate,
494 .set_rate = _clk_parent_set_rate, 468 .set_rate = _clk_parent_set_rate,
@@ -539,7 +513,7 @@ static struct clk gpt_clk = {
539}; 513};
540 514
541static struct clk uart_clk = { 515static struct clk uart_clk = {
542 .name = "uart_clk", 516 .name = "uart",
543 .parent = &perclk[0], 517 .parent = &perclk[0],
544 .round_rate = _clk_parent_round_rate, 518 .round_rate = _clk_parent_round_rate,
545 .set_rate = _clk_parent_set_rate, 519 .set_rate = _clk_parent_set_rate,
@@ -621,7 +595,7 @@ static struct clk *mxc_clks[] = {
621 &rtc_clk, 595 &rtc_clk,
622}; 596};
623 597
624int __init mxc_clocks_init(unsigned long fref) 598int __init mx1_clocks_init(unsigned long fref)
625{ 599{
626 struct clk **clkp; 600 struct clk **clkp;
627 unsigned int reg; 601 unsigned int reg;
@@ -652,5 +626,7 @@ int __init mxc_clocks_init(unsigned long fref)
652 clk_enable(&hclk); 626 clk_enable(&hclk);
653 clk_enable(&fclk); 627 clk_enable(&fclk);
654 628
629 mxc_timer_init(&gpt_clk);
630
655 return 0; 631 return 0;
656} 632}
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c
index a95644193f3f..97f42d96d7a1 100644
--- a/arch/arm/mach-mx1/devices.c
+++ b/arch/arm/mach-mx1/devices.c
@@ -23,10 +23,11 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26
27#include <mach/irqs.h> 26#include <mach/irqs.h>
28#include <mach/hardware.h> 27#include <mach/hardware.h>
29 28
29#include "devices.h"
30
30static struct resource imx_csi_resources[] = { 31static struct resource imx_csi_resources[] = {
31 [0] = { 32 [0] = {
32 .start = 0x00224000, 33 .start = 0x00224000,
diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c
index 3200cf60e384..7ae229bc1b79 100644
--- a/arch/arm/mach-mx1/mx1ads.c
+++ b/arch/arm/mach-mx1/mx1ads.c
@@ -16,6 +16,8 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/mtd/physmap.h> 18#include <linux/mtd/physmap.h>
19#include <linux/i2c.h>
20#include <linux/i2c/pcf857x.h>
19 21
20#include <asm/mach-types.h> 22#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
@@ -25,7 +27,11 @@
25#include <mach/hardware.h> 27#include <mach/hardware.h>
26#include <mach/common.h> 28#include <mach/common.h>
27#include <mach/imx-uart.h> 29#include <mach/imx-uart.h>
28#include <mach/iomux-mx1-mx2.h> 30#include <mach/irqs.h>
31#ifdef CONFIG_I2C_IMX
32#include <mach/i2c.h>
33#endif
34#include <mach/iomux.h>
29#include "devices.h" 35#include "devices.h"
30 36
31/* 37/*
@@ -105,6 +111,55 @@ static struct platform_device flash_device = {
105}; 111};
106 112
107/* 113/*
114 * I2C
115 */
116
117#ifdef CONFIG_I2C_IMX
118static int i2c_pins[] = {
119 PA15_PF_I2C_SDA,
120 PA16_PF_I2C_SCL,
121};
122
123static int i2c_init(struct device *dev)
124{
125 return mxc_gpio_setup_multiple_pins(i2c_pins,
126 ARRAY_SIZE(i2c_pins), "I2C");
127}
128
129static void i2c_exit(struct device *dev)
130{
131 mxc_gpio_release_multiple_pins(i2c_pins,
132 ARRAY_SIZE(i2c_pins));
133}
134
135static struct pcf857x_platform_data pcf857x_data[] = {
136 {
137 .gpio_base = 4 * 32,
138 }, {
139 .gpio_base = 4 * 32 + 16,
140 }
141};
142
143static struct imxi2c_platform_data mx1ads_i2c_data = {
144 .bitrate = 100000,
145 .init = i2c_init,
146 .exit = i2c_exit,
147};
148
149static struct i2c_board_info mx1ads_i2c_devices[] = {
150 {
151 I2C_BOARD_INFO("pcf857x", 0x22),
152 .type = "pcf8575",
153 .platform_data = &pcf857x_data[0],
154 }, {
155 I2C_BOARD_INFO("pcf857x", 0x24),
156 .type = "pcf8575",
157 .platform_data = &pcf857x_data[1],
158 },
159};
160#endif
161
162/*
108 * Board init 163 * Board init
109 */ 164 */
110static void __init mx1ads_init(void) 165static void __init mx1ads_init(void)
@@ -115,12 +170,19 @@ static void __init mx1ads_init(void)
115 170
116 /* Physmap flash */ 171 /* Physmap flash */
117 mxc_register_device(&flash_device, &mx1ads_flash_data); 172 mxc_register_device(&flash_device, &mx1ads_flash_data);
173
174 /* I2C */
175#ifdef CONFIG_I2C_IMX
176 i2c_register_board_info(0, mx1ads_i2c_devices,
177 ARRAY_SIZE(mx1ads_i2c_devices));
178
179 mxc_register_device(&imx_i2c_device, &mx1ads_i2c_data);
180#endif
118} 181}
119 182
120static void __init mx1ads_timer_init(void) 183static void __init mx1ads_timer_init(void)
121{ 184{
122 mxc_clocks_init(32000); 185 mx1_clocks_init(32000);
123 mxc_timer_init("gpt_clk");
124} 186}
125 187
126struct sys_timer mx1ads_timer = { 188struct sys_timer mx1ads_timer = {
diff --git a/arch/arm/mach-mx1/scb9328.c b/arch/arm/mach-mx1/scb9328.c
new file mode 100644
index 000000000000..0e71f3fa28bf
--- /dev/null
+++ b/arch/arm/mach-mx1/scb9328.c
@@ -0,0 +1,160 @@
1/*
2 * linux/arch/arm/mach-mx1/scb9328.c
3 *
4 * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de>
5 * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net>
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/platform_device.h>
14#include <linux/mtd/physmap.h>
15#include <linux/interrupt.h>
16#include <linux/dm9000.h>
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/time.h>
21
22#include <mach/common.h>
23#include <mach/hardware.h>
24#include <mach/irqs.h>
25#include <mach/imx-uart.h>
26#include <mach/iomux.h>
27
28#include "devices.h"
29
30/*
31 * This scb9328 has a 32MiB flash
32 */
33static struct resource flash_resource = {
34 .start = IMX_CS0_PHYS,
35 .end = IMX_CS0_PHYS + (32 * 1024 * 1024) - 1,
36 .flags = IORESOURCE_MEM,
37};
38
39static struct physmap_flash_data scb_flash_data = {
40 .width = 2,
41};
42
43static struct platform_device scb_flash_device = {
44 .name = "physmap-flash",
45 .id = 0,
46 .dev = {
47 .platform_data = &scb_flash_data,
48 },
49 .resource = &flash_resource,
50 .num_resources = 1,
51};
52
53/*
54 * scb9328 has a DM9000 network controller
55 * connected to CS5, with 16 bit data path
56 * and interrupt connected to GPIO 3
57 */
58
59/*
60 * internal datapath is fixed 16 bit
61 */
62static struct dm9000_plat_data dm9000_platdata = {
63 .flags = DM9000_PLATF_16BITONLY,
64};
65
66/*
67 * the DM9000 drivers wants two defined address spaces
68 * to gain access to address latch registers and the data path.
69 */
70static struct resource dm9000x_resources[] = {
71 [0] = {
72 .name = "address area",
73 .start = IMX_CS5_PHYS,
74 .end = IMX_CS5_PHYS + 1,
75 .flags = IORESOURCE_MEM /* address access */
76 },
77 [1] = {
78 .name = "data area",
79 .start = IMX_CS5_PHYS + 4,
80 .end = IMX_CS5_PHYS + 5,
81 .flags = IORESOURCE_MEM /* data access */
82 },
83 [2] = {
84 .start = IRQ_GPIOC(3),
85 .end = IRQ_GPIOC(3),
86 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL
87 },
88};
89
90static struct platform_device dm9000x_device = {
91 .name = "dm9000",
92 .id = 0,
93 .num_resources = ARRAY_SIZE(dm9000x_resources),
94 .resource = dm9000x_resources,
95 .dev = {
96 .platform_data = &dm9000_platdata,
97 }
98};
99
100static int mxc_uart1_pins[] = {
101 PC9_PF_UART1_CTS,
102 PC10_PF_UART1_RTS,
103 PC11_PF_UART1_TXD,
104 PC12_PF_UART1_RXD,
105};
106
107static int uart1_mxc_init(struct platform_device *pdev)
108{
109 return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
110 ARRAY_SIZE(mxc_uart1_pins), "UART1");
111}
112
113static int uart1_mxc_exit(struct platform_device *pdev)
114{
115 mxc_gpio_release_multiple_pins(mxc_uart1_pins,
116 ARRAY_SIZE(mxc_uart1_pins));
117 return 0;
118}
119
120static struct imxuart_platform_data uart_pdata = {
121 .init = uart1_mxc_init,
122 .exit = uart1_mxc_exit,
123 .flags = IMXUART_HAVE_RTSCTS,
124};
125
126static struct platform_device *devices[] __initdata = {
127 &scb_flash_device,
128 &dm9000x_device,
129};
130
131/*
132 * scb9328_init - Init the CPU card itself
133 */
134static void __init scb9328_init(void)
135{
136 mxc_register_device(&imx_uart1_device, &uart_pdata);
137
138 printk(KERN_INFO"Scb9328: Adding devices\n");
139 platform_add_devices(devices, ARRAY_SIZE(devices));
140}
141
142static void __init scb9328_timer_init(void)
143{
144 mx1_clocks_init(32000);
145}
146
147static struct sys_timer scb9328_timer = {
148 .init = scb9328_timer_init,
149};
150
151MACHINE_START(SCB9328, "Synertronixx scb9328")
152 /* Sascha Hauer */
153 .phys_io = 0x00200000,
154 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
155 .boot_params = 0x08000100,
156 .map_io = mxc_map_io,
157 .init_irq = mxc_init_irq,
158 .timer = &scb9328_timer,
159 .init_machine = scb9328_init,
160MACHINE_END
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index 1eaa97cb716d..42a788842f49 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -1,14 +1,22 @@
1comment "MX2 family CPU support" 1if ARCH_MX2
2 depends on ARCH_MX2 2
3choice
4 prompt "CPUs:"
5 default MACH_MX21
6
7config MACH_MX21
8 bool "i.MX21 support"
9 help
10 This enables support for Freescale's MX2 based i.MX21 processor.
3 11
4config MACH_MX27 12config MACH_MX27
5 bool "i.MX27 support" 13 bool "i.MX27 support"
6 depends on ARCH_MX2
7 help 14 help
8 This enables support for Freescale's MX2 based i.MX27 processor. 15 This enables support for Freescale's MX2 based i.MX27 processor.
9 16
10comment "MX2 Platforms" 17endchoice
11 depends on ARCH_MX2 18
19comment "MX2 platforms:"
12 20
13config MACH_MX27ADS 21config MACH_MX27ADS
14 bool "MX27ADS platform" 22 bool "MX27ADS platform"
@@ -37,3 +45,5 @@ config MACH_PCM970_BASEBOARD
37 PCM970 evaluation board. 45 PCM970 evaluation board.
38 46
39endchoice 47endchoice
48
49endif
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile
index 382d86080e86..950649a91540 100644
--- a/arch/arm/mach-mx2/Makefile
+++ b/arch/arm/mach-mx2/Makefile
@@ -4,7 +4,9 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := system.o generic.o devices.o serial.o 7obj-y := generic.o devices.o serial.o
8
9obj-$(CONFIG_MACH_MX21) += clock_imx21.o
8 10
9obj-$(CONFIG_MACH_MX27) += cpu_imx27.o 11obj-$(CONFIG_MACH_MX27) += cpu_imx27.o
10obj-$(CONFIG_MACH_MX27) += clock_imx27.o 12obj-$(CONFIG_MACH_MX27) += clock_imx27.o
diff --git a/arch/arm/mach-mx2/Makefile.boot b/arch/arm/mach-mx2/Makefile.boot
index 696831dcd485..e867398a8fdb 100644
--- a/arch/arm/mach-mx2/Makefile.boot
+++ b/arch/arm/mach-mx2/Makefile.boot
@@ -1,3 +1,7 @@
1 zreladdr-y := 0xA0008000 1zreladdr-$(CONFIG_MACH_MX21) := 0xC0008000
2params_phys-y := 0xA0000100 2params_phys-$(CONFIG_MACH_MX21) := 0xC0000100
3initrd_phys-y := 0xA0800000 3initrd_phys-$(CONFIG_MACH_MX21) := 0xC0800000
4
5zreladdr-$(CONFIG_MACH_MX27) := 0xA0008000
6params_phys-$(CONFIG_MACH_MX27) := 0xA0000100
7initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
new file mode 100644
index 000000000000..2dee5c87614c
--- /dev/null
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -0,0 +1,984 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 * Copyright 2008 Martin Fuzzey, mfuzzey@gmail.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
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#include <linux/clk.h>
22#include <linux/io.h>
23#include <linux/module.h>
24
25#include <mach/clock.h>
26#include <mach/common.h>
27#include <asm/clkdev.h>
28#include <asm/div64.h>
29
30#include "crm_regs.h"
31
32static int _clk_enable(struct clk *clk)
33{
34 u32 reg;
35
36 reg = __raw_readl(clk->enable_reg);
37 reg |= 1 << clk->enable_shift;
38 __raw_writel(reg, clk->enable_reg);
39 return 0;
40}
41
42static void _clk_disable(struct clk *clk)
43{
44 u32 reg;
45
46 reg = __raw_readl(clk->enable_reg);
47 reg &= ~(1 << clk->enable_shift);
48 __raw_writel(reg, clk->enable_reg);
49}
50
51static int _clk_spll_enable(struct clk *clk)
52{
53 u32 reg;
54
55 reg = __raw_readl(CCM_CSCR);
56 reg |= CCM_CSCR_SPEN;
57 __raw_writel(reg, CCM_CSCR);
58
59 while ((__raw_readl(CCM_SPCTL1) & CCM_SPCTL1_LF) == 0)
60 ;
61 return 0;
62}
63
64static void _clk_spll_disable(struct clk *clk)
65{
66 u32 reg;
67
68 reg = __raw_readl(CCM_CSCR);
69 reg &= ~CCM_CSCR_SPEN;
70 __raw_writel(reg, CCM_CSCR);
71}
72
73
74#define CSCR() (__raw_readl(CCM_CSCR))
75#define PCDR0() (__raw_readl(CCM_PCDR0))
76#define PCDR1() (__raw_readl(CCM_PCDR1))
77
78static unsigned long _clk_perclkx_round_rate(struct clk *clk,
79 unsigned long rate)
80{
81 u32 div;
82 unsigned long parent_rate;
83
84 parent_rate = clk_get_rate(clk->parent);
85
86 div = parent_rate / rate;
87 if (parent_rate % rate)
88 div++;
89
90 if (div > 64)
91 div = 64;
92
93 return parent_rate / div;
94}
95
96static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate)
97{
98 u32 reg;
99 u32 div;
100 unsigned long parent_rate;
101
102 parent_rate = clk_get_rate(clk->parent);
103
104 if (clk->id < 0 || clk->id > 3)
105 return -EINVAL;
106
107 div = parent_rate / rate;
108 if (div > 64 || div < 1 || ((parent_rate / div) != rate))
109 return -EINVAL;
110 div--;
111
112 reg =
113 __raw_readl(CCM_PCDR1) & ~(CCM_PCDR1_PERDIV1_MASK <<
114 (clk->id << 3));
115 reg |= div << (clk->id << 3);
116 __raw_writel(reg, CCM_PCDR1);
117
118 return 0;
119}
120
121static unsigned long _clk_usb_recalc(struct clk *clk)
122{
123 unsigned long usb_pdf;
124 unsigned long parent_rate;
125
126 parent_rate = clk_get_rate(clk->parent);
127
128 usb_pdf = (CSCR() & CCM_CSCR_USB_MASK) >> CCM_CSCR_USB_OFFSET;
129
130 return parent_rate / (usb_pdf + 1U);
131}
132
133static unsigned long _clk_ssix_recalc(struct clk *clk, unsigned long pdf)
134{
135 unsigned long parent_rate;
136
137 parent_rate = clk_get_rate(clk->parent);
138
139 pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */
140
141 return 2UL * parent_rate / pdf;
142}
143
144static unsigned long _clk_ssi1_recalc(struct clk *clk)
145{
146 return _clk_ssix_recalc(clk,
147 (PCDR0() & CCM_PCDR0_SSI1BAUDDIV_MASK)
148 >> CCM_PCDR0_SSI1BAUDDIV_OFFSET);
149}
150
151static unsigned long _clk_ssi2_recalc(struct clk *clk)
152{
153 return _clk_ssix_recalc(clk,
154 (PCDR0() & CCM_PCDR0_SSI2BAUDDIV_MASK) >>
155 CCM_PCDR0_SSI2BAUDDIV_OFFSET);
156}
157
158static unsigned long _clk_nfc_recalc(struct clk *clk)
159{
160 unsigned long nfc_pdf;
161 unsigned long parent_rate;
162
163 parent_rate = clk_get_rate(clk->parent);
164
165 nfc_pdf = (PCDR0() & CCM_PCDR0_NFCDIV_MASK)
166 >> CCM_PCDR0_NFCDIV_OFFSET;
167
168 return parent_rate / (nfc_pdf + 1);
169}
170
171static unsigned long _clk_parent_round_rate(struct clk *clk, unsigned long rate)
172{
173 return clk->parent->round_rate(clk->parent, rate);
174}
175
176static int _clk_parent_set_rate(struct clk *clk, unsigned long rate)
177{
178 return clk->parent->set_rate(clk->parent, rate);
179}
180
181static unsigned long external_high_reference; /* in Hz */
182
183static unsigned long get_high_reference_clock_rate(struct clk *clk)
184{
185 return external_high_reference;
186}
187
188/*
189 * the high frequency external clock reference
190 * Default case is 26MHz.
191 */
192static struct clk ckih_clk = {
193 .get_rate = get_high_reference_clock_rate,
194};
195
196static unsigned long external_low_reference; /* in Hz */
197
198static unsigned long get_low_reference_clock_rate(struct clk *clk)
199{
200 return external_low_reference;
201}
202
203/*
204 * the low frequency external clock reference
205 * Default case is 32.768kHz.
206 */
207static struct clk ckil_clk = {
208 .get_rate = get_low_reference_clock_rate,
209};
210
211
212static unsigned long _clk_fpm_recalc(struct clk *clk)
213{
214 return clk_get_rate(clk->parent) * 512;
215}
216
217/* Output of frequency pre multiplier */
218static struct clk fpm_clk = {
219 .parent = &ckil_clk,
220 .get_rate = _clk_fpm_recalc,
221};
222
223static unsigned long get_mpll_clk(struct clk *clk)
224{
225 uint32_t reg;
226 unsigned long ref_clk;
227 unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0;
228 unsigned long long temp;
229
230 ref_clk = clk_get_rate(clk->parent);
231
232 reg = __raw_readl(CCM_MPCTL0);
233 pdf = (reg & CCM_MPCTL0_PD_MASK) >> CCM_MPCTL0_PD_OFFSET;
234 mfd = (reg & CCM_MPCTL0_MFD_MASK) >> CCM_MPCTL0_MFD_OFFSET;
235 mfi = (reg & CCM_MPCTL0_MFI_MASK) >> CCM_MPCTL0_MFI_OFFSET;
236 mfn = (reg & CCM_MPCTL0_MFN_MASK) >> CCM_MPCTL0_MFN_OFFSET;
237
238 mfi = (mfi <= 5) ? 5 : mfi;
239 temp = 2LL * ref_clk * mfn;
240 do_div(temp, mfd + 1);
241 temp = 2LL * ref_clk * mfi + temp;
242 do_div(temp, pdf + 1);
243
244 return (unsigned long)temp;
245}
246
247static struct clk mpll_clk = {
248 .parent = &ckih_clk,
249 .get_rate = get_mpll_clk,
250};
251
252static unsigned long _clk_fclk_get_rate(struct clk *clk)
253{
254 unsigned long parent_rate;
255 u32 div;
256
257 div = (CSCR() & CCM_CSCR_PRESC_MASK) >> CCM_CSCR_PRESC_OFFSET;
258 parent_rate = clk_get_rate(clk->parent);
259
260 return parent_rate / (div+1);
261}
262
263static struct clk fclk_clk = {
264 .parent = &mpll_clk,
265 .get_rate = _clk_fclk_get_rate
266};
267
268static unsigned long get_spll_clk(struct clk *clk)
269{
270 uint32_t reg;
271 unsigned long ref_clk;
272 unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0;
273 unsigned long long temp;
274
275 ref_clk = clk_get_rate(clk->parent);
276
277 reg = __raw_readl(CCM_SPCTL0);
278 pdf = (reg & CCM_SPCTL0_PD_MASK) >> CCM_SPCTL0_PD_OFFSET;
279 mfd = (reg & CCM_SPCTL0_MFD_MASK) >> CCM_SPCTL0_MFD_OFFSET;
280 mfi = (reg & CCM_SPCTL0_MFI_MASK) >> CCM_SPCTL0_MFI_OFFSET;
281 mfn = (reg & CCM_SPCTL0_MFN_MASK) >> CCM_SPCTL0_MFN_OFFSET;
282
283 mfi = (mfi <= 5) ? 5 : mfi;
284 temp = 2LL * ref_clk * mfn;
285 do_div(temp, mfd + 1);
286 temp = 2LL * ref_clk * mfi + temp;
287 do_div(temp, pdf + 1);
288
289 return (unsigned long)temp;
290}
291
292static struct clk spll_clk = {
293 .parent = &ckih_clk,
294 .get_rate = get_spll_clk,
295 .enable = _clk_spll_enable,
296 .disable = _clk_spll_disable,
297};
298
299static unsigned long get_hclk_clk(struct clk *clk)
300{
301 unsigned long rate;
302 unsigned long bclk_pdf;
303
304 bclk_pdf = (CSCR() & CCM_CSCR_BCLK_MASK)
305 >> CCM_CSCR_BCLK_OFFSET;
306
307 rate = clk_get_rate(clk->parent);
308 return rate / (bclk_pdf + 1);
309}
310
311static struct clk hclk_clk = {
312 .parent = &fclk_clk,
313 .get_rate = get_hclk_clk,
314};
315
316static unsigned long get_ipg_clk(struct clk *clk)
317{
318 unsigned long rate;
319 unsigned long ipg_pdf;
320
321 ipg_pdf = (CSCR() & CCM_CSCR_IPDIV) >> CCM_CSCR_IPDIV_OFFSET;
322
323 rate = clk_get_rate(clk->parent);
324 return rate / (ipg_pdf + 1);
325}
326
327static struct clk ipg_clk = {
328 .parent = &hclk_clk,
329 .get_rate = get_ipg_clk,
330};
331
332static unsigned long _clk_perclkx_recalc(struct clk *clk)
333{
334 unsigned long perclk_pdf;
335 unsigned long parent_rate;
336
337 parent_rate = clk_get_rate(clk->parent);
338
339 if (clk->id < 0 || clk->id > 3)
340 return 0;
341
342 perclk_pdf = (PCDR1() >> (clk->id << 3)) & CCM_PCDR1_PERDIV1_MASK;
343
344 return parent_rate / (perclk_pdf + 1);
345}
346
347static struct clk per_clk[] = {
348 {
349 .id = 0,
350 .parent = &mpll_clk,
351 .get_rate = _clk_perclkx_recalc,
352 }, {
353 .id = 1,
354 .parent = &mpll_clk,
355 .get_rate = _clk_perclkx_recalc,
356 }, {
357 .id = 2,
358 .parent = &mpll_clk,
359 .round_rate = _clk_perclkx_round_rate,
360 .set_rate = _clk_perclkx_set_rate,
361 .get_rate = _clk_perclkx_recalc,
362 /* Enable/Disable done via lcd_clkc[1] */
363 }, {
364 .id = 3,
365 .parent = &mpll_clk,
366 .round_rate = _clk_perclkx_round_rate,
367 .set_rate = _clk_perclkx_set_rate,
368 .get_rate = _clk_perclkx_recalc,
369 /* Enable/Disable done via csi_clk[1] */
370 },
371};
372
373static struct clk uart_ipg_clk[];
374
375static struct clk uart_clk[] = {
376 {
377 .id = 0,
378 .parent = &per_clk[0],
379 .secondary = &uart_ipg_clk[0],
380 }, {
381 .id = 1,
382 .parent = &per_clk[0],
383 .secondary = &uart_ipg_clk[1],
384 }, {
385 .id = 2,
386 .parent = &per_clk[0],
387 .secondary = &uart_ipg_clk[2],
388 }, {
389 .id = 3,
390 .parent = &per_clk[0],
391 .secondary = &uart_ipg_clk[3],
392 },
393};
394
395static struct clk uart_ipg_clk[] = {
396 {
397 .id = 0,
398 .parent = &ipg_clk,
399 .enable = _clk_enable,
400 .enable_reg = CCM_PCCR_UART1_REG,
401 .enable_shift = CCM_PCCR_UART1_OFFSET,
402 .disable = _clk_disable,
403 }, {
404 .id = 1,
405 .parent = &ipg_clk,
406 .enable = _clk_enable,
407 .enable_reg = CCM_PCCR_UART2_REG,
408 .enable_shift = CCM_PCCR_UART2_OFFSET,
409 .disable = _clk_disable,
410 }, {
411 .id = 2,
412 .parent = &ipg_clk,
413 .enable = _clk_enable,
414 .enable_reg = CCM_PCCR_UART3_REG,
415 .enable_shift = CCM_PCCR_UART3_OFFSET,
416 .disable = _clk_disable,
417 }, {
418 .id = 3,
419 .parent = &ipg_clk,
420 .enable = _clk_enable,
421 .enable_reg = CCM_PCCR_UART4_REG,
422 .enable_shift = CCM_PCCR_UART4_OFFSET,
423 .disable = _clk_disable,
424 },
425};
426
427static struct clk gpt_ipg_clk[];
428
429static struct clk gpt_clk[] = {
430 {
431 .id = 0,
432 .parent = &per_clk[0],
433 .secondary = &gpt_ipg_clk[0],
434 }, {
435 .id = 1,
436 .parent = &per_clk[0],
437 .secondary = &gpt_ipg_clk[1],
438 }, {
439 .id = 2,
440 .parent = &per_clk[0],
441 .secondary = &gpt_ipg_clk[2],
442 },
443};
444
445static struct clk gpt_ipg_clk[] = {
446 {
447 .id = 0,
448 .parent = &ipg_clk,
449 .enable = _clk_enable,
450 .enable_reg = CCM_PCCR_GPT1_REG,
451 .enable_shift = CCM_PCCR_GPT1_OFFSET,
452 .disable = _clk_disable,
453 }, {
454 .id = 1,
455 .parent = &ipg_clk,
456 .enable = _clk_enable,
457 .enable_reg = CCM_PCCR_GPT2_REG,
458 .enable_shift = CCM_PCCR_GPT2_OFFSET,
459 .disable = _clk_disable,
460 }, {
461 .id = 2,
462 .parent = &ipg_clk,
463 .enable = _clk_enable,
464 .enable_reg = CCM_PCCR_GPT3_REG,
465 .enable_shift = CCM_PCCR_GPT3_OFFSET,
466 .disable = _clk_disable,
467 },
468};
469
470static struct clk pwm_clk[] = {
471 {
472 .parent = &per_clk[0],
473 .secondary = &pwm_clk[1],
474 }, {
475 .parent = &ipg_clk,
476 .enable = _clk_enable,
477 .enable_reg = CCM_PCCR_PWM_REG,
478 .enable_shift = CCM_PCCR_PWM_OFFSET,
479 .disable = _clk_disable,
480 },
481};
482
483static struct clk sdhc_ipg_clk[];
484
485static struct clk sdhc_clk[] = {
486 {
487 .id = 0,
488 .parent = &per_clk[1],
489 .secondary = &sdhc_ipg_clk[0],
490 }, {
491 .id = 1,
492 .parent = &per_clk[1],
493 .secondary = &sdhc_ipg_clk[1],
494 },
495};
496
497static struct clk sdhc_ipg_clk[] = {
498 {
499 .id = 0,
500 .parent = &ipg_clk,
501 .enable = _clk_enable,
502 .enable_reg = CCM_PCCR_SDHC1_REG,
503 .enable_shift = CCM_PCCR_SDHC1_OFFSET,
504 .disable = _clk_disable,
505 }, {
506 .id = 1,
507 .parent = &ipg_clk,
508 .enable = _clk_enable,
509 .enable_reg = CCM_PCCR_SDHC2_REG,
510 .enable_shift = CCM_PCCR_SDHC2_OFFSET,
511 .disable = _clk_disable,
512 },
513};
514
515static struct clk cspi_ipg_clk[];
516
517static struct clk cspi_clk[] = {
518 {
519 .id = 0,
520 .parent = &per_clk[1],
521 .secondary = &cspi_ipg_clk[0],
522 }, {
523 .id = 1,
524 .parent = &per_clk[1],
525 .secondary = &cspi_ipg_clk[1],
526 }, {
527 .id = 2,
528 .parent = &per_clk[1],
529 .secondary = &cspi_ipg_clk[2],
530 },
531};
532
533static struct clk cspi_ipg_clk[] = {
534 {
535 .id = 0,
536 .parent = &ipg_clk,
537 .enable = _clk_enable,
538 .enable_reg = CCM_PCCR_CSPI1_REG,
539 .enable_shift = CCM_PCCR_CSPI1_OFFSET,
540 .disable = _clk_disable,
541 }, {
542 .id = 1,
543 .parent = &ipg_clk,
544 .enable = _clk_enable,
545 .enable_reg = CCM_PCCR_CSPI2_REG,
546 .enable_shift = CCM_PCCR_CSPI2_OFFSET,
547 .disable = _clk_disable,
548 }, {
549 .id = 3,
550 .parent = &ipg_clk,
551 .enable = _clk_enable,
552 .enable_reg = CCM_PCCR_CSPI3_REG,
553 .enable_shift = CCM_PCCR_CSPI3_OFFSET,
554 .disable = _clk_disable,
555 },
556};
557
558static struct clk lcdc_clk[] = {
559 {
560 .parent = &per_clk[2],
561 .secondary = &lcdc_clk[1],
562 .round_rate = _clk_parent_round_rate,
563 .set_rate = _clk_parent_set_rate,
564 }, {
565 .parent = &ipg_clk,
566 .secondary = &lcdc_clk[2],
567 .enable = _clk_enable,
568 .enable_reg = CCM_PCCR_LCDC_REG,
569 .enable_shift = CCM_PCCR_LCDC_OFFSET,
570 .disable = _clk_disable,
571 }, {
572 .parent = &hclk_clk,
573 .enable = _clk_enable,
574 .enable_reg = CCM_PCCR_HCLK_LCDC_REG,
575 .enable_shift = CCM_PCCR_HCLK_LCDC_OFFSET,
576 .disable = _clk_disable,
577 },
578};
579
580static struct clk csi_clk[] = {
581 {
582 .parent = &per_clk[3],
583 .secondary = &csi_clk[1],
584 .round_rate = _clk_parent_round_rate,
585 .set_rate = _clk_parent_set_rate,
586 }, {
587 .parent = &hclk_clk,
588 .enable = _clk_enable,
589 .enable_reg = CCM_PCCR_HCLK_CSI_REG,
590 .enable_shift = CCM_PCCR_HCLK_CSI_OFFSET,
591 .disable = _clk_disable,
592 },
593};
594
595static struct clk usb_clk[] = {
596 {
597 .parent = &spll_clk,
598 .get_rate = _clk_usb_recalc,
599 .enable = _clk_enable,
600 .enable_reg = CCM_PCCR_USBOTG_REG,
601 .enable_shift = CCM_PCCR_USBOTG_OFFSET,
602 .disable = _clk_disable,
603 }, {
604 .parent = &hclk_clk,
605 .enable = _clk_enable,
606 .enable_reg = CCM_PCCR_HCLK_USBOTG_REG,
607 .enable_shift = CCM_PCCR_HCLK_USBOTG_OFFSET,
608 .disable = _clk_disable,
609 }
610};
611
612static struct clk ssi_ipg_clk[];
613
614static struct clk ssi_clk[] = {
615 {
616 .id = 0,
617 .parent = &mpll_clk,
618 .secondary = &ssi_ipg_clk[0],
619 .get_rate = _clk_ssi1_recalc,
620 .enable = _clk_enable,
621 .enable_reg = CCM_PCCR_SSI1_BAUD_REG,
622 .enable_shift = CCM_PCCR_SSI1_BAUD_OFFSET,
623 .disable = _clk_disable,
624 }, {
625 .id = 1,
626 .parent = &mpll_clk,
627 .secondary = &ssi_ipg_clk[1],
628 .get_rate = _clk_ssi2_recalc,
629 .enable = _clk_enable,
630 .enable_reg = CCM_PCCR_SSI2_BAUD_REG,
631 .enable_shift = CCM_PCCR_SSI2_BAUD_OFFSET,
632 .disable = _clk_disable,
633 },
634};
635
636static struct clk ssi_ipg_clk[] = {
637 {
638 .id = 0,
639 .parent = &ipg_clk,
640 .enable = _clk_enable,
641 .enable_reg = CCM_PCCR_SSI1_REG,
642 .enable_shift = CCM_PCCR_SSI1_IPG_OFFSET,
643 .disable = _clk_disable,
644 }, {
645 .id = 1,
646 .parent = &ipg_clk,
647 .enable = _clk_enable,
648 .enable_reg = CCM_PCCR_SSI2_REG,
649 .enable_shift = CCM_PCCR_SSI2_IPG_OFFSET,
650 .disable = _clk_disable,
651 },
652};
653
654
655static struct clk nfc_clk = {
656 .parent = &fclk_clk,
657 .get_rate = _clk_nfc_recalc,
658 .enable = _clk_enable,
659 .enable_reg = CCM_PCCR_NFC_REG,
660 .enable_shift = CCM_PCCR_NFC_OFFSET,
661 .disable = _clk_disable,
662};
663
664static struct clk dma_clk[] = {
665 {
666 .parent = &hclk_clk,
667 .enable = _clk_enable,
668 .enable_reg = CCM_PCCR_DMA_REG,
669 .enable_shift = CCM_PCCR_DMA_OFFSET,
670 .disable = _clk_disable,
671 .secondary = &dma_clk[1],
672 }, {
673 .enable = _clk_enable,
674 .enable_reg = CCM_PCCR_HCLK_DMA_REG,
675 .enable_shift = CCM_PCCR_HCLK_DMA_OFFSET,
676 .disable = _clk_disable,
677 },
678};
679
680static struct clk brom_clk = {
681 .parent = &hclk_clk,
682 .enable = _clk_enable,
683 .enable_reg = CCM_PCCR_HCLK_BROM_REG,
684 .enable_shift = CCM_PCCR_HCLK_BROM_OFFSET,
685 .disable = _clk_disable,
686};
687
688static struct clk emma_clk[] = {
689 {
690 .parent = &hclk_clk,
691 .enable = _clk_enable,
692 .enable_reg = CCM_PCCR_EMMA_REG,
693 .enable_shift = CCM_PCCR_EMMA_OFFSET,
694 .disable = _clk_disable,
695 .secondary = &emma_clk[1],
696 }, {
697 .enable = _clk_enable,
698 .enable_reg = CCM_PCCR_HCLK_EMMA_REG,
699 .enable_shift = CCM_PCCR_HCLK_EMMA_OFFSET,
700 .disable = _clk_disable,
701 }
702};
703
704static struct clk slcdc_clk[] = {
705 {
706 .parent = &hclk_clk,
707 .enable = _clk_enable,
708 .enable_reg = CCM_PCCR_SLCDC_REG,
709 .enable_shift = CCM_PCCR_SLCDC_OFFSET,
710 .disable = _clk_disable,
711 .secondary = &slcdc_clk[1],
712 }, {
713 .enable = _clk_enable,
714 .enable_reg = CCM_PCCR_HCLK_SLCDC_REG,
715 .enable_shift = CCM_PCCR_HCLK_SLCDC_OFFSET,
716 .disable = _clk_disable,
717 }
718};
719
720static struct clk wdog_clk = {
721 .parent = &ipg_clk,
722 .enable = _clk_enable,
723 .enable_reg = CCM_PCCR_WDT_REG,
724 .enable_shift = CCM_PCCR_WDT_OFFSET,
725 .disable = _clk_disable,
726};
727
728static struct clk gpio_clk = {
729 .parent = &ipg_clk,
730 .enable = _clk_enable,
731 .enable_reg = CCM_PCCR_GPIO_REG,
732 .enable_shift = CCM_PCCR_GPIO_OFFSET,
733 .disable = _clk_disable,
734};
735
736static struct clk i2c_clk = {
737 .id = 0,
738 .parent = &ipg_clk,
739 .enable = _clk_enable,
740 .enable_reg = CCM_PCCR_I2C1_REG,
741 .enable_shift = CCM_PCCR_I2C1_OFFSET,
742 .disable = _clk_disable,
743};
744
745static struct clk kpp_clk = {
746 .parent = &ipg_clk,
747 .enable = _clk_enable,
748 .enable_reg = CCM_PCCR_KPP_REG,
749 .enable_shift = CCM_PCCR_KPP_OFFSET,
750 .disable = _clk_disable,
751};
752
753static struct clk owire_clk = {
754 .parent = &ipg_clk,
755 .enable = _clk_enable,
756 .enable_reg = CCM_PCCR_OWIRE_REG,
757 .enable_shift = CCM_PCCR_OWIRE_OFFSET,
758 .disable = _clk_disable,
759};
760
761static struct clk rtc_clk = {
762 .parent = &ipg_clk,
763 .enable = _clk_enable,
764 .enable_reg = CCM_PCCR_RTC_REG,
765 .enable_shift = CCM_PCCR_RTC_OFFSET,
766 .disable = _clk_disable,
767};
768
769static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate)
770{
771 u32 div;
772 unsigned long parent_rate;
773
774 parent_rate = clk_get_rate(clk->parent);
775 div = parent_rate / rate;
776 if (parent_rate % rate)
777 div++;
778
779 if (div > 8)
780 div = 8;
781
782 return parent_rate / div;
783}
784
785static int _clk_clko_set_rate(struct clk *clk, unsigned long rate)
786{
787 u32 reg;
788 u32 div;
789 unsigned long parent_rate;
790
791 parent_rate = clk_get_rate(clk->parent);
792
793 div = parent_rate / rate;
794
795 if (div > 8 || div < 1 || ((parent_rate / div) != rate))
796 return -EINVAL;
797 div--;
798
799 reg = __raw_readl(CCM_PCDR0);
800
801 if (clk->parent == &usb_clk[0]) {
802 reg &= ~CCM_PCDR0_48MDIV_MASK;
803 reg |= div << CCM_PCDR0_48MDIV_OFFSET;
804 }
805 __raw_writel(reg, CCM_PCDR0);
806
807 return 0;
808}
809
810static unsigned long _clk_clko_recalc(struct clk *clk)
811{
812 u32 div = 0;
813 unsigned long parent_rate;
814
815 parent_rate = clk_get_rate(clk->parent);
816
817 if (clk->parent == &usb_clk[0]) /* 48M */
818 div = __raw_readl(CCM_PCDR0) & CCM_PCDR0_48MDIV_MASK
819 >> CCM_PCDR0_48MDIV_OFFSET;
820 div++;
821
822 return parent_rate / div;
823}
824
825static struct clk clko_clk;
826
827static int _clk_clko_set_parent(struct clk *clk, struct clk *parent)
828{
829 u32 reg;
830
831 reg = __raw_readl(CCM_CCSR) & ~CCM_CCSR_CLKOSEL_MASK;
832
833 if (parent == &ckil_clk)
834 reg |= 0 << CCM_CCSR_CLKOSEL_OFFSET;
835 else if (parent == &fpm_clk)
836 reg |= 1 << CCM_CCSR_CLKOSEL_OFFSET;
837 else if (parent == &ckih_clk)
838 reg |= 2 << CCM_CCSR_CLKOSEL_OFFSET;
839 else if (parent == mpll_clk.parent)
840 reg |= 3 << CCM_CCSR_CLKOSEL_OFFSET;
841 else if (parent == spll_clk.parent)
842 reg |= 4 << CCM_CCSR_CLKOSEL_OFFSET;
843 else if (parent == &mpll_clk)
844 reg |= 5 << CCM_CCSR_CLKOSEL_OFFSET;
845 else if (parent == &spll_clk)
846 reg |= 6 << CCM_CCSR_CLKOSEL_OFFSET;
847 else if (parent == &fclk_clk)
848 reg |= 7 << CCM_CCSR_CLKOSEL_OFFSET;
849 else if (parent == &hclk_clk)
850 reg |= 8 << CCM_CCSR_CLKOSEL_OFFSET;
851 else if (parent == &ipg_clk)
852 reg |= 9 << CCM_CCSR_CLKOSEL_OFFSET;
853 else if (parent == &per_clk[0])
854 reg |= 0xA << CCM_CCSR_CLKOSEL_OFFSET;
855 else if (parent == &per_clk[1])
856 reg |= 0xB << CCM_CCSR_CLKOSEL_OFFSET;
857 else if (parent == &per_clk[2])
858 reg |= 0xC << CCM_CCSR_CLKOSEL_OFFSET;
859 else if (parent == &per_clk[3])
860 reg |= 0xD << CCM_CCSR_CLKOSEL_OFFSET;
861 else if (parent == &ssi_clk[0])
862 reg |= 0xE << CCM_CCSR_CLKOSEL_OFFSET;
863 else if (parent == &ssi_clk[1])
864 reg |= 0xF << CCM_CCSR_CLKOSEL_OFFSET;
865 else if (parent == &nfc_clk)
866 reg |= 0x10 << CCM_CCSR_CLKOSEL_OFFSET;
867 else if (parent == &usb_clk[0])
868 reg |= 0x14 << CCM_CCSR_CLKOSEL_OFFSET;
869 else if (parent == &clko_clk)
870 reg |= 0x15 << CCM_CCSR_CLKOSEL_OFFSET;
871 else
872 return -EINVAL;
873
874 __raw_writel(reg, CCM_CCSR);
875
876 return 0;
877}
878
879static struct clk clko_clk = {
880 .get_rate = _clk_clko_recalc,
881 .set_rate = _clk_clko_set_rate,
882 .round_rate = _clk_clko_round_rate,
883 .set_parent = _clk_clko_set_parent,
884};
885
886
887#define _REGISTER_CLOCK(d, n, c) \
888 { \
889 .dev_id = d, \
890 .con_id = n, \
891 .clk = &c, \
892 },
893static struct clk_lookup lookups[] __initdata = {
894/* It's unlikely that any driver wants one of them directly:
895 _REGISTER_CLOCK(NULL, "ckih", ckih_clk)
896 _REGISTER_CLOCK(NULL, "ckil", ckil_clk)
897 _REGISTER_CLOCK(NULL, "fpm", fpm_clk)
898 _REGISTER_CLOCK(NULL, "mpll", mpll_clk)
899 _REGISTER_CLOCK(NULL, "spll", spll_clk)
900 _REGISTER_CLOCK(NULL, "fclk", fclk_clk)
901 _REGISTER_CLOCK(NULL, "hclk", hclk_clk)
902 _REGISTER_CLOCK(NULL, "ipg", ipg_clk)
903*/
904 _REGISTER_CLOCK(NULL, "perclk1", per_clk[0])
905 _REGISTER_CLOCK(NULL, "perclk2", per_clk[1])
906 _REGISTER_CLOCK(NULL, "perclk3", per_clk[2])
907 _REGISTER_CLOCK(NULL, "perclk4", per_clk[3])
908 _REGISTER_CLOCK(NULL, "clko", clko_clk)
909 _REGISTER_CLOCK("imx-uart.0", NULL, uart_clk[0])
910 _REGISTER_CLOCK("imx-uart.1", NULL, uart_clk[1])
911 _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk[2])
912 _REGISTER_CLOCK("imx-uart.3", NULL, uart_clk[3])
913 _REGISTER_CLOCK(NULL, "gpt1", gpt_clk[0])
914 _REGISTER_CLOCK(NULL, "gpt1", gpt_clk[1])
915 _REGISTER_CLOCK(NULL, "gpt1", gpt_clk[2])
916 _REGISTER_CLOCK(NULL, "pwm", pwm_clk[0])
917 _REGISTER_CLOCK(NULL, "sdhc1", sdhc_clk[0])
918 _REGISTER_CLOCK(NULL, "sdhc2", sdhc_clk[1])
919 _REGISTER_CLOCK(NULL, "cspi1", cspi_clk[0])
920 _REGISTER_CLOCK(NULL, "cspi2", cspi_clk[1])
921 _REGISTER_CLOCK(NULL, "cspi3", cspi_clk[2])
922 _REGISTER_CLOCK(NULL, "lcdc", lcdc_clk[0])
923 _REGISTER_CLOCK(NULL, "csi", csi_clk[0])
924 _REGISTER_CLOCK(NULL, "usb", usb_clk[0])
925 _REGISTER_CLOCK(NULL, "ssi1", ssi_clk[0])
926 _REGISTER_CLOCK(NULL, "ssi2", ssi_clk[1])
927 _REGISTER_CLOCK(NULL, "nfc", nfc_clk)
928 _REGISTER_CLOCK(NULL, "dma", dma_clk[0])
929 _REGISTER_CLOCK(NULL, "brom", brom_clk)
930 _REGISTER_CLOCK(NULL, "emma", emma_clk[0])
931 _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0])
932 _REGISTER_CLOCK(NULL, "wdog", wdog_clk)
933 _REGISTER_CLOCK(NULL, "gpio", gpio_clk)
934 _REGISTER_CLOCK(NULL, "i2c", i2c_clk)
935 _REGISTER_CLOCK("mxc-keypad", NULL, kpp_clk)
936 _REGISTER_CLOCK(NULL, "owire", owire_clk)
937 _REGISTER_CLOCK(NULL, "rtc", rtc_clk)
938};
939
940/*
941 * must be called very early to get information about the
942 * available clock rate when the timer framework starts
943 */
944int __init mx21_clocks_init(unsigned long lref, unsigned long href)
945{
946 int i;
947 u32 cscr;
948
949 external_low_reference = lref;
950 external_high_reference = href;
951
952 /* detect clock reference for both system PLL */
953 cscr = CSCR();
954 if (cscr & CCM_CSCR_MCU)
955 mpll_clk.parent = &ckih_clk;
956 else
957 mpll_clk.parent = &fpm_clk;
958
959 if (cscr & CCM_CSCR_SP)
960 spll_clk.parent = &ckih_clk;
961 else
962 spll_clk.parent = &fpm_clk;
963
964 for (i = 0; i < ARRAY_SIZE(lookups); i++)
965 clkdev_add(&lookups[i]);
966
967 /* Turn off all clock gates */
968 __raw_writel(0, CCM_PCCR0);
969 __raw_writel(CCM_PCCR_GPT1_MASK, CCM_PCCR1);
970
971 /* This turns of the serial PLL as well */
972 spll_clk.disable(&spll_clk);
973
974 /* This will propagate to all children and init all the clock rates. */
975 clk_enable(&per_clk[0]);
976 clk_enable(&gpio_clk);
977
978#ifdef CONFIG_DEBUG_LL_CONSOLE
979 clk_enable(&uart_clk[0]);
980#endif
981
982 mxc_timer_init(&gpt_clk[0]);
983 return 0;
984}
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index c69896d011a1..3f7280c490f0 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de 3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 * Copyright 2008 Martin Fuzzey, mfuzzey@gmail.com
4 * 5 *
5 * This program is free software; you can redistribute it and/or 6 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License 7 * modify it under the terms of the GNU General Public License
@@ -20,23 +21,60 @@
20#include <linux/clk.h> 21#include <linux/clk.h>
21#include <linux/io.h> 22#include <linux/io.h>
22#include <linux/module.h> 23#include <linux/module.h>
23#include <linux/spinlock.h>
24 24
25#include <mach/clock.h> 25#include <asm/clkdev.h>
26#include <mach/common.h>
27#include <asm/div64.h> 26#include <asm/div64.h>
28 27
29#include "crm_regs.h" 28#include <mach/clock.h>
30 29#include <mach/common.h>
31static struct clk ckil_clk; 30#include <mach/hardware.h>
32static struct clk mpll_clk; 31
33static struct clk mpll_main_clk[]; 32/* Register offsets */
34static struct clk spll_clk; 33#define CCM_CSCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x0)
35 34#define CCM_MPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4)
36static int _clk_enable(struct clk *clk) 35#define CCM_MPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x8)
36#define CCM_SPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0xC)
37#define CCM_SPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10)
38#define CCM_OSC26MCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x14)
39#define CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18)
40#define CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1c)
41#define CCM_PCCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20)
42#define CCM_PCCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24)
43#define CCM_CCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28)
44#define CCM_PMCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x2c)
45#define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30)
46#define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34)
47
48#define CCM_CSCR_UPDATE_DIS (1 << 31)
49#define CCM_CSCR_SSI2 (1 << 23)
50#define CCM_CSCR_SSI1 (1 << 22)
51#define CCM_CSCR_VPU (1 << 21)
52#define CCM_CSCR_MSHC (1 << 20)
53#define CCM_CSCR_SPLLRES (1 << 19)
54#define CCM_CSCR_MPLLRES (1 << 18)
55#define CCM_CSCR_SP (1 << 17)
56#define CCM_CSCR_MCU (1 << 16)
57#define CCM_CSCR_OSC26MDIV (1 << 4)
58#define CCM_CSCR_OSC26M (1 << 3)
59#define CCM_CSCR_FPM (1 << 2)
60#define CCM_CSCR_SPEN (1 << 1)
61#define CCM_CSCR_MPEN (1 << 0)
62
63/* i.MX27 TO 2+ */
64#define CCM_CSCR_ARM_SRC (1 << 15)
65
66#define CCM_SPCTL1_LF (1 << 15)
67#define CCM_SPCTL1_BRMO (1 << 6)
68
69static struct clk mpll_main1_clk, mpll_main2_clk;
70
71static int clk_pccr_enable(struct clk *clk)
37{ 72{
38 unsigned long reg; 73 unsigned long reg;
39 74
75 if (!clk->enable_reg)
76 return 0;
77
40 reg = __raw_readl(clk->enable_reg); 78 reg = __raw_readl(clk->enable_reg);
41 reg |= 1 << clk->enable_shift; 79 reg |= 1 << clk->enable_shift;
42 __raw_writel(reg, clk->enable_reg); 80 __raw_writel(reg, clk->enable_reg);
@@ -44,16 +82,19 @@ static int _clk_enable(struct clk *clk)
44 return 0; 82 return 0;
45} 83}
46 84
47static void _clk_disable(struct clk *clk) 85static void clk_pccr_disable(struct clk *clk)
48{ 86{
49 unsigned long reg; 87 unsigned long reg;
50 88
89 if (!clk->enable_reg)
90 return;
91
51 reg = __raw_readl(clk->enable_reg); 92 reg = __raw_readl(clk->enable_reg);
52 reg &= ~(1 << clk->enable_shift); 93 reg &= ~(1 << clk->enable_shift);
53 __raw_writel(reg, clk->enable_reg); 94 __raw_writel(reg, clk->enable_reg);
54} 95}
55 96
56static int _clk_spll_enable(struct clk *clk) 97static int clk_spll_enable(struct clk *clk)
57{ 98{
58 unsigned long reg; 99 unsigned long reg;
59 100
@@ -61,13 +102,12 @@ static int _clk_spll_enable(struct clk *clk)
61 reg |= CCM_CSCR_SPEN; 102 reg |= CCM_CSCR_SPEN;
62 __raw_writel(reg, CCM_CSCR); 103 __raw_writel(reg, CCM_CSCR);
63 104
64 while ((__raw_readl(CCM_SPCTL1) & CCM_SPCTL1_LF) == 0) 105 while (!(__raw_readl(CCM_SPCTL1) & CCM_SPCTL1_LF));
65 ;
66 106
67 return 0; 107 return 0;
68} 108}
69 109
70static void _clk_spll_disable(struct clk *clk) 110static void clk_spll_disable(struct clk *clk)
71{ 111{
72 unsigned long reg; 112 unsigned long reg;
73 113
@@ -76,192 +116,30 @@ static void _clk_spll_disable(struct clk *clk)
76 __raw_writel(reg, CCM_CSCR); 116 __raw_writel(reg, CCM_CSCR);
77} 117}
78 118
79static void _clk_pccr01_enable(unsigned long mask0, unsigned long mask1) 119static int clk_cpu_set_parent(struct clk *clk, struct clk *parent)
80{
81 unsigned long reg;
82
83 reg = __raw_readl(CCM_PCCR0);
84 reg |= mask0;
85 __raw_writel(reg, CCM_PCCR0);
86
87 reg = __raw_readl(CCM_PCCR1);
88 reg |= mask1;
89 __raw_writel(reg, CCM_PCCR1);
90
91}
92
93static void _clk_pccr01_disable(unsigned long mask0, unsigned long mask1)
94{
95 unsigned long reg;
96
97 reg = __raw_readl(CCM_PCCR0);
98 reg &= ~mask0;
99 __raw_writel(reg, CCM_PCCR0);
100
101 reg = __raw_readl(CCM_PCCR1);
102 reg &= ~mask1;
103 __raw_writel(reg, CCM_PCCR1);
104}
105
106static void _clk_pccr10_enable(unsigned long mask1, unsigned long mask0)
107{
108 unsigned long reg;
109
110 reg = __raw_readl(CCM_PCCR1);
111 reg |= mask1;
112 __raw_writel(reg, CCM_PCCR1);
113
114 reg = __raw_readl(CCM_PCCR0);
115 reg |= mask0;
116 __raw_writel(reg, CCM_PCCR0);
117}
118
119static void _clk_pccr10_disable(unsigned long mask1, unsigned long mask0)
120{
121 unsigned long reg;
122
123 reg = __raw_readl(CCM_PCCR1);
124 reg &= ~mask1;
125 __raw_writel(reg, CCM_PCCR1);
126
127 reg = __raw_readl(CCM_PCCR0);
128 reg &= ~mask0;
129 __raw_writel(reg, CCM_PCCR0);
130}
131
132static int _clk_dma_enable(struct clk *clk)
133{
134 _clk_pccr01_enable(CCM_PCCR0_DMA_MASK, CCM_PCCR1_HCLK_DMA_MASK);
135
136 return 0;
137}
138
139static void _clk_dma_disable(struct clk *clk)
140{
141 _clk_pccr01_disable(CCM_PCCR0_DMA_MASK, CCM_PCCR1_HCLK_DMA_MASK);
142}
143
144static int _clk_rtic_enable(struct clk *clk)
145{
146 _clk_pccr01_enable(CCM_PCCR0_RTIC_MASK, CCM_PCCR1_HCLK_RTIC_MASK);
147
148 return 0;
149}
150
151static void _clk_rtic_disable(struct clk *clk)
152{
153 _clk_pccr01_disable(CCM_PCCR0_RTIC_MASK, CCM_PCCR1_HCLK_RTIC_MASK);
154}
155
156static int _clk_emma_enable(struct clk *clk)
157{
158 _clk_pccr01_enable(CCM_PCCR0_EMMA_MASK, CCM_PCCR1_HCLK_EMMA_MASK);
159
160 return 0;
161}
162
163static void _clk_emma_disable(struct clk *clk)
164{
165 _clk_pccr01_disable(CCM_PCCR0_EMMA_MASK, CCM_PCCR1_HCLK_EMMA_MASK);
166}
167
168static int _clk_slcdc_enable(struct clk *clk)
169{
170 _clk_pccr01_enable(CCM_PCCR0_SLCDC_MASK, CCM_PCCR1_HCLK_SLCDC_MASK);
171
172 return 0;
173}
174
175static void _clk_slcdc_disable(struct clk *clk)
176{
177 _clk_pccr01_disable(CCM_PCCR0_SLCDC_MASK, CCM_PCCR1_HCLK_SLCDC_MASK);
178}
179
180static int _clk_fec_enable(struct clk *clk)
181{
182 _clk_pccr01_enable(CCM_PCCR0_FEC_MASK, CCM_PCCR1_HCLK_FEC_MASK);
183
184 return 0;
185}
186
187static void _clk_fec_disable(struct clk *clk)
188{
189 _clk_pccr01_disable(CCM_PCCR0_FEC_MASK, CCM_PCCR1_HCLK_FEC_MASK);
190}
191
192static int _clk_vpu_enable(struct clk *clk)
193{
194 unsigned long reg;
195
196 reg = __raw_readl(CCM_PCCR1);
197 reg |= CCM_PCCR1_VPU_BAUD_MASK | CCM_PCCR1_HCLK_VPU_MASK;
198 __raw_writel(reg, CCM_PCCR1);
199
200 return 0;
201}
202
203static void _clk_vpu_disable(struct clk *clk)
204{ 120{
205 unsigned long reg; 121 int cscr = __raw_readl(CCM_CSCR);
206
207 reg = __raw_readl(CCM_PCCR1);
208 reg &= ~(CCM_PCCR1_VPU_BAUD_MASK | CCM_PCCR1_HCLK_VPU_MASK);
209 __raw_writel(reg, CCM_PCCR1);
210}
211
212static int _clk_sahara2_enable(struct clk *clk)
213{
214 _clk_pccr01_enable(CCM_PCCR0_SAHARA_MASK, CCM_PCCR1_HCLK_SAHARA_MASK);
215
216 return 0;
217}
218
219static void _clk_sahara2_disable(struct clk *clk)
220{
221 _clk_pccr01_disable(CCM_PCCR0_SAHARA_MASK, CCM_PCCR1_HCLK_SAHARA_MASK);
222}
223
224static int _clk_mstick1_enable(struct clk *clk)
225{
226 _clk_pccr10_enable(CCM_PCCR1_MSHC_BAUD_MASK, CCM_PCCR0_MSHC_MASK);
227
228 return 0;
229}
230
231static void _clk_mstick1_disable(struct clk *clk)
232{
233 _clk_pccr10_disable(CCM_PCCR1_MSHC_BAUD_MASK, CCM_PCCR0_MSHC_MASK);
234}
235
236#define CSCR() (__raw_readl(CCM_CSCR))
237#define PCDR0() (__raw_readl(CCM_PCDR0))
238#define PCDR1() (__raw_readl(CCM_PCDR1))
239
240static int _clk_cpu_set_parent(struct clk *clk, struct clk *parent)
241{
242 int cscr = CSCR();
243 122
244 if (clk->parent == parent) 123 if (clk->parent == parent)
245 return 0; 124 return 0;
246 125
247 if (mx27_revision() >= CHIP_REV_2_0) { 126 if (mx27_revision() >= CHIP_REV_2_0) {
248 if (parent == &mpll_main_clk[0]) { 127 if (parent == &mpll_main1_clk) {
249 cscr |= CCM_CSCR_ARM_SRC; 128 cscr |= CCM_CSCR_ARM_SRC;
250 } else { 129 } else {
251 if (parent == &mpll_main_clk[1]) 130 if (parent == &mpll_main2_clk)
252 cscr &= ~CCM_CSCR_ARM_SRC; 131 cscr &= ~CCM_CSCR_ARM_SRC;
253 else 132 else
254 return -EINVAL; 133 return -EINVAL;
255 } 134 }
256 __raw_writel(cscr, CCM_CSCR); 135 __raw_writel(cscr, CCM_CSCR);
257 } else 136 clk->parent = parent;
258 return -ENODEV; 137 return 0;
259 138 }
260 clk->parent = parent; 139 return -ENODEV;
261 return 0;
262} 140}
263 141
264static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) 142static unsigned long round_rate_cpu(struct clk *clk, unsigned long rate)
265{ 143{
266 int div; 144 int div;
267 unsigned long parent_rate; 145 unsigned long parent_rate;
@@ -278,7 +156,7 @@ static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate)
278 return parent_rate / div; 156 return parent_rate / div;
279} 157}
280 158
281static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) 159static int set_rate_cpu(struct clk *clk, unsigned long rate)
282{ 160{
283 unsigned int div; 161 unsigned int div;
284 uint32_t reg; 162 uint32_t reg;
@@ -295,19 +173,18 @@ static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate)
295 173
296 reg = __raw_readl(CCM_CSCR); 174 reg = __raw_readl(CCM_CSCR);
297 if (mx27_revision() >= CHIP_REV_2_0) { 175 if (mx27_revision() >= CHIP_REV_2_0) {
298 reg &= ~CCM_CSCR_ARM_MASK; 176 reg &= ~(3 << 12);
299 reg |= div << CCM_CSCR_ARM_OFFSET; 177 reg |= div << 12;
300 reg &= ~0x06; 178 reg &= ~(CCM_CSCR_FPM | CCM_CSCR_SPEN);
301 __raw_writel(reg | 0x80000000, CCM_CSCR); 179 __raw_writel(reg | CCM_CSCR_UPDATE_DIS, CCM_CSCR);
302 } else { 180 } else {
303 printk(KERN_ERR "Cant set CPU frequency!\n"); 181 printk(KERN_ERR "Can't set CPU frequency!\n");
304 } 182 }
305 183
306 return 0; 184 return 0;
307} 185}
308 186
309static unsigned long _clk_perclkx_round_rate(struct clk *clk, 187static unsigned long round_rate_per(struct clk *clk, unsigned long rate)
310 unsigned long rate)
311{ 188{
312 u32 div; 189 u32 div;
313 unsigned long parent_rate; 190 unsigned long parent_rate;
@@ -324,7 +201,7 @@ static unsigned long _clk_perclkx_round_rate(struct clk *clk,
324 return parent_rate / div; 201 return parent_rate / div;
325} 202}
326 203
327static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) 204static int set_rate_per(struct clk *clk, unsigned long rate)
328{ 205{
329 u32 reg; 206 u32 reg;
330 u32 div; 207 u32 div;
@@ -340,84 +217,65 @@ static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate)
340 return -EINVAL; 217 return -EINVAL;
341 div--; 218 div--;
342 219
343 reg = 220 reg = __raw_readl(CCM_PCDR1) & ~(0x3f << (clk->id << 3));
344 __raw_readl(CCM_PCDR1) & ~(CCM_PCDR1_PERDIV1_MASK <<
345 (clk->id << 3));
346 reg |= div << (clk->id << 3); 221 reg |= div << (clk->id << 3);
347 __raw_writel(reg, CCM_PCDR1); 222 __raw_writel(reg, CCM_PCDR1);
348 223
349 return 0; 224 return 0;
350} 225}
351 226
352static unsigned long _clk_usb_recalc(struct clk *clk) 227static unsigned long get_rate_usb(struct clk *clk)
353{ 228{
354 unsigned long usb_pdf; 229 unsigned long usb_pdf;
355 unsigned long parent_rate; 230 unsigned long parent_rate;
356 231
357 parent_rate = clk_get_rate(clk->parent); 232 parent_rate = clk_get_rate(clk->parent);
358 233
359 usb_pdf = (CSCR() & CCM_CSCR_USB_MASK) >> CCM_CSCR_USB_OFFSET; 234 usb_pdf = (__raw_readl(CCM_CSCR) >> 28) & 0x7;
360 235
361 return parent_rate / (usb_pdf + 1U); 236 return parent_rate / (usb_pdf + 1U);
362} 237}
363 238
364static unsigned long _clk_ssi1_recalc(struct clk *clk) 239static unsigned long get_rate_ssix(struct clk *clk, unsigned long pdf)
365{ 240{
366 unsigned long ssi1_pdf;
367 unsigned long parent_rate; 241 unsigned long parent_rate;
368 242
369 parent_rate = clk_get_rate(clk->parent); 243 parent_rate = clk_get_rate(clk->parent);
370 244
371 ssi1_pdf = (PCDR0() & CCM_PCDR0_SSI1BAUDDIV_MASK) >>
372 CCM_PCDR0_SSI1BAUDDIV_OFFSET;
373
374 if (mx27_revision() >= CHIP_REV_2_0) 245 if (mx27_revision() >= CHIP_REV_2_0)
375 ssi1_pdf += 4; 246 pdf += 4; /* MX27 TO2+ */
376 else 247 else
377 ssi1_pdf = (ssi1_pdf < 2) ? 124UL : ssi1_pdf; 248 pdf = (pdf < 2) ? 124UL : pdf; /* MX21 & MX27 TO1 */
378 249
379 return 2UL * parent_rate / ssi1_pdf; 250 return 2UL * parent_rate / pdf;
380} 251}
381 252
382static unsigned long _clk_ssi2_recalc(struct clk *clk) 253static unsigned long get_rate_ssi1(struct clk *clk)
383{ 254{
384 unsigned long ssi2_pdf; 255 return get_rate_ssix(clk, (__raw_readl(CCM_PCDR0) >> 16) & 0x3f);
385 unsigned long parent_rate; 256}
386
387 parent_rate = clk_get_rate(clk->parent);
388
389 ssi2_pdf = (PCDR0() & CCM_PCDR0_SSI2BAUDDIV_MASK) >>
390 CCM_PCDR0_SSI2BAUDDIV_OFFSET;
391
392 if (mx27_revision() >= CHIP_REV_2_0)
393 ssi2_pdf += 4;
394 else
395 ssi2_pdf = (ssi2_pdf < 2) ? 124UL : ssi2_pdf;
396 257
397 return 2UL * parent_rate / ssi2_pdf; 258static unsigned long get_rate_ssi2(struct clk *clk)
259{
260 return get_rate_ssix(clk, (__raw_readl(CCM_PCDR0) >> 26) & 0x3f);
398} 261}
399 262
400static unsigned long _clk_nfc_recalc(struct clk *clk) 263static unsigned long get_rate_nfc(struct clk *clk)
401{ 264{
402 unsigned long nfc_pdf; 265 unsigned long nfc_pdf;
403 unsigned long parent_rate; 266 unsigned long parent_rate;
404 267
405 parent_rate = clk_get_rate(clk->parent); 268 parent_rate = clk_get_rate(clk->parent);
406 269
407 if (mx27_revision() >= CHIP_REV_2_0) { 270 if (mx27_revision() >= CHIP_REV_2_0)
408 nfc_pdf = 271 nfc_pdf = (__raw_readl(CCM_PCDR0) >> 6) & 0xf;
409 (PCDR0() & CCM_PCDR0_NFCDIV2_MASK) >> 272 else
410 CCM_PCDR0_NFCDIV2_OFFSET; 273 nfc_pdf = (__raw_readl(CCM_PCDR0) >> 12) & 0xf;
411 } else {
412 nfc_pdf =
413 (PCDR0() & CCM_PCDR0_NFCDIV_MASK) >>
414 CCM_PCDR0_NFCDIV_OFFSET;
415 }
416 274
417 return parent_rate / (nfc_pdf + 1); 275 return parent_rate / (nfc_pdf + 1);
418} 276}
419 277
420static unsigned long _clk_vpu_recalc(struct clk *clk) 278static unsigned long get_rate_vpu(struct clk *clk)
421{ 279{
422 unsigned long vpu_pdf; 280 unsigned long vpu_pdf;
423 unsigned long parent_rate; 281 unsigned long parent_rate;
@@ -425,25 +283,27 @@ static unsigned long _clk_vpu_recalc(struct clk *clk)
425 parent_rate = clk_get_rate(clk->parent); 283 parent_rate = clk_get_rate(clk->parent);
426 284
427 if (mx27_revision() >= CHIP_REV_2_0) { 285 if (mx27_revision() >= CHIP_REV_2_0) {
428 vpu_pdf = 286 vpu_pdf = (__raw_readl(CCM_PCDR0) >> 10) & 0x3f;
429 (PCDR0() & CCM_PCDR0_VPUDIV2_MASK) >>
430 CCM_PCDR0_VPUDIV2_OFFSET;
431 vpu_pdf += 4; 287 vpu_pdf += 4;
432 } else { 288 } else {
433 vpu_pdf = 289 vpu_pdf = (__raw_readl(CCM_PCDR0) >> 8) & 0xf;
434 (PCDR0() & CCM_PCDR0_VPUDIV_MASK) >>
435 CCM_PCDR0_VPUDIV_OFFSET;
436 vpu_pdf = (vpu_pdf < 2) ? 124 : vpu_pdf; 290 vpu_pdf = (vpu_pdf < 2) ? 124 : vpu_pdf;
437 } 291 }
292
438 return 2UL * parent_rate / vpu_pdf; 293 return 2UL * parent_rate / vpu_pdf;
439} 294}
440 295
441static unsigned long _clk_parent_round_rate(struct clk *clk, unsigned long rate) 296static unsigned long round_rate_parent(struct clk *clk, unsigned long rate)
442{ 297{
443 return clk->parent->round_rate(clk->parent, rate); 298 return clk->parent->round_rate(clk->parent, rate);
444} 299}
445 300
446static int _clk_parent_set_rate(struct clk *clk, unsigned long rate) 301static unsigned long get_rate_parent(struct clk *clk)
302{
303 return clk_get_rate(clk->parent);
304}
305
306static int set_rate_parent(struct clk *clk, unsigned long rate)
447{ 307{
448 return clk->parent->set_rate(clk->parent, rate); 308 return clk->parent->set_rate(clk->parent, rate);
449} 309}
@@ -451,1112 +311,380 @@ static int _clk_parent_set_rate(struct clk *clk, unsigned long rate)
451/* in Hz */ 311/* in Hz */
452static unsigned long external_high_reference = 26000000; 312static unsigned long external_high_reference = 26000000;
453 313
454static unsigned long get_high_reference_clock_rate(struct clk *clk) 314static unsigned long get_rate_high_reference(struct clk *clk)
455{ 315{
456 return external_high_reference; 316 return external_high_reference;
457} 317}
458 318
459/*
460 * the high frequency external clock reference
461 * Default case is 26MHz. Could be changed at runtime
462 * with a call to change_external_high_reference()
463 */
464static struct clk ckih_clk = {
465 .name = "ckih",
466 .get_rate = get_high_reference_clock_rate,
467};
468
469/* in Hz */ 319/* in Hz */
470static unsigned long external_low_reference = 32768; 320static unsigned long external_low_reference = 32768;
471 321
472static unsigned long get_low_reference_clock_rate(struct clk *clk) 322static unsigned long get_rate_low_reference(struct clk *clk)
473{ 323{
474 return external_low_reference; 324 return external_low_reference;
475} 325}
476 326
477/* 327static unsigned long get_rate_fpm(struct clk *clk)
478 * the low frequency external clock reference
479 * Default case is 32.768kHz Could be changed at runtime
480 * with a call to change_external_low_reference()
481 */
482static struct clk ckil_clk = {
483 .name = "ckil",
484 .get_rate = get_low_reference_clock_rate,
485};
486
487static unsigned long get_mpll_clk(struct clk *clk)
488{ 328{
489 uint32_t reg; 329 return clk_get_rate(clk->parent) * 1024;
490 unsigned long ref_clk;
491 unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0;
492 unsigned long long temp;
493
494 ref_clk = clk_get_rate(clk->parent);
495
496 reg = __raw_readl(CCM_MPCTL0);
497 pdf = (reg & CCM_MPCTL0_PD_MASK) >> CCM_MPCTL0_PD_OFFSET;
498 mfd = (reg & CCM_MPCTL0_MFD_MASK) >> CCM_MPCTL0_MFD_OFFSET;
499 mfi = (reg & CCM_MPCTL0_MFI_MASK) >> CCM_MPCTL0_MFI_OFFSET;
500 mfn = (reg & CCM_MPCTL0_MFN_MASK) >> CCM_MPCTL0_MFN_OFFSET;
501
502 mfi = (mfi <= 5) ? 5 : mfi;
503 temp = 2LL * ref_clk * mfn;
504 do_div(temp, mfd + 1);
505 temp = 2LL * ref_clk * mfi + temp;
506 do_div(temp, pdf + 1);
507
508 return (unsigned long)temp;
509} 330}
510 331
511static struct clk mpll_clk = { 332static unsigned long get_rate_mpll(struct clk *clk)
512 .name = "mpll", 333{
513 .parent = &ckih_clk, 334 return mxc_decode_pll(__raw_readl(CCM_MPCTL0),
514 .get_rate = get_mpll_clk, 335 clk_get_rate(clk->parent));
515}; 336}
516 337
517static unsigned long _clk_mpll_main_get_rate(struct clk *clk) 338static unsigned long get_rate_mpll_main(struct clk *clk)
518{ 339{
519 unsigned long parent_rate; 340 unsigned long parent_rate;
520 341
521 parent_rate = clk_get_rate(clk->parent); 342 parent_rate = clk_get_rate(clk->parent);
522 343
523 /* i.MX27 TO2: 344 /* i.MX27 TO2:
524 * clk->id == 0: arm clock source path 1 which is from 2*MPLL/DIV_2 345 * clk->id == 0: arm clock source path 1 which is from 2 * MPLL / 2
525 * clk->id == 1: arm clock source path 2 which is from 2*MPLL/DIV_3 346 * clk->id == 1: arm clock source path 2 which is from 2 * MPLL / 3
526 */ 347 */
527
528 if (mx27_revision() >= CHIP_REV_2_0 && clk->id == 1) 348 if (mx27_revision() >= CHIP_REV_2_0 && clk->id == 1)
529 return 2UL * parent_rate / 3UL; 349 return 2UL * parent_rate / 3UL;
530 350
531 return parent_rate; 351 return parent_rate;
532} 352}
533 353
534static struct clk mpll_main_clk[] = { 354static unsigned long get_rate_spll(struct clk *clk)
535 {
536 /* For i.MX27 TO2, it is the MPLL path 1 of ARM core
537 * It provide the clock source whose rate is same as MPLL
538 */
539 .name = "mpll_main",
540 .id = 0,
541 .parent = &mpll_clk,
542 .get_rate = _clk_mpll_main_get_rate
543 }, {
544 /* For i.MX27 TO2, it is the MPLL path 2 of ARM core
545 * It provide the clock source whose rate is same MPLL * 2/3
546 */
547 .name = "mpll_main",
548 .id = 1,
549 .parent = &mpll_clk,
550 .get_rate = _clk_mpll_main_get_rate
551 }
552};
553
554static unsigned long get_spll_clk(struct clk *clk)
555{ 355{
556 uint32_t reg; 356 uint32_t reg;
557 unsigned long ref_clk; 357 unsigned long rate;
558 unsigned long mfi = 0, mfn = 0, mfd = 0, pdf = 0;
559 unsigned long long temp;
560 358
561 ref_clk = clk_get_rate(clk->parent); 359 rate = clk_get_rate(clk->parent);
562 360
563 reg = __raw_readl(CCM_SPCTL0); 361 reg = __raw_readl(CCM_SPCTL0);
564 /*TODO: This is TO2 Bug */ 362
363 /* On TO2 we have to write the value back. Otherwise we
364 * read 0 from this register the next time.
365 */
565 if (mx27_revision() >= CHIP_REV_2_0) 366 if (mx27_revision() >= CHIP_REV_2_0)
566 __raw_writel(reg, CCM_SPCTL0); 367 __raw_writel(reg, CCM_SPCTL0);
567 368
568 pdf = (reg & CCM_SPCTL0_PD_MASK) >> CCM_SPCTL0_PD_OFFSET; 369 return mxc_decode_pll(reg, rate);
569 mfd = (reg & CCM_SPCTL0_MFD_MASK) >> CCM_SPCTL0_MFD_OFFSET;
570 mfi = (reg & CCM_SPCTL0_MFI_MASK) >> CCM_SPCTL0_MFI_OFFSET;
571 mfn = (reg & CCM_SPCTL0_MFN_MASK) >> CCM_SPCTL0_MFN_OFFSET;
572
573 mfi = (mfi <= 5) ? 5 : mfi;
574 temp = 2LL * ref_clk * mfn;
575 do_div(temp, mfd + 1);
576 temp = 2LL * ref_clk * mfi + temp;
577 do_div(temp, pdf + 1);
578
579 return (unsigned long)temp;
580} 370}
581 371
582static struct clk spll_clk = { 372static unsigned long get_rate_cpu(struct clk *clk)
583 .name = "spll",
584 .parent = &ckih_clk,
585 .get_rate = get_spll_clk,
586 .enable = _clk_spll_enable,
587 .disable = _clk_spll_disable,
588};
589
590static unsigned long get_cpu_clk(struct clk *clk)
591{ 373{
592 u32 div; 374 u32 div;
593 unsigned long rate; 375 unsigned long rate;
594 376
595 if (mx27_revision() >= CHIP_REV_2_0) 377 if (mx27_revision() >= CHIP_REV_2_0)
596 div = (CSCR() & CCM_CSCR_ARM_MASK) >> CCM_CSCR_ARM_OFFSET; 378 div = (__raw_readl(CCM_CSCR) >> 12) & 0x3;
597 else 379 else
598 div = (CSCR() & CCM_CSCR_PRESC_MASK) >> CCM_CSCR_PRESC_OFFSET; 380 div = (__raw_readl(CCM_CSCR) >> 13) & 0x7;
599 381
600 rate = clk_get_rate(clk->parent); 382 rate = clk_get_rate(clk->parent);
601 return rate / (div + 1); 383 return rate / (div + 1);
602} 384}
603 385
604static struct clk cpu_clk = { 386static unsigned long get_rate_ahb(struct clk *clk)
605 .name = "cpu_clk",
606 .parent = &mpll_main_clk[1],
607 .set_parent = _clk_cpu_set_parent,
608 .round_rate = _clk_cpu_round_rate,
609 .get_rate = get_cpu_clk,
610 .set_rate = _clk_cpu_set_rate,
611};
612
613static unsigned long get_ahb_clk(struct clk *clk)
614{ 387{
615 unsigned long rate; 388 unsigned long rate, bclk_pdf;
616 unsigned long bclk_pdf;
617 389
618 if (mx27_revision() >= CHIP_REV_2_0) 390 if (mx27_revision() >= CHIP_REV_2_0)
619 bclk_pdf = (CSCR() & CCM_CSCR_AHB_MASK) 391 bclk_pdf = (__raw_readl(CCM_CSCR) >> 8) & 0x3;
620 >> CCM_CSCR_AHB_OFFSET;
621 else 392 else
622 bclk_pdf = (CSCR() & CCM_CSCR_BCLK_MASK) 393 bclk_pdf = (__raw_readl(CCM_CSCR) >> 9) & 0xf;
623 >> CCM_CSCR_BCLK_OFFSET;
624 394
625 rate = clk_get_rate(clk->parent); 395 rate = clk_get_rate(clk->parent);
626 return rate / (bclk_pdf + 1); 396 return rate / (bclk_pdf + 1);
627} 397}
628 398
629static struct clk ahb_clk = { 399static unsigned long get_rate_ipg(struct clk *clk)
630 .name = "ahb_clk",
631 .parent = &mpll_main_clk[1],
632 .get_rate = get_ahb_clk,
633};
634
635static unsigned long get_ipg_clk(struct clk *clk)
636{ 400{
637 unsigned long rate; 401 unsigned long rate, ipg_pdf;
638 unsigned long ipg_pdf;
639 402
640 if (mx27_revision() >= CHIP_REV_2_0) 403 if (mx27_revision() >= CHIP_REV_2_0)
641 return clk_get_rate(clk->parent); 404 return clk_get_rate(clk->parent);
642 else 405 else
643 ipg_pdf = (CSCR() & CCM_CSCR_IPDIV) >> CCM_CSCR_IPDIV_OFFSET; 406 ipg_pdf = (__raw_readl(CCM_CSCR) >> 8) & 1;
644 407
645 rate = clk_get_rate(clk->parent); 408 rate = clk_get_rate(clk->parent);
646 return rate / (ipg_pdf + 1); 409 return rate / (ipg_pdf + 1);
647} 410}
648 411
649static struct clk ipg_clk = { 412static unsigned long get_rate_per(struct clk *clk)
650 .name = "ipg_clk",
651 .parent = &ahb_clk,
652 .get_rate = get_ipg_clk,
653};
654
655static unsigned long _clk_perclkx_recalc(struct clk *clk)
656{ 413{
657 unsigned long perclk_pdf; 414 unsigned long perclk_pdf, parent_rate;
658 unsigned long parent_rate;
659 415
660 parent_rate = clk_get_rate(clk->parent); 416 parent_rate = clk_get_rate(clk->parent);
661 417
662 if (clk->id < 0 || clk->id > 3) 418 if (clk->id < 0 || clk->id > 3)
663 return 0; 419 return 0;
664 420
665 perclk_pdf = (PCDR1() >> (clk->id << 3)) & CCM_PCDR1_PERDIV1_MASK; 421 perclk_pdf = (__raw_readl(CCM_PCDR1) >> (clk->id << 3)) & 0x3f;
666 422
667 return parent_rate / (perclk_pdf + 1); 423 return parent_rate / (perclk_pdf + 1);
668} 424}
669 425
670static struct clk per_clk[] = { 426/*
671 { 427 * the high frequency external clock reference
672 .name = "per_clk", 428 * Default case is 26MHz. Could be changed at runtime
673 .id = 0, 429 * with a call to change_external_high_reference()
674 .parent = &mpll_main_clk[1], 430 */
675 .get_rate = _clk_perclkx_recalc, 431static struct clk ckih_clk = {
676 .enable = _clk_enable, 432 .get_rate = get_rate_high_reference,
677 .enable_reg = CCM_PCCR1,
678 .enable_shift = CCM_PCCR1_PERCLK1_OFFSET,
679 .disable = _clk_disable,
680 }, {
681 .name = "per_clk",
682 .id = 1,
683 .parent = &mpll_main_clk[1],
684 .get_rate = _clk_perclkx_recalc,
685 .enable = _clk_enable,
686 .enable_reg = CCM_PCCR1,
687 .enable_shift = CCM_PCCR1_PERCLK2_OFFSET,
688 .disable = _clk_disable,
689 }, {
690 .name = "per_clk",
691 .id = 2,
692 .parent = &mpll_main_clk[1],
693 .round_rate = _clk_perclkx_round_rate,
694 .set_rate = _clk_perclkx_set_rate,
695 .get_rate = _clk_perclkx_recalc,
696 .enable = _clk_enable,
697 .enable_reg = CCM_PCCR1,
698 .enable_shift = CCM_PCCR1_PERCLK3_OFFSET,
699 .disable = _clk_disable,
700 }, {
701 .name = "per_clk",
702 .id = 3,
703 .parent = &mpll_main_clk[1],
704 .round_rate = _clk_perclkx_round_rate,
705 .set_rate = _clk_perclkx_set_rate,
706 .get_rate = _clk_perclkx_recalc,
707 .enable = _clk_enable,
708 .enable_reg = CCM_PCCR1,
709 .enable_shift = CCM_PCCR1_PERCLK4_OFFSET,
710 .disable = _clk_disable,
711 },
712};
713
714struct clk uart1_clk[] = {
715 {
716 .name = "uart_clk",
717 .id = 0,
718 .parent = &per_clk[0],
719 .secondary = &uart1_clk[1],
720 }, {
721 .name = "uart_ipg_clk",
722 .id = 0,
723 .parent = &ipg_clk,
724 .enable = _clk_enable,
725 .enable_reg = CCM_PCCR1,
726 .enable_shift = CCM_PCCR1_UART1_OFFSET,
727 .disable = _clk_disable,
728 },
729};
730
731struct clk uart2_clk[] = {
732 {
733 .name = "uart_clk",
734 .id = 1,
735 .parent = &per_clk[0],
736 .secondary = &uart2_clk[1],
737 }, {
738 .name = "uart_ipg_clk",
739 .id = 1,
740 .parent = &ipg_clk,
741 .enable = _clk_enable,
742 .enable_reg = CCM_PCCR1,
743 .enable_shift = CCM_PCCR1_UART2_OFFSET,
744 .disable = _clk_disable,
745 },
746};
747
748struct clk uart3_clk[] = {
749 {
750 .name = "uart_clk",
751 .id = 2,
752 .parent = &per_clk[0],
753 .secondary = &uart3_clk[1],
754 }, {
755 .name = "uart_ipg_clk",
756 .id = 2,
757 .parent = &ipg_clk,
758 .enable = _clk_enable,
759 .enable_reg = CCM_PCCR1,
760 .enable_shift = CCM_PCCR1_UART3_OFFSET,
761 .disable = _clk_disable,
762 },
763};
764
765struct clk uart4_clk[] = {
766 {
767 .name = "uart_clk",
768 .id = 3,
769 .parent = &per_clk[0],
770 .secondary = &uart4_clk[1],
771 }, {
772 .name = "uart_ipg_clk",
773 .id = 3,
774 .parent = &ipg_clk,
775 .enable = _clk_enable,
776 .enable_reg = CCM_PCCR1,
777 .enable_shift = CCM_PCCR1_UART4_OFFSET,
778 .disable = _clk_disable,
779 },
780};
781
782struct clk uart5_clk[] = {
783 {
784 .name = "uart_clk",
785 .id = 4,
786 .parent = &per_clk[0],
787 .secondary = &uart5_clk[1],
788 }, {
789 .name = "uart_ipg_clk",
790 .id = 4,
791 .parent = &ipg_clk,
792 .enable = _clk_enable,
793 .enable_reg = CCM_PCCR1,
794 .enable_shift = CCM_PCCR1_UART5_OFFSET,
795 .disable = _clk_disable,
796 },
797};
798
799struct clk uart6_clk[] = {
800 {
801 .name = "uart_clk",
802 .id = 5,
803 .parent = &per_clk[0],
804 .secondary = &uart6_clk[1],
805 }, {
806 .name = "uart_ipg_clk",
807 .id = 5,
808 .parent = &ipg_clk,
809 .enable = _clk_enable,
810 .enable_reg = CCM_PCCR1,
811 .enable_shift = CCM_PCCR1_UART6_OFFSET,
812 .disable = _clk_disable,
813 },
814};
815
816static struct clk gpt1_clk[] = {
817 {
818 .name = "gpt_clk",
819 .id = 0,
820 .parent = &per_clk[0],
821 .secondary = &gpt1_clk[1],
822 }, {
823 .name = "gpt_ipg_clk",
824 .id = 0,
825 .parent = &ipg_clk,
826 .enable = _clk_enable,
827 .enable_reg = CCM_PCCR0,
828 .enable_shift = CCM_PCCR0_GPT1_OFFSET,
829 .disable = _clk_disable,
830 },
831};
832
833static struct clk gpt2_clk[] = {
834 {
835 .name = "gpt_clk",
836 .id = 1,
837 .parent = &per_clk[0],
838 .secondary = &gpt2_clk[1],
839 }, {
840 .name = "gpt_ipg_clk",
841 .id = 1,
842 .parent = &ipg_clk,
843 .enable = _clk_enable,
844 .enable_reg = CCM_PCCR0,
845 .enable_shift = CCM_PCCR0_GPT2_OFFSET,
846 .disable = _clk_disable,
847 },
848};
849
850static struct clk gpt3_clk[] = {
851 {
852 .name = "gpt_clk",
853 .id = 2,
854 .parent = &per_clk[0],
855 .secondary = &gpt3_clk[1],
856 }, {
857 .name = "gpt_ipg_clk",
858 .id = 2,
859 .parent = &ipg_clk,
860 .enable = _clk_enable,
861 .enable_reg = CCM_PCCR0,
862 .enable_shift = CCM_PCCR0_GPT3_OFFSET,
863 .disable = _clk_disable,
864 },
865};
866
867static struct clk gpt4_clk[] = {
868 {
869 .name = "gpt_clk",
870 .id = 3,
871 .parent = &per_clk[0],
872 .secondary = &gpt4_clk[1],
873 }, {
874 .name = "gpt_ipg_clk",
875 .id = 3,
876 .parent = &ipg_clk,
877 .enable = _clk_enable,
878 .enable_reg = CCM_PCCR0,
879 .enable_shift = CCM_PCCR0_GPT4_OFFSET,
880 .disable = _clk_disable,
881 },
882};
883
884static struct clk gpt5_clk[] = {
885 {
886 .name = "gpt_clk",
887 .id = 4,
888 .parent = &per_clk[0],
889 .secondary = &gpt5_clk[1],
890 }, {
891 .name = "gpt_ipg_clk",
892 .id = 4,
893 .parent = &ipg_clk,
894 .enable = _clk_enable,
895 .enable_reg = CCM_PCCR0,
896 .enable_shift = CCM_PCCR0_GPT5_OFFSET,
897 .disable = _clk_disable,
898 },
899}; 433};
900 434
901static struct clk gpt6_clk[] = { 435static struct clk mpll_clk = {
902 { 436 .parent = &ckih_clk,
903 .name = "gpt_clk", 437 .get_rate = get_rate_mpll,
904 .id = 5,
905 .parent = &per_clk[0],
906 .secondary = &gpt6_clk[1],
907 }, {
908 .name = "gpt_ipg_clk",
909 .id = 5,
910 .parent = &ipg_clk,
911 .enable = _clk_enable,
912 .enable_reg = CCM_PCCR0,
913 .enable_shift = CCM_PCCR0_GPT6_OFFSET,
914 .disable = _clk_disable,
915 },
916}; 438};
917 439
918static struct clk pwm_clk[] = { 440/* For i.MX27 TO2, it is the MPLL path 1 of ARM core
919 { 441 * It provides the clock source whose rate is same as MPLL
920 .name = "pwm_clk", 442 */
921 .parent = &per_clk[0], 443static struct clk mpll_main1_clk = {
922 .secondary = &pwm_clk[1], 444 .id = 0,
923 }, { 445 .parent = &mpll_clk,
924 .name = "pwm_clk", 446 .get_rate = get_rate_mpll_main,
925 .parent = &ipg_clk,
926 .enable = _clk_enable,
927 .enable_reg = CCM_PCCR0,
928 .enable_shift = CCM_PCCR0_PWM_OFFSET,
929 .disable = _clk_disable,
930 },
931}; 447};
932 448
933static struct clk sdhc1_clk[] = { 449/* For i.MX27 TO2, it is the MPLL path 2 of ARM core
934 { 450 * It provides the clock source whose rate is same MPLL * 2 / 3
935 .name = "sdhc_clk", 451 */
936 .id = 0, 452static struct clk mpll_main2_clk = {
937 .parent = &per_clk[1], 453 .id = 1,
938 .secondary = &sdhc1_clk[1], 454 .parent = &mpll_clk,
939 }, { 455 .get_rate = get_rate_mpll_main,
940 .name = "sdhc_ipg_clk",
941 .id = 0,
942 .parent = &ipg_clk,
943 .enable = _clk_enable,
944 .enable_reg = CCM_PCCR0,
945 .enable_shift = CCM_PCCR0_SDHC1_OFFSET,
946 .disable = _clk_disable,
947 },
948}; 456};
949 457
950static struct clk sdhc2_clk[] = { 458static struct clk ahb_clk = {
951 { 459 .parent = &mpll_main2_clk,
952 .name = "sdhc_clk", 460 .get_rate = get_rate_ahb,
953 .id = 1,
954 .parent = &per_clk[1],
955 .secondary = &sdhc2_clk[1],
956 }, {
957 .name = "sdhc_ipg_clk",
958 .id = 1,
959 .parent = &ipg_clk,
960 .enable = _clk_enable,
961 .enable_reg = CCM_PCCR0,
962 .enable_shift = CCM_PCCR0_SDHC2_OFFSET,
963 .disable = _clk_disable,
964 },
965}; 461};
966 462
967static struct clk sdhc3_clk[] = { 463static struct clk ipg_clk = {
968 { 464 .parent = &ahb_clk,
969 .name = "sdhc_clk", 465 .get_rate = get_rate_ipg,
970 .id = 2,
971 .parent = &per_clk[1],
972 .secondary = &sdhc3_clk[1],
973 }, {
974 .name = "sdhc_ipg_clk",
975 .id = 2,
976 .parent = &ipg_clk,
977 .enable = _clk_enable,
978 .enable_reg = CCM_PCCR0,
979 .enable_shift = CCM_PCCR0_SDHC3_OFFSET,
980 .disable = _clk_disable,
981 },
982}; 466};
983 467
984static struct clk cspi1_clk[] = { 468static struct clk cpu_clk = {
985 { 469 .parent = &mpll_main2_clk,
986 .name = "cspi_clk", 470 .set_parent = clk_cpu_set_parent,
987 .id = 0, 471 .round_rate = round_rate_cpu,
988 .parent = &per_clk[1], 472 .get_rate = get_rate_cpu,
989 .secondary = &cspi1_clk[1], 473 .set_rate = set_rate_cpu,
990 }, {
991 .name = "cspi_ipg_clk",
992 .id = 0,
993 .parent = &ipg_clk,
994 .enable = _clk_enable,
995 .enable_reg = CCM_PCCR0,
996 .enable_shift = CCM_PCCR0_CSPI1_OFFSET,
997 .disable = _clk_disable,
998 },
999}; 474};
1000 475
1001static struct clk cspi2_clk[] = { 476static struct clk spll_clk = {
1002 { 477 .parent = &ckih_clk,
1003 .name = "cspi_clk", 478 .get_rate = get_rate_spll,
1004 .id = 1, 479 .enable = clk_spll_enable,
1005 .parent = &per_clk[1], 480 .disable = clk_spll_disable,
1006 .secondary = &cspi2_clk[1],
1007 }, {
1008 .name = "cspi_ipg_clk",
1009 .id = 1,
1010 .parent = &ipg_clk,
1011 .enable = _clk_enable,
1012 .enable_reg = CCM_PCCR0,
1013 .enable_shift = CCM_PCCR0_CSPI2_OFFSET,
1014 .disable = _clk_disable,
1015 },
1016}; 481};
1017 482
1018static struct clk cspi3_clk[] = { 483/*
1019 { 484 * the low frequency external clock reference
1020 .name = "cspi_clk", 485 * Default case is 32.768kHz.
1021 .id = 2, 486 */
1022 .parent = &per_clk[1], 487static struct clk ckil_clk = {
1023 .secondary = &cspi3_clk[1], 488 .get_rate = get_rate_low_reference,
1024 }, {
1025 .name = "cspi_ipg_clk",
1026 .id = 2,
1027 .parent = &ipg_clk,
1028 .enable = _clk_enable,
1029 .enable_reg = CCM_PCCR0,
1030 .enable_shift = CCM_PCCR0_CSPI3_OFFSET,
1031 .disable = _clk_disable,
1032 },
1033}; 489};
1034 490
1035static struct clk lcdc_clk[] = { 491/* Output of frequency pre multiplier */
1036 { 492static struct clk fpm_clk = {
1037 .name = "lcdc_clk", 493 .parent = &ckil_clk,
1038 .parent = &per_clk[2], 494 .get_rate = get_rate_fpm,
1039 .secondary = &lcdc_clk[1],
1040 .round_rate = _clk_parent_round_rate,
1041 .set_rate = _clk_parent_set_rate,
1042 }, {
1043 .name = "lcdc_ipg_clk",
1044 .parent = &ipg_clk,
1045 .secondary = &lcdc_clk[2],
1046 .enable = _clk_enable,
1047 .enable_reg = CCM_PCCR0,
1048 .enable_shift = CCM_PCCR0_LCDC_OFFSET,
1049 .disable = _clk_disable,
1050 }, {
1051 .name = "lcdc_ahb_clk",
1052 .parent = &ahb_clk,
1053 .enable = _clk_enable,
1054 .enable_reg = CCM_PCCR1,
1055 .enable_shift = CCM_PCCR1_HCLK_LCDC_OFFSET,
1056 .disable = _clk_disable,
1057 },
1058}; 495};
1059 496
1060static struct clk csi_clk[] = { 497#define PCCR0 CCM_PCCR0
1061 { 498#define PCCR1 CCM_PCCR1
1062 .name = "csi_perclk",
1063 .parent = &per_clk[3],
1064 .secondary = &csi_clk[1],
1065 .round_rate = _clk_parent_round_rate,
1066 .set_rate = _clk_parent_set_rate,
1067 }, {
1068 .name = "csi_ahb_clk",
1069 .parent = &ahb_clk,
1070 .enable = _clk_enable,
1071 .enable_reg = CCM_PCCR1,
1072 .enable_shift = CCM_PCCR1_HCLK_CSI_OFFSET,
1073 .disable = _clk_disable,
1074 },
1075};
1076 499
1077static struct clk usb_clk[] = { 500#define DEFINE_CLOCK(name, i, er, es, gr, s, p) \
1078 { 501 static struct clk name = { \
1079 .name = "usb_clk", 502 .id = i, \
1080 .parent = &spll_clk, 503 .enable_reg = er, \
1081 .get_rate = _clk_usb_recalc, 504 .enable_shift = es, \
1082 .enable = _clk_enable, 505 .get_rate = gr, \
1083 .enable_reg = CCM_PCCR1, 506 .enable = clk_pccr_enable, \
1084 .enable_shift = CCM_PCCR1_USBOTG_OFFSET, 507 .disable = clk_pccr_disable, \
1085 .disable = _clk_disable, 508 .secondary = s, \
1086 }, { 509 .parent = p, \
1087 .name = "usb_ahb_clk",
1088 .parent = &ahb_clk,
1089 .enable = _clk_enable,
1090 .enable_reg = CCM_PCCR1,
1091 .enable_shift = CCM_PCCR1_HCLK_USBOTG_OFFSET,
1092 .disable = _clk_disable,
1093 } 510 }
1094};
1095 511
1096static struct clk ssi1_clk[] = { 512#define DEFINE_CLOCK1(name, i, er, es, getsetround, s, p) \
1097 { 513 static struct clk name = { \
1098 .name = "ssi_clk", 514 .id = i, \
1099 .id = 0, 515 .enable_reg = er, \
1100 .parent = &mpll_main_clk[1], 516 .enable_shift = es, \
1101 .secondary = &ssi1_clk[1], 517 .get_rate = get_rate_##getsetround, \
1102 .get_rate = _clk_ssi1_recalc, 518 .set_rate = set_rate_##getsetround, \
1103 .enable = _clk_enable, 519 .round_rate = round_rate_##getsetround, \
1104 .enable_reg = CCM_PCCR1, 520 .enable = clk_pccr_enable, \
1105 .enable_shift = CCM_PCCR1_SSI1_BAUD_OFFSET, 521 .disable = clk_pccr_disable, \
1106 .disable = _clk_disable, 522 .secondary = s, \
1107 }, { 523 .parent = p, \
1108 .name = "ssi_ipg_clk", 524 }
1109 .id = 0,
1110 .parent = &ipg_clk,
1111 .enable = _clk_enable,
1112 .enable_reg = CCM_PCCR0,
1113 .enable_shift = CCM_PCCR0_SSI1_IPG_OFFSET,
1114 .disable = _clk_disable,
1115 },
1116};
1117 525
1118static struct clk ssi2_clk[] = { 526/* Forward declaration to keep the following list in order */
1119 { 527static struct clk slcdc_clk1, sahara2_clk1, rtic_clk1, fec_clk1, emma_clk1,
1120 .name = "ssi_clk", 528 dma_clk1, lcdc_clk2, vpu_clk1;
1121 .id = 1, 529
1122 .parent = &mpll_main_clk[1], 530/* All clocks we can gate through PCCRx in the order of PCCRx bits */
1123 .secondary = &ssi2_clk[1], 531DEFINE_CLOCK(ssi2_clk1, 1, PCCR0, 0, NULL, NULL, &ipg_clk);
1124 .get_rate = _clk_ssi2_recalc, 532DEFINE_CLOCK(ssi1_clk1, 0, PCCR0, 1, NULL, NULL, &ipg_clk);
1125 .enable = _clk_enable, 533DEFINE_CLOCK(slcdc_clk, 0, PCCR0, 2, NULL, &slcdc_clk1, &ahb_clk);
1126 .enable_reg = CCM_PCCR1, 534DEFINE_CLOCK(sdhc3_clk1, 0, PCCR0, 3, NULL, NULL, &ipg_clk);
1127 .enable_shift = CCM_PCCR1_SSI2_BAUD_OFFSET, 535DEFINE_CLOCK(sdhc2_clk1, 0, PCCR0, 4, NULL, NULL, &ipg_clk);
1128 .disable = _clk_disable, 536DEFINE_CLOCK(sdhc1_clk1, 0, PCCR0, 5, NULL, NULL, &ipg_clk);
1129 }, { 537DEFINE_CLOCK(scc_clk, 0, PCCR0, 6, NULL, NULL, &ipg_clk);
1130 .name = "ssi_ipg_clk", 538DEFINE_CLOCK(sahara2_clk, 0, PCCR0, 7, NULL, &sahara2_clk1, &ahb_clk);
1131 .id = 1, 539DEFINE_CLOCK(rtic_clk, 0, PCCR0, 8, NULL, &rtic_clk1, &ahb_clk);
1132 .parent = &ipg_clk, 540DEFINE_CLOCK(rtc_clk, 0, PCCR0, 9, NULL, NULL, &ipg_clk);
1133 .enable = _clk_enable, 541DEFINE_CLOCK(pwm_clk1, 0, PCCR0, 11, NULL, NULL, &ipg_clk);
1134 .enable_reg = CCM_PCCR0, 542DEFINE_CLOCK(owire_clk, 0, PCCR0, 12, NULL, NULL, &ipg_clk);
1135 .enable_shift = CCM_PCCR0_SSI2_IPG_OFFSET, 543DEFINE_CLOCK(mstick_clk1, 0, PCCR0, 13, NULL, NULL, &ipg_clk);
1136 .disable = _clk_disable, 544DEFINE_CLOCK(lcdc_clk1, 0, PCCR0, 14, NULL, &lcdc_clk2, &ipg_clk);
545DEFINE_CLOCK(kpp_clk, 0, PCCR0, 15, NULL, NULL, &ipg_clk);
546DEFINE_CLOCK(iim_clk, 0, PCCR0, 16, NULL, NULL, &ipg_clk);
547DEFINE_CLOCK(i2c2_clk, 1, PCCR0, 17, NULL, NULL, &ipg_clk);
548DEFINE_CLOCK(i2c1_clk, 0, PCCR0, 18, NULL, NULL, &ipg_clk);
549DEFINE_CLOCK(gpt6_clk1, 0, PCCR0, 29, NULL, NULL, &ipg_clk);
550DEFINE_CLOCK(gpt5_clk1, 0, PCCR0, 20, NULL, NULL, &ipg_clk);
551DEFINE_CLOCK(gpt4_clk1, 0, PCCR0, 21, NULL, NULL, &ipg_clk);
552DEFINE_CLOCK(gpt3_clk1, 0, PCCR0, 22, NULL, NULL, &ipg_clk);
553DEFINE_CLOCK(gpt2_clk1, 0, PCCR0, 23, NULL, NULL, &ipg_clk);
554DEFINE_CLOCK(gpt1_clk1, 0, PCCR0, 24, NULL, NULL, &ipg_clk);
555DEFINE_CLOCK(gpio_clk, 0, PCCR0, 25, NULL, NULL, &ipg_clk);
556DEFINE_CLOCK(fec_clk, 0, PCCR0, 26, NULL, &fec_clk1, &ahb_clk);
557DEFINE_CLOCK(emma_clk, 0, PCCR0, 27, NULL, &emma_clk1, &ahb_clk);
558DEFINE_CLOCK(dma_clk, 0, PCCR0, 28, NULL, &dma_clk1, &ahb_clk);
559DEFINE_CLOCK(cspi13_clk1, 0, PCCR0, 29, NULL, NULL, &ipg_clk);
560DEFINE_CLOCK(cspi2_clk1, 0, PCCR0, 30, NULL, NULL, &ipg_clk);
561DEFINE_CLOCK(cspi1_clk1, 0, PCCR0, 31, NULL, NULL, &ipg_clk);
562
563DEFINE_CLOCK(mstick_clk, 0, PCCR1, 2, NULL, &mstick_clk1, &ipg_clk);
564DEFINE_CLOCK(nfc_clk, 0, PCCR1, 3, get_rate_nfc, NULL, &cpu_clk);
565DEFINE_CLOCK(ssi2_clk, 1, PCCR1, 4, get_rate_ssi2, &ssi2_clk1, &mpll_main2_clk);
566DEFINE_CLOCK(ssi1_clk, 0, PCCR1, 5, get_rate_ssi1, &ssi1_clk1, &mpll_main2_clk);
567DEFINE_CLOCK(vpu_clk, 0, PCCR1, 6, get_rate_vpu, &vpu_clk1, &mpll_main2_clk);
568DEFINE_CLOCK1(per4_clk, 3, PCCR1, 7, per, NULL, &mpll_main2_clk);
569DEFINE_CLOCK1(per3_clk, 2, PCCR1, 8, per, NULL, &mpll_main2_clk);
570DEFINE_CLOCK1(per2_clk, 1, PCCR1, 9, per, NULL, &mpll_main2_clk);
571DEFINE_CLOCK1(per1_clk, 0, PCCR1, 10, per, NULL, &mpll_main2_clk);
572DEFINE_CLOCK(usb_clk1, 0, PCCR1, 11, NULL, NULL, &ahb_clk);
573DEFINE_CLOCK(slcdc_clk1, 0, PCCR1, 12, NULL, NULL, &ahb_clk);
574DEFINE_CLOCK(sahara2_clk1, 0, PCCR1, 13, NULL, NULL, &ahb_clk);
575DEFINE_CLOCK(rtic_clk1, 0, PCCR1, 14, NULL, NULL, &ahb_clk);
576DEFINE_CLOCK(lcdc_clk2, 0, PCCR1, 15, NULL, NULL, &ahb_clk);
577DEFINE_CLOCK(vpu_clk1, 0, PCCR1, 16, NULL, NULL, &ahb_clk);
578DEFINE_CLOCK(fec_clk1, 0, PCCR1, 17, NULL, NULL, &ahb_clk);
579DEFINE_CLOCK(emma_clk1, 0, PCCR1, 18, NULL, NULL, &ahb_clk);
580DEFINE_CLOCK(emi_clk, 0, PCCR1, 19, NULL, NULL, &ahb_clk);
581DEFINE_CLOCK(dma_clk1, 0, PCCR1, 20, NULL, NULL, &ahb_clk);
582DEFINE_CLOCK(csi_clk1, 0, PCCR1, 21, NULL, NULL, &ahb_clk);
583DEFINE_CLOCK(brom_clk, 0, PCCR1, 22, NULL, NULL, &ahb_clk);
584DEFINE_CLOCK(ata_clk, 0, PCCR1, 23, NULL, NULL, &ahb_clk);
585DEFINE_CLOCK(wdog_clk, 0, PCCR1, 24, NULL, NULL, &ipg_clk);
586DEFINE_CLOCK(usb_clk, 0, PCCR1, 25, get_rate_usb, &usb_clk1, &spll_clk);
587DEFINE_CLOCK(uart6_clk1, 0, PCCR1, 26, NULL, NULL, &ipg_clk);
588DEFINE_CLOCK(uart5_clk1, 0, PCCR1, 27, NULL, NULL, &ipg_clk);
589DEFINE_CLOCK(uart4_clk1, 0, PCCR1, 28, NULL, NULL, &ipg_clk);
590DEFINE_CLOCK(uart3_clk1, 0, PCCR1, 29, NULL, NULL, &ipg_clk);
591DEFINE_CLOCK(uart2_clk1, 0, PCCR1, 30, NULL, NULL, &ipg_clk);
592DEFINE_CLOCK(uart1_clk1, 0, PCCR1, 31, NULL, NULL, &ipg_clk);
593
594/* Clocks we cannot directly gate, but drivers need their rates */
595DEFINE_CLOCK(cspi1_clk, 0, 0, 0, NULL, &cspi1_clk1, &per2_clk);
596DEFINE_CLOCK(cspi2_clk, 1, 0, 0, NULL, &cspi2_clk1, &per2_clk);
597DEFINE_CLOCK(cspi3_clk, 2, 0, 0, NULL, &cspi13_clk1, &per2_clk);
598DEFINE_CLOCK(sdhc1_clk, 0, 0, 0, NULL, &sdhc1_clk1, &per2_clk);
599DEFINE_CLOCK(sdhc2_clk, 1, 0, 0, NULL, &sdhc2_clk1, &per2_clk);
600DEFINE_CLOCK(sdhc3_clk, 2, 0, 0, NULL, &sdhc3_clk1, &per2_clk);
601DEFINE_CLOCK(pwm_clk, 0, 0, 0, NULL, &pwm_clk1, &per1_clk);
602DEFINE_CLOCK(gpt1_clk, 0, 0, 0, NULL, &gpt1_clk1, &per1_clk);
603DEFINE_CLOCK(gpt2_clk, 1, 0, 0, NULL, &gpt2_clk1, &per1_clk);
604DEFINE_CLOCK(gpt3_clk, 2, 0, 0, NULL, &gpt3_clk1, &per1_clk);
605DEFINE_CLOCK(gpt4_clk, 3, 0, 0, NULL, &gpt4_clk1, &per1_clk);
606DEFINE_CLOCK(gpt5_clk, 4, 0, 0, NULL, &gpt5_clk1, &per1_clk);
607DEFINE_CLOCK(gpt6_clk, 5, 0, 0, NULL, &gpt6_clk1, &per1_clk);
608DEFINE_CLOCK(uart1_clk, 0, 0, 0, NULL, &uart1_clk1, &per1_clk);
609DEFINE_CLOCK(uart2_clk, 1, 0, 0, NULL, &uart2_clk1, &per1_clk);
610DEFINE_CLOCK(uart3_clk, 2, 0, 0, NULL, &uart3_clk1, &per1_clk);
611DEFINE_CLOCK(uart4_clk, 3, 0, 0, NULL, &uart4_clk1, &per1_clk);
612DEFINE_CLOCK(uart5_clk, 4, 0, 0, NULL, &uart5_clk1, &per1_clk);
613DEFINE_CLOCK(uart6_clk, 5, 0, 0, NULL, &uart6_clk1, &per1_clk);
614DEFINE_CLOCK1(lcdc_clk, 0, 0, 0, parent, &lcdc_clk1, &per3_clk);
615DEFINE_CLOCK1(csi_clk, 0, 0, 0, parent, &csi_clk1, &per4_clk);
616
617#define _REGISTER_CLOCK(d, n, c) \
618 { \
619 .dev_id = d, \
620 .con_id = n, \
621 .clk = &c, \
1137 }, 622 },
1138};
1139
1140static struct clk nfc_clk = {
1141 .name = "nfc_clk",
1142 .parent = &cpu_clk,
1143 .get_rate = _clk_nfc_recalc,
1144 .enable = _clk_enable,
1145 .enable_reg = CCM_PCCR1,
1146 .enable_shift = CCM_PCCR1_NFC_BAUD_OFFSET,
1147 .disable = _clk_disable,
1148};
1149
1150static struct clk vpu_clk = {
1151 .name = "vpu_clk",
1152 .parent = &mpll_main_clk[1],
1153 .get_rate = _clk_vpu_recalc,
1154 .enable = _clk_vpu_enable,
1155 .disable = _clk_vpu_disable,
1156};
1157
1158static struct clk dma_clk = {
1159 .name = "dma_clk",
1160 .parent = &ahb_clk,
1161 .enable = _clk_dma_enable,
1162 .disable = _clk_dma_disable,
1163};
1164
1165static struct clk rtic_clk = {
1166 .name = "rtic_clk",
1167 .parent = &ahb_clk,
1168 .enable = _clk_rtic_enable,
1169 .disable = _clk_rtic_disable,
1170};
1171 623
1172static struct clk brom_clk = { 624static struct clk_lookup lookups[] __initdata = {
1173 .name = "brom_clk", 625 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
1174 .parent = &ahb_clk, 626 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
1175 .enable = _clk_enable, 627 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
1176 .enable_reg = CCM_PCCR1, 628 _REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk)
1177 .enable_shift = CCM_PCCR1_HCLK_BROM_OFFSET, 629 _REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk)
1178 .disable = _clk_disable, 630 _REGISTER_CLOCK("imx-uart.5", NULL, uart6_clk)
1179}; 631 _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk)
1180 632 _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk)
1181static struct clk emma_clk = { 633 _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk)
1182 .name = "emma_clk", 634 _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk)
1183 .parent = &ahb_clk, 635 _REGISTER_CLOCK(NULL, "gpt5", gpt5_clk)
1184 .enable = _clk_emma_enable, 636 _REGISTER_CLOCK(NULL, "gpt6", gpt6_clk)
1185 .disable = _clk_emma_disable, 637 _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm_clk)
1186}; 638 _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk)
1187 639 _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk)
1188static struct clk slcdc_clk = { 640 _REGISTER_CLOCK("mxc-mmc.2", NULL, sdhc3_clk)
1189 .name = "slcdc_clk", 641 _REGISTER_CLOCK(NULL, "cspi1", cspi1_clk)
1190 .parent = &ahb_clk, 642 _REGISTER_CLOCK(NULL, "cspi2", cspi2_clk)
1191 .enable = _clk_slcdc_enable, 643 _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk)
1192 .disable = _clk_slcdc_disable, 644 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
1193}; 645 _REGISTER_CLOCK(NULL, "csi", csi_clk)
1194 646 _REGISTER_CLOCK(NULL, "usb", usb_clk)
1195static struct clk fec_clk = { 647 _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk)
1196 .name = "fec_clk", 648 _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk)
1197 .parent = &ahb_clk, 649 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
1198 .enable = _clk_fec_enable, 650 _REGISTER_CLOCK(NULL, "vpu", vpu_clk)
1199 .disable = _clk_fec_disable, 651 _REGISTER_CLOCK(NULL, "dma", dma_clk)
1200}; 652 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
1201 653 _REGISTER_CLOCK(NULL, "brom", brom_clk)
1202static struct clk emi_clk = { 654 _REGISTER_CLOCK(NULL, "emma", emma_clk)
1203 .name = "emi_clk", 655 _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk)
1204 .parent = &ahb_clk, 656 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
1205 .enable = _clk_enable, 657 _REGISTER_CLOCK(NULL, "emi", emi_clk)
1206 .enable_reg = CCM_PCCR1, 658 _REGISTER_CLOCK(NULL, "sahara2", sahara2_clk)
1207 .enable_shift = CCM_PCCR1_HCLK_EMI_OFFSET, 659 _REGISTER_CLOCK(NULL, "ata", ata_clk)
1208 .disable = _clk_disable, 660 _REGISTER_CLOCK(NULL, "mstick", mstick_clk)
1209}; 661 _REGISTER_CLOCK(NULL, "wdog", wdog_clk)
1210 662 _REGISTER_CLOCK(NULL, "gpio", gpio_clk)
1211static struct clk sahara2_clk = { 663 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
1212 .name = "sahara_clk", 664 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
1213 .parent = &ahb_clk, 665 _REGISTER_CLOCK(NULL, "iim", iim_clk)
1214 .enable = _clk_sahara2_enable, 666 _REGISTER_CLOCK(NULL, "kpp", kpp_clk)
1215 .disable = _clk_sahara2_disable, 667 _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk)
1216}; 668 _REGISTER_CLOCK(NULL, "rtc", rtc_clk)
1217 669 _REGISTER_CLOCK(NULL, "scc", scc_clk)
1218static struct clk ata_clk = { 670};
1219 .name = "ata_clk", 671
1220 .parent = &ahb_clk, 672/* Adjust the clock path for TO2 and later */
1221 .enable = _clk_enable, 673static void __init to2_adjust_clocks(void)
1222 .enable_reg = CCM_PCCR1, 674{
1223 .enable_shift = CCM_PCCR1_HCLK_ATA_OFFSET, 675 unsigned long cscr = __raw_readl(CCM_CSCR);
1224 .disable = _clk_disable,
1225};
1226
1227static struct clk mstick1_clk = {
1228 .name = "mstick1_clk",
1229 .parent = &ipg_clk,
1230 .enable = _clk_mstick1_enable,
1231 .disable = _clk_mstick1_disable,
1232};
1233
1234static struct clk wdog_clk = {
1235 .name = "wdog_clk",
1236 .parent = &ipg_clk,
1237 .enable = _clk_enable,
1238 .enable_reg = CCM_PCCR1,
1239 .enable_shift = CCM_PCCR1_WDT_OFFSET,
1240 .disable = _clk_disable,
1241};
1242
1243static struct clk gpio_clk = {
1244 .name = "gpio_clk",
1245 .parent = &ipg_clk,
1246 .enable = _clk_enable,
1247 .enable_reg = CCM_PCCR1,
1248 .enable_shift = CCM_PCCR0_GPIO_OFFSET,
1249 .disable = _clk_disable,
1250};
1251
1252static struct clk i2c_clk[] = {
1253 {
1254 .name = "i2c_clk",
1255 .id = 0,
1256 .parent = &ipg_clk,
1257 .enable = _clk_enable,
1258 .enable_reg = CCM_PCCR0,
1259 .enable_shift = CCM_PCCR0_I2C1_OFFSET,
1260 .disable = _clk_disable,
1261 }, {
1262 .name = "i2c_clk",
1263 .id = 1,
1264 .parent = &ipg_clk,
1265 .enable = _clk_enable,
1266 .enable_reg = CCM_PCCR0,
1267 .enable_shift = CCM_PCCR0_I2C2_OFFSET,
1268 .disable = _clk_disable,
1269 },
1270};
1271
1272static struct clk iim_clk = {
1273 .name = "iim_clk",
1274 .parent = &ipg_clk,
1275 .enable = _clk_enable,
1276 .enable_reg = CCM_PCCR0,
1277 .enable_shift = CCM_PCCR0_IIM_OFFSET,
1278 .disable = _clk_disable,
1279};
1280
1281static struct clk kpp_clk = {
1282 .name = "kpp_clk",
1283 .parent = &ipg_clk,
1284 .enable = _clk_enable,
1285 .enable_reg = CCM_PCCR0,
1286 .enable_shift = CCM_PCCR0_KPP_OFFSET,
1287 .disable = _clk_disable,
1288};
1289
1290static struct clk owire_clk = {
1291 .name = "owire_clk",
1292 .parent = &ipg_clk,
1293 .enable = _clk_enable,
1294 .enable_reg = CCM_PCCR0,
1295 .enable_shift = CCM_PCCR0_OWIRE_OFFSET,
1296 .disable = _clk_disable,
1297};
1298
1299static struct clk rtc_clk = {
1300 .name = "rtc_clk",
1301 .parent = &ipg_clk,
1302 .enable = _clk_enable,
1303 .enable_reg = CCM_PCCR0,
1304 .enable_shift = CCM_PCCR0_RTC_OFFSET,
1305 .disable = _clk_disable,
1306};
1307
1308static struct clk scc_clk = {
1309 .name = "scc_clk",
1310 .parent = &ipg_clk,
1311 .enable = _clk_enable,
1312 .enable_reg = CCM_PCCR0,
1313 .enable_shift = CCM_PCCR0_SCC_OFFSET,
1314 .disable = _clk_disable,
1315};
1316
1317static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate)
1318{
1319 u32 div;
1320 unsigned long parent_rate;
1321
1322 parent_rate = clk_get_rate(clk->parent);
1323 div = parent_rate / rate;
1324 if (parent_rate % rate)
1325 div++;
1326
1327 if (div > 8)
1328 div = 8;
1329
1330 return parent_rate / div;
1331}
1332
1333static int _clk_clko_set_rate(struct clk *clk, unsigned long rate)
1334{
1335 u32 reg;
1336 u32 div;
1337 unsigned long parent_rate;
1338
1339 parent_rate = clk_get_rate(clk->parent);
1340
1341 div = parent_rate / rate;
1342
1343 if (div > 8 || div < 1 || ((parent_rate / div) != rate))
1344 return -EINVAL;
1345 div--;
1346
1347 reg = __raw_readl(CCM_PCDR0) & ~CCM_PCDR0_CLKODIV_MASK;
1348 reg |= div << CCM_PCDR0_CLKODIV_OFFSET;
1349 __raw_writel(reg, CCM_PCDR0);
1350
1351 return 0;
1352}
1353
1354static unsigned long _clk_clko_recalc(struct clk *clk)
1355{
1356 u32 div;
1357 unsigned long parent_rate;
1358
1359 parent_rate = clk_get_rate(clk->parent);
1360
1361 div = __raw_readl(CCM_PCDR0) & CCM_PCDR0_CLKODIV_MASK >>
1362 CCM_PCDR0_CLKODIV_OFFSET;
1363 div++;
1364
1365 return parent_rate / div;
1366}
1367
1368static int _clk_clko_set_parent(struct clk *clk, struct clk *parent)
1369{
1370 u32 reg;
1371
1372 reg = __raw_readl(CCM_CCSR) & ~CCM_CCSR_CLKOSEL_MASK;
1373
1374 if (parent == &ckil_clk)
1375 reg |= 0 << CCM_CCSR_CLKOSEL_OFFSET;
1376 else if (parent == &ckih_clk)
1377 reg |= 2 << CCM_CCSR_CLKOSEL_OFFSET;
1378 else if (parent == mpll_clk.parent)
1379 reg |= 3 << CCM_CCSR_CLKOSEL_OFFSET;
1380 else if (parent == spll_clk.parent)
1381 reg |= 4 << CCM_CCSR_CLKOSEL_OFFSET;
1382 else if (parent == &mpll_clk)
1383 reg |= 5 << CCM_CCSR_CLKOSEL_OFFSET;
1384 else if (parent == &spll_clk)
1385 reg |= 6 << CCM_CCSR_CLKOSEL_OFFSET;
1386 else if (parent == &cpu_clk)
1387 reg |= 7 << CCM_CCSR_CLKOSEL_OFFSET;
1388 else if (parent == &ahb_clk)
1389 reg |= 8 << CCM_CCSR_CLKOSEL_OFFSET;
1390 else if (parent == &ipg_clk)
1391 reg |= 9 << CCM_CCSR_CLKOSEL_OFFSET;
1392 else if (parent == &per_clk[0])
1393 reg |= 0xA << CCM_CCSR_CLKOSEL_OFFSET;
1394 else if (parent == &per_clk[1])
1395 reg |= 0xB << CCM_CCSR_CLKOSEL_OFFSET;
1396 else if (parent == &per_clk[2])
1397 reg |= 0xC << CCM_CCSR_CLKOSEL_OFFSET;
1398 else if (parent == &per_clk[3])
1399 reg |= 0xD << CCM_CCSR_CLKOSEL_OFFSET;
1400 else if (parent == &ssi1_clk[0])
1401 reg |= 0xE << CCM_CCSR_CLKOSEL_OFFSET;
1402 else if (parent == &ssi2_clk[0])
1403 reg |= 0xF << CCM_CCSR_CLKOSEL_OFFSET;
1404 else if (parent == &nfc_clk)
1405 reg |= 0x10 << CCM_CCSR_CLKOSEL_OFFSET;
1406 else if (parent == &mstick1_clk)
1407 reg |= 0x11 << CCM_CCSR_CLKOSEL_OFFSET;
1408 else if (parent == &vpu_clk)
1409 reg |= 0x12 << CCM_CCSR_CLKOSEL_OFFSET;
1410 else if (parent == &usb_clk[0])
1411 reg |= 0x15 << CCM_CCSR_CLKOSEL_OFFSET;
1412 else
1413 return -EINVAL;
1414
1415 __raw_writel(reg, CCM_CCSR);
1416
1417 return 0;
1418}
1419
1420static int _clk_clko_enable(struct clk *clk)
1421{
1422 u32 reg;
1423
1424 reg = __raw_readl(CCM_PCDR0) | CCM_PCDR0_CLKO_EN;
1425 __raw_writel(reg, CCM_PCDR0);
1426
1427 return 0;
1428}
1429
1430static void _clk_clko_disable(struct clk *clk)
1431{
1432 u32 reg;
1433
1434 reg = __raw_readl(CCM_PCDR0) & ~CCM_PCDR0_CLKO_EN;
1435 __raw_writel(reg, CCM_PCDR0);
1436}
1437
1438static struct clk clko_clk = {
1439 .name = "clko_clk",
1440 .get_rate = _clk_clko_recalc,
1441 .set_rate = _clk_clko_set_rate,
1442 .round_rate = _clk_clko_round_rate,
1443 .set_parent = _clk_clko_set_parent,
1444 .enable = _clk_clko_enable,
1445 .disable = _clk_clko_disable,
1446};
1447
1448static struct clk *mxc_clks[] = {
1449 &ckih_clk,
1450 &ckil_clk,
1451 &mpll_clk,
1452 &mpll_main_clk[0],
1453 &mpll_main_clk[1],
1454 &spll_clk,
1455 &cpu_clk,
1456 &ahb_clk,
1457 &ipg_clk,
1458 &per_clk[0],
1459 &per_clk[1],
1460 &per_clk[2],
1461 &per_clk[3],
1462 &clko_clk,
1463 &uart1_clk[0],
1464 &uart1_clk[1],
1465 &uart2_clk[0],
1466 &uart2_clk[1],
1467 &uart3_clk[0],
1468 &uart3_clk[1],
1469 &uart4_clk[0],
1470 &uart4_clk[1],
1471 &uart5_clk[0],
1472 &uart5_clk[1],
1473 &uart6_clk[0],
1474 &uart6_clk[1],
1475 &gpt1_clk[0],
1476 &gpt1_clk[1],
1477 &gpt2_clk[0],
1478 &gpt2_clk[1],
1479 &gpt3_clk[0],
1480 &gpt3_clk[1],
1481 &gpt4_clk[0],
1482 &gpt4_clk[1],
1483 &gpt5_clk[0],
1484 &gpt5_clk[1],
1485 &gpt6_clk[0],
1486 &gpt6_clk[1],
1487 &pwm_clk[0],
1488 &pwm_clk[1],
1489 &sdhc1_clk[0],
1490 &sdhc1_clk[1],
1491 &sdhc2_clk[0],
1492 &sdhc2_clk[1],
1493 &sdhc3_clk[0],
1494 &sdhc3_clk[1],
1495 &cspi1_clk[0],
1496 &cspi1_clk[1],
1497 &cspi2_clk[0],
1498 &cspi2_clk[1],
1499 &cspi3_clk[0],
1500 &cspi3_clk[1],
1501 &lcdc_clk[0],
1502 &lcdc_clk[1],
1503 &lcdc_clk[2],
1504 &csi_clk[0],
1505 &csi_clk[1],
1506 &usb_clk[0],
1507 &usb_clk[1],
1508 &ssi1_clk[0],
1509 &ssi1_clk[1],
1510 &ssi2_clk[0],
1511 &ssi2_clk[1],
1512 &nfc_clk,
1513 &vpu_clk,
1514 &dma_clk,
1515 &rtic_clk,
1516 &brom_clk,
1517 &emma_clk,
1518 &slcdc_clk,
1519 &fec_clk,
1520 &emi_clk,
1521 &sahara2_clk,
1522 &ata_clk,
1523 &mstick1_clk,
1524 &wdog_clk,
1525 &gpio_clk,
1526 &i2c_clk[0],
1527 &i2c_clk[1],
1528 &iim_clk,
1529 &kpp_clk,
1530 &owire_clk,
1531 &rtc_clk,
1532 &scc_clk,
1533};
1534
1535void __init change_external_low_reference(unsigned long new_ref)
1536{
1537 external_low_reference = new_ref;
1538}
1539
1540unsigned long __init clk_early_get_timer_rate(void)
1541{
1542 return clk_get_rate(&per_clk[0]);
1543}
1544
1545static void __init probe_mxc_clocks(void)
1546{
1547 int i;
1548 676
1549 if (mx27_revision() >= CHIP_REV_2_0) { 677 if (mx27_revision() >= CHIP_REV_2_0) {
1550 if (CSCR() & 0x8000) 678 if (cscr & CCM_CSCR_ARM_SRC)
1551 cpu_clk.parent = &mpll_main_clk[0]; 679 cpu_clk.parent = &mpll_main1_clk;
1552 680
1553 if (!(CSCR() & 0x00800000)) 681 if (!(cscr & CCM_CSCR_SSI2))
1554 ssi2_clk[0].parent = &spll_clk; 682 ssi1_clk.parent = &spll_clk;
1555 683
1556 if (!(CSCR() & 0x00400000)) 684 if (!(cscr & CCM_CSCR_SSI1))
1557 ssi1_clk[0].parent = &spll_clk; 685 ssi1_clk.parent = &spll_clk;
1558 686
1559 if (!(CSCR() & 0x00200000)) 687 if (!(cscr & CCM_CSCR_VPU))
1560 vpu_clk.parent = &spll_clk; 688 vpu_clk.parent = &spll_clk;
1561 } else { 689 } else {
1562 cpu_clk.parent = &mpll_clk; 690 cpu_clk.parent = &mpll_clk;
@@ -1565,11 +693,13 @@ static void __init probe_mxc_clocks(void)
1565 cpu_clk.set_rate = NULL; 693 cpu_clk.set_rate = NULL;
1566 ahb_clk.parent = &mpll_clk; 694 ahb_clk.parent = &mpll_clk;
1567 695
1568 for (i = 0; i < sizeof(per_clk) / sizeof(per_clk[0]); i++) 696 per1_clk.parent = &mpll_clk;
1569 per_clk[i].parent = &mpll_clk; 697 per2_clk.parent = &mpll_clk;
698 per3_clk.parent = &mpll_clk;
699 per4_clk.parent = &mpll_clk;
1570 700
1571 ssi1_clk[0].parent = &mpll_clk; 701 ssi1_clk.parent = &mpll_clk;
1572 ssi2_clk[0].parent = &mpll_clk; 702 ssi2_clk.parent = &mpll_clk;
1573 703
1574 vpu_clk.parent = &mpll_clk; 704 vpu_clk.parent = &mpll_clk;
1575 } 705 }
@@ -1579,47 +709,47 @@ static void __init probe_mxc_clocks(void)
1579 * must be called very early to get information about the 709 * must be called very early to get information about the
1580 * available clock rate when the timer framework starts 710 * available clock rate when the timer framework starts
1581 */ 711 */
1582int __init mxc_clocks_init(unsigned long fref) 712int __init mx27_clocks_init(unsigned long fref)
1583{ 713{
1584 u32 cscr; 714 u32 cscr = __raw_readl(CCM_CSCR);
1585 struct clk **clkp; 715 int i;
1586 716
1587 external_high_reference = fref; 717 external_high_reference = fref;
1588 718
1589 /* detect clock reference for both system PLL */ 719 /* detect clock reference for both system PLLs */
1590 cscr = CSCR();
1591 if (cscr & CCM_CSCR_MCU) 720 if (cscr & CCM_CSCR_MCU)
1592 mpll_clk.parent = &ckih_clk; 721 mpll_clk.parent = &ckih_clk;
1593 else 722 else
1594 mpll_clk.parent = &ckil_clk; 723 mpll_clk.parent = &fpm_clk;
1595 724
1596 if (cscr & CCM_CSCR_SP) 725 if (cscr & CCM_CSCR_SP)
1597 spll_clk.parent = &ckih_clk; 726 spll_clk.parent = &ckih_clk;
1598 else 727 else
1599 spll_clk.parent = &ckil_clk; 728 spll_clk.parent = &fpm_clk;
1600 729
1601 probe_mxc_clocks(); 730 to2_adjust_clocks();
1602 731
1603 per_clk[0].enable(&per_clk[0]); 732 for (i = 0; i < ARRAY_SIZE(lookups); i++)
1604 gpt1_clk[1].enable(&gpt1_clk[1]); 733 clkdev_add(&lookups[i]);
1605 734
1606 for (clkp = mxc_clks; clkp < mxc_clks + ARRAY_SIZE(mxc_clks); clkp++) 735 /* Turn off all clocks we do not need */
1607 clk_register(*clkp); 736 __raw_writel(0, CCM_PCCR0);
737 __raw_writel((1 << 10) | (1 << 19), CCM_PCCR1);
1608 738
1609 /* Turn off all possible clocks */
1610 __raw_writel(CCM_PCCR0_GPT1_MASK, CCM_PCCR0);
1611 __raw_writel(CCM_PCCR1_PERCLK1_MASK | CCM_PCCR1_HCLK_EMI_MASK,
1612 CCM_PCCR1);
1613 spll_clk.disable(&spll_clk); 739 spll_clk.disable(&spll_clk);
1614 740
1615 /* This will propagate to all children and init all the clock rates */ 741 /* enable basic clocks */
1616 742 clk_enable(&per1_clk);
1617 clk_enable(&emi_clk);
1618 clk_enable(&gpio_clk); 743 clk_enable(&gpio_clk);
744 clk_enable(&emi_clk);
1619 clk_enable(&iim_clk); 745 clk_enable(&iim_clk);
1620 clk_enable(&gpt1_clk[0]); 746
1621#ifdef CONFIG_DEBUG_LL_CONSOLE 747#ifdef CONFIG_DEBUG_LL_CONSOLE
1622 clk_enable(&uart1_clk[0]); 748 clk_enable(&uart1_clk);
1623#endif 749#endif
750
751 mxc_timer_init(&gpt1_clk);
752
1624 return 0; 753 return 0;
1625} 754}
755
diff --git a/arch/arm/mach-mx2/cpu_imx27.c b/arch/arm/mach-mx2/cpu_imx27.c
index 239308fe6652..d9e3bf9644c9 100644
--- a/arch/arm/mach-mx2/cpu_imx27.c
+++ b/arch/arm/mach-mx2/cpu_imx27.c
@@ -26,11 +26,11 @@
26 26
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28 28
29#include "crm_regs.h"
30
31static int cpu_silicon_rev = -1; 29static int cpu_silicon_rev = -1;
32static int cpu_partnumber; 30static int cpu_partnumber;
33 31
32#define SYS_CHIP_ID 0x00 /* The offset of CHIP ID register */
33
34static void query_silicon_parameter(void) 34static void query_silicon_parameter(void)
35{ 35{
36 u32 val; 36 u32 val;
diff --git a/arch/arm/mach-mx2/crm_regs.h b/arch/arm/mach-mx2/crm_regs.h
index 94644cd0a0fc..749de76b3f95 100644
--- a/arch/arm/mach-mx2/crm_regs.h
+++ b/arch/arm/mach-mx2/crm_regs.h
@@ -38,42 +38,36 @@
38#define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) 38#define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30)
39#define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) 39#define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34)
40 40
41#define CCM_CSCR_USB_OFFSET 28 41#define CCM_CSCR_PRESC_OFFSET 29
42#define CCM_CSCR_USB_MASK (0x7 << 28) 42#define CCM_CSCR_PRESC_MASK (0x7 << CCM_CSCR_PRESC_OFFSET)
43
44#define CCM_CSCR_USB_OFFSET 26
45#define CCM_CSCR_USB_MASK (0x7 << CCM_CSCR_USB_OFFSET)
43#define CCM_CSCR_SD_OFFSET 24 46#define CCM_CSCR_SD_OFFSET 24
44#define CCM_CSCR_SD_MASK (0x3 << 24) 47#define CCM_CSCR_SD_MASK (0x3 << CCM_CSCR_SD_OFFSET)
45#define CCM_CSCR_SSI2 (1 << 23) 48#define CCM_CSCR_SPLLRES (1 << 22)
46#define CCM_CSCR_SSI2_OFFSET 23 49#define CCM_CSCR_MPLLRES (1 << 21)
47#define CCM_CSCR_SSI1 (1 << 22) 50#define CCM_CSCR_SSI2_OFFSET 20
48#define CCM_CSCR_SSI1_OFFSET 22 51#define CCM_CSCR_SSI2 (1 << CCM_CSCR_SSI2_OFFSET)
49#define CCM_CSCR_VPU (1 << 21) 52#define CCM_CSCR_SSI1_OFFSET 19
50#define CCM_CSCR_VPU_OFFSET 21 53#define CCM_CSCR_SSI1 (1 << CCM_CSCR_SSI1_OFFSET)
51#define CCM_CSCR_MSHC (1 << 20) 54#define CCM_CSCR_FIR_OFFSET 18
52#define CCM_CSCR_SPLLRES (1 << 19) 55#define CCM_CSCR_FIR (1 << CCM_CSCR_FIR_OFFSET)
53#define CCM_CSCR_MPLLRES (1 << 18)
54#define CCM_CSCR_SP (1 << 17) 56#define CCM_CSCR_SP (1 << 17)
55#define CCM_CSCR_MCU (1 << 16) 57#define CCM_CSCR_MCU (1 << 16)
56/* CCM_CSCR_ARM_xxx just be avaliable on i.MX27 TO2*/ 58#define CCM_CSCR_BCLK_OFFSET 10
57#define CCM_CSCR_ARM_SRC (1 << 15) 59#define CCM_CSCR_BCLK_MASK (0xf << CCM_CSCR_BCLK_OFFSET)
58#define CCM_CSCR_ARM_OFFSET 12 60#define CCM_CSCR_IPDIV_OFFSET 9
59#define CCM_CSCR_ARM_MASK (0x3 << 12) 61#define CCM_CSCR_IPDIV (1 << CCM_CSCR_IPDIV_OFFSET)
60/* CCM_CSCR_ARM_xxx just be avaliable on i.MX27 TO2*/ 62
61#define CCM_CSCR_PRESC_OFFSET 13
62#define CCM_CSCR_PRESC_MASK (0x7 << 13)
63#define CCM_CSCR_BCLK_OFFSET 9
64#define CCM_CSCR_BCLK_MASK (0xf << 9)
65#define CCM_CSCR_IPDIV_OFFSET 8
66#define CCM_CSCR_IPDIV (1 << 8)
67/* CCM_CSCR_AHB_xxx just be avaliable on i.MX27 TO2*/
68#define CCM_CSCR_AHB_OFFSET 8
69#define CCM_CSCR_AHB_MASK (0x3 << 8)
70/* CCM_CSCR_AHB_xxx just be avaliable on i.MX27 TO2*/
71#define CCM_CSCR_OSC26MDIV (1 << 4) 63#define CCM_CSCR_OSC26MDIV (1 << 4)
72#define CCM_CSCR_OSC26M (1 << 3) 64#define CCM_CSCR_OSC26M (1 << 3)
73#define CCM_CSCR_FPM (1 << 2) 65#define CCM_CSCR_FPM (1 << 2)
74#define CCM_CSCR_SPEN (1 << 1) 66#define CCM_CSCR_SPEN (1 << 1)
75#define CCM_CSCR_MPEN 1 67#define CCM_CSCR_MPEN 1
76 68
69
70
77#define CCM_MPCTL0_CPLM (1 << 31) 71#define CCM_MPCTL0_CPLM (1 << 31)
78#define CCM_MPCTL0_PD_OFFSET 26 72#define CCM_MPCTL0_PD_OFFSET 26
79#define CCM_MPCTL0_PD_MASK (0xf << 26) 73#define CCM_MPCTL0_PD_MASK (0xf << 26)
@@ -109,25 +103,14 @@
109 103
110#define CCM_PCDR0_SSI2BAUDDIV_OFFSET 26 104#define CCM_PCDR0_SSI2BAUDDIV_OFFSET 26
111#define CCM_PCDR0_SSI2BAUDDIV_MASK (0x3f << 26) 105#define CCM_PCDR0_SSI2BAUDDIV_MASK (0x3f << 26)
112#define CCM_PCDR0_CLKO_EN 25
113#define CCM_PCDR0_CLKODIV_OFFSET 22
114#define CCM_PCDR0_CLKODIV_MASK (0x7 << 22)
115#define CCM_PCDR0_SSI1BAUDDIV_OFFSET 16 106#define CCM_PCDR0_SSI1BAUDDIV_OFFSET 16
116#define CCM_PCDR0_SSI1BAUDDIV_MASK (0x3f << 16) 107#define CCM_PCDR0_SSI1BAUDDIV_MASK (0x3f << 16)
117/*The difinition for i.MX27 TO2*/
118#define CCM_PCDR0_VPUDIV2_OFFSET 10
119#define CCM_PCDR0_VPUDIV2_MASK (0x3f << 10)
120#define CCM_PCDR0_NFCDIV2_OFFSET 6
121#define CCM_PCDR0_NFCDIV2_MASK (0xf << 6)
122#define CCM_PCDR0_MSHCDIV2_MASK 0x3f
123/*The difinition for i.MX27 TO2*/
124#define CCM_PCDR0_NFCDIV_OFFSET 12 108#define CCM_PCDR0_NFCDIV_OFFSET 12
125#define CCM_PCDR0_NFCDIV_MASK (0xf << 12) 109#define CCM_PCDR0_NFCDIV_MASK (0xf << 12)
126#define CCM_PCDR0_VPUDIV_OFFSET 8 110#define CCM_PCDR0_48MDIV_OFFSET 5
127#define CCM_PCDR0_VPUDIV_MASK (0xf << 8) 111#define CCM_PCDR0_48MDIV_MASK (0x7 << CCM_PCDR0_48MDIV_OFFSET)
128#define CCM_PCDR0_MSHCDIV_OFFSET 0 112#define CCM_PCDR0_FIRIDIV_OFFSET 0
129#define CCM_PCDR0_MSHCDIV_MASK 0x1f 113#define CCM_PCDR0_FIRIDIV_MASK 0x1f
130
131#define CCM_PCDR1_PERDIV4_OFFSET 24 114#define CCM_PCDR1_PERDIV4_OFFSET 24
132#define CCM_PCDR1_PERDIV4_MASK (0x3f << 24) 115#define CCM_PCDR1_PERDIV4_MASK (0x3f << 24)
133#define CCM_PCDR1_PERDIV3_OFFSET 16 116#define CCM_PCDR1_PERDIV3_OFFSET 16
@@ -137,133 +120,135 @@
137#define CCM_PCDR1_PERDIV1_OFFSET 0 120#define CCM_PCDR1_PERDIV1_OFFSET 0
138#define CCM_PCDR1_PERDIV1_MASK 0x3f 121#define CCM_PCDR1_PERDIV1_MASK 0x3f
139 122
140#define CCM_PCCR0_CSPI1_OFFSET 31 123#define CCM_PCCR_HCLK_CSI_OFFSET 31
141#define CCM_PCCR0_CSPI1_MASK (1 << 31) 124#define CCM_PCCR_HCLK_CSI_REG CCM_PCCR0
142#define CCM_PCCR0_CSPI2_OFFSET 30 125#define CCM_PCCR_HCLK_DMA_OFFSET 30
143#define CCM_PCCR0_CSPI2_MASK (1 << 30) 126#define CCM_PCCR_HCLK_DMA_REG CCM_PCCR0
144#define CCM_PCCR0_CSPI3_OFFSET 29 127#define CCM_PCCR_HCLK_BROM_OFFSET 28
145#define CCM_PCCR0_CSPI3_MASK (1 << 29) 128#define CCM_PCCR_HCLK_BROM_REG CCM_PCCR0
146#define CCM_PCCR0_DMA_OFFSET 28 129#define CCM_PCCR_HCLK_EMMA_OFFSET 27
147#define CCM_PCCR0_DMA_MASK (1 << 28) 130#define CCM_PCCR_HCLK_EMMA_REG CCM_PCCR0
148#define CCM_PCCR0_EMMA_OFFSET 27 131#define CCM_PCCR_HCLK_LCDC_OFFSET 26
149#define CCM_PCCR0_EMMA_MASK (1 << 27) 132#define CCM_PCCR_HCLK_LCDC_REG CCM_PCCR0
150#define CCM_PCCR0_FEC_OFFSET 26 133#define CCM_PCCR_HCLK_SLCDC_OFFSET 25
151#define CCM_PCCR0_FEC_MASK (1 << 26) 134#define CCM_PCCR_HCLK_SLCDC_REG CCM_PCCR0
152#define CCM_PCCR0_GPIO_OFFSET 25 135#define CCM_PCCR_HCLK_USBOTG_OFFSET 24
153#define CCM_PCCR0_GPIO_MASK (1 << 25) 136#define CCM_PCCR_HCLK_USBOTG_REG CCM_PCCR0
154#define CCM_PCCR0_GPT1_OFFSET 24 137#define CCM_PCCR_HCLK_BMI_OFFSET 23
155#define CCM_PCCR0_GPT1_MASK (1 << 24) 138#define CCM_PCCR_BMI_MASK (1 << CCM_PCCR_BMI_MASK)
156#define CCM_PCCR0_GPT2_OFFSET 23 139#define CCM_PCCR_HCLK_BMI_REG CCM_PCCR0
157#define CCM_PCCR0_GPT2_MASK (1 << 23) 140#define CCM_PCCR_PERCLK4_OFFSET 22
158#define CCM_PCCR0_GPT3_OFFSET 22 141#define CCM_PCCR_PERCLK4_REG CCM_PCCR0
159#define CCM_PCCR0_GPT3_MASK (1 << 22) 142#define CCM_PCCR_SLCDC_OFFSET 21
160#define CCM_PCCR0_GPT4_OFFSET 21 143#define CCM_PCCR_SLCDC_REG CCM_PCCR0
161#define CCM_PCCR0_GPT4_MASK (1 << 21) 144#define CCM_PCCR_FIRI_BAUD_OFFSET 20
162#define CCM_PCCR0_GPT5_OFFSET 20 145#define CCM_PCCR_FIRI_BAUD_MASK (1 << CCM_PCCR_FIRI_BAUD_MASK)
163#define CCM_PCCR0_GPT5_MASK (1 << 20) 146#define CCM_PCCR_FIRI_BAUD_REG CCM_PCCR0
164#define CCM_PCCR0_GPT6_OFFSET 19 147#define CCM_PCCR_NFC_OFFSET 19
165#define CCM_PCCR0_GPT6_MASK (1 << 19) 148#define CCM_PCCR_NFC_REG CCM_PCCR0
166#define CCM_PCCR0_I2C1_OFFSET 18 149#define CCM_PCCR_LCDC_OFFSET 18
167#define CCM_PCCR0_I2C1_MASK (1 << 18) 150#define CCM_PCCR_LCDC_REG CCM_PCCR0
168#define CCM_PCCR0_I2C2_OFFSET 17 151#define CCM_PCCR_SSI1_BAUD_OFFSET 17
169#define CCM_PCCR0_I2C2_MASK (1 << 17) 152#define CCM_PCCR_SSI1_BAUD_REG CCM_PCCR0
170#define CCM_PCCR0_IIM_OFFSET 16 153#define CCM_PCCR_SSI2_BAUD_OFFSET 16
171#define CCM_PCCR0_IIM_MASK (1 << 16) 154#define CCM_PCCR_SSI2_BAUD_REG CCM_PCCR0
172#define CCM_PCCR0_KPP_OFFSET 15 155#define CCM_PCCR_EMMA_OFFSET 15
173#define CCM_PCCR0_KPP_MASK (1 << 15) 156#define CCM_PCCR_EMMA_REG CCM_PCCR0
174#define CCM_PCCR0_LCDC_OFFSET 14 157#define CCM_PCCR_USBOTG_OFFSET 14
175#define CCM_PCCR0_LCDC_MASK (1 << 14) 158#define CCM_PCCR_USBOTG_REG CCM_PCCR0
176#define CCM_PCCR0_MSHC_OFFSET 13 159#define CCM_PCCR_DMA_OFFSET 13
177#define CCM_PCCR0_MSHC_MASK (1 << 13) 160#define CCM_PCCR_DMA_REG CCM_PCCR0
178#define CCM_PCCR0_OWIRE_OFFSET 12 161#define CCM_PCCR_I2C1_OFFSET 12
179#define CCM_PCCR0_OWIRE_MASK (1 << 12) 162#define CCM_PCCR_I2C1_REG CCM_PCCR0
180#define CCM_PCCR0_PWM_OFFSET 11 163#define CCM_PCCR_GPIO_OFFSET 11
181#define CCM_PCCR0_PWM_MASK (1 << 11) 164#define CCM_PCCR_GPIO_REG CCM_PCCR0
182#define CCM_PCCR0_RTC_OFFSET 9 165#define CCM_PCCR_SDHC2_OFFSET 10
183#define CCM_PCCR0_RTC_MASK (1 << 9) 166#define CCM_PCCR_SDHC2_REG CCM_PCCR0
184#define CCM_PCCR0_RTIC_OFFSET 8 167#define CCM_PCCR_SDHC1_OFFSET 9
185#define CCM_PCCR0_RTIC_MASK (1 << 8) 168#define CCM_PCCR_SDHC1_REG CCM_PCCR0
186#define CCM_PCCR0_SAHARA_OFFSET 7 169#define CCM_PCCR_FIRI_OFFSET 8
187#define CCM_PCCR0_SAHARA_MASK (1 << 7) 170#define CCM_PCCR_FIRI_MASK (1 << CCM_PCCR_BAUD_MASK)
188#define CCM_PCCR0_SCC_OFFSET 6 171#define CCM_PCCR_FIRI_REG CCM_PCCR0
189#define CCM_PCCR0_SCC_MASK (1 << 6) 172#define CCM_PCCR_SSI2_IPG_OFFSET 7
190#define CCM_PCCR0_SDHC1_OFFSET 5 173#define CCM_PCCR_SSI2_REG CCM_PCCR0
191#define CCM_PCCR0_SDHC1_MASK (1 << 5) 174#define CCM_PCCR_SSI1_IPG_OFFSET 6
192#define CCM_PCCR0_SDHC2_OFFSET 4 175#define CCM_PCCR_SSI1_REG CCM_PCCR0
193#define CCM_PCCR0_SDHC2_MASK (1 << 4) 176#define CCM_PCCR_CSPI2_OFFSET 5
194#define CCM_PCCR0_SDHC3_OFFSET 3 177#define CCM_PCCR_CSPI2_REG CCM_PCCR0
195#define CCM_PCCR0_SDHC3_MASK (1 << 3) 178#define CCM_PCCR_CSPI1_OFFSET 4
196#define CCM_PCCR0_SLCDC_OFFSET 2 179#define CCM_PCCR_CSPI1_REG CCM_PCCR0
197#define CCM_PCCR0_SLCDC_MASK (1 << 2) 180#define CCM_PCCR_UART4_OFFSET 3
198#define CCM_PCCR0_SSI1_IPG_OFFSET 1 181#define CCM_PCCR_UART4_REG CCM_PCCR0
199#define CCM_PCCR0_SSI1_IPG_MASK (1 << 1) 182#define CCM_PCCR_UART3_OFFSET 2
200#define CCM_PCCR0_SSI2_IPG_OFFSET 0 183#define CCM_PCCR_UART3_REG CCM_PCCR0
201#define CCM_PCCR0_SSI2_IPG_MASK (1 << 0) 184#define CCM_PCCR_UART2_OFFSET 1
185#define CCM_PCCR_UART2_REG CCM_PCCR0
186#define CCM_PCCR_UART1_OFFSET 0
187#define CCM_PCCR_UART1_REG CCM_PCCR0
188
189#define CCM_PCCR_OWIRE_OFFSET 31
190#define CCM_PCCR_OWIRE_REG CCM_PCCR1
191#define CCM_PCCR_KPP_OFFSET 30
192#define CCM_PCCR_KPP_REG CCM_PCCR1
193#define CCM_PCCR_RTC_OFFSET 29
194#define CCM_PCCR_RTC_REG CCM_PCCR1
195#define CCM_PCCR_PWM_OFFSET 28
196#define CCM_PCCR_PWM_REG CCM_PCCR1
197#define CCM_PCCR_GPT3_OFFSET 27
198#define CCM_PCCR_GPT3_REG CCM_PCCR1
199#define CCM_PCCR_GPT2_OFFSET 26
200#define CCM_PCCR_GPT2_REG CCM_PCCR1
201#define CCM_PCCR_GPT1_OFFSET 25
202#define CCM_PCCR_GPT1_REG CCM_PCCR1
203#define CCM_PCCR_WDT_OFFSET 24
204#define CCM_PCCR_WDT_REG CCM_PCCR1
205#define CCM_PCCR_CSPI3_OFFSET 23
206#define CCM_PCCR_CSPI3_REG CCM_PCCR1
207
208#define CCM_PCCR_CSPI1_MASK (1 << CCM_PCCR_CSPI1_OFFSET)
209#define CCM_PCCR_CSPI2_MASK (1 << CCM_PCCR_CSPI2_OFFSET)
210#define CCM_PCCR_CSPI3_MASK (1 << CCM_PCCR_CSPI3_OFFSET)
211#define CCM_PCCR_DMA_MASK (1 << CCM_PCCR_DMA_OFFSET)
212#define CCM_PCCR_EMMA_MASK (1 << CCM_PCCR_EMMA_OFFSET)
213#define CCM_PCCR_GPIO_MASK (1 << CCM_PCCR_GPIO_OFFSET)
214#define CCM_PCCR_GPT1_MASK (1 << CCM_PCCR_GPT1_OFFSET)
215#define CCM_PCCR_GPT2_MASK (1 << CCM_PCCR_GPT2_OFFSET)
216#define CCM_PCCR_GPT3_MASK (1 << CCM_PCCR_GPT3_OFFSET)
217#define CCM_PCCR_HCLK_BROM_MASK (1 << CCM_PCCR_HCLK_BROM_OFFSET)
218#define CCM_PCCR_HCLK_CSI_MASK (1 << CCM_PCCR_HCLK_CSI_OFFSET)
219#define CCM_PCCR_HCLK_DMA_MASK (1 << CCM_PCCR_HCLK_DMA_OFFSET)
220#define CCM_PCCR_HCLK_EMMA_MASK (1 << CCM_PCCR_HCLK_EMMA_OFFSET)
221#define CCM_PCCR_HCLK_LCDC_MASK (1 << CCM_PCCR_HCLK_LCDC_OFFSET)
222#define CCM_PCCR_HCLK_SLCDC_MASK (1 << CCM_PCCR_HCLK_SLCDC_OFFSET)
223#define CCM_PCCR_HCLK_USBOTG_MASK (1 << CCM_PCCR_HCLK_USBOTG_OFFSET)
224#define CCM_PCCR_I2C1_MASK (1 << CCM_PCCR_I2C1_OFFSET)
225#define CCM_PCCR_KPP_MASK (1 << CCM_PCCR_KPP_OFFSET)
226#define CCM_PCCR_LCDC_MASK (1 << CCM_PCCR_LCDC_OFFSET)
227#define CCM_PCCR_NFC_MASK (1 << CCM_PCCR_NFC_OFFSET)
228#define CCM_PCCR_OWIRE_MASK (1 << CCM_PCCR_OWIRE_OFFSET)
229#define CCM_PCCR_PERCLK4_MASK (1 << CCM_PCCR_PERCLK4_OFFSET)
230#define CCM_PCCR_PWM_MASK (1 << CCM_PCCR_PWM_OFFSET)
231#define CCM_PCCR_RTC_MASK (1 << CCM_PCCR_RTC_OFFSET)
232#define CCM_PCCR_SDHC1_MASK (1 << CCM_PCCR_SDHC1_OFFSET)
233#define CCM_PCCR_SDHC2_MASK (1 << CCM_PCCR_SDHC2_OFFSET)
234#define CCM_PCCR_SLCDC_MASK (1 << CCM_PCCR_SLCDC_OFFSET)
235#define CCM_PCCR_SSI1_BAUD_MASK (1 << CCM_PCCR_SSI1_BAUD_OFFSET)
236#define CCM_PCCR_SSI1_IPG_MASK (1 << CCM_PCCR_SSI1_IPG_OFFSET)
237#define CCM_PCCR_SSI2_BAUD_MASK (1 << CCM_PCCR_SSI2_BAUD_OFFSET)
238#define CCM_PCCR_SSI2_IPG_MASK (1 << CCM_PCCR_SSI2_IPG_OFFSET)
239#define CCM_PCCR_UART1_MASK (1 << CCM_PCCR_UART1_OFFSET)
240#define CCM_PCCR_UART2_MASK (1 << CCM_PCCR_UART2_OFFSET)
241#define CCM_PCCR_UART3_MASK (1 << CCM_PCCR_UART3_OFFSET)
242#define CCM_PCCR_UART4_MASK (1 << CCM_PCCR_UART4_OFFSET)
243#define CCM_PCCR_USBOTG_MASK (1 << CCM_PCCR_USBOTG_OFFSET)
244#define CCM_PCCR_WDT_MASK (1 << CCM_PCCR_WDT_OFFSET)
202 245
203#define CCM_PCCR1_UART1_OFFSET 31
204#define CCM_PCCR1_UART1_MASK (1 << 31)
205#define CCM_PCCR1_UART2_OFFSET 30
206#define CCM_PCCR1_UART2_MASK (1 << 30)
207#define CCM_PCCR1_UART3_OFFSET 29
208#define CCM_PCCR1_UART3_MASK (1 << 29)
209#define CCM_PCCR1_UART4_OFFSET 28
210#define CCM_PCCR1_UART4_MASK (1 << 28)
211#define CCM_PCCR1_UART5_OFFSET 27
212#define CCM_PCCR1_UART5_MASK (1 << 27)
213#define CCM_PCCR1_UART6_OFFSET 26
214#define CCM_PCCR1_UART6_MASK (1 << 26)
215#define CCM_PCCR1_USBOTG_OFFSET 25
216#define CCM_PCCR1_USBOTG_MASK (1 << 25)
217#define CCM_PCCR1_WDT_OFFSET 24
218#define CCM_PCCR1_WDT_MASK (1 << 24)
219#define CCM_PCCR1_HCLK_ATA_OFFSET 23
220#define CCM_PCCR1_HCLK_ATA_MASK (1 << 23)
221#define CCM_PCCR1_HCLK_BROM_OFFSET 22
222#define CCM_PCCR1_HCLK_BROM_MASK (1 << 22)
223#define CCM_PCCR1_HCLK_CSI_OFFSET 21
224#define CCM_PCCR1_HCLK_CSI_MASK (1 << 21)
225#define CCM_PCCR1_HCLK_DMA_OFFSET 20
226#define CCM_PCCR1_HCLK_DMA_MASK (1 << 20)
227#define CCM_PCCR1_HCLK_EMI_OFFSET 19
228#define CCM_PCCR1_HCLK_EMI_MASK (1 << 19)
229#define CCM_PCCR1_HCLK_EMMA_OFFSET 18
230#define CCM_PCCR1_HCLK_EMMA_MASK (1 << 18)
231#define CCM_PCCR1_HCLK_FEC_OFFSET 17
232#define CCM_PCCR1_HCLK_FEC_MASK (1 << 17)
233#define CCM_PCCR1_HCLK_VPU_OFFSET 16
234#define CCM_PCCR1_HCLK_VPU_MASK (1 << 16)
235#define CCM_PCCR1_HCLK_LCDC_OFFSET 15
236#define CCM_PCCR1_HCLK_LCDC_MASK (1 << 15)
237#define CCM_PCCR1_HCLK_RTIC_OFFSET 14
238#define CCM_PCCR1_HCLK_RTIC_MASK (1 << 14)
239#define CCM_PCCR1_HCLK_SAHARA_OFFSET 13
240#define CCM_PCCR1_HCLK_SAHARA_MASK (1 << 13)
241#define CCM_PCCR1_HCLK_SLCDC_OFFSET 12
242#define CCM_PCCR1_HCLK_SLCDC_MASK (1 << 12)
243#define CCM_PCCR1_HCLK_USBOTG_OFFSET 11
244#define CCM_PCCR1_HCLK_USBOTG_MASK (1 << 11)
245#define CCM_PCCR1_PERCLK1_OFFSET 10
246#define CCM_PCCR1_PERCLK1_MASK (1 << 10)
247#define CCM_PCCR1_PERCLK2_OFFSET 9
248#define CCM_PCCR1_PERCLK2_MASK (1 << 9)
249#define CCM_PCCR1_PERCLK3_OFFSET 8
250#define CCM_PCCR1_PERCLK3_MASK (1 << 8)
251#define CCM_PCCR1_PERCLK4_OFFSET 7
252#define CCM_PCCR1_PERCLK4_MASK (1 << 7)
253#define CCM_PCCR1_VPU_BAUD_OFFSET 6
254#define CCM_PCCR1_VPU_BAUD_MASK (1 << 6)
255#define CCM_PCCR1_SSI1_BAUD_OFFSET 5
256#define CCM_PCCR1_SSI1_BAUD_MASK (1 << 5)
257#define CCM_PCCR1_SSI2_BAUD_OFFSET 4
258#define CCM_PCCR1_SSI2_BAUD_MASK (1 << 4)
259#define CCM_PCCR1_NFC_BAUD_OFFSET 3
260#define CCM_PCCR1_NFC_BAUD_MASK (1 << 3)
261#define CCM_PCCR1_MSHC_BAUD_OFFSET 2
262#define CCM_PCCR1_MSHC_BAUD_MASK (1 << 2)
263 246
264#define CCM_CCSR_32KSR (1 << 15) 247#define CCM_CCSR_32KSR (1 << 15)
248
265#define CCM_CCSR_CLKMODE1 (1 << 9) 249#define CCM_CCSR_CLKMODE1 (1 << 9)
266#define CCM_CCSR_CLKMODE0 (1 << 8) 250#define CCM_CCSR_CLKMODE0 (1 << 8)
251
267#define CCM_CCSR_CLKOSEL_OFFSET 0 252#define CCM_CCSR_CLKOSEL_OFFSET 0
268#define CCM_CCSR_CLKOSEL_MASK 0x1f 253#define CCM_CCSR_CLKOSEL_MASK 0x1f
269 254
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 2f9240be1c76..a0f1b3674327 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -34,6 +34,10 @@
34 34
35#include <mach/irqs.h> 35#include <mach/irqs.h>
36#include <mach/hardware.h> 36#include <mach/hardware.h>
37#include <mach/common.h>
38#include <mach/mmc.h>
39
40#include "devices.h"
37 41
38/* 42/*
39 * Resource definition for the MXC IrDA 43 * Resource definition for the MXC IrDA
@@ -225,37 +229,215 @@ struct platform_device mxc_nand_device = {
225 .resource = mxc_nand_resources, 229 .resource = mxc_nand_resources,
226}; 230};
227 231
232/*
233 * lcdc:
234 * - i.MX1: the basic controller
235 * - i.MX21: to be checked
236 * - i.MX27: like i.MX1, with slightly variations
237 */
238static struct resource mxc_fb[] = {
239 {
240 .start = LCDC_BASE_ADDR,
241 .end = LCDC_BASE_ADDR + 0xFFF,
242 .flags = IORESOURCE_MEM,
243 },
244 {
245 .start = MXC_INT_LCDC,
246 .end = MXC_INT_LCDC,
247 .flags = IORESOURCE_IRQ,
248 }
249};
250
251/* mxc lcd driver */
252struct platform_device mxc_fb_device = {
253 .name = "imx-fb",
254 .id = 0,
255 .num_resources = ARRAY_SIZE(mxc_fb),
256 .resource = mxc_fb,
257 .dev = {
258 .coherent_dma_mask = 0xFFFFFFFF,
259 },
260};
261
262#ifdef CONFIG_MACH_MX27
263static struct resource mxc_fec_resources[] = {
264 {
265 .start = FEC_BASE_ADDR,
266 .end = FEC_BASE_ADDR + 0xfff,
267 .flags = IORESOURCE_MEM
268 }, {
269 .start = MXC_INT_FEC,
270 .end = MXC_INT_FEC,
271 .flags = IORESOURCE_IRQ
272 },
273};
274
275struct platform_device mxc_fec_device = {
276 .name = "fec",
277 .id = 0,
278 .num_resources = ARRAY_SIZE(mxc_fec_resources),
279 .resource = mxc_fec_resources,
280};
281#endif
282
283static struct resource mxc_i2c_1_resources[] = {
284 [0] = {
285 .start = I2C_BASE_ADDR,
286 .end = I2C_BASE_ADDR + 0x0fff,
287 .flags = IORESOURCE_MEM
288 },
289 [1] = {
290 .start = MXC_INT_I2C,
291 .end = MXC_INT_I2C,
292 .flags = IORESOURCE_IRQ
293 }
294};
295
296struct platform_device mxc_i2c_device0 = {
297 .name = "imx-i2c",
298 .id = 0,
299 .num_resources = ARRAY_SIZE(mxc_i2c_1_resources),
300 .resource = mxc_i2c_1_resources
301};
302
303#ifdef CONFIG_MACH_MX27
304static struct resource mxc_i2c_2_resources[] = {
305 [0] = {
306 .start = I2C2_BASE_ADDR,
307 .end = I2C2_BASE_ADDR + 0x0fff,
308 .flags = IORESOURCE_MEM
309 },
310 [1] = {
311 .start = MXC_INT_I2C2,
312 .end = MXC_INT_I2C2,
313 .flags = IORESOURCE_IRQ
314 }
315};
316
317struct platform_device mxc_i2c_device1 = {
318 .name = "imx-i2c",
319 .id = 1,
320 .num_resources = ARRAY_SIZE(mxc_i2c_2_resources),
321 .resource = mxc_i2c_2_resources
322};
323#endif
324
325static struct resource mxc_pwm_resources[] = {
326 [0] = {
327 .start = PWM_BASE_ADDR,
328 .end = PWM_BASE_ADDR + 0x0fff,
329 .flags = IORESOURCE_MEM
330 },
331 [1] = {
332 .start = MXC_INT_PWM,
333 .end = MXC_INT_PWM,
334 .flags = IORESOURCE_IRQ,
335 }
336};
337
338struct platform_device mxc_pwm_device = {
339 .name = "mxc_pwm",
340 .id = 0,
341 .num_resources = ARRAY_SIZE(mxc_pwm_resources),
342 .resource = mxc_pwm_resources
343};
344
345/*
346 * Resource definition for the MXC SDHC
347 */
348static struct resource mxc_sdhc1_resources[] = {
349 [0] = {
350 .start = SDHC1_BASE_ADDR,
351 .end = SDHC1_BASE_ADDR + SZ_4K - 1,
352 .flags = IORESOURCE_MEM,
353 },
354 [1] = {
355 .start = MXC_INT_SDHC1,
356 .end = MXC_INT_SDHC1,
357 .flags = IORESOURCE_IRQ,
358 },
359 [2] = {
360 .start = DMA_REQ_SDHC1,
361 .end = DMA_REQ_SDHC1,
362 .flags = IORESOURCE_DMA
363 },
364};
365
366static u64 mxc_sdhc1_dmamask = 0xffffffffUL;
367
368struct platform_device mxc_sdhc_device0 = {
369 .name = "mxc-mmc",
370 .id = 0,
371 .dev = {
372 .dma_mask = &mxc_sdhc1_dmamask,
373 .coherent_dma_mask = 0xffffffff,
374 },
375 .num_resources = ARRAY_SIZE(mxc_sdhc1_resources),
376 .resource = mxc_sdhc1_resources,
377};
378
379static struct resource mxc_sdhc2_resources[] = {
380 [0] = {
381 .start = SDHC2_BASE_ADDR,
382 .end = SDHC2_BASE_ADDR + SZ_4K - 1,
383 .flags = IORESOURCE_MEM,
384 },
385 [1] = {
386 .start = MXC_INT_SDHC2,
387 .end = MXC_INT_SDHC2,
388 .flags = IORESOURCE_IRQ,
389 },
390 [2] = {
391 .start = DMA_REQ_SDHC2,
392 .end = DMA_REQ_SDHC2,
393 .flags = IORESOURCE_DMA
394 },
395};
396
397static u64 mxc_sdhc2_dmamask = 0xffffffffUL;
398
399struct platform_device mxc_sdhc_device1 = {
400 .name = "mxc-mmc",
401 .id = 1,
402 .dev = {
403 .dma_mask = &mxc_sdhc2_dmamask,
404 .coherent_dma_mask = 0xffffffff,
405 },
406 .num_resources = ARRAY_SIZE(mxc_sdhc2_resources),
407 .resource = mxc_sdhc2_resources,
408};
409
228/* GPIO port description */ 410/* GPIO port description */
229static struct mxc_gpio_port imx_gpio_ports[] = { 411static struct mxc_gpio_port imx_gpio_ports[] = {
230 [0] = { 412 [0] = {
231 .chip.label = "gpio-0", 413 .chip.label = "gpio-0",
232 .irq = MXC_INT_GPIO, 414 .irq = MXC_INT_GPIO,
233 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 0), 415 .base = IO_ADDRESS(GPIO_BASE_ADDR),
234 .virtual_irq_start = MXC_GPIO_IRQ_START, 416 .virtual_irq_start = MXC_GPIO_IRQ_START,
235 }, 417 },
236 [1] = { 418 [1] = {
237 .chip.label = "gpio-1", 419 .chip.label = "gpio-1",
238 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 1), 420 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
239 .virtual_irq_start = MXC_GPIO_IRQ_START + 32, 421 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
240 }, 422 },
241 [2] = { 423 [2] = {
242 .chip.label = "gpio-2", 424 .chip.label = "gpio-2",
243 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 2), 425 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
244 .virtual_irq_start = MXC_GPIO_IRQ_START + 64, 426 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
245 }, 427 },
246 [3] = { 428 [3] = {
247 .chip.label = "gpio-3", 429 .chip.label = "gpio-3",
248 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 3), 430 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
249 .virtual_irq_start = MXC_GPIO_IRQ_START + 96, 431 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
250 }, 432 },
251 [4] = { 433 [4] = {
252 .chip.label = "gpio-4", 434 .chip.label = "gpio-4",
253 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 4), 435 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x400),
254 .virtual_irq_start = MXC_GPIO_IRQ_START + 128, 436 .virtual_irq_start = MXC_GPIO_IRQ_START + 128,
255 }, 437 },
256 [5] = { 438 [5] = {
257 .chip.label = "gpio-5", 439 .chip.label = "gpio-5",
258 .base = (void*)(AIPI_BASE_ADDR_VIRT + 0x15000 + 0x100 * 5), 440 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x500),
259 .virtual_irq_start = MXC_GPIO_IRQ_START + 160, 441 .virtual_irq_start = MXC_GPIO_IRQ_START + 160,
260 } 442 }
261}; 443};
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index 1e8cb577a642..049005bb6aa9 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -1,4 +1,3 @@
1
2extern struct platform_device mxc_gpt1; 1extern struct platform_device mxc_gpt1;
3extern struct platform_device mxc_gpt2; 2extern struct platform_device mxc_gpt2;
4extern struct platform_device mxc_gpt3; 3extern struct platform_device mxc_gpt3;
@@ -14,3 +13,10 @@ extern struct platform_device mxc_uart_device4;
14extern struct platform_device mxc_uart_device5; 13extern struct platform_device mxc_uart_device5;
15extern struct platform_device mxc_w1_master_device; 14extern struct platform_device mxc_w1_master_device;
16extern struct platform_device mxc_nand_device; 15extern struct platform_device mxc_nand_device;
16extern struct platform_device mxc_fb_device;
17extern struct platform_device mxc_fec_device;
18extern struct platform_device mxc_pwm_device;
19extern struct platform_device mxc_i2c_device0;
20extern struct platform_device mxc_i2c_device1;
21extern struct platform_device mxc_sdhc_device0;
22extern struct platform_device mxc_sdhc_device1;
diff --git a/arch/arm/mach-mx2/generic.c b/arch/arm/mach-mx2/generic.c
index dea6521d4d5c..bd51dd04948e 100644
--- a/arch/arm/mach-mx2/generic.c
+++ b/arch/arm/mach-mx2/generic.c
@@ -21,6 +21,7 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/common.h>
24#include <asm/pgtable.h> 25#include <asm/pgtable.h>
25#include <asm/mach/map.h> 26#include <asm/mach/map.h>
26 27
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c
index 2b5c67f54571..4a3b097adc12 100644
--- a/arch/arm/mach-mx2/mx27ads.c
+++ b/arch/arm/mach-mx2/mx27ads.c
@@ -31,7 +31,7 @@
31#include <asm/mach/map.h> 31#include <asm/mach/map.h>
32#include <mach/gpio.h> 32#include <mach/gpio.h>
33#include <mach/imx-uart.h> 33#include <mach/imx-uart.h>
34#include <mach/iomux-mx1-mx2.h> 34#include <mach/iomux.h>
35#include <mach/board-mx27ads.h> 35#include <mach/board-mx27ads.h>
36 36
37#include "devices.h" 37#include "devices.h"
@@ -135,6 +135,7 @@ static int uart_mxc_port3_exit(struct platform_device *pdev)
135{ 135{
136 mxc_gpio_release_multiple_pins(mxc_uart3_pins, 136 mxc_gpio_release_multiple_pins(mxc_uart3_pins,
137 ARRAY_SIZE(mxc_uart3_pins)); 137 ARRAY_SIZE(mxc_uart3_pins));
138 return 0;
138} 139}
139 140
140static int mxc_uart4_pins[] = { 141static int mxc_uart4_pins[] = {
@@ -179,6 +180,7 @@ static int uart_mxc_port5_exit(struct platform_device *pdev)
179 180
180static struct platform_device *platform_devices[] __initdata = { 181static struct platform_device *platform_devices[] __initdata = {
181 &mx27ads_nor_mtd_device, 182 &mx27ads_nor_mtd_device,
183 &mxc_fec_device,
182}; 184};
183 185
184static int mxc_fec_pins[] = { 186static int mxc_fec_pins[] = {
@@ -196,7 +198,7 @@ static int mxc_fec_pins[] = {
196 PD11_AOUT_FEC_TX_CLK, 198 PD11_AOUT_FEC_TX_CLK,
197 PD12_AOUT_FEC_RXD0, 199 PD12_AOUT_FEC_RXD0,
198 PD13_AOUT_FEC_RX_DV, 200 PD13_AOUT_FEC_RX_DV,
199 PD14_AOUT_FEC_CLR, 201 PD14_AOUT_FEC_RX_CLK,
200 PD15_AOUT_FEC_COL, 202 PD15_AOUT_FEC_COL,
201 PD16_AIN_FEC_TX_ER, 203 PD16_AIN_FEC_TX_ER,
202 PF23_AIN_FEC_TX_EN 204 PF23_AIN_FEC_TX_EN
@@ -208,12 +210,6 @@ static void gpio_fec_active(void)
208 ARRAY_SIZE(mxc_fec_pins), "FEC"); 210 ARRAY_SIZE(mxc_fec_pins), "FEC");
209} 211}
210 212
211static void gpio_fec_inactive(void)
212{
213 mxc_gpio_release_multiple_pins(mxc_fec_pins,
214 ARRAY_SIZE(mxc_fec_pins));
215}
216
217static struct imxuart_platform_data uart_pdata[] = { 213static struct imxuart_platform_data uart_pdata[] = {
218 { 214 {
219 .init = uart_mxc_port0_init, 215 .init = uart_mxc_port0_init,
@@ -263,11 +259,10 @@ static void __init mx27ads_timer_init(void)
263 if ((__raw_readw(PBC_VERSION_REG) & CKIH_27MHZ_BIT_SET) == 0) 259 if ((__raw_readw(PBC_VERSION_REG) & CKIH_27MHZ_BIT_SET) == 0)
264 fref = 27000000; 260 fref = 27000000;
265 261
266 mxc_clocks_init(fref); 262 mx27_clocks_init(fref);
267 mxc_timer_init("gpt_clk.0");
268} 263}
269 264
270struct sys_timer mx27ads_timer = { 265static struct sys_timer mx27ads_timer = {
271 .init = mx27ads_timer_init, 266 .init = mx27ads_timer_init,
272}; 267};
273 268
@@ -280,7 +275,7 @@ static struct map_desc mx27ads_io_desc[] __initdata = {
280 }, 275 },
281}; 276};
282 277
283void __init mx27ads_map_io(void) 278static void __init mx27ads_map_io(void)
284{ 279{
285 mxc_map_io(); 280 mxc_map_io();
286 iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc)); 281 iotable_init(mx27ads_io_desc, ARRAY_SIZE(mx27ads_io_desc));
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c
index dfd4156da7d5..aa4eaa61d1b5 100644
--- a/arch/arm/mach-mx2/pcm038.c
+++ b/arch/arm/mach-mx2/pcm038.c
@@ -20,11 +20,18 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
22#include <linux/mtd/plat-ram.h> 22#include <linux/mtd/plat-ram.h>
23#include <linux/io.h>
24#include <linux/i2c.h>
25#include <linux/i2c/at24.h>
26
23#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
24#include <asm/mach-types.h> 28#include <asm/mach-types.h>
25#include <mach/common.h> 29#include <mach/common.h>
26#include <mach/hardware.h> 30#include <mach/hardware.h>
27#include <mach/iomux-mx1-mx2.h> 31#include <mach/iomux.h>
32#ifdef CONFIG_I2C_IMX
33#include <mach/i2c.h>
34#endif
28#include <asm/mach/time.h> 35#include <asm/mach/time.h>
29#include <mach/imx-uart.h> 36#include <mach/imx-uart.h>
30#include <mach/board-pcm038.h> 37#include <mach/board-pcm038.h>
@@ -121,10 +128,10 @@ static int uart_mxc_port1_exit(struct platform_device *pdev)
121 return 0; 128 return 0;
122} 129}
123 130
124static int mxc_uart2_pins[] = { PE10_PF_UART3_CTS, 131static int mxc_uart2_pins[] = { PE8_PF_UART3_TXD,
125 PE9_PF_UART3_RXD, 132 PE9_PF_UART3_RXD,
126 PE10_PF_UART3_CTS, 133 PE10_PF_UART3_CTS,
127 PE9_PF_UART3_RXD }; 134 PE11_PF_UART3_RTS };
128 135
129static int uart_mxc_port2_init(struct platform_device *pdev) 136static int uart_mxc_port2_init(struct platform_device *pdev)
130{ 137{
@@ -170,7 +177,7 @@ static int mxc_fec_pins[] = {
170 PD11_AOUT_FEC_TX_CLK, 177 PD11_AOUT_FEC_TX_CLK,
171 PD12_AOUT_FEC_RXD0, 178 PD12_AOUT_FEC_RXD0,
172 PD13_AOUT_FEC_RX_DV, 179 PD13_AOUT_FEC_RX_DV,
173 PD14_AOUT_FEC_CLR, 180 PD14_AOUT_FEC_RX_CLK,
174 PD15_AOUT_FEC_COL, 181 PD15_AOUT_FEC_COL,
175 PD16_AIN_FEC_TX_ER, 182 PD16_AIN_FEC_TX_ER,
176 PF23_AIN_FEC_TX_EN 183 PF23_AIN_FEC_TX_EN
@@ -182,12 +189,6 @@ static void gpio_fec_active(void)
182 ARRAY_SIZE(mxc_fec_pins), "FEC"); 189 ARRAY_SIZE(mxc_fec_pins), "FEC");
183} 190}
184 191
185static void gpio_fec_inactive(void)
186{
187 mxc_gpio_release_multiple_pins(mxc_fec_pins,
188 ARRAY_SIZE(mxc_fec_pins));
189}
190
191static struct mxc_nand_platform_data pcm038_nand_board_info = { 192static struct mxc_nand_platform_data pcm038_nand_board_info = {
192 .width = 1, 193 .width = 1,
193 .hw_ecc = 1, 194 .hw_ecc = 1,
@@ -196,6 +197,7 @@ static struct mxc_nand_platform_data pcm038_nand_board_info = {
196static struct platform_device *platform_devices[] __initdata = { 197static struct platform_device *platform_devices[] __initdata = {
197 &pcm038_nor_mtd_device, 198 &pcm038_nor_mtd_device,
198 &mxc_w1_master_device, 199 &mxc_w1_master_device,
200 &mxc_fec_device,
199 &pcm038_sram_mtd_device, 201 &pcm038_sram_mtd_device,
200}; 202};
201 203
@@ -208,6 +210,51 @@ static void __init pcm038_init_sram(void)
208 __raw_writel(0x22220a00, CSCR_A(1)); 210 __raw_writel(0x22220a00, CSCR_A(1));
209} 211}
210 212
213#ifdef CONFIG_I2C_IMX
214static int mxc_i2c1_pins[] = {
215 PC5_PF_I2C2_SDA,
216 PC6_PF_I2C2_SCL
217};
218
219static int pcm038_i2c_1_init(struct device *dev)
220{
221 return mxc_gpio_setup_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins),
222 "I2C1");
223}
224
225static void pcm038_i2c_1_exit(struct device *dev)
226{
227 mxc_gpio_release_multiple_pins(mxc_i2c1_pins, ARRAY_SIZE(mxc_i2c1_pins));
228}
229
230static struct imxi2c_platform_data pcm038_i2c_1_data = {
231 .bitrate = 100000,
232 .init = pcm038_i2c_1_init,
233 .exit = pcm038_i2c_1_exit,
234};
235
236static struct at24_platform_data board_eeprom = {
237 .byte_len = 4096,
238 .page_size = 32,
239 .flags = AT24_FLAG_ADDR16,
240};
241
242static struct i2c_board_info pcm038_i2c_devices[] = {
243 [0] = {
244 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
245 .platform_data = &board_eeprom,
246 },
247 [1] = {
248 I2C_BOARD_INFO("rtc-pcf8563", 0x51),
249 .type = "pcf8563"
250 },
251 [2] = {
252 I2C_BOARD_INFO("lm75", 0x4a),
253 .type = "lm75"
254 }
255};
256#endif
257
211static void __init pcm038_init(void) 258static void __init pcm038_init(void)
212{ 259{
213 gpio_fec_active(); 260 gpio_fec_active();
@@ -217,9 +264,17 @@ static void __init pcm038_init(void)
217 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); 264 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
218 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); 265 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
219 266
220 mxc_gpio_mode(PE16_AF_RTCK); /* OWIRE */ 267 mxc_gpio_mode(PE16_AF_OWIRE);
221 mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info); 268 mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info);
222 269
270#ifdef CONFIG_I2C_IMX
271 /* only the i2c master 1 is used on this CPU card */
272 i2c_register_board_info(1, pcm038_i2c_devices,
273 ARRAY_SIZE(pcm038_i2c_devices));
274
275 mxc_register_device(&mxc_i2c_device1, &pcm038_i2c_1_data);
276#endif
277
223 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 278 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
224 279
225#ifdef CONFIG_MACH_PCM970_BASEBOARD 280#ifdef CONFIG_MACH_PCM970_BASEBOARD
@@ -229,11 +284,10 @@ static void __init pcm038_init(void)
229 284
230static void __init pcm038_timer_init(void) 285static void __init pcm038_timer_init(void)
231{ 286{
232 mxc_clocks_init(26000000); 287 mx27_clocks_init(26000000);
233 mxc_timer_init("gpt_clk.0");
234} 288}
235 289
236struct sys_timer pcm038_timer = { 290static struct sys_timer pcm038_timer = {
237 .init = pcm038_timer_init, 291 .init = pcm038_timer_init,
238}; 292};
239 293
diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c
index a560cd6ad23d..bf4e520bc1bc 100644
--- a/arch/arm/mach-mx2/pcm970-baseboard.c
+++ b/arch/arm/mach-mx2/pcm970-baseboard.c
@@ -17,9 +17,138 @@
17 */ 17 */
18 18
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <mach/hardware.h> 20#include <linux/gpio.h>
21#include <linux/irq.h>
22
21#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
22 24
25#include <mach/hardware.h>
26#include <mach/common.h>
27#include <mach/mmc.h>
28#include <mach/imxfb.h>
29#include <mach/iomux.h>
30
31#include "devices.h"
32
33static int pcm970_sdhc2_get_ro(struct device *dev)
34{
35 return gpio_get_value(GPIO_PORTC + 28);
36}
37
38static int pcm970_sdhc2_pins[] = {
39 PB4_PF_SD2_D0,
40 PB5_PF_SD2_D1,
41 PB6_PF_SD2_D2,
42 PB7_PF_SD2_D3,
43 PB8_PF_SD2_CMD,
44 PB9_PF_SD2_CLK,
45};
46
47static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void *data)
48{
49 int ret;
50
51 ret = mxc_gpio_setup_multiple_pins(pcm970_sdhc2_pins,
52 ARRAY_SIZE(pcm970_sdhc2_pins), "sdhc2");
53 if(ret)
54 return ret;
55
56 ret = request_irq(IRQ_GPIOC(29), detect_irq, 0,
57 "imx-mmc-detect", data);
58 if (ret)
59 goto out_release_gpio;
60
61 set_irq_type(IRQ_GPIOC(29), IRQF_TRIGGER_FALLING);
62
63 ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro");
64 if (ret)
65 goto out_release_gpio;
66
67 mxc_gpio_mode((GPIO_PORTC | 28) | GPIO_GPIO | GPIO_IN);
68 gpio_direction_input(GPIO_PORTC + 28);
69
70 return 0;
71
72out_release_gpio:
73 mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins,
74 ARRAY_SIZE(pcm970_sdhc2_pins));
75 return ret;
76}
77
78static void pcm970_sdhc2_exit(struct device *dev, void *data)
79{
80 free_irq(IRQ_GPIOC(29), data);
81 gpio_free(GPIO_PORTC + 28);
82 mxc_gpio_release_multiple_pins(pcm970_sdhc2_pins,
83 ARRAY_SIZE(pcm970_sdhc2_pins));
84}
85
86static struct imxmmc_platform_data sdhc_pdata = {
87 .get_ro = pcm970_sdhc2_get_ro,
88 .init = pcm970_sdhc2_init,
89 .exit = pcm970_sdhc2_exit,
90};
91
92static int mxc_fb_pins[] = {
93 PA5_PF_LSCLK, PA6_PF_LD0, PA7_PF_LD1, PA8_PF_LD2,
94 PA9_PF_LD3, PA10_PF_LD4, PA11_PF_LD5, PA12_PF_LD6,
95 PA13_PF_LD7, PA14_PF_LD8, PA15_PF_LD9, PA16_PF_LD10,
96 PA17_PF_LD11, PA18_PF_LD12, PA19_PF_LD13, PA20_PF_LD14,
97 PA21_PF_LD15, PA22_PF_LD16, PA23_PF_LD17, PA24_PF_REV,
98 PA25_PF_CLS, PA26_PF_PS, PA27_PF_SPL_SPR, PA28_PF_HSYNC,
99 PA29_PF_VSYNC, PA30_PF_CONTRAST, PA31_PF_OE_ACD
100};
101
102static int pcm038_fb_init(struct platform_device *pdev)
103{
104 return mxc_gpio_setup_multiple_pins(mxc_fb_pins,
105 ARRAY_SIZE(mxc_fb_pins), "FB");
106}
107
108static int pcm038_fb_exit(struct platform_device *pdev)
109{
110 mxc_gpio_release_multiple_pins(mxc_fb_pins, ARRAY_SIZE(mxc_fb_pins));
111
112 return 0;
113}
114
115/*
116 * Connected is a portrait Sharp-QVGA display
117 * of type: LQ035Q7DH06
118 */
119static struct imx_fb_platform_data pcm038_fb_data = {
120 .pixclock = 188679, /* in ps (5.3MHz) */
121 .xres = 240,
122 .yres = 320,
123
124 .bpp = 16,
125 .hsync_len = 7,
126 .left_margin = 5,
127 .right_margin = 16,
128
129 .vsync_len = 1,
130 .upper_margin = 7,
131 .lower_margin = 9,
132 .fixed_screen_cpu = 0,
133
134 /*
135 * - HSYNC active high
136 * - VSYNC active high
137 * - clk notenabled while idle
138 * - clock not inverted
139 * - data not inverted
140 * - data enable low active
141 * - enable sharp mode
142 */
143 .pcr = 0xFA0080C0,
144 .pwmr = 0x00A903FF,
145 .lscr1 = 0x00120300,
146 .dmacr = 0x00020010,
147
148 .init = pcm038_fb_init,
149 .exit = pcm038_fb_exit,
150};
151
23/* 152/*
24 * system init for baseboard usage. Will be called by pcm038 init. 153 * system init for baseboard usage. Will be called by pcm038 init.
25 * 154 *
@@ -28,4 +157,6 @@
28 */ 157 */
29void __init pcm970_baseboard_init(void) 158void __init pcm970_baseboard_init(void)
30{ 159{
160 mxc_register_device(&mxc_fb_device, &pcm038_fb_data);
161 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
31} 162}
diff --git a/arch/arm/mach-mx2/serial.c b/arch/arm/mach-mx2/serial.c
index 16debc296dad..40a485cdc10e 100644
--- a/arch/arm/mach-mx2/serial.c
+++ b/arch/arm/mach-mx2/serial.c
@@ -22,6 +22,7 @@
22#include <linux/serial.h> 22#include <linux/serial.h>
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/imx-uart.h> 24#include <mach/imx-uart.h>
25#include "devices.h"
25 26
26static struct resource uart0[] = { 27static struct resource uart0[] = {
27 { 28 {
@@ -99,6 +100,7 @@ struct platform_device mxc_uart_device3 = {
99 .num_resources = ARRAY_SIZE(uart3), 100 .num_resources = ARRAY_SIZE(uart3),
100}; 101};
101 102
103#ifdef CONFIG_MACH_MX27
102static struct resource uart4[] = { 104static struct resource uart4[] = {
103 { 105 {
104 .start = UART5_BASE_ADDR, 106 .start = UART5_BASE_ADDR,
@@ -136,3 +138,4 @@ struct platform_device mxc_uart_device5 = {
136 .resource = uart5, 138 .resource = uart5,
137 .num_resources = ARRAY_SIZE(uart5), 139 .num_resources = ARRAY_SIZE(uart5),
138}; 140};
141#endif
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index e79659e8176e..d6235583e979 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -1,21 +1,40 @@
1menu "MX3 Options" 1if ARCH_MX3
2 depends on ARCH_MX3 2
3config ARCH_MX31
4 bool
5
6config ARCH_MX35
7 bool
8
9comment "MX3 platforms:"
3 10
4config MACH_MX31ADS 11config MACH_MX31ADS
5 bool "Support MX31ADS platforms" 12 bool "Support MX31ADS platforms"
13 select ARCH_MX31
6 default y 14 default y
7 help 15 help
8 Include support for MX31ADS platform. This includes specific 16 Include support for MX31ADS platform. This includes specific
9 configurations for the board and its peripherals. 17 configurations for the board and its peripherals.
10 18
19config MACH_MX31ADS_WM1133_EV1
20 bool "Support Wolfson Microelectronics 1133-EV1 module"
21 depends on MACH_MX31ADS
22 select MFD_WM8350_CONFIG_MODE_0
23 select MFD_WM8352_CONFIG_MODE_0
24 help
25 Include support for the Wolfson Microelectronics 1133-EV1 PMU
26 and audio module for the MX31ADS platform.
27
11config MACH_PCM037 28config MACH_PCM037
12 bool "Support Phytec pcm037 platforms" 29 bool "Support Phytec pcm037 (i.MX31) platforms"
30 select ARCH_MX31
13 help 31 help
14 Include support for Phytec pcm037 platform. This includes 32 Include support for Phytec pcm037 platform. This includes
15 specific configurations for the board and its peripherals. 33 specific configurations for the board and its peripherals.
16 34
17config MACH_MX31LITE 35config MACH_MX31LITE
18 bool "Support MX31 LITEKIT (LogicPD)" 36 bool "Support MX31 LITEKIT (LogicPD)"
37 select ARCH_MX31
19 default n 38 default n
20 help 39 help
21 Include support for MX31 LITEKIT platform. This includes specific 40 Include support for MX31 LITEKIT platform. This includes specific
@@ -23,6 +42,7 @@ config MACH_MX31LITE
23 42
24config MACH_MX31_3DS 43config MACH_MX31_3DS
25 bool "Support MX31PDK (3DS)" 44 bool "Support MX31PDK (3DS)"
45 select ARCH_MX31
26 default n 46 default n
27 help 47 help
28 Include support for MX31PDK (3DS) platform. This includes specific 48 Include support for MX31PDK (3DS) platform. This includes specific
@@ -30,10 +50,18 @@ config MACH_MX31_3DS
30 50
31config MACH_MX31MOBOARD 51config MACH_MX31MOBOARD
32 bool "Support mx31moboard platforms (EPFL Mobots group)" 52 bool "Support mx31moboard platforms (EPFL Mobots group)"
53 select ARCH_MX31
33 default n 54 default n
34 help 55 help
35 Include support for mx31moboard platform. This includes specific 56 Include support for mx31moboard platform. This includes specific
36 configurations for the board and its peripherals. 57 configurations for the board and its peripherals.
37 58
38endmenu 59config MACH_QONG
60 bool "Support Dave/DENX QongEVB-LITE platform"
61 select ARCH_MX31
62 default n
63 help
64 Include support for Dave/DENX QongEVB-LITE platform. This includes
65 specific configurations for the board and its peripherals.
39 66
67endif
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 5a151540fe83..272c8a953b30 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -4,9 +4,13 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := mm.o clock.o devices.o iomux.o 7obj-y := mm.o devices.o
8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o
9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
8obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o 10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o
9obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o 11obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o
10obj-$(CONFIG_MACH_PCM037) += pcm037.o 12obj-$(CONFIG_MACH_PCM037) += pcm037.o
11obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 13obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o
12obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o 14obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \
15 mx31moboard-marxbot.o
16obj-$(CONFIG_MACH_QONG) += qong.o
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
new file mode 100644
index 000000000000..53a112d4e04a
--- /dev/null
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -0,0 +1,487 @@
1/*
2 * Copyright (C) 2009 by Sascha Hauer, Pengutronix
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/list.h>
22#include <linux/clk.h>
23#include <linux/io.h>
24
25#include <asm/clkdev.h>
26
27#include <mach/clock.h>
28#include <mach/hardware.h>
29#include <mach/common.h>
30
31#define CCM_BASE IO_ADDRESS(CCM_BASE_ADDR)
32
33#define CCM_CCMR 0x00
34#define CCM_PDR0 0x04
35#define CCM_PDR1 0x08
36#define CCM_PDR2 0x0C
37#define CCM_PDR3 0x10
38#define CCM_PDR4 0x14
39#define CCM_RCSR 0x18
40#define CCM_MPCTL 0x1C
41#define CCM_PPCTL 0x20
42#define CCM_ACMR 0x24
43#define CCM_COSR 0x28
44#define CCM_CGR0 0x2C
45#define CCM_CGR1 0x30
46#define CCM_CGR2 0x34
47#define CCM_CGR3 0x38
48
49#ifdef HAVE_SET_RATE_SUPPORT
50static void calc_dividers(u32 div, u32 *pre, u32 *post, u32 maxpost)
51{
52 u32 min_pre, temp_pre, old_err, err;
53
54 min_pre = (div - 1) / maxpost + 1;
55 old_err = 8;
56
57 for (temp_pre = 8; temp_pre >= min_pre; temp_pre--) {
58 if (div > (temp_pre * maxpost))
59 break;
60
61 if (div < (temp_pre * temp_pre))
62 continue;
63
64 err = div % temp_pre;
65
66 if (err == 0) {
67 *pre = temp_pre;
68 break;
69 }
70
71 err = temp_pre - err;
72
73 if (err < old_err) {
74 old_err = err;
75 *pre = temp_pre;
76 }
77 }
78
79 *post = (div + *pre - 1) / *pre;
80}
81
82/* get the best values for a 3-bit divider combined with a 6-bit divider */
83static void calc_dividers_3_6(u32 div, u32 *pre, u32 *post)
84{
85 if (div >= 512) {
86 *pre = 8;
87 *post = 64;
88 } else if (div >= 64) {
89 calc_dividers(div, pre, post, 64);
90 } else if (div <= 8) {
91 *pre = div;
92 *post = 1;
93 } else {
94 *pre = 1;
95 *post = div;
96 }
97}
98
99/* get the best values for two cascaded 3-bit dividers */
100static void calc_dividers_3_3(u32 div, u32 *pre, u32 *post)
101{
102 if (div >= 64) {
103 *pre = *post = 8;
104 } else if (div > 8) {
105 calc_dividers(div, pre, post, 8);
106 } else {
107 *pre = 1;
108 *post = div;
109 }
110}
111#endif
112
113static unsigned long get_rate_mpll(void)
114{
115 ulong mpctl = __raw_readl(CCM_BASE + CCM_MPCTL);
116
117 return mxc_decode_pll(mpctl, 24000000);
118}
119
120static unsigned long get_rate_ppll(void)
121{
122 ulong ppctl = __raw_readl(CCM_BASE + CCM_PPCTL);
123
124 return mxc_decode_pll(ppctl, 24000000);
125}
126
127struct arm_ahb_div {
128 unsigned char arm, ahb, sel;
129};
130
131static struct arm_ahb_div clk_consumer[] = {
132 { .arm = 1, .ahb = 4, .sel = 0},
133 { .arm = 1, .ahb = 3, .sel = 1},
134 { .arm = 2, .ahb = 2, .sel = 0},
135 { .arm = 0, .ahb = 0, .sel = 0},
136 { .arm = 0, .ahb = 0, .sel = 0},
137 { .arm = 0, .ahb = 0, .sel = 0},
138 { .arm = 4, .ahb = 1, .sel = 0},
139 { .arm = 1, .ahb = 5, .sel = 0},
140 { .arm = 1, .ahb = 8, .sel = 0},
141 { .arm = 1, .ahb = 6, .sel = 1},
142 { .arm = 2, .ahb = 4, .sel = 0},
143 { .arm = 0, .ahb = 0, .sel = 0},
144 { .arm = 0, .ahb = 0, .sel = 0},
145 { .arm = 0, .ahb = 0, .sel = 0},
146 { .arm = 4, .ahb = 2, .sel = 0},
147 { .arm = 0, .ahb = 0, .sel = 0},
148};
149
150static struct arm_ahb_div clk_automotive[] = {
151 { .arm = 1, .ahb = 3, .sel = 0},
152 { .arm = 1, .ahb = 2, .sel = 1},
153 { .arm = 2, .ahb = 1, .sel = 1},
154 { .arm = 0, .ahb = 0, .sel = 0},
155 { .arm = 1, .ahb = 6, .sel = 0},
156 { .arm = 1, .ahb = 4, .sel = 1},
157 { .arm = 2, .ahb = 2, .sel = 1},
158 { .arm = 0, .ahb = 0, .sel = 0},
159};
160
161static unsigned long get_rate_arm(void)
162{
163 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
164 struct arm_ahb_div *aad;
165 unsigned long fref = get_rate_mpll();
166
167 if (pdr0 & 1) {
168 /* consumer path */
169 aad = &clk_consumer[(pdr0 >> 16) & 0xf];
170 if (aad->sel)
171 fref = fref * 2 / 3;
172 } else {
173 /* auto path */
174 aad = &clk_automotive[(pdr0 >> 9) & 0x7];
175 if (aad->sel)
176 fref = fref * 3 / 4;
177 }
178 return fref / aad->arm;
179}
180
181static unsigned long get_rate_ahb(struct clk *clk)
182{
183 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
184 struct arm_ahb_div *aad;
185 unsigned long fref = get_rate_mpll();
186
187 if (pdr0 & 1)
188 /* consumer path */
189 aad = &clk_consumer[(pdr0 >> 16) & 0xf];
190 else
191 /* auto path */
192 aad = &clk_automotive[(pdr0 >> 9) & 0x7];
193
194 return fref / aad->ahb;
195}
196
197static unsigned long get_rate_ipg(struct clk *clk)
198{
199 return get_rate_ahb(NULL) >> 1;
200}
201
202static unsigned long get_3_3_div(unsigned long in)
203{
204 return (((in >> 3) & 0x7) + 1) * ((in & 0x7) + 1);
205}
206
207static unsigned long get_rate_uart(struct clk *clk)
208{
209 unsigned long pdr3 = __raw_readl(CCM_BASE + CCM_PDR3);
210 unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4);
211 unsigned long div = get_3_3_div(pdr4 >> 10);
212
213 if (pdr3 & (1 << 14))
214 return get_rate_arm() / div;
215 else
216 return get_rate_ppll() / div;
217}
218
219static unsigned long get_rate_sdhc(struct clk *clk)
220{
221 unsigned long pdr3 = __raw_readl(CCM_BASE + CCM_PDR3);
222 unsigned long div, rate;
223
224 if (pdr3 & (1 << 6))
225 rate = get_rate_arm();
226 else
227 rate = get_rate_ppll();
228
229 switch (clk->id) {
230 default:
231 case 0:
232 div = pdr3 & 0x3f;
233 break;
234 case 1:
235 div = (pdr3 >> 8) & 0x3f;
236 break;
237 case 2:
238 div = (pdr3 >> 16) & 0x3f;
239 break;
240 }
241
242 return rate / get_3_3_div(div);
243}
244
245static unsigned long get_rate_mshc(struct clk *clk)
246{
247 unsigned long pdr1 = __raw_readl(CCM_BASE + CCM_PDR1);
248 unsigned long div1, div2, rate;
249
250 if (pdr1 & (1 << 7))
251 rate = get_rate_arm();
252 else
253 rate = get_rate_ppll();
254
255 div1 = (pdr1 >> 29) & 0x7;
256 div2 = (pdr1 >> 22) & 0x3f;
257
258 return rate / ((div1 + 1) * (div2 + 1));
259}
260
261static unsigned long get_rate_ssi(struct clk *clk)
262{
263 unsigned long pdr2 = __raw_readl(CCM_BASE + CCM_PDR2);
264 unsigned long div1, div2, rate;
265
266 if (pdr2 & (1 << 6))
267 rate = get_rate_arm();
268 else
269 rate = get_rate_ppll();
270
271 switch (clk->id) {
272 default:
273 case 0:
274 div1 = pdr2 & 0x3f;
275 div2 = (pdr2 >> 24) & 0x7;
276 break;
277 case 1:
278 div1 = (pdr2 >> 8) & 0x3f;
279 div2 = (pdr2 >> 27) & 0x7;
280 break;
281 }
282
283 return rate / ((div1 + 1) * (div2 + 1));
284}
285
286static unsigned long get_rate_csi(struct clk *clk)
287{
288 unsigned long pdr2 = __raw_readl(CCM_BASE + CCM_PDR2);
289 unsigned long rate;
290
291 if (pdr2 & (1 << 7))
292 rate = get_rate_arm();
293 else
294 rate = get_rate_ppll();
295
296 return rate / get_3_3_div((pdr2 >> 16) & 0x3f);
297}
298
299static unsigned long get_rate_ipg_per(struct clk *clk)
300{
301 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0);
302 unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4);
303 unsigned long div1, div2;
304
305 if (pdr0 & (1 << 26)) {
306 div1 = (pdr4 >> 19) & 0x7;
307 div2 = (pdr4 >> 16) & 0x7;
308 return get_rate_arm() / ((div1 + 1) * (div2 + 1));
309 } else {
310 div1 = (pdr0 >> 12) & 0x7;
311 return get_rate_ahb(NULL) / div1;
312 }
313}
314
315static int clk_cgr_enable(struct clk *clk)
316{
317 u32 reg;
318
319 reg = __raw_readl(clk->enable_reg);
320 reg |= 3 << clk->enable_shift;
321 __raw_writel(reg, clk->enable_reg);
322
323 return 0;
324}
325
326static void clk_cgr_disable(struct clk *clk)
327{
328 u32 reg;
329
330 reg = __raw_readl(clk->enable_reg);
331 reg &= ~(3 << clk->enable_shift);
332 __raw_writel(reg, clk->enable_reg);
333}
334
335#define DEFINE_CLOCK(name, i, er, es, gr, sr) \
336 static struct clk name = { \
337 .id = i, \
338 .enable_reg = CCM_BASE + er, \
339 .enable_shift = es, \
340 .get_rate = gr, \
341 .set_rate = sr, \
342 .enable = clk_cgr_enable, \
343 .disable = clk_cgr_disable, \
344 }
345
346DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL);
347DEFINE_CLOCK(ata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL);
348DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL);
349DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL);
350DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL);
351DEFINE_CLOCK(cspi1_clk, 0, CCM_CGR0, 10, get_rate_ipg, NULL);
352DEFINE_CLOCK(cspi2_clk, 1, CCM_CGR0, 12, get_rate_ipg, NULL);
353DEFINE_CLOCK(ect_clk, 0, CCM_CGR0, 14, get_rate_ipg, NULL);
354DEFINE_CLOCK(edio_clk, 0, CCM_CGR0, 16, NULL, NULL);
355DEFINE_CLOCK(emi_clk, 0, CCM_CGR0, 18, get_rate_ipg, NULL);
356DEFINE_CLOCK(epit1_clk, 0, CCM_CGR0, 20, get_rate_ipg_per, NULL);
357DEFINE_CLOCK(epit2_clk, 1, CCM_CGR0, 22, get_rate_ipg_per, NULL);
358DEFINE_CLOCK(esai_clk, 0, CCM_CGR0, 24, NULL, NULL);
359DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGR0, 26, get_rate_sdhc, NULL);
360DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGR0, 28, get_rate_sdhc, NULL);
361DEFINE_CLOCK(esdhc3_clk, 2, CCM_CGR0, 30, get_rate_sdhc, NULL);
362
363DEFINE_CLOCK(fec_clk, 0, CCM_CGR1, 0, get_rate_ipg, NULL);
364DEFINE_CLOCK(gpio1_clk, 0, CCM_CGR1, 2, NULL, NULL);
365DEFINE_CLOCK(gpio2_clk, 1, CCM_CGR1, 4, NULL, NULL);
366DEFINE_CLOCK(gpio3_clk, 2, CCM_CGR1, 6, NULL, NULL);
367DEFINE_CLOCK(gpt_clk, 0, CCM_CGR1, 8, get_rate_ipg, NULL);
368DEFINE_CLOCK(i2c1_clk, 0, CCM_CGR1, 10, get_rate_ipg_per, NULL);
369DEFINE_CLOCK(i2c2_clk, 1, CCM_CGR1, 12, get_rate_ipg_per, NULL);
370DEFINE_CLOCK(i2c3_clk, 2, CCM_CGR1, 14, get_rate_ipg_per, NULL);
371DEFINE_CLOCK(iomuxc_clk, 0, CCM_CGR1, 16, NULL, NULL);
372DEFINE_CLOCK(ipu_clk, 0, CCM_CGR1, 18, NULL, NULL);
373DEFINE_CLOCK(kpp_clk, 0, CCM_CGR1, 20, get_rate_ipg, NULL);
374DEFINE_CLOCK(mlb_clk, 0, CCM_CGR1, 22, get_rate_ahb, NULL);
375DEFINE_CLOCK(mshc_clk, 0, CCM_CGR1, 24, get_rate_mshc, NULL);
376DEFINE_CLOCK(owire_clk, 0, CCM_CGR1, 26, get_rate_ipg_per, NULL);
377DEFINE_CLOCK(pwm_clk, 0, CCM_CGR1, 28, get_rate_ipg_per, NULL);
378DEFINE_CLOCK(rngc_clk, 0, CCM_CGR1, 30, get_rate_ipg, NULL);
379
380DEFINE_CLOCK(rtc_clk, 0, CCM_CGR2, 0, get_rate_ipg, NULL);
381DEFINE_CLOCK(rtic_clk, 0, CCM_CGR2, 2, get_rate_ahb, NULL);
382DEFINE_CLOCK(scc_clk, 0, CCM_CGR2, 4, get_rate_ipg, NULL);
383DEFINE_CLOCK(sdma_clk, 0, CCM_CGR2, 6, NULL, NULL);
384DEFINE_CLOCK(spba_clk, 0, CCM_CGR2, 8, get_rate_ipg, NULL);
385DEFINE_CLOCK(spdif_clk, 0, CCM_CGR2, 10, NULL, NULL);
386DEFINE_CLOCK(ssi1_clk, 0, CCM_CGR2, 12, get_rate_ssi, NULL);
387DEFINE_CLOCK(ssi2_clk, 1, CCM_CGR2, 14, get_rate_ssi, NULL);
388DEFINE_CLOCK(uart1_clk, 0, CCM_CGR2, 16, get_rate_uart, NULL);
389DEFINE_CLOCK(uart2_clk, 1, CCM_CGR2, 18, get_rate_uart, NULL);
390DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL);
391DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, NULL, NULL);
392DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL);
393DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL);
394DEFINE_CLOCK(admux_clk, 0, CCM_CGR2, 30, NULL, NULL);
395
396DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL);
397DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL);
398DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL);
399
400#define _REGISTER_CLOCK(d, n, c) \
401 { \
402 .dev_id = d, \
403 .con_id = n, \
404 .clk = &c, \
405 },
406
407static struct clk_lookup lookups[] __initdata = {
408 _REGISTER_CLOCK(NULL, "asrc", asrc_clk)
409 _REGISTER_CLOCK(NULL, "ata", ata_clk)
410 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
411 _REGISTER_CLOCK(NULL, "can", can1_clk)
412 _REGISTER_CLOCK(NULL, "can", can2_clk)
413 _REGISTER_CLOCK("spi_imx.0", NULL, cspi1_clk)
414 _REGISTER_CLOCK("spi_imx.1", NULL, cspi2_clk)
415 _REGISTER_CLOCK(NULL, "ect", ect_clk)
416 _REGISTER_CLOCK(NULL, "edio", edio_clk)
417 _REGISTER_CLOCK(NULL, "emi", emi_clk)
418 _REGISTER_CLOCK(NULL, "epit", epit1_clk)
419 _REGISTER_CLOCK(NULL, "epit", epit2_clk)
420 _REGISTER_CLOCK(NULL, "esai", esai_clk)
421 _REGISTER_CLOCK(NULL, "sdhc", esdhc1_clk)
422 _REGISTER_CLOCK(NULL, "sdhc", esdhc2_clk)
423 _REGISTER_CLOCK(NULL, "sdhc", esdhc3_clk)
424 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
425 _REGISTER_CLOCK(NULL, "gpio", gpio1_clk)
426 _REGISTER_CLOCK(NULL, "gpio", gpio2_clk)
427 _REGISTER_CLOCK(NULL, "gpio", gpio3_clk)
428 _REGISTER_CLOCK("gpt.0", NULL, gpt_clk)
429 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
430 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
431 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk)
432 _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk)
433 _REGISTER_CLOCK(NULL, "ipu", ipu_clk)
434 _REGISTER_CLOCK(NULL, "kpp", kpp_clk)
435 _REGISTER_CLOCK(NULL, "mlb", mlb_clk)
436 _REGISTER_CLOCK(NULL, "mshc", mshc_clk)
437 _REGISTER_CLOCK("mxc_w1", NULL, owire_clk)
438 _REGISTER_CLOCK(NULL, "pwm", pwm_clk)
439 _REGISTER_CLOCK(NULL, "rngc", rngc_clk)
440 _REGISTER_CLOCK(NULL, "rtc", rtc_clk)
441 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
442 _REGISTER_CLOCK(NULL, "scc", scc_clk)
443 _REGISTER_CLOCK(NULL, "sdma", sdma_clk)
444 _REGISTER_CLOCK(NULL, "spba", spba_clk)
445 _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
446 _REGISTER_CLOCK(NULL, "ssi", ssi1_clk)
447 _REGISTER_CLOCK(NULL, "ssi", ssi2_clk)
448 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
449 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
450 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
451 _REGISTER_CLOCK(NULL, "usbotg", usbotg_clk)
452 _REGISTER_CLOCK("mxc_wdt.0", NULL, wdog_clk)
453 _REGISTER_CLOCK(NULL, "max", max_clk)
454 _REGISTER_CLOCK(NULL, "admux", admux_clk)
455 _REGISTER_CLOCK(NULL, "csi", csi_clk)
456 _REGISTER_CLOCK(NULL, "iim", iim_clk)
457 _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk)
458};
459
460int __init mx35_clocks_init()
461{
462 int i;
463 unsigned int ll = 0;
464
465 mxc_set_cpu_type(MXC_CPU_MX35);
466
467#ifdef CONFIG_DEBUG_LL_CONSOLE
468 ll = (3 << 16);
469#endif
470
471 for (i = 0; i < ARRAY_SIZE(lookups); i++)
472 clkdev_add(&lookups[i]);
473
474 /* Turn off all clocks except the ones we need to survive, namely:
475 * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart
476 */
477 __raw_writel((3 << 18), CCM_BASE + CCM_CGR0);
478 __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16),
479 CCM_BASE + CCM_CGR1);
480 __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2);
481 __raw_writel(0, CCM_BASE + CCM_CGR3);
482
483 mxc_timer_init(&gpt_clk);
484
485 return 0;
486}
487
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock.c
index b1746aae1f89..ca46f4801c3d 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock.c
@@ -23,9 +23,13 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/io.h> 25#include <linux/io.h>
26
27#include <asm/clkdev.h>
28#include <asm/div64.h>
29
26#include <mach/clock.h> 30#include <mach/clock.h>
27#include <mach/hardware.h> 31#include <mach/hardware.h>
28#include <asm/div64.h> 32#include <mach/common.h>
29 33
30#include "crm_regs.h" 34#include "crm_regs.h"
31 35
@@ -64,17 +68,17 @@ static void __calc_pre_post_dividers(u32 div, u32 *pre, u32 *post)
64} 68}
65 69
66static struct clk mcu_pll_clk; 70static struct clk mcu_pll_clk;
67static struct clk mcu_main_clk;
68static struct clk usb_pll_clk;
69static struct clk serial_pll_clk; 71static struct clk serial_pll_clk;
70static struct clk ipg_clk; 72static struct clk ipg_clk;
71static struct clk ckih_clk; 73static struct clk ckih_clk;
72static struct clk ahb_clk;
73 74
74static int _clk_enable(struct clk *clk) 75static int cgr_enable(struct clk *clk)
75{ 76{
76 u32 reg; 77 u32 reg;
77 78
79 if (!clk->enable_reg)
80 return 0;
81
78 reg = __raw_readl(clk->enable_reg); 82 reg = __raw_readl(clk->enable_reg);
79 reg |= 3 << clk->enable_shift; 83 reg |= 3 << clk->enable_shift;
80 __raw_writel(reg, clk->enable_reg); 84 __raw_writel(reg, clk->enable_reg);
@@ -82,133 +86,69 @@ static int _clk_enable(struct clk *clk)
82 return 0; 86 return 0;
83} 87}
84 88
85static void _clk_disable(struct clk *clk) 89static void cgr_disable(struct clk *clk)
86{ 90{
87 u32 reg; 91 u32 reg;
88 92
93 if (!clk->enable_reg)
94 return;
95
89 reg = __raw_readl(clk->enable_reg); 96 reg = __raw_readl(clk->enable_reg);
90 reg &= ~(3 << clk->enable_shift); 97 reg &= ~(3 << clk->enable_shift);
98
99 /* special case for EMI clock */
100 if (clk->enable_reg == MXC_CCM_CGR2 && clk->enable_shift == 8)
101 reg |= (1 << clk->enable_shift);
102
91 __raw_writel(reg, clk->enable_reg); 103 __raw_writel(reg, clk->enable_reg);
92} 104}
93 105
94static void _clk_emi_disable(struct clk *clk) 106static unsigned long pll_ref_get_rate(void)
95{ 107{
96 u32 reg; 108 unsigned long ccmr;
109 unsigned int prcs;
97 110
98 reg = __raw_readl(clk->enable_reg); 111 ccmr = __raw_readl(MXC_CCM_CCMR);
99 reg &= ~(3 << clk->enable_shift); 112 prcs = (ccmr & MXC_CCM_CCMR_PRCS_MASK) >> MXC_CCM_CCMR_PRCS_OFFSET;
100 reg |= (1 << clk->enable_shift); 113 if (prcs == 0x1)
101 __raw_writel(reg, clk->enable_reg); 114 return CKIL_CLK_FREQ * 1024;
115 else
116 return clk_get_rate(&ckih_clk);
102} 117}
103 118
104static int _clk_pll_set_rate(struct clk *clk, unsigned long rate) 119static unsigned long usb_pll_get_rate(struct clk *clk)
105{ 120{
106 u32 reg; 121 unsigned long reg;
107 signed long pd = 1; /* Pre-divider */
108 signed long mfi; /* Multiplication Factor (Integer part) */
109 signed long mfn; /* Multiplication Factor (Integer part) */
110 signed long mfd; /* Multiplication Factor (Denominator Part) */
111 signed long tmp;
112 u32 ref_freq = clk_get_rate(clk->parent);
113 122
114 while (((ref_freq / pd) * 10) > rate) 123 reg = __raw_readl(MXC_CCM_UPCTL);
115 pd++;
116 124
117 if ((ref_freq / pd) < PRE_DIV_MIN_FREQ) 125 return mxc_decode_pll(reg, pll_ref_get_rate());
118 return -EINVAL; 126}
119 127
120 /* the ref_freq/2 in the following is to round up */ 128static unsigned long serial_pll_get_rate(struct clk *clk)
121 mfi = (((rate / 2) * pd) + (ref_freq / 2)) / ref_freq; 129{
122 if (mfi < 5 || mfi > 15) 130 unsigned long reg;
123 return -EINVAL;
124 131
125 /* pick a mfd value that will work 132 reg = __raw_readl(MXC_CCM_SRPCTL);
126 * then solve for mfn */
127 mfd = ref_freq / 50000;
128
129 /*
130 * pll_freq * pd * mfd
131 * mfn = -------------------- - (mfi * mfd)
132 * 2 * ref_freq
133 */
134 /* the tmp/2 is for rounding */
135 tmp = ref_freq / 10000;
136 mfn =
137 ((((((rate / 2) + (tmp / 2)) / tmp) * pd) * mfd) / 10000) -
138 (mfi * mfd);
139
140 mfn = mfn & 0x3ff;
141 pd--;
142 mfd--;
143
144 /* Change the Pll value */
145 reg = (mfi << MXC_CCM_PCTL_MFI_OFFSET) |
146 (mfn << MXC_CCM_PCTL_MFN_OFFSET) |
147 (mfd << MXC_CCM_PCTL_MFD_OFFSET) | (pd << MXC_CCM_PCTL_PD_OFFSET);
148
149 if (clk == &mcu_pll_clk)
150 __raw_writel(reg, MXC_CCM_MPCTL);
151 else if (clk == &usb_pll_clk)
152 __raw_writel(reg, MXC_CCM_UPCTL);
153 else if (clk == &serial_pll_clk)
154 __raw_writel(reg, MXC_CCM_SRPCTL);
155 133
156 return 0; 134 return mxc_decode_pll(reg, pll_ref_get_rate());
157} 135}
158 136
159static unsigned long _clk_pll_get_rate(struct clk *clk) 137static unsigned long mcu_pll_get_rate(struct clk *clk)
160{ 138{
161 long mfi, mfn, mfd, pdf, ref_clk, mfn_abs;
162 unsigned long reg, ccmr; 139 unsigned long reg, ccmr;
163 s64 temp;
164 unsigned int prcs;
165 140
166 ccmr = __raw_readl(MXC_CCM_CCMR); 141 ccmr = __raw_readl(MXC_CCM_CCMR);
167 prcs = (ccmr & MXC_CCM_CCMR_PRCS_MASK) >> MXC_CCM_CCMR_PRCS_OFFSET;
168 if (prcs == 0x1)
169 ref_clk = CKIL_CLK_FREQ * 1024;
170 else
171 ref_clk = clk_get_rate(&ckih_clk);
172
173 if (clk == &mcu_pll_clk) {
174 if ((ccmr & MXC_CCM_CCMR_MPE) == 0)
175 return ref_clk;
176 if ((ccmr & MXC_CCM_CCMR_MDS) != 0)
177 return ref_clk;
178 reg = __raw_readl(MXC_CCM_MPCTL);
179 } else if (clk == &usb_pll_clk)
180 reg = __raw_readl(MXC_CCM_UPCTL);
181 else if (clk == &serial_pll_clk)
182 reg = __raw_readl(MXC_CCM_SRPCTL);
183 else {
184 BUG();
185 return 0;
186 }
187
188 pdf = (reg & MXC_CCM_PCTL_PD_MASK) >> MXC_CCM_PCTL_PD_OFFSET;
189 mfd = (reg & MXC_CCM_PCTL_MFD_MASK) >> MXC_CCM_PCTL_MFD_OFFSET;
190 mfi = (reg & MXC_CCM_PCTL_MFI_MASK) >> MXC_CCM_PCTL_MFI_OFFSET;
191 mfi = (mfi <= 5) ? 5 : mfi;
192 mfn = mfn_abs = reg & MXC_CCM_PCTL_MFN_MASK;
193 142
194 if (mfn >= 0x200) { 143 if (!(ccmr & MXC_CCM_CCMR_MPE) || (ccmr & MXC_CCM_CCMR_MDS))
195 mfn |= 0xFFFFFE00; 144 return clk_get_rate(&ckih_clk);
196 mfn_abs = -mfn;
197 }
198
199 ref_clk *= 2;
200 ref_clk /= pdf + 1;
201 145
202 temp = (u64) ref_clk * mfn_abs; 146 reg = __raw_readl(MXC_CCM_MPCTL);
203 do_div(temp, mfd + 1);
204 if (mfn < 0)
205 temp = -temp;
206 temp = (ref_clk * mfi) + temp;
207 147
208 return temp; 148 return mxc_decode_pll(reg, pll_ref_get_rate());
209} 149}
210 150
211static int _clk_usb_pll_enable(struct clk *clk) 151static int usb_pll_enable(struct clk *clk)
212{ 152{
213 u32 reg; 153 u32 reg;
214 154
@@ -222,7 +162,7 @@ static int _clk_usb_pll_enable(struct clk *clk)
222 return 0; 162 return 0;
223} 163}
224 164
225static void _clk_usb_pll_disable(struct clk *clk) 165static void usb_pll_disable(struct clk *clk)
226{ 166{
227 u32 reg; 167 u32 reg;
228 168
@@ -231,7 +171,7 @@ static void _clk_usb_pll_disable(struct clk *clk)
231 __raw_writel(reg, MXC_CCM_CCMR); 171 __raw_writel(reg, MXC_CCM_CCMR);
232} 172}
233 173
234static int _clk_serial_pll_enable(struct clk *clk) 174static int serial_pll_enable(struct clk *clk)
235{ 175{
236 u32 reg; 176 u32 reg;
237 177
@@ -245,7 +185,7 @@ static int _clk_serial_pll_enable(struct clk *clk)
245 return 0; 185 return 0;
246} 186}
247 187
248static void _clk_serial_pll_disable(struct clk *clk) 188static void serial_pll_disable(struct clk *clk)
249{ 189{
250 u32 reg; 190 u32 reg;
251 191
@@ -258,7 +198,7 @@ static void _clk_serial_pll_disable(struct clk *clk)
258#define PDR1(mask, off) ((__raw_readl(MXC_CCM_PDR1) & mask) >> off) 198#define PDR1(mask, off) ((__raw_readl(MXC_CCM_PDR1) & mask) >> off)
259#define PDR2(mask, off) ((__raw_readl(MXC_CCM_PDR2) & mask) >> off) 199#define PDR2(mask, off) ((__raw_readl(MXC_CCM_PDR2) & mask) >> off)
260 200
261static unsigned long _clk_mcu_main_get_rate(struct clk *clk) 201static unsigned long mcu_main_get_rate(struct clk *clk)
262{ 202{
263 u32 pmcr0 = __raw_readl(MXC_CCM_PMCR0); 203 u32 pmcr0 = __raw_readl(MXC_CCM_PMCR0);
264 204
@@ -268,7 +208,7 @@ static unsigned long _clk_mcu_main_get_rate(struct clk *clk)
268 return clk_get_rate(&mcu_pll_clk); 208 return clk_get_rate(&mcu_pll_clk);
269} 209}
270 210
271static unsigned long _clk_hclk_get_rate(struct clk *clk) 211static unsigned long ahb_get_rate(struct clk *clk)
272{ 212{
273 unsigned long max_pdf; 213 unsigned long max_pdf;
274 214
@@ -277,7 +217,7 @@ static unsigned long _clk_hclk_get_rate(struct clk *clk)
277 return clk_get_rate(clk->parent) / (max_pdf + 1); 217 return clk_get_rate(clk->parent) / (max_pdf + 1);
278} 218}
279 219
280static unsigned long _clk_ipg_get_rate(struct clk *clk) 220static unsigned long ipg_get_rate(struct clk *clk)
281{ 221{
282 unsigned long ipg_pdf; 222 unsigned long ipg_pdf;
283 223
@@ -286,7 +226,7 @@ static unsigned long _clk_ipg_get_rate(struct clk *clk)
286 return clk_get_rate(clk->parent) / (ipg_pdf + 1); 226 return clk_get_rate(clk->parent) / (ipg_pdf + 1);
287} 227}
288 228
289static unsigned long _clk_nfc_get_rate(struct clk *clk) 229static unsigned long nfc_get_rate(struct clk *clk)
290{ 230{
291 unsigned long nfc_pdf; 231 unsigned long nfc_pdf;
292 232
@@ -295,7 +235,7 @@ static unsigned long _clk_nfc_get_rate(struct clk *clk)
295 return clk_get_rate(clk->parent) / (nfc_pdf + 1); 235 return clk_get_rate(clk->parent) / (nfc_pdf + 1);
296} 236}
297 237
298static unsigned long _clk_hsp_get_rate(struct clk *clk) 238static unsigned long hsp_get_rate(struct clk *clk)
299{ 239{
300 unsigned long hsp_pdf; 240 unsigned long hsp_pdf;
301 241
@@ -304,7 +244,7 @@ static unsigned long _clk_hsp_get_rate(struct clk *clk)
304 return clk_get_rate(clk->parent) / (hsp_pdf + 1); 244 return clk_get_rate(clk->parent) / (hsp_pdf + 1);
305} 245}
306 246
307static unsigned long _clk_usb_get_rate(struct clk *clk) 247static unsigned long usb_get_rate(struct clk *clk)
308{ 248{
309 unsigned long usb_pdf, usb_prepdf; 249 unsigned long usb_pdf, usb_prepdf;
310 250
@@ -315,7 +255,7 @@ static unsigned long _clk_usb_get_rate(struct clk *clk)
315 return clk_get_rate(clk->parent) / (usb_prepdf + 1) / (usb_pdf + 1); 255 return clk_get_rate(clk->parent) / (usb_prepdf + 1) / (usb_pdf + 1);
316} 256}
317 257
318static unsigned long _clk_csi_get_rate(struct clk *clk) 258static unsigned long csi_get_rate(struct clk *clk)
319{ 259{
320 u32 reg, pre, post; 260 u32 reg, pre, post;
321 261
@@ -329,7 +269,7 @@ static unsigned long _clk_csi_get_rate(struct clk *clk)
329 return clk_get_rate(clk->parent) / (pre * post); 269 return clk_get_rate(clk->parent) / (pre * post);
330} 270}
331 271
332static unsigned long _clk_csi_round_rate(struct clk *clk, unsigned long rate) 272static unsigned long csi_round_rate(struct clk *clk, unsigned long rate)
333{ 273{
334 u32 pre, post, parent = clk_get_rate(clk->parent); 274 u32 pre, post, parent = clk_get_rate(clk->parent);
335 u32 div = parent / rate; 275 u32 div = parent / rate;
@@ -342,7 +282,7 @@ static unsigned long _clk_csi_round_rate(struct clk *clk, unsigned long rate)
342 return parent / (pre * post); 282 return parent / (pre * post);
343} 283}
344 284
345static int _clk_csi_set_rate(struct clk *clk, unsigned long rate) 285static int csi_set_rate(struct clk *clk, unsigned long rate)
346{ 286{
347 u32 reg, div, pre, post, parent = clk_get_rate(clk->parent); 287 u32 reg, div, pre, post, parent = clk_get_rate(clk->parent);
348 288
@@ -363,16 +303,7 @@ static int _clk_csi_set_rate(struct clk *clk, unsigned long rate)
363 return 0; 303 return 0;
364} 304}
365 305
366static unsigned long _clk_per_get_rate(struct clk *clk) 306static unsigned long ssi1_get_rate(struct clk *clk)
367{
368 unsigned long per_pdf;
369
370 per_pdf = PDR0(MXC_CCM_PDR0_PER_PODF_MASK,
371 MXC_CCM_PDR0_PER_PODF_OFFSET);
372 return clk_get_rate(clk->parent) / (per_pdf + 1);
373}
374
375static unsigned long _clk_ssi1_get_rate(struct clk *clk)
376{ 307{
377 unsigned long ssi1_pdf, ssi1_prepdf; 308 unsigned long ssi1_pdf, ssi1_prepdf;
378 309
@@ -383,7 +314,7 @@ static unsigned long _clk_ssi1_get_rate(struct clk *clk)
383 return clk_get_rate(clk->parent) / (ssi1_prepdf + 1) / (ssi1_pdf + 1); 314 return clk_get_rate(clk->parent) / (ssi1_prepdf + 1) / (ssi1_pdf + 1);
384} 315}
385 316
386static unsigned long _clk_ssi2_get_rate(struct clk *clk) 317static unsigned long ssi2_get_rate(struct clk *clk)
387{ 318{
388 unsigned long ssi2_pdf, ssi2_prepdf; 319 unsigned long ssi2_pdf, ssi2_prepdf;
389 320
@@ -394,7 +325,7 @@ static unsigned long _clk_ssi2_get_rate(struct clk *clk)
394 return clk_get_rate(clk->parent) / (ssi2_prepdf + 1) / (ssi2_pdf + 1); 325 return clk_get_rate(clk->parent) / (ssi2_prepdf + 1) / (ssi2_pdf + 1);
395} 326}
396 327
397static unsigned long _clk_firi_get_rate(struct clk *clk) 328static unsigned long firi_get_rate(struct clk *clk)
398{ 329{
399 unsigned long firi_pdf, firi_prepdf; 330 unsigned long firi_pdf, firi_prepdf;
400 331
@@ -405,7 +336,7 @@ static unsigned long _clk_firi_get_rate(struct clk *clk)
405 return clk_get_rate(clk->parent) / (firi_prepdf + 1) / (firi_pdf + 1); 336 return clk_get_rate(clk->parent) / (firi_prepdf + 1) / (firi_pdf + 1);
406} 337}
407 338
408static unsigned long _clk_firi_round_rate(struct clk *clk, unsigned long rate) 339static unsigned long firi_round_rate(struct clk *clk, unsigned long rate)
409{ 340{
410 u32 pre, post; 341 u32 pre, post;
411 u32 parent = clk_get_rate(clk->parent); 342 u32 parent = clk_get_rate(clk->parent);
@@ -420,7 +351,7 @@ static unsigned long _clk_firi_round_rate(struct clk *clk, unsigned long rate)
420 351
421} 352}
422 353
423static int _clk_firi_set_rate(struct clk *clk, unsigned long rate) 354static int firi_set_rate(struct clk *clk, unsigned long rate)
424{ 355{
425 u32 reg, div, pre, post, parent = clk_get_rate(clk->parent); 356 u32 reg, div, pre, post, parent = clk_get_rate(clk->parent);
426 357
@@ -441,12 +372,12 @@ static int _clk_firi_set_rate(struct clk *clk, unsigned long rate)
441 return 0; 372 return 0;
442} 373}
443 374
444static unsigned long _clk_mbx_get_rate(struct clk *clk) 375static unsigned long mbx_get_rate(struct clk *clk)
445{ 376{
446 return clk_get_rate(clk->parent) / 2; 377 return clk_get_rate(clk->parent) / 2;
447} 378}
448 379
449static unsigned long _clk_mstick1_get_rate(struct clk *clk) 380static unsigned long mstick1_get_rate(struct clk *clk)
450{ 381{
451 unsigned long msti_pdf; 382 unsigned long msti_pdf;
452 383
@@ -455,7 +386,7 @@ static unsigned long _clk_mstick1_get_rate(struct clk *clk)
455 return clk_get_rate(clk->parent) / (msti_pdf + 1); 386 return clk_get_rate(clk->parent) / (msti_pdf + 1);
456} 387}
457 388
458static unsigned long _clk_mstick2_get_rate(struct clk *clk) 389static unsigned long mstick2_get_rate(struct clk *clk)
459{ 390{
460 unsigned long msti_pdf; 391 unsigned long msti_pdf;
461 392
@@ -472,661 +403,185 @@ static unsigned long clk_ckih_get_rate(struct clk *clk)
472} 403}
473 404
474static struct clk ckih_clk = { 405static struct clk ckih_clk = {
475 .name = "ckih",
476 .get_rate = clk_ckih_get_rate, 406 .get_rate = clk_ckih_get_rate,
477}; 407};
478 408
479static unsigned long clk_ckil_get_rate(struct clk *clk)
480{
481 return CKIL_CLK_FREQ;
482}
483
484static struct clk ckil_clk = {
485 .name = "ckil",
486 .get_rate = clk_ckil_get_rate,
487};
488
489static struct clk mcu_pll_clk = { 409static struct clk mcu_pll_clk = {
490 .name = "mcu_pll",
491 .parent = &ckih_clk, 410 .parent = &ckih_clk,
492 .set_rate = _clk_pll_set_rate, 411 .get_rate = mcu_pll_get_rate,
493 .get_rate = _clk_pll_get_rate,
494}; 412};
495 413
496static struct clk mcu_main_clk = { 414static struct clk mcu_main_clk = {
497 .name = "mcu_main_clk",
498 .parent = &mcu_pll_clk, 415 .parent = &mcu_pll_clk,
499 .get_rate = _clk_mcu_main_get_rate, 416 .get_rate = mcu_main_get_rate,
500}; 417};
501 418
502static struct clk serial_pll_clk = { 419static struct clk serial_pll_clk = {
503 .name = "serial_pll",
504 .parent = &ckih_clk, 420 .parent = &ckih_clk,
505 .set_rate = _clk_pll_set_rate, 421 .get_rate = serial_pll_get_rate,
506 .get_rate = _clk_pll_get_rate, 422 .enable = serial_pll_enable,
507 .enable = _clk_serial_pll_enable, 423 .disable = serial_pll_disable,
508 .disable = _clk_serial_pll_disable,
509}; 424};
510 425
511static struct clk usb_pll_clk = { 426static struct clk usb_pll_clk = {
512 .name = "usb_pll",
513 .parent = &ckih_clk, 427 .parent = &ckih_clk,
514 .set_rate = _clk_pll_set_rate, 428 .get_rate = usb_pll_get_rate,
515 .get_rate = _clk_pll_get_rate, 429 .enable = usb_pll_enable,
516 .enable = _clk_usb_pll_enable, 430 .disable = usb_pll_disable,
517 .disable = _clk_usb_pll_disable,
518}; 431};
519 432
520static struct clk ahb_clk = { 433static struct clk ahb_clk = {
521 .name = "ahb_clk",
522 .parent = &mcu_main_clk, 434 .parent = &mcu_main_clk,
523 .get_rate = _clk_hclk_get_rate, 435 .get_rate = ahb_get_rate,
524}; 436};
525 437
526static struct clk per_clk = { 438#define DEFINE_CLOCK(name, i, er, es, gr, s, p) \
527 .name = "per_clk", 439 static struct clk name = { \
528 .parent = &usb_pll_clk, 440 .id = i, \
529 .get_rate = _clk_per_get_rate, 441 .enable_reg = er, \
530}; 442 .enable_shift = es, \
531 443 .get_rate = gr, \
532static struct clk perclk_clk = { 444 .enable = cgr_enable, \
533 .name = "perclk_clk", 445 .disable = cgr_disable, \
534 .parent = &ipg_clk, 446 .secondary = s, \
535}; 447 .parent = p, \
536 448 }
537static struct clk cspi_clk[] = {
538 {
539 .name = "cspi_clk",
540 .id = 0,
541 .parent = &ipg_clk,
542 .enable = _clk_enable,
543 .enable_reg = MXC_CCM_CGR2,
544 .enable_shift = MXC_CCM_CGR2_CSPI1_OFFSET,
545 .disable = _clk_disable,},
546 {
547 .name = "cspi_clk",
548 .id = 1,
549 .parent = &ipg_clk,
550 .enable = _clk_enable,
551 .enable_reg = MXC_CCM_CGR2,
552 .enable_shift = MXC_CCM_CGR2_CSPI2_OFFSET,
553 .disable = _clk_disable,},
554 {
555 .name = "cspi_clk",
556 .id = 2,
557 .parent = &ipg_clk,
558 .enable = _clk_enable,
559 .enable_reg = MXC_CCM_CGR0,
560 .enable_shift = MXC_CCM_CGR0_CSPI3_OFFSET,
561 .disable = _clk_disable,},
562};
563
564static struct clk ipg_clk = {
565 .name = "ipg_clk",
566 .parent = &ahb_clk,
567 .get_rate = _clk_ipg_get_rate,
568};
569
570static struct clk emi_clk = {
571 .name = "emi_clk",
572 .parent = &ahb_clk,
573 .enable = _clk_enable,
574 .enable_reg = MXC_CCM_CGR2,
575 .enable_shift = MXC_CCM_CGR2_EMI_OFFSET,
576 .disable = _clk_emi_disable,
577};
578
579static struct clk gpt_clk = {
580 .name = "gpt_clk",
581 .parent = &perclk_clk,
582 .enable = _clk_enable,
583 .enable_reg = MXC_CCM_CGR0,
584 .enable_shift = MXC_CCM_CGR0_GPT_OFFSET,
585 .disable = _clk_disable,
586};
587
588static struct clk pwm_clk = {
589 .name = "pwm_clk",
590 .parent = &perclk_clk,
591 .enable = _clk_enable,
592 .enable_reg = MXC_CCM_CGR0,
593 .enable_shift = MXC_CCM_CGR1_PWM_OFFSET,
594 .disable = _clk_disable,
595};
596
597static struct clk epit_clk[] = {
598 {
599 .name = "epit_clk",
600 .id = 0,
601 .parent = &perclk_clk,
602 .enable = _clk_enable,
603 .enable_reg = MXC_CCM_CGR0,
604 .enable_shift = MXC_CCM_CGR0_EPIT1_OFFSET,
605 .disable = _clk_disable,},
606 {
607 .name = "epit_clk",
608 .id = 1,
609 .parent = &perclk_clk,
610 .enable = _clk_enable,
611 .enable_reg = MXC_CCM_CGR0,
612 .enable_shift = MXC_CCM_CGR0_EPIT2_OFFSET,
613 .disable = _clk_disable,},
614};
615
616static struct clk nfc_clk = {
617 .name = "nfc_clk",
618 .parent = &ahb_clk,
619 .get_rate = _clk_nfc_get_rate,
620};
621
622static struct clk scc_clk = {
623 .name = "scc_clk",
624 .parent = &ipg_clk,
625};
626
627static struct clk ipu_clk = {
628 .name = "ipu_clk",
629 .parent = &mcu_main_clk,
630 .get_rate = _clk_hsp_get_rate,
631 .enable = _clk_enable,
632 .enable_reg = MXC_CCM_CGR1,
633 .enable_shift = MXC_CCM_CGR1_IPU_OFFSET,
634 .disable = _clk_disable,
635};
636
637static struct clk kpp_clk = {
638 .name = "kpp_clk",
639 .parent = &ipg_clk,
640 .enable = _clk_enable,
641 .enable_reg = MXC_CCM_CGR1,
642 .enable_shift = MXC_CCM_CGR1_KPP_OFFSET,
643 .disable = _clk_disable,
644};
645
646static struct clk wdog_clk = {
647 .name = "wdog_clk",
648 .parent = &ipg_clk,
649 .enable = _clk_enable,
650 .enable_reg = MXC_CCM_CGR1,
651 .enable_shift = MXC_CCM_CGR1_WDOG_OFFSET,
652 .disable = _clk_disable,
653};
654static struct clk rtc_clk = {
655 .name = "rtc_clk",
656 .parent = &ipg_clk,
657 .enable = _clk_enable,
658 .enable_reg = MXC_CCM_CGR1,
659 .enable_shift = MXC_CCM_CGR1_RTC_OFFSET,
660 .disable = _clk_disable,
661};
662
663static struct clk usb_clk[] = {
664 {
665 .name = "usb_clk",
666 .parent = &usb_pll_clk,
667 .get_rate = _clk_usb_get_rate,},
668 {
669 .name = "usb_ahb_clk",
670 .parent = &ahb_clk,
671 .enable = _clk_enable,
672 .enable_reg = MXC_CCM_CGR1,
673 .enable_shift = MXC_CCM_CGR1_USBOTG_OFFSET,
674 .disable = _clk_disable,},
675};
676
677static struct clk csi_clk = {
678 .name = "csi_clk",
679 .parent = &serial_pll_clk,
680 .get_rate = _clk_csi_get_rate,
681 .round_rate = _clk_csi_round_rate,
682 .set_rate = _clk_csi_set_rate,
683 .enable = _clk_enable,
684 .enable_reg = MXC_CCM_CGR1,
685 .enable_shift = MXC_CCM_CGR1_CSI_OFFSET,
686 .disable = _clk_disable,
687};
688
689static struct clk uart_clk[] = {
690 {
691 .name = "uart_clk",
692 .id = 0,
693 .parent = &perclk_clk,
694 .enable = _clk_enable,
695 .enable_reg = MXC_CCM_CGR0,
696 .enable_shift = MXC_CCM_CGR0_UART1_OFFSET,
697 .disable = _clk_disable,},
698 {
699 .name = "uart_clk",
700 .id = 1,
701 .parent = &perclk_clk,
702 .enable = _clk_enable,
703 .enable_reg = MXC_CCM_CGR0,
704 .enable_shift = MXC_CCM_CGR0_UART2_OFFSET,
705 .disable = _clk_disable,},
706 {
707 .name = "uart_clk",
708 .id = 2,
709 .parent = &perclk_clk,
710 .enable = _clk_enable,
711 .enable_reg = MXC_CCM_CGR1,
712 .enable_shift = MXC_CCM_CGR1_UART3_OFFSET,
713 .disable = _clk_disable,},
714 {
715 .name = "uart_clk",
716 .id = 3,
717 .parent = &perclk_clk,
718 .enable = _clk_enable,
719 .enable_reg = MXC_CCM_CGR1,
720 .enable_shift = MXC_CCM_CGR1_UART4_OFFSET,
721 .disable = _clk_disable,},
722 {
723 .name = "uart_clk",
724 .id = 4,
725 .parent = &perclk_clk,
726 .enable = _clk_enable,
727 .enable_reg = MXC_CCM_CGR1,
728 .enable_shift = MXC_CCM_CGR1_UART5_OFFSET,
729 .disable = _clk_disable,},
730};
731
732static struct clk i2c_clk[] = {
733 {
734 .name = "i2c_clk",
735 .id = 0,
736 .parent = &perclk_clk,
737 .enable = _clk_enable,
738 .enable_reg = MXC_CCM_CGR0,
739 .enable_shift = MXC_CCM_CGR0_I2C1_OFFSET,
740 .disable = _clk_disable,},
741 {
742 .name = "i2c_clk",
743 .id = 1,
744 .parent = &perclk_clk,
745 .enable = _clk_enable,
746 .enable_reg = MXC_CCM_CGR0,
747 .enable_shift = MXC_CCM_CGR0_I2C2_OFFSET,
748 .disable = _clk_disable,},
749 {
750 .name = "i2c_clk",
751 .id = 2,
752 .parent = &perclk_clk,
753 .enable = _clk_enable,
754 .enable_reg = MXC_CCM_CGR0,
755 .enable_shift = MXC_CCM_CGR0_I2C3_OFFSET,
756 .disable = _clk_disable,},
757};
758
759static struct clk owire_clk = {
760 .name = "owire_clk",
761 .parent = &perclk_clk,
762 .enable_reg = MXC_CCM_CGR1,
763 .enable_shift = MXC_CCM_CGR1_OWIRE_OFFSET,
764 .enable = _clk_enable,
765 .disable = _clk_disable,
766};
767
768static struct clk sdhc_clk[] = {
769 {
770 .name = "sdhc_clk",
771 .id = 0,
772 .parent = &perclk_clk,
773 .enable = _clk_enable,
774 .enable_reg = MXC_CCM_CGR0,
775 .enable_shift = MXC_CCM_CGR0_SD_MMC1_OFFSET,
776 .disable = _clk_disable,},
777 {
778 .name = "sdhc_clk",
779 .id = 1,
780 .parent = &perclk_clk,
781 .enable = _clk_enable,
782 .enable_reg = MXC_CCM_CGR0,
783 .enable_shift = MXC_CCM_CGR0_SD_MMC2_OFFSET,
784 .disable = _clk_disable,},
785};
786
787static struct clk ssi_clk[] = {
788 {
789 .name = "ssi_clk",
790 .parent = &serial_pll_clk,
791 .get_rate = _clk_ssi1_get_rate,
792 .enable = _clk_enable,
793 .enable_reg = MXC_CCM_CGR0,
794 .enable_shift = MXC_CCM_CGR0_SSI1_OFFSET,
795 .disable = _clk_disable,},
796 {
797 .name = "ssi_clk",
798 .id = 1,
799 .parent = &serial_pll_clk,
800 .get_rate = _clk_ssi2_get_rate,
801 .enable = _clk_enable,
802 .enable_reg = MXC_CCM_CGR2,
803 .enable_shift = MXC_CCM_CGR2_SSI2_OFFSET,
804 .disable = _clk_disable,},
805};
806
807static struct clk firi_clk = {
808 .name = "firi_clk",
809 .parent = &usb_pll_clk,
810 .round_rate = _clk_firi_round_rate,
811 .set_rate = _clk_firi_set_rate,
812 .get_rate = _clk_firi_get_rate,
813 .enable = _clk_enable,
814 .enable_reg = MXC_CCM_CGR2,
815 .enable_shift = MXC_CCM_CGR2_FIRI_OFFSET,
816 .disable = _clk_disable,
817};
818
819static struct clk ata_clk = {
820 .name = "ata_clk",
821 .parent = &ipg_clk,
822 .enable = _clk_enable,
823 .enable_reg = MXC_CCM_CGR0,
824 .enable_shift = MXC_CCM_CGR0_ATA_OFFSET,
825 .disable = _clk_disable,
826};
827
828static struct clk mbx_clk = {
829 .name = "mbx_clk",
830 .parent = &ahb_clk,
831 .enable = _clk_enable,
832 .enable_reg = MXC_CCM_CGR2,
833 .enable_shift = MXC_CCM_CGR2_GACC_OFFSET,
834 .get_rate = _clk_mbx_get_rate,
835};
836
837static struct clk vpu_clk = {
838 .name = "vpu_clk",
839 .parent = &ahb_clk,
840 .enable = _clk_enable,
841 .enable_reg = MXC_CCM_CGR2,
842 .enable_shift = MXC_CCM_CGR2_GACC_OFFSET,
843 .get_rate = _clk_mbx_get_rate,
844};
845
846static struct clk rtic_clk = {
847 .name = "rtic_clk",
848 .parent = &ahb_clk,
849 .enable = _clk_enable,
850 .enable_reg = MXC_CCM_CGR2,
851 .enable_shift = MXC_CCM_CGR2_RTIC_OFFSET,
852 .disable = _clk_disable,
853};
854
855static struct clk rng_clk = {
856 .name = "rng_clk",
857 .parent = &ipg_clk,
858 .enable = _clk_enable,
859 .enable_reg = MXC_CCM_CGR0,
860 .enable_shift = MXC_CCM_CGR0_RNG_OFFSET,
861 .disable = _clk_disable,
862};
863
864static struct clk sdma_clk[] = {
865 {
866 .name = "sdma_ahb_clk",
867 .parent = &ahb_clk,
868 .enable = _clk_enable,
869 .enable_reg = MXC_CCM_CGR0,
870 .enable_shift = MXC_CCM_CGR0_SDMA_OFFSET,
871 .disable = _clk_disable,},
872 {
873 .name = "sdma_ipg_clk",
874 .parent = &ipg_clk,}
875};
876
877static struct clk mpeg4_clk = {
878 .name = "mpeg4_clk",
879 .parent = &ahb_clk,
880 .enable = _clk_enable,
881 .enable_reg = MXC_CCM_CGR1,
882 .enable_shift = MXC_CCM_CGR1_HANTRO_OFFSET,
883 .disable = _clk_disable,
884};
885
886static struct clk vl2cc_clk = {
887 .name = "vl2cc_clk",
888 .parent = &ahb_clk,
889 .enable = _clk_enable,
890 .enable_reg = MXC_CCM_CGR1,
891 .enable_shift = MXC_CCM_CGR1_HANTRO_OFFSET,
892 .disable = _clk_disable,
893};
894
895static struct clk mstick_clk[] = {
896 {
897 .name = "mstick_clk",
898 .id = 0,
899 .parent = &usb_pll_clk,
900 .get_rate = _clk_mstick1_get_rate,
901 .enable = _clk_enable,
902 .enable_reg = MXC_CCM_CGR1,
903 .enable_shift = MXC_CCM_CGR1_MEMSTICK1_OFFSET,
904 .disable = _clk_disable,},
905 {
906 .name = "mstick_clk",
907 .id = 1,
908 .parent = &usb_pll_clk,
909 .get_rate = _clk_mstick2_get_rate,
910 .enable = _clk_enable,
911 .enable_reg = MXC_CCM_CGR1,
912 .enable_shift = MXC_CCM_CGR1_MEMSTICK2_OFFSET,
913 .disable = _clk_disable,},
914};
915
916static struct clk iim_clk = {
917 .name = "iim_clk",
918 .parent = &ipg_clk,
919 .enable = _clk_enable,
920 .enable_reg = MXC_CCM_CGR0,
921 .enable_shift = MXC_CCM_CGR0_IIM_OFFSET,
922 .disable = _clk_disable,
923};
924
925static unsigned long _clk_cko1_round_rate(struct clk *clk, unsigned long rate)
926{
927 u32 div, parent = clk_get_rate(clk->parent);
928
929 div = parent / rate;
930 if (parent % rate)
931 div++;
932
933 if (div > 8)
934 div = 16;
935 else if (div > 4)
936 div = 8;
937 else if (div > 2)
938 div = 4;
939
940 return parent / div;
941}
942
943static int _clk_cko1_set_rate(struct clk *clk, unsigned long rate)
944{
945 u32 reg, div, parent = clk_get_rate(clk->parent);
946
947 div = parent / rate;
948
949 if (div == 16)
950 div = 4;
951 else if (div == 8)
952 div = 3;
953 else if (div == 4)
954 div = 2;
955 else if (div == 2)
956 div = 1;
957 else if (div == 1)
958 div = 0;
959 else
960 return -EINVAL;
961
962 reg = __raw_readl(MXC_CCM_COSR) & ~MXC_CCM_COSR_CLKOUTDIV_MASK;
963 reg |= div << MXC_CCM_COSR_CLKOUTDIV_OFFSET;
964 __raw_writel(reg, MXC_CCM_COSR);
965
966 return 0;
967}
968
969static unsigned long _clk_cko1_get_rate(struct clk *clk)
970{
971 u32 div;
972
973 div = __raw_readl(MXC_CCM_COSR) & MXC_CCM_COSR_CLKOUTDIV_MASK >>
974 MXC_CCM_COSR_CLKOUTDIV_OFFSET;
975
976 return clk_get_rate(clk->parent) / (1 << div);
977}
978
979static int _clk_cko1_set_parent(struct clk *clk, struct clk *parent)
980{
981 u32 reg;
982
983 reg = __raw_readl(MXC_CCM_COSR) & ~MXC_CCM_COSR_CLKOSEL_MASK;
984
985 if (parent == &mcu_main_clk)
986 reg |= 0 << MXC_CCM_COSR_CLKOSEL_OFFSET;
987 else if (parent == &ipg_clk)
988 reg |= 1 << MXC_CCM_COSR_CLKOSEL_OFFSET;
989 else if (parent == &usb_pll_clk)
990 reg |= 2 << MXC_CCM_COSR_CLKOSEL_OFFSET;
991 else if (parent == mcu_main_clk.parent)
992 reg |= 3 << MXC_CCM_COSR_CLKOSEL_OFFSET;
993 else if (parent == &ahb_clk)
994 reg |= 5 << MXC_CCM_COSR_CLKOSEL_OFFSET;
995 else if (parent == &serial_pll_clk)
996 reg |= 7 << MXC_CCM_COSR_CLKOSEL_OFFSET;
997 else if (parent == &ckih_clk)
998 reg |= 8 << MXC_CCM_COSR_CLKOSEL_OFFSET;
999 else if (parent == &emi_clk)
1000 reg |= 9 << MXC_CCM_COSR_CLKOSEL_OFFSET;
1001 else if (parent == &ipu_clk)
1002 reg |= 0xA << MXC_CCM_COSR_CLKOSEL_OFFSET;
1003 else if (parent == &nfc_clk)
1004 reg |= 0xB << MXC_CCM_COSR_CLKOSEL_OFFSET;
1005 else if (parent == &uart_clk[0])
1006 reg |= 0xC << MXC_CCM_COSR_CLKOSEL_OFFSET;
1007 else
1008 return -EINVAL;
1009
1010 __raw_writel(reg, MXC_CCM_COSR);
1011
1012 return 0;
1013}
1014
1015static int _clk_cko1_enable(struct clk *clk)
1016{
1017 u32 reg;
1018
1019 reg = __raw_readl(MXC_CCM_COSR) | MXC_CCM_COSR_CLKOEN;
1020 __raw_writel(reg, MXC_CCM_COSR);
1021 449
1022 return 0; 450#define DEFINE_CLOCK1(name, i, er, es, getsetround, s, p) \
1023} 451 static struct clk name = { \
452 .id = i, \
453 .enable_reg = er, \
454 .enable_shift = es, \
455 .get_rate = getsetround##_get_rate, \
456 .set_rate = getsetround##_set_rate, \
457 .round_rate = getsetround##_round_rate, \
458 .enable = cgr_enable, \
459 .disable = cgr_disable, \
460 .secondary = s, \
461 .parent = p, \
462 }
1024 463
1025static void _clk_cko1_disable(struct clk *clk) 464DEFINE_CLOCK(perclk_clk, 0, NULL, 0, NULL, NULL, &ipg_clk);
465
466DEFINE_CLOCK(sdhc1_clk, 0, MXC_CCM_CGR0, 0, NULL, NULL, &perclk_clk);
467DEFINE_CLOCK(sdhc2_clk, 1, MXC_CCM_CGR0, 2, NULL, NULL, &perclk_clk);
468DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CGR0, 4, NULL, NULL, &perclk_clk);
469DEFINE_CLOCK(epit1_clk, 0, MXC_CCM_CGR0, 6, NULL, NULL, &perclk_clk);
470DEFINE_CLOCK(epit2_clk, 1, MXC_CCM_CGR0, 8, NULL, NULL, &perclk_clk);
471DEFINE_CLOCK(iim_clk, 0, MXC_CCM_CGR0, 10, NULL, NULL, &ipg_clk);
472DEFINE_CLOCK(ata_clk, 0, MXC_CCM_CGR0, 12, NULL, NULL, &ipg_clk);
473DEFINE_CLOCK(sdma_clk1, 0, MXC_CCM_CGR0, 14, NULL, &sdma_clk1, &ahb_clk);
474DEFINE_CLOCK(cspi3_clk, 2, MXC_CCM_CGR0, 16, NULL, NULL, &ipg_clk);
475DEFINE_CLOCK(rng_clk, 0, MXC_CCM_CGR0, 18, NULL, NULL, &ipg_clk);
476DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CGR0, 20, NULL, NULL, &perclk_clk);
477DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CGR0, 22, NULL, NULL, &perclk_clk);
478DEFINE_CLOCK(ssi1_clk, 0, MXC_CCM_CGR0, 24, ssi1_get_rate, NULL, &serial_pll_clk);
479DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CGR0, 26, NULL, NULL, &perclk_clk);
480DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CGR0, 28, NULL, NULL, &perclk_clk);
481DEFINE_CLOCK(i2c3_clk, 2, MXC_CCM_CGR0, 30, NULL, NULL, &perclk_clk);
482
483DEFINE_CLOCK(mpeg4_clk, 0, MXC_CCM_CGR1, 0, NULL, NULL, &ahb_clk);
484DEFINE_CLOCK(mstick1_clk, 0, MXC_CCM_CGR1, 2, mstick1_get_rate, NULL, &usb_pll_clk);
485DEFINE_CLOCK(mstick2_clk, 1, MXC_CCM_CGR1, 4, mstick2_get_rate, NULL, &usb_pll_clk);
486DEFINE_CLOCK1(csi_clk, 0, MXC_CCM_CGR1, 6, csi, NULL, &ahb_clk);
487DEFINE_CLOCK(rtc_clk, 0, MXC_CCM_CGR1, 8, NULL, NULL, &ipg_clk);
488DEFINE_CLOCK(wdog_clk, 0, MXC_CCM_CGR1, 10, NULL, NULL, &ipg_clk);
489DEFINE_CLOCK(pwm_clk, 0, MXC_CCM_CGR1, 12, NULL, NULL, &perclk_clk);
490DEFINE_CLOCK(usb_clk2, 0, MXC_CCM_CGR1, 18, usb_get_rate, NULL, &ahb_clk);
491DEFINE_CLOCK(kpp_clk, 0, MXC_CCM_CGR1, 20, NULL, NULL, &ipg_clk);
492DEFINE_CLOCK(ipu_clk, 0, MXC_CCM_CGR1, 22, hsp_get_rate, NULL, &mcu_main_clk);
493DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CGR1, 24, NULL, NULL, &perclk_clk);
494DEFINE_CLOCK(uart4_clk, 3, MXC_CCM_CGR1, 26, NULL, NULL, &perclk_clk);
495DEFINE_CLOCK(uart5_clk, 4, MXC_CCM_CGR1, 28, NULL, NULL, &perclk_clk);
496DEFINE_CLOCK(owire_clk, 0, MXC_CCM_CGR1, 30, NULL, NULL, &perclk_clk);
497
498DEFINE_CLOCK(ssi2_clk, 1, MXC_CCM_CGR2, 0, ssi2_get_rate, NULL, &serial_pll_clk);
499DEFINE_CLOCK(cspi1_clk, 0, MXC_CCM_CGR2, 2, NULL, NULL, &ipg_clk);
500DEFINE_CLOCK(cspi2_clk, 1, MXC_CCM_CGR2, 4, NULL, NULL, &ipg_clk);
501DEFINE_CLOCK(mbx_clk, 0, MXC_CCM_CGR2, 6, mbx_get_rate, NULL, &ahb_clk);
502DEFINE_CLOCK(emi_clk, 0, MXC_CCM_CGR2, 8, NULL, NULL, &ahb_clk);
503DEFINE_CLOCK(rtic_clk, 0, MXC_CCM_CGR2, 10, NULL, NULL, &ahb_clk);
504DEFINE_CLOCK1(firi_clk, 0, MXC_CCM_CGR2, 12, firi, NULL, &usb_pll_clk);
505
506DEFINE_CLOCK(sdma_clk2, 0, NULL, 0, NULL, NULL, &ipg_clk);
507DEFINE_CLOCK(usb_clk1, 0, NULL, 0, usb_get_rate, NULL, &usb_pll_clk);
508DEFINE_CLOCK(nfc_clk, 0, NULL, 0, nfc_get_rate, NULL, &ahb_clk);
509DEFINE_CLOCK(scc_clk, 0, NULL, 0, NULL, NULL, &ipg_clk);
510DEFINE_CLOCK(ipg_clk, 0, NULL, 0, ipg_get_rate, NULL, &ahb_clk);
511
512#define _REGISTER_CLOCK(d, n, c) \
513 { \
514 .dev_id = d, \
515 .con_id = n, \
516 .clk = &c, \
517 },
518
519static struct clk_lookup lookups[] __initdata = {
520 _REGISTER_CLOCK(NULL, "emi", emi_clk)
521 _REGISTER_CLOCK(NULL, "cspi", cspi1_clk)
522 _REGISTER_CLOCK(NULL, "cspi", cspi2_clk)
523 _REGISTER_CLOCK(NULL, "cspi", cspi3_clk)
524 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
525 _REGISTER_CLOCK(NULL, "pwm", pwm_clk)
526 _REGISTER_CLOCK(NULL, "wdog", wdog_clk)
527 _REGISTER_CLOCK(NULL, "rtc", rtc_clk)
528 _REGISTER_CLOCK(NULL, "epit", epit1_clk)
529 _REGISTER_CLOCK(NULL, "epit", epit2_clk)
530 _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
531 _REGISTER_CLOCK("ipu-core", NULL, ipu_clk)
532 _REGISTER_CLOCK("mx3_sdc_fb", NULL, ipu_clk)
533 _REGISTER_CLOCK(NULL, "kpp", kpp_clk)
534 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk1)
535 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk2)
536 _REGISTER_CLOCK("mx3-camera.0", "csi", csi_clk)
537 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
538 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
539 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
540 _REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk)
541 _REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk)
542 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
543 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
544 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_clk)
545 _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk)
546 _REGISTER_CLOCK("mxc-mmc.0", NULL, sdhc1_clk)
547 _REGISTER_CLOCK("mxc-mmc.1", NULL, sdhc2_clk)
548 _REGISTER_CLOCK(NULL, "ssi", ssi1_clk)
549 _REGISTER_CLOCK(NULL, "ssi", ssi2_clk)
550 _REGISTER_CLOCK(NULL, "firi", firi_clk)
551 _REGISTER_CLOCK(NULL, "ata", ata_clk)
552 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
553 _REGISTER_CLOCK(NULL, "rng", rng_clk)
554 _REGISTER_CLOCK(NULL, "sdma_ahb", sdma_clk1)
555 _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2)
556 _REGISTER_CLOCK(NULL, "mstick", mstick1_clk)
557 _REGISTER_CLOCK(NULL, "mstick", mstick2_clk)
558 _REGISTER_CLOCK(NULL, "scc", scc_clk)
559 _REGISTER_CLOCK(NULL, "iim", iim_clk)
560 _REGISTER_CLOCK(NULL, "mpeg4", mpeg4_clk)
561 _REGISTER_CLOCK(NULL, "mbx", mbx_clk)
562};
563
564int __init mx31_clocks_init(unsigned long fref)
1026{ 565{
1027 u32 reg; 566 u32 reg;
567 int i;
1028 568
1029 reg = __raw_readl(MXC_CCM_COSR) & ~MXC_CCM_COSR_CLKOEN; 569 mxc_set_cpu_type(MXC_CPU_MX31);
1030 __raw_writel(reg, MXC_CCM_COSR);
1031}
1032
1033static struct clk cko1_clk = {
1034 .name = "cko1_clk",
1035 .get_rate = _clk_cko1_get_rate,
1036 .set_rate = _clk_cko1_set_rate,
1037 .round_rate = _clk_cko1_round_rate,
1038 .set_parent = _clk_cko1_set_parent,
1039 .enable = _clk_cko1_enable,
1040 .disable = _clk_cko1_disable,
1041};
1042
1043static struct clk *mxc_clks[] = {
1044 &ckih_clk,
1045 &ckil_clk,
1046 &mcu_pll_clk,
1047 &usb_pll_clk,
1048 &serial_pll_clk,
1049 &mcu_main_clk,
1050 &ahb_clk,
1051 &per_clk,
1052 &perclk_clk,
1053 &cko1_clk,
1054 &emi_clk,
1055 &cspi_clk[0],
1056 &cspi_clk[1],
1057 &cspi_clk[2],
1058 &ipg_clk,
1059 &gpt_clk,
1060 &pwm_clk,
1061 &wdog_clk,
1062 &rtc_clk,
1063 &epit_clk[0],
1064 &epit_clk[1],
1065 &nfc_clk,
1066 &ipu_clk,
1067 &kpp_clk,
1068 &usb_clk[0],
1069 &usb_clk[1],
1070 &csi_clk,
1071 &uart_clk[0],
1072 &uart_clk[1],
1073 &uart_clk[2],
1074 &uart_clk[3],
1075 &uart_clk[4],
1076 &i2c_clk[0],
1077 &i2c_clk[1],
1078 &i2c_clk[2],
1079 &owire_clk,
1080 &sdhc_clk[0],
1081 &sdhc_clk[1],
1082 &ssi_clk[0],
1083 &ssi_clk[1],
1084 &firi_clk,
1085 &ata_clk,
1086 &rtic_clk,
1087 &rng_clk,
1088 &sdma_clk[0],
1089 &sdma_clk[1],
1090 &mstick_clk[0],
1091 &mstick_clk[1],
1092 &scc_clk,
1093 &iim_clk,
1094};
1095
1096int __init mxc_clocks_init(unsigned long fref)
1097{
1098 u32 reg;
1099 struct clk **clkp;
1100 570
1101 ckih_rate = fref; 571 ckih_rate = fref;
1102 572
1103 for (clkp = mxc_clks; clkp < mxc_clks + ARRAY_SIZE(mxc_clks); clkp++) 573 for (i = 0; i < ARRAY_SIZE(lookups); i++)
1104 clk_register(*clkp); 574 clkdev_add(&lookups[i]);
1105
1106 if (cpu_is_mx31()) {
1107 clk_register(&mpeg4_clk);
1108 clk_register(&mbx_clk);
1109 } else {
1110 clk_register(&vpu_clk);
1111 clk_register(&vl2cc_clk);
1112 }
1113 575
1114 /* Turn off all possible clocks */ 576 /* Turn off all possible clocks */
1115 __raw_writel(MXC_CCM_CGR0_GPT_MASK, MXC_CCM_CGR0); 577 __raw_writel((3 << 4), MXC_CCM_CGR0);
1116 __raw_writel(0, MXC_CCM_CGR1); 578 __raw_writel(0, MXC_CCM_CGR1);
1117 579 __raw_writel((3 << 8) | (3 << 14) | (3 << 16)|
1118 __raw_writel(MXC_CCM_CGR2_EMI_MASK |
1119 MXC_CCM_CGR2_IPMUX1_MASK |
1120 MXC_CCM_CGR2_IPMUX2_MASK |
1121 MXC_CCM_CGR2_MXCCLKENSEL_MASK | /* for MX32 */
1122 MXC_CCM_CGR2_CHIKCAMPEN_MASK | /* for MX32 */
1123 MXC_CCM_CGR2_OVRVPUBUSY_MASK | /* for MX32 */
1124 1 << 27 | 1 << 28, /* Bit 27 and 28 are not defined for 580 1 << 27 | 1 << 28, /* Bit 27 and 28 are not defined for
1125 MX32, but still required to be set */ 581 MX32, but still required to be set */
1126 MXC_CCM_CGR2); 582 MXC_CCM_CGR2);
1127 583
1128 clk_disable(&cko1_clk); 584 usb_pll_disable(&usb_pll_clk);
1129 clk_disable(&usb_pll_clk);
1130 585
1131 pr_info("Clock input source is %ld\n", clk_get_rate(&ckih_clk)); 586 pr_info("Clock input source is %ld\n", clk_get_rate(&ckih_clk));
1132 587
@@ -1143,6 +598,8 @@ int __init mxc_clocks_init(unsigned long fref)
1143 __raw_writel(reg, MXC_CCM_PMCR1); 598 __raw_writel(reg, MXC_CCM_PMCR1);
1144 } 599 }
1145 600
601 mxc_timer_init(&ipg_clk);
602
1146 return 0; 603 return 0;
1147} 604}
1148 605
diff --git a/arch/arm/mach-mx3/crm_regs.h b/arch/arm/mach-mx3/crm_regs.h
index 4a0e0ede23bb..adfa3627ad84 100644
--- a/arch/arm/mach-mx3/crm_regs.h
+++ b/arch/arm/mach-mx3/crm_regs.h
@@ -91,47 +91,6 @@
91#define MXC_CCM_PDR0_MCU_PODF_OFFSET 0 91#define MXC_CCM_PDR0_MCU_PODF_OFFSET 0
92#define MXC_CCM_PDR0_MCU_PODF_MASK 0x7 92#define MXC_CCM_PDR0_MCU_PODF_MASK 0x7
93 93
94#define MXC_CCM_PDR0_HSP_DIV_1 (0x0 << 11)
95#define MXC_CCM_PDR0_HSP_DIV_2 (0x1 << 11)
96#define MXC_CCM_PDR0_HSP_DIV_3 (0x2 << 11)
97#define MXC_CCM_PDR0_HSP_DIV_4 (0x3 << 11)
98#define MXC_CCM_PDR0_HSP_DIV_5 (0x4 << 11)
99#define MXC_CCM_PDR0_HSP_DIV_6 (0x5 << 11)
100#define MXC_CCM_PDR0_HSP_DIV_7 (0x6 << 11)
101#define MXC_CCM_PDR0_HSP_DIV_8 (0x7 << 11)
102
103#define MXC_CCM_PDR0_IPG_DIV_1 (0x0 << 6)
104#define MXC_CCM_PDR0_IPG_DIV_2 (0x1 << 6)
105#define MXC_CCM_PDR0_IPG_DIV_3 (0x2 << 6)
106#define MXC_CCM_PDR0_IPG_DIV_4 (0x3 << 6)
107
108#define MXC_CCM_PDR0_MAX_DIV_1 (0x0 << 3)
109#define MXC_CCM_PDR0_MAX_DIV_2 (0x1 << 3)
110#define MXC_CCM_PDR0_MAX_DIV_3 (0x2 << 3)
111#define MXC_CCM_PDR0_MAX_DIV_4 (0x3 << 3)
112#define MXC_CCM_PDR0_MAX_DIV_5 (0x4 << 3)
113#define MXC_CCM_PDR0_MAX_DIV_6 (0x5 << 3)
114#define MXC_CCM_PDR0_MAX_DIV_7 (0x6 << 3)
115#define MXC_CCM_PDR0_MAX_DIV_8 (0x7 << 3)
116
117#define MXC_CCM_PDR0_NFC_DIV_1 (0x0 << 8)
118#define MXC_CCM_PDR0_NFC_DIV_2 (0x1 << 8)
119#define MXC_CCM_PDR0_NFC_DIV_3 (0x2 << 8)
120#define MXC_CCM_PDR0_NFC_DIV_4 (0x3 << 8)
121#define MXC_CCM_PDR0_NFC_DIV_5 (0x4 << 8)
122#define MXC_CCM_PDR0_NFC_DIV_6 (0x5 << 8)
123#define MXC_CCM_PDR0_NFC_DIV_7 (0x6 << 8)
124#define MXC_CCM_PDR0_NFC_DIV_8 (0x7 << 8)
125
126#define MXC_CCM_PDR0_MCU_DIV_1 0x0
127#define MXC_CCM_PDR0_MCU_DIV_2 0x1
128#define MXC_CCM_PDR0_MCU_DIV_3 0x2
129#define MXC_CCM_PDR0_MCU_DIV_4 0x3
130#define MXC_CCM_PDR0_MCU_DIV_5 0x4
131#define MXC_CCM_PDR0_MCU_DIV_6 0x5
132#define MXC_CCM_PDR0_MCU_DIV_7 0x6
133#define MXC_CCM_PDR0_MCU_DIV_8 0x7
134
135#define MXC_CCM_PDR1_USB_PRDF_OFFSET 30 94#define MXC_CCM_PDR1_USB_PRDF_OFFSET 30
136#define MXC_CCM_PDR1_USB_PRDF_MASK (0x3 << 30) 95#define MXC_CCM_PDR1_USB_PRDF_MASK (0x3 << 30)
137#define MXC_CCM_PDR1_USB_PODF_OFFSET 27 96#define MXC_CCM_PDR1_USB_PODF_OFFSET 27
@@ -152,118 +111,6 @@
152/* Bit definitions for RCSR */ 111/* Bit definitions for RCSR */
153#define MXC_CCM_RCSR_NF16B 0x80000000 112#define MXC_CCM_RCSR_NF16B 0x80000000
154 113
155/* Bit definitions for both MCU, USB and SR PLL control registers */
156#define MXC_CCM_PCTL_BRM 0x80000000
157#define MXC_CCM_PCTL_PD_OFFSET 26
158#define MXC_CCM_PCTL_PD_MASK (0xF << 26)
159#define MXC_CCM_PCTL_MFD_OFFSET 16
160#define MXC_CCM_PCTL_MFD_MASK (0x3FF << 16)
161#define MXC_CCM_PCTL_MFI_OFFSET 10
162#define MXC_CCM_PCTL_MFI_MASK (0xF << 10)
163#define MXC_CCM_PCTL_MFN_OFFSET 0
164#define MXC_CCM_PCTL_MFN_MASK 0x3FF
165
166#define MXC_CCM_CGR0_SD_MMC1_OFFSET 0
167#define MXC_CCM_CGR0_SD_MMC1_MASK (0x3 << 0)
168#define MXC_CCM_CGR0_SD_MMC2_OFFSET 2
169#define MXC_CCM_CGR0_SD_MMC2_MASK (0x3 << 2)
170#define MXC_CCM_CGR0_GPT_OFFSET 4
171#define MXC_CCM_CGR0_GPT_MASK (0x3 << 4)
172#define MXC_CCM_CGR0_EPIT1_OFFSET 6
173#define MXC_CCM_CGR0_EPIT1_MASK (0x3 << 6)
174#define MXC_CCM_CGR0_EPIT2_OFFSET 8
175#define MXC_CCM_CGR0_EPIT2_MASK (0x3 << 8)
176#define MXC_CCM_CGR0_IIM_OFFSET 10
177#define MXC_CCM_CGR0_IIM_MASK (0x3 << 10)
178#define MXC_CCM_CGR0_ATA_OFFSET 12
179#define MXC_CCM_CGR0_ATA_MASK (0x3 << 12)
180#define MXC_CCM_CGR0_SDMA_OFFSET 14
181#define MXC_CCM_CGR0_SDMA_MASK (0x3 << 14)
182#define MXC_CCM_CGR0_CSPI3_OFFSET 16
183#define MXC_CCM_CGR0_CSPI3_MASK (0x3 << 16)
184#define MXC_CCM_CGR0_RNG_OFFSET 18
185#define MXC_CCM_CGR0_RNG_MASK (0x3 << 18)
186#define MXC_CCM_CGR0_UART1_OFFSET 20
187#define MXC_CCM_CGR0_UART1_MASK (0x3 << 20)
188#define MXC_CCM_CGR0_UART2_OFFSET 22
189#define MXC_CCM_CGR0_UART2_MASK (0x3 << 22)
190#define MXC_CCM_CGR0_SSI1_OFFSET 24
191#define MXC_CCM_CGR0_SSI1_MASK (0x3 << 24)
192#define MXC_CCM_CGR0_I2C1_OFFSET 26
193#define MXC_CCM_CGR0_I2C1_MASK (0x3 << 26)
194#define MXC_CCM_CGR0_I2C2_OFFSET 28
195#define MXC_CCM_CGR0_I2C2_MASK (0x3 << 28)
196#define MXC_CCM_CGR0_I2C3_OFFSET 30
197#define MXC_CCM_CGR0_I2C3_MASK (0x3 << 30)
198
199#define MXC_CCM_CGR1_HANTRO_OFFSET 0
200#define MXC_CCM_CGR1_HANTRO_MASK (0x3 << 0)
201#define MXC_CCM_CGR1_MEMSTICK1_OFFSET 2
202#define MXC_CCM_CGR1_MEMSTICK1_MASK (0x3 << 2)
203#define MXC_CCM_CGR1_MEMSTICK2_OFFSET 4
204#define MXC_CCM_CGR1_MEMSTICK2_MASK (0x3 << 4)
205#define MXC_CCM_CGR1_CSI_OFFSET 6
206#define MXC_CCM_CGR1_CSI_MASK (0x3 << 6)
207#define MXC_CCM_CGR1_RTC_OFFSET 8
208#define MXC_CCM_CGR1_RTC_MASK (0x3 << 8)
209#define MXC_CCM_CGR1_WDOG_OFFSET 10
210#define MXC_CCM_CGR1_WDOG_MASK (0x3 << 10)
211#define MXC_CCM_CGR1_PWM_OFFSET 12
212#define MXC_CCM_CGR1_PWM_MASK (0x3 << 12)
213#define MXC_CCM_CGR1_SIM_OFFSET 14
214#define MXC_CCM_CGR1_SIM_MASK (0x3 << 14)
215#define MXC_CCM_CGR1_ECT_OFFSET 16
216#define MXC_CCM_CGR1_ECT_MASK (0x3 << 16)
217#define MXC_CCM_CGR1_USBOTG_OFFSET 18
218#define MXC_CCM_CGR1_USBOTG_MASK (0x3 << 18)
219#define MXC_CCM_CGR1_KPP_OFFSET 20
220#define MXC_CCM_CGR1_KPP_MASK (0x3 << 20)
221#define MXC_CCM_CGR1_IPU_OFFSET 22
222#define MXC_CCM_CGR1_IPU_MASK (0x3 << 22)
223#define MXC_CCM_CGR1_UART3_OFFSET 24
224#define MXC_CCM_CGR1_UART3_MASK (0x3 << 24)
225#define MXC_CCM_CGR1_UART4_OFFSET 26
226#define MXC_CCM_CGR1_UART4_MASK (0x3 << 26)
227#define MXC_CCM_CGR1_UART5_OFFSET 28
228#define MXC_CCM_CGR1_UART5_MASK (0x3 << 28)
229#define MXC_CCM_CGR1_OWIRE_OFFSET 30
230#define MXC_CCM_CGR1_OWIRE_MASK (0x3 << 30)
231
232#define MXC_CCM_CGR2_SSI2_OFFSET 0
233#define MXC_CCM_CGR2_SSI2_MASK (0x3 << 0)
234#define MXC_CCM_CGR2_CSPI1_OFFSET 2
235#define MXC_CCM_CGR2_CSPI1_MASK (0x3 << 2)
236#define MXC_CCM_CGR2_CSPI2_OFFSET 4
237#define MXC_CCM_CGR2_CSPI2_MASK (0x3 << 4)
238#define MXC_CCM_CGR2_GACC_OFFSET 6
239#define MXC_CCM_CGR2_GACC_MASK (0x3 << 6)
240#define MXC_CCM_CGR2_EMI_OFFSET 8
241#define MXC_CCM_CGR2_EMI_MASK (0x3 << 8)
242#define MXC_CCM_CGR2_RTIC_OFFSET 10
243#define MXC_CCM_CGR2_RTIC_MASK (0x3 << 10)
244#define MXC_CCM_CGR2_FIRI_OFFSET 12
245#define MXC_CCM_CGR2_FIRI_MASK (0x3 << 12)
246#define MXC_CCM_CGR2_IPMUX1_OFFSET 14
247#define MXC_CCM_CGR2_IPMUX1_MASK (0x3 << 14)
248#define MXC_CCM_CGR2_IPMUX2_OFFSET 16
249#define MXC_CCM_CGR2_IPMUX2_MASK (0x3 << 16)
250
251/* These new CGR2 bits are added in MX32 */
252#define MXC_CCM_CGR2_APMSYSCLKSEL_OFFSET 18
253#define MXC_CCM_CGR2_APMSYSCLKSEL_MASK (0x3 << 18)
254#define MXC_CCM_CGR2_APMSSICLKSEL_OFFSET 20
255#define MXC_CCM_CGR2_APMSSICLKSEL_MASK (0x3 << 20)
256#define MXC_CCM_CGR2_APMPERCLKSEL_OFFSET 22
257#define MXC_CCM_CGR2_APMPERCLKSEL_MASK (0x3 << 22)
258#define MXC_CCM_CGR2_MXCCLKENSEL_OFFSET 24
259#define MXC_CCM_CGR2_MXCCLKENSEL_MASK (0x1 << 24)
260#define MXC_CCM_CGR2_CHIKCAMPEN_OFFSET 25
261#define MXC_CCM_CGR2_CHIKCAMPEN_MASK (0x1 << 25)
262#define MXC_CCM_CGR2_OVRVPUBUSY_OFFSET 26
263#define MXC_CCM_CGR2_OVRVPUBUSY_MASK (0x1 << 26)
264#define MXC_CCM_CGR2_APMENA_OFFSET 30
265#define MXC_CCM_CGR2_AOMENA_MASK (0x1 << 30)
266
267/* 114/*
268 * LTR0 register offsets 115 * LTR0 register offsets
269 */ 116 */
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index f8428800f286..380be0c9b213 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -25,6 +25,8 @@
25#include <mach/irqs.h> 25#include <mach/irqs.h>
26#include <mach/imx-uart.h> 26#include <mach/imx-uart.h>
27 27
28#include "devices.h"
29
28static struct resource uart0[] = { 30static struct resource uart0[] = {
29 { 31 {
30 .start = UART1_BASE_ADDR, 32 .start = UART1_BASE_ADDR,
@@ -82,6 +84,7 @@ struct platform_device mxc_uart_device2 = {
82 .num_resources = ARRAY_SIZE(uart2), 84 .num_resources = ARRAY_SIZE(uart2),
83}; 85};
84 86
87#ifdef CONFIG_ARCH_MX31
85static struct resource uart3[] = { 88static struct resource uart3[] = {
86 { 89 {
87 .start = UART4_BASE_ADDR, 90 .start = UART4_BASE_ADDR,
@@ -119,6 +122,7 @@ struct platform_device mxc_uart_device4 = {
119 .resource = uart4, 122 .resource = uart4,
120 .num_resources = ARRAY_SIZE(uart4), 123 .num_resources = ARRAY_SIZE(uart4),
121}; 124};
125#endif /* CONFIG_ARCH_MX31 */
122 126
123/* GPIO port description */ 127/* GPIO port description */
124static struct mxc_gpio_port imx_gpio_ports[] = { 128static struct mxc_gpio_port imx_gpio_ports[] = {
@@ -164,8 +168,8 @@ struct platform_device mxc_w1_master_device = {
164 168
165static struct resource mxc_nand_resources[] = { 169static struct resource mxc_nand_resources[] = {
166 { 170 {
167 .start = NFC_BASE_ADDR, 171 .start = 0, /* runtime dependent */
168 .end = NFC_BASE_ADDR + 0xfff, 172 .end = 0,
169 .flags = IORESOURCE_MEM 173 .flags = IORESOURCE_MEM
170 }, { 174 }, {
171 .start = MXC_INT_NANDFC, 175 .start = MXC_INT_NANDFC,
@@ -180,3 +184,188 @@ struct platform_device mxc_nand_device = {
180 .num_resources = ARRAY_SIZE(mxc_nand_resources), 184 .num_resources = ARRAY_SIZE(mxc_nand_resources),
181 .resource = mxc_nand_resources, 185 .resource = mxc_nand_resources,
182}; 186};
187
188static struct resource mxc_i2c0_resources[] = {
189 {
190 .start = I2C_BASE_ADDR,
191 .end = I2C_BASE_ADDR + SZ_4K - 1,
192 .flags = IORESOURCE_MEM,
193 },
194 {
195 .start = MXC_INT_I2C,
196 .end = MXC_INT_I2C,
197 .flags = IORESOURCE_IRQ,
198 },
199};
200
201struct platform_device mxc_i2c_device0 = {
202 .name = "imx-i2c",
203 .id = 0,
204 .num_resources = ARRAY_SIZE(mxc_i2c0_resources),
205 .resource = mxc_i2c0_resources,
206};
207
208static struct resource mxc_i2c1_resources[] = {
209 {
210 .start = I2C2_BASE_ADDR,
211 .end = I2C2_BASE_ADDR + SZ_4K - 1,
212 .flags = IORESOURCE_MEM,
213 },
214 {
215 .start = MXC_INT_I2C2,
216 .end = MXC_INT_I2C2,
217 .flags = IORESOURCE_IRQ,
218 },
219};
220
221struct platform_device mxc_i2c_device1 = {
222 .name = "imx-i2c",
223 .id = 1,
224 .num_resources = ARRAY_SIZE(mxc_i2c1_resources),
225 .resource = mxc_i2c1_resources,
226};
227
228static struct resource mxc_i2c2_resources[] = {
229 {
230 .start = I2C3_BASE_ADDR,
231 .end = I2C3_BASE_ADDR + SZ_4K - 1,
232 .flags = IORESOURCE_MEM,
233 },
234 {
235 .start = MXC_INT_I2C3,
236 .end = MXC_INT_I2C3,
237 .flags = IORESOURCE_IRQ,
238 },
239};
240
241struct platform_device mxc_i2c_device2 = {
242 .name = "imx-i2c",
243 .id = 2,
244 .num_resources = ARRAY_SIZE(mxc_i2c2_resources),
245 .resource = mxc_i2c2_resources,
246};
247
248#ifdef CONFIG_ARCH_MX31
249static struct resource mxcsdhc0_resources[] = {
250 {
251 .start = MMC_SDHC1_BASE_ADDR,
252 .end = MMC_SDHC1_BASE_ADDR + SZ_16K - 1,
253 .flags = IORESOURCE_MEM,
254 }, {
255 .start = MXC_INT_MMC_SDHC1,
256 .end = MXC_INT_MMC_SDHC1,
257 .flags = IORESOURCE_IRQ,
258 },
259};
260
261static struct resource mxcsdhc1_resources[] = {
262 {
263 .start = MMC_SDHC2_BASE_ADDR,
264 .end = MMC_SDHC2_BASE_ADDR + SZ_16K - 1,
265 .flags = IORESOURCE_MEM,
266 }, {
267 .start = MXC_INT_MMC_SDHC2,
268 .end = MXC_INT_MMC_SDHC2,
269 .flags = IORESOURCE_IRQ,
270 },
271};
272
273struct platform_device mxcsdhc_device0 = {
274 .name = "mxc-mmc",
275 .id = 0,
276 .num_resources = ARRAY_SIZE(mxcsdhc0_resources),
277 .resource = mxcsdhc0_resources,
278};
279
280struct platform_device mxcsdhc_device1 = {
281 .name = "mxc-mmc",
282 .id = 1,
283 .num_resources = ARRAY_SIZE(mxcsdhc1_resources),
284 .resource = mxcsdhc1_resources,
285};
286#endif /* CONFIG_ARCH_MX31 */
287
288/* i.MX31 Image Processing Unit */
289
290/* The resource order is important! */
291static struct resource mx3_ipu_rsrc[] = {
292 {
293 .start = IPU_CTRL_BASE_ADDR,
294 .end = IPU_CTRL_BASE_ADDR + 0x5F,
295 .flags = IORESOURCE_MEM,
296 }, {
297 .start = IPU_CTRL_BASE_ADDR + 0x88,
298 .end = IPU_CTRL_BASE_ADDR + 0xB3,
299 .flags = IORESOURCE_MEM,
300 }, {
301 .start = MXC_INT_IPU_SYN,
302 .end = MXC_INT_IPU_SYN,
303 .flags = IORESOURCE_IRQ,
304 }, {
305 .start = MXC_INT_IPU_ERR,
306 .end = MXC_INT_IPU_ERR,
307 .flags = IORESOURCE_IRQ,
308 },
309};
310
311struct platform_device mx3_ipu = {
312 .name = "ipu-core",
313 .id = -1,
314 .num_resources = ARRAY_SIZE(mx3_ipu_rsrc),
315 .resource = mx3_ipu_rsrc,
316};
317
318static struct resource fb_resources[] = {
319 {
320 .start = IPU_CTRL_BASE_ADDR + 0xB4,
321 .end = IPU_CTRL_BASE_ADDR + 0x1BF,
322 .flags = IORESOURCE_MEM,
323 },
324};
325
326struct platform_device mx3_fb = {
327 .name = "mx3_sdc_fb",
328 .id = -1,
329 .num_resources = ARRAY_SIZE(fb_resources),
330 .resource = fb_resources,
331 .dev = {
332 .coherent_dma_mask = 0xffffffff,
333 },
334};
335
336#ifdef CONFIG_ARCH_MX35
337static struct resource mxc_fec_resources[] = {
338 {
339 .start = MXC_FEC_BASE_ADDR,
340 .end = MXC_FEC_BASE_ADDR + 0xfff,
341 .flags = IORESOURCE_MEM
342 }, {
343 .start = MXC_INT_FEC,
344 .end = MXC_INT_FEC,
345 .flags = IORESOURCE_IRQ
346 },
347};
348
349struct platform_device mxc_fec_device = {
350 .name = "fec",
351 .id = 0,
352 .num_resources = ARRAY_SIZE(mxc_fec_resources),
353 .resource = mxc_fec_resources,
354};
355#endif
356
357static int mx3_devices_init(void)
358{
359 if (cpu_is_mx31()) {
360 mxc_nand_resources[0].start = MX31_NFC_BASE_ADDR;
361 mxc_nand_resources[0].end = MX31_NFC_BASE_ADDR + 0xfff;
362 }
363 if (cpu_is_mx35()) {
364 mxc_nand_resources[0].start = MX35_NFC_BASE_ADDR;
365 mxc_nand_resources[0].end = MX35_NFC_BASE_ADDR + 0xfff;
366 }
367
368 return 0;
369}
370
371subsys_initcall(mx3_devices_init);
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h
index 9949ef4e0694..88c04b296fab 100644
--- a/arch/arm/mach-mx3/devices.h
+++ b/arch/arm/mach-mx3/devices.h
@@ -6,3 +6,11 @@ extern struct platform_device mxc_uart_device3;
6extern struct platform_device mxc_uart_device4; 6extern struct platform_device mxc_uart_device4;
7extern struct platform_device mxc_w1_master_device; 7extern struct platform_device mxc_w1_master_device;
8extern struct platform_device mxc_nand_device; 8extern struct platform_device mxc_nand_device;
9extern struct platform_device mxc_i2c_device0;
10extern struct platform_device mxc_i2c_device1;
11extern struct platform_device mxc_i2c_device2;
12extern struct platform_device mx3_ipu;
13extern struct platform_device mx3_fb;
14extern struct platform_device mxc_fec_device;
15extern struct platform_device mxcsdhc_device0;
16extern struct platform_device mxcsdhc_device1;
diff --git a/arch/arm/mach-mx3/iomux.c b/arch/arm/mach-mx3/iomux.c
index 7a5088b519a8..40ffc5a664d9 100644
--- a/arch/arm/mach-mx3/iomux.c
+++ b/arch/arm/mach-mx3/iomux.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2004-2006 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> 3 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
4 * Copyright (C) 2009 by Valentin Longchamp <valentin.longchamp@epfl.ch>
4 * 5 *
5 * This program is free software; you can redistribute it and/or 6 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License 7 * modify it under the terms of the GNU General Public License
@@ -21,6 +22,7 @@
21#include <linux/spinlock.h> 22#include <linux/spinlock.h>
22#include <linux/io.h> 23#include <linux/io.h>
23#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/kernel.h>
24#include <mach/hardware.h> 26#include <mach/hardware.h>
25#include <mach/gpio.h> 27#include <mach/gpio.h>
26#include <mach/iomux-mx3.h> 28#include <mach/iomux-mx3.h>
@@ -38,6 +40,8 @@
38static DEFINE_SPINLOCK(gpio_mux_lock); 40static DEFINE_SPINLOCK(gpio_mux_lock);
39 41
40#define IOMUX_REG_MASK (IOMUX_PADNUM_MASK & ~0x3) 42#define IOMUX_REG_MASK (IOMUX_PADNUM_MASK & ~0x3)
43
44unsigned long mxc_pin_alloc_map[NB_PORTS * 32 / BITS_PER_LONG];
41/* 45/*
42 * set the mode for a IOMUX pin. 46 * set the mode for a IOMUX pin.
43 */ 47 */
@@ -50,9 +54,6 @@ int mxc_iomux_mode(unsigned int pin_mode)
50 field = pin_mode & 0x3; 54 field = pin_mode & 0x3;
51 mode = (pin_mode & IOMUX_MODE_MASK) >> IOMUX_MODE_SHIFT; 55 mode = (pin_mode & IOMUX_MODE_MASK) >> IOMUX_MODE_SHIFT;
52 56
53 pr_debug("%s: reg offset = 0x%x field = %d mode = 0x%02x\n",
54 __func__, (pin_mode & IOMUX_REG_MASK), field, mode);
55
56 spin_lock(&gpio_mux_lock); 57 spin_lock(&gpio_mux_lock);
57 58
58 l = __raw_readl(reg); 59 l = __raw_readl(reg);
@@ -93,6 +94,86 @@ void mxc_iomux_set_pad(enum iomux_pins pin, u32 config)
93EXPORT_SYMBOL(mxc_iomux_set_pad); 94EXPORT_SYMBOL(mxc_iomux_set_pad);
94 95
95/* 96/*
97 * setups a single pin:
98 * - reserves the pin so that it is not claimed by another driver
99 * - setups the iomux according to the configuration
100 * - if the pin is configured as a GPIO, we claim it through kernel gpiolib
101 */
102int mxc_iomux_setup_pin(const unsigned int pin, const char *label)
103{
104 unsigned pad = pin & IOMUX_PADNUM_MASK;
105 unsigned gpio;
106
107 if (pad >= (PIN_MAX + 1)) {
108 printk(KERN_ERR "mxc_iomux: Attempt to request nonexistant pin %u for \"%s\"\n",
109 pad, label ? label : "?");
110 return -EINVAL;
111 }
112
113 if (test_and_set_bit(pad, mxc_pin_alloc_map)) {
114 printk(KERN_ERR "mxc_iomux: pin %u already used. Allocation for \"%s\" failed\n",
115 pad, label ? label : "?");
116 return -EINVAL;
117 }
118 mxc_iomux_mode(pin);
119
120 /* if we have a gpio, we can allocate it */
121 gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT;
122 if (gpio < (GPIO_PORT_MAX + 1) * 32)
123 if (gpio_request(gpio, label))
124 return -EINVAL;
125
126 return 0;
127}
128EXPORT_SYMBOL(mxc_iomux_setup_pin);
129
130int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
131 const char *label)
132{
133 unsigned int *p = pin_list;
134 int i;
135 int ret = -EINVAL;
136
137 for (i = 0; i < count; i++) {
138 if (mxc_iomux_setup_pin(*p, label))
139 goto setup_error;
140 p++;
141 }
142 return 0;
143
144setup_error:
145 mxc_iomux_release_multiple_pins(pin_list, i);
146 return ret;
147}
148EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins);
149
150void mxc_iomux_release_pin(const unsigned int pin)
151{
152 unsigned pad = pin & IOMUX_PADNUM_MASK;
153 unsigned gpio;
154
155 if (pad < (PIN_MAX + 1))
156 clear_bit(pad, mxc_pin_alloc_map);
157
158 gpio = (pin & IOMUX_GPIONUM_MASK) >> IOMUX_GPIONUM_SHIFT;
159 if (gpio < (GPIO_PORT_MAX + 1) * 32)
160 gpio_free(gpio);
161}
162EXPORT_SYMBOL(mxc_iomux_release_pin);
163
164void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count)
165{
166 unsigned int *p = pin_list;
167 int i;
168
169 for (i = 0; i < count; i++) {
170 mxc_iomux_release_pin(*p);
171 p++;
172 }
173}
174EXPORT_SYMBOL(mxc_iomux_release_multiple_pins);
175
176/*
96 * This function enables/disables the general purpose function for a particular 177 * This function enables/disables the general purpose function for a particular
97 * signal. 178 * signal.
98 */ 179 */
@@ -111,4 +192,3 @@ void mxc_iomux_set_gpr(enum iomux_gp_func gp, bool en)
111 spin_unlock(&gpio_mux_lock); 192 spin_unlock(&gpio_mux_lock);
112} 193}
113EXPORT_SYMBOL(mxc_iomux_set_gpr); 194EXPORT_SYMBOL(mxc_iomux_set_gpr);
114
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c
index 0589b5cd33c7..9e1459cb4b74 100644
--- a/arch/arm/mach-mx3/mm.c
+++ b/arch/arm/mach-mx3/mm.c
@@ -22,10 +22,14 @@
22 22
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <mach/hardware.h> 25#include <linux/err.h>
26
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/hardware/cache-l2x0.h>
30
28#include <mach/common.h> 31#include <mach/common.h>
32#include <mach/hardware.h>
29 33
30/*! 34/*!
31 * @file mm.c 35 * @file mm.c
@@ -50,6 +54,16 @@ static struct map_desc mxc_io_desc[] __initdata = {
50 .pfn = __phys_to_pfn(AVIC_BASE_ADDR), 54 .pfn = __phys_to_pfn(AVIC_BASE_ADDR),
51 .length = AVIC_SIZE, 55 .length = AVIC_SIZE,
52 .type = MT_DEVICE_NONSHARED 56 .type = MT_DEVICE_NONSHARED
57 }, {
58 .virtual = AIPS1_BASE_ADDR_VIRT,
59 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
60 .length = AIPS1_SIZE,
61 .type = MT_DEVICE_NONSHARED
62 }, {
63 .virtual = AIPS2_BASE_ADDR_VIRT,
64 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
65 .length = AIPS2_SIZE,
66 .type = MT_DEVICE_NONSHARED
53 }, 67 },
54}; 68};
55 69
@@ -62,3 +76,24 @@ void __init mxc_map_io(void)
62{ 76{
63 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 77 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
64} 78}
79
80#ifdef CONFIG_CACHE_L2X0
81static int mxc_init_l2x0(void)
82{
83 void __iomem *l2x0_base;
84
85 l2x0_base = ioremap(L2CC_BASE_ADDR, 4096);
86 if (IS_ERR(l2x0_base)) {
87 printk(KERN_ERR "remapping L2 cache area failed with %ld\n",
88 PTR_ERR(l2x0_base));
89 return 0;
90 }
91
92 l2x0_init(l2x0_base, 0x00030024, 0x00000000);
93
94 return 0;
95}
96
97arch_initcall(mxc_init_l2x0);
98#endif
99
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c
index f902a7c37c31..83e5e8e1276f 100644
--- a/arch/arm/mach-mx3/mx31ads.c
+++ b/arch/arm/mach-mx3/mx31ads.c
@@ -22,6 +22,8 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25#include <linux/gpio.h>
26#include <linux/i2c.h>
25#include <linux/irq.h> 27#include <linux/irq.h>
26 28
27#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -35,6 +37,12 @@
35#include <mach/imx-uart.h> 37#include <mach/imx-uart.h>
36#include <mach/iomux-mx3.h> 38#include <mach/iomux-mx3.h>
37 39
40#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
41#include <linux/mfd/wm8350/audio.h>
42#include <linux/mfd/wm8350/core.h>
43#include <linux/mfd/wm8350/pmic.h>
44#endif
45
38#include "devices.h" 46#include "devices.h"
39 47
40/*! 48/*!
@@ -94,13 +102,16 @@ static struct imxuart_platform_data uart_pdata = {
94 .flags = IMXUART_HAVE_RTSCTS, 102 .flags = IMXUART_HAVE_RTSCTS,
95}; 103};
96 104
105static int uart_pins[] = {
106 MX31_PIN_CTS1__CTS1,
107 MX31_PIN_RTS1__RTS1,
108 MX31_PIN_TXD1__TXD1,
109 MX31_PIN_RXD1__RXD1
110};
111
97static inline void mxc_init_imx_uart(void) 112static inline void mxc_init_imx_uart(void)
98{ 113{
99 mxc_iomux_mode(MX31_PIN_CTS1__CTS1); 114 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0");
100 mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
101 mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
102 mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
103
104 mxc_register_device(&mxc_uart_device0, &uart_pdata); 115 mxc_register_device(&mxc_uart_device0, &uart_pdata);
105} 116}
106#else /* !SERIAL_IMX */ 117#else /* !SERIAL_IMX */
@@ -176,7 +187,7 @@ static void __init mx31ads_init_expio(void)
176 /* 187 /*
177 * Configure INT line as GPIO input 188 * Configure INT line as GPIO input
178 */ 189 */
179 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO)); 190 mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO1_4, IOMUX_CONFIG_GPIO), "expio");
180 191
181 /* disable the interrupt and clear the status */ 192 /* disable the interrupt and clear the status */
182 __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG); 193 __raw_writew(0xFFFF, PBC_INTMASK_CLEAR_REG);
@@ -191,26 +202,301 @@ static void __init mx31ads_init_expio(void)
191 set_irq_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler); 202 set_irq_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler);
192} 203}
193 204
205#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
206/* This section defines setup for the Wolfson Microelectronics
207 * 1133-EV1 PMU/audio board. When other PMU boards are supported the
208 * regulator definitions may be shared with them, but for now they can
209 * only be used with this board so would generate warnings about
210 * unused statics and some of the configuration is specific to this
211 * module.
212 */
213
214/* CPU */
215static struct regulator_consumer_supply sw1a_consumers[] = {
216 {
217 .supply = "cpu_vcc",
218 }
219};
220
221static struct regulator_init_data sw1a_data = {
222 .constraints = {
223 .name = "SW1A",
224 .min_uV = 1275000,
225 .max_uV = 1600000,
226 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
227 REGULATOR_CHANGE_MODE,
228 .valid_modes_mask = REGULATOR_MODE_NORMAL |
229 REGULATOR_MODE_FAST,
230 .state_mem = {
231 .uV = 1400000,
232 .mode = REGULATOR_MODE_NORMAL,
233 .enabled = 1,
234 },
235 .initial_state = PM_SUSPEND_MEM,
236 .always_on = 1,
237 .boot_on = 1,
238 },
239 .num_consumer_supplies = ARRAY_SIZE(sw1a_consumers),
240 .consumer_supplies = sw1a_consumers,
241};
242
243/* System IO - High */
244static struct regulator_init_data viohi_data = {
245 .constraints = {
246 .name = "VIOHO",
247 .min_uV = 2800000,
248 .max_uV = 2800000,
249 .state_mem = {
250 .uV = 2800000,
251 .mode = REGULATOR_MODE_NORMAL,
252 .enabled = 1,
253 },
254 .initial_state = PM_SUSPEND_MEM,
255 .always_on = 1,
256 .boot_on = 1,
257 },
258};
259
260/* System IO - Low */
261static struct regulator_init_data violo_data = {
262 .constraints = {
263 .name = "VIOLO",
264 .min_uV = 1800000,
265 .max_uV = 1800000,
266 .state_mem = {
267 .uV = 1800000,
268 .mode = REGULATOR_MODE_NORMAL,
269 .enabled = 1,
270 },
271 .initial_state = PM_SUSPEND_MEM,
272 .always_on = 1,
273 .boot_on = 1,
274 },
275};
276
277/* DDR RAM */
278static struct regulator_init_data sw2a_data = {
279 .constraints = {
280 .name = "SW2A",
281 .min_uV = 1800000,
282 .max_uV = 1800000,
283 .valid_modes_mask = REGULATOR_MODE_NORMAL,
284 .state_mem = {
285 .uV = 1800000,
286 .mode = REGULATOR_MODE_NORMAL,
287 .enabled = 1,
288 },
289 .state_disk = {
290 .mode = REGULATOR_MODE_NORMAL,
291 .enabled = 0,
292 },
293 .always_on = 1,
294 .boot_on = 1,
295 .initial_state = PM_SUSPEND_MEM,
296 },
297};
298
299static struct regulator_init_data ldo1_data = {
300 .constraints = {
301 .name = "VCAM/VMMC1/VMMC2",
302 .min_uV = 2800000,
303 .max_uV = 2800000,
304 .valid_modes_mask = REGULATOR_MODE_NORMAL,
305 .apply_uV = 1,
306 },
307};
308
309static struct regulator_consumer_supply ldo2_consumers[] = {
310 {
311 .supply = "AVDD",
312 },
313 {
314 .supply = "HPVDD",
315 },
316};
317
318/* CODEC and SIM */
319static struct regulator_init_data ldo2_data = {
320 .constraints = {
321 .name = "VESIM/VSIM/AVDD",
322 .min_uV = 3300000,
323 .max_uV = 3300000,
324 .valid_modes_mask = REGULATOR_MODE_NORMAL,
325 .apply_uV = 1,
326 },
327 .num_consumer_supplies = ARRAY_SIZE(ldo2_consumers),
328 .consumer_supplies = ldo2_consumers,
329};
330
331/* General */
332static struct regulator_init_data vdig_data = {
333 .constraints = {
334 .name = "VDIG",
335 .min_uV = 1500000,
336 .max_uV = 1500000,
337 .valid_modes_mask = REGULATOR_MODE_NORMAL,
338 .apply_uV = 1,
339 .always_on = 1,
340 .boot_on = 1,
341 },
342};
343
344/* Tranceivers */
345static struct regulator_init_data ldo4_data = {
346 .constraints = {
347 .name = "VRF1/CVDD_2.775",
348 .min_uV = 2500000,
349 .max_uV = 2500000,
350 .valid_modes_mask = REGULATOR_MODE_NORMAL,
351 .apply_uV = 1,
352 .always_on = 1,
353 .boot_on = 1,
354 },
355};
356
357static struct wm8350_led_platform_data wm8350_led_data = {
358 .name = "wm8350:white",
359 .default_trigger = "heartbeat",
360 .max_uA = 27899,
361};
362
363static struct wm8350_audio_platform_data imx32ads_wm8350_setup = {
364 .vmid_discharge_msecs = 1000,
365 .drain_msecs = 30,
366 .cap_discharge_msecs = 700,
367 .vmid_charge_msecs = 700,
368 .vmid_s_curve = WM8350_S_CURVE_SLOW,
369 .dis_out4 = WM8350_DISCHARGE_SLOW,
370 .dis_out3 = WM8350_DISCHARGE_SLOW,
371 .dis_out2 = WM8350_DISCHARGE_SLOW,
372 .dis_out1 = WM8350_DISCHARGE_SLOW,
373 .vroi_out4 = WM8350_TIE_OFF_500R,
374 .vroi_out3 = WM8350_TIE_OFF_500R,
375 .vroi_out2 = WM8350_TIE_OFF_500R,
376 .vroi_out1 = WM8350_TIE_OFF_500R,
377 .vroi_enable = 0,
378 .codec_current_on = WM8350_CODEC_ISEL_1_0,
379 .codec_current_standby = WM8350_CODEC_ISEL_0_5,
380 .codec_current_charge = WM8350_CODEC_ISEL_1_5,
381};
382
383static int mx31_wm8350_init(struct wm8350 *wm8350)
384{
385 int i;
386
387 wm8350_gpio_config(wm8350, 0, WM8350_GPIO_DIR_IN,
388 WM8350_GPIO0_PWR_ON_IN, WM8350_GPIO_ACTIVE_LOW,
389 WM8350_GPIO_PULL_UP, WM8350_GPIO_INVERT_OFF,
390 WM8350_GPIO_DEBOUNCE_ON);
391
392 wm8350_gpio_config(wm8350, 3, WM8350_GPIO_DIR_IN,
393 WM8350_GPIO3_PWR_OFF_IN, WM8350_GPIO_ACTIVE_HIGH,
394 WM8350_GPIO_PULL_DOWN, WM8350_GPIO_INVERT_OFF,
395 WM8350_GPIO_DEBOUNCE_ON);
396
397 wm8350_gpio_config(wm8350, 4, WM8350_GPIO_DIR_IN,
398 WM8350_GPIO4_MR_IN, WM8350_GPIO_ACTIVE_HIGH,
399 WM8350_GPIO_PULL_DOWN, WM8350_GPIO_INVERT_OFF,
400 WM8350_GPIO_DEBOUNCE_OFF);
401
402 wm8350_gpio_config(wm8350, 7, WM8350_GPIO_DIR_IN,
403 WM8350_GPIO7_HIBERNATE_IN, WM8350_GPIO_ACTIVE_HIGH,
404 WM8350_GPIO_PULL_DOWN, WM8350_GPIO_INVERT_OFF,
405 WM8350_GPIO_DEBOUNCE_OFF);
406
407 wm8350_gpio_config(wm8350, 6, WM8350_GPIO_DIR_OUT,
408 WM8350_GPIO6_SDOUT_OUT, WM8350_GPIO_ACTIVE_HIGH,
409 WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF,
410 WM8350_GPIO_DEBOUNCE_OFF);
411
412 wm8350_gpio_config(wm8350, 8, WM8350_GPIO_DIR_OUT,
413 WM8350_GPIO8_VCC_FAULT_OUT, WM8350_GPIO_ACTIVE_LOW,
414 WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF,
415 WM8350_GPIO_DEBOUNCE_OFF);
416
417 wm8350_gpio_config(wm8350, 9, WM8350_GPIO_DIR_OUT,
418 WM8350_GPIO9_BATT_FAULT_OUT, WM8350_GPIO_ACTIVE_LOW,
419 WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF,
420 WM8350_GPIO_DEBOUNCE_OFF);
421
422 /* Fix up for our own supplies. */
423 for (i = 0; i < ARRAY_SIZE(ldo2_consumers); i++)
424 ldo2_consumers[i].dev = wm8350->dev;
425
426 wm8350_register_regulator(wm8350, WM8350_DCDC_1, &sw1a_data);
427 wm8350_register_regulator(wm8350, WM8350_DCDC_3, &viohi_data);
428 wm8350_register_regulator(wm8350, WM8350_DCDC_4, &violo_data);
429 wm8350_register_regulator(wm8350, WM8350_DCDC_6, &sw2a_data);
430 wm8350_register_regulator(wm8350, WM8350_LDO_1, &ldo1_data);
431 wm8350_register_regulator(wm8350, WM8350_LDO_2, &ldo2_data);
432 wm8350_register_regulator(wm8350, WM8350_LDO_3, &vdig_data);
433 wm8350_register_regulator(wm8350, WM8350_LDO_4, &ldo4_data);
434
435 /* LEDs */
436 wm8350_dcdc_set_slot(wm8350, WM8350_DCDC_5, 1, 1,
437 WM8350_DC5_ERRACT_SHUTDOWN_CONV);
438 wm8350_isink_set_flash(wm8350, WM8350_ISINK_A,
439 WM8350_ISINK_FLASH_DISABLE,
440 WM8350_ISINK_FLASH_TRIG_BIT,
441 WM8350_ISINK_FLASH_DUR_32MS,
442 WM8350_ISINK_FLASH_ON_INSTANT,
443 WM8350_ISINK_FLASH_OFF_INSTANT,
444 WM8350_ISINK_FLASH_MODE_EN);
445 wm8350_dcdc25_set_mode(wm8350, WM8350_DCDC_5,
446 WM8350_ISINK_MODE_BOOST,
447 WM8350_ISINK_ILIM_NORMAL,
448 WM8350_DC5_RMP_20V,
449 WM8350_DC5_FBSRC_ISINKA);
450 wm8350_register_led(wm8350, 0, WM8350_DCDC_5, WM8350_ISINK_A,
451 &wm8350_led_data);
452
453 wm8350->codec.platform_data = &imx32ads_wm8350_setup;
454
455 return 0;
456}
457
458static struct wm8350_platform_data __initdata mx31_wm8350_pdata = {
459 .init = mx31_wm8350_init,
460};
461#endif
462
463#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE)
464static struct i2c_board_info __initdata mx31ads_i2c1_devices[] = {
465#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
466 {
467 I2C_BOARD_INFO("wm8350", 0x1a),
468 .platform_data = &mx31_wm8350_pdata,
469 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3),
470 },
471#endif
472};
473
474static void mxc_init_i2c(void)
475{
476 i2c_register_board_info(1, mx31ads_i2c1_devices,
477 ARRAY_SIZE(mx31ads_i2c1_devices));
478
479 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_ALT1));
480 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_ALT1));
481
482 mxc_register_device(&mxc_i2c_device1, NULL);
483}
484#else
485static void mxc_init_i2c(void)
486{
487}
488#endif
489
194/*! 490/*!
195 * This structure defines static mappings for the i.MX31ADS board. 491 * This structure defines static mappings for the i.MX31ADS board.
196 */ 492 */
197static struct map_desc mx31ads_io_desc[] __initdata = { 493static struct map_desc mx31ads_io_desc[] __initdata = {
198 { 494 {
199 .virtual = AIPS1_BASE_ADDR_VIRT,
200 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
201 .length = AIPS1_SIZE,
202 .type = MT_DEVICE_NONSHARED
203 }, {
204 .virtual = SPBA0_BASE_ADDR_VIRT, 495 .virtual = SPBA0_BASE_ADDR_VIRT,
205 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), 496 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
206 .length = SPBA0_SIZE, 497 .length = SPBA0_SIZE,
207 .type = MT_DEVICE_NONSHARED 498 .type = MT_DEVICE_NONSHARED
208 }, { 499 }, {
209 .virtual = AIPS2_BASE_ADDR_VIRT,
210 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
211 .length = AIPS2_SIZE,
212 .type = MT_DEVICE_NONSHARED
213 }, {
214 .virtual = CS4_BASE_ADDR_VIRT, 500 .virtual = CS4_BASE_ADDR_VIRT,
215 .pfn = __phys_to_pfn(CS4_BASE_ADDR), 501 .pfn = __phys_to_pfn(CS4_BASE_ADDR),
216 .length = CS4_SIZE / 2, 502 .length = CS4_SIZE / 2,
@@ -221,13 +507,13 @@ static struct map_desc mx31ads_io_desc[] __initdata = {
221/*! 507/*!
222 * Set up static virtual mappings. 508 * Set up static virtual mappings.
223 */ 509 */
224void __init mx31ads_map_io(void) 510static void __init mx31ads_map_io(void)
225{ 511{
226 mxc_map_io(); 512 mxc_map_io();
227 iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc)); 513 iotable_init(mx31ads_io_desc, ARRAY_SIZE(mx31ads_io_desc));
228} 514}
229 515
230void __init mx31ads_init_irq(void) 516static void __init mx31ads_init_irq(void)
231{ 517{
232 mxc_init_irq(); 518 mxc_init_irq();
233 mx31ads_init_expio(); 519 mx31ads_init_expio();
@@ -240,15 +526,15 @@ static void __init mxc_board_init(void)
240{ 526{
241 mxc_init_extuart(); 527 mxc_init_extuart();
242 mxc_init_imx_uart(); 528 mxc_init_imx_uart();
529 mxc_init_i2c();
243} 530}
244 531
245static void __init mx31ads_timer_init(void) 532static void __init mx31ads_timer_init(void)
246{ 533{
247 mxc_clocks_init(26000000); 534 mx31_clocks_init(26000000);
248 mxc_timer_init("ipg_clk.0");
249} 535}
250 536
251struct sys_timer mx31ads_timer = { 537static struct sys_timer mx31ads_timer = {
252 .init = mx31ads_timer_init, 538 .init = mx31ads_timer_init,
253}; 539};
254 540
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mx31lite.c
index c43440070143..894d98cd9941 100644
--- a/arch/arm/mach-mx3/mx31lite.c
+++ b/arch/arm/mach-mx3/mx31lite.c
@@ -42,21 +42,11 @@
42 */ 42 */
43static struct map_desc mx31lite_io_desc[] __initdata = { 43static struct map_desc mx31lite_io_desc[] __initdata = {
44 { 44 {
45 .virtual = AIPS1_BASE_ADDR_VIRT,
46 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
47 .length = AIPS1_SIZE,
48 .type = MT_DEVICE_NONSHARED
49 }, {
50 .virtual = SPBA0_BASE_ADDR_VIRT, 45 .virtual = SPBA0_BASE_ADDR_VIRT,
51 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), 46 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
52 .length = SPBA0_SIZE, 47 .length = SPBA0_SIZE,
53 .type = MT_DEVICE_NONSHARED 48 .type = MT_DEVICE_NONSHARED
54 }, { 49 }, {
55 .virtual = AIPS2_BASE_ADDR_VIRT,
56 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
57 .length = AIPS2_SIZE,
58 .type = MT_DEVICE_NONSHARED
59 }, {
60 .virtual = CS4_BASE_ADDR_VIRT, 50 .virtual = CS4_BASE_ADDR_VIRT,
61 .pfn = __phys_to_pfn(CS4_BASE_ADDR), 51 .pfn = __phys_to_pfn(CS4_BASE_ADDR),
62 .length = CS4_SIZE, 52 .length = CS4_SIZE,
@@ -82,8 +72,7 @@ static void __init mxc_board_init(void)
82 72
83static void __init mx31lite_timer_init(void) 73static void __init mx31lite_timer_init(void)
84{ 74{
85 mxc_clocks_init(26000000); 75 mx31_clocks_init(26000000);
86 mxc_timer_init("ipg_clk.0");
87} 76}
88 77
89struct sys_timer mx31lite_timer = { 78struct sys_timer mx31lite_timer = {
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
new file mode 100644
index 000000000000..d080b4add79c
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
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
19#include <linux/types.h>
20#include <linux/init.h>
21
22#include <linux/platform_device.h>
23
24#include <mach/hardware.h>
25#include <mach/common.h>
26#include <mach/imx-uart.h>
27#include <mach/iomux-mx3.h>
28
29#include "devices.h"
30
31static struct imxuart_platform_data uart_pdata = {
32 .flags = IMXUART_HAVE_RTSCTS,
33};
34
35static int mxc_uart1_pins[] = {
36 MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2,
37 MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2,
38};
39
40/*
41 * system init for baseboard usage. Will be called by mx31moboard init.
42 */
43void __init mx31moboard_devboard_init(void)
44{
45 printk(KERN_INFO "Initializing mx31devboard peripherals\n");
46 mxc_iomux_setup_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins), "uart1");
47 mxc_register_device(&mxc_uart_device1, &uart_pdata);
48}
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
new file mode 100644
index 000000000000..9ef9566823fb
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
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
19#include <linux/types.h>
20#include <linux/init.h>
21
22#include <linux/platform_device.h>
23
24#include <mach/hardware.h>
25#include <mach/common.h>
26#include <mach/imx-uart.h>
27#include <mach/iomux-mx3.h>
28
29#include "devices.h"
30
31/*
32 * system init for baseboard usage. Will be called by mx31moboard init.
33 */
34void __init mx31moboard_marxbot_init(void)
35{
36 printk(KERN_INFO "Initializing mx31marxbot peripherals\n");
37}
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c
index c29098af7394..34c2a1b99d4f 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mx31moboard.c
@@ -32,6 +32,7 @@
32#include <mach/common.h> 32#include <mach/common.h>
33#include <mach/imx-uart.h> 33#include <mach/imx-uart.h>
34#include <mach/iomux-mx3.h> 34#include <mach/iomux-mx3.h>
35#include <mach/board-mx31moboard.h>
35 36
36#include "devices.h" 37#include "devices.h"
37 38
@@ -63,6 +64,18 @@ static struct platform_device *devices[] __initdata = {
63 &mx31moboard_flash, 64 &mx31moboard_flash,
64}; 65};
65 66
67static int mxc_uart0_pins[] = {
68 MX31_PIN_CTS1__CTS1, MX31_PIN_RTS1__RTS1,
69 MX31_PIN_TXD1__TXD1, MX31_PIN_RXD1__RXD1,
70};
71static int mxc_uart4_pins[] = {
72 MX31_PIN_PC_RST__CTS5, MX31_PIN_PC_VS2__RTS5,
73 MX31_PIN_PC_BVD2__TXD5, MX31_PIN_PC_BVD1__RXD5,
74};
75
76static int mx31moboard_baseboard;
77core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
78
66/* 79/*
67 * Board specific initialization. 80 * Board specific initialization.
68 */ 81 */
@@ -70,58 +83,29 @@ static void __init mxc_board_init(void)
70{ 83{
71 platform_add_devices(devices, ARRAY_SIZE(devices)); 84 platform_add_devices(devices, ARRAY_SIZE(devices));
72 85
73 mxc_iomux_mode(MX31_PIN_CTS1__CTS1); 86 mxc_iomux_setup_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins), "uart0");
74 mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
75 mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
76 mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
77
78 mxc_register_device(&mxc_uart_device0, &uart_pdata); 87 mxc_register_device(&mxc_uart_device0, &uart_pdata);
79 88
80 mxc_iomux_mode(MX31_PIN_CTS2__CTS2); 89 mxc_iomux_setup_multiple_pins(mxc_uart4_pins, ARRAY_SIZE(mxc_uart4_pins), "uart4");
81 mxc_iomux_mode(MX31_PIN_RTS2__RTS2);
82 mxc_iomux_mode(MX31_PIN_TXD2__TXD2);
83 mxc_iomux_mode(MX31_PIN_RXD2__RXD2);
84
85 mxc_register_device(&mxc_uart_device1, &uart_pdata);
86
87 mxc_iomux_mode(MX31_PIN_PC_RST__CTS5);
88 mxc_iomux_mode(MX31_PIN_PC_VS2__RTS5);
89 mxc_iomux_mode(MX31_PIN_PC_BVD2__TXD5);
90 mxc_iomux_mode(MX31_PIN_PC_BVD1__RXD5);
91
92 mxc_register_device(&mxc_uart_device4, &uart_pdata); 90 mxc_register_device(&mxc_uart_device4, &uart_pdata);
93}
94 91
95/* 92 switch (mx31moboard_baseboard) {
96 * This structure defines static mappings for the mx31moboard. 93 case MX31NOBOARD:
97 */ 94 break;
98static struct map_desc mx31moboard_io_desc[] __initdata = { 95 case MX31DEVBOARD:
99 { 96 mx31moboard_devboard_init();
100 .virtual = AIPS1_BASE_ADDR_VIRT, 97 break;
101 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), 98 case MX31MARXBOT:
102 .length = AIPS1_SIZE, 99 mx31moboard_marxbot_init();
103 .type = MT_DEVICE_NONSHARED 100 break;
104 }, { 101 default:
105 .virtual = AIPS2_BASE_ADDR_VIRT, 102 printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n", mx31moboard_baseboard);
106 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), 103 }
107 .length = AIPS2_SIZE,
108 .type = MT_DEVICE_NONSHARED
109 },
110};
111
112/*
113 * Set up static virtual mappings.
114 */
115void __init mx31moboard_map_io(void)
116{
117 mxc_map_io();
118 iotable_init(mx31moboard_io_desc, ARRAY_SIZE(mx31moboard_io_desc));
119} 104}
120 105
121static void __init mx31moboard_timer_init(void) 106static void __init mx31moboard_timer_init(void)
122{ 107{
123 mxc_clocks_init(26000000); 108 mx31_clocks_init(26000000);
124 mxc_timer_init("ipg_clk.0");
125} 109}
126 110
127struct sys_timer mx31moboard_timer = { 111struct sys_timer mx31moboard_timer = {
@@ -133,7 +117,7 @@ MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
133 .phys_io = AIPS1_BASE_ADDR, 117 .phys_io = AIPS1_BASE_ADDR,
134 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 118 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
135 .boot_params = PHYS_OFFSET + 0x100, 119 .boot_params = PHYS_OFFSET + 0x100,
136 .map_io = mx31moboard_map_io, 120 .map_io = mxc_map_io,
137 .init_irq = mxc_init_irq, 121 .init_irq = mxc_init_irq,
138 .init_machine = mxc_board_init, 122 .init_machine = mxc_board_init,
139 .timer = &mx31moboard_timer, 123 .timer = &mx31moboard_timer,
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mx31pdk.c
index d464d068a4a6..bc63f1785691 100644
--- a/arch/arm/mach-mx3/mx31pdk.c
+++ b/arch/arm/mach-mx3/mx31pdk.c
@@ -45,40 +45,17 @@ static struct imxuart_platform_data uart_pdata = {
45 .flags = IMXUART_HAVE_RTSCTS, 45 .flags = IMXUART_HAVE_RTSCTS,
46}; 46};
47 47
48static inline void mxc_init_imx_uart(void) 48static int uart_pins[] = {
49{ 49 MX31_PIN_CTS1__CTS1,
50 mxc_iomux_mode(MX31_PIN_CTS1__CTS1); 50 MX31_PIN_RTS1__RTS1,
51 mxc_iomux_mode(MX31_PIN_RTS1__RTS1); 51 MX31_PIN_TXD1__TXD1,
52 mxc_iomux_mode(MX31_PIN_TXD1__TXD1); 52 MX31_PIN_RXD1__RXD1
53 mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
54
55 mxc_register_device(&mxc_uart_device0, &uart_pdata);
56}
57
58/*!
59 * This structure defines static mappings for the i.MX31PDK board.
60 */
61static struct map_desc mx31pdk_io_desc[] __initdata = {
62 {
63 .virtual = AIPS1_BASE_ADDR_VIRT,
64 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
65 .length = AIPS1_SIZE,
66 .type = MT_DEVICE_NONSHARED
67 }, {
68 .virtual = AIPS2_BASE_ADDR_VIRT,
69 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
70 .length = AIPS2_SIZE,
71 .type = MT_DEVICE_NONSHARED
72 },
73}; 53};
74 54
75/*! 55static inline void mxc_init_imx_uart(void)
76 * Set up static virtual mappings.
77 */
78static void __init mx31pdk_map_io(void)
79{ 56{
80 mxc_map_io(); 57 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0");
81 iotable_init(mx31pdk_io_desc, ARRAY_SIZE(mx31pdk_io_desc)); 58 mxc_register_device(&mxc_uart_device0, &uart_pdata);
82} 59}
83 60
84/*! 61/*!
@@ -91,8 +68,7 @@ static void __init mxc_board_init(void)
91 68
92static void __init mx31pdk_timer_init(void) 69static void __init mx31pdk_timer_init(void)
93{ 70{
94 mxc_clocks_init(26000000); 71 mx31_clocks_init(26000000);
95 mxc_timer_init("ipg_clk.0");
96} 72}
97 73
98static struct sys_timer mx31pdk_timer = { 74static struct sys_timer mx31pdk_timer = {
@@ -108,7 +84,7 @@ MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
108 .phys_io = AIPS1_BASE_ADDR, 84 .phys_io = AIPS1_BASE_ADDR,
109 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 85 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
110 .boot_params = PHYS_OFFSET + 0x100, 86 .boot_params = PHYS_OFFSET + 0x100,
111 .map_io = mx31pdk_map_io, 87 .map_io = mxc_map_io,
112 .init_irq = mxc_init_irq, 88 .init_irq = mxc_init_irq,
113 .init_machine = mxc_board_init, 89 .init_machine = mxc_board_init,
114 .timer = &mx31pdk_timer, 90 .timer = &mx31pdk_timer,
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index 8cea82587222..5fce022114de 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -26,6 +26,8 @@
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/smc911x.h> 27#include <linux/smc911x.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/i2c.h>
30#include <linux/i2c/at24.h>
29 31
30#include <mach/hardware.h> 32#include <mach/hardware.h>
31#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -37,6 +39,10 @@
37#include <mach/iomux-mx3.h> 39#include <mach/iomux-mx3.h>
38#include <mach/board-pcm037.h> 40#include <mach/board-pcm037.h>
39#include <mach/mxc_nand.h> 41#include <mach/mxc_nand.h>
42#include <mach/mmc.h>
43#ifdef CONFIG_I2C_IMX
44#include <mach/i2c.h>
45#endif
40 46
41#include "devices.h" 47#include "devices.h"
42 48
@@ -117,12 +123,90 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
117 .hw_ecc = 1, 123 .hw_ecc = 1,
118}; 124};
119 125
126#ifdef CONFIG_I2C_IMX
127static int i2c_1_pins[] = {
128 MX31_PIN_CSPI2_MOSI__SCL,
129 MX31_PIN_CSPI2_MISO__SDA,
130};
131
132static int pcm037_i2c_1_init(struct device *dev)
133{
134 return mxc_iomux_setup_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins),
135 "i2c-1");
136}
137
138static void pcm037_i2c_1_exit(struct device *dev)
139{
140 mxc_iomux_release_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins));
141}
142
143static struct imxi2c_platform_data pcm037_i2c_1_data = {
144 .bitrate = 100000,
145 .init = pcm037_i2c_1_init,
146 .exit = pcm037_i2c_1_exit,
147};
148
149static struct at24_platform_data board_eeprom = {
150 .byte_len = 4096,
151 .page_size = 32,
152 .flags = AT24_FLAG_ADDR16,
153};
154
155static struct i2c_board_info pcm037_i2c_devices[] = {
156 {
157 I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
158 .platform_data = &board_eeprom,
159 }, {
160 I2C_BOARD_INFO("rtc-pcf8563", 0x51),
161 .type = "pcf8563",
162 }
163};
164#endif
165
166static int sdhc1_pins[] = {
167 MX31_PIN_SD1_DATA3__SD1_DATA3,
168 MX31_PIN_SD1_DATA2__SD1_DATA2,
169 MX31_PIN_SD1_DATA1__SD1_DATA1,
170 MX31_PIN_SD1_DATA0__SD1_DATA0,
171 MX31_PIN_SD1_CLK__SD1_CLK,
172 MX31_PIN_SD1_CMD__SD1_CMD,
173};
174
175static int pcm970_sdhc1_init(struct device *dev, irq_handler_t h, void *data)
176{
177 return mxc_iomux_setup_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins),
178 "sdhc-1");
179}
180
181static void pcm970_sdhc1_exit(struct device *dev, void *data)
182{
183 mxc_iomux_release_multiple_pins(sdhc1_pins, ARRAY_SIZE(sdhc1_pins));
184}
185
186/* No card and rw detection at the moment */
187static struct imxmmc_platform_data sdhc_pdata = {
188 .init = pcm970_sdhc1_init,
189 .exit = pcm970_sdhc1_exit,
190};
191
120static struct platform_device *devices[] __initdata = { 192static struct platform_device *devices[] __initdata = {
121 &pcm037_flash, 193 &pcm037_flash,
122 &pcm037_eth, 194 &pcm037_eth,
123 &pcm037_sram_device, 195 &pcm037_sram_device,
124}; 196};
125 197
198static int uart0_pins[] = {
199 MX31_PIN_CTS1__CTS1,
200 MX31_PIN_RTS1__RTS1,
201 MX31_PIN_TXD1__TXD1,
202 MX31_PIN_RXD1__RXD1
203};
204
205static int uart2_pins[] = {
206 MX31_PIN_CSPI3_MOSI__RXD3,
207 MX31_PIN_CSPI3_MISO__TXD3
208};
209
126/* 210/*
127 * Board specific initialization. 211 * Board specific initialization.
128 */ 212 */
@@ -130,59 +214,33 @@ static void __init mxc_board_init(void)
130{ 214{
131 platform_add_devices(devices, ARRAY_SIZE(devices)); 215 platform_add_devices(devices, ARRAY_SIZE(devices));
132 216
133 mxc_iomux_mode(MX31_PIN_CTS1__CTS1); 217 mxc_iomux_setup_multiple_pins(uart0_pins, ARRAY_SIZE(uart0_pins), "uart-0");
134 mxc_iomux_mode(MX31_PIN_RTS1__RTS1);
135 mxc_iomux_mode(MX31_PIN_TXD1__TXD1);
136 mxc_iomux_mode(MX31_PIN_RXD1__RXD1);
137
138 mxc_register_device(&mxc_uart_device0, &uart_pdata); 218 mxc_register_device(&mxc_uart_device0, &uart_pdata);
139 219
140 mxc_iomux_mode(MX31_PIN_CSPI3_MOSI__RXD3); 220 mxc_iomux_setup_multiple_pins(uart2_pins, ARRAY_SIZE(uart2_pins), "uart-2");
141 mxc_iomux_mode(MX31_PIN_CSPI3_MISO__TXD3);
142
143 mxc_register_device(&mxc_uart_device2, &uart_pdata); 221 mxc_register_device(&mxc_uart_device2, &uart_pdata);
144 222
145 mxc_iomux_mode(MX31_PIN_BATT_LINE__OWIRE); 223 mxc_iomux_setup_pin(MX31_PIN_BATT_LINE__OWIRE, "batt-0wire");
146 mxc_register_device(&mxc_w1_master_device, NULL); 224 mxc_register_device(&mxc_w1_master_device, NULL);
147 225
148 /* SMSC9215 IRQ pin */ 226 /* SMSC9215 IRQ pin */
149 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO)); 227 if (!mxc_iomux_setup_pin(IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO),
150 if (!gpio_request(MX31_PIN_GPIO3_1, "pcm037-eth")) 228 "pcm037-eth"))
151 gpio_direction_input(MX31_PIN_GPIO3_1); 229 gpio_direction_input(MX31_PIN_GPIO3_1);
152 230
153 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); 231#ifdef CONFIG_I2C_IMX
154} 232 i2c_register_board_info(1, pcm037_i2c_devices,
233 ARRAY_SIZE(pcm037_i2c_devices));
155 234
156/* 235 mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data);
157 * This structure defines static mappings for the pcm037 board. 236#endif
158 */ 237 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
159static struct map_desc pcm037_io_desc[] __initdata = { 238 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
160 {
161 .virtual = AIPS1_BASE_ADDR_VIRT,
162 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
163 .length = AIPS1_SIZE,
164 .type = MT_DEVICE_NONSHARED
165 }, {
166 .virtual = AIPS2_BASE_ADDR_VIRT,
167 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
168 .length = AIPS2_SIZE,
169 .type = MT_DEVICE_NONSHARED
170 },
171};
172
173/*
174 * Set up static virtual mappings.
175 */
176void __init pcm037_map_io(void)
177{
178 mxc_map_io();
179 iotable_init(pcm037_io_desc, ARRAY_SIZE(pcm037_io_desc));
180} 239}
181 240
182static void __init pcm037_timer_init(void) 241static void __init pcm037_timer_init(void)
183{ 242{
184 mxc_clocks_init(26000000); 243 mx31_clocks_init(26000000);
185 mxc_timer_init("ipg_clk.0");
186} 244}
187 245
188struct sys_timer pcm037_timer = { 246struct sys_timer pcm037_timer = {
@@ -194,7 +252,7 @@ MACHINE_START(PCM037, "Phytec Phycore pcm037")
194 .phys_io = AIPS1_BASE_ADDR, 252 .phys_io = AIPS1_BASE_ADDR,
195 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 253 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
196 .boot_params = PHYS_OFFSET + 0x100, 254 .boot_params = PHYS_OFFSET + 0x100,
197 .map_io = pcm037_map_io, 255 .map_io = mxc_map_io,
198 .init_irq = mxc_init_irq, 256 .init_irq = mxc_init_irq,
199 .init_machine = mxc_board_init, 257 .init_machine = mxc_board_init,
200 .timer = &pcm037_timer, 258 .timer = &pcm037_timer,
diff --git a/arch/arm/mach-mx3/qong.c b/arch/arm/mach-mx3/qong.c
new file mode 100644
index 000000000000..6c4283cec6f4
--- /dev/null
+++ b/arch/arm/mach-mx3/qong.c
@@ -0,0 +1,312 @@
1/*
2 * Copyright (C) 2009 Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
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
19#include <linux/types.h>
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/memory.h>
23#include <linux/platform_device.h>
24#include <linux/mtd/physmap.h>
25#include <linux/mtd/nand.h>
26#include <linux/gpio.h>
27
28#include <mach/hardware.h>
29#include <mach/irqs.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 <mach/common.h>
35#include <asm/page.h>
36#include <asm/setup.h>
37#include <mach/board-qong.h>
38#include <mach/imx-uart.h>
39#include <mach/iomux-mx3.h>
40#include "devices.h"
41
42/* FPGA defines */
43#define QONG_FPGA_VERSION(major, minor, rev) \
44 (((major & 0xF) << 12) | ((minor & 0xF) << 8) | (rev & 0xFF))
45
46#define QONG_FPGA_BASEADDR CS1_BASE_ADDR
47#define QONG_FPGA_PERIPH_SIZE (1 << 24)
48
49#define QONG_FPGA_CTRL_BASEADDR QONG_FPGA_BASEADDR
50#define QONG_FPGA_CTRL_SIZE 0x10
51/* FPGA control registers */
52#define QONG_FPGA_CTRL_VERSION 0x00
53
54#define QONG_DNET_ID 1
55#define QONG_DNET_BASEADDR \
56 (QONG_FPGA_BASEADDR + QONG_DNET_ID * QONG_FPGA_PERIPH_SIZE)
57#define QONG_DNET_SIZE 0x00001000
58
59#define QONG_FPGA_IRQ IOMUX_TO_IRQ(MX31_PIN_DTR_DCE1)
60
61/*
62 * This file contains the board-specific initialization routines.
63 */
64
65static struct imxuart_platform_data uart_pdata = {
66 .flags = IMXUART_HAVE_RTSCTS,
67};
68
69static int uart_pins[] = {
70 MX31_PIN_CTS1__CTS1,
71 MX31_PIN_RTS1__RTS1,
72 MX31_PIN_TXD1__TXD1,
73 MX31_PIN_RXD1__RXD1
74};
75
76static inline void mxc_init_imx_uart(void)
77{
78 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins),
79 "uart-0");
80 mxc_register_device(&mxc_uart_device0, &uart_pdata);
81}
82
83static struct resource dnet_resources[] = {
84 [0] = {
85 .name = "dnet-memory",
86 .start = QONG_DNET_BASEADDR,
87 .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1,
88 .flags = IORESOURCE_MEM,
89 },
90 [1] = {
91 .start = QONG_FPGA_IRQ,
92 .end = QONG_FPGA_IRQ,
93 .flags = IORESOURCE_IRQ,
94 },
95};
96
97static struct platform_device dnet_device = {
98 .name = "dnet",
99 .id = -1,
100 .num_resources = ARRAY_SIZE(dnet_resources),
101 .resource = dnet_resources,
102};
103
104static int __init qong_init_dnet(void)
105{
106 int ret;
107
108 ret = platform_device_register(&dnet_device);
109 return ret;
110}
111
112/* MTD NOR flash */
113
114static struct physmap_flash_data qong_flash_data = {
115 .width = 2,
116};
117
118static struct resource qong_flash_resource = {
119 .start = CS0_BASE_ADDR,
120 .end = CS0_BASE_ADDR + QONG_NOR_SIZE - 1,
121 .flags = IORESOURCE_MEM,
122};
123
124static struct platform_device qong_nor_mtd_device = {
125 .name = "physmap-flash",
126 .id = 0,
127 .dev = {
128 .platform_data = &qong_flash_data,
129 },
130 .resource = &qong_flash_resource,
131 .num_resources = 1,
132};
133
134static void qong_init_nor_mtd(void)
135{
136 (void)platform_device_register(&qong_nor_mtd_device);
137}
138
139/*
140 * Hardware specific access to control-lines
141 */
142static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
143{
144 struct nand_chip *nand_chip = mtd->priv;
145
146 if (cmd == NAND_CMD_NONE)
147 return;
148
149 if (ctrl & NAND_CLE)
150 writeb(cmd, nand_chip->IO_ADDR_W + (1 << 24));
151 else
152 writeb(cmd, nand_chip->IO_ADDR_W + (1 << 23));
153}
154
155/*
156 * Read the Device Ready pin.
157 */
158static int qong_nand_device_ready(struct mtd_info *mtd)
159{
160 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_NFRB));
161}
162
163static void qong_nand_select_chip(struct mtd_info *mtd, int chip)
164{
165 if (chip >= 0)
166 gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 0);
167 else
168 gpio_set_value(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 1);
169}
170
171static struct platform_nand_data qong_nand_data = {
172 .chip = {
173 .chip_delay = 20,
174 .options = 0,
175 },
176 .ctrl = {
177 .cmd_ctrl = qong_nand_cmd_ctrl,
178 .dev_ready = qong_nand_device_ready,
179 .select_chip = qong_nand_select_chip,
180 }
181};
182
183static struct resource qong_nand_resource = {
184 .start = CS3_BASE_ADDR,
185 .end = CS3_BASE_ADDR + SZ_32M - 1,
186 .flags = IORESOURCE_MEM,
187};
188
189static struct platform_device qong_nand_device = {
190 .name = "gen_nand",
191 .id = -1,
192 .dev = {
193 .platform_data = &qong_nand_data,
194 },
195 .num_resources = 1,
196 .resource = &qong_nand_resource,
197};
198
199static void __init qong_init_nand_mtd(void)
200{
201 /* init CS */
202 __raw_writel(0x00004f00, CSCR_U(3));
203 __raw_writel(0x20013b31, CSCR_L(3));
204 __raw_writel(0x00020800, CSCR_A(3));
205 mxc_iomux_set_gpr(MUX_SDCTL_CSD1_SEL, true);
206
207 /* enable pin */
208 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_NFCE_B, IOMUX_CONFIG_GPIO));
209 if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), "nand_enable"))
210 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_NFCE_B), 0);
211
212 /* ready/busy pin */
213 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_NFRB, IOMUX_CONFIG_GPIO));
214 if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_NFRB), "nand_rdy"))
215 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_NFRB));
216
217 /* write protect pin */
218 mxc_iomux_mode(IOMUX_MODE(MX31_PIN_NFWP_B, IOMUX_CONFIG_GPIO));
219 if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_NFWP_B), "nand_wp"))
220 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_NFWP_B));
221
222 platform_device_register(&qong_nand_device);
223}
224
225static void __init qong_init_fpga(void)
226{
227 void __iomem *regs;
228 u32 fpga_ver;
229
230 regs = ioremap(QONG_FPGA_CTRL_BASEADDR, QONG_FPGA_CTRL_SIZE);
231 if (!regs) {
232 printk(KERN_ERR "%s: failed to map registers, aborting.\n",
233 __func__);
234 return;
235 }
236
237 fpga_ver = readl(regs + QONG_FPGA_CTRL_VERSION);
238 iounmap(regs);
239 printk(KERN_INFO "Qong FPGA version %d.%d.%d\n",
240 (fpga_ver & 0xF000) >> 12,
241 (fpga_ver & 0x0F00) >> 8, fpga_ver & 0x00FF);
242 if (fpga_ver < QONG_FPGA_VERSION(0, 8, 7)) {
243 printk(KERN_ERR "qong: Unexpected FPGA version, FPGA-based "
244 "devices won't be registered!\n");
245 return;
246 }
247
248 /* register FPGA-based devices */
249 qong_init_nand_mtd();
250 qong_init_dnet();
251}
252
253/*
254 * This structure defines the MX31 memory map.
255 */
256static struct map_desc qong_io_desc[] __initdata = {
257 {
258 .virtual = AIPS1_BASE_ADDR_VIRT,
259 .pfn = __phys_to_pfn(AIPS1_BASE_ADDR),
260 .length = AIPS1_SIZE,
261 .type = MT_DEVICE_NONSHARED
262 }, {
263 .virtual = AIPS2_BASE_ADDR_VIRT,
264 .pfn = __phys_to_pfn(AIPS2_BASE_ADDR),
265 .length = AIPS2_SIZE,
266 .type = MT_DEVICE_NONSHARED
267 }
268};
269
270/*
271 * Set up static virtual mappings.
272 */
273static void __init qong_map_io(void)
274{
275 mxc_map_io();
276 iotable_init(qong_io_desc, ARRAY_SIZE(qong_io_desc));
277}
278
279/*
280 * Board specific initialization.
281 */
282static void __init mxc_board_init(void)
283{
284 mxc_init_imx_uart();
285 qong_init_nor_mtd();
286 qong_init_fpga();
287}
288
289static void __init qong_timer_init(void)
290{
291 mx31_clocks_init(26000000);
292}
293
294static struct sys_timer qong_timer = {
295 .init = qong_timer_init,
296};
297
298/*
299 * The following uses standard kernel macros defined in arch.h in order to
300 * initialize __mach_desc_QONG data structure.
301 */
302
303MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
304 /* Maintainer: DENX Software Engineering GmbH */
305 .phys_io = AIPS1_BASE_ADDR,
306 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
307 .boot_params = PHYS_OFFSET + 0x100,
308 .map_io = qong_map_io,
309 .init_irq = mxc_init_irq,
310 .init_machine = mxc_board_init,
311 .timer = &qong_timer,
312MACHINE_END
diff --git a/arch/arm/mach-netx/include/mach/system.h b/arch/arm/mach-netx/include/mach/system.h
index 6c1023b8a9ab..dc7b4bc003c5 100644
--- a/arch/arm/mach-netx/include/mach/system.h
+++ b/arch/arm/mach-netx/include/mach/system.h
@@ -28,7 +28,7 @@ static inline void arch_idle(void)
28 cpu_do_idle(); 28 cpu_do_idle();
29} 29}
30 30
31static inline void arch_reset(char mode) 31static inline void arch_reset(char mode, const char *cmd)
32{ 32{
33 writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES, 33 writel(NETX_SYSTEM_RES_CR_FIRMW_RES_EN | NETX_SYSTEM_RES_CR_FIRMW_RES,
34 NETX_SYSTEM_RES_CR); 34 NETX_SYSTEM_RES_CR);
diff --git a/arch/arm/mach-ns9xxx/include/mach/system.h b/arch/arm/mach-ns9xxx/include/mach/system.h
index e2068c57415f..1561588ca364 100644
--- a/arch/arm/mach-ns9xxx/include/mach/system.h
+++ b/arch/arm/mach-ns9xxx/include/mach/system.h
@@ -20,7 +20,7 @@ static inline void arch_idle(void)
20 cpu_do_idle(); 20 cpu_do_idle();
21} 21}
22 22
23static inline void arch_reset(char mode) 23static inline void arch_reset(char mode, const char *cmd)
24{ 24{
25#ifdef CONFIG_PROCESSOR_NS9360 25#ifdef CONFIG_PROCESSOR_NS9360
26 if (processor_is_ns9360()) 26 if (processor_is_ns9360())
diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c
index 22e0eb6e9ec4..feb0e54a91de 100644
--- a/arch/arm/mach-ns9xxx/irq.c
+++ b/arch/arm/mach-ns9xxx/irq.c
@@ -63,7 +63,6 @@ static struct irq_chip ns9xxx_chip = {
63#else 63#else
64static void handle_prio_irq(unsigned int irq, struct irq_desc *desc) 64static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
65{ 65{
66 unsigned int cpu = smp_processor_id();
67 struct irqaction *action; 66 struct irqaction *action;
68 irqreturn_t action_ret; 67 irqreturn_t action_ret;
69 68
@@ -72,7 +71,7 @@ static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
72 BUG_ON(desc->status & IRQ_INPROGRESS); 71 BUG_ON(desc->status & IRQ_INPROGRESS);
73 72
74 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); 73 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
75 kstat_cpu(cpu).irqs[irq]++; 74 kstat_incr_irqs_this_cpu(irq, desc);
76 75
77 action = desc->action; 76 action = desc->action;
78 if (unlikely(!action || (desc->status & IRQ_DISABLED))) 77 if (unlikely(!action || (desc->status & IRQ_DISABLED)))
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 10a301e32434..3f325d3718a9 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -7,6 +7,11 @@ config ARCH_OMAP730
7 select CPU_ARM926T 7 select CPU_ARM926T
8 select ARCH_OMAP_OTG 8 select ARCH_OMAP_OTG
9 9
10config ARCH_OMAP850
11 depends on ARCH_OMAP1
12 bool "OMAP850 Based System"
13 select CPU_ARM926T
14
10config ARCH_OMAP15XX 15config ARCH_OMAP15XX
11 depends on ARCH_OMAP1 16 depends on ARCH_OMAP1
12 default y 17 default y
@@ -46,6 +51,12 @@ config MACH_OMAP_H3
46 TI OMAP 1710 H3 board support. Say Y here if you have such 51 TI OMAP 1710 H3 board support. Say Y here if you have such
47 a board. 52 a board.
48 53
54config MACH_OMAP_HTCWIZARD
55 bool "HTC Wizard"
56 depends on ARCH_OMAP850
57 help
58 HTC Wizard smartphone support (AKA QTEK 9100, ...)
59
49config MACH_OMAP_OSK 60config MACH_OMAP_OSK
50 bool "TI OSK Support" 61 bool "TI OSK Support"
51 depends on ARCH_OMAP1 && ARCH_OMAP16XX 62 depends on ARCH_OMAP1 && ARCH_OMAP16XX
@@ -163,7 +174,7 @@ config OMAP_ARM_216MHZ
163 174
164config OMAP_ARM_195MHZ 175config OMAP_ARM_195MHZ
165 bool "OMAP ARM 195 MHz CPU" 176 bool "OMAP ARM 195 MHz CPU"
166 depends on ARCH_OMAP1 && ARCH_OMAP730 177 depends on ARCH_OMAP1 && (ARCH_OMAP730 || ARCH_OMAP850)
167 help 178 help
168 Enable 195MHz clock for OMAP CPU. If unsure, say N. 179 Enable 195MHz clock for OMAP CPU. If unsure, say N.
169 180
@@ -175,13 +186,13 @@ config OMAP_ARM_192MHZ
175 186
176config OMAP_ARM_182MHZ 187config OMAP_ARM_182MHZ
177 bool "OMAP ARM 182 MHz CPU" 188 bool "OMAP ARM 182 MHz CPU"
178 depends on ARCH_OMAP1 && ARCH_OMAP730 189 depends on ARCH_OMAP1 && (ARCH_OMAP730 || ARCH_OMAP850)
179 help 190 help
180 Enable 182MHz clock for OMAP CPU. If unsure, say N. 191 Enable 182MHz clock for OMAP CPU. If unsure, say N.
181 192
182config OMAP_ARM_168MHZ 193config OMAP_ARM_168MHZ
183 bool "OMAP ARM 168 MHz CPU" 194 bool "OMAP ARM 168 MHz CPU"
184 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730) 195 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
185 help 196 help
186 Enable 168MHz clock for OMAP CPU. If unsure, say N. 197 Enable 168MHz clock for OMAP CPU. If unsure, say N.
187 198
@@ -193,20 +204,20 @@ config OMAP_ARM_150MHZ
193 204
194config OMAP_ARM_120MHZ 205config OMAP_ARM_120MHZ
195 bool "OMAP ARM 120 MHz CPU" 206 bool "OMAP ARM 120 MHz CPU"
196 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730) 207 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
197 help 208 help
198 Enable 120MHz clock for OMAP CPU. If unsure, say N. 209 Enable 120MHz clock for OMAP CPU. If unsure, say N.
199 210
200config OMAP_ARM_60MHZ 211config OMAP_ARM_60MHZ
201 bool "OMAP ARM 60 MHz CPU" 212 bool "OMAP ARM 60 MHz CPU"
202 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730) 213 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
203 default y 214 default y
204 help 215 help
205 Enable 60MHz clock for OMAP CPU. If unsure, say Y. 216 Enable 60MHz clock for OMAP CPU. If unsure, say Y.
206 217
207config OMAP_ARM_30MHZ 218config OMAP_ARM_30MHZ
208 bool "OMAP ARM 30 MHz CPU" 219 bool "OMAP ARM 30 MHz CPU"
209 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730) 220 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_OMAP850)
210 help 221 help
211 Enable 30MHz clock for OMAP CPU. If unsure, say N. 222 Enable 30MHz clock for OMAP CPU. If unsure, say N.
212 223
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 2e618391cc51..8b40aace9db4 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -175,7 +175,6 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
175static struct omap_board_config_kernel ams_delta_config[] = { 175static struct omap_board_config_kernel ams_delta_config[] = {
176 { OMAP_TAG_LCD, &ams_delta_lcd_config }, 176 { OMAP_TAG_LCD, &ams_delta_lcd_config },
177 { OMAP_TAG_UART, &ams_delta_uart_config }, 177 { OMAP_TAG_UART, &ams_delta_uart_config },
178 { OMAP_TAG_USB, &ams_delta_usb_config },
179}; 178};
180 179
181static struct resource ams_delta_kp_resources[] = { 180static struct resource ams_delta_kp_resources[] = {
@@ -232,6 +231,7 @@ static void __init ams_delta_init(void)
232 /* Clear latch2 (NAND, LCD, modem enable) */ 231 /* Clear latch2 (NAND, LCD, modem enable) */
233 ams_delta_latch2_write(~0, 0); 232 ams_delta_latch2_write(~0, 0);
234 233
234 omap_usb_init(&ams_delta_usb_config);
235 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 235 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
236} 236}
237 237
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 30308294e7c1..19e0e9232336 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -34,7 +34,39 @@
34#include <mach/keypad.h> 34#include <mach/keypad.h>
35#include <mach/common.h> 35#include <mach/common.h>
36#include <mach/board.h> 36#include <mach/board.h>
37#include <mach/board-fsample.h> 37
38/* fsample is pretty close to p2-sample */
39
40#define fsample_cpld_read(reg) __raw_readb(reg)
41#define fsample_cpld_write(val, reg) __raw_writeb(val, reg)
42
43#define FSAMPLE_CPLD_BASE 0xE8100000
44#define FSAMPLE_CPLD_SIZE SZ_4K
45#define FSAMPLE_CPLD_START 0x05080000
46
47#define FSAMPLE_CPLD_REG_A (FSAMPLE_CPLD_BASE + 0x00)
48#define FSAMPLE_CPLD_SWITCH (FSAMPLE_CPLD_BASE + 0x02)
49#define FSAMPLE_CPLD_UART (FSAMPLE_CPLD_BASE + 0x02)
50#define FSAMPLE_CPLD_REG_B (FSAMPLE_CPLD_BASE + 0x04)
51#define FSAMPLE_CPLD_VERSION (FSAMPLE_CPLD_BASE + 0x06)
52#define FSAMPLE_CPLD_SET_CLR (FSAMPLE_CPLD_BASE + 0x06)
53
54#define FSAMPLE_CPLD_BIT_BT_RESET 0
55#define FSAMPLE_CPLD_BIT_LCD_RESET 1
56#define FSAMPLE_CPLD_BIT_CAM_PWDN 2
57#define FSAMPLE_CPLD_BIT_CHARGER_ENABLE 3
58#define FSAMPLE_CPLD_BIT_SD_MMC_EN 4
59#define FSAMPLE_CPLD_BIT_aGPS_PWREN 5
60#define FSAMPLE_CPLD_BIT_BACKLIGHT 6
61#define FSAMPLE_CPLD_BIT_aGPS_EN_RESET 7
62#define FSAMPLE_CPLD_BIT_aGPS_SLEEPx_N 8
63#define FSAMPLE_CPLD_BIT_OTG_RESET 9
64
65#define fsample_cpld_set(bit) \
66 fsample_cpld_write((((bit) & 15) << 4) | 0x0f, FSAMPLE_CPLD_SET_CLR)
67
68#define fsample_cpld_clear(bit) \
69 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR)
38 70
39static int fsample_keymap[] = { 71static int fsample_keymap[] = {
40 KEY(0,0,KEY_UP), 72 KEY(0,0,KEY_UP),
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 7d2670205373..e724940e86f2 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -62,7 +62,6 @@ static struct omap_uart_config generic_uart_config __initdata = {
62}; 62};
63 63
64static struct omap_board_config_kernel generic_config[] __initdata = { 64static struct omap_board_config_kernel generic_config[] __initdata = {
65 { OMAP_TAG_USB, NULL },
66 { OMAP_TAG_UART, &generic_uart_config }, 65 { OMAP_TAG_UART, &generic_uart_config },
67}; 66};
68 67
@@ -70,12 +69,12 @@ static void __init omap_generic_init(void)
70{ 69{
71#ifdef CONFIG_ARCH_OMAP15XX 70#ifdef CONFIG_ARCH_OMAP15XX
72 if (cpu_is_omap15xx()) { 71 if (cpu_is_omap15xx()) {
73 generic_config[0].data = &generic1510_usb_config; 72 omap_usb_init(&generic1510_usb_config);
74 } 73 }
75#endif 74#endif
76#if defined(CONFIG_ARCH_OMAP16XX) 75#if defined(CONFIG_ARCH_OMAP16XX)
77 if (!cpu_is_omap1510()) { 76 if (!cpu_is_omap1510()) {
78 generic_config[0].data = &generic1610_usb_config; 77 omap_usb_init(&generic1610_usb_config);
79 } 78 }
80#endif 79#endif
81 80
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c
index 409fa56d0a87..44d4a966bed9 100644
--- a/arch/arm/mach-omap1/board-h2-mmc.c
+++ b/arch/arm/mach-omap1/board-h2-mmc.c
@@ -19,6 +19,8 @@
19#include <mach/mmc.h> 19#include <mach/mmc.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21 21
22#include "board-h2.h"
23
22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 24#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
23 25
24static int mmc_set_power(struct device *dev, int slot, int power_on, 26static int mmc_set_power(struct device *dev, int slot, int power_on,
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 0d784a795092..f695aa053ac8 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -46,6 +46,11 @@
46#include <mach/keypad.h> 46#include <mach/keypad.h>
47#include <mach/common.h> 47#include <mach/common.h>
48 48
49#include "board-h2.h"
50
51/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
52#define OMAP1610_ETHR_START 0x04000300
53
49static int h2_keymap[] = { 54static int h2_keymap[] = {
50 KEY(0, 0, KEY_LEFT), 55 KEY(0, 0, KEY_LEFT),
51 KEY(0, 1, KEY_RIGHT), 56 KEY(0, 1, KEY_RIGHT),
@@ -364,7 +369,6 @@ static struct omap_lcd_config h2_lcd_config __initdata = {
364}; 369};
365 370
366static struct omap_board_config_kernel h2_config[] __initdata = { 371static struct omap_board_config_kernel h2_config[] __initdata = {
367 { OMAP_TAG_USB, &h2_usb_config },
368 { OMAP_TAG_UART, &h2_uart_config }, 372 { OMAP_TAG_UART, &h2_uart_config },
369 { OMAP_TAG_LCD, &h2_lcd_config }, 373 { OMAP_TAG_LCD, &h2_lcd_config },
370}; 374};
@@ -413,6 +417,7 @@ static void __init h2_init(void)
413 omap_serial_init(); 417 omap_serial_init();
414 omap_register_i2c_bus(1, 100, h2_i2c_board_info, 418 omap_register_i2c_bus(1, 100, h2_i2c_board_info,
415 ARRAY_SIZE(h2_i2c_board_info)); 419 ARRAY_SIZE(h2_i2c_board_info));
420 omap_usb_init(&h2_usb_config);
416 h2_mmc_init(); 421 h2_mmc_init();
417} 422}
418 423
diff --git a/arch/arm/plat-omap/include/mach/board-h2.h b/arch/arm/mach-omap1/board-h2.h
index 15531c8dc0e6..315e2662547e 100644
--- a/arch/arm/plat-omap/include/mach/board-h2.h
+++ b/arch/arm/mach-omap1/board-h2.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/board-h2.h 2 * arch/arm/mach-omap1/board-h2.h
3 * 3 *
4 * Hardware definitions for TI OMAP1610 H2 board. 4 * Hardware definitions for TI OMAP1610 H2 board.
5 * 5 *
@@ -29,9 +29,6 @@
29#ifndef __ASM_ARCH_OMAP_H2_H 29#ifndef __ASM_ARCH_OMAP_H2_H
30#define __ASM_ARCH_OMAP_H2_H 30#define __ASM_ARCH_OMAP_H2_H
31 31
32/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
33#define OMAP1610_ETHR_START 0x04000300
34
35#define H2_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */) 32#define H2_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
36# define H2_TPS_GPIO_MMC_PWR_EN (H2_TPS_GPIO_BASE + 3) 33# define H2_TPS_GPIO_MMC_PWR_EN (H2_TPS_GPIO_BASE + 3)
37 34
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c
index fdfe793d56f2..0d8a3c195e2e 100644
--- a/arch/arm/mach-omap1/board-h3-mmc.c
+++ b/arch/arm/mach-omap1/board-h3-mmc.c
@@ -19,6 +19,8 @@
19#include <mach/mmc.h> 19#include <mach/mmc.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21 21
22#include "board-h3.h"
23
22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 24#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
23 25
24static int mmc_set_power(struct device *dev, int slot, int power_on, 26static int mmc_set_power(struct device *dev, int slot, int power_on,
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index bf08b6ad22ee..4695965114c4 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -50,6 +50,11 @@
50#include <mach/dma.h> 50#include <mach/dma.h>
51#include <mach/common.h> 51#include <mach/common.h>
52 52
53#include "board-h3.h"
54
55/* In OMAP1710 H3 the Ethernet is directly connected to CS1 */
56#define OMAP1710_ETHR_START 0x04000300
57
53#define H3_TS_GPIO 48 58#define H3_TS_GPIO 48
54 59
55static int h3_keymap[] = { 60static int h3_keymap[] = {
@@ -418,7 +423,6 @@ static struct omap_lcd_config h3_lcd_config __initdata = {
418}; 423};
419 424
420static struct omap_board_config_kernel h3_config[] __initdata = { 425static struct omap_board_config_kernel h3_config[] __initdata = {
421 { OMAP_TAG_USB, &h3_usb_config },
422 { OMAP_TAG_UART, &h3_uart_config }, 426 { OMAP_TAG_UART, &h3_uart_config },
423 { OMAP_TAG_LCD, &h3_lcd_config }, 427 { OMAP_TAG_LCD, &h3_lcd_config },
424}; 428};
@@ -472,6 +476,7 @@ static void __init h3_init(void)
472 omap_serial_init(); 476 omap_serial_init();
473 omap_register_i2c_bus(1, 100, h3_i2c_board_info, 477 omap_register_i2c_bus(1, 100, h3_i2c_board_info,
474 ARRAY_SIZE(h3_i2c_board_info)); 478 ARRAY_SIZE(h3_i2c_board_info));
479 omap_usb_init(&h3_usb_config);
475 h3_mmc_init(); 480 h3_mmc_init();
476} 481}
477 482
diff --git a/arch/arm/plat-omap/include/mach/board-h3.h b/arch/arm/mach-omap1/board-h3.h
index 1888326da7ea..78de535be3c5 100644
--- a/arch/arm/plat-omap/include/mach/board-h3.h
+++ b/arch/arm/mach-omap1/board-h3.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/board-h3.h 2 * arch/arm/mach-omap1/board-h3.h
3 * 3 *
4 * Copyright (C) 2001 RidgeRun, Inc. 4 * Copyright (C) 2001 RidgeRun, Inc.
5 * Copyright (C) 2004 Texas Instruments, Inc. 5 * Copyright (C) 2004 Texas Instruments, Inc.
@@ -27,9 +27,6 @@
27#ifndef __ASM_ARCH_OMAP_H3_H 27#ifndef __ASM_ARCH_OMAP_H3_H
28#define __ASM_ARCH_OMAP_H3_H 28#define __ASM_ARCH_OMAP_H3_H
29 29
30/* In OMAP1710 H3 the Ethernet is directly connected to CS1 */
31#define OMAP1710_ETHR_START 0x04000300
32
33#define H3_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */) 30#define H3_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
34# define H3_TPS_GPIO_MMC_PWR_EN (H3_TPS_GPIO_BASE + 4) 31# define H3_TPS_GPIO_MMC_PWR_EN (H3_TPS_GPIO_BASE + 4)
35 32
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 071cd02a734e..2fd98260ea49 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -39,6 +39,9 @@
39#include <mach/common.h> 39#include <mach/common.h>
40#include <mach/mmc.h> 40#include <mach/mmc.h>
41 41
42/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
43#define INNOVATOR1610_ETHR_START 0x04000300
44
42static int innovator_keymap[] = { 45static int innovator_keymap[] = {
43 KEY(0, 0, KEY_F1), 46 KEY(0, 0, KEY_F1),
44 KEY(0, 3, KEY_DOWN), 47 KEY(0, 3, KEY_DOWN),
@@ -370,7 +373,6 @@ static struct omap_uart_config innovator_uart_config __initdata = {
370}; 373};
371 374
372static struct omap_board_config_kernel innovator_config[] = { 375static struct omap_board_config_kernel innovator_config[] = {
373 { OMAP_TAG_USB, NULL },
374 { OMAP_TAG_LCD, NULL }, 376 { OMAP_TAG_LCD, NULL },
375 { OMAP_TAG_UART, &innovator_uart_config }, 377 { OMAP_TAG_UART, &innovator_uart_config },
376}; 378};
@@ -392,13 +394,13 @@ static void __init innovator_init(void)
392 394
393#ifdef CONFIG_ARCH_OMAP15XX 395#ifdef CONFIG_ARCH_OMAP15XX
394 if (cpu_is_omap1510()) { 396 if (cpu_is_omap1510()) {
395 innovator_config[0].data = &innovator1510_usb_config; 397 omap_usb_init(&innovator1510_usb_config);
396 innovator_config[1].data = &innovator1510_lcd_config; 398 innovator_config[1].data = &innovator1510_lcd_config;
397 } 399 }
398#endif 400#endif
399#ifdef CONFIG_ARCH_OMAP16XX 401#ifdef CONFIG_ARCH_OMAP16XX
400 if (cpu_is_omap1610()) { 402 if (cpu_is_omap1610()) {
401 innovator_config[0].data = &h2_usb_config; 403 omap_usb_init(&h2_usb_config);
402 innovator_config[1].data = &innovator1610_lcd_config; 404 innovator_config[1].data = &innovator1610_lcd_config;
403 } 405 }
404#endif 406#endif
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index af51e0b180f2..7bc7a3cb9c51 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -233,10 +233,6 @@ static inline void nokia770_mmc_init(void)
233} 233}
234#endif 234#endif
235 235
236static struct omap_board_config_kernel nokia770_config[] __initdata = {
237 { OMAP_TAG_USB, NULL },
238};
239
240#if defined(CONFIG_OMAP_DSP) 236#if defined(CONFIG_OMAP_DSP)
241/* 237/*
242 * audio power control 238 * audio power control
@@ -371,19 +367,16 @@ static __init int omap_dsp_init(void)
371 367
372static void __init omap_nokia770_init(void) 368static void __init omap_nokia770_init(void)
373{ 369{
374 nokia770_config[0].data = &nokia770_usb_config;
375
376 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); 370 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
377 spi_register_board_info(nokia770_spi_board_info, 371 spi_register_board_info(nokia770_spi_board_info,
378 ARRAY_SIZE(nokia770_spi_board_info)); 372 ARRAY_SIZE(nokia770_spi_board_info));
379 omap_board_config = nokia770_config;
380 omap_board_config_size = ARRAY_SIZE(nokia770_config);
381 omap_gpio_init(); 373 omap_gpio_init();
382 omap_serial_init(); 374 omap_serial_init();
383 omap_register_i2c_bus(1, 100, NULL, 0); 375 omap_register_i2c_bus(1, 100, NULL, 0);
384 omap_dsp_init(); 376 omap_dsp_init();
385 ads7846_dev_init(); 377 ads7846_dev_init();
386 mipid_dev_init(); 378 mipid_dev_init();
379 omap_usb_init(&nokia770_usb_config);
387 nokia770_mmc_init(); 380 nokia770_mmc_init();
388} 381}
389 382
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index 1a16ecb2ccc8..cf3247b15f87 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -52,6 +52,20 @@
52#include <mach/tc.h> 52#include <mach/tc.h>
53#include <mach/common.h> 53#include <mach/common.h>
54 54
55/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
56#define OMAP_OSK_ETHR_START 0x04800300
57
58/* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with
59 * alternate pin configurations for hardware-controlled blinking.
60 */
61#define OSK_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
62# define OSK_TPS_GPIO_USB_PWR_EN (OSK_TPS_GPIO_BASE + 0)
63# define OSK_TPS_GPIO_LED_D3 (OSK_TPS_GPIO_BASE + 1)
64# define OSK_TPS_GPIO_LAN_RESET (OSK_TPS_GPIO_BASE + 2)
65# define OSK_TPS_GPIO_DSP_PWR_EN (OSK_TPS_GPIO_BASE + 3)
66# define OSK_TPS_GPIO_LED_D9 (OSK_TPS_GPIO_BASE + 4)
67# define OSK_TPS_GPIO_LED_D2 (OSK_TPS_GPIO_BASE + 5)
68
55static struct mtd_partition osk_partitions[] = { 69static struct mtd_partition osk_partitions[] = {
56 /* bootloader (U-Boot, etc) in first sector */ 70 /* bootloader (U-Boot, etc) in first sector */
57 { 71 {
@@ -290,7 +304,6 @@ static struct omap_lcd_config osk_lcd_config __initdata = {
290#endif 304#endif
291 305
292static struct omap_board_config_kernel osk_config[] __initdata = { 306static struct omap_board_config_kernel osk_config[] __initdata = {
293 { OMAP_TAG_USB, &osk_usb_config },
294 { OMAP_TAG_UART, &osk_uart_config }, 307 { OMAP_TAG_UART, &osk_uart_config },
295#ifdef CONFIG_OMAP_OSK_MISTRAL 308#ifdef CONFIG_OMAP_OSK_MISTRAL
296 { OMAP_TAG_LCD, &osk_lcd_config }, 309 { OMAP_TAG_LCD, &osk_lcd_config },
@@ -541,6 +554,8 @@ static void __init osk_init(void)
541 l |= (3 << 1); 554 l |= (3 << 1);
542 omap_writel(l, USB_TRANSCEIVER_CTRL); 555 omap_writel(l, USB_TRANSCEIVER_CTRL);
543 556
557 omap_usb_init(&osk_usb_config);
558
544 /* irq for tps65010 chip */ 559 /* irq for tps65010 chip */
545 /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */ 560 /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */
546 if (gpio_request(OMAP_MPUIO(1), "tps65010") == 0) 561 if (gpio_request(OMAP_MPUIO(1), "tps65010") == 0)
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 99f2b43f2541..886b4c0569bd 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -43,6 +43,21 @@
43#include <mach/keypad.h> 43#include <mach/keypad.h>
44#include <mach/common.h> 44#include <mach/common.h>
45 45
46#define PALMTE_USBDETECT_GPIO 0
47#define PALMTE_USB_OR_DC_GPIO 1
48#define PALMTE_TSC_GPIO 4
49#define PALMTE_PINTDAV_GPIO 6
50#define PALMTE_MMC_WP_GPIO 8
51#define PALMTE_MMC_POWER_GPIO 9
52#define PALMTE_HDQ_GPIO 11
53#define PALMTE_HEADPHONES_GPIO 14
54#define PALMTE_SPEAKER_GPIO 15
55#define PALMTE_DC_GPIO OMAP_MPUIO(2)
56#define PALMTE_MMC_SWITCH_GPIO OMAP_MPUIO(4)
57#define PALMTE_MMC1_GPIO OMAP_MPUIO(6)
58#define PALMTE_MMC2_GPIO OMAP_MPUIO(7)
59#define PALMTE_MMC3_GPIO OMAP_MPUIO(11)
60
46static void __init omap_palmte_init_irq(void) 61static void __init omap_palmte_init_irq(void)
47{ 62{
48 omap1_init_common_hw(); 63 omap1_init_common_hw();
@@ -286,7 +301,6 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery)
286#endif 301#endif
287 302
288static struct omap_board_config_kernel palmte_config[] __initdata = { 303static struct omap_board_config_kernel palmte_config[] __initdata = {
289 { OMAP_TAG_USB, &palmte_usb_config },
290 { OMAP_TAG_LCD, &palmte_lcd_config }, 304 { OMAP_TAG_LCD, &palmte_lcd_config },
291 { OMAP_TAG_UART, &palmte_uart_config }, 305 { OMAP_TAG_UART, &palmte_uart_config },
292}; 306};
@@ -341,6 +355,7 @@ static void __init omap_palmte_init(void)
341 spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); 355 spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info));
342 palmte_misc_gpio_setup(); 356 palmte_misc_gpio_setup();
343 omap_serial_init(); 357 omap_serial_init();
358 omap_usb_init(&palmte_usb_config);
344 omap_register_i2c_bus(1, 100, NULL, 0); 359 omap_register_i2c_bus(1, 100, NULL, 0);
345} 360}
346 361
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 1cbc1275c95f..4f1b44831d37 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -43,6 +43,13 @@
43#include <linux/spi/spi.h> 43#include <linux/spi/spi.h>
44#include <linux/spi/ads7846.h> 44#include <linux/spi/ads7846.h>
45 45
46#define PALMTT_USBDETECT_GPIO 0
47#define PALMTT_CABLE_GPIO 1
48#define PALMTT_LED_GPIO 3
49#define PALMTT_PENIRQ_GPIO 6
50#define PALMTT_MMC_WP_GPIO 8
51#define PALMTT_HDQ_GPIO 11
52
46static int palmtt_keymap[] = { 53static int palmtt_keymap[] = {
47 KEY(0, 0, KEY_ESC), 54 KEY(0, 0, KEY_ESC),
48 KEY(0, 1, KEY_SPACE), 55 KEY(0, 1, KEY_SPACE),
@@ -272,7 +279,6 @@ static struct omap_uart_config palmtt_uart_config __initdata = {
272}; 279};
273 280
274static struct omap_board_config_kernel palmtt_config[] __initdata = { 281static struct omap_board_config_kernel palmtt_config[] __initdata = {
275 { OMAP_TAG_USB, &palmtt_usb_config },
276 { OMAP_TAG_LCD, &palmtt_lcd_config }, 282 { OMAP_TAG_LCD, &palmtt_lcd_config },
277 { OMAP_TAG_UART, &palmtt_uart_config }, 283 { OMAP_TAG_UART, &palmtt_uart_config },
278}; 284};
@@ -297,6 +303,7 @@ static void __init omap_palmtt_init(void)
297 303
298 spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo)); 304 spi_register_board_info(palmtt_boardinfo,ARRAY_SIZE(palmtt_boardinfo));
299 omap_serial_init(); 305 omap_serial_init();
306 omap_usb_init(&palmtt_usb_config);
300 omap_register_i2c_bus(1, 100, NULL, 0); 307 omap_register_i2c_bus(1, 100, NULL, 0);
301} 308}
302 309
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index baf5efbfe3e8..9a55c3c58218 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -46,6 +46,16 @@
46#include <linux/spi/spi.h> 46#include <linux/spi/spi.h>
47#include <linux/spi/ads7846.h> 47#include <linux/spi/ads7846.h>
48 48
49#define PALMZ71_USBDETECT_GPIO 0
50#define PALMZ71_PENIRQ_GPIO 6
51#define PALMZ71_MMC_WP_GPIO 8
52#define PALMZ71_HDQ_GPIO 11
53
54#define PALMZ71_HOTSYNC_GPIO OMAP_MPUIO(1)
55#define PALMZ71_CABLE_GPIO OMAP_MPUIO(2)
56#define PALMZ71_SLIDER_GPIO OMAP_MPUIO(3)
57#define PALMZ71_MMC_IN_GPIO OMAP_MPUIO(4)
58
49static void __init 59static void __init
50omap_palmz71_init_irq(void) 60omap_palmz71_init_irq(void)
51{ 61{
@@ -239,7 +249,6 @@ static struct omap_uart_config palmz71_uart_config __initdata = {
239}; 249};
240 250
241static struct omap_board_config_kernel palmz71_config[] __initdata = { 251static struct omap_board_config_kernel palmz71_config[] __initdata = {
242 {OMAP_TAG_USB, &palmz71_usb_config},
243 {OMAP_TAG_LCD, &palmz71_lcd_config}, 252 {OMAP_TAG_LCD, &palmz71_lcd_config},
244 {OMAP_TAG_UART, &palmz71_uart_config}, 253 {OMAP_TAG_UART, &palmz71_uart_config},
245}; 254};
@@ -313,6 +322,7 @@ omap_palmz71_init(void)
313 322
314 spi_register_board_info(palmz71_boardinfo, 323 spi_register_board_info(palmz71_boardinfo,
315 ARRAY_SIZE(palmz71_boardinfo)); 324 ARRAY_SIZE(palmz71_boardinfo));
325 omap_usb_init(&palmz71_usb_config);
316 omap_serial_init(); 326 omap_serial_init();
317 omap_register_i2c_bus(1, 100, NULL, 0); 327 omap_register_i2c_bus(1, 100, NULL, 0);
318 palmz71_gpio_setup(0); 328 palmz71_gpio_setup(0);
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index 66a4d7d5255d..58a46e4e45c3 100644
--- a/arch/arm/mach-omap1/board-sx1-mmc.c
+++ b/arch/arm/mach-omap1/board-sx1-mmc.c
@@ -17,6 +17,7 @@
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/mmc.h> 18#include <mach/mmc.h>
19#include <mach/gpio.h> 19#include <mach/gpio.h>
20#include <mach/board-sx1.h>
20 21
21#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
22 23
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 28c76a1e71c0..c096577695fe 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -41,6 +41,7 @@
41#include <mach/board.h> 41#include <mach/board.h>
42#include <mach/common.h> 42#include <mach/common.h>
43#include <mach/keypad.h> 43#include <mach/keypad.h>
44#include <mach/board-sx1.h>
44 45
45/* Write to I2C device */ 46/* Write to I2C device */
46int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) 47int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
@@ -373,7 +374,6 @@ static struct omap_uart_config sx1_uart_config __initdata = {
373}; 374};
374 375
375static struct omap_board_config_kernel sx1_config[] __initdata = { 376static struct omap_board_config_kernel sx1_config[] __initdata = {
376 { OMAP_TAG_USB, &sx1_usb_config },
377 { OMAP_TAG_LCD, &sx1_lcd_config }, 377 { OMAP_TAG_LCD, &sx1_lcd_config },
378 { OMAP_TAG_UART, &sx1_uart_config }, 378 { OMAP_TAG_UART, &sx1_uart_config },
379}; 379};
@@ -388,6 +388,7 @@ static void __init omap_sx1_init(void)
388 omap_board_config_size = ARRAY_SIZE(sx1_config); 388 omap_board_config_size = ARRAY_SIZE(sx1_config);
389 omap_serial_init(); 389 omap_serial_init();
390 omap_register_i2c_bus(1, 100, NULL, 0); 390 omap_register_i2c_bus(1, 100, NULL, 0);
391 omap_usb_init(&sx1_usb_config);
391 sx1_mmc_init(); 392 sx1_mmc_init();
392 393
393 /* turn on USB power */ 394 /* turn on USB power */
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index a7653542a2b0..98275e03dad1 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -145,7 +145,6 @@ static struct omap_uart_config voiceblue_uart_config __initdata = {
145}; 145};
146 146
147static struct omap_board_config_kernel voiceblue_config[] = { 147static struct omap_board_config_kernel voiceblue_config[] = {
148 { OMAP_TAG_USB, &voiceblue_usb_config },
149 { OMAP_TAG_UART, &voiceblue_uart_config }, 148 { OMAP_TAG_UART, &voiceblue_uart_config },
150}; 149};
151 150
@@ -185,6 +184,7 @@ static void __init voiceblue_init(void)
185 omap_board_config = voiceblue_config; 184 omap_board_config = voiceblue_config;
186 omap_board_config_size = ARRAY_SIZE(voiceblue_config); 185 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
187 omap_serial_init(); 186 omap_serial_init();
187 omap_usb_init(&voiceblue_usb_config);
188 omap_register_i2c_bus(1, 100, NULL, 0); 188 omap_register_i2c_bus(1, 100, NULL, 0);
189 189
190 /* There is a good chance board is going up, so enable power LED 190 /* There is a good chance board is going up, so enable power LED
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 5fba20731710..dafe4f71d15f 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -20,41 +20,161 @@
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/clkdev.h>
23 24
24#include <mach/cpu.h> 25#include <mach/cpu.h>
25#include <mach/usb.h> 26#include <mach/usb.h>
26#include <mach/clock.h> 27#include <mach/clock.h>
27#include <mach/sram.h> 28#include <mach/sram.h>
28 29
30static const struct clkops clkops_generic;
31static const struct clkops clkops_uart;
32static const struct clkops clkops_dspck;
33
29#include "clock.h" 34#include "clock.h"
30 35
36static int clk_omap1_dummy_enable(struct clk *clk)
37{
38 return 0;
39}
40
41static void clk_omap1_dummy_disable(struct clk *clk)
42{
43}
44
45static const struct clkops clkops_dummy = {
46 .enable = clk_omap1_dummy_enable,
47 .disable = clk_omap1_dummy_disable,
48};
49
50static struct clk dummy_ck = {
51 .name = "dummy",
52 .ops = &clkops_dummy,
53 .flags = RATE_FIXED,
54};
55
56struct omap_clk {
57 u32 cpu;
58 struct clk_lookup lk;
59};
60
61#define CLK(dev, con, ck, cp) \
62 { \
63 .cpu = cp, \
64 .lk = { \
65 .dev_id = dev, \
66 .con_id = con, \
67 .clk = ck, \
68 }, \
69 }
70
71#define CK_310 (1 << 0)
72#define CK_730 (1 << 1)
73#define CK_1510 (1 << 2)
74#define CK_16XX (1 << 3)
75
76static struct omap_clk omap_clks[] = {
77 /* non-ULPD clocks */
78 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310),
79 CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310),
80 /* CK_GEN1 clocks */
81 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX),
82 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
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),
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),
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),
89 CLK("omap_wdt", "ick", &armper_ck.clk, CK_16XX),
90 CLK("omap_wdt", "ick", &dummy_ck, CK_1510 | CK_310),
91 CLK(NULL, "arminth_ck", &arminth_ck1510, CK_1510 | CK_310),
92 CLK(NULL, "arminth_ck", &arminth_ck16xx, CK_16XX),
93 /* CK_GEN2 clocks */
94 CLK(NULL, "dsp_ck", &dsp_ck, CK_16XX | CK_1510 | CK_310),
95 CLK(NULL, "dspmmu_ck", &dspmmu_ck, CK_16XX | CK_1510 | CK_310),
96 CLK(NULL, "dspper_ck", &dspper_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),
99 /* CK_GEN3 clocks */
100 CLK(NULL, "tc_ck", &tc_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_730),
101 CLK(NULL, "tipb_ck", &tipb_ck, CK_1510 | CK_310),
102 CLK(NULL, "l3_ocpi_ck", &l3_ocpi_ck, CK_16XX),
103 CLK(NULL, "tc1_ck", &tc1_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),
106 CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX),
107 CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | 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),
110 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX),
111 CLK(NULL, "lcd_ck", &lcd_ck_16xx, CK_16XX | CK_730),
112 CLK(NULL, "lcd_ck", &lcd_ck_1510.clk, CK_1510 | CK_310),
113 /* ULPD clocks */
114 CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310),
115 CLK(NULL, "uart1_ck", &uart1_16xx.clk, CK_16XX),
116 CLK(NULL, "uart2_ck", &uart2_ck, CK_16XX | CK_1510 | CK_310),
117 CLK(NULL, "uart3_ck", &uart3_1510, CK_1510 | CK_310),
118 CLK(NULL, "uart3_ck", &uart3_16xx.clk, CK_16XX),
119 CLK(NULL, "usb_clko", &usb_clko, CK_16XX | 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),
122 CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX),
123 CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310),
124 CLK(NULL, "mclk", &mclk_16xx, CK_16XX),
125 CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310),
126 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", "ick", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
129 CLK("mmci-omap.1", "fck", &mmc2_ck, CK_16XX),
130 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX),
131 /* Virtual clocks */
132 CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310),
133 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310),
134 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX),
135 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310),
136 CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
137 CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX),
138 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310),
139 CLK("omap-mcbsp.2", "ick", &armper_ck.clk, CK_16XX),
140 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_1510 | CK_310),
141 CLK("omap-mcbsp.3", "ick", &dspper_ck, CK_16XX),
142 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_1510 | CK_310),
143 CLK("omap-mcbsp.1", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
144 CLK("omap-mcbsp.2", "fck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
145 CLK("omap-mcbsp.3", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
146};
147
148static int omap1_clk_enable_generic(struct clk * clk);
149static int omap1_clk_enable(struct clk *clk);
150static void omap1_clk_disable_generic(struct clk * clk);
151static void omap1_clk_disable(struct clk *clk);
152
31__u32 arm_idlect1_mask; 153__u32 arm_idlect1_mask;
32 154
33/*------------------------------------------------------------------------- 155/*-------------------------------------------------------------------------
34 * Omap1 specific clock functions 156 * Omap1 specific clock functions
35 *-------------------------------------------------------------------------*/ 157 *-------------------------------------------------------------------------*/
36 158
37static void omap1_watchdog_recalc(struct clk * clk) 159static unsigned long omap1_watchdog_recalc(struct clk *clk)
38{ 160{
39 clk->rate = clk->parent->rate / 14; 161 return clk->parent->rate / 14;
40} 162}
41 163
42static void omap1_uart_recalc(struct clk * clk) 164static unsigned long omap1_uart_recalc(struct clk *clk)
43{ 165{
44 unsigned int val = omap_readl(clk->enable_reg); 166 unsigned int val = __raw_readl(clk->enable_reg);
45 if (val & clk->enable_bit) 167 return val & clk->enable_bit ? 48000000 : 12000000;
46 clk->rate = 48000000;
47 else
48 clk->rate = 12000000;
49} 168}
50 169
51static void omap1_sossi_recalc(struct clk *clk) 170static unsigned long omap1_sossi_recalc(struct clk *clk)
52{ 171{
53 u32 div = omap_readl(MOD_CONF_CTRL_1); 172 u32 div = omap_readl(MOD_CONF_CTRL_1);
54 173
55 div = (div >> 17) & 0x7; 174 div = (div >> 17) & 0x7;
56 div++; 175 div++;
57 clk->rate = clk->parent->rate / div; 176
177 return clk->parent->rate / div;
58} 178}
59 179
60static int omap1_clk_enable_dsp_domain(struct clk *clk) 180static int omap1_clk_enable_dsp_domain(struct clk *clk)
@@ -78,6 +198,11 @@ static void omap1_clk_disable_dsp_domain(struct clk *clk)
78 } 198 }
79} 199}
80 200
201static const struct clkops clkops_dspck = {
202 .enable = &omap1_clk_enable_dsp_domain,
203 .disable = &omap1_clk_disable_dsp_domain,
204};
205
81static int omap1_clk_enable_uart_functional(struct clk *clk) 206static int omap1_clk_enable_uart_functional(struct clk *clk)
82{ 207{
83 int ret; 208 int ret;
@@ -105,6 +230,11 @@ static void omap1_clk_disable_uart_functional(struct clk *clk)
105 omap1_clk_disable_generic(clk); 230 omap1_clk_disable_generic(clk);
106} 231}
107 232
233static const struct clkops clkops_uart = {
234 .enable = &omap1_clk_enable_uart_functional,
235 .disable = &omap1_clk_disable_uart_functional,
236};
237
108static void omap1_clk_allow_idle(struct clk *clk) 238static void omap1_clk_allow_idle(struct clk *clk)
109{ 239{
110 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk; 240 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk;
@@ -197,9 +327,6 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate)
197 struct clk * parent; 327 struct clk * parent;
198 unsigned dsor_exp; 328 unsigned dsor_exp;
199 329
200 if (unlikely(!(clk->flags & RATE_CKCTL)))
201 return -EINVAL;
202
203 parent = clk->parent; 330 parent = clk->parent;
204 if (unlikely(parent == NULL)) 331 if (unlikely(parent == NULL))
205 return -EIO; 332 return -EIO;
@@ -215,22 +342,15 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate)
215 return dsor_exp; 342 return dsor_exp;
216} 343}
217 344
218static void omap1_ckctl_recalc(struct clk * clk) 345static unsigned long omap1_ckctl_recalc(struct clk *clk)
219{ 346{
220 int dsor;
221
222 /* Calculate divisor encoded as 2-bit exponent */ 347 /* Calculate divisor encoded as 2-bit exponent */
223 dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset)); 348 int dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset));
224 349
225 if (unlikely(clk->rate == clk->parent->rate / dsor)) 350 return clk->parent->rate / dsor;
226 return; /* No change, quick exit */
227 clk->rate = clk->parent->rate / dsor;
228
229 if (unlikely(clk->flags & RATE_PROPAGATES))
230 propagate_rate(clk);
231} 351}
232 352
233static void omap1_ckctl_recalc_dsp_domain(struct clk * clk) 353static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk)
234{ 354{
235 int dsor; 355 int dsor;
236 356
@@ -245,12 +365,7 @@ static void omap1_ckctl_recalc_dsp_domain(struct clk * clk)
245 dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset)); 365 dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset));
246 omap1_clk_disable(&api_ck.clk); 366 omap1_clk_disable(&api_ck.clk);
247 367
248 if (unlikely(clk->rate == clk->parent->rate / dsor)) 368 return clk->parent->rate / dsor;
249 return; /* No change, quick exit */
250 clk->rate = clk->parent->rate / dsor;
251
252 if (unlikely(clk->flags & RATE_PROPAGATES))
253 propagate_rate(clk);
254} 369}
255 370
256/* MPU virtual clock functions */ 371/* MPU virtual clock functions */
@@ -289,35 +404,57 @@ static int omap1_select_table_rate(struct clk * clk, unsigned long rate)
289 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); 404 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
290 405
291 ck_dpll1.rate = ptr->pll_rate; 406 ck_dpll1.rate = ptr->pll_rate;
292 propagate_rate(&ck_dpll1);
293 return 0; 407 return 0;
294} 408}
295 409
296static int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate) 410static int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate)
297{ 411{
298 int ret = -EINVAL; 412 int dsor_exp;
299 int dsor_exp; 413 u16 regval;
300 __u16 regval;
301
302 if (clk->flags & RATE_CKCTL) {
303 dsor_exp = calc_dsor_exp(clk, rate);
304 if (dsor_exp > 3)
305 dsor_exp = -EINVAL;
306 if (dsor_exp < 0)
307 return dsor_exp;
308
309 regval = __raw_readw(DSP_CKCTL);
310 regval &= ~(3 << clk->rate_offset);
311 regval |= dsor_exp << clk->rate_offset;
312 __raw_writew(regval, DSP_CKCTL);
313 clk->rate = clk->parent->rate / (1 << dsor_exp);
314 ret = 0;
315 }
316 414
317 if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES))) 415 dsor_exp = calc_dsor_exp(clk, rate);
318 propagate_rate(clk); 416 if (dsor_exp > 3)
417 dsor_exp = -EINVAL;
418 if (dsor_exp < 0)
419 return dsor_exp;
319 420
320 return ret; 421 regval = __raw_readw(DSP_CKCTL);
422 regval &= ~(3 << clk->rate_offset);
423 regval |= dsor_exp << clk->rate_offset;
424 __raw_writew(regval, DSP_CKCTL);
425 clk->rate = clk->parent->rate / (1 << dsor_exp);
426
427 return 0;
428}
429
430static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate)
431{
432 int dsor_exp = calc_dsor_exp(clk, rate);
433 if (dsor_exp < 0)
434 return dsor_exp;
435 if (dsor_exp > 3)
436 dsor_exp = 3;
437 return clk->parent->rate / (1 << dsor_exp);
438}
439
440static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate)
441{
442 int dsor_exp;
443 u16 regval;
444
445 dsor_exp = calc_dsor_exp(clk, rate);
446 if (dsor_exp > 3)
447 dsor_exp = -EINVAL;
448 if (dsor_exp < 0)
449 return dsor_exp;
450
451 regval = omap_readw(ARM_CKCTL);
452 regval &= ~(3 << clk->rate_offset);
453 regval |= dsor_exp << clk->rate_offset;
454 regval = verify_ckctl_value(regval);
455 omap_writew(regval, ARM_CKCTL);
456 clk->rate = clk->parent->rate / (1 << dsor_exp);
457 return 0;
321} 458}
322 459
323static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate) 460static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate)
@@ -372,14 +509,14 @@ static int omap1_set_uart_rate(struct clk * clk, unsigned long rate)
372{ 509{
373 unsigned int val; 510 unsigned int val;
374 511
375 val = omap_readl(clk->enable_reg); 512 val = __raw_readl(clk->enable_reg);
376 if (rate == 12000000) 513 if (rate == 12000000)
377 val &= ~(1 << clk->enable_bit); 514 val &= ~(1 << clk->enable_bit);
378 else if (rate == 48000000) 515 else if (rate == 48000000)
379 val |= (1 << clk->enable_bit); 516 val |= (1 << clk->enable_bit);
380 else 517 else
381 return -EINVAL; 518 return -EINVAL;
382 omap_writel(val, clk->enable_reg); 519 __raw_writel(val, clk->enable_reg);
383 clk->rate = rate; 520 clk->rate = rate;
384 521
385 return 0; 522 return 0;
@@ -398,8 +535,8 @@ static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate)
398 else 535 else
399 ratio_bits = (dsor - 2) << 2; 536 ratio_bits = (dsor - 2) << 2;
400 537
401 ratio_bits |= omap_readw(clk->enable_reg) & ~0xfd; 538 ratio_bits |= __raw_readw(clk->enable_reg) & ~0xfd;
402 omap_writew(ratio_bits, clk->enable_reg); 539 __raw_writew(ratio_bits, clk->enable_reg);
403 540
404 return 0; 541 return 0;
405} 542}
@@ -423,8 +560,6 @@ static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate)
423 omap_writel(l, MOD_CONF_CTRL_1); 560 omap_writel(l, MOD_CONF_CTRL_1);
424 561
425 clk->rate = p_rate / (div + 1); 562 clk->rate = p_rate / (div + 1);
426 if (unlikely(clk->flags & RATE_PROPAGATES))
427 propagate_rate(clk);
428 563
429 return 0; 564 return 0;
430} 565}
@@ -440,8 +575,8 @@ static void omap1_init_ext_clk(struct clk * clk)
440 __u16 ratio_bits; 575 __u16 ratio_bits;
441 576
442 /* Determine current rate and ensure clock is based on 96MHz APLL */ 577 /* Determine current rate and ensure clock is based on 96MHz APLL */
443 ratio_bits = omap_readw(clk->enable_reg) & ~1; 578 ratio_bits = __raw_readw(clk->enable_reg) & ~1;
444 omap_writew(ratio_bits, clk->enable_reg); 579 __raw_writew(ratio_bits, clk->enable_reg);
445 580
446 ratio_bits = (ratio_bits & 0xfc) >> 2; 581 ratio_bits = (ratio_bits & 0xfc) >> 2;
447 if (ratio_bits > 6) 582 if (ratio_bits > 6)
@@ -468,7 +603,7 @@ static int omap1_clk_enable(struct clk *clk)
468 omap1_clk_deny_idle(clk->parent); 603 omap1_clk_deny_idle(clk->parent);
469 } 604 }
470 605
471 ret = clk->enable(clk); 606 ret = clk->ops->enable(clk);
472 607
473 if (unlikely(ret != 0) && clk->parent) { 608 if (unlikely(ret != 0) && clk->parent) {
474 omap1_clk_disable(clk->parent); 609 omap1_clk_disable(clk->parent);
@@ -482,7 +617,7 @@ static int omap1_clk_enable(struct clk *clk)
482static void omap1_clk_disable(struct clk *clk) 617static void omap1_clk_disable(struct clk *clk)
483{ 618{
484 if (clk->usecount > 0 && !(--clk->usecount)) { 619 if (clk->usecount > 0 && !(--clk->usecount)) {
485 clk->disable(clk); 620 clk->ops->disable(clk);
486 if (likely(clk->parent)) { 621 if (likely(clk->parent)) {
487 omap1_clk_disable(clk->parent); 622 omap1_clk_disable(clk->parent);
488 if (clk->flags & CLOCK_NO_IDLE_PARENT) 623 if (clk->flags & CLOCK_NO_IDLE_PARENT)
@@ -496,9 +631,6 @@ static int omap1_clk_enable_generic(struct clk *clk)
496 __u16 regval16; 631 __u16 regval16;
497 __u32 regval32; 632 __u32 regval32;
498 633
499 if (clk->flags & ALWAYS_ENABLED)
500 return 0;
501
502 if (unlikely(clk->enable_reg == NULL)) { 634 if (unlikely(clk->enable_reg == NULL)) {
503 printk(KERN_ERR "clock.c: Enable for %s without enable code\n", 635 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
504 clk->name); 636 clk->name);
@@ -506,25 +638,13 @@ static int omap1_clk_enable_generic(struct clk *clk)
506 } 638 }
507 639
508 if (clk->flags & ENABLE_REG_32BIT) { 640 if (clk->flags & ENABLE_REG_32BIT) {
509 if (clk->flags & VIRTUAL_IO_ADDRESS) { 641 regval32 = __raw_readl(clk->enable_reg);
510 regval32 = __raw_readl(clk->enable_reg); 642 regval32 |= (1 << clk->enable_bit);
511 regval32 |= (1 << clk->enable_bit); 643 __raw_writel(regval32, clk->enable_reg);
512 __raw_writel(regval32, clk->enable_reg);
513 } else {
514 regval32 = omap_readl(clk->enable_reg);
515 regval32 |= (1 << clk->enable_bit);
516 omap_writel(regval32, clk->enable_reg);
517 }
518 } else { 644 } else {
519 if (clk->flags & VIRTUAL_IO_ADDRESS) { 645 regval16 = __raw_readw(clk->enable_reg);
520 regval16 = __raw_readw(clk->enable_reg); 646 regval16 |= (1 << clk->enable_bit);
521 regval16 |= (1 << clk->enable_bit); 647 __raw_writew(regval16, clk->enable_reg);
522 __raw_writew(regval16, clk->enable_reg);
523 } else {
524 regval16 = omap_readw(clk->enable_reg);
525 regval16 |= (1 << clk->enable_bit);
526 omap_writew(regval16, clk->enable_reg);
527 }
528 } 648 }
529 649
530 return 0; 650 return 0;
@@ -539,44 +659,26 @@ static void omap1_clk_disable_generic(struct clk *clk)
539 return; 659 return;
540 660
541 if (clk->flags & ENABLE_REG_32BIT) { 661 if (clk->flags & ENABLE_REG_32BIT) {
542 if (clk->flags & VIRTUAL_IO_ADDRESS) { 662 regval32 = __raw_readl(clk->enable_reg);
543 regval32 = __raw_readl(clk->enable_reg); 663 regval32 &= ~(1 << clk->enable_bit);
544 regval32 &= ~(1 << clk->enable_bit); 664 __raw_writel(regval32, clk->enable_reg);
545 __raw_writel(regval32, clk->enable_reg);
546 } else {
547 regval32 = omap_readl(clk->enable_reg);
548 regval32 &= ~(1 << clk->enable_bit);
549 omap_writel(regval32, clk->enable_reg);
550 }
551 } else { 665 } else {
552 if (clk->flags & VIRTUAL_IO_ADDRESS) { 666 regval16 = __raw_readw(clk->enable_reg);
553 regval16 = __raw_readw(clk->enable_reg); 667 regval16 &= ~(1 << clk->enable_bit);
554 regval16 &= ~(1 << clk->enable_bit); 668 __raw_writew(regval16, clk->enable_reg);
555 __raw_writew(regval16, clk->enable_reg);
556 } else {
557 regval16 = omap_readw(clk->enable_reg);
558 regval16 &= ~(1 << clk->enable_bit);
559 omap_writew(regval16, clk->enable_reg);
560 }
561 } 669 }
562} 670}
563 671
672static const struct clkops clkops_generic = {
673 .enable = &omap1_clk_enable_generic,
674 .disable = &omap1_clk_disable_generic,
675};
676
564static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) 677static long omap1_clk_round_rate(struct clk *clk, unsigned long rate)
565{ 678{
566 int dsor_exp;
567
568 if (clk->flags & RATE_FIXED) 679 if (clk->flags & RATE_FIXED)
569 return clk->rate; 680 return clk->rate;
570 681
571 if (clk->flags & RATE_CKCTL) {
572 dsor_exp = calc_dsor_exp(clk, rate);
573 if (dsor_exp < 0)
574 return dsor_exp;
575 if (dsor_exp > 3)
576 dsor_exp = 3;
577 return clk->parent->rate / (1 << dsor_exp);
578 }
579
580 if (clk->round_rate != NULL) 682 if (clk->round_rate != NULL)
581 return clk->round_rate(clk, rate); 683 return clk->round_rate(clk, rate);
582 684
@@ -586,30 +688,9 @@ static long omap1_clk_round_rate(struct clk *clk, unsigned long rate)
586static int omap1_clk_set_rate(struct clk *clk, unsigned long rate) 688static int omap1_clk_set_rate(struct clk *clk, unsigned long rate)
587{ 689{
588 int ret = -EINVAL; 690 int ret = -EINVAL;
589 int dsor_exp;
590 __u16 regval;
591 691
592 if (clk->set_rate) 692 if (clk->set_rate)
593 ret = clk->set_rate(clk, rate); 693 ret = clk->set_rate(clk, rate);
594 else if (clk->flags & RATE_CKCTL) {
595 dsor_exp = calc_dsor_exp(clk, rate);
596 if (dsor_exp > 3)
597 dsor_exp = -EINVAL;
598 if (dsor_exp < 0)
599 return dsor_exp;
600
601 regval = omap_readw(ARM_CKCTL);
602 regval &= ~(3 << clk->rate_offset);
603 regval |= dsor_exp << clk->rate_offset;
604 regval = verify_ckctl_value(regval);
605 omap_writew(regval, ARM_CKCTL);
606 clk->rate = clk->parent->rate / (1 << dsor_exp);
607 ret = 0;
608 }
609
610 if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES)))
611 propagate_rate(clk);
612
613 return ret; 694 return ret;
614} 695}
615 696
@@ -632,17 +713,10 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
632 } 713 }
633 714
634 /* Is the clock already disabled? */ 715 /* Is the clock already disabled? */
635 if (clk->flags & ENABLE_REG_32BIT) { 716 if (clk->flags & ENABLE_REG_32BIT)
636 if (clk->flags & VIRTUAL_IO_ADDRESS) 717 regval32 = __raw_readl(clk->enable_reg);
637 regval32 = __raw_readl(clk->enable_reg); 718 else
638 else 719 regval32 = __raw_readw(clk->enable_reg);
639 regval32 = omap_readl(clk->enable_reg);
640 } else {
641 if (clk->flags & VIRTUAL_IO_ADDRESS)
642 regval32 = __raw_readw(clk->enable_reg);
643 else
644 regval32 = omap_readw(clk->enable_reg);
645 }
646 720
647 if ((regval32 & (1 << clk->enable_bit)) == 0) 721 if ((regval32 & (1 << clk->enable_bit)) == 0)
648 return; 722 return;
@@ -659,7 +733,7 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
659 } 733 }
660 734
661 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name); 735 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name);
662 clk->disable(clk); 736 clk->ops->disable(clk);
663 printk(" done\n"); 737 printk(" done\n");
664} 738}
665 739
@@ -677,10 +751,10 @@ static struct clk_functions omap1_clk_functions = {
677 751
678int __init omap1_clk_init(void) 752int __init omap1_clk_init(void)
679{ 753{
680 struct clk ** clkp; 754 struct omap_clk *c;
681 const struct omap_clock_config *info; 755 const struct omap_clock_config *info;
682 int crystal_type = 0; /* Default 12 MHz */ 756 int crystal_type = 0; /* Default 12 MHz */
683 u32 reg; 757 u32 reg, cpu_mask;
684 758
685#ifdef CONFIG_DEBUG_LL 759#ifdef CONFIG_DEBUG_LL
686 /* Resets some clocks that may be left on from bootloader, 760 /* Resets some clocks that may be left on from bootloader,
@@ -700,27 +774,24 @@ int __init omap1_clk_init(void)
700 /* By default all idlect1 clocks are allowed to idle */ 774 /* By default all idlect1 clocks are allowed to idle */
701 arm_idlect1_mask = ~0; 775 arm_idlect1_mask = ~0;
702 776
703 for (clkp = onchip_clks; clkp < onchip_clks+ARRAY_SIZE(onchip_clks); clkp++) { 777 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++)
704 if (((*clkp)->flags &CLOCK_IN_OMAP1510) && cpu_is_omap1510()) { 778 clk_init_one(c->lk.clk);
705 clk_register(*clkp);
706 continue;
707 }
708
709 if (((*clkp)->flags &CLOCK_IN_OMAP16XX) && cpu_is_omap16xx()) {
710 clk_register(*clkp);
711 continue;
712 }
713
714 if (((*clkp)->flags &CLOCK_IN_OMAP730) && cpu_is_omap730()) {
715 clk_register(*clkp);
716 continue;
717 }
718 779
719 if (((*clkp)->flags &CLOCK_IN_OMAP310) && cpu_is_omap310()) { 780 cpu_mask = 0;
720 clk_register(*clkp); 781 if (cpu_is_omap16xx())
721 continue; 782 cpu_mask |= CK_16XX;
783 if (cpu_is_omap1510())
784 cpu_mask |= CK_1510;
785 if (cpu_is_omap730())
786 cpu_mask |= CK_730;
787 if (cpu_is_omap310())
788 cpu_mask |= CK_310;
789
790 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++)
791 if (c->cpu & cpu_mask) {
792 clkdev_add(&c->lk);
793 clk_register(c->lk.clk);
722 } 794 }
723 }
724 795
725 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config); 796 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);
726 if (info != NULL) { 797 if (info != NULL) {
@@ -769,7 +840,6 @@ int __init omap1_clk_init(void)
769 } 840 }
770 } 841 }
771 } 842 }
772 propagate_rate(&ck_dpll1);
773#else 843#else
774 /* Find the highest supported frequency and enable it */ 844 /* Find the highest supported frequency and enable it */
775 if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { 845 if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
@@ -778,9 +848,9 @@ int __init omap1_clk_init(void)
778 omap_writew(0x2290, DPLL_CTL); 848 omap_writew(0x2290, DPLL_CTL);
779 omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL); 849 omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL);
780 ck_dpll1.rate = 60000000; 850 ck_dpll1.rate = 60000000;
781 propagate_rate(&ck_dpll1);
782 } 851 }
783#endif 852#endif
853 propagate_rate(&ck_dpll1);
784 /* Cache rates for clocks connected to ck_ref (not dpll1) */ 854 /* Cache rates for clocks connected to ck_ref (not dpll1) */
785 propagate_rate(&ck_ref); 855 propagate_rate(&ck_ref);
786 printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): " 856 printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): "
@@ -832,4 +902,3 @@ int __init omap1_clk_init(void)
832 902
833 return 0; 903 return 0;
834} 904}
835
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index c1dcdf18d8dd..17f874271255 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -13,27 +13,22 @@
13#ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H 13#ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H
14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H 14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H
15 15
16static int omap1_clk_enable_generic(struct clk * clk); 16static unsigned long omap1_ckctl_recalc(struct clk *clk);
17static void omap1_clk_disable_generic(struct clk * clk); 17static unsigned long omap1_watchdog_recalc(struct clk *clk);
18static void omap1_ckctl_recalc(struct clk * clk);
19static void omap1_watchdog_recalc(struct clk * clk);
20static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate); 18static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
21static void omap1_sossi_recalc(struct clk *clk); 19static unsigned long omap1_sossi_recalc(struct clk *clk);
22static void omap1_ckctl_recalc_dsp_domain(struct clk * clk); 20static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk);
23static int omap1_clk_enable_dsp_domain(struct clk * clk);
24static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); 21static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate);
25static void omap1_clk_disable_dsp_domain(struct clk * clk);
26static int omap1_set_uart_rate(struct clk * clk, unsigned long rate); 22static int omap1_set_uart_rate(struct clk * clk, unsigned long rate);
27static void omap1_uart_recalc(struct clk * clk); 23static unsigned long omap1_uart_recalc(struct clk *clk);
28static int omap1_clk_enable_uart_functional(struct clk * clk);
29static void omap1_clk_disable_uart_functional(struct clk * clk);
30static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate); 24static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate);
31static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate); 25static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate);
32static void omap1_init_ext_clk(struct clk * clk); 26static void omap1_init_ext_clk(struct clk * clk);
33static int omap1_select_table_rate(struct clk * clk, unsigned long rate); 27static int omap1_select_table_rate(struct clk * clk, unsigned long rate);
34static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate); 28static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate);
35static int omap1_clk_enable(struct clk *clk); 29
36static void omap1_clk_disable(struct clk *clk); 30static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
31static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
37 32
38struct mpu_rate { 33struct mpu_rate {
39 unsigned long rate; 34 unsigned long rate;
@@ -152,101 +147,84 @@ static struct mpu_rate rate_table[] = {
152 147
153static struct clk ck_ref = { 148static struct clk ck_ref = {
154 .name = "ck_ref", 149 .name = "ck_ref",
150 .ops = &clkops_null,
155 .rate = 12000000, 151 .rate = 12000000,
156 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
157 CLOCK_IN_OMAP310 | ALWAYS_ENABLED,
158 .enable = &omap1_clk_enable_generic,
159 .disable = &omap1_clk_disable_generic,
160}; 152};
161 153
162static struct clk ck_dpll1 = { 154static struct clk ck_dpll1 = {
163 .name = "ck_dpll1", 155 .name = "ck_dpll1",
156 .ops = &clkops_null,
164 .parent = &ck_ref, 157 .parent = &ck_ref,
165 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
166 CLOCK_IN_OMAP310 | RATE_PROPAGATES | ALWAYS_ENABLED,
167 .enable = &omap1_clk_enable_generic,
168 .disable = &omap1_clk_disable_generic,
169}; 158};
170 159
171static struct arm_idlect1_clk ck_dpll1out = { 160static struct arm_idlect1_clk ck_dpll1out = {
172 .clk = { 161 .clk = {
173 .name = "ck_dpll1out", 162 .name = "ck_dpll1out",
163 .ops = &clkops_generic,
174 .parent = &ck_dpll1, 164 .parent = &ck_dpll1,
175 .flags = CLOCK_IN_OMAP16XX | CLOCK_IDLE_CONTROL | 165 .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT,
176 ENABLE_REG_32BIT | RATE_PROPAGATES, 166 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
177 .enable_reg = (void __iomem *)ARM_IDLECT2,
178 .enable_bit = EN_CKOUT_ARM, 167 .enable_bit = EN_CKOUT_ARM,
179 .recalc = &followparent_recalc, 168 .recalc = &followparent_recalc,
180 .enable = &omap1_clk_enable_generic,
181 .disable = &omap1_clk_disable_generic,
182 }, 169 },
183 .idlect_shift = 12, 170 .idlect_shift = 12,
184}; 171};
185 172
186static struct clk sossi_ck = { 173static struct clk sossi_ck = {
187 .name = "ck_sossi", 174 .name = "ck_sossi",
175 .ops = &clkops_generic,
188 .parent = &ck_dpll1out.clk, 176 .parent = &ck_dpll1out.clk,
189 .flags = CLOCK_IN_OMAP16XX | CLOCK_NO_IDLE_PARENT | 177 .flags = CLOCK_NO_IDLE_PARENT | ENABLE_REG_32BIT,
190 ENABLE_REG_32BIT, 178 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_1),
191 .enable_reg = (void __iomem *)MOD_CONF_CTRL_1,
192 .enable_bit = 16, 179 .enable_bit = 16,
193 .recalc = &omap1_sossi_recalc, 180 .recalc = &omap1_sossi_recalc,
194 .set_rate = &omap1_set_sossi_rate, 181 .set_rate = &omap1_set_sossi_rate,
195 .enable = &omap1_clk_enable_generic,
196 .disable = &omap1_clk_disable_generic,
197}; 182};
198 183
199static struct clk arm_ck = { 184static struct clk arm_ck = {
200 .name = "arm_ck", 185 .name = "arm_ck",
186 .ops = &clkops_null,
201 .parent = &ck_dpll1, 187 .parent = &ck_dpll1,
202 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
203 CLOCK_IN_OMAP310 | RATE_CKCTL | RATE_PROPAGATES |
204 ALWAYS_ENABLED,
205 .rate_offset = CKCTL_ARMDIV_OFFSET, 188 .rate_offset = CKCTL_ARMDIV_OFFSET,
206 .recalc = &omap1_ckctl_recalc, 189 .recalc = &omap1_ckctl_recalc,
207 .enable = &omap1_clk_enable_generic, 190 .round_rate = omap1_clk_round_rate_ckctl_arm,
208 .disable = &omap1_clk_disable_generic, 191 .set_rate = omap1_clk_set_rate_ckctl_arm,
209}; 192};
210 193
211static struct arm_idlect1_clk armper_ck = { 194static struct arm_idlect1_clk armper_ck = {
212 .clk = { 195 .clk = {
213 .name = "armper_ck", 196 .name = "armper_ck",
197 .ops = &clkops_generic,
214 .parent = &ck_dpll1, 198 .parent = &ck_dpll1,
215 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 199 .flags = CLOCK_IDLE_CONTROL,
216 CLOCK_IN_OMAP310 | RATE_CKCTL | 200 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
217 CLOCK_IDLE_CONTROL,
218 .enable_reg = (void __iomem *)ARM_IDLECT2,
219 .enable_bit = EN_PERCK, 201 .enable_bit = EN_PERCK,
220 .rate_offset = CKCTL_PERDIV_OFFSET, 202 .rate_offset = CKCTL_PERDIV_OFFSET,
221 .recalc = &omap1_ckctl_recalc, 203 .recalc = &omap1_ckctl_recalc,
222 .enable = &omap1_clk_enable_generic, 204 .round_rate = omap1_clk_round_rate_ckctl_arm,
223 .disable = &omap1_clk_disable_generic, 205 .set_rate = omap1_clk_set_rate_ckctl_arm,
224 }, 206 },
225 .idlect_shift = 2, 207 .idlect_shift = 2,
226}; 208};
227 209
228static struct clk arm_gpio_ck = { 210static struct clk arm_gpio_ck = {
229 .name = "arm_gpio_ck", 211 .name = "arm_gpio_ck",
212 .ops = &clkops_generic,
230 .parent = &ck_dpll1, 213 .parent = &ck_dpll1,
231 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310, 214 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
232 .enable_reg = (void __iomem *)ARM_IDLECT2,
233 .enable_bit = EN_GPIOCK, 215 .enable_bit = EN_GPIOCK,
234 .recalc = &followparent_recalc, 216 .recalc = &followparent_recalc,
235 .enable = &omap1_clk_enable_generic,
236 .disable = &omap1_clk_disable_generic,
237}; 217};
238 218
239static struct arm_idlect1_clk armxor_ck = { 219static struct arm_idlect1_clk armxor_ck = {
240 .clk = { 220 .clk = {
241 .name = "armxor_ck", 221 .name = "armxor_ck",
222 .ops = &clkops_generic,
242 .parent = &ck_ref, 223 .parent = &ck_ref,
243 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 224 .flags = CLOCK_IDLE_CONTROL,
244 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 225 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
245 .enable_reg = (void __iomem *)ARM_IDLECT2,
246 .enable_bit = EN_XORPCK, 226 .enable_bit = EN_XORPCK,
247 .recalc = &followparent_recalc, 227 .recalc = &followparent_recalc,
248 .enable = &omap1_clk_enable_generic,
249 .disable = &omap1_clk_disable_generic,
250 }, 228 },
251 .idlect_shift = 1, 229 .idlect_shift = 1,
252}; 230};
@@ -254,14 +232,12 @@ static struct arm_idlect1_clk armxor_ck = {
254static struct arm_idlect1_clk armtim_ck = { 232static struct arm_idlect1_clk armtim_ck = {
255 .clk = { 233 .clk = {
256 .name = "armtim_ck", 234 .name = "armtim_ck",
235 .ops = &clkops_generic,
257 .parent = &ck_ref, 236 .parent = &ck_ref,
258 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 237 .flags = CLOCK_IDLE_CONTROL,
259 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 238 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
260 .enable_reg = (void __iomem *)ARM_IDLECT2,
261 .enable_bit = EN_TIMCK, 239 .enable_bit = EN_TIMCK,
262 .recalc = &followparent_recalc, 240 .recalc = &followparent_recalc,
263 .enable = &omap1_clk_enable_generic,
264 .disable = &omap1_clk_disable_generic,
265 }, 241 },
266 .idlect_shift = 9, 242 .idlect_shift = 9,
267}; 243};
@@ -269,201 +245,166 @@ static struct arm_idlect1_clk armtim_ck = {
269static struct arm_idlect1_clk armwdt_ck = { 245static struct arm_idlect1_clk armwdt_ck = {
270 .clk = { 246 .clk = {
271 .name = "armwdt_ck", 247 .name = "armwdt_ck",
248 .ops = &clkops_generic,
272 .parent = &ck_ref, 249 .parent = &ck_ref,
273 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 250 .flags = CLOCK_IDLE_CONTROL,
274 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 251 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
275 .enable_reg = (void __iomem *)ARM_IDLECT2,
276 .enable_bit = EN_WDTCK, 252 .enable_bit = EN_WDTCK,
277 .recalc = &omap1_watchdog_recalc, 253 .recalc = &omap1_watchdog_recalc,
278 .enable = &omap1_clk_enable_generic,
279 .disable = &omap1_clk_disable_generic,
280 }, 254 },
281 .idlect_shift = 0, 255 .idlect_shift = 0,
282}; 256};
283 257
284static struct clk arminth_ck16xx = { 258static struct clk arminth_ck16xx = {
285 .name = "arminth_ck", 259 .name = "arminth_ck",
260 .ops = &clkops_null,
286 .parent = &arm_ck, 261 .parent = &arm_ck,
287 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
288 .recalc = &followparent_recalc, 262 .recalc = &followparent_recalc,
289 /* Note: On 16xx the frequency can be divided by 2 by programming 263 /* Note: On 16xx the frequency can be divided by 2 by programming
290 * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1 264 * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1
291 * 265 *
292 * 1510 version is in TC clocks. 266 * 1510 version is in TC clocks.
293 */ 267 */
294 .enable = &omap1_clk_enable_generic,
295 .disable = &omap1_clk_disable_generic,
296}; 268};
297 269
298static struct clk dsp_ck = { 270static struct clk dsp_ck = {
299 .name = "dsp_ck", 271 .name = "dsp_ck",
272 .ops = &clkops_generic,
300 .parent = &ck_dpll1, 273 .parent = &ck_dpll1,
301 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 274 .enable_reg = OMAP1_IO_ADDRESS(ARM_CKCTL),
302 RATE_CKCTL,
303 .enable_reg = (void __iomem *)ARM_CKCTL,
304 .enable_bit = EN_DSPCK, 275 .enable_bit = EN_DSPCK,
305 .rate_offset = CKCTL_DSPDIV_OFFSET, 276 .rate_offset = CKCTL_DSPDIV_OFFSET,
306 .recalc = &omap1_ckctl_recalc, 277 .recalc = &omap1_ckctl_recalc,
307 .enable = &omap1_clk_enable_generic, 278 .round_rate = omap1_clk_round_rate_ckctl_arm,
308 .disable = &omap1_clk_disable_generic, 279 .set_rate = omap1_clk_set_rate_ckctl_arm,
309}; 280};
310 281
311static struct clk dspmmu_ck = { 282static struct clk dspmmu_ck = {
312 .name = "dspmmu_ck", 283 .name = "dspmmu_ck",
284 .ops = &clkops_null,
313 .parent = &ck_dpll1, 285 .parent = &ck_dpll1,
314 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
315 RATE_CKCTL | ALWAYS_ENABLED,
316 .rate_offset = CKCTL_DSPMMUDIV_OFFSET, 286 .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
317 .recalc = &omap1_ckctl_recalc, 287 .recalc = &omap1_ckctl_recalc,
318 .enable = &omap1_clk_enable_generic, 288 .round_rate = omap1_clk_round_rate_ckctl_arm,
319 .disable = &omap1_clk_disable_generic, 289 .set_rate = omap1_clk_set_rate_ckctl_arm,
320}; 290};
321 291
322static struct clk dspper_ck = { 292static struct clk dspper_ck = {
323 .name = "dspper_ck", 293 .name = "dspper_ck",
294 .ops = &clkops_dspck,
324 .parent = &ck_dpll1, 295 .parent = &ck_dpll1,
325 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
326 RATE_CKCTL | VIRTUAL_IO_ADDRESS,
327 .enable_reg = DSP_IDLECT2, 296 .enable_reg = DSP_IDLECT2,
328 .enable_bit = EN_PERCK, 297 .enable_bit = EN_PERCK,
329 .rate_offset = CKCTL_PERDIV_OFFSET, 298 .rate_offset = CKCTL_PERDIV_OFFSET,
330 .recalc = &omap1_ckctl_recalc_dsp_domain, 299 .recalc = &omap1_ckctl_recalc_dsp_domain,
300 .round_rate = omap1_clk_round_rate_ckctl_arm,
331 .set_rate = &omap1_clk_set_rate_dsp_domain, 301 .set_rate = &omap1_clk_set_rate_dsp_domain,
332 .enable = &omap1_clk_enable_dsp_domain,
333 .disable = &omap1_clk_disable_dsp_domain,
334}; 302};
335 303
336static struct clk dspxor_ck = { 304static struct clk dspxor_ck = {
337 .name = "dspxor_ck", 305 .name = "dspxor_ck",
306 .ops = &clkops_dspck,
338 .parent = &ck_ref, 307 .parent = &ck_ref,
339 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
340 VIRTUAL_IO_ADDRESS,
341 .enable_reg = DSP_IDLECT2, 308 .enable_reg = DSP_IDLECT2,
342 .enable_bit = EN_XORPCK, 309 .enable_bit = EN_XORPCK,
343 .recalc = &followparent_recalc, 310 .recalc = &followparent_recalc,
344 .enable = &omap1_clk_enable_dsp_domain,
345 .disable = &omap1_clk_disable_dsp_domain,
346}; 311};
347 312
348static struct clk dsptim_ck = { 313static struct clk dsptim_ck = {
349 .name = "dsptim_ck", 314 .name = "dsptim_ck",
315 .ops = &clkops_dspck,
350 .parent = &ck_ref, 316 .parent = &ck_ref,
351 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
352 VIRTUAL_IO_ADDRESS,
353 .enable_reg = DSP_IDLECT2, 317 .enable_reg = DSP_IDLECT2,
354 .enable_bit = EN_DSPTIMCK, 318 .enable_bit = EN_DSPTIMCK,
355 .recalc = &followparent_recalc, 319 .recalc = &followparent_recalc,
356 .enable = &omap1_clk_enable_dsp_domain,
357 .disable = &omap1_clk_disable_dsp_domain,
358}; 320};
359 321
360/* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */ 322/* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */
361static struct arm_idlect1_clk tc_ck = { 323static struct arm_idlect1_clk tc_ck = {
362 .clk = { 324 .clk = {
363 .name = "tc_ck", 325 .name = "tc_ck",
326 .ops = &clkops_null,
364 .parent = &ck_dpll1, 327 .parent = &ck_dpll1,
365 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 328 .flags = CLOCK_IDLE_CONTROL,
366 CLOCK_IN_OMAP730 | CLOCK_IN_OMAP310 |
367 RATE_CKCTL | RATE_PROPAGATES |
368 ALWAYS_ENABLED | CLOCK_IDLE_CONTROL,
369 .rate_offset = CKCTL_TCDIV_OFFSET, 329 .rate_offset = CKCTL_TCDIV_OFFSET,
370 .recalc = &omap1_ckctl_recalc, 330 .recalc = &omap1_ckctl_recalc,
371 .enable = &omap1_clk_enable_generic, 331 .round_rate = omap1_clk_round_rate_ckctl_arm,
372 .disable = &omap1_clk_disable_generic, 332 .set_rate = omap1_clk_set_rate_ckctl_arm,
373 }, 333 },
374 .idlect_shift = 6, 334 .idlect_shift = 6,
375}; 335};
376 336
377static struct clk arminth_ck1510 = { 337static struct clk arminth_ck1510 = {
378 .name = "arminth_ck", 338 .name = "arminth_ck",
339 .ops = &clkops_null,
379 .parent = &tc_ck.clk, 340 .parent = &tc_ck.clk,
380 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
381 ALWAYS_ENABLED,
382 .recalc = &followparent_recalc, 341 .recalc = &followparent_recalc,
383 /* Note: On 1510 the frequency follows TC_CK 342 /* Note: On 1510 the frequency follows TC_CK
384 * 343 *
385 * 16xx version is in MPU clocks. 344 * 16xx version is in MPU clocks.
386 */ 345 */
387 .enable = &omap1_clk_enable_generic,
388 .disable = &omap1_clk_disable_generic,
389}; 346};
390 347
391static struct clk tipb_ck = { 348static struct clk tipb_ck = {
392 /* No-idle controlled by "tc_ck" */ 349 /* No-idle controlled by "tc_ck" */
393 .name = "tipb_ck", 350 .name = "tipb_ck",
351 .ops = &clkops_null,
394 .parent = &tc_ck.clk, 352 .parent = &tc_ck.clk,
395 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 |
396 ALWAYS_ENABLED,
397 .recalc = &followparent_recalc, 353 .recalc = &followparent_recalc,
398 .enable = &omap1_clk_enable_generic,
399 .disable = &omap1_clk_disable_generic,
400}; 354};
401 355
402static struct clk l3_ocpi_ck = { 356static struct clk l3_ocpi_ck = {
403 /* No-idle controlled by "tc_ck" */ 357 /* No-idle controlled by "tc_ck" */
404 .name = "l3_ocpi_ck", 358 .name = "l3_ocpi_ck",
359 .ops = &clkops_generic,
405 .parent = &tc_ck.clk, 360 .parent = &tc_ck.clk,
406 .flags = CLOCK_IN_OMAP16XX, 361 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
407 .enable_reg = (void __iomem *)ARM_IDLECT3,
408 .enable_bit = EN_OCPI_CK, 362 .enable_bit = EN_OCPI_CK,
409 .recalc = &followparent_recalc, 363 .recalc = &followparent_recalc,
410 .enable = &omap1_clk_enable_generic,
411 .disable = &omap1_clk_disable_generic,
412}; 364};
413 365
414static struct clk tc1_ck = { 366static struct clk tc1_ck = {
415 .name = "tc1_ck", 367 .name = "tc1_ck",
368 .ops = &clkops_generic,
416 .parent = &tc_ck.clk, 369 .parent = &tc_ck.clk,
417 .flags = CLOCK_IN_OMAP16XX, 370 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
418 .enable_reg = (void __iomem *)ARM_IDLECT3,
419 .enable_bit = EN_TC1_CK, 371 .enable_bit = EN_TC1_CK,
420 .recalc = &followparent_recalc, 372 .recalc = &followparent_recalc,
421 .enable = &omap1_clk_enable_generic,
422 .disable = &omap1_clk_disable_generic,
423}; 373};
424 374
425static struct clk tc2_ck = { 375static struct clk tc2_ck = {
426 .name = "tc2_ck", 376 .name = "tc2_ck",
377 .ops = &clkops_generic,
427 .parent = &tc_ck.clk, 378 .parent = &tc_ck.clk,
428 .flags = CLOCK_IN_OMAP16XX, 379 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
429 .enable_reg = (void __iomem *)ARM_IDLECT3,
430 .enable_bit = EN_TC2_CK, 380 .enable_bit = EN_TC2_CK,
431 .recalc = &followparent_recalc, 381 .recalc = &followparent_recalc,
432 .enable = &omap1_clk_enable_generic,
433 .disable = &omap1_clk_disable_generic,
434}; 382};
435 383
436static struct clk dma_ck = { 384static struct clk dma_ck = {
437 /* No-idle controlled by "tc_ck" */ 385 /* No-idle controlled by "tc_ck" */
438 .name = "dma_ck", 386 .name = "dma_ck",
387 .ops = &clkops_null,
439 .parent = &tc_ck.clk, 388 .parent = &tc_ck.clk,
440 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
441 CLOCK_IN_OMAP310 | ALWAYS_ENABLED,
442 .recalc = &followparent_recalc, 389 .recalc = &followparent_recalc,
443 .enable = &omap1_clk_enable_generic,
444 .disable = &omap1_clk_disable_generic,
445}; 390};
446 391
447static struct clk dma_lcdfree_ck = { 392static struct clk dma_lcdfree_ck = {
448 .name = "dma_lcdfree_ck", 393 .name = "dma_lcdfree_ck",
394 .ops = &clkops_null,
449 .parent = &tc_ck.clk, 395 .parent = &tc_ck.clk,
450 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
451 .recalc = &followparent_recalc, 396 .recalc = &followparent_recalc,
452 .enable = &omap1_clk_enable_generic,
453 .disable = &omap1_clk_disable_generic,
454}; 397};
455 398
456static struct arm_idlect1_clk api_ck = { 399static struct arm_idlect1_clk api_ck = {
457 .clk = { 400 .clk = {
458 .name = "api_ck", 401 .name = "api_ck",
402 .ops = &clkops_generic,
459 .parent = &tc_ck.clk, 403 .parent = &tc_ck.clk,
460 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 404 .flags = CLOCK_IDLE_CONTROL,
461 CLOCK_IN_OMAP310 | CLOCK_IDLE_CONTROL, 405 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
462 .enable_reg = (void __iomem *)ARM_IDLECT2,
463 .enable_bit = EN_APICK, 406 .enable_bit = EN_APICK,
464 .recalc = &followparent_recalc, 407 .recalc = &followparent_recalc,
465 .enable = &omap1_clk_enable_generic,
466 .disable = &omap1_clk_disable_generic,
467 }, 408 },
468 .idlect_shift = 8, 409 .idlect_shift = 8,
469}; 410};
@@ -471,276 +412,238 @@ static struct arm_idlect1_clk api_ck = {
471static struct arm_idlect1_clk lb_ck = { 412static struct arm_idlect1_clk lb_ck = {
472 .clk = { 413 .clk = {
473 .name = "lb_ck", 414 .name = "lb_ck",
415 .ops = &clkops_generic,
474 .parent = &tc_ck.clk, 416 .parent = &tc_ck.clk,
475 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 417 .flags = CLOCK_IDLE_CONTROL,
476 CLOCK_IDLE_CONTROL, 418 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
477 .enable_reg = (void __iomem *)ARM_IDLECT2,
478 .enable_bit = EN_LBCK, 419 .enable_bit = EN_LBCK,
479 .recalc = &followparent_recalc, 420 .recalc = &followparent_recalc,
480 .enable = &omap1_clk_enable_generic,
481 .disable = &omap1_clk_disable_generic,
482 }, 421 },
483 .idlect_shift = 4, 422 .idlect_shift = 4,
484}; 423};
485 424
486static struct clk rhea1_ck = { 425static struct clk rhea1_ck = {
487 .name = "rhea1_ck", 426 .name = "rhea1_ck",
427 .ops = &clkops_null,
488 .parent = &tc_ck.clk, 428 .parent = &tc_ck.clk,
489 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
490 .recalc = &followparent_recalc, 429 .recalc = &followparent_recalc,
491 .enable = &omap1_clk_enable_generic,
492 .disable = &omap1_clk_disable_generic,
493}; 430};
494 431
495static struct clk rhea2_ck = { 432static struct clk rhea2_ck = {
496 .name = "rhea2_ck", 433 .name = "rhea2_ck",
434 .ops = &clkops_null,
497 .parent = &tc_ck.clk, 435 .parent = &tc_ck.clk,
498 .flags = CLOCK_IN_OMAP16XX | ALWAYS_ENABLED,
499 .recalc = &followparent_recalc, 436 .recalc = &followparent_recalc,
500 .enable = &omap1_clk_enable_generic,
501 .disable = &omap1_clk_disable_generic,
502}; 437};
503 438
504static struct clk lcd_ck_16xx = { 439static struct clk lcd_ck_16xx = {
505 .name = "lcd_ck", 440 .name = "lcd_ck",
441 .ops = &clkops_generic,
506 .parent = &ck_dpll1, 442 .parent = &ck_dpll1,
507 .flags = CLOCK_IN_OMAP16XX | CLOCK_IN_OMAP730 | RATE_CKCTL, 443 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
508 .enable_reg = (void __iomem *)ARM_IDLECT2,
509 .enable_bit = EN_LCDCK, 444 .enable_bit = EN_LCDCK,
510 .rate_offset = CKCTL_LCDDIV_OFFSET, 445 .rate_offset = CKCTL_LCDDIV_OFFSET,
511 .recalc = &omap1_ckctl_recalc, 446 .recalc = &omap1_ckctl_recalc,
512 .enable = &omap1_clk_enable_generic, 447 .round_rate = omap1_clk_round_rate_ckctl_arm,
513 .disable = &omap1_clk_disable_generic, 448 .set_rate = omap1_clk_set_rate_ckctl_arm,
514}; 449};
515 450
516static struct arm_idlect1_clk lcd_ck_1510 = { 451static struct arm_idlect1_clk lcd_ck_1510 = {
517 .clk = { 452 .clk = {
518 .name = "lcd_ck", 453 .name = "lcd_ck",
454 .ops = &clkops_generic,
519 .parent = &ck_dpll1, 455 .parent = &ck_dpll1,
520 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 456 .flags = CLOCK_IDLE_CONTROL,
521 RATE_CKCTL | CLOCK_IDLE_CONTROL, 457 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
522 .enable_reg = (void __iomem *)ARM_IDLECT2,
523 .enable_bit = EN_LCDCK, 458 .enable_bit = EN_LCDCK,
524 .rate_offset = CKCTL_LCDDIV_OFFSET, 459 .rate_offset = CKCTL_LCDDIV_OFFSET,
525 .recalc = &omap1_ckctl_recalc, 460 .recalc = &omap1_ckctl_recalc,
526 .enable = &omap1_clk_enable_generic, 461 .round_rate = omap1_clk_round_rate_ckctl_arm,
527 .disable = &omap1_clk_disable_generic, 462 .set_rate = omap1_clk_set_rate_ckctl_arm,
528 }, 463 },
529 .idlect_shift = 3, 464 .idlect_shift = 3,
530}; 465};
531 466
532static struct clk uart1_1510 = { 467static struct clk uart1_1510 = {
533 .name = "uart1_ck", 468 .name = "uart1_ck",
469 .ops = &clkops_null,
534 /* Direct from ULPD, no real parent */ 470 /* Direct from ULPD, no real parent */
535 .parent = &armper_ck.clk, 471 .parent = &armper_ck.clk,
536 .rate = 12000000, 472 .rate = 12000000,
537 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 473 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
538 ENABLE_REG_32BIT | ALWAYS_ENABLED | 474 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
539 CLOCK_NO_IDLE_PARENT,
540 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
541 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */ 475 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */
542 .set_rate = &omap1_set_uart_rate, 476 .set_rate = &omap1_set_uart_rate,
543 .recalc = &omap1_uart_recalc, 477 .recalc = &omap1_uart_recalc,
544 .enable = &omap1_clk_enable_generic,
545 .disable = &omap1_clk_disable_generic,
546}; 478};
547 479
548static struct uart_clk uart1_16xx = { 480static struct uart_clk uart1_16xx = {
549 .clk = { 481 .clk = {
550 .name = "uart1_ck", 482 .name = "uart1_ck",
483 .ops = &clkops_uart,
551 /* Direct from ULPD, no real parent */ 484 /* Direct from ULPD, no real parent */
552 .parent = &armper_ck.clk, 485 .parent = &armper_ck.clk,
553 .rate = 48000000, 486 .rate = 48000000,
554 .flags = CLOCK_IN_OMAP16XX | RATE_FIXED | 487 .flags = RATE_FIXED | ENABLE_REG_32BIT |
555 ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, 488 CLOCK_NO_IDLE_PARENT,
556 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 489 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
557 .enable_bit = 29, 490 .enable_bit = 29,
558 .enable = &omap1_clk_enable_uart_functional,
559 .disable = &omap1_clk_disable_uart_functional,
560 }, 491 },
561 .sysc_addr = 0xfffb0054, 492 .sysc_addr = 0xfffb0054,
562}; 493};
563 494
564static struct clk uart2_ck = { 495static struct clk uart2_ck = {
565 .name = "uart2_ck", 496 .name = "uart2_ck",
497 .ops = &clkops_null,
566 /* Direct from ULPD, no real parent */ 498 /* Direct from ULPD, no real parent */
567 .parent = &armper_ck.clk, 499 .parent = &armper_ck.clk,
568 .rate = 12000000, 500 .rate = 12000000,
569 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 501 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
570 CLOCK_IN_OMAP310 | ENABLE_REG_32BIT | 502 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
571 ALWAYS_ENABLED | CLOCK_NO_IDLE_PARENT,
572 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
573 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */ 503 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */
574 .set_rate = &omap1_set_uart_rate, 504 .set_rate = &omap1_set_uart_rate,
575 .recalc = &omap1_uart_recalc, 505 .recalc = &omap1_uart_recalc,
576 .enable = &omap1_clk_enable_generic,
577 .disable = &omap1_clk_disable_generic,
578}; 506};
579 507
580static struct clk uart3_1510 = { 508static struct clk uart3_1510 = {
581 .name = "uart3_ck", 509 .name = "uart3_ck",
510 .ops = &clkops_null,
582 /* Direct from ULPD, no real parent */ 511 /* Direct from ULPD, no real parent */
583 .parent = &armper_ck.clk, 512 .parent = &armper_ck.clk,
584 .rate = 12000000, 513 .rate = 12000000,
585 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 514 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
586 ENABLE_REG_32BIT | ALWAYS_ENABLED | 515 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
587 CLOCK_NO_IDLE_PARENT,
588 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
589 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */ 516 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */
590 .set_rate = &omap1_set_uart_rate, 517 .set_rate = &omap1_set_uart_rate,
591 .recalc = &omap1_uart_recalc, 518 .recalc = &omap1_uart_recalc,
592 .enable = &omap1_clk_enable_generic,
593 .disable = &omap1_clk_disable_generic,
594}; 519};
595 520
596static struct uart_clk uart3_16xx = { 521static struct uart_clk uart3_16xx = {
597 .clk = { 522 .clk = {
598 .name = "uart3_ck", 523 .name = "uart3_ck",
524 .ops = &clkops_uart,
599 /* Direct from ULPD, no real parent */ 525 /* Direct from ULPD, no real parent */
600 .parent = &armper_ck.clk, 526 .parent = &armper_ck.clk,
601 .rate = 48000000, 527 .rate = 48000000,
602 .flags = CLOCK_IN_OMAP16XX | RATE_FIXED | 528 .flags = RATE_FIXED | ENABLE_REG_32BIT |
603 ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, 529 CLOCK_NO_IDLE_PARENT,
604 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0, 530 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
605 .enable_bit = 31, 531 .enable_bit = 31,
606 .enable = &omap1_clk_enable_uart_functional,
607 .disable = &omap1_clk_disable_uart_functional,
608 }, 532 },
609 .sysc_addr = 0xfffb9854, 533 .sysc_addr = 0xfffb9854,
610}; 534};
611 535
612static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */ 536static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */
613 .name = "usb_clko", 537 .name = "usb_clko",
538 .ops = &clkops_generic,
614 /* Direct from ULPD, no parent */ 539 /* Direct from ULPD, no parent */
615 .rate = 6000000, 540 .rate = 6000000,
616 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 541 .flags = RATE_FIXED | ENABLE_REG_32BIT,
617 CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT, 542 .enable_reg = OMAP1_IO_ADDRESS(ULPD_CLOCK_CTRL),
618 .enable_reg = (void __iomem *)ULPD_CLOCK_CTRL,
619 .enable_bit = USB_MCLK_EN_BIT, 543 .enable_bit = USB_MCLK_EN_BIT,
620 .enable = &omap1_clk_enable_generic,
621 .disable = &omap1_clk_disable_generic,
622}; 544};
623 545
624static struct clk usb_hhc_ck1510 = { 546static struct clk usb_hhc_ck1510 = {
625 .name = "usb_hhc_ck", 547 .name = "usb_hhc_ck",
548 .ops = &clkops_generic,
626 /* Direct from ULPD, no parent */ 549 /* Direct from ULPD, no parent */
627 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */ 550 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */
628 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | 551 .flags = RATE_FIXED | ENABLE_REG_32BIT,
629 RATE_FIXED | ENABLE_REG_32BIT, 552 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
630 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
631 .enable_bit = USB_HOST_HHC_UHOST_EN, 553 .enable_bit = USB_HOST_HHC_UHOST_EN,
632 .enable = &omap1_clk_enable_generic,
633 .disable = &omap1_clk_disable_generic,
634}; 554};
635 555
636static struct clk usb_hhc_ck16xx = { 556static struct clk usb_hhc_ck16xx = {
637 .name = "usb_hhc_ck", 557 .name = "usb_hhc_ck",
558 .ops = &clkops_generic,
638 /* Direct from ULPD, no parent */ 559 /* Direct from ULPD, no parent */
639 .rate = 48000000, 560 .rate = 48000000,
640 /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */ 561 /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
641 .flags = CLOCK_IN_OMAP16XX | 562 .flags = RATE_FIXED | ENABLE_REG_32BIT,
642 RATE_FIXED | ENABLE_REG_32BIT, 563 .enable_reg = OMAP1_IO_ADDRESS(OTG_BASE + 0x08), /* OTG_SYSCON_2 */
643 .enable_reg = (void __iomem *)OTG_BASE + 0x08 /* OTG_SYSCON_2 */,
644 .enable_bit = 8 /* UHOST_EN */, 564 .enable_bit = 8 /* UHOST_EN */,
645 .enable = &omap1_clk_enable_generic,
646 .disable = &omap1_clk_disable_generic,
647}; 565};
648 566
649static struct clk usb_dc_ck = { 567static struct clk usb_dc_ck = {
650 .name = "usb_dc_ck", 568 .name = "usb_dc_ck",
569 .ops = &clkops_generic,
651 /* Direct from ULPD, no parent */ 570 /* Direct from ULPD, no parent */
652 .rate = 48000000, 571 .rate = 48000000,
653 .flags = CLOCK_IN_OMAP16XX | RATE_FIXED, 572 .flags = RATE_FIXED,
654 .enable_reg = (void __iomem *)SOFT_REQ_REG, 573 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
655 .enable_bit = 4, 574 .enable_bit = 4,
656 .enable = &omap1_clk_enable_generic,
657 .disable = &omap1_clk_disable_generic,
658}; 575};
659 576
660static struct clk mclk_1510 = { 577static struct clk mclk_1510 = {
661 .name = "mclk", 578 .name = "mclk",
579 .ops = &clkops_generic,
662 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 580 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
663 .rate = 12000000, 581 .rate = 12000000,
664 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, 582 .flags = RATE_FIXED,
665 .enable_reg = (void __iomem *)SOFT_REQ_REG, 583 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
666 .enable_bit = 6, 584 .enable_bit = 6,
667 .enable = &omap1_clk_enable_generic,
668 .disable = &omap1_clk_disable_generic,
669}; 585};
670 586
671static struct clk mclk_16xx = { 587static struct clk mclk_16xx = {
672 .name = "mclk", 588 .name = "mclk",
589 .ops = &clkops_generic,
673 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 590 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
674 .flags = CLOCK_IN_OMAP16XX, 591 .enable_reg = OMAP1_IO_ADDRESS(COM_CLK_DIV_CTRL_SEL),
675 .enable_reg = (void __iomem *)COM_CLK_DIV_CTRL_SEL,
676 .enable_bit = COM_ULPD_PLL_CLK_REQ, 592 .enable_bit = COM_ULPD_PLL_CLK_REQ,
677 .set_rate = &omap1_set_ext_clk_rate, 593 .set_rate = &omap1_set_ext_clk_rate,
678 .round_rate = &omap1_round_ext_clk_rate, 594 .round_rate = &omap1_round_ext_clk_rate,
679 .init = &omap1_init_ext_clk, 595 .init = &omap1_init_ext_clk,
680 .enable = &omap1_clk_enable_generic,
681 .disable = &omap1_clk_disable_generic,
682}; 596};
683 597
684static struct clk bclk_1510 = { 598static struct clk bclk_1510 = {
685 .name = "bclk", 599 .name = "bclk",
600 .ops = &clkops_generic,
686 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 601 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
687 .rate = 12000000, 602 .rate = 12000000,
688 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP310 | RATE_FIXED, 603 .flags = RATE_FIXED,
689 .enable = &omap1_clk_enable_generic,
690 .disable = &omap1_clk_disable_generic,
691}; 604};
692 605
693static struct clk bclk_16xx = { 606static struct clk bclk_16xx = {
694 .name = "bclk", 607 .name = "bclk",
608 .ops = &clkops_generic,
695 /* Direct from ULPD, no parent. May be enabled by ext hardware. */ 609 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
696 .flags = CLOCK_IN_OMAP16XX, 610 .enable_reg = OMAP1_IO_ADDRESS(SWD_CLK_DIV_CTRL_SEL),
697 .enable_reg = (void __iomem *)SWD_CLK_DIV_CTRL_SEL,
698 .enable_bit = SWD_ULPD_PLL_CLK_REQ, 611 .enable_bit = SWD_ULPD_PLL_CLK_REQ,
699 .set_rate = &omap1_set_ext_clk_rate, 612 .set_rate = &omap1_set_ext_clk_rate,
700 .round_rate = &omap1_round_ext_clk_rate, 613 .round_rate = &omap1_round_ext_clk_rate,
701 .init = &omap1_init_ext_clk, 614 .init = &omap1_init_ext_clk,
702 .enable = &omap1_clk_enable_generic,
703 .disable = &omap1_clk_disable_generic,
704}; 615};
705 616
706static struct clk mmc1_ck = { 617static struct clk mmc1_ck = {
707 .name = "mmc_ck", 618 .name = "mmc_ck",
619 .ops = &clkops_generic,
708 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 620 /* Functional clock is direct from ULPD, interface clock is ARMPER */
709 .parent = &armper_ck.clk, 621 .parent = &armper_ck.clk,
710 .rate = 48000000, 622 .rate = 48000000,
711 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 623 .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
712 CLOCK_IN_OMAP310 | RATE_FIXED | ENABLE_REG_32BIT | 624 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
713 CLOCK_NO_IDLE_PARENT,
714 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
715 .enable_bit = 23, 625 .enable_bit = 23,
716 .enable = &omap1_clk_enable_generic,
717 .disable = &omap1_clk_disable_generic,
718}; 626};
719 627
720static struct clk mmc2_ck = { 628static struct clk mmc2_ck = {
721 .name = "mmc_ck", 629 .name = "mmc_ck",
722 .id = 1, 630 .id = 1,
631 .ops = &clkops_generic,
723 /* Functional clock is direct from ULPD, interface clock is ARMPER */ 632 /* Functional clock is direct from ULPD, interface clock is ARMPER */
724 .parent = &armper_ck.clk, 633 .parent = &armper_ck.clk,
725 .rate = 48000000, 634 .rate = 48000000,
726 .flags = CLOCK_IN_OMAP16XX | 635 .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
727 RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT, 636 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
728 .enable_reg = (void __iomem *)MOD_CONF_CTRL_0,
729 .enable_bit = 20, 637 .enable_bit = 20,
730 .enable = &omap1_clk_enable_generic,
731 .disable = &omap1_clk_disable_generic,
732}; 638};
733 639
734static struct clk virtual_ck_mpu = { 640static struct clk virtual_ck_mpu = {
735 .name = "mpu", 641 .name = "mpu",
736 .flags = CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 642 .ops = &clkops_null,
737 CLOCK_IN_OMAP310 | VIRTUAL_CLOCK | ALWAYS_ENABLED,
738 .parent = &arm_ck, /* Is smarter alias for */ 643 .parent = &arm_ck, /* Is smarter alias for */
739 .recalc = &followparent_recalc, 644 .recalc = &followparent_recalc,
740 .set_rate = &omap1_select_table_rate, 645 .set_rate = &omap1_select_table_rate,
741 .round_rate = &omap1_round_to_table_rate, 646 .round_rate = &omap1_round_to_table_rate,
742 .enable = &omap1_clk_enable_generic,
743 .disable = &omap1_clk_disable_generic,
744}; 647};
745 648
746/* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK 649/* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK
@@ -748,78 +651,19 @@ remains active during MPU idle whenever this is enabled */
748static struct clk i2c_fck = { 651static struct clk i2c_fck = {
749 .name = "i2c_fck", 652 .name = "i2c_fck",
750 .id = 1, 653 .id = 1,
751 .flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX | 654 .ops = &clkops_null,
752 VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT | 655 .flags = CLOCK_NO_IDLE_PARENT,
753 ALWAYS_ENABLED,
754 .parent = &armxor_ck.clk, 656 .parent = &armxor_ck.clk,
755 .recalc = &followparent_recalc, 657 .recalc = &followparent_recalc,
756 .enable = &omap1_clk_enable_generic,
757 .disable = &omap1_clk_disable_generic,
758}; 658};
759 659
760static struct clk i2c_ick = { 660static struct clk i2c_ick = {
761 .name = "i2c_ick", 661 .name = "i2c_ick",
762 .id = 1, 662 .id = 1,
763 .flags = CLOCK_IN_OMAP16XX | 663 .ops = &clkops_null,
764 VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT | 664 .flags = CLOCK_NO_IDLE_PARENT,
765 ALWAYS_ENABLED,
766 .parent = &armper_ck.clk, 665 .parent = &armper_ck.clk,
767 .recalc = &followparent_recalc, 666 .recalc = &followparent_recalc,
768 .enable = &omap1_clk_enable_generic,
769 .disable = &omap1_clk_disable_generic,
770};
771
772static struct clk * onchip_clks[] = {
773 /* non-ULPD clocks */
774 &ck_ref,
775 &ck_dpll1,
776 /* CK_GEN1 clocks */
777 &ck_dpll1out.clk,
778 &sossi_ck,
779 &arm_ck,
780 &armper_ck.clk,
781 &arm_gpio_ck,
782 &armxor_ck.clk,
783 &armtim_ck.clk,
784 &armwdt_ck.clk,
785 &arminth_ck1510, &arminth_ck16xx,
786 /* CK_GEN2 clocks */
787 &dsp_ck,
788 &dspmmu_ck,
789 &dspper_ck,
790 &dspxor_ck,
791 &dsptim_ck,
792 /* CK_GEN3 clocks */
793 &tc_ck.clk,
794 &tipb_ck,
795 &l3_ocpi_ck,
796 &tc1_ck,
797 &tc2_ck,
798 &dma_ck,
799 &dma_lcdfree_ck,
800 &api_ck.clk,
801 &lb_ck.clk,
802 &rhea1_ck,
803 &rhea2_ck,
804 &lcd_ck_16xx,
805 &lcd_ck_1510.clk,
806 /* ULPD clocks */
807 &uart1_1510,
808 &uart1_16xx.clk,
809 &uart2_ck,
810 &uart3_1510,
811 &uart3_16xx.clk,
812 &usb_clko,
813 &usb_hhc_ck1510, &usb_hhc_ck16xx,
814 &usb_dc_ck,
815 &mclk_1510, &mclk_16xx,
816 &bclk_1510, &bclk_16xx,
817 &mmc1_ck,
818 &mmc2_ck,
819 /* Virtual clocks */
820 &virtual_ck_mpu,
821 &i2c_fck,
822 &i2c_ick,
823}; 667};
824 668
825#endif 669#endif
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index ba5d7c08dc17..bbbaeb0abcd3 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -86,7 +86,7 @@ static struct resource mbox_resources[] = {
86}; 86};
87 87
88static struct platform_device mbox_device = { 88static struct platform_device mbox_device = {
89 .name = "mailbox", 89 .name = "omap1-mailbox",
90 .id = -1, 90 .id = -1,
91 .num_resources = ARRAY_SIZE(mbox_resources), 91 .num_resources = ARRAY_SIZE(mbox_resources),
92 .resource = mbox_resources, 92 .resource = mbox_resources,
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index 89bb8756f450..4ef26faf083e 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -38,6 +38,7 @@ static struct omap_id omap_ids[] __initdata = {
38 { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, 38 { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000},
39 { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100}, 39 { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100},
40 { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300}, 40 { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300},
41 { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320500, .type = 0x08500000},
41 { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000}, 42 { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000},
42 { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000}, 43 { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000},
43 { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000}, 44 { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000},
@@ -77,7 +78,7 @@ static u16 __init omap_get_jtag_id(void)
77 prod_id = omap_readl(OMAP_PRODUCTION_ID_1); 78 prod_id = omap_readl(OMAP_PRODUCTION_ID_1);
78 omap_id = omap_readl(OMAP32_ID_1); 79 omap_id = omap_readl(OMAP32_ID_1);
79 80
80 /* Check for unusable OMAP_PRODUCTION_ID_1 on 1611B/5912 and 730 */ 81 /* Check for unusable OMAP_PRODUCTION_ID_1 on 1611B/5912 and 730/850 */
81 if (((prod_id >> 20) == 0) || (prod_id == omap_id)) 82 if (((prod_id >> 20) == 0) || (prod_id == omap_id))
82 prod_id = 0; 83 prod_id = 0;
83 else 84 else
@@ -178,6 +179,7 @@ void __init omap_check_revision(void)
178 179
179 switch (cpu_type) { 180 switch (cpu_type) {
180 case 0x07: 181 case 0x07:
182 case 0x08:
181 omap_revision |= 0x07; 183 omap_revision |= 0x07;
182 break; 184 break;
183 case 0x03: 185 case 0x03:
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 4c3e582f3d3c..3afe540149f7 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -52,6 +52,22 @@ static struct map_desc omap730_io_desc[] __initdata = {
52}; 52};
53#endif 53#endif
54 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
67 }
68};
69#endif
70
55#ifdef CONFIG_ARCH_OMAP15XX 71#ifdef CONFIG_ARCH_OMAP15XX
56static struct map_desc omap1510_io_desc[] __initdata = { 72static struct map_desc omap1510_io_desc[] __initdata = {
57 { 73 {
@@ -109,6 +125,13 @@ void __init omap1_map_common_io(void)
109 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc)); 125 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc));
110 } 126 }
111#endif 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 }
133#endif
134
112#ifdef CONFIG_ARCH_OMAP15XX 135#ifdef CONFIG_ARCH_OMAP15XX
113 if (cpu_is_omap15xx()) { 136 if (cpu_is_omap15xx()) {
114 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); 137 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 9ad5197075ff..de03c8448994 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -145,6 +145,14 @@ static struct omap_irq_bank omap730_irq_banks[] = {
145}; 145};
146#endif 146#endif
147 147
148#ifdef CONFIG_ARCH_OMAP850
149static struct omap_irq_bank omap850_irq_banks[] = {
150 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f },
151 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 },
152 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 },
153};
154#endif
155
148#ifdef CONFIG_ARCH_OMAP15XX 156#ifdef CONFIG_ARCH_OMAP15XX
149static struct omap_irq_bank omap1510_irq_banks[] = { 157static struct omap_irq_bank omap1510_irq_banks[] = {
150 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3febfff }, 158 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3febfff },
@@ -184,6 +192,12 @@ void __init omap_init_irq(void)
184 irq_bank_count = ARRAY_SIZE(omap730_irq_banks); 192 irq_bank_count = ARRAY_SIZE(omap730_irq_banks);
185 } 193 }
186#endif 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 }
200#endif
187#ifdef CONFIG_ARCH_OMAP15XX 201#ifdef CONFIG_ARCH_OMAP15XX
188 if (cpu_is_omap1510()) { 202 if (cpu_is_omap1510()) {
189 irq_banks = omap1510_irq_banks; 203 irq_banks = omap1510_irq_banks;
@@ -214,9 +228,8 @@ void __init omap_init_irq(void)
214 irq_bank_writel(0x03, 1, IRQ_CONTROL_REG_OFFSET); 228 irq_bank_writel(0x03, 1, IRQ_CONTROL_REG_OFFSET);
215 229
216 /* Enable interrupts in global mask */ 230 /* Enable interrupts in global mask */
217 if (cpu_is_omap730()) { 231 if (cpu_is_omap7xx())
218 irq_bank_writel(0x0, 0, IRQ_GMR_REG_OFFSET); 232 irq_bank_writel(0x0, 0, IRQ_GMR_REG_OFFSET);
219 }
220 233
221 /* Install the interrupt handlers for each bank */ 234 /* Install the interrupt handlers for each bank */
222 for (i = 0; i < irq_bank_count; i++) { 235 for (i = 0; i < irq_bank_count; i++) {
@@ -236,6 +249,8 @@ void __init omap_init_irq(void)
236 249
237 if (cpu_is_omap730()) 250 if (cpu_is_omap730())
238 omap_unmask_irq(INT_730_IH2_IRQ); 251 omap_unmask_irq(INT_730_IH2_IRQ);
252 else if (cpu_is_omap850())
253 omap_unmask_irq(INT_850_IH2_IRQ);
239 else if (cpu_is_omap15xx()) 254 else if (cpu_is_omap15xx())
240 omap_unmask_irq(INT_1510_IH2_IRQ); 255 omap_unmask_irq(INT_1510_IH2_IRQ);
241 else if (cpu_is_omap16xx()) 256 else if (cpu_is_omap16xx())
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 59abbf331a96..0af4d6c85b47 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Mailbox reservation modules for DSP 2 * Mailbox reservation modules for DSP
3 * 3 *
4 * Copyright (C) 2006 Nokia Corporation 4 * Copyright (C) 2006-2009 Nokia Corporation
5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> 5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
@@ -27,7 +27,7 @@
27#define MAILBOX_DSP2ARM1_Flag 0x1c 27#define MAILBOX_DSP2ARM1_Flag 0x1c
28#define MAILBOX_DSP2ARM2_Flag 0x20 28#define MAILBOX_DSP2ARM2_Flag 0x20
29 29
30unsigned long mbox_base; 30static void __iomem *mbox_base;
31 31
32struct omap_mbox1_fifo { 32struct omap_mbox1_fifo {
33 unsigned long cmd; 33 unsigned long cmd;
@@ -40,14 +40,14 @@ struct omap_mbox1_priv {
40 struct omap_mbox1_fifo rx_fifo; 40 struct omap_mbox1_fifo rx_fifo;
41}; 41};
42 42
43static inline int mbox_read_reg(unsigned int reg) 43static inline int mbox_read_reg(size_t ofs)
44{ 44{
45 return __raw_readw(mbox_base + reg); 45 return __raw_readw(mbox_base + ofs);
46} 46}
47 47
48static inline void mbox_write_reg(unsigned int val, unsigned int reg) 48static inline void mbox_write_reg(u32 val, size_t ofs)
49{ 49{
50 __raw_writew(val, mbox_base + reg); 50 __raw_writew(val, mbox_base + ofs);
51} 51}
52 52
53/* msg */ 53/* msg */
@@ -143,7 +143,7 @@ struct omap_mbox mbox_dsp_info = {
143}; 143};
144EXPORT_SYMBOL(mbox_dsp_info); 144EXPORT_SYMBOL(mbox_dsp_info);
145 145
146static int __init omap1_mbox_probe(struct platform_device *pdev) 146static int __devinit omap1_mbox_probe(struct platform_device *pdev)
147{ 147{
148 struct resource *res; 148 struct resource *res;
149 int ret = 0; 149 int ret = 0;
@@ -170,12 +170,10 @@ static int __init omap1_mbox_probe(struct platform_device *pdev)
170 } 170 }
171 mbox_dsp_info.irq = res->start; 171 mbox_dsp_info.irq = res->start;
172 172
173 ret = omap_mbox_register(&mbox_dsp_info); 173 return omap_mbox_register(&pdev->dev, &mbox_dsp_info);
174
175 return ret;
176} 174}
177 175
178static int omap1_mbox_remove(struct platform_device *pdev) 176static int __devexit omap1_mbox_remove(struct platform_device *pdev)
179{ 177{
180 omap_mbox_unregister(&mbox_dsp_info); 178 omap_mbox_unregister(&mbox_dsp_info);
181 179
@@ -184,9 +182,9 @@ static int omap1_mbox_remove(struct platform_device *pdev)
184 182
185static struct platform_driver omap1_mbox_driver = { 183static struct platform_driver omap1_mbox_driver = {
186 .probe = omap1_mbox_probe, 184 .probe = omap1_mbox_probe,
187 .remove = omap1_mbox_remove, 185 .remove = __devexit_p(omap1_mbox_remove),
188 .driver = { 186 .driver = {
189 .name = "mailbox", 187 .name = "omap1-mailbox",
190 }, 188 },
191}; 189};
192 190
@@ -203,4 +201,7 @@ static void __exit omap1_mbox_exit(void)
203module_init(omap1_mbox_init); 201module_init(omap1_mbox_init);
204module_exit(omap1_mbox_exit); 202module_exit(omap1_mbox_exit);
205 203
206MODULE_LICENSE("GPL"); 204MODULE_LICENSE("GPL v2");
205MODULE_DESCRIPTION("omap mailbox: omap1 architecture specific functions");
206MODULE_AUTHOR("Hiroshi DOYU" <Hiroshi.DOYU@nokia.com>);
207MODULE_ALIAS("platform:omap1-mailbox");
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index 575ba31295cf..d040c3f1027f 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -28,9 +28,9 @@
28#define DPS_RSTCT2_PER_EN (1 << 0) 28#define DPS_RSTCT2_PER_EN (1 << 0)
29#define DSP_RSTCT2_WD_PER_EN (1 << 1) 29#define DSP_RSTCT2_WD_PER_EN (1 << 1)
30 30
31#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) 31static int dsp_use;
32const char *clk_names[] = { "dsp_ck", "api_ck", "dspxor_ck" }; 32static struct clk *api_clk;
33#endif 33static struct clk *dsp_clk;
34 34
35static void omap1_mcbsp_request(unsigned int id) 35static void omap1_mcbsp_request(unsigned int id)
36{ 36{
@@ -39,20 +39,40 @@ static void omap1_mcbsp_request(unsigned int id)
39 * are DSP public peripherals. 39 * are DSP public peripherals.
40 */ 40 */
41 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { 41 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) {
42 omap_dsp_request_mem(); 42 if (dsp_use++ == 0) {
43 /* 43 api_clk = clk_get(NULL, "api_clk");
44 * DSP external peripheral reset 44 dsp_clk = clk_get(NULL, "dsp_clk");
45 * FIXME: This should be moved to dsp code 45 if (!IS_ERR(api_clk) && !IS_ERR(dsp_clk)) {
46 */ 46 clk_enable(api_clk);
47 __raw_writew(__raw_readw(DSP_RSTCT2) | DPS_RSTCT2_PER_EN | 47 clk_enable(dsp_clk);
48 DSP_RSTCT2_WD_PER_EN, DSP_RSTCT2); 48
49 omap_dsp_request_mem();
50 /*
51 * DSP external peripheral reset
52 * FIXME: This should be moved to dsp code
53 */
54 __raw_writew(__raw_readw(DSP_RSTCT2) | DPS_RSTCT2_PER_EN |
55 DSP_RSTCT2_WD_PER_EN, DSP_RSTCT2);
56 }
57 }
49 } 58 }
50} 59}
51 60
52static void omap1_mcbsp_free(unsigned int id) 61static void omap1_mcbsp_free(unsigned int id)
53{ 62{
54 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) 63 if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) {
55 omap_dsp_release_mem(); 64 if (--dsp_use == 0) {
65 omap_dsp_release_mem();
66 if (!IS_ERR(api_clk)) {
67 clk_disable(api_clk);
68 clk_put(api_clk);
69 }
70 if (!IS_ERR(dsp_clk)) {
71 clk_disable(dsp_clk);
72 clk_put(dsp_clk);
73 }
74 }
75 }
56} 76}
57 77
58static struct omap_mcbsp_ops omap1_mcbsp_ops = { 78static struct omap_mcbsp_ops omap1_mcbsp_ops = {
@@ -94,8 +114,6 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
94 .rx_irq = INT_McBSP1RX, 114 .rx_irq = INT_McBSP1RX,
95 .tx_irq = INT_McBSP1TX, 115 .tx_irq = INT_McBSP1TX,
96 .ops = &omap1_mcbsp_ops, 116 .ops = &omap1_mcbsp_ops,
97 .clk_names = clk_names,
98 .num_clks = 3,
99 }, 117 },
100 { 118 {
101 .phys_base = OMAP1510_MCBSP2_BASE, 119 .phys_base = OMAP1510_MCBSP2_BASE,
@@ -112,8 +130,6 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
112 .rx_irq = INT_McBSP3RX, 130 .rx_irq = INT_McBSP3RX,
113 .tx_irq = INT_McBSP3TX, 131 .tx_irq = INT_McBSP3TX,
114 .ops = &omap1_mcbsp_ops, 132 .ops = &omap1_mcbsp_ops,
115 .clk_names = clk_names,
116 .num_clks = 3,
117 }, 133 },
118}; 134};
119#define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) 135#define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata)
@@ -131,8 +147,6 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
131 .rx_irq = INT_McBSP1RX, 147 .rx_irq = INT_McBSP1RX,
132 .tx_irq = INT_McBSP1TX, 148 .tx_irq = INT_McBSP1TX,
133 .ops = &omap1_mcbsp_ops, 149 .ops = &omap1_mcbsp_ops,
134 .clk_names = clk_names,
135 .num_clks = 3,
136 }, 150 },
137 { 151 {
138 .phys_base = OMAP1610_MCBSP2_BASE, 152 .phys_base = OMAP1610_MCBSP2_BASE,
@@ -149,8 +163,6 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
149 .rx_irq = INT_McBSP3RX, 163 .rx_irq = INT_McBSP3RX,
150 .tx_irq = INT_McBSP3TX, 164 .tx_irq = INT_McBSP3TX,
151 .ops = &omap1_mcbsp_ops, 165 .ops = &omap1_mcbsp_ops,
152 .clk_names = clk_names,
153 .num_clks = 3,
154 }, 166 },
155}; 167};
156#define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) 168#define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata)
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 062c905c2ba6..721e0d9d8b1d 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -58,6 +58,25 @@ MUX_CFG_730("W17_730_USB_VBUSI", 2, 29, 0, 28, 0, 0)
58#define OMAP730_PINS_SZ 0 58#define OMAP730_PINS_SZ 0
59#endif /* CONFIG_ARCH_OMAP730 */ 59#endif /* CONFIG_ARCH_OMAP730 */
60 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
61#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) 80#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
62static struct pin_config __initdata_or_module omap1xxx_pins[] = { 81static struct pin_config __initdata_or_module omap1xxx_pins[] = {
63/* 82/*
@@ -419,6 +438,11 @@ int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
419 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n", 438 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n",
420 cfg->pull_name, cfg->pull_reg, pull_orig, pull); 439 cfg->pull_name, cfg->pull_reg, pull_orig, pull);
421 } 440 }
441
442#ifdef CONFIG_ARCH_OMAP850
443 omap_mux_register(omap850_pins, ARRAY_SIZE(omap850_pins));
444#endif
445
422#endif 446#endif
423 447
424#ifdef CONFIG_OMAP_MUX_ERRORS 448#ifdef CONFIG_OMAP_MUX_ERRORS
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index 0002084e0655..842090b148f1 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -121,6 +121,13 @@ void __init omap_serial_init(void)
121 serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2; 121 serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2;
122 } 122 }
123 123
124 if (cpu_is_omap850()) {
125 serial_platform_data[0].regshift = 0;
126 serial_platform_data[1].regshift = 0;
127 serial_platform_data[0].irq = INT_850_UART_MODEM_1;
128 serial_platform_data[1].irq = INT_850_UART_MODEM_IRDA_2;
129 }
130
124 if (cpu_is_omap15xx()) { 131 if (cpu_is_omap15xx()) {
125 serial_platform_data[0].uartclk = OMAP1510_BASE_BAUD * 16; 132 serial_platform_data[0].uartclk = OMAP1510_BASE_BAUD * 16;
126 serial_platform_data[1].uartclk = OMAP1510_BASE_BAUD * 16; 133 serial_platform_data[1].uartclk = OMAP1510_BASE_BAUD * 16;
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 3754b79092ab..64ab386a65c7 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -58,4 +58,12 @@ config MACH_OVERO
58 58
59config MACH_OMAP3_PANDORA 59config MACH_OMAP3_PANDORA
60 bool "OMAP3 Pandora" 60 bool "OMAP3 Pandora"
61 depends on ARCH_OMAP3 && ARCH_OMAP34XX \ No newline at end of file 61 depends on ARCH_OMAP3 && ARCH_OMAP34XX
62
63config MACH_OMAP_3430SDP
64 bool "OMAP 3430 SDP board"
65 depends on ARCH_OMAP3 && ARCH_OMAP34XX
66
67config MACH_NOKIA_RX51
68 bool "Nokia RX-51 board"
69 depends on ARCH_OMAP3 && ARCH_OMAP34XX
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index bbd12bc10fdc..a2c3fcc27a22 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := irq.o id.o io.o memory.o control.o prcm.o clock.o mux.o \ 6obj-y := irq.o id.o io.o sdrc.o control.o prcm.o clock.o mux.o \
7 devices.o serial.o gpmc.o timer-gp.o powerdomain.o \ 7 devices.o serial.o gpmc.o timer-gp.o powerdomain.o \
8 clockdomain.o 8 clockdomain.o
9 9
@@ -14,6 +14,10 @@ obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o
14obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o 14obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o
15obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o 15obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o
16 16
17# SMS/SDRC
18obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o
19# obj-$(CONFIG_ARCH_OMAP3) += sdrc3xxx.o
20
17# Power Management 21# Power Management
18ifeq ($(CONFIG_PM),y) 22ifeq ($(CONFIG_PM),y)
19obj-y += pm.o 23obj-y += pm.o
@@ -38,4 +42,12 @@ obj-$(CONFIG_MACH_OVERO) += board-overo.o \
38 mmc-twl4030.o 42 mmc-twl4030.o
39obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ 43obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \
40 mmc-twl4030.o 44 mmc-twl4030.o
45obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
46 mmc-twl4030.o
41 47
48obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
49 board-rx51-peripherals.o \
50# Platform specific device init code
51ifeq ($(CONFIG_USB_MUSB_SOC),y)
52obj-y += usb-musb.o
53endif
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 83fa37211d77..22143651037e 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -35,12 +35,16 @@
35#include <mach/board.h> 35#include <mach/board.h>
36#include <mach/common.h> 36#include <mach/common.h>
37#include <mach/gpmc.h> 37#include <mach/gpmc.h>
38#include <mach/usb.h>
38 39
39#include "mmc-twl4030.h" 40#include "mmc-twl4030.h"
40 41
42#define SDP2430_CS0_BASE 0x04000000
41#define SDP2430_FLASH_CS 0 43#define SDP2430_FLASH_CS 0
42#define SDP2430_SMC91X_CS 5 44#define SDP2430_SMC91X_CS 5
43 45
46#define SDP2430_ETHR_GPIO_IRQ 149
47
44static struct mtd_partition sdp2430_partitions[] = { 48static struct mtd_partition sdp2430_partitions[] = {
45 /* bootloader (U-Boot, etc) in first sector */ 49 /* bootloader (U-Boot, etc) in first sector */
46 { 50 {
@@ -102,8 +106,8 @@ static struct resource sdp2430_smc91x_resources[] = {
102 .flags = IORESOURCE_MEM, 106 .flags = IORESOURCE_MEM,
103 }, 107 },
104 [1] = { 108 [1] = {
105 .start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ), 109 .start = OMAP_GPIO_IRQ(SDP2430_ETHR_GPIO_IRQ),
106 .end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ), 110 .end = OMAP_GPIO_IRQ(SDP2430_ETHR_GPIO_IRQ),
107 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 111 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
108 }, 112 },
109}; 113};
@@ -170,13 +174,13 @@ static inline void __init sdp2430_init_smc91x(void)
170 sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f; 174 sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f;
171 udelay(100); 175 udelay(100);
172 176
173 if (gpio_request(OMAP24XX_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { 177 if (gpio_request(SDP2430_ETHR_GPIO_IRQ, "SMC91x irq") < 0) {
174 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", 178 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
175 OMAP24XX_ETHR_GPIO_IRQ); 179 SDP2430_ETHR_GPIO_IRQ);
176 gpmc_cs_free(eth_cs); 180 gpmc_cs_free(eth_cs);
177 goto out; 181 goto out;
178 } 182 }
179 gpio_direction_input(OMAP24XX_ETHR_GPIO_IRQ); 183 gpio_direction_input(SDP2430_ETHR_GPIO_IRQ);
180 184
181out: 185out:
182 clk_disable(gpmc_fck); 186 clk_disable(gpmc_fck);
@@ -185,7 +189,7 @@ out:
185 189
186static void __init omap_2430sdp_init_irq(void) 190static void __init omap_2430sdp_init_irq(void)
187{ 191{
188 omap2_init_common_hw(); 192 omap2_init_common_hw(NULL);
189 omap_init_irq(); 193 omap_init_irq();
190 omap_gpio_init(); 194 omap_gpio_init();
191 sdp2430_init_smc91x(); 195 sdp2430_init_smc91x();
@@ -251,6 +255,7 @@ static void __init omap_2430sdp_init(void)
251 omap_board_config_size = ARRAY_SIZE(sdp2430_config); 255 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
252 omap_serial_init(); 256 omap_serial_init();
253 twl4030_mmc_init(mmc); 257 twl4030_mmc_init(mmc);
258 usb_musb_init();
254} 259}
255 260
256static void __init omap_2430sdp_map_io(void) 261static void __init omap_2430sdp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
new file mode 100644
index 000000000000..ed9274972122
--- /dev/null
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -0,0 +1,542 @@
1/*
2 * linux/arch/arm/mach-omap2/board-3430sdp.c
3 *
4 * Copyright (C) 2007 Texas Instruments
5 *
6 * Modified from mach-omap2/board-generic.c
7 *
8 * Initial code: Syed Mohammed Khasim
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/init.h>
17#include <linux/platform_device.h>
18#include <linux/delay.h>
19#include <linux/input.h>
20#include <linux/spi/spi.h>
21#include <linux/spi/ads7846.h>
22#include <linux/i2c/twl4030.h>
23#include <linux/regulator/machine.h>
24#include <linux/io.h>
25#include <linux/gpio.h>
26
27#include <mach/hardware.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31
32#include <mach/mcspi.h>
33#include <mach/mux.h>
34#include <mach/board.h>
35#include <mach/usb.h>
36#include <mach/common.h>
37#include <mach/dma.h>
38#include <mach/gpmc.h>
39
40#include <mach/control.h>
41#include <mach/keypad.h>
42
43#include "mmc-twl4030.h"
44
45#define CONFIG_DISABLE_HFCLK 1
46
47#define SDP3430_ETHR_GPIO_IRQ_SDPV1 29
48#define SDP3430_ETHR_GPIO_IRQ_SDPV2 6
49#define SDP3430_SMC91X_CS 3
50
51#define SDP3430_TS_GPIO_IRQ_SDPV1 3
52#define SDP3430_TS_GPIO_IRQ_SDPV2 2
53
54#define ENABLE_VAUX3_DEDICATED 0x03
55#define ENABLE_VAUX3_DEV_GRP 0x20
56
57#define TWL4030_MSECURE_GPIO 22
58
59static struct resource sdp3430_smc91x_resources[] = {
60 [0] = {
61 .flags = IORESOURCE_MEM,
62 },
63 [1] = {
64 .start = 0,
65 .end = 0,
66 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
67 },
68};
69
70static struct platform_device sdp3430_smc91x_device = {
71 .name = "smc91x",
72 .id = -1,
73 .num_resources = ARRAY_SIZE(sdp3430_smc91x_resources),
74 .resource = sdp3430_smc91x_resources,
75};
76
77static int sdp3430_keymap[] = {
78 KEY(0, 0, KEY_LEFT),
79 KEY(0, 1, KEY_RIGHT),
80 KEY(0, 2, KEY_A),
81 KEY(0, 3, KEY_B),
82 KEY(0, 4, KEY_C),
83 KEY(1, 0, KEY_DOWN),
84 KEY(1, 1, KEY_UP),
85 KEY(1, 2, KEY_E),
86 KEY(1, 3, KEY_F),
87 KEY(1, 4, KEY_G),
88 KEY(2, 0, KEY_ENTER),
89 KEY(2, 1, KEY_I),
90 KEY(2, 2, KEY_J),
91 KEY(2, 3, KEY_K),
92 KEY(2, 4, KEY_3),
93 KEY(3, 0, KEY_M),
94 KEY(3, 1, KEY_N),
95 KEY(3, 2, KEY_O),
96 KEY(3, 3, KEY_P),
97 KEY(3, 4, KEY_Q),
98 KEY(4, 0, KEY_R),
99 KEY(4, 1, KEY_4),
100 KEY(4, 2, KEY_T),
101 KEY(4, 3, KEY_U),
102 KEY(4, 4, KEY_D),
103 KEY(5, 0, KEY_V),
104 KEY(5, 1, KEY_W),
105 KEY(5, 2, KEY_L),
106 KEY(5, 3, KEY_S),
107 KEY(5, 4, KEY_H),
108 0
109};
110
111static struct twl4030_keypad_data sdp3430_kp_data = {
112 .rows = 5,
113 .cols = 6,
114 .keymap = sdp3430_keymap,
115 .keymapsize = ARRAY_SIZE(sdp3430_keymap),
116 .rep = 1,
117};
118
119static int ts_gpio; /* Needed for ads7846_get_pendown_state */
120
121/**
122 * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq
123 *
124 * @return - void. If request gpio fails then Flag KERN_ERR.
125 */
126static void ads7846_dev_init(void)
127{
128 if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) {
129 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
130 return;
131 }
132
133 gpio_direction_input(ts_gpio);
134
135 omap_set_gpio_debounce(ts_gpio, 1);
136 omap_set_gpio_debounce_time(ts_gpio, 0xa);
137}
138
139static int ads7846_get_pendown_state(void)
140{
141 return !gpio_get_value(ts_gpio);
142}
143
144static struct ads7846_platform_data tsc2046_config __initdata = {
145 .get_pendown_state = ads7846_get_pendown_state,
146 .keep_vref_on = 1,
147};
148
149
150static struct omap2_mcspi_device_config tsc2046_mcspi_config = {
151 .turbo_mode = 0,
152 .single_channel = 1, /* 0: slave, 1: master */
153};
154
155static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
156 [0] = {
157 /*
158 * TSC2046 operates at a max freqency of 2MHz, so
159 * operate slightly below at 1.5MHz
160 */
161 .modalias = "ads7846",
162 .bus_num = 1,
163 .chip_select = 0,
164 .max_speed_hz = 1500000,
165 .controller_data = &tsc2046_mcspi_config,
166 .irq = 0,
167 .platform_data = &tsc2046_config,
168 },
169};
170
171static struct platform_device sdp3430_lcd_device = {
172 .name = "sdp2430_lcd",
173 .id = -1,
174};
175
176static struct regulator_consumer_supply sdp3430_vdac_supply = {
177 .supply = "vdac",
178 .dev = &sdp3430_lcd_device.dev,
179};
180
181static struct regulator_consumer_supply sdp3430_vdvi_supply = {
182 .supply = "vdvi",
183 .dev = &sdp3430_lcd_device.dev,
184};
185
186static struct platform_device *sdp3430_devices[] __initdata = {
187 &sdp3430_smc91x_device,
188 &sdp3430_lcd_device,
189};
190
191static inline void __init sdp3430_init_smc91x(void)
192{
193 int eth_cs;
194 unsigned long cs_mem_base;
195 int eth_gpio = 0;
196
197 eth_cs = SDP3430_SMC91X_CS;
198
199 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
200 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
201 return;
202 }
203
204 sdp3430_smc91x_resources[0].start = cs_mem_base + 0x300;
205 sdp3430_smc91x_resources[0].end = cs_mem_base + 0x30f;
206 udelay(100);
207
208 if (omap_rev() > OMAP3430_REV_ES1_0)
209 eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV2;
210 else
211 eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV1;
212
213 sdp3430_smc91x_resources[1].start = gpio_to_irq(eth_gpio);
214
215 if (gpio_request(eth_gpio, "SMC91x irq") < 0) {
216 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
217 eth_gpio);
218 return;
219 }
220 gpio_direction_input(eth_gpio);
221}
222
223static void __init omap_3430sdp_init_irq(void)
224{
225 omap2_init_common_hw(NULL);
226 omap_init_irq();
227 omap_gpio_init();
228 sdp3430_init_smc91x();
229}
230
231static struct omap_uart_config sdp3430_uart_config __initdata = {
232 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
233};
234
235static struct omap_lcd_config sdp3430_lcd_config __initdata = {
236 .ctrl_name = "internal",
237};
238
239static struct omap_board_config_kernel sdp3430_config[] __initdata = {
240 { OMAP_TAG_UART, &sdp3430_uart_config },
241 { OMAP_TAG_LCD, &sdp3430_lcd_config },
242};
243
244static int sdp3430_batt_table[] = {
245/* 0 C*/
24630800, 29500, 28300, 27100,
24726000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
24817200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
24911600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
2508020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
2515640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
2524040, 3910, 3790, 3670, 3550
253};
254
255static struct twl4030_bci_platform_data sdp3430_bci_data = {
256 .battery_tmp_tbl = sdp3430_batt_table,
257 .tblsize = ARRAY_SIZE(sdp3430_batt_table),
258};
259
260static struct twl4030_hsmmc_info mmc[] = {
261 {
262 .mmc = 1,
263 /* 8 bits (default) requires S6.3 == ON,
264 * so the SIM card isn't used; else 4 bits.
265 */
266 .wires = 8,
267 .gpio_wp = 4,
268 },
269 {
270 .mmc = 2,
271 .wires = 8,
272 .gpio_wp = 7,
273 },
274 {} /* Terminator */
275};
276
277static struct regulator_consumer_supply sdp3430_vmmc1_supply = {
278 .supply = "vmmc",
279};
280
281static struct regulator_consumer_supply sdp3430_vsim_supply = {
282 .supply = "vmmc_aux",
283};
284
285static struct regulator_consumer_supply sdp3430_vmmc2_supply = {
286 .supply = "vmmc",
287};
288
289static int sdp3430_twl_gpio_setup(struct device *dev,
290 unsigned gpio, unsigned ngpio)
291{
292 /* gpio + 0 is "mmc0_cd" (input/IRQ),
293 * gpio + 1 is "mmc1_cd" (input/IRQ)
294 */
295 mmc[0].gpio_cd = gpio + 0;
296 mmc[1].gpio_cd = gpio + 1;
297 twl4030_mmc_init(mmc);
298
299 /* link regulators to MMC adapters ... we "know" the
300 * regulators will be set up only *after* we return.
301 */
302 sdp3430_vmmc1_supply.dev = mmc[0].dev;
303 sdp3430_vsim_supply.dev = mmc[0].dev;
304 sdp3430_vmmc2_supply.dev = mmc[1].dev;
305
306 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
307 gpio_request(gpio + 7, "sub_lcd_en_bkl");
308 gpio_direction_output(gpio + 7, 0);
309
310 /* gpio + 15 is "sub_lcd_nRST" (output) */
311 gpio_request(gpio + 15, "sub_lcd_nRST");
312 gpio_direction_output(gpio + 15, 0);
313
314 return 0;
315}
316
317static struct twl4030_gpio_platform_data sdp3430_gpio_data = {
318 .gpio_base = OMAP_MAX_GPIO_LINES,
319 .irq_base = TWL4030_GPIO_IRQ_BASE,
320 .irq_end = TWL4030_GPIO_IRQ_END,
321 .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13)
322 | BIT(16) | BIT(17),
323 .setup = sdp3430_twl_gpio_setup,
324};
325
326static struct twl4030_usb_data sdp3430_usb_data = {
327 .usb_mode = T2_USB_MODE_ULPI,
328};
329
330static struct twl4030_madc_platform_data sdp3430_madc_data = {
331 .irq_line = 1,
332};
333
334/*
335 * Apply all the fixed voltages since most versions of U-Boot
336 * don't bother with that initialization.
337 */
338
339/* VAUX1 for mainboard (irda and sub-lcd) */
340static struct regulator_init_data sdp3430_vaux1 = {
341 .constraints = {
342 .min_uV = 2800000,
343 .max_uV = 2800000,
344 .apply_uV = true,
345 .valid_modes_mask = REGULATOR_MODE_NORMAL
346 | REGULATOR_MODE_STANDBY,
347 .valid_ops_mask = REGULATOR_CHANGE_MODE
348 | REGULATOR_CHANGE_STATUS,
349 },
350};
351
352/* VAUX2 for camera module */
353static struct regulator_init_data sdp3430_vaux2 = {
354 .constraints = {
355 .min_uV = 2800000,
356 .max_uV = 2800000,
357 .apply_uV = true,
358 .valid_modes_mask = REGULATOR_MODE_NORMAL
359 | REGULATOR_MODE_STANDBY,
360 .valid_ops_mask = REGULATOR_CHANGE_MODE
361 | REGULATOR_CHANGE_STATUS,
362 },
363};
364
365/* VAUX3 for LCD board */
366static struct regulator_init_data sdp3430_vaux3 = {
367 .constraints = {
368 .min_uV = 2800000,
369 .max_uV = 2800000,
370 .apply_uV = true,
371 .valid_modes_mask = REGULATOR_MODE_NORMAL
372 | REGULATOR_MODE_STANDBY,
373 .valid_ops_mask = REGULATOR_CHANGE_MODE
374 | REGULATOR_CHANGE_STATUS,
375 },
376};
377
378/* VAUX4 for OMAP VDD_CSI2 (camera) */
379static struct regulator_init_data sdp3430_vaux4 = {
380 .constraints = {
381 .min_uV = 1800000,
382 .max_uV = 1800000,
383 .apply_uV = true,
384 .valid_modes_mask = REGULATOR_MODE_NORMAL
385 | REGULATOR_MODE_STANDBY,
386 .valid_ops_mask = REGULATOR_CHANGE_MODE
387 | REGULATOR_CHANGE_STATUS,
388 },
389};
390
391/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
392static struct regulator_init_data sdp3430_vmmc1 = {
393 .constraints = {
394 .min_uV = 1850000,
395 .max_uV = 3150000,
396 .valid_modes_mask = REGULATOR_MODE_NORMAL
397 | REGULATOR_MODE_STANDBY,
398 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
399 | REGULATOR_CHANGE_MODE
400 | REGULATOR_CHANGE_STATUS,
401 },
402 .num_consumer_supplies = 1,
403 .consumer_supplies = &sdp3430_vmmc1_supply,
404};
405
406/* VMMC2 for MMC2 card */
407static struct regulator_init_data sdp3430_vmmc2 = {
408 .constraints = {
409 .min_uV = 1850000,
410 .max_uV = 1850000,
411 .apply_uV = true,
412 .valid_modes_mask = REGULATOR_MODE_NORMAL
413 | REGULATOR_MODE_STANDBY,
414 .valid_ops_mask = REGULATOR_CHANGE_MODE
415 | REGULATOR_CHANGE_STATUS,
416 },
417 .num_consumer_supplies = 1,
418 .consumer_supplies = &sdp3430_vmmc2_supply,
419};
420
421/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
422static struct regulator_init_data sdp3430_vsim = {
423 .constraints = {
424 .min_uV = 1800000,
425 .max_uV = 3000000,
426 .valid_modes_mask = REGULATOR_MODE_NORMAL
427 | REGULATOR_MODE_STANDBY,
428 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
429 | REGULATOR_CHANGE_MODE
430 | REGULATOR_CHANGE_STATUS,
431 },
432 .num_consumer_supplies = 1,
433 .consumer_supplies = &sdp3430_vsim_supply,
434};
435
436/* VDAC for DSS driving S-Video */
437static struct regulator_init_data sdp3430_vdac = {
438 .constraints = {
439 .min_uV = 1800000,
440 .max_uV = 1800000,
441 .apply_uV = true,
442 .valid_modes_mask = REGULATOR_MODE_NORMAL
443 | REGULATOR_MODE_STANDBY,
444 .valid_ops_mask = REGULATOR_CHANGE_MODE
445 | REGULATOR_CHANGE_STATUS,
446 },
447 .num_consumer_supplies = 1,
448 .consumer_supplies = &sdp3430_vdac_supply,
449};
450
451/* VPLL2 for digital video outputs */
452static struct regulator_init_data sdp3430_vpll2 = {
453 .constraints = {
454 .name = "VDVI",
455 .min_uV = 1800000,
456 .max_uV = 1800000,
457 .valid_modes_mask = REGULATOR_MODE_NORMAL
458 | REGULATOR_MODE_STANDBY,
459 .valid_ops_mask = REGULATOR_CHANGE_MODE
460 | REGULATOR_CHANGE_STATUS,
461 },
462 .num_consumer_supplies = 1,
463 .consumer_supplies = &sdp3430_vdvi_supply,
464};
465
466static struct twl4030_platform_data sdp3430_twldata = {
467 .irq_base = TWL4030_IRQ_BASE,
468 .irq_end = TWL4030_IRQ_END,
469
470 /* platform_data for children goes here */
471 .bci = &sdp3430_bci_data,
472 .gpio = &sdp3430_gpio_data,
473 .madc = &sdp3430_madc_data,
474 .keypad = &sdp3430_kp_data,
475 .usb = &sdp3430_usb_data,
476
477 .vaux1 = &sdp3430_vaux1,
478 .vaux2 = &sdp3430_vaux2,
479 .vaux3 = &sdp3430_vaux3,
480 .vaux4 = &sdp3430_vaux4,
481 .vmmc1 = &sdp3430_vmmc1,
482 .vmmc2 = &sdp3430_vmmc2,
483 .vsim = &sdp3430_vsim,
484 .vdac = &sdp3430_vdac,
485 .vpll2 = &sdp3430_vpll2,
486};
487
488static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = {
489 {
490 I2C_BOARD_INFO("twl4030", 0x48),
491 .flags = I2C_CLIENT_WAKE,
492 .irq = INT_34XX_SYS_NIRQ,
493 .platform_data = &sdp3430_twldata,
494 },
495};
496
497static int __init omap3430_i2c_init(void)
498{
499 /* i2c1 for PMIC only */
500 omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo,
501 ARRAY_SIZE(sdp3430_i2c_boardinfo));
502 /* i2c2 on camera connector (for sensor control) and optional isp1301 */
503 omap_register_i2c_bus(2, 400, NULL, 0);
504 /* i2c3 on display connector (for DVI, tfp410) */
505 omap_register_i2c_bus(3, 400, NULL, 0);
506 return 0;
507}
508
509static void __init omap_3430sdp_init(void)
510{
511 omap3430_i2c_init();
512 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
513 omap_board_config = sdp3430_config;
514 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
515 if (omap_rev() > OMAP3430_REV_ES1_0)
516 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
517 else
518 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV1;
519 sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio);
520 spi_register_board_info(sdp3430_spi_board_info,
521 ARRAY_SIZE(sdp3430_spi_board_info));
522 ads7846_dev_init();
523 omap_serial_init();
524 usb_musb_init();
525}
526
527static void __init omap_3430sdp_map_io(void)
528{
529 omap2_set_globals_343x();
530 omap2_map_common_io();
531}
532
533MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
534 /* Maintainer: Syed Khasim - Texas Instruments Inc */
535 .phys_io = 0x48000000,
536 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
537 .boot_params = 0x80000100,
538 .map_io = omap_3430sdp_map_io,
539 .init_irq = omap_3430sdp_init_irq,
540 .init_machine = omap_3430sdp_init,
541 .timer = &omap_timer,
542MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 0a7b24ba1652..06dfba888b0c 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -51,6 +51,7 @@
51 51
52#define APOLLON_FLASH_CS 0 52#define APOLLON_FLASH_CS 0
53#define APOLLON_ETH_CS 1 53#define APOLLON_ETH_CS 1
54#define APOLLON_ETHR_GPIO_IRQ 74
54 55
55static struct mtd_partition apollon_partitions[] = { 56static struct mtd_partition apollon_partitions[] = {
56 { 57 {
@@ -249,7 +250,7 @@ out:
249 250
250static void __init omap_apollon_init_irq(void) 251static void __init omap_apollon_init_irq(void)
251{ 252{
252 omap2_init_common_hw(); 253 omap2_init_common_hw(NULL);
253 omap_init_irq(); 254 omap_init_irq();
254 omap_gpio_init(); 255 omap_gpio_init();
255 apollon_init_smc91x(); 256 apollon_init_smc91x();
@@ -272,7 +273,6 @@ static struct omap_lcd_config apollon_lcd_config __initdata = {
272 273
273static struct omap_board_config_kernel apollon_config[] = { 274static struct omap_board_config_kernel apollon_config[] = {
274 { OMAP_TAG_UART, &apollon_uart_config }, 275 { OMAP_TAG_UART, &apollon_uart_config },
275 { OMAP_TAG_USB, &apollon_usb_config },
276 { OMAP_TAG_LCD, &apollon_lcd_config }, 276 { OMAP_TAG_LCD, &apollon_lcd_config },
277}; 277};
278 278
@@ -299,6 +299,7 @@ static void __init apollon_usb_init(void)
299 omap_cfg_reg(P21_242X_GPIO12); 299 omap_cfg_reg(P21_242X_GPIO12);
300 gpio_request(12, "USB suspend"); 300 gpio_request(12, "USB suspend");
301 gpio_direction_output(12, 0); 301 gpio_direction_output(12, 0);
302 omap_usb_init(&apollon_usb_config);
302} 303}
303 304
304static void __init omap_apollon_init(void) 305static void __init omap_apollon_init(void)
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 3b34c20d1df4..3492162a65c3 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -33,7 +33,7 @@
33 33
34static void __init omap_generic_init_irq(void) 34static void __init omap_generic_init_irq(void)
35{ 35{
36 omap2_init_common_hw(); 36 omap2_init_common_hw(NULL);
37 omap_init_irq(); 37 omap_init_irq();
38} 38}
39 39
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 5e9b14675b1e..a0267a9ab466 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -47,6 +47,8 @@
47#define H4_FLASH_CS 0 47#define H4_FLASH_CS 0
48#define H4_SMC91X_CS 1 48#define H4_SMC91X_CS 1
49 49
50#define H4_ETHR_GPIO_IRQ 92
51
50static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; 52static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 };
51static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; 53static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 };
52 54
@@ -341,7 +343,7 @@ static inline void __init h4_init_debug(void)
341 udelay(100); 343 udelay(100);
342 344
343 omap_cfg_reg(M15_24XX_GPIO92); 345 omap_cfg_reg(M15_24XX_GPIO92);
344 if (debug_card_init(cs_mem_base, OMAP24XX_ETHR_GPIO_IRQ) < 0) 346 if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0)
345 gpmc_cs_free(eth_cs); 347 gpmc_cs_free(eth_cs);
346 348
347out: 349out:
@@ -363,7 +365,7 @@ static void __init h4_init_flash(void)
363 365
364static void __init omap_h4_init_irq(void) 366static void __init omap_h4_init_irq(void)
365{ 367{
366 omap2_init_common_hw(); 368 omap2_init_common_hw(NULL);
367 omap_init_irq(); 369 omap_init_irq();
368 omap_gpio_init(); 370 omap_gpio_init();
369 h4_init_flash(); 371 h4_init_flash();
@@ -377,6 +379,39 @@ static struct omap_lcd_config h4_lcd_config __initdata = {
377 .ctrl_name = "internal", 379 .ctrl_name = "internal",
378}; 380};
379 381
382static struct omap_usb_config h4_usb_config __initdata = {
383#ifdef CONFIG_MACH_OMAP2_H4_USB1
384 /* NOTE: usb1 could also be used with 3 wire signaling */
385 .pins[1] = 4,
386#endif
387
388#ifdef CONFIG_MACH_OMAP_H4_OTG
389 /* S1.10 ON -- USB OTG port
390 * usb0 switched to Mini-AB port and isp1301 transceiver;
391 * S2.POS3 = OFF, S2.POS4 = ON ... to allow battery charging
392 */
393 .otg = 1,
394 .pins[0] = 4,
395#ifdef CONFIG_USB_GADGET_OMAP
396 /* use OTG cable, or standard A-to-MiniB */
397 .hmc_mode = 0x14, /* 0:dev/otg 1:host 2:disable */
398#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
399 /* use OTG cable, or NONSTANDARD (B-to-MiniB) */
400 .hmc_mode = 0x11, /* 0:host 1:host 2:disable */
401#endif /* XX */
402
403#else
404 /* S1.10 OFF -- usb "download port"
405 * usb0 switched to Mini-B port and isp1105 transceiver;
406 * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging
407 */
408 .register_dev = 1,
409 .pins[0] = 3,
410/* .hmc_mode = 0x14,*/ /* 0:dev 1:host 2:disable */
411 .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */
412#endif
413};
414
380static struct omap_board_config_kernel h4_config[] = { 415static struct omap_board_config_kernel h4_config[] = {
381 { OMAP_TAG_UART, &h4_uart_config }, 416 { OMAP_TAG_UART, &h4_uart_config },
382 { OMAP_TAG_LCD, &h4_lcd_config }, 417 { OMAP_TAG_LCD, &h4_lcd_config },
@@ -428,6 +463,7 @@ static void __init omap_h4_init(void)
428 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); 463 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
429 omap_board_config = h4_config; 464 omap_board_config = h4_config;
430 omap_board_config_size = ARRAY_SIZE(h4_config); 465 omap_board_config_size = ARRAY_SIZE(h4_config);
466 omap_usb_init(&h4_usb_config);
431 omap_serial_init(); 467 omap_serial_init();
432} 468}
433 469
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 6031e179926b..e096f776f996 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -22,31 +22,34 @@
22#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
23#include <linux/spi/ads7846.h> 23#include <linux/spi/ads7846.h>
24#include <linux/i2c/twl4030.h> 24#include <linux/i2c/twl4030.h>
25#include <linux/io.h>
25 26
26#include <mach/hardware.h> 27#include <mach/hardware.h>
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#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30 31
31#include <mach/board-ldp.h>
32#include <mach/mcspi.h> 32#include <mach/mcspi.h>
33#include <mach/gpio.h> 33#include <mach/gpio.h>
34#include <mach/board.h> 34#include <mach/board.h>
35#include <mach/common.h> 35#include <mach/common.h>
36#include <mach/gpmc.h> 36#include <mach/gpmc.h>
37 37
38#include <asm/io.h>
39#include <asm/delay.h> 38#include <asm/delay.h>
40#include <mach/control.h> 39#include <mach/control.h>
40#include <mach/usb.h>
41 41
42#include "mmc-twl4030.h" 42#include "mmc-twl4030.h"
43 43
44#define SDP3430_SMC91X_CS 3 44#define LDP_SMC911X_CS 1
45#define LDP_SMC911X_GPIO 152
46#define DEBUG_BASE 0x08000000
47#define LDP_ETHR_START DEBUG_BASE
45 48
46static struct resource ldp_smc911x_resources[] = { 49static struct resource ldp_smc911x_resources[] = {
47 [0] = { 50 [0] = {
48 .start = OMAP34XX_ETHR_START, 51 .start = LDP_ETHR_START,
49 .end = OMAP34XX_ETHR_START + SZ_4K, 52 .end = LDP_ETHR_START + SZ_4K,
50 .flags = IORESOURCE_MEM, 53 .flags = IORESOURCE_MEM,
51 }, 54 },
52 [1] = { 55 [1] = {
@@ -98,7 +101,7 @@ static inline void __init ldp_init_smc911x(void)
98 101
99static void __init omap_ldp_init_irq(void) 102static void __init omap_ldp_init_irq(void)
100{ 103{
101 omap2_init_common_hw(); 104 omap2_init_common_hw(NULL);
102 omap_init_irq(); 105 omap_init_irq();
103 omap_gpio_init(); 106 omap_gpio_init();
104 ldp_init_smc911x(); 107 ldp_init_smc911x();
@@ -162,6 +165,7 @@ static void __init omap_ldp_init(void)
162 omap_board_config_size = ARRAY_SIZE(ldp_config); 165 omap_board_config_size = ARRAY_SIZE(ldp_config);
163 omap_serial_init(); 166 omap_serial_init();
164 twl4030_mmc_init(mmc); 167 twl4030_mmc_init(mmc);
168 usb_musb_init();
165} 169}
166 170
167static void __init omap_ldp_map_io(void) 171static void __init omap_ldp_map_io(void)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index e39cd2c46cfa..744740ae1b9c 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -41,6 +41,7 @@
41#include <mach/gpmc.h> 41#include <mach/gpmc.h>
42#include <mach/nand.h> 42#include <mach/nand.h>
43#include <mach/mux.h> 43#include <mach/mux.h>
44#include <mach/usb.h>
44 45
45#include "mmc-twl4030.h" 46#include "mmc-twl4030.h"
46 47
@@ -175,9 +176,6 @@ static int __init omap3_beagle_i2c_init(void)
175{ 176{
176 omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo, 177 omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
177 ARRAY_SIZE(beagle_i2c_boardinfo)); 178 ARRAY_SIZE(beagle_i2c_boardinfo));
178#ifdef CONFIG_I2C2_OMAP_BEAGLE
179 omap_register_i2c_bus(2, 400, NULL, 0);
180#endif
181 /* Bus 3 is attached to the DVI port where devices like the pico DLP 179 /* Bus 3 is attached to the DVI port where devices like the pico DLP
182 * projector don't work reliably with 400kHz */ 180 * projector don't work reliably with 400kHz */
183 omap_register_i2c_bus(3, 100, NULL, 0); 181 omap_register_i2c_bus(3, 100, NULL, 0);
@@ -186,7 +184,7 @@ static int __init omap3_beagle_i2c_init(void)
186 184
187static void __init omap3_beagle_init_irq(void) 185static void __init omap3_beagle_init_irq(void)
188{ 186{
189 omap2_init_common_hw(); 187 omap2_init_common_hw(NULL);
190 omap_init_irq(); 188 omap_init_irq();
191 omap_gpio_init(); 189 omap_gpio_init();
192} 190}
@@ -316,6 +314,7 @@ static void __init omap3_beagle_init(void)
316 /* REVISIT leave DVI powered down until it's needed ... */ 314 /* REVISIT leave DVI powered down until it's needed ... */
317 gpio_direction_output(170, true); 315 gpio_direction_output(170, true);
318 316
317 usb_musb_init();
319 omap3beagle_flash_init(); 318 omap3beagle_flash_init();
320} 319}
321 320
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index b3196107afdb..402f09c6cf10 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -34,6 +34,7 @@
34#include <mach/gpio.h> 34#include <mach/gpio.h>
35#include <mach/hardware.h> 35#include <mach/hardware.h>
36#include <mach/mcspi.h> 36#include <mach/mcspi.h>
37#include <mach/usb.h>
37 38
38#include "mmc-twl4030.h" 39#include "mmc-twl4030.h"
39 40
@@ -53,6 +54,13 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = {
53 .gpio_cd = -EINVAL, 54 .gpio_cd = -EINVAL,
54 .gpio_wp = 127, 55 .gpio_wp = 127,
55 .ext_clock = 1, 56 .ext_clock = 1,
57 .transceiver = true,
58 },
59 {
60 .mmc = 3,
61 .wires = 4,
62 .gpio_cd = -EINVAL,
63 .gpio_wp = -EINVAL,
56 }, 64 },
57 {} /* Terminator */ 65 {} /* Terminator */
58}; 66};
@@ -110,7 +118,7 @@ static int __init omap3pandora_i2c_init(void)
110 118
111static void __init omap3pandora_init_irq(void) 119static void __init omap3pandora_init_irq(void)
112{ 120{
113 omap2_init_common_hw(); 121 omap2_init_common_hw(NULL);
114 omap_init_irq(); 122 omap_init_irq();
115 omap_gpio_init(); 123 omap_gpio_init();
116} 124}
@@ -193,6 +201,7 @@ static void __init omap3pandora_init(void)
193 spi_register_board_info(omap3pandora_spi_board_info, 201 spi_register_board_info(omap3pandora_spi_board_info,
194 ARRAY_SIZE(omap3pandora_spi_board_info)); 202 ARRAY_SIZE(omap3pandora_spi_board_info));
195 omap3pandora_ads7846_init(); 203 omap3pandora_ads7846_init();
204 usb_musb_init();
196} 205}
197 206
198static void __init omap3pandora_map_io(void) 207static void __init omap3pandora_map_io(void)
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 82b3dc557c96..b3f6e9d81807 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -37,20 +37,85 @@
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/board-overo.h>
41#include <mach/board.h> 40#include <mach/board.h>
42#include <mach/common.h> 41#include <mach/common.h>
43#include <mach/gpio.h> 42#include <mach/gpio.h>
44#include <mach/gpmc.h> 43#include <mach/gpmc.h>
45#include <mach/hardware.h> 44#include <mach/hardware.h>
46#include <mach/nand.h> 45#include <mach/nand.h>
46#include <mach/usb.h>
47 47
48#include "mmc-twl4030.h" 48#include "mmc-twl4030.h"
49 49
50#define OVERO_GPIO_BT_XGATE 15
51#define OVERO_GPIO_W2W_NRESET 16
52#define OVERO_GPIO_BT_NRESET 164
53#define OVERO_GPIO_USBH_CPEN 168
54#define OVERO_GPIO_USBH_NRESET 183
55
50#define NAND_BLOCK_SIZE SZ_128K 56#define NAND_BLOCK_SIZE SZ_128K
51#define GPMC_CS0_BASE 0x60 57#define GPMC_CS0_BASE 0x60
52#define GPMC_CS_SIZE 0x30 58#define GPMC_CS_SIZE 0x30
53 59
60#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
61 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
62
63#include <mach/mcspi.h>
64#include <linux/spi/spi.h>
65#include <linux/spi/ads7846.h>
66
67static struct omap2_mcspi_device_config ads7846_mcspi_config = {
68 .turbo_mode = 0,
69 .single_channel = 1, /* 0: slave, 1: master */
70};
71
72static int ads7846_get_pendown_state(void)
73{
74 return !gpio_get_value(OVERO_GPIO_PENDOWN);
75}
76
77static struct ads7846_platform_data ads7846_config = {
78 .x_max = 0x0fff,
79 .y_max = 0x0fff,
80 .x_plate_ohms = 180,
81 .pressure_max = 255,
82 .debounce_max = 10,
83 .debounce_tol = 3,
84 .debounce_rep = 1,
85 .get_pendown_state = ads7846_get_pendown_state,
86 .keep_vref_on = 1,
87};
88
89static struct spi_board_info overo_spi_board_info[] __initdata = {
90 {
91 .modalias = "ads7846",
92 .bus_num = 1,
93 .chip_select = 0,
94 .max_speed_hz = 1500000,
95 .controller_data = &ads7846_mcspi_config,
96 .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
97 .platform_data = &ads7846_config,
98 }
99};
100
101static void __init overo_ads7846_init(void)
102{
103 if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
104 (gpio_direction_input(OVERO_GPIO_PENDOWN) == 0)) {
105 gpio_export(OVERO_GPIO_PENDOWN, 0);
106 } else {
107 printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
108 return;
109 }
110
111 spi_register_board_info(overo_spi_board_info,
112 ARRAY_SIZE(overo_spi_board_info));
113}
114
115#else
116static inline void __init overo_ads7846_init(void) { return; }
117#endif
118
54static struct mtd_partition overo_nand_partitions[] = { 119static struct mtd_partition overo_nand_partitions[] = {
55 { 120 {
56 .name = "xloader", 121 .name = "xloader",
@@ -174,7 +239,7 @@ static int __init overo_i2c_init(void)
174 239
175static void __init overo_init_irq(void) 240static void __init overo_init_irq(void)
176{ 241{
177 omap2_init_common_hw(); 242 omap2_init_common_hw(NULL);
178 omap_init_irq(); 243 omap_init_irq();
179 omap_gpio_init(); 244 omap_gpio_init();
180} 245}
@@ -209,6 +274,7 @@ static struct twl4030_hsmmc_info mmc[] __initdata = {
209 .wires = 4, 274 .wires = 4,
210 .gpio_cd = -EINVAL, 275 .gpio_cd = -EINVAL,
211 .gpio_wp = -EINVAL, 276 .gpio_wp = -EINVAL,
277 .transceiver = true,
212 }, 278 },
213 {} /* Terminator */ 279 {} /* Terminator */
214}; 280};
@@ -222,6 +288,8 @@ static void __init overo_init(void)
222 omap_serial_init(); 288 omap_serial_init();
223 twl4030_mmc_init(mmc); 289 twl4030_mmc_init(mmc);
224 overo_flash_init(); 290 overo_flash_init();
291 usb_musb_init();
292 overo_ads7846_init();
225 293
226 if ((gpio_request(OVERO_GPIO_W2W_NRESET, 294 if ((gpio_request(OVERO_GPIO_W2W_NRESET,
227 "OVERO_GPIO_W2W_NRESET") == 0) && 295 "OVERO_GPIO_W2W_NRESET") == 0) &&
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
new file mode 100644
index 000000000000..a7381729645c
--- /dev/null
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -0,0 +1,419 @@
1/*
2 * linux/arch/arm/mach-omap2/board-rx51-flash.c
3 *
4 * Copyright (C) 2008-2009 Nokia
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/spi/spi.h>
16#include <linux/i2c.h>
17#include <linux/i2c/twl4030.h>
18#include <linux/clk.h>
19#include <linux/delay.h>
20#include <linux/regulator/machine.h>
21#include <linux/gpio.h>
22
23#include <mach/mcspi.h>
24#include <mach/mux.h>
25#include <mach/board.h>
26#include <mach/common.h>
27#include <mach/dma.h>
28#include <mach/gpmc.h>
29#include <mach/keypad.h>
30
31#include "mmc-twl4030.h"
32
33
34#define SMC91X_CS 1
35#define SMC91X_GPIO_IRQ 54
36#define SMC91X_GPIO_RESET 164
37#define SMC91X_GPIO_PWRDWN 86
38
39static struct resource rx51_smc91x_resources[] = {
40 [0] = {
41 .flags = IORESOURCE_MEM,
42 },
43 [1] = {
44 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
45 },
46};
47
48static struct platform_device rx51_smc91x_device = {
49 .name = "smc91x",
50 .id = -1,
51 .num_resources = ARRAY_SIZE(rx51_smc91x_resources),
52 .resource = rx51_smc91x_resources,
53};
54
55static int rx51_keymap[] = {
56 KEY(0, 0, KEY_Q),
57 KEY(0, 1, KEY_W),
58 KEY(0, 2, KEY_E),
59 KEY(0, 3, KEY_R),
60 KEY(0, 4, KEY_T),
61 KEY(0, 5, KEY_Y),
62 KEY(0, 6, KEY_U),
63 KEY(0, 7, KEY_I),
64 KEY(1, 0, KEY_O),
65 KEY(1, 1, KEY_D),
66 KEY(1, 2, KEY_DOT),
67 KEY(1, 3, KEY_V),
68 KEY(1, 4, KEY_DOWN),
69 KEY(2, 0, KEY_P),
70 KEY(2, 1, KEY_F),
71 KEY(2, 2, KEY_UP),
72 KEY(2, 3, KEY_B),
73 KEY(2, 4, KEY_RIGHT),
74 KEY(3, 0, KEY_COMMA),
75 KEY(3, 1, KEY_G),
76 KEY(3, 2, KEY_ENTER),
77 KEY(3, 3, KEY_N),
78 KEY(4, 0, KEY_BACKSPACE),
79 KEY(4, 1, KEY_H),
80 KEY(4, 3, KEY_M),
81 KEY(4, 4, KEY_LEFTCTRL),
82 KEY(5, 1, KEY_J),
83 KEY(5, 2, KEY_Z),
84 KEY(5, 3, KEY_SPACE),
85 KEY(5, 4, KEY_LEFTSHIFT),
86 KEY(6, 0, KEY_A),
87 KEY(6, 1, KEY_K),
88 KEY(6, 2, KEY_X),
89 KEY(6, 3, KEY_SPACE),
90 KEY(6, 4, KEY_FN),
91 KEY(7, 0, KEY_S),
92 KEY(7, 1, KEY_L),
93 KEY(7, 2, KEY_C),
94 KEY(7, 3, KEY_LEFT),
95 KEY(0xff, 0, KEY_F6),
96 KEY(0xff, 1, KEY_F7),
97 KEY(0xff, 2, KEY_F8),
98 KEY(0xff, 4, KEY_F9),
99 KEY(0xff, 5, KEY_F10),
100};
101
102static struct twl4030_keypad_data rx51_kp_data = {
103 .rows = 8,
104 .cols = 8,
105 .keymap = rx51_keymap,
106 .keymapsize = ARRAY_SIZE(rx51_keymap),
107 .rep = 1,
108};
109
110static struct platform_device *rx51_peripherals_devices[] = {
111 &rx51_smc91x_device,
112};
113
114/*
115 * Timings are taken from smsc-lan91c96-ms.pdf
116 */
117static int smc91x_init_gpmc(int cs)
118{
119 struct gpmc_timings t;
120 const int t2_r = 45; /* t2 in Figure 12.10 */
121 const int t2_w = 30; /* t2 in Figure 12.11 */
122 const int t3 = 15; /* t3 in Figure 12.10 */
123 const int t5_r = 0; /* t5 in Figure 12.10 */
124 const int t6_r = 45; /* t6 in Figure 12.10 */
125 const int t6_w = 0; /* t6 in Figure 12.11 */
126 const int t7_w = 15; /* t7 in Figure 12.11 */
127 const int t15 = 12; /* t15 in Figure 12.2 */
128 const int t20 = 185; /* t20 in Figure 12.2 */
129
130 memset(&t, 0, sizeof(t));
131
132 t.cs_on = t15;
133 t.cs_rd_off = t3 + t2_r + t5_r; /* Figure 12.10 */
134 t.cs_wr_off = t3 + t2_w + t6_w; /* Figure 12.11 */
135 t.adv_on = t3; /* Figure 12.10 */
136 t.adv_rd_off = t3 + t2_r; /* Figure 12.10 */
137 t.adv_wr_off = t3 + t2_w; /* Figure 12.11 */
138 t.oe_off = t3 + t2_r + t5_r; /* Figure 12.10 */
139 t.oe_on = t.oe_off - t6_r; /* Figure 12.10 */
140 t.we_off = t3 + t2_w + t6_w; /* Figure 12.11 */
141 t.we_on = t.we_off - t7_w; /* Figure 12.11 */
142 t.rd_cycle = t20; /* Figure 12.2 */
143 t.wr_cycle = t20; /* Figure 12.4 */
144 t.access = t3 + t2_r + t5_r; /* Figure 12.10 */
145 t.wr_access = t3 + t2_w + t6_w; /* Figure 12.11 */
146
147 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, GPMC_CONFIG1_DEVICESIZE_16);
148
149 return gpmc_cs_set_timings(cs, &t);
150}
151
152static void __init rx51_init_smc91x(void)
153{
154 unsigned long cs_mem_base;
155 int ret;
156
157 omap_cfg_reg(U8_34XX_GPIO54_DOWN);
158 omap_cfg_reg(G25_34XX_GPIO86_OUT);
159 omap_cfg_reg(H19_34XX_GPIO164_OUT);
160
161 if (gpmc_cs_request(SMC91X_CS, SZ_16M, &cs_mem_base) < 0) {
162 printk(KERN_ERR "Failed to request GPMC mem for smc91x\n");
163 return;
164 }
165
166 rx51_smc91x_resources[0].start = cs_mem_base + 0x300;
167 rx51_smc91x_resources[0].end = cs_mem_base + 0x30f;
168
169 smc91x_init_gpmc(SMC91X_CS);
170
171 if (gpio_request(SMC91X_GPIO_IRQ, "SMC91X irq") < 0)
172 goto free1;
173
174 gpio_direction_input(SMC91X_GPIO_IRQ);
175 rx51_smc91x_resources[1].start = gpio_to_irq(SMC91X_GPIO_IRQ);
176
177 ret = gpio_request(SMC91X_GPIO_PWRDWN, "SMC91X powerdown");
178 if (ret)
179 goto free2;
180 gpio_direction_output(SMC91X_GPIO_PWRDWN, 0);
181
182 ret = gpio_request(SMC91X_GPIO_RESET, "SMC91X reset");
183 if (ret)
184 goto free3;
185 gpio_direction_output(SMC91X_GPIO_RESET, 0);
186 gpio_set_value(SMC91X_GPIO_RESET, 1);
187 msleep(100);
188 gpio_set_value(SMC91X_GPIO_RESET, 0);
189
190 return;
191
192free3:
193 gpio_free(SMC91X_GPIO_PWRDWN);
194free2:
195 gpio_free(SMC91X_GPIO_IRQ);
196free1:
197 gpmc_cs_free(SMC91X_CS);
198
199 printk(KERN_ERR "Could not initialize smc91x\n");
200}
201
202static struct twl4030_madc_platform_data rx51_madc_data = {
203 .irq_line = 1,
204};
205
206static struct twl4030_hsmmc_info mmc[] = {
207 {
208 .name = "external",
209 .mmc = 1,
210 .wires = 4,
211 .cover_only = true,
212 .gpio_cd = 160,
213 .gpio_wp = -EINVAL,
214 },
215 {
216 .name = "internal",
217 .mmc = 2,
218 .wires = 8,
219 .gpio_cd = -EINVAL,
220 .gpio_wp = -EINVAL,
221 },
222 {} /* Terminator */
223};
224
225static struct regulator_consumer_supply rx51_vmmc1_supply = {
226 .supply = "vmmc",
227};
228
229static struct regulator_consumer_supply rx51_vmmc2_supply = {
230 .supply = "vmmc",
231};
232
233static struct regulator_consumer_supply rx51_vsim_supply = {
234 .supply = "vmmc_aux",
235};
236
237static struct regulator_init_data rx51_vaux1 = {
238 .constraints = {
239 .name = "V28",
240 .min_uV = 2800000,
241 .max_uV = 2800000,
242 .valid_modes_mask = REGULATOR_MODE_NORMAL
243 | REGULATOR_MODE_STANDBY,
244 .valid_ops_mask = REGULATOR_CHANGE_MODE
245 | REGULATOR_CHANGE_STATUS,
246 },
247};
248
249static struct regulator_init_data rx51_vaux2 = {
250 .constraints = {
251 .name = "VCSI",
252 .min_uV = 1800000,
253 .max_uV = 1800000,
254 .valid_modes_mask = REGULATOR_MODE_NORMAL
255 | REGULATOR_MODE_STANDBY,
256 .valid_ops_mask = REGULATOR_CHANGE_MODE
257 | REGULATOR_CHANGE_STATUS,
258 },
259};
260
261/* VAUX3 - adds more power to VIO_18 rail */
262static struct regulator_init_data rx51_vaux3 = {
263 .constraints = {
264 .name = "VCAM_DIG_18",
265 .min_uV = 1800000,
266 .max_uV = 1800000,
267 .apply_uV = true,
268 .valid_modes_mask = REGULATOR_MODE_NORMAL
269 | REGULATOR_MODE_STANDBY,
270 .valid_ops_mask = REGULATOR_CHANGE_MODE
271 | REGULATOR_CHANGE_STATUS,
272 },
273};
274
275static struct regulator_init_data rx51_vaux4 = {
276 .constraints = {
277 .name = "VCAM_ANA_28",
278 .min_uV = 2800000,
279 .max_uV = 2800000,
280 .apply_uV = true,
281 .valid_modes_mask = REGULATOR_MODE_NORMAL
282 | REGULATOR_MODE_STANDBY,
283 .valid_ops_mask = REGULATOR_CHANGE_MODE
284 | REGULATOR_CHANGE_STATUS,
285 },
286};
287
288static struct regulator_init_data rx51_vmmc1 = {
289 .constraints = {
290 .min_uV = 1850000,
291 .max_uV = 3150000,
292 .valid_modes_mask = REGULATOR_MODE_NORMAL
293 | REGULATOR_MODE_STANDBY,
294 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
295 | REGULATOR_CHANGE_MODE
296 | REGULATOR_CHANGE_STATUS,
297 },
298 .num_consumer_supplies = 1,
299 .consumer_supplies = &rx51_vmmc1_supply,
300};
301
302static struct regulator_init_data rx51_vmmc2 = {
303 .constraints = {
304 .name = "VMMC2_30",
305 .min_uV = 1850000,
306 .max_uV = 3150000,
307 .apply_uV = true,
308 .valid_modes_mask = REGULATOR_MODE_NORMAL
309 | REGULATOR_MODE_STANDBY,
310 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
311 | REGULATOR_CHANGE_MODE
312 | REGULATOR_CHANGE_STATUS,
313 },
314 .num_consumer_supplies = 1,
315 .consumer_supplies = &rx51_vmmc2_supply,
316};
317
318static struct regulator_init_data rx51_vsim = {
319 .constraints = {
320 .name = "VMMC2_IO_18",
321 .min_uV = 1800000,
322 .max_uV = 1800000,
323 .apply_uV = true,
324 .valid_modes_mask = REGULATOR_MODE_NORMAL
325 | REGULATOR_MODE_STANDBY,
326 .valid_ops_mask = REGULATOR_CHANGE_MODE
327 | REGULATOR_CHANGE_STATUS,
328 },
329 .num_consumer_supplies = 1,
330 .consumer_supplies = &rx51_vsim_supply,
331};
332
333static struct regulator_init_data rx51_vdac = {
334 .constraints = {
335 .min_uV = 1800000,
336 .max_uV = 1800000,
337 .valid_modes_mask = REGULATOR_MODE_NORMAL
338 | REGULATOR_MODE_STANDBY,
339 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
340 | REGULATOR_CHANGE_MODE
341 | REGULATOR_CHANGE_STATUS,
342 },
343};
344
345static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
346{
347 /* FIXME this gpio setup is just a placeholder for now */
348 gpio_request(gpio + 6, "backlight_pwm");
349 gpio_direction_output(gpio + 6, 0);
350 gpio_request(gpio + 7, "speaker_en");
351 gpio_direction_output(gpio + 7, 1);
352
353 /* set up MMC adapters, linking their regulators to them */
354 twl4030_mmc_init(mmc);
355 rx51_vmmc1_supply.dev = mmc[0].dev;
356 rx51_vmmc2_supply.dev = mmc[1].dev;
357 rx51_vsim_supply.dev = mmc[1].dev;
358
359 return 0;
360}
361
362static struct twl4030_gpio_platform_data rx51_gpio_data = {
363 .gpio_base = OMAP_MAX_GPIO_LINES,
364 .irq_base = TWL4030_GPIO_IRQ_BASE,
365 .irq_end = TWL4030_GPIO_IRQ_END,
366 .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3)
367 | BIT(4) | BIT(5)
368 | BIT(8) | BIT(9) | BIT(10) | BIT(11)
369 | BIT(12) | BIT(13) | BIT(14) | BIT(15)
370 | BIT(16) | BIT(17) ,
371 .setup = rx51_twlgpio_setup,
372};
373
374static struct twl4030_platform_data rx51_twldata = {
375 .irq_base = TWL4030_IRQ_BASE,
376 .irq_end = TWL4030_IRQ_END,
377
378 /* platform_data for children goes here */
379 .gpio = &rx51_gpio_data,
380 .keypad = &rx51_kp_data,
381 .madc = &rx51_madc_data,
382
383 .vaux1 = &rx51_vaux1,
384 .vaux2 = &rx51_vaux2,
385 .vaux3 = &rx51_vaux3,
386 .vaux4 = &rx51_vaux4,
387 .vmmc1 = &rx51_vmmc1,
388 .vmmc2 = &rx51_vmmc2,
389 .vsim = &rx51_vsim,
390 .vdac = &rx51_vdac,
391};
392
393static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
394 {
395 I2C_BOARD_INFO("twl5030", 0x48),
396 .flags = I2C_CLIENT_WAKE,
397 .irq = INT_34XX_SYS_NIRQ,
398 .platform_data = &rx51_twldata,
399 },
400};
401
402static int __init rx51_i2c_init(void)
403{
404 omap_register_i2c_bus(1, 2600, rx51_peripherals_i2c_board_info_1,
405 ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
406 omap_register_i2c_bus(2, 100, NULL, 0);
407 omap_register_i2c_bus(3, 400, NULL, 0);
408 return 0;
409}
410
411
412void __init rx51_peripherals_init(void)
413{
414 platform_add_devices(rx51_peripherals_devices,
415 ARRAY_SIZE(rx51_peripherals_devices));
416 rx51_i2c_init();
417 rx51_init_smc91x();
418}
419
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
new file mode 100644
index 000000000000..3a0daac6c839
--- /dev/null
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -0,0 +1,96 @@
1/*
2 * linux/arch/arm/mach-omap2/board-rx51.c
3 *
4 * Copyright (C) 2007, 2008 Nokia
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/delay.h>
19#include <linux/gpio.h>
20
21#include <mach/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25
26#include <mach/mcspi.h>
27#include <mach/mux.h>
28#include <mach/board.h>
29#include <mach/common.h>
30#include <mach/keypad.h>
31#include <mach/dma.h>
32#include <mach/gpmc.h>
33#include <mach/usb.h>
34
35static struct omap_uart_config rx51_uart_config = {
36 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
37};
38
39static struct omap_lcd_config rx51_lcd_config = {
40 .ctrl_name = "internal",
41};
42
43static struct omap_fbmem_config rx51_fbmem0_config = {
44 .size = 752 * 1024,
45};
46
47static struct omap_fbmem_config rx51_fbmem1_config = {
48 .size = 752 * 1024,
49};
50
51static struct omap_fbmem_config rx51_fbmem2_config = {
52 .size = 752 * 1024,
53};
54
55static struct omap_board_config_kernel rx51_config[] = {
56 { OMAP_TAG_UART, &rx51_uart_config },
57 { OMAP_TAG_FBMEM, &rx51_fbmem0_config },
58 { OMAP_TAG_FBMEM, &rx51_fbmem1_config },
59 { OMAP_TAG_FBMEM, &rx51_fbmem2_config },
60 { OMAP_TAG_LCD, &rx51_lcd_config },
61};
62
63static void __init rx51_init_irq(void)
64{
65 omap2_init_common_hw(NULL);
66 omap_init_irq();
67 omap_gpio_init();
68}
69
70extern void __init rx51_peripherals_init(void);
71
72static void __init rx51_init(void)
73{
74 omap_board_config = rx51_config;
75 omap_board_config_size = ARRAY_SIZE(rx51_config);
76 omap_serial_init();
77 usb_musb_init();
78 rx51_peripherals_init();
79}
80
81static void __init rx51_map_io(void)
82{
83 omap2_set_globals_343x();
84 omap2_map_common_io();
85}
86
87MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
88 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
89 .phys_io = 0x48000000,
90 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
91 .boot_params = 0x80000100,
92 .map_io = rx51_map_io,
93 .init_irq = rx51_init_irq,
94 .init_machine = rx51_init,
95 .timer = &omap_timer,
96MACHINE_END
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index ce4d46a4a838..4247a1534411 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -26,11 +26,10 @@
26 26
27#include <mach/clock.h> 27#include <mach/clock.h>
28#include <mach/clockdomain.h> 28#include <mach/clockdomain.h>
29#include <mach/sram.h>
30#include <mach/cpu.h> 29#include <mach/cpu.h>
31#include <asm/div64.h> 30#include <asm/div64.h>
32 31
33#include "memory.h" 32#include <mach/sdrc.h>
34#include "sdrc.h" 33#include "sdrc.h"
35#include "clock.h" 34#include "clock.h"
36#include "prm.h" 35#include "prm.h"
@@ -46,7 +45,7 @@
46#define DPLL_MIN_DIVIDER 1 45#define DPLL_MIN_DIVIDER 1
47 46
48/* Possible error results from _dpll_test_mult */ 47/* Possible error results from _dpll_test_mult */
49#define DPLL_MULT_UNDERFLOW (1 << 0) 48#define DPLL_MULT_UNDERFLOW -1
50 49
51/* 50/*
52 * Scale factor to mitigate roundoff errors in DPLL rate rounding. 51 * Scale factor to mitigate roundoff errors in DPLL rate rounding.
@@ -59,6 +58,16 @@
59#define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \ 58#define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \
60 (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE)) 59 (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE))
61 60
61/* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */
62#define DPLL_FINT_BAND1_MIN 750000
63#define DPLL_FINT_BAND1_MAX 2100000
64#define DPLL_FINT_BAND2_MIN 7500000
65#define DPLL_FINT_BAND2_MAX 21000000
66
67/* _dpll_test_fint() return codes */
68#define DPLL_FINT_UNDERFLOW -1
69#define DPLL_FINT_INVALID -2
70
62u8 cpu_mask; 71u8 cpu_mask;
63 72
64/*------------------------------------------------------------------------- 73/*-------------------------------------------------------------------------
@@ -66,6 +75,74 @@ u8 cpu_mask;
66 *-------------------------------------------------------------------------*/ 75 *-------------------------------------------------------------------------*/
67 76
68/** 77/**
78 * _omap2xxx_clk_commit - commit clock parent/rate changes in hardware
79 * @clk: struct clk *
80 *
81 * If @clk has the DELAYED_APP flag set, meaning that parent/rate changes
82 * don't take effect until the VALID_CONFIG bit is written, write the
83 * VALID_CONFIG bit and wait for the write to complete. No return value.
84 */
85static void _omap2xxx_clk_commit(struct clk *clk)
86{
87 if (!cpu_is_omap24xx())
88 return;
89
90 if (!(clk->flags & DELAYED_APP))
91 return;
92
93 prm_write_mod_reg(OMAP24XX_VALID_CONFIG, OMAP24XX_GR_MOD,
94 OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET);
95 /* OCP barrier */
96 prm_read_mod_reg(OMAP24XX_GR_MOD, OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET);
97}
98
99/*
100 * _dpll_test_fint - test whether an Fint value is valid for the DPLL
101 * @clk: DPLL struct clk to test
102 * @n: divider value (N) to test
103 *
104 * Tests whether a particular divider @n will result in a valid DPLL
105 * internal clock frequency Fint. See the 34xx TRM 4.7.6.2 "DPLL Jitter
106 * Correction". Returns 0 if OK, -1 if the enclosing loop can terminate
107 * (assuming that it is counting N upwards), or -2 if the enclosing loop
108 * should skip to the next iteration (again assuming N is increasing).
109 */
110static int _dpll_test_fint(struct clk *clk, u8 n)
111{
112 struct dpll_data *dd;
113 long fint;
114 int ret = 0;
115
116 dd = clk->dpll_data;
117
118 /* DPLL divider must result in a valid jitter correction val */
119 fint = clk->parent->rate / (n + 1);
120 if (fint < DPLL_FINT_BAND1_MIN) {
121
122 pr_debug("rejecting n=%d due to Fint failure, "
123 "lowering max_divider\n", n);
124 dd->max_divider = n;
125 ret = DPLL_FINT_UNDERFLOW;
126
127 } else if (fint > DPLL_FINT_BAND1_MAX &&
128 fint < DPLL_FINT_BAND2_MIN) {
129
130 pr_debug("rejecting n=%d due to Fint failure\n", n);
131 ret = DPLL_FINT_INVALID;
132
133 } else if (fint > DPLL_FINT_BAND2_MAX) {
134
135 pr_debug("rejecting n=%d due to Fint failure, "
136 "boosting min_divider\n", n);
137 dd->min_divider = n;
138 ret = DPLL_FINT_INVALID;
139
140 }
141
142 return ret;
143}
144
145/**
69 * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk 146 * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk
70 * @clk: OMAP clock struct ptr to use 147 * @clk: OMAP clock struct ptr to use
71 * 148 *
@@ -120,7 +197,7 @@ void omap2_init_clksel_parent(struct clk *clk)
120 clk->name, clks->parent->name, 197 clk->name, clks->parent->name,
121 ((clk->parent) ? 198 ((clk->parent) ?
122 clk->parent->name : "NULL")); 199 clk->parent->name : "NULL"));
123 clk->parent = clks->parent; 200 clk_reparent(clk, clks->parent);
124 }; 201 };
125 found = 1; 202 found = 1;
126 } 203 }
@@ -134,25 +211,52 @@ void omap2_init_clksel_parent(struct clk *clk)
134 return; 211 return;
135} 212}
136 213
137/* Returns the DPLL rate */ 214/**
215 * omap2_get_dpll_rate - returns the current DPLL CLKOUT rate
216 * @clk: struct clk * of a DPLL
217 *
218 * DPLLs can be locked or bypassed - basically, enabled or disabled.
219 * When locked, the DPLL output depends on the M and N values. When
220 * bypassed, on OMAP2xxx, the output rate is either the 32KiHz clock
221 * or sys_clk. Bypass rates on OMAP3 depend on the DPLL: DPLLs 1 and
222 * 2 are bypassed with dpll1_fclk and dpll2_fclk respectively
223 * (generated by DPLL3), while DPLL 3, 4, and 5 bypass rates are sys_clk.
224 * Returns the current DPLL CLKOUT rate (*not* CLKOUTX2) if the DPLL is
225 * locked, or the appropriate bypass rate if the DPLL is bypassed, or 0
226 * if the clock @clk is not a DPLL.
227 */
138u32 omap2_get_dpll_rate(struct clk *clk) 228u32 omap2_get_dpll_rate(struct clk *clk)
139{ 229{
140 long long dpll_clk; 230 long long dpll_clk;
141 u32 dpll_mult, dpll_div, dpll; 231 u32 dpll_mult, dpll_div, v;
142 struct dpll_data *dd; 232 struct dpll_data *dd;
143 233
144 dd = clk->dpll_data; 234 dd = clk->dpll_data;
145 /* REVISIT: What do we return on error? */
146 if (!dd) 235 if (!dd)
147 return 0; 236 return 0;
148 237
149 dpll = __raw_readl(dd->mult_div1_reg); 238 /* Return bypass rate if DPLL is bypassed */
150 dpll_mult = dpll & dd->mult_mask; 239 v = __raw_readl(dd->control_reg);
240 v &= dd->enable_mask;
241 v >>= __ffs(dd->enable_mask);
242
243 if (cpu_is_omap24xx()) {
244 if (v == OMAP2XXX_EN_DPLL_LPBYPASS ||
245 v == OMAP2XXX_EN_DPLL_FRBYPASS)
246 return dd->clk_bypass->rate;
247 } else if (cpu_is_omap34xx()) {
248 if (v == OMAP3XXX_EN_DPLL_LPBYPASS ||
249 v == OMAP3XXX_EN_DPLL_FRBYPASS)
250 return dd->clk_bypass->rate;
251 }
252
253 v = __raw_readl(dd->mult_div1_reg);
254 dpll_mult = v & dd->mult_mask;
151 dpll_mult >>= __ffs(dd->mult_mask); 255 dpll_mult >>= __ffs(dd->mult_mask);
152 dpll_div = dpll & dd->div1_mask; 256 dpll_div = v & dd->div1_mask;
153 dpll_div >>= __ffs(dd->div1_mask); 257 dpll_div >>= __ffs(dd->div1_mask);
154 258
155 dpll_clk = (long long)clk->parent->rate * dpll_mult; 259 dpll_clk = (long long)dd->clk_ref->rate * dpll_mult;
156 do_div(dpll_clk, dpll_div + 1); 260 do_div(dpll_clk, dpll_div + 1);
157 261
158 return dpll_clk; 262 return dpll_clk;
@@ -162,14 +266,11 @@ u32 omap2_get_dpll_rate(struct clk *clk)
162 * Used for clocks that have the same value as the parent clock, 266 * Used for clocks that have the same value as the parent clock,
163 * divided by some factor 267 * divided by some factor
164 */ 268 */
165void omap2_fixed_divisor_recalc(struct clk *clk) 269unsigned long omap2_fixed_divisor_recalc(struct clk *clk)
166{ 270{
167 WARN_ON(!clk->fixed_div); 271 WARN_ON(!clk->fixed_div);
168 272
169 clk->rate = clk->parent->rate / clk->fixed_div; 273 return clk->parent->rate / clk->fixed_div;
170
171 if (clk->flags & RATE_PROPAGATES)
172 propagate_rate(clk);
173} 274}
174 275
175/** 276/**
@@ -190,11 +291,10 @@ int omap2_wait_clock_ready(void __iomem *reg, u32 mask, const char *name)
190 * 24xx uses 0 to indicate not ready, and 1 to indicate ready. 291 * 24xx uses 0 to indicate not ready, and 1 to indicate ready.
191 * 34xx reverses this, just to keep us on our toes 292 * 34xx reverses this, just to keep us on our toes
192 */ 293 */
193 if (cpu_mask & (RATE_IN_242X | RATE_IN_243X)) { 294 if (cpu_mask & (RATE_IN_242X | RATE_IN_243X))
194 ena = mask; 295 ena = mask;
195 } else if (cpu_mask & RATE_IN_343X) { 296 else if (cpu_mask & RATE_IN_343X)
196 ena = 0; 297 ena = 0;
197 }
198 298
199 /* Wait for lock */ 299 /* Wait for lock */
200 while (((__raw_readl(reg) & mask) != ena) && 300 while (((__raw_readl(reg) & mask) != ena) &&
@@ -228,31 +328,12 @@ static void omap2_clk_wait_ready(struct clk *clk)
228 * it and pull it into struct clk itself somehow. 328 * it and pull it into struct clk itself somehow.
229 */ 329 */
230 reg = clk->enable_reg; 330 reg = clk->enable_reg;
231 if ((((u32)reg & 0xff) >= CM_FCLKEN1) &&
232 (((u32)reg & 0xff) <= OMAP24XX_CM_FCLKEN2))
233 other_reg = (void __iomem *)(((u32)reg & ~0xf0) | 0x10); /* CM_ICLKEN* */
234 else if ((((u32)reg & 0xff) >= CM_ICLKEN1) &&
235 (((u32)reg & 0xff) <= OMAP24XX_CM_ICLKEN4))
236 other_reg = (void __iomem *)(((u32)reg & ~0xf0) | 0x00); /* CM_FCLKEN* */
237 else
238 return;
239 331
240 /* REVISIT: What are the appropriate exclusions for 34XX? */ 332 /*
241 /* No check for DSS or cam clocks */ 333 * Convert CM_ICLKEN* <-> CM_FCLKEN*. This conversion assumes
242 if (cpu_is_omap24xx() && ((u32)reg & 0x0f) == 0) { /* CM_{F,I}CLKEN1 */ 334 * it's just a matter of XORing the bits.
243 if (clk->enable_bit == OMAP24XX_EN_DSS2_SHIFT || 335 */
244 clk->enable_bit == OMAP24XX_EN_DSS1_SHIFT || 336 other_reg = (void __iomem *)((u32)reg ^ (CM_FCLKEN ^ CM_ICLKEN));
245 clk->enable_bit == OMAP24XX_EN_CAM_SHIFT)
246 return;
247 }
248
249 /* REVISIT: What are the appropriate exclusions for 34XX? */
250 /* OMAP3: ignore DSS-mod clocks */
251 if (cpu_is_omap34xx() &&
252 (((u32)reg & ~0xff) == (u32)OMAP_CM_REGADDR(OMAP3430_DSS_MOD, 0) ||
253 ((((u32)reg & ~0xff) == (u32)OMAP_CM_REGADDR(CORE_MOD, 0)) &&
254 clk->enable_bit == OMAP3430_EN_SSI_SHIFT)))
255 return;
256 337
257 /* Check if both functional and interface clocks 338 /* Check if both functional and interface clocks
258 * are running. */ 339 * are running. */
@@ -264,18 +345,9 @@ static void omap2_clk_wait_ready(struct clk *clk)
264 omap2_wait_clock_ready(st_reg, bit, clk->name); 345 omap2_wait_clock_ready(st_reg, bit, clk->name);
265} 346}
266 347
267/* Enables clock without considering parent dependencies or use count 348static int omap2_dflt_clk_enable(struct clk *clk)
268 * REVISIT: Maybe change this to use clk->enable like on omap1?
269 */
270int _omap2_clk_enable(struct clk *clk)
271{ 349{
272 u32 regval32; 350 u32 v;
273
274 if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
275 return 0;
276
277 if (clk->enable)
278 return clk->enable(clk);
279 351
280 if (unlikely(clk->enable_reg == NULL)) { 352 if (unlikely(clk->enable_reg == NULL)) {
281 printk(KERN_ERR "clock.c: Enable for %s without enable code\n", 353 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
@@ -283,33 +355,38 @@ int _omap2_clk_enable(struct clk *clk)
283 return 0; /* REVISIT: -EINVAL */ 355 return 0; /* REVISIT: -EINVAL */
284 } 356 }
285 357
286 regval32 = __raw_readl(clk->enable_reg); 358 v = __raw_readl(clk->enable_reg);
287 if (clk->flags & INVERT_ENABLE) 359 if (clk->flags & INVERT_ENABLE)
288 regval32 &= ~(1 << clk->enable_bit); 360 v &= ~(1 << clk->enable_bit);
289 else 361 else
290 regval32 |= (1 << clk->enable_bit); 362 v |= (1 << clk->enable_bit);
291 __raw_writel(regval32, clk->enable_reg); 363 __raw_writel(v, clk->enable_reg);
292 wmb(); 364 v = __raw_readl(clk->enable_reg); /* OCP barrier */
293
294 omap2_clk_wait_ready(clk);
295 365
296 return 0; 366 return 0;
297} 367}
298 368
299/* Disables clock without considering parent dependencies or use count */ 369static int omap2_dflt_clk_enable_wait(struct clk *clk)
300void _omap2_clk_disable(struct clk *clk)
301{ 370{
302 u32 regval32; 371 int ret;
303
304 if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK))
305 return;
306 372
307 if (clk->disable) { 373 if (!clk->enable_reg) {
308 clk->disable(clk); 374 printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
309 return; 375 clk->name);
376 return 0; /* REVISIT: -EINVAL */
310 } 377 }
311 378
312 if (clk->enable_reg == NULL) { 379 ret = omap2_dflt_clk_enable(clk);
380 if (ret == 0)
381 omap2_clk_wait_ready(clk);
382 return ret;
383}
384
385static void omap2_dflt_clk_disable(struct clk *clk)
386{
387 u32 v;
388
389 if (!clk->enable_reg) {
313 /* 390 /*
314 * 'Independent' here refers to a clock which is not 391 * 'Independent' here refers to a clock which is not
315 * controlled by its parent. 392 * controlled by its parent.
@@ -319,20 +396,44 @@ void _omap2_clk_disable(struct clk *clk)
319 return; 396 return;
320 } 397 }
321 398
322 regval32 = __raw_readl(clk->enable_reg); 399 v = __raw_readl(clk->enable_reg);
323 if (clk->flags & INVERT_ENABLE) 400 if (clk->flags & INVERT_ENABLE)
324 regval32 |= (1 << clk->enable_bit); 401 v |= (1 << clk->enable_bit);
325 else 402 else
326 regval32 &= ~(1 << clk->enable_bit); 403 v &= ~(1 << clk->enable_bit);
327 __raw_writel(regval32, clk->enable_reg); 404 __raw_writel(v, clk->enable_reg);
328 wmb(); 405 /* No OCP barrier needed here since it is a disable operation */
406}
407
408const struct clkops clkops_omap2_dflt_wait = {
409 .enable = omap2_dflt_clk_enable_wait,
410 .disable = omap2_dflt_clk_disable,
411};
412
413const struct clkops clkops_omap2_dflt = {
414 .enable = omap2_dflt_clk_enable,
415 .disable = omap2_dflt_clk_disable,
416};
417
418/* Enables clock without considering parent dependencies or use count
419 * REVISIT: Maybe change this to use clk->enable like on omap1?
420 */
421static int _omap2_clk_enable(struct clk *clk)
422{
423 return clk->ops->enable(clk);
424}
425
426/* Disables clock without considering parent dependencies or use count */
427static void _omap2_clk_disable(struct clk *clk)
428{
429 clk->ops->disable(clk);
329} 430}
330 431
331void omap2_clk_disable(struct clk *clk) 432void omap2_clk_disable(struct clk *clk)
332{ 433{
333 if (clk->usecount > 0 && !(--clk->usecount)) { 434 if (clk->usecount > 0 && !(--clk->usecount)) {
334 _omap2_clk_disable(clk); 435 _omap2_clk_disable(clk);
335 if (likely((u32)clk->parent)) 436 if (clk->parent)
336 omap2_clk_disable(clk->parent); 437 omap2_clk_disable(clk->parent);
337 if (clk->clkdm) 438 if (clk->clkdm)
338 omap2_clkdm_clk_disable(clk->clkdm, clk); 439 omap2_clkdm_clk_disable(clk->clkdm, clk);
@@ -345,30 +446,29 @@ int omap2_clk_enable(struct clk *clk)
345 int ret = 0; 446 int ret = 0;
346 447
347 if (clk->usecount++ == 0) { 448 if (clk->usecount++ == 0) {
348 if (likely((u32)clk->parent))
349 ret = omap2_clk_enable(clk->parent);
350
351 if (unlikely(ret != 0)) {
352 clk->usecount--;
353 return ret;
354 }
355
356 if (clk->clkdm) 449 if (clk->clkdm)
357 omap2_clkdm_clk_enable(clk->clkdm, clk); 450 omap2_clkdm_clk_enable(clk->clkdm, clk);
358 451
359 ret = _omap2_clk_enable(clk); 452 if (clk->parent) {
360 453 ret = omap2_clk_enable(clk->parent);
361 if (unlikely(ret != 0)) { 454 if (ret)
362 if (clk->clkdm) 455 goto err;
363 omap2_clkdm_clk_disable(clk->clkdm, clk); 456 }
364 457
365 if (clk->parent) { 458 ret = _omap2_clk_enable(clk);
459 if (ret) {
460 if (clk->parent)
366 omap2_clk_disable(clk->parent); 461 omap2_clk_disable(clk->parent);
367 clk->usecount--; 462
368 } 463 goto err;
369 } 464 }
370 } 465 }
466 return ret;
371 467
468err:
469 if (clk->clkdm)
470 omap2_clkdm_clk_disable(clk->clkdm, clk);
471 clk->usecount--;
372 return ret; 472 return ret;
373} 473}
374 474
@@ -376,24 +476,22 @@ int omap2_clk_enable(struct clk *clk)
376 * Used for clocks that are part of CLKSEL_xyz governed clocks. 476 * Used for clocks that are part of CLKSEL_xyz governed clocks.
377 * REVISIT: Maybe change to use clk->enable() functions like on omap1? 477 * REVISIT: Maybe change to use clk->enable() functions like on omap1?
378 */ 478 */
379void omap2_clksel_recalc(struct clk *clk) 479unsigned long omap2_clksel_recalc(struct clk *clk)
380{ 480{
481 unsigned long rate;
381 u32 div = 0; 482 u32 div = 0;
382 483
383 pr_debug("clock: recalc'ing clksel clk %s\n", clk->name); 484 pr_debug("clock: recalc'ing clksel clk %s\n", clk->name);
384 485
385 div = omap2_clksel_get_divisor(clk); 486 div = omap2_clksel_get_divisor(clk);
386 if (div == 0) 487 if (div == 0)
387 return; 488 return clk->rate;
388 489
389 if (unlikely(clk->rate == clk->parent->rate / div)) 490 rate = clk->parent->rate / div;
390 return;
391 clk->rate = clk->parent->rate / div;
392 491
393 pr_debug("clock: new clock rate is %ld (div %d)\n", clk->rate, div); 492 pr_debug("clock: new clock rate is %ld (div %d)\n", rate, div);
394 493
395 if (unlikely(clk->flags & RATE_PROPAGATES)) 494 return rate;
396 propagate_rate(clk);
397} 495}
398 496
399/** 497/**
@@ -405,8 +503,8 @@ void omap2_clksel_recalc(struct clk *clk)
405 * the element associated with the supplied parent clock address. 503 * the element associated with the supplied parent clock address.
406 * Returns a pointer to the struct clksel on success or NULL on error. 504 * Returns a pointer to the struct clksel on success or NULL on error.
407 */ 505 */
408const struct clksel *omap2_get_clksel_by_parent(struct clk *clk, 506static const struct clksel *omap2_get_clksel_by_parent(struct clk *clk,
409 struct clk *src_clk) 507 struct clk *src_clk)
410{ 508{
411 const struct clksel *clks; 509 const struct clksel *clks;
412 510
@@ -455,7 +553,7 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
455 *new_div = 1; 553 *new_div = 1;
456 554
457 clks = omap2_get_clksel_by_parent(clk, clk->parent); 555 clks = omap2_get_clksel_by_parent(clk, clk->parent);
458 if (clks == NULL) 556 if (!clks)
459 return ~0; 557 return ~0;
460 558
461 for (clkr = clks->rates; clkr->div; clkr++) { 559 for (clkr = clks->rates; clkr->div; clkr++) {
@@ -514,7 +612,7 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate)
514/* Given a clock and a rate apply a clock specific rounding function */ 612/* Given a clock and a rate apply a clock specific rounding function */
515long omap2_clk_round_rate(struct clk *clk, unsigned long rate) 613long omap2_clk_round_rate(struct clk *clk, unsigned long rate)
516{ 614{
517 if (clk->round_rate != NULL) 615 if (clk->round_rate)
518 return clk->round_rate(clk, rate); 616 return clk->round_rate(clk, rate);
519 617
520 if (clk->flags & RATE_FIXED) 618 if (clk->flags & RATE_FIXED)
@@ -540,7 +638,7 @@ u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val)
540 const struct clksel_rate *clkr; 638 const struct clksel_rate *clkr;
541 639
542 clks = omap2_get_clksel_by_parent(clk, clk->parent); 640 clks = omap2_get_clksel_by_parent(clk, clk->parent);
543 if (clks == NULL) 641 if (!clks)
544 return 0; 642 return 0;
545 643
546 for (clkr = clks->rates; clkr->div; clkr++) { 644 for (clkr = clks->rates; clkr->div; clkr++) {
@@ -576,7 +674,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
576 WARN_ON(div == 0); 674 WARN_ON(div == 0);
577 675
578 clks = omap2_get_clksel_by_parent(clk, clk->parent); 676 clks = omap2_get_clksel_by_parent(clk, clk->parent);
579 if (clks == NULL) 677 if (!clks)
580 return ~0; 678 return ~0;
581 679
582 for (clkr = clks->rates; clkr->div; clkr++) { 680 for (clkr = clks->rates; clkr->div; clkr++) {
@@ -595,23 +693,6 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
595} 693}
596 694
597/** 695/**
598 * omap2_get_clksel - find clksel register addr & field mask for a clk
599 * @clk: struct clk to use
600 * @field_mask: ptr to u32 to store the register field mask
601 *
602 * Returns the address of the clksel register upon success or NULL on error.
603 */
604void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask)
605{
606 if (unlikely((clk->clksel_reg == NULL) || (clk->clksel_mask == NULL)))
607 return NULL;
608
609 *field_mask = clk->clksel_mask;
610
611 return clk->clksel_reg;
612}
613
614/**
615 * omap2_clksel_get_divisor - get current divider applied to parent clock. 696 * omap2_clksel_get_divisor - get current divider applied to parent clock.
616 * @clk: OMAP struct clk to use. 697 * @clk: OMAP struct clk to use.
617 * 698 *
@@ -619,49 +700,41 @@ void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask)
619 */ 700 */
620u32 omap2_clksel_get_divisor(struct clk *clk) 701u32 omap2_clksel_get_divisor(struct clk *clk)
621{ 702{
622 u32 field_mask, field_val; 703 u32 v;
623 void __iomem *div_addr;
624 704
625 div_addr = omap2_get_clksel(clk, &field_mask); 705 if (!clk->clksel_mask)
626 if (div_addr == NULL)
627 return 0; 706 return 0;
628 707
629 field_val = __raw_readl(div_addr) & field_mask; 708 v = __raw_readl(clk->clksel_reg) & clk->clksel_mask;
630 field_val >>= __ffs(field_mask); 709 v >>= __ffs(clk->clksel_mask);
631 710
632 return omap2_clksel_to_divisor(clk, field_val); 711 return omap2_clksel_to_divisor(clk, v);
633} 712}
634 713
635int omap2_clksel_set_rate(struct clk *clk, unsigned long rate) 714int omap2_clksel_set_rate(struct clk *clk, unsigned long rate)
636{ 715{
637 u32 field_mask, field_val, reg_val, validrate, new_div = 0; 716 u32 v, field_val, validrate, new_div = 0;
638 void __iomem *div_addr;
639 717
640 validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); 718 if (!clk->clksel_mask)
641 if (validrate != rate)
642 return -EINVAL; 719 return -EINVAL;
643 720
644 div_addr = omap2_get_clksel(clk, &field_mask); 721 validrate = omap2_clksel_round_rate_div(clk, rate, &new_div);
645 if (div_addr == NULL) 722 if (validrate != rate)
646 return -EINVAL; 723 return -EINVAL;
647 724
648 field_val = omap2_divisor_to_clksel(clk, new_div); 725 field_val = omap2_divisor_to_clksel(clk, new_div);
649 if (field_val == ~0) 726 if (field_val == ~0)
650 return -EINVAL; 727 return -EINVAL;
651 728
652 reg_val = __raw_readl(div_addr); 729 v = __raw_readl(clk->clksel_reg);
653 reg_val &= ~field_mask; 730 v &= ~clk->clksel_mask;
654 reg_val |= (field_val << __ffs(field_mask)); 731 v |= field_val << __ffs(clk->clksel_mask);
655 __raw_writel(reg_val, div_addr); 732 __raw_writel(v, clk->clksel_reg);
656 wmb(); 733 v = __raw_readl(clk->clksel_reg); /* OCP barrier */
657 734
658 clk->rate = clk->parent->rate / new_div; 735 clk->rate = clk->parent->rate / new_div;
659 736
660 if (clk->flags & DELAYED_APP && cpu_is_omap24xx()) { 737 _omap2xxx_clk_commit(clk);
661 prm_write_mod_reg(OMAP24XX_VALID_CONFIG,
662 OMAP24XX_GR_MOD, OMAP24XX_PRCM_CLKCFG_CTRL_OFFSET);
663 wmb();
664 }
665 738
666 return 0; 739 return 0;
667} 740}
@@ -680,31 +753,24 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
680 return -EINVAL; 753 return -EINVAL;
681 754
682 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ 755 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
683 if (clk->set_rate != NULL) 756 if (clk->set_rate)
684 ret = clk->set_rate(clk, rate); 757 ret = clk->set_rate(clk, rate);
685 758
686 if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES)))
687 propagate_rate(clk);
688
689 return ret; 759 return ret;
690} 760}
691 761
692/* 762/*
693 * Converts encoded control register address into a full address 763 * Converts encoded control register address into a full address
694 * On error, *src_addr will be returned as 0. 764 * On error, the return value (parent_div) will be 0.
695 */ 765 */
696static u32 omap2_clksel_get_src_field(void __iomem **src_addr, 766static u32 _omap2_clksel_get_src_field(struct clk *src_clk, struct clk *clk,
697 struct clk *src_clk, u32 *field_mask, 767 u32 *field_val)
698 struct clk *clk, u32 *parent_div)
699{ 768{
700 const struct clksel *clks; 769 const struct clksel *clks;
701 const struct clksel_rate *clkr; 770 const struct clksel_rate *clkr;
702 771
703 *parent_div = 0;
704 *src_addr = NULL;
705
706 clks = omap2_get_clksel_by_parent(clk, src_clk); 772 clks = omap2_get_clksel_by_parent(clk, src_clk);
707 if (clks == NULL) 773 if (!clks)
708 return 0; 774 return 0;
709 775
710 for (clkr = clks->rates; clkr->div; clkr++) { 776 for (clkr = clks->rates; clkr->div; clkr++) {
@@ -722,47 +788,35 @@ static u32 omap2_clksel_get_src_field(void __iomem **src_addr,
722 /* Should never happen. Add a clksel mask to the struct clk. */ 788 /* Should never happen. Add a clksel mask to the struct clk. */
723 WARN_ON(clk->clksel_mask == 0); 789 WARN_ON(clk->clksel_mask == 0);
724 790
725 *field_mask = clk->clksel_mask; 791 *field_val = clkr->val;
726 *src_addr = clk->clksel_reg;
727 *parent_div = clkr->div;
728 792
729 return clkr->val; 793 return clkr->div;
730} 794}
731 795
732int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) 796int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
733{ 797{
734 void __iomem *src_addr; 798 u32 field_val, v, parent_div;
735 u32 field_val, field_mask, reg_val, parent_div;
736 799
737 if (unlikely(clk->flags & CONFIG_PARTICIPANT)) 800 if (clk->flags & CONFIG_PARTICIPANT)
738 return -EINVAL; 801 return -EINVAL;
739 802
740 if (!clk->clksel) 803 if (!clk->clksel)
741 return -EINVAL; 804 return -EINVAL;
742 805
743 field_val = omap2_clksel_get_src_field(&src_addr, new_parent, 806 parent_div = _omap2_clksel_get_src_field(new_parent, clk, &field_val);
744 &field_mask, clk, &parent_div); 807 if (!parent_div)
745 if (src_addr == NULL)
746 return -EINVAL; 808 return -EINVAL;
747 809
748 if (clk->usecount > 0)
749 omap2_clk_disable(clk);
750
751 /* Set new source value (previous dividers if any in effect) */ 810 /* Set new source value (previous dividers if any in effect) */
752 reg_val = __raw_readl(src_addr) & ~field_mask; 811 v = __raw_readl(clk->clksel_reg);
753 reg_val |= (field_val << __ffs(field_mask)); 812 v &= ~clk->clksel_mask;
754 __raw_writel(reg_val, src_addr); 813 v |= field_val << __ffs(clk->clksel_mask);
755 wmb(); 814 __raw_writel(v, clk->clksel_reg);
756 815 v = __raw_readl(clk->clksel_reg); /* OCP barrier */
757 if (clk->flags & DELAYED_APP && cpu_is_omap24xx()) {
758 __raw_writel(OMAP24XX_VALID_CONFIG, OMAP24XX_PRCM_CLKCFG_CTRL);
759 wmb();
760 }
761 816
762 clk->parent = new_parent; 817 _omap2xxx_clk_commit(clk);
763 818
764 if (clk->usecount > 0) 819 clk_reparent(clk, new_parent);
765 omap2_clk_enable(clk);
766 820
767 /* CLKSEL clocks follow their parents' rates, divided by a divisor */ 821 /* CLKSEL clocks follow their parents' rates, divided by a divisor */
768 clk->rate = new_parent->rate; 822 clk->rate = new_parent->rate;
@@ -773,9 +827,6 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
773 pr_debug("clock: set parent of %s to %s (new rate %ld)\n", 827 pr_debug("clock: set parent of %s to %s (new rate %ld)\n",
774 clk->name, clk->parent->name, clk->rate); 828 clk->name, clk->parent->name, clk->rate);
775 829
776 if (unlikely(clk->flags & RATE_PROPAGATES))
777 propagate_rate(clk);
778
779 return 0; 830 return 0;
780} 831}
781 832
@@ -805,7 +856,8 @@ int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance)
805 return 0; 856 return 0;
806} 857}
807 858
808static unsigned long _dpll_compute_new_rate(unsigned long parent_rate, unsigned int m, unsigned int n) 859static unsigned long _dpll_compute_new_rate(unsigned long parent_rate,
860 unsigned int m, unsigned int n)
809{ 861{
810 unsigned long long num; 862 unsigned long long num;
811 863
@@ -838,7 +890,7 @@ static int _dpll_test_mult(int *m, int n, unsigned long *new_rate,
838 unsigned long target_rate, 890 unsigned long target_rate,
839 unsigned long parent_rate) 891 unsigned long parent_rate)
840{ 892{
841 int flags = 0, carry = 0; 893 int r = 0, carry = 0;
842 894
843 /* Unscale m and round if necessary */ 895 /* Unscale m and round if necessary */
844 if (*m % DPLL_SCALE_FACTOR >= DPLL_ROUNDING_VAL) 896 if (*m % DPLL_SCALE_FACTOR >= DPLL_ROUNDING_VAL)
@@ -859,13 +911,13 @@ static int _dpll_test_mult(int *m, int n, unsigned long *new_rate,
859 if (*m < DPLL_MIN_MULTIPLIER) { 911 if (*m < DPLL_MIN_MULTIPLIER) {
860 *m = DPLL_MIN_MULTIPLIER; 912 *m = DPLL_MIN_MULTIPLIER;
861 *new_rate = 0; 913 *new_rate = 0;
862 flags = DPLL_MULT_UNDERFLOW; 914 r = DPLL_MULT_UNDERFLOW;
863 } 915 }
864 916
865 if (*new_rate == 0) 917 if (*new_rate == 0)
866 *new_rate = _dpll_compute_new_rate(parent_rate, *m, n); 918 *new_rate = _dpll_compute_new_rate(parent_rate, *m, n);
867 919
868 return flags; 920 return r;
869} 921}
870 922
871/** 923/**
@@ -889,54 +941,65 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
889 int m, n, r, e, scaled_max_m; 941 int m, n, r, e, scaled_max_m;
890 unsigned long scaled_rt_rp, new_rate; 942 unsigned long scaled_rt_rp, new_rate;
891 int min_e = -1, min_e_m = -1, min_e_n = -1; 943 int min_e = -1, min_e_m = -1, min_e_n = -1;
944 struct dpll_data *dd;
892 945
893 if (!clk || !clk->dpll_data) 946 if (!clk || !clk->dpll_data)
894 return ~0; 947 return ~0;
895 948
949 dd = clk->dpll_data;
950
896 pr_debug("clock: starting DPLL round_rate for clock %s, target rate " 951 pr_debug("clock: starting DPLL round_rate for clock %s, target rate "
897 "%ld\n", clk->name, target_rate); 952 "%ld\n", clk->name, target_rate);
898 953
899 scaled_rt_rp = target_rate / (clk->parent->rate / DPLL_SCALE_FACTOR); 954 scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR);
900 scaled_max_m = clk->dpll_data->max_multiplier * DPLL_SCALE_FACTOR; 955 scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR;
901 956
902 clk->dpll_data->last_rounded_rate = 0; 957 dd->last_rounded_rate = 0;
903 958
904 for (n = clk->dpll_data->max_divider; n >= DPLL_MIN_DIVIDER; n--) { 959 for (n = dd->min_divider; n <= dd->max_divider; n++) {
960
961 /* Is the (input clk, divider) pair valid for the DPLL? */
962 r = _dpll_test_fint(clk, n);
963 if (r == DPLL_FINT_UNDERFLOW)
964 break;
965 else if (r == DPLL_FINT_INVALID)
966 continue;
905 967
906 /* Compute the scaled DPLL multiplier, based on the divider */ 968 /* Compute the scaled DPLL multiplier, based on the divider */
907 m = scaled_rt_rp * n; 969 m = scaled_rt_rp * n;
908 970
909 /* 971 /*
910 * Since we're counting n down, a m overflow means we can 972 * Since we're counting n up, a m overflow means we
911 * can immediately skip to the next n 973 * can bail out completely (since as n increases in
974 * the next iteration, there's no way that m can
975 * increase beyond the current m)
912 */ 976 */
913 if (m > scaled_max_m) 977 if (m > scaled_max_m)
914 continue; 978 break;
915 979
916 r = _dpll_test_mult(&m, n, &new_rate, target_rate, 980 r = _dpll_test_mult(&m, n, &new_rate, target_rate,
917 clk->parent->rate); 981 dd->clk_ref->rate);
982
983 /* m can't be set low enough for this n - try with a larger n */
984 if (r == DPLL_MULT_UNDERFLOW)
985 continue;
918 986
919 e = target_rate - new_rate; 987 e = target_rate - new_rate;
920 pr_debug("clock: n = %d: m = %d: rate error is %d " 988 pr_debug("clock: n = %d: m = %d: rate error is %d "
921 "(new_rate = %ld)\n", n, m, e, new_rate); 989 "(new_rate = %ld)\n", n, m, e, new_rate);
922 990
923 if (min_e == -1 || 991 if (min_e == -1 ||
924 min_e >= (int)(abs(e) - clk->dpll_data->rate_tolerance)) { 992 min_e >= (int)(abs(e) - dd->rate_tolerance)) {
925 min_e = e; 993 min_e = e;
926 min_e_m = m; 994 min_e_m = m;
927 min_e_n = n; 995 min_e_n = n;
928 996
929 pr_debug("clock: found new least error %d\n", min_e); 997 pr_debug("clock: found new least error %d\n", min_e);
930 }
931 998
932 /* 999 /* We found good settings -- bail out now */
933 * Since we're counting n down, a m underflow means we 1000 if (min_e <= dd->rate_tolerance)
934 * can bail out completely (since as n decreases in 1001 break;
935 * the next iteration, there's no way that m can 1002 }
936 * increase beyond the current m)
937 */
938 if (r & DPLL_MULT_UNDERFLOW)
939 break;
940 } 1003 }
941 1004
942 if (min_e < 0) { 1005 if (min_e < 0) {
@@ -944,17 +1007,17 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
944 return ~0; 1007 return ~0;
945 } 1008 }
946 1009
947 clk->dpll_data->last_rounded_m = min_e_m; 1010 dd->last_rounded_m = min_e_m;
948 clk->dpll_data->last_rounded_n = min_e_n; 1011 dd->last_rounded_n = min_e_n;
949 clk->dpll_data->last_rounded_rate = 1012 dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate,
950 _dpll_compute_new_rate(clk->parent->rate, min_e_m, min_e_n); 1013 min_e_m, min_e_n);
951 1014
952 pr_debug("clock: final least error: e = %d, m = %d, n = %d\n", 1015 pr_debug("clock: final least error: e = %d, m = %d, n = %d\n",
953 min_e, min_e_m, min_e_n); 1016 min_e, min_e_m, min_e_n);
954 pr_debug("clock: final rate: %ld (target rate: %ld)\n", 1017 pr_debug("clock: final rate: %ld (target rate: %ld)\n",
955 clk->dpll_data->last_rounded_rate, target_rate); 1018 dd->last_rounded_rate, target_rate);
956 1019
957 return clk->dpll_data->last_rounded_rate; 1020 return dd->last_rounded_rate;
958} 1021}
959 1022
960/*------------------------------------------------------------------------- 1023/*-------------------------------------------------------------------------
@@ -973,6 +1036,10 @@ void omap2_clk_disable_unused(struct clk *clk)
973 return; 1036 return;
974 1037
975 printk(KERN_INFO "Disabling unused clock \"%s\"\n", clk->name); 1038 printk(KERN_INFO "Disabling unused clock \"%s\"\n", clk->name);
976 _omap2_clk_disable(clk); 1039 if (cpu_is_omap34xx()) {
1040 omap2_clk_enable(clk);
1041 omap2_clk_disable(clk);
1042 } else
1043 _omap2_clk_disable(clk);
977} 1044}
978#endif 1045#endif
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 1fb330e0847d..2679ddfa6424 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -21,13 +21,28 @@
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
23 23
24/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */
25#define CORE_CLK_SRC_32K 0x0
26#define CORE_CLK_SRC_DPLL 0x1
27#define CORE_CLK_SRC_DPLL_X2 0x2
28
29/* OMAP2xxx CM_CLKEN_PLL.EN_DPLL bits - for omap2_get_dpll_rate() */
30#define OMAP2XXX_EN_DPLL_LPBYPASS 0x1
31#define OMAP2XXX_EN_DPLL_FRBYPASS 0x2
32#define OMAP2XXX_EN_DPLL_LOCKED 0x3
33
34/* OMAP3xxx CM_CLKEN_PLL*.EN_*_DPLL bits - for omap2_get_dpll_rate() */
35#define OMAP3XXX_EN_DPLL_LPBYPASS 0x5
36#define OMAP3XXX_EN_DPLL_FRBYPASS 0x6
37#define OMAP3XXX_EN_DPLL_LOCKED 0x7
38
24int omap2_clk_init(void); 39int omap2_clk_init(void);
25int omap2_clk_enable(struct clk *clk); 40int omap2_clk_enable(struct clk *clk);
26void omap2_clk_disable(struct clk *clk); 41void omap2_clk_disable(struct clk *clk);
27long omap2_clk_round_rate(struct clk *clk, unsigned long rate); 42long omap2_clk_round_rate(struct clk *clk, unsigned long rate);
28int omap2_clk_set_rate(struct clk *clk, unsigned long rate); 43int omap2_clk_set_rate(struct clk *clk, unsigned long rate);
29int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); 44int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent);
30int omap2_dpll_rate_tolerance_set(struct clk *clk, unsigned int tolerance); 45int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance);
31long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); 46long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate);
32 47
33#ifdef CONFIG_OMAP_RESET_CLOCKS 48#ifdef CONFIG_OMAP_RESET_CLOCKS
@@ -36,7 +51,7 @@ void omap2_clk_disable_unused(struct clk *clk);
36#define omap2_clk_disable_unused NULL 51#define omap2_clk_disable_unused NULL
37#endif 52#endif
38 53
39void omap2_clksel_recalc(struct clk *clk); 54unsigned long omap2_clksel_recalc(struct clk *clk);
40void omap2_init_clk_clkdm(struct clk *clk); 55void omap2_init_clk_clkdm(struct clk *clk);
41void omap2_init_clksel_parent(struct clk *clk); 56void omap2_init_clksel_parent(struct clk *clk);
42u32 omap2_clksel_get_divisor(struct clk *clk); 57u32 omap2_clksel_get_divisor(struct clk *clk);
@@ -44,13 +59,16 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
44 u32 *new_div); 59 u32 *new_div);
45u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val); 60u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val);
46u32 omap2_divisor_to_clksel(struct clk *clk, u32 div); 61u32 omap2_divisor_to_clksel(struct clk *clk, u32 div);
47void omap2_fixed_divisor_recalc(struct clk *clk); 62unsigned long omap2_fixed_divisor_recalc(struct clk *clk);
48long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); 63long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate);
49int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); 64int omap2_clksel_set_rate(struct clk *clk, unsigned long rate);
50u32 omap2_get_dpll_rate(struct clk *clk); 65u32 omap2_get_dpll_rate(struct clk *clk);
51int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); 66int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name);
52void omap2_clk_prepare_for_reboot(void); 67void omap2_clk_prepare_for_reboot(void);
53 68
69extern const struct clkops clkops_omap2_dflt_wait;
70extern const struct clkops clkops_omap2_dflt;
71
54extern u8 cpu_mask; 72extern u8 cpu_mask;
55 73
56/* clksel_rate data common to 24xx/343x */ 74/* clksel_rate data common to 24xx/343x */
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index d382eb0184ac..1e839c5a28c5 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -31,15 +31,192 @@
31#include <mach/clock.h> 31#include <mach/clock.h>
32#include <mach/sram.h> 32#include <mach/sram.h>
33#include <asm/div64.h> 33#include <asm/div64.h>
34#include <asm/clkdev.h>
34 35
35#include "memory.h" 36#include <mach/sdrc.h>
36#include "clock.h" 37#include "clock.h"
37#include "clock24xx.h"
38#include "prm.h" 38#include "prm.h"
39#include "prm-regbits-24xx.h" 39#include "prm-regbits-24xx.h"
40#include "cm.h" 40#include "cm.h"
41#include "cm-regbits-24xx.h" 41#include "cm-regbits-24xx.h"
42 42
43static const struct clkops clkops_oscck;
44static const struct clkops clkops_fixed;
45
46#include "clock24xx.h"
47
48struct omap_clk {
49 u32 cpu;
50 struct clk_lookup lk;
51};
52
53#define CLK(dev, con, ck, cp) \
54 { \
55 .cpu = cp, \
56 .lk = { \
57 .dev_id = dev, \
58 .con_id = con, \
59 .clk = ck, \
60 }, \
61 }
62
63#define CK_243X (1 << 0)
64#define CK_242X (1 << 1)
65
66static struct omap_clk omap24xx_clks[] = {
67 /* external root sources */
68 CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X),
69 CLK(NULL, "osc_ck", &osc_ck, CK_243X | CK_242X),
70 CLK(NULL, "sys_ck", &sys_ck, CK_243X | CK_242X),
71 CLK(NULL, "alt_ck", &alt_ck, CK_243X | CK_242X),
72 /* internal analog sources */
73 CLK(NULL, "dpll_ck", &dpll_ck, CK_243X | CK_242X),
74 CLK(NULL, "apll96_ck", &apll96_ck, CK_243X | CK_242X),
75 CLK(NULL, "apll54_ck", &apll54_ck, CK_243X | CK_242X),
76 /* internal prcm root sources */
77 CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X | CK_242X),
78 CLK(NULL, "core_ck", &core_ck, CK_243X | CK_242X),
79 CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X | CK_242X),
80 CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X | CK_242X),
81 CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X | CK_242X),
82 CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X | CK_242X),
83 CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X | CK_242X),
84 CLK(NULL, "sys_clkout", &sys_clkout, CK_243X | CK_242X),
85 CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X),
86 CLK(NULL, "sys_clkout2", &sys_clkout2, CK_242X),
87 CLK(NULL, "emul_ck", &emul_ck, CK_242X),
88 /* mpu domain clocks */
89 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X | CK_242X),
90 /* dsp domain clocks */
91 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X | CK_242X),
92 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X | CK_242X),
93 CLK(NULL, "dsp_ick", &dsp_ick, CK_242X),
94 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
95 CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X),
96 CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X),
97 /* GFX domain clocks */
98 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X | CK_242X),
99 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X | CK_242X),
100 CLK(NULL, "gfx_ick", &gfx_ick, CK_243X | CK_242X),
101 /* Modem domain clocks */
102 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
103 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
104 /* DSS domain clocks */
105 CLK(NULL, "dss_ick", &dss_ick, CK_243X | CK_242X),
106 CLK(NULL, "dss1_fck", &dss1_fck, CK_243X | CK_242X),
107 CLK(NULL, "dss2_fck", &dss2_fck, CK_243X | CK_242X),
108 CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X | CK_242X),
109 /* L3 domain clocks */
110 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X | CK_242X),
111 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X | CK_242X),
112 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X | CK_242X),
113 /* L4 domain clocks */
114 CLK(NULL, "l4_ck", &l4_ck, CK_243X | CK_242X),
115 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X | CK_242X),
116 /* virtual meta-group clock */
117 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X | CK_242X),
118 /* general l4 interface ck, multi-parent functional clk */
119 CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X | CK_242X),
120 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X | CK_242X),
121 CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X | CK_242X),
122 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X | CK_242X),
123 CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X | CK_242X),
124 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X | CK_242X),
125 CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X | CK_242X),
126 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X | CK_242X),
127 CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X | CK_242X),
128 CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X | CK_242X),
129 CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X | CK_242X),
130 CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X | CK_242X),
131 CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X | CK_242X),
132 CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X | CK_242X),
133 CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X | CK_242X),
134 CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X | CK_242X),
135 CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X | CK_242X),
136 CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X | CK_242X),
137 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X | CK_242X),
138 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X | CK_242X),
139 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X | CK_242X),
140 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X | CK_242X),
141 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X | CK_242X),
142 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X | CK_242X),
143 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X | CK_242X),
144 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X | CK_242X),
145 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X | CK_242X),
146 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X | CK_242X),
147 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
148 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X),
149 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
150 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X),
151 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
152 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X),
153 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X | CK_242X),
154 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X | CK_242X),
155 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X | CK_242X),
156 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X | CK_242X),
157 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
158 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X),
159 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X | CK_242X),
160 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X | CK_242X),
161 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X | CK_242X),
162 CLK(NULL, "uart2_fck", &uart2_fck, CK_243X | CK_242X),
163 CLK(NULL, "uart3_ick", &uart3_ick, CK_243X | CK_242X),
164 CLK(NULL, "uart3_fck", &uart3_fck, CK_243X | CK_242X),
165 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X | CK_242X),
166 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X | CK_242X),
167 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X | CK_242X),
168 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X | CK_242X),
169 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X | CK_242X),
170 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X | CK_242X),
171 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X | CK_242X),
172 CLK(NULL, "icr_ick", &icr_ick, CK_243X),
173 CLK("omap24xxcam", "fck", &cam_fck, CK_243X | CK_242X),
174 CLK("omap24xxcam", "ick", &cam_ick, CK_243X | CK_242X),
175 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X | CK_242X),
176 CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X | CK_242X),
177 CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X | CK_242X),
178 CLK(NULL, "wdt3_ick", &wdt3_ick, CK_242X),
179 CLK(NULL, "wdt3_fck", &wdt3_fck, CK_242X),
180 CLK(NULL, "mspro_ick", &mspro_ick, CK_243X | CK_242X),
181 CLK(NULL, "mspro_fck", &mspro_fck, CK_243X | CK_242X),
182 CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X),
183 CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X),
184 CLK(NULL, "fac_ick", &fac_ick, CK_243X | CK_242X),
185 CLK(NULL, "fac_fck", &fac_fck, CK_243X | CK_242X),
186 CLK(NULL, "eac_ick", &eac_ick, CK_242X),
187 CLK(NULL, "eac_fck", &eac_fck, CK_242X),
188 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X | CK_242X),
189 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X | CK_242X),
190 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X | CK_242X),
191 CLK("i2c_omap.1", "fck", &i2c1_fck, CK_242X),
192 CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X),
193 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X | CK_242X),
194 CLK("i2c_omap.2", "fck", &i2c2_fck, CK_242X),
195 CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X),
196 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X | CK_242X),
197 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X | CK_242X),
198 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X | CK_242X),
199 CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X),
200 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X),
201 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X),
202 CLK(NULL, "des_ick", &des_ick, CK_243X | CK_242X),
203 CLK(NULL, "sha_ick", &sha_ick, CK_243X | CK_242X),
204 CLK("omap_rng", "ick", &rng_ick, CK_243X | CK_242X),
205 CLK(NULL, "aes_ick", &aes_ick, CK_243X | CK_242X),
206 CLK(NULL, "pka_ick", &pka_ick, CK_243X | CK_242X),
207 CLK(NULL, "usb_fck", &usb_fck, CK_243X | CK_242X),
208 CLK(NULL, "usbhs_ick", &usbhs_ick, CK_243X),
209 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X),
210 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X),
211 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X),
212 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X),
213 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
214 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
215 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
216 CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
217 CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
218};
219
43/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ 220/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
44#define EN_APLL_STOPPED 0 221#define EN_APLL_STOPPED 0
45#define EN_APLL_LOCKED 3 222#define EN_APLL_LOCKED 3
@@ -59,19 +236,32 @@ static struct clk *sclk;
59 * Omap24xx specific clock functions 236 * Omap24xx specific clock functions
60 *-------------------------------------------------------------------------*/ 237 *-------------------------------------------------------------------------*/
61 238
62/* This actually returns the rate of core_ck, not dpll_ck. */ 239/**
63static u32 omap2_get_dpll_rate_24xx(struct clk *tclk) 240 * omap2xxx_clk_get_core_rate - return the CORE_CLK rate
241 * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck")
242 *
243 * Returns the CORE_CLK rate. CORE_CLK can have one of three rate
244 * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz
245 * (the latter is unusual). This currently should be called with
246 * struct clk *dpll_ck, which is a composite clock of dpll_ck and
247 * core_ck.
248 */
249static unsigned long omap2xxx_clk_get_core_rate(struct clk *clk)
64{ 250{
65 long long dpll_clk; 251 long long core_clk;
66 u8 amult; 252 u32 v;
253
254 core_clk = omap2_get_dpll_rate(clk);
67 255
68 dpll_clk = omap2_get_dpll_rate(tclk); 256 v = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
257 v &= OMAP24XX_CORE_CLK_SRC_MASK;
69 258
70 amult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 259 if (v == CORE_CLK_SRC_32K)
71 amult &= OMAP24XX_CORE_CLK_SRC_MASK; 260 core_clk = 32768;
72 dpll_clk *= amult; 261 else
262 core_clk *= v;
73 263
74 return dpll_clk; 264 return core_clk;
75} 265}
76 266
77static int omap2_enable_osc_ck(struct clk *clk) 267static int omap2_enable_osc_ck(struct clk *clk)
@@ -96,6 +286,11 @@ static void omap2_disable_osc_ck(struct clk *clk)
96 OMAP24XX_PRCM_CLKSRC_CTRL); 286 OMAP24XX_PRCM_CLKSRC_CTRL);
97} 287}
98 288
289static const struct clkops clkops_oscck = {
290 .enable = &omap2_enable_osc_ck,
291 .disable = &omap2_disable_osc_ck,
292};
293
99#ifdef OLD_CK 294#ifdef OLD_CK
100/* Recalculate SYST_CLK */ 295/* Recalculate SYST_CLK */
101static void omap2_sys_clk_recalc(struct clk * clk) 296static void omap2_sys_clk_recalc(struct clk * clk)
@@ -149,11 +344,16 @@ static void omap2_clk_fixed_disable(struct clk *clk)
149 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 344 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
150} 345}
151 346
347static const struct clkops clkops_fixed = {
348 .enable = &omap2_clk_fixed_enable,
349 .disable = &omap2_clk_fixed_disable,
350};
351
152/* 352/*
153 * Uses the current prcm set to tell if a rate is valid. 353 * Uses the current prcm set to tell if a rate is valid.
154 * You can go slower, but not faster within a given rate set. 354 * You can go slower, but not faster within a given rate set.
155 */ 355 */
156long omap2_dpllcore_round_rate(unsigned long target_rate) 356static long omap2_dpllcore_round_rate(unsigned long target_rate)
157{ 357{
158 u32 high, low, core_clk_src; 358 u32 high, low, core_clk_src;
159 359
@@ -182,11 +382,9 @@ long omap2_dpllcore_round_rate(unsigned long target_rate)
182 382
183} 383}
184 384
185static void omap2_dpllcore_recalc(struct clk *clk) 385static unsigned long omap2_dpllcore_recalc(struct clk *clk)
186{ 386{
187 clk->rate = omap2_get_dpll_rate_24xx(clk); 387 return omap2xxx_clk_get_core_rate(clk);
188
189 propagate_rate(clk);
190} 388}
191 389
192static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) 390static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
@@ -195,22 +393,19 @@ static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
195 u32 bypass = 0; 393 u32 bypass = 0;
196 struct prcm_config tmpset; 394 struct prcm_config tmpset;
197 const struct dpll_data *dd; 395 const struct dpll_data *dd;
198 unsigned long flags;
199 int ret = -EINVAL;
200 396
201 local_irq_save(flags); 397 cur_rate = omap2xxx_clk_get_core_rate(&dpll_ck);
202 cur_rate = omap2_get_dpll_rate_24xx(&dpll_ck);
203 mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 398 mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
204 mult &= OMAP24XX_CORE_CLK_SRC_MASK; 399 mult &= OMAP24XX_CORE_CLK_SRC_MASK;
205 400
206 if ((rate == (cur_rate / 2)) && (mult == 2)) { 401 if ((rate == (cur_rate / 2)) && (mult == 2)) {
207 omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL, 1); 402 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1);
208 } else if ((rate == (cur_rate * 2)) && (mult == 1)) { 403 } else if ((rate == (cur_rate * 2)) && (mult == 1)) {
209 omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); 404 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
210 } else if (rate != cur_rate) { 405 } else if (rate != cur_rate) {
211 valid_rate = omap2_dpllcore_round_rate(rate); 406 valid_rate = omap2_dpllcore_round_rate(rate);
212 if (valid_rate != rate) 407 if (valid_rate != rate)
213 goto dpll_exit; 408 return -EINVAL;
214 409
215 if (mult == 1) 410 if (mult == 1)
216 low = curr_prcm_set->dpll_speed; 411 low = curr_prcm_set->dpll_speed;
@@ -219,7 +414,7 @@ static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
219 414
220 dd = clk->dpll_data; 415 dd = clk->dpll_data;
221 if (!dd) 416 if (!dd)
222 goto dpll_exit; 417 return -EINVAL;
223 418
224 tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg); 419 tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg);
225 tmpset.cm_clksel1_pll &= ~(dd->mult_mask | 420 tmpset.cm_clksel1_pll &= ~(dd->mult_mask |
@@ -245,22 +440,19 @@ static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
245 if (rate == curr_prcm_set->xtal_speed) /* If asking for 1-1 */ 440 if (rate == curr_prcm_set->xtal_speed) /* If asking for 1-1 */
246 bypass = 1; 441 bypass = 1;
247 442
248 omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); /* For init_mem */ 443 /* For omap2xxx_sdrc_init_params() */
444 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
249 445
250 /* Force dll lock mode */ 446 /* Force dll lock mode */
251 omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr, 447 omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr,
252 bypass); 448 bypass);
253 449
254 /* Errata: ret dll entry state */ 450 /* Errata: ret dll entry state */
255 omap2_init_memory_params(omap2_dll_force_needed()); 451 omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked());
256 omap2_reprogram_sdrc(done_rate, 0); 452 omap2xxx_sdrc_reprogram(done_rate, 0);
257 } 453 }
258 omap2_dpllcore_recalc(&dpll_ck);
259 ret = 0;
260 454
261dpll_exit: 455 return 0;
262 local_irq_restore(flags);
263 return(ret);
264} 456}
265 457
266/** 458/**
@@ -269,9 +461,9 @@ dpll_exit:
269 * 461 *
270 * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. 462 * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set.
271 */ 463 */
272static void omap2_table_mpu_recalc(struct clk *clk) 464static unsigned long omap2_table_mpu_recalc(struct clk *clk)
273{ 465{
274 clk->rate = curr_prcm_set->mpu_speed; 466 return curr_prcm_set->mpu_speed;
275} 467}
276 468
277/* 469/*
@@ -337,12 +529,12 @@ static int omap2_select_table_rate(struct clk *clk, unsigned long rate)
337 } 529 }
338 530
339 curr_prcm_set = prcm; 531 curr_prcm_set = prcm;
340 cur_rate = omap2_get_dpll_rate_24xx(&dpll_ck); 532 cur_rate = omap2xxx_clk_get_core_rate(&dpll_ck);
341 533
342 if (prcm->dpll_speed == cur_rate / 2) { 534 if (prcm->dpll_speed == cur_rate / 2) {
343 omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL, 1); 535 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1);
344 } else if (prcm->dpll_speed == cur_rate * 2) { 536 } else if (prcm->dpll_speed == cur_rate * 2) {
345 omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); 537 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
346 } else if (prcm->dpll_speed != cur_rate) { 538 } else if (prcm->dpll_speed != cur_rate) {
347 local_irq_save(flags); 539 local_irq_save(flags);
348 540
@@ -366,27 +558,67 @@ static int omap2_select_table_rate(struct clk *clk, unsigned long rate)
366 558
367 /* Major subsystem dividers */ 559 /* Major subsystem dividers */
368 tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; 560 tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK;
369 cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, CM_CLKSEL1); 561 cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD,
562 CM_CLKSEL1);
563
370 if (cpu_is_omap2430()) 564 if (cpu_is_omap2430())
371 cm_write_mod_reg(prcm->cm_clksel_mdm, 565 cm_write_mod_reg(prcm->cm_clksel_mdm,
372 OMAP2430_MDM_MOD, CM_CLKSEL); 566 OMAP2430_MDM_MOD, CM_CLKSEL);
373 567
374 /* x2 to enter init_mem */ 568 /* x2 to enter omap2xxx_sdrc_init_params() */
375 omap2_reprogram_sdrc(CORE_CLK_SRC_DPLL_X2, 1); 569 omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1);
376 570
377 omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr, 571 omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr,
378 bypass); 572 bypass);
379 573
380 omap2_init_memory_params(omap2_dll_force_needed()); 574 omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked());
381 omap2_reprogram_sdrc(done_rate, 0); 575 omap2xxx_sdrc_reprogram(done_rate, 0);
382 576
383 local_irq_restore(flags); 577 local_irq_restore(flags);
384 } 578 }
385 omap2_dpllcore_recalc(&dpll_ck);
386 579
387 return 0; 580 return 0;
388} 581}
389 582
583#ifdef CONFIG_CPU_FREQ
584/*
585 * Walk PRCM rate table and fillout cpufreq freq_table
586 */
587static struct cpufreq_frequency_table freq_table[ARRAY_SIZE(rate_table)];
588
589void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
590{
591 struct prcm_config *prcm;
592 int i = 0;
593
594 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
595 if (!(prcm->flags & cpu_mask))
596 continue;
597 if (prcm->xtal_speed != sys_ck.rate)
598 continue;
599
600 /* don't put bypass rates in table */
601 if (prcm->dpll_speed == prcm->xtal_speed)
602 continue;
603
604 freq_table[i].index = i;
605 freq_table[i].frequency = prcm->mpu_speed / 1000;
606 i++;
607 }
608
609 if (i == 0) {
610 printk(KERN_WARNING "%s: failed to initialize frequency "
611 "table\n", __func__);
612 return;
613 }
614
615 freq_table[i].index = i;
616 freq_table[i].frequency = CPUFREQ_TABLE_END;
617
618 *table = &freq_table[0];
619}
620#endif
621
390static struct clk_functions omap2_clk_functions = { 622static struct clk_functions omap2_clk_functions = {
391 .clk_enable = omap2_clk_enable, 623 .clk_enable = omap2_clk_enable,
392 .clk_disable = omap2_clk_disable, 624 .clk_disable = omap2_clk_disable,
@@ -394,24 +626,27 @@ static struct clk_functions omap2_clk_functions = {
394 .clk_set_rate = omap2_clk_set_rate, 626 .clk_set_rate = omap2_clk_set_rate,
395 .clk_set_parent = omap2_clk_set_parent, 627 .clk_set_parent = omap2_clk_set_parent,
396 .clk_disable_unused = omap2_clk_disable_unused, 628 .clk_disable_unused = omap2_clk_disable_unused,
629#ifdef CONFIG_CPU_FREQ
630 .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table,
631#endif
397}; 632};
398 633
399static u32 omap2_get_apll_clkin(void) 634static u32 omap2_get_apll_clkin(void)
400{ 635{
401 u32 aplls, sclk = 0; 636 u32 aplls, srate = 0;
402 637
403 aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); 638 aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
404 aplls &= OMAP24XX_APLLS_CLKIN_MASK; 639 aplls &= OMAP24XX_APLLS_CLKIN_MASK;
405 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; 640 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT;
406 641
407 if (aplls == APLLS_CLKIN_19_2MHZ) 642 if (aplls == APLLS_CLKIN_19_2MHZ)
408 sclk = 19200000; 643 srate = 19200000;
409 else if (aplls == APLLS_CLKIN_13MHZ) 644 else if (aplls == APLLS_CLKIN_13MHZ)
410 sclk = 13000000; 645 srate = 13000000;
411 else if (aplls == APLLS_CLKIN_12MHZ) 646 else if (aplls == APLLS_CLKIN_12MHZ)
412 sclk = 12000000; 647 srate = 12000000;
413 648
414 return sclk; 649 return srate;
415} 650}
416 651
417static u32 omap2_get_sysclkdiv(void) 652static u32 omap2_get_sysclkdiv(void)
@@ -425,16 +660,14 @@ static u32 omap2_get_sysclkdiv(void)
425 return div; 660 return div;
426} 661}
427 662
428static void omap2_osc_clk_recalc(struct clk *clk) 663static unsigned long omap2_osc_clk_recalc(struct clk *clk)
429{ 664{
430 clk->rate = omap2_get_apll_clkin() * omap2_get_sysclkdiv(); 665 return omap2_get_apll_clkin() * omap2_get_sysclkdiv();
431 propagate_rate(clk);
432} 666}
433 667
434static void omap2_sys_clk_recalc(struct clk *clk) 668static unsigned long omap2_sys_clk_recalc(struct clk *clk)
435{ 669{
436 clk->rate = clk->parent->rate / omap2_get_sysclkdiv(); 670 return clk->parent->rate / omap2_get_sysclkdiv();
437 propagate_rate(clk);
438} 671}
439 672
440/* 673/*
@@ -460,7 +693,7 @@ static int __init omap2_clk_arch_init(void)
460 if (!mpurate) 693 if (!mpurate)
461 return -EINVAL; 694 return -EINVAL;
462 695
463 if (omap2_select_table_rate(&virt_prcm_set, mpurate)) 696 if (clk_set_rate(&virt_prcm_set, mpurate))
464 printk(KERN_ERR "Could not find matching MPU rate\n"); 697 printk(KERN_ERR "Could not find matching MPU rate\n");
465 698
466 recalculate_root_clocks(); 699 recalculate_root_clocks();
@@ -477,8 +710,8 @@ arch_initcall(omap2_clk_arch_init);
477int __init omap2_clk_init(void) 710int __init omap2_clk_init(void)
478{ 711{
479 struct prcm_config *prcm; 712 struct prcm_config *prcm;
480 struct clk **clkp; 713 struct omap_clk *c;
481 u32 clkrate; 714 u32 clkrate, cpu_mask;
482 715
483 if (cpu_is_omap242x()) 716 if (cpu_is_omap242x())
484 cpu_mask = RATE_IN_242X; 717 cpu_mask = RATE_IN_242X;
@@ -487,26 +720,28 @@ int __init omap2_clk_init(void)
487 720
488 clk_init(&omap2_clk_functions); 721 clk_init(&omap2_clk_functions);
489 722
490 omap2_osc_clk_recalc(&osc_ck); 723 osc_ck.rate = omap2_osc_clk_recalc(&osc_ck);
491 omap2_sys_clk_recalc(&sys_ck); 724 propagate_rate(&osc_ck);
725 sys_ck.rate = omap2_sys_clk_recalc(&sys_ck);
726 propagate_rate(&sys_ck);
492 727
493 for (clkp = onchip_24xx_clks; 728 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
494 clkp < onchip_24xx_clks + ARRAY_SIZE(onchip_24xx_clks); 729 clk_init_one(c->lk.clk);
495 clkp++) {
496 730
497 if ((*clkp)->flags & CLOCK_IN_OMAP242X && cpu_is_omap2420()) { 731 cpu_mask = 0;
498 clk_register(*clkp); 732 if (cpu_is_omap2420())
499 continue; 733 cpu_mask |= CK_242X;
500 } 734 if (cpu_is_omap2430())
735 cpu_mask |= CK_243X;
501 736
502 if ((*clkp)->flags & CLOCK_IN_OMAP243X && cpu_is_omap2430()) { 737 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
503 clk_register(*clkp); 738 if (c->cpu & cpu_mask) {
504 continue; 739 clkdev_add(&c->lk);
740 clk_register(c->lk.clk);
505 } 741 }
506 }
507 742
508 /* Check the MPU rate set by bootloader */ 743 /* Check the MPU rate set by bootloader */
509 clkrate = omap2_get_dpll_rate_24xx(&dpll_ck); 744 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
510 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 745 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
511 if (!(prcm->flags & cpu_mask)) 746 if (!(prcm->flags & cpu_mask))
512 continue; 747 continue;
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
index ad6d98d177c5..33c3e5b14323 100644
--- a/arch/arm/mach-omap2/clock24xx.h
+++ b/arch/arm/mach-omap2/clock24xx.h
@@ -24,17 +24,13 @@
24#include "cm-regbits-24xx.h" 24#include "cm-regbits-24xx.h"
25#include "sdrc.h" 25#include "sdrc.h"
26 26
27static void omap2_table_mpu_recalc(struct clk *clk); 27static unsigned long omap2_table_mpu_recalc(struct clk *clk);
28static int omap2_select_table_rate(struct clk *clk, unsigned long rate); 28static int omap2_select_table_rate(struct clk *clk, unsigned long rate);
29static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); 29static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate);
30static void omap2_sys_clk_recalc(struct clk *clk); 30static unsigned long omap2_sys_clk_recalc(struct clk *clk);
31static void omap2_osc_clk_recalc(struct clk *clk); 31static unsigned long omap2_osc_clk_recalc(struct clk *clk);
32static void omap2_sys_clk_recalc(struct clk *clk); 32static unsigned long omap2_sys_clk_recalc(struct clk *clk);
33static void omap2_dpllcore_recalc(struct clk *clk); 33static unsigned long omap2_dpllcore_recalc(struct clk *clk);
34static int omap2_clk_fixed_enable(struct clk *clk);
35static void omap2_clk_fixed_disable(struct clk *clk);
36static int omap2_enable_osc_ck(struct clk *clk);
37static void omap2_disable_osc_ck(struct clk *clk);
38static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); 34static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate);
39 35
40/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 36/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated.
@@ -623,41 +619,35 @@ static struct prcm_config rate_table[] = {
623/* Base external input clocks */ 619/* Base external input clocks */
624static struct clk func_32k_ck = { 620static struct clk func_32k_ck = {
625 .name = "func_32k_ck", 621 .name = "func_32k_ck",
622 .ops = &clkops_null,
626 .rate = 32000, 623 .rate = 32000,
627 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 624 .flags = RATE_FIXED,
628 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
629 .clkdm_name = "wkup_clkdm", 625 .clkdm_name = "wkup_clkdm",
630 .recalc = &propagate_rate,
631}; 626};
632 627
633/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ 628/* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */
634static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ 629static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */
635 .name = "osc_ck", 630 .name = "osc_ck",
636 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 631 .ops = &clkops_oscck,
637 RATE_PROPAGATES,
638 .clkdm_name = "wkup_clkdm", 632 .clkdm_name = "wkup_clkdm",
639 .enable = &omap2_enable_osc_ck,
640 .disable = &omap2_disable_osc_ck,
641 .recalc = &omap2_osc_clk_recalc, 633 .recalc = &omap2_osc_clk_recalc,
642}; 634};
643 635
644/* Without modem likely 12MHz, with modem likely 13MHz */ 636/* Without modem likely 12MHz, with modem likely 13MHz */
645static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */ 637static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */
646 .name = "sys_ck", /* ~ ref_clk also */ 638 .name = "sys_ck", /* ~ ref_clk also */
639 .ops = &clkops_null,
647 .parent = &osc_ck, 640 .parent = &osc_ck,
648 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
649 ALWAYS_ENABLED | RATE_PROPAGATES,
650 .clkdm_name = "wkup_clkdm", 641 .clkdm_name = "wkup_clkdm",
651 .recalc = &omap2_sys_clk_recalc, 642 .recalc = &omap2_sys_clk_recalc,
652}; 643};
653 644
654static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ 645static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */
655 .name = "alt_ck", 646 .name = "alt_ck",
647 .ops = &clkops_null,
656 .rate = 54000000, 648 .rate = 54000000,
657 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 649 .flags = RATE_FIXED,
658 RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES,
659 .clkdm_name = "wkup_clkdm", 650 .clkdm_name = "wkup_clkdm",
660 .recalc = &propagate_rate,
661}; 651};
662 652
663/* 653/*
@@ -673,7 +663,12 @@ static struct dpll_data dpll_dd = {
673 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 663 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
674 .mult_mask = OMAP24XX_DPLL_MULT_MASK, 664 .mult_mask = OMAP24XX_DPLL_MULT_MASK,
675 .div1_mask = OMAP24XX_DPLL_DIV_MASK, 665 .div1_mask = OMAP24XX_DPLL_DIV_MASK,
666 .clk_bypass = &sys_ck,
667 .clk_ref = &sys_ck,
668 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
669 .enable_mask = OMAP24XX_EN_DPLL_MASK,
676 .max_multiplier = 1024, 670 .max_multiplier = 1024,
671 .min_divider = 1,
677 .max_divider = 16, 672 .max_divider = 16,
678 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE 673 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
679}; 674};
@@ -684,10 +679,9 @@ static struct dpll_data dpll_dd = {
684 */ 679 */
685static struct clk dpll_ck = { 680static struct clk dpll_ck = {
686 .name = "dpll_ck", 681 .name = "dpll_ck",
682 .ops = &clkops_null,
687 .parent = &sys_ck, /* Can be func_32k also */ 683 .parent = &sys_ck, /* Can be func_32k also */
688 .dpll_data = &dpll_dd, 684 .dpll_data = &dpll_dd,
689 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
690 RATE_PROPAGATES | ALWAYS_ENABLED,
691 .clkdm_name = "wkup_clkdm", 685 .clkdm_name = "wkup_clkdm",
692 .recalc = &omap2_dpllcore_recalc, 686 .recalc = &omap2_dpllcore_recalc,
693 .set_rate = &omap2_reprogram_dpllcore, 687 .set_rate = &omap2_reprogram_dpllcore,
@@ -695,30 +689,24 @@ static struct clk dpll_ck = {
695 689
696static struct clk apll96_ck = { 690static struct clk apll96_ck = {
697 .name = "apll96_ck", 691 .name = "apll96_ck",
692 .ops = &clkops_fixed,
698 .parent = &sys_ck, 693 .parent = &sys_ck,
699 .rate = 96000000, 694 .rate = 96000000,
700 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 695 .flags = RATE_FIXED | ENABLE_ON_INIT,
701 RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
702 .clkdm_name = "wkup_clkdm", 696 .clkdm_name = "wkup_clkdm",
703 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 697 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
704 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, 698 .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT,
705 .enable = &omap2_clk_fixed_enable,
706 .disable = &omap2_clk_fixed_disable,
707 .recalc = &propagate_rate,
708}; 699};
709 700
710static struct clk apll54_ck = { 701static struct clk apll54_ck = {
711 .name = "apll54_ck", 702 .name = "apll54_ck",
703 .ops = &clkops_fixed,
712 .parent = &sys_ck, 704 .parent = &sys_ck,
713 .rate = 54000000, 705 .rate = 54000000,
714 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 706 .flags = RATE_FIXED | ENABLE_ON_INIT,
715 RATE_FIXED | RATE_PROPAGATES | ENABLE_ON_INIT,
716 .clkdm_name = "wkup_clkdm", 707 .clkdm_name = "wkup_clkdm",
717 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 708 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
718 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, 709 .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT,
719 .enable = &omap2_clk_fixed_enable,
720 .disable = &omap2_clk_fixed_disable,
721 .recalc = &propagate_rate,
722}; 710};
723 711
724/* 712/*
@@ -745,9 +733,8 @@ static const struct clksel func_54m_clksel[] = {
745 733
746static struct clk func_54m_ck = { 734static struct clk func_54m_ck = {
747 .name = "func_54m_ck", 735 .name = "func_54m_ck",
736 .ops = &clkops_null,
748 .parent = &apll54_ck, /* can also be alt_clk */ 737 .parent = &apll54_ck, /* can also be alt_clk */
749 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
750 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
751 .clkdm_name = "wkup_clkdm", 738 .clkdm_name = "wkup_clkdm",
752 .init = &omap2_init_clksel_parent, 739 .init = &omap2_init_clksel_parent,
753 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 740 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
@@ -758,9 +745,8 @@ static struct clk func_54m_ck = {
758 745
759static struct clk core_ck = { 746static struct clk core_ck = {
760 .name = "core_ck", 747 .name = "core_ck",
748 .ops = &clkops_null,
761 .parent = &dpll_ck, /* can also be 32k */ 749 .parent = &dpll_ck, /* can also be 32k */
762 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
763 ALWAYS_ENABLED | RATE_PROPAGATES,
764 .clkdm_name = "wkup_clkdm", 750 .clkdm_name = "wkup_clkdm",
765 .recalc = &followparent_recalc, 751 .recalc = &followparent_recalc,
766}; 752};
@@ -785,9 +771,8 @@ static const struct clksel func_96m_clksel[] = {
785/* The parent of this clock is not selectable on 2420. */ 771/* The parent of this clock is not selectable on 2420. */
786static struct clk func_96m_ck = { 772static struct clk func_96m_ck = {
787 .name = "func_96m_ck", 773 .name = "func_96m_ck",
774 .ops = &clkops_null,
788 .parent = &apll96_ck, 775 .parent = &apll96_ck,
789 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
790 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
791 .clkdm_name = "wkup_clkdm", 776 .clkdm_name = "wkup_clkdm",
792 .init = &omap2_init_clksel_parent, 777 .init = &omap2_init_clksel_parent,
793 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 778 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
@@ -818,9 +803,8 @@ static const struct clksel func_48m_clksel[] = {
818 803
819static struct clk func_48m_ck = { 804static struct clk func_48m_ck = {
820 .name = "func_48m_ck", 805 .name = "func_48m_ck",
806 .ops = &clkops_null,
821 .parent = &apll96_ck, /* 96M or Alt */ 807 .parent = &apll96_ck, /* 96M or Alt */
822 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
823 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
824 .clkdm_name = "wkup_clkdm", 808 .clkdm_name = "wkup_clkdm",
825 .init = &omap2_init_clksel_parent, 809 .init = &omap2_init_clksel_parent,
826 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 810 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
@@ -833,10 +817,9 @@ static struct clk func_48m_ck = {
833 817
834static struct clk func_12m_ck = { 818static struct clk func_12m_ck = {
835 .name = "func_12m_ck", 819 .name = "func_12m_ck",
820 .ops = &clkops_null,
836 .parent = &func_48m_ck, 821 .parent = &func_48m_ck,
837 .fixed_div = 4, 822 .fixed_div = 4,
838 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
839 RATE_PROPAGATES | PARENT_CONTROLS_CLOCK,
840 .clkdm_name = "wkup_clkdm", 823 .clkdm_name = "wkup_clkdm",
841 .recalc = &omap2_fixed_divisor_recalc, 824 .recalc = &omap2_fixed_divisor_recalc,
842}; 825};
@@ -844,8 +827,8 @@ static struct clk func_12m_ck = {
844/* Secure timer, only available in secure mode */ 827/* Secure timer, only available in secure mode */
845static struct clk wdt1_osc_ck = { 828static struct clk wdt1_osc_ck = {
846 .name = "ck_wdt1_osc", 829 .name = "ck_wdt1_osc",
830 .ops = &clkops_null, /* RMK: missing? */
847 .parent = &osc_ck, 831 .parent = &osc_ck,
848 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
849 .recalc = &followparent_recalc, 832 .recalc = &followparent_recalc,
850}; 833};
851 834
@@ -887,9 +870,8 @@ static const struct clksel common_clkout_src_clksel[] = {
887 870
888static struct clk sys_clkout_src = { 871static struct clk sys_clkout_src = {
889 .name = "sys_clkout_src", 872 .name = "sys_clkout_src",
873 .ops = &clkops_omap2_dflt,
890 .parent = &func_54m_ck, 874 .parent = &func_54m_ck,
891 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
892 RATE_PROPAGATES,
893 .clkdm_name = "wkup_clkdm", 875 .clkdm_name = "wkup_clkdm",
894 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, 876 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
895 .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT, 877 .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT,
@@ -918,9 +900,8 @@ static const struct clksel sys_clkout_clksel[] = {
918 900
919static struct clk sys_clkout = { 901static struct clk sys_clkout = {
920 .name = "sys_clkout", 902 .name = "sys_clkout",
903 .ops = &clkops_null,
921 .parent = &sys_clkout_src, 904 .parent = &sys_clkout_src,
922 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
923 PARENT_CONTROLS_CLOCK,
924 .clkdm_name = "wkup_clkdm", 905 .clkdm_name = "wkup_clkdm",
925 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, 906 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
926 .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK, 907 .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK,
@@ -933,8 +914,8 @@ static struct clk sys_clkout = {
933/* In 2430, new in 2420 ES2 */ 914/* In 2430, new in 2420 ES2 */
934static struct clk sys_clkout2_src = { 915static struct clk sys_clkout2_src = {
935 .name = "sys_clkout2_src", 916 .name = "sys_clkout2_src",
917 .ops = &clkops_omap2_dflt,
936 .parent = &func_54m_ck, 918 .parent = &func_54m_ck,
937 .flags = CLOCK_IN_OMAP242X | RATE_PROPAGATES,
938 .clkdm_name = "wkup_clkdm", 919 .clkdm_name = "wkup_clkdm",
939 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, 920 .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
940 .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT, 921 .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT,
@@ -955,8 +936,8 @@ static const struct clksel sys_clkout2_clksel[] = {
955/* In 2430, new in 2420 ES2 */ 936/* In 2430, new in 2420 ES2 */
956static struct clk sys_clkout2 = { 937static struct clk sys_clkout2 = {
957 .name = "sys_clkout2", 938 .name = "sys_clkout2",
939 .ops = &clkops_null,
958 .parent = &sys_clkout2_src, 940 .parent = &sys_clkout2_src,
959 .flags = CLOCK_IN_OMAP242X | PARENT_CONTROLS_CLOCK,
960 .clkdm_name = "wkup_clkdm", 941 .clkdm_name = "wkup_clkdm",
961 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, 942 .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL,
962 .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK, 943 .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK,
@@ -968,8 +949,8 @@ static struct clk sys_clkout2 = {
968 949
969static struct clk emul_ck = { 950static struct clk emul_ck = {
970 .name = "emul_ck", 951 .name = "emul_ck",
952 .ops = &clkops_omap2_dflt,
971 .parent = &func_54m_ck, 953 .parent = &func_54m_ck,
972 .flags = CLOCK_IN_OMAP242X,
973 .clkdm_name = "wkup_clkdm", 954 .clkdm_name = "wkup_clkdm",
974 .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL, 955 .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL,
975 .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, 956 .enable_bit = OMAP24XX_EMULATION_EN_SHIFT,
@@ -1003,10 +984,9 @@ static const struct clksel mpu_clksel[] = {
1003 984
1004static struct clk mpu_ck = { /* Control cpu */ 985static struct clk mpu_ck = { /* Control cpu */
1005 .name = "mpu_ck", 986 .name = "mpu_ck",
987 .ops = &clkops_null,
1006 .parent = &core_ck, 988 .parent = &core_ck,
1007 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 989 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1008 ALWAYS_ENABLED | DELAYED_APP |
1009 CONFIG_PARTICIPANT | RATE_PROPAGATES,
1010 .clkdm_name = "mpu_clkdm", 990 .clkdm_name = "mpu_clkdm",
1011 .init = &omap2_init_clksel_parent, 991 .init = &omap2_init_clksel_parent,
1012 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL), 992 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL),
@@ -1046,9 +1026,9 @@ static const struct clksel dsp_fck_clksel[] = {
1046 1026
1047static struct clk dsp_fck = { 1027static struct clk dsp_fck = {
1048 .name = "dsp_fck", 1028 .name = "dsp_fck",
1029 .ops = &clkops_omap2_dflt_wait,
1049 .parent = &core_ck, 1030 .parent = &core_ck,
1050 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP | 1031 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1051 CONFIG_PARTICIPANT | RATE_PROPAGATES,
1052 .clkdm_name = "dsp_clkdm", 1032 .clkdm_name = "dsp_clkdm",
1053 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), 1033 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1054 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, 1034 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
@@ -1076,9 +1056,9 @@ static const struct clksel dsp_irate_ick_clksel[] = {
1076/* This clock does not exist as such in the TRM. */ 1056/* This clock does not exist as such in the TRM. */
1077static struct clk dsp_irate_ick = { 1057static struct clk dsp_irate_ick = {
1078 .name = "dsp_irate_ick", 1058 .name = "dsp_irate_ick",
1059 .ops = &clkops_null,
1079 .parent = &dsp_fck, 1060 .parent = &dsp_fck,
1080 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | DELAYED_APP | 1061 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1081 CONFIG_PARTICIPANT | PARENT_CONTROLS_CLOCK,
1082 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), 1062 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
1083 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, 1063 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
1084 .clksel = dsp_irate_ick_clksel, 1064 .clksel = dsp_irate_ick_clksel,
@@ -1090,8 +1070,9 @@ static struct clk dsp_irate_ick = {
1090/* 2420 only */ 1070/* 2420 only */
1091static struct clk dsp_ick = { 1071static struct clk dsp_ick = {
1092 .name = "dsp_ick", /* apparently ipi and isp */ 1072 .name = "dsp_ick", /* apparently ipi and isp */
1073 .ops = &clkops_omap2_dflt_wait,
1093 .parent = &dsp_irate_ick, 1074 .parent = &dsp_irate_ick,
1094 .flags = CLOCK_IN_OMAP242X | DELAYED_APP | CONFIG_PARTICIPANT, 1075 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1095 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), 1076 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
1096 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ 1077 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */
1097}; 1078};
@@ -1099,8 +1080,9 @@ static struct clk dsp_ick = {
1099/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ 1080/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
1100static struct clk iva2_1_ick = { 1081static struct clk iva2_1_ick = {
1101 .name = "iva2_1_ick", 1082 .name = "iva2_1_ick",
1083 .ops = &clkops_omap2_dflt_wait,
1102 .parent = &dsp_irate_ick, 1084 .parent = &dsp_irate_ick,
1103 .flags = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT, 1085 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1104 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), 1086 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1105 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, 1087 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
1106}; 1088};
@@ -1112,9 +1094,9 @@ static struct clk iva2_1_ick = {
1112 */ 1094 */
1113static struct clk iva1_ifck = { 1095static struct clk iva1_ifck = {
1114 .name = "iva1_ifck", 1096 .name = "iva1_ifck",
1097 .ops = &clkops_omap2_dflt_wait,
1115 .parent = &core_ck, 1098 .parent = &core_ck,
1116 .flags = CLOCK_IN_OMAP242X | CONFIG_PARTICIPANT | 1099 .flags = CONFIG_PARTICIPANT | DELAYED_APP,
1117 RATE_PROPAGATES | DELAYED_APP,
1118 .clkdm_name = "iva1_clkdm", 1100 .clkdm_name = "iva1_clkdm",
1119 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), 1101 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1120 .enable_bit = OMAP2420_EN_IVA_COP_SHIFT, 1102 .enable_bit = OMAP2420_EN_IVA_COP_SHIFT,
@@ -1129,8 +1111,8 @@ static struct clk iva1_ifck = {
1129/* IVA1 mpu/int/i/f clocks are /2 of parent */ 1111/* IVA1 mpu/int/i/f clocks are /2 of parent */
1130static struct clk iva1_mpu_int_ifck = { 1112static struct clk iva1_mpu_int_ifck = {
1131 .name = "iva1_mpu_int_ifck", 1113 .name = "iva1_mpu_int_ifck",
1114 .ops = &clkops_omap2_dflt_wait,
1132 .parent = &iva1_ifck, 1115 .parent = &iva1_ifck,
1133 .flags = CLOCK_IN_OMAP242X,
1134 .clkdm_name = "iva1_clkdm", 1116 .clkdm_name = "iva1_clkdm",
1135 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), 1117 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
1136 .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, 1118 .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT,
@@ -1175,10 +1157,9 @@ static const struct clksel core_l3_clksel[] = {
1175 1157
1176static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */ 1158static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */
1177 .name = "core_l3_ck", 1159 .name = "core_l3_ck",
1160 .ops = &clkops_null,
1178 .parent = &core_ck, 1161 .parent = &core_ck,
1179 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 1162 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1180 ALWAYS_ENABLED | DELAYED_APP |
1181 CONFIG_PARTICIPANT | RATE_PROPAGATES,
1182 .clkdm_name = "core_l3_clkdm", 1163 .clkdm_name = "core_l3_clkdm",
1183 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), 1164 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1184 .clksel_mask = OMAP24XX_CLKSEL_L3_MASK, 1165 .clksel_mask = OMAP24XX_CLKSEL_L3_MASK,
@@ -1204,9 +1185,9 @@ static const struct clksel usb_l4_ick_clksel[] = {
1204/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ 1185/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
1205static struct clk usb_l4_ick = { /* FS-USB interface clock */ 1186static struct clk usb_l4_ick = { /* FS-USB interface clock */
1206 .name = "usb_l4_ick", 1187 .name = "usb_l4_ick",
1188 .ops = &clkops_omap2_dflt_wait,
1207 .parent = &core_l3_ck, 1189 .parent = &core_l3_ck,
1208 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 1190 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1209 DELAYED_APP | CONFIG_PARTICIPANT,
1210 .clkdm_name = "core_l4_clkdm", 1191 .clkdm_name = "core_l4_clkdm",
1211 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1192 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1212 .enable_bit = OMAP24XX_EN_USB_SHIFT, 1193 .enable_bit = OMAP24XX_EN_USB_SHIFT,
@@ -1238,9 +1219,9 @@ static const struct clksel l4_clksel[] = {
1238 1219
1239static struct clk l4_ck = { /* used both as an ick and fck */ 1220static struct clk l4_ck = { /* used both as an ick and fck */
1240 .name = "l4_ck", 1221 .name = "l4_ck",
1222 .ops = &clkops_null,
1241 .parent = &core_l3_ck, 1223 .parent = &core_l3_ck,
1242 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 1224 .flags = DELAYED_APP,
1243 ALWAYS_ENABLED | DELAYED_APP | RATE_PROPAGATES,
1244 .clkdm_name = "core_l4_clkdm", 1225 .clkdm_name = "core_l4_clkdm",
1245 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), 1226 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
1246 .clksel_mask = OMAP24XX_CLKSEL_L4_MASK, 1227 .clksel_mask = OMAP24XX_CLKSEL_L4_MASK,
@@ -1276,9 +1257,9 @@ static const struct clksel ssi_ssr_sst_fck_clksel[] = {
1276 1257
1277static struct clk ssi_ssr_sst_fck = { 1258static struct clk ssi_ssr_sst_fck = {
1278 .name = "ssi_fck", 1259 .name = "ssi_fck",
1260 .ops = &clkops_omap2_dflt_wait,
1279 .parent = &core_ck, 1261 .parent = &core_ck,
1280 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 1262 .flags = DELAYED_APP,
1281 DELAYED_APP,
1282 .clkdm_name = "core_l3_clkdm", 1263 .clkdm_name = "core_l3_clkdm",
1283 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1264 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1284 .enable_bit = OMAP24XX_EN_SSI_SHIFT, 1265 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
@@ -1290,6 +1271,20 @@ static struct clk ssi_ssr_sst_fck = {
1290 .set_rate = &omap2_clksel_set_rate 1271 .set_rate = &omap2_clksel_set_rate
1291}; 1272};
1292 1273
1274/*
1275 * Presumably this is the same as SSI_ICLK.
1276 * TRM contradicts itself on what clockdomain SSI_ICLK is in
1277 */
1278static struct clk ssi_l4_ick = {
1279 .name = "ssi_l4_ick",
1280 .ops = &clkops_omap2_dflt_wait,
1281 .parent = &l4_ck,
1282 .clkdm_name = "core_l4_clkdm",
1283 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1284 .enable_bit = OMAP24XX_EN_SSI_SHIFT,
1285 .recalc = &followparent_recalc,
1286};
1287
1293 1288
1294/* 1289/*
1295 * GFX clock domain 1290 * GFX clock domain
@@ -1312,8 +1307,8 @@ static const struct clksel gfx_fck_clksel[] = {
1312 1307
1313static struct clk gfx_3d_fck = { 1308static struct clk gfx_3d_fck = {
1314 .name = "gfx_3d_fck", 1309 .name = "gfx_3d_fck",
1310 .ops = &clkops_omap2_dflt_wait,
1315 .parent = &core_l3_ck, 1311 .parent = &core_l3_ck,
1316 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1317 .clkdm_name = "gfx_clkdm", 1312 .clkdm_name = "gfx_clkdm",
1318 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), 1313 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1319 .enable_bit = OMAP24XX_EN_3D_SHIFT, 1314 .enable_bit = OMAP24XX_EN_3D_SHIFT,
@@ -1327,8 +1322,8 @@ static struct clk gfx_3d_fck = {
1327 1322
1328static struct clk gfx_2d_fck = { 1323static struct clk gfx_2d_fck = {
1329 .name = "gfx_2d_fck", 1324 .name = "gfx_2d_fck",
1325 .ops = &clkops_omap2_dflt_wait,
1330 .parent = &core_l3_ck, 1326 .parent = &core_l3_ck,
1331 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1332 .clkdm_name = "gfx_clkdm", 1327 .clkdm_name = "gfx_clkdm",
1333 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), 1328 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1334 .enable_bit = OMAP24XX_EN_2D_SHIFT, 1329 .enable_bit = OMAP24XX_EN_2D_SHIFT,
@@ -1342,8 +1337,8 @@ static struct clk gfx_2d_fck = {
1342 1337
1343static struct clk gfx_ick = { 1338static struct clk gfx_ick = {
1344 .name = "gfx_ick", /* From l3 */ 1339 .name = "gfx_ick", /* From l3 */
1340 .ops = &clkops_omap2_dflt_wait,
1345 .parent = &core_l3_ck, 1341 .parent = &core_l3_ck,
1346 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1347 .clkdm_name = "gfx_clkdm", 1342 .clkdm_name = "gfx_clkdm",
1348 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), 1343 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
1349 .enable_bit = OMAP_EN_GFX_SHIFT, 1344 .enable_bit = OMAP_EN_GFX_SHIFT,
@@ -1372,8 +1367,9 @@ static const struct clksel mdm_ick_clksel[] = {
1372 1367
1373static struct clk mdm_ick = { /* used both as a ick and fck */ 1368static struct clk mdm_ick = { /* used both as a ick and fck */
1374 .name = "mdm_ick", 1369 .name = "mdm_ick",
1370 .ops = &clkops_omap2_dflt_wait,
1375 .parent = &core_ck, 1371 .parent = &core_ck,
1376 .flags = CLOCK_IN_OMAP243X | DELAYED_APP | CONFIG_PARTICIPANT, 1372 .flags = DELAYED_APP | CONFIG_PARTICIPANT,
1377 .clkdm_name = "mdm_clkdm", 1373 .clkdm_name = "mdm_clkdm",
1378 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), 1374 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
1379 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT, 1375 .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT,
@@ -1387,8 +1383,8 @@ static struct clk mdm_ick = { /* used both as a ick and fck */
1387 1383
1388static struct clk mdm_osc_ck = { 1384static struct clk mdm_osc_ck = {
1389 .name = "mdm_osc_ck", 1385 .name = "mdm_osc_ck",
1386 .ops = &clkops_omap2_dflt_wait,
1390 .parent = &osc_ck, 1387 .parent = &osc_ck,
1391 .flags = CLOCK_IN_OMAP243X,
1392 .clkdm_name = "mdm_clkdm", 1388 .clkdm_name = "mdm_clkdm",
1393 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), 1389 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
1394 .enable_bit = OMAP2430_EN_OSC_SHIFT, 1390 .enable_bit = OMAP2430_EN_OSC_SHIFT,
@@ -1432,8 +1428,8 @@ static const struct clksel dss1_fck_clksel[] = {
1432 1428
1433static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ 1429static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
1434 .name = "dss_ick", 1430 .name = "dss_ick",
1431 .ops = &clkops_omap2_dflt,
1435 .parent = &l4_ck, /* really both l3 and l4 */ 1432 .parent = &l4_ck, /* really both l3 and l4 */
1436 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1437 .clkdm_name = "dss_clkdm", 1433 .clkdm_name = "dss_clkdm",
1438 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1434 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1439 .enable_bit = OMAP24XX_EN_DSS1_SHIFT, 1435 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
@@ -1442,9 +1438,9 @@ static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
1442 1438
1443static struct clk dss1_fck = { 1439static struct clk dss1_fck = {
1444 .name = "dss1_fck", 1440 .name = "dss1_fck",
1441 .ops = &clkops_omap2_dflt,
1445 .parent = &core_ck, /* Core or sys */ 1442 .parent = &core_ck, /* Core or sys */
1446 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 1443 .flags = DELAYED_APP,
1447 DELAYED_APP,
1448 .clkdm_name = "dss_clkdm", 1444 .clkdm_name = "dss_clkdm",
1449 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1445 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1450 .enable_bit = OMAP24XX_EN_DSS1_SHIFT, 1446 .enable_bit = OMAP24XX_EN_DSS1_SHIFT,
@@ -1475,9 +1471,9 @@ static const struct clksel dss2_fck_clksel[] = {
1475 1471
1476static struct clk dss2_fck = { /* Alt clk used in power management */ 1472static struct clk dss2_fck = { /* Alt clk used in power management */
1477 .name = "dss2_fck", 1473 .name = "dss2_fck",
1474 .ops = &clkops_omap2_dflt,
1478 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ 1475 .parent = &sys_ck, /* fixed at sys_ck or 48MHz */
1479 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 1476 .flags = DELAYED_APP,
1480 DELAYED_APP,
1481 .clkdm_name = "dss_clkdm", 1477 .clkdm_name = "dss_clkdm",
1482 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1478 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1483 .enable_bit = OMAP24XX_EN_DSS2_SHIFT, 1479 .enable_bit = OMAP24XX_EN_DSS2_SHIFT,
@@ -1490,8 +1486,8 @@ static struct clk dss2_fck = { /* Alt clk used in power management */
1490 1486
1491static struct clk dss_54m_fck = { /* Alt clk used in power management */ 1487static struct clk dss_54m_fck = { /* Alt clk used in power management */
1492 .name = "dss_54m_fck", /* 54m tv clk */ 1488 .name = "dss_54m_fck", /* 54m tv clk */
1489 .ops = &clkops_omap2_dflt_wait,
1493 .parent = &func_54m_ck, 1490 .parent = &func_54m_ck,
1494 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1495 .clkdm_name = "dss_clkdm", 1491 .clkdm_name = "dss_clkdm",
1496 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1492 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1497 .enable_bit = OMAP24XX_EN_TV_SHIFT, 1493 .enable_bit = OMAP24XX_EN_TV_SHIFT,
@@ -1518,8 +1514,8 @@ static const struct clksel omap24xx_gpt_clksel[] = {
1518 1514
1519static struct clk gpt1_ick = { 1515static struct clk gpt1_ick = {
1520 .name = "gpt1_ick", 1516 .name = "gpt1_ick",
1517 .ops = &clkops_omap2_dflt_wait,
1521 .parent = &l4_ck, 1518 .parent = &l4_ck,
1522 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1523 .clkdm_name = "core_l4_clkdm", 1519 .clkdm_name = "core_l4_clkdm",
1524 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1520 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1525 .enable_bit = OMAP24XX_EN_GPT1_SHIFT, 1521 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
@@ -1528,8 +1524,8 @@ static struct clk gpt1_ick = {
1528 1524
1529static struct clk gpt1_fck = { 1525static struct clk gpt1_fck = {
1530 .name = "gpt1_fck", 1526 .name = "gpt1_fck",
1527 .ops = &clkops_omap2_dflt_wait,
1531 .parent = &func_32k_ck, 1528 .parent = &func_32k_ck,
1532 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1533 .clkdm_name = "core_l4_clkdm", 1529 .clkdm_name = "core_l4_clkdm",
1534 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 1530 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
1535 .enable_bit = OMAP24XX_EN_GPT1_SHIFT, 1531 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
@@ -1544,8 +1540,8 @@ static struct clk gpt1_fck = {
1544 1540
1545static struct clk gpt2_ick = { 1541static struct clk gpt2_ick = {
1546 .name = "gpt2_ick", 1542 .name = "gpt2_ick",
1543 .ops = &clkops_omap2_dflt_wait,
1547 .parent = &l4_ck, 1544 .parent = &l4_ck,
1548 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1549 .clkdm_name = "core_l4_clkdm", 1545 .clkdm_name = "core_l4_clkdm",
1550 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1546 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1551 .enable_bit = OMAP24XX_EN_GPT2_SHIFT, 1547 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
@@ -1554,8 +1550,8 @@ static struct clk gpt2_ick = {
1554 1550
1555static struct clk gpt2_fck = { 1551static struct clk gpt2_fck = {
1556 .name = "gpt2_fck", 1552 .name = "gpt2_fck",
1553 .ops = &clkops_omap2_dflt_wait,
1557 .parent = &func_32k_ck, 1554 .parent = &func_32k_ck,
1558 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1559 .clkdm_name = "core_l4_clkdm", 1555 .clkdm_name = "core_l4_clkdm",
1560 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1556 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1561 .enable_bit = OMAP24XX_EN_GPT2_SHIFT, 1557 .enable_bit = OMAP24XX_EN_GPT2_SHIFT,
@@ -1568,8 +1564,8 @@ static struct clk gpt2_fck = {
1568 1564
1569static struct clk gpt3_ick = { 1565static struct clk gpt3_ick = {
1570 .name = "gpt3_ick", 1566 .name = "gpt3_ick",
1567 .ops = &clkops_omap2_dflt_wait,
1571 .parent = &l4_ck, 1568 .parent = &l4_ck,
1572 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1573 .clkdm_name = "core_l4_clkdm", 1569 .clkdm_name = "core_l4_clkdm",
1574 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1570 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1575 .enable_bit = OMAP24XX_EN_GPT3_SHIFT, 1571 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
@@ -1578,8 +1574,8 @@ static struct clk gpt3_ick = {
1578 1574
1579static struct clk gpt3_fck = { 1575static struct clk gpt3_fck = {
1580 .name = "gpt3_fck", 1576 .name = "gpt3_fck",
1577 .ops = &clkops_omap2_dflt_wait,
1581 .parent = &func_32k_ck, 1578 .parent = &func_32k_ck,
1582 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1583 .clkdm_name = "core_l4_clkdm", 1579 .clkdm_name = "core_l4_clkdm",
1584 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1580 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1585 .enable_bit = OMAP24XX_EN_GPT3_SHIFT, 1581 .enable_bit = OMAP24XX_EN_GPT3_SHIFT,
@@ -1592,8 +1588,8 @@ static struct clk gpt3_fck = {
1592 1588
1593static struct clk gpt4_ick = { 1589static struct clk gpt4_ick = {
1594 .name = "gpt4_ick", 1590 .name = "gpt4_ick",
1591 .ops = &clkops_omap2_dflt_wait,
1595 .parent = &l4_ck, 1592 .parent = &l4_ck,
1596 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1597 .clkdm_name = "core_l4_clkdm", 1593 .clkdm_name = "core_l4_clkdm",
1598 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1594 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1599 .enable_bit = OMAP24XX_EN_GPT4_SHIFT, 1595 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
@@ -1602,8 +1598,8 @@ static struct clk gpt4_ick = {
1602 1598
1603static struct clk gpt4_fck = { 1599static struct clk gpt4_fck = {
1604 .name = "gpt4_fck", 1600 .name = "gpt4_fck",
1601 .ops = &clkops_omap2_dflt_wait,
1605 .parent = &func_32k_ck, 1602 .parent = &func_32k_ck,
1606 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1607 .clkdm_name = "core_l4_clkdm", 1603 .clkdm_name = "core_l4_clkdm",
1608 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1604 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1609 .enable_bit = OMAP24XX_EN_GPT4_SHIFT, 1605 .enable_bit = OMAP24XX_EN_GPT4_SHIFT,
@@ -1616,8 +1612,8 @@ static struct clk gpt4_fck = {
1616 1612
1617static struct clk gpt5_ick = { 1613static struct clk gpt5_ick = {
1618 .name = "gpt5_ick", 1614 .name = "gpt5_ick",
1615 .ops = &clkops_omap2_dflt_wait,
1619 .parent = &l4_ck, 1616 .parent = &l4_ck,
1620 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1621 .clkdm_name = "core_l4_clkdm", 1617 .clkdm_name = "core_l4_clkdm",
1622 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1618 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1623 .enable_bit = OMAP24XX_EN_GPT5_SHIFT, 1619 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
@@ -1626,8 +1622,8 @@ static struct clk gpt5_ick = {
1626 1622
1627static struct clk gpt5_fck = { 1623static struct clk gpt5_fck = {
1628 .name = "gpt5_fck", 1624 .name = "gpt5_fck",
1625 .ops = &clkops_omap2_dflt_wait,
1629 .parent = &func_32k_ck, 1626 .parent = &func_32k_ck,
1630 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1631 .clkdm_name = "core_l4_clkdm", 1627 .clkdm_name = "core_l4_clkdm",
1632 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1628 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1633 .enable_bit = OMAP24XX_EN_GPT5_SHIFT, 1629 .enable_bit = OMAP24XX_EN_GPT5_SHIFT,
@@ -1640,8 +1636,8 @@ static struct clk gpt5_fck = {
1640 1636
1641static struct clk gpt6_ick = { 1637static struct clk gpt6_ick = {
1642 .name = "gpt6_ick", 1638 .name = "gpt6_ick",
1639 .ops = &clkops_omap2_dflt_wait,
1643 .parent = &l4_ck, 1640 .parent = &l4_ck,
1644 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1645 .clkdm_name = "core_l4_clkdm", 1641 .clkdm_name = "core_l4_clkdm",
1646 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1642 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1647 .enable_bit = OMAP24XX_EN_GPT6_SHIFT, 1643 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
@@ -1650,8 +1646,8 @@ static struct clk gpt6_ick = {
1650 1646
1651static struct clk gpt6_fck = { 1647static struct clk gpt6_fck = {
1652 .name = "gpt6_fck", 1648 .name = "gpt6_fck",
1649 .ops = &clkops_omap2_dflt_wait,
1653 .parent = &func_32k_ck, 1650 .parent = &func_32k_ck,
1654 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1655 .clkdm_name = "core_l4_clkdm", 1651 .clkdm_name = "core_l4_clkdm",
1656 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1652 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1657 .enable_bit = OMAP24XX_EN_GPT6_SHIFT, 1653 .enable_bit = OMAP24XX_EN_GPT6_SHIFT,
@@ -1664,8 +1660,8 @@ static struct clk gpt6_fck = {
1664 1660
1665static struct clk gpt7_ick = { 1661static struct clk gpt7_ick = {
1666 .name = "gpt7_ick", 1662 .name = "gpt7_ick",
1663 .ops = &clkops_omap2_dflt_wait,
1667 .parent = &l4_ck, 1664 .parent = &l4_ck,
1668 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1669 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1670 .enable_bit = OMAP24XX_EN_GPT7_SHIFT, 1666 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
1671 .recalc = &followparent_recalc, 1667 .recalc = &followparent_recalc,
@@ -1673,8 +1669,8 @@ static struct clk gpt7_ick = {
1673 1669
1674static struct clk gpt7_fck = { 1670static struct clk gpt7_fck = {
1675 .name = "gpt7_fck", 1671 .name = "gpt7_fck",
1672 .ops = &clkops_omap2_dflt_wait,
1676 .parent = &func_32k_ck, 1673 .parent = &func_32k_ck,
1677 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1678 .clkdm_name = "core_l4_clkdm", 1674 .clkdm_name = "core_l4_clkdm",
1679 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1675 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1680 .enable_bit = OMAP24XX_EN_GPT7_SHIFT, 1676 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
@@ -1687,8 +1683,8 @@ static struct clk gpt7_fck = {
1687 1683
1688static struct clk gpt8_ick = { 1684static struct clk gpt8_ick = {
1689 .name = "gpt8_ick", 1685 .name = "gpt8_ick",
1686 .ops = &clkops_omap2_dflt_wait,
1690 .parent = &l4_ck, 1687 .parent = &l4_ck,
1691 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1692 .clkdm_name = "core_l4_clkdm", 1688 .clkdm_name = "core_l4_clkdm",
1693 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1689 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1694 .enable_bit = OMAP24XX_EN_GPT8_SHIFT, 1690 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
@@ -1697,8 +1693,8 @@ static struct clk gpt8_ick = {
1697 1693
1698static struct clk gpt8_fck = { 1694static struct clk gpt8_fck = {
1699 .name = "gpt8_fck", 1695 .name = "gpt8_fck",
1696 .ops = &clkops_omap2_dflt_wait,
1700 .parent = &func_32k_ck, 1697 .parent = &func_32k_ck,
1701 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1702 .clkdm_name = "core_l4_clkdm", 1698 .clkdm_name = "core_l4_clkdm",
1703 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1699 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1704 .enable_bit = OMAP24XX_EN_GPT8_SHIFT, 1700 .enable_bit = OMAP24XX_EN_GPT8_SHIFT,
@@ -1711,8 +1707,8 @@ static struct clk gpt8_fck = {
1711 1707
1712static struct clk gpt9_ick = { 1708static struct clk gpt9_ick = {
1713 .name = "gpt9_ick", 1709 .name = "gpt9_ick",
1710 .ops = &clkops_omap2_dflt_wait,
1714 .parent = &l4_ck, 1711 .parent = &l4_ck,
1715 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1716 .clkdm_name = "core_l4_clkdm", 1712 .clkdm_name = "core_l4_clkdm",
1717 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1713 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1718 .enable_bit = OMAP24XX_EN_GPT9_SHIFT, 1714 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
@@ -1721,8 +1717,8 @@ static struct clk gpt9_ick = {
1721 1717
1722static struct clk gpt9_fck = { 1718static struct clk gpt9_fck = {
1723 .name = "gpt9_fck", 1719 .name = "gpt9_fck",
1720 .ops = &clkops_omap2_dflt_wait,
1724 .parent = &func_32k_ck, 1721 .parent = &func_32k_ck,
1725 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1726 .clkdm_name = "core_l4_clkdm", 1722 .clkdm_name = "core_l4_clkdm",
1727 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1723 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1728 .enable_bit = OMAP24XX_EN_GPT9_SHIFT, 1724 .enable_bit = OMAP24XX_EN_GPT9_SHIFT,
@@ -1735,8 +1731,8 @@ static struct clk gpt9_fck = {
1735 1731
1736static struct clk gpt10_ick = { 1732static struct clk gpt10_ick = {
1737 .name = "gpt10_ick", 1733 .name = "gpt10_ick",
1734 .ops = &clkops_omap2_dflt_wait,
1738 .parent = &l4_ck, 1735 .parent = &l4_ck,
1739 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1740 .clkdm_name = "core_l4_clkdm", 1736 .clkdm_name = "core_l4_clkdm",
1741 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1737 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1742 .enable_bit = OMAP24XX_EN_GPT10_SHIFT, 1738 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
@@ -1745,8 +1741,8 @@ static struct clk gpt10_ick = {
1745 1741
1746static struct clk gpt10_fck = { 1742static struct clk gpt10_fck = {
1747 .name = "gpt10_fck", 1743 .name = "gpt10_fck",
1744 .ops = &clkops_omap2_dflt_wait,
1748 .parent = &func_32k_ck, 1745 .parent = &func_32k_ck,
1749 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1750 .clkdm_name = "core_l4_clkdm", 1746 .clkdm_name = "core_l4_clkdm",
1751 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1747 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1752 .enable_bit = OMAP24XX_EN_GPT10_SHIFT, 1748 .enable_bit = OMAP24XX_EN_GPT10_SHIFT,
@@ -1759,8 +1755,8 @@ static struct clk gpt10_fck = {
1759 1755
1760static struct clk gpt11_ick = { 1756static struct clk gpt11_ick = {
1761 .name = "gpt11_ick", 1757 .name = "gpt11_ick",
1758 .ops = &clkops_omap2_dflt_wait,
1762 .parent = &l4_ck, 1759 .parent = &l4_ck,
1763 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1764 .clkdm_name = "core_l4_clkdm", 1760 .clkdm_name = "core_l4_clkdm",
1765 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1761 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1766 .enable_bit = OMAP24XX_EN_GPT11_SHIFT, 1762 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
@@ -1769,8 +1765,8 @@ static struct clk gpt11_ick = {
1769 1765
1770static struct clk gpt11_fck = { 1766static struct clk gpt11_fck = {
1771 .name = "gpt11_fck", 1767 .name = "gpt11_fck",
1768 .ops = &clkops_omap2_dflt_wait,
1772 .parent = &func_32k_ck, 1769 .parent = &func_32k_ck,
1773 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1774 .clkdm_name = "core_l4_clkdm", 1770 .clkdm_name = "core_l4_clkdm",
1775 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1771 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1776 .enable_bit = OMAP24XX_EN_GPT11_SHIFT, 1772 .enable_bit = OMAP24XX_EN_GPT11_SHIFT,
@@ -1783,8 +1779,8 @@ static struct clk gpt11_fck = {
1783 1779
1784static struct clk gpt12_ick = { 1780static struct clk gpt12_ick = {
1785 .name = "gpt12_ick", 1781 .name = "gpt12_ick",
1782 .ops = &clkops_omap2_dflt_wait,
1786 .parent = &l4_ck, 1783 .parent = &l4_ck,
1787 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1788 .clkdm_name = "core_l4_clkdm", 1784 .clkdm_name = "core_l4_clkdm",
1789 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1785 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1790 .enable_bit = OMAP24XX_EN_GPT12_SHIFT, 1786 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
@@ -1793,8 +1789,8 @@ static struct clk gpt12_ick = {
1793 1789
1794static struct clk gpt12_fck = { 1790static struct clk gpt12_fck = {
1795 .name = "gpt12_fck", 1791 .name = "gpt12_fck",
1792 .ops = &clkops_omap2_dflt_wait,
1796 .parent = &func_32k_ck, 1793 .parent = &func_32k_ck,
1797 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1798 .clkdm_name = "core_l4_clkdm", 1794 .clkdm_name = "core_l4_clkdm",
1799 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1795 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1800 .enable_bit = OMAP24XX_EN_GPT12_SHIFT, 1796 .enable_bit = OMAP24XX_EN_GPT12_SHIFT,
@@ -1807,9 +1803,9 @@ static struct clk gpt12_fck = {
1807 1803
1808static struct clk mcbsp1_ick = { 1804static struct clk mcbsp1_ick = {
1809 .name = "mcbsp_ick", 1805 .name = "mcbsp_ick",
1806 .ops = &clkops_omap2_dflt_wait,
1810 .id = 1, 1807 .id = 1,
1811 .parent = &l4_ck, 1808 .parent = &l4_ck,
1812 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1813 .clkdm_name = "core_l4_clkdm", 1809 .clkdm_name = "core_l4_clkdm",
1814 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1810 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1815 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, 1811 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
@@ -1818,9 +1814,9 @@ static struct clk mcbsp1_ick = {
1818 1814
1819static struct clk mcbsp1_fck = { 1815static struct clk mcbsp1_fck = {
1820 .name = "mcbsp_fck", 1816 .name = "mcbsp_fck",
1817 .ops = &clkops_omap2_dflt_wait,
1821 .id = 1, 1818 .id = 1,
1822 .parent = &func_96m_ck, 1819 .parent = &func_96m_ck,
1823 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1824 .clkdm_name = "core_l4_clkdm", 1820 .clkdm_name = "core_l4_clkdm",
1825 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1821 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1826 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, 1822 .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT,
@@ -1829,9 +1825,9 @@ static struct clk mcbsp1_fck = {
1829 1825
1830static struct clk mcbsp2_ick = { 1826static struct clk mcbsp2_ick = {
1831 .name = "mcbsp_ick", 1827 .name = "mcbsp_ick",
1828 .ops = &clkops_omap2_dflt_wait,
1832 .id = 2, 1829 .id = 2,
1833 .parent = &l4_ck, 1830 .parent = &l4_ck,
1834 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1835 .clkdm_name = "core_l4_clkdm", 1831 .clkdm_name = "core_l4_clkdm",
1836 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1832 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1837 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, 1833 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
@@ -1840,9 +1836,9 @@ static struct clk mcbsp2_ick = {
1840 1836
1841static struct clk mcbsp2_fck = { 1837static struct clk mcbsp2_fck = {
1842 .name = "mcbsp_fck", 1838 .name = "mcbsp_fck",
1839 .ops = &clkops_omap2_dflt_wait,
1843 .id = 2, 1840 .id = 2,
1844 .parent = &func_96m_ck, 1841 .parent = &func_96m_ck,
1845 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1846 .clkdm_name = "core_l4_clkdm", 1842 .clkdm_name = "core_l4_clkdm",
1847 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1843 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1848 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, 1844 .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT,
@@ -1851,9 +1847,9 @@ static struct clk mcbsp2_fck = {
1851 1847
1852static struct clk mcbsp3_ick = { 1848static struct clk mcbsp3_ick = {
1853 .name = "mcbsp_ick", 1849 .name = "mcbsp_ick",
1850 .ops = &clkops_omap2_dflt_wait,
1854 .id = 3, 1851 .id = 3,
1855 .parent = &l4_ck, 1852 .parent = &l4_ck,
1856 .flags = CLOCK_IN_OMAP243X,
1857 .clkdm_name = "core_l4_clkdm", 1853 .clkdm_name = "core_l4_clkdm",
1858 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1854 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1859 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, 1855 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
@@ -1862,9 +1858,9 @@ static struct clk mcbsp3_ick = {
1862 1858
1863static struct clk mcbsp3_fck = { 1859static struct clk mcbsp3_fck = {
1864 .name = "mcbsp_fck", 1860 .name = "mcbsp_fck",
1861 .ops = &clkops_omap2_dflt_wait,
1865 .id = 3, 1862 .id = 3,
1866 .parent = &func_96m_ck, 1863 .parent = &func_96m_ck,
1867 .flags = CLOCK_IN_OMAP243X,
1868 .clkdm_name = "core_l4_clkdm", 1864 .clkdm_name = "core_l4_clkdm",
1869 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1865 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1870 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, 1866 .enable_bit = OMAP2430_EN_MCBSP3_SHIFT,
@@ -1873,9 +1869,9 @@ static struct clk mcbsp3_fck = {
1873 1869
1874static struct clk mcbsp4_ick = { 1870static struct clk mcbsp4_ick = {
1875 .name = "mcbsp_ick", 1871 .name = "mcbsp_ick",
1872 .ops = &clkops_omap2_dflt_wait,
1876 .id = 4, 1873 .id = 4,
1877 .parent = &l4_ck, 1874 .parent = &l4_ck,
1878 .flags = CLOCK_IN_OMAP243X,
1879 .clkdm_name = "core_l4_clkdm", 1875 .clkdm_name = "core_l4_clkdm",
1880 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1876 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1881 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, 1877 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
@@ -1884,9 +1880,9 @@ static struct clk mcbsp4_ick = {
1884 1880
1885static struct clk mcbsp4_fck = { 1881static struct clk mcbsp4_fck = {
1886 .name = "mcbsp_fck", 1882 .name = "mcbsp_fck",
1883 .ops = &clkops_omap2_dflt_wait,
1887 .id = 4, 1884 .id = 4,
1888 .parent = &func_96m_ck, 1885 .parent = &func_96m_ck,
1889 .flags = CLOCK_IN_OMAP243X,
1890 .clkdm_name = "core_l4_clkdm", 1886 .clkdm_name = "core_l4_clkdm",
1891 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1887 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1892 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, 1888 .enable_bit = OMAP2430_EN_MCBSP4_SHIFT,
@@ -1895,9 +1891,9 @@ static struct clk mcbsp4_fck = {
1895 1891
1896static struct clk mcbsp5_ick = { 1892static struct clk mcbsp5_ick = {
1897 .name = "mcbsp_ick", 1893 .name = "mcbsp_ick",
1894 .ops = &clkops_omap2_dflt_wait,
1898 .id = 5, 1895 .id = 5,
1899 .parent = &l4_ck, 1896 .parent = &l4_ck,
1900 .flags = CLOCK_IN_OMAP243X,
1901 .clkdm_name = "core_l4_clkdm", 1897 .clkdm_name = "core_l4_clkdm",
1902 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1898 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1903 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, 1899 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
@@ -1906,9 +1902,9 @@ static struct clk mcbsp5_ick = {
1906 1902
1907static struct clk mcbsp5_fck = { 1903static struct clk mcbsp5_fck = {
1908 .name = "mcbsp_fck", 1904 .name = "mcbsp_fck",
1905 .ops = &clkops_omap2_dflt_wait,
1909 .id = 5, 1906 .id = 5,
1910 .parent = &func_96m_ck, 1907 .parent = &func_96m_ck,
1911 .flags = CLOCK_IN_OMAP243X,
1912 .clkdm_name = "core_l4_clkdm", 1908 .clkdm_name = "core_l4_clkdm",
1913 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1909 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1914 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, 1910 .enable_bit = OMAP2430_EN_MCBSP5_SHIFT,
@@ -1917,10 +1913,10 @@ static struct clk mcbsp5_fck = {
1917 1913
1918static struct clk mcspi1_ick = { 1914static struct clk mcspi1_ick = {
1919 .name = "mcspi_ick", 1915 .name = "mcspi_ick",
1916 .ops = &clkops_omap2_dflt_wait,
1920 .id = 1, 1917 .id = 1,
1921 .parent = &l4_ck, 1918 .parent = &l4_ck,
1922 .clkdm_name = "core_l4_clkdm", 1919 .clkdm_name = "core_l4_clkdm",
1923 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1924 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1920 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1925 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, 1921 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1926 .recalc = &followparent_recalc, 1922 .recalc = &followparent_recalc,
@@ -1928,9 +1924,9 @@ static struct clk mcspi1_ick = {
1928 1924
1929static struct clk mcspi1_fck = { 1925static struct clk mcspi1_fck = {
1930 .name = "mcspi_fck", 1926 .name = "mcspi_fck",
1927 .ops = &clkops_omap2_dflt_wait,
1931 .id = 1, 1928 .id = 1,
1932 .parent = &func_48m_ck, 1929 .parent = &func_48m_ck,
1933 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1934 .clkdm_name = "core_l4_clkdm", 1930 .clkdm_name = "core_l4_clkdm",
1935 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1931 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1936 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, 1932 .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT,
@@ -1939,9 +1935,9 @@ static struct clk mcspi1_fck = {
1939 1935
1940static struct clk mcspi2_ick = { 1936static struct clk mcspi2_ick = {
1941 .name = "mcspi_ick", 1937 .name = "mcspi_ick",
1938 .ops = &clkops_omap2_dflt_wait,
1942 .id = 2, 1939 .id = 2,
1943 .parent = &l4_ck, 1940 .parent = &l4_ck,
1944 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1945 .clkdm_name = "core_l4_clkdm", 1941 .clkdm_name = "core_l4_clkdm",
1946 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1942 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1947 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, 1943 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
@@ -1950,9 +1946,9 @@ static struct clk mcspi2_ick = {
1950 1946
1951static struct clk mcspi2_fck = { 1947static struct clk mcspi2_fck = {
1952 .name = "mcspi_fck", 1948 .name = "mcspi_fck",
1949 .ops = &clkops_omap2_dflt_wait,
1953 .id = 2, 1950 .id = 2,
1954 .parent = &func_48m_ck, 1951 .parent = &func_48m_ck,
1955 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1956 .clkdm_name = "core_l4_clkdm", 1952 .clkdm_name = "core_l4_clkdm",
1957 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1953 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1958 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, 1954 .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT,
@@ -1961,9 +1957,9 @@ static struct clk mcspi2_fck = {
1961 1957
1962static struct clk mcspi3_ick = { 1958static struct clk mcspi3_ick = {
1963 .name = "mcspi_ick", 1959 .name = "mcspi_ick",
1960 .ops = &clkops_omap2_dflt_wait,
1964 .id = 3, 1961 .id = 3,
1965 .parent = &l4_ck, 1962 .parent = &l4_ck,
1966 .flags = CLOCK_IN_OMAP243X,
1967 .clkdm_name = "core_l4_clkdm", 1963 .clkdm_name = "core_l4_clkdm",
1968 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1964 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1969 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, 1965 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
@@ -1972,9 +1968,9 @@ static struct clk mcspi3_ick = {
1972 1968
1973static struct clk mcspi3_fck = { 1969static struct clk mcspi3_fck = {
1974 .name = "mcspi_fck", 1970 .name = "mcspi_fck",
1971 .ops = &clkops_omap2_dflt_wait,
1975 .id = 3, 1972 .id = 3,
1976 .parent = &func_48m_ck, 1973 .parent = &func_48m_ck,
1977 .flags = CLOCK_IN_OMAP243X,
1978 .clkdm_name = "core_l4_clkdm", 1974 .clkdm_name = "core_l4_clkdm",
1979 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1975 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1980 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT, 1976 .enable_bit = OMAP2430_EN_MCSPI3_SHIFT,
@@ -1983,8 +1979,8 @@ static struct clk mcspi3_fck = {
1983 1979
1984static struct clk uart1_ick = { 1980static struct clk uart1_ick = {
1985 .name = "uart1_ick", 1981 .name = "uart1_ick",
1982 .ops = &clkops_omap2_dflt_wait,
1986 .parent = &l4_ck, 1983 .parent = &l4_ck,
1987 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1988 .clkdm_name = "core_l4_clkdm", 1984 .clkdm_name = "core_l4_clkdm",
1989 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1985 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1990 .enable_bit = OMAP24XX_EN_UART1_SHIFT, 1986 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
@@ -1993,8 +1989,8 @@ static struct clk uart1_ick = {
1993 1989
1994static struct clk uart1_fck = { 1990static struct clk uart1_fck = {
1995 .name = "uart1_fck", 1991 .name = "uart1_fck",
1992 .ops = &clkops_omap2_dflt_wait,
1996 .parent = &func_48m_ck, 1993 .parent = &func_48m_ck,
1997 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
1998 .clkdm_name = "core_l4_clkdm", 1994 .clkdm_name = "core_l4_clkdm",
1999 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1995 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2000 .enable_bit = OMAP24XX_EN_UART1_SHIFT, 1996 .enable_bit = OMAP24XX_EN_UART1_SHIFT,
@@ -2003,8 +1999,8 @@ static struct clk uart1_fck = {
2003 1999
2004static struct clk uart2_ick = { 2000static struct clk uart2_ick = {
2005 .name = "uart2_ick", 2001 .name = "uart2_ick",
2002 .ops = &clkops_omap2_dflt_wait,
2006 .parent = &l4_ck, 2003 .parent = &l4_ck,
2007 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2008 .clkdm_name = "core_l4_clkdm", 2004 .clkdm_name = "core_l4_clkdm",
2009 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2005 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2010 .enable_bit = OMAP24XX_EN_UART2_SHIFT, 2006 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
@@ -2013,8 +2009,8 @@ static struct clk uart2_ick = {
2013 2009
2014static struct clk uart2_fck = { 2010static struct clk uart2_fck = {
2015 .name = "uart2_fck", 2011 .name = "uart2_fck",
2012 .ops = &clkops_omap2_dflt_wait,
2016 .parent = &func_48m_ck, 2013 .parent = &func_48m_ck,
2017 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2018 .clkdm_name = "core_l4_clkdm", 2014 .clkdm_name = "core_l4_clkdm",
2019 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2015 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2020 .enable_bit = OMAP24XX_EN_UART2_SHIFT, 2016 .enable_bit = OMAP24XX_EN_UART2_SHIFT,
@@ -2023,8 +2019,8 @@ static struct clk uart2_fck = {
2023 2019
2024static struct clk uart3_ick = { 2020static struct clk uart3_ick = {
2025 .name = "uart3_ick", 2021 .name = "uart3_ick",
2022 .ops = &clkops_omap2_dflt_wait,
2026 .parent = &l4_ck, 2023 .parent = &l4_ck,
2027 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2028 .clkdm_name = "core_l4_clkdm", 2024 .clkdm_name = "core_l4_clkdm",
2029 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2025 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2030 .enable_bit = OMAP24XX_EN_UART3_SHIFT, 2026 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
@@ -2033,8 +2029,8 @@ static struct clk uart3_ick = {
2033 2029
2034static struct clk uart3_fck = { 2030static struct clk uart3_fck = {
2035 .name = "uart3_fck", 2031 .name = "uart3_fck",
2032 .ops = &clkops_omap2_dflt_wait,
2036 .parent = &func_48m_ck, 2033 .parent = &func_48m_ck,
2037 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2038 .clkdm_name = "core_l4_clkdm", 2034 .clkdm_name = "core_l4_clkdm",
2039 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2035 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2040 .enable_bit = OMAP24XX_EN_UART3_SHIFT, 2036 .enable_bit = OMAP24XX_EN_UART3_SHIFT,
@@ -2043,8 +2039,8 @@ static struct clk uart3_fck = {
2043 2039
2044static struct clk gpios_ick = { 2040static struct clk gpios_ick = {
2045 .name = "gpios_ick", 2041 .name = "gpios_ick",
2042 .ops = &clkops_omap2_dflt_wait,
2046 .parent = &l4_ck, 2043 .parent = &l4_ck,
2047 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2048 .clkdm_name = "core_l4_clkdm", 2044 .clkdm_name = "core_l4_clkdm",
2049 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2045 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2050 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, 2046 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
@@ -2053,8 +2049,8 @@ static struct clk gpios_ick = {
2053 2049
2054static struct clk gpios_fck = { 2050static struct clk gpios_fck = {
2055 .name = "gpios_fck", 2051 .name = "gpios_fck",
2052 .ops = &clkops_omap2_dflt_wait,
2056 .parent = &func_32k_ck, 2053 .parent = &func_32k_ck,
2057 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2058 .clkdm_name = "wkup_clkdm", 2054 .clkdm_name = "wkup_clkdm",
2059 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2055 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2060 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, 2056 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
@@ -2063,8 +2059,8 @@ static struct clk gpios_fck = {
2063 2059
2064static struct clk mpu_wdt_ick = { 2060static struct clk mpu_wdt_ick = {
2065 .name = "mpu_wdt_ick", 2061 .name = "mpu_wdt_ick",
2062 .ops = &clkops_omap2_dflt_wait,
2066 .parent = &l4_ck, 2063 .parent = &l4_ck,
2067 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2068 .clkdm_name = "core_l4_clkdm", 2064 .clkdm_name = "core_l4_clkdm",
2069 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2065 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2070 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, 2066 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
@@ -2073,8 +2069,8 @@ static struct clk mpu_wdt_ick = {
2073 2069
2074static struct clk mpu_wdt_fck = { 2070static struct clk mpu_wdt_fck = {
2075 .name = "mpu_wdt_fck", 2071 .name = "mpu_wdt_fck",
2072 .ops = &clkops_omap2_dflt_wait,
2076 .parent = &func_32k_ck, 2073 .parent = &func_32k_ck,
2077 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2078 .clkdm_name = "wkup_clkdm", 2074 .clkdm_name = "wkup_clkdm",
2079 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2075 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2080 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, 2076 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
@@ -2083,9 +2079,9 @@ static struct clk mpu_wdt_fck = {
2083 2079
2084static struct clk sync_32k_ick = { 2080static struct clk sync_32k_ick = {
2085 .name = "sync_32k_ick", 2081 .name = "sync_32k_ick",
2082 .ops = &clkops_omap2_dflt_wait,
2086 .parent = &l4_ck, 2083 .parent = &l4_ck,
2087 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 2084 .flags = ENABLE_ON_INIT,
2088 ENABLE_ON_INIT,
2089 .clkdm_name = "core_l4_clkdm", 2085 .clkdm_name = "core_l4_clkdm",
2090 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2086 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2091 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, 2087 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
@@ -2094,8 +2090,8 @@ static struct clk sync_32k_ick = {
2094 2090
2095static struct clk wdt1_ick = { 2091static struct clk wdt1_ick = {
2096 .name = "wdt1_ick", 2092 .name = "wdt1_ick",
2093 .ops = &clkops_omap2_dflt_wait,
2097 .parent = &l4_ck, 2094 .parent = &l4_ck,
2098 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2099 .clkdm_name = "core_l4_clkdm", 2095 .clkdm_name = "core_l4_clkdm",
2100 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2096 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2101 .enable_bit = OMAP24XX_EN_WDT1_SHIFT, 2097 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
@@ -2104,9 +2100,9 @@ static struct clk wdt1_ick = {
2104 2100
2105static struct clk omapctrl_ick = { 2101static struct clk omapctrl_ick = {
2106 .name = "omapctrl_ick", 2102 .name = "omapctrl_ick",
2103 .ops = &clkops_omap2_dflt_wait,
2107 .parent = &l4_ck, 2104 .parent = &l4_ck,
2108 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 2105 .flags = ENABLE_ON_INIT,
2109 ENABLE_ON_INIT,
2110 .clkdm_name = "core_l4_clkdm", 2106 .clkdm_name = "core_l4_clkdm",
2111 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2107 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2112 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, 2108 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
@@ -2115,8 +2111,8 @@ static struct clk omapctrl_ick = {
2115 2111
2116static struct clk icr_ick = { 2112static struct clk icr_ick = {
2117 .name = "icr_ick", 2113 .name = "icr_ick",
2114 .ops = &clkops_omap2_dflt_wait,
2118 .parent = &l4_ck, 2115 .parent = &l4_ck,
2119 .flags = CLOCK_IN_OMAP243X,
2120 .clkdm_name = "core_l4_clkdm", 2116 .clkdm_name = "core_l4_clkdm",
2121 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2117 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2122 .enable_bit = OMAP2430_EN_ICR_SHIFT, 2118 .enable_bit = OMAP2430_EN_ICR_SHIFT,
@@ -2125,8 +2121,8 @@ static struct clk icr_ick = {
2125 2121
2126static struct clk cam_ick = { 2122static struct clk cam_ick = {
2127 .name = "cam_ick", 2123 .name = "cam_ick",
2124 .ops = &clkops_omap2_dflt,
2128 .parent = &l4_ck, 2125 .parent = &l4_ck,
2129 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2130 .clkdm_name = "core_l4_clkdm", 2126 .clkdm_name = "core_l4_clkdm",
2131 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2127 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2132 .enable_bit = OMAP24XX_EN_CAM_SHIFT, 2128 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
@@ -2140,8 +2136,8 @@ static struct clk cam_ick = {
2140 */ 2136 */
2141static struct clk cam_fck = { 2137static struct clk cam_fck = {
2142 .name = "cam_fck", 2138 .name = "cam_fck",
2139 .ops = &clkops_omap2_dflt,
2143 .parent = &func_96m_ck, 2140 .parent = &func_96m_ck,
2144 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2145 .clkdm_name = "core_l3_clkdm", 2141 .clkdm_name = "core_l3_clkdm",
2146 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2142 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2147 .enable_bit = OMAP24XX_EN_CAM_SHIFT, 2143 .enable_bit = OMAP24XX_EN_CAM_SHIFT,
@@ -2150,8 +2146,8 @@ static struct clk cam_fck = {
2150 2146
2151static struct clk mailboxes_ick = { 2147static struct clk mailboxes_ick = {
2152 .name = "mailboxes_ick", 2148 .name = "mailboxes_ick",
2149 .ops = &clkops_omap2_dflt_wait,
2153 .parent = &l4_ck, 2150 .parent = &l4_ck,
2154 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2155 .clkdm_name = "core_l4_clkdm", 2151 .clkdm_name = "core_l4_clkdm",
2156 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2152 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2157 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT, 2153 .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
@@ -2160,8 +2156,8 @@ static struct clk mailboxes_ick = {
2160 2156
2161static struct clk wdt4_ick = { 2157static struct clk wdt4_ick = {
2162 .name = "wdt4_ick", 2158 .name = "wdt4_ick",
2159 .ops = &clkops_omap2_dflt_wait,
2163 .parent = &l4_ck, 2160 .parent = &l4_ck,
2164 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2165 .clkdm_name = "core_l4_clkdm", 2161 .clkdm_name = "core_l4_clkdm",
2166 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2162 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2167 .enable_bit = OMAP24XX_EN_WDT4_SHIFT, 2163 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
@@ -2170,8 +2166,8 @@ static struct clk wdt4_ick = {
2170 2166
2171static struct clk wdt4_fck = { 2167static struct clk wdt4_fck = {
2172 .name = "wdt4_fck", 2168 .name = "wdt4_fck",
2169 .ops = &clkops_omap2_dflt_wait,
2173 .parent = &func_32k_ck, 2170 .parent = &func_32k_ck,
2174 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2175 .clkdm_name = "core_l4_clkdm", 2171 .clkdm_name = "core_l4_clkdm",
2176 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2172 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2177 .enable_bit = OMAP24XX_EN_WDT4_SHIFT, 2173 .enable_bit = OMAP24XX_EN_WDT4_SHIFT,
@@ -2180,8 +2176,8 @@ static struct clk wdt4_fck = {
2180 2176
2181static struct clk wdt3_ick = { 2177static struct clk wdt3_ick = {
2182 .name = "wdt3_ick", 2178 .name = "wdt3_ick",
2179 .ops = &clkops_omap2_dflt_wait,
2183 .parent = &l4_ck, 2180 .parent = &l4_ck,
2184 .flags = CLOCK_IN_OMAP242X,
2185 .clkdm_name = "core_l4_clkdm", 2181 .clkdm_name = "core_l4_clkdm",
2186 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2182 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2187 .enable_bit = OMAP2420_EN_WDT3_SHIFT, 2183 .enable_bit = OMAP2420_EN_WDT3_SHIFT,
@@ -2190,8 +2186,8 @@ static struct clk wdt3_ick = {
2190 2186
2191static struct clk wdt3_fck = { 2187static struct clk wdt3_fck = {
2192 .name = "wdt3_fck", 2188 .name = "wdt3_fck",
2189 .ops = &clkops_omap2_dflt_wait,
2193 .parent = &func_32k_ck, 2190 .parent = &func_32k_ck,
2194 .flags = CLOCK_IN_OMAP242X,
2195 .clkdm_name = "core_l4_clkdm", 2191 .clkdm_name = "core_l4_clkdm",
2196 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2192 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2197 .enable_bit = OMAP2420_EN_WDT3_SHIFT, 2193 .enable_bit = OMAP2420_EN_WDT3_SHIFT,
@@ -2200,8 +2196,8 @@ static struct clk wdt3_fck = {
2200 2196
2201static struct clk mspro_ick = { 2197static struct clk mspro_ick = {
2202 .name = "mspro_ick", 2198 .name = "mspro_ick",
2199 .ops = &clkops_omap2_dflt_wait,
2203 .parent = &l4_ck, 2200 .parent = &l4_ck,
2204 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2205 .clkdm_name = "core_l4_clkdm", 2201 .clkdm_name = "core_l4_clkdm",
2206 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2202 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2207 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, 2203 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
@@ -2210,8 +2206,8 @@ static struct clk mspro_ick = {
2210 2206
2211static struct clk mspro_fck = { 2207static struct clk mspro_fck = {
2212 .name = "mspro_fck", 2208 .name = "mspro_fck",
2209 .ops = &clkops_omap2_dflt_wait,
2213 .parent = &func_96m_ck, 2210 .parent = &func_96m_ck,
2214 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2215 .clkdm_name = "core_l4_clkdm", 2211 .clkdm_name = "core_l4_clkdm",
2216 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2212 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2217 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, 2213 .enable_bit = OMAP24XX_EN_MSPRO_SHIFT,
@@ -2220,8 +2216,8 @@ static struct clk mspro_fck = {
2220 2216
2221static struct clk mmc_ick = { 2217static struct clk mmc_ick = {
2222 .name = "mmc_ick", 2218 .name = "mmc_ick",
2219 .ops = &clkops_omap2_dflt_wait,
2223 .parent = &l4_ck, 2220 .parent = &l4_ck,
2224 .flags = CLOCK_IN_OMAP242X,
2225 .clkdm_name = "core_l4_clkdm", 2221 .clkdm_name = "core_l4_clkdm",
2226 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2222 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2227 .enable_bit = OMAP2420_EN_MMC_SHIFT, 2223 .enable_bit = OMAP2420_EN_MMC_SHIFT,
@@ -2230,8 +2226,8 @@ static struct clk mmc_ick = {
2230 2226
2231static struct clk mmc_fck = { 2227static struct clk mmc_fck = {
2232 .name = "mmc_fck", 2228 .name = "mmc_fck",
2229 .ops = &clkops_omap2_dflt_wait,
2233 .parent = &func_96m_ck, 2230 .parent = &func_96m_ck,
2234 .flags = CLOCK_IN_OMAP242X,
2235 .clkdm_name = "core_l4_clkdm", 2231 .clkdm_name = "core_l4_clkdm",
2236 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2232 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2237 .enable_bit = OMAP2420_EN_MMC_SHIFT, 2233 .enable_bit = OMAP2420_EN_MMC_SHIFT,
@@ -2240,8 +2236,8 @@ static struct clk mmc_fck = {
2240 2236
2241static struct clk fac_ick = { 2237static struct clk fac_ick = {
2242 .name = "fac_ick", 2238 .name = "fac_ick",
2239 .ops = &clkops_omap2_dflt_wait,
2243 .parent = &l4_ck, 2240 .parent = &l4_ck,
2244 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2245 .clkdm_name = "core_l4_clkdm", 2241 .clkdm_name = "core_l4_clkdm",
2246 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2242 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2247 .enable_bit = OMAP24XX_EN_FAC_SHIFT, 2243 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
@@ -2250,8 +2246,8 @@ static struct clk fac_ick = {
2250 2246
2251static struct clk fac_fck = { 2247static struct clk fac_fck = {
2252 .name = "fac_fck", 2248 .name = "fac_fck",
2249 .ops = &clkops_omap2_dflt_wait,
2253 .parent = &func_12m_ck, 2250 .parent = &func_12m_ck,
2254 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2255 .clkdm_name = "core_l4_clkdm", 2251 .clkdm_name = "core_l4_clkdm",
2256 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2252 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2257 .enable_bit = OMAP24XX_EN_FAC_SHIFT, 2253 .enable_bit = OMAP24XX_EN_FAC_SHIFT,
@@ -2260,8 +2256,8 @@ static struct clk fac_fck = {
2260 2256
2261static struct clk eac_ick = { 2257static struct clk eac_ick = {
2262 .name = "eac_ick", 2258 .name = "eac_ick",
2259 .ops = &clkops_omap2_dflt_wait,
2263 .parent = &l4_ck, 2260 .parent = &l4_ck,
2264 .flags = CLOCK_IN_OMAP242X,
2265 .clkdm_name = "core_l4_clkdm", 2261 .clkdm_name = "core_l4_clkdm",
2266 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2262 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2267 .enable_bit = OMAP2420_EN_EAC_SHIFT, 2263 .enable_bit = OMAP2420_EN_EAC_SHIFT,
@@ -2270,8 +2266,8 @@ static struct clk eac_ick = {
2270 2266
2271static struct clk eac_fck = { 2267static struct clk eac_fck = {
2272 .name = "eac_fck", 2268 .name = "eac_fck",
2269 .ops = &clkops_omap2_dflt_wait,
2273 .parent = &func_96m_ck, 2270 .parent = &func_96m_ck,
2274 .flags = CLOCK_IN_OMAP242X,
2275 .clkdm_name = "core_l4_clkdm", 2271 .clkdm_name = "core_l4_clkdm",
2276 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2272 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2277 .enable_bit = OMAP2420_EN_EAC_SHIFT, 2273 .enable_bit = OMAP2420_EN_EAC_SHIFT,
@@ -2280,8 +2276,8 @@ static struct clk eac_fck = {
2280 2276
2281static struct clk hdq_ick = { 2277static struct clk hdq_ick = {
2282 .name = "hdq_ick", 2278 .name = "hdq_ick",
2279 .ops = &clkops_omap2_dflt_wait,
2283 .parent = &l4_ck, 2280 .parent = &l4_ck,
2284 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2285 .clkdm_name = "core_l4_clkdm", 2281 .clkdm_name = "core_l4_clkdm",
2286 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2282 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2287 .enable_bit = OMAP24XX_EN_HDQ_SHIFT, 2283 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
@@ -2290,8 +2286,8 @@ static struct clk hdq_ick = {
2290 2286
2291static struct clk hdq_fck = { 2287static struct clk hdq_fck = {
2292 .name = "hdq_fck", 2288 .name = "hdq_fck",
2289 .ops = &clkops_omap2_dflt_wait,
2293 .parent = &func_12m_ck, 2290 .parent = &func_12m_ck,
2294 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2295 .clkdm_name = "core_l4_clkdm", 2291 .clkdm_name = "core_l4_clkdm",
2296 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2292 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2297 .enable_bit = OMAP24XX_EN_HDQ_SHIFT, 2293 .enable_bit = OMAP24XX_EN_HDQ_SHIFT,
@@ -2300,9 +2296,9 @@ static struct clk hdq_fck = {
2300 2296
2301static struct clk i2c2_ick = { 2297static struct clk i2c2_ick = {
2302 .name = "i2c_ick", 2298 .name = "i2c_ick",
2299 .ops = &clkops_omap2_dflt_wait,
2303 .id = 2, 2300 .id = 2,
2304 .parent = &l4_ck, 2301 .parent = &l4_ck,
2305 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2306 .clkdm_name = "core_l4_clkdm", 2302 .clkdm_name = "core_l4_clkdm",
2307 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2303 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2308 .enable_bit = OMAP2420_EN_I2C2_SHIFT, 2304 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
@@ -2311,9 +2307,9 @@ static struct clk i2c2_ick = {
2311 2307
2312static struct clk i2c2_fck = { 2308static struct clk i2c2_fck = {
2313 .name = "i2c_fck", 2309 .name = "i2c_fck",
2310 .ops = &clkops_omap2_dflt_wait,
2314 .id = 2, 2311 .id = 2,
2315 .parent = &func_12m_ck, 2312 .parent = &func_12m_ck,
2316 .flags = CLOCK_IN_OMAP242X,
2317 .clkdm_name = "core_l4_clkdm", 2313 .clkdm_name = "core_l4_clkdm",
2318 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2314 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2319 .enable_bit = OMAP2420_EN_I2C2_SHIFT, 2315 .enable_bit = OMAP2420_EN_I2C2_SHIFT,
@@ -2322,9 +2318,9 @@ static struct clk i2c2_fck = {
2322 2318
2323static struct clk i2chs2_fck = { 2319static struct clk i2chs2_fck = {
2324 .name = "i2c_fck", 2320 .name = "i2c_fck",
2321 .ops = &clkops_omap2_dflt_wait,
2325 .id = 2, 2322 .id = 2,
2326 .parent = &func_96m_ck, 2323 .parent = &func_96m_ck,
2327 .flags = CLOCK_IN_OMAP243X,
2328 .clkdm_name = "core_l4_clkdm", 2324 .clkdm_name = "core_l4_clkdm",
2329 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2325 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2330 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT, 2326 .enable_bit = OMAP2430_EN_I2CHS2_SHIFT,
@@ -2333,9 +2329,9 @@ static struct clk i2chs2_fck = {
2333 2329
2334static struct clk i2c1_ick = { 2330static struct clk i2c1_ick = {
2335 .name = "i2c_ick", 2331 .name = "i2c_ick",
2332 .ops = &clkops_omap2_dflt_wait,
2336 .id = 1, 2333 .id = 1,
2337 .parent = &l4_ck, 2334 .parent = &l4_ck,
2338 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2339 .clkdm_name = "core_l4_clkdm", 2335 .clkdm_name = "core_l4_clkdm",
2340 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2336 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2341 .enable_bit = OMAP2420_EN_I2C1_SHIFT, 2337 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
@@ -2344,9 +2340,9 @@ static struct clk i2c1_ick = {
2344 2340
2345static struct clk i2c1_fck = { 2341static struct clk i2c1_fck = {
2346 .name = "i2c_fck", 2342 .name = "i2c_fck",
2343 .ops = &clkops_omap2_dflt_wait,
2347 .id = 1, 2344 .id = 1,
2348 .parent = &func_12m_ck, 2345 .parent = &func_12m_ck,
2349 .flags = CLOCK_IN_OMAP242X,
2350 .clkdm_name = "core_l4_clkdm", 2346 .clkdm_name = "core_l4_clkdm",
2351 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2347 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2352 .enable_bit = OMAP2420_EN_I2C1_SHIFT, 2348 .enable_bit = OMAP2420_EN_I2C1_SHIFT,
@@ -2355,9 +2351,9 @@ static struct clk i2c1_fck = {
2355 2351
2356static struct clk i2chs1_fck = { 2352static struct clk i2chs1_fck = {
2357 .name = "i2c_fck", 2353 .name = "i2c_fck",
2354 .ops = &clkops_omap2_dflt_wait,
2358 .id = 1, 2355 .id = 1,
2359 .parent = &func_96m_ck, 2356 .parent = &func_96m_ck,
2360 .flags = CLOCK_IN_OMAP243X,
2361 .clkdm_name = "core_l4_clkdm", 2357 .clkdm_name = "core_l4_clkdm",
2362 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2358 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2363 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT, 2359 .enable_bit = OMAP2430_EN_I2CHS1_SHIFT,
@@ -2366,33 +2362,33 @@ static struct clk i2chs1_fck = {
2366 2362
2367static struct clk gpmc_fck = { 2363static struct clk gpmc_fck = {
2368 .name = "gpmc_fck", 2364 .name = "gpmc_fck",
2365 .ops = &clkops_null, /* RMK: missing? */
2369 .parent = &core_l3_ck, 2366 .parent = &core_l3_ck,
2370 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 2367 .flags = ENABLE_ON_INIT,
2371 ENABLE_ON_INIT,
2372 .clkdm_name = "core_l3_clkdm", 2368 .clkdm_name = "core_l3_clkdm",
2373 .recalc = &followparent_recalc, 2369 .recalc = &followparent_recalc,
2374}; 2370};
2375 2371
2376static struct clk sdma_fck = { 2372static struct clk sdma_fck = {
2377 .name = "sdma_fck", 2373 .name = "sdma_fck",
2374 .ops = &clkops_null, /* RMK: missing? */
2378 .parent = &core_l3_ck, 2375 .parent = &core_l3_ck,
2379 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2380 .clkdm_name = "core_l3_clkdm", 2376 .clkdm_name = "core_l3_clkdm",
2381 .recalc = &followparent_recalc, 2377 .recalc = &followparent_recalc,
2382}; 2378};
2383 2379
2384static struct clk sdma_ick = { 2380static struct clk sdma_ick = {
2385 .name = "sdma_ick", 2381 .name = "sdma_ick",
2382 .ops = &clkops_null, /* RMK: missing? */
2386 .parent = &l4_ck, 2383 .parent = &l4_ck,
2387 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X,
2388 .clkdm_name = "core_l3_clkdm", 2384 .clkdm_name = "core_l3_clkdm",
2389 .recalc = &followparent_recalc, 2385 .recalc = &followparent_recalc,
2390}; 2386};
2391 2387
2392static struct clk vlynq_ick = { 2388static struct clk vlynq_ick = {
2393 .name = "vlynq_ick", 2389 .name = "vlynq_ick",
2390 .ops = &clkops_omap2_dflt_wait,
2394 .parent = &core_l3_ck, 2391 .parent = &core_l3_ck,
2395 .flags = CLOCK_IN_OMAP242X,
2396 .clkdm_name = "core_l3_clkdm", 2392 .clkdm_name = "core_l3_clkdm",
2397 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2393 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2398 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, 2394 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT,
@@ -2426,8 +2422,9 @@ static const struct clksel vlynq_fck_clksel[] = {
2426 2422
2427static struct clk vlynq_fck = { 2423static struct clk vlynq_fck = {
2428 .name = "vlynq_fck", 2424 .name = "vlynq_fck",
2425 .ops = &clkops_omap2_dflt_wait,
2429 .parent = &func_96m_ck, 2426 .parent = &func_96m_ck,
2430 .flags = CLOCK_IN_OMAP242X | DELAYED_APP, 2427 .flags = DELAYED_APP,
2431 .clkdm_name = "core_l3_clkdm", 2428 .clkdm_name = "core_l3_clkdm",
2432 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 2429 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
2433 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, 2430 .enable_bit = OMAP2420_EN_VLYNQ_SHIFT,
@@ -2442,8 +2439,9 @@ static struct clk vlynq_fck = {
2442 2439
2443static struct clk sdrc_ick = { 2440static struct clk sdrc_ick = {
2444 .name = "sdrc_ick", 2441 .name = "sdrc_ick",
2442 .ops = &clkops_omap2_dflt_wait,
2445 .parent = &l4_ck, 2443 .parent = &l4_ck,
2446 .flags = CLOCK_IN_OMAP243X | ENABLE_ON_INIT, 2444 .flags = ENABLE_ON_INIT,
2447 .clkdm_name = "core_l4_clkdm", 2445 .clkdm_name = "core_l4_clkdm",
2448 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 2446 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
2449 .enable_bit = OMAP2430_EN_SDRC_SHIFT, 2447 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
@@ -2452,8 +2450,8 @@ static struct clk sdrc_ick = {
2452 2450
2453static struct clk des_ick = { 2451static struct clk des_ick = {
2454 .name = "des_ick", 2452 .name = "des_ick",
2453 .ops = &clkops_omap2_dflt_wait,
2455 .parent = &l4_ck, 2454 .parent = &l4_ck,
2456 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2457 .clkdm_name = "core_l4_clkdm", 2455 .clkdm_name = "core_l4_clkdm",
2458 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 2456 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2459 .enable_bit = OMAP24XX_EN_DES_SHIFT, 2457 .enable_bit = OMAP24XX_EN_DES_SHIFT,
@@ -2462,8 +2460,8 @@ static struct clk des_ick = {
2462 2460
2463static struct clk sha_ick = { 2461static struct clk sha_ick = {
2464 .name = "sha_ick", 2462 .name = "sha_ick",
2463 .ops = &clkops_omap2_dflt_wait,
2465 .parent = &l4_ck, 2464 .parent = &l4_ck,
2466 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2467 .clkdm_name = "core_l4_clkdm", 2465 .clkdm_name = "core_l4_clkdm",
2468 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 2466 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2469 .enable_bit = OMAP24XX_EN_SHA_SHIFT, 2467 .enable_bit = OMAP24XX_EN_SHA_SHIFT,
@@ -2472,8 +2470,8 @@ static struct clk sha_ick = {
2472 2470
2473static struct clk rng_ick = { 2471static struct clk rng_ick = {
2474 .name = "rng_ick", 2472 .name = "rng_ick",
2473 .ops = &clkops_omap2_dflt_wait,
2475 .parent = &l4_ck, 2474 .parent = &l4_ck,
2476 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2477 .clkdm_name = "core_l4_clkdm", 2475 .clkdm_name = "core_l4_clkdm",
2478 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 2476 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2479 .enable_bit = OMAP24XX_EN_RNG_SHIFT, 2477 .enable_bit = OMAP24XX_EN_RNG_SHIFT,
@@ -2482,8 +2480,8 @@ static struct clk rng_ick = {
2482 2480
2483static struct clk aes_ick = { 2481static struct clk aes_ick = {
2484 .name = "aes_ick", 2482 .name = "aes_ick",
2483 .ops = &clkops_omap2_dflt_wait,
2485 .parent = &l4_ck, 2484 .parent = &l4_ck,
2486 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2487 .clkdm_name = "core_l4_clkdm", 2485 .clkdm_name = "core_l4_clkdm",
2488 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 2486 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2489 .enable_bit = OMAP24XX_EN_AES_SHIFT, 2487 .enable_bit = OMAP24XX_EN_AES_SHIFT,
@@ -2492,8 +2490,8 @@ static struct clk aes_ick = {
2492 2490
2493static struct clk pka_ick = { 2491static struct clk pka_ick = {
2494 .name = "pka_ick", 2492 .name = "pka_ick",
2493 .ops = &clkops_omap2_dflt_wait,
2495 .parent = &l4_ck, 2494 .parent = &l4_ck,
2496 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2497 .clkdm_name = "core_l4_clkdm", 2495 .clkdm_name = "core_l4_clkdm",
2498 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 2496 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
2499 .enable_bit = OMAP24XX_EN_PKA_SHIFT, 2497 .enable_bit = OMAP24XX_EN_PKA_SHIFT,
@@ -2502,8 +2500,8 @@ static struct clk pka_ick = {
2502 2500
2503static struct clk usb_fck = { 2501static struct clk usb_fck = {
2504 .name = "usb_fck", 2502 .name = "usb_fck",
2503 .ops = &clkops_omap2_dflt_wait,
2505 .parent = &func_48m_ck, 2504 .parent = &func_48m_ck,
2506 .flags = CLOCK_IN_OMAP243X | CLOCK_IN_OMAP242X,
2507 .clkdm_name = "core_l3_clkdm", 2505 .clkdm_name = "core_l3_clkdm",
2508 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2506 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2509 .enable_bit = OMAP24XX_EN_USB_SHIFT, 2507 .enable_bit = OMAP24XX_EN_USB_SHIFT,
@@ -2512,8 +2510,8 @@ static struct clk usb_fck = {
2512 2510
2513static struct clk usbhs_ick = { 2511static struct clk usbhs_ick = {
2514 .name = "usbhs_ick", 2512 .name = "usbhs_ick",
2513 .ops = &clkops_omap2_dflt_wait,
2515 .parent = &core_l3_ck, 2514 .parent = &core_l3_ck,
2516 .flags = CLOCK_IN_OMAP243X,
2517 .clkdm_name = "core_l3_clkdm", 2515 .clkdm_name = "core_l3_clkdm",
2518 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2516 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2519 .enable_bit = OMAP2430_EN_USBHS_SHIFT, 2517 .enable_bit = OMAP2430_EN_USBHS_SHIFT,
@@ -2522,8 +2520,8 @@ static struct clk usbhs_ick = {
2522 2520
2523static struct clk mmchs1_ick = { 2521static struct clk mmchs1_ick = {
2524 .name = "mmchs_ick", 2522 .name = "mmchs_ick",
2523 .ops = &clkops_omap2_dflt_wait,
2525 .parent = &l4_ck, 2524 .parent = &l4_ck,
2526 .flags = CLOCK_IN_OMAP243X,
2527 .clkdm_name = "core_l4_clkdm", 2525 .clkdm_name = "core_l4_clkdm",
2528 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2526 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2529 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, 2527 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
@@ -2532,8 +2530,8 @@ static struct clk mmchs1_ick = {
2532 2530
2533static struct clk mmchs1_fck = { 2531static struct clk mmchs1_fck = {
2534 .name = "mmchs_fck", 2532 .name = "mmchs_fck",
2533 .ops = &clkops_omap2_dflt_wait,
2535 .parent = &func_96m_ck, 2534 .parent = &func_96m_ck,
2536 .flags = CLOCK_IN_OMAP243X,
2537 .clkdm_name = "core_l3_clkdm", 2535 .clkdm_name = "core_l3_clkdm",
2538 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2536 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2539 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, 2537 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
@@ -2542,9 +2540,9 @@ static struct clk mmchs1_fck = {
2542 2540
2543static struct clk mmchs2_ick = { 2541static struct clk mmchs2_ick = {
2544 .name = "mmchs_ick", 2542 .name = "mmchs_ick",
2543 .ops = &clkops_omap2_dflt_wait,
2545 .id = 1, 2544 .id = 1,
2546 .parent = &l4_ck, 2545 .parent = &l4_ck,
2547 .flags = CLOCK_IN_OMAP243X,
2548 .clkdm_name = "core_l4_clkdm", 2546 .clkdm_name = "core_l4_clkdm",
2549 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2547 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2550 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, 2548 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
@@ -2553,9 +2551,9 @@ static struct clk mmchs2_ick = {
2553 2551
2554static struct clk mmchs2_fck = { 2552static struct clk mmchs2_fck = {
2555 .name = "mmchs_fck", 2553 .name = "mmchs_fck",
2554 .ops = &clkops_omap2_dflt_wait,
2556 .id = 1, 2555 .id = 1,
2557 .parent = &func_96m_ck, 2556 .parent = &func_96m_ck,
2558 .flags = CLOCK_IN_OMAP243X,
2559 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2557 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2560 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, 2558 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
2561 .recalc = &followparent_recalc, 2559 .recalc = &followparent_recalc,
@@ -2563,8 +2561,8 @@ static struct clk mmchs2_fck = {
2563 2561
2564static struct clk gpio5_ick = { 2562static struct clk gpio5_ick = {
2565 .name = "gpio5_ick", 2563 .name = "gpio5_ick",
2564 .ops = &clkops_omap2_dflt_wait,
2566 .parent = &l4_ck, 2565 .parent = &l4_ck,
2567 .flags = CLOCK_IN_OMAP243X,
2568 .clkdm_name = "core_l4_clkdm", 2566 .clkdm_name = "core_l4_clkdm",
2569 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2567 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2570 .enable_bit = OMAP2430_EN_GPIO5_SHIFT, 2568 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
@@ -2573,8 +2571,8 @@ static struct clk gpio5_ick = {
2573 2571
2574static struct clk gpio5_fck = { 2572static struct clk gpio5_fck = {
2575 .name = "gpio5_fck", 2573 .name = "gpio5_fck",
2574 .ops = &clkops_omap2_dflt_wait,
2576 .parent = &func_32k_ck, 2575 .parent = &func_32k_ck,
2577 .flags = CLOCK_IN_OMAP243X,
2578 .clkdm_name = "core_l4_clkdm", 2576 .clkdm_name = "core_l4_clkdm",
2579 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2577 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2580 .enable_bit = OMAP2430_EN_GPIO5_SHIFT, 2578 .enable_bit = OMAP2430_EN_GPIO5_SHIFT,
@@ -2583,8 +2581,8 @@ static struct clk gpio5_fck = {
2583 2581
2584static struct clk mdm_intc_ick = { 2582static struct clk mdm_intc_ick = {
2585 .name = "mdm_intc_ick", 2583 .name = "mdm_intc_ick",
2584 .ops = &clkops_omap2_dflt_wait,
2586 .parent = &l4_ck, 2585 .parent = &l4_ck,
2587 .flags = CLOCK_IN_OMAP243X,
2588 .clkdm_name = "core_l4_clkdm", 2586 .clkdm_name = "core_l4_clkdm",
2589 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2587 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2590 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT, 2588 .enable_bit = OMAP2430_EN_MDM_INTC_SHIFT,
@@ -2593,8 +2591,8 @@ static struct clk mdm_intc_ick = {
2593 2591
2594static struct clk mmchsdb1_fck = { 2592static struct clk mmchsdb1_fck = {
2595 .name = "mmchsdb_fck", 2593 .name = "mmchsdb_fck",
2594 .ops = &clkops_omap2_dflt_wait,
2596 .parent = &func_32k_ck, 2595 .parent = &func_32k_ck,
2597 .flags = CLOCK_IN_OMAP243X,
2598 .clkdm_name = "core_l4_clkdm", 2596 .clkdm_name = "core_l4_clkdm",
2599 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2597 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2600 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT, 2598 .enable_bit = OMAP2430_EN_MMCHSDB1_SHIFT,
@@ -2603,9 +2601,9 @@ static struct clk mmchsdb1_fck = {
2603 2601
2604static struct clk mmchsdb2_fck = { 2602static struct clk mmchsdb2_fck = {
2605 .name = "mmchsdb_fck", 2603 .name = "mmchsdb_fck",
2604 .ops = &clkops_omap2_dflt_wait,
2606 .id = 1, 2605 .id = 1,
2607 .parent = &func_32k_ck, 2606 .parent = &func_32k_ck,
2608 .flags = CLOCK_IN_OMAP243X,
2609 .clkdm_name = "core_l4_clkdm", 2607 .clkdm_name = "core_l4_clkdm",
2610 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 2608 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
2611 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT, 2609 .enable_bit = OMAP2430_EN_MMCHSDB2_SHIFT,
@@ -2628,166 +2626,13 @@ static struct clk mmchsdb2_fck = {
2628 */ 2626 */
2629static struct clk virt_prcm_set = { 2627static struct clk virt_prcm_set = {
2630 .name = "virt_prcm_set", 2628 .name = "virt_prcm_set",
2631 .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | 2629 .ops = &clkops_null,
2632 VIRTUAL_CLOCK | ALWAYS_ENABLED | DELAYED_APP, 2630 .flags = DELAYED_APP,
2633 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ 2631 .parent = &mpu_ck, /* Indexed by mpu speed, no parent */
2634 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */ 2632 .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */
2635 .set_rate = &omap2_select_table_rate, 2633 .set_rate = &omap2_select_table_rate,
2636 .round_rate = &omap2_round_to_table_rate, 2634 .round_rate = &omap2_round_to_table_rate,
2637}; 2635};
2638 2636
2639static struct clk *onchip_24xx_clks[] __initdata = {
2640 /* external root sources */
2641 &func_32k_ck,
2642 &osc_ck,
2643 &sys_ck,
2644 &alt_ck,
2645 /* internal analog sources */
2646 &dpll_ck,
2647 &apll96_ck,
2648 &apll54_ck,
2649 /* internal prcm root sources */
2650 &func_54m_ck,
2651 &core_ck,
2652 &func_96m_ck,
2653 &func_48m_ck,
2654 &func_12m_ck,
2655 &wdt1_osc_ck,
2656 &sys_clkout_src,
2657 &sys_clkout,
2658 &sys_clkout2_src,
2659 &sys_clkout2,
2660 &emul_ck,
2661 /* mpu domain clocks */
2662 &mpu_ck,
2663 /* dsp domain clocks */
2664 &dsp_fck,
2665 &dsp_irate_ick,
2666 &dsp_ick, /* 242x */
2667 &iva2_1_ick, /* 243x */
2668 &iva1_ifck, /* 242x */
2669 &iva1_mpu_int_ifck, /* 242x */
2670 /* GFX domain clocks */
2671 &gfx_3d_fck,
2672 &gfx_2d_fck,
2673 &gfx_ick,
2674 /* Modem domain clocks */
2675 &mdm_ick,
2676 &mdm_osc_ck,
2677 /* DSS domain clocks */
2678 &dss_ick,
2679 &dss1_fck,
2680 &dss2_fck,
2681 &dss_54m_fck,
2682 /* L3 domain clocks */
2683 &core_l3_ck,
2684 &ssi_ssr_sst_fck,
2685 &usb_l4_ick,
2686 /* L4 domain clocks */
2687 &l4_ck, /* used as both core_l4 and wu_l4 */
2688 /* virtual meta-group clock */
2689 &virt_prcm_set,
2690 /* general l4 interface ck, multi-parent functional clk */
2691 &gpt1_ick,
2692 &gpt1_fck,
2693 &gpt2_ick,
2694 &gpt2_fck,
2695 &gpt3_ick,
2696 &gpt3_fck,
2697 &gpt4_ick,
2698 &gpt4_fck,
2699 &gpt5_ick,
2700 &gpt5_fck,
2701 &gpt6_ick,
2702 &gpt6_fck,
2703 &gpt7_ick,
2704 &gpt7_fck,
2705 &gpt8_ick,
2706 &gpt8_fck,
2707 &gpt9_ick,
2708 &gpt9_fck,
2709 &gpt10_ick,
2710 &gpt10_fck,
2711 &gpt11_ick,
2712 &gpt11_fck,
2713 &gpt12_ick,
2714 &gpt12_fck,
2715 &mcbsp1_ick,
2716 &mcbsp1_fck,
2717 &mcbsp2_ick,
2718 &mcbsp2_fck,
2719 &mcbsp3_ick,
2720 &mcbsp3_fck,
2721 &mcbsp4_ick,
2722 &mcbsp4_fck,
2723 &mcbsp5_ick,
2724 &mcbsp5_fck,
2725 &mcspi1_ick,
2726 &mcspi1_fck,
2727 &mcspi2_ick,
2728 &mcspi2_fck,
2729 &mcspi3_ick,
2730 &mcspi3_fck,
2731 &uart1_ick,
2732 &uart1_fck,
2733 &uart2_ick,
2734 &uart2_fck,
2735 &uart3_ick,
2736 &uart3_fck,
2737 &gpios_ick,
2738 &gpios_fck,
2739 &mpu_wdt_ick,
2740 &mpu_wdt_fck,
2741 &sync_32k_ick,
2742 &wdt1_ick,
2743 &omapctrl_ick,
2744 &icr_ick,
2745 &cam_fck,
2746 &cam_ick,
2747 &mailboxes_ick,
2748 &wdt4_ick,
2749 &wdt4_fck,
2750 &wdt3_ick,
2751 &wdt3_fck,
2752 &mspro_ick,
2753 &mspro_fck,
2754 &mmc_ick,
2755 &mmc_fck,
2756 &fac_ick,
2757 &fac_fck,
2758 &eac_ick,
2759 &eac_fck,
2760 &hdq_ick,
2761 &hdq_fck,
2762 &i2c1_ick,
2763 &i2c1_fck,
2764 &i2chs1_fck,
2765 &i2c2_ick,
2766 &i2c2_fck,
2767 &i2chs2_fck,
2768 &gpmc_fck,
2769 &sdma_fck,
2770 &sdma_ick,
2771 &vlynq_ick,
2772 &vlynq_fck,
2773 &sdrc_ick,
2774 &des_ick,
2775 &sha_ick,
2776 &rng_ick,
2777 &aes_ick,
2778 &pka_ick,
2779 &usb_fck,
2780 &usbhs_ick,
2781 &mmchs1_ick,
2782 &mmchs1_fck,
2783 &mmchs2_ick,
2784 &mmchs2_fck,
2785 &gpio5_ick,
2786 &gpio5_fck,
2787 &mdm_intc_ick,
2788 &mmchsdb1_fck,
2789 &mmchsdb2_fck,
2790};
2791
2792#endif 2637#endif
2793 2638
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 31bb7010bd48..0a14dca31e30 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -30,15 +30,251 @@
30#include <mach/clock.h> 30#include <mach/clock.h>
31#include <mach/sram.h> 31#include <mach/sram.h>
32#include <asm/div64.h> 32#include <asm/div64.h>
33#include <asm/clkdev.h>
33 34
34#include "memory.h" 35#include <mach/sdrc.h>
35#include "clock.h" 36#include "clock.h"
36#include "clock34xx.h"
37#include "prm.h" 37#include "prm.h"
38#include "prm-regbits-34xx.h" 38#include "prm-regbits-34xx.h"
39#include "cm.h" 39#include "cm.h"
40#include "cm-regbits-34xx.h" 40#include "cm-regbits-34xx.h"
41 41
42static const struct clkops clkops_noncore_dpll_ops;
43
44#include "clock34xx.h"
45
46struct omap_clk {
47 u32 cpu;
48 struct clk_lookup lk;
49};
50
51#define CLK(dev, con, ck, cp) \
52 { \
53 .cpu = cp, \
54 .lk = { \
55 .dev_id = dev, \
56 .con_id = con, \
57 .clk = ck, \
58 }, \
59 }
60
61#define CK_343X (1 << 0)
62#define CK_3430ES1 (1 << 1)
63#define CK_3430ES2 (1 << 2)
64
65static struct omap_clk omap34xx_clks[] = {
66 CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_343X),
67 CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_343X),
68 CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_343X),
69 CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2),
70 CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_343X),
71 CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_343X),
72 CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_343X),
73 CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_343X),
74 CLK(NULL, "sys_ck", &sys_ck, CK_343X),
75 CLK(NULL, "sys_altclk", &sys_altclk, CK_343X),
76 CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_343X),
77 CLK(NULL, "sys_clkout1", &sys_clkout1, CK_343X),
78 CLK(NULL, "dpll1_ck", &dpll1_ck, CK_343X),
79 CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_343X),
80 CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_343X),
81 CLK(NULL, "dpll2_ck", &dpll2_ck, CK_343X),
82 CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_343X),
83 CLK(NULL, "dpll3_ck", &dpll3_ck, CK_343X),
84 CLK(NULL, "core_ck", &core_ck, CK_343X),
85 CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_343X),
86 CLK(NULL, "dpll3_m2_ck", &dpll3_m2_ck, CK_343X),
87 CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_343X),
88 CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_343X),
89 CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_343X),
90 CLK(NULL, "emu_core_alwon_ck", &emu_core_alwon_ck, CK_343X),
91 CLK(NULL, "dpll4_ck", &dpll4_ck, CK_343X),
92 CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_343X),
93 CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_343X),
94 CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_343X),
95 CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_343X),
96 CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_343X),
97 CLK(NULL, "omap_48m_fck", &omap_48m_fck, CK_343X),
98 CLK(NULL, "omap_12m_fck", &omap_12m_fck, CK_343X),
99 CLK(NULL, "dpll4_m2_ck", &dpll4_m2_ck, CK_343X),
100 CLK(NULL, "dpll4_m2x2_ck", &dpll4_m2x2_ck, CK_343X),
101 CLK(NULL, "dpll4_m3_ck", &dpll4_m3_ck, CK_343X),
102 CLK(NULL, "dpll4_m3x2_ck", &dpll4_m3x2_ck, CK_343X),
103 CLK(NULL, "dpll4_m4_ck", &dpll4_m4_ck, CK_343X),
104 CLK(NULL, "dpll4_m4x2_ck", &dpll4_m4x2_ck, CK_343X),
105 CLK(NULL, "dpll4_m5_ck", &dpll4_m5_ck, CK_343X),
106 CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_343X),
107 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_343X),
108 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_343X),
109 CLK(NULL, "emu_per_alwon_ck", &emu_per_alwon_ck, CK_343X),
110 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2),
111 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2),
112 CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_343X),
113 CLK(NULL, "sys_clkout2", &sys_clkout2, CK_343X),
114 CLK(NULL, "corex2_fck", &corex2_fck, CK_343X),
115 CLK(NULL, "dpll1_fck", &dpll1_fck, CK_343X),
116 CLK(NULL, "mpu_ck", &mpu_ck, CK_343X),
117 CLK(NULL, "arm_fck", &arm_fck, CK_343X),
118 CLK(NULL, "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_343X),
119 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X),
120 CLK(NULL, "iva2_ck", &iva2_ck, CK_343X),
121 CLK(NULL, "l3_ick", &l3_ick, CK_343X),
122 CLK(NULL, "l4_ick", &l4_ick, CK_343X),
123 CLK(NULL, "rm_ick", &rm_ick, CK_343X),
124 CLK(NULL, "gfx_l3_ck", &gfx_l3_ck, CK_3430ES1),
125 CLK(NULL, "gfx_l3_fck", &gfx_l3_fck, CK_3430ES1),
126 CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1),
127 CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1),
128 CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1),
129 CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2),
130 CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2),
131 CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1),
132 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_343X),
133 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_343X),
134 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2),
135 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2),
136 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2),
137 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_343X),
138 CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2),
139 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_343X),
140 CLK(NULL, "mspro_fck", &mspro_fck, CK_343X),
141 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_343X),
142 CLK("i2c_omap.3", "fck", &i2c3_fck, CK_343X),
143 CLK("i2c_omap.2", "fck", &i2c2_fck, CK_343X),
144 CLK("i2c_omap.1", "fck", &i2c1_fck, CK_343X),
145 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_343X),
146 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_343X),
147 CLK(NULL, "core_48m_fck", &core_48m_fck, CK_343X),
148 CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_343X),
149 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_343X),
150 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_343X),
151 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_343X),
152 CLK(NULL, "uart2_fck", &uart2_fck, CK_343X),
153 CLK(NULL, "uart1_fck", &uart1_fck, CK_343X),
154 CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1),
155 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_343X),
156 CLK("omap_hdq.0", "fck", &hdq_fck, CK_343X),
157 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck, CK_343X),
158 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck, CK_343X),
159 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_343X),
160 CLK(NULL, "hsotgusb_ick", &hsotgusb_ick, CK_343X),
161 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_343X),
162 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_343X),
163 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X),
164 CLK(NULL, "pka_ick", &pka_ick, CK_343X),
165 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_343X),
166 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2),
167 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2),
168 CLK(NULL, "icr_ick", &icr_ick, CK_343X),
169 CLK(NULL, "aes2_ick", &aes2_ick, CK_343X),
170 CLK(NULL, "sha12_ick", &sha12_ick, CK_343X),
171 CLK(NULL, "des2_ick", &des2_ick, CK_343X),
172 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_343X),
173 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_343X),
174 CLK(NULL, "mspro_ick", &mspro_ick, CK_343X),
175 CLK("omap_hdq.0", "ick", &hdq_ick, CK_343X),
176 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_343X),
177 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_343X),
178 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_343X),
179 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_343X),
180 CLK("i2c_omap.3", "ick", &i2c3_ick, CK_343X),
181 CLK("i2c_omap.2", "ick", &i2c2_ick, CK_343X),
182 CLK("i2c_omap.1", "ick", &i2c1_ick, CK_343X),
183 CLK(NULL, "uart2_ick", &uart2_ick, CK_343X),
184 CLK(NULL, "uart1_ick", &uart1_ick, CK_343X),
185 CLK(NULL, "gpt11_ick", &gpt11_ick, CK_343X),
186 CLK(NULL, "gpt10_ick", &gpt10_ick, CK_343X),
187 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_343X),
188 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_343X),
189 CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1),
190 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_343X),
191 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_343X),
192 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_343X),
193 CLK(NULL, "ssi_ick", &ssi_ick, CK_343X),
194 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_3430ES1),
195 CLK(NULL, "security_l4_ick2", &security_l4_ick2, CK_343X),
196 CLK(NULL, "aes1_ick", &aes1_ick, CK_343X),
197 CLK("omap_rng", "ick", &rng_ick, CK_343X),
198 CLK(NULL, "sha11_ick", &sha11_ick, CK_343X),
199 CLK(NULL, "des1_ick", &des1_ick, CK_343X),
200 CLK(NULL, "dss1_alwon_fck", &dss1_alwon_fck, CK_343X),
201 CLK(NULL, "dss_tv_fck", &dss_tv_fck, CK_343X),
202 CLK(NULL, "dss_96m_fck", &dss_96m_fck, CK_343X),
203 CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck, CK_343X),
204 CLK(NULL, "dss_ick", &dss_ick, CK_343X),
205 CLK(NULL, "cam_mclk", &cam_mclk, CK_343X),
206 CLK(NULL, "cam_ick", &cam_ick, CK_343X),
207 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X),
208 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2),
209 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2),
210 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2),
211 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2),
212 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_343X),
213 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_343X),
214 CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_343X),
215 CLK("omap_wdt", "fck", &wdt2_fck, CK_343X),
216 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_343X),
217 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2),
218 CLK("omap_wdt", "ick", &wdt2_ick, CK_343X),
219 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_343X),
220 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_343X),
221 CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_343X),
222 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_343X),
223 CLK(NULL, "gpt1_ick", &gpt1_ick, CK_343X),
224 CLK(NULL, "per_96m_fck", &per_96m_fck, CK_343X),
225 CLK(NULL, "per_48m_fck", &per_48m_fck, CK_343X),
226 CLK(NULL, "uart3_fck", &uart3_fck, CK_343X),
227 CLK(NULL, "gpt2_fck", &gpt2_fck, CK_343X),
228 CLK(NULL, "gpt3_fck", &gpt3_fck, CK_343X),
229 CLK(NULL, "gpt4_fck", &gpt4_fck, CK_343X),
230 CLK(NULL, "gpt5_fck", &gpt5_fck, CK_343X),
231 CLK(NULL, "gpt6_fck", &gpt6_fck, CK_343X),
232 CLK(NULL, "gpt7_fck", &gpt7_fck, CK_343X),
233 CLK(NULL, "gpt8_fck", &gpt8_fck, CK_343X),
234 CLK(NULL, "gpt9_fck", &gpt9_fck, CK_343X),
235 CLK(NULL, "per_32k_alwon_fck", &per_32k_alwon_fck, CK_343X),
236 CLK(NULL, "gpio6_dbck", &gpio6_dbck, CK_343X),
237 CLK(NULL, "gpio5_dbck", &gpio5_dbck, CK_343X),
238 CLK(NULL, "gpio4_dbck", &gpio4_dbck, CK_343X),
239 CLK(NULL, "gpio3_dbck", &gpio3_dbck, CK_343X),
240 CLK(NULL, "gpio2_dbck", &gpio2_dbck, CK_343X),
241 CLK(NULL, "wdt3_fck", &wdt3_fck, CK_343X),
242 CLK(NULL, "per_l4_ick", &per_l4_ick, CK_343X),
243 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_343X),
244 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_343X),
245 CLK(NULL, "gpio4_ick", &gpio4_ick, CK_343X),
246 CLK(NULL, "gpio3_ick", &gpio3_ick, CK_343X),
247 CLK(NULL, "gpio2_ick", &gpio2_ick, CK_343X),
248 CLK(NULL, "wdt3_ick", &wdt3_ick, CK_343X),
249 CLK(NULL, "uart3_ick", &uart3_ick, CK_343X),
250 CLK(NULL, "gpt9_ick", &gpt9_ick, CK_343X),
251 CLK(NULL, "gpt8_ick", &gpt8_ick, CK_343X),
252 CLK(NULL, "gpt7_ick", &gpt7_ick, CK_343X),
253 CLK(NULL, "gpt6_ick", &gpt6_ick, CK_343X),
254 CLK(NULL, "gpt5_ick", &gpt5_ick, CK_343X),
255 CLK(NULL, "gpt4_ick", &gpt4_ick, CK_343X),
256 CLK(NULL, "gpt3_ick", &gpt3_ick, CK_343X),
257 CLK(NULL, "gpt2_ick", &gpt2_ick, CK_343X),
258 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_343X),
259 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_343X),
260 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_343X),
261 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_343X),
262 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_343X),
263 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_343X),
264 CLK(NULL, "emu_src_ck", &emu_src_ck, CK_343X),
265 CLK(NULL, "pclk_fck", &pclk_fck, CK_343X),
266 CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_343X),
267 CLK(NULL, "atclk_fck", &atclk_fck, CK_343X),
268 CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_343X),
269 CLK(NULL, "traceclk_fck", &traceclk_fck, CK_343X),
270 CLK(NULL, "sr1_fck", &sr1_fck, CK_343X),
271 CLK(NULL, "sr2_fck", &sr2_fck, CK_343X),
272 CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_343X),
273 CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_343X),
274 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_343X),
275 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_343X),
276};
277
42/* CM_AUTOIDLE_PLL*.AUTO_* bit values */ 278/* CM_AUTOIDLE_PLL*.AUTO_* bit values */
43#define DPLL_AUTOIDLE_DISABLE 0x0 279#define DPLL_AUTOIDLE_DISABLE 0x0
44#define DPLL_AUTOIDLE_LOW_POWER_STOP 0x1 280#define DPLL_AUTOIDLE_LOW_POWER_STOP 0x1
@@ -51,11 +287,9 @@
51 * 287 *
52 * Recalculate and propagate the DPLL rate. 288 * Recalculate and propagate the DPLL rate.
53 */ 289 */
54static void omap3_dpll_recalc(struct clk *clk) 290static unsigned long omap3_dpll_recalc(struct clk *clk)
55{ 291{
56 clk->rate = omap2_get_dpll_rate(clk); 292 return omap2_get_dpll_rate(clk);
57
58 propagate_rate(clk);
59} 293}
60 294
61/* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ 295/* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */
@@ -78,14 +312,12 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state)
78 const struct dpll_data *dd; 312 const struct dpll_data *dd;
79 int i = 0; 313 int i = 0;
80 int ret = -EINVAL; 314 int ret = -EINVAL;
81 u32 idlest_mask;
82 315
83 dd = clk->dpll_data; 316 dd = clk->dpll_data;
84 317
85 state <<= dd->idlest_bit; 318 state <<= __ffs(dd->idlest_mask);
86 idlest_mask = 1 << dd->idlest_bit;
87 319
88 while (((__raw_readl(dd->idlest_reg) & idlest_mask) != state) && 320 while (((__raw_readl(dd->idlest_reg) & dd->idlest_mask) != state) &&
89 i < MAX_DPLL_WAIT_TRIES) { 321 i < MAX_DPLL_WAIT_TRIES) {
90 i++; 322 i++;
91 udelay(1); 323 udelay(1);
@@ -104,6 +336,42 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state)
104 return ret; 336 return ret;
105} 337}
106 338
339/* From 3430 TRM ES2 4.7.6.2 */
340static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n)
341{
342 unsigned long fint;
343 u16 f = 0;
344
345 fint = clk->dpll_data->clk_ref->rate / (n + 1);
346
347 pr_debug("clock: fint is %lu\n", fint);
348
349 if (fint >= 750000 && fint <= 1000000)
350 f = 0x3;
351 else if (fint > 1000000 && fint <= 1250000)
352 f = 0x4;
353 else if (fint > 1250000 && fint <= 1500000)
354 f = 0x5;
355 else if (fint > 1500000 && fint <= 1750000)
356 f = 0x6;
357 else if (fint > 1750000 && fint <= 2100000)
358 f = 0x7;
359 else if (fint > 7500000 && fint <= 10000000)
360 f = 0xB;
361 else if (fint > 10000000 && fint <= 12500000)
362 f = 0xC;
363 else if (fint > 12500000 && fint <= 15000000)
364 f = 0xD;
365 else if (fint > 15000000 && fint <= 17500000)
366 f = 0xE;
367 else if (fint > 17500000 && fint <= 21000000)
368 f = 0xF;
369 else
370 pr_debug("clock: unknown freqsel setting for %d\n", n);
371
372 return f;
373}
374
107/* Non-CORE DPLL (e.g., DPLLs that do not control SDRC) clock functions */ 375/* Non-CORE DPLL (e.g., DPLLs that do not control SDRC) clock functions */
108 376
109/* 377/*
@@ -128,25 +396,20 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
128 396
129 ai = omap3_dpll_autoidle_read(clk); 397 ai = omap3_dpll_autoidle_read(clk);
130 398
399 omap3_dpll_deny_idle(clk);
400
131 _omap3_dpll_write_clken(clk, DPLL_LOCKED); 401 _omap3_dpll_write_clken(clk, DPLL_LOCKED);
132 402
133 if (ai) { 403 r = _omap3_wait_dpll_status(clk, 1);
134 /* 404
135 * If no downstream clocks are enabled, CM_IDLEST bit 405 if (ai)
136 * may never become active, so don't wait for DPLL to lock.
137 */
138 r = 0;
139 omap3_dpll_allow_idle(clk); 406 omap3_dpll_allow_idle(clk);
140 } else {
141 r = _omap3_wait_dpll_status(clk, 1);
142 omap3_dpll_deny_idle(clk);
143 };
144 407
145 return r; 408 return r;
146} 409}
147 410
148/* 411/*
149 * omap3_noncore_dpll_bypass - instruct a DPLL to bypass and wait for readiness 412 * _omap3_noncore_dpll_bypass - instruct a DPLL to bypass and wait for readiness
150 * @clk: pointer to a DPLL struct clk 413 * @clk: pointer to a DPLL struct clk
151 * 414 *
152 * Instructs a non-CORE DPLL to enter low-power bypass mode. In 415 * Instructs a non-CORE DPLL to enter low-power bypass mode. In
@@ -236,14 +499,25 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
236static int omap3_noncore_dpll_enable(struct clk *clk) 499static int omap3_noncore_dpll_enable(struct clk *clk)
237{ 500{
238 int r; 501 int r;
502 struct dpll_data *dd;
239 503
240 if (clk == &dpll3_ck) 504 if (clk == &dpll3_ck)
241 return -EINVAL; 505 return -EINVAL;
242 506
243 if (clk->parent->rate == clk_get_rate(clk)) 507 dd = clk->dpll_data;
508 if (!dd)
509 return -EINVAL;
510
511 if (clk->rate == dd->clk_bypass->rate) {
512 WARN_ON(clk->parent != dd->clk_bypass);
244 r = _omap3_noncore_dpll_bypass(clk); 513 r = _omap3_noncore_dpll_bypass(clk);
245 else 514 } else {
515 WARN_ON(clk->parent != dd->clk_ref);
246 r = _omap3_noncore_dpll_lock(clk); 516 r = _omap3_noncore_dpll_lock(clk);
517 }
518 /* FIXME: this is dubious - if clk->rate has changed, what about propagating? */
519 if (!r)
520 clk->rate = omap2_get_dpll_rate(clk);
247 521
248 return r; 522 return r;
249} 523}
@@ -270,6 +544,215 @@ static void omap3_noncore_dpll_disable(struct clk *clk)
270 _omap3_noncore_dpll_stop(clk); 544 _omap3_noncore_dpll_stop(clk);
271} 545}
272 546
547
548/* Non-CORE DPLL rate set code */
549
550/*
551 * omap3_noncore_dpll_program - set non-core DPLL M,N values directly
552 * @clk: struct clk * of DPLL to set
553 * @m: DPLL multiplier to set
554 * @n: DPLL divider to set
555 * @freqsel: FREQSEL value to set
556 *
557 * Program the DPLL with the supplied M, N values, and wait for the DPLL to
558 * lock.. Returns -EINVAL upon error, or 0 upon success.
559 */
560static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel)
561{
562 struct dpll_data *dd = clk->dpll_data;
563 u32 v;
564
565 /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */
566 _omap3_noncore_dpll_bypass(clk);
567
568 /* Set jitter correction */
569 v = __raw_readl(dd->control_reg);
570 v &= ~dd->freqsel_mask;
571 v |= freqsel << __ffs(dd->freqsel_mask);
572 __raw_writel(v, dd->control_reg);
573
574 /* Set DPLL multiplier, divider */
575 v = __raw_readl(dd->mult_div1_reg);
576 v &= ~(dd->mult_mask | dd->div1_mask);
577 v |= m << __ffs(dd->mult_mask);
578 v |= (n - 1) << __ffs(dd->div1_mask);
579 __raw_writel(v, dd->mult_div1_reg);
580
581 /* We let the clock framework set the other output dividers later */
582
583 /* REVISIT: Set ramp-up delay? */
584
585 _omap3_noncore_dpll_lock(clk);
586
587 return 0;
588}
589
590/**
591 * omap3_noncore_dpll_set_rate - set non-core DPLL rate
592 * @clk: struct clk * of DPLL to set
593 * @rate: rounded target rate
594 *
595 * Set the DPLL CLKOUT to the target rate. If the DPLL can enter
596 * low-power bypass, and the target rate is the bypass source clock
597 * rate, then configure the DPLL for bypass. Otherwise, round the
598 * target rate if it hasn't been done already, then program and lock
599 * the DPLL. Returns -EINVAL upon error, or 0 upon success.
600 */
601static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
602{
603 struct clk *new_parent = NULL;
604 u16 freqsel;
605 struct dpll_data *dd;
606 int ret;
607
608 if (!clk || !rate)
609 return -EINVAL;
610
611 dd = clk->dpll_data;
612 if (!dd)
613 return -EINVAL;
614
615 if (rate == omap2_get_dpll_rate(clk))
616 return 0;
617
618 /*
619 * Ensure both the bypass and ref clocks are enabled prior to
620 * doing anything; we need the bypass clock running to reprogram
621 * the DPLL.
622 */
623 omap2_clk_enable(dd->clk_bypass);
624 omap2_clk_enable(dd->clk_ref);
625
626 if (dd->clk_bypass->rate == rate &&
627 (clk->dpll_data->modes & (1 << DPLL_LOW_POWER_BYPASS))) {
628 pr_debug("clock: %s: set rate: entering bypass.\n", clk->name);
629
630 ret = _omap3_noncore_dpll_bypass(clk);
631 if (!ret)
632 new_parent = dd->clk_bypass;
633 } else {
634 if (dd->last_rounded_rate != rate)
635 omap2_dpll_round_rate(clk, rate);
636
637 if (dd->last_rounded_rate == 0)
638 return -EINVAL;
639
640 freqsel = _omap3_dpll_compute_freqsel(clk, dd->last_rounded_n);
641 if (!freqsel)
642 WARN_ON(1);
643
644 pr_debug("clock: %s: set rate: locking rate to %lu.\n",
645 clk->name, rate);
646
647 ret = omap3_noncore_dpll_program(clk, dd->last_rounded_m,
648 dd->last_rounded_n, freqsel);
649 if (!ret)
650 new_parent = dd->clk_ref;
651 }
652 if (!ret) {
653 /*
654 * Switch the parent clock in the heirarchy, and make sure
655 * that the new parent's usecount is correct. Note: we
656 * enable the new parent before disabling the old to avoid
657 * any unnecessary hardware disable->enable transitions.
658 */
659 if (clk->usecount) {
660 omap2_clk_enable(new_parent);
661 omap2_clk_disable(clk->parent);
662 }
663 clk_reparent(clk, new_parent);
664 clk->rate = rate;
665 }
666 omap2_clk_disable(dd->clk_ref);
667 omap2_clk_disable(dd->clk_bypass);
668
669 return 0;
670}
671
672static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate)
673{
674 /*
675 * According to the 12-5 CDP code from TI, "Limitation 2.5"
676 * on 3430ES1 prevents us from changing DPLL multipliers or dividers
677 * on DPLL4.
678 */
679 if (omap_rev() == OMAP3430_REV_ES1_0) {
680 printk(KERN_ERR "clock: DPLL4 cannot change rate due to "
681 "silicon 'Limitation 2.5' on 3430ES1.\n");
682 return -EINVAL;
683 }
684 return omap3_noncore_dpll_set_rate(clk, rate);
685}
686
687
688/*
689 * CORE DPLL (DPLL3) rate programming functions
690 *
691 * These call into SRAM code to do the actual CM writes, since the SDRAM
692 * is clocked from DPLL3.
693 */
694
695/**
696 * omap3_core_dpll_m2_set_rate - set CORE DPLL M2 divider
697 * @clk: struct clk * of DPLL to set
698 * @rate: rounded target rate
699 *
700 * Program the DPLL M2 divider with the rounded target rate. Returns
701 * -EINVAL upon error, or 0 upon success.
702 */
703static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
704{
705 u32 new_div = 0;
706 unsigned long validrate, sdrcrate;
707 struct omap_sdrc_params *sp;
708
709 if (!clk || !rate)
710 return -EINVAL;
711
712 if (clk != &dpll3_m2_ck)
713 return -EINVAL;
714
715 if (rate == clk->rate)
716 return 0;
717
718 validrate = omap2_clksel_round_rate_div(clk, rate, &new_div);
719 if (validrate != rate)
720 return -EINVAL;
721
722 sdrcrate = sdrc_ick.rate;
723 if (rate > clk->rate)
724 sdrcrate <<= ((rate / clk->rate) - 1);
725 else
726 sdrcrate >>= ((clk->rate / rate) - 1);
727
728 sp = omap2_sdrc_get_params(sdrcrate);
729 if (!sp)
730 return -EINVAL;
731
732 pr_info("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate,
733 validrate);
734 pr_info("clock: SDRC timing params used: %08x %08x %08x\n",
735 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb);
736
737 /* REVISIT: SRAM code doesn't support other M2 divisors yet */
738 WARN_ON(new_div != 1 && new_div != 2);
739
740 /* REVISIT: Add SDRC_MR changing to this code also */
741 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla,
742 sp->actim_ctrlb, new_div);
743
744 return 0;
745}
746
747
748static const struct clkops clkops_noncore_dpll_ops = {
749 .enable = &omap3_noncore_dpll_enable,
750 .disable = &omap3_noncore_dpll_disable,
751};
752
753/* DPLL autoidle read/set code */
754
755
273/** 756/**
274 * omap3_dpll_autoidle_read - read a DPLL's autoidle bits 757 * omap3_dpll_autoidle_read - read a DPLL's autoidle bits
275 * @clk: struct clk * of the DPLL to read 758 * @clk: struct clk * of the DPLL to read
@@ -356,9 +839,10 @@ static void omap3_dpll_deny_idle(struct clk *clk)
356 * Using parent clock DPLL data, look up DPLL state. If locked, set our 839 * Using parent clock DPLL data, look up DPLL state. If locked, set our
357 * rate to the dpll_clk * 2; otherwise, just use dpll_clk. 840 * rate to the dpll_clk * 2; otherwise, just use dpll_clk.
358 */ 841 */
359static void omap3_clkoutx2_recalc(struct clk *clk) 842static unsigned long omap3_clkoutx2_recalc(struct clk *clk)
360{ 843{
361 const struct dpll_data *dd; 844 const struct dpll_data *dd;
845 unsigned long rate;
362 u32 v; 846 u32 v;
363 struct clk *pclk; 847 struct clk *pclk;
364 848
@@ -372,17 +856,15 @@ static void omap3_clkoutx2_recalc(struct clk *clk)
372 856
373 dd = pclk->dpll_data; 857 dd = pclk->dpll_data;
374 858
375 WARN_ON(!dd->control_reg || !dd->enable_mask); 859 WARN_ON(!dd->enable_mask);
376 860
377 v = __raw_readl(dd->control_reg) & dd->enable_mask; 861 v = __raw_readl(dd->control_reg) & dd->enable_mask;
378 v >>= __ffs(dd->enable_mask); 862 v >>= __ffs(dd->enable_mask);
379 if (v != DPLL_LOCKED) 863 if (v != OMAP3XXX_EN_DPLL_LOCKED)
380 clk->rate = clk->parent->rate; 864 rate = clk->parent->rate;
381 else 865 else
382 clk->rate = clk->parent->rate * 2; 866 rate = clk->parent->rate * 2;
383 867 return rate;
384 if (clk->flags & RATE_PROPAGATES)
385 propagate_rate(clk);
386} 868}
387 869
388/* Common clock code */ 870/* Common clock code */
@@ -432,7 +914,7 @@ static int __init omap2_clk_arch_init(void)
432 914
433 /* REVISIT: not yet ready for 343x */ 915 /* REVISIT: not yet ready for 343x */
434#if 0 916#if 0
435 if (omap2_select_table_rate(&virt_prcm_set, mpurate)) 917 if (clk_set_rate(&virt_prcm_set, mpurate))
436 printk(KERN_ERR "Could not find matching MPU rate\n"); 918 printk(KERN_ERR "Could not find matching MPU rate\n");
437#endif 919#endif
438 920
@@ -450,26 +932,13 @@ arch_initcall(omap2_clk_arch_init);
450int __init omap2_clk_init(void) 932int __init omap2_clk_init(void)
451{ 933{
452 /* struct prcm_config *prcm; */ 934 /* struct prcm_config *prcm; */
453 struct clk **clkp; 935 struct omap_clk *c;
454 /* u32 clkrate; */ 936 /* u32 clkrate; */
455 u32 cpu_clkflg; 937 u32 cpu_clkflg;
456 938
457 /* REVISIT: Ultimately this will be used for multiboot */
458#if 0
459 if (cpu_is_omap242x()) {
460 cpu_mask = RATE_IN_242X;
461 cpu_clkflg = CLOCK_IN_OMAP242X;
462 clkp = onchip_24xx_clks;
463 } else if (cpu_is_omap2430()) {
464 cpu_mask = RATE_IN_243X;
465 cpu_clkflg = CLOCK_IN_OMAP243X;
466 clkp = onchip_24xx_clks;
467 }
468#endif
469 if (cpu_is_omap34xx()) { 939 if (cpu_is_omap34xx()) {
470 cpu_mask = RATE_IN_343X; 940 cpu_mask = RATE_IN_343X;
471 cpu_clkflg = CLOCK_IN_OMAP343X; 941 cpu_clkflg = CK_343X;
472 clkp = onchip_34xx_clks;
473 942
474 /* 943 /*
475 * Update this if there are further clock changes between ES2 944 * Update this if there are further clock changes between ES2
@@ -477,23 +946,24 @@ int __init omap2_clk_init(void)
477 */ 946 */
478 if (omap_rev() == OMAP3430_REV_ES1_0) { 947 if (omap_rev() == OMAP3430_REV_ES1_0) {
479 /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */ 948 /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */
480 cpu_clkflg |= CLOCK_IN_OMAP3430ES1; 949 cpu_clkflg |= CK_3430ES1;
481 } else { 950 } else {
482 cpu_mask |= RATE_IN_3430ES2; 951 cpu_mask |= RATE_IN_3430ES2;
483 cpu_clkflg |= CLOCK_IN_OMAP3430ES2; 952 cpu_clkflg |= CK_3430ES2;
484 } 953 }
485 } 954 }
486 955
487 clk_init(&omap2_clk_functions); 956 clk_init(&omap2_clk_functions);
488 957
489 for (clkp = onchip_34xx_clks; 958 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++)
490 clkp < onchip_34xx_clks + ARRAY_SIZE(onchip_34xx_clks); 959 clk_init_one(c->lk.clk);
491 clkp++) { 960
492 if ((*clkp)->flags & cpu_clkflg) { 961 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++)
493 clk_register(*clkp); 962 if (c->cpu & cpu_clkflg) {
494 omap2_init_clk_clkdm(*clkp); 963 clkdev_add(&c->lk);
964 clk_register(c->lk.clk);
965 omap2_init_clk_clkdm(c->lk.clk);
495 } 966 }
496 }
497 967
498 /* REVISIT: Not yet ready for OMAP3 */ 968 /* REVISIT: Not yet ready for OMAP3 */
499#if 0 969#if 0
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index a826094d89b5..70ec10deb654 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -27,13 +27,14 @@
27#include "prm.h" 27#include "prm.h"
28#include "prm-regbits-34xx.h" 28#include "prm-regbits-34xx.h"
29 29
30static void omap3_dpll_recalc(struct clk *clk); 30static unsigned long omap3_dpll_recalc(struct clk *clk);
31static void omap3_clkoutx2_recalc(struct clk *clk); 31static unsigned long omap3_clkoutx2_recalc(struct clk *clk);
32static void omap3_dpll_allow_idle(struct clk *clk); 32static void omap3_dpll_allow_idle(struct clk *clk);
33static void omap3_dpll_deny_idle(struct clk *clk); 33static void omap3_dpll_deny_idle(struct clk *clk);
34static u32 omap3_dpll_autoidle_read(struct clk *clk); 34static u32 omap3_dpll_autoidle_read(struct clk *clk);
35static int omap3_noncore_dpll_enable(struct clk *clk); 35static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate);
36static void omap3_noncore_dpll_disable(struct clk *clk); 36static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate);
37static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate);
37 38
38/* Maximum DPLL multiplier, divider values for OMAP3 */ 39/* Maximum DPLL multiplier, divider values for OMAP3 */
39#define OMAP3_MAX_DPLL_MULT 2048 40#define OMAP3_MAX_DPLL_MULT 2048
@@ -47,6 +48,10 @@ static void omap3_noncore_dpll_disable(struct clk *clk);
47 * DPLL5 supplies other peripheral clocks (USBHOST, USIM). 48 * DPLL5 supplies other peripheral clocks (USBHOST, USIM).
48 */ 49 */
49 50
51/* Forward declarations for DPLL bypass clocks */
52static struct clk dpll1_fck;
53static struct clk dpll2_fck;
54
50/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */ 55/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
51#define DPLL_LOW_POWER_STOP 0x1 56#define DPLL_LOW_POWER_STOP 0x1
52#define DPLL_LOW_POWER_BYPASS 0x5 57#define DPLL_LOW_POWER_BYPASS 0x5
@@ -57,67 +62,59 @@ static void omap3_noncore_dpll_disable(struct clk *clk);
57/* According to timer32k.c, this is a 32768Hz clock, not a 32000Hz clock. */ 62/* According to timer32k.c, this is a 32768Hz clock, not a 32000Hz clock. */
58static struct clk omap_32k_fck = { 63static struct clk omap_32k_fck = {
59 .name = "omap_32k_fck", 64 .name = "omap_32k_fck",
65 .ops = &clkops_null,
60 .rate = 32768, 66 .rate = 32768,
61 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 67 .flags = RATE_FIXED,
62 ALWAYS_ENABLED,
63 .recalc = &propagate_rate,
64}; 68};
65 69
66static struct clk secure_32k_fck = { 70static struct clk secure_32k_fck = {
67 .name = "secure_32k_fck", 71 .name = "secure_32k_fck",
72 .ops = &clkops_null,
68 .rate = 32768, 73 .rate = 32768,
69 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 74 .flags = RATE_FIXED,
70 ALWAYS_ENABLED,
71 .recalc = &propagate_rate,
72}; 75};
73 76
74/* Virtual source clocks for osc_sys_ck */ 77/* Virtual source clocks for osc_sys_ck */
75static struct clk virt_12m_ck = { 78static struct clk virt_12m_ck = {
76 .name = "virt_12m_ck", 79 .name = "virt_12m_ck",
80 .ops = &clkops_null,
77 .rate = 12000000, 81 .rate = 12000000,
78 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 82 .flags = RATE_FIXED,
79 ALWAYS_ENABLED,
80 .recalc = &propagate_rate,
81}; 83};
82 84
83static struct clk virt_13m_ck = { 85static struct clk virt_13m_ck = {
84 .name = "virt_13m_ck", 86 .name = "virt_13m_ck",
87 .ops = &clkops_null,
85 .rate = 13000000, 88 .rate = 13000000,
86 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 89 .flags = RATE_FIXED,
87 ALWAYS_ENABLED,
88 .recalc = &propagate_rate,
89}; 90};
90 91
91static struct clk virt_16_8m_ck = { 92static struct clk virt_16_8m_ck = {
92 .name = "virt_16_8m_ck", 93 .name = "virt_16_8m_ck",
94 .ops = &clkops_null,
93 .rate = 16800000, 95 .rate = 16800000,
94 .flags = CLOCK_IN_OMAP3430ES2 | RATE_FIXED | RATE_PROPAGATES | 96 .flags = RATE_FIXED,
95 ALWAYS_ENABLED,
96 .recalc = &propagate_rate,
97}; 97};
98 98
99static struct clk virt_19_2m_ck = { 99static struct clk virt_19_2m_ck = {
100 .name = "virt_19_2m_ck", 100 .name = "virt_19_2m_ck",
101 .ops = &clkops_null,
101 .rate = 19200000, 102 .rate = 19200000,
102 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 103 .flags = RATE_FIXED,
103 ALWAYS_ENABLED,
104 .recalc = &propagate_rate,
105}; 104};
106 105
107static struct clk virt_26m_ck = { 106static struct clk virt_26m_ck = {
108 .name = "virt_26m_ck", 107 .name = "virt_26m_ck",
108 .ops = &clkops_null,
109 .rate = 26000000, 109 .rate = 26000000,
110 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 110 .flags = RATE_FIXED,
111 ALWAYS_ENABLED,
112 .recalc = &propagate_rate,
113}; 111};
114 112
115static struct clk virt_38_4m_ck = { 113static struct clk virt_38_4m_ck = {
116 .name = "virt_38_4m_ck", 114 .name = "virt_38_4m_ck",
115 .ops = &clkops_null,
117 .rate = 38400000, 116 .rate = 38400000,
118 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 117 .flags = RATE_FIXED,
119 ALWAYS_ENABLED,
120 .recalc = &propagate_rate,
121}; 118};
122 119
123static const struct clksel_rate osc_sys_12m_rates[] = { 120static const struct clksel_rate osc_sys_12m_rates[] = {
@@ -164,13 +161,13 @@ static const struct clksel osc_sys_clksel[] = {
164/* 12, 13, 16.8, 19.2, 26, or 38.4 MHz */ 161/* 12, 13, 16.8, 19.2, 26, or 38.4 MHz */
165static struct clk osc_sys_ck = { 162static struct clk osc_sys_ck = {
166 .name = "osc_sys_ck", 163 .name = "osc_sys_ck",
164 .ops = &clkops_null,
167 .init = &omap2_init_clksel_parent, 165 .init = &omap2_init_clksel_parent,
168 .clksel_reg = OMAP3430_PRM_CLKSEL, 166 .clksel_reg = OMAP3430_PRM_CLKSEL,
169 .clksel_mask = OMAP3430_SYS_CLKIN_SEL_MASK, 167 .clksel_mask = OMAP3430_SYS_CLKIN_SEL_MASK,
170 .clksel = osc_sys_clksel, 168 .clksel = osc_sys_clksel,
171 /* REVISIT: deal with autoextclkmode? */ 169 /* REVISIT: deal with autoextclkmode? */
172 .flags = CLOCK_IN_OMAP343X | RATE_FIXED | RATE_PROPAGATES | 170 .flags = RATE_FIXED,
173 ALWAYS_ENABLED,
174 .recalc = &omap2_clksel_recalc, 171 .recalc = &omap2_clksel_recalc,
175}; 172};
176 173
@@ -189,36 +186,34 @@ static const struct clksel sys_clksel[] = {
189/* Feeds DPLLs - divided first by PRM_CLKSRC_CTRL.SYSCLKDIV? */ 186/* Feeds DPLLs - divided first by PRM_CLKSRC_CTRL.SYSCLKDIV? */
190static struct clk sys_ck = { 187static struct clk sys_ck = {
191 .name = "sys_ck", 188 .name = "sys_ck",
189 .ops = &clkops_null,
192 .parent = &osc_sys_ck, 190 .parent = &osc_sys_ck,
193 .init = &omap2_init_clksel_parent, 191 .init = &omap2_init_clksel_parent,
194 .clksel_reg = OMAP3430_PRM_CLKSRC_CTRL, 192 .clksel_reg = OMAP3430_PRM_CLKSRC_CTRL,
195 .clksel_mask = OMAP_SYSCLKDIV_MASK, 193 .clksel_mask = OMAP_SYSCLKDIV_MASK,
196 .clksel = sys_clksel, 194 .clksel = sys_clksel,
197 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
198 .recalc = &omap2_clksel_recalc, 195 .recalc = &omap2_clksel_recalc,
199}; 196};
200 197
201static struct clk sys_altclk = { 198static struct clk sys_altclk = {
202 .name = "sys_altclk", 199 .name = "sys_altclk",
203 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, 200 .ops = &clkops_null,
204 .recalc = &propagate_rate,
205}; 201};
206 202
207/* Optional external clock input for some McBSPs */ 203/* Optional external clock input for some McBSPs */
208static struct clk mcbsp_clks = { 204static struct clk mcbsp_clks = {
209 .name = "mcbsp_clks", 205 .name = "mcbsp_clks",
210 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED, 206 .ops = &clkops_null,
211 .recalc = &propagate_rate,
212}; 207};
213 208
214/* PRM EXTERNAL CLOCK OUTPUT */ 209/* PRM EXTERNAL CLOCK OUTPUT */
215 210
216static struct clk sys_clkout1 = { 211static struct clk sys_clkout1 = {
217 .name = "sys_clkout1", 212 .name = "sys_clkout1",
213 .ops = &clkops_omap2_dflt,
218 .parent = &osc_sys_ck, 214 .parent = &osc_sys_ck,
219 .enable_reg = OMAP3430_PRM_CLKOUT_CTRL, 215 .enable_reg = OMAP3430_PRM_CLKOUT_CTRL,
220 .enable_bit = OMAP3430_CLKOUT_EN_SHIFT, 216 .enable_bit = OMAP3430_CLKOUT_EN_SHIFT,
221 .flags = CLOCK_IN_OMAP343X,
222 .recalc = &followparent_recalc, 217 .recalc = &followparent_recalc,
223}; 218};
224 219
@@ -226,16 +221,6 @@ static struct clk sys_clkout1 = {
226 221
227/* CM CLOCKS */ 222/* CM CLOCKS */
228 223
229static const struct clksel_rate dpll_bypass_rates[] = {
230 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
231 { .div = 0 }
232};
233
234static const struct clksel_rate dpll_locked_rates[] = {
235 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
236 { .div = 0 }
237};
238
239static const struct clksel_rate div16_dpll_rates[] = { 224static const struct clksel_rate div16_dpll_rates[] = {
240 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE }, 225 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
241 { .div = 2, .val = 2, .flags = RATE_IN_343X }, 226 { .div = 2, .val = 2, .flags = RATE_IN_343X },
@@ -263,6 +248,9 @@ static struct dpll_data dpll1_dd = {
263 .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL), 248 .mult_div1_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
264 .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK, 249 .mult_mask = OMAP3430_MPU_DPLL_MULT_MASK,
265 .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK, 250 .div1_mask = OMAP3430_MPU_DPLL_DIV_MASK,
251 .clk_bypass = &dpll1_fck,
252 .clk_ref = &sys_ck,
253 .freqsel_mask = OMAP3430_MPU_DPLL_FREQSEL_MASK,
266 .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL), 254 .control_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKEN_PLL),
267 .enable_mask = OMAP3430_EN_MPU_DPLL_MASK, 255 .enable_mask = OMAP3430_EN_MPU_DPLL_MASK,
268 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), 256 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
@@ -272,18 +260,21 @@ static struct dpll_data dpll1_dd = {
272 .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL), 260 .autoidle_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL),
273 .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK, 261 .autoidle_mask = OMAP3430_AUTO_MPU_DPLL_MASK,
274 .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL), 262 .idlest_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
275 .idlest_bit = OMAP3430_ST_MPU_CLK_SHIFT, 263 .idlest_mask = OMAP3430_ST_MPU_CLK_MASK,
276 .max_multiplier = OMAP3_MAX_DPLL_MULT, 264 .max_multiplier = OMAP3_MAX_DPLL_MULT,
265 .min_divider = 1,
277 .max_divider = OMAP3_MAX_DPLL_DIV, 266 .max_divider = OMAP3_MAX_DPLL_DIV,
278 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE 267 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
279}; 268};
280 269
281static struct clk dpll1_ck = { 270static struct clk dpll1_ck = {
282 .name = "dpll1_ck", 271 .name = "dpll1_ck",
272 .ops = &clkops_null,
283 .parent = &sys_ck, 273 .parent = &sys_ck,
284 .dpll_data = &dpll1_dd, 274 .dpll_data = &dpll1_dd,
285 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
286 .round_rate = &omap2_dpll_round_rate, 275 .round_rate = &omap2_dpll_round_rate,
276 .set_rate = &omap3_noncore_dpll_set_rate,
277 .clkdm_name = "dpll1_clkdm",
287 .recalc = &omap3_dpll_recalc, 278 .recalc = &omap3_dpll_recalc,
288}; 279};
289 280
@@ -293,9 +284,9 @@ static struct clk dpll1_ck = {
293 */ 284 */
294static struct clk dpll1_x2_ck = { 285static struct clk dpll1_x2_ck = {
295 .name = "dpll1_x2_ck", 286 .name = "dpll1_x2_ck",
287 .ops = &clkops_null,
296 .parent = &dpll1_ck, 288 .parent = &dpll1_ck,
297 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 289 .clkdm_name = "dpll1_clkdm",
298 PARENT_CONTROLS_CLOCK,
299 .recalc = &omap3_clkoutx2_recalc, 290 .recalc = &omap3_clkoutx2_recalc,
300}; 291};
301 292
@@ -311,13 +302,13 @@ static const struct clksel div16_dpll1_x2m2_clksel[] = {
311 */ 302 */
312static struct clk dpll1_x2m2_ck = { 303static struct clk dpll1_x2m2_ck = {
313 .name = "dpll1_x2m2_ck", 304 .name = "dpll1_x2m2_ck",
305 .ops = &clkops_null,
314 .parent = &dpll1_x2_ck, 306 .parent = &dpll1_x2_ck,
315 .init = &omap2_init_clksel_parent, 307 .init = &omap2_init_clksel_parent,
316 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL), 308 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL),
317 .clksel_mask = OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK, 309 .clksel_mask = OMAP3430_MPU_DPLL_CLKOUT_DIV_MASK,
318 .clksel = div16_dpll1_x2m2_clksel, 310 .clksel = div16_dpll1_x2m2_clksel,
319 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 311 .clkdm_name = "dpll1_clkdm",
320 PARENT_CONTROLS_CLOCK,
321 .recalc = &omap2_clksel_recalc, 312 .recalc = &omap2_clksel_recalc,
322}; 313};
323 314
@@ -329,6 +320,9 @@ static struct dpll_data dpll2_dd = {
329 .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL), 320 .mult_div1_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
330 .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK, 321 .mult_mask = OMAP3430_IVA2_DPLL_MULT_MASK,
331 .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK, 322 .div1_mask = OMAP3430_IVA2_DPLL_DIV_MASK,
323 .clk_bypass = &dpll2_fck,
324 .clk_ref = &sys_ck,
325 .freqsel_mask = OMAP3430_IVA2_DPLL_FREQSEL_MASK,
332 .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL), 326 .control_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL),
333 .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK, 327 .enable_mask = OMAP3430_EN_IVA2_DPLL_MASK,
334 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) | 328 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED) |
@@ -339,20 +333,21 @@ static struct dpll_data dpll2_dd = {
339 .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL), 333 .autoidle_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_AUTOIDLE_PLL),
340 .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK, 334 .autoidle_mask = OMAP3430_AUTO_IVA2_DPLL_MASK,
341 .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL), 335 .idlest_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_IDLEST_PLL),
342 .idlest_bit = OMAP3430_ST_IVA2_CLK_SHIFT, 336 .idlest_mask = OMAP3430_ST_IVA2_CLK_MASK,
343 .max_multiplier = OMAP3_MAX_DPLL_MULT, 337 .max_multiplier = OMAP3_MAX_DPLL_MULT,
338 .min_divider = 1,
344 .max_divider = OMAP3_MAX_DPLL_DIV, 339 .max_divider = OMAP3_MAX_DPLL_DIV,
345 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE 340 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
346}; 341};
347 342
348static struct clk dpll2_ck = { 343static struct clk dpll2_ck = {
349 .name = "dpll2_ck", 344 .name = "dpll2_ck",
345 .ops = &clkops_noncore_dpll_ops,
350 .parent = &sys_ck, 346 .parent = &sys_ck,
351 .dpll_data = &dpll2_dd, 347 .dpll_data = &dpll2_dd,
352 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
353 .enable = &omap3_noncore_dpll_enable,
354 .disable = &omap3_noncore_dpll_disable,
355 .round_rate = &omap2_dpll_round_rate, 348 .round_rate = &omap2_dpll_round_rate,
349 .set_rate = &omap3_noncore_dpll_set_rate,
350 .clkdm_name = "dpll2_clkdm",
356 .recalc = &omap3_dpll_recalc, 351 .recalc = &omap3_dpll_recalc,
357}; 352};
358 353
@@ -367,14 +362,14 @@ static const struct clksel div16_dpll2_m2x2_clksel[] = {
367 */ 362 */
368static struct clk dpll2_m2_ck = { 363static struct clk dpll2_m2_ck = {
369 .name = "dpll2_m2_ck", 364 .name = "dpll2_m2_ck",
365 .ops = &clkops_null,
370 .parent = &dpll2_ck, 366 .parent = &dpll2_ck,
371 .init = &omap2_init_clksel_parent, 367 .init = &omap2_init_clksel_parent,
372 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, 368 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD,
373 OMAP3430_CM_CLKSEL2_PLL), 369 OMAP3430_CM_CLKSEL2_PLL),
374 .clksel_mask = OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK, 370 .clksel_mask = OMAP3430_IVA2_DPLL_CLKOUT_DIV_MASK,
375 .clksel = div16_dpll2_m2x2_clksel, 371 .clksel = div16_dpll2_m2x2_clksel,
376 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 372 .clkdm_name = "dpll2_clkdm",
377 PARENT_CONTROLS_CLOCK,
378 .recalc = &omap2_clksel_recalc, 373 .recalc = &omap2_clksel_recalc,
379}; 374};
380 375
@@ -387,6 +382,9 @@ static struct dpll_data dpll3_dd = {
387 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 382 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
388 .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK, 383 .mult_mask = OMAP3430_CORE_DPLL_MULT_MASK,
389 .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK, 384 .div1_mask = OMAP3430_CORE_DPLL_DIV_MASK,
385 .clk_bypass = &sys_ck,
386 .clk_ref = &sys_ck,
387 .freqsel_mask = OMAP3430_CORE_DPLL_FREQSEL_MASK,
390 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 388 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
391 .enable_mask = OMAP3430_EN_CORE_DPLL_MASK, 389 .enable_mask = OMAP3430_EN_CORE_DPLL_MASK,
392 .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT, 390 .auto_recal_bit = OMAP3430_EN_CORE_DPLL_DRIFTGUARD_SHIFT,
@@ -394,17 +392,21 @@ static struct dpll_data dpll3_dd = {
394 .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT, 392 .recal_st_bit = OMAP3430_CORE_DPLL_ST_SHIFT,
395 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE), 393 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
396 .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK, 394 .autoidle_mask = OMAP3430_AUTO_CORE_DPLL_MASK,
395 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
396 .idlest_mask = OMAP3430_ST_CORE_CLK_MASK,
397 .max_multiplier = OMAP3_MAX_DPLL_MULT, 397 .max_multiplier = OMAP3_MAX_DPLL_MULT,
398 .min_divider = 1,
398 .max_divider = OMAP3_MAX_DPLL_DIV, 399 .max_divider = OMAP3_MAX_DPLL_DIV,
399 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE 400 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
400}; 401};
401 402
402static struct clk dpll3_ck = { 403static struct clk dpll3_ck = {
403 .name = "dpll3_ck", 404 .name = "dpll3_ck",
405 .ops = &clkops_null,
404 .parent = &sys_ck, 406 .parent = &sys_ck,
405 .dpll_data = &dpll3_dd, 407 .dpll_data = &dpll3_dd,
406 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
407 .round_rate = &omap2_dpll_round_rate, 408 .round_rate = &omap2_dpll_round_rate,
409 .clkdm_name = "dpll3_clkdm",
408 .recalc = &omap3_dpll_recalc, 410 .recalc = &omap3_dpll_recalc,
409}; 411};
410 412
@@ -414,9 +416,9 @@ static struct clk dpll3_ck = {
414 */ 416 */
415static struct clk dpll3_x2_ck = { 417static struct clk dpll3_x2_ck = {
416 .name = "dpll3_x2_ck", 418 .name = "dpll3_x2_ck",
419 .ops = &clkops_null,
417 .parent = &dpll3_ck, 420 .parent = &dpll3_ck,
418 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 421 .clkdm_name = "dpll3_clkdm",
419 PARENT_CONTROLS_CLOCK,
420 .recalc = &omap3_clkoutx2_recalc, 422 .recalc = &omap3_clkoutx2_recalc,
421}; 423};
422 424
@@ -460,55 +462,34 @@ static const struct clksel div31_dpll3m2_clksel[] = {
460 { .parent = NULL } 462 { .parent = NULL }
461}; 463};
462 464
463/* 465/* DPLL3 output M2 - primary control point for CORE speed */
464 * DPLL3 output M2
465 * REVISIT: This DPLL output divider must be changed in SRAM, so until
466 * that code is ready, this should remain a 'read-only' clksel clock.
467 */
468static struct clk dpll3_m2_ck = { 466static struct clk dpll3_m2_ck = {
469 .name = "dpll3_m2_ck", 467 .name = "dpll3_m2_ck",
468 .ops = &clkops_null,
470 .parent = &dpll3_ck, 469 .parent = &dpll3_ck,
471 .init = &omap2_init_clksel_parent, 470 .init = &omap2_init_clksel_parent,
472 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 471 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
473 .clksel_mask = OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK, 472 .clksel_mask = OMAP3430_CORE_DPLL_CLKOUT_DIV_MASK,
474 .clksel = div31_dpll3m2_clksel, 473 .clksel = div31_dpll3m2_clksel,
475 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 474 .clkdm_name = "dpll3_clkdm",
476 PARENT_CONTROLS_CLOCK, 475 .round_rate = &omap2_clksel_round_rate,
476 .set_rate = &omap3_core_dpll_m2_set_rate,
477 .recalc = &omap2_clksel_recalc, 477 .recalc = &omap2_clksel_recalc,
478}; 478};
479 479
480static const struct clksel core_ck_clksel[] = {
481 { .parent = &sys_ck, .rates = dpll_bypass_rates },
482 { .parent = &dpll3_m2_ck, .rates = dpll_locked_rates },
483 { .parent = NULL }
484};
485
486static struct clk core_ck = { 480static struct clk core_ck = {
487 .name = "core_ck", 481 .name = "core_ck",
488 .init = &omap2_init_clksel_parent, 482 .ops = &clkops_null,
489 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), 483 .parent = &dpll3_m2_ck,
490 .clksel_mask = OMAP3430_ST_CORE_CLK_MASK, 484 .recalc = &followparent_recalc,
491 .clksel = core_ck_clksel,
492 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
493 PARENT_CONTROLS_CLOCK,
494 .recalc = &omap2_clksel_recalc,
495};
496
497static const struct clksel dpll3_m2x2_ck_clksel[] = {
498 { .parent = &sys_ck, .rates = dpll_bypass_rates },
499 { .parent = &dpll3_x2_ck, .rates = dpll_locked_rates },
500 { .parent = NULL }
501}; 485};
502 486
503static struct clk dpll3_m2x2_ck = { 487static struct clk dpll3_m2x2_ck = {
504 .name = "dpll3_m2x2_ck", 488 .name = "dpll3_m2x2_ck",
505 .init = &omap2_init_clksel_parent, 489 .ops = &clkops_null,
506 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), 490 .parent = &dpll3_x2_ck,
507 .clksel_mask = OMAP3430_ST_CORE_CLK_MASK, 491 .clkdm_name = "dpll3_clkdm",
508 .clksel = dpll3_m2x2_ck_clksel, 492 .recalc = &followparent_recalc,
509 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
510 PARENT_CONTROLS_CLOCK,
511 .recalc = &omap2_clksel_recalc,
512}; 493};
513 494
514/* The PWRDN bit is apparently only available on 3430ES2 and above */ 495/* The PWRDN bit is apparently only available on 3430ES2 and above */
@@ -520,42 +501,34 @@ static const struct clksel div16_dpll3_clksel[] = {
520/* This virtual clock is the source for dpll3_m3x2_ck */ 501/* This virtual clock is the source for dpll3_m3x2_ck */
521static struct clk dpll3_m3_ck = { 502static struct clk dpll3_m3_ck = {
522 .name = "dpll3_m3_ck", 503 .name = "dpll3_m3_ck",
504 .ops = &clkops_null,
523 .parent = &dpll3_ck, 505 .parent = &dpll3_ck,
524 .init = &omap2_init_clksel_parent, 506 .init = &omap2_init_clksel_parent,
525 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 507 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
526 .clksel_mask = OMAP3430_DIV_DPLL3_MASK, 508 .clksel_mask = OMAP3430_DIV_DPLL3_MASK,
527 .clksel = div16_dpll3_clksel, 509 .clksel = div16_dpll3_clksel,
528 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 510 .clkdm_name = "dpll3_clkdm",
529 PARENT_CONTROLS_CLOCK,
530 .recalc = &omap2_clksel_recalc, 511 .recalc = &omap2_clksel_recalc,
531}; 512};
532 513
533/* The PWRDN bit is apparently only available on 3430ES2 and above */ 514/* The PWRDN bit is apparently only available on 3430ES2 and above */
534static struct clk dpll3_m3x2_ck = { 515static struct clk dpll3_m3x2_ck = {
535 .name = "dpll3_m3x2_ck", 516 .name = "dpll3_m3x2_ck",
517 .ops = &clkops_omap2_dflt_wait,
536 .parent = &dpll3_m3_ck, 518 .parent = &dpll3_m3_ck,
537 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 519 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
538 .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT, 520 .enable_bit = OMAP3430_PWRDN_EMU_CORE_SHIFT,
539 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, 521 .flags = INVERT_ENABLE,
522 .clkdm_name = "dpll3_clkdm",
540 .recalc = &omap3_clkoutx2_recalc, 523 .recalc = &omap3_clkoutx2_recalc,
541}; 524};
542 525
543static const struct clksel emu_core_alwon_ck_clksel[] = {
544 { .parent = &sys_ck, .rates = dpll_bypass_rates },
545 { .parent = &dpll3_m3x2_ck, .rates = dpll_locked_rates },
546 { .parent = NULL }
547};
548
549static struct clk emu_core_alwon_ck = { 526static struct clk emu_core_alwon_ck = {
550 .name = "emu_core_alwon_ck", 527 .name = "emu_core_alwon_ck",
528 .ops = &clkops_null,
551 .parent = &dpll3_m3x2_ck, 529 .parent = &dpll3_m3x2_ck,
552 .init = &omap2_init_clksel_parent, 530 .clkdm_name = "dpll3_clkdm",
553 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), 531 .recalc = &followparent_recalc,
554 .clksel_mask = OMAP3430_ST_CORE_CLK_MASK,
555 .clksel = emu_core_alwon_ck_clksel,
556 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
557 PARENT_CONTROLS_CLOCK,
558 .recalc = &omap2_clksel_recalc,
559}; 532};
560 533
561/* DPLL4 */ 534/* DPLL4 */
@@ -565,6 +538,9 @@ static struct dpll_data dpll4_dd = {
565 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2), 538 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2),
566 .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK, 539 .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK,
567 .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK, 540 .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK,
541 .clk_bypass = &sys_ck,
542 .clk_ref = &sys_ck,
543 .freqsel_mask = OMAP3430_PERIPH_DPLL_FREQSEL_MASK,
568 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 544 .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
569 .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK, 545 .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK,
570 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), 546 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
@@ -574,20 +550,21 @@ static struct dpll_data dpll4_dd = {
574 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE), 550 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE),
575 .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK, 551 .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
576 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), 552 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
577 .idlest_bit = OMAP3430_ST_PERIPH_CLK_SHIFT, 553 .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
578 .max_multiplier = OMAP3_MAX_DPLL_MULT, 554 .max_multiplier = OMAP3_MAX_DPLL_MULT,
555 .min_divider = 1,
579 .max_divider = OMAP3_MAX_DPLL_DIV, 556 .max_divider = OMAP3_MAX_DPLL_DIV,
580 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE 557 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
581}; 558};
582 559
583static struct clk dpll4_ck = { 560static struct clk dpll4_ck = {
584 .name = "dpll4_ck", 561 .name = "dpll4_ck",
562 .ops = &clkops_noncore_dpll_ops,
585 .parent = &sys_ck, 563 .parent = &sys_ck,
586 .dpll_data = &dpll4_dd, 564 .dpll_data = &dpll4_dd,
587 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
588 .enable = &omap3_noncore_dpll_enable,
589 .disable = &omap3_noncore_dpll_disable,
590 .round_rate = &omap2_dpll_round_rate, 565 .round_rate = &omap2_dpll_round_rate,
566 .set_rate = &omap3_dpll4_set_rate,
567 .clkdm_name = "dpll4_clkdm",
591 .recalc = &omap3_dpll_recalc, 568 .recalc = &omap3_dpll_recalc,
592}; 569};
593 570
@@ -598,9 +575,9 @@ static struct clk dpll4_ck = {
598 */ 575 */
599static struct clk dpll4_x2_ck = { 576static struct clk dpll4_x2_ck = {
600 .name = "dpll4_x2_ck", 577 .name = "dpll4_x2_ck",
578 .ops = &clkops_null,
601 .parent = &dpll4_ck, 579 .parent = &dpll4_ck,
602 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 580 .clkdm_name = "dpll4_clkdm",
603 PARENT_CONTROLS_CLOCK,
604 .recalc = &omap3_clkoutx2_recalc, 581 .recalc = &omap3_clkoutx2_recalc,
605}; 582};
606 583
@@ -612,112 +589,101 @@ static const struct clksel div16_dpll4_clksel[] = {
612/* This virtual clock is the source for dpll4_m2x2_ck */ 589/* This virtual clock is the source for dpll4_m2x2_ck */
613static struct clk dpll4_m2_ck = { 590static struct clk dpll4_m2_ck = {
614 .name = "dpll4_m2_ck", 591 .name = "dpll4_m2_ck",
592 .ops = &clkops_null,
615 .parent = &dpll4_ck, 593 .parent = &dpll4_ck,
616 .init = &omap2_init_clksel_parent, 594 .init = &omap2_init_clksel_parent,
617 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3), 595 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3),
618 .clksel_mask = OMAP3430_DIV_96M_MASK, 596 .clksel_mask = OMAP3430_DIV_96M_MASK,
619 .clksel = div16_dpll4_clksel, 597 .clksel = div16_dpll4_clksel,
620 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 598 .clkdm_name = "dpll4_clkdm",
621 PARENT_CONTROLS_CLOCK,
622 .recalc = &omap2_clksel_recalc, 599 .recalc = &omap2_clksel_recalc,
623}; 600};
624 601
625/* The PWRDN bit is apparently only available on 3430ES2 and above */ 602/* The PWRDN bit is apparently only available on 3430ES2 and above */
626static struct clk dpll4_m2x2_ck = { 603static struct clk dpll4_m2x2_ck = {
627 .name = "dpll4_m2x2_ck", 604 .name = "dpll4_m2x2_ck",
605 .ops = &clkops_omap2_dflt_wait,
628 .parent = &dpll4_m2_ck, 606 .parent = &dpll4_m2_ck,
629 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 607 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
630 .enable_bit = OMAP3430_PWRDN_96M_SHIFT, 608 .enable_bit = OMAP3430_PWRDN_96M_SHIFT,
631 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, 609 .flags = INVERT_ENABLE,
610 .clkdm_name = "dpll4_clkdm",
632 .recalc = &omap3_clkoutx2_recalc, 611 .recalc = &omap3_clkoutx2_recalc,
633}; 612};
634 613
635static const struct clksel omap_96m_alwon_fck_clksel[] = { 614/*
636 { .parent = &sys_ck, .rates = dpll_bypass_rates }, 615 * DPLL4 generates DPLL4_M2X2_CLK which is then routed into the PRM as
637 { .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates }, 616 * PRM_96M_ALWON_(F)CLK. Two clocks then emerge from the PRM:
638 { .parent = NULL } 617 * 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and
639}; 618 * CM_96K_(F)CLK.
640 619 */
641static struct clk omap_96m_alwon_fck = { 620static struct clk omap_96m_alwon_fck = {
642 .name = "omap_96m_alwon_fck", 621 .name = "omap_96m_alwon_fck",
622 .ops = &clkops_null,
643 .parent = &dpll4_m2x2_ck, 623 .parent = &dpll4_m2x2_ck,
644 .init = &omap2_init_clksel_parent, 624 .recalc = &followparent_recalc,
645 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
646 .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK,
647 .clksel = omap_96m_alwon_fck_clksel,
648 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
649 PARENT_CONTROLS_CLOCK,
650 .recalc = &omap2_clksel_recalc,
651}; 625};
652 626
653static struct clk omap_96m_fck = { 627static struct clk cm_96m_fck = {
654 .name = "omap_96m_fck", 628 .name = "cm_96m_fck",
629 .ops = &clkops_null,
655 .parent = &omap_96m_alwon_fck, 630 .parent = &omap_96m_alwon_fck,
656 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
657 PARENT_CONTROLS_CLOCK,
658 .recalc = &followparent_recalc, 631 .recalc = &followparent_recalc,
659}; 632};
660 633
661static const struct clksel cm_96m_fck_clksel[] = { 634static const struct clksel_rate omap_96m_dpll_rates[] = {
662 { .parent = &sys_ck, .rates = dpll_bypass_rates }, 635 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
663 { .parent = &dpll4_m2x2_ck, .rates = dpll_locked_rates }, 636 { .div = 0 }
637};
638
639static const struct clksel_rate omap_96m_sys_rates[] = {
640 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
641 { .div = 0 }
642};
643
644static const struct clksel omap_96m_fck_clksel[] = {
645 { .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates },
646 { .parent = &sys_ck, .rates = omap_96m_sys_rates },
664 { .parent = NULL } 647 { .parent = NULL }
665}; 648};
666 649
667static struct clk cm_96m_fck = { 650static struct clk omap_96m_fck = {
668 .name = "cm_96m_fck", 651 .name = "omap_96m_fck",
669 .parent = &dpll4_m2x2_ck, 652 .ops = &clkops_null,
653 .parent = &sys_ck,
670 .init = &omap2_init_clksel_parent, 654 .init = &omap2_init_clksel_parent,
671 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), 655 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
672 .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK, 656 .clksel_mask = OMAP3430_SOURCE_96M_MASK,
673 .clksel = cm_96m_fck_clksel, 657 .clksel = omap_96m_fck_clksel,
674 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
675 PARENT_CONTROLS_CLOCK,
676 .recalc = &omap2_clksel_recalc, 658 .recalc = &omap2_clksel_recalc,
677}; 659};
678 660
679/* This virtual clock is the source for dpll4_m3x2_ck */ 661/* This virtual clock is the source for dpll4_m3x2_ck */
680static struct clk dpll4_m3_ck = { 662static struct clk dpll4_m3_ck = {
681 .name = "dpll4_m3_ck", 663 .name = "dpll4_m3_ck",
664 .ops = &clkops_null,
682 .parent = &dpll4_ck, 665 .parent = &dpll4_ck,
683 .init = &omap2_init_clksel_parent, 666 .init = &omap2_init_clksel_parent,
684 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), 667 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
685 .clksel_mask = OMAP3430_CLKSEL_TV_MASK, 668 .clksel_mask = OMAP3430_CLKSEL_TV_MASK,
686 .clksel = div16_dpll4_clksel, 669 .clksel = div16_dpll4_clksel,
687 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 670 .clkdm_name = "dpll4_clkdm",
688 PARENT_CONTROLS_CLOCK,
689 .recalc = &omap2_clksel_recalc, 671 .recalc = &omap2_clksel_recalc,
690}; 672};
691 673
692/* The PWRDN bit is apparently only available on 3430ES2 and above */ 674/* The PWRDN bit is apparently only available on 3430ES2 and above */
693static struct clk dpll4_m3x2_ck = { 675static struct clk dpll4_m3x2_ck = {
694 .name = "dpll4_m3x2_ck", 676 .name = "dpll4_m3x2_ck",
677 .ops = &clkops_omap2_dflt_wait,
695 .parent = &dpll4_m3_ck, 678 .parent = &dpll4_m3_ck,
696 .init = &omap2_init_clksel_parent, 679 .init = &omap2_init_clksel_parent,
697 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 680 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
698 .enable_bit = OMAP3430_PWRDN_TV_SHIFT, 681 .enable_bit = OMAP3430_PWRDN_TV_SHIFT,
699 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, 682 .flags = INVERT_ENABLE,
683 .clkdm_name = "dpll4_clkdm",
700 .recalc = &omap3_clkoutx2_recalc, 684 .recalc = &omap3_clkoutx2_recalc,
701}; 685};
702 686
703static const struct clksel virt_omap_54m_fck_clksel[] = {
704 { .parent = &sys_ck, .rates = dpll_bypass_rates },
705 { .parent = &dpll4_m3x2_ck, .rates = dpll_locked_rates },
706 { .parent = NULL }
707};
708
709static struct clk virt_omap_54m_fck = {
710 .name = "virt_omap_54m_fck",
711 .parent = &dpll4_m3x2_ck,
712 .init = &omap2_init_clksel_parent,
713 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
714 .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK,
715 .clksel = virt_omap_54m_fck_clksel,
716 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
717 PARENT_CONTROLS_CLOCK,
718 .recalc = &omap2_clksel_recalc,
719};
720
721static const struct clksel_rate omap_54m_d4m3x2_rates[] = { 687static const struct clksel_rate omap_54m_d4m3x2_rates[] = {
722 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, 688 { .div = 1, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
723 { .div = 0 } 689 { .div = 0 }
@@ -729,23 +695,22 @@ static const struct clksel_rate omap_54m_alt_rates[] = {
729}; 695};
730 696
731static const struct clksel omap_54m_clksel[] = { 697static const struct clksel omap_54m_clksel[] = {
732 { .parent = &virt_omap_54m_fck, .rates = omap_54m_d4m3x2_rates }, 698 { .parent = &dpll4_m3x2_ck, .rates = omap_54m_d4m3x2_rates },
733 { .parent = &sys_altclk, .rates = omap_54m_alt_rates }, 699 { .parent = &sys_altclk, .rates = omap_54m_alt_rates },
734 { .parent = NULL } 700 { .parent = NULL }
735}; 701};
736 702
737static struct clk omap_54m_fck = { 703static struct clk omap_54m_fck = {
738 .name = "omap_54m_fck", 704 .name = "omap_54m_fck",
705 .ops = &clkops_null,
739 .init = &omap2_init_clksel_parent, 706 .init = &omap2_init_clksel_parent,
740 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 707 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
741 .clksel_mask = OMAP3430_SOURCE_54M, 708 .clksel_mask = OMAP3430_SOURCE_54M_MASK,
742 .clksel = omap_54m_clksel, 709 .clksel = omap_54m_clksel,
743 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
744 PARENT_CONTROLS_CLOCK,
745 .recalc = &omap2_clksel_recalc, 710 .recalc = &omap2_clksel_recalc,
746}; 711};
747 712
748static const struct clksel_rate omap_48m_96md2_rates[] = { 713static const struct clksel_rate omap_48m_cm96m_rates[] = {
749 { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, 714 { .div = 2, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE },
750 { .div = 0 } 715 { .div = 0 }
751}; 716};
@@ -756,106 +721,112 @@ static const struct clksel_rate omap_48m_alt_rates[] = {
756}; 721};
757 722
758static const struct clksel omap_48m_clksel[] = { 723static const struct clksel omap_48m_clksel[] = {
759 { .parent = &cm_96m_fck, .rates = omap_48m_96md2_rates }, 724 { .parent = &cm_96m_fck, .rates = omap_48m_cm96m_rates },
760 { .parent = &sys_altclk, .rates = omap_48m_alt_rates }, 725 { .parent = &sys_altclk, .rates = omap_48m_alt_rates },
761 { .parent = NULL } 726 { .parent = NULL }
762}; 727};
763 728
764static struct clk omap_48m_fck = { 729static struct clk omap_48m_fck = {
765 .name = "omap_48m_fck", 730 .name = "omap_48m_fck",
731 .ops = &clkops_null,
766 .init = &omap2_init_clksel_parent, 732 .init = &omap2_init_clksel_parent,
767 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), 733 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1),
768 .clksel_mask = OMAP3430_SOURCE_48M, 734 .clksel_mask = OMAP3430_SOURCE_48M_MASK,
769 .clksel = omap_48m_clksel, 735 .clksel = omap_48m_clksel,
770 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
771 PARENT_CONTROLS_CLOCK,
772 .recalc = &omap2_clksel_recalc, 736 .recalc = &omap2_clksel_recalc,
773}; 737};
774 738
775static struct clk omap_12m_fck = { 739static struct clk omap_12m_fck = {
776 .name = "omap_12m_fck", 740 .name = "omap_12m_fck",
741 .ops = &clkops_null,
777 .parent = &omap_48m_fck, 742 .parent = &omap_48m_fck,
778 .fixed_div = 4, 743 .fixed_div = 4,
779 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
780 PARENT_CONTROLS_CLOCK,
781 .recalc = &omap2_fixed_divisor_recalc, 744 .recalc = &omap2_fixed_divisor_recalc,
782}; 745};
783 746
784/* This virstual clock is the source for dpll4_m4x2_ck */ 747/* This virstual clock is the source for dpll4_m4x2_ck */
785static struct clk dpll4_m4_ck = { 748static struct clk dpll4_m4_ck = {
786 .name = "dpll4_m4_ck", 749 .name = "dpll4_m4_ck",
750 .ops = &clkops_null,
787 .parent = &dpll4_ck, 751 .parent = &dpll4_ck,
788 .init = &omap2_init_clksel_parent, 752 .init = &omap2_init_clksel_parent,
789 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), 753 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL),
790 .clksel_mask = OMAP3430_CLKSEL_DSS1_MASK, 754 .clksel_mask = OMAP3430_CLKSEL_DSS1_MASK,
791 .clksel = div16_dpll4_clksel, 755 .clksel = div16_dpll4_clksel,
792 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 756 .clkdm_name = "dpll4_clkdm",
793 PARENT_CONTROLS_CLOCK,
794 .recalc = &omap2_clksel_recalc, 757 .recalc = &omap2_clksel_recalc,
758 .set_rate = &omap2_clksel_set_rate,
759 .round_rate = &omap2_clksel_round_rate,
795}; 760};
796 761
797/* The PWRDN bit is apparently only available on 3430ES2 and above */ 762/* The PWRDN bit is apparently only available on 3430ES2 and above */
798static struct clk dpll4_m4x2_ck = { 763static struct clk dpll4_m4x2_ck = {
799 .name = "dpll4_m4x2_ck", 764 .name = "dpll4_m4x2_ck",
765 .ops = &clkops_omap2_dflt_wait,
800 .parent = &dpll4_m4_ck, 766 .parent = &dpll4_m4_ck,
801 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 767 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
802 .enable_bit = OMAP3430_PWRDN_CAM_SHIFT, 768 .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
803 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, 769 .flags = INVERT_ENABLE,
770 .clkdm_name = "dpll4_clkdm",
804 .recalc = &omap3_clkoutx2_recalc, 771 .recalc = &omap3_clkoutx2_recalc,
805}; 772};
806 773
807/* This virtual clock is the source for dpll4_m5x2_ck */ 774/* This virtual clock is the source for dpll4_m5x2_ck */
808static struct clk dpll4_m5_ck = { 775static struct clk dpll4_m5_ck = {
809 .name = "dpll4_m5_ck", 776 .name = "dpll4_m5_ck",
777 .ops = &clkops_null,
810 .parent = &dpll4_ck, 778 .parent = &dpll4_ck,
811 .init = &omap2_init_clksel_parent, 779 .init = &omap2_init_clksel_parent,
812 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), 780 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL),
813 .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, 781 .clksel_mask = OMAP3430_CLKSEL_CAM_MASK,
814 .clksel = div16_dpll4_clksel, 782 .clksel = div16_dpll4_clksel,
815 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 783 .clkdm_name = "dpll4_clkdm",
816 PARENT_CONTROLS_CLOCK,
817 .recalc = &omap2_clksel_recalc, 784 .recalc = &omap2_clksel_recalc,
818}; 785};
819 786
820/* The PWRDN bit is apparently only available on 3430ES2 and above */ 787/* The PWRDN bit is apparently only available on 3430ES2 and above */
821static struct clk dpll4_m5x2_ck = { 788static struct clk dpll4_m5x2_ck = {
822 .name = "dpll4_m5x2_ck", 789 .name = "dpll4_m5x2_ck",
790 .ops = &clkops_omap2_dflt_wait,
823 .parent = &dpll4_m5_ck, 791 .parent = &dpll4_m5_ck,
824 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 792 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
825 .enable_bit = OMAP3430_PWRDN_CAM_SHIFT, 793 .enable_bit = OMAP3430_PWRDN_CAM_SHIFT,
826 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, 794 .flags = INVERT_ENABLE,
795 .clkdm_name = "dpll4_clkdm",
827 .recalc = &omap3_clkoutx2_recalc, 796 .recalc = &omap3_clkoutx2_recalc,
828}; 797};
829 798
830/* This virtual clock is the source for dpll4_m6x2_ck */ 799/* This virtual clock is the source for dpll4_m6x2_ck */
831static struct clk dpll4_m6_ck = { 800static struct clk dpll4_m6_ck = {
832 .name = "dpll4_m6_ck", 801 .name = "dpll4_m6_ck",
802 .ops = &clkops_null,
833 .parent = &dpll4_ck, 803 .parent = &dpll4_ck,
834 .init = &omap2_init_clksel_parent, 804 .init = &omap2_init_clksel_parent,
835 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 805 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
836 .clksel_mask = OMAP3430_DIV_DPLL4_MASK, 806 .clksel_mask = OMAP3430_DIV_DPLL4_MASK,
837 .clksel = div16_dpll4_clksel, 807 .clksel = div16_dpll4_clksel,
838 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 808 .clkdm_name = "dpll4_clkdm",
839 PARENT_CONTROLS_CLOCK,
840 .recalc = &omap2_clksel_recalc, 809 .recalc = &omap2_clksel_recalc,
841}; 810};
842 811
843/* The PWRDN bit is apparently only available on 3430ES2 and above */ 812/* The PWRDN bit is apparently only available on 3430ES2 and above */
844static struct clk dpll4_m6x2_ck = { 813static struct clk dpll4_m6x2_ck = {
845 .name = "dpll4_m6x2_ck", 814 .name = "dpll4_m6x2_ck",
815 .ops = &clkops_omap2_dflt_wait,
846 .parent = &dpll4_m6_ck, 816 .parent = &dpll4_m6_ck,
847 .init = &omap2_init_clksel_parent, 817 .init = &omap2_init_clksel_parent,
848 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), 818 .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN),
849 .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT, 819 .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT,
850 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | INVERT_ENABLE, 820 .flags = INVERT_ENABLE,
821 .clkdm_name = "dpll4_clkdm",
851 .recalc = &omap3_clkoutx2_recalc, 822 .recalc = &omap3_clkoutx2_recalc,
852}; 823};
853 824
854static struct clk emu_per_alwon_ck = { 825static struct clk emu_per_alwon_ck = {
855 .name = "emu_per_alwon_ck", 826 .name = "emu_per_alwon_ck",
827 .ops = &clkops_null,
856 .parent = &dpll4_m6x2_ck, 828 .parent = &dpll4_m6x2_ck,
857 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | 829 .clkdm_name = "dpll4_clkdm",
858 PARENT_CONTROLS_CLOCK,
859 .recalc = &followparent_recalc, 830 .recalc = &followparent_recalc,
860}; 831};
861 832
@@ -867,6 +838,9 @@ static struct dpll_data dpll5_dd = {
867 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4), 838 .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL4),
868 .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK, 839 .mult_mask = OMAP3430ES2_PERIPH2_DPLL_MULT_MASK,
869 .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK, 840 .div1_mask = OMAP3430ES2_PERIPH2_DPLL_DIV_MASK,
841 .clk_bypass = &sys_ck,
842 .clk_ref = &sys_ck,
843 .freqsel_mask = OMAP3430ES2_PERIPH2_DPLL_FREQSEL_MASK,
870 .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2), 844 .control_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKEN2),
871 .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK, 845 .enable_mask = OMAP3430ES2_EN_PERIPH2_DPLL_MASK,
872 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), 846 .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED),
@@ -876,20 +850,21 @@ static struct dpll_data dpll5_dd = {
876 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL), 850 .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_AUTOIDLE2_PLL),
877 .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK, 851 .autoidle_mask = OMAP3430ES2_AUTO_PERIPH2_DPLL_MASK,
878 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2), 852 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
879 .idlest_bit = OMAP3430ES2_ST_PERIPH2_CLK_SHIFT, 853 .idlest_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
880 .max_multiplier = OMAP3_MAX_DPLL_MULT, 854 .max_multiplier = OMAP3_MAX_DPLL_MULT,
855 .min_divider = 1,
881 .max_divider = OMAP3_MAX_DPLL_DIV, 856 .max_divider = OMAP3_MAX_DPLL_DIV,
882 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE 857 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
883}; 858};
884 859
885static struct clk dpll5_ck = { 860static struct clk dpll5_ck = {
886 .name = "dpll5_ck", 861 .name = "dpll5_ck",
862 .ops = &clkops_noncore_dpll_ops,
887 .parent = &sys_ck, 863 .parent = &sys_ck,
888 .dpll_data = &dpll5_dd, 864 .dpll_data = &dpll5_dd,
889 .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES,
890 .enable = &omap3_noncore_dpll_enable,
891 .disable = &omap3_noncore_dpll_disable,
892 .round_rate = &omap2_dpll_round_rate, 865 .round_rate = &omap2_dpll_round_rate,
866 .set_rate = &omap3_noncore_dpll_set_rate,
867 .clkdm_name = "dpll5_clkdm",
893 .recalc = &omap3_dpll_recalc, 868 .recalc = &omap3_dpll_recalc,
894}; 869};
895 870
@@ -900,31 +875,13 @@ static const struct clksel div16_dpll5_clksel[] = {
900 875
901static struct clk dpll5_m2_ck = { 876static struct clk dpll5_m2_ck = {
902 .name = "dpll5_m2_ck", 877 .name = "dpll5_m2_ck",
878 .ops = &clkops_null,
903 .parent = &dpll5_ck, 879 .parent = &dpll5_ck,
904 .init = &omap2_init_clksel_parent, 880 .init = &omap2_init_clksel_parent,
905 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5), 881 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430ES2_CM_CLKSEL5),
906 .clksel_mask = OMAP3430ES2_DIV_120M_MASK, 882 .clksel_mask = OMAP3430ES2_DIV_120M_MASK,
907 .clksel = div16_dpll5_clksel, 883 .clksel = div16_dpll5_clksel,
908 .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES | 884 .clkdm_name = "dpll5_clkdm",
909 PARENT_CONTROLS_CLOCK,
910 .recalc = &omap2_clksel_recalc,
911};
912
913static const struct clksel omap_120m_fck_clksel[] = {
914 { .parent = &sys_ck, .rates = dpll_bypass_rates },
915 { .parent = &dpll5_m2_ck, .rates = dpll_locked_rates },
916 { .parent = NULL }
917};
918
919static struct clk omap_120m_fck = {
920 .name = "omap_120m_fck",
921 .parent = &dpll5_m2_ck,
922 .init = &omap2_init_clksel_parent,
923 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST2),
924 .clksel_mask = OMAP3430ES2_ST_PERIPH2_CLK_MASK,
925 .clksel = omap_120m_fck_clksel,
926 .flags = CLOCK_IN_OMAP3430ES2 | RATE_PROPAGATES |
927 PARENT_CONTROLS_CLOCK,
928 .recalc = &omap2_clksel_recalc, 885 .recalc = &omap2_clksel_recalc,
929}; 886};
930 887
@@ -951,22 +908,23 @@ static const struct clksel_rate clkout2_src_54m_rates[] = {
951}; 908};
952 909
953static const struct clksel clkout2_src_clksel[] = { 910static const struct clksel clkout2_src_clksel[] = {
954 { .parent = &core_ck, .rates = clkout2_src_core_rates }, 911 { .parent = &core_ck, .rates = clkout2_src_core_rates },
955 { .parent = &sys_ck, .rates = clkout2_src_sys_rates }, 912 { .parent = &sys_ck, .rates = clkout2_src_sys_rates },
956 { .parent = &omap_96m_alwon_fck, .rates = clkout2_src_96m_rates }, 913 { .parent = &cm_96m_fck, .rates = clkout2_src_96m_rates },
957 { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates }, 914 { .parent = &omap_54m_fck, .rates = clkout2_src_54m_rates },
958 { .parent = NULL } 915 { .parent = NULL }
959}; 916};
960 917
961static struct clk clkout2_src_ck = { 918static struct clk clkout2_src_ck = {
962 .name = "clkout2_src_ck", 919 .name = "clkout2_src_ck",
920 .ops = &clkops_omap2_dflt,
963 .init = &omap2_init_clksel_parent, 921 .init = &omap2_init_clksel_parent,
964 .enable_reg = OMAP3430_CM_CLKOUT_CTRL, 922 .enable_reg = OMAP3430_CM_CLKOUT_CTRL,
965 .enable_bit = OMAP3430_CLKOUT2_EN_SHIFT, 923 .enable_bit = OMAP3430_CLKOUT2_EN_SHIFT,
966 .clksel_reg = OMAP3430_CM_CLKOUT_CTRL, 924 .clksel_reg = OMAP3430_CM_CLKOUT_CTRL,
967 .clksel_mask = OMAP3430_CLKOUT2SOURCE_MASK, 925 .clksel_mask = OMAP3430_CLKOUT2SOURCE_MASK,
968 .clksel = clkout2_src_clksel, 926 .clksel = clkout2_src_clksel,
969 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES, 927 .clkdm_name = "core_clkdm",
970 .recalc = &omap2_clksel_recalc, 928 .recalc = &omap2_clksel_recalc,
971}; 929};
972 930
@@ -986,11 +944,11 @@ static const struct clksel sys_clkout2_clksel[] = {
986 944
987static struct clk sys_clkout2 = { 945static struct clk sys_clkout2 = {
988 .name = "sys_clkout2", 946 .name = "sys_clkout2",
947 .ops = &clkops_null,
989 .init = &omap2_init_clksel_parent, 948 .init = &omap2_init_clksel_parent,
990 .clksel_reg = OMAP3430_CM_CLKOUT_CTRL, 949 .clksel_reg = OMAP3430_CM_CLKOUT_CTRL,
991 .clksel_mask = OMAP3430_CLKOUT2_DIV_MASK, 950 .clksel_mask = OMAP3430_CLKOUT2_DIV_MASK,
992 .clksel = sys_clkout2_clksel, 951 .clksel = sys_clkout2_clksel,
993 .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK,
994 .recalc = &omap2_clksel_recalc, 952 .recalc = &omap2_clksel_recalc,
995}; 953};
996 954
@@ -998,16 +956,22 @@ static struct clk sys_clkout2 = {
998 956
999static struct clk corex2_fck = { 957static struct clk corex2_fck = {
1000 .name = "corex2_fck", 958 .name = "corex2_fck",
959 .ops = &clkops_null,
1001 .parent = &dpll3_m2x2_ck, 960 .parent = &dpll3_m2x2_ck,
1002 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1003 PARENT_CONTROLS_CLOCK,
1004 .recalc = &followparent_recalc, 961 .recalc = &followparent_recalc,
1005}; 962};
1006 963
1007/* DPLL power domain clock controls */ 964/* DPLL power domain clock controls */
1008 965
1009static const struct clksel div2_core_clksel[] = { 966static const struct clksel_rate div4_rates[] = {
1010 { .parent = &core_ck, .rates = div2_rates }, 967 { .div = 1, .val = 1, .flags = RATE_IN_343X | DEFAULT_RATE },
968 { .div = 2, .val = 2, .flags = RATE_IN_343X },
969 { .div = 4, .val = 4, .flags = RATE_IN_343X },
970 { .div = 0 }
971};
972
973static const struct clksel div4_core_clksel[] = {
974 { .parent = &core_ck, .rates = div4_rates },
1011 { .parent = NULL } 975 { .parent = NULL }
1012}; 976};
1013 977
@@ -1017,39 +981,21 @@ static const struct clksel div2_core_clksel[] = {
1017 */ 981 */
1018static struct clk dpll1_fck = { 982static struct clk dpll1_fck = {
1019 .name = "dpll1_fck", 983 .name = "dpll1_fck",
984 .ops = &clkops_null,
1020 .parent = &core_ck, 985 .parent = &core_ck,
1021 .init = &omap2_init_clksel_parent, 986 .init = &omap2_init_clksel_parent,
1022 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL), 987 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL),
1023 .clksel_mask = OMAP3430_MPU_CLK_SRC_MASK, 988 .clksel_mask = OMAP3430_MPU_CLK_SRC_MASK,
1024 .clksel = div2_core_clksel, 989 .clksel = div4_core_clksel,
1025 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1026 PARENT_CONTROLS_CLOCK,
1027 .recalc = &omap2_clksel_recalc, 990 .recalc = &omap2_clksel_recalc,
1028}; 991};
1029 992
1030/*
1031 * MPU clksel:
1032 * If DPLL1 is locked, mpu_ck derives from DPLL1; otherwise, mpu_ck
1033 * derives from the high-frequency bypass clock originating from DPLL3,
1034 * called 'dpll1_fck'
1035 */
1036static const struct clksel mpu_clksel[] = {
1037 { .parent = &dpll1_fck, .rates = dpll_bypass_rates },
1038 { .parent = &dpll1_x2m2_ck, .rates = dpll_locked_rates },
1039 { .parent = NULL }
1040};
1041
1042static struct clk mpu_ck = { 993static struct clk mpu_ck = {
1043 .name = "mpu_ck", 994 .name = "mpu_ck",
995 .ops = &clkops_null,
1044 .parent = &dpll1_x2m2_ck, 996 .parent = &dpll1_x2m2_ck,
1045 .init = &omap2_init_clksel_parent,
1046 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
1047 .clksel_mask = OMAP3430_ST_MPU_CLK_MASK,
1048 .clksel = mpu_clksel,
1049 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1050 PARENT_CONTROLS_CLOCK,
1051 .clkdm_name = "mpu_clkdm", 997 .clkdm_name = "mpu_clkdm",
1052 .recalc = &omap2_clksel_recalc, 998 .recalc = &followparent_recalc,
1053}; 999};
1054 1000
1055/* arm_fck is divided by two when DPLL1 locked; otherwise, passthrough mpu_ck */ 1001/* arm_fck is divided by two when DPLL1 locked; otherwise, passthrough mpu_ck */
@@ -1066,13 +1012,12 @@ static const struct clksel arm_fck_clksel[] = {
1066 1012
1067static struct clk arm_fck = { 1013static struct clk arm_fck = {
1068 .name = "arm_fck", 1014 .name = "arm_fck",
1015 .ops = &clkops_null,
1069 .parent = &mpu_ck, 1016 .parent = &mpu_ck,
1070 .init = &omap2_init_clksel_parent, 1017 .init = &omap2_init_clksel_parent,
1071 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL), 1018 .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, OMAP3430_CM_IDLEST_PLL),
1072 .clksel_mask = OMAP3430_ST_MPU_CLK_MASK, 1019 .clksel_mask = OMAP3430_ST_MPU_CLK_MASK,
1073 .clksel = arm_fck_clksel, 1020 .clksel = arm_fck_clksel,
1074 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1075 PARENT_CONTROLS_CLOCK,
1076 .recalc = &omap2_clksel_recalc, 1021 .recalc = &omap2_clksel_recalc,
1077}; 1022};
1078 1023
@@ -1084,63 +1029,48 @@ static struct clk arm_fck = {
1084 */ 1029 */
1085static struct clk emu_mpu_alwon_ck = { 1030static struct clk emu_mpu_alwon_ck = {
1086 .name = "emu_mpu_alwon_ck", 1031 .name = "emu_mpu_alwon_ck",
1032 .ops = &clkops_null,
1087 .parent = &mpu_ck, 1033 .parent = &mpu_ck,
1088 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1089 PARENT_CONTROLS_CLOCK,
1090 .recalc = &followparent_recalc, 1034 .recalc = &followparent_recalc,
1091}; 1035};
1092 1036
1093static struct clk dpll2_fck = { 1037static struct clk dpll2_fck = {
1094 .name = "dpll2_fck", 1038 .name = "dpll2_fck",
1039 .ops = &clkops_null,
1095 .parent = &core_ck, 1040 .parent = &core_ck,
1096 .init = &omap2_init_clksel_parent, 1041 .init = &omap2_init_clksel_parent,
1097 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL), 1042 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSEL1_PLL),
1098 .clksel_mask = OMAP3430_IVA2_CLK_SRC_MASK, 1043 .clksel_mask = OMAP3430_IVA2_CLK_SRC_MASK,
1099 .clksel = div2_core_clksel, 1044 .clksel = div4_core_clksel,
1100 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1101 PARENT_CONTROLS_CLOCK,
1102 .recalc = &omap2_clksel_recalc, 1045 .recalc = &omap2_clksel_recalc,
1103}; 1046};
1104 1047
1105/*
1106 * IVA2 clksel:
1107 * If DPLL2 is locked, iva2_ck derives from DPLL2; otherwise, iva2_ck
1108 * derives from the high-frequency bypass clock originating from DPLL3,
1109 * called 'dpll2_fck'
1110 */
1111
1112static const struct clksel iva2_clksel[] = {
1113 { .parent = &dpll2_fck, .rates = dpll_bypass_rates },
1114 { .parent = &dpll2_m2_ck, .rates = dpll_locked_rates },
1115 { .parent = NULL }
1116};
1117
1118static struct clk iva2_ck = { 1048static struct clk iva2_ck = {
1119 .name = "iva2_ck", 1049 .name = "iva2_ck",
1050 .ops = &clkops_omap2_dflt_wait,
1120 .parent = &dpll2_m2_ck, 1051 .parent = &dpll2_m2_ck,
1121 .init = &omap2_init_clksel_parent, 1052 .init = &omap2_init_clksel_parent,
1122 .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN), 1053 .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN),
1123 .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT, 1054 .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
1124 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD,
1125 OMAP3430_CM_IDLEST_PLL),
1126 .clksel_mask = OMAP3430_ST_IVA2_CLK_MASK,
1127 .clksel = iva2_clksel,
1128 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
1129 .clkdm_name = "iva2_clkdm", 1055 .clkdm_name = "iva2_clkdm",
1130 .recalc = &omap2_clksel_recalc, 1056 .recalc = &followparent_recalc,
1131}; 1057};
1132 1058
1133/* Common interface clocks */ 1059/* Common interface clocks */
1134 1060
1061static const struct clksel div2_core_clksel[] = {
1062 { .parent = &core_ck, .rates = div2_rates },
1063 { .parent = NULL }
1064};
1065
1135static struct clk l3_ick = { 1066static struct clk l3_ick = {
1136 .name = "l3_ick", 1067 .name = "l3_ick",
1068 .ops = &clkops_null,
1137 .parent = &core_ck, 1069 .parent = &core_ck,
1138 .init = &omap2_init_clksel_parent, 1070 .init = &omap2_init_clksel_parent,
1139 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), 1071 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1140 .clksel_mask = OMAP3430_CLKSEL_L3_MASK, 1072 .clksel_mask = OMAP3430_CLKSEL_L3_MASK,
1141 .clksel = div2_core_clksel, 1073 .clksel = div2_core_clksel,
1142 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1143 PARENT_CONTROLS_CLOCK,
1144 .clkdm_name = "core_l3_clkdm", 1074 .clkdm_name = "core_l3_clkdm",
1145 .recalc = &omap2_clksel_recalc, 1075 .recalc = &omap2_clksel_recalc,
1146}; 1076};
@@ -1152,13 +1082,12 @@ static const struct clksel div2_l3_clksel[] = {
1152 1082
1153static struct clk l4_ick = { 1083static struct clk l4_ick = {
1154 .name = "l4_ick", 1084 .name = "l4_ick",
1085 .ops = &clkops_null,
1155 .parent = &l3_ick, 1086 .parent = &l3_ick,
1156 .init = &omap2_init_clksel_parent, 1087 .init = &omap2_init_clksel_parent,
1157 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), 1088 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1158 .clksel_mask = OMAP3430_CLKSEL_L4_MASK, 1089 .clksel_mask = OMAP3430_CLKSEL_L4_MASK,
1159 .clksel = div2_l3_clksel, 1090 .clksel = div2_l3_clksel,
1160 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1161 PARENT_CONTROLS_CLOCK,
1162 .clkdm_name = "core_l4_clkdm", 1091 .clkdm_name = "core_l4_clkdm",
1163 .recalc = &omap2_clksel_recalc, 1092 .recalc = &omap2_clksel_recalc,
1164 1093
@@ -1171,12 +1100,12 @@ static const struct clksel div2_l4_clksel[] = {
1171 1100
1172static struct clk rm_ick = { 1101static struct clk rm_ick = {
1173 .name = "rm_ick", 1102 .name = "rm_ick",
1103 .ops = &clkops_null,
1174 .parent = &l4_ick, 1104 .parent = &l4_ick,
1175 .init = &omap2_init_clksel_parent, 1105 .init = &omap2_init_clksel_parent,
1176 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), 1106 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
1177 .clksel_mask = OMAP3430_CLKSEL_RM_MASK, 1107 .clksel_mask = OMAP3430_CLKSEL_RM_MASK,
1178 .clksel = div2_l4_clksel, 1108 .clksel = div2_l4_clksel,
1179 .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK,
1180 .recalc = &omap2_clksel_recalc, 1109 .recalc = &omap2_clksel_recalc,
1181}; 1110};
1182 1111
@@ -1192,53 +1121,52 @@ static const struct clksel gfx_l3_clksel[] = {
1192/* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */ 1121/* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */
1193static struct clk gfx_l3_ck = { 1122static struct clk gfx_l3_ck = {
1194 .name = "gfx_l3_ck", 1123 .name = "gfx_l3_ck",
1124 .ops = &clkops_omap2_dflt_wait,
1195 .parent = &l3_ick, 1125 .parent = &l3_ick,
1196 .init = &omap2_init_clksel_parent, 1126 .init = &omap2_init_clksel_parent,
1197 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), 1127 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN),
1198 .enable_bit = OMAP_EN_GFX_SHIFT, 1128 .enable_bit = OMAP_EN_GFX_SHIFT,
1199 .flags = CLOCK_IN_OMAP3430ES1,
1200 .recalc = &followparent_recalc, 1129 .recalc = &followparent_recalc,
1201}; 1130};
1202 1131
1203static struct clk gfx_l3_fck = { 1132static struct clk gfx_l3_fck = {
1204 .name = "gfx_l3_fck", 1133 .name = "gfx_l3_fck",
1134 .ops = &clkops_null,
1205 .parent = &gfx_l3_ck, 1135 .parent = &gfx_l3_ck,
1206 .init = &omap2_init_clksel_parent, 1136 .init = &omap2_init_clksel_parent,
1207 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL), 1137 .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL),
1208 .clksel_mask = OMAP_CLKSEL_GFX_MASK, 1138 .clksel_mask = OMAP_CLKSEL_GFX_MASK,
1209 .clksel = gfx_l3_clksel, 1139 .clksel = gfx_l3_clksel,
1210 .flags = CLOCK_IN_OMAP3430ES1 | RATE_PROPAGATES |
1211 PARENT_CONTROLS_CLOCK,
1212 .clkdm_name = "gfx_3430es1_clkdm", 1140 .clkdm_name = "gfx_3430es1_clkdm",
1213 .recalc = &omap2_clksel_recalc, 1141 .recalc = &omap2_clksel_recalc,
1214}; 1142};
1215 1143
1216static struct clk gfx_l3_ick = { 1144static struct clk gfx_l3_ick = {
1217 .name = "gfx_l3_ick", 1145 .name = "gfx_l3_ick",
1146 .ops = &clkops_null,
1218 .parent = &gfx_l3_ck, 1147 .parent = &gfx_l3_ck,
1219 .flags = CLOCK_IN_OMAP3430ES1 | PARENT_CONTROLS_CLOCK,
1220 .clkdm_name = "gfx_3430es1_clkdm", 1148 .clkdm_name = "gfx_3430es1_clkdm",
1221 .recalc = &followparent_recalc, 1149 .recalc = &followparent_recalc,
1222}; 1150};
1223 1151
1224static struct clk gfx_cg1_ck = { 1152static struct clk gfx_cg1_ck = {
1225 .name = "gfx_cg1_ck", 1153 .name = "gfx_cg1_ck",
1154 .ops = &clkops_omap2_dflt_wait,
1226 .parent = &gfx_l3_fck, /* REVISIT: correct? */ 1155 .parent = &gfx_l3_fck, /* REVISIT: correct? */
1227 .init = &omap2_init_clk_clkdm, 1156 .init = &omap2_init_clk_clkdm,
1228 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), 1157 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1229 .enable_bit = OMAP3430ES1_EN_2D_SHIFT, 1158 .enable_bit = OMAP3430ES1_EN_2D_SHIFT,
1230 .flags = CLOCK_IN_OMAP3430ES1,
1231 .clkdm_name = "gfx_3430es1_clkdm", 1159 .clkdm_name = "gfx_3430es1_clkdm",
1232 .recalc = &followparent_recalc, 1160 .recalc = &followparent_recalc,
1233}; 1161};
1234 1162
1235static struct clk gfx_cg2_ck = { 1163static struct clk gfx_cg2_ck = {
1236 .name = "gfx_cg2_ck", 1164 .name = "gfx_cg2_ck",
1165 .ops = &clkops_omap2_dflt_wait,
1237 .parent = &gfx_l3_fck, /* REVISIT: correct? */ 1166 .parent = &gfx_l3_fck, /* REVISIT: correct? */
1238 .init = &omap2_init_clk_clkdm, 1167 .init = &omap2_init_clk_clkdm,
1239 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), 1168 .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN),
1240 .enable_bit = OMAP3430ES1_EN_3D_SHIFT, 1169 .enable_bit = OMAP3430ES1_EN_3D_SHIFT,
1241 .flags = CLOCK_IN_OMAP3430ES1,
1242 .clkdm_name = "gfx_3430es1_clkdm", 1170 .clkdm_name = "gfx_3430es1_clkdm",
1243 .recalc = &followparent_recalc, 1171 .recalc = &followparent_recalc,
1244}; 1172};
@@ -1265,24 +1193,24 @@ static const struct clksel sgx_clksel[] = {
1265 1193
1266static struct clk sgx_fck = { 1194static struct clk sgx_fck = {
1267 .name = "sgx_fck", 1195 .name = "sgx_fck",
1196 .ops = &clkops_omap2_dflt_wait,
1268 .init = &omap2_init_clksel_parent, 1197 .init = &omap2_init_clksel_parent,
1269 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN), 1198 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_FCLKEN),
1270 .enable_bit = OMAP3430ES2_EN_SGX_SHIFT, 1199 .enable_bit = OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT,
1271 .clksel_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL), 1200 .clksel_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_CLKSEL),
1272 .clksel_mask = OMAP3430ES2_CLKSEL_SGX_MASK, 1201 .clksel_mask = OMAP3430ES2_CLKSEL_SGX_MASK,
1273 .clksel = sgx_clksel, 1202 .clksel = sgx_clksel,
1274 .flags = CLOCK_IN_OMAP3430ES2,
1275 .clkdm_name = "sgx_clkdm", 1203 .clkdm_name = "sgx_clkdm",
1276 .recalc = &omap2_clksel_recalc, 1204 .recalc = &omap2_clksel_recalc,
1277}; 1205};
1278 1206
1279static struct clk sgx_ick = { 1207static struct clk sgx_ick = {
1280 .name = "sgx_ick", 1208 .name = "sgx_ick",
1209 .ops = &clkops_omap2_dflt_wait,
1281 .parent = &l3_ick, 1210 .parent = &l3_ick,
1282 .init = &omap2_init_clk_clkdm, 1211 .init = &omap2_init_clk_clkdm,
1283 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN), 1212 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_SGX_MOD, CM_ICLKEN),
1284 .enable_bit = OMAP3430ES2_EN_SGX_SHIFT, 1213 .enable_bit = OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT,
1285 .flags = CLOCK_IN_OMAP3430ES2,
1286 .clkdm_name = "sgx_clkdm", 1214 .clkdm_name = "sgx_clkdm",
1287 .recalc = &followparent_recalc, 1215 .recalc = &followparent_recalc,
1288}; 1216};
@@ -1291,11 +1219,11 @@ static struct clk sgx_ick = {
1291 1219
1292static struct clk d2d_26m_fck = { 1220static struct clk d2d_26m_fck = {
1293 .name = "d2d_26m_fck", 1221 .name = "d2d_26m_fck",
1222 .ops = &clkops_omap2_dflt_wait,
1294 .parent = &sys_ck, 1223 .parent = &sys_ck,
1295 .init = &omap2_init_clk_clkdm, 1224 .init = &omap2_init_clk_clkdm,
1296 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1225 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1297 .enable_bit = OMAP3430ES1_EN_D2D_SHIFT, 1226 .enable_bit = OMAP3430ES1_EN_D2D_SHIFT,
1298 .flags = CLOCK_IN_OMAP3430ES1,
1299 .clkdm_name = "d2d_clkdm", 1227 .clkdm_name = "d2d_clkdm",
1300 .recalc = &followparent_recalc, 1228 .recalc = &followparent_recalc,
1301}; 1229};
@@ -1308,6 +1236,7 @@ static const struct clksel omap343x_gpt_clksel[] = {
1308 1236
1309static struct clk gpt10_fck = { 1237static struct clk gpt10_fck = {
1310 .name = "gpt10_fck", 1238 .name = "gpt10_fck",
1239 .ops = &clkops_omap2_dflt_wait,
1311 .parent = &sys_ck, 1240 .parent = &sys_ck,
1312 .init = &omap2_init_clksel_parent, 1241 .init = &omap2_init_clksel_parent,
1313 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1242 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
@@ -1315,13 +1244,13 @@ static struct clk gpt10_fck = {
1315 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), 1244 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1316 .clksel_mask = OMAP3430_CLKSEL_GPT10_MASK, 1245 .clksel_mask = OMAP3430_CLKSEL_GPT10_MASK,
1317 .clksel = omap343x_gpt_clksel, 1246 .clksel = omap343x_gpt_clksel,
1318 .flags = CLOCK_IN_OMAP343X,
1319 .clkdm_name = "core_l4_clkdm", 1247 .clkdm_name = "core_l4_clkdm",
1320 .recalc = &omap2_clksel_recalc, 1248 .recalc = &omap2_clksel_recalc,
1321}; 1249};
1322 1250
1323static struct clk gpt11_fck = { 1251static struct clk gpt11_fck = {
1324 .name = "gpt11_fck", 1252 .name = "gpt11_fck",
1253 .ops = &clkops_omap2_dflt_wait,
1325 .parent = &sys_ck, 1254 .parent = &sys_ck,
1326 .init = &omap2_init_clksel_parent, 1255 .init = &omap2_init_clksel_parent,
1327 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1256 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
@@ -1329,35 +1258,34 @@ static struct clk gpt11_fck = {
1329 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), 1258 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1330 .clksel_mask = OMAP3430_CLKSEL_GPT11_MASK, 1259 .clksel_mask = OMAP3430_CLKSEL_GPT11_MASK,
1331 .clksel = omap343x_gpt_clksel, 1260 .clksel = omap343x_gpt_clksel,
1332 .flags = CLOCK_IN_OMAP343X,
1333 .clkdm_name = "core_l4_clkdm", 1261 .clkdm_name = "core_l4_clkdm",
1334 .recalc = &omap2_clksel_recalc, 1262 .recalc = &omap2_clksel_recalc,
1335}; 1263};
1336 1264
1337static struct clk cpefuse_fck = { 1265static struct clk cpefuse_fck = {
1338 .name = "cpefuse_fck", 1266 .name = "cpefuse_fck",
1267 .ops = &clkops_omap2_dflt,
1339 .parent = &sys_ck, 1268 .parent = &sys_ck,
1340 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), 1269 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
1341 .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT, 1270 .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT,
1342 .flags = CLOCK_IN_OMAP3430ES2,
1343 .recalc = &followparent_recalc, 1271 .recalc = &followparent_recalc,
1344}; 1272};
1345 1273
1346static struct clk ts_fck = { 1274static struct clk ts_fck = {
1347 .name = "ts_fck", 1275 .name = "ts_fck",
1276 .ops = &clkops_omap2_dflt,
1348 .parent = &omap_32k_fck, 1277 .parent = &omap_32k_fck,
1349 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), 1278 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
1350 .enable_bit = OMAP3430ES2_EN_TS_SHIFT, 1279 .enable_bit = OMAP3430ES2_EN_TS_SHIFT,
1351 .flags = CLOCK_IN_OMAP3430ES2,
1352 .recalc = &followparent_recalc, 1280 .recalc = &followparent_recalc,
1353}; 1281};
1354 1282
1355static struct clk usbtll_fck = { 1283static struct clk usbtll_fck = {
1356 .name = "usbtll_fck", 1284 .name = "usbtll_fck",
1357 .parent = &omap_120m_fck, 1285 .ops = &clkops_omap2_dflt,
1286 .parent = &dpll5_m2_ck,
1358 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), 1287 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3),
1359 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, 1288 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
1360 .flags = CLOCK_IN_OMAP3430ES2,
1361 .recalc = &followparent_recalc, 1289 .recalc = &followparent_recalc,
1362}; 1290};
1363 1291
@@ -1365,84 +1293,83 @@ static struct clk usbtll_fck = {
1365 1293
1366static struct clk core_96m_fck = { 1294static struct clk core_96m_fck = {
1367 .name = "core_96m_fck", 1295 .name = "core_96m_fck",
1296 .ops = &clkops_null,
1368 .parent = &omap_96m_fck, 1297 .parent = &omap_96m_fck,
1369 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1370 PARENT_CONTROLS_CLOCK,
1371 .clkdm_name = "core_l4_clkdm", 1298 .clkdm_name = "core_l4_clkdm",
1372 .recalc = &followparent_recalc, 1299 .recalc = &followparent_recalc,
1373}; 1300};
1374 1301
1375static struct clk mmchs3_fck = { 1302static struct clk mmchs3_fck = {
1376 .name = "mmchs_fck", 1303 .name = "mmchs_fck",
1304 .ops = &clkops_omap2_dflt_wait,
1377 .id = 2, 1305 .id = 2,
1378 .parent = &core_96m_fck, 1306 .parent = &core_96m_fck,
1379 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1307 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1380 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, 1308 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
1381 .flags = CLOCK_IN_OMAP3430ES2,
1382 .clkdm_name = "core_l4_clkdm", 1309 .clkdm_name = "core_l4_clkdm",
1383 .recalc = &followparent_recalc, 1310 .recalc = &followparent_recalc,
1384}; 1311};
1385 1312
1386static struct clk mmchs2_fck = { 1313static struct clk mmchs2_fck = {
1387 .name = "mmchs_fck", 1314 .name = "mmchs_fck",
1315 .ops = &clkops_omap2_dflt_wait,
1388 .id = 1, 1316 .id = 1,
1389 .parent = &core_96m_fck, 1317 .parent = &core_96m_fck,
1390 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1318 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1391 .enable_bit = OMAP3430_EN_MMC2_SHIFT, 1319 .enable_bit = OMAP3430_EN_MMC2_SHIFT,
1392 .flags = CLOCK_IN_OMAP343X,
1393 .clkdm_name = "core_l4_clkdm", 1320 .clkdm_name = "core_l4_clkdm",
1394 .recalc = &followparent_recalc, 1321 .recalc = &followparent_recalc,
1395}; 1322};
1396 1323
1397static struct clk mspro_fck = { 1324static struct clk mspro_fck = {
1398 .name = "mspro_fck", 1325 .name = "mspro_fck",
1326 .ops = &clkops_omap2_dflt_wait,
1399 .parent = &core_96m_fck, 1327 .parent = &core_96m_fck,
1400 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1328 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1401 .enable_bit = OMAP3430_EN_MSPRO_SHIFT, 1329 .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
1402 .flags = CLOCK_IN_OMAP343X,
1403 .clkdm_name = "core_l4_clkdm", 1330 .clkdm_name = "core_l4_clkdm",
1404 .recalc = &followparent_recalc, 1331 .recalc = &followparent_recalc,
1405}; 1332};
1406 1333
1407static struct clk mmchs1_fck = { 1334static struct clk mmchs1_fck = {
1408 .name = "mmchs_fck", 1335 .name = "mmchs_fck",
1336 .ops = &clkops_omap2_dflt_wait,
1409 .parent = &core_96m_fck, 1337 .parent = &core_96m_fck,
1410 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1338 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1411 .enable_bit = OMAP3430_EN_MMC1_SHIFT, 1339 .enable_bit = OMAP3430_EN_MMC1_SHIFT,
1412 .flags = CLOCK_IN_OMAP343X,
1413 .clkdm_name = "core_l4_clkdm", 1340 .clkdm_name = "core_l4_clkdm",
1414 .recalc = &followparent_recalc, 1341 .recalc = &followparent_recalc,
1415}; 1342};
1416 1343
1417static struct clk i2c3_fck = { 1344static struct clk i2c3_fck = {
1418 .name = "i2c_fck", 1345 .name = "i2c_fck",
1346 .ops = &clkops_omap2_dflt_wait,
1419 .id = 3, 1347 .id = 3,
1420 .parent = &core_96m_fck, 1348 .parent = &core_96m_fck,
1421 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1349 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1422 .enable_bit = OMAP3430_EN_I2C3_SHIFT, 1350 .enable_bit = OMAP3430_EN_I2C3_SHIFT,
1423 .flags = CLOCK_IN_OMAP343X,
1424 .clkdm_name = "core_l4_clkdm", 1351 .clkdm_name = "core_l4_clkdm",
1425 .recalc = &followparent_recalc, 1352 .recalc = &followparent_recalc,
1426}; 1353};
1427 1354
1428static struct clk i2c2_fck = { 1355static struct clk i2c2_fck = {
1429 .name = "i2c_fck", 1356 .name = "i2c_fck",
1357 .ops = &clkops_omap2_dflt_wait,
1430 .id = 2, 1358 .id = 2,
1431 .parent = &core_96m_fck, 1359 .parent = &core_96m_fck,
1432 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1360 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1433 .enable_bit = OMAP3430_EN_I2C2_SHIFT, 1361 .enable_bit = OMAP3430_EN_I2C2_SHIFT,
1434 .flags = CLOCK_IN_OMAP343X,
1435 .clkdm_name = "core_l4_clkdm", 1362 .clkdm_name = "core_l4_clkdm",
1436 .recalc = &followparent_recalc, 1363 .recalc = &followparent_recalc,
1437}; 1364};
1438 1365
1439static struct clk i2c1_fck = { 1366static struct clk i2c1_fck = {
1440 .name = "i2c_fck", 1367 .name = "i2c_fck",
1368 .ops = &clkops_omap2_dflt_wait,
1441 .id = 1, 1369 .id = 1,
1442 .parent = &core_96m_fck, 1370 .parent = &core_96m_fck,
1443 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1371 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1444 .enable_bit = OMAP3430_EN_I2C1_SHIFT, 1372 .enable_bit = OMAP3430_EN_I2C1_SHIFT,
1445 .flags = CLOCK_IN_OMAP343X,
1446 .clkdm_name = "core_l4_clkdm", 1373 .clkdm_name = "core_l4_clkdm",
1447 .recalc = &followparent_recalc, 1374 .recalc = &followparent_recalc,
1448}; 1375};
@@ -1469,6 +1396,7 @@ static const struct clksel mcbsp_15_clksel[] = {
1469 1396
1470static struct clk mcbsp5_fck = { 1397static struct clk mcbsp5_fck = {
1471 .name = "mcbsp_fck", 1398 .name = "mcbsp_fck",
1399 .ops = &clkops_omap2_dflt_wait,
1472 .id = 5, 1400 .id = 5,
1473 .init = &omap2_init_clksel_parent, 1401 .init = &omap2_init_clksel_parent,
1474 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1402 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
@@ -1476,13 +1404,13 @@ static struct clk mcbsp5_fck = {
1476 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), 1404 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
1477 .clksel_mask = OMAP2_MCBSP5_CLKS_MASK, 1405 .clksel_mask = OMAP2_MCBSP5_CLKS_MASK,
1478 .clksel = mcbsp_15_clksel, 1406 .clksel = mcbsp_15_clksel,
1479 .flags = CLOCK_IN_OMAP343X,
1480 .clkdm_name = "core_l4_clkdm", 1407 .clkdm_name = "core_l4_clkdm",
1481 .recalc = &omap2_clksel_recalc, 1408 .recalc = &omap2_clksel_recalc,
1482}; 1409};
1483 1410
1484static struct clk mcbsp1_fck = { 1411static struct clk mcbsp1_fck = {
1485 .name = "mcbsp_fck", 1412 .name = "mcbsp_fck",
1413 .ops = &clkops_omap2_dflt_wait,
1486 .id = 1, 1414 .id = 1,
1487 .init = &omap2_init_clksel_parent, 1415 .init = &omap2_init_clksel_parent,
1488 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1416 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
@@ -1490,7 +1418,6 @@ static struct clk mcbsp1_fck = {
1490 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), 1418 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
1491 .clksel_mask = OMAP2_MCBSP1_CLKS_MASK, 1419 .clksel_mask = OMAP2_MCBSP1_CLKS_MASK,
1492 .clksel = mcbsp_15_clksel, 1420 .clksel = mcbsp_15_clksel,
1493 .flags = CLOCK_IN_OMAP343X,
1494 .clkdm_name = "core_l4_clkdm", 1421 .clkdm_name = "core_l4_clkdm",
1495 .recalc = &omap2_clksel_recalc, 1422 .recalc = &omap2_clksel_recalc,
1496}; 1423};
@@ -1499,77 +1426,76 @@ static struct clk mcbsp1_fck = {
1499 1426
1500static struct clk core_48m_fck = { 1427static struct clk core_48m_fck = {
1501 .name = "core_48m_fck", 1428 .name = "core_48m_fck",
1429 .ops = &clkops_null,
1502 .parent = &omap_48m_fck, 1430 .parent = &omap_48m_fck,
1503 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1504 PARENT_CONTROLS_CLOCK,
1505 .clkdm_name = "core_l4_clkdm", 1431 .clkdm_name = "core_l4_clkdm",
1506 .recalc = &followparent_recalc, 1432 .recalc = &followparent_recalc,
1507}; 1433};
1508 1434
1509static struct clk mcspi4_fck = { 1435static struct clk mcspi4_fck = {
1510 .name = "mcspi_fck", 1436 .name = "mcspi_fck",
1437 .ops = &clkops_omap2_dflt_wait,
1511 .id = 4, 1438 .id = 4,
1512 .parent = &core_48m_fck, 1439 .parent = &core_48m_fck,
1513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1440 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1514 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, 1441 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
1515 .flags = CLOCK_IN_OMAP343X,
1516 .recalc = &followparent_recalc, 1442 .recalc = &followparent_recalc,
1517}; 1443};
1518 1444
1519static struct clk mcspi3_fck = { 1445static struct clk mcspi3_fck = {
1520 .name = "mcspi_fck", 1446 .name = "mcspi_fck",
1447 .ops = &clkops_omap2_dflt_wait,
1521 .id = 3, 1448 .id = 3,
1522 .parent = &core_48m_fck, 1449 .parent = &core_48m_fck,
1523 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1450 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1524 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, 1451 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
1525 .flags = CLOCK_IN_OMAP343X,
1526 .recalc = &followparent_recalc, 1452 .recalc = &followparent_recalc,
1527}; 1453};
1528 1454
1529static struct clk mcspi2_fck = { 1455static struct clk mcspi2_fck = {
1530 .name = "mcspi_fck", 1456 .name = "mcspi_fck",
1457 .ops = &clkops_omap2_dflt_wait,
1531 .id = 2, 1458 .id = 2,
1532 .parent = &core_48m_fck, 1459 .parent = &core_48m_fck,
1533 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1460 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1534 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, 1461 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
1535 .flags = CLOCK_IN_OMAP343X,
1536 .recalc = &followparent_recalc, 1462 .recalc = &followparent_recalc,
1537}; 1463};
1538 1464
1539static struct clk mcspi1_fck = { 1465static struct clk mcspi1_fck = {
1540 .name = "mcspi_fck", 1466 .name = "mcspi_fck",
1467 .ops = &clkops_omap2_dflt_wait,
1541 .id = 1, 1468 .id = 1,
1542 .parent = &core_48m_fck, 1469 .parent = &core_48m_fck,
1543 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1470 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1544 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, 1471 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
1545 .flags = CLOCK_IN_OMAP343X,
1546 .recalc = &followparent_recalc, 1472 .recalc = &followparent_recalc,
1547}; 1473};
1548 1474
1549static struct clk uart2_fck = { 1475static struct clk uart2_fck = {
1550 .name = "uart2_fck", 1476 .name = "uart2_fck",
1477 .ops = &clkops_omap2_dflt_wait,
1551 .parent = &core_48m_fck, 1478 .parent = &core_48m_fck,
1552 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1479 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1553 .enable_bit = OMAP3430_EN_UART2_SHIFT, 1480 .enable_bit = OMAP3430_EN_UART2_SHIFT,
1554 .flags = CLOCK_IN_OMAP343X,
1555 .recalc = &followparent_recalc, 1481 .recalc = &followparent_recalc,
1556}; 1482};
1557 1483
1558static struct clk uart1_fck = { 1484static struct clk uart1_fck = {
1559 .name = "uart1_fck", 1485 .name = "uart1_fck",
1486 .ops = &clkops_omap2_dflt_wait,
1560 .parent = &core_48m_fck, 1487 .parent = &core_48m_fck,
1561 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1488 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1562 .enable_bit = OMAP3430_EN_UART1_SHIFT, 1489 .enable_bit = OMAP3430_EN_UART1_SHIFT,
1563 .flags = CLOCK_IN_OMAP343X,
1564 .recalc = &followparent_recalc, 1490 .recalc = &followparent_recalc,
1565}; 1491};
1566 1492
1567static struct clk fshostusb_fck = { 1493static struct clk fshostusb_fck = {
1568 .name = "fshostusb_fck", 1494 .name = "fshostusb_fck",
1495 .ops = &clkops_omap2_dflt_wait,
1569 .parent = &core_48m_fck, 1496 .parent = &core_48m_fck,
1570 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1497 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1571 .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT, 1498 .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT,
1572 .flags = CLOCK_IN_OMAP3430ES1,
1573 .recalc = &followparent_recalc, 1499 .recalc = &followparent_recalc,
1574}; 1500};
1575 1501
@@ -1577,19 +1503,18 @@ static struct clk fshostusb_fck = {
1577 1503
1578static struct clk core_12m_fck = { 1504static struct clk core_12m_fck = {
1579 .name = "core_12m_fck", 1505 .name = "core_12m_fck",
1506 .ops = &clkops_null,
1580 .parent = &omap_12m_fck, 1507 .parent = &omap_12m_fck,
1581 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1582 PARENT_CONTROLS_CLOCK,
1583 .clkdm_name = "core_l4_clkdm", 1508 .clkdm_name = "core_l4_clkdm",
1584 .recalc = &followparent_recalc, 1509 .recalc = &followparent_recalc,
1585}; 1510};
1586 1511
1587static struct clk hdq_fck = { 1512static struct clk hdq_fck = {
1588 .name = "hdq_fck", 1513 .name = "hdq_fck",
1514 .ops = &clkops_omap2_dflt_wait,
1589 .parent = &core_12m_fck, 1515 .parent = &core_12m_fck,
1590 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1516 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1591 .enable_bit = OMAP3430_EN_HDQ_SHIFT, 1517 .enable_bit = OMAP3430_EN_HDQ_SHIFT,
1592 .flags = CLOCK_IN_OMAP343X,
1593 .recalc = &followparent_recalc, 1518 .recalc = &followparent_recalc,
1594}; 1519};
1595 1520
@@ -1612,22 +1537,22 @@ static const struct clksel ssi_ssr_clksel[] = {
1612 1537
1613static struct clk ssi_ssr_fck = { 1538static struct clk ssi_ssr_fck = {
1614 .name = "ssi_ssr_fck", 1539 .name = "ssi_ssr_fck",
1540 .ops = &clkops_omap2_dflt,
1615 .init = &omap2_init_clksel_parent, 1541 .init = &omap2_init_clksel_parent,
1616 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1542 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1617 .enable_bit = OMAP3430_EN_SSI_SHIFT, 1543 .enable_bit = OMAP3430_EN_SSI_SHIFT,
1618 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), 1544 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
1619 .clksel_mask = OMAP3430_CLKSEL_SSI_MASK, 1545 .clksel_mask = OMAP3430_CLKSEL_SSI_MASK,
1620 .clksel = ssi_ssr_clksel, 1546 .clksel = ssi_ssr_clksel,
1621 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
1622 .clkdm_name = "core_l4_clkdm", 1547 .clkdm_name = "core_l4_clkdm",
1623 .recalc = &omap2_clksel_recalc, 1548 .recalc = &omap2_clksel_recalc,
1624}; 1549};
1625 1550
1626static struct clk ssi_sst_fck = { 1551static struct clk ssi_sst_fck = {
1627 .name = "ssi_sst_fck", 1552 .name = "ssi_sst_fck",
1553 .ops = &clkops_null,
1628 .parent = &ssi_ssr_fck, 1554 .parent = &ssi_ssr_fck,
1629 .fixed_div = 2, 1555 .fixed_div = 2,
1630 .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK,
1631 .recalc = &omap2_fixed_divisor_recalc, 1556 .recalc = &omap2_fixed_divisor_recalc,
1632}; 1557};
1633 1558
@@ -1641,39 +1566,39 @@ static struct clk ssi_sst_fck = {
1641 */ 1566 */
1642static struct clk core_l3_ick = { 1567static struct clk core_l3_ick = {
1643 .name = "core_l3_ick", 1568 .name = "core_l3_ick",
1569 .ops = &clkops_null,
1644 .parent = &l3_ick, 1570 .parent = &l3_ick,
1645 .init = &omap2_init_clk_clkdm, 1571 .init = &omap2_init_clk_clkdm,
1646 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1647 PARENT_CONTROLS_CLOCK,
1648 .clkdm_name = "core_l3_clkdm", 1572 .clkdm_name = "core_l3_clkdm",
1649 .recalc = &followparent_recalc, 1573 .recalc = &followparent_recalc,
1650}; 1574};
1651 1575
1652static struct clk hsotgusb_ick = { 1576static struct clk hsotgusb_ick = {
1653 .name = "hsotgusb_ick", 1577 .name = "hsotgusb_ick",
1578 .ops = &clkops_omap2_dflt_wait,
1654 .parent = &core_l3_ick, 1579 .parent = &core_l3_ick,
1655 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1580 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1656 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, 1581 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
1657 .flags = CLOCK_IN_OMAP343X,
1658 .clkdm_name = "core_l3_clkdm", 1582 .clkdm_name = "core_l3_clkdm",
1659 .recalc = &followparent_recalc, 1583 .recalc = &followparent_recalc,
1660}; 1584};
1661 1585
1662static struct clk sdrc_ick = { 1586static struct clk sdrc_ick = {
1663 .name = "sdrc_ick", 1587 .name = "sdrc_ick",
1588 .ops = &clkops_omap2_dflt_wait,
1664 .parent = &core_l3_ick, 1589 .parent = &core_l3_ick,
1665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1590 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1666 .enable_bit = OMAP3430_EN_SDRC_SHIFT, 1591 .enable_bit = OMAP3430_EN_SDRC_SHIFT,
1667 .flags = CLOCK_IN_OMAP343X | ENABLE_ON_INIT, 1592 .flags = ENABLE_ON_INIT,
1668 .clkdm_name = "core_l3_clkdm", 1593 .clkdm_name = "core_l3_clkdm",
1669 .recalc = &followparent_recalc, 1594 .recalc = &followparent_recalc,
1670}; 1595};
1671 1596
1672static struct clk gpmc_fck = { 1597static struct clk gpmc_fck = {
1673 .name = "gpmc_fck", 1598 .name = "gpmc_fck",
1599 .ops = &clkops_null,
1674 .parent = &core_l3_ick, 1600 .parent = &core_l3_ick,
1675 .flags = CLOCK_IN_OMAP343X | PARENT_CONTROLS_CLOCK | 1601 .flags = ENABLE_ON_INIT, /* huh? */
1676 ENABLE_ON_INIT,
1677 .clkdm_name = "core_l3_clkdm", 1602 .clkdm_name = "core_l3_clkdm",
1678 .recalc = &followparent_recalc, 1603 .recalc = &followparent_recalc,
1679}; 1604};
@@ -1682,18 +1607,17 @@ static struct clk gpmc_fck = {
1682 1607
1683static struct clk security_l3_ick = { 1608static struct clk security_l3_ick = {
1684 .name = "security_l3_ick", 1609 .name = "security_l3_ick",
1610 .ops = &clkops_null,
1685 .parent = &l3_ick, 1611 .parent = &l3_ick,
1686 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1687 PARENT_CONTROLS_CLOCK,
1688 .recalc = &followparent_recalc, 1612 .recalc = &followparent_recalc,
1689}; 1613};
1690 1614
1691static struct clk pka_ick = { 1615static struct clk pka_ick = {
1692 .name = "pka_ick", 1616 .name = "pka_ick",
1617 .ops = &clkops_omap2_dflt_wait,
1693 .parent = &security_l3_ick, 1618 .parent = &security_l3_ick,
1694 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1619 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1695 .enable_bit = OMAP3430_EN_PKA_SHIFT, 1620 .enable_bit = OMAP3430_EN_PKA_SHIFT,
1696 .flags = CLOCK_IN_OMAP343X,
1697 .recalc = &followparent_recalc, 1621 .recalc = &followparent_recalc,
1698}; 1622};
1699 1623
@@ -1701,31 +1625,30 @@ static struct clk pka_ick = {
1701 1625
1702static struct clk core_l4_ick = { 1626static struct clk core_l4_ick = {
1703 .name = "core_l4_ick", 1627 .name = "core_l4_ick",
1628 .ops = &clkops_null,
1704 .parent = &l4_ick, 1629 .parent = &l4_ick,
1705 .init = &omap2_init_clk_clkdm, 1630 .init = &omap2_init_clk_clkdm,
1706 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1707 PARENT_CONTROLS_CLOCK,
1708 .clkdm_name = "core_l4_clkdm", 1631 .clkdm_name = "core_l4_clkdm",
1709 .recalc = &followparent_recalc, 1632 .recalc = &followparent_recalc,
1710}; 1633};
1711 1634
1712static struct clk usbtll_ick = { 1635static struct clk usbtll_ick = {
1713 .name = "usbtll_ick", 1636 .name = "usbtll_ick",
1637 .ops = &clkops_omap2_dflt_wait,
1714 .parent = &core_l4_ick, 1638 .parent = &core_l4_ick,
1715 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 1639 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1716 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, 1640 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
1717 .flags = CLOCK_IN_OMAP3430ES2,
1718 .clkdm_name = "core_l4_clkdm", 1641 .clkdm_name = "core_l4_clkdm",
1719 .recalc = &followparent_recalc, 1642 .recalc = &followparent_recalc,
1720}; 1643};
1721 1644
1722static struct clk mmchs3_ick = { 1645static struct clk mmchs3_ick = {
1723 .name = "mmchs_ick", 1646 .name = "mmchs_ick",
1647 .ops = &clkops_omap2_dflt_wait,
1724 .id = 2, 1648 .id = 2,
1725 .parent = &core_l4_ick, 1649 .parent = &core_l4_ick,
1726 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1650 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1727 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, 1651 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
1728 .flags = CLOCK_IN_OMAP3430ES2,
1729 .clkdm_name = "core_l4_clkdm", 1652 .clkdm_name = "core_l4_clkdm",
1730 .recalc = &followparent_recalc, 1653 .recalc = &followparent_recalc,
1731}; 1654};
@@ -1733,250 +1656,251 @@ static struct clk mmchs3_ick = {
1733/* Intersystem Communication Registers - chassis mode only */ 1656/* Intersystem Communication Registers - chassis mode only */
1734static struct clk icr_ick = { 1657static struct clk icr_ick = {
1735 .name = "icr_ick", 1658 .name = "icr_ick",
1659 .ops = &clkops_omap2_dflt_wait,
1736 .parent = &core_l4_ick, 1660 .parent = &core_l4_ick,
1737 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1661 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1738 .enable_bit = OMAP3430_EN_ICR_SHIFT, 1662 .enable_bit = OMAP3430_EN_ICR_SHIFT,
1739 .flags = CLOCK_IN_OMAP343X,
1740 .clkdm_name = "core_l4_clkdm", 1663 .clkdm_name = "core_l4_clkdm",
1741 .recalc = &followparent_recalc, 1664 .recalc = &followparent_recalc,
1742}; 1665};
1743 1666
1744static struct clk aes2_ick = { 1667static struct clk aes2_ick = {
1745 .name = "aes2_ick", 1668 .name = "aes2_ick",
1669 .ops = &clkops_omap2_dflt_wait,
1746 .parent = &core_l4_ick, 1670 .parent = &core_l4_ick,
1747 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1671 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1748 .enable_bit = OMAP3430_EN_AES2_SHIFT, 1672 .enable_bit = OMAP3430_EN_AES2_SHIFT,
1749 .flags = CLOCK_IN_OMAP343X,
1750 .clkdm_name = "core_l4_clkdm", 1673 .clkdm_name = "core_l4_clkdm",
1751 .recalc = &followparent_recalc, 1674 .recalc = &followparent_recalc,
1752}; 1675};
1753 1676
1754static struct clk sha12_ick = { 1677static struct clk sha12_ick = {
1755 .name = "sha12_ick", 1678 .name = "sha12_ick",
1679 .ops = &clkops_omap2_dflt_wait,
1756 .parent = &core_l4_ick, 1680 .parent = &core_l4_ick,
1757 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1681 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1758 .enable_bit = OMAP3430_EN_SHA12_SHIFT, 1682 .enable_bit = OMAP3430_EN_SHA12_SHIFT,
1759 .flags = CLOCK_IN_OMAP343X,
1760 .clkdm_name = "core_l4_clkdm", 1683 .clkdm_name = "core_l4_clkdm",
1761 .recalc = &followparent_recalc, 1684 .recalc = &followparent_recalc,
1762}; 1685};
1763 1686
1764static struct clk des2_ick = { 1687static struct clk des2_ick = {
1765 .name = "des2_ick", 1688 .name = "des2_ick",
1689 .ops = &clkops_omap2_dflt_wait,
1766 .parent = &core_l4_ick, 1690 .parent = &core_l4_ick,
1767 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1691 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1768 .enable_bit = OMAP3430_EN_DES2_SHIFT, 1692 .enable_bit = OMAP3430_EN_DES2_SHIFT,
1769 .flags = CLOCK_IN_OMAP343X,
1770 .clkdm_name = "core_l4_clkdm", 1693 .clkdm_name = "core_l4_clkdm",
1771 .recalc = &followparent_recalc, 1694 .recalc = &followparent_recalc,
1772}; 1695};
1773 1696
1774static struct clk mmchs2_ick = { 1697static struct clk mmchs2_ick = {
1775 .name = "mmchs_ick", 1698 .name = "mmchs_ick",
1699 .ops = &clkops_omap2_dflt_wait,
1776 .id = 1, 1700 .id = 1,
1777 .parent = &core_l4_ick, 1701 .parent = &core_l4_ick,
1778 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1702 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1779 .enable_bit = OMAP3430_EN_MMC2_SHIFT, 1703 .enable_bit = OMAP3430_EN_MMC2_SHIFT,
1780 .flags = CLOCK_IN_OMAP343X,
1781 .clkdm_name = "core_l4_clkdm", 1704 .clkdm_name = "core_l4_clkdm",
1782 .recalc = &followparent_recalc, 1705 .recalc = &followparent_recalc,
1783}; 1706};
1784 1707
1785static struct clk mmchs1_ick = { 1708static struct clk mmchs1_ick = {
1786 .name = "mmchs_ick", 1709 .name = "mmchs_ick",
1710 .ops = &clkops_omap2_dflt_wait,
1787 .parent = &core_l4_ick, 1711 .parent = &core_l4_ick,
1788 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1712 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1789 .enable_bit = OMAP3430_EN_MMC1_SHIFT, 1713 .enable_bit = OMAP3430_EN_MMC1_SHIFT,
1790 .flags = CLOCK_IN_OMAP343X,
1791 .clkdm_name = "core_l4_clkdm", 1714 .clkdm_name = "core_l4_clkdm",
1792 .recalc = &followparent_recalc, 1715 .recalc = &followparent_recalc,
1793}; 1716};
1794 1717
1795static struct clk mspro_ick = { 1718static struct clk mspro_ick = {
1796 .name = "mspro_ick", 1719 .name = "mspro_ick",
1720 .ops = &clkops_omap2_dflt_wait,
1797 .parent = &core_l4_ick, 1721 .parent = &core_l4_ick,
1798 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1722 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1799 .enable_bit = OMAP3430_EN_MSPRO_SHIFT, 1723 .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
1800 .flags = CLOCK_IN_OMAP343X,
1801 .clkdm_name = "core_l4_clkdm", 1724 .clkdm_name = "core_l4_clkdm",
1802 .recalc = &followparent_recalc, 1725 .recalc = &followparent_recalc,
1803}; 1726};
1804 1727
1805static struct clk hdq_ick = { 1728static struct clk hdq_ick = {
1806 .name = "hdq_ick", 1729 .name = "hdq_ick",
1730 .ops = &clkops_omap2_dflt_wait,
1807 .parent = &core_l4_ick, 1731 .parent = &core_l4_ick,
1808 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1732 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1809 .enable_bit = OMAP3430_EN_HDQ_SHIFT, 1733 .enable_bit = OMAP3430_EN_HDQ_SHIFT,
1810 .flags = CLOCK_IN_OMAP343X,
1811 .clkdm_name = "core_l4_clkdm", 1734 .clkdm_name = "core_l4_clkdm",
1812 .recalc = &followparent_recalc, 1735 .recalc = &followparent_recalc,
1813}; 1736};
1814 1737
1815static struct clk mcspi4_ick = { 1738static struct clk mcspi4_ick = {
1816 .name = "mcspi_ick", 1739 .name = "mcspi_ick",
1740 .ops = &clkops_omap2_dflt_wait,
1817 .id = 4, 1741 .id = 4,
1818 .parent = &core_l4_ick, 1742 .parent = &core_l4_ick,
1819 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1743 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1820 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, 1744 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
1821 .flags = CLOCK_IN_OMAP343X,
1822 .clkdm_name = "core_l4_clkdm", 1745 .clkdm_name = "core_l4_clkdm",
1823 .recalc = &followparent_recalc, 1746 .recalc = &followparent_recalc,
1824}; 1747};
1825 1748
1826static struct clk mcspi3_ick = { 1749static struct clk mcspi3_ick = {
1827 .name = "mcspi_ick", 1750 .name = "mcspi_ick",
1751 .ops = &clkops_omap2_dflt_wait,
1828 .id = 3, 1752 .id = 3,
1829 .parent = &core_l4_ick, 1753 .parent = &core_l4_ick,
1830 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1754 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1831 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, 1755 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
1832 .flags = CLOCK_IN_OMAP343X,
1833 .clkdm_name = "core_l4_clkdm", 1756 .clkdm_name = "core_l4_clkdm",
1834 .recalc = &followparent_recalc, 1757 .recalc = &followparent_recalc,
1835}; 1758};
1836 1759
1837static struct clk mcspi2_ick = { 1760static struct clk mcspi2_ick = {
1838 .name = "mcspi_ick", 1761 .name = "mcspi_ick",
1762 .ops = &clkops_omap2_dflt_wait,
1839 .id = 2, 1763 .id = 2,
1840 .parent = &core_l4_ick, 1764 .parent = &core_l4_ick,
1841 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1765 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1842 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, 1766 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
1843 .flags = CLOCK_IN_OMAP343X,
1844 .clkdm_name = "core_l4_clkdm", 1767 .clkdm_name = "core_l4_clkdm",
1845 .recalc = &followparent_recalc, 1768 .recalc = &followparent_recalc,
1846}; 1769};
1847 1770
1848static struct clk mcspi1_ick = { 1771static struct clk mcspi1_ick = {
1849 .name = "mcspi_ick", 1772 .name = "mcspi_ick",
1773 .ops = &clkops_omap2_dflt_wait,
1850 .id = 1, 1774 .id = 1,
1851 .parent = &core_l4_ick, 1775 .parent = &core_l4_ick,
1852 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1776 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1853 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, 1777 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
1854 .flags = CLOCK_IN_OMAP343X,
1855 .clkdm_name = "core_l4_clkdm", 1778 .clkdm_name = "core_l4_clkdm",
1856 .recalc = &followparent_recalc, 1779 .recalc = &followparent_recalc,
1857}; 1780};
1858 1781
1859static struct clk i2c3_ick = { 1782static struct clk i2c3_ick = {
1860 .name = "i2c_ick", 1783 .name = "i2c_ick",
1784 .ops = &clkops_omap2_dflt_wait,
1861 .id = 3, 1785 .id = 3,
1862 .parent = &core_l4_ick, 1786 .parent = &core_l4_ick,
1863 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1787 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1864 .enable_bit = OMAP3430_EN_I2C3_SHIFT, 1788 .enable_bit = OMAP3430_EN_I2C3_SHIFT,
1865 .flags = CLOCK_IN_OMAP343X,
1866 .clkdm_name = "core_l4_clkdm", 1789 .clkdm_name = "core_l4_clkdm",
1867 .recalc = &followparent_recalc, 1790 .recalc = &followparent_recalc,
1868}; 1791};
1869 1792
1870static struct clk i2c2_ick = { 1793static struct clk i2c2_ick = {
1871 .name = "i2c_ick", 1794 .name = "i2c_ick",
1795 .ops = &clkops_omap2_dflt_wait,
1872 .id = 2, 1796 .id = 2,
1873 .parent = &core_l4_ick, 1797 .parent = &core_l4_ick,
1874 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1798 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1875 .enable_bit = OMAP3430_EN_I2C2_SHIFT, 1799 .enable_bit = OMAP3430_EN_I2C2_SHIFT,
1876 .flags = CLOCK_IN_OMAP343X,
1877 .clkdm_name = "core_l4_clkdm", 1800 .clkdm_name = "core_l4_clkdm",
1878 .recalc = &followparent_recalc, 1801 .recalc = &followparent_recalc,
1879}; 1802};
1880 1803
1881static struct clk i2c1_ick = { 1804static struct clk i2c1_ick = {
1882 .name = "i2c_ick", 1805 .name = "i2c_ick",
1806 .ops = &clkops_omap2_dflt_wait,
1883 .id = 1, 1807 .id = 1,
1884 .parent = &core_l4_ick, 1808 .parent = &core_l4_ick,
1885 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1809 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1886 .enable_bit = OMAP3430_EN_I2C1_SHIFT, 1810 .enable_bit = OMAP3430_EN_I2C1_SHIFT,
1887 .flags = CLOCK_IN_OMAP343X,
1888 .clkdm_name = "core_l4_clkdm", 1811 .clkdm_name = "core_l4_clkdm",
1889 .recalc = &followparent_recalc, 1812 .recalc = &followparent_recalc,
1890}; 1813};
1891 1814
1892static struct clk uart2_ick = { 1815static struct clk uart2_ick = {
1893 .name = "uart2_ick", 1816 .name = "uart2_ick",
1817 .ops = &clkops_omap2_dflt_wait,
1894 .parent = &core_l4_ick, 1818 .parent = &core_l4_ick,
1895 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1819 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1896 .enable_bit = OMAP3430_EN_UART2_SHIFT, 1820 .enable_bit = OMAP3430_EN_UART2_SHIFT,
1897 .flags = CLOCK_IN_OMAP343X,
1898 .clkdm_name = "core_l4_clkdm", 1821 .clkdm_name = "core_l4_clkdm",
1899 .recalc = &followparent_recalc, 1822 .recalc = &followparent_recalc,
1900}; 1823};
1901 1824
1902static struct clk uart1_ick = { 1825static struct clk uart1_ick = {
1903 .name = "uart1_ick", 1826 .name = "uart1_ick",
1827 .ops = &clkops_omap2_dflt_wait,
1904 .parent = &core_l4_ick, 1828 .parent = &core_l4_ick,
1905 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1829 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1906 .enable_bit = OMAP3430_EN_UART1_SHIFT, 1830 .enable_bit = OMAP3430_EN_UART1_SHIFT,
1907 .flags = CLOCK_IN_OMAP343X,
1908 .clkdm_name = "core_l4_clkdm", 1831 .clkdm_name = "core_l4_clkdm",
1909 .recalc = &followparent_recalc, 1832 .recalc = &followparent_recalc,
1910}; 1833};
1911 1834
1912static struct clk gpt11_ick = { 1835static struct clk gpt11_ick = {
1913 .name = "gpt11_ick", 1836 .name = "gpt11_ick",
1837 .ops = &clkops_omap2_dflt_wait,
1914 .parent = &core_l4_ick, 1838 .parent = &core_l4_ick,
1915 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1839 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1916 .enable_bit = OMAP3430_EN_GPT11_SHIFT, 1840 .enable_bit = OMAP3430_EN_GPT11_SHIFT,
1917 .flags = CLOCK_IN_OMAP343X,
1918 .clkdm_name = "core_l4_clkdm", 1841 .clkdm_name = "core_l4_clkdm",
1919 .recalc = &followparent_recalc, 1842 .recalc = &followparent_recalc,
1920}; 1843};
1921 1844
1922static struct clk gpt10_ick = { 1845static struct clk gpt10_ick = {
1923 .name = "gpt10_ick", 1846 .name = "gpt10_ick",
1847 .ops = &clkops_omap2_dflt_wait,
1924 .parent = &core_l4_ick, 1848 .parent = &core_l4_ick,
1925 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1849 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1926 .enable_bit = OMAP3430_EN_GPT10_SHIFT, 1850 .enable_bit = OMAP3430_EN_GPT10_SHIFT,
1927 .flags = CLOCK_IN_OMAP343X,
1928 .clkdm_name = "core_l4_clkdm", 1851 .clkdm_name = "core_l4_clkdm",
1929 .recalc = &followparent_recalc, 1852 .recalc = &followparent_recalc,
1930}; 1853};
1931 1854
1932static struct clk mcbsp5_ick = { 1855static struct clk mcbsp5_ick = {
1933 .name = "mcbsp_ick", 1856 .name = "mcbsp_ick",
1857 .ops = &clkops_omap2_dflt_wait,
1934 .id = 5, 1858 .id = 5,
1935 .parent = &core_l4_ick, 1859 .parent = &core_l4_ick,
1936 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1860 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1937 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, 1861 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT,
1938 .flags = CLOCK_IN_OMAP343X,
1939 .clkdm_name = "core_l4_clkdm", 1862 .clkdm_name = "core_l4_clkdm",
1940 .recalc = &followparent_recalc, 1863 .recalc = &followparent_recalc,
1941}; 1864};
1942 1865
1943static struct clk mcbsp1_ick = { 1866static struct clk mcbsp1_ick = {
1944 .name = "mcbsp_ick", 1867 .name = "mcbsp_ick",
1868 .ops = &clkops_omap2_dflt_wait,
1945 .id = 1, 1869 .id = 1,
1946 .parent = &core_l4_ick, 1870 .parent = &core_l4_ick,
1947 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1871 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1948 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, 1872 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT,
1949 .flags = CLOCK_IN_OMAP343X,
1950 .clkdm_name = "core_l4_clkdm", 1873 .clkdm_name = "core_l4_clkdm",
1951 .recalc = &followparent_recalc, 1874 .recalc = &followparent_recalc,
1952}; 1875};
1953 1876
1954static struct clk fac_ick = { 1877static struct clk fac_ick = {
1955 .name = "fac_ick", 1878 .name = "fac_ick",
1879 .ops = &clkops_omap2_dflt_wait,
1956 .parent = &core_l4_ick, 1880 .parent = &core_l4_ick,
1957 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1881 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1958 .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, 1882 .enable_bit = OMAP3430ES1_EN_FAC_SHIFT,
1959 .flags = CLOCK_IN_OMAP3430ES1,
1960 .clkdm_name = "core_l4_clkdm", 1883 .clkdm_name = "core_l4_clkdm",
1961 .recalc = &followparent_recalc, 1884 .recalc = &followparent_recalc,
1962}; 1885};
1963 1886
1964static struct clk mailboxes_ick = { 1887static struct clk mailboxes_ick = {
1965 .name = "mailboxes_ick", 1888 .name = "mailboxes_ick",
1889 .ops = &clkops_omap2_dflt_wait,
1966 .parent = &core_l4_ick, 1890 .parent = &core_l4_ick,
1967 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1891 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1968 .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, 1892 .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT,
1969 .flags = CLOCK_IN_OMAP343X,
1970 .clkdm_name = "core_l4_clkdm", 1893 .clkdm_name = "core_l4_clkdm",
1971 .recalc = &followparent_recalc, 1894 .recalc = &followparent_recalc,
1972}; 1895};
1973 1896
1974static struct clk omapctrl_ick = { 1897static struct clk omapctrl_ick = {
1975 .name = "omapctrl_ick", 1898 .name = "omapctrl_ick",
1899 .ops = &clkops_omap2_dflt_wait,
1976 .parent = &core_l4_ick, 1900 .parent = &core_l4_ick,
1977 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1901 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1978 .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, 1902 .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT,
1979 .flags = CLOCK_IN_OMAP343X | ENABLE_ON_INIT, 1903 .flags = ENABLE_ON_INIT,
1980 .recalc = &followparent_recalc, 1904 .recalc = &followparent_recalc,
1981}; 1905};
1982 1906
@@ -1984,19 +1908,18 @@ static struct clk omapctrl_ick = {
1984 1908
1985static struct clk ssi_l4_ick = { 1909static struct clk ssi_l4_ick = {
1986 .name = "ssi_l4_ick", 1910 .name = "ssi_l4_ick",
1911 .ops = &clkops_null,
1987 .parent = &l4_ick, 1912 .parent = &l4_ick,
1988 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
1989 PARENT_CONTROLS_CLOCK,
1990 .clkdm_name = "core_l4_clkdm", 1913 .clkdm_name = "core_l4_clkdm",
1991 .recalc = &followparent_recalc, 1914 .recalc = &followparent_recalc,
1992}; 1915};
1993 1916
1994static struct clk ssi_ick = { 1917static struct clk ssi_ick = {
1995 .name = "ssi_ick", 1918 .name = "ssi_ick",
1919 .ops = &clkops_omap2_dflt,
1996 .parent = &ssi_l4_ick, 1920 .parent = &ssi_l4_ick,
1997 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1921 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1998 .enable_bit = OMAP3430_EN_SSI_SHIFT, 1922 .enable_bit = OMAP3430_EN_SSI_SHIFT,
1999 .flags = CLOCK_IN_OMAP343X,
2000 .clkdm_name = "core_l4_clkdm", 1923 .clkdm_name = "core_l4_clkdm",
2001 .recalc = &followparent_recalc, 1924 .recalc = &followparent_recalc,
2002}; 1925};
@@ -2011,6 +1934,7 @@ static const struct clksel usb_l4_clksel[] = {
2011 1934
2012static struct clk usb_l4_ick = { 1935static struct clk usb_l4_ick = {
2013 .name = "usb_l4_ick", 1936 .name = "usb_l4_ick",
1937 .ops = &clkops_omap2_dflt_wait,
2014 .parent = &l4_ick, 1938 .parent = &l4_ick,
2015 .init = &omap2_init_clksel_parent, 1939 .init = &omap2_init_clksel_parent,
2016 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1940 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -2018,7 +1942,6 @@ static struct clk usb_l4_ick = {
2018 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), 1942 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL),
2019 .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK, 1943 .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK,
2020 .clksel = usb_l4_clksel, 1944 .clksel = usb_l4_clksel,
2021 .flags = CLOCK_IN_OMAP3430ES1,
2022 .recalc = &omap2_clksel_recalc, 1945 .recalc = &omap2_clksel_recalc,
2023}; 1946};
2024 1947
@@ -2028,98 +1951,87 @@ static struct clk usb_l4_ick = {
2028 1951
2029static struct clk security_l4_ick2 = { 1952static struct clk security_l4_ick2 = {
2030 .name = "security_l4_ick2", 1953 .name = "security_l4_ick2",
1954 .ops = &clkops_null,
2031 .parent = &l4_ick, 1955 .parent = &l4_ick,
2032 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
2033 PARENT_CONTROLS_CLOCK,
2034 .recalc = &followparent_recalc, 1956 .recalc = &followparent_recalc,
2035}; 1957};
2036 1958
2037static struct clk aes1_ick = { 1959static struct clk aes1_ick = {
2038 .name = "aes1_ick", 1960 .name = "aes1_ick",
1961 .ops = &clkops_omap2_dflt_wait,
2039 .parent = &security_l4_ick2, 1962 .parent = &security_l4_ick2,
2040 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1963 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2041 .enable_bit = OMAP3430_EN_AES1_SHIFT, 1964 .enable_bit = OMAP3430_EN_AES1_SHIFT,
2042 .flags = CLOCK_IN_OMAP343X,
2043 .recalc = &followparent_recalc, 1965 .recalc = &followparent_recalc,
2044}; 1966};
2045 1967
2046static struct clk rng_ick = { 1968static struct clk rng_ick = {
2047 .name = "rng_ick", 1969 .name = "rng_ick",
1970 .ops = &clkops_omap2_dflt_wait,
2048 .parent = &security_l4_ick2, 1971 .parent = &security_l4_ick2,
2049 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1972 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2050 .enable_bit = OMAP3430_EN_RNG_SHIFT, 1973 .enable_bit = OMAP3430_EN_RNG_SHIFT,
2051 .flags = CLOCK_IN_OMAP343X,
2052 .recalc = &followparent_recalc, 1974 .recalc = &followparent_recalc,
2053}; 1975};
2054 1976
2055static struct clk sha11_ick = { 1977static struct clk sha11_ick = {
2056 .name = "sha11_ick", 1978 .name = "sha11_ick",
1979 .ops = &clkops_omap2_dflt_wait,
2057 .parent = &security_l4_ick2, 1980 .parent = &security_l4_ick2,
2058 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1981 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2059 .enable_bit = OMAP3430_EN_SHA11_SHIFT, 1982 .enable_bit = OMAP3430_EN_SHA11_SHIFT,
2060 .flags = CLOCK_IN_OMAP343X,
2061 .recalc = &followparent_recalc, 1983 .recalc = &followparent_recalc,
2062}; 1984};
2063 1985
2064static struct clk des1_ick = { 1986static struct clk des1_ick = {
2065 .name = "des1_ick", 1987 .name = "des1_ick",
1988 .ops = &clkops_omap2_dflt_wait,
2066 .parent = &security_l4_ick2, 1989 .parent = &security_l4_ick2,
2067 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1990 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2068 .enable_bit = OMAP3430_EN_DES1_SHIFT, 1991 .enable_bit = OMAP3430_EN_DES1_SHIFT,
2069 .flags = CLOCK_IN_OMAP343X,
2070 .recalc = &followparent_recalc, 1992 .recalc = &followparent_recalc,
2071}; 1993};
2072 1994
2073/* DSS */ 1995/* DSS */
2074static const struct clksel dss1_alwon_fck_clksel[] = {
2075 { .parent = &sys_ck, .rates = dpll_bypass_rates },
2076 { .parent = &dpll4_m4x2_ck, .rates = dpll_locked_rates },
2077 { .parent = NULL }
2078};
2079
2080static struct clk dss1_alwon_fck = { 1996static struct clk dss1_alwon_fck = {
2081 .name = "dss1_alwon_fck", 1997 .name = "dss1_alwon_fck",
1998 .ops = &clkops_omap2_dflt,
2082 .parent = &dpll4_m4x2_ck, 1999 .parent = &dpll4_m4x2_ck,
2083 .init = &omap2_init_clksel_parent,
2084 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), 2000 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2085 .enable_bit = OMAP3430_EN_DSS1_SHIFT, 2001 .enable_bit = OMAP3430_EN_DSS1_SHIFT,
2086 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
2087 .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK,
2088 .clksel = dss1_alwon_fck_clksel,
2089 .flags = CLOCK_IN_OMAP343X,
2090 .clkdm_name = "dss_clkdm", 2002 .clkdm_name = "dss_clkdm",
2091 .recalc = &omap2_clksel_recalc, 2003 .recalc = &followparent_recalc,
2092}; 2004};
2093 2005
2094static struct clk dss_tv_fck = { 2006static struct clk dss_tv_fck = {
2095 .name = "dss_tv_fck", 2007 .name = "dss_tv_fck",
2008 .ops = &clkops_omap2_dflt,
2096 .parent = &omap_54m_fck, 2009 .parent = &omap_54m_fck,
2097 .init = &omap2_init_clk_clkdm, 2010 .init = &omap2_init_clk_clkdm,
2098 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), 2011 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2099 .enable_bit = OMAP3430_EN_TV_SHIFT, 2012 .enable_bit = OMAP3430_EN_TV_SHIFT,
2100 .flags = CLOCK_IN_OMAP343X,
2101 .clkdm_name = "dss_clkdm", 2013 .clkdm_name = "dss_clkdm",
2102 .recalc = &followparent_recalc, 2014 .recalc = &followparent_recalc,
2103}; 2015};
2104 2016
2105static struct clk dss_96m_fck = { 2017static struct clk dss_96m_fck = {
2106 .name = "dss_96m_fck", 2018 .name = "dss_96m_fck",
2019 .ops = &clkops_omap2_dflt,
2107 .parent = &omap_96m_fck, 2020 .parent = &omap_96m_fck,
2108 .init = &omap2_init_clk_clkdm, 2021 .init = &omap2_init_clk_clkdm,
2109 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), 2022 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2110 .enable_bit = OMAP3430_EN_TV_SHIFT, 2023 .enable_bit = OMAP3430_EN_TV_SHIFT,
2111 .flags = CLOCK_IN_OMAP343X,
2112 .clkdm_name = "dss_clkdm", 2024 .clkdm_name = "dss_clkdm",
2113 .recalc = &followparent_recalc, 2025 .recalc = &followparent_recalc,
2114}; 2026};
2115 2027
2116static struct clk dss2_alwon_fck = { 2028static struct clk dss2_alwon_fck = {
2117 .name = "dss2_alwon_fck", 2029 .name = "dss2_alwon_fck",
2030 .ops = &clkops_omap2_dflt,
2118 .parent = &sys_ck, 2031 .parent = &sys_ck,
2119 .init = &omap2_init_clk_clkdm, 2032 .init = &omap2_init_clk_clkdm,
2120 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN), 2033 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_FCLKEN),
2121 .enable_bit = OMAP3430_EN_DSS2_SHIFT, 2034 .enable_bit = OMAP3430_EN_DSS2_SHIFT,
2122 .flags = CLOCK_IN_OMAP343X,
2123 .clkdm_name = "dss_clkdm", 2035 .clkdm_name = "dss_clkdm",
2124 .recalc = &followparent_recalc, 2036 .recalc = &followparent_recalc,
2125}; 2037};
@@ -2127,45 +2039,46 @@ static struct clk dss2_alwon_fck = {
2127static struct clk dss_ick = { 2039static struct clk dss_ick = {
2128 /* Handles both L3 and L4 clocks */ 2040 /* Handles both L3 and L4 clocks */
2129 .name = "dss_ick", 2041 .name = "dss_ick",
2042 .ops = &clkops_omap2_dflt,
2130 .parent = &l4_ick, 2043 .parent = &l4_ick,
2131 .init = &omap2_init_clk_clkdm, 2044 .init = &omap2_init_clk_clkdm,
2132 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), 2045 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
2133 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, 2046 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
2134 .flags = CLOCK_IN_OMAP343X,
2135 .clkdm_name = "dss_clkdm", 2047 .clkdm_name = "dss_clkdm",
2136 .recalc = &followparent_recalc, 2048 .recalc = &followparent_recalc,
2137}; 2049};
2138 2050
2139/* CAM */ 2051/* CAM */
2140 2052
2141static const struct clksel cam_mclk_clksel[] = {
2142 { .parent = &sys_ck, .rates = dpll_bypass_rates },
2143 { .parent = &dpll4_m5x2_ck, .rates = dpll_locked_rates },
2144 { .parent = NULL }
2145};
2146
2147static struct clk cam_mclk = { 2053static struct clk cam_mclk = {
2148 .name = "cam_mclk", 2054 .name = "cam_mclk",
2055 .ops = &clkops_omap2_dflt_wait,
2149 .parent = &dpll4_m5x2_ck, 2056 .parent = &dpll4_m5x2_ck,
2150 .init = &omap2_init_clksel_parent,
2151 .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
2152 .clksel_mask = OMAP3430_ST_PERIPH_CLK_MASK,
2153 .clksel = cam_mclk_clksel,
2154 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN), 2057 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
2155 .enable_bit = OMAP3430_EN_CAM_SHIFT, 2058 .enable_bit = OMAP3430_EN_CAM_SHIFT,
2156 .flags = CLOCK_IN_OMAP343X,
2157 .clkdm_name = "cam_clkdm", 2059 .clkdm_name = "cam_clkdm",
2158 .recalc = &omap2_clksel_recalc, 2060 .recalc = &followparent_recalc,
2159}; 2061};
2160 2062
2161static struct clk cam_ick = { 2063static struct clk cam_ick = {
2162 /* Handles both L3 and L4 clocks */ 2064 /* Handles both L3 and L4 clocks */
2163 .name = "cam_ick", 2065 .name = "cam_ick",
2066 .ops = &clkops_omap2_dflt_wait,
2164 .parent = &l4_ick, 2067 .parent = &l4_ick,
2165 .init = &omap2_init_clk_clkdm, 2068 .init = &omap2_init_clk_clkdm,
2166 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), 2069 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
2167 .enable_bit = OMAP3430_EN_CAM_SHIFT, 2070 .enable_bit = OMAP3430_EN_CAM_SHIFT,
2168 .flags = CLOCK_IN_OMAP343X, 2071 .clkdm_name = "cam_clkdm",
2072 .recalc = &followparent_recalc,
2073};
2074
2075static struct clk csi2_96m_fck = {
2076 .name = "csi2_96m_fck",
2077 .ops = &clkops_omap2_dflt_wait,
2078 .parent = &core_96m_fck,
2079 .init = &omap2_init_clk_clkdm,
2080 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_FCLKEN),
2081 .enable_bit = OMAP3430_EN_CSI2_SHIFT,
2169 .clkdm_name = "cam_clkdm", 2082 .clkdm_name = "cam_clkdm",
2170 .recalc = &followparent_recalc, 2083 .recalc = &followparent_recalc,
2171}; 2084};
@@ -2174,22 +2087,22 @@ static struct clk cam_ick = {
2174 2087
2175static struct clk usbhost_120m_fck = { 2088static struct clk usbhost_120m_fck = {
2176 .name = "usbhost_120m_fck", 2089 .name = "usbhost_120m_fck",
2177 .parent = &omap_120m_fck, 2090 .ops = &clkops_omap2_dflt_wait,
2091 .parent = &dpll5_m2_ck,
2178 .init = &omap2_init_clk_clkdm, 2092 .init = &omap2_init_clk_clkdm,
2179 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), 2093 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
2180 .enable_bit = OMAP3430ES2_EN_USBHOST2_SHIFT, 2094 .enable_bit = OMAP3430ES2_EN_USBHOST2_SHIFT,
2181 .flags = CLOCK_IN_OMAP3430ES2,
2182 .clkdm_name = "usbhost_clkdm", 2095 .clkdm_name = "usbhost_clkdm",
2183 .recalc = &followparent_recalc, 2096 .recalc = &followparent_recalc,
2184}; 2097};
2185 2098
2186static struct clk usbhost_48m_fck = { 2099static struct clk usbhost_48m_fck = {
2187 .name = "usbhost_48m_fck", 2100 .name = "usbhost_48m_fck",
2101 .ops = &clkops_omap2_dflt_wait,
2188 .parent = &omap_48m_fck, 2102 .parent = &omap_48m_fck,
2189 .init = &omap2_init_clk_clkdm, 2103 .init = &omap2_init_clk_clkdm,
2190 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN), 2104 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN),
2191 .enable_bit = OMAP3430ES2_EN_USBHOST1_SHIFT, 2105 .enable_bit = OMAP3430ES2_EN_USBHOST1_SHIFT,
2192 .flags = CLOCK_IN_OMAP3430ES2,
2193 .clkdm_name = "usbhost_clkdm", 2106 .clkdm_name = "usbhost_clkdm",
2194 .recalc = &followparent_recalc, 2107 .recalc = &followparent_recalc,
2195}; 2108};
@@ -2197,22 +2110,11 @@ static struct clk usbhost_48m_fck = {
2197static struct clk usbhost_ick = { 2110static struct clk usbhost_ick = {
2198 /* Handles both L3 and L4 clocks */ 2111 /* Handles both L3 and L4 clocks */
2199 .name = "usbhost_ick", 2112 .name = "usbhost_ick",
2113 .ops = &clkops_omap2_dflt_wait,
2200 .parent = &l4_ick, 2114 .parent = &l4_ick,
2201 .init = &omap2_init_clk_clkdm, 2115 .init = &omap2_init_clk_clkdm,
2202 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), 2116 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
2203 .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, 2117 .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT,
2204 .flags = CLOCK_IN_OMAP3430ES2,
2205 .clkdm_name = "usbhost_clkdm",
2206 .recalc = &followparent_recalc,
2207};
2208
2209static struct clk usbhost_sar_fck = {
2210 .name = "usbhost_sar_fck",
2211 .parent = &osc_sys_ck,
2212 .init = &omap2_init_clk_clkdm,
2213 .enable_reg = OMAP_PRM_REGADDR(OMAP3430ES2_USBHOST_MOD, PM_PWSTCTRL),
2214 .enable_bit = OMAP3430ES2_SAVEANDRESTORE_SHIFT,
2215 .flags = CLOCK_IN_OMAP3430ES2,
2216 .clkdm_name = "usbhost_clkdm", 2118 .clkdm_name = "usbhost_clkdm",
2217 .recalc = &followparent_recalc, 2119 .recalc = &followparent_recalc,
2218}; 2120};
@@ -2237,7 +2139,7 @@ static const struct clksel_rate usim_120m_rates[] = {
2237 2139
2238static const struct clksel usim_clksel[] = { 2140static const struct clksel usim_clksel[] = {
2239 { .parent = &omap_96m_fck, .rates = usim_96m_rates }, 2141 { .parent = &omap_96m_fck, .rates = usim_96m_rates },
2240 { .parent = &omap_120m_fck, .rates = usim_120m_rates }, 2142 { .parent = &dpll5_m2_ck, .rates = usim_120m_rates },
2241 { .parent = &sys_ck, .rates = div2_rates }, 2143 { .parent = &sys_ck, .rates = div2_rates },
2242 { .parent = NULL }, 2144 { .parent = NULL },
2243}; 2145};
@@ -2245,63 +2147,63 @@ static const struct clksel usim_clksel[] = {
2245/* 3430ES2 only */ 2147/* 3430ES2 only */
2246static struct clk usim_fck = { 2148static struct clk usim_fck = {
2247 .name = "usim_fck", 2149 .name = "usim_fck",
2150 .ops = &clkops_omap2_dflt_wait,
2248 .init = &omap2_init_clksel_parent, 2151 .init = &omap2_init_clksel_parent,
2249 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2152 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2250 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, 2153 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT,
2251 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), 2154 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
2252 .clksel_mask = OMAP3430ES2_CLKSEL_USIMOCP_MASK, 2155 .clksel_mask = OMAP3430ES2_CLKSEL_USIMOCP_MASK,
2253 .clksel = usim_clksel, 2156 .clksel = usim_clksel,
2254 .flags = CLOCK_IN_OMAP3430ES2,
2255 .recalc = &omap2_clksel_recalc, 2157 .recalc = &omap2_clksel_recalc,
2256}; 2158};
2257 2159
2258/* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */ 2160/* XXX should gpt1's clksel have wkup_32k_fck as the 32k opt? */
2259static struct clk gpt1_fck = { 2161static struct clk gpt1_fck = {
2260 .name = "gpt1_fck", 2162 .name = "gpt1_fck",
2163 .ops = &clkops_omap2_dflt_wait,
2261 .init = &omap2_init_clksel_parent, 2164 .init = &omap2_init_clksel_parent,
2262 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2165 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2263 .enable_bit = OMAP3430_EN_GPT1_SHIFT, 2166 .enable_bit = OMAP3430_EN_GPT1_SHIFT,
2264 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL), 2167 .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL),
2265 .clksel_mask = OMAP3430_CLKSEL_GPT1_MASK, 2168 .clksel_mask = OMAP3430_CLKSEL_GPT1_MASK,
2266 .clksel = omap343x_gpt_clksel, 2169 .clksel = omap343x_gpt_clksel,
2267 .flags = CLOCK_IN_OMAP343X,
2268 .clkdm_name = "wkup_clkdm", 2170 .clkdm_name = "wkup_clkdm",
2269 .recalc = &omap2_clksel_recalc, 2171 .recalc = &omap2_clksel_recalc,
2270}; 2172};
2271 2173
2272static struct clk wkup_32k_fck = { 2174static struct clk wkup_32k_fck = {
2273 .name = "wkup_32k_fck", 2175 .name = "wkup_32k_fck",
2176 .ops = &clkops_null,
2274 .init = &omap2_init_clk_clkdm, 2177 .init = &omap2_init_clk_clkdm,
2275 .parent = &omap_32k_fck, 2178 .parent = &omap_32k_fck,
2276 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2277 .clkdm_name = "wkup_clkdm", 2179 .clkdm_name = "wkup_clkdm",
2278 .recalc = &followparent_recalc, 2180 .recalc = &followparent_recalc,
2279}; 2181};
2280 2182
2281static struct clk gpio1_dbck = { 2183static struct clk gpio1_dbck = {
2282 .name = "gpio1_dbck", 2184 .name = "gpio1_dbck",
2185 .ops = &clkops_omap2_dflt_wait,
2283 .parent = &wkup_32k_fck, 2186 .parent = &wkup_32k_fck,
2284 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2187 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2285 .enable_bit = OMAP3430_EN_GPIO1_SHIFT, 2188 .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
2286 .flags = CLOCK_IN_OMAP343X,
2287 .clkdm_name = "wkup_clkdm", 2189 .clkdm_name = "wkup_clkdm",
2288 .recalc = &followparent_recalc, 2190 .recalc = &followparent_recalc,
2289}; 2191};
2290 2192
2291static struct clk wdt2_fck = { 2193static struct clk wdt2_fck = {
2292 .name = "wdt2_fck", 2194 .name = "wdt2_fck",
2195 .ops = &clkops_omap2_dflt_wait,
2293 .parent = &wkup_32k_fck, 2196 .parent = &wkup_32k_fck,
2294 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2197 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2295 .enable_bit = OMAP3430_EN_WDT2_SHIFT, 2198 .enable_bit = OMAP3430_EN_WDT2_SHIFT,
2296 .flags = CLOCK_IN_OMAP343X,
2297 .clkdm_name = "wkup_clkdm", 2199 .clkdm_name = "wkup_clkdm",
2298 .recalc = &followparent_recalc, 2200 .recalc = &followparent_recalc,
2299}; 2201};
2300 2202
2301static struct clk wkup_l4_ick = { 2203static struct clk wkup_l4_ick = {
2302 .name = "wkup_l4_ick", 2204 .name = "wkup_l4_ick",
2205 .ops = &clkops_null,
2303 .parent = &sys_ck, 2206 .parent = &sys_ck,
2304 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2305 .clkdm_name = "wkup_clkdm", 2207 .clkdm_name = "wkup_clkdm",
2306 .recalc = &followparent_recalc, 2208 .recalc = &followparent_recalc,
2307}; 2209};
@@ -2310,50 +2212,50 @@ static struct clk wkup_l4_ick = {
2310/* Never specifically named in the TRM, so we have to infer a likely name */ 2212/* Never specifically named in the TRM, so we have to infer a likely name */
2311static struct clk usim_ick = { 2213static struct clk usim_ick = {
2312 .name = "usim_ick", 2214 .name = "usim_ick",
2215 .ops = &clkops_omap2_dflt_wait,
2313 .parent = &wkup_l4_ick, 2216 .parent = &wkup_l4_ick,
2314 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2217 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2315 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, 2218 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT,
2316 .flags = CLOCK_IN_OMAP3430ES2,
2317 .clkdm_name = "wkup_clkdm", 2219 .clkdm_name = "wkup_clkdm",
2318 .recalc = &followparent_recalc, 2220 .recalc = &followparent_recalc,
2319}; 2221};
2320 2222
2321static struct clk wdt2_ick = { 2223static struct clk wdt2_ick = {
2322 .name = "wdt2_ick", 2224 .name = "wdt2_ick",
2225 .ops = &clkops_omap2_dflt_wait,
2323 .parent = &wkup_l4_ick, 2226 .parent = &wkup_l4_ick,
2324 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2227 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2325 .enable_bit = OMAP3430_EN_WDT2_SHIFT, 2228 .enable_bit = OMAP3430_EN_WDT2_SHIFT,
2326 .flags = CLOCK_IN_OMAP343X,
2327 .clkdm_name = "wkup_clkdm", 2229 .clkdm_name = "wkup_clkdm",
2328 .recalc = &followparent_recalc, 2230 .recalc = &followparent_recalc,
2329}; 2231};
2330 2232
2331static struct clk wdt1_ick = { 2233static struct clk wdt1_ick = {
2332 .name = "wdt1_ick", 2234 .name = "wdt1_ick",
2235 .ops = &clkops_omap2_dflt_wait,
2333 .parent = &wkup_l4_ick, 2236 .parent = &wkup_l4_ick,
2334 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2237 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2335 .enable_bit = OMAP3430_EN_WDT1_SHIFT, 2238 .enable_bit = OMAP3430_EN_WDT1_SHIFT,
2336 .flags = CLOCK_IN_OMAP343X,
2337 .clkdm_name = "wkup_clkdm", 2239 .clkdm_name = "wkup_clkdm",
2338 .recalc = &followparent_recalc, 2240 .recalc = &followparent_recalc,
2339}; 2241};
2340 2242
2341static struct clk gpio1_ick = { 2243static struct clk gpio1_ick = {
2342 .name = "gpio1_ick", 2244 .name = "gpio1_ick",
2245 .ops = &clkops_omap2_dflt_wait,
2343 .parent = &wkup_l4_ick, 2246 .parent = &wkup_l4_ick,
2344 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2247 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2345 .enable_bit = OMAP3430_EN_GPIO1_SHIFT, 2248 .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
2346 .flags = CLOCK_IN_OMAP343X,
2347 .clkdm_name = "wkup_clkdm", 2249 .clkdm_name = "wkup_clkdm",
2348 .recalc = &followparent_recalc, 2250 .recalc = &followparent_recalc,
2349}; 2251};
2350 2252
2351static struct clk omap_32ksync_ick = { 2253static struct clk omap_32ksync_ick = {
2352 .name = "omap_32ksync_ick", 2254 .name = "omap_32ksync_ick",
2255 .ops = &clkops_omap2_dflt_wait,
2353 .parent = &wkup_l4_ick, 2256 .parent = &wkup_l4_ick,
2354 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2257 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2355 .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, 2258 .enable_bit = OMAP3430_EN_32KSYNC_SHIFT,
2356 .flags = CLOCK_IN_OMAP343X,
2357 .clkdm_name = "wkup_clkdm", 2259 .clkdm_name = "wkup_clkdm",
2358 .recalc = &followparent_recalc, 2260 .recalc = &followparent_recalc,
2359}; 2261};
@@ -2361,20 +2263,20 @@ static struct clk omap_32ksync_ick = {
2361/* XXX This clock no longer exists in 3430 TRM rev F */ 2263/* XXX This clock no longer exists in 3430 TRM rev F */
2362static struct clk gpt12_ick = { 2264static struct clk gpt12_ick = {
2363 .name = "gpt12_ick", 2265 .name = "gpt12_ick",
2266 .ops = &clkops_omap2_dflt_wait,
2364 .parent = &wkup_l4_ick, 2267 .parent = &wkup_l4_ick,
2365 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2268 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2366 .enable_bit = OMAP3430_EN_GPT12_SHIFT, 2269 .enable_bit = OMAP3430_EN_GPT12_SHIFT,
2367 .flags = CLOCK_IN_OMAP343X,
2368 .clkdm_name = "wkup_clkdm", 2270 .clkdm_name = "wkup_clkdm",
2369 .recalc = &followparent_recalc, 2271 .recalc = &followparent_recalc,
2370}; 2272};
2371 2273
2372static struct clk gpt1_ick = { 2274static struct clk gpt1_ick = {
2373 .name = "gpt1_ick", 2275 .name = "gpt1_ick",
2276 .ops = &clkops_omap2_dflt_wait,
2374 .parent = &wkup_l4_ick, 2277 .parent = &wkup_l4_ick,
2375 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2278 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2376 .enable_bit = OMAP3430_EN_GPT1_SHIFT, 2279 .enable_bit = OMAP3430_EN_GPT1_SHIFT,
2377 .flags = CLOCK_IN_OMAP343X,
2378 .clkdm_name = "wkup_clkdm", 2280 .clkdm_name = "wkup_clkdm",
2379 .recalc = &followparent_recalc, 2281 .recalc = &followparent_recalc,
2380}; 2282};
@@ -2385,406 +2287,404 @@ static struct clk gpt1_ick = {
2385 2287
2386static struct clk per_96m_fck = { 2288static struct clk per_96m_fck = {
2387 .name = "per_96m_fck", 2289 .name = "per_96m_fck",
2290 .ops = &clkops_null,
2388 .parent = &omap_96m_alwon_fck, 2291 .parent = &omap_96m_alwon_fck,
2389 .init = &omap2_init_clk_clkdm, 2292 .init = &omap2_init_clk_clkdm,
2390 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
2391 PARENT_CONTROLS_CLOCK,
2392 .clkdm_name = "per_clkdm", 2293 .clkdm_name = "per_clkdm",
2393 .recalc = &followparent_recalc, 2294 .recalc = &followparent_recalc,
2394}; 2295};
2395 2296
2396static struct clk per_48m_fck = { 2297static struct clk per_48m_fck = {
2397 .name = "per_48m_fck", 2298 .name = "per_48m_fck",
2299 .ops = &clkops_null,
2398 .parent = &omap_48m_fck, 2300 .parent = &omap_48m_fck,
2399 .init = &omap2_init_clk_clkdm, 2301 .init = &omap2_init_clk_clkdm,
2400 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
2401 PARENT_CONTROLS_CLOCK,
2402 .clkdm_name = "per_clkdm", 2302 .clkdm_name = "per_clkdm",
2403 .recalc = &followparent_recalc, 2303 .recalc = &followparent_recalc,
2404}; 2304};
2405 2305
2406static struct clk uart3_fck = { 2306static struct clk uart3_fck = {
2407 .name = "uart3_fck", 2307 .name = "uart3_fck",
2308 .ops = &clkops_omap2_dflt_wait,
2408 .parent = &per_48m_fck, 2309 .parent = &per_48m_fck,
2409 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2310 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2410 .enable_bit = OMAP3430_EN_UART3_SHIFT, 2311 .enable_bit = OMAP3430_EN_UART3_SHIFT,
2411 .flags = CLOCK_IN_OMAP343X,
2412 .clkdm_name = "per_clkdm", 2312 .clkdm_name = "per_clkdm",
2413 .recalc = &followparent_recalc, 2313 .recalc = &followparent_recalc,
2414}; 2314};
2415 2315
2416static struct clk gpt2_fck = { 2316static struct clk gpt2_fck = {
2417 .name = "gpt2_fck", 2317 .name = "gpt2_fck",
2318 .ops = &clkops_omap2_dflt_wait,
2418 .init = &omap2_init_clksel_parent, 2319 .init = &omap2_init_clksel_parent,
2419 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2320 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2420 .enable_bit = OMAP3430_EN_GPT2_SHIFT, 2321 .enable_bit = OMAP3430_EN_GPT2_SHIFT,
2421 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2322 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2422 .clksel_mask = OMAP3430_CLKSEL_GPT2_MASK, 2323 .clksel_mask = OMAP3430_CLKSEL_GPT2_MASK,
2423 .clksel = omap343x_gpt_clksel, 2324 .clksel = omap343x_gpt_clksel,
2424 .flags = CLOCK_IN_OMAP343X,
2425 .clkdm_name = "per_clkdm", 2325 .clkdm_name = "per_clkdm",
2426 .recalc = &omap2_clksel_recalc, 2326 .recalc = &omap2_clksel_recalc,
2427}; 2327};
2428 2328
2429static struct clk gpt3_fck = { 2329static struct clk gpt3_fck = {
2430 .name = "gpt3_fck", 2330 .name = "gpt3_fck",
2331 .ops = &clkops_omap2_dflt_wait,
2431 .init = &omap2_init_clksel_parent, 2332 .init = &omap2_init_clksel_parent,
2432 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2333 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2433 .enable_bit = OMAP3430_EN_GPT3_SHIFT, 2334 .enable_bit = OMAP3430_EN_GPT3_SHIFT,
2434 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2335 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2435 .clksel_mask = OMAP3430_CLKSEL_GPT3_MASK, 2336 .clksel_mask = OMAP3430_CLKSEL_GPT3_MASK,
2436 .clksel = omap343x_gpt_clksel, 2337 .clksel = omap343x_gpt_clksel,
2437 .flags = CLOCK_IN_OMAP343X,
2438 .clkdm_name = "per_clkdm", 2338 .clkdm_name = "per_clkdm",
2439 .recalc = &omap2_clksel_recalc, 2339 .recalc = &omap2_clksel_recalc,
2440}; 2340};
2441 2341
2442static struct clk gpt4_fck = { 2342static struct clk gpt4_fck = {
2443 .name = "gpt4_fck", 2343 .name = "gpt4_fck",
2344 .ops = &clkops_omap2_dflt_wait,
2444 .init = &omap2_init_clksel_parent, 2345 .init = &omap2_init_clksel_parent,
2445 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2346 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2446 .enable_bit = OMAP3430_EN_GPT4_SHIFT, 2347 .enable_bit = OMAP3430_EN_GPT4_SHIFT,
2447 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2348 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2448 .clksel_mask = OMAP3430_CLKSEL_GPT4_MASK, 2349 .clksel_mask = OMAP3430_CLKSEL_GPT4_MASK,
2449 .clksel = omap343x_gpt_clksel, 2350 .clksel = omap343x_gpt_clksel,
2450 .flags = CLOCK_IN_OMAP343X,
2451 .clkdm_name = "per_clkdm", 2351 .clkdm_name = "per_clkdm",
2452 .recalc = &omap2_clksel_recalc, 2352 .recalc = &omap2_clksel_recalc,
2453}; 2353};
2454 2354
2455static struct clk gpt5_fck = { 2355static struct clk gpt5_fck = {
2456 .name = "gpt5_fck", 2356 .name = "gpt5_fck",
2357 .ops = &clkops_omap2_dflt_wait,
2457 .init = &omap2_init_clksel_parent, 2358 .init = &omap2_init_clksel_parent,
2458 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2359 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2459 .enable_bit = OMAP3430_EN_GPT5_SHIFT, 2360 .enable_bit = OMAP3430_EN_GPT5_SHIFT,
2460 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2361 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2461 .clksel_mask = OMAP3430_CLKSEL_GPT5_MASK, 2362 .clksel_mask = OMAP3430_CLKSEL_GPT5_MASK,
2462 .clksel = omap343x_gpt_clksel, 2363 .clksel = omap343x_gpt_clksel,
2463 .flags = CLOCK_IN_OMAP343X,
2464 .clkdm_name = "per_clkdm", 2364 .clkdm_name = "per_clkdm",
2465 .recalc = &omap2_clksel_recalc, 2365 .recalc = &omap2_clksel_recalc,
2466}; 2366};
2467 2367
2468static struct clk gpt6_fck = { 2368static struct clk gpt6_fck = {
2469 .name = "gpt6_fck", 2369 .name = "gpt6_fck",
2370 .ops = &clkops_omap2_dflt_wait,
2470 .init = &omap2_init_clksel_parent, 2371 .init = &omap2_init_clksel_parent,
2471 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2372 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2472 .enable_bit = OMAP3430_EN_GPT6_SHIFT, 2373 .enable_bit = OMAP3430_EN_GPT6_SHIFT,
2473 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2374 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2474 .clksel_mask = OMAP3430_CLKSEL_GPT6_MASK, 2375 .clksel_mask = OMAP3430_CLKSEL_GPT6_MASK,
2475 .clksel = omap343x_gpt_clksel, 2376 .clksel = omap343x_gpt_clksel,
2476 .flags = CLOCK_IN_OMAP343X,
2477 .clkdm_name = "per_clkdm", 2377 .clkdm_name = "per_clkdm",
2478 .recalc = &omap2_clksel_recalc, 2378 .recalc = &omap2_clksel_recalc,
2479}; 2379};
2480 2380
2481static struct clk gpt7_fck = { 2381static struct clk gpt7_fck = {
2482 .name = "gpt7_fck", 2382 .name = "gpt7_fck",
2383 .ops = &clkops_omap2_dflt_wait,
2483 .init = &omap2_init_clksel_parent, 2384 .init = &omap2_init_clksel_parent,
2484 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2385 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2485 .enable_bit = OMAP3430_EN_GPT7_SHIFT, 2386 .enable_bit = OMAP3430_EN_GPT7_SHIFT,
2486 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2387 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2487 .clksel_mask = OMAP3430_CLKSEL_GPT7_MASK, 2388 .clksel_mask = OMAP3430_CLKSEL_GPT7_MASK,
2488 .clksel = omap343x_gpt_clksel, 2389 .clksel = omap343x_gpt_clksel,
2489 .flags = CLOCK_IN_OMAP343X,
2490 .clkdm_name = "per_clkdm", 2390 .clkdm_name = "per_clkdm",
2491 .recalc = &omap2_clksel_recalc, 2391 .recalc = &omap2_clksel_recalc,
2492}; 2392};
2493 2393
2494static struct clk gpt8_fck = { 2394static struct clk gpt8_fck = {
2495 .name = "gpt8_fck", 2395 .name = "gpt8_fck",
2396 .ops = &clkops_omap2_dflt_wait,
2496 .init = &omap2_init_clksel_parent, 2397 .init = &omap2_init_clksel_parent,
2497 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2398 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2498 .enable_bit = OMAP3430_EN_GPT8_SHIFT, 2399 .enable_bit = OMAP3430_EN_GPT8_SHIFT,
2499 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2400 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2500 .clksel_mask = OMAP3430_CLKSEL_GPT8_MASK, 2401 .clksel_mask = OMAP3430_CLKSEL_GPT8_MASK,
2501 .clksel = omap343x_gpt_clksel, 2402 .clksel = omap343x_gpt_clksel,
2502 .flags = CLOCK_IN_OMAP343X,
2503 .clkdm_name = "per_clkdm", 2403 .clkdm_name = "per_clkdm",
2504 .recalc = &omap2_clksel_recalc, 2404 .recalc = &omap2_clksel_recalc,
2505}; 2405};
2506 2406
2507static struct clk gpt9_fck = { 2407static struct clk gpt9_fck = {
2508 .name = "gpt9_fck", 2408 .name = "gpt9_fck",
2409 .ops = &clkops_omap2_dflt_wait,
2509 .init = &omap2_init_clksel_parent, 2410 .init = &omap2_init_clksel_parent,
2510 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2411 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2511 .enable_bit = OMAP3430_EN_GPT9_SHIFT, 2412 .enable_bit = OMAP3430_EN_GPT9_SHIFT,
2512 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL), 2413 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_CLKSEL),
2513 .clksel_mask = OMAP3430_CLKSEL_GPT9_MASK, 2414 .clksel_mask = OMAP3430_CLKSEL_GPT9_MASK,
2514 .clksel = omap343x_gpt_clksel, 2415 .clksel = omap343x_gpt_clksel,
2515 .flags = CLOCK_IN_OMAP343X,
2516 .clkdm_name = "per_clkdm", 2416 .clkdm_name = "per_clkdm",
2517 .recalc = &omap2_clksel_recalc, 2417 .recalc = &omap2_clksel_recalc,
2518}; 2418};
2519 2419
2520static struct clk per_32k_alwon_fck = { 2420static struct clk per_32k_alwon_fck = {
2521 .name = "per_32k_alwon_fck", 2421 .name = "per_32k_alwon_fck",
2422 .ops = &clkops_null,
2522 .parent = &omap_32k_fck, 2423 .parent = &omap_32k_fck,
2523 .clkdm_name = "per_clkdm", 2424 .clkdm_name = "per_clkdm",
2524 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2525 .recalc = &followparent_recalc, 2425 .recalc = &followparent_recalc,
2526}; 2426};
2527 2427
2528static struct clk gpio6_dbck = { 2428static struct clk gpio6_dbck = {
2529 .name = "gpio6_dbck", 2429 .name = "gpio6_dbck",
2430 .ops = &clkops_omap2_dflt_wait,
2530 .parent = &per_32k_alwon_fck, 2431 .parent = &per_32k_alwon_fck,
2531 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2432 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2532 .enable_bit = OMAP3430_EN_GPIO6_SHIFT, 2433 .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
2533 .flags = CLOCK_IN_OMAP343X,
2534 .clkdm_name = "per_clkdm", 2434 .clkdm_name = "per_clkdm",
2535 .recalc = &followparent_recalc, 2435 .recalc = &followparent_recalc,
2536}; 2436};
2537 2437
2538static struct clk gpio5_dbck = { 2438static struct clk gpio5_dbck = {
2539 .name = "gpio5_dbck", 2439 .name = "gpio5_dbck",
2440 .ops = &clkops_omap2_dflt_wait,
2540 .parent = &per_32k_alwon_fck, 2441 .parent = &per_32k_alwon_fck,
2541 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2442 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2542 .enable_bit = OMAP3430_EN_GPIO5_SHIFT, 2443 .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
2543 .flags = CLOCK_IN_OMAP343X,
2544 .clkdm_name = "per_clkdm", 2444 .clkdm_name = "per_clkdm",
2545 .recalc = &followparent_recalc, 2445 .recalc = &followparent_recalc,
2546}; 2446};
2547 2447
2548static struct clk gpio4_dbck = { 2448static struct clk gpio4_dbck = {
2549 .name = "gpio4_dbck", 2449 .name = "gpio4_dbck",
2450 .ops = &clkops_omap2_dflt_wait,
2550 .parent = &per_32k_alwon_fck, 2451 .parent = &per_32k_alwon_fck,
2551 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2452 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2552 .enable_bit = OMAP3430_EN_GPIO4_SHIFT, 2453 .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
2553 .flags = CLOCK_IN_OMAP343X,
2554 .clkdm_name = "per_clkdm", 2454 .clkdm_name = "per_clkdm",
2555 .recalc = &followparent_recalc, 2455 .recalc = &followparent_recalc,
2556}; 2456};
2557 2457
2558static struct clk gpio3_dbck = { 2458static struct clk gpio3_dbck = {
2559 .name = "gpio3_dbck", 2459 .name = "gpio3_dbck",
2460 .ops = &clkops_omap2_dflt_wait,
2560 .parent = &per_32k_alwon_fck, 2461 .parent = &per_32k_alwon_fck,
2561 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2462 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2562 .enable_bit = OMAP3430_EN_GPIO3_SHIFT, 2463 .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
2563 .flags = CLOCK_IN_OMAP343X,
2564 .clkdm_name = "per_clkdm", 2464 .clkdm_name = "per_clkdm",
2565 .recalc = &followparent_recalc, 2465 .recalc = &followparent_recalc,
2566}; 2466};
2567 2467
2568static struct clk gpio2_dbck = { 2468static struct clk gpio2_dbck = {
2569 .name = "gpio2_dbck", 2469 .name = "gpio2_dbck",
2470 .ops = &clkops_omap2_dflt_wait,
2570 .parent = &per_32k_alwon_fck, 2471 .parent = &per_32k_alwon_fck,
2571 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2472 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2572 .enable_bit = OMAP3430_EN_GPIO2_SHIFT, 2473 .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
2573 .flags = CLOCK_IN_OMAP343X,
2574 .clkdm_name = "per_clkdm", 2474 .clkdm_name = "per_clkdm",
2575 .recalc = &followparent_recalc, 2475 .recalc = &followparent_recalc,
2576}; 2476};
2577 2477
2578static struct clk wdt3_fck = { 2478static struct clk wdt3_fck = {
2579 .name = "wdt3_fck", 2479 .name = "wdt3_fck",
2480 .ops = &clkops_omap2_dflt_wait,
2580 .parent = &per_32k_alwon_fck, 2481 .parent = &per_32k_alwon_fck,
2581 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2482 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
2582 .enable_bit = OMAP3430_EN_WDT3_SHIFT, 2483 .enable_bit = OMAP3430_EN_WDT3_SHIFT,
2583 .flags = CLOCK_IN_OMAP343X,
2584 .clkdm_name = "per_clkdm", 2484 .clkdm_name = "per_clkdm",
2585 .recalc = &followparent_recalc, 2485 .recalc = &followparent_recalc,
2586}; 2486};
2587 2487
2588static struct clk per_l4_ick = { 2488static struct clk per_l4_ick = {
2589 .name = "per_l4_ick", 2489 .name = "per_l4_ick",
2490 .ops = &clkops_null,
2590 .parent = &l4_ick, 2491 .parent = &l4_ick,
2591 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES |
2592 PARENT_CONTROLS_CLOCK,
2593 .clkdm_name = "per_clkdm", 2492 .clkdm_name = "per_clkdm",
2594 .recalc = &followparent_recalc, 2493 .recalc = &followparent_recalc,
2595}; 2494};
2596 2495
2597static struct clk gpio6_ick = { 2496static struct clk gpio6_ick = {
2598 .name = "gpio6_ick", 2497 .name = "gpio6_ick",
2498 .ops = &clkops_omap2_dflt_wait,
2599 .parent = &per_l4_ick, 2499 .parent = &per_l4_ick,
2600 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2500 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2601 .enable_bit = OMAP3430_EN_GPIO6_SHIFT, 2501 .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
2602 .flags = CLOCK_IN_OMAP343X,
2603 .clkdm_name = "per_clkdm", 2502 .clkdm_name = "per_clkdm",
2604 .recalc = &followparent_recalc, 2503 .recalc = &followparent_recalc,
2605}; 2504};
2606 2505
2607static struct clk gpio5_ick = { 2506static struct clk gpio5_ick = {
2608 .name = "gpio5_ick", 2507 .name = "gpio5_ick",
2508 .ops = &clkops_omap2_dflt_wait,
2609 .parent = &per_l4_ick, 2509 .parent = &per_l4_ick,
2610 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2510 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2611 .enable_bit = OMAP3430_EN_GPIO5_SHIFT, 2511 .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
2612 .flags = CLOCK_IN_OMAP343X,
2613 .clkdm_name = "per_clkdm", 2512 .clkdm_name = "per_clkdm",
2614 .recalc = &followparent_recalc, 2513 .recalc = &followparent_recalc,
2615}; 2514};
2616 2515
2617static struct clk gpio4_ick = { 2516static struct clk gpio4_ick = {
2618 .name = "gpio4_ick", 2517 .name = "gpio4_ick",
2518 .ops = &clkops_omap2_dflt_wait,
2619 .parent = &per_l4_ick, 2519 .parent = &per_l4_ick,
2620 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2520 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2621 .enable_bit = OMAP3430_EN_GPIO4_SHIFT, 2521 .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
2622 .flags = CLOCK_IN_OMAP343X,
2623 .clkdm_name = "per_clkdm", 2522 .clkdm_name = "per_clkdm",
2624 .recalc = &followparent_recalc, 2523 .recalc = &followparent_recalc,
2625}; 2524};
2626 2525
2627static struct clk gpio3_ick = { 2526static struct clk gpio3_ick = {
2628 .name = "gpio3_ick", 2527 .name = "gpio3_ick",
2528 .ops = &clkops_omap2_dflt_wait,
2629 .parent = &per_l4_ick, 2529 .parent = &per_l4_ick,
2630 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2530 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2631 .enable_bit = OMAP3430_EN_GPIO3_SHIFT, 2531 .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
2632 .flags = CLOCK_IN_OMAP343X,
2633 .clkdm_name = "per_clkdm", 2532 .clkdm_name = "per_clkdm",
2634 .recalc = &followparent_recalc, 2533 .recalc = &followparent_recalc,
2635}; 2534};
2636 2535
2637static struct clk gpio2_ick = { 2536static struct clk gpio2_ick = {
2638 .name = "gpio2_ick", 2537 .name = "gpio2_ick",
2538 .ops = &clkops_omap2_dflt_wait,
2639 .parent = &per_l4_ick, 2539 .parent = &per_l4_ick,
2640 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2540 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2641 .enable_bit = OMAP3430_EN_GPIO2_SHIFT, 2541 .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
2642 .flags = CLOCK_IN_OMAP343X,
2643 .clkdm_name = "per_clkdm", 2542 .clkdm_name = "per_clkdm",
2644 .recalc = &followparent_recalc, 2543 .recalc = &followparent_recalc,
2645}; 2544};
2646 2545
2647static struct clk wdt3_ick = { 2546static struct clk wdt3_ick = {
2648 .name = "wdt3_ick", 2547 .name = "wdt3_ick",
2548 .ops = &clkops_omap2_dflt_wait,
2649 .parent = &per_l4_ick, 2549 .parent = &per_l4_ick,
2650 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2550 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2651 .enable_bit = OMAP3430_EN_WDT3_SHIFT, 2551 .enable_bit = OMAP3430_EN_WDT3_SHIFT,
2652 .flags = CLOCK_IN_OMAP343X,
2653 .clkdm_name = "per_clkdm", 2552 .clkdm_name = "per_clkdm",
2654 .recalc = &followparent_recalc, 2553 .recalc = &followparent_recalc,
2655}; 2554};
2656 2555
2657static struct clk uart3_ick = { 2556static struct clk uart3_ick = {
2658 .name = "uart3_ick", 2557 .name = "uart3_ick",
2558 .ops = &clkops_omap2_dflt_wait,
2659 .parent = &per_l4_ick, 2559 .parent = &per_l4_ick,
2660 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2560 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2661 .enable_bit = OMAP3430_EN_UART3_SHIFT, 2561 .enable_bit = OMAP3430_EN_UART3_SHIFT,
2662 .flags = CLOCK_IN_OMAP343X,
2663 .clkdm_name = "per_clkdm", 2562 .clkdm_name = "per_clkdm",
2664 .recalc = &followparent_recalc, 2563 .recalc = &followparent_recalc,
2665}; 2564};
2666 2565
2667static struct clk gpt9_ick = { 2566static struct clk gpt9_ick = {
2668 .name = "gpt9_ick", 2567 .name = "gpt9_ick",
2568 .ops = &clkops_omap2_dflt_wait,
2669 .parent = &per_l4_ick, 2569 .parent = &per_l4_ick,
2670 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2570 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2671 .enable_bit = OMAP3430_EN_GPT9_SHIFT, 2571 .enable_bit = OMAP3430_EN_GPT9_SHIFT,
2672 .flags = CLOCK_IN_OMAP343X,
2673 .clkdm_name = "per_clkdm", 2572 .clkdm_name = "per_clkdm",
2674 .recalc = &followparent_recalc, 2573 .recalc = &followparent_recalc,
2675}; 2574};
2676 2575
2677static struct clk gpt8_ick = { 2576static struct clk gpt8_ick = {
2678 .name = "gpt8_ick", 2577 .name = "gpt8_ick",
2578 .ops = &clkops_omap2_dflt_wait,
2679 .parent = &per_l4_ick, 2579 .parent = &per_l4_ick,
2680 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2580 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2681 .enable_bit = OMAP3430_EN_GPT8_SHIFT, 2581 .enable_bit = OMAP3430_EN_GPT8_SHIFT,
2682 .flags = CLOCK_IN_OMAP343X,
2683 .clkdm_name = "per_clkdm", 2582 .clkdm_name = "per_clkdm",
2684 .recalc = &followparent_recalc, 2583 .recalc = &followparent_recalc,
2685}; 2584};
2686 2585
2687static struct clk gpt7_ick = { 2586static struct clk gpt7_ick = {
2688 .name = "gpt7_ick", 2587 .name = "gpt7_ick",
2588 .ops = &clkops_omap2_dflt_wait,
2689 .parent = &per_l4_ick, 2589 .parent = &per_l4_ick,
2690 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2590 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2691 .enable_bit = OMAP3430_EN_GPT7_SHIFT, 2591 .enable_bit = OMAP3430_EN_GPT7_SHIFT,
2692 .flags = CLOCK_IN_OMAP343X,
2693 .clkdm_name = "per_clkdm", 2592 .clkdm_name = "per_clkdm",
2694 .recalc = &followparent_recalc, 2593 .recalc = &followparent_recalc,
2695}; 2594};
2696 2595
2697static struct clk gpt6_ick = { 2596static struct clk gpt6_ick = {
2698 .name = "gpt6_ick", 2597 .name = "gpt6_ick",
2598 .ops = &clkops_omap2_dflt_wait,
2699 .parent = &per_l4_ick, 2599 .parent = &per_l4_ick,
2700 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2600 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2701 .enable_bit = OMAP3430_EN_GPT6_SHIFT, 2601 .enable_bit = OMAP3430_EN_GPT6_SHIFT,
2702 .flags = CLOCK_IN_OMAP343X,
2703 .clkdm_name = "per_clkdm", 2602 .clkdm_name = "per_clkdm",
2704 .recalc = &followparent_recalc, 2603 .recalc = &followparent_recalc,
2705}; 2604};
2706 2605
2707static struct clk gpt5_ick = { 2606static struct clk gpt5_ick = {
2708 .name = "gpt5_ick", 2607 .name = "gpt5_ick",
2608 .ops = &clkops_omap2_dflt_wait,
2709 .parent = &per_l4_ick, 2609 .parent = &per_l4_ick,
2710 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2610 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2711 .enable_bit = OMAP3430_EN_GPT5_SHIFT, 2611 .enable_bit = OMAP3430_EN_GPT5_SHIFT,
2712 .flags = CLOCK_IN_OMAP343X,
2713 .clkdm_name = "per_clkdm", 2612 .clkdm_name = "per_clkdm",
2714 .recalc = &followparent_recalc, 2613 .recalc = &followparent_recalc,
2715}; 2614};
2716 2615
2717static struct clk gpt4_ick = { 2616static struct clk gpt4_ick = {
2718 .name = "gpt4_ick", 2617 .name = "gpt4_ick",
2618 .ops = &clkops_omap2_dflt_wait,
2719 .parent = &per_l4_ick, 2619 .parent = &per_l4_ick,
2720 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2620 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2721 .enable_bit = OMAP3430_EN_GPT4_SHIFT, 2621 .enable_bit = OMAP3430_EN_GPT4_SHIFT,
2722 .flags = CLOCK_IN_OMAP343X,
2723 .clkdm_name = "per_clkdm", 2622 .clkdm_name = "per_clkdm",
2724 .recalc = &followparent_recalc, 2623 .recalc = &followparent_recalc,
2725}; 2624};
2726 2625
2727static struct clk gpt3_ick = { 2626static struct clk gpt3_ick = {
2728 .name = "gpt3_ick", 2627 .name = "gpt3_ick",
2628 .ops = &clkops_omap2_dflt_wait,
2729 .parent = &per_l4_ick, 2629 .parent = &per_l4_ick,
2730 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2630 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2731 .enable_bit = OMAP3430_EN_GPT3_SHIFT, 2631 .enable_bit = OMAP3430_EN_GPT3_SHIFT,
2732 .flags = CLOCK_IN_OMAP343X,
2733 .clkdm_name = "per_clkdm", 2632 .clkdm_name = "per_clkdm",
2734 .recalc = &followparent_recalc, 2633 .recalc = &followparent_recalc,
2735}; 2634};
2736 2635
2737static struct clk gpt2_ick = { 2636static struct clk gpt2_ick = {
2738 .name = "gpt2_ick", 2637 .name = "gpt2_ick",
2638 .ops = &clkops_omap2_dflt_wait,
2739 .parent = &per_l4_ick, 2639 .parent = &per_l4_ick,
2740 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2640 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2741 .enable_bit = OMAP3430_EN_GPT2_SHIFT, 2641 .enable_bit = OMAP3430_EN_GPT2_SHIFT,
2742 .flags = CLOCK_IN_OMAP343X,
2743 .clkdm_name = "per_clkdm", 2642 .clkdm_name = "per_clkdm",
2744 .recalc = &followparent_recalc, 2643 .recalc = &followparent_recalc,
2745}; 2644};
2746 2645
2747static struct clk mcbsp2_ick = { 2646static struct clk mcbsp2_ick = {
2748 .name = "mcbsp_ick", 2647 .name = "mcbsp_ick",
2648 .ops = &clkops_omap2_dflt_wait,
2749 .id = 2, 2649 .id = 2,
2750 .parent = &per_l4_ick, 2650 .parent = &per_l4_ick,
2751 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2651 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2752 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, 2652 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT,
2753 .flags = CLOCK_IN_OMAP343X,
2754 .clkdm_name = "per_clkdm", 2653 .clkdm_name = "per_clkdm",
2755 .recalc = &followparent_recalc, 2654 .recalc = &followparent_recalc,
2756}; 2655};
2757 2656
2758static struct clk mcbsp3_ick = { 2657static struct clk mcbsp3_ick = {
2759 .name = "mcbsp_ick", 2658 .name = "mcbsp_ick",
2659 .ops = &clkops_omap2_dflt_wait,
2760 .id = 3, 2660 .id = 3,
2761 .parent = &per_l4_ick, 2661 .parent = &per_l4_ick,
2762 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2662 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2763 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, 2663 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT,
2764 .flags = CLOCK_IN_OMAP343X,
2765 .clkdm_name = "per_clkdm", 2664 .clkdm_name = "per_clkdm",
2766 .recalc = &followparent_recalc, 2665 .recalc = &followparent_recalc,
2767}; 2666};
2768 2667
2769static struct clk mcbsp4_ick = { 2668static struct clk mcbsp4_ick = {
2770 .name = "mcbsp_ick", 2669 .name = "mcbsp_ick",
2670 .ops = &clkops_omap2_dflt_wait,
2771 .id = 4, 2671 .id = 4,
2772 .parent = &per_l4_ick, 2672 .parent = &per_l4_ick,
2773 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2673 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2774 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, 2674 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT,
2775 .flags = CLOCK_IN_OMAP343X,
2776 .clkdm_name = "per_clkdm", 2675 .clkdm_name = "per_clkdm",
2777 .recalc = &followparent_recalc, 2676 .recalc = &followparent_recalc,
2778}; 2677};
2779 2678
2780static const struct clksel mcbsp_234_clksel[] = { 2679static const struct clksel mcbsp_234_clksel[] = {
2781 { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates }, 2680 { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates },
2782 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, 2681 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
2783 { .parent = NULL } 2682 { .parent = NULL }
2784}; 2683};
2785 2684
2786static struct clk mcbsp2_fck = { 2685static struct clk mcbsp2_fck = {
2787 .name = "mcbsp_fck", 2686 .name = "mcbsp_fck",
2687 .ops = &clkops_omap2_dflt_wait,
2788 .id = 2, 2688 .id = 2,
2789 .init = &omap2_init_clksel_parent, 2689 .init = &omap2_init_clksel_parent,
2790 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2690 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
@@ -2792,13 +2692,13 @@ static struct clk mcbsp2_fck = {
2792 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), 2692 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0),
2793 .clksel_mask = OMAP2_MCBSP2_CLKS_MASK, 2693 .clksel_mask = OMAP2_MCBSP2_CLKS_MASK,
2794 .clksel = mcbsp_234_clksel, 2694 .clksel = mcbsp_234_clksel,
2795 .flags = CLOCK_IN_OMAP343X,
2796 .clkdm_name = "per_clkdm", 2695 .clkdm_name = "per_clkdm",
2797 .recalc = &omap2_clksel_recalc, 2696 .recalc = &omap2_clksel_recalc,
2798}; 2697};
2799 2698
2800static struct clk mcbsp3_fck = { 2699static struct clk mcbsp3_fck = {
2801 .name = "mcbsp_fck", 2700 .name = "mcbsp_fck",
2701 .ops = &clkops_omap2_dflt_wait,
2802 .id = 3, 2702 .id = 3,
2803 .init = &omap2_init_clksel_parent, 2703 .init = &omap2_init_clksel_parent,
2804 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2704 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
@@ -2806,13 +2706,13 @@ static struct clk mcbsp3_fck = {
2806 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), 2706 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
2807 .clksel_mask = OMAP2_MCBSP3_CLKS_MASK, 2707 .clksel_mask = OMAP2_MCBSP3_CLKS_MASK,
2808 .clksel = mcbsp_234_clksel, 2708 .clksel = mcbsp_234_clksel,
2809 .flags = CLOCK_IN_OMAP343X,
2810 .clkdm_name = "per_clkdm", 2709 .clkdm_name = "per_clkdm",
2811 .recalc = &omap2_clksel_recalc, 2710 .recalc = &omap2_clksel_recalc,
2812}; 2711};
2813 2712
2814static struct clk mcbsp4_fck = { 2713static struct clk mcbsp4_fck = {
2815 .name = "mcbsp_fck", 2714 .name = "mcbsp_fck",
2715 .ops = &clkops_omap2_dflt_wait,
2816 .id = 4, 2716 .id = 4,
2817 .init = &omap2_init_clksel_parent, 2717 .init = &omap2_init_clksel_parent,
2818 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), 2718 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN),
@@ -2820,7 +2720,6 @@ static struct clk mcbsp4_fck = {
2820 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1), 2720 .clksel_reg = OMAP343X_CTRL_REGADDR(OMAP343X_CONTROL_DEVCONF1),
2821 .clksel_mask = OMAP2_MCBSP4_CLKS_MASK, 2721 .clksel_mask = OMAP2_MCBSP4_CLKS_MASK,
2822 .clksel = mcbsp_234_clksel, 2722 .clksel = mcbsp_234_clksel,
2823 .flags = CLOCK_IN_OMAP343X,
2824 .clkdm_name = "per_clkdm", 2723 .clkdm_name = "per_clkdm",
2825 .recalc = &omap2_clksel_recalc, 2724 .recalc = &omap2_clksel_recalc,
2826}; 2725};
@@ -2864,11 +2763,11 @@ static const struct clksel emu_src_clksel[] = {
2864 */ 2763 */
2865static struct clk emu_src_ck = { 2764static struct clk emu_src_ck = {
2866 .name = "emu_src_ck", 2765 .name = "emu_src_ck",
2766 .ops = &clkops_null,
2867 .init = &omap2_init_clksel_parent, 2767 .init = &omap2_init_clksel_parent,
2868 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 2768 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2869 .clksel_mask = OMAP3430_MUX_CTRL_MASK, 2769 .clksel_mask = OMAP3430_MUX_CTRL_MASK,
2870 .clksel = emu_src_clksel, 2770 .clksel = emu_src_clksel,
2871 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2872 .clkdm_name = "emu_clkdm", 2771 .clkdm_name = "emu_clkdm",
2873 .recalc = &omap2_clksel_recalc, 2772 .recalc = &omap2_clksel_recalc,
2874}; 2773};
@@ -2888,11 +2787,11 @@ static const struct clksel pclk_emu_clksel[] = {
2888 2787
2889static struct clk pclk_fck = { 2788static struct clk pclk_fck = {
2890 .name = "pclk_fck", 2789 .name = "pclk_fck",
2790 .ops = &clkops_null,
2891 .init = &omap2_init_clksel_parent, 2791 .init = &omap2_init_clksel_parent,
2892 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 2792 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2893 .clksel_mask = OMAP3430_CLKSEL_PCLK_MASK, 2793 .clksel_mask = OMAP3430_CLKSEL_PCLK_MASK,
2894 .clksel = pclk_emu_clksel, 2794 .clksel = pclk_emu_clksel,
2895 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2896 .clkdm_name = "emu_clkdm", 2795 .clkdm_name = "emu_clkdm",
2897 .recalc = &omap2_clksel_recalc, 2796 .recalc = &omap2_clksel_recalc,
2898}; 2797};
@@ -2911,11 +2810,11 @@ static const struct clksel pclkx2_emu_clksel[] = {
2911 2810
2912static struct clk pclkx2_fck = { 2811static struct clk pclkx2_fck = {
2913 .name = "pclkx2_fck", 2812 .name = "pclkx2_fck",
2813 .ops = &clkops_null,
2914 .init = &omap2_init_clksel_parent, 2814 .init = &omap2_init_clksel_parent,
2915 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 2815 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2916 .clksel_mask = OMAP3430_CLKSEL_PCLKX2_MASK, 2816 .clksel_mask = OMAP3430_CLKSEL_PCLKX2_MASK,
2917 .clksel = pclkx2_emu_clksel, 2817 .clksel = pclkx2_emu_clksel,
2918 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2919 .clkdm_name = "emu_clkdm", 2818 .clkdm_name = "emu_clkdm",
2920 .recalc = &omap2_clksel_recalc, 2819 .recalc = &omap2_clksel_recalc,
2921}; 2820};
@@ -2927,22 +2826,22 @@ static const struct clksel atclk_emu_clksel[] = {
2927 2826
2928static struct clk atclk_fck = { 2827static struct clk atclk_fck = {
2929 .name = "atclk_fck", 2828 .name = "atclk_fck",
2829 .ops = &clkops_null,
2930 .init = &omap2_init_clksel_parent, 2830 .init = &omap2_init_clksel_parent,
2931 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 2831 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2932 .clksel_mask = OMAP3430_CLKSEL_ATCLK_MASK, 2832 .clksel_mask = OMAP3430_CLKSEL_ATCLK_MASK,
2933 .clksel = atclk_emu_clksel, 2833 .clksel = atclk_emu_clksel,
2934 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2935 .clkdm_name = "emu_clkdm", 2834 .clkdm_name = "emu_clkdm",
2936 .recalc = &omap2_clksel_recalc, 2835 .recalc = &omap2_clksel_recalc,
2937}; 2836};
2938 2837
2939static struct clk traceclk_src_fck = { 2838static struct clk traceclk_src_fck = {
2940 .name = "traceclk_src_fck", 2839 .name = "traceclk_src_fck",
2840 .ops = &clkops_null,
2941 .init = &omap2_init_clksel_parent, 2841 .init = &omap2_init_clksel_parent,
2942 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 2842 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2943 .clksel_mask = OMAP3430_TRACE_MUX_CTRL_MASK, 2843 .clksel_mask = OMAP3430_TRACE_MUX_CTRL_MASK,
2944 .clksel = emu_src_clksel, 2844 .clksel = emu_src_clksel,
2945 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES | ALWAYS_ENABLED,
2946 .clkdm_name = "emu_clkdm", 2845 .clkdm_name = "emu_clkdm",
2947 .recalc = &omap2_clksel_recalc, 2846 .recalc = &omap2_clksel_recalc,
2948}; 2847};
@@ -2961,11 +2860,11 @@ static const struct clksel traceclk_clksel[] = {
2961 2860
2962static struct clk traceclk_fck = { 2861static struct clk traceclk_fck = {
2963 .name = "traceclk_fck", 2862 .name = "traceclk_fck",
2863 .ops = &clkops_null,
2964 .init = &omap2_init_clksel_parent, 2864 .init = &omap2_init_clksel_parent,
2965 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), 2865 .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1),
2966 .clksel_mask = OMAP3430_CLKSEL_TRACECLK_MASK, 2866 .clksel_mask = OMAP3430_CLKSEL_TRACECLK_MASK,
2967 .clksel = traceclk_clksel, 2867 .clksel = traceclk_clksel,
2968 .flags = CLOCK_IN_OMAP343X | ALWAYS_ENABLED,
2969 .clkdm_name = "emu_clkdm", 2868 .clkdm_name = "emu_clkdm",
2970 .recalc = &omap2_clksel_recalc, 2869 .recalc = &omap2_clksel_recalc,
2971}; 2870};
@@ -2975,27 +2874,27 @@ static struct clk traceclk_fck = {
2975/* SmartReflex fclk (VDD1) */ 2874/* SmartReflex fclk (VDD1) */
2976static struct clk sr1_fck = { 2875static struct clk sr1_fck = {
2977 .name = "sr1_fck", 2876 .name = "sr1_fck",
2877 .ops = &clkops_omap2_dflt_wait,
2978 .parent = &sys_ck, 2878 .parent = &sys_ck,
2979 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2879 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2980 .enable_bit = OMAP3430_EN_SR1_SHIFT, 2880 .enable_bit = OMAP3430_EN_SR1_SHIFT,
2981 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
2982 .recalc = &followparent_recalc, 2881 .recalc = &followparent_recalc,
2983}; 2882};
2984 2883
2985/* SmartReflex fclk (VDD2) */ 2884/* SmartReflex fclk (VDD2) */
2986static struct clk sr2_fck = { 2885static struct clk sr2_fck = {
2987 .name = "sr2_fck", 2886 .name = "sr2_fck",
2887 .ops = &clkops_omap2_dflt_wait,
2988 .parent = &sys_ck, 2888 .parent = &sys_ck,
2989 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 2889 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
2990 .enable_bit = OMAP3430_EN_SR2_SHIFT, 2890 .enable_bit = OMAP3430_EN_SR2_SHIFT,
2991 .flags = CLOCK_IN_OMAP343X | RATE_PROPAGATES,
2992 .recalc = &followparent_recalc, 2891 .recalc = &followparent_recalc,
2993}; 2892};
2994 2893
2995static struct clk sr_l4_ick = { 2894static struct clk sr_l4_ick = {
2996 .name = "sr_l4_ick", 2895 .name = "sr_l4_ick",
2896 .ops = &clkops_null, /* RMK: missing? */
2997 .parent = &l4_ick, 2897 .parent = &l4_ick,
2998 .flags = CLOCK_IN_OMAP343X,
2999 .clkdm_name = "core_l4_clkdm", 2898 .clkdm_name = "core_l4_clkdm",
3000 .recalc = &followparent_recalc, 2899 .recalc = &followparent_recalc,
3001}; 2900};
@@ -3005,231 +2904,16 @@ static struct clk sr_l4_ick = {
3005/* XXX This clock no longer exists in 3430 TRM rev F */ 2904/* XXX This clock no longer exists in 3430 TRM rev F */
3006static struct clk gpt12_fck = { 2905static struct clk gpt12_fck = {
3007 .name = "gpt12_fck", 2906 .name = "gpt12_fck",
2907 .ops = &clkops_null,
3008 .parent = &secure_32k_fck, 2908 .parent = &secure_32k_fck,
3009 .flags = CLOCK_IN_OMAP343X | ALWAYS_ENABLED,
3010 .recalc = &followparent_recalc, 2909 .recalc = &followparent_recalc,
3011}; 2910};
3012 2911
3013static struct clk wdt1_fck = { 2912static struct clk wdt1_fck = {
3014 .name = "wdt1_fck", 2913 .name = "wdt1_fck",
2914 .ops = &clkops_null,
3015 .parent = &secure_32k_fck, 2915 .parent = &secure_32k_fck,
3016 .flags = CLOCK_IN_OMAP343X | ALWAYS_ENABLED, 2916 .recalc = &followparent_recalc,
3017 .recalc = &followparent_recalc,
3018};
3019
3020static struct clk *onchip_34xx_clks[] __initdata = {
3021 &omap_32k_fck,
3022 &virt_12m_ck,
3023 &virt_13m_ck,
3024 &virt_16_8m_ck,
3025 &virt_19_2m_ck,
3026 &virt_26m_ck,
3027 &virt_38_4m_ck,
3028 &osc_sys_ck,
3029 &sys_ck,
3030 &sys_altclk,
3031 &mcbsp_clks,
3032 &sys_clkout1,
3033 &dpll1_ck,
3034 &dpll1_x2_ck,
3035 &dpll1_x2m2_ck,
3036 &dpll2_ck,
3037 &dpll2_m2_ck,
3038 &dpll3_ck,
3039 &core_ck,
3040 &dpll3_x2_ck,
3041 &dpll3_m2_ck,
3042 &dpll3_m2x2_ck,
3043 &dpll3_m3_ck,
3044 &dpll3_m3x2_ck,
3045 &emu_core_alwon_ck,
3046 &dpll4_ck,
3047 &dpll4_x2_ck,
3048 &omap_96m_alwon_fck,
3049 &omap_96m_fck,
3050 &cm_96m_fck,
3051 &virt_omap_54m_fck,
3052 &omap_54m_fck,
3053 &omap_48m_fck,
3054 &omap_12m_fck,
3055 &dpll4_m2_ck,
3056 &dpll4_m2x2_ck,
3057 &dpll4_m3_ck,
3058 &dpll4_m3x2_ck,
3059 &dpll4_m4_ck,
3060 &dpll4_m4x2_ck,
3061 &dpll4_m5_ck,
3062 &dpll4_m5x2_ck,
3063 &dpll4_m6_ck,
3064 &dpll4_m6x2_ck,
3065 &emu_per_alwon_ck,
3066 &dpll5_ck,
3067 &dpll5_m2_ck,
3068 &omap_120m_fck,
3069 &clkout2_src_ck,
3070 &sys_clkout2,
3071 &corex2_fck,
3072 &dpll1_fck,
3073 &mpu_ck,
3074 &arm_fck,
3075 &emu_mpu_alwon_ck,
3076 &dpll2_fck,
3077 &iva2_ck,
3078 &l3_ick,
3079 &l4_ick,
3080 &rm_ick,
3081 &gfx_l3_ck,
3082 &gfx_l3_fck,
3083 &gfx_l3_ick,
3084 &gfx_cg1_ck,
3085 &gfx_cg2_ck,
3086 &sgx_fck,
3087 &sgx_ick,
3088 &d2d_26m_fck,
3089 &gpt10_fck,
3090 &gpt11_fck,
3091 &cpefuse_fck,
3092 &ts_fck,
3093 &usbtll_fck,
3094 &core_96m_fck,
3095 &mmchs3_fck,
3096 &mmchs2_fck,
3097 &mspro_fck,
3098 &mmchs1_fck,
3099 &i2c3_fck,
3100 &i2c2_fck,
3101 &i2c1_fck,
3102 &mcbsp5_fck,
3103 &mcbsp1_fck,
3104 &core_48m_fck,
3105 &mcspi4_fck,
3106 &mcspi3_fck,
3107 &mcspi2_fck,
3108 &mcspi1_fck,
3109 &uart2_fck,
3110 &uart1_fck,
3111 &fshostusb_fck,
3112 &core_12m_fck,
3113 &hdq_fck,
3114 &ssi_ssr_fck,
3115 &ssi_sst_fck,
3116 &core_l3_ick,
3117 &hsotgusb_ick,
3118 &sdrc_ick,
3119 &gpmc_fck,
3120 &security_l3_ick,
3121 &pka_ick,
3122 &core_l4_ick,
3123 &usbtll_ick,
3124 &mmchs3_ick,
3125 &icr_ick,
3126 &aes2_ick,
3127 &sha12_ick,
3128 &des2_ick,
3129 &mmchs2_ick,
3130 &mmchs1_ick,
3131 &mspro_ick,
3132 &hdq_ick,
3133 &mcspi4_ick,
3134 &mcspi3_ick,
3135 &mcspi2_ick,
3136 &mcspi1_ick,
3137 &i2c3_ick,
3138 &i2c2_ick,
3139 &i2c1_ick,
3140 &uart2_ick,
3141 &uart1_ick,
3142 &gpt11_ick,
3143 &gpt10_ick,
3144 &mcbsp5_ick,
3145 &mcbsp1_ick,
3146 &fac_ick,
3147 &mailboxes_ick,
3148 &omapctrl_ick,
3149 &ssi_l4_ick,
3150 &ssi_ick,
3151 &usb_l4_ick,
3152 &security_l4_ick2,
3153 &aes1_ick,
3154 &rng_ick,
3155 &sha11_ick,
3156 &des1_ick,
3157 &dss1_alwon_fck,
3158 &dss_tv_fck,
3159 &dss_96m_fck,
3160 &dss2_alwon_fck,
3161 &dss_ick,
3162 &cam_mclk,
3163 &cam_ick,
3164 &usbhost_120m_fck,
3165 &usbhost_48m_fck,
3166 &usbhost_ick,
3167 &usbhost_sar_fck,
3168 &usim_fck,
3169 &gpt1_fck,
3170 &wkup_32k_fck,
3171 &gpio1_dbck,
3172 &wdt2_fck,
3173 &wkup_l4_ick,
3174 &usim_ick,
3175 &wdt2_ick,
3176 &wdt1_ick,
3177 &gpio1_ick,
3178 &omap_32ksync_ick,
3179 &gpt12_ick,
3180 &gpt1_ick,
3181 &per_96m_fck,
3182 &per_48m_fck,
3183 &uart3_fck,
3184 &gpt2_fck,
3185 &gpt3_fck,
3186 &gpt4_fck,
3187 &gpt5_fck,
3188 &gpt6_fck,
3189 &gpt7_fck,
3190 &gpt8_fck,
3191 &gpt9_fck,
3192 &per_32k_alwon_fck,
3193 &gpio6_dbck,
3194 &gpio5_dbck,
3195 &gpio4_dbck,
3196 &gpio3_dbck,
3197 &gpio2_dbck,
3198 &wdt3_fck,
3199 &per_l4_ick,
3200 &gpio6_ick,
3201 &gpio5_ick,
3202 &gpio4_ick,
3203 &gpio3_ick,
3204 &gpio2_ick,
3205 &wdt3_ick,
3206 &uart3_ick,
3207 &gpt9_ick,
3208 &gpt8_ick,
3209 &gpt7_ick,
3210 &gpt6_ick,
3211 &gpt5_ick,
3212 &gpt4_ick,
3213 &gpt3_ick,
3214 &gpt2_ick,
3215 &mcbsp2_ick,
3216 &mcbsp3_ick,
3217 &mcbsp4_ick,
3218 &mcbsp2_fck,
3219 &mcbsp3_fck,
3220 &mcbsp4_fck,
3221 &emu_src_ck,
3222 &pclk_fck,
3223 &pclkx2_fck,
3224 &atclk_fck,
3225 &traceclk_src_fck,
3226 &traceclk_fck,
3227 &sr1_fck,
3228 &sr2_fck,
3229 &sr_l4_ick,
3230 &secure_32k_fck,
3231 &gpt12_fck,
3232 &wdt1_fck,
3233}; 2917};
3234 2918
3235#endif 2919#endif
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 4c3ce9cfd948..0e7d501865b6 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -22,6 +22,7 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/limits.h> 24#include <linux/limits.h>
25#include <linux/err.h>
25 26
26#include <linux/io.h> 27#include <linux/io.h>
27 28
@@ -71,16 +72,13 @@ static void _autodep_lookup(struct clkdm_pwrdm_autodep *autodep)
71 if (!omap_chip_is(autodep->omap_chip)) 72 if (!omap_chip_is(autodep->omap_chip))
72 return; 73 return;
73 74
74 pwrdm = pwrdm_lookup(autodep->pwrdm_name); 75 pwrdm = pwrdm_lookup(autodep->pwrdm.name);
75 if (!pwrdm) { 76 if (!pwrdm) {
76 pr_debug("clockdomain: _autodep_lookup: powerdomain %s " 77 pr_err("clockdomain: autodeps: powerdomain %s does not exist\n",
77 "does not exist\n", autodep->pwrdm_name); 78 autodep->pwrdm.name);
78 WARN_ON(1); 79 pwrdm = ERR_PTR(-ENOENT);
79 return;
80 } 80 }
81 autodep->pwrdm = pwrdm; 81 autodep->pwrdm.ptr = pwrdm;
82
83 return;
84} 82}
85 83
86/* 84/*
@@ -95,16 +93,19 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm)
95{ 93{
96 struct clkdm_pwrdm_autodep *autodep; 94 struct clkdm_pwrdm_autodep *autodep;
97 95
98 for (autodep = autodeps; autodep->pwrdm_name; autodep++) { 96 for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) {
99 if (!autodep->pwrdm) 97 if (IS_ERR(autodep->pwrdm.ptr))
98 continue;
99
100 if (!omap_chip_is(autodep->omap_chip))
100 continue; 101 continue;
101 102
102 pr_debug("clockdomain: adding %s sleepdep/wkdep for " 103 pr_debug("clockdomain: adding %s sleepdep/wkdep for "
103 "pwrdm %s\n", autodep->pwrdm_name, 104 "pwrdm %s\n", autodep->pwrdm.ptr->name,
104 clkdm->pwrdm->name); 105 clkdm->pwrdm.ptr->name);
105 106
106 pwrdm_add_sleepdep(clkdm->pwrdm, autodep->pwrdm); 107 pwrdm_add_sleepdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr);
107 pwrdm_add_wkdep(clkdm->pwrdm, autodep->pwrdm); 108 pwrdm_add_wkdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr);
108 } 109 }
109} 110}
110 111
@@ -120,16 +121,19 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
120{ 121{
121 struct clkdm_pwrdm_autodep *autodep; 122 struct clkdm_pwrdm_autodep *autodep;
122 123
123 for (autodep = autodeps; autodep->pwrdm_name; autodep++) { 124 for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) {
124 if (!autodep->pwrdm) 125 if (IS_ERR(autodep->pwrdm.ptr))
126 continue;
127
128 if (!omap_chip_is(autodep->omap_chip))
125 continue; 129 continue;
126 130
127 pr_debug("clockdomain: removing %s sleepdep/wkdep for " 131 pr_debug("clockdomain: removing %s sleepdep/wkdep for "
128 "pwrdm %s\n", autodep->pwrdm_name, 132 "pwrdm %s\n", autodep->pwrdm.ptr->name,
129 clkdm->pwrdm->name); 133 clkdm->pwrdm.ptr->name);
130 134
131 pwrdm_del_sleepdep(clkdm->pwrdm, autodep->pwrdm); 135 pwrdm_del_sleepdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr);
132 pwrdm_del_wkdep(clkdm->pwrdm, autodep->pwrdm); 136 pwrdm_del_wkdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr);
133 } 137 }
134} 138}
135 139
@@ -179,7 +183,7 @@ void clkdm_init(struct clockdomain **clkdms,
179 183
180 autodeps = init_autodeps; 184 autodeps = init_autodeps;
181 if (autodeps) 185 if (autodeps)
182 for (autodep = autodeps; autodep->pwrdm_name; autodep++) 186 for (autodep = autodeps; autodep->pwrdm.ptr; autodep++)
183 _autodep_lookup(autodep); 187 _autodep_lookup(autodep);
184} 188}
185 189
@@ -202,20 +206,20 @@ int clkdm_register(struct clockdomain *clkdm)
202 if (!omap_chip_is(clkdm->omap_chip)) 206 if (!omap_chip_is(clkdm->omap_chip))
203 return -EINVAL; 207 return -EINVAL;
204 208
205 pwrdm = pwrdm_lookup(clkdm->pwrdm_name); 209 pwrdm = pwrdm_lookup(clkdm->pwrdm.name);
206 if (!pwrdm) { 210 if (!pwrdm) {
207 pr_debug("clockdomain: clkdm_register %s: powerdomain %s " 211 pr_err("clockdomain: %s: powerdomain %s does not exist\n",
208 "does not exist\n", clkdm->name, clkdm->pwrdm_name); 212 clkdm->name, clkdm->pwrdm.name);
209 return -EINVAL; 213 return -EINVAL;
210 } 214 }
211 clkdm->pwrdm = pwrdm; 215 clkdm->pwrdm.ptr = pwrdm;
212 216
213 mutex_lock(&clkdm_mutex); 217 mutex_lock(&clkdm_mutex);
214 /* Verify that the clockdomain is not already registered */ 218 /* Verify that the clockdomain is not already registered */
215 if (_clkdm_lookup(clkdm->name)) { 219 if (_clkdm_lookup(clkdm->name)) {
216 ret = -EEXIST; 220 ret = -EEXIST;
217 goto cr_unlock; 221 goto cr_unlock;
218 }; 222 }
219 223
220 list_add(&clkdm->node, &clkdm_list); 224 list_add(&clkdm->node, &clkdm_list);
221 225
@@ -242,7 +246,7 @@ int clkdm_unregister(struct clockdomain *clkdm)
242 if (!clkdm) 246 if (!clkdm)
243 return -EINVAL; 247 return -EINVAL;
244 248
245 pwrdm_del_clkdm(clkdm->pwrdm, clkdm); 249 pwrdm_del_clkdm(clkdm->pwrdm.ptr, clkdm);
246 250
247 mutex_lock(&clkdm_mutex); 251 mutex_lock(&clkdm_mutex);
248 list_del(&clkdm->node); 252 list_del(&clkdm->node);
@@ -327,7 +331,7 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm)
327 if (!clkdm) 331 if (!clkdm)
328 return NULL; 332 return NULL;
329 333
330 return clkdm->pwrdm; 334 return clkdm->pwrdm.ptr;
331} 335}
332 336
333 337
@@ -348,7 +352,7 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm)
348 if (!clkdm) 352 if (!clkdm)
349 return -EINVAL; 353 return -EINVAL;
350 354
351 v = cm_read_mod_reg(clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); 355 v = cm_read_mod_reg(clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL);
352 v &= clkdm->clktrctrl_mask; 356 v &= clkdm->clktrctrl_mask;
353 v >>= __ffs(clkdm->clktrctrl_mask); 357 v >>= __ffs(clkdm->clktrctrl_mask);
354 358
@@ -380,7 +384,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
380 if (cpu_is_omap24xx()) { 384 if (cpu_is_omap24xx()) {
381 385
382 cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, 386 cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,
383 clkdm->pwrdm->prcm_offs, PM_PWSTCTRL); 387 clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL);
384 388
385 } else if (cpu_is_omap34xx()) { 389 } else if (cpu_is_omap34xx()) {
386 390
@@ -388,7 +392,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
388 __ffs(clkdm->clktrctrl_mask)); 392 __ffs(clkdm->clktrctrl_mask));
389 393
390 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, 394 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
391 clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); 395 clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL);
392 396
393 } else { 397 } else {
394 BUG(); 398 BUG();
@@ -422,7 +426,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
422 if (cpu_is_omap24xx()) { 426 if (cpu_is_omap24xx()) {
423 427
424 cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, 428 cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,
425 clkdm->pwrdm->prcm_offs, PM_PWSTCTRL); 429 clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL);
426 430
427 } else if (cpu_is_omap34xx()) { 431 } else if (cpu_is_omap34xx()) {
428 432
@@ -430,7 +434,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
430 __ffs(clkdm->clktrctrl_mask)); 434 __ffs(clkdm->clktrctrl_mask));
431 435
432 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, 436 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
433 clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); 437 clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL);
434 438
435 } else { 439 } else {
436 BUG(); 440 BUG();
@@ -478,7 +482,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
478 482
479 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, 483 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask,
480 v << __ffs(clkdm->clktrctrl_mask), 484 v << __ffs(clkdm->clktrctrl_mask),
481 clkdm->pwrdm->prcm_offs, 485 clkdm->pwrdm.ptr->prcm_offs,
482 CM_CLKSTCTRL); 486 CM_CLKSTCTRL);
483} 487}
484 488
@@ -516,7 +520,7 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
516 520
517 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, 521 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask,
518 v << __ffs(clkdm->clktrctrl_mask), 522 v << __ffs(clkdm->clktrctrl_mask),
519 clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL); 523 clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL);
520 524
521 if (atomic_read(&clkdm->usecount) > 0) 525 if (atomic_read(&clkdm->usecount) > 0)
522 _clkdm_del_autodeps(clkdm); 526 _clkdm_del_autodeps(clkdm);
@@ -567,6 +571,8 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
567 else 571 else
568 omap2_clkdm_wakeup(clkdm); 572 omap2_clkdm_wakeup(clkdm);
569 573
574 pwrdm_wait_transition(clkdm->pwrdm.ptr);
575
570 return 0; 576 return 0;
571} 577}
572 578
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h
index cd86dcc7b424..281d5da19188 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -14,12 +14,29 @@
14 14
15/* 15/*
16 * OMAP2/3-common clockdomains 16 * OMAP2/3-common clockdomains
17 *
18 * Even though the 2420 has a single PRCM module from the
19 * interconnect's perspective, internally it does appear to have
20 * separate PRM and CM clockdomains. The usual test case is
21 * sys_clkout/sys_clkout2.
17 */ 22 */
18 23
19/* This is an implicit clockdomain - it is never defined as such in TRM */ 24/* This is an implicit clockdomain - it is never defined as such in TRM */
20static struct clockdomain wkup_clkdm = { 25static struct clockdomain wkup_clkdm = {
21 .name = "wkup_clkdm", 26 .name = "wkup_clkdm",
22 .pwrdm_name = "wkup_pwrdm", 27 .pwrdm = { .name = "wkup_pwrdm" },
28 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
29};
30
31static struct clockdomain prm_clkdm = {
32 .name = "prm_clkdm",
33 .pwrdm = { .name = "wkup_pwrdm" },
34 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
35};
36
37static struct clockdomain cm_clkdm = {
38 .name = "cm_clkdm",
39 .pwrdm = { .name = "core_pwrdm" },
23 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 40 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
24}; 41};
25 42
@@ -31,7 +48,7 @@ static struct clockdomain wkup_clkdm = {
31 48
32static struct clockdomain mpu_2420_clkdm = { 49static struct clockdomain mpu_2420_clkdm = {
33 .name = "mpu_clkdm", 50 .name = "mpu_clkdm",
34 .pwrdm_name = "mpu_pwrdm", 51 .pwrdm = { .name = "mpu_pwrdm" },
35 .flags = CLKDM_CAN_HWSUP, 52 .flags = CLKDM_CAN_HWSUP,
36 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 53 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
37 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 54 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -39,7 +56,7 @@ static struct clockdomain mpu_2420_clkdm = {
39 56
40static struct clockdomain iva1_2420_clkdm = { 57static struct clockdomain iva1_2420_clkdm = {
41 .name = "iva1_clkdm", 58 .name = "iva1_clkdm",
42 .pwrdm_name = "dsp_pwrdm", 59 .pwrdm = { .name = "dsp_pwrdm" },
43 .flags = CLKDM_CAN_HWSUP_SWSUP, 60 .flags = CLKDM_CAN_HWSUP_SWSUP,
44 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, 61 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
45 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -56,7 +73,7 @@ static struct clockdomain iva1_2420_clkdm = {
56 73
57static struct clockdomain mpu_2430_clkdm = { 74static struct clockdomain mpu_2430_clkdm = {
58 .name = "mpu_clkdm", 75 .name = "mpu_clkdm",
59 .pwrdm_name = "mpu_pwrdm", 76 .pwrdm = { .name = "mpu_pwrdm" },
60 .flags = CLKDM_CAN_HWSUP_SWSUP, 77 .flags = CLKDM_CAN_HWSUP_SWSUP,
61 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 78 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 79 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
@@ -64,7 +81,7 @@ static struct clockdomain mpu_2430_clkdm = {
64 81
65static struct clockdomain mdm_clkdm = { 82static struct clockdomain mdm_clkdm = {
66 .name = "mdm_clkdm", 83 .name = "mdm_clkdm",
67 .pwrdm_name = "mdm_pwrdm", 84 .pwrdm = { .name = "mdm_pwrdm" },
68 .flags = CLKDM_CAN_HWSUP_SWSUP, 85 .flags = CLKDM_CAN_HWSUP_SWSUP,
69 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, 86 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
70 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 87 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
@@ -81,7 +98,7 @@ static struct clockdomain mdm_clkdm = {
81 98
82static struct clockdomain dsp_clkdm = { 99static struct clockdomain dsp_clkdm = {
83 .name = "dsp_clkdm", 100 .name = "dsp_clkdm",
84 .pwrdm_name = "dsp_pwrdm", 101 .pwrdm = { .name = "dsp_pwrdm" },
85 .flags = CLKDM_CAN_HWSUP_SWSUP, 102 .flags = CLKDM_CAN_HWSUP_SWSUP,
86 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, 103 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
87 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 104 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
@@ -89,7 +106,7 @@ static struct clockdomain dsp_clkdm = {
89 106
90static struct clockdomain gfx_24xx_clkdm = { 107static struct clockdomain gfx_24xx_clkdm = {
91 .name = "gfx_clkdm", 108 .name = "gfx_clkdm",
92 .pwrdm_name = "gfx_pwrdm", 109 .pwrdm = { .name = "gfx_pwrdm" },
93 .flags = CLKDM_CAN_HWSUP_SWSUP, 110 .flags = CLKDM_CAN_HWSUP_SWSUP,
94 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 111 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
95 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 112 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
@@ -97,7 +114,7 @@ static struct clockdomain gfx_24xx_clkdm = {
97 114
98static struct clockdomain core_l3_24xx_clkdm = { 115static struct clockdomain core_l3_24xx_clkdm = {
99 .name = "core_l3_clkdm", 116 .name = "core_l3_clkdm",
100 .pwrdm_name = "core_pwrdm", 117 .pwrdm = { .name = "core_pwrdm" },
101 .flags = CLKDM_CAN_HWSUP, 118 .flags = CLKDM_CAN_HWSUP,
102 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 119 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
103 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 120 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
@@ -105,7 +122,7 @@ static struct clockdomain core_l3_24xx_clkdm = {
105 122
106static struct clockdomain core_l4_24xx_clkdm = { 123static struct clockdomain core_l4_24xx_clkdm = {
107 .name = "core_l4_clkdm", 124 .name = "core_l4_clkdm",
108 .pwrdm_name = "core_pwrdm", 125 .pwrdm = { .name = "core_pwrdm" },
109 .flags = CLKDM_CAN_HWSUP, 126 .flags = CLKDM_CAN_HWSUP,
110 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 127 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
111 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
@@ -113,7 +130,7 @@ static struct clockdomain core_l4_24xx_clkdm = {
113 130
114static struct clockdomain dss_24xx_clkdm = { 131static struct clockdomain dss_24xx_clkdm = {
115 .name = "dss_clkdm", 132 .name = "dss_clkdm",
116 .pwrdm_name = "core_pwrdm", 133 .pwrdm = { .name = "core_pwrdm" },
117 .flags = CLKDM_CAN_HWSUP, 134 .flags = CLKDM_CAN_HWSUP,
118 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, 135 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
@@ -130,7 +147,7 @@ static struct clockdomain dss_24xx_clkdm = {
130 147
131static struct clockdomain mpu_34xx_clkdm = { 148static struct clockdomain mpu_34xx_clkdm = {
132 .name = "mpu_clkdm", 149 .name = "mpu_clkdm",
133 .pwrdm_name = "mpu_pwrdm", 150 .pwrdm = { .name = "mpu_pwrdm" },
134 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, 151 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
135 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, 152 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 153 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -138,7 +155,7 @@ static struct clockdomain mpu_34xx_clkdm = {
138 155
139static struct clockdomain neon_clkdm = { 156static struct clockdomain neon_clkdm = {
140 .name = "neon_clkdm", 157 .name = "neon_clkdm",
141 .pwrdm_name = "neon_pwrdm", 158 .pwrdm = { .name = "neon_pwrdm" },
142 .flags = CLKDM_CAN_HWSUP_SWSUP, 159 .flags = CLKDM_CAN_HWSUP_SWSUP,
143 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, 160 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
144 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 161 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -146,7 +163,7 @@ static struct clockdomain neon_clkdm = {
146 163
147static struct clockdomain iva2_clkdm = { 164static struct clockdomain iva2_clkdm = {
148 .name = "iva2_clkdm", 165 .name = "iva2_clkdm",
149 .pwrdm_name = "iva2_pwrdm", 166 .pwrdm = { .name = "iva2_pwrdm" },
150 .flags = CLKDM_CAN_HWSUP_SWSUP, 167 .flags = CLKDM_CAN_HWSUP_SWSUP,
151 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, 168 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
152 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 169 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -154,7 +171,7 @@ static struct clockdomain iva2_clkdm = {
154 171
155static struct clockdomain gfx_3430es1_clkdm = { 172static struct clockdomain gfx_3430es1_clkdm = {
156 .name = "gfx_clkdm", 173 .name = "gfx_clkdm",
157 .pwrdm_name = "gfx_pwrdm", 174 .pwrdm = { .name = "gfx_pwrdm" },
158 .flags = CLKDM_CAN_HWSUP_SWSUP, 175 .flags = CLKDM_CAN_HWSUP_SWSUP,
159 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, 176 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
160 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), 177 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
@@ -162,10 +179,10 @@ static struct clockdomain gfx_3430es1_clkdm = {
162 179
163static struct clockdomain sgx_clkdm = { 180static struct clockdomain sgx_clkdm = {
164 .name = "sgx_clkdm", 181 .name = "sgx_clkdm",
165 .pwrdm_name = "sgx_pwrdm", 182 .pwrdm = { .name = "sgx_pwrdm" },
166 .flags = CLKDM_CAN_HWSUP_SWSUP, 183 .flags = CLKDM_CAN_HWSUP_SWSUP,
167 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, 184 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
168 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), 185 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
169}; 186};
170 187
171/* 188/*
@@ -177,7 +194,7 @@ static struct clockdomain sgx_clkdm = {
177 */ 194 */
178static struct clockdomain d2d_clkdm = { 195static struct clockdomain d2d_clkdm = {
179 .name = "d2d_clkdm", 196 .name = "d2d_clkdm",
180 .pwrdm_name = "core_pwrdm", 197 .pwrdm = { .name = "core_pwrdm" },
181 .flags = CLKDM_CAN_HWSUP, 198 .flags = CLKDM_CAN_HWSUP,
182 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, 199 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
183 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -185,7 +202,7 @@ static struct clockdomain d2d_clkdm = {
185 202
186static struct clockdomain core_l3_34xx_clkdm = { 203static struct clockdomain core_l3_34xx_clkdm = {
187 .name = "core_l3_clkdm", 204 .name = "core_l3_clkdm",
188 .pwrdm_name = "core_pwrdm", 205 .pwrdm = { .name = "core_pwrdm" },
189 .flags = CLKDM_CAN_HWSUP, 206 .flags = CLKDM_CAN_HWSUP,
190 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, 207 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 208 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -193,7 +210,7 @@ static struct clockdomain core_l3_34xx_clkdm = {
193 210
194static struct clockdomain core_l4_34xx_clkdm = { 211static struct clockdomain core_l4_34xx_clkdm = {
195 .name = "core_l4_clkdm", 212 .name = "core_l4_clkdm",
196 .pwrdm_name = "core_pwrdm", 213 .pwrdm = { .name = "core_pwrdm" },
197 .flags = CLKDM_CAN_HWSUP, 214 .flags = CLKDM_CAN_HWSUP,
198 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, 215 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
199 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 216 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -201,7 +218,7 @@ static struct clockdomain core_l4_34xx_clkdm = {
201 218
202static struct clockdomain dss_34xx_clkdm = { 219static struct clockdomain dss_34xx_clkdm = {
203 .name = "dss_clkdm", 220 .name = "dss_clkdm",
204 .pwrdm_name = "dss_pwrdm", 221 .pwrdm = { .name = "dss_pwrdm" },
205 .flags = CLKDM_CAN_HWSUP_SWSUP, 222 .flags = CLKDM_CAN_HWSUP_SWSUP,
206 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, 223 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 224 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -209,7 +226,7 @@ static struct clockdomain dss_34xx_clkdm = {
209 226
210static struct clockdomain cam_clkdm = { 227static struct clockdomain cam_clkdm = {
211 .name = "cam_clkdm", 228 .name = "cam_clkdm",
212 .pwrdm_name = "cam_pwrdm", 229 .pwrdm = { .name = "cam_pwrdm" },
213 .flags = CLKDM_CAN_HWSUP_SWSUP, 230 .flags = CLKDM_CAN_HWSUP_SWSUP,
214 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, 231 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
215 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 232 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -217,28 +234,62 @@ static struct clockdomain cam_clkdm = {
217 234
218static struct clockdomain usbhost_clkdm = { 235static struct clockdomain usbhost_clkdm = {
219 .name = "usbhost_clkdm", 236 .name = "usbhost_clkdm",
220 .pwrdm_name = "usbhost_pwrdm", 237 .pwrdm = { .name = "usbhost_pwrdm" },
221 .flags = CLKDM_CAN_HWSUP_SWSUP, 238 .flags = CLKDM_CAN_HWSUP_SWSUP,
222 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, 239 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
223 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), 240 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
224}; 241};
225 242
226static struct clockdomain per_clkdm = { 243static struct clockdomain per_clkdm = {
227 .name = "per_clkdm", 244 .name = "per_clkdm",
228 .pwrdm_name = "per_pwrdm", 245 .pwrdm = { .name = "per_pwrdm" },
229 .flags = CLKDM_CAN_HWSUP_SWSUP, 246 .flags = CLKDM_CAN_HWSUP_SWSUP,
230 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, 247 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
231 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 248 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
232}; 249};
233 250
251/*
252 * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
253 * switched of even if sdti is in use
254 */
234static struct clockdomain emu_clkdm = { 255static struct clockdomain emu_clkdm = {
235 .name = "emu_clkdm", 256 .name = "emu_clkdm",
236 .pwrdm_name = "emu_pwrdm", 257 .pwrdm = { .name = "emu_pwrdm" },
237 .flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_SWSUP, 258 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP,
238 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, 259 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
239 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 260 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
240}; 261};
241 262
263static struct clockdomain dpll1_clkdm = {
264 .name = "dpll1_clkdm",
265 .pwrdm = { .name = "dpll1_pwrdm" },
266 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
267};
268
269static struct clockdomain dpll2_clkdm = {
270 .name = "dpll2_clkdm",
271 .pwrdm = { .name = "dpll2_pwrdm" },
272 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
273};
274
275static struct clockdomain dpll3_clkdm = {
276 .name = "dpll3_clkdm",
277 .pwrdm = { .name = "dpll3_pwrdm" },
278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
279};
280
281static struct clockdomain dpll4_clkdm = {
282 .name = "dpll4_clkdm",
283 .pwrdm = { .name = "dpll4_pwrdm" },
284 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
285};
286
287static struct clockdomain dpll5_clkdm = {
288 .name = "dpll5_clkdm",
289 .pwrdm = { .name = "dpll5_pwrdm" },
290 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
291};
292
242#endif /* CONFIG_ARCH_OMAP34XX */ 293#endif /* CONFIG_ARCH_OMAP34XX */
243 294
244/* 295/*
@@ -247,14 +298,16 @@ static struct clockdomain emu_clkdm = {
247 298
248static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = { 299static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = {
249 { 300 {
250 .pwrdm_name = "mpu_pwrdm", 301 .pwrdm = { .name = "mpu_pwrdm" },
251 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) 302 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
252 }, 303 },
253 { 304 {
254 .pwrdm_name = "iva2_pwrdm", 305 .pwrdm = { .name = "iva2_pwrdm" },
255 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) 306 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
256 }, 307 },
257 { NULL } 308 {
309 .pwrdm = { .name = NULL },
310 }
258}; 311};
259 312
260/* 313/*
@@ -264,6 +317,8 @@ static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = {
264static struct clockdomain *clockdomains_omap[] = { 317static struct clockdomain *clockdomains_omap[] = {
265 318
266 &wkup_clkdm, 319 &wkup_clkdm,
320 &cm_clkdm,
321 &prm_clkdm,
267 322
268#ifdef CONFIG_ARCH_OMAP2420 323#ifdef CONFIG_ARCH_OMAP2420
269 &mpu_2420_clkdm, 324 &mpu_2420_clkdm,
@@ -297,6 +352,11 @@ static struct clockdomain *clockdomains_omap[] = {
297 &usbhost_clkdm, 352 &usbhost_clkdm,
298 &per_clkdm, 353 &per_clkdm,
299 &emu_clkdm, 354 &emu_clkdm,
355 &dpll1_clkdm,
356 &dpll2_clkdm,
357 &dpll3_clkdm,
358 &dpll4_clkdm,
359 &dpll5_clkdm,
300#endif 360#endif
301 361
302 NULL, 362 NULL,
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h
index 1098ecfab861..297a2fe634ea 100644
--- a/arch/arm/mach-omap2/cm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-24xx.h
@@ -110,35 +110,56 @@
110#define OMAP24XX_EN_DES (1 << 0) 110#define OMAP24XX_EN_DES (1 << 0)
111 111
112/* CM_IDLEST1_CORE specific bits */ 112/* CM_IDLEST1_CORE specific bits */
113#define OMAP24XX_ST_MAILBOXES (1 << 30) 113#define OMAP24XX_ST_MAILBOXES_SHIFT 30
114#define OMAP24XX_ST_WDT4 (1 << 29) 114#define OMAP24XX_ST_MAILBOXES_MASK (1 << 30)
115#define OMAP2420_ST_WDT3 (1 << 28) 115#define OMAP24XX_ST_WDT4_SHIFT 29
116#define OMAP24XX_ST_MSPRO (1 << 27) 116#define OMAP24XX_ST_WDT4_MASK (1 << 29)
117#define OMAP24XX_ST_FAC (1 << 25) 117#define OMAP2420_ST_WDT3_SHIFT 28
118#define OMAP2420_ST_EAC (1 << 24) 118#define OMAP2420_ST_WDT3_MASK (1 << 28)
119#define OMAP24XX_ST_HDQ (1 << 23) 119#define OMAP24XX_ST_MSPRO_SHIFT 27
120#define OMAP24XX_ST_I2C2 (1 << 20) 120#define OMAP24XX_ST_MSPRO_MASK (1 << 27)
121#define OMAP24XX_ST_I2C1 (1 << 19) 121#define OMAP24XX_ST_FAC_SHIFT 25
122#define OMAP24XX_ST_MCBSP2 (1 << 16) 122#define OMAP24XX_ST_FAC_MASK (1 << 25)
123#define OMAP24XX_ST_MCBSP1 (1 << 15) 123#define OMAP2420_ST_EAC_SHIFT 24
124#define OMAP24XX_ST_DSS (1 << 0) 124#define OMAP2420_ST_EAC_MASK (1 << 24)
125#define OMAP24XX_ST_HDQ_SHIFT 23
126#define OMAP24XX_ST_HDQ_MASK (1 << 23)
127#define OMAP2420_ST_I2C2_SHIFT 20
128#define OMAP2420_ST_I2C2_MASK (1 << 20)
129#define OMAP2420_ST_I2C1_SHIFT 19
130#define OMAP2420_ST_I2C1_MASK (1 << 19)
131#define OMAP24XX_ST_MCBSP2_SHIFT 16
132#define OMAP24XX_ST_MCBSP2_MASK (1 << 16)
133#define OMAP24XX_ST_MCBSP1_SHIFT 15
134#define OMAP24XX_ST_MCBSP1_MASK (1 << 15)
135#define OMAP24XX_ST_DSS_SHIFT 0
136#define OMAP24XX_ST_DSS_MASK (1 << 0)
125 137
126/* CM_IDLEST2_CORE */ 138/* CM_IDLEST2_CORE */
127#define OMAP2430_ST_MCBSP5 (1 << 5) 139#define OMAP2430_ST_MCBSP5_SHIFT 5
128#define OMAP2430_ST_MCBSP4 (1 << 4) 140#define OMAP2430_ST_MCBSP5_MASK (1 << 5)
129#define OMAP2430_ST_MCBSP3 (1 << 3) 141#define OMAP2430_ST_MCBSP4_SHIFT 4
130#define OMAP24XX_ST_SSI (1 << 1) 142#define OMAP2430_ST_MCBSP4_MASK (1 << 4)
143#define OMAP2430_ST_MCBSP3_SHIFT 3
144#define OMAP2430_ST_MCBSP3_MASK (1 << 3)
145#define OMAP24XX_ST_SSI_SHIFT 1
146#define OMAP24XX_ST_SSI_MASK (1 << 1)
131 147
132/* CM_IDLEST3_CORE */ 148/* CM_IDLEST3_CORE */
133/* 2430 only */ 149/* 2430 only */
134#define OMAP2430_ST_SDRC (1 << 2) 150#define OMAP2430_ST_SDRC_MASK (1 << 2)
135 151
136/* CM_IDLEST4_CORE */ 152/* CM_IDLEST4_CORE */
137#define OMAP24XX_ST_PKA (1 << 4) 153#define OMAP24XX_ST_PKA_SHIFT 4
138#define OMAP24XX_ST_AES (1 << 3) 154#define OMAP24XX_ST_PKA_MASK (1 << 4)
139#define OMAP24XX_ST_RNG (1 << 2) 155#define OMAP24XX_ST_AES_SHIFT 3
140#define OMAP24XX_ST_SHA (1 << 1) 156#define OMAP24XX_ST_AES_MASK (1 << 3)
141#define OMAP24XX_ST_DES (1 << 0) 157#define OMAP24XX_ST_RNG_SHIFT 2
158#define OMAP24XX_ST_RNG_MASK (1 << 2)
159#define OMAP24XX_ST_SHA_SHIFT 1
160#define OMAP24XX_ST_SHA_MASK (1 << 1)
161#define OMAP24XX_ST_DES_SHIFT 0
162#define OMAP24XX_ST_DES_MASK (1 << 0)
142 163
143/* CM_AUTOIDLE1_CORE */ 164/* CM_AUTOIDLE1_CORE */
144#define OMAP24XX_AUTO_CAM (1 << 31) 165#define OMAP24XX_AUTO_CAM (1 << 31)
@@ -275,11 +296,16 @@
275#define OMAP24XX_EN_32KSYNC (1 << 1) 296#define OMAP24XX_EN_32KSYNC (1 << 1)
276 297
277/* CM_IDLEST_WKUP specific bits */ 298/* CM_IDLEST_WKUP specific bits */
278#define OMAP2430_ST_ICR (1 << 6) 299#define OMAP2430_ST_ICR_SHIFT 6
279#define OMAP24XX_ST_OMAPCTRL (1 << 5) 300#define OMAP2430_ST_ICR_MASK (1 << 6)
280#define OMAP24XX_ST_WDT1 (1 << 4) 301#define OMAP24XX_ST_OMAPCTRL_SHIFT 5
281#define OMAP24XX_ST_MPU_WDT (1 << 3) 302#define OMAP24XX_ST_OMAPCTRL_MASK (1 << 5)
282#define OMAP24XX_ST_32KSYNC (1 << 1) 303#define OMAP24XX_ST_WDT1_SHIFT 4
304#define OMAP24XX_ST_WDT1_MASK (1 << 4)
305#define OMAP24XX_ST_MPU_WDT_SHIFT 3
306#define OMAP24XX_ST_MPU_WDT_MASK (1 << 3)
307#define OMAP24XX_ST_32KSYNC_SHIFT 1
308#define OMAP24XX_ST_32KSYNC_MASK (1 << 1)
283 309
284/* CM_AUTOIDLE_WKUP */ 310/* CM_AUTOIDLE_WKUP */
285#define OMAP24XX_AUTO_OMAPCTRL (1 << 5) 311#define OMAP24XX_AUTO_OMAPCTRL (1 << 5)
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
index 219f5c8d9659..6f3f5a36aae6 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -183,31 +183,58 @@
183#define OMAP3430ES2_EN_CPEFUSE_MASK (1 << 0) 183#define OMAP3430ES2_EN_CPEFUSE_MASK (1 << 0)
184 184
185/* CM_IDLEST1_CORE specific bits */ 185/* CM_IDLEST1_CORE specific bits */
186#define OMAP3430_ST_ICR (1 << 29) 186#define OMAP3430ES2_ST_MMC3_SHIFT 30
187#define OMAP3430_ST_AES2 (1 << 28) 187#define OMAP3430ES2_ST_MMC3_MASK (1 << 30)
188#define OMAP3430_ST_SHA12 (1 << 27) 188#define OMAP3430_ST_ICR_SHIFT 29
189#define OMAP3430_ST_DES2 (1 << 26) 189#define OMAP3430_ST_ICR_MASK (1 << 29)
190#define OMAP3430_ST_MSPRO (1 << 23) 190#define OMAP3430_ST_AES2_SHIFT 28
191#define OMAP3430_ST_HDQ (1 << 22) 191#define OMAP3430_ST_AES2_MASK (1 << 28)
192#define OMAP3430ES1_ST_FAC (1 << 8) 192#define OMAP3430_ST_SHA12_SHIFT 27
193#define OMAP3430ES1_ST_MAILBOXES (1 << 7) 193#define OMAP3430_ST_SHA12_MASK (1 << 27)
194#define OMAP3430_ST_OMAPCTRL (1 << 6) 194#define OMAP3430_ST_DES2_SHIFT 26
195#define OMAP3430_ST_SDMA (1 << 2) 195#define OMAP3430_ST_DES2_MASK (1 << 26)
196#define OMAP3430_ST_SDRC (1 << 1) 196#define OMAP3430_ST_MSPRO_SHIFT 23
197#define OMAP3430_ST_SSI (1 << 0) 197#define OMAP3430_ST_MSPRO_MASK (1 << 23)
198#define OMAP3430_ST_HDQ_SHIFT 22
199#define OMAP3430_ST_HDQ_MASK (1 << 22)
200#define OMAP3430ES1_ST_FAC_SHIFT 8
201#define OMAP3430ES1_ST_FAC_MASK (1 << 8)
202#define OMAP3430ES2_ST_SSI_IDLE_SHIFT 8
203#define OMAP3430ES2_ST_SSI_IDLE_MASK (1 << 8)
204#define OMAP3430_ST_MAILBOXES_SHIFT 7
205#define OMAP3430_ST_MAILBOXES_MASK (1 << 7)
206#define OMAP3430_ST_OMAPCTRL_SHIFT 6
207#define OMAP3430_ST_OMAPCTRL_MASK (1 << 6)
208#define OMAP3430_ST_SDMA_SHIFT 2
209#define OMAP3430_ST_SDMA_MASK (1 << 2)
210#define OMAP3430_ST_SDRC_SHIFT 1
211#define OMAP3430_ST_SDRC_MASK (1 << 1)
212#define OMAP3430_ST_SSI_STDBY_SHIFT 0
213#define OMAP3430_ST_SSI_STDBY_MASK (1 << 0)
198 214
199/* CM_IDLEST2_CORE */ 215/* CM_IDLEST2_CORE */
200#define OMAP3430_ST_PKA (1 << 4) 216#define OMAP3430_ST_PKA_SHIFT 4
201#define OMAP3430_ST_AES1 (1 << 3) 217#define OMAP3430_ST_PKA_MASK (1 << 4)
202#define OMAP3430_ST_RNG (1 << 2) 218#define OMAP3430_ST_AES1_SHIFT 3
203#define OMAP3430_ST_SHA11 (1 << 1) 219#define OMAP3430_ST_AES1_MASK (1 << 3)
204#define OMAP3430_ST_DES1 (1 << 0) 220#define OMAP3430_ST_RNG_SHIFT 2
221#define OMAP3430_ST_RNG_MASK (1 << 2)
222#define OMAP3430_ST_SHA11_SHIFT 1
223#define OMAP3430_ST_SHA11_MASK (1 << 1)
224#define OMAP3430_ST_DES1_SHIFT 0
225#define OMAP3430_ST_DES1_MASK (1 << 0)
205 226
206/* CM_IDLEST3_CORE */ 227/* CM_IDLEST3_CORE */
207#define OMAP3430ES2_ST_USBTLL_SHIFT 2 228#define OMAP3430ES2_ST_USBTLL_SHIFT 2
208#define OMAP3430ES2_ST_USBTLL_MASK (1 << 2) 229#define OMAP3430ES2_ST_USBTLL_MASK (1 << 2)
230#define OMAP3430ES2_ST_CPEFUSE_SHIFT 0
231#define OMAP3430ES2_ST_CPEFUSE_MASK (1 << 0)
209 232
210/* CM_AUTOIDLE1_CORE */ 233/* CM_AUTOIDLE1_CORE */
234#define OMAP3430ES2_AUTO_MMC3 (1 << 30)
235#define OMAP3430ES2_AUTO_MMC3_SHIFT 30
236#define OMAP3430ES2_AUTO_ICR (1 << 29)
237#define OMAP3430ES2_AUTO_ICR_SHIFT 29
211#define OMAP3430_AUTO_AES2 (1 << 28) 238#define OMAP3430_AUTO_AES2 (1 << 28)
212#define OMAP3430_AUTO_AES2_SHIFT 28 239#define OMAP3430_AUTO_AES2_SHIFT 28
213#define OMAP3430_AUTO_SHA12 (1 << 27) 240#define OMAP3430_AUTO_SHA12 (1 << 27)
@@ -276,6 +303,9 @@
276#define OMAP3430_AUTO_DES1_SHIFT 0 303#define OMAP3430_AUTO_DES1_SHIFT 0
277 304
278/* CM_AUTOIDLE3_CORE */ 305/* CM_AUTOIDLE3_CORE */
306#define OMAP3430ES2_AUTO_USBHOST (1 << 0)
307#define OMAP3430ES2_AUTO_USBHOST_SHIFT 0
308#define OMAP3430ES2_AUTO_USBTLL (1 << 2)
279#define OMAP3430ES2_AUTO_USBTLL_SHIFT 2 309#define OMAP3430ES2_AUTO_USBTLL_SHIFT 2
280#define OMAP3430ES2_AUTO_USBTLL_MASK (1 << 2) 310#define OMAP3430ES2_AUTO_USBTLL_MASK (1 << 2)
281 311
@@ -332,8 +362,12 @@
332#define OMAP3430ES1_CLKACTIVITY_GFX_MASK (1 << 0) 362#define OMAP3430ES1_CLKACTIVITY_GFX_MASK (1 << 0)
333 363
334/* CM_FCLKEN_SGX */ 364/* CM_FCLKEN_SGX */
335#define OMAP3430ES2_EN_SGX_SHIFT 1 365#define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT 1
336#define OMAP3430ES2_EN_SGX_MASK (1 << 1) 366#define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_MASK (1 << 1)
367
368/* CM_ICLKEN_SGX */
369#define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT 0
370#define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_MASK (1 << 0)
337 371
338/* CM_CLKSEL_SGX */ 372/* CM_CLKSEL_SGX */
339#define OMAP3430ES2_CLKSEL_SGX_SHIFT 0 373#define OMAP3430ES2_CLKSEL_SGX_SHIFT 0
@@ -349,6 +383,7 @@
349 383
350/* CM_FCLKEN_WKUP specific bits */ 384/* CM_FCLKEN_WKUP specific bits */
351#define OMAP3430ES2_EN_USIMOCP_SHIFT 9 385#define OMAP3430ES2_EN_USIMOCP_SHIFT 9
386#define OMAP3430ES2_EN_USIMOCP_MASK (1 << 9)
352 387
353/* CM_ICLKEN_WKUP specific bits */ 388/* CM_ICLKEN_WKUP specific bits */
354#define OMAP3430_EN_WDT1 (1 << 4) 389#define OMAP3430_EN_WDT1 (1 << 4)
@@ -357,11 +392,18 @@
357#define OMAP3430_EN_32KSYNC_SHIFT 2 392#define OMAP3430_EN_32KSYNC_SHIFT 2
358 393
359/* CM_IDLEST_WKUP specific bits */ 394/* CM_IDLEST_WKUP specific bits */
360#define OMAP3430_ST_WDT2 (1 << 5) 395#define OMAP3430ES2_ST_USIMOCP_SHIFT 9
361#define OMAP3430_ST_WDT1 (1 << 4) 396#define OMAP3430ES2_ST_USIMOCP_MASK (1 << 9)
362#define OMAP3430_ST_32KSYNC (1 << 2) 397#define OMAP3430_ST_WDT2_SHIFT 5
398#define OMAP3430_ST_WDT2_MASK (1 << 5)
399#define OMAP3430_ST_WDT1_SHIFT 4
400#define OMAP3430_ST_WDT1_MASK (1 << 4)
401#define OMAP3430_ST_32KSYNC_SHIFT 2
402#define OMAP3430_ST_32KSYNC_MASK (1 << 2)
363 403
364/* CM_AUTOIDLE_WKUP */ 404/* CM_AUTOIDLE_WKUP */
405#define OMAP3430ES2_AUTO_USIMOCP (1 << 9)
406#define OMAP3430ES2_AUTO_USIMOCP_SHIFT 9
365#define OMAP3430_AUTO_WDT2 (1 << 5) 407#define OMAP3430_AUTO_WDT2 (1 << 5)
366#define OMAP3430_AUTO_WDT2_SHIFT 5 408#define OMAP3430_AUTO_WDT2_SHIFT 5
367#define OMAP3430_AUTO_WDT1 (1 << 4) 409#define OMAP3430_AUTO_WDT1 (1 << 4)
@@ -426,6 +468,8 @@
426#define OMAP3430_ST_CORE_CLK_MASK (1 << 0) 468#define OMAP3430_ST_CORE_CLK_MASK (1 << 0)
427 469
428/* CM_IDLEST2_CKGEN */ 470/* CM_IDLEST2_CKGEN */
471#define OMAP3430ES2_ST_USIM_CLK_SHIFT 2
472#define OMAP3430ES2_ST_USIM_CLK_MASK (1 << 2)
429#define OMAP3430ES2_ST_120M_CLK_SHIFT 1 473#define OMAP3430ES2_ST_120M_CLK_SHIFT 1
430#define OMAP3430ES2_ST_120M_CLK_MASK (1 << 1) 474#define OMAP3430ES2_ST_120M_CLK_MASK (1 << 1)
431#define OMAP3430ES2_ST_PERIPH2_CLK_SHIFT 0 475#define OMAP3430ES2_ST_PERIPH2_CLK_SHIFT 0
@@ -449,8 +493,12 @@
449#define OMAP3430_CORE_DPLL_MULT_MASK (0x7ff << 16) 493#define OMAP3430_CORE_DPLL_MULT_MASK (0x7ff << 16)
450#define OMAP3430_CORE_DPLL_DIV_SHIFT 8 494#define OMAP3430_CORE_DPLL_DIV_SHIFT 8
451#define OMAP3430_CORE_DPLL_DIV_MASK (0x7f << 8) 495#define OMAP3430_CORE_DPLL_DIV_MASK (0x7f << 8)
452#define OMAP3430_SOURCE_54M (1 << 5) 496#define OMAP3430_SOURCE_96M_SHIFT 6
453#define OMAP3430_SOURCE_48M (1 << 3) 497#define OMAP3430_SOURCE_96M_MASK (1 << 6)
498#define OMAP3430_SOURCE_54M_SHIFT 5
499#define OMAP3430_SOURCE_54M_MASK (1 << 5)
500#define OMAP3430_SOURCE_48M_SHIFT 3
501#define OMAP3430_SOURCE_48M_MASK (1 << 3)
454 502
455/* CM_CLKSEL2_PLL */ 503/* CM_CLKSEL2_PLL */
456#define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8 504#define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8
@@ -493,7 +541,12 @@
493#define OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT 0 541#define OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT 0
494 542
495/* CM_IDLEST_DSS */ 543/* CM_IDLEST_DSS */
496#define OMAP3430_ST_DSS (1 << 0) 544#define OMAP3430ES2_ST_DSS_IDLE_SHIFT 1
545#define OMAP3430ES2_ST_DSS_IDLE_MASK (1 << 1)
546#define OMAP3430ES2_ST_DSS_STDBY_SHIFT 0
547#define OMAP3430ES2_ST_DSS_STDBY_MASK (1 << 0)
548#define OMAP3430ES1_ST_DSS_SHIFT 0
549#define OMAP3430ES1_ST_DSS_MASK (1 << 0)
497 550
498/* CM_AUTOIDLE_DSS */ 551/* CM_AUTOIDLE_DSS */
499#define OMAP3430_AUTO_DSS (1 << 0) 552#define OMAP3430_AUTO_DSS (1 << 0)
@@ -516,6 +569,8 @@
516#define OMAP3430_CLKACTIVITY_DSS_MASK (1 << 0) 569#define OMAP3430_CLKACTIVITY_DSS_MASK (1 << 0)
517 570
518/* CM_FCLKEN_CAM specific bits */ 571/* CM_FCLKEN_CAM specific bits */
572#define OMAP3430_EN_CSI2 (1 << 1)
573#define OMAP3430_EN_CSI2_SHIFT 1
519 574
520/* CM_ICLKEN_CAM specific bits */ 575/* CM_ICLKEN_CAM specific bits */
521 576
@@ -545,10 +600,14 @@
545/* CM_ICLKEN_PER specific bits */ 600/* CM_ICLKEN_PER specific bits */
546 601
547/* CM_IDLEST_PER */ 602/* CM_IDLEST_PER */
548#define OMAP3430_ST_WDT3 (1 << 12) 603#define OMAP3430_ST_WDT3_SHIFT 12
549#define OMAP3430_ST_MCBSP4 (1 << 2) 604#define OMAP3430_ST_WDT3_MASK (1 << 12)
550#define OMAP3430_ST_MCBSP3 (1 << 1) 605#define OMAP3430_ST_MCBSP4_SHIFT 2
551#define OMAP3430_ST_MCBSP2 (1 << 0) 606#define OMAP3430_ST_MCBSP4_MASK (1 << 2)
607#define OMAP3430_ST_MCBSP3_SHIFT 1
608#define OMAP3430_ST_MCBSP3_MASK (1 << 1)
609#define OMAP3430_ST_MCBSP2_SHIFT 0
610#define OMAP3430_ST_MCBSP2_MASK (1 << 0)
552 611
553/* CM_AUTOIDLE_PER */ 612/* CM_AUTOIDLE_PER */
554#define OMAP3430_AUTO_GPIO6 (1 << 17) 613#define OMAP3430_AUTO_GPIO6 (1 << 17)
@@ -676,6 +735,10 @@
676#define OMAP3430ES2_EN_USBHOST_MASK (1 << 0) 735#define OMAP3430ES2_EN_USBHOST_MASK (1 << 0)
677 736
678/* CM_IDLEST_USBHOST */ 737/* CM_IDLEST_USBHOST */
738#define OMAP3430ES2_ST_USBHOST_IDLE_SHIFT 1
739#define OMAP3430ES2_ST_USBHOST_IDLE_MASK (1 << 1)
740#define OMAP3430ES2_ST_USBHOST_STDBY_SHIFT 0
741#define OMAP3430ES2_ST_USBHOST_STDBY_MASK (1 << 0)
679 742
680/* CM_AUTOIDLE_USBHOST */ 743/* CM_AUTOIDLE_USBHOST */
681#define OMAP3430ES2_AUTO_USBHOST_SHIFT 0 744#define OMAP3430ES2_AUTO_USBHOST_SHIFT 0
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index ce03fa750775..d6b4b2f8722f 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -28,13 +28,121 @@
28#include <mach/eac.h> 28#include <mach/eac.h>
29#include <mach/mmc.h> 29#include <mach/mmc.h>
30 30
31#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) 31#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
32#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
33 32
34static struct resource mbox_resources[] = { 33static struct resource cam_resources[] = {
35 { 34 {
36 .start = OMAP2_MBOX_BASE, 35 .start = OMAP24XX_CAMERA_BASE,
37 .end = OMAP2_MBOX_BASE + 0x11f, 36 .end = OMAP24XX_CAMERA_BASE + 0xfff,
37 .flags = IORESOURCE_MEM,
38 },
39 {
40 .start = INT_24XX_CAM_IRQ,
41 .flags = IORESOURCE_IRQ,
42 }
43};
44
45static struct platform_device omap_cam_device = {
46 .name = "omap24xxcam",
47 .id = -1,
48 .num_resources = ARRAY_SIZE(cam_resources),
49 .resource = cam_resources,
50};
51
52static inline void omap_init_camera(void)
53{
54 platform_device_register(&omap_cam_device);
55}
56
57#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
58
59static struct resource omap3isp_resources[] = {
60 {
61 .start = OMAP3430_ISP_BASE,
62 .end = OMAP3430_ISP_END,
63 .flags = IORESOURCE_MEM,
64 },
65 {
66 .start = OMAP3430_ISP_CBUFF_BASE,
67 .end = OMAP3430_ISP_CBUFF_END,
68 .flags = IORESOURCE_MEM,
69 },
70 {
71 .start = OMAP3430_ISP_CCP2_BASE,
72 .end = OMAP3430_ISP_CCP2_END,
73 .flags = IORESOURCE_MEM,
74 },
75 {
76 .start = OMAP3430_ISP_CCDC_BASE,
77 .end = OMAP3430_ISP_CCDC_END,
78 .flags = IORESOURCE_MEM,
79 },
80 {
81 .start = OMAP3430_ISP_HIST_BASE,
82 .end = OMAP3430_ISP_HIST_END,
83 .flags = IORESOURCE_MEM,
84 },
85 {
86 .start = OMAP3430_ISP_H3A_BASE,
87 .end = OMAP3430_ISP_H3A_END,
88 .flags = IORESOURCE_MEM,
89 },
90 {
91 .start = OMAP3430_ISP_PREV_BASE,
92 .end = OMAP3430_ISP_PREV_END,
93 .flags = IORESOURCE_MEM,
94 },
95 {
96 .start = OMAP3430_ISP_RESZ_BASE,
97 .end = OMAP3430_ISP_RESZ_END,
98 .flags = IORESOURCE_MEM,
99 },
100 {
101 .start = OMAP3430_ISP_SBL_BASE,
102 .end = OMAP3430_ISP_SBL_END,
103 .flags = IORESOURCE_MEM,
104 },
105 {
106 .start = OMAP3430_ISP_CSI2A_BASE,
107 .end = OMAP3430_ISP_CSI2A_END,
108 .flags = IORESOURCE_MEM,
109 },
110 {
111 .start = OMAP3430_ISP_CSI2PHY_BASE,
112 .end = OMAP3430_ISP_CSI2PHY_END,
113 .flags = IORESOURCE_MEM,
114 },
115 {
116 .start = INT_34XX_CAM_IRQ,
117 .flags = IORESOURCE_IRQ,
118 }
119};
120
121static struct platform_device omap3isp_device = {
122 .name = "omap3isp",
123 .id = -1,
124 .num_resources = ARRAY_SIZE(omap3isp_resources),
125 .resource = omap3isp_resources,
126};
127
128static inline void omap_init_camera(void)
129{
130 platform_device_register(&omap3isp_device);
131}
132#else
133static inline void omap_init_camera(void)
134{
135}
136#endif
137
138#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
139
140#define MBOX_REG_SIZE 0x120
141
142static struct resource omap2_mbox_resources[] = {
143 {
144 .start = OMAP24XX_MAILBOX_BASE,
145 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
38 .flags = IORESOURCE_MEM, 146 .flags = IORESOURCE_MEM,
39 }, 147 },
40 { 148 {
@@ -47,20 +155,40 @@ static struct resource mbox_resources[] = {
47 }, 155 },
48}; 156};
49 157
158static struct resource omap3_mbox_resources[] = {
159 {
160 .start = OMAP34XX_MAILBOX_BASE,
161 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
162 .flags = IORESOURCE_MEM,
163 },
164 {
165 .start = INT_24XX_MAIL_U0_MPU,
166 .flags = IORESOURCE_IRQ,
167 },
168};
169
50static struct platform_device mbox_device = { 170static struct platform_device mbox_device = {
51 .name = "mailbox", 171 .name = "omap2-mailbox",
52 .id = -1, 172 .id = -1,
53 .num_resources = ARRAY_SIZE(mbox_resources),
54 .resource = mbox_resources,
55}; 173};
56 174
57static inline void omap_init_mbox(void) 175static inline void omap_init_mbox(void)
58{ 176{
177 if (cpu_is_omap2420()) {
178 mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources);
179 mbox_device.resource = omap2_mbox_resources;
180 } else if (cpu_is_omap3430()) {
181 mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
182 mbox_device.resource = omap3_mbox_resources;
183 } else {
184 pr_err("%s: platform not supported\n", __func__);
185 return;
186 }
59 platform_device_register(&mbox_device); 187 platform_device_register(&mbox_device);
60} 188}
61#else 189#else
62static inline void omap_init_mbox(void) { } 190static inline void omap_init_mbox(void) { }
63#endif 191#endif /* CONFIG_OMAP_MBOX_FWK */
64 192
65#if defined(CONFIG_OMAP_STI) 193#if defined(CONFIG_OMAP_STI)
66 194
@@ -348,11 +476,12 @@ static void __init omap_hsmmc_reset(void)
348 } 476 }
349 477
350 dummy_pdev.id = i; 478 dummy_pdev.id = i;
351 iclk = clk_get(dev, "mmchs_ick"); 479 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
480 iclk = clk_get(dev, "ick");
352 if (iclk && clk_enable(iclk)) 481 if (iclk && clk_enable(iclk))
353 iclk = NULL; 482 iclk = NULL;
354 483
355 fclk = clk_get(dev, "mmchs_fck"); 484 fclk = clk_get(dev, "fck");
356 if (fclk && clk_enable(fclk)) 485 if (fclk && clk_enable(fclk))
357 fclk = NULL; 486 fclk = NULL;
358 487
@@ -506,6 +635,7 @@ static int __init omap2_init_devices(void)
506 * in alphabetical order so they're easier to sort through. 635 * in alphabetical order so they're easier to sort through.
507 */ 636 */
508 omap_hsmmc_reset(); 637 omap_hsmmc_reset();
638 omap_init_camera();
509 omap_init_mbox(); 639 omap_init_mbox();
510 omap_init_mcspi(); 640 omap_init_mcspi();
511 omap_hdq_init(); 641 omap_hdq_init();
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index b52a02fc7cd6..34b5914e0f8b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -217,8 +217,13 @@ void __init omap2_check_revision(void)
217 omap_chip.oc = CHIP_IS_OMAP3430; 217 omap_chip.oc = CHIP_IS_OMAP3430;
218 if (omap_rev() == OMAP3430_REV_ES1_0) 218 if (omap_rev() == OMAP3430_REV_ES1_0)
219 omap_chip.oc |= CHIP_IS_OMAP3430ES1; 219 omap_chip.oc |= CHIP_IS_OMAP3430ES1;
220 else if (omap_rev() > OMAP3430_REV_ES1_0) 220 else if (omap_rev() >= OMAP3430_REV_ES2_0 &&
221 omap_rev() <= OMAP3430_REV_ES2_1)
221 omap_chip.oc |= CHIP_IS_OMAP3430ES2; 222 omap_chip.oc |= CHIP_IS_OMAP3430ES2;
223 else if (omap_rev() == OMAP3430_REV_ES3_0)
224 omap_chip.oc |= CHIP_IS_OMAP3430ES3_0;
225 else if (omap_rev() == OMAP3430_REV_ES3_1)
226 omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
222 } else { 227 } else {
223 pr_err("Uninitialized omap_chip, please fix!\n"); 228 pr_err("Uninitialized omap_chip, please fix!\n");
224 } 229 }
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 5ea64f926ed5..916fcd3a2328 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -27,8 +27,8 @@
27#include <mach/mux.h> 27#include <mach/mux.h>
28#include <mach/omapfb.h> 28#include <mach/omapfb.h>
29#include <mach/sram.h> 29#include <mach/sram.h>
30 30#include <mach/sdrc.h>
31#include "memory.h" 31#include <mach/gpmc.h>
32 32
33#include "clock.h" 33#include "clock.h"
34 34
@@ -195,12 +195,12 @@ void __init omap2_map_common_io(void)
195 omapfb_reserve_sdram(); 195 omapfb_reserve_sdram();
196} 196}
197 197
198void __init omap2_init_common_hw(void) 198void __init omap2_init_common_hw(struct omap_sdrc_params *sp)
199{ 199{
200 omap2_mux_init(); 200 omap2_mux_init();
201 pwrdm_init(powerdomains_omap); 201 pwrdm_init(powerdomains_omap);
202 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); 202 clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
203 omap2_clk_init(); 203 omap2_clk_init();
204 omap2_init_memory(); 204 omap2_sdrc_init(sp);
205 gpmc_init(); 205 gpmc_init();
206} 206}
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 32b7af3c610b..fd5b8a5925cc 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * Mailbox reservation modules for OMAP2 2 * Mailbox reservation modules for OMAP2/3
3 * 3 *
4 * Copyright (C) 2006 Nokia Corporation 4 * Copyright (C) 2006-2009 Nokia Corporation
5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> 5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
6 * and Paul Mundt <paul.mundt@nokia.com> 6 * and Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -18,40 +18,22 @@
18#include <mach/mailbox.h> 18#include <mach/mailbox.h>
19#include <mach/irqs.h> 19#include <mach/irqs.h>
20 20
21#define MAILBOX_REVISION 0x00 21#define MAILBOX_REVISION 0x000
22#define MAILBOX_SYSCONFIG 0x10 22#define MAILBOX_SYSCONFIG 0x010
23#define MAILBOX_SYSSTATUS 0x14 23#define MAILBOX_SYSSTATUS 0x014
24#define MAILBOX_MESSAGE_0 0x40 24#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
25#define MAILBOX_MESSAGE_1 0x44 25#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m))
26#define MAILBOX_MESSAGE_2 0x48 26#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m))
27#define MAILBOX_MESSAGE_3 0x4c 27#define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u))
28#define MAILBOX_MESSAGE_4 0x50 28#define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u))
29#define MAILBOX_MESSAGE_5 0x54 29
30#define MAILBOX_FIFOSTATUS_0 0x80 30#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u)))
31#define MAILBOX_FIFOSTATUS_1 0x84 31#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1))
32#define MAILBOX_FIFOSTATUS_2 0x88 32
33#define MAILBOX_FIFOSTATUS_3 0x8c 33#define MBOX_REG_SIZE 0x120
34#define MAILBOX_FIFOSTATUS_4 0x90 34#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32))
35#define MAILBOX_FIFOSTATUS_5 0x94 35
36#define MAILBOX_MSGSTATUS_0 0xc0 36static void __iomem *mbox_base;
37#define MAILBOX_MSGSTATUS_1 0xc4
38#define MAILBOX_MSGSTATUS_2 0xc8
39#define MAILBOX_MSGSTATUS_3 0xcc
40#define MAILBOX_MSGSTATUS_4 0xd0
41#define MAILBOX_MSGSTATUS_5 0xd4
42#define MAILBOX_IRQSTATUS_0 0x100
43#define MAILBOX_IRQENABLE_0 0x104
44#define MAILBOX_IRQSTATUS_1 0x108
45#define MAILBOX_IRQENABLE_1 0x10c
46#define MAILBOX_IRQSTATUS_2 0x110
47#define MAILBOX_IRQENABLE_2 0x114
48#define MAILBOX_IRQSTATUS_3 0x118
49#define MAILBOX_IRQENABLE_3 0x11c
50
51static unsigned long mbox_base;
52
53#define MAILBOX_IRQ_NOTFULL(n) (1 << (2 * (n) + 1))
54#define MAILBOX_IRQ_NEWMSG(n) (1 << (2 * (n)))
55 37
56struct omap_mbox2_fifo { 38struct omap_mbox2_fifo {
57 unsigned long msg; 39 unsigned long msg;
@@ -66,6 +48,7 @@ struct omap_mbox2_priv {
66 unsigned long irqstatus; 48 unsigned long irqstatus;
67 u32 newmsg_bit; 49 u32 newmsg_bit;
68 u32 notfull_bit; 50 u32 notfull_bit;
51 u32 ctx[MBOX_NR_REGS];
69}; 52};
70 53
71static struct clk *mbox_ick_handle; 54static struct clk *mbox_ick_handle;
@@ -73,14 +56,14 @@ static struct clk *mbox_ick_handle;
73static void omap2_mbox_enable_irq(struct omap_mbox *mbox, 56static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
74 omap_mbox_type_t irq); 57 omap_mbox_type_t irq);
75 58
76static inline unsigned int mbox_read_reg(unsigned int reg) 59static inline unsigned int mbox_read_reg(size_t ofs)
77{ 60{
78 return __raw_readl(mbox_base + reg); 61 return __raw_readl(mbox_base + ofs);
79} 62}
80 63
81static inline void mbox_write_reg(unsigned int val, unsigned int reg) 64static inline void mbox_write_reg(u32 val, size_t ofs)
82{ 65{
83 __raw_writel(val, mbox_base + reg); 66 __raw_writel(val, mbox_base + ofs);
84} 67}
85 68
86/* Mailbox H/W preparations */ 69/* Mailbox H/W preparations */
@@ -95,6 +78,9 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
95 } 78 }
96 clk_enable(mbox_ick_handle); 79 clk_enable(mbox_ick_handle);
97 80
81 l = mbox_read_reg(MAILBOX_REVISION);
82 pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));
83
98 /* set smart-idle & autoidle */ 84 /* set smart-idle & autoidle */
99 l = mbox_read_reg(MAILBOX_SYSCONFIG); 85 l = mbox_read_reg(MAILBOX_SYSCONFIG);
100 l |= 0x00000011; 86 l |= 0x00000011;
@@ -183,6 +169,32 @@ static int omap2_mbox_is_irq(struct omap_mbox *mbox,
183 return (enable & status & bit); 169 return (enable & status & bit);
184} 170}
185 171
172static void omap2_mbox_save_ctx(struct omap_mbox *mbox)
173{
174 int i;
175 struct omap_mbox2_priv *p = mbox->priv;
176
177 for (i = 0; i < MBOX_NR_REGS; i++) {
178 p->ctx[i] = mbox_read_reg(i * sizeof(u32));
179
180 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
181 i, p->ctx[i]);
182 }
183}
184
185static void omap2_mbox_restore_ctx(struct omap_mbox *mbox)
186{
187 int i;
188 struct omap_mbox2_priv *p = mbox->priv;
189
190 for (i = 0; i < MBOX_NR_REGS; i++) {
191 mbox_write_reg(p->ctx[i], i * sizeof(u32));
192
193 dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__,
194 i, p->ctx[i]);
195 }
196}
197
186static struct omap_mbox_ops omap2_mbox_ops = { 198static struct omap_mbox_ops omap2_mbox_ops = {
187 .type = OMAP_MBOX_TYPE2, 199 .type = OMAP_MBOX_TYPE2,
188 .startup = omap2_mbox_startup, 200 .startup = omap2_mbox_startup,
@@ -195,6 +207,8 @@ static struct omap_mbox_ops omap2_mbox_ops = {
195 .disable_irq = omap2_mbox_disable_irq, 207 .disable_irq = omap2_mbox_disable_irq,
196 .ack_irq = omap2_mbox_ack_irq, 208 .ack_irq = omap2_mbox_ack_irq,
197 .is_irq = omap2_mbox_is_irq, 209 .is_irq = omap2_mbox_is_irq,
210 .save_ctx = omap2_mbox_save_ctx,
211 .restore_ctx = omap2_mbox_restore_ctx,
198}; 212};
199 213
200/* 214/*
@@ -209,15 +223,15 @@ static struct omap_mbox_ops omap2_mbox_ops = {
209/* DSP */ 223/* DSP */
210static struct omap_mbox2_priv omap2_mbox_dsp_priv = { 224static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
211 .tx_fifo = { 225 .tx_fifo = {
212 .msg = MAILBOX_MESSAGE_0, 226 .msg = MAILBOX_MESSAGE(0),
213 .fifo_stat = MAILBOX_FIFOSTATUS_0, 227 .fifo_stat = MAILBOX_FIFOSTATUS(0),
214 }, 228 },
215 .rx_fifo = { 229 .rx_fifo = {
216 .msg = MAILBOX_MESSAGE_1, 230 .msg = MAILBOX_MESSAGE(1),
217 .msg_stat = MAILBOX_MSGSTATUS_1, 231 .msg_stat = MAILBOX_MSGSTATUS(1),
218 }, 232 },
219 .irqenable = MAILBOX_IRQENABLE_0, 233 .irqenable = MAILBOX_IRQENABLE(0),
220 .irqstatus = MAILBOX_IRQSTATUS_0, 234 .irqstatus = MAILBOX_IRQSTATUS(0),
221 .notfull_bit = MAILBOX_IRQ_NOTFULL(0), 235 .notfull_bit = MAILBOX_IRQ_NOTFULL(0),
222 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1), 236 .newmsg_bit = MAILBOX_IRQ_NEWMSG(1),
223}; 237};
@@ -229,18 +243,18 @@ struct omap_mbox mbox_dsp_info = {
229}; 243};
230EXPORT_SYMBOL(mbox_dsp_info); 244EXPORT_SYMBOL(mbox_dsp_info);
231 245
232/* IVA */ 246#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
233static struct omap_mbox2_priv omap2_mbox_iva_priv = { 247static struct omap_mbox2_priv omap2_mbox_iva_priv = {
234 .tx_fifo = { 248 .tx_fifo = {
235 .msg = MAILBOX_MESSAGE_2, 249 .msg = MAILBOX_MESSAGE(2),
236 .fifo_stat = MAILBOX_FIFOSTATUS_2, 250 .fifo_stat = MAILBOX_FIFOSTATUS(2),
237 }, 251 },
238 .rx_fifo = { 252 .rx_fifo = {
239 .msg = MAILBOX_MESSAGE_3, 253 .msg = MAILBOX_MESSAGE(3),
240 .msg_stat = MAILBOX_MSGSTATUS_3, 254 .msg_stat = MAILBOX_MSGSTATUS(3),
241 }, 255 },
242 .irqenable = MAILBOX_IRQENABLE_3, 256 .irqenable = MAILBOX_IRQENABLE(3),
243 .irqstatus = MAILBOX_IRQSTATUS_3, 257 .irqstatus = MAILBOX_IRQSTATUS(3),
244 .notfull_bit = MAILBOX_IRQ_NOTFULL(2), 258 .notfull_bit = MAILBOX_IRQ_NOTFULL(2),
245 .newmsg_bit = MAILBOX_IRQ_NEWMSG(3), 259 .newmsg_bit = MAILBOX_IRQ_NEWMSG(3),
246}; 260};
@@ -250,17 +264,12 @@ static struct omap_mbox mbox_iva_info = {
250 .ops = &omap2_mbox_ops, 264 .ops = &omap2_mbox_ops,
251 .priv = &omap2_mbox_iva_priv, 265 .priv = &omap2_mbox_iva_priv,
252}; 266};
267#endif
253 268
254static int __init omap2_mbox_probe(struct platform_device *pdev) 269static int __devinit omap2_mbox_probe(struct platform_device *pdev)
255{ 270{
256 struct resource *res; 271 struct resource *res;
257 int ret = 0; 272 int ret;
258
259 if (pdev->num_resources != 3) {
260 dev_err(&pdev->dev, "invalid number of resources: %d\n",
261 pdev->num_resources);
262 return -ENODEV;
263 }
264 273
265 /* MBOX base */ 274 /* MBOX base */
266 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 275 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -268,42 +277,61 @@ static int __init omap2_mbox_probe(struct platform_device *pdev)
268 dev_err(&pdev->dev, "invalid mem resource\n"); 277 dev_err(&pdev->dev, "invalid mem resource\n");
269 return -ENODEV; 278 return -ENODEV;
270 } 279 }
271 mbox_base = res->start; 280 mbox_base = ioremap(res->start, res->end - res->start);
281 if (!mbox_base)
282 return -ENOMEM;
272 283
273 /* DSP IRQ */ 284 /* DSP or IVA2 IRQ */
274 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 285 mbox_dsp_info.irq = platform_get_irq(pdev, 0);
275 if (unlikely(!res)) { 286 if (mbox_dsp_info.irq < 0) {
276 dev_err(&pdev->dev, "invalid irq resource\n"); 287 dev_err(&pdev->dev, "invalid irq resource\n");
277 return -ENODEV; 288 ret = -ENODEV;
289 goto err_dsp;
278 } 290 }
279 mbox_dsp_info.irq = res->start;
280 291
281 ret = omap_mbox_register(&mbox_dsp_info); 292 ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
282 293 if (ret)
283 /* IVA IRQ */ 294 goto err_dsp;
284 res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); 295
285 if (unlikely(!res)) { 296#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
286 dev_err(&pdev->dev, "invalid irq resource\n"); 297 if (cpu_is_omap2420()) {
287 return -ENODEV; 298 /* IVA IRQ */
299 res = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
300 if (unlikely(!res)) {
301 dev_err(&pdev->dev, "invalid irq resource\n");
302 ret = -ENODEV;
303 goto err_iva1;
304 }
305 mbox_iva_info.irq = res->start;
306 ret = omap_mbox_register(&pdev->dev, &mbox_iva_info);
307 if (ret)
308 goto err_iva1;
288 } 309 }
289 mbox_iva_info.irq = res->start; 310#endif
290 311 return 0;
291 ret = omap_mbox_register(&mbox_iva_info);
292 312
313err_iva1:
314 omap_mbox_unregister(&mbox_dsp_info);
315err_dsp:
316 iounmap(mbox_base);
293 return ret; 317 return ret;
294} 318}
295 319
296static int omap2_mbox_remove(struct platform_device *pdev) 320static int __devexit omap2_mbox_remove(struct platform_device *pdev)
297{ 321{
322#if defined(CONFIG_ARCH_OMAP2420)
323 omap_mbox_unregister(&mbox_iva_info);
324#endif
298 omap_mbox_unregister(&mbox_dsp_info); 325 omap_mbox_unregister(&mbox_dsp_info);
326 iounmap(mbox_base);
299 return 0; 327 return 0;
300} 328}
301 329
302static struct platform_driver omap2_mbox_driver = { 330static struct platform_driver omap2_mbox_driver = {
303 .probe = omap2_mbox_probe, 331 .probe = omap2_mbox_probe,
304 .remove = omap2_mbox_remove, 332 .remove = __devexit_p(omap2_mbox_remove),
305 .driver = { 333 .driver = {
306 .name = "mailbox", 334 .name = "omap2-mailbox",
307 }, 335 },
308}; 336};
309 337
@@ -320,4 +348,7 @@ static void __exit omap2_mbox_exit(void)
320module_init(omap2_mbox_init); 348module_init(omap2_mbox_init);
321module_exit(omap2_mbox_exit); 349module_exit(omap2_mbox_exit);
322 350
323MODULE_LICENSE("GPL"); 351MODULE_LICENSE("GPL v2");
352MODULE_DESCRIPTION("omap mailbox: omap2/3 architecture specific functions");
353MODULE_AUTHOR("Hiroshi DOYU <Hiroshi.DOYU@nokia.com>, Paul Mundt");
354MODULE_ALIAS("platform:omap2-mailbox");
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index a9e631fc1134..a5c0f0435cd6 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -24,8 +24,6 @@
24#include <mach/cpu.h> 24#include <mach/cpu.h>
25#include <mach/mcbsp.h> 25#include <mach/mcbsp.h>
26 26
27const char *clk_names[] = { "mcbsp_ick", "mcbsp_fck" };
28
29static void omap2_mcbsp2_mux_setup(void) 27static void omap2_mcbsp2_mux_setup(void)
30{ 28{
31 omap_cfg_reg(Y15_24XX_MCBSP2_CLKX); 29 omap_cfg_reg(Y15_24XX_MCBSP2_CLKX);
@@ -57,8 +55,6 @@ static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
57 .rx_irq = INT_24XX_MCBSP1_IRQ_RX, 55 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
58 .tx_irq = INT_24XX_MCBSP1_IRQ_TX, 56 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
59 .ops = &omap2_mcbsp_ops, 57 .ops = &omap2_mcbsp_ops,
60 .clk_names = clk_names,
61 .num_clks = 2,
62 }, 58 },
63 { 59 {
64 .phys_base = OMAP24XX_MCBSP2_BASE, 60 .phys_base = OMAP24XX_MCBSP2_BASE,
@@ -67,8 +63,6 @@ static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
67 .rx_irq = INT_24XX_MCBSP2_IRQ_RX, 63 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
68 .tx_irq = INT_24XX_MCBSP2_IRQ_TX, 64 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
69 .ops = &omap2_mcbsp_ops, 65 .ops = &omap2_mcbsp_ops,
70 .clk_names = clk_names,
71 .num_clks = 2,
72 }, 66 },
73}; 67};
74#define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) 68#define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata)
@@ -86,8 +80,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
86 .rx_irq = INT_24XX_MCBSP1_IRQ_RX, 80 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
87 .tx_irq = INT_24XX_MCBSP1_IRQ_TX, 81 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
88 .ops = &omap2_mcbsp_ops, 82 .ops = &omap2_mcbsp_ops,
89 .clk_names = clk_names,
90 .num_clks = 2,
91 }, 83 },
92 { 84 {
93 .phys_base = OMAP24XX_MCBSP2_BASE, 85 .phys_base = OMAP24XX_MCBSP2_BASE,
@@ -96,8 +88,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
96 .rx_irq = INT_24XX_MCBSP2_IRQ_RX, 88 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
97 .tx_irq = INT_24XX_MCBSP2_IRQ_TX, 89 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
98 .ops = &omap2_mcbsp_ops, 90 .ops = &omap2_mcbsp_ops,
99 .clk_names = clk_names,
100 .num_clks = 2,
101 }, 91 },
102 { 92 {
103 .phys_base = OMAP2430_MCBSP3_BASE, 93 .phys_base = OMAP2430_MCBSP3_BASE,
@@ -106,8 +96,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
106 .rx_irq = INT_24XX_MCBSP3_IRQ_RX, 96 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
107 .tx_irq = INT_24XX_MCBSP3_IRQ_TX, 97 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
108 .ops = &omap2_mcbsp_ops, 98 .ops = &omap2_mcbsp_ops,
109 .clk_names = clk_names,
110 .num_clks = 2,
111 }, 99 },
112 { 100 {
113 .phys_base = OMAP2430_MCBSP4_BASE, 101 .phys_base = OMAP2430_MCBSP4_BASE,
@@ -116,8 +104,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
116 .rx_irq = INT_24XX_MCBSP4_IRQ_RX, 104 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
117 .tx_irq = INT_24XX_MCBSP4_IRQ_TX, 105 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
118 .ops = &omap2_mcbsp_ops, 106 .ops = &omap2_mcbsp_ops,
119 .clk_names = clk_names,
120 .num_clks = 2,
121 }, 107 },
122 { 108 {
123 .phys_base = OMAP2430_MCBSP5_BASE, 109 .phys_base = OMAP2430_MCBSP5_BASE,
@@ -126,8 +112,6 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
126 .rx_irq = INT_24XX_MCBSP5_IRQ_RX, 112 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
127 .tx_irq = INT_24XX_MCBSP5_IRQ_TX, 113 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
128 .ops = &omap2_mcbsp_ops, 114 .ops = &omap2_mcbsp_ops,
129 .clk_names = clk_names,
130 .num_clks = 2,
131 }, 115 },
132}; 116};
133#define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) 117#define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata)
@@ -145,8 +129,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
145 .rx_irq = INT_24XX_MCBSP1_IRQ_RX, 129 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
146 .tx_irq = INT_24XX_MCBSP1_IRQ_TX, 130 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
147 .ops = &omap2_mcbsp_ops, 131 .ops = &omap2_mcbsp_ops,
148 .clk_names = clk_names,
149 .num_clks = 2,
150 }, 132 },
151 { 133 {
152 .phys_base = OMAP34XX_MCBSP2_BASE, 134 .phys_base = OMAP34XX_MCBSP2_BASE,
@@ -155,8 +137,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
155 .rx_irq = INT_24XX_MCBSP2_IRQ_RX, 137 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
156 .tx_irq = INT_24XX_MCBSP2_IRQ_TX, 138 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
157 .ops = &omap2_mcbsp_ops, 139 .ops = &omap2_mcbsp_ops,
158 .clk_names = clk_names,
159 .num_clks = 2,
160 }, 140 },
161 { 141 {
162 .phys_base = OMAP34XX_MCBSP3_BASE, 142 .phys_base = OMAP34XX_MCBSP3_BASE,
@@ -165,8 +145,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
165 .rx_irq = INT_24XX_MCBSP3_IRQ_RX, 145 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
166 .tx_irq = INT_24XX_MCBSP3_IRQ_TX, 146 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
167 .ops = &omap2_mcbsp_ops, 147 .ops = &omap2_mcbsp_ops,
168 .clk_names = clk_names,
169 .num_clks = 2,
170 }, 148 },
171 { 149 {
172 .phys_base = OMAP34XX_MCBSP4_BASE, 150 .phys_base = OMAP34XX_MCBSP4_BASE,
@@ -175,8 +153,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
175 .rx_irq = INT_24XX_MCBSP4_IRQ_RX, 153 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
176 .tx_irq = INT_24XX_MCBSP4_IRQ_TX, 154 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
177 .ops = &omap2_mcbsp_ops, 155 .ops = &omap2_mcbsp_ops,
178 .clk_names = clk_names,
179 .num_clks = 2,
180 }, 156 },
181 { 157 {
182 .phys_base = OMAP34XX_MCBSP5_BASE, 158 .phys_base = OMAP34XX_MCBSP5_BASE,
@@ -185,8 +161,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
185 .rx_irq = INT_24XX_MCBSP5_IRQ_RX, 161 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
186 .tx_irq = INT_24XX_MCBSP5_IRQ_TX, 162 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
187 .ops = &omap2_mcbsp_ops, 163 .ops = &omap2_mcbsp_ops,
188 .clk_names = clk_names,
189 .num_clks = 2,
190 }, 164 },
191}; 165};
192#define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) 166#define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata)
diff --git a/arch/arm/mach-omap2/memory.h b/arch/arm/mach-omap2/memory.h
deleted file mode 100644
index bb3db80a7c46..000000000000
--- a/arch/arm/mach-omap2/memory.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * linux/arch/arm/mach-omap2/memory.h
3 *
4 * Interface for memory timing related functions for OMAP24XX
5 *
6 * Copyright (C) 2005 Texas Instruments Inc.
7 * Richard Woodruff <r-woodruff2@ti.com>
8 *
9 * Copyright (C) 2005 Nokia Corporation
10 * Tony Lindgren <tony@atomide.com>
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#ifndef ARCH_ARM_MACH_OMAP2_MEMORY_H
18#define ARCH_ARM_MACH_OMAP2_MEMORY_H
19
20/* Memory timings */
21#define M_DDR 1
22#define M_LOCK_CTRL (1 << 2)
23#define M_UNLOCK 0
24#define M_LOCK 1
25
26struct memory_timings {
27 u32 m_type; /* ddr = 1, sdr = 0 */
28 u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
29 u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
30 u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
31 u32 base_cs; /* base chip select to use for calculations */
32};
33
34extern void omap2_init_memory_params(u32 force_lock_to_unlock_mode);
35extern u32 omap2_memory_get_slow_dll_ctrl(void);
36extern u32 omap2_memory_get_fast_dll_ctrl(void);
37extern u32 omap2_memory_get_type(void);
38u32 omap2_dll_force_needed(void);
39u32 omap2_reprogram_sdrc(u32 level, u32 force);
40void __init omap2_init_memory(void);
41void __init gpmc_init(void);
42
43#endif
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index 437f52073f6e..dc40b3e72206 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -17,6 +17,7 @@
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/i2c/twl4030.h> 19#include <linux/i2c/twl4030.h>
20#include <linux/regulator/machine.h>
20 21
21#include <mach/hardware.h> 22#include <mach/hardware.h>
22#include <mach/control.h> 23#include <mach/control.h>
@@ -44,6 +45,7 @@
44#define VMMC2_315V 0x0c 45#define VMMC2_315V 0x0c
45#define VMMC2_300V 0x0b 46#define VMMC2_300V 0x0b
46#define VMMC2_285V 0x0a 47#define VMMC2_285V 0x0a
48#define VMMC2_280V 0x09
47#define VMMC2_260V 0x08 49#define VMMC2_260V 0x08
48#define VMMC2_185V 0x06 50#define VMMC2_185V 0x06
49#define VMMC2_DEDICATED 0x2E 51#define VMMC2_DEDICATED 0x2E
@@ -59,8 +61,8 @@ static struct twl_mmc_controller {
59 struct omap_mmc_platform_data *mmc; 61 struct omap_mmc_platform_data *mmc;
60 u8 twl_vmmc_dev_grp; 62 u8 twl_vmmc_dev_grp;
61 u8 twl_mmc_dedicated; 63 u8 twl_mmc_dedicated;
62 char name[HSMMC_NAME_LEN]; 64 char name[HSMMC_NAME_LEN + 1];
63} hsmmc[] = { 65} hsmmc[OMAP34XX_NR_MMC] = {
64 { 66 {
65 .twl_vmmc_dev_grp = VMMC1_DEV_GRP, 67 .twl_vmmc_dev_grp = VMMC1_DEV_GRP,
66 .twl_mmc_dedicated = VMMC1_DEDICATED, 68 .twl_mmc_dedicated = VMMC1_DEDICATED,
@@ -98,6 +100,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot)
98 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); 100 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
99} 101}
100 102
103static int twl_mmc_get_cover_state(struct device *dev, int slot)
104{
105 struct omap_mmc_platform_data *mmc = dev->platform_data;
106
107 /* NOTE: assumes card detect signal is active-low */
108 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
109}
110
101/* 111/*
102 * MMC Slot Initialization. 112 * MMC Slot Initialization.
103 */ 113 */
@@ -166,66 +176,85 @@ static int twl_mmc_resume(struct device *dev, int slot)
166/* 176/*
167 * Sets the MMC voltage in twl4030 177 * Sets the MMC voltage in twl4030
168 */ 178 */
179
180#define MMC1_OCR (MMC_VDD_165_195 \
181 |MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32)
182#define MMC2_OCR (MMC_VDD_165_195 \
183 |MMC_VDD_25_26|MMC_VDD_26_27|MMC_VDD_27_28 \
184 |MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32)
185
169static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd) 186static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd)
170{ 187{
171 int ret; 188 int ret;
172 u8 vmmc, dev_grp_val; 189 u8 vmmc = 0, dev_grp_val;
173 190
174 switch (1 << vdd) { 191 if (!vdd)
175 case MMC_VDD_35_36: 192 goto doit;
176 case MMC_VDD_34_35: 193
177 case MMC_VDD_33_34: 194 if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) {
178 case MMC_VDD_32_33: 195 /* VMMC1: max 220 mA. And for 8-bit mode,
179 case MMC_VDD_31_32: 196 * VSIM: max 50 mA
180 case MMC_VDD_30_31: 197 */
181 if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) 198 switch (1 << vdd) {
182 vmmc = VMMC1_315V; 199 case MMC_VDD_165_195:
183 else
184 vmmc = VMMC2_315V;
185 break;
186 case MMC_VDD_29_30:
187 if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
188 vmmc = VMMC1_315V;
189 else
190 vmmc = VMMC2_300V;
191 break;
192 case MMC_VDD_27_28:
193 case MMC_VDD_26_27:
194 if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
195 vmmc = VMMC1_285V;
196 else
197 vmmc = VMMC2_285V;
198 break;
199 case MMC_VDD_25_26:
200 case MMC_VDD_24_25:
201 case MMC_VDD_23_24:
202 case MMC_VDD_22_23:
203 case MMC_VDD_21_22:
204 case MMC_VDD_20_21:
205 if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
206 vmmc = VMMC1_285V;
207 else
208 vmmc = VMMC2_260V;
209 break;
210 case MMC_VDD_165_195:
211 if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP)
212 vmmc = VMMC1_185V; 200 vmmc = VMMC1_185V;
213 else 201 /* and VSIM_180V */
202 break;
203 case MMC_VDD_28_29:
204 vmmc = VMMC1_285V;
205 /* and VSIM_280V */
206 break;
207 case MMC_VDD_29_30:
208 case MMC_VDD_30_31:
209 vmmc = VMMC1_300V;
210 /* and VSIM_300V */
211 break;
212 case MMC_VDD_31_32:
213 vmmc = VMMC1_315V;
214 /* error if VSIM needed */
215 break;
216 default:
217 return -EINVAL;
218 }
219 } else if (c->twl_vmmc_dev_grp == VMMC2_DEV_GRP) {
220 /* VMMC2: max 100 mA */
221 switch (1 << vdd) {
222 case MMC_VDD_165_195:
214 vmmc = VMMC2_185V; 223 vmmc = VMMC2_185V;
215 break; 224 break;
216 default: 225 case MMC_VDD_25_26:
217 vmmc = 0; 226 case MMC_VDD_26_27:
218 break; 227 vmmc = VMMC2_260V;
228 break;
229 case MMC_VDD_27_28:
230 vmmc = VMMC2_280V;
231 break;
232 case MMC_VDD_28_29:
233 vmmc = VMMC2_285V;
234 break;
235 case MMC_VDD_29_30:
236 case MMC_VDD_30_31:
237 vmmc = VMMC2_300V;
238 break;
239 case MMC_VDD_31_32:
240 vmmc = VMMC2_315V;
241 break;
242 default:
243 return -EINVAL;
244 }
245 } else {
246 return -EINVAL;
219 } 247 }
220 248
221 if (vmmc) 249doit:
250 if (vdd)
222 dev_grp_val = VMMC_DEV_GRP_P1; /* Power up */ 251 dev_grp_val = VMMC_DEV_GRP_P1; /* Power up */
223 else 252 else
224 dev_grp_val = LDO_CLR; /* Power down */ 253 dev_grp_val = LDO_CLR; /* Power down */
225 254
226 ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 255 ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
227 dev_grp_val, c->twl_vmmc_dev_grp); 256 dev_grp_val, c->twl_vmmc_dev_grp);
228 if (ret) 257 if (ret || !vdd)
229 return ret; 258 return ret;
230 259
231 ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 260 ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
@@ -242,6 +271,14 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on,
242 struct twl_mmc_controller *c = &hsmmc[0]; 271 struct twl_mmc_controller *c = &hsmmc[0];
243 struct omap_mmc_platform_data *mmc = dev->platform_data; 272 struct omap_mmc_platform_data *mmc = dev->platform_data;
244 273
274 /*
275 * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
276 * card using the same TWL VMMC1 supply (hsmmc[0]); OMAP has both
277 * 1.8V and 3.0V modes, controlled by the PBIAS register.
278 *
279 * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which
280 * is most naturally TWL VSIM; those pins also use PBIAS.
281 */
245 if (power_on) { 282 if (power_on) {
246 if (cpu_is_omap2430()) { 283 if (cpu_is_omap2430()) {
247 reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1); 284 reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1);
@@ -298,6 +335,12 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
298 struct twl_mmc_controller *c = &hsmmc[1]; 335 struct twl_mmc_controller *c = &hsmmc[1];
299 struct omap_mmc_platform_data *mmc = dev->platform_data; 336 struct omap_mmc_platform_data *mmc = dev->platform_data;
300 337
338 /*
339 * Assume TWL VMMC2 (hsmmc[1]) is used only to power the card ... OMAP
340 * VDDS is used to power the pins, optionally with a transceiver to
341 * support cards using voltages other than VDDS (1.8V nominal). When a
342 * transceiver is used, DAT3..7 are muxed as transceiver control pins.
343 */
301 if (power_on) { 344 if (power_on) {
302 if (mmc->slots[0].internal_clock) { 345 if (mmc->slots[0].internal_clock) {
303 u32 reg; 346 u32 reg;
@@ -314,6 +357,16 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd
314 return ret; 357 return ret;
315} 358}
316 359
360static int twl_mmc3_set_power(struct device *dev, int slot, int power_on,
361 int vdd)
362{
363 /*
364 * Assume MMC3 has self-powered device connected, for example on-board
365 * chip with external power source.
366 */
367 return 0;
368}
369
317static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; 370static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata;
318 371
319void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) 372void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
@@ -349,13 +402,13 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
349 return; 402 return;
350 } 403 }
351 404
352 sprintf(twl->name, "mmc%islot%i", c->mmc, 1); 405 if (c->name)
406 strncpy(twl->name, c->name, HSMMC_NAME_LEN);
407 else
408 snprintf(twl->name, ARRAY_SIZE(twl->name),
409 "mmc%islot%i", c->mmc, 1);
353 mmc->slots[0].name = twl->name; 410 mmc->slots[0].name = twl->name;
354 mmc->nr_slots = 1; 411 mmc->nr_slots = 1;
355 mmc->slots[0].ocr_mask = MMC_VDD_165_195 |
356 MMC_VDD_26_27 | MMC_VDD_27_28 |
357 MMC_VDD_29_30 |
358 MMC_VDD_30_31 | MMC_VDD_31_32;
359 mmc->slots[0].wires = c->wires; 412 mmc->slots[0].wires = c->wires;
360 mmc->slots[0].internal_clock = !c->ext_clock; 413 mmc->slots[0].internal_clock = !c->ext_clock;
361 mmc->dma_mask = 0xffffffff; 414 mmc->dma_mask = 0xffffffff;
@@ -369,7 +422,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
369 422
370 mmc->slots[0].switch_pin = c->gpio_cd; 423 mmc->slots[0].switch_pin = c->gpio_cd;
371 mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd); 424 mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd);
372 mmc->slots[0].card_detect = twl_mmc_card_detect; 425 if (c->cover_only)
426 mmc->slots[0].get_cover_state = twl_mmc_get_cover_state;
427 else
428 mmc->slots[0].card_detect = twl_mmc_card_detect;
373 } else 429 } else
374 mmc->slots[0].switch_pin = -EINVAL; 430 mmc->slots[0].switch_pin = -EINVAL;
375 431
@@ -385,24 +441,43 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
385 441
386 /* NOTE: we assume OMAP's MMC1 and MMC2 use 442 /* NOTE: we assume OMAP's MMC1 and MMC2 use
387 * the TWL4030's VMMC1 and VMMC2, respectively; 443 * the TWL4030's VMMC1 and VMMC2, respectively;
388 * and that OMAP's MMC3 isn't used. 444 * and that MMC3 device has it's own power source.
389 */ 445 */
390 446
391 switch (c->mmc) { 447 switch (c->mmc) {
392 case 1: 448 case 1:
393 mmc->slots[0].set_power = twl_mmc1_set_power; 449 mmc->slots[0].set_power = twl_mmc1_set_power;
450 mmc->slots[0].ocr_mask = MMC1_OCR;
394 break; 451 break;
395 case 2: 452 case 2:
396 mmc->slots[0].set_power = twl_mmc2_set_power; 453 mmc->slots[0].set_power = twl_mmc2_set_power;
454 if (c->transceiver)
455 mmc->slots[0].ocr_mask = MMC2_OCR;
456 else
457 mmc->slots[0].ocr_mask = MMC_VDD_165_195;
458 break;
459 case 3:
460 mmc->slots[0].set_power = twl_mmc3_set_power;
461 mmc->slots[0].ocr_mask = MMC_VDD_165_195;
397 break; 462 break;
398 default: 463 default:
399 pr_err("MMC%d configuration not supported!\n", c->mmc); 464 pr_err("MMC%d configuration not supported!\n", c->mmc);
465 kfree(mmc);
400 continue; 466 continue;
401 } 467 }
402 hsmmc_data[c->mmc - 1] = mmc; 468 hsmmc_data[c->mmc - 1] = mmc;
403 } 469 }
404 470
405 omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); 471 omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC);
472
473 /* pass the device nodes back to board setup code */
474 for (c = controllers; c->mmc; c++) {
475 struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1];
476
477 if (!c->mmc || c->mmc > nr_hsmmc)
478 continue;
479 c->dev = mmc->dev;
480 }
406} 481}
407 482
408#endif 483#endif
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index e1c8076400ca..ea59e8624290 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -9,9 +9,13 @@
9struct twl4030_hsmmc_info { 9struct twl4030_hsmmc_info {
10 u8 mmc; /* controller 1/2/3 */ 10 u8 mmc; /* controller 1/2/3 */
11 u8 wires; /* 1/4/8 wires */ 11 u8 wires; /* 1/4/8 wires */
12 bool transceiver; /* MMC-2 option */
13 bool ext_clock; /* use external pin for input clock */
14 bool cover_only; /* No card detect - just cover switch */
12 int gpio_cd; /* or -EINVAL */ 15 int gpio_cd; /* or -EINVAL */
13 int gpio_wp; /* or -EINVAL */ 16 int gpio_wp; /* or -EINVAL */
14 int ext_clock:1; /* use external pin for input clock */ 17 char *name; /* or NULL for default */
18 struct device *dev; /* returned: pointer to mmc adapter */
15}; 19};
16 20
17#if defined(CONFIG_TWL4030_CORE) && \ 21#if defined(CONFIG_TWL4030_CORE) && \
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index dacb41f130c0..026c4fc883a7 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -453,10 +453,37 @@ MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TXEN_N", 0x18a,
453 453
454 454
455/* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix. 455/* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
456 * (Always specify PIN_INPUT, except for names suffixed by "_OUT".)
456 * No internal pullup/pulldown without "_UP" or "_DOWN" suffix. 457 * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
457 */ 458 */
459MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
460 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
461MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
462 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
458MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, 463MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
459 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) 464 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
465MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4,
466 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
467MUX_CFG_34XX("U8_34XX_GPIO54_DOWN", 0x0b4,
468 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLDOWN)
469MUX_CFG_34XX("L8_34XX_GPIO63", 0x0ce,
470 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
471MUX_CFG_34XX("G25_34XX_GPIO86_OUT", 0x0fc,
472 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
473MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160,
474 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
475MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164,
476 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
477MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
478 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
479MUX_CFG_34XX("AE6_34XX_GPIO141", 0x16e,
480 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
481MUX_CFG_34XX("AF5_34XX_GPIO142", 0x170,
482 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
483MUX_CFG_34XX("AE5_34XX_GPIO143", 0x172,
484 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
485MUX_CFG_34XX("H19_34XX_GPIO164_OUT", 0x19c,
486 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
460MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6, 487MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
461 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) 488 OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
462}; 489};
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 55361c16c9d9..ea8ceaed09cb 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -103,7 +103,7 @@ static struct platform_suspend_ops omap_pm_ops = {
103 .valid = suspend_valid_only_mem, 103 .valid = suspend_valid_only_mem,
104}; 104};
105 105
106int __init omap2_pm_init(void) 106static int __init omap2_pm_init(void)
107{ 107{
108 return 0; 108 return 0;
109} 109}
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains.h
index 1e151faebbd3..691470ea4c6a 100644
--- a/arch/arm/mach-omap2/powerdomains.h
+++ b/arch/arm/mach-omap2/powerdomains.h
@@ -171,13 +171,19 @@ static struct powerdomain *powerdomains_omap[] __initdata = {
171 &iva2_pwrdm, 171 &iva2_pwrdm,
172 &mpu_34xx_pwrdm, 172 &mpu_34xx_pwrdm,
173 &neon_pwrdm, 173 &neon_pwrdm,
174 &core_34xx_pwrdm, 174 &core_34xx_pre_es3_1_pwrdm,
175 &core_34xx_es3_1_pwrdm,
175 &cam_pwrdm, 176 &cam_pwrdm,
176 &dss_pwrdm, 177 &dss_pwrdm,
177 &per_pwrdm, 178 &per_pwrdm,
178 &emu_pwrdm, 179 &emu_pwrdm,
179 &sgx_pwrdm, 180 &sgx_pwrdm,
180 &usbhost_pwrdm, 181 &usbhost_pwrdm,
182 &dpll1_pwrdm,
183 &dpll2_pwrdm,
184 &dpll3_pwrdm,
185 &dpll4_pwrdm,
186 &dpll5_pwrdm,
181#endif 187#endif
182 188
183 NULL 189 NULL
diff --git a/arch/arm/mach-omap2/powerdomains34xx.h b/arch/arm/mach-omap2/powerdomains34xx.h
index f573f7108398..4dcf94b800ab 100644
--- a/arch/arm/mach-omap2/powerdomains34xx.h
+++ b/arch/arm/mach-omap2/powerdomains34xx.h
@@ -200,12 +200,33 @@ static struct powerdomain mpu_34xx_pwrdm = {
200}; 200};
201 201
202/* No wkdeps or sleepdeps for 34xx core apparently */ 202/* No wkdeps or sleepdeps for 34xx core apparently */
203static struct powerdomain core_34xx_pwrdm = { 203static struct powerdomain core_34xx_pre_es3_1_pwrdm = {
204 .name = "core_pwrdm", 204 .name = "core_pwrdm",
205 .prcm_offs = CORE_MOD, 205 .prcm_offs = CORE_MOD,
206 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 206 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
207 CHIP_IS_OMAP3430ES2 |
208 CHIP_IS_OMAP3430ES3_0),
209 .pwrsts = PWRSTS_OFF_RET_ON,
210 .dep_bit = OMAP3430_EN_CORE_SHIFT,
211 .banks = 2,
212 .pwrsts_mem_ret = {
213 [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
214 [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
215 },
216 .pwrsts_mem_on = {
217 [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
218 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
219 },
220};
221
222/* No wkdeps or sleepdeps for 34xx core apparently */
223static struct powerdomain core_34xx_es3_1_pwrdm = {
224 .name = "core_pwrdm",
225 .prcm_offs = CORE_MOD,
226 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES3_1),
207 .pwrsts = PWRSTS_OFF_RET_ON, 227 .pwrsts = PWRSTS_OFF_RET_ON,
208 .dep_bit = OMAP3430_EN_CORE_SHIFT, 228 .dep_bit = OMAP3430_EN_CORE_SHIFT,
229 .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
209 .banks = 2, 230 .banks = 2,
210 .pwrsts_mem_ret = { 231 .pwrsts_mem_ret = {
211 [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ 232 [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
@@ -236,14 +257,19 @@ static struct powerdomain dss_pwrdm = {
236 }, 257 },
237}; 258};
238 259
260/*
261 * Although the 34XX TRM Rev K Table 4-371 notes that retention is a
262 * possible SGX powerstate, the SGX device itself does not support
263 * retention.
264 */
239static struct powerdomain sgx_pwrdm = { 265static struct powerdomain sgx_pwrdm = {
240 .name = "sgx_pwrdm", 266 .name = "sgx_pwrdm",
241 .prcm_offs = OMAP3430ES2_SGX_MOD, 267 .prcm_offs = OMAP3430ES2_SGX_MOD,
242 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), 268 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
243 .wkdep_srcs = gfx_sgx_wkdeps, 269 .wkdep_srcs = gfx_sgx_wkdeps,
244 .sleepdep_srcs = cam_gfx_sleepdeps, 270 .sleepdep_srcs = cam_gfx_sleepdeps,
245 /* XXX This is accurate for 3430 SGX, but what about GFX? */ 271 /* XXX This is accurate for 3430 SGX, but what about GFX? */
246 .pwrsts = PWRSTS_OFF_RET_ON, 272 .pwrsts = PWRSTS_OFF_ON,
247 .pwrsts_logic_ret = PWRDM_POWER_RET, 273 .pwrsts_logic_ret = PWRDM_POWER_RET,
248 .banks = 1, 274 .banks = 1,
249 .pwrsts_mem_ret = { 275 .pwrsts_mem_ret = {
@@ -307,11 +333,12 @@ static struct powerdomain neon_pwrdm = {
307static struct powerdomain usbhost_pwrdm = { 333static struct powerdomain usbhost_pwrdm = {
308 .name = "usbhost_pwrdm", 334 .name = "usbhost_pwrdm",
309 .prcm_offs = OMAP3430ES2_USBHOST_MOD, 335 .prcm_offs = OMAP3430ES2_USBHOST_MOD,
310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2), 336 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
311 .wkdep_srcs = per_usbhost_wkdeps, 337 .wkdep_srcs = per_usbhost_wkdeps,
312 .sleepdep_srcs = dss_per_usbhost_sleepdeps, 338 .sleepdep_srcs = dss_per_usbhost_sleepdeps,
313 .pwrsts = PWRSTS_OFF_RET_ON, 339 .pwrsts = PWRSTS_OFF_RET_ON,
314 .pwrsts_logic_ret = PWRDM_POWER_RET, 340 .pwrsts_logic_ret = PWRDM_POWER_RET,
341 .flags = PWRDM_HAS_HDWR_SAR, /* for USBHOST ctrlr only */
315 .banks = 1, 342 .banks = 1,
316 .pwrsts_mem_ret = { 343 .pwrsts_mem_ret = {
317 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 344 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */
@@ -321,6 +348,37 @@ static struct powerdomain usbhost_pwrdm = {
321 }, 348 },
322}; 349};
323 350
351static struct powerdomain dpll1_pwrdm = {
352 .name = "dpll1_pwrdm",
353 .prcm_offs = MPU_MOD,
354 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
355};
356
357static struct powerdomain dpll2_pwrdm = {
358 .name = "dpll2_pwrdm",
359 .prcm_offs = OMAP3430_IVA2_MOD,
360 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
361};
362
363static struct powerdomain dpll3_pwrdm = {
364 .name = "dpll3_pwrdm",
365 .prcm_offs = PLL_MOD,
366 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
367};
368
369static struct powerdomain dpll4_pwrdm = {
370 .name = "dpll4_pwrdm",
371 .prcm_offs = PLL_MOD,
372 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
373};
374
375static struct powerdomain dpll5_pwrdm = {
376 .name = "dpll5_pwrdm",
377 .prcm_offs = PLL_MOD,
378 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
379};
380
381
324#endif /* CONFIG_ARCH_OMAP34XX */ 382#endif /* CONFIG_ARCH_OMAP34XX */
325 383
326 384
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 4a32822ff3fc..812d50ee495d 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -113,33 +113,58 @@
113#define OMAP2430_EN_USBHS (1 << 6) 113#define OMAP2430_EN_USBHS (1 << 6)
114 114
115/* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */ 115/* CM_IDLEST1_CORE, PM_WKST1_CORE shared bits */
116#define OMAP2420_ST_MMC (1 << 26) 116#define OMAP2420_ST_MMC_SHIFT 26
117#define OMAP24XX_ST_UART2 (1 << 22) 117#define OMAP2420_ST_MMC_MASK (1 << 26)
118#define OMAP24XX_ST_UART1 (1 << 21) 118#define OMAP24XX_ST_UART2_SHIFT 22
119#define OMAP24XX_ST_MCSPI2 (1 << 18) 119#define OMAP24XX_ST_UART2_MASK (1 << 22)
120#define OMAP24XX_ST_MCSPI1 (1 << 17) 120#define OMAP24XX_ST_UART1_SHIFT 21
121#define OMAP24XX_ST_GPT12 (1 << 14) 121#define OMAP24XX_ST_UART1_MASK (1 << 21)
122#define OMAP24XX_ST_GPT11 (1 << 13) 122#define OMAP24XX_ST_MCSPI2_SHIFT 18
123#define OMAP24XX_ST_GPT10 (1 << 12) 123#define OMAP24XX_ST_MCSPI2_MASK (1 << 18)
124#define OMAP24XX_ST_GPT9 (1 << 11) 124#define OMAP24XX_ST_MCSPI1_SHIFT 17
125#define OMAP24XX_ST_GPT8 (1 << 10) 125#define OMAP24XX_ST_MCSPI1_MASK (1 << 17)
126#define OMAP24XX_ST_GPT7 (1 << 9) 126#define OMAP24XX_ST_GPT12_SHIFT 14
127#define OMAP24XX_ST_GPT6 (1 << 8) 127#define OMAP24XX_ST_GPT12_MASK (1 << 14)
128#define OMAP24XX_ST_GPT5 (1 << 7) 128#define OMAP24XX_ST_GPT11_SHIFT 13
129#define OMAP24XX_ST_GPT4 (1 << 6) 129#define OMAP24XX_ST_GPT11_MASK (1 << 13)
130#define OMAP24XX_ST_GPT3 (1 << 5) 130#define OMAP24XX_ST_GPT10_SHIFT 12
131#define OMAP24XX_ST_GPT2 (1 << 4) 131#define OMAP24XX_ST_GPT10_MASK (1 << 12)
132#define OMAP2420_ST_VLYNQ (1 << 3) 132#define OMAP24XX_ST_GPT9_SHIFT 11
133#define OMAP24XX_ST_GPT9_MASK (1 << 11)
134#define OMAP24XX_ST_GPT8_SHIFT 10
135#define OMAP24XX_ST_GPT8_MASK (1 << 10)
136#define OMAP24XX_ST_GPT7_SHIFT 9
137#define OMAP24XX_ST_GPT7_MASK (1 << 9)
138#define OMAP24XX_ST_GPT6_SHIFT 8
139#define OMAP24XX_ST_GPT6_MASK (1 << 8)
140#define OMAP24XX_ST_GPT5_SHIFT 7
141#define OMAP24XX_ST_GPT5_MASK (1 << 7)
142#define OMAP24XX_ST_GPT4_SHIFT 6
143#define OMAP24XX_ST_GPT4_MASK (1 << 6)
144#define OMAP24XX_ST_GPT3_SHIFT 5
145#define OMAP24XX_ST_GPT3_MASK (1 << 5)
146#define OMAP24XX_ST_GPT2_SHIFT 4
147#define OMAP24XX_ST_GPT2_MASK (1 << 4)
148#define OMAP2420_ST_VLYNQ_SHIFT 3
149#define OMAP2420_ST_VLYNQ_MASK (1 << 3)
133 150
134/* CM_IDLEST2_CORE, PM_WKST2_CORE shared bits */ 151/* CM_IDLEST2_CORE, PM_WKST2_CORE shared bits */
135#define OMAP2430_ST_MDM_INTC (1 << 11) 152#define OMAP2430_ST_MDM_INTC_SHIFT 11
136#define OMAP2430_ST_GPIO5 (1 << 10) 153#define OMAP2430_ST_MDM_INTC_MASK (1 << 11)
137#define OMAP2430_ST_MCSPI3 (1 << 9) 154#define OMAP2430_ST_GPIO5_SHIFT 10
138#define OMAP2430_ST_MMCHS2 (1 << 8) 155#define OMAP2430_ST_GPIO5_MASK (1 << 10)
139#define OMAP2430_ST_MMCHS1 (1 << 7) 156#define OMAP2430_ST_MCSPI3_SHIFT 9
140#define OMAP2430_ST_USBHS (1 << 6) 157#define OMAP2430_ST_MCSPI3_MASK (1 << 9)
141#define OMAP24XX_ST_UART3 (1 << 2) 158#define OMAP2430_ST_MMCHS2_SHIFT 8
142#define OMAP24XX_ST_USB (1 << 0) 159#define OMAP2430_ST_MMCHS2_MASK (1 << 8)
160#define OMAP2430_ST_MMCHS1_SHIFT 7
161#define OMAP2430_ST_MMCHS1_MASK (1 << 7)
162#define OMAP2430_ST_USBHS_SHIFT 6
163#define OMAP2430_ST_USBHS_MASK (1 << 6)
164#define OMAP24XX_ST_UART3_SHIFT 2
165#define OMAP24XX_ST_UART3_MASK (1 << 2)
166#define OMAP24XX_ST_USB_SHIFT 0
167#define OMAP24XX_ST_USB_MASK (1 << 0)
143 168
144/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ 169/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
145#define OMAP24XX_EN_GPIOS_SHIFT 2 170#define OMAP24XX_EN_GPIOS_SHIFT 2
@@ -148,11 +173,13 @@
148#define OMAP24XX_EN_GPT1 (1 << 0) 173#define OMAP24XX_EN_GPT1 (1 << 0)
149 174
150/* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ 175/* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */
151#define OMAP24XX_ST_GPIOS (1 << 2) 176#define OMAP24XX_ST_GPIOS_SHIFT (1 << 2)
152#define OMAP24XX_ST_GPT1 (1 << 0) 177#define OMAP24XX_ST_GPIOS_MASK 2
178#define OMAP24XX_ST_GPT1_SHIFT (1 << 0)
179#define OMAP24XX_ST_GPT1_MASK 0
153 180
154/* CM_IDLEST_MDM and PM_WKST_MDM shared bits */ 181/* CM_IDLEST_MDM and PM_WKST_MDM shared bits */
155#define OMAP2430_ST_MDM (1 << 0) 182#define OMAP2430_ST_MDM_SHIFT (1 << 0)
156 183
157 184
158/* 3430 register bits shared between CM & PRM registers */ 185/* 3430 register bits shared between CM & PRM registers */
@@ -205,24 +232,46 @@
205#define OMAP3430_EN_HSOTGUSB_SHIFT 4 232#define OMAP3430_EN_HSOTGUSB_SHIFT 4
206 233
207/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ 234/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */
208#define OMAP3430_ST_MMC2 (1 << 25) 235#define OMAP3430_ST_MMC2_SHIFT 25
209#define OMAP3430_ST_MMC1 (1 << 24) 236#define OMAP3430_ST_MMC2_MASK (1 << 25)
210#define OMAP3430_ST_MCSPI4 (1 << 21) 237#define OMAP3430_ST_MMC1_SHIFT 24
211#define OMAP3430_ST_MCSPI3 (1 << 20) 238#define OMAP3430_ST_MMC1_MASK (1 << 24)
212#define OMAP3430_ST_MCSPI2 (1 << 19) 239#define OMAP3430_ST_MCSPI4_SHIFT 21
213#define OMAP3430_ST_MCSPI1 (1 << 18) 240#define OMAP3430_ST_MCSPI4_MASK (1 << 21)
214#define OMAP3430_ST_I2C3 (1 << 17) 241#define OMAP3430_ST_MCSPI3_SHIFT 20
215#define OMAP3430_ST_I2C2 (1 << 16) 242#define OMAP3430_ST_MCSPI3_MASK (1 << 20)
216#define OMAP3430_ST_I2C1 (1 << 15) 243#define OMAP3430_ST_MCSPI2_SHIFT 19
217#define OMAP3430_ST_UART2 (1 << 14) 244#define OMAP3430_ST_MCSPI2_MASK (1 << 19)
218#define OMAP3430_ST_UART1 (1 << 13) 245#define OMAP3430_ST_MCSPI1_SHIFT 18
219#define OMAP3430_ST_GPT11 (1 << 12) 246#define OMAP3430_ST_MCSPI1_MASK (1 << 18)
220#define OMAP3430_ST_GPT10 (1 << 11) 247#define OMAP3430_ST_I2C3_SHIFT 17
221#define OMAP3430_ST_MCBSP5 (1 << 10) 248#define OMAP3430_ST_I2C3_MASK (1 << 17)
222#define OMAP3430_ST_MCBSP1 (1 << 9) 249#define OMAP3430_ST_I2C2_SHIFT 16
223#define OMAP3430_ST_FSHOSTUSB (1 << 5) 250#define OMAP3430_ST_I2C2_MASK (1 << 16)
224#define OMAP3430_ST_HSOTGUSB (1 << 4) 251#define OMAP3430_ST_I2C1_SHIFT 15
225#define OMAP3430_ST_D2D (1 << 3) 252#define OMAP3430_ST_I2C1_MASK (1 << 15)
253#define OMAP3430_ST_UART2_SHIFT 14
254#define OMAP3430_ST_UART2_MASK (1 << 14)
255#define OMAP3430_ST_UART1_SHIFT 13
256#define OMAP3430_ST_UART1_MASK (1 << 13)
257#define OMAP3430_ST_GPT11_SHIFT 12
258#define OMAP3430_ST_GPT11_MASK (1 << 12)
259#define OMAP3430_ST_GPT10_SHIFT 11
260#define OMAP3430_ST_GPT10_MASK (1 << 11)
261#define OMAP3430_ST_MCBSP5_SHIFT 10
262#define OMAP3430_ST_MCBSP5_MASK (1 << 10)
263#define OMAP3430_ST_MCBSP1_SHIFT 9
264#define OMAP3430_ST_MCBSP1_MASK (1 << 9)
265#define OMAP3430ES1_ST_FSHOSTUSB_SHIFT 5
266#define OMAP3430ES1_ST_FSHOSTUSB_MASK (1 << 5)
267#define OMAP3430ES1_ST_HSOTGUSB_SHIFT 4
268#define OMAP3430ES1_ST_HSOTGUSB_MASK (1 << 4)
269#define OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT 5
270#define OMAP3430ES2_ST_HSOTGUSB_IDLE_MASK (1 << 5)
271#define OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT 4
272#define OMAP3430ES2_ST_HSOTGUSB_STDBY_MASK (1 << 4)
273#define OMAP3430_ST_D2D_SHIFT 3
274#define OMAP3430_ST_D2D_MASK (1 << 3)
226 275
227/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */ 276/* CM_FCLKEN_WKUP, CM_ICLKEN_WKUP, PM_WKEN_WKUP shared bits */
228#define OMAP3430_EN_GPIO1 (1 << 3) 277#define OMAP3430_EN_GPIO1 (1 << 3)
@@ -241,11 +290,16 @@
241#define OMAP3430_EN_GPT12_SHIFT 1 290#define OMAP3430_EN_GPT12_SHIFT 1
242 291
243/* CM_IDLEST_WKUP, PM_WKST_WKUP shared bits */ 292/* CM_IDLEST_WKUP, PM_WKST_WKUP shared bits */
244#define OMAP3430_ST_SR2 (1 << 7) 293#define OMAP3430_ST_SR2_SHIFT 7
245#define OMAP3430_ST_SR1 (1 << 6) 294#define OMAP3430_ST_SR2_MASK (1 << 7)
246#define OMAP3430_ST_GPIO1 (1 << 3) 295#define OMAP3430_ST_SR1_SHIFT 6
247#define OMAP3430_ST_GPT12 (1 << 1) 296#define OMAP3430_ST_SR1_MASK (1 << 6)
248#define OMAP3430_ST_GPT1 (1 << 0) 297#define OMAP3430_ST_GPIO1_SHIFT 3
298#define OMAP3430_ST_GPIO1_MASK (1 << 3)
299#define OMAP3430_ST_GPT12_SHIFT 1
300#define OMAP3430_ST_GPT12_MASK (1 << 1)
301#define OMAP3430_ST_GPT1_SHIFT 0
302#define OMAP3430_ST_GPT1_MASK (1 << 0)
249 303
250/* 304/*
251 * CM_SLEEPDEP_GFX, CM_SLEEPDEP_DSS, CM_SLEEPDEP_CAM, 305 * CM_SLEEPDEP_GFX, CM_SLEEPDEP_DSS, CM_SLEEPDEP_CAM,
@@ -296,20 +350,34 @@
296#define OMAP3430_EN_MCBSP2_SHIFT 0 350#define OMAP3430_EN_MCBSP2_SHIFT 0
297 351
298/* CM_IDLEST_PER, PM_WKST_PER shared bits */ 352/* CM_IDLEST_PER, PM_WKST_PER shared bits */
299#define OMAP3430_ST_GPIO6 (1 << 17) 353#define OMAP3430_ST_GPIO6_SHIFT 17
300#define OMAP3430_ST_GPIO5 (1 << 16) 354#define OMAP3430_ST_GPIO6_MASK (1 << 17)
301#define OMAP3430_ST_GPIO4 (1 << 15) 355#define OMAP3430_ST_GPIO5_SHIFT 16
302#define OMAP3430_ST_GPIO3 (1 << 14) 356#define OMAP3430_ST_GPIO5_MASK (1 << 16)
303#define OMAP3430_ST_GPIO2 (1 << 13) 357#define OMAP3430_ST_GPIO4_SHIFT 15
304#define OMAP3430_ST_UART3 (1 << 11) 358#define OMAP3430_ST_GPIO4_MASK (1 << 15)
305#define OMAP3430_ST_GPT9 (1 << 10) 359#define OMAP3430_ST_GPIO3_SHIFT 14
306#define OMAP3430_ST_GPT8 (1 << 9) 360#define OMAP3430_ST_GPIO3_MASK (1 << 14)
307#define OMAP3430_ST_GPT7 (1 << 8) 361#define OMAP3430_ST_GPIO2_SHIFT 13
308#define OMAP3430_ST_GPT6 (1 << 7) 362#define OMAP3430_ST_GPIO2_MASK (1 << 13)
309#define OMAP3430_ST_GPT5 (1 << 6) 363#define OMAP3430_ST_UART3_SHIFT 11
310#define OMAP3430_ST_GPT4 (1 << 5) 364#define OMAP3430_ST_UART3_MASK (1 << 11)
311#define OMAP3430_ST_GPT3 (1 << 4) 365#define OMAP3430_ST_GPT9_SHIFT 10
312#define OMAP3430_ST_GPT2 (1 << 3) 366#define OMAP3430_ST_GPT9_MASK (1 << 10)
367#define OMAP3430_ST_GPT8_SHIFT 9
368#define OMAP3430_ST_GPT8_MASK (1 << 9)
369#define OMAP3430_ST_GPT7_SHIFT 8
370#define OMAP3430_ST_GPT7_MASK (1 << 8)
371#define OMAP3430_ST_GPT6_SHIFT 7
372#define OMAP3430_ST_GPT6_MASK (1 << 7)
373#define OMAP3430_ST_GPT5_SHIFT 6
374#define OMAP3430_ST_GPT5_MASK (1 << 6)
375#define OMAP3430_ST_GPT4_SHIFT 5
376#define OMAP3430_ST_GPT4_MASK (1 << 5)
377#define OMAP3430_ST_GPT3_SHIFT 4
378#define OMAP3430_ST_GPT3_MASK (1 << 4)
379#define OMAP3430_ST_GPT2_SHIFT 3
380#define OMAP3430_ST_GPT2_MASK (1 << 3)
313 381
314/* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */ 382/* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */
315#define OMAP3430_EN_CORE_SHIFT 0 383#define OMAP3430_EN_CORE_SHIFT 0
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h
index 5b5ecfe6c999..c6a7940f4287 100644
--- a/arch/arm/mach-omap2/prm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-34xx.h
@@ -366,6 +366,7 @@
366 366
367/* PM_WKEN_WKUP specific bits */ 367/* PM_WKEN_WKUP specific bits */
368#define OMAP3430_EN_IO (1 << 8) 368#define OMAP3430_EN_IO (1 << 8)
369#define OMAP3430_EN_GPIO1 (1 << 3)
369 370
370/* PM_MPUGRPSEL_WKUP specific bits */ 371/* PM_MPUGRPSEL_WKUP specific bits */
371 372
@@ -452,6 +453,14 @@
452#define OMAP3430_CMDRA0_MASK (0xff << 0) 453#define OMAP3430_CMDRA0_MASK (0xff << 0)
453 454
454/* PRM_VC_CMD_VAL_0 specific bits */ 455/* PRM_VC_CMD_VAL_0 specific bits */
456#define OMAP3430_VC_CMD_ON_SHIFT 24
457#define OMAP3430_VC_CMD_ON_MASK (0xFF << 24)
458#define OMAP3430_VC_CMD_ONLP_SHIFT 16
459#define OMAP3430_VC_CMD_ONLP_MASK (0xFF << 16)
460#define OMAP3430_VC_CMD_RET_SHIFT 8
461#define OMAP3430_VC_CMD_RET_MASK (0xFF << 8)
462#define OMAP3430_VC_CMD_OFF_SHIFT 0
463#define OMAP3430_VC_CMD_OFF_MASK (0xFF << 0)
455 464
456/* PRM_VC_CMD_VAL_1 specific bits */ 465/* PRM_VC_CMD_VAL_1 specific bits */
457 466
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index e4dc4b17881d..826d326b8062 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -141,6 +141,19 @@
141#define PM_PWSTCTRL 0x00e0 141#define PM_PWSTCTRL 0x00e0
142#define PM_PWSTST 0x00e4 142#define PM_PWSTST 0x00e4
143 143
144/* Omap2 specific registers */
145#define OMAP24XX_PM_WKEN2 0x00a4
146#define OMAP24XX_PM_WKST2 0x00b4
147
148#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
149#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
150#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
151#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
152
153/* Omap3 specific registers */
154#define OMAP3430ES2_PM_WKEN3 0x00f0
155#define OMAP3430ES2_PM_WKST3 0x00b8
156
144#define OMAP3430_PM_MPUGRPSEL 0x00a4 157#define OMAP3430_PM_MPUGRPSEL 0x00a4
145#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL 158#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
146 159
@@ -153,16 +166,6 @@
153#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc 166#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
154 167
155 168
156/* Architecture-specific registers */
157
158#define OMAP24XX_PM_WKEN2 0x00a4
159#define OMAP24XX_PM_WKST2 0x00b4
160
161#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
162#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
163#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
164#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
165
166#ifndef __ASSEMBLER__ 169#ifndef __ASSEMBLER__
167 170
168/* Power/reset management domain register get/set */ 171/* Power/reset management domain register get/set */
@@ -228,7 +231,6 @@ static inline u32 prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
228#define OMAP_RSTTIME1_SHIFT 0 231#define OMAP_RSTTIME1_SHIFT 0
229#define OMAP_RSTTIME1_MASK (0xff << 0) 232#define OMAP_RSTTIME1_MASK (0xff << 0)
230 233
231
232/* PRM_RSTCTRL */ 234/* PRM_RSTCTRL */
233/* Named RM_RSTCTRL_WKUP on the 24xx */ 235/* Named RM_RSTCTRL_WKUP on the 24xx */
234/* 2420 calls RST_DPLL3 'RST_DPLL' */ 236/* 2420 calls RST_DPLL3 'RST_DPLL' */
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
new file mode 100644
index 000000000000..2a30060cb4b7
--- /dev/null
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -0,0 +1,93 @@
1/*
2 * SMS/SDRC (SDRAM controller) common code for OMAP2/3
3 *
4 * Copyright (C) 2005, 2008 Texas Instruments Inc.
5 * Copyright (C) 2005, 2008 Nokia Corporation
6 *
7 * Tony Lindgren <tony@atomide.com>
8 * Paul Walmsley
9 * Richard Woodruff <r-woodruff2@ti.com>
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#undef DEBUG
16
17#include <linux/module.h>
18#include <linux/kernel.h>
19#include <linux/device.h>
20#include <linux/list.h>
21#include <linux/errno.h>
22#include <linux/delay.h>
23#include <linux/clk.h>
24#include <linux/io.h>
25
26#include <mach/common.h>
27#include <mach/clock.h>
28#include <mach/sram.h>
29
30#include "prm.h"
31
32#include <mach/sdrc.h>
33#include "sdrc.h"
34
35static struct omap_sdrc_params *sdrc_init_params;
36
37void __iomem *omap2_sdrc_base;
38void __iomem *omap2_sms_base;
39
40
41/**
42 * omap2_sdrc_get_params - return SDRC register values for a given clock rate
43 * @r: SDRC clock rate (in Hz)
44 *
45 * Return pre-calculated values for the SDRC_ACTIM_CTRLA,
46 * SDRC_ACTIM_CTRLB, SDRC_RFR_CTRL, and SDRC_MR registers, for a given
47 * SDRC clock rate 'r'. These parameters control various timing
48 * delays in the SDRAM controller that are expressed in terms of the
49 * number of SDRC clock cycles to wait; hence the clock rate
50 * dependency. Note that sdrc_init_params must be sorted rate
51 * descending. Also assumes that both chip-selects use the same
52 * timing parameters. Returns a struct omap_sdrc_params * upon
53 * success, or NULL upon failure.
54 */
55struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r)
56{
57 struct omap_sdrc_params *sp;
58
59 sp = sdrc_init_params;
60
61 while (sp->rate != r)
62 sp++;
63
64 if (!sp->rate)
65 return NULL;
66
67 return sp;
68}
69
70
71void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals)
72{
73 omap2_sdrc_base = omap2_globals->sdrc;
74 omap2_sms_base = omap2_globals->sms;
75}
76
77/* turn on smart idle modes for SDRAM scheduler and controller */
78void __init omap2_sdrc_init(struct omap_sdrc_params *sp)
79{
80 u32 l;
81
82 l = sms_read_reg(SMS_SYSCONFIG);
83 l &= ~(0x3 << 3);
84 l |= (0x2 << 3);
85 sms_write_reg(l, SMS_SYSCONFIG);
86
87 l = sdrc_read_reg(SDRC_SYSCONFIG);
88 l &= ~(0x3 << 3);
89 l |= (0x2 << 3);
90 sdrc_write_reg(l, SDRC_SYSCONFIG);
91
92 sdrc_init_params = sp;
93}
diff --git a/arch/arm/mach-omap2/memory.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 882c70224292..0afdad5ae9fb 100644
--- a/arch/arm/mach-omap2/memory.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -1,13 +1,14 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/memory.c 2 * linux/arch/arm/mach-omap2/sdrc2xxx.c
3 * 3 *
4 * Memory timing related functions for OMAP24XX 4 * SDRAM timing related functions for OMAP2xxx
5 * 5 *
6 * Copyright (C) 2005 Texas Instruments Inc. 6 * Copyright (C) 2005, 2008 Texas Instruments Inc.
7 * Richard Woodruff <r-woodruff2@ti.com> 7 * Copyright (C) 2005, 2008 Nokia Corporation
8 * 8 *
9 * Copyright (C) 2005 Nokia Corporation
10 * Tony Lindgren <tony@atomide.com> 9 * Tony Lindgren <tony@atomide.com>
10 * Paul Walmsley
11 * Richard Woodruff <r-woodruff2@ti.com>
11 * 12 *
12 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 14 * it under the terms of the GNU General Public License version 2 as
@@ -28,27 +29,31 @@
28#include <mach/sram.h> 29#include <mach/sram.h>
29 30
30#include "prm.h" 31#include "prm.h"
31 32#include "clock.h"
32#include "memory.h" 33#include <mach/sdrc.h>
33#include "sdrc.h" 34#include "sdrc.h"
34 35
35void __iomem *omap2_sdrc_base; 36/* Memory timing, DLL mode flags */
36void __iomem *omap2_sms_base; 37#define M_DDR 1
38#define M_LOCK_CTRL (1 << 2)
39#define M_UNLOCK 0
40#define M_LOCK 1
41
37 42
38static struct memory_timings mem_timings; 43static struct memory_timings mem_timings;
39static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2; 44static u32 curr_perf_level = CORE_CLK_SRC_DPLL_X2;
40 45
41u32 omap2_memory_get_slow_dll_ctrl(void) 46static u32 omap2xxx_sdrc_get_slow_dll_ctrl(void)
42{ 47{
43 return mem_timings.slow_dll_ctrl; 48 return mem_timings.slow_dll_ctrl;
44} 49}
45 50
46u32 omap2_memory_get_fast_dll_ctrl(void) 51static u32 omap2xxx_sdrc_get_fast_dll_ctrl(void)
47{ 52{
48 return mem_timings.fast_dll_ctrl; 53 return mem_timings.fast_dll_ctrl;
49} 54}
50 55
51u32 omap2_memory_get_type(void) 56static u32 omap2xxx_sdrc_get_type(void)
52{ 57{
53 return mem_timings.m_type; 58 return mem_timings.m_type;
54} 59}
@@ -57,7 +62,7 @@ u32 omap2_memory_get_type(void)
57 * Check the DLL lock state, and return tue if running in unlock mode. 62 * Check the DLL lock state, and return tue if running in unlock mode.
58 * This is needed to compensate for the shifted DLL value in unlock mode. 63 * This is needed to compensate for the shifted DLL value in unlock mode.
59 */ 64 */
60u32 omap2_dll_force_needed(void) 65u32 omap2xxx_sdrc_dll_is_unlocked(void)
61{ 66{
62 /* dlla and dllb are a set */ 67 /* dlla and dllb are a set */
63 u32 dll_state = sdrc_read_reg(SDRC_DLLA_CTRL); 68 u32 dll_state = sdrc_read_reg(SDRC_DLLA_CTRL);
@@ -72,8 +77,10 @@ u32 omap2_dll_force_needed(void)
72 * 'level' is the value to store to CM_CLKSEL2_PLL.CORE_CLK_SRC. 77 * 'level' is the value to store to CM_CLKSEL2_PLL.CORE_CLK_SRC.
73 * Practical values are CORE_CLK_SRC_DPLL (for CORE_CLK = DPLL_CLK) or 78 * Practical values are CORE_CLK_SRC_DPLL (for CORE_CLK = DPLL_CLK) or
74 * CORE_CLK_SRC_DPLL_X2 (for CORE_CLK = * DPLL_CLK * 2) 79 * CORE_CLK_SRC_DPLL_X2 (for CORE_CLK = * DPLL_CLK * 2)
80 *
81 * Used by the clock framework during CORE DPLL changes
75 */ 82 */
76u32 omap2_reprogram_sdrc(u32 level, u32 force) 83u32 omap2xxx_sdrc_reprogram(u32 level, u32 force)
77{ 84{
78 u32 dll_ctrl, m_type; 85 u32 dll_ctrl, m_type;
79 u32 prev = curr_perf_level; 86 u32 prev = curr_perf_level;
@@ -82,15 +89,14 @@ u32 omap2_reprogram_sdrc(u32 level, u32 force)
82 if ((curr_perf_level == level) && !force) 89 if ((curr_perf_level == level) && !force)
83 return prev; 90 return prev;
84 91
85 if (level == CORE_CLK_SRC_DPLL) { 92 if (level == CORE_CLK_SRC_DPLL)
86 dll_ctrl = omap2_memory_get_slow_dll_ctrl(); 93 dll_ctrl = omap2xxx_sdrc_get_slow_dll_ctrl();
87 } else if (level == CORE_CLK_SRC_DPLL_X2) { 94 else if (level == CORE_CLK_SRC_DPLL_X2)
88 dll_ctrl = omap2_memory_get_fast_dll_ctrl(); 95 dll_ctrl = omap2xxx_sdrc_get_fast_dll_ctrl();
89 } else { 96 else
90 return prev; 97 return prev;
91 }
92 98
93 m_type = omap2_memory_get_type(); 99 m_type = omap2xxx_sdrc_get_type();
94 100
95 local_irq_save(flags); 101 local_irq_save(flags);
96 __raw_writel(0xffff, OMAP24XX_PRCM_VOLTSETUP); 102 __raw_writel(0xffff, OMAP24XX_PRCM_VOLTSETUP);
@@ -101,23 +107,14 @@ u32 omap2_reprogram_sdrc(u32 level, u32 force)
101 return prev; 107 return prev;
102} 108}
103 109
104#if !defined(CONFIG_ARCH_OMAP2) 110/* Used by the clock framework during CORE DPLL changes */
105void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 111void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode)
106 u32 base_cs, u32 force_unlock)
107{
108}
109void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
110 u32 mem_type)
111{
112}
113#endif
114
115void omap2_init_memory_params(u32 force_lock_to_unlock_mode)
116{ 112{
117 unsigned long dll_cnt; 113 unsigned long dll_cnt;
118 u32 fast_dll = 0; 114 u32 fast_dll = 0;
119 115
120 mem_timings.m_type = !((sdrc_read_reg(SDRC_MR_0) & 0x3) == 0x1); /* DDR = 1, SDR = 0 */ 116 /* DDR = 1, SDR = 0 */
117 mem_timings.m_type = !((sdrc_read_reg(SDRC_MR_0) & 0x3) == 0x1);
121 118
122 /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others. 119 /* 2422 es2.05 and beyond has a single SIP DDR instead of 2 like others.
123 * In the case of 2422, its ok to use CS1 instead of CS0. 120 * In the case of 2422, its ok to use CS1 instead of CS0.
@@ -164,28 +161,3 @@ void omap2_init_memory_params(u32 force_lock_to_unlock_mode)
164 /* 90 degree phase for anything below 133Mhz + disable DLL filter */ 161 /* 90 degree phase for anything below 133Mhz + disable DLL filter */
165 mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8)); 162 mem_timings.slow_dll_ctrl |= ((1 << 1) | (3 << 8));
166} 163}
167
168void __init omap2_set_globals_memory(struct omap_globals *omap2_globals)
169{
170 omap2_sdrc_base = omap2_globals->sdrc;
171 omap2_sms_base = omap2_globals->sms;
172}
173
174/* turn on smart idle modes for SDRAM scheduler and controller */
175void __init omap2_init_memory(void)
176{
177 u32 l;
178
179 if (!cpu_is_omap2420())
180 return;
181
182 l = sms_read_reg(SMS_SYSCONFIG);
183 l &= ~(0x3 << 3);
184 l |= (0x2 << 3);
185 sms_write_reg(l, SMS_SYSCONFIG);
186
187 l = sdrc_read_reg(SDRC_SYSCONFIG);
188 l &= ~(0x3 << 3);
189 l |= (0x2 << 3);
190 sdrc_write_reg(l, SDRC_SYSCONFIG);
191}
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
new file mode 100644
index 000000000000..fc74e913c415
--- /dev/null
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -0,0 +1,187 @@
1/*
2 * linux/arch/arm/mach-omap2/usb-musb.c
3 *
4 * This file will contain the board specific details for the
5 * MENTOR USB OTG controller on OMAP3430
6 *
7 * Copyright (C) 2007-2008 Texas Instruments
8 * Copyright (C) 2008 Nokia Corporation
9 * Author: Vikram Pandita
10 *
11 * Generalization by:
12 * Felipe Balbi <felipe.balbi@nokia.com>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/types.h>
20#include <linux/errno.h>
21#include <linux/delay.h>
22#include <linux/platform_device.h>
23#include <linux/clk.h>
24#include <linux/dma-mapping.h>
25#include <linux/io.h>
26
27#include <linux/usb/musb.h>
28
29#include <mach/hardware.h>
30#include <mach/irqs.h>
31#include <mach/pm.h>
32#include <mach/mux.h>
33#include <mach/usb.h>
34
35static struct resource musb_resources[] = {
36 [0] = { /* start and end set dynamically */
37 .flags = IORESOURCE_MEM,
38 },
39 [1] = { /* general IRQ */
40 .start = INT_243X_HS_USB_MC,
41 .flags = IORESOURCE_IRQ,
42 },
43 [2] = { /* DMA IRQ */
44 .start = INT_243X_HS_USB_DMA,
45 .flags = IORESOURCE_IRQ,
46 },
47};
48
49static int clk_on;
50
51static int musb_set_clock(struct clk *clk, int state)
52{
53 if (state) {
54 if (clk_on > 0)
55 return -ENODEV;
56
57 clk_enable(clk);
58 clk_on = 1;
59 } else {
60 if (clk_on == 0)
61 return -ENODEV;
62
63 clk_disable(clk);
64 clk_on = 0;
65 }
66
67 return 0;
68}
69
70static struct musb_hdrc_eps_bits musb_eps[] = {
71 { "ep1_tx", 10, },
72 { "ep1_rx", 10, },
73 { "ep2_tx", 9, },
74 { "ep2_rx", 9, },
75 { "ep3_tx", 3, },
76 { "ep3_rx", 3, },
77 { "ep4_tx", 3, },
78 { "ep4_rx", 3, },
79 { "ep5_tx", 3, },
80 { "ep5_rx", 3, },
81 { "ep6_tx", 3, },
82 { "ep6_rx", 3, },
83 { "ep7_tx", 3, },
84 { "ep7_rx", 3, },
85 { "ep8_tx", 2, },
86 { "ep8_rx", 2, },
87 { "ep9_tx", 2, },
88 { "ep9_rx", 2, },
89 { "ep10_tx", 2, },
90 { "ep10_rx", 2, },
91 { "ep11_tx", 2, },
92 { "ep11_rx", 2, },
93 { "ep12_tx", 2, },
94 { "ep12_rx", 2, },
95 { "ep13_tx", 2, },
96 { "ep13_rx", 2, },
97 { "ep14_tx", 2, },
98 { "ep14_rx", 2, },
99 { "ep15_tx", 2, },
100 { "ep15_rx", 2, },
101};
102
103static struct musb_hdrc_config musb_config = {
104 .multipoint = 1,
105 .dyn_fifo = 1,
106 .soft_con = 1,
107 .dma = 1,
108 .num_eps = 16,
109 .dma_channels = 7,
110 .dma_req_chan = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
111 .ram_bits = 12,
112 .eps_bits = musb_eps,
113};
114
115static struct musb_hdrc_platform_data musb_plat = {
116#ifdef CONFIG_USB_MUSB_OTG
117 .mode = MUSB_OTG,
118#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
119 .mode = MUSB_HOST,
120#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
121 .mode = MUSB_PERIPHERAL,
122#endif
123 /* .clock is set dynamically */
124 .set_clock = musb_set_clock,
125 .config = &musb_config,
126
127 /* REVISIT charge pump on TWL4030 can supply up to
128 * 100 mA ... but this value is board-specific, like
129 * "mode", and should be passed to usb_musb_init().
130 */
131 .power = 50, /* up to 100 mA */
132};
133
134static u64 musb_dmamask = DMA_32BIT_MASK;
135
136static struct platform_device musb_device = {
137 .name = "musb_hdrc",
138 .id = -1,
139 .dev = {
140 .dma_mask = &musb_dmamask,
141 .coherent_dma_mask = DMA_32BIT_MASK,
142 .platform_data = &musb_plat,
143 },
144 .num_resources = ARRAY_SIZE(musb_resources),
145 .resource = musb_resources,
146};
147
148#ifdef CONFIG_NOP_USB_XCEIV
149static u64 nop_xceiv_dmamask = DMA_32BIT_MASK;
150
151static struct platform_device nop_xceiv_device = {
152 .name = "nop_usb_xceiv",
153 .id = -1,
154 .dev = {
155 .dma_mask = &nop_xceiv_dmamask,
156 .coherent_dma_mask = DMA_32BIT_MASK,
157 .platform_data = NULL,
158 },
159};
160#endif
161
162void __init usb_musb_init(void)
163{
164 if (cpu_is_omap243x())
165 musb_resources[0].start = OMAP243X_HS_BASE;
166 else
167 musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
168 musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
169
170 /*
171 * REVISIT: This line can be removed once all the platforms using
172 * musb_core.c have been converted to use use clkdev.
173 */
174 musb_plat.clock = "ick";
175
176#ifdef CONFIG_NOP_USB_XCEIV
177 if (platform_device_register(&nop_xceiv_device) < 0) {
178 printk(KERN_ERR "Unable to register NOP-XCEIV device\n");
179 return;
180 }
181#endif
182
183 if (platform_device_register(&musb_device) < 0) {
184 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
185 return;
186 }
187}
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index f59a8d0e0824..2c7035d8dcbf 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -71,6 +71,7 @@ config MACH_WRT350N_V2
71 71
72config MACH_TS78XX 72config MACH_TS78XX
73 bool "Technologic Systems TS-78xx" 73 bool "Technologic Systems TS-78xx"
74 select PM
74 help 75 help
75 Say 'Y' here if you want your kernel to support the 76 Say 'Y' here if you want your kernel to support the
76 Technologic Systems TS-78xx platform. 77 Technologic Systems TS-78xx platform.
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 8a0e49d84256..68cc3efae567 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -31,6 +31,7 @@
31#include <plat/ehci-orion.h> 31#include <plat/ehci-orion.h>
32#include <plat/mv_xor.h> 32#include <plat/mv_xor.h>
33#include <plat/orion_nand.h> 33#include <plat/orion_nand.h>
34#include <plat/orion5x_wdt.h>
34#include <plat/time.h> 35#include <plat/time.h>
35#include "common.h" 36#include "common.h"
36 37
@@ -219,14 +220,17 @@ static struct platform_device orion5x_switch_device = {
219 220
220void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq) 221void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
221{ 222{
223 int i;
224
222 if (irq != NO_IRQ) { 225 if (irq != NO_IRQ) {
223 orion5x_switch_resources[0].start = irq; 226 orion5x_switch_resources[0].start = irq;
224 orion5x_switch_resources[0].end = irq; 227 orion5x_switch_resources[0].end = irq;
225 orion5x_switch_device.num_resources = 1; 228 orion5x_switch_device.num_resources = 1;
226 } 229 }
227 230
228 d->mii_bus = &orion5x_eth_shared.dev;
229 d->netdev = &orion5x_eth.dev; 231 d->netdev = &orion5x_eth.dev;
232 for (i = 0; i < d->nr_chips; i++)
233 d->chip[i].mii_bus = &orion5x_eth_shared.dev;
230 orion5x_switch_device.dev.platform_data = d; 234 orion5x_switch_device.dev.platform_data = d;
231 235
232 platform_device_register(&orion5x_switch_device); 236 platform_device_register(&orion5x_switch_device);
@@ -533,6 +537,29 @@ void __init orion5x_xor_init(void)
533 537
534 538
535/***************************************************************************** 539/*****************************************************************************
540 * Watchdog
541 ****************************************************************************/
542static struct orion5x_wdt_platform_data orion5x_wdt_data = {
543 .tclk = 0,
544};
545
546static struct platform_device orion5x_wdt_device = {
547 .name = "orion5x_wdt",
548 .id = -1,
549 .dev = {
550 .platform_data = &orion5x_wdt_data,
551 },
552 .num_resources = 0,
553};
554
555void __init orion5x_wdt_init(void)
556{
557 orion5x_wdt_data.tclk = orion5x_tclk;
558 platform_device_register(&orion5x_wdt_device);
559}
560
561
562/*****************************************************************************
536 * Time handling 563 * Time handling
537 ****************************************************************************/ 564 ****************************************************************************/
538int orion5x_tclk; 565int orion5x_tclk;
@@ -631,6 +658,11 @@ void __init orion5x_init(void)
631 printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n"); 658 printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
632 disable_hlt(); 659 disable_hlt();
633 } 660 }
661
662 /*
663 * Register watchdog driver
664 */
665 orion5x_wdt_init();
634} 666}
635 667
636/* 668/*
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 0722d6510df1..b31ca4cef365 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -76,7 +76,7 @@ static int __init dns323_dev_id(void)
76 76
77static int __init dns323_pci_init(void) 77static int __init dns323_pci_init(void)
78{ 78{
79 /* The 5182 doesn't really use it's PCI bus, and initialising PCI 79 /* The 5182 doesn't really use its PCI bus, and initialising PCI
80 * gets in the way of initialising the SATA controller. 80 * gets in the way of initialising the SATA controller.
81 */ 81 */
82 if (machine_is_dns323() && dns323_dev_id() != MV88F5182_DEV_ID) 82 if (machine_is_dns323() && dns323_dev_id() != MV88F5182_DEV_ID)
@@ -418,7 +418,7 @@ static void __init dns323_init(void)
418 orion5x_i2c_init(); 418 orion5x_i2c_init();
419 orion5x_uart0_init(); 419 orion5x_uart0_init();
420 420
421 /* The 5182 has it's SATA controller on-chip, and needs it's own little 421 /* The 5182 has its SATA controller on-chip, and needs its own little
422 * init routine. 422 * init routine.
423 */ 423 */
424 if (dns323_dev_id() == MV88F5182_DEV_ID) 424 if (dns323_dev_id() == MV88F5182_DEV_ID)
diff --git a/arch/arm/mach-orion5x/include/mach/system.h b/arch/arm/mach-orion5x/include/mach/system.h
index 08e430757890..9b8db1dcfa83 100644
--- a/arch/arm/mach-orion5x/include/mach/system.h
+++ b/arch/arm/mach-orion5x/include/mach/system.h
@@ -19,7 +19,7 @@ static inline void arch_idle(void)
19 cpu_do_idle(); 19 cpu_do_idle();
20} 20}
21 21
22static inline void arch_reset(char mode) 22static inline void arch_reset(char mode, const char *cmd)
23{ 23{
24 /* 24 /*
25 * Enable and issue soft reset 25 * Enable and issue soft reset
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index e0c43b8beb72..c9bf6b81a80d 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data lsmini_sata_data = {
186 186
187static void lsmini_power_off(void) 187static void lsmini_power_off(void)
188{ 188{
189 arch_reset(0); 189 arch_reset(0, NULL);
190} 190}
191 191
192 192
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index 15f53235ee30..9c1ca41730ba 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -94,7 +94,7 @@ static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = {
94 .duplex = DUPLEX_FULL, 94 .duplex = DUPLEX_FULL,
95}; 95};
96 96
97static struct dsa_platform_data rd88f5181l_fxo_switch_data = { 97static struct dsa_chip_data rd88f5181l_fxo_switch_chip_data = {
98 .port_names[0] = "lan2", 98 .port_names[0] = "lan2",
99 .port_names[1] = "lan1", 99 .port_names[1] = "lan1",
100 .port_names[2] = "wan", 100 .port_names[2] = "wan",
@@ -103,6 +103,11 @@ static struct dsa_platform_data rd88f5181l_fxo_switch_data = {
103 .port_names[7] = "lan3", 103 .port_names[7] = "lan3",
104}; 104};
105 105
106static struct dsa_platform_data rd88f5181l_fxo_switch_plat_data = {
107 .nr_chips = 1,
108 .chip = &rd88f5181l_fxo_switch_chip_data,
109};
110
106static void __init rd88f5181l_fxo_init(void) 111static void __init rd88f5181l_fxo_init(void)
107{ 112{
108 /* 113 /*
@@ -117,7 +122,7 @@ static void __init rd88f5181l_fxo_init(void)
117 */ 122 */
118 orion5x_ehci0_init(); 123 orion5x_ehci0_init();
119 orion5x_eth_init(&rd88f5181l_fxo_eth_data); 124 orion5x_eth_init(&rd88f5181l_fxo_eth_data);
120 orion5x_eth_switch_init(&rd88f5181l_fxo_switch_data, NO_IRQ); 125 orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
121 orion5x_uart0_init(); 126 orion5x_uart0_init();
122 127
123 orion5x_setup_dev_boot_win(RD88F5181L_FXO_NOR_BOOT_BASE, 128 orion5x_setup_dev_boot_win(RD88F5181L_FXO_NOR_BOOT_BASE,
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index 8ad3934399d4..ee1399ff0ced 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -95,7 +95,7 @@ static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = {
95 .duplex = DUPLEX_FULL, 95 .duplex = DUPLEX_FULL,
96}; 96};
97 97
98static struct dsa_platform_data rd88f5181l_ge_switch_data = { 98static struct dsa_chip_data rd88f5181l_ge_switch_chip_data = {
99 .port_names[0] = "lan2", 99 .port_names[0] = "lan2",
100 .port_names[1] = "lan1", 100 .port_names[1] = "lan1",
101 .port_names[2] = "wan", 101 .port_names[2] = "wan",
@@ -104,6 +104,11 @@ static struct dsa_platform_data rd88f5181l_ge_switch_data = {
104 .port_names[7] = "lan3", 104 .port_names[7] = "lan3",
105}; 105};
106 106
107static struct dsa_platform_data rd88f5181l_ge_switch_plat_data = {
108 .nr_chips = 1,
109 .chip = &rd88f5181l_ge_switch_chip_data,
110};
111
107static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = { 112static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = {
108 I2C_BOARD_INFO("ds1338", 0x68), 113 I2C_BOARD_INFO("ds1338", 0x68),
109}; 114};
@@ -122,7 +127,8 @@ static void __init rd88f5181l_ge_init(void)
122 */ 127 */
123 orion5x_ehci0_init(); 128 orion5x_ehci0_init();
124 orion5x_eth_init(&rd88f5181l_ge_eth_data); 129 orion5x_eth_init(&rd88f5181l_ge_eth_data);
125 orion5x_eth_switch_init(&rd88f5181l_ge_switch_data, gpio_to_irq(8)); 130 orion5x_eth_switch_init(&rd88f5181l_ge_switch_plat_data,
131 gpio_to_irq(8));
126 orion5x_i2c_init(); 132 orion5x_i2c_init();
127 orion5x_uart0_init(); 133 orion5x_uart0_init();
128 134
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 262e25e4dace..7737cf9a8f50 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -35,7 +35,7 @@ static struct mv643xx_eth_platform_data rd88f6183ap_ge_eth_data = {
35 .duplex = DUPLEX_FULL, 35 .duplex = DUPLEX_FULL,
36}; 36};
37 37
38static struct dsa_platform_data rd88f6183ap_ge_switch_data = { 38static struct dsa_chip_data rd88f6183ap_ge_switch_chip_data = {
39 .port_names[0] = "lan1", 39 .port_names[0] = "lan1",
40 .port_names[1] = "lan2", 40 .port_names[1] = "lan2",
41 .port_names[2] = "lan3", 41 .port_names[2] = "lan3",
@@ -44,6 +44,11 @@ static struct dsa_platform_data rd88f6183ap_ge_switch_data = {
44 .port_names[5] = "cpu", 44 .port_names[5] = "cpu",
45}; 45};
46 46
47static struct dsa_platform_data rd88f6183ap_ge_switch_plat_data = {
48 .nr_chips = 1,
49 .chip = &rd88f6183ap_ge_switch_chip_data,
50};
51
47static struct mtd_partition rd88f6183ap_ge_partitions[] = { 52static struct mtd_partition rd88f6183ap_ge_partitions[] = {
48 { 53 {
49 .name = "kernel", 54 .name = "kernel",
@@ -89,7 +94,8 @@ static void __init rd88f6183ap_ge_init(void)
89 */ 94 */
90 orion5x_ehci0_init(); 95 orion5x_ehci0_init();
91 orion5x_eth_init(&rd88f6183ap_ge_eth_data); 96 orion5x_eth_init(&rd88f6183ap_ge_eth_data);
92 orion5x_eth_switch_init(&rd88f6183ap_ge_switch_data, gpio_to_irq(3)); 97 orion5x_eth_switch_init(&rd88f6183ap_ge_switch_plat_data,
98 gpio_to_irq(3));
93 spi_register_board_info(rd88f6183ap_ge_spi_slave_info, 99 spi_register_board_info(rd88f6183ap_ge_spi_slave_info,
94 ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info)); 100 ARRAY_SIZE(rd88f6183ap_ge_spi_slave_info));
95 orion5x_spi_init(); 101 orion5x_spi_init();
diff --git a/arch/arm/mach-orion5x/ts78xx-fpga.h b/arch/arm/mach-orion5x/ts78xx-fpga.h
new file mode 100644
index 000000000000..0f9cdf458952
--- /dev/null
+++ b/arch/arm/mach-orion5x/ts78xx-fpga.h
@@ -0,0 +1,35 @@
1#define FPGAID(_magic, _rev) ((_magic << 8) + _rev)
2
3/*
4 * get yer id's from http://ts78xx.digriz.org.uk/
5 * do *not* make up your own or 'borrow' any!
6 */
7enum fpga_ids {
8 /* Technologic Systems */
9 TS7800_REV_1 = FPGAID(0x00b480, 0x01),
10 TS7800_REV_2 = FPGAID(0x00b480, 0x02),
11 TS7800_REV_3 = FPGAID(0x00b480, 0x03),
12 TS7800_REV_4 = FPGAID(0x00b480, 0x04),
13 TS7800_REV_5 = FPGAID(0x00b480, 0x05),
14
15 /* Unaffordable & Expensive */
16 UAE_DUMMY = FPGAID(0xffffff, 0x01),
17};
18
19struct fpga_device {
20 unsigned present:1;
21 unsigned init:1;
22};
23
24struct fpga_devices {
25 /* Technologic Systems */
26 struct fpga_device ts_rtc;
27 struct fpga_device ts_nand;
28};
29
30struct ts78xx_fpga_data {
31 unsigned int id;
32 int state;
33
34 struct fpga_devices supports;
35};
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index 1368e9fd1a06..9a6b397f972d 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -10,17 +10,20 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/sysfs.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
14#include <linux/mtd/physmap.h>
15#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
16#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
17#include <linux/m48t86.h> 17#include <linux/m48t86.h>
18#include <linux/mtd/nand.h>
19#include <linux/mtd/partitions.h>
18#include <asm/mach-types.h> 20#include <asm/mach-types.h>
19#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
20#include <asm/mach/map.h> 22#include <asm/mach/map.h>
21#include <mach/orion5x.h> 23#include <mach/orion5x.h>
22#include "common.h" 24#include "common.h"
23#include "mpp.h" 25#include "mpp.h"
26#include "ts78xx-fpga.h"
24 27
25/***************************************************************************** 28/*****************************************************************************
26 * TS-78xx Info 29 * TS-78xx Info
@@ -33,18 +36,11 @@
33#define TS78XX_FPGA_REGS_VIRT_BASE 0xff900000 36#define TS78XX_FPGA_REGS_VIRT_BASE 0xff900000
34#define TS78XX_FPGA_REGS_SIZE SZ_1M 37#define TS78XX_FPGA_REGS_SIZE SZ_1M
35 38
36#define TS78XX_FPGA_REGS_SYSCON_ID (TS78XX_FPGA_REGS_VIRT_BASE | 0x000) 39static struct ts78xx_fpga_data ts78xx_fpga = {
37#define TS78XX_FPGA_REGS_SYSCON_LCDI (TS78XX_FPGA_REGS_VIRT_BASE | 0x004) 40 .id = 0,
38#define TS78XX_FPGA_REGS_SYSCON_LCDO (TS78XX_FPGA_REGS_VIRT_BASE | 0x008) 41 .state = 1,
39 42/* .supports = ... - populated by ts78xx_fpga_supports() */
40#define TS78XX_FPGA_REGS_RTC_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x808) 43};
41#define TS78XX_FPGA_REGS_RTC_DATA (TS78XX_FPGA_REGS_VIRT_BASE | 0x80c)
42
43/*
44 * 512kB NOR flash Device
45 */
46#define TS78XX_NOR_BOOT_BASE 0xff800000
47#define TS78XX_NOR_BOOT_SIZE SZ_512K
48 44
49/***************************************************************************** 45/*****************************************************************************
50 * I/O Address Mapping 46 * I/O Address Mapping
@@ -65,73 +61,47 @@ void __init ts78xx_map_io(void)
65} 61}
66 62
67/***************************************************************************** 63/*****************************************************************************
68 * 512kB NOR Boot Flash - the chip is a M25P40 64 * Ethernet
69 ****************************************************************************/ 65 ****************************************************************************/
70static struct mtd_partition ts78xx_nor_boot_flash_resources[] = { 66static struct mv643xx_eth_platform_data ts78xx_eth_data = {
71 { 67 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
72 .name = "ts-bootrom",
73 .offset = 0,
74 /* only the first 256kB is used */
75 .size = SZ_256K,
76 .mask_flags = MTD_WRITEABLE,
77 },
78};
79
80static struct physmap_flash_data ts78xx_nor_boot_flash_data = {
81 .width = 1,
82 .parts = ts78xx_nor_boot_flash_resources,
83 .nr_parts = ARRAY_SIZE(ts78xx_nor_boot_flash_resources),
84};
85
86static struct resource ts78xx_nor_boot_flash_resource = {
87 .flags = IORESOURCE_MEM,
88 .start = TS78XX_NOR_BOOT_BASE,
89 .end = TS78XX_NOR_BOOT_BASE + TS78XX_NOR_BOOT_SIZE - 1,
90};
91
92static struct platform_device ts78xx_nor_boot_flash = {
93 .name = "physmap-flash",
94 .id = -1,
95 .dev = {
96 .platform_data = &ts78xx_nor_boot_flash_data,
97 },
98 .num_resources = 1,
99 .resource = &ts78xx_nor_boot_flash_resource,
100}; 68};
101 69
102/***************************************************************************** 70/*****************************************************************************
103 * Ethernet 71 * SATA
104 ****************************************************************************/ 72 ****************************************************************************/
105static struct mv643xx_eth_platform_data ts78xx_eth_data = { 73static struct mv_sata_platform_data ts78xx_sata_data = {
106 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 74 .n_ports = 2,
107}; 75};
108 76
109/***************************************************************************** 77/*****************************************************************************
110 * RTC M48T86 - nicked^Wborrowed from arch/arm/mach-ep93xx/ts72xx.c 78 * RTC M48T86 - nicked^Wborrowed from arch/arm/mach-ep93xx/ts72xx.c
111 ****************************************************************************/ 79 ****************************************************************************/
112#ifdef CONFIG_RTC_DRV_M48T86 80#define TS_RTC_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x808)
113static unsigned char ts78xx_rtc_readbyte(unsigned long addr) 81#define TS_RTC_DATA (TS78XX_FPGA_REGS_VIRT_BASE | 0x80c)
82
83static unsigned char ts78xx_ts_rtc_readbyte(unsigned long addr)
114{ 84{
115 writeb(addr, TS78XX_FPGA_REGS_RTC_CTRL); 85 writeb(addr, TS_RTC_CTRL);
116 return readb(TS78XX_FPGA_REGS_RTC_DATA); 86 return readb(TS_RTC_DATA);
117} 87}
118 88
119static void ts78xx_rtc_writebyte(unsigned char value, unsigned long addr) 89static void ts78xx_ts_rtc_writebyte(unsigned char value, unsigned long addr)
120{ 90{
121 writeb(addr, TS78XX_FPGA_REGS_RTC_CTRL); 91 writeb(addr, TS_RTC_CTRL);
122 writeb(value, TS78XX_FPGA_REGS_RTC_DATA); 92 writeb(value, TS_RTC_DATA);
123} 93}
124 94
125static struct m48t86_ops ts78xx_rtc_ops = { 95static struct m48t86_ops ts78xx_ts_rtc_ops = {
126 .readbyte = ts78xx_rtc_readbyte, 96 .readbyte = ts78xx_ts_rtc_readbyte,
127 .writebyte = ts78xx_rtc_writebyte, 97 .writebyte = ts78xx_ts_rtc_writebyte,
128}; 98};
129 99
130static struct platform_device ts78xx_rtc_device = { 100static struct platform_device ts78xx_ts_rtc_device = {
131 .name = "rtc-m48t86", 101 .name = "rtc-m48t86",
132 .id = -1, 102 .id = -1,
133 .dev = { 103 .dev = {
134 .platform_data = &ts78xx_rtc_ops, 104 .platform_data = &ts78xx_ts_rtc_ops,
135 }, 105 },
136 .num_resources = 0, 106 .num_resources = 0,
137}; 107};
@@ -146,59 +116,314 @@ static struct platform_device ts78xx_rtc_device = {
146 * TODO: track down a guinea pig without an RTC to see if we can work out a 116 * TODO: track down a guinea pig without an RTC to see if we can work out a
147 * better RTC detection routine 117 * better RTC detection routine
148 */ 118 */
149static int __init ts78xx_rtc_init(void) 119static int ts78xx_ts_rtc_load(void)
150{ 120{
121 int rc;
151 unsigned char tmp_rtc0, tmp_rtc1; 122 unsigned char tmp_rtc0, tmp_rtc1;
152 123
153 tmp_rtc0 = ts78xx_rtc_readbyte(126); 124 tmp_rtc0 = ts78xx_ts_rtc_readbyte(126);
154 tmp_rtc1 = ts78xx_rtc_readbyte(127); 125 tmp_rtc1 = ts78xx_ts_rtc_readbyte(127);
155 126
156 ts78xx_rtc_writebyte(0x00, 126); 127 ts78xx_ts_rtc_writebyte(0x00, 126);
157 ts78xx_rtc_writebyte(0x55, 127); 128 ts78xx_ts_rtc_writebyte(0x55, 127);
158 if (ts78xx_rtc_readbyte(127) == 0x55) { 129 if (ts78xx_ts_rtc_readbyte(127) == 0x55) {
159 ts78xx_rtc_writebyte(0xaa, 127); 130 ts78xx_ts_rtc_writebyte(0xaa, 127);
160 if (ts78xx_rtc_readbyte(127) == 0xaa 131 if (ts78xx_ts_rtc_readbyte(127) == 0xaa
161 && ts78xx_rtc_readbyte(126) == 0x00) { 132 && ts78xx_ts_rtc_readbyte(126) == 0x00) {
162 ts78xx_rtc_writebyte(tmp_rtc0, 126); 133 ts78xx_ts_rtc_writebyte(tmp_rtc0, 126);
163 ts78xx_rtc_writebyte(tmp_rtc1, 127); 134 ts78xx_ts_rtc_writebyte(tmp_rtc1, 127);
164 platform_device_register(&ts78xx_rtc_device); 135
165 return 1; 136 if (ts78xx_fpga.supports.ts_rtc.init == 0) {
137 rc = platform_device_register(&ts78xx_ts_rtc_device);
138 if (!rc)
139 ts78xx_fpga.supports.ts_rtc.init = 1;
140 } else
141 rc = platform_device_add(&ts78xx_ts_rtc_device);
142
143 return rc;
166 } 144 }
167 } 145 }
168 146
169 return 0; 147 return -ENODEV;
170}; 148};
171#else 149
172static int __init ts78xx_rtc_init(void) 150static void ts78xx_ts_rtc_unload(void)
173{ 151{
174 return 0; 152 platform_device_del(&ts78xx_ts_rtc_device);
175} 153}
176#endif
177 154
178/***************************************************************************** 155/*****************************************************************************
179 * SATA 156 * NAND Flash
180 ****************************************************************************/ 157 ****************************************************************************/
181static struct mv_sata_platform_data ts78xx_sata_data = { 158#define TS_NAND_CTRL (TS78XX_FPGA_REGS_VIRT_BASE | 0x800) /* VIRT */
182 .n_ports = 2, 159#define TS_NAND_DATA (TS78XX_FPGA_REGS_PHYS_BASE | 0x804) /* PHYS */
160
161/*
162 * hardware specific access to control-lines
163 *
164 * ctrl:
165 * NAND_NCE: bit 0 -> bit 2
166 * NAND_CLE: bit 1 -> bit 1
167 * NAND_ALE: bit 2 -> bit 0
168 */
169static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
170 unsigned int ctrl)
171{
172 struct nand_chip *this = mtd->priv;
173
174 if (ctrl & NAND_CTRL_CHANGE) {
175 unsigned char bits;
176
177 bits = (ctrl & NAND_NCE) << 2;
178 bits |= ctrl & NAND_CLE;
179 bits |= (ctrl & NAND_ALE) >> 2;
180
181 writeb((readb(TS_NAND_CTRL) & ~0x7) | bits, TS_NAND_CTRL);
182 }
183
184 if (cmd != NAND_CMD_NONE)
185 writeb(cmd, this->IO_ADDR_W);
186}
187
188static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd)
189{
190 return readb(TS_NAND_CTRL) & 0x20;
191}
192
193const char *ts_nand_part_probes[] = { "cmdlinepart", NULL };
194
195static struct mtd_partition ts78xx_ts_nand_parts[] = {
196 {
197 .name = "mbr",
198 .offset = 0,
199 .size = SZ_128K,
200 .mask_flags = MTD_WRITEABLE,
201 }, {
202 .name = "kernel",
203 .offset = MTDPART_OFS_APPEND,
204 .size = SZ_4M,
205 }, {
206 .name = "initrd",
207 .offset = MTDPART_OFS_APPEND,
208 .size = SZ_4M,
209 }, {
210 .name = "rootfs",
211 .offset = MTDPART_OFS_APPEND,
212 .size = MTDPART_SIZ_FULL,
213 }
183}; 214};
184 215
216static struct platform_nand_data ts78xx_ts_nand_data = {
217 .chip = {
218 .part_probe_types = ts_nand_part_probes,
219 .partitions = ts78xx_ts_nand_parts,
220 .nr_partitions = ARRAY_SIZE(ts78xx_ts_nand_parts),
221 .chip_delay = 15,
222 .options = NAND_USE_FLASH_BBT,
223 },
224 .ctrl = {
225 /*
226 * The HW ECC offloading functions, used to give about a 9%
227 * performance increase for 'dd if=/dev/mtdblockX' and 5% for
228 * nanddump. This all however was changed by git commit
229 * e6cf5df1838c28bb060ac45b5585e48e71bbc740 so now there is
230 * no performance advantage to be had so we no longer bother
231 */
232 .cmd_ctrl = ts78xx_ts_nand_cmd_ctrl,
233 .dev_ready = ts78xx_ts_nand_dev_ready,
234 },
235};
236
237static struct resource ts78xx_ts_nand_resources = {
238 .start = TS_NAND_DATA,
239 .end = TS_NAND_DATA + 4,
240 .flags = IORESOURCE_IO,
241};
242
243static struct platform_device ts78xx_ts_nand_device = {
244 .name = "gen_nand",
245 .id = -1,
246 .dev = {
247 .platform_data = &ts78xx_ts_nand_data,
248 },
249 .resource = &ts78xx_ts_nand_resources,
250 .num_resources = 1,
251};
252
253static int ts78xx_ts_nand_load(void)
254{
255 int rc;
256
257 if (ts78xx_fpga.supports.ts_nand.init == 0) {
258 rc = platform_device_register(&ts78xx_ts_nand_device);
259 if (!rc)
260 ts78xx_fpga.supports.ts_nand.init = 1;
261 } else
262 rc = platform_device_add(&ts78xx_ts_nand_device);
263
264 return rc;
265};
266
267static void ts78xx_ts_nand_unload(void)
268{
269 platform_device_del(&ts78xx_ts_nand_device);
270}
271
185/***************************************************************************** 272/*****************************************************************************
186 * print some information regarding the board 273 * FPGA 'hotplug' support code
187 ****************************************************************************/ 274 ****************************************************************************/
188static void __init ts78xx_print_board_id(void) 275static void ts78xx_fpga_devices_zero_init(void)
189{ 276{
190 unsigned int board_info; 277 ts78xx_fpga.supports.ts_rtc.init = 0;
191 278 ts78xx_fpga.supports.ts_nand.init = 0;
192 board_info = readl(TS78XX_FPGA_REGS_SYSCON_ID); 279}
193 printk(KERN_INFO "TS-78xx Info: FPGA rev=%.2x, Board Magic=%.6x, ", 280
194 board_info & 0xff, 281static void ts78xx_fpga_supports(void)
195 (board_info >> 8) & 0xffffff); 282{
196 board_info = readl(TS78XX_FPGA_REGS_SYSCON_LCDI); 283 /* TODO: put this 'table' into ts78xx-fpga.h */
197 printk("JP1=%d, JP2=%d\n", 284 switch (ts78xx_fpga.id) {
198 (board_info >> 30) & 0x1, 285 case TS7800_REV_1:
199 (board_info >> 31) & 0x1); 286 case TS7800_REV_2:
287 case TS7800_REV_3:
288 case TS7800_REV_4:
289 case TS7800_REV_5:
290 ts78xx_fpga.supports.ts_rtc.present = 1;
291 ts78xx_fpga.supports.ts_nand.present = 1;
292 break;
293 default:
294 ts78xx_fpga.supports.ts_rtc.present = 0;
295 ts78xx_fpga.supports.ts_nand.present = 0;
296 }
297}
298
299static int ts78xx_fpga_load_devices(void)
300{
301 int tmp, ret = 0;
302
303 if (ts78xx_fpga.supports.ts_rtc.present == 1) {
304 tmp = ts78xx_ts_rtc_load();
305 if (tmp) {
306 printk(KERN_INFO "TS-78xx: RTC not registered\n");
307 ts78xx_fpga.supports.ts_rtc.present = 0;
308 }
309 ret |= tmp;
310 }
311 if (ts78xx_fpga.supports.ts_nand.present == 1) {
312 tmp = ts78xx_ts_nand_load();
313 if (tmp) {
314 printk(KERN_INFO "TS-78xx: NAND not registered\n");
315 ts78xx_fpga.supports.ts_nand.present = 0;
316 }
317 ret |= tmp;
318 }
319
320 return ret;
321}
322
323static int ts78xx_fpga_unload_devices(void)
324{
325 int ret = 0;
326
327 if (ts78xx_fpga.supports.ts_rtc.present == 1)
328 ts78xx_ts_rtc_unload();
329 if (ts78xx_fpga.supports.ts_nand.present == 1)
330 ts78xx_ts_nand_unload();
331
332 return ret;
333}
334
335static int ts78xx_fpga_load(void)
336{
337 ts78xx_fpga.id = readl(TS78XX_FPGA_REGS_VIRT_BASE);
338
339 printk(KERN_INFO "TS-78xx FPGA: magic=0x%.6x, rev=0x%.2x\n",
340 (ts78xx_fpga.id >> 8) & 0xffffff,
341 ts78xx_fpga.id & 0xff);
342
343 ts78xx_fpga_supports();
344
345 if (ts78xx_fpga_load_devices()) {
346 ts78xx_fpga.state = -1;
347 return -EBUSY;
348 }
349
350 return 0;
200}; 351};
201 352
353static int ts78xx_fpga_unload(void)
354{
355 unsigned int fpga_id;
356
357 fpga_id = readl(TS78XX_FPGA_REGS_VIRT_BASE);
358
359 /*
360 * There does not seem to be a feasible way to block access to the GPIO
361 * pins from userspace (/dev/mem). This if clause should hopefully warn
362 * those foolish enough not to follow 'policy' :)
363 *
364 * UrJTAG SVN since r1381 can be used to reprogram the FPGA
365 */
366 if (ts78xx_fpga.id != fpga_id) {
367 printk(KERN_ERR "TS-78xx FPGA: magic/rev mismatch\n"
368 "TS-78xx FPGA: was 0x%.6x/%.2x but now 0x%.6x/%.2x\n",
369 (ts78xx_fpga.id >> 8) & 0xffffff, ts78xx_fpga.id & 0xff,
370 (fpga_id >> 8) & 0xffffff, fpga_id & 0xff);
371 ts78xx_fpga.state = -1;
372 return -EBUSY;
373 }
374
375 if (ts78xx_fpga_unload_devices()) {
376 ts78xx_fpga.state = -1;
377 return -EBUSY;
378 }
379
380 return 0;
381};
382
383static ssize_t ts78xx_fpga_show(struct kobject *kobj,
384 struct kobj_attribute *attr, char *buf)
385{
386 if (ts78xx_fpga.state < 0)
387 return sprintf(buf, "borked\n");
388
389 return sprintf(buf, "%s\n", (ts78xx_fpga.state) ? "online" : "offline");
390}
391
392static ssize_t ts78xx_fpga_store(struct kobject *kobj,
393 struct kobj_attribute *attr, const char *buf, size_t n)
394{
395 int value, ret;
396
397 if (ts78xx_fpga.state < 0) {
398 printk(KERN_ERR "TS-78xx FPGA: borked, you must powercycle asap\n");
399 return -EBUSY;
400 }
401
402 if (strncmp(buf, "online", sizeof("online") - 1) == 0)
403 value = 1;
404 else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0)
405 value = 0;
406 else {
407 printk(KERN_ERR "ts78xx_fpga_store: Invalid value\n");
408 return -EINVAL;
409 }
410
411 if (ts78xx_fpga.state == value)
412 return n;
413
414 ret = (ts78xx_fpga.state == 0)
415 ? ts78xx_fpga_load()
416 : ts78xx_fpga_unload();
417
418 if (!(ret < 0))
419 ts78xx_fpga.state = value;
420
421 return n;
422}
423
424static struct kobj_attribute ts78xx_fpga_attr =
425 __ATTR(ts78xx_fpga, 0644, ts78xx_fpga_show, ts78xx_fpga_store);
426
202/***************************************************************************** 427/*****************************************************************************
203 * General Setup 428 * General Setup
204 ****************************************************************************/ 429 ****************************************************************************/
@@ -223,30 +448,29 @@ static struct orion5x_mpp_mode ts78xx_mpp_modes[] __initdata = {
223 { 17, MPP_UART }, 448 { 17, MPP_UART },
224 { 18, MPP_UART }, 449 { 18, MPP_UART },
225 { 19, MPP_UART }, 450 { 19, MPP_UART },
451 /*
452 * MPP[20] PCI Clock Out 1
453 * MPP[21] PCI Clock Out 0
454 * MPP[22] Unused
455 * MPP[23] Unused
456 * MPP[24] Unused
457 * MPP[25] Unused
458 */
226 { -1 }, 459 { -1 },
227}; 460};
228 461
229static void __init ts78xx_init(void) 462static void __init ts78xx_init(void)
230{ 463{
464 int ret;
465
231 /* 466 /*
232 * Setup basic Orion functions. Need to be called early. 467 * Setup basic Orion functions. Need to be called early.
233 */ 468 */
234 orion5x_init(); 469 orion5x_init();
235 470
236 ts78xx_print_board_id();
237
238 orion5x_mpp_conf(ts78xx_mpp_modes); 471 orion5x_mpp_conf(ts78xx_mpp_modes);
239 472
240 /* 473 /*
241 * MPP[20] PCI Clock Out 1
242 * MPP[21] PCI Clock Out 0
243 * MPP[22] Unused
244 * MPP[23] Unused
245 * MPP[24] Unused
246 * MPP[25] Unused
247 */
248
249 /*
250 * Configure peripherals. 474 * Configure peripherals.
251 */ 475 */
252 orion5x_ehci0_init(); 476 orion5x_ehci0_init();
@@ -257,12 +481,12 @@ static void __init ts78xx_init(void)
257 orion5x_uart1_init(); 481 orion5x_uart1_init();
258 orion5x_xor_init(); 482 orion5x_xor_init();
259 483
260 orion5x_setup_dev_boot_win(TS78XX_NOR_BOOT_BASE, 484 /* FPGA init */
261 TS78XX_NOR_BOOT_SIZE); 485 ts78xx_fpga_devices_zero_init();
262 platform_device_register(&ts78xx_nor_boot_flash); 486 ret = ts78xx_fpga_load();
263 487 ret = sysfs_create_file(power_kobj, &ts78xx_fpga_attr.attr);
264 if (!ts78xx_rtc_init()) 488 if (ret)
265 printk(KERN_INFO "TS-78xx RTC not detected or enabled\n"); 489 printk(KERN_ERR "sysfs_create_file failed: %d\n", ret);
266} 490}
267 491
268MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC") 492MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index cc8f89200865..1b4ad9d5e2eb 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -106,7 +106,7 @@ static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = {
106 .duplex = DUPLEX_FULL, 106 .duplex = DUPLEX_FULL,
107}; 107};
108 108
109static struct dsa_platform_data wrt350n_v2_switch_data = { 109static struct dsa_chip_data wrt350n_v2_switch_chip_data = {
110 .port_names[0] = "lan2", 110 .port_names[0] = "lan2",
111 .port_names[1] = "lan1", 111 .port_names[1] = "lan1",
112 .port_names[2] = "wan", 112 .port_names[2] = "wan",
@@ -115,6 +115,11 @@ static struct dsa_platform_data wrt350n_v2_switch_data = {
115 .port_names[7] = "lan4", 115 .port_names[7] = "lan4",
116}; 116};
117 117
118static struct dsa_platform_data wrt350n_v2_switch_plat_data = {
119 .nr_chips = 1,
120 .chip = &wrt350n_v2_switch_chip_data,
121};
122
118static void __init wrt350n_v2_init(void) 123static void __init wrt350n_v2_init(void)
119{ 124{
120 /* 125 /*
@@ -129,7 +134,7 @@ static void __init wrt350n_v2_init(void)
129 */ 134 */
130 orion5x_ehci0_init(); 135 orion5x_ehci0_init();
131 orion5x_eth_init(&wrt350n_v2_eth_data); 136 orion5x_eth_init(&wrt350n_v2_eth_data);
132 orion5x_eth_switch_init(&wrt350n_v2_switch_data, NO_IRQ); 137 orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
133 orion5x_uart0_init(); 138 orion5x_uart0_init();
134 139
135 orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE, 140 orion5x_setup_dev_boot_win(WRT350N_V2_NOR_BOOT_BASE,
diff --git a/arch/arm/mach-pnx4008/include/mach/system.h b/arch/arm/mach-pnx4008/include/mach/system.h
index e12e7abfcbcf..5dda2bb55f8d 100644
--- a/arch/arm/mach-pnx4008/include/mach/system.h
+++ b/arch/arm/mach-pnx4008/include/mach/system.h
@@ -30,7 +30,7 @@ static void arch_idle(void)
30 cpu_do_idle(); 30 cpu_do_idle();
31} 31}
32 32
33static inline void arch_reset(char mode) 33static inline void arch_reset(char mode, const char *cmd)
34{ 34{
35 cpu_reset(0); 35 cpu_reset(0);
36} 36}
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 8eea7306f29b..96a2006cb597 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -40,6 +40,9 @@ choice
40config GUMSTIX_AM200EPD 40config GUMSTIX_AM200EPD
41 bool "Enable AM200EPD board support" 41 bool "Enable AM200EPD board support"
42 42
43config GUMSTIX_AM300EPD
44 bool "Enable AM300EPD board support"
45
43endchoice 46endchoice
44 47
45config MACH_INTELMOTE2 48config MACH_INTELMOTE2
@@ -254,10 +257,24 @@ config MACH_EM_X270
254 bool "CompuLab EM-x270 platform" 257 bool "CompuLab EM-x270 platform"
255 select PXA27x 258 select PXA27x
256 259
260config MACH_EXEDA
261 bool "CompuLab eXeda platform"
262 select PXA27x
263
257config MACH_COLIBRI 264config MACH_COLIBRI
258 bool "Toradex Colibri PX27x" 265 bool "Toradex Colibri PXA270"
259 select PXA27x 266 select PXA27x
260 267
268config MACH_COLIBRI300
269 bool "Toradex Colibri PXA300/310"
270 select PXA3xx
271 select CPU_PXA300
272
273config MACH_COLIBRI320
274 bool "Toradex Colibri PXA320"
275 select PXA3xx
276 select CPU_PXA320
277
261config MACH_ZYLONITE 278config MACH_ZYLONITE
262 bool "PXA3xx Development Platform (aka Zylonite)" 279 bool "PXA3xx Development Platform (aka Zylonite)"
263 select PXA3xx 280 select PXA3xx
@@ -295,8 +312,15 @@ config MACH_MAGICIAN
295 bool "Enable HTC Magician Support" 312 bool "Enable HTC Magician Support"
296 select PXA27x 313 select PXA27x
297 select IWMMXT 314 select IWMMXT
315 select PXA_SSP
316 select HAVE_PWM
298 select PXA_HAVE_BOARD_IRQS 317 select PXA_HAVE_BOARD_IRQS
299 318
319config MACH_HIMALAYA
320 bool "HTC Himalaya Support"
321 select CPU_PXA26x
322 select FB_W100
323
300config MACH_MIOA701 324config MACH_MIOA701
301 bool "Mitac Mio A701 Support" 325 bool "Mitac Mio A701 Support"
302 select PXA27x 326 select PXA27x
@@ -319,6 +343,16 @@ config ARCH_PXA_PALM
319 bool "PXA based Palm PDAs" 343 bool "PXA based Palm PDAs"
320 select HAVE_PWM 344 select HAVE_PWM
321 345
346config MACH_PALMT5
347 bool "Palm Tungsten|T5"
348 default y
349 depends on ARCH_PXA_PALM
350 select PXA27x
351 select IWMMXT
352 help
353 Say Y here if you intend to run this kernel on a Palm Tungsten|T5
354 handheld computer.
355
322config MACH_PALMTX 356config MACH_PALMTX
323 bool "Palm T|X" 357 bool "Palm T|X"
324 default y 358 default y
@@ -339,6 +373,16 @@ config MACH_PALMZ72
339 Say Y here if you intend to run this kernel on Palm Zire 72 373 Say Y here if you intend to run this kernel on Palm Zire 72
340 handheld computer. 374 handheld computer.
341 375
376config MACH_PALMLD
377 bool "Palm LifeDrive"
378 default y
379 depends on ARCH_PXA_PALM
380 select PXA27x
381 select IWMMXT
382 help
383 Say Y here if you intend to run this kernel on a Palm LifeDrive
384 handheld computer.
385
342config MACH_PCM990_BASEBOARD 386config MACH_PCM990_BASEBOARD
343 bool "PHYTEC PCM-990 development board" 387 bool "PHYTEC PCM-990 development board"
344 select HAVE_PWM 388 select HAVE_PWM
@@ -359,6 +403,18 @@ config PCM990_DISPLAY_NONE
359 403
360endchoice 404endchoice
361 405
406config MACH_CSB726
407 bool "Enable Cogent CSB726 System On a Module"
408 select PXA27x
409 select IWMMXT
410 help
411 Say Y here if you intend to run this kernel on a Cogent
412 CSB726 System On Module.
413
414config CSB726_CSB701
415 bool "Enable supprot for CSB701 baseboard"
416 depends on MACH_CSB726
417
362config PXA_EZX 418config PXA_EZX
363 bool "Motorola EZX Platform" 419 bool "Motorola EZX Platform"
364 select PXA27x 420 select PXA27x
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 7b28bb561d63..c80e1bac4945 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -3,8 +3,8 @@
3# 3#
4 4
5# Common support (must be linked before board specific support) 5# Common support (must be linked before board specific support)
6obj-y += clock.o devices.o generic.o irq.o dma.o \ 6obj-y += clock.o devices.o generic.o irq.o \
7 time.o gpio.o reset.o 7 time.o reset.o
8obj-$(CONFIG_PM) += pm.o sleep.o standby.o 8obj-$(CONFIG_PM) += pm.o sleep.o standby.o
9 9
10ifeq ($(CONFIG_CPU_FREQ),y) 10ifeq ($(CONFIG_CPU_FREQ),y)
@@ -28,13 +28,16 @@ obj-$(CONFIG_CPU_PXA930) += pxa930.o
28# Specific board support 28# Specific board support
29obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 29obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
30obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o 30obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
31obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
31obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 32obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
32obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o 33obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
33obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 34obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
34obj-$(CONFIG_MACH_MP900C) += mp900.o 35obj-$(CONFIG_MACH_MP900C) += mp900.o
35obj-$(CONFIG_ARCH_PXA_IDP) += idp.o 36obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
36obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o 37obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
37obj-$(CONFIG_MACH_COLIBRI) += colibri.o 38obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
39obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
40obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
38obj-$(CONFIG_MACH_H5000) += h5000.o 41obj-$(CONFIG_MACH_H5000) += h5000.o
39obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o 42obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o
40obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o 43obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
@@ -45,6 +48,7 @@ obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
45obj-$(CONFIG_MACH_TOSA) += tosa.o 48obj-$(CONFIG_MACH_TOSA) += tosa.o
46obj-$(CONFIG_MACH_EM_X270) += em-x270.o 49obj-$(CONFIG_MACH_EM_X270) += em-x270.o
47obj-$(CONFIG_MACH_MAGICIAN) += magician.o 50obj-$(CONFIG_MACH_MAGICIAN) += magician.o
51obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o
48obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o 52obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o
49obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o 53obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
50obj-$(CONFIG_MACH_E330) += e330.o 54obj-$(CONFIG_MACH_E330) += e330.o
@@ -53,7 +57,9 @@ obj-$(CONFIG_MACH_E740) += e740.o
53obj-$(CONFIG_MACH_E750) += e750.o 57obj-$(CONFIG_MACH_E750) += e750.o
54obj-$(CONFIG_MACH_E400) += e400.o 58obj-$(CONFIG_MACH_E400) += e400.o
55obj-$(CONFIG_MACH_E800) += e800.o 59obj-$(CONFIG_MACH_E800) += e800.o
60obj-$(CONFIG_MACH_PALMT5) += palmt5.o
56obj-$(CONFIG_MACH_PALMTX) += palmtx.o 61obj-$(CONFIG_MACH_PALMTX) += palmtx.o
62obj-$(CONFIG_MACH_PALMLD) += palmld.o
57obj-$(CONFIG_MACH_PALMZ72) += palmz72.o 63obj-$(CONFIG_MACH_PALMZ72) += palmz72.o
58obj-$(CONFIG_ARCH_VIPER) += viper.o 64obj-$(CONFIG_ARCH_VIPER) += viper.o
59 65
@@ -71,6 +77,8 @@ obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
71obj-$(CONFIG_PXA_EZX) += ezx.o 77obj-$(CONFIG_PXA_EZX) += ezx.o
72 78
73obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o 79obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
80obj-$(CONFIG_MACH_CSB726) += csb726.o
81obj-$(CONFIG_CSB726_CSB701) += csb701.o
74 82
75# Support for blinky lights 83# Support for blinky lights
76led-y := leds.o 84led-y := leds.o
diff --git a/arch/arm/mach-pxa/am200epd.c b/arch/arm/mach-pxa/am200epd.c
index 77ee80e5e47b..3499fada73ae 100644
--- a/arch/arm/mach-pxa/am200epd.c
+++ b/arch/arm/mach-pxa/am200epd.c
@@ -30,8 +30,8 @@
30#include <linux/irq.h> 30#include <linux/irq.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32 32
33#include <mach/pxa25x.h>
33#include <mach/gumstix.h> 34#include <mach/gumstix.h>
34#include <mach/mfp-pxa25x.h>
35#include <mach/pxafb.h> 35#include <mach/pxafb.h>
36 36
37#include "generic.h" 37#include "generic.h"
diff --git a/arch/arm/mach-pxa/am300epd.c b/arch/arm/mach-pxa/am300epd.c
new file mode 100644
index 000000000000..4bd10a17332e
--- /dev/null
+++ b/arch/arm/mach-pxa/am300epd.c
@@ -0,0 +1,295 @@
1/*
2 * am300epd.c -- Platform device for AM300 EPD kit
3 *
4 * Copyright (C) 2008, Jaya Kumar
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive for
8 * more details.
9 *
10 * This work was made possible by help and equipment support from E-Ink
11 * Corporation. http://support.eink.com/community
12 *
13 * This driver is written to be used with the Broadsheet display controller.
14 * on the AM300 EPD prototype kit/development kit with an E-Ink 800x600
15 * Vizplex EPD on a Gumstix board using the Broadsheet interface board.
16 *
17 */
18
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/errno.h>
22#include <linux/string.h>
23#include <linux/delay.h>
24#include <linux/interrupt.h>
25#include <linux/fb.h>
26#include <linux/init.h>
27#include <linux/platform_device.h>
28#include <linux/irq.h>
29#include <linux/gpio.h>
30
31#include <mach/gumstix.h>
32#include <mach/mfp-pxa25x.h>
33#include <mach/pxafb.h>
34
35#include "generic.h"
36
37#include <video/broadsheetfb.h>
38
39static unsigned int panel_type = 6;
40static struct platform_device *am300_device;
41static struct broadsheet_board am300_board;
42
43static unsigned long am300_pin_config[] __initdata = {
44 GPIO16_GPIO,
45 GPIO17_GPIO,
46 GPIO32_GPIO,
47 GPIO48_GPIO,
48 GPIO49_GPIO,
49 GPIO51_GPIO,
50 GPIO74_GPIO,
51 GPIO75_GPIO,
52 GPIO76_GPIO,
53 GPIO77_GPIO,
54
55 /* this is the 16-bit hdb bus 58-73 */
56 GPIO58_GPIO,
57 GPIO59_GPIO,
58 GPIO60_GPIO,
59 GPIO61_GPIO,
60
61 GPIO62_GPIO,
62 GPIO63_GPIO,
63 GPIO64_GPIO,
64 GPIO65_GPIO,
65
66 GPIO66_GPIO,
67 GPIO67_GPIO,
68 GPIO68_GPIO,
69 GPIO69_GPIO,
70
71 GPIO70_GPIO,
72 GPIO71_GPIO,
73 GPIO72_GPIO,
74 GPIO73_GPIO,
75};
76
77/* register offsets for gpio control */
78#define PWR_GPIO_PIN 16
79#define CFG_GPIO_PIN 17
80#define RDY_GPIO_PIN 32
81#define DC_GPIO_PIN 48
82#define RST_GPIO_PIN 49
83#define LED_GPIO_PIN 51
84#define RD_GPIO_PIN 74
85#define WR_GPIO_PIN 75
86#define CS_GPIO_PIN 76
87#define IRQ_GPIO_PIN 77
88
89/* hdb bus */
90#define DB0_GPIO_PIN 58
91#define DB15_GPIO_PIN 73
92
93static int gpios[] = { PWR_GPIO_PIN, CFG_GPIO_PIN, RDY_GPIO_PIN, DC_GPIO_PIN,
94 RST_GPIO_PIN, RD_GPIO_PIN, WR_GPIO_PIN, CS_GPIO_PIN,
95 IRQ_GPIO_PIN, LED_GPIO_PIN };
96static char *gpio_names[] = { "PWR", "CFG", "RDY", "DC", "RST", "RD", "WR",
97 "CS", "IRQ", "LED" };
98
99static int am300_wait_event(struct broadsheetfb_par *par)
100{
101 /* todo: improve err recovery */
102 wait_event(par->waitq, gpio_get_value(RDY_GPIO_PIN));
103 return 0;
104}
105
106static int am300_init_gpio_regs(struct broadsheetfb_par *par)
107{
108 int i;
109 int err;
110 char dbname[8];
111
112 for (i = 0; i < ARRAY_SIZE(gpios); i++) {
113 err = gpio_request(gpios[i], gpio_names[i]);
114 if (err) {
115 dev_err(&am300_device->dev, "failed requesting "
116 "gpio %s, err=%d\n", gpio_names[i], err);
117 goto err_req_gpio;
118 }
119 }
120
121 /* we also need to take care of the hdb bus */
122 for (i = DB0_GPIO_PIN; i <= DB15_GPIO_PIN; i++) {
123 sprintf(dbname, "DB%d", i);
124 err = gpio_request(i, dbname);
125 if (err) {
126 dev_err(&am300_device->dev, "failed requesting "
127 "gpio %d, err=%d\n", i, err);
128 while (i >= DB0_GPIO_PIN)
129 gpio_free(i--);
130 i = ARRAY_SIZE(gpios) - 1;
131 goto err_req_gpio;
132 }
133 }
134
135 /* setup the outputs and init values */
136 gpio_direction_output(PWR_GPIO_PIN, 0);
137 gpio_direction_output(CFG_GPIO_PIN, 1);
138 gpio_direction_output(DC_GPIO_PIN, 0);
139 gpio_direction_output(RD_GPIO_PIN, 1);
140 gpio_direction_output(WR_GPIO_PIN, 1);
141 gpio_direction_output(CS_GPIO_PIN, 1);
142 gpio_direction_output(RST_GPIO_PIN, 0);
143
144 /* setup the inputs */
145 gpio_direction_input(RDY_GPIO_PIN);
146 gpio_direction_input(IRQ_GPIO_PIN);
147
148 /* start the hdb bus as an input */
149 for (i = DB0_GPIO_PIN; i <= DB15_GPIO_PIN; i++)
150 gpio_direction_output(i, 0);
151
152 /* go into command mode */
153 gpio_set_value(CFG_GPIO_PIN, 1);
154 gpio_set_value(RST_GPIO_PIN, 0);
155 msleep(10);
156 gpio_set_value(RST_GPIO_PIN, 1);
157 msleep(10);
158 am300_wait_event(par);
159
160 return 0;
161
162err_req_gpio:
163 while (i > 0)
164 gpio_free(gpios[i--]);
165
166 return err;
167}
168
169static int am300_init_board(struct broadsheetfb_par *par)
170{
171 return am300_init_gpio_regs(par);
172}
173
174static void am300_cleanup(struct broadsheetfb_par *par)
175{
176 int i;
177
178 free_irq(IRQ_GPIO(RDY_GPIO_PIN), par);
179
180 for (i = 0; i < ARRAY_SIZE(gpios); i++)
181 gpio_free(gpios[i]);
182
183 for (i = DB0_GPIO_PIN; i <= DB15_GPIO_PIN; i++)
184 gpio_free(i);
185
186}
187
188static u16 am300_get_hdb(struct broadsheetfb_par *par)
189{
190 u16 res = 0;
191 int i;
192
193 for (i = 0; i <= (DB15_GPIO_PIN - DB0_GPIO_PIN) ; i++)
194 res |= (gpio_get_value(DB0_GPIO_PIN + i)) ? (1 << i) : 0;
195
196 return res;
197}
198
199static void am300_set_hdb(struct broadsheetfb_par *par, u16 data)
200{
201 int i;
202
203 for (i = 0; i <= (DB15_GPIO_PIN - DB0_GPIO_PIN) ; i++)
204 gpio_set_value(DB0_GPIO_PIN + i, (data >> i) & 0x01);
205}
206
207
208static void am300_set_ctl(struct broadsheetfb_par *par, unsigned char bit,
209 u8 state)
210{
211 switch (bit) {
212 case BS_CS:
213 gpio_set_value(CS_GPIO_PIN, state);
214 break;
215 case BS_DC:
216 gpio_set_value(DC_GPIO_PIN, state);
217 break;
218 case BS_WR:
219 gpio_set_value(WR_GPIO_PIN, state);
220 break;
221 }
222}
223
224static int am300_get_panel_type(void)
225{
226 return panel_type;
227}
228
229static irqreturn_t am300_handle_irq(int irq, void *dev_id)
230{
231 struct broadsheetfb_par *par = dev_id;
232
233 wake_up(&par->waitq);
234 return IRQ_HANDLED;
235}
236
237static int am300_setup_irq(struct fb_info *info)
238{
239 int ret;
240 struct broadsheetfb_par *par = info->par;
241
242 ret = request_irq(IRQ_GPIO(RDY_GPIO_PIN), am300_handle_irq,
243 IRQF_DISABLED|IRQF_TRIGGER_RISING,
244 "AM300", par);
245 if (ret)
246 dev_err(&am300_device->dev, "request_irq failed: %d\n", ret);
247
248 return ret;
249}
250
251static struct broadsheet_board am300_board = {
252 .owner = THIS_MODULE,
253 .init = am300_init_board,
254 .cleanup = am300_cleanup,
255 .set_hdb = am300_set_hdb,
256 .get_hdb = am300_get_hdb,
257 .set_ctl = am300_set_ctl,
258 .wait_for_rdy = am300_wait_event,
259 .get_panel_type = am300_get_panel_type,
260 .setup_irq = am300_setup_irq,
261};
262
263int __init am300_init(void)
264{
265 int ret;
266
267 pxa2xx_mfp_config(ARRAY_AND_SIZE(am300_pin_config));
268
269 /* request our platform independent driver */
270 request_module("broadsheetfb");
271
272 am300_device = platform_device_alloc("broadsheetfb", -1);
273 if (!am300_device)
274 return -ENOMEM;
275
276 /* the am300_board that will be seen by broadsheetfb is a copy */
277 platform_device_add_data(am300_device, &am300_board,
278 sizeof(am300_board));
279
280 ret = platform_device_add(am300_device);
281
282 if (ret) {
283 platform_device_put(am300_device);
284 return ret;
285 }
286
287 return 0;
288}
289
290module_param(panel_type, uint, 0);
291MODULE_PARM_DESC(panel_type, "Select the panel type: 6, 8, 97");
292
293MODULE_DESCRIPTION("board driver for am300 epd kit");
294MODULE_AUTHOR("Jaya Kumar");
295MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index 40b774084514..db52d2c4791d 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -87,7 +87,7 @@ void clks_register(struct clk_lookup *clks, size_t num)
87 clkdev_add(&clks[i]); 87 clkdev_add(&clks[i]);
88} 88}
89 89
90int clk_add_alias(char *alias, struct device *alias_dev, char *id, 90int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
91 struct device *dev) 91 struct device *dev)
92{ 92{
93 struct clk *r = clk_get(dev, id); 93 struct clk *r = clk_get(dev, id);
@@ -96,7 +96,7 @@ int clk_add_alias(char *alias, struct device *alias_dev, char *id,
96 if (!r) 96 if (!r)
97 return -ENODEV; 97 return -ENODEV;
98 98
99 l = clkdev_alloc(r, alias, alias_dev ? dev_name(alias_dev) : NULL); 99 l = clkdev_alloc(r, alias, alias_dev_name);
100 clk_put(r); 100 clk_put(r);
101 if (!l) 101 if (!l)
102 return -ENODEV; 102 return -ENODEV;
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h
index 4e9c613c6767..5599bceff738 100644
--- a/arch/arm/mach-pxa/clock.h
+++ b/arch/arm/mach-pxa/clock.h
@@ -69,6 +69,6 @@ extern void clk_pxa3xx_cken_disable(struct clk *);
69#endif 69#endif
70 70
71void clks_register(struct clk_lookup *clks, size_t num); 71void clks_register(struct clk_lookup *clks, size_t num);
72int clk_add_alias(char *alias, struct device *alias_dev, char *id, 72int clk_add_alias(const char *alias, const char *alias_name, char *id,
73 struct device *dev); 73 struct device *dev);
74 74
diff --git a/arch/arm/mach-pxa/cm-x255.c b/arch/arm/mach-pxa/cm-x255.c
index 83a4cdf08176..253fd76142d6 100644
--- a/arch/arm/mach-pxa/cm-x255.c
+++ b/arch/arm/mach-pxa/cm-x255.c
@@ -22,10 +22,8 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24 24
25#include <mach/pxa2xx-regs.h> 25#include <mach/pxa25x.h>
26#include <mach/mfp-pxa25x.h>
27#include <mach/pxa2xx_spi.h> 26#include <mach/pxa2xx_spi.h>
28#include <mach/bitfield.h>
29 27
30#include "generic.h" 28#include "generic.h"
31 29
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index df83b97f303f..34576ba5f5fd 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -17,7 +17,7 @@
17#include <linux/rtc-v3020.h> 17#include <linux/rtc-v3020.h>
18#include <video/mbxfb.h> 18#include <video/mbxfb.h>
19 19
20#include <mach/mfp-pxa27x.h> 20#include <mach/pxa27x.h>
21#include <mach/ohci.h> 21#include <mach/ohci.h>
22#include <mach/mmc.h> 22#include <mach/mmc.h>
23 23
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c
index 3156b25f6e9d..7873fa3d8fa4 100644
--- a/arch/arm/mach-pxa/cm-x2xx-pci.c
+++ b/arch/arm/mach-pxa/cm-x2xx-pci.c
@@ -22,7 +22,6 @@
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23 23
24#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
25#include <mach/pxa-regs.h>
26#include <asm/mach-types.h> 25#include <asm/mach-types.h>
27 26
28#include <asm/hardware/it8152.h> 27#include <asm/hardware/it8152.h>
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index d99fd9e4d888..117b5435f8d5 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -22,8 +22,6 @@
22#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23 23
24#include <mach/pxa2xx-regs.h> 24#include <mach/pxa2xx-regs.h>
25#include <mach/mfp-pxa27x.h>
26#include <mach/pxa-regs.h>
27#include <mach/audio.h> 25#include <mach/audio.h>
28#include <mach/pxafb.h> 26#include <mach/pxafb.h>
29 27
@@ -96,7 +94,7 @@ static struct resource cmx270_dm9000_resource[] = {
96}; 94};
97 95
98static struct dm9000_plat_data cmx270_dm9000_platdata = { 96static struct dm9000_plat_data cmx270_dm9000_platdata = {
99 .flags = DM9000_PLATF_32BITONLY, 97 .flags = DM9000_PLATF_32BITONLY | DM9000_PLATF_NO_EEPROM,
100}; 98};
101 99
102static struct platform_device cmx2xx_dm9000_device = { 100static struct platform_device cmx2xx_dm9000_device = {
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index ff0c577cd1ac..a9f48b1cb54a 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -28,9 +28,7 @@
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 30
31#include <mach/mfp-pxa300.h> 31#include <mach/pxa300.h>
32
33#include <mach/hardware.h>
34#include <mach/pxafb.h> 32#include <mach/pxafb.h>
35#include <mach/mmc.h> 33#include <mach/mmc.h>
36#include <mach/ohci.h> 34#include <mach/ohci.h>
@@ -162,7 +160,7 @@ static struct resource dm9000_resources[] = {
162}; 160};
163 161
164static struct dm9000_plat_data cm_x300_dm9000_platdata = { 162static struct dm9000_plat_data cm_x300_dm9000_platdata = {
165 .flags = DM9000_PLATF_16BITONLY, 163 .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM,
166}; 164};
167 165
168static struct platform_device dm9000_device = { 166static struct platform_device dm9000_device = {
diff --git a/arch/arm/mach-pxa/colibri.c b/arch/arm/mach-pxa/colibri-pxa270.c
index e8473624427e..01bcfaae75bc 100644
--- a/arch/arm/mach-pxa/colibri.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-pxa/colibri.c 2 * linux/arch/arm/mach-pxa/colibri-pxa270.c
3 * 3 *
4 * Support for Toradex PXA27x based Colibri module 4 * Support for Toradex PXA270 based Colibri module
5 * Daniel Mack <daniel@caiaq.de> 5 * Daniel Mack <daniel@caiaq.de>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -20,6 +20,7 @@
20#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
21#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
22#include <linux/mtd/physmap.h> 22#include <linux/mtd/physmap.h>
23#include <linux/gpio.h>
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24#include <mach/hardware.h> 25#include <mach/hardware.h>
25#include <asm/irq.h> 26#include <asm/irq.h>
@@ -28,20 +29,23 @@
28#include <asm/mach/map.h> 29#include <asm/mach/map.h>
29#include <asm/mach/irq.h> 30#include <asm/mach/irq.h>
30#include <asm/mach/flash.h> 31#include <asm/mach/flash.h>
31#include <mach/pxa-regs.h> 32
32#include <mach/mfp-pxa27x.h> 33#include <mach/pxa27x.h>
33#include <mach/colibri.h> 34#include <mach/colibri.h>
34 35
35#include "generic.h" 36#include "generic.h"
36#include "devices.h" 37#include "devices.h"
37 38
38static unsigned long colibri_pin_config[] __initdata = { 39/*
40 * GPIO configuration
41 */
42static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
39 GPIO78_nCS_2, /* Ethernet CS */ 43 GPIO78_nCS_2, /* Ethernet CS */
40 GPIO114_GPIO, /* Ethernet IRQ */ 44 GPIO114_GPIO, /* Ethernet IRQ */
41}; 45};
42 46
43/* 47/*
44 * Flash 48 * NOR flash
45 */ 49 */
46static struct mtd_partition colibri_partitions[] = { 50static struct mtd_partition colibri_partitions[] = {
47 { 51 {
@@ -70,39 +74,40 @@ static struct physmap_flash_data colibri_flash_data[] = {
70 } 74 }
71}; 75};
72 76
73static struct resource flash_resource = { 77static struct resource colibri_pxa270_flash_resource = {
74 .start = PXA_CS0_PHYS, 78 .start = PXA_CS0_PHYS,
75 .end = PXA_CS0_PHYS + SZ_32M - 1, 79 .end = PXA_CS0_PHYS + SZ_32M - 1,
76 .flags = IORESOURCE_MEM, 80 .flags = IORESOURCE_MEM,
77}; 81};
78 82
79static struct platform_device flash_device = { 83static struct platform_device colibri_pxa270_flash_device = {
80 .name = "physmap-flash", 84 .name = "physmap-flash",
81 .id = 0, 85 .id = 0,
82 .dev = { 86 .dev = {
83 .platform_data = colibri_flash_data, 87 .platform_data = colibri_flash_data,
84 }, 88 },
85 .resource = &flash_resource, 89 .resource = &colibri_pxa270_flash_resource,
86 .num_resources = 1, 90 .num_resources = 1,
87}; 91};
88 92
89/* 93/*
90 * DM9000 Ethernet 94 * DM9000 Ethernet
91 */ 95 */
96#if defined(CONFIG_DM9000)
92static struct resource dm9000_resources[] = { 97static struct resource dm9000_resources[] = {
93 [0] = { 98 [0] = {
94 .start = COLIBRI_ETH_PHYS, 99 .start = COLIBRI_PXA270_ETH_PHYS,
95 .end = COLIBRI_ETH_PHYS + 3, 100 .end = COLIBRI_PXA270_ETH_PHYS + 3,
96 .flags = IORESOURCE_MEM, 101 .flags = IORESOURCE_MEM,
97 }, 102 },
98 [1] = { 103 [1] = {
99 .start = COLIBRI_ETH_PHYS + 4, 104 .start = COLIBRI_PXA270_ETH_PHYS + 4,
100 .end = COLIBRI_ETH_PHYS + 4 + 500, 105 .end = COLIBRI_PXA270_ETH_PHYS + 4 + 500,
101 .flags = IORESOURCE_MEM, 106 .flags = IORESOURCE_MEM,
102 }, 107 },
103 [2] = { 108 [2] = {
104 .start = COLIBRI_ETH_IRQ, 109 .start = COLIBRI_PXA270_ETH_IRQ,
105 .end = COLIBRI_ETH_IRQ, 110 .end = COLIBRI_PXA270_ETH_IRQ,
106 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, 111 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
107 }, 112 },
108}; 113};
@@ -113,25 +118,28 @@ static struct platform_device dm9000_device = {
113 .num_resources = ARRAY_SIZE(dm9000_resources), 118 .num_resources = ARRAY_SIZE(dm9000_resources),
114 .resource = dm9000_resources, 119 .resource = dm9000_resources,
115}; 120};
121#endif /* CONFIG_DM9000 */
116 122
117static struct platform_device *colibri_devices[] __initdata = { 123static struct platform_device *colibri_pxa270_devices[] __initdata = {
118 &flash_device, 124 &colibri_pxa270_flash_device,
125#if defined(CONFIG_DM9000)
119 &dm9000_device, 126 &dm9000_device,
127#endif
120}; 128};
121 129
122static void __init colibri_init(void) 130static void __init colibri_pxa270_init(void)
123{ 131{
124 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pin_config)); 132 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
125 133 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa270_devices));
126 platform_add_devices(colibri_devices, ARRAY_SIZE(colibri_devices));
127} 134}
128 135
129MACHINE_START(COLIBRI, "Toradex Colibri PXA27x") 136MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
130 .phys_io = 0x40000000, 137 .phys_io = 0x40000000,
131 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 138 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
132 .boot_params = COLIBRI_SDRAM_BASE + 0x100, 139 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
133 .init_machine = colibri_init, 140 .init_machine = colibri_pxa270_init,
134 .map_io = pxa_map_io, 141 .map_io = pxa_map_io,
135 .init_irq = pxa27x_init_irq, 142 .init_irq = pxa27x_init_irq,
136 .timer = &pxa_timer, 143 .timer = &pxa_timer,
137MACHINE_END 144MACHINE_END
145
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
new file mode 100644
index 000000000000..10c2eaf93230
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -0,0 +1,190 @@
1/*
2 * arch/arm/mach-pxa/colibri-pxa300.c
3 *
4 * Support for Toradex PXA300/310 based Colibri module
5 *
6 * Daniel Mack <daniel@caiaq.de>
7 * Matthias Meier <matthias.j.meier@gmx.net>
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/kernel.h>
16#include <linux/platform_device.h>
17#include <linux/gpio.h>
18#include <net/ax88796.h>
19
20#include <asm/mach-types.h>
21#include <asm/sizes.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/irq.h>
24
25#include <mach/pxa300.h>
26#include <mach/colibri.h>
27#include <mach/ohci.h>
28#include <mach/pxafb.h>
29
30#include "generic.h"
31#include "devices.h"
32
33#if defined(CONFIG_AX88796)
34#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
35/*
36 * Asix AX88796 Ethernet
37 */
38static struct ax_plat_data colibri_asix_platdata = {
39 .flags = AXFLG_MAC_FROMDEV,
40 .wordlength = 2
41};
42
43static struct resource colibri_asix_resource[] = {
44 [0] = {
45 .start = PXA3xx_CS2_PHYS,
46 .end = PXA3xx_CS2_PHYS + (0x20 * 2) - 1,
47 .flags = IORESOURCE_MEM,
48 },
49 [1] = {
50 .start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
51 .end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
52 .flags = IORESOURCE_IRQ
53 }
54};
55
56static struct platform_device asix_device = {
57 .name = "ax88796",
58 .id = 0,
59 .num_resources = ARRAY_SIZE(colibri_asix_resource),
60 .resource = colibri_asix_resource,
61 .dev = {
62 .platform_data = &colibri_asix_platdata
63 }
64};
65
66static mfp_cfg_t colibri_pxa300_eth_pin_config[] __initdata = {
67 GPIO1_nCS2, /* AX88796 chip select */
68 GPIO26_GPIO | MFP_PULL_HIGH /* AX88796 IRQ */
69};
70
71static void __init colibri_pxa300_init_eth(void)
72{
73 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_eth_pin_config));
74 set_irq_type(gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), IRQ_TYPE_EDGE_FALLING);
75 platform_device_register(&asix_device);
76}
77#else
78static inline void __init colibri_pxa300_init_eth(void) {}
79#endif /* CONFIG_AX88796 */
80
81#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
82static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = {
83 GPIO0_2_USBH_PEN,
84 GPIO1_2_USBH_PWR,
85};
86
87static struct pxaohci_platform_data colibri_pxa300_ohci_info = {
88 .port_mode = PMM_GLOBAL_MODE,
89 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
90};
91
92void __init colibri_pxa300_init_ohci(void)
93{
94 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config));
95 pxa_set_ohci_info(&colibri_pxa300_ohci_info);
96}
97#else
98static inline void colibri_pxa300_init_ohci(void) {}
99#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
100
101static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = {
102 GPIO7_MMC1_CLK,
103 GPIO14_MMC1_CMD,
104 GPIO3_MMC1_DAT0,
105 GPIO4_MMC1_DAT1,
106 GPIO5_MMC1_DAT2,
107 GPIO6_MMC1_DAT3,
108};
109
110#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
111static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = {
112 GPIO54_LCD_LDD_0,
113 GPIO55_LCD_LDD_1,
114 GPIO56_LCD_LDD_2,
115 GPIO57_LCD_LDD_3,
116 GPIO58_LCD_LDD_4,
117 GPIO59_LCD_LDD_5,
118 GPIO60_LCD_LDD_6,
119 GPIO61_LCD_LDD_7,
120 GPIO62_LCD_LDD_8,
121 GPIO63_LCD_LDD_9,
122 GPIO64_LCD_LDD_10,
123 GPIO65_LCD_LDD_11,
124 GPIO66_LCD_LDD_12,
125 GPIO67_LCD_LDD_13,
126 GPIO68_LCD_LDD_14,
127 GPIO69_LCD_LDD_15,
128 GPIO70_LCD_LDD_16,
129 GPIO71_LCD_LDD_17,
130 GPIO62_LCD_CS_N,
131 GPIO72_LCD_FCLK,
132 GPIO73_LCD_LCLK,
133 GPIO74_LCD_PCLK,
134 GPIO75_LCD_BIAS,
135 GPIO76_LCD_VSYNC,
136};
137
138static void __init colibri_pxa300_init_lcd(void)
139{
140 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_lcd_pin_config));
141}
142
143#else
144static inline void colibri_pxa300_init_lcd(void) {}
145#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
146
147#if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE)
148static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = {
149 GPIO24_AC97_SYSCLK,
150 GPIO23_AC97_nACRESET,
151 GPIO25_AC97_SDATA_IN_0,
152 GPIO27_AC97_SDATA_OUT,
153 GPIO28_AC97_SYNC,
154 GPIO29_AC97_BITCLK
155};
156
157static inline void __init colibri_pxa310_init_ac97(void)
158{
159 /* no AC97 codec on Colibri PXA300 */
160 if (!cpu_is_pxa310())
161 return;
162
163 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa310_ac97_pin_config));
164 pxa_set_ac97_info(NULL);
165}
166#else
167static inline void colibri_pxa310_init_ac97(void) {}
168#endif
169
170void __init colibri_pxa300_init(void)
171{
172 colibri_pxa300_init_eth();
173 colibri_pxa300_init_ohci();
174 colibri_pxa300_init_lcd();
175 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
176 colibri_pxa310_init_ac97();
177 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config),
178 mfp_to_gpio(MFP_PIN_GPIO13));
179}
180
181MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
182 .phys_io = 0x40000000,
183 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
184 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
185 .init_machine = colibri_pxa300_init,
186 .map_io = pxa_map_io,
187 .init_irq = pxa3xx_init_irq,
188 .timer = &pxa_timer,
189MACHINE_END
190
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
new file mode 100644
index 000000000000..55b74a7a6151
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -0,0 +1,187 @@
1/*
2 * arch/arm/mach-pxa/colibri-pxa320.c
3 *
4 * Support for Toradex PXA320/310 based Colibri module
5 *
6 * Daniel Mack <daniel@caiaq.de>
7 * Matthias Meier <matthias.j.meier@gmx.net>
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/kernel.h>
16#include <linux/platform_device.h>
17#include <linux/gpio.h>
18#include <net/ax88796.h>
19
20#include <asm/mach-types.h>
21#include <asm/sizes.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/irq.h>
24
25#include <mach/pxa3xx-regs.h>
26#include <mach/mfp-pxa320.h>
27#include <mach/colibri.h>
28#include <mach/pxafb.h>
29#include <mach/ohci.h>
30
31#include "generic.h"
32#include "devices.h"
33
34#if defined(CONFIG_AX88796)
35#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO)
36
37/*
38 * Asix AX88796 Ethernet
39 */
40static struct ax_plat_data colibri_asix_platdata = {
41 .flags = AXFLG_MAC_FROMDEV,
42 .wordlength = 2
43};
44
45static struct resource colibri_asix_resource[] = {
46 [0] = {
47 .start = PXA3xx_CS2_PHYS,
48 .end = PXA3xx_CS2_PHYS + (0x20 * 2) - 1,
49 .flags = IORESOURCE_MEM,
50 },
51 [1] = {
52 .start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
53 .end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
54 .flags = IORESOURCE_IRQ
55 }
56};
57
58static struct platform_device asix_device = {
59 .name = "ax88796",
60 .id = 0,
61 .num_resources = ARRAY_SIZE(colibri_asix_resource),
62 .resource = colibri_asix_resource,
63 .dev = {
64 .platform_data = &colibri_asix_platdata
65 }
66};
67
68static mfp_cfg_t colibri_pxa320_eth_pin_config[] __initdata = {
69 GPIO3_nCS2, /* AX88796 chip select */
70 GPIO36_GPIO | MFP_PULL_HIGH /* AX88796 IRQ */
71};
72
73static void __init colibri_pxa320_init_eth(void)
74{
75 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_eth_pin_config));
76 set_irq_type(gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), IRQ_TYPE_EDGE_FALLING);
77 platform_device_register(&asix_device);
78}
79#else
80static inline void __init colibri_pxa320_init_eth(void) {}
81#endif /* CONFIG_AX88796 */
82
83#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
84static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = {
85 GPIO2_2_USBH_PEN,
86 GPIO3_2_USBH_PWR,
87};
88
89static struct pxaohci_platform_data colibri_pxa320_ohci_info = {
90 .port_mode = PMM_GLOBAL_MODE,
91 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
92};
93
94void __init colibri_pxa320_init_ohci(void)
95{
96 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config));
97 pxa_set_ohci_info(&colibri_pxa320_ohci_info);
98}
99#else
100static inline void colibri_pxa320_init_ohci(void) {}
101#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
102
103static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
104 GPIO22_MMC1_CLK,
105 GPIO23_MMC1_CMD,
106 GPIO18_MMC1_DAT0,
107 GPIO19_MMC1_DAT1,
108 GPIO20_MMC1_DAT2,
109 GPIO21_MMC1_DAT3
110};
111
112#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
113static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = {
114 GPIO6_2_LCD_LDD_0,
115 GPIO7_2_LCD_LDD_1,
116 GPIO8_2_LCD_LDD_2,
117 GPIO9_2_LCD_LDD_3,
118 GPIO10_2_LCD_LDD_4,
119 GPIO11_2_LCD_LDD_5,
120 GPIO12_2_LCD_LDD_6,
121 GPIO13_2_LCD_LDD_7,
122 GPIO63_LCD_LDD_8,
123 GPIO64_LCD_LDD_9,
124 GPIO65_LCD_LDD_10,
125 GPIO66_LCD_LDD_11,
126 GPIO67_LCD_LDD_12,
127 GPIO68_LCD_LDD_13,
128 GPIO69_LCD_LDD_14,
129 GPIO70_LCD_LDD_15,
130 GPIO71_LCD_LDD_16,
131 GPIO72_LCD_LDD_17,
132 GPIO73_LCD_CS_N,
133 GPIO74_LCD_VSYNC,
134 GPIO14_2_LCD_FCLK,
135 GPIO15_2_LCD_LCLK,
136 GPIO16_2_LCD_PCLK,
137 GPIO17_2_LCD_BIAS,
138};
139
140static void __init colibri_pxa320_init_lcd(void)
141{
142 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_lcd_pin_config));
143}
144#else
145static inline void colibri_pxa320_init_lcd(void) {}
146#endif
147
148#if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE)
149static mfp_cfg_t colibri_pxa320_ac97_pin_config[] __initdata = {
150 GPIO34_AC97_SYSCLK,
151 GPIO35_AC97_SDATA_IN_0,
152 GPIO37_AC97_SDATA_OUT,
153 GPIO38_AC97_SYNC,
154 GPIO39_AC97_BITCLK,
155 GPIO40_AC97_nACRESET
156};
157
158static inline void __init colibri_pxa320_init_ac97(void)
159{
160 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_ac97_pin_config));
161 pxa_set_ac97_info(NULL);
162}
163#else
164static inline void colibri_pxa320_init_ac97(void) {}
165#endif
166
167void __init colibri_pxa320_init(void)
168{
169 colibri_pxa320_init_eth();
170 colibri_pxa320_init_ohci();
171 colibri_pxa320_init_lcd();
172 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
173 colibri_pxa320_init_ac97();
174 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
175 mfp_to_gpio(MFP_PIN_GPIO28));
176}
177
178MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
179 .phys_io = 0x40000000,
180 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
181 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
182 .init_machine = colibri_pxa320_init,
183 .map_io = pxa_map_io,
184 .init_irq = pxa3xx_init_irq,
185 .timer = &pxa_timer,
186MACHINE_END
187
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
new file mode 100644
index 000000000000..12d0afc54aa5
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -0,0 +1,121 @@
1/*
2 * arch/arm/mach-pxa/colibri-pxa3xx.c
3 *
4 * Common functions for all Toradex PXA3xx modules
5 *
6 * Daniel Mack <daniel@caiaq.de>
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/init.h>
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/gpio.h>
17#include <asm/mach-types.h>
18#include <mach/hardware.h>
19#include <asm/sizes.h>
20#include <asm/mach/arch.h>
21#include <asm/mach/irq.h>
22#include <mach/pxa3xx-regs.h>
23#include <mach/mfp-pxa300.h>
24#include <mach/colibri.h>
25#include <mach/mmc.h>
26#include <mach/pxafb.h>
27
28#include "generic.h"
29#include "devices.h"
30
31#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
32static int mmc_detect_pin;
33
34static int colibri_pxa3xx_mci_init(struct device *dev,
35 irq_handler_t colibri_mmc_detect_int,
36 void *data)
37{
38 int ret;
39
40 ret = gpio_request(mmc_detect_pin, "mmc card detect");
41 if (ret)
42 return ret;
43
44 gpio_direction_input(mmc_detect_pin);
45 ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int,
46 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
47 "MMC card detect", data);
48 if (ret) {
49 gpio_free(mmc_detect_pin);
50 return ret;
51 }
52
53 return 0;
54}
55
56static void colibri_pxa3xx_mci_exit(struct device *dev, void *data)
57{
58 free_irq(mmc_detect_pin, data);
59 gpio_free(gpio_to_irq(mmc_detect_pin));
60}
61
62static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = {
63 .detect_delay = 20,
64 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
65 .init = colibri_pxa3xx_mci_init,
66 .exit = colibri_pxa3xx_mci_exit,
67};
68
69void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
70{
71 pxa3xx_mfp_config(pins, len);
72 mmc_detect_pin = detect_pin;
73 pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data);
74}
75#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */
76
77#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
78static int lcd_bl_pin;
79
80/*
81 * LCD panel (Sharp LQ043T3DX02)
82 */
83static void colibri_lcd_backlight(int on)
84{
85 gpio_set_value(lcd_bl_pin, !!on);
86}
87
88static struct pxafb_mode_info sharp_lq43_mode = {
89 .pixclock = 101936,
90 .xres = 480,
91 .yres = 272,
92 .bpp = 32,
93 .depth = 18,
94 .hsync_len = 41,
95 .left_margin = 2,
96 .right_margin = 2,
97 .vsync_len = 10,
98 .upper_margin = 2,
99 .lower_margin = 2,
100 .sync = 0,
101 .cmap_greyscale = 0,
102};
103
104static struct pxafb_mach_info sharp_lq43_info = {
105 .modes = &sharp_lq43_mode,
106 .num_modes = 1,
107 .cmap_inverse = 0,
108 .cmap_static = 0,
109 .lcd_conn = LCD_COLOR_TFT_18BPP,
110 .pxafb_backlight_power = colibri_lcd_backlight,
111};
112
113void __init colibri_pxa3xx_init_lcd(int bl_pin)
114{
115 lcd_bl_pin = bl_pin;
116 gpio_request(bl_pin, "lcd backlight");
117 gpio_direction_output(bl_pin, 0);
118 set_pxa_fb_info(&sharp_lq43_info);
119}
120#endif
121
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index a8d91b6c136b..cdf21dd135b4 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -41,9 +41,7 @@
41#include <asm/mach/map.h> 41#include <asm/mach/map.h>
42#include <asm/mach/irq.h> 42#include <asm/mach/irq.h>
43 43
44#include <mach/pxa-regs.h> 44#include <mach/pxa25x.h>
45#include <mach/pxa2xx-regs.h>
46#include <mach/mfp-pxa25x.h>
47#include <mach/i2c.h> 45#include <mach/i2c.h>
48#include <mach/irda.h> 46#include <mach/irda.h>
49#include <mach/mmc.h> 47#include <mach/mmc.h>
@@ -637,16 +635,16 @@ static void corgi_poweroff(void)
637 /* Green LED off tells the bootloader to halt */ 635 /* Green LED off tells the bootloader to halt */
638 gpio_set_value(CORGI_GPIO_LED_GREEN, 0); 636 gpio_set_value(CORGI_GPIO_LED_GREEN, 0);
639 637
640 arm_machine_restart('h'); 638 arm_machine_restart('h', NULL);
641} 639}
642 640
643static void corgi_restart(char mode) 641static void corgi_restart(char mode, const char *cmd)
644{ 642{
645 if (!machine_is_corgi()) 643 if (!machine_is_corgi())
646 /* Green LED on tells the bootloader to reboot */ 644 /* Green LED on tells the bootloader to reboot */
647 gpio_set_value(CORGI_GPIO_LED_GREEN, 1); 645 gpio_set_value(CORGI_GPIO_LED_GREEN, 1);
648 646
649 arm_machine_restart('h'); 647 arm_machine_restart('h', cmd);
650} 648}
651 649
652static void __init corgi_init(void) 650static void __init corgi_init(void)
diff --git a/arch/arm/mach-pxa/corgi_lcd.c b/arch/arm/mach-pxa/corgi_lcd.c
index 411607bc1fc2..d9b96319d498 100644
--- a/arch/arm/mach-pxa/corgi_lcd.c
+++ b/arch/arm/mach-pxa/corgi_lcd.c
@@ -22,7 +22,6 @@
22#include <linux/string.h> 22#include <linux/string.h>
23#include <mach/corgi.h> 23#include <mach/corgi.h>
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/pxa-regs.h>
26#include <mach/sharpsl.h> 25#include <mach/sharpsl.h>
27#include <mach/spitz.h> 26#include <mach/spitz.h>
28#include <asm/hardware/scoop.h> 27#include <asm/hardware/scoop.h>
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index e35259032813..7f04b3a761d1 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/sharpsl.h> 25#include <mach/sharpsl.h>
26#include <mach/corgi.h> 26#include <mach/corgi.h>
27#include <mach/pxa-regs.h>
28#include <mach/pxa2xx-regs.h> 27#include <mach/pxa2xx-regs.h>
29#include <mach/pxa2xx-gpio.h> 28#include <mach/pxa2xx-gpio.h>
30#include "sharpsl.h" 29#include "sharpsl.h"
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index 8e2f2215c4ba..a5ee70735e04 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -20,7 +20,6 @@
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21 21
22#include <mach/ssp.h> 22#include <mach/ssp.h>
23#include <mach/pxa-regs.h>
24#include <mach/pxa2xx-gpio.h> 23#include <mach/pxa2xx-gpio.h>
25#include <mach/regs-ssp.h> 24#include <mach/regs-ssp.h>
26#include "sharpsl.h" 25#include "sharpsl.h"
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 771dd4eac935..083a1d851d49 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -37,8 +37,6 @@
37#include <linux/init.h> 37#include <linux/init.h>
38#include <linux/cpufreq.h> 38#include <linux/cpufreq.h>
39 39
40#include <mach/hardware.h>
41#include <mach/pxa-regs.h>
42#include <mach/pxa2xx-regs.h> 40#include <mach/pxa2xx-regs.h>
43 41
44#ifdef DEBUG 42#ifdef DEBUG
diff --git a/arch/arm/mach-pxa/cpufreq-pxa3xx.c b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
index 968c8309ec37..67f34a8d8e60 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa3xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
@@ -15,8 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/cpufreq.h> 16#include <linux/cpufreq.h>
17 17
18#include <mach/hardware.h>
19#include <mach/pxa-regs.h>
20#include <mach/pxa3xx-regs.h> 18#include <mach/pxa3xx-regs.h>
21 19
22#include "generic.h" 20#include "generic.h"
diff --git a/arch/arm/mach-pxa/csb701.c b/arch/arm/mach-pxa/csb701.c
new file mode 100644
index 000000000000..4a2a2952c374
--- /dev/null
+++ b/arch/arm/mach-pxa/csb701.c
@@ -0,0 +1,61 @@
1#include <linux/kernel.h>
2#include <linux/module.h>
3#include <linux/platform_device.h>
4#include <linux/gpio_keys.h>
5#include <linux/input.h>
6#include <linux/leds.h>
7
8static struct gpio_keys_button csb701_buttons[] = {
9 {
10 .code = 0x7,
11 .gpio = 1,
12 .active_low = 1,
13 .desc = "SW2",
14 .type = EV_SW,
15 .wakeup = 1,
16 },
17};
18
19static struct gpio_keys_platform_data csb701_gpio_keys_data = {
20 .buttons = csb701_buttons,
21 .nbuttons = ARRAY_SIZE(csb701_buttons),
22};
23
24static struct gpio_led csb701_leds[] = {
25 {
26 .name = "csb701:yellow:heartbeat",
27 .default_trigger = "heartbeat",
28 .gpio = 11,
29 .active_low = 1,
30 },
31};
32
33static struct platform_device csb701_gpio_keys = {
34 .name = "gpio-keys",
35 .id = -1,
36 .dev.platform_data = &csb701_gpio_keys_data,
37};
38
39static struct gpio_led_platform_data csb701_leds_gpio_data = {
40 .leds = csb701_leds,
41 .num_leds = ARRAY_SIZE(csb701_leds),
42};
43
44static struct platform_device csb701_leds_gpio = {
45 .name = "leds-gpio",
46 .id = -1,
47 .dev.platform_data = &csb701_leds_gpio_data,
48};
49
50static struct platform_device *devices[] __initdata = {
51 &csb701_gpio_keys,
52 &csb701_leds_gpio,
53};
54
55static int __init csb701_init(void)
56{
57 return platform_add_devices(devices, ARRAY_SIZE(devices));
58}
59
60module_init(csb701_init);
61
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
new file mode 100644
index 000000000000..2b289f83a61a
--- /dev/null
+++ b/arch/arm/mach-pxa/csb726.c
@@ -0,0 +1,318 @@
1/*
2 * Support for Cogent CSB726
3 *
4 * Copyright (c) 2008 Dmitry Eremin-Solenikov
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/io.h>
14#include <linux/gpio.h>
15#include <linux/platform_device.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/partitions.h>
18#include <linux/sm501.h>
19
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <mach/csb726.h>
23#include <mach/mfp-pxa27x.h>
24#include <mach/i2c.h>
25#include <mach/mmc.h>
26#include <mach/ohci.h>
27#include <mach/pxa2xx-regs.h>
28
29#include "generic.h"
30#include "devices.h"
31
32/*
33 * n/a: 2, 5, 6, 7, 8, 23, 24, 25, 26, 27, 87, 88, 89,
34 * nu: 58 -- 77, 90, 91, 93, 102, 105-108, 114-116,
35 * XXX: 21,
36 * XXX: 79 CS_3 for LAN9215 or PSKTSEL on R2, R3
37 * XXX: 33 CS_5 for LAN9215 on R1
38 */
39
40static unsigned long csb726_pin_config[] = {
41 GPIO78_nCS_2, /* EXP_CS */
42 GPIO79_nCS_3, /* SMSC9215 */
43 GPIO80_nCS_4, /* SM501 */
44
45 GPIO52_GPIO, /* #SMSC9251 int */
46 GPIO53_GPIO, /* SM501 int */
47
48 GPIO1_GPIO, /* GPIO0 */
49 GPIO11_GPIO, /* GPIO1 */
50 GPIO9_GPIO, /* GPIO2 */
51 GPIO10_GPIO, /* GPIO3 */
52 GPIO16_PWM0_OUT, /* or GPIO4 */
53 GPIO17_PWM1_OUT, /* or GPIO5 */
54 GPIO94_GPIO, /* GPIO6 */
55 GPIO95_GPIO, /* GPIO7 */
56 GPIO96_GPIO, /* GPIO8 */
57 GPIO97_GPIO, /* GPIO9 */
58 GPIO15_GPIO, /* EXP_IRQ */
59 GPIO18_RDY, /* EXP_WAIT */
60
61 GPIO0_GPIO, /* PWR_INT */
62 GPIO104_GPIO, /* PWR_OFF */
63
64 GPIO12_GPIO, /* touch irq */
65
66 GPIO13_SSP2_TXD,
67 GPIO14_SSP2_SFRM,
68 MFP_CFG_OUT(GPIO19, AF1, DRIVE_LOW),/* SSP2_SYSCLK */
69 GPIO22_SSP2_SCLK,
70
71 GPIO81_SSP3_TXD,
72 GPIO82_SSP3_RXD,
73 GPIO83_SSP3_SFRM,
74 GPIO84_SSP3_SCLK,
75
76 GPIO20_GPIO, /* SDIO int */
77 GPIO32_MMC_CLK,
78 GPIO92_MMC_DAT_0,
79 GPIO109_MMC_DAT_1,
80 GPIO110_MMC_DAT_2,
81 GPIO111_MMC_DAT_3,
82 GPIO112_MMC_CMD,
83 GPIO100_GPIO, /* SD CD */
84 GPIO101_GPIO, /* SD WP */
85
86 GPIO28_AC97_BITCLK,
87 GPIO29_AC97_SDATA_IN_0,
88 GPIO30_AC97_SDATA_OUT,
89 GPIO31_AC97_SYNC,
90 GPIO113_AC97_nRESET,
91
92 GPIO34_FFUART_RXD,
93 GPIO35_FFUART_CTS,
94 GPIO36_FFUART_DCD,
95 GPIO37_FFUART_DSR,
96 GPIO38_FFUART_RI,
97 GPIO39_FFUART_TXD,
98 GPIO40_FFUART_DTR,
99 GPIO41_FFUART_RTS,
100
101 GPIO42_BTUART_RXD,
102 GPIO43_BTUART_TXD,
103 GPIO44_BTUART_CTS,
104 GPIO45_BTUART_RTS,
105
106 GPIO46_STUART_RXD,
107 GPIO47_STUART_TXD,
108
109 GPIO48_nPOE,
110 GPIO49_nPWE,
111 GPIO50_nPIOR,
112 GPIO51_nPIOW,
113 GPIO54_nPCE_2,
114 GPIO55_nPREG,
115 GPIO56_nPWAIT,
116 GPIO57_nIOIS16, /* maybe unused */
117 GPIO85_nPCE_1,
118 GPIO98_GPIO, /* CF IRQ */
119 GPIO99_GPIO, /* CF CD */
120 GPIO103_GPIO, /* Reset */
121
122 GPIO117_I2C_SCL,
123 GPIO118_I2C_SDA,
124};
125
126static struct pxamci_platform_data csb726_mci_data;
127
128static int csb726_mci_init(struct device *dev,
129 irq_handler_t detect, void *data)
130{
131 int err;
132
133 csb726_mci_data.detect_delay = msecs_to_jiffies(500);
134
135 err = gpio_request(CSB726_GPIO_MMC_DETECT, "MMC detect");
136 if (err)
137 goto err_det_req;
138
139 err = gpio_direction_input(CSB726_GPIO_MMC_DETECT);
140 if (err)
141 goto err_det_dir;
142
143 err = gpio_request(CSB726_GPIO_MMC_RO, "MMC ro");
144 if (err)
145 goto err_ro_req;
146
147 err = gpio_direction_input(CSB726_GPIO_MMC_RO);
148 if (err)
149 goto err_ro_dir;
150
151 err = request_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), detect,
152 IRQF_DISABLED, "MMC card detect", data);
153 if (err)
154 goto err_irq;
155
156 return 0;
157
158err_irq:
159err_ro_dir:
160 gpio_free(CSB726_GPIO_MMC_RO);
161err_ro_req:
162err_det_dir:
163 gpio_free(CSB726_GPIO_MMC_DETECT);
164err_det_req:
165 return err;
166}
167
168static int csb726_mci_get_ro(struct device *dev)
169{
170 return gpio_get_value(CSB726_GPIO_MMC_RO);
171}
172
173static void csb726_mci_exit(struct device *dev, void *data)
174{
175 free_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), data);
176 gpio_free(CSB726_GPIO_MMC_RO);
177 gpio_free(CSB726_GPIO_MMC_DETECT);
178}
179
180static struct pxamci_platform_data csb726_mci = {
181 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
182 .init = csb726_mci_init,
183 .get_ro = csb726_mci_get_ro,
184 /* FIXME setpower */
185 .exit = csb726_mci_exit,
186};
187
188static struct pxaohci_platform_data csb726_ohci_platform_data = {
189 .port_mode = PMM_NPS_MODE,
190 .flags = ENABLE_PORT1 | NO_OC_PROTECTION,
191};
192
193static struct mtd_partition csb726_flash_partitions[] = {
194 {
195 .name = "Bootloader",
196 .offset = 0,
197 .size = CSB726_FLASH_uMON,
198 .mask_flags = MTD_WRITEABLE /* force read-only */
199 },
200 {
201 .name = "root",
202 .offset = MTDPART_OFS_APPEND,
203 .size = MTDPART_SIZ_FULL,
204 }
205};
206
207static struct physmap_flash_data csb726_flash_data = {
208 .width = 2,
209 .parts = csb726_flash_partitions,
210 .nr_parts = ARRAY_SIZE(csb726_flash_partitions),
211};
212
213static struct resource csb726_flash_resources[] = {
214 {
215 .start = PXA_CS0_PHYS,
216 .end = PXA_CS0_PHYS + CSB726_FLASH_SIZE - 1 ,
217 .flags = IORESOURCE_MEM,
218 }
219};
220
221static struct platform_device csb726_flash = {
222 .name = "physmap-flash",
223 .dev = {
224 .platform_data = &csb726_flash_data,
225 },
226 .resource = csb726_flash_resources,
227 .num_resources = ARRAY_SIZE(csb726_flash_resources),
228};
229
230static struct resource csb726_sm501_resources[] = {
231 {
232 .start = PXA_CS4_PHYS,
233 .end = PXA_CS4_PHYS + SZ_8M - 1,
234 .flags = IORESOURCE_MEM,
235 .name = "sm501-localmem",
236 },
237 {
238 .start = PXA_CS4_PHYS + SZ_64M - SZ_2M,
239 .end = PXA_CS4_PHYS + SZ_64M - 1,
240 .flags = IORESOURCE_MEM,
241 .name = "sm501-regs",
242 },
243 {
244 .start = CSB726_IRQ_SM501,
245 .end = CSB726_IRQ_SM501,
246 .flags = IORESOURCE_IRQ,
247 },
248};
249
250static struct sm501_initdata csb726_sm501_initdata = {
251/* .devices = SM501_USE_USB_HOST, */
252 .devices = SM501_USE_USB_HOST | SM501_USE_UART0 | SM501_USE_UART1,
253};
254
255static struct sm501_platdata csb726_sm501_platdata = {
256 .init = &csb726_sm501_initdata,
257};
258
259static struct platform_device csb726_sm501 = {
260 .name = "sm501",
261 .id = 0,
262 .num_resources = ARRAY_SIZE(csb726_sm501_resources),
263 .resource = csb726_sm501_resources,
264 .dev = {
265 .platform_data = &csb726_sm501_platdata,
266 },
267};
268
269static struct resource csb726_lan_resources[] = {
270 {
271 .start = PXA_CS3_PHYS,
272 .end = PXA_CS3_PHYS + SZ_64K - 1,
273 .flags = IORESOURCE_MEM,
274 },
275 {
276 .start = CSB726_IRQ_LAN,
277 .end = CSB726_IRQ_LAN,
278 .flags = IORESOURCE_IRQ,
279 },
280};
281
282static struct platform_device csb726_lan = {
283 .name = "smc911x",
284 .id = -1,
285 .num_resources = ARRAY_SIZE(csb726_lan_resources),
286 .resource = csb726_lan_resources,
287};
288
289static struct platform_device *devices[] __initdata = {
290 &csb726_flash,
291 &csb726_sm501,
292 &csb726_lan,
293};
294
295static void __init csb726_init(void)
296{
297 pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config));
298/* MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */
299/* MSC2 = 0x06697ff4; *//* none/SM501 */
300 MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */
301
302 pxa_set_i2c_info(NULL);
303 pxa27x_set_i2c_power_info(NULL);
304 pxa_set_mci_info(&csb726_mci);
305 pxa_set_ohci_info(&csb726_ohci_platform_data);
306
307 platform_add_devices(devices, ARRAY_SIZE(devices));
308}
309
310MACHINE_START(CSB726, "Cogent CSB726")
311 .phys_io = 0x40000000,
312 .boot_params = 0xa0000100,
313 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
314 .map_io = pxa_map_io,
315 .init_irq = pxa27x_init_irq,
316 .init_machine = csb726_init,
317 .timer = &pxa_timer,
318MACHINE_END
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index e16f8e3d58d3..d245e59c51b1 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -4,7 +4,6 @@
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/pxa-regs.h>
8#include <mach/udc.h> 7#include <mach/udc.h>
9#include <mach/pxafb.h> 8#include <mach/pxafb.h>
10#include <mach/mmc.h> 9#include <mach/mmc.h>
diff --git a/arch/arm/mach-pxa/e330.c b/arch/arm/mach-pxa/e330.c
index 1bd7f740427c..74d3f8987c5c 100644
--- a/arch/arm/mach-pxa/e330.c
+++ b/arch/arm/mach-pxa/e330.c
@@ -20,9 +20,7 @@
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22 22
23#include <mach/mfp-pxa25x.h> 23#include <mach/pxa25x.h>
24#include <mach/hardware.h>
25#include <mach/pxa-regs.h>
26#include <mach/eseries-gpio.h> 24#include <mach/eseries-gpio.h>
27#include <mach/udc.h> 25#include <mach/udc.h>
28 26
diff --git a/arch/arm/mach-pxa/e350.c b/arch/arm/mach-pxa/e350.c
index edcd9d5ce545..080036272131 100644
--- a/arch/arm/mach-pxa/e350.c
+++ b/arch/arm/mach-pxa/e350.c
@@ -21,9 +21,7 @@
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22 22
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24#include <mach/mfp-pxa25x.h> 24#include <mach/pxa25x.h>
25#include <mach/pxa-regs.h>
26#include <mach/hardware.h>
27#include <mach/eseries-gpio.h> 25#include <mach/eseries-gpio.h>
28#include <mach/udc.h> 26#include <mach/udc.h>
29 27
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c
index 77bb8e2c48c0..ed9c0c3f64a2 100644
--- a/arch/arm/mach-pxa/e400.c
+++ b/arch/arm/mach-pxa/e400.c
@@ -22,9 +22,7 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <mach/mfp-pxa25x.h> 25#include <mach/pxa25x.h>
26#include <mach/pxa-regs.h>
27#include <mach/hardware.h>
28#include <mach/eseries-gpio.h> 26#include <mach/eseries-gpio.h>
29#include <mach/pxafb.h> 27#include <mach/pxafb.h>
30#include <mach/udc.h> 28#include <mach/udc.h>
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c
index 6d48e00f4f0b..07500a04fd8c 100644
--- a/arch/arm/mach-pxa/e740.c
+++ b/arch/arm/mach-pxa/e740.c
@@ -24,9 +24,7 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26 26
27#include <mach/mfp-pxa25x.h> 27#include <mach/pxa25x.h>
28#include <mach/pxa-regs.h>
29#include <mach/hardware.h>
30#include <mach/eseries-gpio.h> 28#include <mach/eseries-gpio.h>
31#include <mach/udc.h> 29#include <mach/udc.h>
32#include <mach/irda.h> 30#include <mach/irda.h>
@@ -135,6 +133,11 @@ static unsigned long e740_pin_config[] __initdata = {
135 /* IrDA */ 133 /* IrDA */
136 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, 134 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
137 135
136 /* Audio power control */
137 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
138 GPIO40_GPIO, /* Mic amp power */
139 GPIO41_GPIO, /* Headphone amp power */
140
138 /* PC Card */ 141 /* PC Card */
139 GPIO8_GPIO, /* CD0 */ 142 GPIO8_GPIO, /* CD0 */
140 GPIO44_GPIO, /* CD1 */ 143 GPIO44_GPIO, /* CD1 */
@@ -189,7 +192,7 @@ static void __init e740_init(void)
189{ 192{
190 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); 193 pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
191 eseries_register_clks(); 194 eseries_register_clks();
192 clk_add_alias("CLK_CK48M", &e740_t7l66xb_device.dev, 195 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
193 "UDCCLK", &pxa25x_device_udc.dev), 196 "UDCCLK", &pxa25x_device_udc.dev),
194 eseries_get_tmio_gpios(); 197 eseries_get_tmio_gpios();
195 platform_add_devices(devices, ARRAY_SIZE(devices)); 198 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
index be1ab8edb973..6126c04e02bc 100644
--- a/arch/arm/mach-pxa/e750.c
+++ b/arch/arm/mach-pxa/e750.c
@@ -23,9 +23,7 @@
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/mfp-pxa25x.h> 26#include <mach/pxa25x.h>
27#include <mach/pxa-regs.h>
28#include <mach/hardware.h>
29#include <mach/eseries-gpio.h> 27#include <mach/eseries-gpio.h>
30#include <mach/udc.h> 28#include <mach/udc.h>
31#include <mach/irda.h> 29#include <mach/irda.h>
@@ -133,6 +131,11 @@ static unsigned long e750_pin_config[] __initdata = {
133 /* IrDA */ 131 /* IrDA */
134 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, 132 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
135 133
134 /* Audio power control */
135 GPIO4_GPIO, /* Headphone amp power */
136 GPIO7_GPIO, /* Speaker amp power */
137 GPIO37_GPIO, /* Headphone detect */
138
136 /* PC Card */ 139 /* PC Card */
137 GPIO8_GPIO, /* CD0 */ 140 GPIO8_GPIO, /* CD0 */
138 GPIO44_GPIO, /* CD1 */ 141 GPIO44_GPIO, /* CD1 */
@@ -190,7 +193,7 @@ static struct platform_device *devices[] __initdata = {
190static void __init e750_init(void) 193static void __init e750_init(void)
191{ 194{
192 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config)); 195 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
193 clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev, 196 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
194 "GPIO11_CLK", NULL), 197 "GPIO11_CLK", NULL),
195 eseries_get_tmio_gpios(); 198 eseries_get_tmio_gpios();
196 platform_add_devices(devices, ARRAY_SIZE(devices)); 199 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index cc9b1293e866..74ab09812a72 100644
--- a/arch/arm/mach-pxa/e800.c
+++ b/arch/arm/mach-pxa/e800.c
@@ -23,9 +23,7 @@
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/mfp-pxa25x.h> 26#include <mach/pxa25x.h>
27#include <mach/pxa-regs.h>
28#include <mach/hardware.h>
29#include <mach/eseries-gpio.h> 27#include <mach/eseries-gpio.h>
30#include <mach/udc.h> 28#include <mach/udc.h>
31#include <mach/irqs.h> 29#include <mach/irqs.h>
@@ -196,7 +194,7 @@ static struct platform_device *devices[] __initdata = {
196 194
197static void __init e800_init(void) 195static void __init e800_init(void)
198{ 196{
199 clk_add_alias("CLK_CK3P6MI", &e800_tc6393xb_device.dev, 197 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
200 "GPIO11_CLK", NULL), 198 "GPIO11_CLK", NULL),
201 eseries_get_tmio_gpios(); 199 eseries_get_tmio_gpios();
202 platform_add_devices(devices, ARRAY_SIZE(devices)); 200 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index f5ed8038ede5..920dfb8d36da 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -11,40 +11,63 @@
11 11
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/delay.h>
14 15
15#include <linux/dm9000.h> 16#include <linux/dm9000.h>
16#include <linux/rtc-v3020.h> 17#include <linux/rtc-v3020.h>
17#include <linux/mtd/nand.h> 18#include <linux/mtd/nand.h>
18#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20#include <linux/mtd/physmap.h>
19#include <linux/input.h> 21#include <linux/input.h>
20#include <linux/gpio_keys.h> 22#include <linux/gpio_keys.h>
21#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/mfd/da903x.h>
25#include <linux/regulator/machine.h>
26#include <linux/spi/spi.h>
27#include <linux/spi/tdo24m.h>
28#include <linux/power_supply.h>
29#include <linux/apm-emulation.h>
30
31#include <media/soc_camera.h>
22 32
23#include <asm/mach-types.h> 33#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
25 35
26#include <mach/mfp-pxa27x.h> 36#include <mach/pxa27x.h>
27#include <mach/pxa-regs.h>
28#include <mach/pxa27x-udc.h> 37#include <mach/pxa27x-udc.h>
29#include <mach/audio.h> 38#include <mach/audio.h>
30#include <mach/pxafb.h> 39#include <mach/pxafb.h>
31#include <mach/ohci.h> 40#include <mach/ohci.h>
32#include <mach/mmc.h> 41#include <mach/mmc.h>
33#include <mach/pxa27x_keypad.h> 42#include <mach/pxa27x_keypad.h>
43#include <mach/i2c.h>
44#include <mach/camera.h>
45#include <mach/pxa2xx_spi.h>
34 46
35#include "generic.h" 47#include "generic.h"
48#include "devices.h"
36 49
37/* GPIO IRQ usage */ 50/* EM-X270 specific GPIOs */
38#define GPIO41_ETHIRQ (41)
39#define GPIO13_MMC_CD (13) 51#define GPIO13_MMC_CD (13)
52#define GPIO95_MMC_WP (95)
53#define GPIO56_NAND_RB (56)
54
55/* eXeda specific GPIOs */
56#define GPIO114_MMC_CD (114)
57#define GPIO20_NAND_RB (20)
58#define GPIO38_SD_PWEN (38)
59
60/* common GPIOs */
61#define GPIO11_NAND_CS (11)
62#define GPIO93_CAM_RESET (93)
63#define GPIO41_ETHIRQ (41)
40#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) 64#define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ)
41#define EM_X270_MMC_CD IRQ_GPIO(GPIO13_MMC_CD)
42 65
43/* NAND control GPIOs */ 66static int mmc_cd;
44#define GPIO11_NAND_CS (11) 67static int nand_rb;
45#define GPIO56_NAND_RB (56) 68static int dm9000_flags;
46 69
47static unsigned long em_x270_pin_config[] = { 70static unsigned long common_pin_config[] = {
48 /* AC'97 */ 71 /* AC'97 */
49 GPIO28_AC97_BITCLK, 72 GPIO28_AC97_BITCLK,
50 GPIO29_AC97_SDATA_IN_0, 73 GPIO29_AC97_SDATA_IN_0,
@@ -150,21 +173,32 @@ static unsigned long em_x270_pin_config[] = {
150 GPIO18_RDY, 173 GPIO18_RDY,
151 174
152 /* GPIO */ 175 /* GPIO */
153 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, 176 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, /* sleep/resume button */
154 177
155 /* power controls */ 178 /* power controls */
156 GPIO20_GPIO | MFP_LPM_DRIVE_LOW, /* GPRS_PWEN */ 179 GPIO20_GPIO | MFP_LPM_DRIVE_LOW, /* GPRS_PWEN */
180 GPIO93_GPIO | MFP_LPM_DRIVE_LOW, /* Camera reset */
157 GPIO115_GPIO | MFP_LPM_DRIVE_LOW, /* WLAN_PWEN */ 181 GPIO115_GPIO | MFP_LPM_DRIVE_LOW, /* WLAN_PWEN */
158 182
159 /* NAND controls */ 183 /* NAND controls */
160 GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */ 184 GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */
161 GPIO56_GPIO, /* NAND Ready/Busy */
162 185
163 /* interrupts */ 186 /* interrupts */
164 GPIO13_GPIO, /* MMC card detect */
165 GPIO41_GPIO, /* DM9000 interrupt */ 187 GPIO41_GPIO, /* DM9000 interrupt */
166}; 188};
167 189
190static unsigned long em_x270_pin_config[] = {
191 GPIO13_GPIO, /* MMC card detect */
192 GPIO56_GPIO, /* NAND Ready/Busy */
193 GPIO95_GPIO, /* MMC Write protect */
194};
195
196static unsigned long exeda_pin_config[] = {
197 GPIO20_GPIO, /* NAND Ready/Busy */
198 GPIO38_GPIO | MFP_LPM_DRIVE_LOW, /* SD slot power */
199 GPIO114_GPIO, /* MMC card detect */
200};
201
168#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 202#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
169static struct resource em_x270_dm9000_resource[] = { 203static struct resource em_x270_dm9000_resource[] = {
170 [0] = { 204 [0] = {
@@ -185,7 +219,7 @@ static struct resource em_x270_dm9000_resource[] = {
185}; 219};
186 220
187static struct dm9000_plat_data em_x270_dm9000_platdata = { 221static struct dm9000_plat_data em_x270_dm9000_platdata = {
188 .flags = DM9000_PLATF_32BITONLY, 222 .flags = DM9000_PLATF_NO_EEPROM,
189}; 223};
190 224
191static struct platform_device em_x270_dm9000 = { 225static struct platform_device em_x270_dm9000 = {
@@ -200,6 +234,7 @@ static struct platform_device em_x270_dm9000 = {
200 234
201static void __init em_x270_init_dm9000(void) 235static void __init em_x270_init_dm9000(void)
202{ 236{
237 em_x270_dm9000_platdata.flags |= dm9000_flags;
203 platform_device_register(&em_x270_dm9000); 238 platform_device_register(&em_x270_dm9000);
204} 239}
205#else 240#else
@@ -289,7 +324,7 @@ static int em_x270_nand_device_ready(struct mtd_info *mtd)
289{ 324{
290 dsb(); 325 dsb();
291 326
292 return gpio_get_value(GPIO56_NAND_RB); 327 return gpio_get_value(nand_rb);
293} 328}
294 329
295static struct mtd_partition em_x270_partition_info[] = { 330static struct mtd_partition em_x270_partition_info[] = {
@@ -354,14 +389,14 @@ static void __init em_x270_init_nand(void)
354 389
355 gpio_direction_output(GPIO11_NAND_CS, 1); 390 gpio_direction_output(GPIO11_NAND_CS, 1);
356 391
357 err = gpio_request(GPIO56_NAND_RB, "NAND R/B"); 392 err = gpio_request(nand_rb, "NAND R/B");
358 if (err) { 393 if (err) {
359 pr_warning("EM-X270: failed to request NAND R/B gpio\n"); 394 pr_warning("EM-X270: failed to request NAND R/B gpio\n");
360 gpio_free(GPIO11_NAND_CS); 395 gpio_free(GPIO11_NAND_CS);
361 return; 396 return;
362 } 397 }
363 398
364 gpio_direction_input(GPIO56_NAND_RB); 399 gpio_direction_input(nand_rb);
365 400
366 platform_device_register(&em_x270_nand); 401 platform_device_register(&em_x270_nand);
367} 402}
@@ -369,6 +404,61 @@ static void __init em_x270_init_nand(void)
369static inline void em_x270_init_nand(void) {} 404static inline void em_x270_init_nand(void) {}
370#endif 405#endif
371 406
407#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
408static struct mtd_partition em_x270_nor_parts[] = {
409 {
410 .name = "Bootloader",
411 .offset = 0x00000000,
412 .size = 0x00050000,
413 .mask_flags = MTD_WRITEABLE /* force read-only */
414 }, {
415 .name = "Environment",
416 .offset = 0x00050000,
417 .size = 0x00010000,
418 }, {
419 .name = "Reserved",
420 .offset = 0x00060000,
421 .size = 0x00050000,
422 .mask_flags = MTD_WRITEABLE /* force read-only */
423 }, {
424 .name = "Splashscreen",
425 .offset = 0x000b0000,
426 .size = 0x00050000,
427 }
428};
429
430static struct physmap_flash_data em_x270_nor_data[] = {
431 [0] = {
432 .width = 2,
433 .parts = em_x270_nor_parts,
434 .nr_parts = ARRAY_SIZE(em_x270_nor_parts),
435 },
436};
437
438static struct resource em_x270_nor_flash_resource = {
439 .start = PXA_CS0_PHYS,
440 .end = PXA_CS0_PHYS + SZ_1M - 1,
441 .flags = IORESOURCE_MEM,
442};
443
444static struct platform_device em_x270_physmap_flash = {
445 .name = "physmap-flash",
446 .id = 0,
447 .num_resources = 1,
448 .resource = &em_x270_nor_flash_resource,
449 .dev = {
450 .platform_data = &em_x270_nor_data,
451 },
452};
453
454static void __init em_x270_init_nor(void)
455{
456 platform_device_register(&em_x270_physmap_flash);
457}
458#else
459static inline void em_x270_init_nor(void) {}
460#endif
461
372/* PXA27x OHCI controller setup */ 462/* PXA27x OHCI controller setup */
373#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 463#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
374static int em_x270_ohci_init(struct device *dev) 464static int em_x270_ohci_init(struct device *dev)
@@ -395,40 +485,93 @@ static inline void em_x270_init_ohci(void) {}
395 485
396/* MCI controller setup */ 486/* MCI controller setup */
397#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE) 487#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
488static struct regulator *em_x270_sdio_ldo;
489
398static int em_x270_mci_init(struct device *dev, 490static int em_x270_mci_init(struct device *dev,
399 irq_handler_t em_x270_detect_int, 491 irq_handler_t em_x270_detect_int,
400 void *data) 492 void *data)
401{ 493{
402 int err = request_irq(EM_X270_MMC_CD, em_x270_detect_int, 494 int err;
403 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 495
496 em_x270_sdio_ldo = regulator_get(dev, "vcc sdio");
497 if (IS_ERR(em_x270_sdio_ldo)) {
498 dev_err(dev, "can't request SDIO power supply: %ld\n",
499 PTR_ERR(em_x270_sdio_ldo));
500 return PTR_ERR(em_x270_sdio_ldo);
501 }
502
503 err = request_irq(gpio_to_irq(mmc_cd), em_x270_detect_int,
504 IRQF_DISABLED | IRQF_TRIGGER_RISING |
505 IRQF_TRIGGER_FALLING,
404 "MMC card detect", data); 506 "MMC card detect", data);
405 if (err) { 507 if (err) {
406 printk(KERN_ERR "%s: can't request MMC card detect IRQ: %d\n", 508 dev_err(dev, "can't request MMC card detect IRQ: %d\n", err);
407 __func__, err); 509 goto err_irq;
408 return err; 510 }
511
512 if (machine_is_em_x270()) {
513 err = gpio_request(GPIO95_MMC_WP, "MMC WP");
514 if (err) {
515 dev_err(dev, "can't request MMC write protect: %d\n",
516 err);
517 goto err_gpio_wp;
518 }
519 gpio_direction_input(GPIO95_MMC_WP);
520 } else {
521 err = gpio_request(GPIO38_SD_PWEN, "sdio power");
522 if (err) {
523 dev_err(dev, "can't request MMC power control : %d\n",
524 err);
525 goto err_gpio_wp;
526 }
527 gpio_direction_output(GPIO38_SD_PWEN, 1);
409 } 528 }
410 529
411 return 0; 530 return 0;
531
532err_gpio_wp:
533 free_irq(gpio_to_irq(mmc_cd), data);
534err_irq:
535 regulator_put(em_x270_sdio_ldo);
536
537 return err;
412} 538}
413 539
414static void em_x270_mci_setpower(struct device *dev, unsigned int vdd) 540static void em_x270_mci_setpower(struct device *dev, unsigned int vdd)
415{ 541{
416 /* 542 struct pxamci_platform_data* p_d = dev->platform_data;
417 FIXME: current hardware implementation does not allow to 543
418 enable/disable MMC power. This will be fixed in next HW releases, 544 if ((1 << vdd) & p_d->ocr_mask) {
419 and we'll need to add implmentation here. 545 int vdd_uV = (2000 + (vdd - __ffs(MMC_VDD_20_21)) * 100) * 1000;
420 */ 546
421 return; 547 regulator_set_voltage(em_x270_sdio_ldo, vdd_uV, vdd_uV);
548 regulator_enable(em_x270_sdio_ldo);
549 } else {
550 regulator_disable(em_x270_sdio_ldo);
551 }
422} 552}
423 553
424static void em_x270_mci_exit(struct device *dev, void *data) 554static void em_x270_mci_exit(struct device *dev, void *data)
425{ 555{
426 int irq = gpio_to_irq(GPIO13_MMC_CD); 556 free_irq(gpio_to_irq(mmc_cd), data);
427 free_irq(irq, data); 557 regulator_put(em_x270_sdio_ldo);
558
559 if (machine_is_em_x270())
560 gpio_free(GPIO95_MMC_WP);
561 else
562 gpio_free(GPIO38_SD_PWEN);
563}
564
565static int em_x270_mci_get_ro(struct device *dev)
566{
567 return gpio_get_value(GPIO95_MMC_WP);
428} 568}
429 569
430static struct pxamci_platform_data em_x270_mci_platform_data = { 570static struct pxamci_platform_data em_x270_mci_platform_data = {
431 .ocr_mask = MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31, 571 .ocr_mask = MMC_VDD_20_21|MMC_VDD_21_22|MMC_VDD_22_23|
572 MMC_VDD_24_25|MMC_VDD_25_26|MMC_VDD_26_27|
573 MMC_VDD_27_28|MMC_VDD_28_29|MMC_VDD_29_30|
574 MMC_VDD_30_31|MMC_VDD_31_32,
432 .init = em_x270_mci_init, 575 .init = em_x270_mci_init,
433 .setpower = em_x270_mci_setpower, 576 .setpower = em_x270_mci_setpower,
434 .exit = em_x270_mci_exit, 577 .exit = em_x270_mci_exit,
@@ -436,33 +579,53 @@ static struct pxamci_platform_data em_x270_mci_platform_data = {
436 579
437static void __init em_x270_init_mmc(void) 580static void __init em_x270_init_mmc(void)
438{ 581{
582 if (machine_is_em_x270())
583 em_x270_mci_platform_data.get_ro = em_x270_mci_get_ro;
584
585 em_x270_mci_platform_data.detect_delay = msecs_to_jiffies(250);
439 pxa_set_mci_info(&em_x270_mci_platform_data); 586 pxa_set_mci_info(&em_x270_mci_platform_data);
440} 587}
441#else 588#else
442static inline void em_x270_init_mmc(void) {} 589static inline void em_x270_init_mmc(void) {}
443#endif 590#endif
444 591
445/* LCD 480x640 */ 592/* LCD */
446#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) 593#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
447static struct pxafb_mode_info em_x270_lcd_mode = { 594static struct pxafb_mode_info em_x270_lcd_modes[] = {
448 .pixclock = 50000, 595 [0] = {
449 .bpp = 16, 596 .pixclock = 38250,
450 .xres = 480, 597 .bpp = 16,
451 .yres = 640, 598 .xres = 480,
452 .hsync_len = 8, 599 .yres = 640,
453 .vsync_len = 2, 600 .hsync_len = 8,
454 .left_margin = 8, 601 .vsync_len = 2,
455 .upper_margin = 0, 602 .left_margin = 8,
456 .right_margin = 24, 603 .upper_margin = 2,
457 .lower_margin = 4, 604 .right_margin = 24,
458 .cmap_greyscale = 0, 605 .lower_margin = 4,
606 .sync = 0,
607 },
608 [1] = {
609 .pixclock = 153800,
610 .bpp = 16,
611 .xres = 240,
612 .yres = 320,
613 .hsync_len = 8,
614 .vsync_len = 2,
615 .left_margin = 8,
616 .upper_margin = 2,
617 .right_margin = 88,
618 .lower_margin = 2,
619 .sync = 0,
620 },
459}; 621};
460 622
461static struct pxafb_mach_info em_x270_lcd = { 623static struct pxafb_mach_info em_x270_lcd = {
462 .modes = &em_x270_lcd_mode, 624 .modes = em_x270_lcd_modes,
463 .num_modes = 1, 625 .num_modes = 2,
464 .lcd_conn = LCD_COLOR_TFT_16BPP, 626 .lcd_conn = LCD_COLOR_TFT_16BPP,
465}; 627};
628
466static void __init em_x270_init_lcd(void) 629static void __init em_x270_init_lcd(void)
467{ 630{
468 set_pxa_fb_info(&em_x270_lcd); 631 set_pxa_fb_info(&em_x270_lcd);
@@ -471,6 +634,40 @@ static void __init em_x270_init_lcd(void)
471static inline void em_x270_init_lcd(void) {} 634static inline void em_x270_init_lcd(void) {}
472#endif 635#endif
473 636
637#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
638static struct pxa2xx_spi_master em_x270_spi_info = {
639 .num_chipselect = 1,
640};
641
642static struct pxa2xx_spi_chip em_x270_tdo24m_chip = {
643 .rx_threshold = 1,
644 .tx_threshold = 1,
645};
646
647static struct tdo24m_platform_data em_x270_tdo24m_pdata = {
648 .model = TDO35S,
649};
650
651static struct spi_board_info em_x270_spi_devices[] __initdata = {
652 {
653 .modalias = "tdo24m",
654 .max_speed_hz = 1000000,
655 .bus_num = 1,
656 .chip_select = 0,
657 .controller_data = &em_x270_tdo24m_chip,
658 .platform_data = &em_x270_tdo24m_pdata,
659 },
660};
661
662static void __init em_x270_init_spi(void)
663{
664 pxa2xx_set_spi_info(1, &em_x270_spi_info);
665 spi_register_board_info(ARRAY_AND_SIZE(em_x270_spi_devices));
666}
667#else
668static inline void em_x270_init_spi(void) {}
669#endif
670
474#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE) 671#if defined(CONFIG_SND_PXA2XX_AC97) || defined(CONFIG_SND_PXA2XX_AC97_MODULE)
475static void __init em_x270_init_ac97(void) 672static void __init em_x270_init_ac97(void)
476{ 673{
@@ -481,23 +678,76 @@ static inline void em_x270_init_ac97(void) {}
481#endif 678#endif
482 679
483#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) 680#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
484static unsigned int em_x270_matrix_keys[] = { 681static unsigned int em_x270_module_matrix_keys[] = {
485 KEY(0, 0, KEY_A), KEY(1, 0, KEY_UP), KEY(2, 1, KEY_B), 682 KEY(0, 0, KEY_A), KEY(1, 0, KEY_UP), KEY(2, 1, KEY_B),
486 KEY(0, 2, KEY_LEFT), KEY(1, 1, KEY_ENTER), KEY(2, 0, KEY_RIGHT), 683 KEY(0, 2, KEY_LEFT), KEY(1, 1, KEY_ENTER), KEY(2, 0, KEY_RIGHT),
487 KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D), 684 KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D),
488}; 685};
489 686
490struct pxa27x_keypad_platform_data em_x270_keypad_info = { 687struct pxa27x_keypad_platform_data em_x270_module_keypad_info = {
491 /* code map for the matrix keys */ 688 /* code map for the matrix keys */
492 .matrix_key_rows = 3, 689 .matrix_key_rows = 3,
493 .matrix_key_cols = 3, 690 .matrix_key_cols = 3,
494 .matrix_key_map = em_x270_matrix_keys, 691 .matrix_key_map = em_x270_module_matrix_keys,
495 .matrix_key_map_size = ARRAY_SIZE(em_x270_matrix_keys), 692 .matrix_key_map_size = ARRAY_SIZE(em_x270_module_matrix_keys),
693};
694
695static unsigned int em_x270_exeda_matrix_keys[] = {
696 KEY(0, 0, KEY_RIGHTSHIFT), KEY(0, 1, KEY_RIGHTCTRL),
697 KEY(0, 2, KEY_RIGHTALT), KEY(0, 3, KEY_SPACE),
698 KEY(0, 4, KEY_LEFTALT), KEY(0, 5, KEY_LEFTCTRL),
699 KEY(0, 6, KEY_ENTER), KEY(0, 7, KEY_SLASH),
700
701 KEY(1, 0, KEY_DOT), KEY(1, 1, KEY_M),
702 KEY(1, 2, KEY_N), KEY(1, 3, KEY_B),
703 KEY(1, 4, KEY_V), KEY(1, 5, KEY_C),
704 KEY(1, 6, KEY_X), KEY(1, 7, KEY_Z),
705
706 KEY(2, 0, KEY_LEFTSHIFT), KEY(2, 1, KEY_SEMICOLON),
707 KEY(2, 2, KEY_L), KEY(2, 3, KEY_K),
708 KEY(2, 4, KEY_J), KEY(2, 5, KEY_H),
709 KEY(2, 6, KEY_G), KEY(2, 7, KEY_F),
710
711 KEY(3, 0, KEY_D), KEY(3, 1, KEY_S),
712 KEY(3, 2, KEY_A), KEY(3, 3, KEY_TAB),
713 KEY(3, 4, KEY_BACKSPACE), KEY(3, 5, KEY_P),
714 KEY(3, 6, KEY_O), KEY(3, 7, KEY_I),
715
716 KEY(4, 0, KEY_U), KEY(4, 1, KEY_Y),
717 KEY(4, 2, KEY_T), KEY(4, 3, KEY_R),
718 KEY(4, 4, KEY_E), KEY(4, 5, KEY_W),
719 KEY(4, 6, KEY_Q), KEY(4, 7, KEY_MINUS),
720
721 KEY(5, 0, KEY_0), KEY(5, 1, KEY_9),
722 KEY(5, 2, KEY_8), KEY(5, 3, KEY_7),
723 KEY(5, 4, KEY_6), KEY(5, 5, KEY_5),
724 KEY(5, 6, KEY_4), KEY(5, 7, KEY_3),
725
726 KEY(6, 0, KEY_2), KEY(6, 1, KEY_1),
727 KEY(6, 2, KEY_ENTER), KEY(6, 3, KEY_END),
728 KEY(6, 4, KEY_DOWN), KEY(6, 5, KEY_UP),
729 KEY(6, 6, KEY_MENU), KEY(6, 7, KEY_F1),
730
731 KEY(7, 0, KEY_LEFT), KEY(7, 1, KEY_RIGHT),
732 KEY(7, 2, KEY_BACK), KEY(7, 3, KEY_HOME),
733 KEY(7, 4, 0), KEY(7, 5, 0),
734 KEY(7, 6, 0), KEY(7, 7, 0),
735};
736
737struct pxa27x_keypad_platform_data em_x270_exeda_keypad_info = {
738 /* code map for the matrix keys */
739 .matrix_key_rows = 8,
740 .matrix_key_cols = 8,
741 .matrix_key_map = em_x270_exeda_matrix_keys,
742 .matrix_key_map_size = ARRAY_SIZE(em_x270_exeda_matrix_keys),
496}; 743};
497 744
498static void __init em_x270_init_keypad(void) 745static void __init em_x270_init_keypad(void)
499{ 746{
500 pxa_set_keypad_info(&em_x270_keypad_info); 747 if (machine_is_em_x270())
748 pxa_set_keypad_info(&em_x270_module_keypad_info);
749 else
750 pxa_set_keypad_info(&em_x270_exeda_keypad_info);
501} 751}
502#else 752#else
503static inline void em_x270_init_keypad(void) {} 753static inline void em_x270_init_keypad(void) {}
@@ -535,19 +785,264 @@ static void __init em_x270_init_gpio_keys(void)
535static inline void em_x270_init_gpio_keys(void) {} 785static inline void em_x270_init_gpio_keys(void) {}
536#endif 786#endif
537 787
538static void __init em_x270_init(void) 788/* Quick Capture Interface and sensor setup */
789#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
790static struct regulator *em_x270_camera_ldo;
791
792static int em_x270_sensor_init(struct device *dev)
539{ 793{
794 int ret;
795
796 ret = gpio_request(GPIO93_CAM_RESET, "camera reset");
797 if (ret)
798 return ret;
799
800 gpio_direction_output(GPIO93_CAM_RESET, 0);
801
802 em_x270_camera_ldo = regulator_get(NULL, "vcc cam");
803 if (em_x270_camera_ldo == NULL) {
804 gpio_free(GPIO93_CAM_RESET);
805 return -ENODEV;
806 }
807
808 ret = regulator_enable(em_x270_camera_ldo);
809 if (ret) {
810 regulator_put(em_x270_camera_ldo);
811 gpio_free(GPIO93_CAM_RESET);
812 return ret;
813 }
814
815 gpio_set_value(GPIO93_CAM_RESET, 1);
816
817 return 0;
818}
819
820struct pxacamera_platform_data em_x270_camera_platform_data = {
821 .init = em_x270_sensor_init,
822 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
823 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
824 .mclk_10khz = 2600,
825};
826
827static int em_x270_sensor_power(struct device *dev, int on)
828{
829 int ret;
830 int is_on = regulator_is_enabled(em_x270_camera_ldo);
831
832 if (on == is_on)
833 return 0;
834
835 gpio_set_value(GPIO93_CAM_RESET, !on);
836
837 if (on)
838 ret = regulator_enable(em_x270_camera_ldo);
839 else
840 ret = regulator_disable(em_x270_camera_ldo);
841
842 if (ret)
843 return ret;
844
845 gpio_set_value(GPIO93_CAM_RESET, on);
846
847 return 0;
848}
849
850static struct soc_camera_link iclink = {
851 .bus_id = 0,
852 .power = em_x270_sensor_power,
853};
854
855static struct i2c_board_info em_x270_i2c_cam_info[] = {
856 {
857 I2C_BOARD_INFO("mt9m111", 0x48),
858 .platform_data = &iclink,
859 },
860};
861
862static struct i2c_pxa_platform_data em_x270_i2c_info = {
863 .fast_mode = 1,
864};
865
866static void __init em_x270_init_camera(void)
867{
868 pxa_set_i2c_info(&em_x270_i2c_info);
869 i2c_register_board_info(0, ARRAY_AND_SIZE(em_x270_i2c_cam_info));
870 pxa_set_camera_info(&em_x270_camera_platform_data);
871}
872#else
873static inline void em_x270_init_camera(void) {}
874#endif
875
876/* DA9030 related initializations */
877#define REGULATOR_CONSUMER(_name, _dev, _supply) \
878 static struct regulator_consumer_supply _name##_consumers[] = { \
879 { \
880 .dev = _dev, \
881 .supply = _supply, \
882 }, \
883 }
884
885REGULATOR_CONSUMER(ldo3, NULL, "vcc gps");
886REGULATOR_CONSUMER(ldo5, NULL, "vcc cam");
887REGULATOR_CONSUMER(ldo10, &pxa_device_mci.dev, "vcc sdio");
888REGULATOR_CONSUMER(ldo12, NULL, "vcc usb");
889REGULATOR_CONSUMER(ldo19, NULL, "vcc gprs");
890
891#define REGULATOR_INIT(_ldo, _min_uV, _max_uV, _ops_mask) \
892 static struct regulator_init_data _ldo##_data = { \
893 .constraints = { \
894 .min_uV = _min_uV, \
895 .max_uV = _max_uV, \
896 .state_mem = { \
897 .enabled = 0, \
898 }, \
899 .valid_ops_mask = _ops_mask, \
900 }, \
901 .num_consumer_supplies = ARRAY_SIZE(_ldo##_consumers), \
902 .consumer_supplies = _ldo##_consumers, \
903 };
904
905REGULATOR_INIT(ldo3, 3200000, 3200000, REGULATOR_CHANGE_STATUS);
906REGULATOR_INIT(ldo5, 3000000, 3000000, REGULATOR_CHANGE_STATUS);
907REGULATOR_INIT(ldo10, 2000000, 3200000,
908 REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE);
909REGULATOR_INIT(ldo12, 3000000, 3000000, REGULATOR_CHANGE_STATUS);
910REGULATOR_INIT(ldo19, 3200000, 3200000, REGULATOR_CHANGE_STATUS);
911
912struct led_info em_x270_led_info = {
913 .name = "em-x270:orange",
914 .default_trigger = "battery-charging-or-full",
915};
916
917struct power_supply_info em_x270_psy_info = {
918 .name = "LP555597P6H-FPS",
919 .technology = POWER_SUPPLY_TECHNOLOGY_LIPO,
920 .voltage_max_design = 4200000,
921 .voltage_min_design = 3000000,
922 .use_for_apm = 1,
923};
924
925static void em_x270_battery_low(void)
926{
927 apm_queue_event(APM_LOW_BATTERY);
928}
929
930static void em_x270_battery_critical(void)
931{
932 apm_queue_event(APM_CRITICAL_SUSPEND);
933}
934
935struct da9030_battery_info em_x270_batterty_info = {
936 .battery_info = &em_x270_psy_info,
937
938 .charge_milliamp = 1000,
939 .charge_millivolt = 4200,
940
941 .vbat_low = 3600,
942 .vbat_crit = 3400,
943 .vbat_charge_start = 4100,
944 .vbat_charge_stop = 4200,
945 .vbat_charge_restart = 4000,
946
947 .vcharge_min = 3200,
948 .vcharge_max = 5500,
949
950 .tbat_low = 197,
951 .tbat_high = 78,
952 .tbat_restart = 100,
953
954 .batmon_interval = 0,
955
956 .battery_low = em_x270_battery_low,
957 .battery_critical = em_x270_battery_critical,
958};
959
960#define DA9030_SUBDEV(_name, _id, _pdata) \
961 { \
962 .name = "da903x-" #_name, \
963 .id = DA9030_ID_##_id, \
964 .platform_data = _pdata, \
965 }
966
967#define DA9030_LDO(num) DA9030_SUBDEV(regulator, LDO##num, &ldo##num##_data)
968
969struct da903x_subdev_info em_x270_da9030_subdevs[] = {
970 DA9030_LDO(3),
971 DA9030_LDO(5),
972 DA9030_LDO(10),
973 DA9030_LDO(12),
974 DA9030_LDO(19),
975
976 DA9030_SUBDEV(led, LED_PC, &em_x270_led_info),
977 DA9030_SUBDEV(backlight, WLED, &em_x270_led_info),
978 DA9030_SUBDEV(battery, BAT, &em_x270_batterty_info),
979};
980
981static struct da903x_platform_data em_x270_da9030_info = {
982 .num_subdevs = ARRAY_SIZE(em_x270_da9030_subdevs),
983 .subdevs = em_x270_da9030_subdevs,
984};
985
986static struct i2c_board_info em_x270_i2c_pmic_info = {
987 I2C_BOARD_INFO("da9030", 0x49),
988 .irq = IRQ_GPIO(0),
989 .platform_data = &em_x270_da9030_info,
990};
991
992static struct i2c_pxa_platform_data em_x270_pwr_i2c_info = {
993 .use_pio = 1,
994};
995
996static void __init em_x270_init_da9030(void)
997{
998 pxa27x_set_i2c_power_info(&em_x270_pwr_i2c_info);
999 i2c_register_board_info(1, &em_x270_i2c_pmic_info, 1);
1000}
1001
1002static void __init em_x270_module_init(void)
1003{
1004 pr_info("%s\n", __func__);
540 pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_pin_config)); 1005 pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_pin_config));
541 1006
1007 mmc_cd = GPIO13_MMC_CD;
1008 nand_rb = GPIO56_NAND_RB;
1009 dm9000_flags = DM9000_PLATF_32BITONLY;
1010}
1011
1012static void __init em_x270_exeda_init(void)
1013{
1014 pr_info("%s\n", __func__);
1015 pxa2xx_mfp_config(ARRAY_AND_SIZE(exeda_pin_config));
1016
1017 mmc_cd = GPIO114_MMC_CD;
1018 nand_rb = GPIO20_NAND_RB;
1019 dm9000_flags = DM9000_PLATF_16BITONLY;
1020}
1021
1022static void __init em_x270_init(void)
1023{
1024 pxa2xx_mfp_config(ARRAY_AND_SIZE(common_pin_config));
1025
1026 if (machine_is_em_x270())
1027 em_x270_module_init();
1028 else if (machine_is_exeda())
1029 em_x270_exeda_init();
1030 else
1031 panic("Unsupported machine: %d\n", machine_arch_type);
1032
1033 em_x270_init_da9030();
542 em_x270_init_dm9000(); 1034 em_x270_init_dm9000();
543 em_x270_init_rtc(); 1035 em_x270_init_rtc();
544 em_x270_init_nand(); 1036 em_x270_init_nand();
1037 em_x270_init_nor();
545 em_x270_init_lcd(); 1038 em_x270_init_lcd();
546 em_x270_init_mmc(); 1039 em_x270_init_mmc();
547 em_x270_init_ohci(); 1040 em_x270_init_ohci();
548 em_x270_init_keypad(); 1041 em_x270_init_keypad();
549 em_x270_init_gpio_keys(); 1042 em_x270_init_gpio_keys();
550 em_x270_init_ac97(); 1043 em_x270_init_ac97();
1044 em_x270_init_camera();
1045 em_x270_init_spi();
551} 1046}
552 1047
553MACHINE_START(EM_X270, "Compulab EM-X270") 1048MACHINE_START(EM_X270, "Compulab EM-X270")
@@ -559,3 +1054,13 @@ MACHINE_START(EM_X270, "Compulab EM-X270")
559 .timer = &pxa_timer, 1054 .timer = &pxa_timer,
560 .init_machine = em_x270_init, 1055 .init_machine = em_x270_init,
561MACHINE_END 1056MACHINE_END
1057
1058MACHINE_START(EXEDA, "Compulab eXeda")
1059 .boot_params = 0xa0000100,
1060 .phys_io = 0x40000000,
1061 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1062 .map_io = pxa_map_io,
1063 .init_irq = pxa27x_init_irq,
1064 .timer = &pxa_timer,
1065 .init_machine = em_x270_init,
1066MACHINE_END
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index dfce7d5b659e..c60dadf847a6 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -20,8 +20,7 @@
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22 22
23#include <mach/mfp-pxa25x.h> 23#include <mach/pxa25x.h>
24#include <mach/hardware.h>
25#include <mach/eseries-gpio.h> 24#include <mach/eseries-gpio.h>
26#include <mach/udc.h> 25#include <mach/udc.h>
27#include <mach/irda.h> 26#include <mach/irda.h>
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index df5f822f3b6c..92ba16e1b6fc 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -19,18 +19,16 @@
19#include <linux/input.h> 19#include <linux/input.h>
20 20
21#include <asm/setup.h> 21#include <asm/setup.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24
25#include <mach/pxa27x.h>
22#include <mach/pxafb.h> 26#include <mach/pxafb.h>
23#include <mach/ohci.h> 27#include <mach/ohci.h>
24#include <mach/i2c.h> 28#include <mach/i2c.h>
25#include <mach/hardware.h> 29#include <mach/hardware.h>
26#include <mach/pxa27x_keypad.h> 30#include <mach/pxa27x_keypad.h>
27 31
28#include <mach/mfp-pxa27x.h>
29#include <mach/pxa-regs.h>
30#include <mach/pxa2xx-regs.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33
34#include "devices.h" 32#include "devices.h"
35#include "generic.h" 33#include "generic.h"
36 34
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 0ccc91c92c44..3126a35aa002 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -26,8 +26,9 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <asm/mach-types.h> 27#include <asm/mach-types.h>
28 28
29#include <mach/pxa-regs.h>
30#include <mach/reset.h> 29#include <mach/reset.h>
30#include <mach/gpio.h>
31#include <mach/pxa2xx-gpio.h>
31 32
32#include "generic.h" 33#include "generic.h"
33 34
@@ -127,3 +128,33 @@ void __init pxa_map_io(void)
127 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); 128 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
128 get_clk_frequency_khz(1); 129 get_clk_frequency_khz(1);
129} 130}
131
132/*
133 * Configure pins for GPIO or other functions
134 */
135int pxa_gpio_mode(int gpio_mode)
136{
137 unsigned long flags;
138 int gpio = gpio_mode & GPIO_MD_MASK_NR;
139 int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
140 int gafr;
141
142 if (gpio > pxa_last_gpio)
143 return -EINVAL;
144
145 local_irq_save(flags);
146 if (gpio_mode & GPIO_DFLT_LOW)
147 GPCR(gpio) = GPIO_bit(gpio);
148 else if (gpio_mode & GPIO_DFLT_HIGH)
149 GPSR(gpio) = GPIO_bit(gpio);
150 if (gpio_mode & GPIO_MD_MASK_DIR)
151 GPDR(gpio) |= GPIO_bit(gpio);
152 else
153 GPDR(gpio) &= ~GPIO_bit(gpio);
154 gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
155 GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
156 local_irq_restore(flags);
157
158 return 0;
159}
160EXPORT_SYMBOL(pxa_gpio_mode);
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index dc876a8e6668..3465268ca716 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -9,20 +9,17 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12typedef int (*set_wake_t)(unsigned int, unsigned int);
13
14struct sys_timer; 12struct sys_timer;
15 13
16extern struct sys_timer pxa_timer; 14extern struct sys_timer pxa_timer;
17extern void __init pxa_init_irq(int irq_nr, set_wake_t fn); 15extern void __init pxa_init_irq(int irq_nr,
18extern void __init pxa_init_gpio(int gpio_nr, set_wake_t fn); 16 int (*set_wake)(unsigned int, unsigned int));
19extern void __init pxa25x_init_irq(void); 17extern void __init pxa25x_init_irq(void);
20extern void __init pxa27x_init_irq(void); 18extern void __init pxa27x_init_irq(void);
21extern void __init pxa3xx_init_irq(void); 19extern void __init pxa3xx_init_irq(void);
22extern void __init pxa_map_io(void); 20extern void __init pxa_map_io(void);
23 21
24extern unsigned int get_clk_frequency_khz(int info); 22extern unsigned int get_clk_frequency_khz(int info);
25extern int pxa_last_gpio;
26 23
27#define SET_BANK(__nr,__start,__size) \ 24#define SET_BANK(__nr,__start,__size) \
28 mi->bank[__nr].start = (__start), \ 25 mi->bank[__nr].start = (__start), \
diff --git a/arch/arm/mach-pxa/gpio.c b/arch/arm/mach-pxa/gpio.c
deleted file mode 100644
index 5fec1e479cb3..000000000000
--- a/arch/arm/mach-pxa/gpio.c
+++ /dev/null
@@ -1,453 +0,0 @@
1/*
2 * linux/arch/arm/mach-pxa/gpio.c
3 *
4 * Generic PXA GPIO handling
5 *
6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001
8 * Copyright: MontaVista Software Inc.
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/init.h>
16#include <linux/module.h>
17#include <linux/irq.h>
18#include <linux/sysdev.h>
19#include <linux/io.h>
20
21#include <asm/gpio.h>
22#include <mach/hardware.h>
23#include <mach/pxa-regs.h>
24#include <mach/pxa2xx-gpio.h>
25
26#include "generic.h"
27
28#define GPIO0_BASE ((void __iomem *)io_p2v(0x40E00000))
29#define GPIO1_BASE ((void __iomem *)io_p2v(0x40E00004))
30#define GPIO2_BASE ((void __iomem *)io_p2v(0x40E00008))
31#define GPIO3_BASE ((void __iomem *)io_p2v(0x40E00100))
32
33#define GPLR_OFFSET 0x00
34#define GPDR_OFFSET 0x0C
35#define GPSR_OFFSET 0x18
36#define GPCR_OFFSET 0x24
37#define GRER_OFFSET 0x30
38#define GFER_OFFSET 0x3C
39#define GEDR_OFFSET 0x48
40
41struct pxa_gpio_chip {
42 struct gpio_chip chip;
43 void __iomem *regbase;
44};
45
46int pxa_last_gpio;
47
48#ifdef CONFIG_CPU_PXA26x
49/* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted,
50 * as well as their Alternate Function value being '1' for GPIO in GAFRx.
51 */
52static int __gpio_is_inverted(unsigned gpio)
53{
54 return cpu_is_pxa25x() && gpio > 85;
55}
56#else
57#define __gpio_is_inverted(gpio) (0)
58#endif
59
60/*
61 * Configure pins for GPIO or other functions
62 */
63int pxa_gpio_mode(int gpio_mode)
64{
65 unsigned long flags;
66 int gpio = gpio_mode & GPIO_MD_MASK_NR;
67 int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
68 int gafr;
69
70 if (gpio > pxa_last_gpio)
71 return -EINVAL;
72
73 local_irq_save(flags);
74 if (gpio_mode & GPIO_DFLT_LOW)
75 GPCR(gpio) = GPIO_bit(gpio);
76 else if (gpio_mode & GPIO_DFLT_HIGH)
77 GPSR(gpio) = GPIO_bit(gpio);
78 if (gpio_mode & GPIO_MD_MASK_DIR)
79 GPDR(gpio) |= GPIO_bit(gpio);
80 else
81 GPDR(gpio) &= ~GPIO_bit(gpio);
82 gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
83 GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
84 local_irq_restore(flags);
85
86 return 0;
87}
88EXPORT_SYMBOL(pxa_gpio_mode);
89
90static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
91{
92 unsigned long flags;
93 u32 mask = 1 << offset;
94 u32 value;
95 struct pxa_gpio_chip *pxa;
96 void __iomem *gpdr;
97
98 pxa = container_of(chip, struct pxa_gpio_chip, chip);
99 gpdr = pxa->regbase + GPDR_OFFSET;
100 local_irq_save(flags);
101 value = __raw_readl(gpdr);
102 if (__gpio_is_inverted(chip->base + offset))
103 value |= mask;
104 else
105 value &= ~mask;
106 __raw_writel(value, gpdr);
107 local_irq_restore(flags);
108
109 return 0;
110}
111
112static int pxa_gpio_direction_output(struct gpio_chip *chip,
113 unsigned offset, int value)
114{
115 unsigned long flags;
116 u32 mask = 1 << offset;
117 u32 tmp;
118 struct pxa_gpio_chip *pxa;
119 void __iomem *gpdr;
120
121 pxa = container_of(chip, struct pxa_gpio_chip, chip);
122 __raw_writel(mask,
123 pxa->regbase + (value ? GPSR_OFFSET : GPCR_OFFSET));
124 gpdr = pxa->regbase + GPDR_OFFSET;
125 local_irq_save(flags);
126 tmp = __raw_readl(gpdr);
127 if (__gpio_is_inverted(chip->base + offset))
128 tmp &= ~mask;
129 else
130 tmp |= mask;
131 __raw_writel(tmp, gpdr);
132 local_irq_restore(flags);
133
134 return 0;
135}
136
137/*
138 * Return GPIO level
139 */
140static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
141{
142 u32 mask = 1 << offset;
143 struct pxa_gpio_chip *pxa;
144
145 pxa = container_of(chip, struct pxa_gpio_chip, chip);
146 return __raw_readl(pxa->regbase + GPLR_OFFSET) & mask;
147}
148
149/*
150 * Set output GPIO level
151 */
152static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
153{
154 u32 mask = 1 << offset;
155 struct pxa_gpio_chip *pxa;
156
157 pxa = container_of(chip, struct pxa_gpio_chip, chip);
158
159 if (value)
160 __raw_writel(mask, pxa->regbase + GPSR_OFFSET);
161 else
162 __raw_writel(mask, pxa->regbase + GPCR_OFFSET);
163}
164
165#define GPIO_CHIP(_n) \
166 [_n] = { \
167 .regbase = GPIO##_n##_BASE, \
168 .chip = { \
169 .label = "gpio-" #_n, \
170 .direction_input = pxa_gpio_direction_input, \
171 .direction_output = pxa_gpio_direction_output, \
172 .get = pxa_gpio_get, \
173 .set = pxa_gpio_set, \
174 .base = (_n) * 32, \
175 .ngpio = 32, \
176 }, \
177 }
178
179static struct pxa_gpio_chip pxa_gpio_chip[] = {
180 GPIO_CHIP(0),
181 GPIO_CHIP(1),
182 GPIO_CHIP(2),
183#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
184 GPIO_CHIP(3),
185#endif
186};
187
188/*
189 * PXA GPIO edge detection for IRQs:
190 * IRQs are generated on Falling-Edge, Rising-Edge, or both.
191 * Use this instead of directly setting GRER/GFER.
192 */
193
194static unsigned long GPIO_IRQ_rising_edge[4];
195static unsigned long GPIO_IRQ_falling_edge[4];
196static unsigned long GPIO_IRQ_mask[4];
197
198/*
199 * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate
200 * function of a GPIO, and GPDRx cannot be altered once configured. It
201 * is attributed as "occupied" here (I know this terminology isn't
202 * accurate, you are welcome to propose a better one :-)
203 */
204static int __gpio_is_occupied(unsigned gpio)
205{
206 if (cpu_is_pxa27x() || cpu_is_pxa25x()) {
207 int af = (GAFR(gpio) >> ((gpio & 0xf) * 2)) & 0x3;
208 int dir = GPDR(gpio) & GPIO_bit(gpio);
209
210 if (__gpio_is_inverted(gpio))
211 return af != 1 || dir == 0;
212 else
213 return af != 0 || dir != 0;
214 }
215
216 return 0;
217}
218
219static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
220{
221 int gpio, idx;
222
223 gpio = IRQ_TO_GPIO(irq);
224 idx = gpio >> 5;
225
226 if (type == IRQ_TYPE_PROBE) {
227 /* Don't mess with enabled GPIOs using preconfigured edges or
228 * GPIOs set to alternate function or to output during probe
229 */
230 if ((GPIO_IRQ_rising_edge[idx] & GPIO_bit(gpio)) ||
231 (GPIO_IRQ_falling_edge[idx] & GPIO_bit(gpio)))
232 return 0;
233
234 if (__gpio_is_occupied(gpio))
235 return 0;
236
237 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
238 }
239
240 if (__gpio_is_inverted(gpio))
241 GPDR(gpio) |= GPIO_bit(gpio);
242 else
243 GPDR(gpio) &= ~GPIO_bit(gpio);
244
245 if (type & IRQ_TYPE_EDGE_RISING)
246 __set_bit(gpio, GPIO_IRQ_rising_edge);
247 else
248 __clear_bit(gpio, GPIO_IRQ_rising_edge);
249
250 if (type & IRQ_TYPE_EDGE_FALLING)
251 __set_bit(gpio, GPIO_IRQ_falling_edge);
252 else
253 __clear_bit(gpio, GPIO_IRQ_falling_edge);
254
255 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
256 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
257
258 pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio,
259 ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""),
260 ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : ""));
261 return 0;
262}
263
264/*
265 * GPIO IRQs must be acknowledged. This is for GPIO 0 and 1.
266 */
267
268static void pxa_ack_low_gpio(unsigned int irq)
269{
270 GEDR0 = (1 << (irq - IRQ_GPIO0));
271}
272
273static void pxa_mask_low_gpio(unsigned int irq)
274{
275 ICMR &= ~(1 << (irq - PXA_IRQ(0)));
276}
277
278static void pxa_unmask_low_gpio(unsigned int irq)
279{
280 ICMR |= 1 << (irq - PXA_IRQ(0));
281}
282
283static struct irq_chip pxa_low_gpio_chip = {
284 .name = "GPIO-l",
285 .ack = pxa_ack_low_gpio,
286 .mask = pxa_mask_low_gpio,
287 .unmask = pxa_unmask_low_gpio,
288 .set_type = pxa_gpio_irq_type,
289};
290
291/*
292 * Demux handler for GPIO>=2 edge detect interrupts
293 */
294
295#define GEDR_BITS (sizeof(gedr) * BITS_PER_BYTE)
296
297static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
298{
299 int loop, bit, n;
300 unsigned long gedr[4];
301
302 do {
303 gedr[0] = GEDR0 & GPIO_IRQ_mask[0] & ~3;
304 gedr[1] = GEDR1 & GPIO_IRQ_mask[1];
305 gedr[2] = GEDR2 & GPIO_IRQ_mask[2];
306 gedr[3] = GEDR3 & GPIO_IRQ_mask[3];
307
308 GEDR0 = gedr[0]; GEDR1 = gedr[1];
309 GEDR2 = gedr[2]; GEDR3 = gedr[3];
310
311 loop = 0;
312 bit = find_first_bit(gedr, GEDR_BITS);
313 while (bit < GEDR_BITS) {
314 loop = 1;
315
316 n = PXA_GPIO_IRQ_BASE + bit;
317 generic_handle_irq(n);
318
319 bit = find_next_bit(gedr, GEDR_BITS, bit + 1);
320 }
321 } while (loop);
322}
323
324static void pxa_ack_muxed_gpio(unsigned int irq)
325{
326 int gpio = irq - IRQ_GPIO(2) + 2;
327 GEDR(gpio) = GPIO_bit(gpio);
328}
329
330static void pxa_mask_muxed_gpio(unsigned int irq)
331{
332 int gpio = irq - IRQ_GPIO(2) + 2;
333 __clear_bit(gpio, GPIO_IRQ_mask);
334 GRER(gpio) &= ~GPIO_bit(gpio);
335 GFER(gpio) &= ~GPIO_bit(gpio);
336}
337
338static void pxa_unmask_muxed_gpio(unsigned int irq)
339{
340 int gpio = irq - IRQ_GPIO(2) + 2;
341 int idx = gpio >> 5;
342 __set_bit(gpio, GPIO_IRQ_mask);
343 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
344 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
345}
346
347static struct irq_chip pxa_muxed_gpio_chip = {
348 .name = "GPIO",
349 .ack = pxa_ack_muxed_gpio,
350 .mask = pxa_mask_muxed_gpio,
351 .unmask = pxa_unmask_muxed_gpio,
352 .set_type = pxa_gpio_irq_type,
353};
354
355void __init pxa_init_gpio(int gpio_nr, set_wake_t fn)
356{
357 int irq, i, gpio;
358
359 pxa_last_gpio = gpio_nr - 1;
360
361 /* clear all GPIO edge detects */
362 for (i = 0; i < gpio_nr; i += 32) {
363 GFER(i) = 0;
364 GRER(i) = 0;
365 GEDR(i) = GEDR(i);
366 }
367
368 /* GPIO 0 and 1 must have their mask bit always set */
369 GPIO_IRQ_mask[0] = 3;
370
371 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
372 set_irq_chip(irq, &pxa_low_gpio_chip);
373 set_irq_handler(irq, handle_edge_irq);
374 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
375 }
376
377 for (irq = IRQ_GPIO(2); irq < IRQ_GPIO(gpio_nr); irq++) {
378 set_irq_chip(irq, &pxa_muxed_gpio_chip);
379 set_irq_handler(irq, handle_edge_irq);
380 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
381 }
382
383 /* Install handler for GPIO>=2 edge detect interrupts */
384 set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
385
386 pxa_low_gpio_chip.set_wake = fn;
387 pxa_muxed_gpio_chip.set_wake = fn;
388
389 /* add a GPIO chip for each register bank.
390 * the last PXA25x register only contains 21 GPIOs
391 */
392 for (gpio = 0, i = 0; gpio < gpio_nr; gpio += 32, i++) {
393 if (gpio + 32 > gpio_nr)
394 pxa_gpio_chip[i].chip.ngpio = gpio_nr - gpio;
395 gpiochip_add(&pxa_gpio_chip[i].chip);
396 }
397}
398
399#ifdef CONFIG_PM
400
401static unsigned long saved_gplr[4];
402static unsigned long saved_gpdr[4];
403static unsigned long saved_grer[4];
404static unsigned long saved_gfer[4];
405
406static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
407{
408 int i, gpio;
409
410 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
411 saved_gplr[i] = GPLR(gpio);
412 saved_gpdr[i] = GPDR(gpio);
413 saved_grer[i] = GRER(gpio);
414 saved_gfer[i] = GFER(gpio);
415
416 /* Clear GPIO transition detect bits */
417 GEDR(gpio) = GEDR(gpio);
418 }
419 return 0;
420}
421
422static int pxa_gpio_resume(struct sys_device *dev)
423{
424 int i, gpio;
425
426 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
427 /* restore level with set/clear */
428 GPSR(gpio) = saved_gplr[i];
429 GPCR(gpio) = ~saved_gplr[i];
430
431 GRER(gpio) = saved_grer[i];
432 GFER(gpio) = saved_gfer[i];
433 GPDR(gpio) = saved_gpdr[i];
434 }
435 return 0;
436}
437#else
438#define pxa_gpio_suspend NULL
439#define pxa_gpio_resume NULL
440#endif
441
442struct sysdev_class pxa_gpio_sysclass = {
443 .name = "gpio",
444 .suspend = pxa_gpio_suspend,
445 .resume = pxa_gpio_resume,
446};
447
448static int __init pxa_gpio_init(void)
449{
450 return sysdev_class_register(&pxa_gpio_sysclass);
451}
452
453core_initcall(pxa_gpio_init);
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index e296ce11658c..ca9912ea78d9 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -38,14 +38,12 @@
38#include <asm/mach/map.h> 38#include <asm/mach/map.h>
39#include <asm/mach/irq.h> 39#include <asm/mach/irq.h>
40#include <asm/mach/flash.h> 40#include <asm/mach/flash.h>
41
42#include <mach/pxa25x.h>
41#include <mach/mmc.h> 43#include <mach/mmc.h>
42#include <mach/udc.h> 44#include <mach/udc.h>
43#include <mach/gumstix.h> 45#include <mach/gumstix.h>
44 46
45#include <mach/pxa-regs.h>
46#include <mach/pxa2xx-regs.h>
47#include <mach/mfp-pxa25x.h>
48
49#include "generic.h" 47#include "generic.h"
50 48
51static struct resource flash_resource = { 49static struct resource flash_resource = {
@@ -191,6 +189,11 @@ int __attribute__((weak)) am200_init(void)
191 return 0; 189 return 0;
192} 190}
193 191
192int __attribute__((weak)) am300_init(void)
193{
194 return 0;
195}
196
194static void __init carrier_board_init(void) 197static void __init carrier_board_init(void)
195{ 198{
196 /* 199 /*
@@ -198,6 +201,7 @@ static void __init carrier_board_init(void)
198 * they cannot be detected programatically 201 * they cannot be detected programatically
199 */ 202 */
200 am200_init(); 203 am200_init();
204 am300_init();
201} 205}
202 206
203static void __init gumstix_init(void) 207static void __init gumstix_init(void)
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
index da6e4422c0f3..f3d220c32e07 100644
--- a/arch/arm/mach-pxa/h5000.c
+++ b/arch/arm/mach-pxa/h5000.c
@@ -24,14 +24,15 @@
24#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/mtd/physmap.h> 26#include <linux/mtd/physmap.h>
27
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#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31
32#include <mach/pxa25x.h>
30#include <mach/h5000.h> 33#include <mach/h5000.h>
31#include <mach/pxa-regs.h>
32#include <mach/pxa2xx-regs.h>
33#include <mach/mfp-pxa25x.h>
34#include <mach/udc.h> 34#include <mach/udc.h>
35
35#include "generic.h" 36#include "generic.h"
36 37
37/* 38/*
@@ -153,6 +154,13 @@ static unsigned long h5000_pin_config[] __initdata = {
153 GPIO23_SSP1_SCLK, 154 GPIO23_SSP1_SCLK,
154 GPIO25_SSP1_TXD, 155 GPIO25_SSP1_TXD,
155 GPIO26_SSP1_RXD, 156 GPIO26_SSP1_RXD,
157
158 /* I2S */
159 GPIO28_I2S_BITCLK_OUT,
160 GPIO29_I2S_SDATA_IN,
161 GPIO30_I2S_SDATA_OUT,
162 GPIO31_I2S_SYNC,
163 GPIO32_I2S_SYSCLK,
156}; 164};
157 165
158/* 166/*
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c
new file mode 100644
index 000000000000..cea99fe65b97
--- /dev/null
+++ b/arch/arm/mach-pxa/himalaya.c
@@ -0,0 +1,166 @@
1/*
2 * linux/arch/arm/mach-pxa/himalaya.c
3 *
4 * Hardware definitions for the HTC Himalaya
5 *
6 * Based on 2.6.21-hh20's himalaya.c and himalaya_lcd.c
7 *
8 * Copyright (c) 2008 Zbynek Michl <Zbynek.Michl@seznam.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
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/device.h>
18#include <linux/fb.h>
19#include <linux/platform_device.h>
20
21#include <video/w100fb.h>
22
23#include <asm/setup.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27#include <mach/mfp-pxa25x.h>
28#include <mach/hardware.h>
29
30#include "generic.h"
31
32/* ---------------------- Himalaya LCD definitions -------------------- */
33
34static struct w100_gen_regs himalaya_lcd_regs = {
35 .lcd_format = 0x00000003,
36 .lcdd_cntl1 = 0x00000000,
37 .lcdd_cntl2 = 0x0003ffff,
38 .genlcd_cntl1 = 0x00fff003,
39 .genlcd_cntl2 = 0x00000003,
40 .genlcd_cntl3 = 0x000102aa,
41};
42
43static struct w100_mode himalaya4_lcd_mode = {
44 .xres = 240,
45 .yres = 320,
46 .left_margin = 0,
47 .right_margin = 31,
48 .upper_margin = 15,
49 .lower_margin = 0,
50 .crtc_ss = 0x80150014,
51 .crtc_ls = 0xa0fb00f7,
52 .crtc_gs = 0xc0080007,
53 .crtc_vpos_gs = 0x00080007,
54 .crtc_rev = 0x0000000a,
55 .crtc_dclk = 0x81700030,
56 .crtc_gclk = 0x8015010f,
57 .crtc_goe = 0x00000000,
58 .pll_freq = 80,
59 .pixclk_divider = 15,
60 .pixclk_divider_rotated = 15,
61 .pixclk_src = CLK_SRC_PLL,
62 .sysclk_divider = 0,
63 .sysclk_src = CLK_SRC_PLL,
64};
65
66static struct w100_mode himalaya6_lcd_mode = {
67 .xres = 240,
68 .yres = 320,
69 .left_margin = 9,
70 .right_margin = 8,
71 .upper_margin = 5,
72 .lower_margin = 4,
73 .crtc_ss = 0x80150014,
74 .crtc_ls = 0xa0fb00f7,
75 .crtc_gs = 0xc0080007,
76 .crtc_vpos_gs = 0x00080007,
77 .crtc_rev = 0x0000000a,
78 .crtc_dclk = 0xa1700030,
79 .crtc_gclk = 0x8015010f,
80 .crtc_goe = 0x00000000,
81 .pll_freq = 95,
82 .pixclk_divider = 0xb,
83 .pixclk_divider_rotated = 4,
84 .pixclk_src = CLK_SRC_PLL,
85 .sysclk_divider = 1,
86 .sysclk_src = CLK_SRC_PLL,
87};
88
89static struct w100_gpio_regs himalaya_w100_gpio_info = {
90 .init_data1 = 0xffff0000, /* GPIO_DATA */
91 .gpio_dir1 = 0x00000000, /* GPIO_CNTL1 */
92 .gpio_oe1 = 0x003c0000, /* GPIO_CNTL2 */
93 .init_data2 = 0x00000000, /* GPIO_DATA2 */
94 .gpio_dir2 = 0x00000000, /* GPIO_CNTL3 */
95 .gpio_oe2 = 0x00000000, /* GPIO_CNTL4 */
96};
97
98static struct w100fb_mach_info himalaya_fb_info = {
99 .num_modes = 1,
100 .regs = &himalaya_lcd_regs,
101 .gpio = &himalaya_w100_gpio_info,
102 .xtal_freq = 16000000,
103};
104
105static struct resource himalaya_fb_resources[] = {
106 [0] = {
107 .start = 0x08000000,
108 .end = 0x08ffffff,
109 .flags = IORESOURCE_MEM,
110 },
111};
112
113static struct platform_device himalaya_fb_device = {
114 .name = "w100fb",
115 .id = -1,
116 .dev = {
117 .platform_data = &himalaya_fb_info,
118 },
119 .num_resources = ARRAY_SIZE(himalaya_fb_resources),
120 .resource = himalaya_fb_resources,
121};
122
123/* ----------------------------------------------------------------------- */
124
125static struct platform_device *devices[] __initdata = {
126 &himalaya_fb_device,
127};
128
129static void __init himalaya_lcd_init(void)
130{
131 int himalaya_boardid;
132
133 himalaya_boardid = 0x4; /* hardcoded (detection needs ASIC3 functions) */
134 printk(KERN_INFO "himalaya LCD Driver init. boardid=%d\n",
135 himalaya_boardid);
136
137 switch (himalaya_boardid) {
138 case 0x4:
139 himalaya_fb_info.modelist = &himalaya4_lcd_mode;
140 break;
141 case 0x6:
142 himalaya_fb_info.modelist = &himalaya6_lcd_mode;
143 break;
144 default:
145 printk(KERN_INFO "himalaya lcd_init: unknown boardid=%d. Using 0x4\n",
146 himalaya_boardid);
147 himalaya_fb_info.modelist = &himalaya4_lcd_mode;
148 }
149}
150
151static void __init himalaya_init(void)
152{
153 himalaya_lcd_init();
154 platform_add_devices(devices, ARRAY_SIZE(devices));
155}
156
157
158MACHINE_START(HIMALAYA, "HTC Himalaya")
159 .phys_io = 0x40000000,
160 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
161 .boot_params = 0xa0000100,
162 .map_io = pxa_map_io,
163 .init_irq = pxa25x_init_irq,
164 .init_machine = himalaya_init,
165 .timer = &pxa_timer,
166MACHINE_END
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 013b15baa034..b6243b59d9be 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -31,8 +31,7 @@
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33 33
34#include <mach/pxa-regs.h> 34#include <mach/pxa25x.h>
35#include <mach/mfp-pxa25x.h>
36#include <mach/idp.h> 35#include <mach/idp.h>
37#include <mach/pxafb.h> 36#include <mach/pxafb.h>
38#include <mach/bitfield.h> 37#include <mach/bitfield.h>
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
index 364c5e271330..2121309b2474 100644
--- a/arch/arm/mach-pxa/imote2.c
+++ b/arch/arm/mach-pxa/imote2.c
@@ -28,11 +28,8 @@
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30 30
31#include <mach/pxa27x.h>
31#include <mach/i2c.h> 32#include <mach/i2c.h>
32#include <mach/pxa-regs.h>
33#include <mach/pxa2xx-regs.h>
34#include <mach/mfp-pxa27x.h>
35#include <mach/regs-ssp.h>
36#include <mach/udc.h> 33#include <mach/udc.h>
37#include <mach/mmc.h> 34#include <mach/mmc.h>
38#include <mach/pxa2xx_spi.h> 35#include <mach/pxa2xx_spi.h>
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 2ae373fb5675..3f2a01d6a03c 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -1,19 +1,31 @@
1#ifndef _COLIBRI_H_ 1#ifndef _COLIBRI_H_
2#define _COLIBRI_H_ 2#define _COLIBRI_H_
3/*
4 * common settings for all modules
5 */
6
7#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
8extern void colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin);
9#else
10static inline void colibri_pxa3xx_init_mmc(mfp_cfg_t *, int, int) {}
11#endif
12
13#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
14extern void colibri_pxa3xx_init_lcd(int bl_pin);
15#else
16static inline void colibri_pxa3xx_init_lcd(int) {}
17#endif
3 18
4/* physical memory regions */ 19/* physical memory regions */
5#define COLIBRI_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
6#define COLIBRI_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet DM9000 region */
7#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ 20#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
8 21
9/* virtual memory regions */ 22/* definitions for Colibri PXA270 */
10#define COLIBRI_DISK_VIRT 0xF0000000 /* Disk On Chip region */
11 23
12/* size of flash */ 24#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
13#define COLIBRI_FLASH_SIZE 0x02000000 /* Flash size 32 MB */ 25#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */
14 26#define COLIBRI_PXA270_ETH_IRQ_GPIO 114
15/* Ethernet Controller Davicom DM9000 */ 27#define COLIBRI_PXA270_ETH_IRQ \
16#define GPIO_DM9000 114 28 gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO))
17#define COLIBRI_ETH_IRQ IRQ_GPIO(GPIO_DM9000)
18 29
19#endif /* _COLIBRI_H_ */ 30#endif /* _COLIBRI_H_ */
31
diff --git a/arch/arm/mach-pxa/include/mach/csb726.h b/arch/arm/mach-pxa/include/mach/csb726.h
new file mode 100644
index 000000000000..747ab1a71f2f
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/csb726.h
@@ -0,0 +1,26 @@
1/*
2 * Support for Cogent CSB726
3 *
4 * Copyright (c) 2008 Dmitry Baryshkov
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 CSB726_H
12#define CSB726_H
13
14#define CSB726_GPIO_IRQ_LAN 52
15#define CSB726_GPIO_IRQ_SM501 53
16#define CSB726_GPIO_MMC_DETECT 100
17#define CSB726_GPIO_MMC_RO 101
18
19#define CSB726_FLASH_SIZE (64 * 1024 * 1024)
20#define CSB726_FLASH_uMON (8 * 1024 * 1024)
21
22#define CSB726_IRQ_LAN gpio_to_irq(CSB726_GPIO_IRQ_LAN)
23#define CSB726_IRQ_SM501 gpio_to_irq(CSB726_GPIO_IRQ_SM501)
24
25#endif
26
diff --git a/arch/arm/mach-pxa/include/mach/dma.h b/arch/arm/mach-pxa/include/mach/dma.h
index 7804637a6df3..5bd55894a48d 100644
--- a/arch/arm/mach-pxa/include/mach/dma.h
+++ b/arch/arm/mach-pxa/include/mach/dma.h
@@ -12,35 +12,10 @@
12#ifndef __ASM_ARCH_DMA_H 12#ifndef __ASM_ARCH_DMA_H
13#define __ASM_ARCH_DMA_H 13#define __ASM_ARCH_DMA_H
14 14
15/* 15#include <mach/hardware.h>
16 * Descriptor structure for PXA's DMA engine
17 * Note: this structure must always be aligned to a 16-byte boundary.
18 */
19
20typedef struct pxa_dma_desc {
21 volatile u32 ddadr; /* Points to the next descriptor + flags */
22 volatile u32 dsadr; /* DSADR value for the current transfer */
23 volatile u32 dtadr; /* DTADR value for the current transfer */
24 volatile u32 dcmd; /* DCMD value for the current transfer */
25} pxa_dma_desc;
26
27typedef enum {
28 DMA_PRIO_HIGH = 0,
29 DMA_PRIO_MEDIUM = 1,
30 DMA_PRIO_LOW = 2
31} pxa_dma_prio;
32
33/*
34 * DMA registration
35 */
36
37int __init pxa_init_dma(int num_ch);
38
39int pxa_request_dma (char *name,
40 pxa_dma_prio prio,
41 void (*irq_handler)(int, void *),
42 void *data);
43 16
44void pxa_free_dma (int dma_ch); 17/* DMA Controller Registers Definitions */
18#define DMAC_REGS_VIRT io_p2v(0x40000000)
45 19
20#include <plat/dma.h>
46#endif /* _ASM_ARCH_DMA_H */ 21#endif /* _ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-pxa/include/mach/eseries-gpio.h b/arch/arm/mach-pxa/include/mach/eseries-gpio.h
index efbd2aa9ecec..f3e5509820d7 100644
--- a/arch/arm/mach-pxa/include/mach/eseries-gpio.h
+++ b/arch/arm/mach-pxa/include/mach/eseries-gpio.h
@@ -45,6 +45,21 @@
45/* e7xx IrDA power control */ 45/* e7xx IrDA power control */
46#define GPIO_E7XX_IR_OFF 38 46#define GPIO_E7XX_IR_OFF 38
47 47
48/* e740 audio control GPIOs */
49#define GPIO_E740_WM9705_nAVDD2 16
50#define GPIO_E740_MIC_ON 40
51#define GPIO_E740_AMP_ON 41
52
53/* e750 audio control GPIOs */
54#define GPIO_E750_HP_AMP_OFF 4
55#define GPIO_E750_SPK_AMP_OFF 7
56#define GPIO_E750_HP_DETECT 37
57
58/* e800 audio control GPIOs */
59#define GPIO_E800_HP_DETECT 81
60#define GPIO_E800_HP_AMP_OFF 82
61#define GPIO_E800_SPK_AMP_ON 83
62
48/* ASIC related GPIOs */ 63/* ASIC related GPIOs */
49#define GPIO_ESERIES_TMIO_IRQ 5 64#define GPIO_ESERIES_TMIO_IRQ 5
50#define GPIO_ESERIES_TMIO_PCLR 19 65#define GPIO_ESERIES_TMIO_PCLR 19
diff --git a/arch/arm/mach-pxa/include/mach/gpio.h b/arch/arm/mach-pxa/include/mach/gpio.h
index 2c538d8c362d..b024a8b37439 100644
--- a/arch/arm/mach-pxa/include/mach/gpio.h
+++ b/arch/arm/mach-pxa/include/mach/gpio.h
@@ -24,42 +24,118 @@
24#ifndef __ASM_ARCH_PXA_GPIO_H 24#ifndef __ASM_ARCH_PXA_GPIO_H
25#define __ASM_ARCH_PXA_GPIO_H 25#define __ASM_ARCH_PXA_GPIO_H
26 26
27#include <mach/pxa-regs.h> 27#include <mach/irqs.h>
28#include <asm/irq.h>
29#include <mach/hardware.h> 28#include <mach/hardware.h>
30
31#include <asm-generic/gpio.h> 29#include <asm-generic/gpio.h>
32 30
31#define GPIO_REGS_VIRT io_p2v(0x40E00000)
32
33#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
34#define GPIO_REG(x) (*(volatile u32 *)(GPIO_REGS_VIRT + (x)))
35
36/* GPIO Pin Level Registers */
37#define GPLR0 GPIO_REG(BANK_OFF(0) + 0x00)
38#define GPLR1 GPIO_REG(BANK_OFF(1) + 0x00)
39#define GPLR2 GPIO_REG(BANK_OFF(2) + 0x00)
40#define GPLR3 GPIO_REG(BANK_OFF(3) + 0x00)
41
42/* GPIO Pin Direction Registers */
43#define GPDR0 GPIO_REG(BANK_OFF(0) + 0x0c)
44#define GPDR1 GPIO_REG(BANK_OFF(1) + 0x0c)
45#define GPDR2 GPIO_REG(BANK_OFF(2) + 0x0c)
46#define GPDR3 GPIO_REG(BANK_OFF(3) + 0x0c)
47
48/* GPIO Pin Output Set Registers */
49#define GPSR0 GPIO_REG(BANK_OFF(0) + 0x18)
50#define GPSR1 GPIO_REG(BANK_OFF(1) + 0x18)
51#define GPSR2 GPIO_REG(BANK_OFF(2) + 0x18)
52#define GPSR3 GPIO_REG(BANK_OFF(3) + 0x18)
53
54/* GPIO Pin Output Clear Registers */
55#define GPCR0 GPIO_REG(BANK_OFF(0) + 0x24)
56#define GPCR1 GPIO_REG(BANK_OFF(1) + 0x24)
57#define GPCR2 GPIO_REG(BANK_OFF(2) + 0x24)
58#define GPCR3 GPIO_REG(BANK_OFF(3) + 0x24)
59
60/* GPIO Rising Edge Detect Registers */
61#define GRER0 GPIO_REG(BANK_OFF(0) + 0x30)
62#define GRER1 GPIO_REG(BANK_OFF(1) + 0x30)
63#define GRER2 GPIO_REG(BANK_OFF(2) + 0x30)
64#define GRER3 GPIO_REG(BANK_OFF(3) + 0x30)
65
66/* GPIO Falling Edge Detect Registers */
67#define GFER0 GPIO_REG(BANK_OFF(0) + 0x3c)
68#define GFER1 GPIO_REG(BANK_OFF(1) + 0x3c)
69#define GFER2 GPIO_REG(BANK_OFF(2) + 0x3c)
70#define GFER3 GPIO_REG(BANK_OFF(3) + 0x3c)
71
72/* GPIO Edge Detect Status Registers */
73#define GEDR0 GPIO_REG(BANK_OFF(0) + 0x48)
74#define GEDR1 GPIO_REG(BANK_OFF(1) + 0x48)
75#define GEDR2 GPIO_REG(BANK_OFF(2) + 0x48)
76#define GEDR3 GPIO_REG(BANK_OFF(3) + 0x48)
77
78/* GPIO Alternate Function Select Registers */
79#define GAFR0_L GPIO_REG(0x0054)
80#define GAFR0_U GPIO_REG(0x0058)
81#define GAFR1_L GPIO_REG(0x005C)
82#define GAFR1_U GPIO_REG(0x0060)
83#define GAFR2_L GPIO_REG(0x0064)
84#define GAFR2_U GPIO_REG(0x0068)
85#define GAFR3_L GPIO_REG(0x006C)
86#define GAFR3_U GPIO_REG(0x0070)
87
88/* More handy macros. The argument is a literal GPIO number. */
89
90#define GPIO_bit(x) (1 << ((x) & 0x1f))
91
92#define GPLR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x00)
93#define GPDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x0c)
94#define GPSR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x18)
95#define GPCR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x24)
96#define GRER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x30)
97#define GFER(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x3c)
98#define GEDR(x) GPIO_REG(BANK_OFF((x) >> 5) + 0x48)
99#define GAFR(x) GPIO_REG(0x54 + (((x) & 0x70) >> 2))
100
33 101
34/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
35 * Those cases currently cause holes in the GPIO number space.
36 */
37#define NR_BUILTIN_GPIO 128 102#define NR_BUILTIN_GPIO 128
38 103
39static inline int gpio_get_value(unsigned gpio) 104#define gpio_to_bank(gpio) ((gpio) >> 5)
105#define gpio_to_irq(gpio) IRQ_GPIO(gpio)
106#define irq_to_gpio(irq) IRQ_TO_GPIO(irq)
107
108#ifdef CONFIG_CPU_PXA26x
109/* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted,
110 * as well as their Alternate Function value being '1' for GPIO in GAFRx.
111 */
112static inline int __gpio_is_inverted(unsigned gpio)
40{ 113{
41 if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) 114 return cpu_is_pxa25x() && gpio > 85;
42 return GPLR(gpio) & GPIO_bit(gpio);
43 else
44 return __gpio_get_value(gpio);
45} 115}
116#else
117static inline int __gpio_is_inverted(unsigned gpio) { return 0; }
118#endif
46 119
47static inline void gpio_set_value(unsigned gpio, int value) 120/*
121 * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate
122 * function of a GPIO, and GPDRx cannot be altered once configured. It
123 * is attributed as "occupied" here (I know this terminology isn't
124 * accurate, you are welcome to propose a better one :-)
125 */
126static inline int __gpio_is_occupied(unsigned gpio)
48{ 127{
49 if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) { 128 if (cpu_is_pxa27x() || cpu_is_pxa25x()) {
50 if (value) 129 int af = (GAFR(gpio) >> ((gpio & 0xf) * 2)) & 0x3;
51 GPSR(gpio) = GPIO_bit(gpio); 130 int dir = GPDR(gpio) & GPIO_bit(gpio);
131
132 if (__gpio_is_inverted(gpio))
133 return af != 1 || dir == 0;
52 else 134 else
53 GPCR(gpio) = GPIO_bit(gpio); 135 return af != 0 || dir != 0;
54 } else { 136 } else
55 __gpio_set_value(gpio, value); 137 return GPDR(gpio) & GPIO_bit(gpio);
56 }
57} 138}
58 139
59#define gpio_cansleep __gpio_cansleep 140#include <plat/gpio.h>
60
61#define gpio_to_irq(gpio) IRQ_GPIO(gpio)
62#define irq_to_gpio(irq) IRQ_TO_GPIO(irq)
63
64
65#endif 141#endif
diff --git a/arch/arm/mach-pxa/include/mach/gumstix.h b/arch/arm/mach-pxa/include/mach/gumstix.h
index 099f54a41de4..06abd4160607 100644
--- a/arch/arm/mach-pxa/include/mach/gumstix.h
+++ b/arch/arm/mach-pxa/include/mach/gumstix.h
@@ -97,4 +97,5 @@ has detected a cable insertion; driven low otherwise. */
97 97
98/* for expansion boards that can't be programatically detected */ 98/* for expansion boards that can't be programatically detected */
99extern int am200_init(void); 99extern int am200_init(void);
100extern int am300_init(void);
100 101
diff --git a/arch/arm/mach-pxa/include/mach/lubbock.h b/arch/arm/mach-pxa/include/mach/lubbock.h
index 4cb24154a5a8..751b74811d0f 100644
--- a/arch/arm/mach-pxa/include/mach/lubbock.h
+++ b/arch/arm/mach-pxa/include/mach/lubbock.h
@@ -25,7 +25,6 @@
25 25
26/* FPGA register virtual addresses */ 26/* FPGA register virtual addresses */
27#define LUB_WHOAMI __LUB_REG(LUBBOCK_FPGA_PHYS + 0x000) 27#define LUB_WHOAMI __LUB_REG(LUBBOCK_FPGA_PHYS + 0x000)
28#define LUB_HEXLED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x010)
29#define LUB_DISC_BLNK_LED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x040) 28#define LUB_DISC_BLNK_LED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x040)
30#define LUB_CONF_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x050) 29#define LUB_CONF_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x050)
31#define LUB_USER_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x060) 30#define LUB_USER_SWITCHES __LUB_REG(LUBBOCK_FPGA_PHYS + 0x060)
diff --git a/arch/arm/mach-pxa/include/mach/magician.h b/arch/arm/mach-pxa/include/mach/magician.h
index 38d68d99f585..82a399f3f9f2 100644
--- a/arch/arm/mach-pxa/include/mach/magician.h
+++ b/arch/arm/mach-pxa/include/mach/magician.h
@@ -69,7 +69,7 @@
69#define IRQ_MAGICIAN_SD (IRQ_BOARD_START + 0) 69#define IRQ_MAGICIAN_SD (IRQ_BOARD_START + 0)
70#define IRQ_MAGICIAN_EP (IRQ_BOARD_START + 1) 70#define IRQ_MAGICIAN_EP (IRQ_BOARD_START + 1)
71#define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2) 71#define IRQ_MAGICIAN_BT (IRQ_BOARD_START + 2)
72#define IRQ_MAGICIAN_AC (IRQ_BOARD_START + 3) 72#define IRQ_MAGICIAN_VBUS (IRQ_BOARD_START + 3)
73 73
74/* 74/*
75 * CPLD EGPIOs 75 * CPLD EGPIOs
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
index a72869b73ee3..b13dc0269a6d 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_ARCH_MFP_PXA25X_H 1#ifndef __ASM_ARCH_MFP_PXA25X_H
2#define __ASM_ARCH_MFP_PXA25X_H 2#define __ASM_ARCH_MFP_PXA25X_H
3 3
4#include <mach/mfp.h>
5#include <mach/mfp-pxa2xx.h> 4#include <mach/mfp-pxa2xx.h>
6 5
7/* GPIO */ 6/* GPIO */
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
index da4f85a4f990..6543c05f47ed 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
@@ -8,7 +8,6 @@
8 * specific controller, and this should work in most cases. 8 * specific controller, and this should work in most cases.
9 */ 9 */
10 10
11#include <mach/mfp.h>
12#include <mach/mfp-pxa2xx.h> 11#include <mach/mfp-pxa2xx.h>
13 12
14/* Note: GPIO3/GPIO4 will be driven by Power I2C when PCFR/PI2C_EN 13/* Note: GPIO3/GPIO4 will be driven by Power I2C when PCFR/PI2C_EN
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
index 3e9211591e20..658b28ed129b 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_ARCH_MFP_PXA2XX_H 1#ifndef __ASM_ARCH_MFP_PXA2XX_H
2#define __ASM_ARCH_MFP_PXA2XX_H 2#define __ASM_ARCH_MFP_PXA2XX_H
3 3
4#include <mach/mfp.h> 4#include <plat/mfp.h>
5 5
6/* 6/*
7 * the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx: 7 * the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx:
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa300.h b/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
index bc1fb33a6e70..ae8441192ef0 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa300.h
@@ -15,7 +15,6 @@
15#ifndef __ASM_ARCH_MFP_PXA300_H 15#ifndef __ASM_ARCH_MFP_PXA300_H
16#define __ASM_ARCH_MFP_PXA300_H 16#define __ASM_ARCH_MFP_PXA300_H
17 17
18#include <mach/mfp.h>
19#include <mach/mfp-pxa3xx.h> 18#include <mach/mfp-pxa3xx.h>
20 19
21/* GPIO */ 20/* GPIO */
@@ -41,6 +40,7 @@
41#endif 40#endif
42 41
43/* Chip Select */ 42/* Chip Select */
43#define GPIO1_nCS2 MFP_CFG(GPIO1, AF1)
44#define GPIO2_nCS3 MFP_CFG(GPIO2, AF1) 44#define GPIO2_nCS3 MFP_CFG(GPIO2, AF1)
45 45
46/* AC97 */ 46/* AC97 */
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa320.h b/arch/arm/mach-pxa/include/mach/mfp-pxa320.h
index 67f8385ea548..07897e61d05a 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa320.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa320.h
@@ -15,7 +15,6 @@
15#ifndef __ASM_ARCH_MFP_PXA320_H 15#ifndef __ASM_ARCH_MFP_PXA320_H
16#define __ASM_ARCH_MFP_PXA320_H 16#define __ASM_ARCH_MFP_PXA320_H
17 17
18#include <mach/mfp.h>
19#include <mach/mfp-pxa3xx.h> 18#include <mach/mfp-pxa3xx.h>
20 19
21/* GPIO */ 20/* GPIO */
@@ -38,6 +37,7 @@
38#define GPIO17_2_GPIO MFP_CFG(GPIO17_2, AF0) 37#define GPIO17_2_GPIO MFP_CFG(GPIO17_2, AF0)
39 38
40/* Chip Select */ 39/* Chip Select */
40#define GPIO3_nCS2 MFP_CFG(GPIO3, AF1)
41#define GPIO4_nCS3 MFP_CFG(GPIO4, AF1) 41#define GPIO4_nCS3 MFP_CFG(GPIO4, AF1)
42 42
43/* AC97 */ 43/* AC97 */
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h
index 1f6b35c015d0..d375195d982b 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa3xx.h
@@ -1,68 +1,9 @@
1#ifndef __ASM_ARCH_MFP_PXA3XX_H 1#ifndef __ASM_ARCH_MFP_PXA3XX_H
2#define __ASM_ARCH_MFP_PXA3XX_H 2#define __ASM_ARCH_MFP_PXA3XX_H
3 3
4#define MFPR_BASE (0x40e10000) 4#include <plat/mfp.h>
5#define MFPR_SIZE (PAGE_SIZE)
6
7/* MFPR register bit definitions */
8#define MFPR_PULL_SEL (0x1 << 15)
9#define MFPR_PULLUP_EN (0x1 << 14)
10#define MFPR_PULLDOWN_EN (0x1 << 13)
11#define MFPR_SLEEP_SEL (0x1 << 9)
12#define MFPR_SLEEP_OE_N (0x1 << 7)
13#define MFPR_EDGE_CLEAR (0x1 << 6)
14#define MFPR_EDGE_FALL_EN (0x1 << 5)
15#define MFPR_EDGE_RISE_EN (0x1 << 4)
16
17#define MFPR_SLEEP_DATA(x) ((x) << 8)
18#define MFPR_DRIVE(x) (((x) & 0x7) << 10)
19#define MFPR_AF_SEL(x) (((x) & 0x7) << 0)
20 5
21#define MFPR_EDGE_NONE (0) 6#define MFPR_BASE (0x40e10000)
22#define MFPR_EDGE_RISE (MFPR_EDGE_RISE_EN)
23#define MFPR_EDGE_FALL (MFPR_EDGE_FALL_EN)
24#define MFPR_EDGE_BOTH (MFPR_EDGE_RISE | MFPR_EDGE_FALL)
25
26/*
27 * Table that determines the low power modes outputs, with actual settings
28 * used in parentheses for don't-care values. Except for the float output,
29 * the configured driven and pulled levels match, so if there is a need for
30 * non-LPM pulled output, the same configuration could probably be used.
31 *
32 * Output value sleep_oe_n sleep_data pullup_en pulldown_en pull_sel
33 * (bit 7) (bit 8) (bit 14) (bit 13) (bit 15)
34 *
35 * Input 0 X(0) X(0) X(0) 0
36 * Drive 0 0 0 0 X(1) 0
37 * Drive 1 0 1 X(1) 0 0
38 * Pull hi (1) 1 X(1) 1 0 0
39 * Pull lo (0) 1 X(0) 0 1 0
40 * Z (float) 1 X(0) 0 0 0
41 */
42#define MFPR_LPM_INPUT (0)
43#define MFPR_LPM_DRIVE_LOW (MFPR_SLEEP_DATA(0) | MFPR_PULLDOWN_EN)
44#define MFPR_LPM_DRIVE_HIGH (MFPR_SLEEP_DATA(1) | MFPR_PULLUP_EN)
45#define MFPR_LPM_PULL_LOW (MFPR_LPM_DRIVE_LOW | MFPR_SLEEP_OE_N)
46#define MFPR_LPM_PULL_HIGH (MFPR_LPM_DRIVE_HIGH | MFPR_SLEEP_OE_N)
47#define MFPR_LPM_FLOAT (MFPR_SLEEP_OE_N)
48#define MFPR_LPM_MASK (0xe080)
49
50/*
51 * The pullup and pulldown state of the MFP pin at run mode is by default
52 * determined by the selected alternate function. In case that some buggy
53 * devices need to override this default behavior, the definitions below
54 * indicates the setting of corresponding MFPR bits
55 *
56 * Definition pull_sel pullup_en pulldown_en
57 * MFPR_PULL_NONE 0 0 0
58 * MFPR_PULL_LOW 1 0 1
59 * MFPR_PULL_HIGH 1 1 0
60 * MFPR_PULL_BOTH 1 1 1
61 */
62#define MFPR_PULL_NONE (0)
63#define MFPR_PULL_LOW (MFPR_PULL_SEL | MFPR_PULLDOWN_EN)
64#define MFPR_PULL_BOTH (MFPR_PULL_LOW | MFPR_PULLUP_EN)
65#define MFPR_PULL_HIGH (MFPR_PULL_SEL | MFPR_PULLUP_EN)
66 7
67/* PXA3xx common MFP configurations - processor specific ones defined 8/* PXA3xx common MFP configurations - processor specific ones defined
68 * in mfp-pxa300.h and mfp-pxa320.h 9 * in mfp-pxa300.h and mfp-pxa320.h
@@ -197,56 +138,21 @@
197#define GPIO5_2_GPIO MFP_CFG(GPIO5_2, AF0) 138#define GPIO5_2_GPIO MFP_CFG(GPIO5_2, AF0)
198#define GPIO6_2_GPIO MFP_CFG(GPIO6_2, AF0) 139#define GPIO6_2_GPIO MFP_CFG(GPIO6_2, AF0)
199 140
200/* 141/* NOTE: usage of these two functions is not recommended,
201 * each MFP pin will have a MFPR register, since the offset of the 142 * use pxa3xx_mfp_config() instead.
202 * register varies between processors, the processor specific code
203 * should initialize the pin offsets by pxa3xx_mfp_init_addr()
204 *
205 * pxa3xx_mfp_init_addr - accepts a table of "pxa3xx_mfp_addr_map"
206 * structure, which represents a range of MFP pins from "start" to
207 * "end", with the offset begining at "offset", to define a single
208 * pin, let "end" = -1
209 *
210 * use
211 *
212 * MFP_ADDR_X() to define a range of pins
213 * MFP_ADDR() to define a single pin
214 * MFP_ADDR_END to signal the end of pin offset definitions
215 */
216struct pxa3xx_mfp_addr_map {
217 unsigned int start;
218 unsigned int end;
219 unsigned long offset;
220};
221
222#define MFP_ADDR_X(start, end, offset) \
223 { MFP_PIN_##start, MFP_PIN_##end, offset }
224
225#define MFP_ADDR(pin, offset) \
226 { MFP_PIN_##pin, -1, offset }
227
228#define MFP_ADDR_END { MFP_PIN_INVALID, 0 }
229
230/*
231 * pxa3xx_mfp_read()/pxa3xx_mfp_write() - for direct read/write access
232 * to the MFPR register
233 */
234unsigned long pxa3xx_mfp_read(int mfp);
235void pxa3xx_mfp_write(int mfp, unsigned long mfpr_val);
236
237/*
238 * pxa3xx_mfp_config - configure the MFPR registers
239 *
240 * used by board specific initialization code
241 */
242void pxa3xx_mfp_config(unsigned long *mfp_cfgs, int num);
243
244/*
245 * pxa3xx_mfp_init_addr() - initialize the mapping between mfp pin
246 * index and MFPR register offset
247 *
248 * used by processor specific code
249 */ 143 */
250void __init pxa3xx_mfp_init_addr(struct pxa3xx_mfp_addr_map *); 144static inline unsigned long pxa3xx_mfp_read(int mfp)
251void __init pxa3xx_init_mfp(void); 145{
146 return mfp_read(mfp);
147}
148
149static inline void pxa3xx_mfp_write(int mfp, unsigned long val)
150{
151 mfp_write(mfp, val);
152}
153
154static inline void pxa3xx_mfp_config(unsigned long *mfp_cfg, int num)
155{
156 mfp_config(mfp_cfg, num);
157}
252#endif /* __ASM_ARCH_MFP_PXA3XX_H */ 158#endif /* __ASM_ARCH_MFP_PXA3XX_H */
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa930.h b/arch/arm/mach-pxa/include/mach/mfp-pxa930.h
index fa73f56a1372..0d119d3b9221 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa930.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa930.h
@@ -13,7 +13,6 @@
13#ifndef __ASM_ARCH_MFP_PXA9xx_H 13#ifndef __ASM_ARCH_MFP_PXA9xx_H
14#define __ASM_ARCH_MFP_PXA9xx_H 14#define __ASM_ARCH_MFP_PXA9xx_H
15 15
16#include <mach/mfp.h>
17#include <mach/mfp-pxa3xx.h> 16#include <mach/mfp-pxa3xx.h>
18 17
19/* GPIO */ 18/* GPIO */
diff --git a/arch/arm/mach-pxa/include/mach/mtd-xip.h b/arch/arm/mach-pxa/include/mach/mtd-xip.h
index cfca8155be72..297387ec3618 100644
--- a/arch/arm/mach-pxa/include/mach/mtd-xip.h
+++ b/arch/arm/mach-pxa/include/mach/mtd-xip.h
@@ -15,8 +15,8 @@
15#ifndef __ARCH_PXA_MTD_XIP_H__ 15#ifndef __ARCH_PXA_MTD_XIP_H__
16#define __ARCH_PXA_MTD_XIP_H__ 16#define __ARCH_PXA_MTD_XIP_H__
17 17
18#include <mach/hardware.h> 18#include <mach/regs-ost.h>
19#include <mach/pxa-regs.h> 19#include <mach/regs-intc.h>
20 20
21#define xip_irqpending() (ICIP & ICMR) 21#define xip_irqpending() (ICIP & ICMR)
22 22
diff --git a/arch/arm/mach-pxa/include/mach/palmld.h b/arch/arm/mach-pxa/include/mach/palmld.h
new file mode 100644
index 000000000000..7c295a48d784
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/palmld.h
@@ -0,0 +1,109 @@
1/*
2 * GPIOs and interrupts for Palm LifeDrive Handheld Computer
3 *
4 * Authors: Alex Osborne <ato@meshy.org>
5 * Marek Vasut <marek.vasut@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#ifndef _INCLUDE_PALMLD_H_
14#define _INCLUDE_PALMLD_H_
15
16/** HERE ARE GPIOs **/
17
18/* GPIOs */
19#define GPIO_NR_PALMLD_GPIO_RESET 1
20#define GPIO_NR_PALMLD_POWER_DETECT 4
21#define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N 10
22#define GPIO_NR_PALMLD_POWER_SWITCH 12
23#define GPIO_NR_PALMLD_EARPHONE_DETECT 13
24#define GPIO_NR_PALMLD_LOCK_SWITCH 15
25
26/* SD/MMC */
27#define GPIO_NR_PALMLD_SD_DETECT_N 14
28#define GPIO_NR_PALMLD_SD_POWER 114
29#define GPIO_NR_PALMLD_SD_READONLY 116
30
31/* TOUCHSCREEN */
32#define GPIO_NR_PALMLD_WM9712_IRQ 27
33
34/* IRDA */
35#define GPIO_NR_PALMLD_IR_DISABLE 108
36
37/* LCD/BACKLIGHT */
38#define GPIO_NR_PALMLD_BL_POWER 19
39#define GPIO_NR_PALMLD_LCD_POWER 96
40
41/* LCD BORDER */
42#define GPIO_NR_PALMLD_BORDER_SWITCH 21
43#define GPIO_NR_PALMLD_BORDER_SELECT 22
44
45/* BLUETOOTH */
46#define GPIO_NR_PALMLD_BT_POWER 17
47#define GPIO_NR_PALMLD_BT_RESET 83
48
49/* PCMCIA (WiFi) */
50#define GPIO_NR_PALMLD_PCMCIA_READY 38
51#define GPIO_NR_PALMLD_PCMCIA_POWER 36
52#define GPIO_NR_PALMLD_PCMCIA_RESET 81
53
54/* LEDs */
55#define GPIO_NR_PALMLD_LED_GREEN 52
56#define GPIO_NR_PALMLD_LED_AMBER 94
57
58/* IDE */
59#define GPIO_NR_PALMLD_IDE_IRQ 95
60#define GPIO_NR_PALMLD_IDE_RESET 98
61#define GPIO_NR_PALMLD_IDE_PWEN 115
62
63/* USB */
64#define GPIO_NR_PALMLD_USB_DETECT_N 3
65#define GPIO_NR_PALMLD_USB_READY 86
66#define GPIO_NR_PALMLD_USB_RESET 88
67#define GPIO_NR_PALMLD_USB_INT 106
68#define GPIO_NR_PALMLD_USB_POWER 118
69/* 20, 53 and 86 are usb related too */
70
71/* INTERRUPTS */
72#define IRQ_GPIO_PALMLD_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMLD_GPIO_RESET)
73#define IRQ_GPIO_PALMLD_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMLD_SD_DETECT_N)
74#define IRQ_GPIO_PALMLD_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMLD_WM9712_IRQ)
75#define IRQ_GPIO_PALMLD_IDE_IRQ IRQ_GPIO(GPIO_NR_PALMLD_IDE_IRQ)
76
77
78/** HERE ARE INIT VALUES **/
79
80/* IO mappings */
81#define PALMLD_USB_PHYS PXA_CS2_PHYS
82#define PALMLD_USB_VIRT 0xf0000000
83#define PALMLD_USB_SIZE 0x00100000
84
85#define PALMLD_IDE_PHYS 0x20000000
86#define PALMLD_IDE_VIRT 0xf1000000
87#define PALMLD_IDE_SIZE 0x00100000
88
89#define PALMLD_PHYS_IO_START 0x40000000
90
91/* BATTERY */
92#define PALMLD_BAT_MAX_VOLTAGE 4000 /* 4.00V maximum voltage */
93#define PALMLD_BAT_MIN_VOLTAGE 3550 /* 3.55V critical voltage */
94#define PALMLD_BAT_MAX_CURRENT 0 /* unknokn */
95#define PALMLD_BAT_MIN_CURRENT 0 /* unknown */
96#define PALMLD_BAT_MAX_CHARGE 1 /* unknown */
97#define PALMLD_BAT_MIN_CHARGE 1 /* unknown */
98#define PALMLD_MAX_LIFE_MINS 240 /* on-life in minutes */
99
100#define PALMLD_BAT_MEASURE_DELAY (HZ * 1)
101
102/* BACKLIGHT */
103#define PALMLD_MAX_INTENSITY 0xFE
104#define PALMLD_DEFAULT_INTENSITY 0x7E
105#define PALMLD_LIMIT_MASK 0x7F
106#define PALMLD_PRESCALER 0x3F
107#define PALMLD_PERIOD_NS 3500
108
109#endif
diff --git a/arch/arm/mach-pxa/include/mach/palmt5.h b/arch/arm/mach-pxa/include/mach/palmt5.h
new file mode 100644
index 000000000000..94db2881f048
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/palmt5.h
@@ -0,0 +1,84 @@
1/*
2 * GPIOs and interrupts for Palm Tungsten|T5 Handheld Computer
3 *
4 * Authors: Ales Snuparek <snuparek@atlas.cz>
5 * Marek Vasut <marek.vasut@gmail.com>
6 * Justin Kendrick <twilightsentry@gmail.com>
7 * RichardT5 <richard_t5@users.sourceforge.net>
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
15#ifndef _INCLUDE_PALMT5_H_
16#define _INCLUDE_PALMT5_H_
17
18/** HERE ARE GPIOs **/
19
20/* GPIOs */
21#define GPIO_NR_PALMT5_GPIO_RESET 1
22
23#define GPIO_NR_PALMT5_POWER_DETECT 90
24#define GPIO_NR_PALMT5_HOTSYNC_BUTTON_N 10
25#define GPIO_NR_PALMT5_EARPHONE_DETECT 107
26
27/* SD/MMC */
28#define GPIO_NR_PALMT5_SD_DETECT_N 14
29#define GPIO_NR_PALMT5_SD_POWER 114
30#define GPIO_NR_PALMT5_SD_READONLY 115
31
32/* TOUCHSCREEN */
33#define GPIO_NR_PALMT5_WM9712_IRQ 27
34
35/* IRDA - disable GPIO connected to SD pin of tranceiver (TFBS4710?) ? */
36#define GPIO_NR_PALMT5_IR_DISABLE 40
37
38/* USB */
39#define GPIO_NR_PALMT5_USB_DETECT_N 15
40#define GPIO_NR_PALMT5_USB_POWER 95
41#define GPIO_NR_PALMT5_USB_PULLUP 93
42
43/* LCD/BACKLIGHT */
44#define GPIO_NR_PALMT5_BL_POWER 84
45#define GPIO_NR_PALMT5_LCD_POWER 96
46
47/* BLUETOOTH */
48#define GPIO_NR_PALMT5_BT_POWER 17
49#define GPIO_NR_PALMT5_BT_RESET 83
50
51/* INTERRUPTS */
52#define IRQ_GPIO_PALMT5_SD_DETECT_N IRQ_GPIO(GPIO_NR_PALMT5_SD_DETECT_N)
53#define IRQ_GPIO_PALMT5_WM9712_IRQ IRQ_GPIO(GPIO_NR_PALMT5_WM9712_IRQ)
54#define IRQ_GPIO_PALMT5_USB_DETECT IRQ_GPIO(GPIO_NR_PALMT5_USB_DETECT)
55#define IRQ_GPIO_PALMT5_GPIO_RESET IRQ_GPIO(GPIO_NR_PALMT5_GPIO_RESET)
56
57/** HERE ARE INIT VALUES **/
58
59/* Various addresses */
60#define PALMT5_PHYS_RAM_START 0xa0000000
61#define PALMT5_PHYS_IO_START 0x40000000
62
63/* TOUCHSCREEN */
64#define AC97_LINK_FRAME 21
65
66/* BATTERY */
67#define PALMT5_BAT_MAX_VOLTAGE 4000 /* 4.00v current voltage */
68#define PALMT5_BAT_MIN_VOLTAGE 3550 /* 3.55v critical voltage */
69#define PALMT5_BAT_MAX_CURRENT 0 /* unknokn */
70#define PALMT5_BAT_MIN_CURRENT 0 /* unknown */
71#define PALMT5_BAT_MAX_CHARGE 1 /* unknown */
72#define PALMT5_BAT_MIN_CHARGE 1 /* unknown */
73#define PALMT5_MAX_LIFE_MINS 360 /* on-life in minutes */
74
75#define PALMT5_BAT_MEASURE_DELAY (HZ * 1)
76
77/* BACKLIGHT */
78#define PALMT5_MAX_INTENSITY 0xFE
79#define PALMT5_DEFAULT_INTENSITY 0x7E
80#define PALMT5_LIMIT_MASK 0x7F
81#define PALMT5_PRESCALER 0x3F
82#define PALMT5_PERIOD_NS 3500
83
84#endif
diff --git a/arch/arm/mach-pxa/include/mach/pm.h b/arch/arm/mach-pxa/include/mach/pm.h
index 83342469acac..a6eeef8a075f 100644
--- a/arch/arm/mach-pxa/include/mach/pm.h
+++ b/arch/arm/mach-pxa/include/mach/pm.h
@@ -27,3 +27,13 @@ extern void pxa27x_cpu_suspend(unsigned int);
27extern void pxa_cpu_resume(void); 27extern void pxa_cpu_resume(void);
28 28
29extern int pxa_pm_enter(suspend_state_t state); 29extern int pxa_pm_enter(suspend_state_t state);
30
31/* NOTE: this is for PM debugging on Lubbock, it's really a big
32 * ugly, but let's keep the crap minimum here, instead of direct
33 * accessing the LUBBOCK CPLD registers in arch/arm/mach-pxa/pm.c
34 */
35#ifdef CONFIG_ARCH_LUBBOCK
36extern void lubbock_set_hexled(uint32_t value);
37#else
38#define lubbock_set_hexled(x)
39#endif
diff --git a/arch/arm/mach-pxa/include/mach/pxa-regs.h b/arch/arm/mach-pxa/include/mach/pxa-regs.h
deleted file mode 100644
index 31d615aa7723..000000000000
--- a/arch/arm/mach-pxa/include/mach/pxa-regs.h
+++ /dev/null
@@ -1,263 +0,0 @@
1/*
2 * arch/arm/mach-pxa/include/mach/pxa-regs.h
3 *
4 * Author: Nicolas Pitre
5 * Created: Jun 15, 2001
6 * Copyright: MontaVista Software Inc.
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 __PXA_REGS_H
14#define __PXA_REGS_H
15
16#include <mach/hardware.h>
17
18/*
19 * PXA Chip selects
20 */
21
22#define PXA_CS0_PHYS 0x00000000
23#define PXA_CS1_PHYS 0x04000000
24#define PXA_CS2_PHYS 0x08000000
25#define PXA_CS3_PHYS 0x0C000000
26#define PXA_CS4_PHYS 0x10000000
27#define PXA_CS5_PHYS 0x14000000
28
29
30/*
31 * Personal Computer Memory Card International Association (PCMCIA) sockets
32 */
33
34#define PCMCIAPrtSp 0x04000000 /* PCMCIA Partition Space [byte] */
35#define PCMCIASp (4*PCMCIAPrtSp) /* PCMCIA Space [byte] */
36#define PCMCIAIOSp PCMCIAPrtSp /* PCMCIA I/O Space [byte] */
37#define PCMCIAAttrSp PCMCIAPrtSp /* PCMCIA Attribute Space [byte] */
38#define PCMCIAMemSp PCMCIAPrtSp /* PCMCIA Memory Space [byte] */
39
40#define PCMCIA0Sp PCMCIASp /* PCMCIA 0 Space [byte] */
41#define PCMCIA0IOSp PCMCIAIOSp /* PCMCIA 0 I/O Space [byte] */
42#define PCMCIA0AttrSp PCMCIAAttrSp /* PCMCIA 0 Attribute Space [byte] */
43#define PCMCIA0MemSp PCMCIAMemSp /* PCMCIA 0 Memory Space [byte] */
44
45#define PCMCIA1Sp PCMCIASp /* PCMCIA 1 Space [byte] */
46#define PCMCIA1IOSp PCMCIAIOSp /* PCMCIA 1 I/O Space [byte] */
47#define PCMCIA1AttrSp PCMCIAAttrSp /* PCMCIA 1 Attribute Space [byte] */
48#define PCMCIA1MemSp PCMCIAMemSp /* PCMCIA 1 Memory Space [byte] */
49
50#define _PCMCIA(Nb) /* PCMCIA [0..1] */ \
51 (0x20000000 + (Nb)*PCMCIASp)
52#define _PCMCIAIO(Nb) _PCMCIA (Nb) /* PCMCIA I/O [0..1] */
53#define _PCMCIAAttr(Nb) /* PCMCIA Attribute [0..1] */ \
54 (_PCMCIA (Nb) + 2*PCMCIAPrtSp)
55#define _PCMCIAMem(Nb) /* PCMCIA Memory [0..1] */ \
56 (_PCMCIA (Nb) + 3*PCMCIAPrtSp)
57
58#define _PCMCIA0 _PCMCIA (0) /* PCMCIA 0 */
59#define _PCMCIA0IO _PCMCIAIO (0) /* PCMCIA 0 I/O */
60#define _PCMCIA0Attr _PCMCIAAttr (0) /* PCMCIA 0 Attribute */
61#define _PCMCIA0Mem _PCMCIAMem (0) /* PCMCIA 0 Memory */
62
63#define _PCMCIA1 _PCMCIA (1) /* PCMCIA 1 */
64#define _PCMCIA1IO _PCMCIAIO (1) /* PCMCIA 1 I/O */
65#define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */
66#define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */
67
68
69
70/*
71 * DMA Controller
72 */
73#define DCSR(x) __REG2(0x40000000, (x) << 2)
74
75#define DCSR_RUN (1 << 31) /* Run Bit (read / write) */
76#define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch (read / write) */
77#define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */
78#define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */
79#define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */
80#define DCSR_ENDINTR (1 << 2) /* End Interrupt (read / write) */
81#define DCSR_STARTINTR (1 << 1) /* Start Interrupt (read / write) */
82#define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt (read / write) */
83
84#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
85#define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */
86#define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */
87#define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */
88#define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */
89#define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */
90#define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */
91#define DCSR_EORINTR (1 << 9) /* The end of Receive */
92#endif
93
94#define DALGN __REG(0x400000a0) /* DMA Alignment Register */
95#define DINT __REG(0x400000f0) /* DMA Interrupt Register */
96
97#define DRCMR(n) (*(((n) < 64) ? \
98 &__REG2(0x40000100, ((n) & 0x3f) << 2) : \
99 &__REG2(0x40001100, ((n) & 0x3f) << 2)))
100
101#define DRCMR_MAPVLD (1 << 7) /* Map Valid (read / write) */
102#define DRCMR_CHLNUM 0x1f /* mask for Channel Number (read / write) */
103
104#define DDADR(x) __REG2(0x40000200, (x) << 4)
105#define DSADR(x) __REG2(0x40000204, (x) << 4)
106#define DTADR(x) __REG2(0x40000208, (x) << 4)
107#define DCMD(x) __REG2(0x4000020c, (x) << 4)
108
109#define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor (mask) */
110#define DDADR_STOP (1 << 0) /* Stop (read / write) */
111
112#define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */
113#define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */
114#define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */
115#define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */
116#define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */
117#define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */
118#define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */
119#define DCMD_BURST8 (1 << 16) /* 8 byte burst */
120#define DCMD_BURST16 (2 << 16) /* 16 byte burst */
121#define DCMD_BURST32 (3 << 16) /* 32 byte burst */
122#define DCMD_WIDTH1 (1 << 14) /* 1 byte width */
123#define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */
124#define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */
125#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
126
127/*
128 * Real Time Clock
129 */
130
131#define RCNR __REG(0x40900000) /* RTC Count Register */
132#define RTAR __REG(0x40900004) /* RTC Alarm Register */
133#define RTSR __REG(0x40900008) /* RTC Status Register */
134#define RTTR __REG(0x4090000C) /* RTC Timer Trim Register */
135#define PIAR __REG(0x40900038) /* Periodic Interrupt Alarm Register */
136
137#define RTSR_PICE (1 << 15) /* Periodic interrupt count enable */
138#define RTSR_PIALE (1 << 14) /* Periodic interrupt Alarm enable */
139#define RTSR_HZE (1 << 3) /* HZ interrupt enable */
140#define RTSR_ALE (1 << 2) /* RTC alarm interrupt enable */
141#define RTSR_HZ (1 << 1) /* HZ rising-edge detected */
142#define RTSR_AL (1 << 0) /* RTC alarm detected */
143
144
145/*
146 * OS Timer & Match Registers
147 */
148
149#define OSMR0 __REG(0x40A00000) /* */
150#define OSMR1 __REG(0x40A00004) /* */
151#define OSMR2 __REG(0x40A00008) /* */
152#define OSMR3 __REG(0x40A0000C) /* */
153#define OSMR4 __REG(0x40A00080) /* */
154#define OSCR __REG(0x40A00010) /* OS Timer Counter Register */
155#define OSCR4 __REG(0x40A00040) /* OS Timer Counter Register */
156#define OMCR4 __REG(0x40A000C0) /* */
157#define OSSR __REG(0x40A00014) /* OS Timer Status Register */
158#define OWER __REG(0x40A00018) /* OS Timer Watchdog Enable Register */
159#define OIER __REG(0x40A0001C) /* OS Timer Interrupt Enable Register */
160
161#define OSSR_M3 (1 << 3) /* Match status channel 3 */
162#define OSSR_M2 (1 << 2) /* Match status channel 2 */
163#define OSSR_M1 (1 << 1) /* Match status channel 1 */
164#define OSSR_M0 (1 << 0) /* Match status channel 0 */
165
166#define OWER_WME (1 << 0) /* Watchdog Match Enable */
167
168#define OIER_E3 (1 << 3) /* Interrupt enable channel 3 */
169#define OIER_E2 (1 << 2) /* Interrupt enable channel 2 */
170#define OIER_E1 (1 << 1) /* Interrupt enable channel 1 */
171#define OIER_E0 (1 << 0) /* Interrupt enable channel 0 */
172
173
174/*
175 * Interrupt Controller
176 */
177
178#define ICIP __REG(0x40D00000) /* Interrupt Controller IRQ Pending Register */
179#define ICMR __REG(0x40D00004) /* Interrupt Controller Mask Register */
180#define ICLR __REG(0x40D00008) /* Interrupt Controller Level Register */
181#define ICFP __REG(0x40D0000C) /* Interrupt Controller FIQ Pending Register */
182#define ICPR __REG(0x40D00010) /* Interrupt Controller Pending Register */
183#define ICCR __REG(0x40D00014) /* Interrupt Controller Control Register */
184
185#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
186#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
187#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
188#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
189#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
190
191/*
192 * General Purpose I/O
193 */
194
195#define GPLR0 __REG(0x40E00000) /* GPIO Pin-Level Register GPIO<31:0> */
196#define GPLR1 __REG(0x40E00004) /* GPIO Pin-Level Register GPIO<63:32> */
197#define GPLR2 __REG(0x40E00008) /* GPIO Pin-Level Register GPIO<80:64> */
198
199#define GPDR0 __REG(0x40E0000C) /* GPIO Pin Direction Register GPIO<31:0> */
200#define GPDR1 __REG(0x40E00010) /* GPIO Pin Direction Register GPIO<63:32> */
201#define GPDR2 __REG(0x40E00014) /* GPIO Pin Direction Register GPIO<80:64> */
202
203#define GPSR0 __REG(0x40E00018) /* GPIO Pin Output Set Register GPIO<31:0> */
204#define GPSR1 __REG(0x40E0001C) /* GPIO Pin Output Set Register GPIO<63:32> */
205#define GPSR2 __REG(0x40E00020) /* GPIO Pin Output Set Register GPIO<80:64> */
206
207#define GPCR0 __REG(0x40E00024) /* GPIO Pin Output Clear Register GPIO<31:0> */
208#define GPCR1 __REG(0x40E00028) /* GPIO Pin Output Clear Register GPIO <63:32> */
209#define GPCR2 __REG(0x40E0002C) /* GPIO Pin Output Clear Register GPIO <80:64> */
210
211#define GRER0 __REG(0x40E00030) /* GPIO Rising-Edge Detect Register GPIO<31:0> */
212#define GRER1 __REG(0x40E00034) /* GPIO Rising-Edge Detect Register GPIO<63:32> */
213#define GRER2 __REG(0x40E00038) /* GPIO Rising-Edge Detect Register GPIO<80:64> */
214
215#define GFER0 __REG(0x40E0003C) /* GPIO Falling-Edge Detect Register GPIO<31:0> */
216#define GFER1 __REG(0x40E00040) /* GPIO Falling-Edge Detect Register GPIO<63:32> */
217#define GFER2 __REG(0x40E00044) /* GPIO Falling-Edge Detect Register GPIO<80:64> */
218
219#define GEDR0 __REG(0x40E00048) /* GPIO Edge Detect Status Register GPIO<31:0> */
220#define GEDR1 __REG(0x40E0004C) /* GPIO Edge Detect Status Register GPIO<63:32> */
221#define GEDR2 __REG(0x40E00050) /* GPIO Edge Detect Status Register GPIO<80:64> */
222
223#define GAFR0_L __REG(0x40E00054) /* GPIO Alternate Function Select Register GPIO<15:0> */
224#define GAFR0_U __REG(0x40E00058) /* GPIO Alternate Function Select Register GPIO<31:16> */
225#define GAFR1_L __REG(0x40E0005C) /* GPIO Alternate Function Select Register GPIO<47:32> */
226#define GAFR1_U __REG(0x40E00060) /* GPIO Alternate Function Select Register GPIO<63:48> */
227#define GAFR2_L __REG(0x40E00064) /* GPIO Alternate Function Select Register GPIO<79:64> */
228#define GAFR2_U __REG(0x40E00068) /* GPIO Alternate Function Select Register GPIO<95-80> */
229#define GAFR3_L __REG(0x40E0006C) /* GPIO Alternate Function Select Register GPIO<111:96> */
230#define GAFR3_U __REG(0x40E00070) /* GPIO Alternate Function Select Register GPIO<127:112> */
231
232#define GPLR3 __REG(0x40E00100) /* GPIO Pin-Level Register GPIO<127:96> */
233#define GPDR3 __REG(0x40E0010C) /* GPIO Pin Direction Register GPIO<127:96> */
234#define GPSR3 __REG(0x40E00118) /* GPIO Pin Output Set Register GPIO<127:96> */
235#define GPCR3 __REG(0x40E00124) /* GPIO Pin Output Clear Register GPIO<127:96> */
236#define GRER3 __REG(0x40E00130) /* GPIO Rising-Edge Detect Register GPIO<127:96> */
237#define GFER3 __REG(0x40E0013C) /* GPIO Falling-Edge Detect Register GPIO<127:96> */
238#define GEDR3 __REG(0x40E00148) /* GPIO Edge Detect Status Register GPIO<127:96> */
239
240/* More handy macros. The argument is a literal GPIO number. */
241
242#define GPIO_bit(x) (1 << ((x) & 0x1f))
243
244#define _GPLR(x) __REG2(0x40E00000, ((x) & 0x60) >> 3)
245#define _GPDR(x) __REG2(0x40E0000C, ((x) & 0x60) >> 3)
246#define _GPSR(x) __REG2(0x40E00018, ((x) & 0x60) >> 3)
247#define _GPCR(x) __REG2(0x40E00024, ((x) & 0x60) >> 3)
248#define _GRER(x) __REG2(0x40E00030, ((x) & 0x60) >> 3)
249#define _GFER(x) __REG2(0x40E0003C, ((x) & 0x60) >> 3)
250#define _GEDR(x) __REG2(0x40E00048, ((x) & 0x60) >> 3)
251#define _GAFR(x) __REG2(0x40E00054, ((x) & 0x70) >> 2)
252
253#define GPLR(x) (*((((x) & 0x7f) < 96) ? &_GPLR(x) : &GPLR3))
254#define GPDR(x) (*((((x) & 0x7f) < 96) ? &_GPDR(x) : &GPDR3))
255#define GPSR(x) (*((((x) & 0x7f) < 96) ? &_GPSR(x) : &GPSR3))
256#define GPCR(x) (*((((x) & 0x7f) < 96) ? &_GPCR(x) : &GPCR3))
257#define GRER(x) (*((((x) & 0x7f) < 96) ? &_GRER(x) : &GRER3))
258#define GFER(x) (*((((x) & 0x7f) < 96) ? &_GFER(x) : &GFER3))
259#define GEDR(x) (*((((x) & 0x7f) < 96) ? &_GEDR(x) : &GEDR3))
260#define GAFR(x) (*((((x) & 0x7f) < 96) ? &_GAFR(x) : \
261 ((((x) & 0x7f) < 112) ? &GAFR3_L : &GAFR3_U)))
262
263#endif
diff --git a/arch/arm/mach-pxa/include/mach/pxa25x.h b/arch/arm/mach-pxa/include/mach/pxa25x.h
new file mode 100644
index 000000000000..508c3ba1f4d0
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa25x.h
@@ -0,0 +1,8 @@
1#ifndef __MACH_PXA25x_H
2#define __MACH_PXA25x_H
3
4#include <mach/hardware.h>
5#include <mach/pxa2xx-regs.h>
6#include <mach/mfp-pxa25x.h>
7
8#endif /* __MACH_PXA25x_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxa27x.h b/arch/arm/mach-pxa/include/mach/pxa27x.h
new file mode 100644
index 000000000000..6876e16c2970
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa27x.h
@@ -0,0 +1,19 @@
1#ifndef __MACH_PXA27x_H
2#define __MACH_PXA27x_H
3
4#include <mach/hardware.h>
5#include <mach/pxa2xx-regs.h>
6#include <mach/mfp-pxa27x.h>
7
8#define ARB_CNTRL __REG(0x48000048) /* Arbiter Control Register */
9
10#define ARB_DMA_SLV_PARK (1<<31) /* Be parked with DMA slave when idle */
11#define ARB_CI_PARK (1<<30) /* Be parked with Camera Interface when idle */
12#define ARB_EX_MEM_PARK (1<<29) /* Be parked with external MEMC when idle */
13#define ARB_INT_MEM_PARK (1<<28) /* Be parked with internal MEMC when idle */
14#define ARB_USB_PARK (1<<27) /* Be parked with USB when idle */
15#define ARB_LCD_PARK (1<<26) /* Be parked with LCD when idle */
16#define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */
17#define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */
18#define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */
19#endif /* __MACH_PXA27x_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h b/arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h
index d83393e25273..1209c44aa6f1 100644
--- a/arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h
+++ b/arch/arm/mach-pxa/include/mach/pxa2xx-gpio.h
@@ -3,6 +3,8 @@
3 3
4#warning Please use mfp-pxa2[57]x.h instead of pxa2xx-gpio.h 4#warning Please use mfp-pxa2[57]x.h instead of pxa2xx-gpio.h
5 5
6#include <mach/gpio.h>
7
6/* GPIO alternate function assignments */ 8/* GPIO alternate function assignments */
7 9
8#define GPIO1_RST 1 /* reset */ 10#define GPIO1_RST 1 /* reset */
diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
index 77102d695cc7..4fcddd9cab76 100644
--- a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
+++ b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
@@ -14,6 +14,19 @@
14#ifndef __PXA2XX_REGS_H 14#ifndef __PXA2XX_REGS_H
15#define __PXA2XX_REGS_H 15#define __PXA2XX_REGS_H
16 16
17#include <mach/hardware.h>
18
19/*
20 * PXA Chip selects
21 */
22
23#define PXA_CS0_PHYS 0x00000000
24#define PXA_CS1_PHYS 0x04000000
25#define PXA_CS2_PHYS 0x08000000
26#define PXA_CS3_PHYS 0x0C000000
27#define PXA_CS4_PHYS 0x10000000
28#define PXA_CS5_PHYS 0x14000000
29
17/* 30/*
18 * Memory controller 31 * Memory controller
19 */ 32 */
@@ -69,24 +82,6 @@
69#define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */ 82#define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */
70#define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */ 83#define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */
71 84
72
73#ifdef CONFIG_PXA27x
74
75#define ARB_CNTRL __REG(0x48000048) /* Arbiter Control Register */
76
77#define ARB_DMA_SLV_PARK (1<<31) /* Be parked with DMA slave when idle */
78#define ARB_CI_PARK (1<<30) /* Be parked with Camera Interface when idle */
79#define ARB_EX_MEM_PARK (1<<29) /* Be parked with external MEMC when idle */
80#define ARB_INT_MEM_PARK (1<<28) /* Be parked with internal MEMC when idle */
81#define ARB_USB_PARK (1<<27) /* Be parked with USB when idle */
82#define ARB_LCD_PARK (1<<26) /* Be parked with LCD when idle */
83#define ARB_DMA_PARK (1<<25) /* Be parked with DMA when idle */
84#define ARB_CORE_PARK (1<<24) /* Be parked with core when idle */
85#define ARB_LOCK_FLAG (1<<23) /* Only Locking masters gain access to the bus */
86
87#endif
88
89
90/* 85/*
91 * Power Manager 86 * Power Manager
92 */ 87 */
diff --git a/arch/arm/mach-pxa/include/mach/pxa300.h b/arch/arm/mach-pxa/include/mach/pxa300.h
new file mode 100644
index 000000000000..2f33076c9e48
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa300.h
@@ -0,0 +1,8 @@
1#ifndef __MACH_PXA300_H
2#define __MACH_PXA300_H
3
4#include <mach/hardware.h>
5#include <mach/pxa3xx-regs.h>
6#include <mach/mfp-pxa300.h>
7
8#endif /* __MACH_PXA300_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxa320.h b/arch/arm/mach-pxa/include/mach/pxa320.h
new file mode 100644
index 000000000000..cab78e903273
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa320.h
@@ -0,0 +1,9 @@
1#ifndef __MACH_PXA320_H
2#define __MACH_PXA320_H
3
4#include <mach/hardware.h>
5#include <mach/pxa3xx-regs.h>
6#include <mach/mfp-pxa320.h>
7
8#endif /* __MACH_PXA320_H */
9
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
index bcf3fb2c4b3a..7d1a059b3d43 100644
--- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
+++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
@@ -13,6 +13,17 @@
13#ifndef __ASM_ARCH_PXA3XX_REGS_H 13#ifndef __ASM_ARCH_PXA3XX_REGS_H
14#define __ASM_ARCH_PXA3XX_REGS_H 14#define __ASM_ARCH_PXA3XX_REGS_H
15 15
16#include <mach/hardware.h>
17
18/*
19 * Static Chip Selects
20 */
21
22#define PXA300_CS0_PHYS (0x00000000) /* PXA300/PXA310 _only_ */
23#define PXA300_CS1_PHYS (0x30000000) /* PXA300/PXA310 _only_ */
24#define PXA3xx_CS2_PHYS (0x10000000)
25#define PXA3xx_CS3_PHYS (0x14000000)
26
16/* 27/*
17 * Oscillator Configuration Register (OSCC) 28 * Oscillator Configuration Register (OSCC)
18 */ 29 */
diff --git a/arch/arm/mach-pxa/include/mach/pxa930.h b/arch/arm/mach-pxa/include/mach/pxa930.h
new file mode 100644
index 000000000000..d45f76a9b54d
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa930.h
@@ -0,0 +1,8 @@
1#ifndef __MACH_PXA930_H
2#define __MACH_PXA930_H
3
4#include <mach/hardware.h>
5#include <mach/pxa3xx-regs.h>
6#include <mach/mfp-pxa930.h>
7
8#endif /* __MACH_PXA930_H */
diff --git a/arch/arm/mach-pxa/include/mach/regs-intc.h b/arch/arm/mach-pxa/include/mach/regs-intc.h
new file mode 100644
index 000000000000..ad23e74b762f
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/regs-intc.h
@@ -0,0 +1,23 @@
1#ifndef __ASM_MACH_REGS_INTC_H
2#define __ASM_MACH_REGS_INTC_H
3
4#include <mach/hardware.h>
5
6/*
7 * Interrupt Controller
8 */
9
10#define ICIP __REG(0x40D00000) /* Interrupt Controller IRQ Pending Register */
11#define ICMR __REG(0x40D00004) /* Interrupt Controller Mask Register */
12#define ICLR __REG(0x40D00008) /* Interrupt Controller Level Register */
13#define ICFP __REG(0x40D0000C) /* Interrupt Controller FIQ Pending Register */
14#define ICPR __REG(0x40D00010) /* Interrupt Controller Pending Register */
15#define ICCR __REG(0x40D00014) /* Interrupt Controller Control Register */
16
17#define ICIP2 __REG(0x40D0009C) /* Interrupt Controller IRQ Pending Register 2 */
18#define ICMR2 __REG(0x40D000A0) /* Interrupt Controller Mask Register 2 */
19#define ICLR2 __REG(0x40D000A4) /* Interrupt Controller Level Register 2 */
20#define ICFP2 __REG(0x40D000A8) /* Interrupt Controller FIQ Pending Register 2 */
21#define ICPR2 __REG(0x40D000AC) /* Interrupt Controller Pending Register 2 */
22
23#endif /* __ASM_MACH_REGS_INTC_H */
diff --git a/arch/arm/mach-pxa/include/mach/regs-ost.h b/arch/arm/mach-pxa/include/mach/regs-ost.h
new file mode 100644
index 000000000000..a3e5f86ef67e
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/regs-ost.h
@@ -0,0 +1,34 @@
1#ifndef __ASM_MACH_REGS_OST_H
2#define __ASM_MACH_REGS_OST_H
3
4#include <mach/hardware.h>
5
6/*
7 * OS Timer & Match Registers
8 */
9
10#define OSMR0 __REG(0x40A00000) /* */
11#define OSMR1 __REG(0x40A00004) /* */
12#define OSMR2 __REG(0x40A00008) /* */
13#define OSMR3 __REG(0x40A0000C) /* */
14#define OSMR4 __REG(0x40A00080) /* */
15#define OSCR __REG(0x40A00010) /* OS Timer Counter Register */
16#define OSCR4 __REG(0x40A00040) /* OS Timer Counter Register */
17#define OMCR4 __REG(0x40A000C0) /* */
18#define OSSR __REG(0x40A00014) /* OS Timer Status Register */
19#define OWER __REG(0x40A00018) /* OS Timer Watchdog Enable Register */
20#define OIER __REG(0x40A0001C) /* OS Timer Interrupt Enable Register */
21
22#define OSSR_M3 (1 << 3) /* Match status channel 3 */
23#define OSSR_M2 (1 << 2) /* Match status channel 2 */
24#define OSSR_M1 (1 << 1) /* Match status channel 1 */
25#define OSSR_M0 (1 << 0) /* Match status channel 0 */
26
27#define OWER_WME (1 << 0) /* Watchdog Match Enable */
28
29#define OIER_E3 (1 << 3) /* Interrupt enable channel 3 */
30#define OIER_E2 (1 << 2) /* Interrupt enable channel 2 */
31#define OIER_E1 (1 << 1) /* Interrupt enable channel 1 */
32#define OIER_E0 (1 << 0) /* Interrupt enable channel 0 */
33
34#endif /* __ASM_MACH_REGS_OST_H */
diff --git a/arch/arm/mach-pxa/include/mach/regs-rtc.h b/arch/arm/mach-pxa/include/mach/regs-rtc.h
new file mode 100644
index 000000000000..f0e4a589bbe1
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/regs-rtc.h
@@ -0,0 +1,23 @@
1#ifndef __ASM_MACH_REGS_RTC_H
2#define __ASM_MACH_REGS_RTC_H
3
4#include <mach/hardware.h>
5
6/*
7 * Real Time Clock
8 */
9
10#define RCNR __REG(0x40900000) /* RTC Count Register */
11#define RTAR __REG(0x40900004) /* RTC Alarm Register */
12#define RTSR __REG(0x40900008) /* RTC Status Register */
13#define RTTR __REG(0x4090000C) /* RTC Timer Trim Register */
14#define PIAR __REG(0x40900038) /* Periodic Interrupt Alarm Register */
15
16#define RTSR_PICE (1 << 15) /* Periodic interrupt count enable */
17#define RTSR_PIALE (1 << 14) /* Periodic interrupt Alarm enable */
18#define RTSR_HZE (1 << 3) /* HZ interrupt enable */
19#define RTSR_ALE (1 << 2) /* RTC alarm interrupt enable */
20#define RTSR_HZ (1 << 1) /* HZ rising-edge detected */
21#define RTSR_AL (1 << 0) /* RTC alarm detected */
22
23#endif /* __ASM_MACH_REGS_RTC_H */
diff --git a/arch/arm/mach-pxa/include/mach/regs-ssp.h b/arch/arm/mach-pxa/include/mach/regs-ssp.h
index cf31986f6f05..6a2ed35acd59 100644
--- a/arch/arm/mach-pxa/include/mach/regs-ssp.h
+++ b/arch/arm/mach-pxa/include/mach/regs-ssp.h
@@ -37,7 +37,6 @@
37#if defined(CONFIG_PXA25x) 37#if defined(CONFIG_PXA25x)
38#define SSCR0_SCR (0x0000ff00) /* Serial Clock Rate (mask) */ 38#define SSCR0_SCR (0x0000ff00) /* Serial Clock Rate (mask) */
39#define SSCR0_SerClkDiv(x) ((((x) - 2)/2) << 8) /* Divisor [2..512] */ 39#define SSCR0_SerClkDiv(x) ((((x) - 2)/2) << 8) /* Divisor [2..512] */
40
41#elif defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 40#elif defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
42#define SSCR0_SCR (0x000fff00) /* Serial Clock Rate (mask) */ 41#define SSCR0_SCR (0x000fff00) /* Serial Clock Rate (mask) */
43#define SSCR0_SerClkDiv(x) (((x) - 1) << 8) /* Divisor [1..4096] */ 42#define SSCR0_SerClkDiv(x) (((x) - 1) << 8) /* Divisor [1..4096] */
@@ -50,7 +49,7 @@
50#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */ 49#define SSCR0_TUM (1 << 23) /* Transmit FIFO underrun interrupt mask */
51#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */ 50#define SSCR0_FRDC (0x07000000) /* Frame rate divider control (mask) */
52#define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */ 51#define SSCR0_SlotsPerFrm(x) (((x) - 1) << 24) /* Time slots per frame [1..8] */
53#define SSCR0_ADC (1 << 30) /* Audio clock select */ 52#define SSCR0_ACS (1 << 30) /* Audio clock select */
54#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */ 53#define SSCR0_MOD (1 << 31) /* Mode (normal or network) */
55#endif 54#endif
56 55
@@ -109,6 +108,11 @@
109#define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */ 108#define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */
110#define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */ 109#define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */
111 110
111#if defined(CONFIG_PXA3xx)
112#define SSPSP_EDMYSTOP(x) ((x) << 28) /* Extended Dummy Stop */
113#define SSPSP_EDMYSTRT(x) ((x) << 26) /* Extended Dummy Start */
114#endif
115
112#define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */ 116#define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */
113#define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */ 117#define SSPSP_DMYSTOP(x) ((x) << 23) /* Dummy Stop */
114#define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */ 118#define SSPSP_SFRMWDTH(x) ((x) << 16) /* Serial Frame Width */
diff --git a/arch/arm/mach-pxa/include/mach/system.h b/arch/arm/mach-pxa/include/mach/system.h
index 0f381e692999..d1fce8b6d105 100644
--- a/arch/arm/mach-pxa/include/mach/system.h
+++ b/arch/arm/mach-pxa/include/mach/system.h
@@ -13,7 +13,6 @@
13#include <asm/proc-fns.h> 13#include <asm/proc-fns.h>
14#include "hardware.h" 14#include "hardware.h"
15#include "pxa2xx-regs.h" 15#include "pxa2xx-regs.h"
16#include "pxa-regs.h"
17 16
18static inline void arch_idle(void) 17static inline void arch_idle(void)
19{ 18{
@@ -21,4 +20,4 @@ static inline void arch_idle(void)
21} 20}
22 21
23 22
24void arch_reset(char mode); 23void arch_reset(char mode, const char *cmd);
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index f4b029c03957..5706cea95d11 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -35,7 +35,8 @@ static inline void flush(void)
35 35
36static inline void arch_decomp_setup(void) 36static inline void arch_decomp_setup(void)
37{ 37{
38 if (machine_is_littleton() || machine_is_intelmote2()) 38 if (machine_is_littleton() || machine_is_intelmote2()
39 || machine_is_csb726())
39 UART = STUART; 40 UART = STUART;
40} 41}
41 42
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index fa69c3a6a38e..f6e0300e4f64 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -20,7 +20,8 @@
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/mach/irq.h> 22#include <asm/mach/irq.h>
23#include <mach/pxa-regs.h> 23#include <mach/gpio.h>
24#include <mach/regs-intc.h>
24 25
25#include "generic.h" 26#include "generic.h"
26 27
@@ -51,6 +52,72 @@ static struct irq_chip pxa_internal_irq_chip = {
51 .unmask = pxa_unmask_irq, 52 .unmask = pxa_unmask_irq,
52}; 53};
53 54
55/*
56 * GPIO IRQs for GPIO 0 and 1
57 */
58static int pxa_set_low_gpio_type(unsigned int irq, unsigned int type)
59{
60 int gpio = irq - IRQ_GPIO0;
61
62 if (__gpio_is_occupied(gpio)) {
63 pr_err("%s failed: GPIO is configured\n", __func__);
64 return -EINVAL;
65 }
66
67 if (type & IRQ_TYPE_EDGE_RISING)
68 GRER0 |= GPIO_bit(gpio);
69 else
70 GRER0 &= ~GPIO_bit(gpio);
71
72 if (type & IRQ_TYPE_EDGE_FALLING)
73 GFER0 |= GPIO_bit(gpio);
74 else
75 GFER0 &= ~GPIO_bit(gpio);
76
77 return 0;
78}
79
80static void pxa_ack_low_gpio(unsigned int irq)
81{
82 GEDR0 = (1 << (irq - IRQ_GPIO0));
83}
84
85static void pxa_mask_low_gpio(unsigned int irq)
86{
87 ICMR &= ~(1 << (irq - PXA_IRQ(0)));
88}
89
90static void pxa_unmask_low_gpio(unsigned int irq)
91{
92 ICMR |= 1 << (irq - PXA_IRQ(0));
93}
94
95static struct irq_chip pxa_low_gpio_chip = {
96 .name = "GPIO-l",
97 .ack = pxa_ack_low_gpio,
98 .mask = pxa_mask_low_gpio,
99 .unmask = pxa_unmask_low_gpio,
100 .set_type = pxa_set_low_gpio_type,
101};
102
103static void __init pxa_init_low_gpio_irq(set_wake_t fn)
104{
105 int irq;
106
107 /* clear edge detection on GPIO 0 and 1 */
108 GFER0 &= ~0x3;
109 GRER0 &= ~0x3;
110 GEDR0 = 0x3;
111
112 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
113 set_irq_chip(irq, &pxa_low_gpio_chip);
114 set_irq_handler(irq, handle_edge_irq);
115 set_irq_flags(irq, IRQF_VALID);
116 }
117
118 pxa_low_gpio_chip.set_wake = fn;
119}
120
54void __init pxa_init_irq(int irq_nr, set_wake_t fn) 121void __init pxa_init_irq(int irq_nr, set_wake_t fn)
55{ 122{
56 int irq; 123 int irq;
@@ -72,6 +139,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
72 } 139 }
73 140
74 pxa_internal_irq_chip.set_wake = fn; 141 pxa_internal_irq_chip.set_wake = fn;
142 pxa_init_low_gpio_irq(fn);
75} 143}
76 144
77#ifdef CONFIG_PM 145#ifdef CONFIG_PM
diff --git a/arch/arm/mach-pxa/leds-idp.c b/arch/arm/mach-pxa/leds-idp.c
index 18b20d469410..8b9c17142d5a 100644
--- a/arch/arm/mach-pxa/leds-idp.c
+++ b/arch/arm/mach-pxa/leds-idp.c
@@ -18,7 +18,7 @@
18#include <asm/leds.h> 18#include <asm/leds.h>
19#include <asm/system.h> 19#include <asm/system.h>
20 20
21#include <mach/pxa-regs.h> 21#include <mach/pxa25x.h>
22#include <mach/idp.h> 22#include <mach/idp.h>
23 23
24#include "leds.h" 24#include "leds.h"
diff --git a/arch/arm/mach-pxa/leds-lubbock.c b/arch/arm/mach-pxa/leds-lubbock.c
index 1a258029c33c..e26d5efe1969 100644
--- a/arch/arm/mach-pxa/leds-lubbock.c
+++ b/arch/arm/mach-pxa/leds-lubbock.c
@@ -16,7 +16,7 @@
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <asm/leds.h> 17#include <asm/leds.h>
18#include <asm/system.h> 18#include <asm/system.h>
19#include <mach/pxa-regs.h> 19#include <mach/pxa25x.h>
20#include <mach/lubbock.h> 20#include <mach/lubbock.h>
21 21
22#include "leds.h" 22#include "leds.h"
diff --git a/arch/arm/mach-pxa/leds-mainstone.c b/arch/arm/mach-pxa/leds-mainstone.c
index 95e06b849634..db4af5eee8b2 100644
--- a/arch/arm/mach-pxa/leds-mainstone.c
+++ b/arch/arm/mach-pxa/leds-mainstone.c
@@ -16,7 +16,7 @@
16#include <asm/leds.h> 16#include <asm/leds.h>
17#include <asm/system.h> 17#include <asm/system.h>
18 18
19#include <mach/pxa-regs.h> 19#include <mach/pxa27x.h>
20#include <mach/mainstone.h> 20#include <mach/mainstone.h>
21 21
22#include "leds.h" 22#include "leds.h"
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 31da7f3c06f6..e13f6a81c223 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -39,8 +39,7 @@
39#include <asm/mach/map.h> 39#include <asm/mach/map.h>
40#include <asm/mach/irq.h> 40#include <asm/mach/irq.h>
41 41
42#include <mach/pxa-regs.h> 42#include <mach/pxa300.h>
43#include <mach/mfp-pxa300.h>
44#include <mach/pxafb.h> 43#include <mach/pxafb.h>
45#include <mach/ssp.h> 44#include <mach/ssp.h>
46#include <mach/pxa2xx_spi.h> 45#include <mach/pxa2xx_spi.h>
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index de3f67daaacf..d64395f26a3e 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -38,9 +38,8 @@
38#include <asm/mach/irq.h> 38#include <asm/mach/irq.h>
39#include <asm/mach/flash.h> 39#include <asm/mach/flash.h>
40 40
41#include <mach/pxa-regs.h> 41#include <mach/pxa27x.h>
42#include <mach/pxa2xx-regs.h> 42#include <mach/gpio.h>
43#include <mach/mfp-pxa27x.h>
44#include <mach/lpd270.h> 43#include <mach/lpd270.h>
45#include <mach/audio.h> 44#include <mach/audio.h>
46#include <mach/pxafb.h> 45#include <mach/pxafb.h>
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index bff704354c1a..f04c8333dff7 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -41,15 +41,15 @@
41 41
42#include <asm/hardware/sa1111.h> 42#include <asm/hardware/sa1111.h>
43 43
44#include <mach/pxa-regs.h> 44#include <mach/pxa25x.h>
45#include <mach/pxa2xx-regs.h> 45#include <mach/gpio.h>
46#include <mach/mfp-pxa25x.h>
47#include <mach/audio.h> 46#include <mach/audio.h>
48#include <mach/lubbock.h> 47#include <mach/lubbock.h>
49#include <mach/udc.h> 48#include <mach/udc.h>
50#include <mach/irda.h> 49#include <mach/irda.h>
51#include <mach/pxafb.h> 50#include <mach/pxafb.h>
52#include <mach/mmc.h> 51#include <mach/mmc.h>
52#include <mach/pm.h>
53 53
54#include "generic.h" 54#include "generic.h"
55#include "clock.h" 55#include "clock.h"
@@ -113,8 +113,14 @@ static unsigned long lubbock_pin_config[] __initdata = {
113 GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, 113 GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,
114}; 114};
115 115
116#define LUB_HEXLED __LUB_REG(LUBBOCK_FPGA_PHYS + 0x010)
116#define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080) 117#define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080)
117 118
119void lubbock_set_hexled(uint32_t value)
120{
121 LUB_HEXLED = value;
122}
123
118void lubbock_set_misc_wr(unsigned int mask, unsigned int set) 124void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
119{ 125{
120 unsigned long flags; 126 unsigned long flags;
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 21b821e1a60d..d46b36746be2 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -25,14 +25,14 @@
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/pda_power.h> 26#include <linux/pda_power.h>
27#include <linux/pwm_backlight.h> 27#include <linux/pwm_backlight.h>
28#include <linux/usb/gpio_vbus.h>
28 29
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33
34#include <mach/pxa27x.h>
32#include <mach/magician.h> 35#include <mach/magician.h>
33#include <mach/mfp-pxa27x.h>
34#include <mach/pxa-regs.h>
35#include <mach/pxa2xx-regs.h>
36#include <mach/pxafb.h> 36#include <mach/pxafb.h>
37#include <mach/i2c.h> 37#include <mach/i2c.h>
38#include <mach/mmc.h> 38#include <mach/mmc.h>
@@ -66,6 +66,11 @@ static unsigned long magician_pin_config[] __initdata = {
66 GPIO31_I2S_SYNC, 66 GPIO31_I2S_SYNC,
67 GPIO113_I2S_SYSCLK, 67 GPIO113_I2S_SYSCLK,
68 68
69 /* SSP 1 */
70 GPIO23_SSP1_SCLK,
71 GPIO24_SSP1_SFRM,
72 GPIO25_SSP1_TXD,
73
69 /* SSP 2 */ 74 /* SSP 2 */
70 GPIO19_SSP2_SCLK, 75 GPIO19_SSP2_SCLK,
71 GPIO14_SSP2_SFRM, 76 GPIO14_SSP2_SFRM,
@@ -148,22 +153,31 @@ static struct pxaficp_platform_data magician_ficp_info = {
148 * GPIO Keys 153 * GPIO Keys
149 */ 154 */
150 155
156#define INIT_KEY(_code, _gpio, _desc) \
157 { \
158 .code = KEY_##_code, \
159 .gpio = _gpio, \
160 .desc = _desc, \
161 .type = EV_KEY, \
162 .wakeup = 1, \
163 }
164
151static struct gpio_keys_button magician_button_table[] = { 165static struct gpio_keys_button magician_button_table[] = {
152 {KEY_POWER, GPIO0_MAGICIAN_KEY_POWER, 0, "Power button"}, 166 INIT_KEY(POWER, GPIO0_MAGICIAN_KEY_POWER, "Power button"),
153 {KEY_ESC, GPIO37_MAGICIAN_KEY_HANGUP, 0, "Hangup button"}, 167 INIT_KEY(ESC, GPIO37_MAGICIAN_KEY_HANGUP, "Hangup button"),
154 {KEY_F10, GPIO38_MAGICIAN_KEY_CONTACTS, 0, "Contacts button"}, 168 INIT_KEY(F10, GPIO38_MAGICIAN_KEY_CONTACTS, "Contacts button"),
155 {KEY_CALENDAR, GPIO90_MAGICIAN_KEY_CALENDAR, 0, "Calendar button"}, 169 INIT_KEY(CALENDAR, GPIO90_MAGICIAN_KEY_CALENDAR, "Calendar button"),
156 {KEY_CAMERA, GPIO91_MAGICIAN_KEY_CAMERA, 0, "Camera button"}, 170 INIT_KEY(CAMERA, GPIO91_MAGICIAN_KEY_CAMERA, "Camera button"),
157 {KEY_UP, GPIO93_MAGICIAN_KEY_UP, 0, "Up button"}, 171 INIT_KEY(UP, GPIO93_MAGICIAN_KEY_UP, "Up button"),
158 {KEY_DOWN, GPIO94_MAGICIAN_KEY_DOWN, 0, "Down button"}, 172 INIT_KEY(DOWN, GPIO94_MAGICIAN_KEY_DOWN, "Down button"),
159 {KEY_LEFT, GPIO95_MAGICIAN_KEY_LEFT, 0, "Left button"}, 173 INIT_KEY(LEFT, GPIO95_MAGICIAN_KEY_LEFT, "Left button"),
160 {KEY_RIGHT, GPIO96_MAGICIAN_KEY_RIGHT, 0, "Right button"}, 174 INIT_KEY(RIGHT, GPIO96_MAGICIAN_KEY_RIGHT, "Right button"),
161 {KEY_KPENTER, GPIO97_MAGICIAN_KEY_ENTER, 0, "Action button"}, 175 INIT_KEY(KPENTER, GPIO97_MAGICIAN_KEY_ENTER, "Action button"),
162 {KEY_RECORD, GPIO98_MAGICIAN_KEY_RECORD, 0, "Record button"}, 176 INIT_KEY(RECORD, GPIO98_MAGICIAN_KEY_RECORD, "Record button"),
163 {KEY_VOLUMEUP, GPIO100_MAGICIAN_KEY_VOL_UP, 0, "Volume up"}, 177 INIT_KEY(VOLUMEUP, GPIO100_MAGICIAN_KEY_VOL_UP, "Volume up"),
164 {KEY_VOLUMEDOWN, GPIO101_MAGICIAN_KEY_VOL_DOWN, 0, "Volume down"}, 178 INIT_KEY(VOLUMEDOWN, GPIO101_MAGICIAN_KEY_VOL_DOWN, "Volume down"),
165 {KEY_PHONE, GPIO102_MAGICIAN_KEY_PHONE, 0, "Phone button"}, 179 INIT_KEY(PHONE, GPIO102_MAGICIAN_KEY_PHONE, "Phone button"),
166 {KEY_PLAY, GPIO99_MAGICIAN_HEADPHONE_IN, 0, "Headset button"}, 180 INIT_KEY(PLAY, GPIO99_MAGICIAN_HEADPHONE_IN, "Headset button"),
167}; 181};
168 182
169static struct gpio_keys_platform_data gpio_keys_data = { 183static struct gpio_keys_platform_data gpio_keys_data = {
@@ -189,7 +203,7 @@ static struct platform_device gpio_keys = {
189static struct resource egpio_resources[] = { 203static struct resource egpio_resources[] = {
190 [0] = { 204 [0] = {
191 .start = PXA_CS3_PHYS, 205 .start = PXA_CS3_PHYS,
192 .end = PXA_CS3_PHYS + 0x20, 206 .end = PXA_CS3_PHYS + 0x20 - 1,
193 .flags = IORESOURCE_MEM, 207 .flags = IORESOURCE_MEM,
194 }, 208 },
195 [1] = { 209 [1] = {
@@ -420,7 +434,7 @@ static struct gpio_led gpio_leds[] = {
420 }, 434 },
421 { 435 {
422 .name = "magician::phone_bl", 436 .name = "magician::phone_bl",
423 .default_trigger = "none", 437 .default_trigger = "backlight",
424 .gpio = GPIO103_MAGICIAN_LED_KP, 438 .gpio = GPIO103_MAGICIAN_LED_KP,
425 }, 439 },
426}; 440};
@@ -468,8 +482,6 @@ static struct pasic3_led pasic3_leds[] = {
468 }, 482 },
469}; 483};
470 484
471static struct platform_device pasic3;
472
473static struct pasic3_leds_machinfo pasic3_leds_info = { 485static struct pasic3_leds_machinfo pasic3_leds_info = {
474 .num_leds = ARRAY_SIZE(pasic3_leds), 486 .num_leds = ARRAY_SIZE(pasic3_leds),
475 .power_gpio = EGPIO_MAGICIAN_LED_POWER, 487 .power_gpio = EGPIO_MAGICIAN_LED_POWER,
@@ -511,6 +523,31 @@ static struct platform_device pasic3 = {
511}; 523};
512 524
513/* 525/*
526 * USB "Transceiver"
527 */
528
529static struct resource gpio_vbus_resource = {
530 .flags = IORESOURCE_IRQ,
531 .start = IRQ_MAGICIAN_VBUS,
532 .end = IRQ_MAGICIAN_VBUS,
533};
534
535static struct gpio_vbus_mach_info gpio_vbus_info = {
536 .gpio_pullup = GPIO27_MAGICIAN_USBC_PUEN,
537 .gpio_vbus = EGPIO_MAGICIAN_CABLE_STATE_USB,
538};
539
540static struct platform_device gpio_vbus = {
541 .name = "gpio-vbus",
542 .id = -1,
543 .num_resources = 1,
544 .resource = &gpio_vbus_resource,
545 .dev = {
546 .platform_data = &gpio_vbus_info,
547 },
548};
549
550/*
514 * External power 551 * External power
515 */ 552 */
516 553
@@ -586,15 +623,17 @@ static struct pda_power_pdata power_supply_info = {
586static struct resource power_supply_resources[] = { 623static struct resource power_supply_resources[] = {
587 [0] = { 624 [0] = {
588 .name = "ac", 625 .name = "ac",
589 .flags = IORESOURCE_IRQ, 626 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
590 .start = IRQ_MAGICIAN_AC, 627 IORESOURCE_IRQ_LOWEDGE,
591 .end = IRQ_MAGICIAN_AC, 628 .start = IRQ_MAGICIAN_VBUS,
629 .end = IRQ_MAGICIAN_VBUS,
592 }, 630 },
593 [1] = { 631 [1] = {
594 .name = "usb", 632 .name = "usb",
595 .flags = IORESOURCE_IRQ, 633 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
596 .start = IRQ_MAGICIAN_AC, 634 IORESOURCE_IRQ_LOWEDGE,
597 .end = IRQ_MAGICIAN_AC, 635 .start = IRQ_MAGICIAN_VBUS,
636 .end = IRQ_MAGICIAN_VBUS,
598 }, 637 },
599}; 638};
600 639
@@ -688,11 +727,9 @@ static void magician_set_vpp(struct map_info *map, int vpp)
688 gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp); 727 gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
689} 728}
690 729
691#define PXA_CS_SIZE 0x04000000
692
693static struct resource strataflash_resource = { 730static struct resource strataflash_resource = {
694 .start = PXA_CS0_PHYS, 731 .start = PXA_CS0_PHYS,
695 .end = PXA_CS0_PHYS + PXA_CS_SIZE - 1, 732 .end = PXA_CS0_PHYS + SZ_64M - 1,
696 .flags = IORESOURCE_MEM, 733 .flags = IORESOURCE_MEM,
697}; 734};
698 735
@@ -720,6 +757,7 @@ static struct platform_device *devices[] __initdata = {
720 &egpio, 757 &egpio,
721 &backlight, 758 &backlight,
722 &pasic3, 759 &pasic3,
760 &gpio_vbus,
723 &power_supply, 761 &power_supply,
724 &strataflash, 762 &strataflash,
725 &leds_gpio, 763 &leds_gpio,
@@ -743,6 +781,7 @@ static void __init magician_init(void)
743 gpio_direction_output(GPIO83_MAGICIAN_nIR_EN, 1); 781 gpio_direction_output(GPIO83_MAGICIAN_nIR_EN, 1);
744 pxa_set_ficp_info(&magician_ficp_info); 782 pxa_set_ficp_info(&magician_ficp_info);
745 } 783 }
784 pxa27x_set_i2c_power_info(NULL);
746 pxa_set_i2c_info(NULL); 785 pxa_set_i2c_info(NULL);
747 pxa_set_mci_info(&magician_mci_info); 786 pxa_set_mci_info(&magician_mci_info);
748 pxa_set_ohci_info(&magician_ohci_info); 787 pxa_set_ohci_info(&magician_ohci_info);
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 5f224968043c..a6c8429e975f 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -41,9 +41,8 @@
41#include <asm/mach/irq.h> 41#include <asm/mach/irq.h>
42#include <asm/mach/flash.h> 42#include <asm/mach/flash.h>
43 43
44#include <mach/pxa-regs.h> 44#include <mach/pxa27x.h>
45#include <mach/pxa2xx-regs.h> 45#include <mach/gpio.h>
46#include <mach/mfp-pxa27x.h>
47#include <mach/mainstone.h> 46#include <mach/mainstone.h>
48#include <mach/audio.h> 47#include <mach/audio.h>
49#include <mach/pxafb.h> 48#include <mach/pxafb.h>
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index 33626de8cbf6..7ffb91d64c39 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -18,15 +18,12 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h> 19#include <linux/sysdev.h>
20 20
21#include <mach/hardware.h> 21#include <mach/gpio.h>
22#include <mach/pxa-regs.h>
23#include <mach/pxa2xx-regs.h> 22#include <mach/pxa2xx-regs.h>
24#include <mach/mfp-pxa2xx.h> 23#include <mach/mfp-pxa2xx.h>
25 24
26#include "generic.h" 25#include "generic.h"
27 26
28#define gpio_to_bank(gpio) ((gpio) >> 5)
29
30#define PGSR(x) __REG2(0x40F00020, (x) << 2) 27#define PGSR(x) __REG2(0x40F00020, (x) << 2)
31#define __GAFR(u, x) __REG2((u) ? 0x40E00058 : 0x40E00054, (x) << 3) 28#define __GAFR(u, x) __REG2((u) ? 0x40E00058 : 0x40E00054, (x) << 3)
32#define GAFR_L(x) __GAFR(0, x) 29#define GAFR_L(x) __GAFR(0, x)
diff --git a/arch/arm/mach-pxa/mfp-pxa3xx.c b/arch/arm/mach-pxa/mfp-pxa3xx.c
index eb197a6e8e94..7a270eecd480 100644
--- a/arch/arm/mach-pxa/mfp-pxa3xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa3xx.c
@@ -20,183 +20,9 @@
20#include <linux/sysdev.h> 20#include <linux/sysdev.h>
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/mfp.h>
24#include <mach/mfp-pxa3xx.h> 23#include <mach/mfp-pxa3xx.h>
25#include <mach/pxa3xx-regs.h> 24#include <mach/pxa3xx-regs.h>
26 25
27/* mfp_spin_lock is used to ensure that MFP register configuration
28 * (most likely a read-modify-write operation) is atomic, and that
29 * mfp_table[] is consistent
30 */
31static DEFINE_SPINLOCK(mfp_spin_lock);
32
33static void __iomem *mfpr_mmio_base = (void __iomem *)&__REG(MFPR_BASE);
34
35struct pxa3xx_mfp_pin {
36 unsigned long config; /* -1 for not configured */
37 unsigned long mfpr_off; /* MFPRxx Register offset */
38 unsigned long mfpr_run; /* Run-Mode Register Value */
39 unsigned long mfpr_lpm; /* Low Power Mode Register Value */
40};
41
42static struct pxa3xx_mfp_pin mfp_table[MFP_PIN_MAX];
43
44/* mapping of MFP_LPM_* definitions to MFPR_LPM_* register bits */
45static const unsigned long mfpr_lpm[] = {
46 MFPR_LPM_INPUT,
47 MFPR_LPM_DRIVE_LOW,
48 MFPR_LPM_DRIVE_HIGH,
49 MFPR_LPM_PULL_LOW,
50 MFPR_LPM_PULL_HIGH,
51 MFPR_LPM_FLOAT,
52};
53
54/* mapping of MFP_PULL_* definitions to MFPR_PULL_* register bits */
55static const unsigned long mfpr_pull[] = {
56 MFPR_PULL_NONE,
57 MFPR_PULL_LOW,
58 MFPR_PULL_HIGH,
59 MFPR_PULL_BOTH,
60};
61
62/* mapping of MFP_LPM_EDGE_* definitions to MFPR_EDGE_* register bits */
63static const unsigned long mfpr_edge[] = {
64 MFPR_EDGE_NONE,
65 MFPR_EDGE_RISE,
66 MFPR_EDGE_FALL,
67 MFPR_EDGE_BOTH,
68};
69
70#define mfpr_readl(off) \
71 __raw_readl(mfpr_mmio_base + (off))
72
73#define mfpr_writel(off, val) \
74 __raw_writel(val, mfpr_mmio_base + (off))
75
76#define mfp_configured(p) ((p)->config != -1)
77
78/*
79 * perform a read-back of any MFPR register to make sure the
80 * previous writings are finished
81 */
82#define mfpr_sync() (void)__raw_readl(mfpr_mmio_base + 0)
83
84static inline void __mfp_config_run(struct pxa3xx_mfp_pin *p)
85{
86 if (mfp_configured(p))
87 mfpr_writel(p->mfpr_off, p->mfpr_run);
88}
89
90static inline void __mfp_config_lpm(struct pxa3xx_mfp_pin *p)
91{
92 if (mfp_configured(p)) {
93 unsigned long mfpr_clr = (p->mfpr_run & ~MFPR_EDGE_BOTH) | MFPR_EDGE_CLEAR;
94 if (mfpr_clr != p->mfpr_run)
95 mfpr_writel(p->mfpr_off, mfpr_clr);
96 if (p->mfpr_lpm != mfpr_clr)
97 mfpr_writel(p->mfpr_off, p->mfpr_lpm);
98 }
99}
100
101void pxa3xx_mfp_config(unsigned long *mfp_cfgs, int num)
102{
103 unsigned long flags;
104 int i;
105
106 spin_lock_irqsave(&mfp_spin_lock, flags);
107
108 for (i = 0; i < num; i++, mfp_cfgs++) {
109 unsigned long tmp, c = *mfp_cfgs;
110 struct pxa3xx_mfp_pin *p;
111 int pin, af, drv, lpm, edge, pull;
112
113 pin = MFP_PIN(c);
114 BUG_ON(pin >= MFP_PIN_MAX);
115 p = &mfp_table[pin];
116
117 af = MFP_AF(c);
118 drv = MFP_DS(c);
119 lpm = MFP_LPM_STATE(c);
120 edge = MFP_LPM_EDGE(c);
121 pull = MFP_PULL(c);
122
123 /* run-mode pull settings will conflict with MFPR bits of
124 * low power mode state, calculate mfpr_run and mfpr_lpm
125 * individually if pull != MFP_PULL_NONE
126 */
127 tmp = MFPR_AF_SEL(af) | MFPR_DRIVE(drv);
128
129 if (likely(pull == MFP_PULL_NONE)) {
130 p->mfpr_run = tmp | mfpr_lpm[lpm] | mfpr_edge[edge];
131 p->mfpr_lpm = p->mfpr_run;
132 } else {
133 p->mfpr_lpm = tmp | mfpr_lpm[lpm] | mfpr_edge[edge];
134 p->mfpr_run = tmp | mfpr_pull[pull];
135 }
136
137 p->config = c; __mfp_config_run(p);
138 }
139
140 mfpr_sync();
141 spin_unlock_irqrestore(&mfp_spin_lock, flags);
142}
143
144unsigned long pxa3xx_mfp_read(int mfp)
145{
146 unsigned long val, flags;
147
148 BUG_ON(mfp >= MFP_PIN_MAX);
149
150 spin_lock_irqsave(&mfp_spin_lock, flags);
151 val = mfpr_readl(mfp_table[mfp].mfpr_off);
152 spin_unlock_irqrestore(&mfp_spin_lock, flags);
153
154 return val;
155}
156
157void pxa3xx_mfp_write(int mfp, unsigned long val)
158{
159 unsigned long flags;
160
161 BUG_ON(mfp >= MFP_PIN_MAX);
162
163 spin_lock_irqsave(&mfp_spin_lock, flags);
164 mfpr_writel(mfp_table[mfp].mfpr_off, val);
165 mfpr_sync();
166 spin_unlock_irqrestore(&mfp_spin_lock, flags);
167}
168
169void __init pxa3xx_mfp_init_addr(struct pxa3xx_mfp_addr_map *map)
170{
171 struct pxa3xx_mfp_addr_map *p;
172 unsigned long offset, flags;
173 int i;
174
175 spin_lock_irqsave(&mfp_spin_lock, flags);
176
177 for (p = map; p->start != MFP_PIN_INVALID; p++) {
178 offset = p->offset;
179 i = p->start;
180
181 do {
182 mfp_table[i].mfpr_off = offset;
183 mfp_table[i].mfpr_run = 0;
184 mfp_table[i].mfpr_lpm = 0;
185 offset += 4; i++;
186 } while ((i <= p->end) && (p->end != -1));
187 }
188
189 spin_unlock_irqrestore(&mfp_spin_lock, flags);
190}
191
192void __init pxa3xx_init_mfp(void)
193{
194 int i;
195
196 for (i = 0; i < ARRAY_SIZE(mfp_table); i++)
197 mfp_table[i].config = -1;
198}
199
200#ifdef CONFIG_PM 26#ifdef CONFIG_PM
201/* 27/*
202 * Configure the MFPs appropriately for suspend/resume. 28 * Configure the MFPs appropriately for suspend/resume.
@@ -207,23 +33,13 @@ void __init pxa3xx_init_mfp(void)
207 */ 33 */
208static int pxa3xx_mfp_suspend(struct sys_device *d, pm_message_t state) 34static int pxa3xx_mfp_suspend(struct sys_device *d, pm_message_t state)
209{ 35{
210 int pin; 36 mfp_config_lpm();
211
212 for (pin = 0; pin < ARRAY_SIZE(mfp_table); pin++) {
213 struct pxa3xx_mfp_pin *p = &mfp_table[pin];
214 __mfp_config_lpm(p);
215 }
216 return 0; 37 return 0;
217} 38}
218 39
219static int pxa3xx_mfp_resume(struct sys_device *d) 40static int pxa3xx_mfp_resume(struct sys_device *d)
220{ 41{
221 int pin; 42 mfp_config_run();
222
223 for (pin = 0; pin < ARRAY_SIZE(mfp_table); pin++) {
224 struct pxa3xx_mfp_pin *p = &mfp_table[pin];
225 __mfp_config_run(p);
226 }
227 43
228 /* clear RDH bit when MFP settings are restored 44 /* clear RDH bit when MFP settings are restored
229 * 45 *
@@ -231,7 +47,6 @@ static int pxa3xx_mfp_resume(struct sys_device *d)
231 * preserve them here in case they will be referenced later 47 * preserve them here in case they will be referenced later
232 */ 48 */
233 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); 49 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
234
235 return 0; 50 return 0;
236} 51}
237#else 52#else
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 2b427e015b6f..97c93a7a285c 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -36,13 +36,15 @@
36#include <linux/power_supply.h> 36#include <linux/power_supply.h>
37#include <linux/wm97xx_batt.h> 37#include <linux/wm97xx_batt.h>
38#include <linux/mtd/physmap.h> 38#include <linux/mtd/physmap.h>
39#include <linux/usb/gpio_vbus.h>
39 40
40#include <asm/mach-types.h> 41#include <asm/mach-types.h>
41#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
42#include <mach/mfp-pxa27x.h> 43
44#include <mach/pxa27x.h>
45#include <mach/regs-rtc.h>
43#include <mach/pxa27x_keypad.h> 46#include <mach/pxa27x_keypad.h>
44#include <mach/pxafb.h> 47#include <mach/pxafb.h>
45#include <mach/pxa2xx-regs.h>
46#include <mach/mmc.h> 48#include <mach/mmc.h>
47#include <mach/udc.h> 49#include <mach/udc.h>
48#include <mach/pxa27x-udc.h> 50#include <mach/pxa27x-udc.h>
@@ -411,21 +413,6 @@ static void gsm_exit(void)
411/* 413/*
412 * USB UDC 414 * USB UDC
413 */ 415 */
414static void udc_power_command(int cmd)
415{
416 switch (cmd) {
417 case PXA2XX_UDC_CMD_DISCONNECT:
418 gpio_set_value(GPIO22_USB_ENABLE, 0);
419 break;
420 case PXA2XX_UDC_CMD_CONNECT:
421 gpio_set_value(GPIO22_USB_ENABLE, 1);
422 break;
423 default:
424 printk(KERN_INFO "udc_control: unknown command (0x%x)!\n", cmd);
425 break;
426 }
427}
428
429static int is_usb_connected(void) 416static int is_usb_connected(void)
430{ 417{
431 return !gpio_get_value(GPIO13_nUSB_DETECT); 418 return !gpio_get_value(GPIO13_nUSB_DETECT);
@@ -433,24 +420,15 @@ static int is_usb_connected(void)
433 420
434static struct pxa2xx_udc_mach_info mioa701_udc_info = { 421static struct pxa2xx_udc_mach_info mioa701_udc_info = {
435 .udc_is_connected = is_usb_connected, 422 .udc_is_connected = is_usb_connected,
436 .udc_command = udc_power_command, 423 .gpio_pullup = GPIO22_USB_ENABLE,
437}; 424};
438 425
439struct gpio_ress udc_gpios[] = { 426struct gpio_vbus_mach_info gpio_vbus_data = {
440 MIO_GPIO_OUT(GPIO22_USB_ENABLE, 0, "USB Vbus enable") 427 .gpio_vbus = GPIO13_nUSB_DETECT,
428 .gpio_vbus_inverted = 1,
429 .gpio_pullup = -1,
441}; 430};
442 431
443static int __init udc_init(void)
444{
445 pxa_set_udc_info(&mioa701_udc_info);
446 return mio_gpio_request(ARRAY_AND_SIZE(udc_gpios));
447}
448
449static void udc_exit(void)
450{
451 mio_gpio_free(ARRAY_AND_SIZE(udc_gpios));
452}
453
454/* 432/*
455 * SDIO/MMC Card controller 433 * SDIO/MMC Card controller
456 */ 434 */
@@ -789,6 +767,7 @@ MIO_SIMPLE_DEV(pxa2xx_ac97, "pxa2xx-ac97", NULL)
789MIO_PARENT_DEV(mio_wm9713_codec, "wm9713-codec", &pxa2xx_ac97.dev, NULL) 767MIO_PARENT_DEV(mio_wm9713_codec, "wm9713-codec", &pxa2xx_ac97.dev, NULL)
790MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL) 768MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL)
791MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL) 769MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL)
770MIO_SIMPLE_DEV(gpio_vbus, "gpio-vbus", &gpio_vbus_data);
792 771
793static struct platform_device *devices[] __initdata = { 772static struct platform_device *devices[] __initdata = {
794 &mioa701_gpio_keys, 773 &mioa701_gpio_keys,
@@ -800,7 +779,8 @@ static struct platform_device *devices[] __initdata = {
800 &mioa701_sound, 779 &mioa701_sound,
801 &power_dev, 780 &power_dev,
802 &strataflash, 781 &strataflash,
803 &mioa701_board 782 &gpio_vbus,
783 &mioa701_board,
804}; 784};
805 785
806static void mioa701_machine_exit(void); 786static void mioa701_machine_exit(void);
@@ -808,13 +788,13 @@ static void mioa701_machine_exit(void);
808static void mioa701_poweroff(void) 788static void mioa701_poweroff(void)
809{ 789{
810 mioa701_machine_exit(); 790 mioa701_machine_exit();
811 arm_machine_restart('s'); 791 arm_machine_restart('s', NULL);
812} 792}
813 793
814static void mioa701_restart(char c) 794static void mioa701_restart(char c, const char *cmd)
815{ 795{
816 mioa701_machine_exit(); 796 mioa701_machine_exit();
817 arm_machine_restart('s'); 797 arm_machine_restart('s', cmd);
818} 798}
819 799
820struct gpio_ress global_gpios[] = { 800struct gpio_ress global_gpios[] = {
@@ -837,7 +817,7 @@ static void __init mioa701_machine_init(void)
837 pxa_set_mci_info(&mioa701_mci_info); 817 pxa_set_mci_info(&mioa701_mci_info);
838 pxa_set_keypad_info(&mioa701_keypad_info); 818 pxa_set_keypad_info(&mioa701_keypad_info);
839 wm97xx_bat_set_pdata(&mioa701_battery_data); 819 wm97xx_bat_set_pdata(&mioa701_battery_data);
840 udc_init(); 820 pxa_set_udc_info(&mioa701_udc_info);
841 pm_power_off = mioa701_poweroff; 821 pm_power_off = mioa701_poweroff;
842 arm_pm_restart = mioa701_restart; 822 arm_pm_restart = mioa701_restart;
843 platform_add_devices(devices, ARRAY_SIZE(devices)); 823 platform_add_devices(devices, ARRAY_SIZE(devices));
@@ -850,7 +830,6 @@ static void __init mioa701_machine_init(void)
850 830
851static void mioa701_machine_exit(void) 831static void mioa701_machine_exit(void)
852{ 832{
853 udc_exit();
854 bootstrap_exit(); 833 bootstrap_exit();
855 gsm_exit(); 834 gsm_exit();
856} 835}
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c
index 8a73814126b1..a65713ce019e 100644
--- a/arch/arm/mach-pxa/mp900.c
+++ b/arch/arm/mach-pxa/mp900.c
@@ -19,10 +19,10 @@
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/usb/isp116x.h> 20#include <linux/usb/isp116x.h>
21 21
22#include <mach/hardware.h>
23#include <mach/pxa-regs.h>
24#include <asm/mach-types.h> 22#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24
25#include <mach/pxa25x.h>
26#include "generic.h" 26#include "generic.h"
27 27
28static void isp116x_pfm_delay(struct device *dev, int delay) 28static void isp116x_pfm_delay(struct device *dev, int delay)
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
new file mode 100644
index 000000000000..8587477a9bb7
--- /dev/null
+++ b/arch/arm/mach-pxa/palmld.c
@@ -0,0 +1,565 @@
1/*
2 * Hardware definitions for Palm LifeDrive
3 *
4 * Author: Marek Vasut <marek.vasut@gmail.com>
5 *
6 * Based on work of:
7 * Alex Osborne <ato@meshy.org>
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 * (find more info at www.hackndev.com)
14 *
15 */
16
17#include <linux/platform_device.h>
18#include <linux/delay.h>
19#include <linux/irq.h>
20#include <linux/gpio_keys.h>
21#include <linux/input.h>
22#include <linux/pda_power.h>
23#include <linux/pwm_backlight.h>
24#include <linux/gpio.h>
25#include <linux/wm97xx_batt.h>
26#include <linux/power_supply.h>
27
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
31
32#include <mach/pxa27x.h>
33#include <mach/audio.h>
34#include <mach/palmld.h>
35#include <mach/mmc.h>
36#include <mach/pxafb.h>
37#include <mach/irda.h>
38#include <mach/pxa27x_keypad.h>
39#include <mach/palmasoc.h>
40
41#include "generic.h"
42#include "devices.h"
43
44/******************************************************************************
45 * Pin configuration
46 ******************************************************************************/
47static unsigned long palmld_pin_config[] __initdata = {
48 /* MMC */
49 GPIO32_MMC_CLK,
50 GPIO92_MMC_DAT_0,
51 GPIO109_MMC_DAT_1,
52 GPIO110_MMC_DAT_2,
53 GPIO111_MMC_DAT_3,
54 GPIO112_MMC_CMD,
55 GPIO14_GPIO, /* SD detect */
56 GPIO114_GPIO, /* SD power */
57 GPIO116_GPIO, /* SD r/o switch */
58
59 /* AC97 */
60 GPIO28_AC97_BITCLK,
61 GPIO29_AC97_SDATA_IN_0,
62 GPIO30_AC97_SDATA_OUT,
63 GPIO31_AC97_SYNC,
64
65 /* IrDA */
66 GPIO108_GPIO, /* ir disable */
67 GPIO46_FICP_RXD,
68 GPIO47_FICP_TXD,
69
70 /* MATRIX KEYPAD */
71 GPIO100_KP_MKIN_0,
72 GPIO101_KP_MKIN_1,
73 GPIO102_KP_MKIN_2,
74 GPIO97_KP_MKIN_3,
75 GPIO103_KP_MKOUT_0,
76 GPIO104_KP_MKOUT_1,
77 GPIO105_KP_MKOUT_2,
78
79 /* LCD */
80 GPIO58_LCD_LDD_0,
81 GPIO59_LCD_LDD_1,
82 GPIO60_LCD_LDD_2,
83 GPIO61_LCD_LDD_3,
84 GPIO62_LCD_LDD_4,
85 GPIO63_LCD_LDD_5,
86 GPIO64_LCD_LDD_6,
87 GPIO65_LCD_LDD_7,
88 GPIO66_LCD_LDD_8,
89 GPIO67_LCD_LDD_9,
90 GPIO68_LCD_LDD_10,
91 GPIO69_LCD_LDD_11,
92 GPIO70_LCD_LDD_12,
93 GPIO71_LCD_LDD_13,
94 GPIO72_LCD_LDD_14,
95 GPIO73_LCD_LDD_15,
96 GPIO74_LCD_FCLK,
97 GPIO75_LCD_LCLK,
98 GPIO76_LCD_PCLK,
99 GPIO77_LCD_BIAS,
100
101 /* PWM */
102 GPIO16_PWM0_OUT,
103
104 /* GPIO KEYS */
105 GPIO10_GPIO, /* hotsync button */
106 GPIO12_GPIO, /* power switch */
107 GPIO15_GPIO, /* lock switch */
108
109 /* LEDs */
110 GPIO52_GPIO, /* green led */
111 GPIO94_GPIO, /* orange led */
112
113 /* PCMCIA */
114 GPIO48_nPOE,
115 GPIO49_nPWE,
116 GPIO50_nPIOR,
117 GPIO51_nPIOW,
118 GPIO85_nPCE_1,
119 GPIO54_nPCE_2,
120 GPIO79_PSKTSEL,
121 GPIO55_nPREG,
122 GPIO56_nPWAIT,
123 GPIO57_nIOIS16,
124 GPIO36_GPIO, /* wifi power */
125 GPIO38_GPIO, /* wifi ready */
126 GPIO81_GPIO, /* wifi reset */
127
128 /* HDD */
129 GPIO95_GPIO, /* HDD irq */
130 GPIO115_GPIO, /* HDD power */
131
132 /* MISC */
133 GPIO13_GPIO, /* earphone detect */
134};
135
136/******************************************************************************
137 * SD/MMC card controller
138 ******************************************************************************/
139static int palmld_mci_init(struct device *dev, irq_handler_t palmld_detect_int,
140 void *data)
141{
142 int err = 0;
143
144 /* Setup an interrupt for detecting card insert/remove events */
145 err = gpio_request(GPIO_NR_PALMLD_SD_DETECT_N, "SD IRQ");
146 if (err)
147 goto err;
148 err = gpio_direction_input(GPIO_NR_PALMLD_SD_DETECT_N);
149 if (err)
150 goto err2;
151 err = request_irq(gpio_to_irq(GPIO_NR_PALMLD_SD_DETECT_N),
152 palmld_detect_int, IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
153 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
154 "SD/MMC card detect", data);
155 if (err) {
156 printk(KERN_ERR "%s: cannot request SD/MMC card detect IRQ\n",
157 __func__);
158 goto err2;
159 }
160
161 err = gpio_request(GPIO_NR_PALMLD_SD_POWER, "SD_POWER");
162 if (err)
163 goto err3;
164 err = gpio_direction_output(GPIO_NR_PALMLD_SD_POWER, 0);
165 if (err)
166 goto err4;
167
168 err = gpio_request(GPIO_NR_PALMLD_SD_READONLY, "SD_READONLY");
169 if (err)
170 goto err4;
171 err = gpio_direction_input(GPIO_NR_PALMLD_SD_READONLY);
172 if (err)
173 goto err5;
174
175 printk(KERN_DEBUG "%s: irq registered\n", __func__);
176
177 return 0;
178
179err5:
180 gpio_free(GPIO_NR_PALMLD_SD_READONLY);
181err4:
182 gpio_free(GPIO_NR_PALMLD_SD_POWER);
183err3:
184 free_irq(gpio_to_irq(GPIO_NR_PALMLD_SD_DETECT_N), data);
185err2:
186 gpio_free(GPIO_NR_PALMLD_SD_DETECT_N);
187err:
188 return err;
189}
190
191static void palmld_mci_exit(struct device *dev, void *data)
192{
193 gpio_free(GPIO_NR_PALMLD_SD_READONLY);
194 gpio_free(GPIO_NR_PALMLD_SD_POWER);
195 free_irq(gpio_to_irq(GPIO_NR_PALMLD_SD_DETECT_N), data);
196 gpio_free(GPIO_NR_PALMLD_SD_DETECT_N);
197}
198
199static void palmld_mci_power(struct device *dev, unsigned int vdd)
200{
201 struct pxamci_platform_data *p_d = dev->platform_data;
202 gpio_set_value(GPIO_NR_PALMLD_SD_POWER, p_d->ocr_mask & (1 << vdd));
203}
204
205static int palmld_mci_get_ro(struct device *dev)
206{
207 return gpio_get_value(GPIO_NR_PALMLD_SD_READONLY);
208}
209
210static struct pxamci_platform_data palmld_mci_platform_data = {
211 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
212 .setpower = palmld_mci_power,
213 .get_ro = palmld_mci_get_ro,
214 .init = palmld_mci_init,
215 .exit = palmld_mci_exit,
216};
217
218/******************************************************************************
219 * GPIO keyboard
220 ******************************************************************************/
221static unsigned int palmld_matrix_keys[] = {
222 KEY(0, 1, KEY_F2),
223 KEY(0, 2, KEY_UP),
224
225 KEY(1, 0, KEY_F3),
226 KEY(1, 1, KEY_F4),
227 KEY(1, 2, KEY_RIGHT),
228
229 KEY(2, 0, KEY_F1),
230 KEY(2, 1, KEY_F5),
231 KEY(2, 2, KEY_DOWN),
232
233 KEY(3, 0, KEY_F6),
234 KEY(3, 1, KEY_ENTER),
235 KEY(3, 2, KEY_LEFT),
236};
237
238static struct pxa27x_keypad_platform_data palmld_keypad_platform_data = {
239 .matrix_key_rows = 4,
240 .matrix_key_cols = 3,
241 .matrix_key_map = palmld_matrix_keys,
242 .matrix_key_map_size = ARRAY_SIZE(palmld_matrix_keys),
243
244 .debounce_interval = 30,
245};
246
247/******************************************************************************
248 * GPIO keys
249 ******************************************************************************/
250static struct gpio_keys_button palmld_pxa_buttons[] = {
251 {KEY_F8, GPIO_NR_PALMLD_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
252 {KEY_F9, GPIO_NR_PALMLD_LOCK_SWITCH, 0, "Lock Switch" },
253 {KEY_POWER, GPIO_NR_PALMLD_POWER_SWITCH, 0, "Power Switch" },
254};
255
256static struct gpio_keys_platform_data palmld_pxa_keys_data = {
257 .buttons = palmld_pxa_buttons,
258 .nbuttons = ARRAY_SIZE(palmld_pxa_buttons),
259};
260
261static struct platform_device palmld_pxa_keys = {
262 .name = "gpio-keys",
263 .id = -1,
264 .dev = {
265 .platform_data = &palmld_pxa_keys_data,
266 },
267};
268
269/******************************************************************************
270 * Backlight
271 ******************************************************************************/
272static int palmld_backlight_init(struct device *dev)
273{
274 int ret;
275
276 ret = gpio_request(GPIO_NR_PALMLD_BL_POWER, "BL POWER");
277 if (ret)
278 goto err;
279 ret = gpio_direction_output(GPIO_NR_PALMLD_BL_POWER, 0);
280 if (ret)
281 goto err2;
282 ret = gpio_request(GPIO_NR_PALMLD_LCD_POWER, "LCD POWER");
283 if (ret)
284 goto err2;
285 ret = gpio_direction_output(GPIO_NR_PALMLD_LCD_POWER, 0);
286 if (ret)
287 goto err3;
288
289 return 0;
290err3:
291 gpio_free(GPIO_NR_PALMLD_LCD_POWER);
292err2:
293 gpio_free(GPIO_NR_PALMLD_BL_POWER);
294err:
295 return ret;
296}
297
298static int palmld_backlight_notify(int brightness)
299{
300 gpio_set_value(GPIO_NR_PALMLD_BL_POWER, brightness);
301 gpio_set_value(GPIO_NR_PALMLD_LCD_POWER, brightness);
302 return brightness;
303}
304
305static void palmld_backlight_exit(struct device *dev)
306{
307 gpio_free(GPIO_NR_PALMLD_BL_POWER);
308 gpio_free(GPIO_NR_PALMLD_LCD_POWER);
309}
310
311static struct platform_pwm_backlight_data palmld_backlight_data = {
312 .pwm_id = 0,
313 .max_brightness = PALMLD_MAX_INTENSITY,
314 .dft_brightness = PALMLD_MAX_INTENSITY,
315 .pwm_period_ns = PALMLD_PERIOD_NS,
316 .init = palmld_backlight_init,
317 .notify = palmld_backlight_notify,
318 .exit = palmld_backlight_exit,
319};
320
321static struct platform_device palmld_backlight = {
322 .name = "pwm-backlight",
323 .dev = {
324 .parent = &pxa27x_device_pwm0.dev,
325 .platform_data = &palmld_backlight_data,
326 },
327};
328
329/******************************************************************************
330 * IrDA
331 ******************************************************************************/
332static int palmld_irda_startup(struct device *dev)
333{
334 int err;
335 err = gpio_request(GPIO_NR_PALMLD_IR_DISABLE, "IR DISABLE");
336 if (err)
337 goto err;
338 err = gpio_direction_output(GPIO_NR_PALMLD_IR_DISABLE, 1);
339 if (err)
340 gpio_free(GPIO_NR_PALMLD_IR_DISABLE);
341err:
342 return err;
343}
344
345static void palmld_irda_shutdown(struct device *dev)
346{
347 gpio_free(GPIO_NR_PALMLD_IR_DISABLE);
348}
349
350static void palmld_irda_transceiver_mode(struct device *dev, int mode)
351{
352 gpio_set_value(GPIO_NR_PALMLD_IR_DISABLE, mode & IR_OFF);
353 pxa2xx_transceiver_mode(dev, mode);
354}
355
356static struct pxaficp_platform_data palmld_ficp_platform_data = {
357 .startup = palmld_irda_startup,
358 .shutdown = palmld_irda_shutdown,
359 .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
360 .transceiver_mode = palmld_irda_transceiver_mode,
361};
362
363/******************************************************************************
364 * LEDs
365 ******************************************************************************/
366struct gpio_led gpio_leds[] = {
367{
368 .name = "palmld:green:led",
369 .default_trigger = "none",
370 .gpio = GPIO_NR_PALMLD_LED_GREEN,
371}, {
372 .name = "palmld:amber:led",
373 .default_trigger = "none",
374 .gpio = GPIO_NR_PALMLD_LED_AMBER,
375},
376};
377
378static struct gpio_led_platform_data gpio_led_info = {
379 .leds = gpio_leds,
380 .num_leds = ARRAY_SIZE(gpio_leds),
381};
382
383static struct platform_device palmld_leds = {
384 .name = "leds-gpio",
385 .id = -1,
386 .dev = {
387 .platform_data = &gpio_led_info,
388 }
389};
390
391/******************************************************************************
392 * Power supply
393 ******************************************************************************/
394static int power_supply_init(struct device *dev)
395{
396 int ret;
397
398 ret = gpio_request(GPIO_NR_PALMLD_POWER_DETECT, "CABLE_STATE_AC");
399 if (ret)
400 goto err1;
401 ret = gpio_direction_input(GPIO_NR_PALMLD_POWER_DETECT);
402 if (ret)
403 goto err2;
404
405 ret = gpio_request(GPIO_NR_PALMLD_USB_DETECT_N, "CABLE_STATE_USB");
406 if (ret)
407 goto err2;
408 ret = gpio_direction_input(GPIO_NR_PALMLD_USB_DETECT_N);
409 if (ret)
410 goto err3;
411
412 return 0;
413
414err3:
415 gpio_free(GPIO_NR_PALMLD_USB_DETECT_N);
416err2:
417 gpio_free(GPIO_NR_PALMLD_POWER_DETECT);
418err1:
419 return ret;
420}
421
422static int palmld_is_ac_online(void)
423{
424 return gpio_get_value(GPIO_NR_PALMLD_POWER_DETECT);
425}
426
427static int palmld_is_usb_online(void)
428{
429 return !gpio_get_value(GPIO_NR_PALMLD_USB_DETECT_N);
430}
431
432static void power_supply_exit(struct device *dev)
433{
434 gpio_free(GPIO_NR_PALMLD_USB_DETECT_N);
435 gpio_free(GPIO_NR_PALMLD_POWER_DETECT);
436}
437
438static char *palmld_supplicants[] = {
439 "main-battery",
440};
441
442static struct pda_power_pdata power_supply_info = {
443 .init = power_supply_init,
444 .is_ac_online = palmld_is_ac_online,
445 .is_usb_online = palmld_is_usb_online,
446 .exit = power_supply_exit,
447 .supplied_to = palmld_supplicants,
448 .num_supplicants = ARRAY_SIZE(palmld_supplicants),
449};
450
451static struct platform_device power_supply = {
452 .name = "pda-power",
453 .id = -1,
454 .dev = {
455 .platform_data = &power_supply_info,
456 },
457};
458
459/******************************************************************************
460 * WM97xx battery
461 ******************************************************************************/
462static struct wm97xx_batt_info wm97xx_batt_pdata = {
463 .batt_aux = WM97XX_AUX_ID3,
464 .temp_aux = WM97XX_AUX_ID2,
465 .charge_gpio = -1,
466 .max_voltage = PALMLD_BAT_MAX_VOLTAGE,
467 .min_voltage = PALMLD_BAT_MIN_VOLTAGE,
468 .batt_mult = 1000,
469 .batt_div = 414,
470 .temp_mult = 1,
471 .temp_div = 1,
472 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
473 .batt_name = "main-batt",
474};
475
476/******************************************************************************
477 * aSoC audio
478 ******************************************************************************/
479static struct palm27x_asoc_info palm27x_asoc_pdata = {
480 .jack_gpio = GPIO_NR_PALMLD_EARPHONE_DETECT,
481};
482
483/******************************************************************************
484 * Framebuffer
485 ******************************************************************************/
486static struct pxafb_mode_info palmld_lcd_modes[] = {
487{
488 .pixclock = 57692,
489 .xres = 320,
490 .yres = 480,
491 .bpp = 16,
492
493 .left_margin = 32,
494 .right_margin = 1,
495 .upper_margin = 7,
496 .lower_margin = 1,
497
498 .hsync_len = 4,
499 .vsync_len = 1,
500},
501};
502
503static struct pxafb_mach_info palmld_lcd_screen = {
504 .modes = palmld_lcd_modes,
505 .num_modes = ARRAY_SIZE(palmld_lcd_modes),
506 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
507};
508
509/******************************************************************************
510 * Machine init
511 ******************************************************************************/
512static struct platform_device *devices[] __initdata = {
513#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
514 &palmld_pxa_keys,
515#endif
516 &palmld_backlight,
517 &palmld_leds,
518 &power_supply,
519};
520
521static struct map_desc palmld_io_desc[] __initdata = {
522{
523 .virtual = PALMLD_IDE_VIRT,
524 .pfn = __phys_to_pfn(PALMLD_IDE_PHYS),
525 .length = PALMLD_IDE_SIZE,
526 .type = MT_DEVICE
527},
528{
529 .virtual = PALMLD_USB_VIRT,
530 .pfn = __phys_to_pfn(PALMLD_USB_PHYS),
531 .length = PALMLD_USB_SIZE,
532 .type = MT_DEVICE
533},
534};
535
536static void __init palmld_map_io(void)
537{
538 pxa_map_io();
539 iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc));
540}
541
542static void __init palmld_init(void)
543{
544 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config));
545
546 set_pxa_fb_info(&palmld_lcd_screen);
547 pxa_set_mci_info(&palmld_mci_platform_data);
548 pxa_set_ac97_info(NULL);
549 pxa_set_ficp_info(&palmld_ficp_platform_data);
550 pxa_set_keypad_info(&palmld_keypad_platform_data);
551 wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
552 palm27x_asoc_set_pdata(&palm27x_asoc_pdata);
553
554 platform_add_devices(devices, ARRAY_SIZE(devices));
555}
556
557MACHINE_START(PALMLD, "Palm LifeDrive")
558 .phys_io = PALMLD_PHYS_IO_START,
559 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
560 .boot_params = 0xa0000100,
561 .map_io = palmld_map_io,
562 .init_irq = pxa27x_init_irq,
563 .timer = &pxa_timer,
564 .init_machine = palmld_init
565MACHINE_END
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
new file mode 100644
index 000000000000..9521c7b33492
--- /dev/null
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -0,0 +1,496 @@
1/*
2 * Hardware definitions for Palm Tungsten|T5
3 *
4 * Author: Marek Vasut <marek.vasut@gmail.com>
5 *
6 * Based on work of:
7 * Ales Snuparek <snuparek@atlas.cz>
8 * Justin Kendrick <twilightsentry@gmail.com>
9 * RichardT5 <richard_t5@users.sourceforge.net>
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 * (find more info at www.hackndev.com)
16 *
17 */
18
19#include <linux/platform_device.h>
20#include <linux/delay.h>
21#include <linux/irq.h>
22#include <linux/gpio_keys.h>
23#include <linux/input.h>
24#include <linux/pda_power.h>
25#include <linux/pwm_backlight.h>
26#include <linux/gpio.h>
27#include <linux/wm97xx_batt.h>
28#include <linux/power_supply.h>
29
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/map.h>
33
34#include <mach/pxa27x.h>
35#include <mach/audio.h>
36#include <mach/palmt5.h>
37#include <mach/mmc.h>
38#include <mach/pxafb.h>
39#include <mach/irda.h>
40#include <mach/pxa27x_keypad.h>
41#include <mach/udc.h>
42#include <mach/palmasoc.h>
43
44#include "generic.h"
45#include "devices.h"
46
47/******************************************************************************
48 * Pin configuration
49 ******************************************************************************/
50static unsigned long palmt5_pin_config[] __initdata = {
51 /* MMC */
52 GPIO32_MMC_CLK,
53 GPIO92_MMC_DAT_0,
54 GPIO109_MMC_DAT_1,
55 GPIO110_MMC_DAT_2,
56 GPIO111_MMC_DAT_3,
57 GPIO112_MMC_CMD,
58 GPIO14_GPIO, /* SD detect */
59 GPIO114_GPIO, /* SD power */
60 GPIO115_GPIO, /* SD r/o switch */
61
62 /* AC97 */
63 GPIO28_AC97_BITCLK,
64 GPIO29_AC97_SDATA_IN_0,
65 GPIO30_AC97_SDATA_OUT,
66 GPIO31_AC97_SYNC,
67
68 /* IrDA */
69 GPIO40_GPIO, /* ir disable */
70 GPIO46_FICP_RXD,
71 GPIO47_FICP_TXD,
72
73 /* USB */
74 GPIO15_GPIO, /* usb detect */
75 GPIO95_GPIO, /* usb power */
76
77 /* MATRIX KEYPAD */
78 GPIO100_KP_MKIN_0,
79 GPIO101_KP_MKIN_1,
80 GPIO102_KP_MKIN_2,
81 GPIO97_KP_MKIN_3,
82 GPIO103_KP_MKOUT_0,
83 GPIO104_KP_MKOUT_1,
84 GPIO105_KP_MKOUT_2,
85
86 /* LCD */
87 GPIO58_LCD_LDD_0,
88 GPIO59_LCD_LDD_1,
89 GPIO60_LCD_LDD_2,
90 GPIO61_LCD_LDD_3,
91 GPIO62_LCD_LDD_4,
92 GPIO63_LCD_LDD_5,
93 GPIO64_LCD_LDD_6,
94 GPIO65_LCD_LDD_7,
95 GPIO66_LCD_LDD_8,
96 GPIO67_LCD_LDD_9,
97 GPIO68_LCD_LDD_10,
98 GPIO69_LCD_LDD_11,
99 GPIO70_LCD_LDD_12,
100 GPIO71_LCD_LDD_13,
101 GPIO72_LCD_LDD_14,
102 GPIO73_LCD_LDD_15,
103 GPIO74_LCD_FCLK,
104 GPIO75_LCD_LCLK,
105 GPIO76_LCD_PCLK,
106 GPIO77_LCD_BIAS,
107
108 /* PWM */
109 GPIO16_PWM0_OUT,
110
111 /* MISC */
112 GPIO10_GPIO, /* hotsync button */
113 GPIO90_GPIO, /* power detect */
114 GPIO107_GPIO, /* earphone detect */
115};
116
117/******************************************************************************
118 * SD/MMC card controller
119 ******************************************************************************/
120static int palmt5_mci_init(struct device *dev, irq_handler_t palmt5_detect_int,
121 void *data)
122{
123 int err = 0;
124
125 /* Setup an interrupt for detecting card insert/remove events */
126 err = gpio_request(GPIO_NR_PALMT5_SD_DETECT_N, "SD IRQ");
127 if (err)
128 goto err;
129 err = gpio_direction_input(GPIO_NR_PALMT5_SD_DETECT_N);
130 if (err)
131 goto err2;
132 err = request_irq(gpio_to_irq(GPIO_NR_PALMT5_SD_DETECT_N),
133 palmt5_detect_int, IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
134 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
135 "SD/MMC card detect", data);
136 if (err) {
137 printk(KERN_ERR "%s: cannot request SD/MMC card detect IRQ\n",
138 __func__);
139 goto err2;
140 }
141
142 err = gpio_request(GPIO_NR_PALMT5_SD_POWER, "SD_POWER");
143 if (err)
144 goto err3;
145 err = gpio_direction_output(GPIO_NR_PALMT5_SD_POWER, 0);
146 if (err)
147 goto err4;
148
149 err = gpio_request(GPIO_NR_PALMT5_SD_READONLY, "SD_READONLY");
150 if (err)
151 goto err4;
152 err = gpio_direction_input(GPIO_NR_PALMT5_SD_READONLY);
153 if (err)
154 goto err5;
155
156 printk(KERN_DEBUG "%s: irq registered\n", __func__);
157
158 return 0;
159
160err5:
161 gpio_free(GPIO_NR_PALMT5_SD_READONLY);
162err4:
163 gpio_free(GPIO_NR_PALMT5_SD_POWER);
164err3:
165 free_irq(gpio_to_irq(GPIO_NR_PALMT5_SD_DETECT_N), data);
166err2:
167 gpio_free(GPIO_NR_PALMT5_SD_DETECT_N);
168err:
169 return err;
170}
171
172static void palmt5_mci_exit(struct device *dev, void *data)
173{
174 gpio_free(GPIO_NR_PALMT5_SD_READONLY);
175 gpio_free(GPIO_NR_PALMT5_SD_POWER);
176 free_irq(IRQ_GPIO_PALMT5_SD_DETECT_N, data);
177 gpio_free(GPIO_NR_PALMT5_SD_DETECT_N);
178}
179
180static void palmt5_mci_power(struct device *dev, unsigned int vdd)
181{
182 struct pxamci_platform_data *p_d = dev->platform_data;
183 gpio_set_value(GPIO_NR_PALMT5_SD_POWER, p_d->ocr_mask & (1 << vdd));
184}
185
186static int palmt5_mci_get_ro(struct device *dev)
187{
188 return gpio_get_value(GPIO_NR_PALMT5_SD_READONLY);
189}
190
191static struct pxamci_platform_data palmt5_mci_platform_data = {
192 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
193 .setpower = palmt5_mci_power,
194 .get_ro = palmt5_mci_get_ro,
195 .init = palmt5_mci_init,
196 .exit = palmt5_mci_exit,
197};
198
199/******************************************************************************
200 * GPIO keyboard
201 ******************************************************************************/
202static unsigned int palmt5_matrix_keys[] = {
203 KEY(0, 0, KEY_POWER),
204 KEY(0, 1, KEY_F1),
205 KEY(0, 2, KEY_ENTER),
206
207 KEY(1, 0, KEY_F2),
208 KEY(1, 1, KEY_F3),
209 KEY(1, 2, KEY_F4),
210
211 KEY(2, 0, KEY_UP),
212 KEY(2, 2, KEY_DOWN),
213
214 KEY(3, 0, KEY_RIGHT),
215 KEY(3, 2, KEY_LEFT),
216};
217
218static struct pxa27x_keypad_platform_data palmt5_keypad_platform_data = {
219 .matrix_key_rows = 4,
220 .matrix_key_cols = 3,
221 .matrix_key_map = palmt5_matrix_keys,
222 .matrix_key_map_size = ARRAY_SIZE(palmt5_matrix_keys),
223
224 .debounce_interval = 30,
225};
226
227/******************************************************************************
228 * GPIO keys
229 ******************************************************************************/
230static struct gpio_keys_button palmt5_pxa_buttons[] = {
231 {KEY_F8, GPIO_NR_PALMT5_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
232};
233
234static struct gpio_keys_platform_data palmt5_pxa_keys_data = {
235 .buttons = palmt5_pxa_buttons,
236 .nbuttons = ARRAY_SIZE(palmt5_pxa_buttons),
237};
238
239static struct platform_device palmt5_pxa_keys = {
240 .name = "gpio-keys",
241 .id = -1,
242 .dev = {
243 .platform_data = &palmt5_pxa_keys_data,
244 },
245};
246
247/******************************************************************************
248 * Backlight
249 ******************************************************************************/
250static int palmt5_backlight_init(struct device *dev)
251{
252 int ret;
253
254 ret = gpio_request(GPIO_NR_PALMT5_BL_POWER, "BL POWER");
255 if (ret)
256 goto err;
257 ret = gpio_direction_output(GPIO_NR_PALMT5_BL_POWER, 0);
258 if (ret)
259 goto err2;
260 ret = gpio_request(GPIO_NR_PALMT5_LCD_POWER, "LCD POWER");
261 if (ret)
262 goto err2;
263 ret = gpio_direction_output(GPIO_NR_PALMT5_LCD_POWER, 0);
264 if (ret)
265 goto err3;
266
267 return 0;
268err3:
269 gpio_free(GPIO_NR_PALMT5_LCD_POWER);
270err2:
271 gpio_free(GPIO_NR_PALMT5_BL_POWER);
272err:
273 return ret;
274}
275
276static int palmt5_backlight_notify(int brightness)
277{
278 gpio_set_value(GPIO_NR_PALMT5_BL_POWER, brightness);
279 gpio_set_value(GPIO_NR_PALMT5_LCD_POWER, brightness);
280 return brightness;
281}
282
283static void palmt5_backlight_exit(struct device *dev)
284{
285 gpio_free(GPIO_NR_PALMT5_BL_POWER);
286 gpio_free(GPIO_NR_PALMT5_LCD_POWER);
287}
288
289static struct platform_pwm_backlight_data palmt5_backlight_data = {
290 .pwm_id = 0,
291 .max_brightness = PALMT5_MAX_INTENSITY,
292 .dft_brightness = PALMT5_MAX_INTENSITY,
293 .pwm_period_ns = PALMT5_PERIOD_NS,
294 .init = palmt5_backlight_init,
295 .notify = palmt5_backlight_notify,
296 .exit = palmt5_backlight_exit,
297};
298
299static struct platform_device palmt5_backlight = {
300 .name = "pwm-backlight",
301 .dev = {
302 .parent = &pxa27x_device_pwm0.dev,
303 .platform_data = &palmt5_backlight_data,
304 },
305};
306
307/******************************************************************************
308 * IrDA
309 ******************************************************************************/
310static int palmt5_irda_startup(struct device *dev)
311{
312 int err;
313 err = gpio_request(GPIO_NR_PALMT5_IR_DISABLE, "IR DISABLE");
314 if (err)
315 goto err;
316 err = gpio_direction_output(GPIO_NR_PALMT5_IR_DISABLE, 1);
317 if (err)
318 gpio_free(GPIO_NR_PALMT5_IR_DISABLE);
319err:
320 return err;
321}
322
323static void palmt5_irda_shutdown(struct device *dev)
324{
325 gpio_free(GPIO_NR_PALMT5_IR_DISABLE);
326}
327
328static void palmt5_irda_transceiver_mode(struct device *dev, int mode)
329{
330 gpio_set_value(GPIO_NR_PALMT5_IR_DISABLE, mode & IR_OFF);
331 pxa2xx_transceiver_mode(dev, mode);
332}
333
334static struct pxaficp_platform_data palmt5_ficp_platform_data = {
335 .startup = palmt5_irda_startup,
336 .shutdown = palmt5_irda_shutdown,
337 .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
338 .transceiver_mode = palmt5_irda_transceiver_mode,
339};
340
341/******************************************************************************
342 * UDC
343 ******************************************************************************/
344static struct pxa2xx_udc_mach_info palmt5_udc_info __initdata = {
345 .gpio_vbus = GPIO_NR_PALMT5_USB_DETECT_N,
346 .gpio_vbus_inverted = 1,
347 .gpio_pullup = GPIO_NR_PALMT5_USB_POWER,
348 .gpio_pullup_inverted = 0,
349};
350
351/******************************************************************************
352 * Power supply
353 ******************************************************************************/
354static int power_supply_init(struct device *dev)
355{
356 int ret;
357
358 ret = gpio_request(GPIO_NR_PALMT5_POWER_DETECT, "CABLE_STATE_AC");
359 if (ret)
360 goto err1;
361 ret = gpio_direction_input(GPIO_NR_PALMT5_POWER_DETECT);
362 if (ret)
363 goto err2;
364
365 return 0;
366err2:
367 gpio_free(GPIO_NR_PALMT5_POWER_DETECT);
368err1:
369 return ret;
370}
371
372static int palmt5_is_ac_online(void)
373{
374 return gpio_get_value(GPIO_NR_PALMT5_POWER_DETECT);
375}
376
377static void power_supply_exit(struct device *dev)
378{
379 gpio_free(GPIO_NR_PALMT5_POWER_DETECT);
380}
381
382static char *palmt5_supplicants[] = {
383 "main-battery",
384};
385
386static struct pda_power_pdata power_supply_info = {
387 .init = power_supply_init,
388 .is_ac_online = palmt5_is_ac_online,
389 .exit = power_supply_exit,
390 .supplied_to = palmt5_supplicants,
391 .num_supplicants = ARRAY_SIZE(palmt5_supplicants),
392};
393
394static struct platform_device power_supply = {
395 .name = "pda-power",
396 .id = -1,
397 .dev = {
398 .platform_data = &power_supply_info,
399 },
400};
401
402/******************************************************************************
403 * WM97xx battery
404 ******************************************************************************/
405static struct wm97xx_batt_info wm97xx_batt_pdata = {
406 .batt_aux = WM97XX_AUX_ID3,
407 .temp_aux = WM97XX_AUX_ID2,
408 .charge_gpio = -1,
409 .max_voltage = PALMT5_BAT_MAX_VOLTAGE,
410 .min_voltage = PALMT5_BAT_MIN_VOLTAGE,
411 .batt_mult = 1000,
412 .batt_div = 414,
413 .temp_mult = 1,
414 .temp_div = 1,
415 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
416 .batt_name = "main-batt",
417};
418
419/******************************************************************************
420 * aSoC audio
421 ******************************************************************************/
422static struct palm27x_asoc_info palm27x_asoc_pdata = {
423 .jack_gpio = GPIO_NR_PALMT5_EARPHONE_DETECT,
424};
425
426/******************************************************************************
427 * Framebuffer
428 ******************************************************************************/
429static struct pxafb_mode_info palmt5_lcd_modes[] = {
430{
431 .pixclock = 57692,
432 .xres = 320,
433 .yres = 480,
434 .bpp = 16,
435
436 .left_margin = 32,
437 .right_margin = 1,
438 .upper_margin = 7,
439 .lower_margin = 1,
440
441 .hsync_len = 4,
442 .vsync_len = 1,
443},
444};
445
446static struct pxafb_mach_info palmt5_lcd_screen = {
447 .modes = palmt5_lcd_modes,
448 .num_modes = ARRAY_SIZE(palmt5_lcd_modes),
449 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
450};
451
452/******************************************************************************
453 * Machine init
454 ******************************************************************************/
455static struct platform_device *devices[] __initdata = {
456#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
457 &palmt5_pxa_keys,
458#endif
459 &palmt5_backlight,
460 &power_supply,
461};
462
463/* setup udc GPIOs initial state */
464static void __init palmt5_udc_init(void)
465{
466 if (!gpio_request(GPIO_NR_PALMT5_USB_POWER, "UDC Vbus")) {
467 gpio_direction_output(GPIO_NR_PALMT5_USB_POWER, 1);
468 gpio_free(GPIO_NR_PALMT5_USB_POWER);
469 }
470}
471
472static void __init palmt5_init(void)
473{
474 pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
475
476 set_pxa_fb_info(&palmt5_lcd_screen);
477 pxa_set_mci_info(&palmt5_mci_platform_data);
478 palmt5_udc_init();
479 pxa_set_udc_info(&palmt5_udc_info);
480 pxa_set_ac97_info(NULL);
481 pxa_set_ficp_info(&palmt5_ficp_platform_data);
482 pxa_set_keypad_info(&palmt5_keypad_platform_data);
483 wm97xx_bat_set_pdata(&wm97xx_batt_pdata);
484 palm27x_asoc_set_pdata(&palm27x_asoc_pdata);
485 platform_add_devices(devices, ARRAY_SIZE(devices));
486}
487
488MACHINE_START(PALMT5, "Palm Tungsten|T5")
489 .phys_io = PALMT5_PHYS_IO_START,
490 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
491 .boot_params = 0xa0000100,
492 .map_io = pxa_map_io,
493 .init_irq = pxa27x_init_irq,
494 .timer = &pxa_timer,
495 .init_machine = palmt5_init
496MACHINE_END
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index a9d94f5dbec4..b490c0924619 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -32,12 +32,11 @@
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34 34
35#include <mach/pxa27x.h>
35#include <mach/audio.h> 36#include <mach/audio.h>
36#include <mach/palmtx.h> 37#include <mach/palmtx.h>
37#include <mach/mmc.h> 38#include <mach/mmc.h>
38#include <mach/pxafb.h> 39#include <mach/pxafb.h>
39#include <mach/pxa-regs.h>
40#include <mach/mfp-pxa27x.h>
41#include <mach/irda.h> 40#include <mach/irda.h>
42#include <mach/pxa27x_keypad.h> 41#include <mach/pxa27x_keypad.h>
43#include <mach/udc.h> 42#include <mach/udc.h>
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 2f730da3bba8..b88eb4dd2c84 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -33,13 +33,11 @@
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/pxa27x.h>
36#include <mach/audio.h> 37#include <mach/audio.h>
37#include <mach/palmz72.h> 38#include <mach/palmz72.h>
38#include <mach/mmc.h> 39#include <mach/mmc.h>
39#include <mach/pxafb.h> 40#include <mach/pxafb.h>
40#include <mach/pxa-regs.h>
41#include <mach/pxa2xx-regs.h>
42#include <mach/mfp-pxa27x.h>
43#include <mach/irda.h> 41#include <mach/irda.h>
44#include <mach/pxa27x_keypad.h> 42#include <mach/pxa27x_keypad.h>
45#include <mach/udc.h> 43#include <mach/udc.h>
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index 36135a02fdc7..6abfa2979c61 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -29,10 +29,7 @@
29 29
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32#include <mach/hardware.h> 32#include <mach/pxa27x.h>
33#include <mach/pxa-regs.h>
34#include <mach/mfp-pxa27x.h>
35#include <mach/pxa2xx-regs.h>
36#include <mach/pxa2xx_spi.h> 33#include <mach/pxa2xx_spi.h>
37#include <mach/pcm027.h> 34#include <mach/pcm027.h>
38#include "generic.h" 35#include "generic.h"
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 34841c72815f..f46698e20c1f 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -31,13 +31,12 @@
31#include <mach/i2c.h> 31#include <mach/i2c.h>
32#include <mach/camera.h> 32#include <mach/camera.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34#include <mach/pxa-regs.h> 34#include <mach/pxa27x.h>
35#include <mach/audio.h> 35#include <mach/audio.h>
36#include <mach/mmc.h> 36#include <mach/mmc.h>
37#include <mach/ohci.h> 37#include <mach/ohci.h>
38#include <mach/pcm990_baseboard.h> 38#include <mach/pcm990_baseboard.h>
39#include <mach/pxafb.h> 39#include <mach/pxafb.h>
40#include <mach/mfp-pxa27x.h>
41 40
42#include "devices.h" 41#include "devices.h"
43#include "generic.h" 42#include "generic.h"
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 164eb0bb6321..884b174c8ead 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -14,15 +14,8 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/suspend.h> 15#include <linux/suspend.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/time.h>
18 17
19#include <mach/hardware.h>
20#include <asm/memory.h>
21#include <asm/system.h>
22#include <mach/pm.h> 18#include <mach/pm.h>
23#include <mach/pxa-regs.h>
24#include <mach/lubbock.h>
25#include <asm/mach/time.h>
26 19
27struct pxa_cpu_pm_fns *pxa_cpu_pm_fns; 20struct pxa_cpu_pm_fns *pxa_cpu_pm_fns;
28static unsigned long *sleep_save; 21static unsigned long *sleep_save;
@@ -57,9 +50,9 @@ int pxa_pm_enter(suspend_state_t state)
57 50
58 /* if invalid, display message and wait for a hardware reset */ 51 /* if invalid, display message and wait for a hardware reset */
59 if (checksum != sleep_save_checksum) { 52 if (checksum != sleep_save_checksum) {
60#ifdef CONFIG_ARCH_LUBBOCK 53
61 LUB_HEXLED = 0xbadbadc5; 54 lubbock_set_hexled(0xbadbadc5);
62#endif 55
63 while (1) 56 while (1)
64 pxa_cpu_pm_fns->enter(state); 57 pxa_cpu_pm_fns->enter(state);
65 } 58 }
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index f9093beba752..036bbde4d221 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -36,9 +36,7 @@
36#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include <asm/mach/irq.h> 37#include <asm/mach/irq.h>
38 38
39#include <mach/pxa-regs.h> 39#include <mach/pxa25x.h>
40#include <mach/pxa2xx-regs.h>
41#include <mach/mfp-pxa25x.h>
42#include <mach/mmc.h> 40#include <mach/mmc.h>
43#include <mach/udc.h> 41#include <mach/udc.h>
44#include <mach/i2c.h> 42#include <mach/i2c.h>
@@ -503,12 +501,12 @@ static struct platform_device *devices[] __initdata = {
503 501
504static void poodle_poweroff(void) 502static void poodle_poweroff(void)
505{ 503{
506 arm_machine_restart('h'); 504 arm_machine_restart('h', NULL);
507} 505}
508 506
509static void poodle_restart(char mode) 507static void poodle_restart(char mode, const char *cmd)
510{ 508{
511 arm_machine_restart('h'); 509 arm_machine_restart('h', cmd);
512} 510}
513 511
514static void __init poodle_init(void) 512static void __init poodle_init(void)
diff --git a/arch/arm/mach-pxa/pwm.c b/arch/arm/mach-pxa/pwm.c
index 3ca7ffc6904b..fcdd374437a8 100644
--- a/arch/arm/mach-pxa/pwm.c
+++ b/arch/arm/mach-pxa/pwm.c
@@ -20,7 +20,6 @@
20#include <linux/pwm.h> 20#include <linux/pwm.h>
21 21
22#include <asm/div64.h> 22#include <asm/div64.h>
23#include <mach/pxa-regs.h>
24 23
25/* PWM registers and bits definitions */ 24/* PWM registers and bits definitions */
26#define PWMCR (0x00) 25#define PWMCR (0x00)
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 6c57522e2469..77c2693cfeef 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -25,9 +25,8 @@
25 25
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/irqs.h> 27#include <mach/irqs.h>
28#include <mach/pxa-regs.h> 28#include <mach/gpio.h>
29#include <mach/pxa2xx-regs.h> 29#include <mach/pxa25x.h>
30#include <mach/mfp-pxa25x.h>
31#include <mach/reset.h> 30#include <mach/reset.h>
32#include <mach/pm.h> 31#include <mach/pm.h>
33#include <mach/dma.h> 32#include <mach/dma.h>
@@ -310,14 +309,14 @@ set_pwer:
310void __init pxa25x_init_irq(void) 309void __init pxa25x_init_irq(void)
311{ 310{
312 pxa_init_irq(32, pxa25x_set_wake); 311 pxa_init_irq(32, pxa25x_set_wake);
313 pxa_init_gpio(85, pxa25x_set_wake); 312 pxa_init_gpio(IRQ_GPIO_2_x, 2, 84, pxa25x_set_wake);
314} 313}
315 314
316#ifdef CONFIG_CPU_PXA26x 315#ifdef CONFIG_CPU_PXA26x
317void __init pxa26x_init_irq(void) 316void __init pxa26x_init_irq(void)
318{ 317{
319 pxa_init_irq(32, pxa25x_set_wake); 318 pxa_init_irq(32, pxa25x_set_wake);
320 pxa_init_gpio(90, pxa25x_set_wake); 319 pxa_init_gpio(IRQ_GPIO_2_x, 2, 89, pxa25x_set_wake);
321} 320}
322#endif 321#endif
323 322
@@ -355,7 +354,7 @@ static int __init pxa25x_init(void)
355 354
356 clks_register(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs)); 355 clks_register(pxa25x_clkregs, ARRAY_SIZE(pxa25x_clkregs));
357 356
358 if ((ret = pxa_init_dma(16))) 357 if ((ret = pxa_init_dma(IRQ_DMA, 16)))
359 return ret; 358 return ret;
360 359
361 pxa25x_init_pm(); 360 pxa25x_init_pm();
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 411bec54fdc4..a425ec71e657 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -21,9 +21,8 @@
21#include <mach/hardware.h> 21#include <mach/hardware.h>
22#include <asm/irq.h> 22#include <asm/irq.h>
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24#include <mach/pxa-regs.h> 24#include <mach/gpio.h>
25#include <mach/pxa2xx-regs.h> 25#include <mach/pxa27x.h>
26#include <mach/mfp-pxa27x.h>
27#include <mach/reset.h> 26#include <mach/reset.h>
28#include <mach/ohci.h> 27#include <mach/ohci.h>
29#include <mach/pm.h> 28#include <mach/pm.h>
@@ -332,7 +331,7 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on)
332void __init pxa27x_init_irq(void) 331void __init pxa27x_init_irq(void)
333{ 332{
334 pxa_init_irq(34, pxa27x_set_wake); 333 pxa_init_irq(34, pxa27x_set_wake);
335 pxa_init_gpio(121, pxa27x_set_wake); 334 pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake);
336} 335}
337 336
338/* 337/*
@@ -381,7 +380,7 @@ static int __init pxa27x_init(void)
381 380
382 clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs)); 381 clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs));
383 382
384 if ((ret = pxa_init_dma(32))) 383 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
385 return ret; 384 return ret;
386 385
387 pxa27x_init_pm(); 386 pxa27x_init_pm();
diff --git a/arch/arm/mach-pxa/pxa2xx.c b/arch/arm/mach-pxa/pxa2xx.c
index 73d04d81c75a..2f3394f85917 100644
--- a/arch/arm/mach-pxa/pxa2xx.c
+++ b/arch/arm/mach-pxa/pxa2xx.c
@@ -16,7 +16,6 @@
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/pxa2xx-regs.h> 18#include <mach/pxa2xx-regs.h>
19#include <mach/mfp-pxa2xx.h>
20#include <mach/mfp-pxa25x.h> 19#include <mach/mfp-pxa25x.h>
21#include <mach/reset.h> 20#include <mach/reset.h>
22#include <mach/irda.h> 21#include <mach/irda.h>
diff --git a/arch/arm/mach-pxa/pxa300.c b/arch/arm/mach-pxa/pxa300.c
index 83fb609b6eb7..4ba6d21f851c 100644
--- a/arch/arm/mach-pxa/pxa300.c
+++ b/arch/arm/mach-pxa/pxa300.c
@@ -17,15 +17,13 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <mach/hardware.h> 20#include <mach/pxa300.h>
21#include <mach/pxa3xx-regs.h>
22#include <mach/mfp-pxa300.h>
23 21
24#include "generic.h" 22#include "generic.h"
25#include "devices.h" 23#include "devices.h"
26#include "clock.h" 24#include "clock.h"
27 25
28static struct pxa3xx_mfp_addr_map pxa300_mfp_addr_map[] __initdata = { 26static struct mfp_addr_map pxa300_mfp_addr_map[] __initdata = {
29 27
30 MFP_ADDR_X(GPIO0, GPIO2, 0x00b4), 28 MFP_ADDR_X(GPIO0, GPIO2, 0x00b4),
31 MFP_ADDR_X(GPIO3, GPIO26, 0x027c), 29 MFP_ADDR_X(GPIO3, GPIO26, 0x027c),
@@ -74,7 +72,7 @@ static struct pxa3xx_mfp_addr_map pxa300_mfp_addr_map[] __initdata = {
74}; 72};
75 73
76/* override pxa300 MFP register addresses */ 74/* override pxa300 MFP register addresses */
77static struct pxa3xx_mfp_addr_map pxa310_mfp_addr_map[] __initdata = { 75static struct mfp_addr_map pxa310_mfp_addr_map[] __initdata = {
78 MFP_ADDR_X(GPIO30, GPIO98, 0x0418), 76 MFP_ADDR_X(GPIO30, GPIO98, 0x0418),
79 MFP_ADDR_X(GPIO7_2, GPIO12_2, 0x052C), 77 MFP_ADDR_X(GPIO7_2, GPIO12_2, 0x052C),
80 78
@@ -100,13 +98,13 @@ static struct clk_lookup pxa310_clkregs[] = {
100static int __init pxa300_init(void) 98static int __init pxa300_init(void)
101{ 99{
102 if (cpu_is_pxa300() || cpu_is_pxa310()) { 100 if (cpu_is_pxa300() || cpu_is_pxa310()) {
103 pxa3xx_init_mfp(); 101 mfp_init_base(io_p2v(MFPR_BASE));
104 pxa3xx_mfp_init_addr(pxa300_mfp_addr_map); 102 mfp_init_addr(pxa300_mfp_addr_map);
105 clks_register(ARRAY_AND_SIZE(common_clkregs)); 103 clks_register(ARRAY_AND_SIZE(common_clkregs));
106 } 104 }
107 105
108 if (cpu_is_pxa310()) { 106 if (cpu_is_pxa310()) {
109 pxa3xx_mfp_init_addr(pxa310_mfp_addr_map); 107 mfp_init_addr(pxa310_mfp_addr_map);
110 clks_register(ARRAY_AND_SIZE(pxa310_clkregs)); 108 clks_register(ARRAY_AND_SIZE(pxa310_clkregs));
111 } 109 }
112 110
diff --git a/arch/arm/mach-pxa/pxa320.c b/arch/arm/mach-pxa/pxa320.c
index 36f066196fa2..8b3d97efadab 100644
--- a/arch/arm/mach-pxa/pxa320.c
+++ b/arch/arm/mach-pxa/pxa320.c
@@ -17,16 +17,13 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <mach/hardware.h> 20#include <mach/pxa320.h>
21#include <mach/mfp.h>
22#include <mach/pxa3xx-regs.h>
23#include <mach/mfp-pxa320.h>
24 21
25#include "generic.h" 22#include "generic.h"
26#include "devices.h" 23#include "devices.h"
27#include "clock.h" 24#include "clock.h"
28 25
29static struct pxa3xx_mfp_addr_map pxa320_mfp_addr_map[] __initdata = { 26static struct mfp_addr_map pxa320_mfp_addr_map[] __initdata = {
30 27
31 MFP_ADDR_X(GPIO0, GPIO4, 0x0124), 28 MFP_ADDR_X(GPIO0, GPIO4, 0x0124),
32 MFP_ADDR_X(GPIO5, GPIO9, 0x028C), 29 MFP_ADDR_X(GPIO5, GPIO9, 0x028C),
@@ -89,8 +86,8 @@ static struct clk_lookup pxa320_clkregs[] = {
89static int __init pxa320_init(void) 86static int __init pxa320_init(void)
90{ 87{
91 if (cpu_is_pxa320()) { 88 if (cpu_is_pxa320()) {
92 pxa3xx_init_mfp(); 89 mfp_init_base(io_p2v(MFPR_BASE));
93 pxa3xx_mfp_init_addr(pxa320_mfp_addr_map); 90 mfp_init_addr(pxa320_mfp_addr_map);
94 clks_register(ARRAY_AND_SIZE(pxa320_clkregs)); 91 clks_register(ARRAY_AND_SIZE(pxa320_clkregs));
95 } 92 }
96 93
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 490893824e78..b02d4544dc95 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -23,6 +23,7 @@
23#include <linux/sysdev.h> 23#include <linux/sysdev.h>
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/gpio.h>
26#include <mach/pxa3xx-regs.h> 27#include <mach/pxa3xx-regs.h>
27#include <mach/reset.h> 28#include <mach/reset.h>
28#include <mach/ohci.h> 29#include <mach/ohci.h>
@@ -538,7 +539,7 @@ void __init pxa3xx_init_irq(void)
538 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value)); 539 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));
539 540
540 pxa_init_irq(56, pxa3xx_set_wake); 541 pxa_init_irq(56, pxa3xx_set_wake);
541 pxa_init_gpio(128, NULL); 542 pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
542} 543}
543 544
544/* 545/*
@@ -594,7 +595,7 @@ static int __init pxa3xx_init(void)
594 595
595 clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs)); 596 clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs));
596 597
597 if ((ret = pxa_init_dma(32))) 598 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
598 return ret; 599 return ret;
599 600
600 pxa3xx_init_pm(); 601 pxa3xx_init_pm();
diff --git a/arch/arm/mach-pxa/pxa930.c b/arch/arm/mach-pxa/pxa930.c
index 13e6bfdfff60..71131742fffd 100644
--- a/arch/arm/mach-pxa/pxa930.c
+++ b/arch/arm/mach-pxa/pxa930.c
@@ -16,10 +16,9 @@
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18 18
19#include <mach/hardware.h> 19#include <mach/pxa930.h>
20#include <mach/mfp-pxa930.h>
21 20
22static struct pxa3xx_mfp_addr_map pxa930_mfp_addr_map[] __initdata = { 21static struct mfp_addr_map pxa930_mfp_addr_map[] __initdata = {
23 22
24 MFP_ADDR(GPIO0, 0x02e0), 23 MFP_ADDR(GPIO0, 0x02e0),
25 MFP_ADDR(GPIO1, 0x02dc), 24 MFP_ADDR(GPIO1, 0x02dc),
@@ -180,8 +179,8 @@ static struct pxa3xx_mfp_addr_map pxa930_mfp_addr_map[] __initdata = {
180static int __init pxa930_init(void) 179static int __init pxa930_init(void)
181{ 180{
182 if (cpu_is_pxa930()) { 181 if (cpu_is_pxa930()) {
183 pxa3xx_init_mfp(); 182 mfp_init_base(io_p2v(MFPR_BASE));
184 pxa3xx_mfp_init_addr(pxa930_mfp_addr_map); 183 mfp_init_addr(pxa930_mfp_addr_map);
185 } 184 }
186 185
187 return 0; 186 return 0;
diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
index 00b2dc2a1074..df29d45fb4e7 100644
--- a/arch/arm/mach-pxa/reset.c
+++ b/arch/arm/mach-pxa/reset.c
@@ -10,7 +10,7 @@
10#include <linux/io.h> 10#include <linux/io.h>
11#include <asm/proc-fns.h> 11#include <asm/proc-fns.h>
12 12
13#include <mach/pxa-regs.h> 13#include <mach/regs-ost.h>
14#include <mach/reset.h> 14#include <mach/reset.h>
15 15
16unsigned int reset_status; 16unsigned int reset_status;
@@ -81,7 +81,7 @@ static void do_hw_reset(void)
81 OSMR3 = OSCR + 368640; /* ... in 100 ms */ 81 OSMR3 = OSCR + 368640; /* ... in 100 ms */
82} 82}
83 83
84void arch_reset(char mode) 84void arch_reset(char mode, const char *cmd)
85{ 85{
86 clear_reset_status(RESET_STATUS_ALL); 86 clear_reset_status(RESET_STATUS_ALL);
87 87
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index 5d02a7325586..ff8239991430 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -25,11 +25,9 @@
25 25
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <mach/hardware.h> 28
29#include <mach/pxa3xx-regs.h> 29#include <mach/pxa930.h>
30#include <mach/mfp-pxa930.h>
31#include <mach/i2c.h> 30#include <mach/i2c.h>
32#include <mach/regs-lcd.h>
33#include <mach/pxafb.h> 31#include <mach/pxafb.h>
34 32
35#include "devices.h" 33#include "devices.h"
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index f0845c1b001c..16b4ec67e3b6 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -25,7 +25,6 @@
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <mach/pm.h> 27#include <mach/pm.h>
28#include <mach/pxa-regs.h>
29#include <mach/pxa2xx-gpio.h> 28#include <mach/pxa2xx-gpio.h>
30#include <mach/sharpsl.h> 29#include <mach/sharpsl.h>
31#include "sharpsl.h" 30#include "sharpsl.h"
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index a62c8375eb53..2ed95f369cfc 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -15,7 +15,6 @@
15#include <asm/assembler.h> 15#include <asm/assembler.h>
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17 17
18#include <mach/pxa-regs.h>
19#include <mach/pxa2xx-regs.h> 18#include <mach/pxa2xx-regs.h>
20 19
21#define MDREFR_KDIV 0x200a4000 // all banks 20#define MDREFR_KDIV 0x200a4000 // all banks
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 6d447c9ce8ab..8c61ddac119e 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -44,9 +44,7 @@
44#include <asm/mach/map.h> 44#include <asm/mach/map.h>
45#include <asm/mach/irq.h> 45#include <asm/mach/irq.h>
46 46
47#include <mach/pxa-regs.h> 47#include <mach/pxa27x.h>
48#include <mach/pxa2xx-regs.h>
49#include <mach/mfp-pxa27x.h>
50#include <mach/pxa27x-udc.h> 48#include <mach/pxa27x-udc.h>
51#include <mach/reset.h> 49#include <mach/reset.h>
52#include <mach/i2c.h> 50#include <mach/i2c.h>
@@ -105,6 +103,12 @@ static unsigned long spitz_pin_config[] __initdata = {
105 GPIO57_nIOIS16, 103 GPIO57_nIOIS16,
106 GPIO104_PSKTSEL, 104 GPIO104_PSKTSEL,
107 105
106 /* I2S */
107 GPIO28_I2S_BITCLK_OUT,
108 GPIO29_I2S_SDATA_IN,
109 GPIO30_I2S_SDATA_OUT,
110 GPIO31_I2S_SYNC,
111
108 /* MMC */ 112 /* MMC */
109 GPIO32_MMC_CLK, 113 GPIO32_MMC_CLK,
110 GPIO112_MMC_CMD, 114 GPIO112_MMC_CMD,
@@ -703,10 +707,10 @@ static struct platform_device *devices[] __initdata = {
703 707
704static void spitz_poweroff(void) 708static void spitz_poweroff(void)
705{ 709{
706 arm_machine_restart('g'); 710 arm_machine_restart('g', NULL);
707} 711}
708 712
709static void spitz_restart(char mode) 713static void spitz_restart(char mode, const char *cmd)
710{ 714{
711 /* Bootloader magic for a reboot */ 715 /* Bootloader magic for a reboot */
712 if((MSC0 & 0xffff0000) == 0x7ff00000) 716 if((MSC0 & 0xffff0000) == 0x7ff00000)
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 072e77cfe5a3..2e4490562c9e 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/sharpsl.h> 25#include <mach/sharpsl.h>
26#include <mach/spitz.h> 26#include <mach/spitz.h>
27#include <mach/pxa-regs.h>
28#include <mach/pxa2xx-regs.h> 27#include <mach/pxa2xx-regs.h>
29#include <mach/pxa2xx-gpio.h> 28#include <mach/pxa2xx-gpio.h>
30#include "sharpsl.h" 29#include "sharpsl.h"
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c
index 6f42004db3ed..965e38c6bafe 100644
--- a/arch/arm/mach-pxa/ssp.c
+++ b/arch/arm/mach-pxa/ssp.c
@@ -33,7 +33,6 @@
33#include <asm/irq.h> 33#include <asm/irq.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <mach/ssp.h> 35#include <mach/ssp.h>
36#include <mach/pxa-regs.h>
37#include <mach/regs-ssp.h> 36#include <mach/regs-ssp.h>
38 37
39#define TIMEOUT 100000 38#define TIMEOUT 100000
diff --git a/arch/arm/mach-pxa/standby.S b/arch/arm/mach-pxa/standby.S
index f3821cfda72f..29f5f5c180b7 100644
--- a/arch/arm/mach-pxa/standby.S
+++ b/arch/arm/mach-pxa/standby.S
@@ -13,7 +13,6 @@
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15 15
16#include <mach/pxa-regs.h>
17#include <mach/pxa2xx-regs.h> 16#include <mach/pxa2xx-regs.h>
18 17
19 .text 18 .text
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c
index 58ef08a5224b..b75353a2ec75 100644
--- a/arch/arm/mach-pxa/tavorevb.c
+++ b/arch/arm/mach-pxa/tavorevb.c
@@ -22,9 +22,8 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <mach/hardware.h> 25
26#include <mach/pxa3xx-regs.h> 26#include <mach/pxa930.h>
27#include <mach/mfp-pxa930.h>
28#include <mach/pxafb.h> 27#include <mach/pxafb.h>
29#include <mach/pxa27x_keypad.h> 28#include <mach/pxa27x_keypad.h>
30 29
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 95656a72268d..8eb3830fbb0b 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -22,8 +22,7 @@
22#include <asm/div64.h> 22#include <asm/div64.h>
23#include <asm/mach/irq.h> 23#include <asm/mach/irq.h>
24#include <asm/mach/time.h> 24#include <asm/mach/time.h>
25#include <mach/hardware.h> 25#include <mach/regs-ost.h>
26#include <mach/pxa-regs.h>
27 26
28/* 27/*
29 * This is PXA's sched_clock implementation. This has a resolution 28 * This is PXA's sched_clock implementation. This has a resolution
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 3332e5d0356c..6e8ade6ae339 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -36,8 +36,8 @@
36 36
37#include <asm/setup.h> 37#include <asm/setup.h>
38#include <asm/mach-types.h> 38#include <asm/mach-types.h>
39#include <mach/pxa2xx-regs.h> 39
40#include <mach/mfp-pxa25x.h> 40#include <mach/pxa25x.h>
41#include <mach/reset.h> 41#include <mach/reset.h>
42#include <mach/irda.h> 42#include <mach/irda.h>
43#include <mach/i2c.h> 43#include <mach/i2c.h>
@@ -876,10 +876,10 @@ static struct platform_device *devices[] __initdata = {
876 876
877static void tosa_poweroff(void) 877static void tosa_poweroff(void)
878{ 878{
879 arm_machine_restart('g'); 879 arm_machine_restart('g', NULL);
880} 880}
881 881
882static void tosa_restart(char mode) 882static void tosa_restart(char mode, const char *cmd)
883{ 883{
884 /* Bootloader magic for a reboot */ 884 /* Bootloader magic for a reboot */
885 if((MSC0 & 0xffff0000) == 0x7ff00000) 885 if((MSC0 & 0xffff0000) == 0x7ff00000)
@@ -919,7 +919,7 @@ static void __init tosa_init(void)
919 pxa2xx_set_spi_info(2, &pxa_ssp_master_info); 919 pxa2xx_set_spi_info(2, &pxa_ssp_master_info);
920 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); 920 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
921 921
922 clk_add_alias("CLK_CK3P6MI", &tc6393xb_device.dev, "GPIO11_CLK", NULL); 922 clk_add_alias("CLK_CK3P6MI", tc6393xb_device.name, "GPIO11_CLK", NULL);
923 923
924 platform_add_devices(devices, ARRAY_SIZE(devices)); 924 platform_add_devices(devices, ARRAY_SIZE(devices));
925} 925}
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index a72e3add743c..f79c9cb70ae4 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -39,10 +39,7 @@
39#include <asm/mach/irq.h> 39#include <asm/mach/irq.h>
40#include <asm/mach/flash.h> 40#include <asm/mach/flash.h>
41 41
42#include <mach/hardware.h> 42#include <mach/pxa27x.h>
43#include <mach/pxa-regs.h>
44#include <mach/pxa2xx-regs.h>
45#include <mach/mfp-pxa27x.h>
46#include <mach/pxa2xx_spi.h> 43#include <mach/pxa2xx_spi.h>
47#include <mach/trizeps4.h> 44#include <mach/trizeps4.h>
48#include <mach/audio.h> 45#include <mach/audio.h>
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 4b3120dbc049..0e65344e9f53 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -42,12 +42,9 @@
42#include <linux/mtd/partitions.h> 42#include <linux/mtd/partitions.h>
43#include <linux/mtd/physmap.h> 43#include <linux/mtd/physmap.h>
44 44
45#include <mach/pxa-regs.h> 45#include <mach/pxa25x.h>
46#include <mach/pxa2xx-regs.h>
47#include <mach/bitfield.h>
48#include <mach/audio.h> 46#include <mach/audio.h>
49#include <mach/pxafb.h> 47#include <mach/pxafb.h>
50#include <mach/mfp-pxa25x.h>
51#include <mach/i2c.h> 48#include <mach/i2c.h>
52#include <mach/viper.h> 49#include <mach/viper.h>
53 50
@@ -956,7 +953,7 @@ static struct map_desc viper_io_desc[] __initdata = {
956 }, 953 },
957 { 954 {
958 .virtual = VIPER_PC104IO_BASE, 955 .virtual = VIPER_PC104IO_BASE,
959 .pfn = __phys_to_pfn(_PCMCIA1IO), 956 .pfn = __phys_to_pfn(0x30000000),
960 .length = 0x00800000, 957 .length = 0x00800000,
961 .type = MT_DEVICE, 958 .type = MT_DEVICE,
962 }, 959 },
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c
index 46538885a58a..c1f73205d078 100644
--- a/arch/arm/mach-pxa/zylonite_pxa300.c
+++ b/arch/arm/mach-pxa/zylonite_pxa300.c
@@ -18,9 +18,9 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/i2c/pca953x.h> 20#include <linux/i2c/pca953x.h>
21#include <linux/gpio.h>
21 22
22#include <asm/gpio.h> 23#include <mach/pxa300.h>
23#include <mach/mfp-pxa300.h>
24#include <mach/i2c.h> 24#include <mach/i2c.h>
25#include <mach/zylonite.h> 25#include <mach/zylonite.h>
26 26
diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c
index 28e4e623780b..4e1c488c6906 100644
--- a/arch/arm/mach-pxa/zylonite_pxa320.c
+++ b/arch/arm/mach-pxa/zylonite_pxa320.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20 20
21#include <mach/mfp-pxa320.h> 21#include <mach/pxa320.h>
22#include <mach/zylonite.h> 22#include <mach/zylonite.h>
23 23
24#include "generic.h" 24#include "generic.h"
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index ad911854eb4c..b6ec10627776 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -35,6 +35,7 @@ config MACH_REALVIEW_PB11MP
35 bool "Support RealView/PB11MPCore platform" 35 bool "Support RealView/PB11MPCore platform"
36 select CPU_V6 36 select CPU_V6
37 select ARM_GIC 37 select ARM_GIC
38 select HAVE_PATA_PLATFORM
38 help 39 help
39 Include support for the ARM(R) RealView MPCore Platform Baseboard. 40 Include support for the ARM(R) RealView MPCore Platform Baseboard.
40 PB11MPCore is a platform with an on-board ARM11MPCore and has 41 PB11MPCore is a platform with an on-board ARM11MPCore and has
@@ -51,6 +52,7 @@ config MACH_REALVIEW_PBA8
51 bool "Support RealView/PB-A8 platform" 52 bool "Support RealView/PB-A8 platform"
52 select CPU_V7 53 select CPU_V7
53 select ARM_GIC 54 select ARM_GIC
55 select HAVE_PATA_PLATFORM
54 help 56 help
55 Include support for the ARM(R) RealView Cortex-A8 Platform Baseboard. 57 Include support for the ARM(R) RealView Cortex-A8 Platform Baseboard.
56 PB-A8 is a platform with an on-board Cortex-A8 and has support for 58 PB-A8 is a platform with an on-board Cortex-A8 and has support for
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index bd2aa4f16141..d6766685cfc7 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -29,6 +29,7 @@
29#include <linux/clockchips.h> 29#include <linux/clockchips.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/smc911x.h> 31#include <linux/smc911x.h>
32#include <linux/ata_platform.h>
32 33
33#include <asm/clkdev.h> 34#include <asm/clkdev.h>
34#include <asm/system.h> 35#include <asm/system.h>
@@ -150,6 +151,44 @@ int realview_eth_register(const char *name, struct resource *res)
150 return platform_device_register(&realview_eth_device); 151 return platform_device_register(&realview_eth_device);
151} 152}
152 153
154struct platform_device realview_usb_device = {
155 .name = "isp1760",
156 .num_resources = 2,
157};
158
159int realview_usb_register(struct resource *res)
160{
161 realview_usb_device.resource = res;
162 return platform_device_register(&realview_usb_device);
163}
164
165static struct pata_platform_info pata_platform_data = {
166 .ioport_shift = 1,
167};
168
169static struct resource pata_resources[] = {
170 [0] = {
171 .start = REALVIEW_CF_BASE,
172 .end = REALVIEW_CF_BASE + 0xff,
173 .flags = IORESOURCE_MEM,
174 },
175 [1] = {
176 .start = REALVIEW_CF_BASE + 0x100,
177 .end = REALVIEW_CF_BASE + SZ_4K - 1,
178 .flags = IORESOURCE_MEM,
179 },
180};
181
182struct platform_device realview_cf_device = {
183 .name = "pata_platform",
184 .id = -1,
185 .num_resources = ARRAY_SIZE(pata_resources),
186 .resource = pata_resources,
187 .dev = {
188 .platform_data = &pata_platform_data,
189 },
190};
191
153static struct resource realview_i2c_resource = { 192static struct resource realview_i2c_resource = {
154 .start = REALVIEW_I2C_BASE, 193 .start = REALVIEW_I2C_BASE,
155 .end = REALVIEW_I2C_BASE + SZ_4K - 1, 194 .end = REALVIEW_I2C_BASE + SZ_4K - 1,
@@ -158,11 +197,25 @@ static struct resource realview_i2c_resource = {
158 197
159struct platform_device realview_i2c_device = { 198struct platform_device realview_i2c_device = {
160 .name = "versatile-i2c", 199 .name = "versatile-i2c",
161 .id = -1, 200 .id = 0,
162 .num_resources = 1, 201 .num_resources = 1,
163 .resource = &realview_i2c_resource, 202 .resource = &realview_i2c_resource,
164}; 203};
165 204
205static struct i2c_board_info realview_i2c_board_info[] = {
206 {
207 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1),
208 .type = "ds1338",
209 },
210};
211
212static int __init realview_i2c_init(void)
213{
214 return i2c_register_board_info(0, realview_i2c_board_info,
215 ARRAY_SIZE(realview_i2c_board_info));
216}
217arch_initcall(realview_i2c_init);
218
166#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET) 219#define REALVIEW_SYSMCI (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)
167 220
168static unsigned int realview_mmc_status(struct device *dev) 221static unsigned int realview_mmc_status(struct device *dev)
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 44269b162d49..21c08637683b 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -45,6 +45,7 @@ static struct amba_device name##_device = { \
45} 45}
46 46
47extern struct platform_device realview_flash_device; 47extern struct platform_device realview_flash_device;
48extern struct platform_device realview_cf_device;
48extern struct platform_device realview_i2c_device; 49extern struct platform_device realview_i2c_device;
49extern struct mmc_platform_data realview_mmc0_plat_data; 50extern struct mmc_platform_data realview_mmc0_plat_data;
50extern struct mmc_platform_data realview_mmc1_plat_data; 51extern struct mmc_platform_data realview_mmc1_plat_data;
@@ -62,5 +63,6 @@ extern void realview_leds_event(led_event_t ledevt);
62extern void realview_timer_init(unsigned int timer_irq); 63extern void realview_timer_init(unsigned int timer_irq);
63extern int realview_flash_register(struct resource *res, u32 num); 64extern int realview_flash_register(struct resource *res, u32 num);
64extern int realview_eth_register(const char *name, struct resource *res); 65extern int realview_eth_register(const char *name, struct resource *res);
66extern int realview_usb_register(struct resource *res);
65 67
66#endif 68#endif
diff --git a/arch/arm/mach-realview/include/mach/board-pba8.h b/arch/arm/mach-realview/include/mach/board-pba8.h
index c8bed8f58bab..307f97b16e5b 100644
--- a/arch/arm/mach-realview/include/mach/board-pba8.h
+++ b/arch/arm/mach-realview/include/mach/board-pba8.h
@@ -45,8 +45,6 @@
45#define REALVIEW_PBA8_DMC_BASE 0x100E0000 /* DMC configuration */ 45#define REALVIEW_PBA8_DMC_BASE 0x100E0000 /* DMC configuration */
46#define REALVIEW_PBA8_SMC_BASE 0x100E1000 /* SMC configuration */ 46#define REALVIEW_PBA8_SMC_BASE 0x100E1000 /* SMC configuration */
47#define REALVIEW_PBA8_CAN_BASE 0x100E2000 /* CAN bus */ 47#define REALVIEW_PBA8_CAN_BASE 0x100E2000 /* CAN bus */
48#define REALVIEW_PBA8_CF_BASE 0x18000000 /* Compact flash */
49#define REALVIEW_PBA8_CF_MEM_BASE 0x18003000 /* SMC for Compact flash */
50#define REALVIEW_PBA8_GIC_CPU_BASE 0x1E000000 /* Generic interrupt controller CPU interface */ 48#define REALVIEW_PBA8_GIC_CPU_BASE 0x1E000000 /* Generic interrupt controller CPU interface */
51#define REALVIEW_PBA8_FLASH0_BASE 0x40000000 49#define REALVIEW_PBA8_FLASH0_BASE 0x40000000
52#define REALVIEW_PBA8_FLASH0_SIZE SZ_64M 50#define REALVIEW_PBA8_FLASH0_SIZE SZ_64M
diff --git a/arch/arm/mach-realview/include/mach/platform.h b/arch/arm/mach-realview/include/mach/platform.h
index 793a3a332712..c8f50835fed2 100644
--- a/arch/arm/mach-realview/include/mach/platform.h
+++ b/arch/arm/mach-realview/include/mach/platform.h
@@ -204,6 +204,12 @@
204#define REALVIEW_LT_BASE 0x80000000 /* Logic Tile expansion */ 204#define REALVIEW_LT_BASE 0x80000000 /* Logic Tile expansion */
205 205
206/* 206/*
207 * CompactFlash
208 */
209#define REALVIEW_CF_BASE 0x18000000 /* CompactFlash */
210#define REALVIEW_CF_MEM_BASE 0x18003000 /* SMC for CompactFlash */
211
212/*
207 * Disk on Chip 213 * Disk on Chip
208 */ 214 */
209#define REALVIEW_DOC_BASE 0x2C000000 215#define REALVIEW_DOC_BASE 0x2C000000
diff --git a/arch/arm/mach-realview/include/mach/system.h b/arch/arm/mach-realview/include/mach/system.h
index a2f61c78adbf..1a15a441e027 100644
--- a/arch/arm/mach-realview/include/mach/system.h
+++ b/arch/arm/mach-realview/include/mach/system.h
@@ -34,7 +34,7 @@ static inline void arch_idle(void)
34 cpu_do_idle(); 34 cpu_do_idle();
35} 35}
36 36
37static inline void arch_reset(char mode) 37static inline void arch_reset(char mode, const char *cmd)
38{ 38{
39 void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET; 39 void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET;
40 unsigned int val; 40 unsigned int val;
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index bed39ed97613..c20fbef122b3 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -264,6 +264,19 @@ static int eth_device_register(void)
264 return realview_eth_register(name, realview_eb_eth_resources); 264 return realview_eth_register(name, realview_eb_eth_resources);
265} 265}
266 266
267static struct resource realview_eb_isp1761_resources[] = {
268 [0] = {
269 .start = REALVIEW_EB_USB_BASE,
270 .end = REALVIEW_EB_USB_BASE + SZ_128K - 1,
271 .flags = IORESOURCE_MEM,
272 },
273 [1] = {
274 .start = IRQ_EB_USB,
275 .end = IRQ_EB_USB,
276 .flags = IORESOURCE_IRQ,
277 },
278};
279
267static void __init gic_init_irq(void) 280static void __init gic_init_irq(void)
268{ 281{
269 if (core_tile_eb11mp() || core_tile_a9mp()) { 282 if (core_tile_eb11mp() || core_tile_a9mp()) {
@@ -323,6 +336,8 @@ static void realview_eb11mp_fixup(void)
323 /* platform devices */ 336 /* platform devices */
324 realview_eb_eth_resources[1].start = IRQ_EB11MP_ETH; 337 realview_eb_eth_resources[1].start = IRQ_EB11MP_ETH;
325 realview_eb_eth_resources[1].end = IRQ_EB11MP_ETH; 338 realview_eb_eth_resources[1].end = IRQ_EB11MP_ETH;
339 realview_eb_isp1761_resources[1].start = IRQ_EB11MP_USB;
340 realview_eb_isp1761_resources[1].end = IRQ_EB11MP_USB;
326} 341}
327 342
328static void __init realview_eb_timer_init(void) 343static void __init realview_eb_timer_init(void)
@@ -366,6 +381,7 @@ static void __init realview_eb_init(void)
366 realview_flash_register(&realview_eb_flash_resource, 1); 381 realview_flash_register(&realview_eb_flash_resource, 1);
367 platform_device_register(&realview_i2c_device); 382 platform_device_register(&realview_i2c_device);
368 eth_device_register(); 383 eth_device_register();
384 realview_usb_register(realview_eb_isp1761_resources);
369 385
370 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 386 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
371 struct amba_device *d = amba_devs[i]; 387 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 8f0683c22140..a64b84a7a3df 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -222,6 +222,19 @@ static struct resource realview_pb1176_smsc911x_resources[] = {
222 }, 222 },
223}; 223};
224 224
225static struct resource realview_pb1176_isp1761_resources[] = {
226 [0] = {
227 .start = REALVIEW_PB1176_USB_BASE,
228 .end = REALVIEW_PB1176_USB_BASE + SZ_128K - 1,
229 .flags = IORESOURCE_MEM,
230 },
231 [1] = {
232 .start = IRQ_PB1176_USB,
233 .end = IRQ_PB1176_USB,
234 .flags = IORESOURCE_IRQ,
235 },
236};
237
225static void __init gic_init_irq(void) 238static void __init gic_init_irq(void)
226{ 239{
227 /* ARM1176 DevChip GIC, primary */ 240 /* ARM1176 DevChip GIC, primary */
@@ -260,6 +273,8 @@ static void __init realview_pb1176_init(void)
260 273
261 realview_flash_register(&realview_pb1176_flash_resource, 1); 274 realview_flash_register(&realview_pb1176_flash_resource, 1);
262 realview_eth_register(NULL, realview_pb1176_smsc911x_resources); 275 realview_eth_register(NULL, realview_pb1176_smsc911x_resources);
276 platform_device_register(&realview_i2c_device);
277 realview_usb_register(realview_pb1176_isp1761_resources);
263 278
264 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 279 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
265 struct amba_device *d = amba_devs[i]; 280 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 3ebdb2dadd6f..ea1e60eca359 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -230,31 +230,19 @@ static struct resource realview_pb11mp_smsc911x_resources[] = {
230 }, 230 },
231}; 231};
232 232
233struct resource realview_pb11mp_cf_resources[] = { 233static struct resource realview_pb11mp_isp1761_resources[] = {
234 [0] = { 234 [0] = {
235 .start = REALVIEW_PB11MP_CF_BASE, 235 .start = REALVIEW_PB11MP_USB_BASE,
236 .end = REALVIEW_PB11MP_CF_BASE + SZ_4K - 1, 236 .end = REALVIEW_PB11MP_USB_BASE + SZ_128K - 1,
237 .flags = IORESOURCE_MEM, 237 .flags = IORESOURCE_MEM,
238 }, 238 },
239 [1] = { 239 [1] = {
240 .start = REALVIEW_PB11MP_CF_MEM_BASE, 240 .start = IRQ_TC11MP_USB,
241 .end = REALVIEW_PB11MP_CF_MEM_BASE + SZ_4K - 1, 241 .end = IRQ_TC11MP_USB,
242 .flags = IORESOURCE_MEM,
243 },
244 [2] = {
245 .start = -1, /* FIXME: Find correct irq */
246 .end = -1,
247 .flags = IORESOURCE_IRQ, 242 .flags = IORESOURCE_IRQ,
248 }, 243 },
249}; 244};
250 245
251struct platform_device realview_pb11mp_cf_device = {
252 .name = "compactflash",
253 .id = 0,
254 .num_resources = ARRAY_SIZE(realview_pb11mp_cf_resources),
255 .resource = realview_pb11mp_cf_resources,
256};
257
258static void __init gic_init_irq(void) 246static void __init gic_init_irq(void)
259{ 247{
260 unsigned int pldctrl; 248 unsigned int pldctrl;
@@ -308,7 +296,8 @@ static void __init realview_pb11mp_init(void)
308 ARRAY_SIZE(realview_pb11mp_flash_resource)); 296 ARRAY_SIZE(realview_pb11mp_flash_resource));
309 realview_eth_register(NULL, realview_pb11mp_smsc911x_resources); 297 realview_eth_register(NULL, realview_pb11mp_smsc911x_resources);
310 platform_device_register(&realview_i2c_device); 298 platform_device_register(&realview_i2c_device);
311 platform_device_register(&realview_pb11mp_cf_device); 299 platform_device_register(&realview_cf_device);
300 realview_usb_register(realview_pb11mp_isp1761_resources);
312 301
313 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 302 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
314 struct amba_device *d = amba_devs[i]; 303 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 34c94435d2d8..d6ac1eb86576 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -221,31 +221,19 @@ static struct resource realview_pba8_smsc911x_resources[] = {
221 }, 221 },
222}; 222};
223 223
224struct resource realview_pba8_cf_resources[] = { 224static struct resource realview_pba8_isp1761_resources[] = {
225 [0] = { 225 [0] = {
226 .start = REALVIEW_PBA8_CF_BASE, 226 .start = REALVIEW_PBA8_USB_BASE,
227 .end = REALVIEW_PBA8_CF_BASE + SZ_4K - 1, 227 .end = REALVIEW_PBA8_USB_BASE + SZ_128K - 1,
228 .flags = IORESOURCE_MEM, 228 .flags = IORESOURCE_MEM,
229 }, 229 },
230 [1] = { 230 [1] = {
231 .start = REALVIEW_PBA8_CF_MEM_BASE, 231 .start = IRQ_PBA8_USB,
232 .end = REALVIEW_PBA8_CF_MEM_BASE + SZ_4K - 1, 232 .end = IRQ_PBA8_USB,
233 .flags = IORESOURCE_MEM,
234 },
235 [2] = {
236 .start = -1, /* FIXME: Find correct irq */
237 .end = -1,
238 .flags = IORESOURCE_IRQ, 233 .flags = IORESOURCE_IRQ,
239 }, 234 },
240}; 235};
241 236
242struct platform_device realview_pba8_cf_device = {
243 .name = "compactflash",
244 .id = 0,
245 .num_resources = ARRAY_SIZE(realview_pba8_cf_resources),
246 .resource = realview_pba8_cf_resources,
247};
248
249static void __init gic_init_irq(void) 237static void __init gic_init_irq(void)
250{ 238{
251 /* ARM PB-A8 on-board GIC */ 239 /* ARM PB-A8 on-board GIC */
@@ -276,7 +264,8 @@ static void __init realview_pba8_init(void)
276 ARRAY_SIZE(realview_pba8_flash_resource)); 264 ARRAY_SIZE(realview_pba8_flash_resource));
277 realview_eth_register(NULL, realview_pba8_smsc911x_resources); 265 realview_eth_register(NULL, realview_pba8_smsc911x_resources);
278 platform_device_register(&realview_i2c_device); 266 platform_device_register(&realview_i2c_device);
279 platform_device_register(&realview_pba8_cf_device); 267 platform_device_register(&realview_cf_device);
268 realview_usb_register(realview_pba8_isp1761_resources);
280 269
281 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 270 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
282 struct amba_device *d = amba_devs[i]; 271 struct amba_device *d = amba_devs[i];
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c
index 7958a30f8932..c47d974d52bd 100644
--- a/arch/arm/mach-rpc/dma.c
+++ b/arch/arm/mach-rpc/dma.c
@@ -26,6 +26,16 @@
26#include <asm/mach/dma.h> 26#include <asm/mach/dma.h>
27#include <asm/hardware/iomd.h> 27#include <asm/hardware/iomd.h>
28 28
29struct iomd_dma {
30 struct dma_struct dma;
31 unsigned int state;
32 unsigned long base; /* Controller base address */
33 int irq; /* Controller IRQ */
34 struct scatterlist cur_sg; /* Current controller buffer */
35 dma_addr_t dma_addr;
36 unsigned int dma_len;
37};
38
29#if 0 39#if 0
30typedef enum { 40typedef enum {
31 dma_size_8 = 1, 41 dma_size_8 = 1,
@@ -44,15 +54,15 @@ typedef enum {
44#define CR (IOMD_IO0CR - IOMD_IO0CURA) 54#define CR (IOMD_IO0CR - IOMD_IO0CURA)
45#define ST (IOMD_IO0ST - IOMD_IO0CURA) 55#define ST (IOMD_IO0ST - IOMD_IO0CURA)
46 56
47static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma) 57static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma)
48{ 58{
49 unsigned long end, offset, flags = 0; 59 unsigned long end, offset, flags = 0;
50 60
51 if (dma->sg) { 61 if (idma->dma.sg) {
52 sg->dma_address = dma->sg->dma_address; 62 sg->dma_address = idma->dma_addr;
53 offset = sg->dma_address & ~PAGE_MASK; 63 offset = sg->dma_address & ~PAGE_MASK;
54 64
55 end = offset + dma->sg->length; 65 end = offset + idma->dma_len;
56 66
57 if (end > PAGE_SIZE) 67 if (end > PAGE_SIZE)
58 end = PAGE_SIZE; 68 end = PAGE_SIZE;
@@ -62,15 +72,17 @@ static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma)
62 72
63 sg->length = end - TRANSFER_SIZE; 73 sg->length = end - TRANSFER_SIZE;
64 74
65 dma->sg->length -= end - offset; 75 idma->dma_len -= end - offset;
66 dma->sg->dma_address += end - offset; 76 idma->dma_addr += end - offset;
67 77
68 if (dma->sg->length == 0) { 78 if (idma->dma_len == 0) {
69 if (dma->sgcount > 1) { 79 if (idma->dma.sgcount > 1) {
70 dma->sg++; 80 idma->dma.sg = sg_next(idma->dma.sg);
71 dma->sgcount--; 81 idma->dma_addr = idma->dma.sg->dma_address;
82 idma->dma_len = idma->dma.sg->length;
83 idma->dma.sgcount--;
72 } else { 84 } else {
73 dma->sg = NULL; 85 idma->dma.sg = NULL;
74 flags |= DMA_END_S; 86 flags |= DMA_END_S;
75 } 87 }
76 } 88 }
@@ -85,8 +97,8 @@ static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma)
85 97
86static irqreturn_t iomd_dma_handle(int irq, void *dev_id) 98static irqreturn_t iomd_dma_handle(int irq, void *dev_id)
87{ 99{
88 dma_t *dma = (dma_t *)dev_id; 100 struct iomd_dma *idma = dev_id;
89 unsigned long base = dma->dma_base; 101 unsigned long base = idma->base;
90 102
91 do { 103 do {
92 unsigned int status; 104 unsigned int status;
@@ -95,93 +107,99 @@ static irqreturn_t iomd_dma_handle(int irq, void *dev_id)
95 if (!(status & DMA_ST_INT)) 107 if (!(status & DMA_ST_INT))
96 return IRQ_HANDLED; 108 return IRQ_HANDLED;
97 109
98 if ((dma->state ^ status) & DMA_ST_AB) 110 if ((idma->state ^ status) & DMA_ST_AB)
99 iomd_get_next_sg(&dma->cur_sg, dma); 111 iomd_get_next_sg(&idma->cur_sg, idma);
100 112
101 switch (status & (DMA_ST_OFL | DMA_ST_AB)) { 113 switch (status & (DMA_ST_OFL | DMA_ST_AB)) {
102 case DMA_ST_OFL: /* OIA */ 114 case DMA_ST_OFL: /* OIA */
103 case DMA_ST_AB: /* .IB */ 115 case DMA_ST_AB: /* .IB */
104 iomd_writel(dma->cur_sg.dma_address, base + CURA); 116 iomd_writel(idma->cur_sg.dma_address, base + CURA);
105 iomd_writel(dma->cur_sg.length, base + ENDA); 117 iomd_writel(idma->cur_sg.length, base + ENDA);
106 dma->state = DMA_ST_AB; 118 idma->state = DMA_ST_AB;
107 break; 119 break;
108 120
109 case DMA_ST_OFL | DMA_ST_AB: /* OIB */ 121 case DMA_ST_OFL | DMA_ST_AB: /* OIB */
110 case 0: /* .IA */ 122 case 0: /* .IA */
111 iomd_writel(dma->cur_sg.dma_address, base + CURB); 123 iomd_writel(idma->cur_sg.dma_address, base + CURB);
112 iomd_writel(dma->cur_sg.length, base + ENDB); 124 iomd_writel(idma->cur_sg.length, base + ENDB);
113 dma->state = 0; 125 idma->state = 0;
114 break; 126 break;
115 } 127 }
116 128
117 if (status & DMA_ST_OFL && 129 if (status & DMA_ST_OFL &&
118 dma->cur_sg.length == (DMA_END_S|DMA_END_L)) 130 idma->cur_sg.length == (DMA_END_S|DMA_END_L))
119 break; 131 break;
120 } while (1); 132 } while (1);
121 133
122 dma->state = ~DMA_ST_AB; 134 idma->state = ~DMA_ST_AB;
123 disable_irq(irq); 135 disable_irq(irq);
124 136
125 return IRQ_HANDLED; 137 return IRQ_HANDLED;
126} 138}
127 139
128static int iomd_request_dma(dmach_t channel, dma_t *dma) 140static int iomd_request_dma(unsigned int chan, dma_t *dma)
129{ 141{
130 return request_irq(dma->dma_irq, iomd_dma_handle, 142 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
131 IRQF_DISABLED, dma->device_id, dma); 143
144 return request_irq(idma->irq, iomd_dma_handle,
145 IRQF_DISABLED, idma->dma.device_id, idma);
132} 146}
133 147
134static void iomd_free_dma(dmach_t channel, dma_t *dma) 148static void iomd_free_dma(unsigned int chan, dma_t *dma)
135{ 149{
136 free_irq(dma->dma_irq, dma); 150 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
151
152 free_irq(idma->irq, idma);
137} 153}
138 154
139static void iomd_enable_dma(dmach_t channel, dma_t *dma) 155static void iomd_enable_dma(unsigned int chan, dma_t *dma)
140{ 156{
141 unsigned long dma_base = dma->dma_base; 157 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
158 unsigned long dma_base = idma->base;
142 unsigned int ctrl = TRANSFER_SIZE | DMA_CR_E; 159 unsigned int ctrl = TRANSFER_SIZE | DMA_CR_E;
143 160
144 if (dma->invalid) { 161 if (idma->dma.invalid) {
145 dma->invalid = 0; 162 idma->dma.invalid = 0;
146 163
147 /* 164 /*
148 * Cope with ISA-style drivers which expect cache 165 * Cope with ISA-style drivers which expect cache
149 * coherence. 166 * coherence.
150 */ 167 */
151 if (!dma->sg) { 168 if (!idma->dma.sg) {
152 dma->sg = &dma->buf; 169 idma->dma.sg = &idma->dma.buf;
153 dma->sgcount = 1; 170 idma->dma.sgcount = 1;
154 dma->buf.length = dma->count; 171 idma->dma.buf.length = idma->dma.count;
155 dma->buf.dma_address = dma_map_single(NULL, 172 idma->dma.buf.dma_address = dma_map_single(NULL,
156 dma->addr, dma->count, 173 idma->dma.addr, idma->dma.count,
157 dma->dma_mode == DMA_MODE_READ ? 174 idma->dma.dma_mode == DMA_MODE_READ ?
158 DMA_FROM_DEVICE : DMA_TO_DEVICE); 175 DMA_FROM_DEVICE : DMA_TO_DEVICE);
159 } 176 }
160 177
161 iomd_writeb(DMA_CR_C, dma_base + CR); 178 iomd_writeb(DMA_CR_C, dma_base + CR);
162 dma->state = DMA_ST_AB; 179 idma->state = DMA_ST_AB;
163 } 180 }
164 181
165 if (dma->dma_mode == DMA_MODE_READ) 182 if (idma->dma.dma_mode == DMA_MODE_READ)
166 ctrl |= DMA_CR_D; 183 ctrl |= DMA_CR_D;
167 184
168 iomd_writeb(ctrl, dma_base + CR); 185 iomd_writeb(ctrl, dma_base + CR);
169 enable_irq(dma->dma_irq); 186 enable_irq(idma->irq);
170} 187}
171 188
172static void iomd_disable_dma(dmach_t channel, dma_t *dma) 189static void iomd_disable_dma(unsigned int chan, dma_t *dma)
173{ 190{
174 unsigned long dma_base = dma->dma_base; 191 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
192 unsigned long dma_base = idma->base;
175 unsigned long flags; 193 unsigned long flags;
176 194
177 local_irq_save(flags); 195 local_irq_save(flags);
178 if (dma->state != ~DMA_ST_AB) 196 if (idma->state != ~DMA_ST_AB)
179 disable_irq(dma->dma_irq); 197 disable_irq(idma->irq);
180 iomd_writeb(0, dma_base + CR); 198 iomd_writeb(0, dma_base + CR);
181 local_irq_restore(flags); 199 local_irq_restore(flags);
182} 200}
183 201
184static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle) 202static int iomd_set_dma_speed(unsigned int chan, dma_t *dma, int cycle)
185{ 203{
186 int tcr, speed; 204 int tcr, speed;
187 205
@@ -197,7 +215,7 @@ static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle)
197 tcr = iomd_readb(IOMD_DMATCR); 215 tcr = iomd_readb(IOMD_DMATCR);
198 speed &= 3; 216 speed &= 3;
199 217
200 switch (channel) { 218 switch (chan) {
201 case DMA_0: 219 case DMA_0:
202 tcr = (tcr & ~0x03) | speed; 220 tcr = (tcr & ~0x03) | speed;
203 break; 221 break;
@@ -236,16 +254,22 @@ static struct fiq_handler fh = {
236 .name = "floppydma" 254 .name = "floppydma"
237}; 255};
238 256
239static void floppy_enable_dma(dmach_t channel, dma_t *dma) 257struct floppy_dma {
258 struct dma_struct dma;
259 unsigned int fiq;
260};
261
262static void floppy_enable_dma(unsigned int chan, dma_t *dma)
240{ 263{
264 struct floppy_dma *fdma = container_of(dma, struct floppy_dma, dma);
241 void *fiqhandler_start; 265 void *fiqhandler_start;
242 unsigned int fiqhandler_length; 266 unsigned int fiqhandler_length;
243 struct pt_regs regs; 267 struct pt_regs regs;
244 268
245 if (dma->sg) 269 if (fdma->dma.sg)
246 BUG(); 270 BUG();
247 271
248 if (dma->dma_mode == DMA_MODE_READ) { 272 if (fdma->dma.dma_mode == DMA_MODE_READ) {
249 extern unsigned char floppy_fiqin_start, floppy_fiqin_end; 273 extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
250 fiqhandler_start = &floppy_fiqin_start; 274 fiqhandler_start = &floppy_fiqin_start;
251 fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start; 275 fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start;
@@ -255,8 +279,8 @@ static void floppy_enable_dma(dmach_t channel, dma_t *dma)
255 fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start; 279 fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start;
256 } 280 }
257 281
258 regs.ARM_r9 = dma->count; 282 regs.ARM_r9 = fdma->dma.count;
259 regs.ARM_r10 = (unsigned long)dma->addr; 283 regs.ARM_r10 = (unsigned long)fdma->dma.addr;
260 regs.ARM_fp = (unsigned long)FLOPPYDMA_BASE; 284 regs.ARM_fp = (unsigned long)FLOPPYDMA_BASE;
261 285
262 if (claim_fiq(&fh)) { 286 if (claim_fiq(&fh)) {
@@ -266,16 +290,17 @@ static void floppy_enable_dma(dmach_t channel, dma_t *dma)
266 290
267 set_fiq_handler(fiqhandler_start, fiqhandler_length); 291 set_fiq_handler(fiqhandler_start, fiqhandler_length);
268 set_fiq_regs(&regs); 292 set_fiq_regs(&regs);
269 enable_fiq(dma->dma_irq); 293 enable_fiq(fdma->fiq);
270} 294}
271 295
272static void floppy_disable_dma(dmach_t channel, dma_t *dma) 296static void floppy_disable_dma(unsigned int chan, dma_t *dma)
273{ 297{
274 disable_fiq(dma->dma_irq); 298 struct floppy_dma *fdma = container_of(dma, struct floppy_dma, dma);
299 disable_fiq(fdma->fiq);
275 release_fiq(&fh); 300 release_fiq(&fh);
276} 301}
277 302
278static int floppy_get_residue(dmach_t channel, dma_t *dma) 303static int floppy_get_residue(unsigned int chan, dma_t *dma)
279{ 304{
280 struct pt_regs regs; 305 struct pt_regs regs;
281 get_fiq_regs(&regs); 306 get_fiq_regs(&regs);
@@ -292,7 +317,7 @@ static struct dma_ops floppy_dma_ops = {
292/* 317/*
293 * This is virtual DMA - we don't need anything here. 318 * This is virtual DMA - we don't need anything here.
294 */ 319 */
295static void sound_enable_disable_dma(dmach_t channel, dma_t *dma) 320static void sound_enable_disable_dma(unsigned int chan, dma_t *dma)
296{ 321{
297} 322}
298 323
@@ -302,8 +327,24 @@ static struct dma_ops sound_dma_ops = {
302 .disable = sound_enable_disable_dma, 327 .disable = sound_enable_disable_dma,
303}; 328};
304 329
305void __init arch_dma_init(dma_t *dma) 330static struct iomd_dma iomd_dma[6];
331
332static struct floppy_dma floppy_dma = {
333 .dma = {
334 .d_ops = &floppy_dma_ops,
335 },
336 .fiq = FIQ_FLOPPYDATA,
337};
338
339static dma_t sound_dma = {
340 .d_ops = &sound_dma_ops,
341};
342
343static int __init rpc_dma_init(void)
306{ 344{
345 unsigned int i;
346 int ret;
347
307 iomd_writeb(0, IOMD_IO0CR); 348 iomd_writeb(0, IOMD_IO0CR);
308 iomd_writeb(0, IOMD_IO1CR); 349 iomd_writeb(0, IOMD_IO1CR);
309 iomd_writeb(0, IOMD_IO2CR); 350 iomd_writeb(0, IOMD_IO2CR);
@@ -311,31 +352,39 @@ void __init arch_dma_init(dma_t *dma)
311 352
312 iomd_writeb(0xa0, IOMD_DMATCR); 353 iomd_writeb(0xa0, IOMD_DMATCR);
313 354
314 dma[DMA_0].dma_base = IOMD_IO0CURA;
315 dma[DMA_0].dma_irq = IRQ_DMA0;
316 dma[DMA_0].d_ops = &iomd_dma_ops;
317 dma[DMA_1].dma_base = IOMD_IO1CURA;
318 dma[DMA_1].dma_irq = IRQ_DMA1;
319 dma[DMA_1].d_ops = &iomd_dma_ops;
320 dma[DMA_2].dma_base = IOMD_IO2CURA;
321 dma[DMA_2].dma_irq = IRQ_DMA2;
322 dma[DMA_2].d_ops = &iomd_dma_ops;
323 dma[DMA_3].dma_base = IOMD_IO3CURA;
324 dma[DMA_3].dma_irq = IRQ_DMA3;
325 dma[DMA_3].d_ops = &iomd_dma_ops;
326 dma[DMA_S0].dma_base = IOMD_SD0CURA;
327 dma[DMA_S0].dma_irq = IRQ_DMAS0;
328 dma[DMA_S0].d_ops = &iomd_dma_ops;
329 dma[DMA_S1].dma_base = IOMD_SD1CURA;
330 dma[DMA_S1].dma_irq = IRQ_DMAS1;
331 dma[DMA_S1].d_ops = &iomd_dma_ops;
332 dma[DMA_VIRTUAL_FLOPPY].dma_irq = FIQ_FLOPPYDATA;
333 dma[DMA_VIRTUAL_FLOPPY].d_ops = &floppy_dma_ops;
334 dma[DMA_VIRTUAL_SOUND].d_ops = &sound_dma_ops;
335
336 /* 355 /*
337 * Setup DMA channels 2,3 to be for podules 356 * Setup DMA channels 2,3 to be for podules
338 * and channels 0,1 for internal devices 357 * and channels 0,1 for internal devices
339 */ 358 */
340 iomd_writeb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT); 359 iomd_writeb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT);
360
361 iomd_dma[DMA_0].base = IOMD_IO0CURA;
362 iomd_dma[DMA_0].irq = IRQ_DMA0;
363 iomd_dma[DMA_1].base = IOMD_IO1CURA;
364 iomd_dma[DMA_1].irq = IRQ_DMA1;
365 iomd_dma[DMA_2].base = IOMD_IO2CURA;
366 iomd_dma[DMA_2].irq = IRQ_DMA2;
367 iomd_dma[DMA_3].base = IOMD_IO3CURA;
368 iomd_dma[DMA_3].irq = IRQ_DMA3;
369 iomd_dma[DMA_S0].base = IOMD_SD0CURA;
370 iomd_dma[DMA_S0].irq = IRQ_DMAS0;
371 iomd_dma[DMA_S1].base = IOMD_SD1CURA;
372 iomd_dma[DMA_S1].irq = IRQ_DMAS1;
373
374 for (i = DMA_0; i <= DMA_S1; i++) {
375 iomd_dma[i].dma.d_ops = &iomd_dma_ops;
376
377 ret = isa_dma_add(i, &iomd_dma[i].dma);
378 if (ret)
379 printk("IOMDDMA%u: unable to register: %d\n", i, ret);
380 }
381
382 ret = isa_dma_add(DMA_VIRTUAL_FLOPPY, &floppy_dma.dma);
383 if (ret)
384 printk("IOMDFLOPPY: unable to register: %d\n", ret);
385 ret = isa_dma_add(DMA_VIRTUAL_SOUND, &sound_dma);
386 if (ret)
387 printk("IOMDSOUND: unable to register: %d\n", ret);
388 return 0;
341} 389}
390core_initcall(rpc_dma_init);
diff --git a/arch/arm/mach-rpc/include/mach/isa-dma.h b/arch/arm/mach-rpc/include/mach/isa-dma.h
index bad720548587..67bfc6719c34 100644
--- a/arch/arm/mach-rpc/include/mach/isa-dma.h
+++ b/arch/arm/mach-rpc/include/mach/isa-dma.h
@@ -23,5 +23,7 @@
23 23
24#define DMA_FLOPPY DMA_VIRTUAL_FLOPPY 24#define DMA_FLOPPY DMA_VIRTUAL_FLOPPY
25 25
26#define IOMD_DMA_BOUNDARY (PAGE_SIZE - 1)
27
26#endif /* _ASM_ARCH_DMA_H */ 28#endif /* _ASM_ARCH_DMA_H */
27 29
diff --git a/arch/arm/mach-rpc/include/mach/system.h b/arch/arm/mach-rpc/include/mach/system.h
index bd7268ba17e2..45c7b935dc45 100644
--- a/arch/arm/mach-rpc/include/mach/system.h
+++ b/arch/arm/mach-rpc/include/mach/system.h
@@ -16,7 +16,7 @@ static inline void arch_idle(void)
16 cpu_do_idle(); 16 cpu_do_idle();
17} 17}
18 18
19static inline void arch_reset(char mode) 19static inline void arch_reset(char mode, const char *cmd)
20{ 20{
21 iomd_writeb(0, IOMD_ROMCR0); 21 iomd_writeb(0, IOMD_ROMCR0);
22 22
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index 552b4c778fdc..440c014e24b3 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -28,7 +28,7 @@
28#include <mach/regs-mem.h> 28#include <mach/regs-mem.h>
29#include <mach/regs-lcd.h> 29#include <mach/regs-lcd.h>
30#include <mach/regs-sdi.h> 30#include <mach/regs-sdi.h>
31#include <asm/plat-s3c24xx/regs-iis.h> 31#include <plat/regs-iis.h>
32#include <plat/regs-spi.h> 32#include <plat/regs-spi.h>
33 33
34static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = { 34static struct s3c24xx_dma_map __initdata s3c2410_dma_mappings[] = {
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
new file mode 100644
index 000000000000..ce1ec69806a1
--- /dev/null
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
@@ -0,0 +1,23 @@
1/* arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2410 - GPIO bank numbering
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#define S3C2410_GPIONO(bank,offset) ((bank) + (offset))
15
16#define S3C2410_GPIO_BANKA (32*0)
17#define S3C2410_GPIO_BANKB (32*1)
18#define S3C2410_GPIO_BANKC (32*2)
19#define S3C2410_GPIO_BANKD (32*3)
20#define S3C2410_GPIO_BANKE (32*4)
21#define S3C2410_GPIO_BANKF (32*5)
22#define S3C2410_GPIO_BANKG (32*6)
23#define S3C2410_GPIO_BANKH (32*7)
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 00476a573bbe..51a88cf9526b 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -23,3 +23,6 @@
23#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA) 23#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
24 24
25#include <asm-generic/gpio.h> 25#include <asm-generic/gpio.h>
26#include <mach/gpio-nrs.h>
27
28#define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32)
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
index 49efce8cd4a7..2a2384ffa7b1 100644
--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
+++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
@@ -80,7 +80,7 @@
80#define IRQ_EINT22 S3C2410_IRQ(50) 80#define IRQ_EINT22 S3C2410_IRQ(50)
81#define IRQ_EINT23 S3C2410_IRQ(51) 81#define IRQ_EINT23 S3C2410_IRQ(51)
82 82
83 83#define IRQ_EINT_BIT(x) ((x) - IRQ_EINT4 + 4)
84#define IRQ_EINT(x) (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x))) 84#define IRQ_EINT(x) (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x)))
85 85
86#define IRQ_LCD_FIFO S3C2410_IRQ(52) 86#define IRQ_LCD_FIFO S3C2410_IRQ(52)
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
index 321077613067..35a03df473fc 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
@@ -14,16 +14,7 @@
14#ifndef __ASM_ARCH_REGS_GPIO_H 14#ifndef __ASM_ARCH_REGS_GPIO_H
15#define __ASM_ARCH_REGS_GPIO_H 15#define __ASM_ARCH_REGS_GPIO_H
16 16
17#define S3C2410_GPIONO(bank,offset) ((bank) + (offset)) 17#include <mach/gpio-nrs.h>
18
19#define S3C2410_GPIO_BANKA (32*0)
20#define S3C2410_GPIO_BANKB (32*1)
21#define S3C2410_GPIO_BANKC (32*2)
22#define S3C2410_GPIO_BANKD (32*3)
23#define S3C2410_GPIO_BANKE (32*4)
24#define S3C2410_GPIO_BANKF (32*5)
25#define S3C2410_GPIO_BANKG (32*6)
26#define S3C2410_GPIO_BANKH (32*7)
27 18
28#ifdef CONFIG_CPU_S3C2400 19#ifdef CONFIG_CPU_S3C2400
29#define S3C24XX_GPIO_BASE(x) S3C2400_GPIO_BASE(x) 20#define S3C24XX_GPIO_BASE(x) S3C2400_GPIO_BASE(x)
diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h b/arch/arm/mach-s3c2410/include/mach/system-reset.h
index 7613d0a384ba..b8687f71c304 100644
--- a/arch/arm/mach-s3c2410/include/mach/system-reset.h
+++ b/arch/arm/mach-s3c2410/include/mach/system-reset.h
@@ -22,7 +22,7 @@
22extern void (*s3c24xx_reset_hook)(void); 22extern void (*s3c24xx_reset_hook)(void);
23 23
24static void 24static void
25arch_reset(char mode) 25arch_reset(char mode, const char *cmd)
26{ 26{
27 struct clk *wdtclk; 27 struct clk *wdtclk;
28 28
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 821a1668c3ac..7a7c4da4c256 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -203,7 +203,7 @@ static void __init h1940_map_io(void)
203#ifdef CONFIG_PM_H1940 203#ifdef CONFIG_PM_H1940
204 memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024); 204 memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
205#endif 205#endif
206 s3c2410_pm_init(); 206 s3c_pm_init();
207} 207}
208 208
209static void __init h1940_init_irq(void) 209static void __init h1940_init_irq(void)
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 9678a53ceeb1..9f1ba9b63f70 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -355,7 +355,7 @@ static void __init qt2410_machine_init(void)
355 s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT); 355 s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT);
356 356
357 platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); 357 platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices));
358 s3c2410_pm_init(); 358 s3c_pm_init();
359} 359}
360 360
361MACHINE_START(QT2410, "QT2410") 361MACHINE_START(QT2410, "QT2410")
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
index a6970f613192..87fc481d92d4 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -37,21 +37,14 @@
37#include <plat/cpu.h> 37#include <plat/cpu.h>
38#include <plat/pm.h> 38#include <plat/pm.h>
39 39
40#ifdef CONFIG_S3C2410_PM_DEBUG
41extern void pm_dbg(const char *fmt, ...);
42#define DBG(fmt...) pm_dbg(fmt)
43#else
44#define DBG(fmt...) printk(KERN_DEBUG fmt)
45#endif
46
47static void s3c2410_pm_prepare(void) 40static void s3c2410_pm_prepare(void)
48{ 41{
49 /* ensure at least GSTATUS3 has the resume address */ 42 /* ensure at least GSTATUS3 has the resume address */
50 43
51 __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2410_GSTATUS3); 44 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2410_GSTATUS3);
52 45
53 DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3)); 46 S3C_PMDBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
54 DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4)); 47 S3C_PMDBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
55 48
56 if (machine_is_h1940()) { 49 if (machine_is_h1940()) {
57 void *base = phys_to_virt(H1940_SUSPEND_CHECK); 50 void *base = phys_to_virt(H1940_SUSPEND_CHECK);
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 6078f09b7df5..8331e8d97e20 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -29,13 +29,14 @@
29 29
30#include <mach/bast-map.h> 30#include <mach/bast-map.h>
31#include <mach/bast-irq.h> 31#include <mach/bast-irq.h>
32#include <mach/usb-control.h>
33#include <mach/regs-gpio.h> 32#include <mach/regs-gpio.h>
34 33
35#include <mach/hardware.h> 34#include <mach/hardware.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
37 36
37#include <plat/usb-control.h>
38#include <plat/devs.h> 38#include <plat/devs.h>
39
39#include "usb-simtec.h" 40#include "usb-simtec.h"
40 41
41/* control power and monitor over-current events on various Simtec 42/* control power and monitor over-current events on various Simtec
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
index 919856c9433f..9e3478506c6f 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c2412/dma.c
@@ -29,8 +29,8 @@
29#include <mach/regs-mem.h> 29#include <mach/regs-mem.h>
30#include <mach/regs-lcd.h> 30#include <mach/regs-lcd.h>
31#include <mach/regs-sdi.h> 31#include <mach/regs-sdi.h>
32#include <asm/plat-s3c24xx/regs-s3c2412-iis.h> 32#include <plat/regs-s3c2412-iis.h>
33#include <asm/plat-s3c24xx/regs-iis.h> 33#include <plat/regs-iis.h>
34#include <plat/regs-spi.h> 34#include <plat/regs-spi.h>
35 35
36#define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID } 36#define MAP(x) { (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID, (x)| DMA_CH_VALID }
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index ecddbbb34832..72c266aee141 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -494,7 +494,7 @@ static int jive_pm_suspend(struct sys_device *sd, pm_message_t state)
494 * correct address to resume from. */ 494 * correct address to resume from. */
495 495
496 __raw_writel(0x2BED, S3C2412_INFORM0); 496 __raw_writel(0x2BED, S3C2412_INFORM0);
497 __raw_writel(virt_to_phys(s3c2410_cpu_resume), S3C2412_INFORM1); 497 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
498 498
499 return 0; 499 return 0;
500} 500}
@@ -630,7 +630,7 @@ static void __init jive_machine_init(void)
630 630
631 /* initialise the power management now we've setup everything. */ 631 /* initialise the power management now we've setup everything. */
632 632
633 s3c2410_pm_init(); 633 s3c_pm_init();
634 634
635 s3c_device_nand.dev.platform_data = &jive_nand_info; 635 s3c_device_nand.dev.platform_data = &jive_nand_info;
636 636
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
index 217e9e4ed45f..c9cfe40e21f6 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c2412/pm.c
@@ -85,7 +85,7 @@ static struct sleep_save s3c2412_sleep[] = {
85 85
86static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state) 86static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state)
87{ 87{
88 s3c2410_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); 88 s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
89 return 0; 89 return 0;
90} 90}
91 91
@@ -98,7 +98,7 @@ static int s3c2412_pm_resume(struct sys_device *dev)
98 tmp |= S3C2412_PWRCFG_STANDBYWFI_IDLE; 98 tmp |= S3C2412_PWRCFG_STANDBYWFI_IDLE;
99 __raw_writel(tmp, S3C2412_PWRCFG); 99 __raw_writel(tmp, S3C2412_PWRCFG);
100 100
101 s3c2410_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); 101 s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
102 return 0; 102 return 0;
103} 103}
104 104
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c2440/dma.c
index 5b5ee0b8f4e0..69b6cf34df47 100644
--- a/arch/arm/mach-s3c2440/dma.c
+++ b/arch/arm/mach-s3c2440/dma.c
@@ -28,7 +28,7 @@
28#include <mach/regs-mem.h> 28#include <mach/regs-mem.h>
29#include <mach/regs-lcd.h> 29#include <mach/regs-lcd.h>
30#include <mach/regs-sdi.h> 30#include <mach/regs-sdi.h>
31#include <asm/plat-s3c24xx/regs-iis.h> 31#include <plat/regs-iis.h>
32#include <plat/regs-spi.h> 32#include <plat/regs-spi.h>
33 33
34static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = { 34static struct s3c24xx_dma_map __initdata s3c2440_dma_mappings[] = {
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index 12d378f84ad2..bc8d8d1ebd1a 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -203,7 +203,7 @@ static void __init rx3715_init_machine(void)
203#ifdef CONFIG_PM_H1940 203#ifdef CONFIG_PM_H1940
204 memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024); 204 memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
205#endif 205#endif
206 s3c2410_pm_init(); 206 s3c_pm_init();
207 207
208 s3c24xx_fb_set_platdata(&rx3715_fb_info); 208 s3c24xx_fb_set_platdata(&rx3715_fb_info);
209 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices)); 209 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c2443/dma.c
index 2a58a4d5aa5a..8430e5829186 100644
--- a/arch/arm/mach-s3c2443/dma.c
+++ b/arch/arm/mach-s3c2443/dma.c
@@ -29,7 +29,7 @@
29#include <mach/regs-mem.h> 29#include <mach/regs-mem.h>
30#include <mach/regs-lcd.h> 30#include <mach/regs-lcd.h>
31#include <mach/regs-sdi.h> 31#include <mach/regs-sdi.h>
32#include <asm/plat-s3c24xx/regs-iis.h> 32#include <plat/regs-iis.h>
33#include <plat/regs-spi.h> 33#include <plat/regs-spi.h>
34 34
35#define MAP(x) { \ 35#define MAP(x) { \
diff --git a/arch/arm/mach-s3c24a0/include/mach/irqs.h b/arch/arm/mach-s3c24a0/include/mach/irqs.h
index ae8c0e359783..83ce2a7a9dae 100644
--- a/arch/arm/mach-s3c24a0/include/mach/irqs.h
+++ b/arch/arm/mach-s3c24a0/include/mach/irqs.h
@@ -70,6 +70,8 @@
70#define IRQ_EINT17 S3C2410_IRQ(49) 70#define IRQ_EINT17 S3C2410_IRQ(49)
71#define IRQ_EINT18 S3C2410_IRQ(50) 71#define IRQ_EINT18 S3C2410_IRQ(50)
72 72
73#define IRQ_EINT_BIT(x) ((x) - IRQ_EINT00)
74
73/* SUB IRQS */ 75/* SUB IRQS */
74#define IRQ_S3CUART_RX0 S3C2410_IRQ(51) /* 67 */ 76#define IRQ_S3CUART_RX0 S3C2410_IRQ(51) /* 67 */
75#define IRQ_S3CUART_TX0 S3C2410_IRQ(52) 77#define IRQ_S3CUART_TX0 S3C2410_IRQ(52)
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c6400/include/mach/map.h
index cff27d813fc6..baf1c0f1ea5a 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c6400/include/mach/map.h
@@ -52,6 +52,9 @@
52#define S3C64XX_PA_VIC0 (0x71200000) 52#define S3C64XX_PA_VIC0 (0x71200000)
53#define S3C64XX_PA_VIC1 (0x71300000) 53#define S3C64XX_PA_VIC1 (0x71300000)
54 54
55#define S3C64XX_PA_MODEM (0x74108000)
56#define S3C64XX_VA_MODEM S3C_ADDR(0x00600000)
57
55/* place VICs close together */ 58/* place VICs close together */
56#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) 59#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00)
57#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) 60#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
diff --git a/arch/arm/mach-s3c6400/include/mach/system.h b/arch/arm/mach-s3c6400/include/mach/system.h
index 652bbc403f0b..090cfd969bc7 100644
--- a/arch/arm/mach-s3c6400/include/mach/system.h
+++ b/arch/arm/mach-s3c6400/include/mach/system.h
@@ -16,7 +16,7 @@ static void arch_idle(void)
16 /* nothing here yet */ 16 /* nothing here yet */
17} 17}
18 18
19static void arch_reset(char mode) 19static void arch_reset(char mode, const char *cmd)
20{ 20{
21 /* nothing here yet */ 21 /* nothing here yet */
22} 22}
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index f99d9013905f..81ffff7ed498 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -71,19 +71,9 @@ config SA1100_H3600
71 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3600> 71 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3600>
72 <http://www.compaq.com/products/handhelds/pocketpc/> 72 <http://www.compaq.com/products/handhelds/pocketpc/>
73 73
74config SA1100_H3800
75 bool "Compaq iPAQ H3800"
76 help
77 Say Y here if you intend to run this kernel on the Compaq iPAQ H3800
78 series handheld computer. Information about this machine and the
79 Linux port to this machine can be found at:
80
81 <http://www.handhelds.org/Compaq/index.html#iPAQ_H3800>
82 <http://www.compaq.com/products/handhelds/pocketpc/>
83
84config SA1100_H3XXX 74config SA1100_H3XXX
85 bool 75 bool
86 depends on SA1100_H3100 || SA1100_H3600 || SA1100_H3800 76 depends on SA1100_H3100 || SA1100_H3600
87 default y 77 default y
88 78
89config SA1100_BADGE4 79config SA1100_BADGE4
@@ -157,15 +147,6 @@ config SA1100_SSP
157 This isn't for audio support, but for attached sensors and 147 This isn't for audio support, but for attached sensors and
158 other devices, eg for BadgePAD 4 sensor support. 148 other devices, eg for BadgePAD 4 sensor support.
159 149
160config H3600_SLEEVE
161 tristate "Compaq iPAQ Handheld sleeve support"
162 depends on SA1100_H3100 || SA1100_H3600
163 help
164 Choose this option to enable support for extension packs (sleeves)
165 for the Compaq iPAQ H3XXX series of handheld computers. This option
166 is required for the CF, PCMCIA, Bluetooth and GSM/GPRS extension
167 packs.
168
169endmenu 150endmenu
170 151
171endif 152endif
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 2052eb88c961..bbf2ebcc3066 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
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 29
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
@@ -145,7 +146,8 @@ static struct locomo_driver collie_uart_driver = {
145 .remove = collie_uart_remove, 146 .remove = collie_uart_remove,
146}; 147};
147 148
148static int __init collie_uart_init(void) { 149static int __init collie_uart_init(void)
150{
149 return locomo_driver_register(&collie_uart_driver); 151 return locomo_driver_register(&collie_uart_driver);
150} 152}
151device_initcall(collie_uart_init); 153device_initcall(collie_uart_init);
@@ -195,18 +197,34 @@ static struct mtd_partition collie_partitions[] = {
195 } 197 }
196}; 198};
197 199
200static int collie_flash_init(void)
201{
202 int rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable");
203 if (rc)
204 return rc;
205
206 rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1);
207 if (rc)
208 gpio_free(COLLIE_GPIO_VPEN);
209
210 return rc;
211}
212
198static void collie_set_vpp(int vpp) 213static void collie_set_vpp(int vpp)
199{ 214{
200 write_scoop_reg(&colliescoop_device.dev, SCOOP_GPCR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPCR) | COLLIE_SCP_VPEN); 215 gpio_set_value(COLLIE_GPIO_VPEN, vpp);
201 if (vpp) 216}
202 write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) | COLLIE_SCP_VPEN); 217
203 else 218static void collie_flash_exit(void)
204 write_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR, read_scoop_reg(&colliescoop_device.dev, SCOOP_GPWR) & ~COLLIE_SCP_VPEN); 219{
220 gpio_free(COLLIE_GPIO_VPEN);
205} 221}
206 222
207static struct flash_platform_data collie_flash_data = { 223static struct flash_platform_data collie_flash_data = {
208 .map_name = "cfi_probe", 224 .map_name = "cfi_probe",
225 .init = collie_flash_init,
209 .set_vpp = collie_set_vpp, 226 .set_vpp = collie_set_vpp,
227 .exit = collie_flash_exit,
210 .parts = collie_partitions, 228 .parts = collie_partitions,
211 .nr_parts = ARRAY_SIZE(collie_partitions), 229 .nr_parts = ARRAY_SIZE(collie_partitions),
212}; 230};
diff --git a/arch/arm/mach-sa1100/collie_pm.c b/arch/arm/mach-sa1100/collie_pm.c
index b39307f26b52..444f266ecc06 100644
--- a/arch/arm/mach-sa1100/collie_pm.c
+++ b/arch/arm/mach-sa1100/collie_pm.c
@@ -22,6 +22,7 @@
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/gpio.h>
25 26
26#include <asm/irq.h> 27#include <asm/irq.h>
27#include <mach/hardware.h> 28#include <mach/hardware.h>
@@ -58,6 +59,9 @@ static void collie_charger_init(void)
58 return; 59 return;
59 } 60 }
60 61
62 gpio_request(COLLIE_GPIO_CHARGE_ON, "charge on");
63 gpio_direction_output(COLLIE_GPIO_CHARGE_ON, 1);
64
61 ucb1x00_io_set_dir(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON | COLLIE_TC35143_GPIO_TMP_ON | 65 ucb1x00_io_set_dir(ucb, 0, COLLIE_TC35143_GPIO_MBAT_ON | COLLIE_TC35143_GPIO_TMP_ON |
62 COLLIE_TC35143_GPIO_BBAT_ON); 66 COLLIE_TC35143_GPIO_BBAT_ON);
63 return; 67 return;
@@ -73,17 +77,11 @@ static void collie_measure_temp(int on)
73 77
74static void collie_charge(int on) 78static void collie_charge(int on)
75{ 79{
76 extern struct platform_device colliescoop_device;
77
78 /* Zaurus seems to contain LTC1731; it should know when to 80 /* Zaurus seems to contain LTC1731; it should know when to
79 * stop charging itself, so setting charge on should be 81 * stop charging itself, so setting charge on should be
80 * relatively harmless (as long as it is not done too often). 82 * relatively harmless (as long as it is not done too often).
81 */ 83 */
82 if (on) { 84 gpio_set_value(COLLIE_GPIO_CHARGE_ON, on);
83 set_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
84 } else {
85 reset_scoop_gpio(&colliescoop_device.dev, COLLIE_SCP_CHARGE_ON);
86 }
87} 85}
88 86
89static void collie_discharge(int on) 87static void collie_discharge(int on)
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index af25a78d705d..0eb2f159578b 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -42,19 +42,12 @@
42#include <asm/mach/serial_sa1100.h> 42#include <asm/mach/serial_sa1100.h>
43 43
44#include <mach/h3600.h> 44#include <mach/h3600.h>
45
46#if defined (CONFIG_SA1100_H3600) || defined (CONFIG_SA1100_H3100)
47#include <mach/h3600_gpio.h> 45#include <mach/h3600_gpio.h>
48#endif
49
50#ifdef CONFIG_SA1100_H3800
51#include <mach/h3600_asic.h>
52#endif
53 46
54#include "generic.h" 47#include "generic.h"
55 48
56struct ipaq_model_ops ipaq_model_ops; 49void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level);
57EXPORT_SYMBOL(ipaq_model_ops); 50EXPORT_SYMBOL(assign_h3600_egpio);
58 51
59static struct mtd_partition h3xxx_partitions[] = { 52static struct mtd_partition h3xxx_partitions[] = {
60 { 53 {
@@ -63,41 +56,9 @@ static struct mtd_partition h3xxx_partitions[] = {
63 .offset = 0, 56 .offset = 0,
64 .mask_flags = MTD_WRITEABLE, /* force read-only */ 57 .mask_flags = MTD_WRITEABLE, /* force read-only */
65 }, { 58 }, {
66#ifdef CONFIG_MTD_2PARTS_IPAQ 59 .name = "H3XXX rootfs",
67 .name = "H3XXX root jffs2",
68 .size = MTDPART_SIZ_FULL, 60 .size = MTDPART_SIZ_FULL,
69 .offset = 0x00040000, 61 .offset = 0x00040000,
70#else
71 .name = "H3XXX kernel",
72 .size = 0x00080000,
73 .offset = 0x00040000,
74 }, {
75 .name = "H3XXX params",
76 .size = 0x00040000,
77 .offset = 0x000C0000,
78 }, {
79#ifdef CONFIG_JFFS2_FS
80 .name = "H3XXX root jffs2",
81 .size = MTDPART_SIZ_FULL,
82 .offset = 0x00100000,
83#else
84 .name = "H3XXX initrd",
85 .size = 0x00100000,
86 .offset = 0x00100000,
87 }, {
88 .name = "H3XXX root cramfs",
89 .size = 0x00300000,
90 .offset = 0x00200000,
91 }, {
92 .name = "H3XXX usr cramfs",
93 .size = 0x00800000,
94 .offset = 0x00500000,
95 }, {
96 .name = "H3XXX usr local",
97 .size = MTDPART_SIZ_FULL,
98 .offset = 0x00d00000,
99#endif
100#endif
101 } 62 }
102}; 63};
103 64
@@ -131,11 +92,7 @@ static int h3600_irda_set_power(struct device *dev, unsigned int state)
131 92
132static void h3600_irda_set_speed(struct device *dev, unsigned int speed) 93static void h3600_irda_set_speed(struct device *dev, unsigned int speed)
133{ 94{
134 if (speed < 4000000) { 95 assign_h3600_egpio(IPAQ_EGPIO_IR_FSEL, !(speed < 4000000));
135 clr_h3600_egpio(IPAQ_EGPIO_IR_FSEL);
136 } else {
137 set_h3600_egpio(IPAQ_EGPIO_IR_FSEL);
138 }
139} 96}
140 97
141static struct irda_platform_data h3600_irda_data = { 98static struct irda_platform_data h3600_irda_data = {
@@ -266,12 +223,6 @@ static void __init h3xxx_map_io(void)
266 sa1100fb_lcd_power = h3xxx_lcd_power; 223 sa1100fb_lcd_power = h3xxx_lcd_power;
267} 224}
268 225
269static __inline__ void do_blank(int setp)
270{
271 if (ipaq_model_ops.blank_callback)
272 ipaq_model_ops.blank_callback(1-setp);
273}
274
275/************************* H3100 *************************/ 226/************************* H3100 *************************/
276 227
277#ifdef CONFIG_SA1100_H3100 228#ifdef CONFIG_SA1100_H3100
@@ -289,7 +240,6 @@ static void h3100_control_egpio(enum ipaq_egpio_type x, int setp)
289 case IPAQ_EGPIO_LCD_POWER: 240 case IPAQ_EGPIO_LCD_POWER:
290 egpio |= EGPIO_H3600_LCD_ON; 241 egpio |= EGPIO_H3600_LCD_ON;
291 gpio |= GPIO_H3100_LCD_3V_ON; 242 gpio |= GPIO_H3100_LCD_3V_ON;
292 do_blank(setp);
293 break; 243 break;
294 case IPAQ_EGPIO_LCD_ENABLE: 244 case IPAQ_EGPIO_LCD_ENABLE:
295 break; 245 break;
@@ -343,25 +293,6 @@ static void h3100_control_egpio(enum ipaq_egpio_type x, int setp)
343 } 293 }
344} 294}
345 295
346static unsigned long h3100_read_egpio(void)
347{
348 return h3100_egpio;
349}
350
351static int h3100_pm_callback(int req)
352{
353 if (ipaq_model_ops.pm_callback_aux)
354 return ipaq_model_ops.pm_callback_aux(req);
355 return 0;
356}
357
358static struct ipaq_model_ops h3100_model_ops __initdata = {
359 .generic_name = "3100",
360 .control = h3100_control_egpio,
361 .read = h3100_read_egpio,
362 .pm_callback = h3100_pm_callback
363};
364
365#define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \ 296#define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \
366 | GPIO_H3100_GPIO3 \ 297 | GPIO_H3100_GPIO3 \
367 | GPIO_H3100_QMUTE \ 298 | GPIO_H3100_QMUTE \
@@ -387,7 +318,7 @@ static void __init h3100_map_io(void)
387 GAFR &= ~H3100_DIRECT_EGPIO; 318 GAFR &= ~H3100_DIRECT_EGPIO;
388 319
389 H3100_EGPIO = h3100_egpio; 320 H3100_EGPIO = h3100_egpio;
390 ipaq_model_ops = h3100_model_ops; 321 assign_h3600_egpio = h3100_control_egpio;
391} 322}
392 323
393MACHINE_START(H3100, "Compaq iPAQ H3100") 324MACHINE_START(H3100, "Compaq iPAQ H3100")
@@ -420,7 +351,6 @@ static void h3600_control_egpio(enum ipaq_egpio_type x, int setp)
420 EGPIO_H3600_LCD_PCI | 351 EGPIO_H3600_LCD_PCI |
421 EGPIO_H3600_LCD_5V_ON | 352 EGPIO_H3600_LCD_5V_ON |
422 EGPIO_H3600_LVDD_ON; 353 EGPIO_H3600_LVDD_ON;
423 do_blank(setp);
424 break; 354 break;
425 case IPAQ_EGPIO_LCD_ENABLE: 355 case IPAQ_EGPIO_LCD_ENABLE:
426 break; 356 break;
@@ -471,25 +401,6 @@ static void h3600_control_egpio(enum ipaq_egpio_type x, int setp)
471 } 401 }
472} 402}
473 403
474static unsigned long h3600_read_egpio(void)
475{
476 return h3600_egpio;
477}
478
479static int h3600_pm_callback(int req)
480{
481 if (ipaq_model_ops.pm_callback_aux)
482 return ipaq_model_ops.pm_callback_aux(req);
483 return 0;
484}
485
486static struct ipaq_model_ops h3600_model_ops __initdata = {
487 .generic_name = "3600",
488 .control = h3600_control_egpio,
489 .read = h3600_read_egpio,
490 .pm_callback = h3600_pm_callback
491};
492
493static void __init h3600_map_io(void) 404static void __init h3600_map_io(void)
494{ 405{
495 h3xxx_map_io(); 406 h3xxx_map_io();
@@ -504,7 +415,7 @@ static void __init h3600_map_io(void)
504 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8; 415 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
505 416
506 H3600_EGPIO = h3600_egpio; /* Maintains across sleep? */ 417 H3600_EGPIO = h3600_egpio; /* Maintains across sleep? */
507 ipaq_model_ops = h3600_model_ops; 418 assign_h3600_egpio = h3600_control_egpio;
508} 419}
509 420
510MACHINE_START(H3600, "Compaq iPAQ H3600") 421MACHINE_START(H3600, "Compaq iPAQ H3600")
@@ -519,388 +430,3 @@ MACHINE_END
519 430
520#endif /* CONFIG_SA1100_H3600 */ 431#endif /* CONFIG_SA1100_H3600 */
521 432
522#ifdef CONFIG_SA1100_H3800
523
524#define SET_ASIC1(x) \
525 do {if (setp) { H3800_ASIC1_GPIO_OUT |= (x); } else { H3800_ASIC1_GPIO_OUT &= ~(x); }} while(0)
526
527#define SET_ASIC2(x) \
528 do {if (setp) { H3800_ASIC2_GPIOPIOD |= (x); } else { H3800_ASIC2_GPIOPIOD &= ~(x); }} while(0)
529
530#define CLEAR_ASIC1(x) \
531 do {if (setp) { H3800_ASIC1_GPIO_OUT &= ~(x); } else { H3800_ASIC1_GPIO_OUT |= (x); }} while(0)
532
533#define CLEAR_ASIC2(x) \
534 do {if (setp) { H3800_ASIC2_GPIOPIOD &= ~(x); } else { H3800_ASIC2_GPIOPIOD |= (x); }} while(0)
535
536
537/*
538 On screen enable, we get
539
540 h3800_video_power_on(1)
541 LCD controller starts
542 h3800_video_lcd_enable(1)
543
544 On screen disable, we get
545
546 h3800_video_lcd_enable(0)
547 LCD controller stops
548 h3800_video_power_on(0)
549*/
550
551
552static void h3800_video_power_on(int setp)
553{
554 if (setp) {
555 H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_ON;
556 msleep(30);
557 H3800_ASIC1_GPIO_OUT |= GPIO1_VGL_ON;
558 msleep(5);
559 H3800_ASIC1_GPIO_OUT |= GPIO1_VGH_ON;
560 msleep(50);
561 H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_5V_ON;
562 msleep(5);
563 } else {
564 msleep(5);
565 H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_5V_ON;
566 msleep(50);
567 H3800_ASIC1_GPIO_OUT &= ~GPIO1_VGL_ON;
568 msleep(5);
569 H3800_ASIC1_GPIO_OUT &= ~GPIO1_VGH_ON;
570 msleep(100);
571 H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_ON;
572 }
573}
574
575static void h3800_video_lcd_enable(int setp)
576{
577 if (setp) {
578 msleep(17); // Wait one from before turning on
579 H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_PCI;
580 } else {
581 H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_PCI;
582 msleep(30); // Wait before turning off
583 }
584}
585
586
587static void h3800_control_egpio(enum ipaq_egpio_type x, int setp)
588{
589 switch (x) {
590 case IPAQ_EGPIO_LCD_POWER:
591 h3800_video_power_on(setp);
592 break;
593 case IPAQ_EGPIO_LCD_ENABLE:
594 h3800_video_lcd_enable(setp);
595 break;
596 case IPAQ_EGPIO_CODEC_NRESET:
597 case IPAQ_EGPIO_AUDIO_ON:
598 case IPAQ_EGPIO_QMUTE:
599 printk("%s: error - should not be called\n", __func__);
600 break;
601 case IPAQ_EGPIO_OPT_NVRAM_ON:
602 SET_ASIC2(GPIO2_OPT_ON_NVRAM);
603 break;
604 case IPAQ_EGPIO_OPT_ON:
605 SET_ASIC2(GPIO2_OPT_ON);
606 break;
607 case IPAQ_EGPIO_CARD_RESET:
608 SET_ASIC2(GPIO2_OPT_PCM_RESET);
609 break;
610 case IPAQ_EGPIO_OPT_RESET:
611 SET_ASIC2(GPIO2_OPT_RESET);
612 break;
613 case IPAQ_EGPIO_IR_ON:
614 CLEAR_ASIC1(GPIO1_IR_ON_N);
615 break;
616 case IPAQ_EGPIO_IR_FSEL:
617 break;
618 case IPAQ_EGPIO_RS232_ON:
619 SET_ASIC1(GPIO1_RS232_ON);
620 break;
621 case IPAQ_EGPIO_VPP_ON:
622 H3800_ASIC2_FlashWP_VPP_ON = setp;
623 break;
624 }
625}
626
627static unsigned long h3800_read_egpio(void)
628{
629 return H3800_ASIC1_GPIO_OUT | (H3800_ASIC2_GPIOPIOD << 16);
630}
631
632/* We need to fix ASIC2 GPIO over suspend/resume. At the moment,
633 it doesn't appear that ASIC1 GPIO has the same problem */
634
635static int h3800_pm_callback(int req)
636{
637 static u16 asic1_data;
638 static u16 asic2_data;
639 int result = 0;
640
641 printk("%s %d\n", __func__, req);
642
643 switch (req) {
644 case PM_RESUME:
645 MSC2 = (MSC2 & 0x0000ffff) | 0xE4510000; /* Set MSC2 correctly */
646
647 H3800_ASIC2_GPIOPIOD = asic2_data;
648 H3800_ASIC2_GPIODIR = GPIO2_PEN_IRQ
649 | GPIO2_SD_DETECT
650 | GPIO2_EAR_IN_N
651 | GPIO2_USB_DETECT_N
652 | GPIO2_SD_CON_SLT;
653
654 H3800_ASIC1_GPIO_OUT = asic1_data;
655
656 if (ipaq_model_ops.pm_callback_aux)
657 result = ipaq_model_ops.pm_callback_aux(req);
658 break;
659
660 case PM_SUSPEND:
661 if (ipaq_model_ops.pm_callback_aux &&
662 ((result = ipaq_model_ops.pm_callback_aux(req)) != 0))
663 return result;
664
665 asic1_data = H3800_ASIC1_GPIO_OUT;
666 asic2_data = H3800_ASIC2_GPIOPIOD;
667 break;
668 default:
669 printk("%s: unrecognized PM callback\n", __func__);
670 break;
671 }
672 return result;
673}
674
675static struct ipaq_model_ops h3800_model_ops __initdata = {
676 .generic_name = "3800",
677 .control = h3800_control_egpio,
678 .read = h3800_read_egpio,
679 .pm_callback = h3800_pm_callback
680};
681
682#define MAX_ASIC_ISR_LOOPS 20
683
684/* The order of these is important - see #include <mach/irqs.h> */
685static u32 kpio_irq_mask[] = {
686 KPIO_KEY_ALL,
687 KPIO_SPI_INT,
688 KPIO_OWM_INT,
689 KPIO_ADC_INT,
690 KPIO_UART_0_INT,
691 KPIO_UART_1_INT,
692 KPIO_TIMER_0_INT,
693 KPIO_TIMER_1_INT,
694 KPIO_TIMER_2_INT
695};
696
697static u32 gpio_irq_mask[] = {
698 GPIO2_PEN_IRQ,
699 GPIO2_SD_DETECT,
700 GPIO2_EAR_IN_N,
701 GPIO2_USB_DETECT_N,
702 GPIO2_SD_CON_SLT,
703};
704
705static void h3800_IRQ_demux(unsigned int irq, struct irq_desc *desc)
706{
707 int i;
708
709 if (0) printk("%s: interrupt received\n", __func__);
710
711 desc->chip->ack(irq);
712
713 for (i = 0; i < MAX_ASIC_ISR_LOOPS && (GPLR & GPIO_H3800_ASIC); i++) {
714 u32 irq;
715 int j;
716
717 /* KPIO */
718 irq = H3800_ASIC2_KPIINTFLAG;
719 if (0) printk("%s KPIO 0x%08X\n", __func__, irq);
720 for (j = 0; j < H3800_KPIO_IRQ_COUNT; j++)
721 if (irq & kpio_irq_mask[j])
722 handle_edge_irq(H3800_KPIO_IRQ_COUNT + j, irq_desc + H3800_KPIO_IRQ_COUNT + j);
723
724 /* GPIO2 */
725 irq = H3800_ASIC2_GPIINTFLAG;
726 if (0) printk("%s GPIO 0x%08X\n", __func__, irq);
727 for (j = 0; j < H3800_GPIO_IRQ_COUNT; j++)
728 if (irq & gpio_irq_mask[j])
729 handle_edge_irq(H3800_GPIO_IRQ_COUNT + j, irq_desc + H3800_GPIO_IRQ_COUNT + j);
730 }
731
732 if (i >= MAX_ASIC_ISR_LOOPS)
733 printk("%s: interrupt processing overrun\n", __func__);
734
735 /* For level-based interrupts */
736 desc->chip->unmask(irq);
737
738}
739
740static struct irqaction h3800_irq = {
741 .name = "h3800_asic",
742 .handler = h3800_IRQ_demux,
743 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
744};
745
746u32 kpio_int_shadow = 0;
747
748
749/* mask_ack <- IRQ is first serviced.
750 mask <- IRQ is disabled.
751 unmask <- IRQ is enabled
752
753 The INTCLR registers are poorly documented. I believe that writing
754 a "1" to the register clears the specific interrupt, but the documentation
755 indicates writing a "0" clears the interrupt. In any case, they shouldn't
756 be read (that's the INTFLAG register)
757 */
758
759static void h3800_mask_ack_kpio_irq(unsigned int irq)
760{
761 u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START];
762 kpio_int_shadow &= ~mask;
763 H3800_ASIC2_KPIINTSTAT = kpio_int_shadow;
764 H3800_ASIC2_KPIINTCLR = mask;
765}
766
767static void h3800_mask_kpio_irq(unsigned int irq)
768{
769 u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START];
770 kpio_int_shadow &= ~mask;
771 H3800_ASIC2_KPIINTSTAT = kpio_int_shadow;
772}
773
774static void h3800_unmask_kpio_irq(unsigned int irq)
775{
776 u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START];
777 kpio_int_shadow |= mask;
778 H3800_ASIC2_KPIINTSTAT = kpio_int_shadow;
779}
780
781static void h3800_mask_ack_gpio_irq(unsigned int irq)
782{
783 u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START];
784 H3800_ASIC2_GPIINTSTAT &= ~mask;
785 H3800_ASIC2_GPIINTCLR = mask;
786}
787
788static void h3800_mask_gpio_irq(unsigned int irq)
789{
790 u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START];
791 H3800_ASIC2_GPIINTSTAT &= ~mask;
792 }
793
794static void h3800_unmask_gpio_irq(unsigned int irq)
795{
796 u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START];
797 H3800_ASIC2_GPIINTSTAT |= mask;
798}
799
800static void __init h3800_init_irq(void)
801{
802 int i;
803
804 /* Initialize standard IRQs */
805 sa1100_init_irq();
806
807 /* Disable all IRQs and set up clock */
808 H3800_ASIC2_KPIINTSTAT = 0; /* Disable all interrupts */
809 H3800_ASIC2_GPIINTSTAT = 0;
810
811 H3800_ASIC2_KPIINTCLR = 0; /* Clear all KPIO interrupts */
812 H3800_ASIC2_GPIINTCLR = 0; /* Clear all GPIO interrupts */
813
814// H3800_ASIC2_KPIINTCLR = 0xffff; /* Clear all KPIO interrupts */
815// H3800_ASIC2_GPIINTCLR = 0xffff; /* Clear all GPIO interrupts */
816
817 H3800_ASIC2_CLOCK_Enable |= ASIC2_CLOCK_EX0; /* 32 kHZ crystal on */
818 H3800_ASIC2_INTR_ClockPrescale |= ASIC2_INTCPS_SET;
819 H3800_ASIC2_INTR_ClockPrescale = ASIC2_INTCPS_CPS(0x0e) | ASIC2_INTCPS_SET;
820 H3800_ASIC2_INTR_TimerSet = 1;
821
822#if 0
823 for (i = 0; i < H3800_KPIO_IRQ_COUNT; i++) {
824 int irq = i + H3800_KPIO_IRQ_START;
825 irq_desc[irq].valid = 1;
826 irq_desc[irq].probe_ok = 1;
827 set_irq_chip(irq, &h3800_kpio_irqchip);
828 }
829
830 for (i = 0; i < H3800_GPIO_IRQ_COUNT; i++) {
831 int irq = i + H3800_GPIO_IRQ_START;
832 irq_desc[irq].valid = 1;
833 irq_desc[irq].probe_ok = 1;
834 set_irq_chip(irq, &h3800_gpio_irqchip);
835 }
836#endif
837 set_irq_type(IRQ_GPIO_H3800_ASIC, IRQ_TYPE_EDGE_RISING);
838 set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, h3800_IRQ_demux);
839}
840
841
842#define ASIC1_OUTPUTS 0x7fff /* First 15 bits are used */
843
844static void __init h3800_map_io(void)
845{
846 h3xxx_map_io();
847
848 /* Add wakeup on AC plug/unplug */
849 PWER |= PWER_GPIO12;
850
851 /* Initialize h3800-specific values here */
852 GPCR = 0x0fffffff; /* All outputs are set low by default */
853 GAFR = GPIO_H3800_CLK_OUT |
854 GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 |
855 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
856 GPDR = GPIO_H3800_CLK_OUT |
857 GPIO_H3600_COM_RTS | GPIO_H3600_L3_CLOCK |
858 GPIO_H3600_L3_MODE | GPIO_H3600_L3_DATA |
859 GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 |
860 GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8;
861 TUCR = TUCR_3_6864MHz; /* Seems to be used only for the Bluetooth UART */
862
863 /* Fix the memory bus */
864 MSC2 = (MSC2 & 0x0000ffff) | 0xE4510000;
865
866 /* Set up ASIC #1 */
867 H3800_ASIC1_GPIO_DIR = ASIC1_OUTPUTS; /* All outputs */
868 H3800_ASIC1_GPIO_MASK = ASIC1_OUTPUTS; /* No interrupts */
869 H3800_ASIC1_GPIO_SLEEP_MASK = ASIC1_OUTPUTS;
870 H3800_ASIC1_GPIO_SLEEP_DIR = ASIC1_OUTPUTS;
871 H3800_ASIC1_GPIO_SLEEP_OUT = GPIO1_EAR_ON_N;
872 H3800_ASIC1_GPIO_BATT_FAULT_DIR = ASIC1_OUTPUTS;
873 H3800_ASIC1_GPIO_BATT_FAULT_OUT = GPIO1_EAR_ON_N;
874
875 H3800_ASIC1_GPIO_OUT = GPIO1_IR_ON_N
876 | GPIO1_RS232_ON
877 | GPIO1_EAR_ON_N;
878
879 /* Set up ASIC #2 */
880 H3800_ASIC2_GPIOPIOD = GPIO2_IN_Y1_N | GPIO2_IN_X1_N;
881 H3800_ASIC2_GPOBFSTAT = GPIO2_IN_Y1_N | GPIO2_IN_X1_N;
882
883 H3800_ASIC2_GPIODIR = GPIO2_PEN_IRQ
884 | GPIO2_SD_DETECT
885 | GPIO2_EAR_IN_N
886 | GPIO2_USB_DETECT_N
887 | GPIO2_SD_CON_SLT;
888
889 /* TODO : Set sleep states & battery fault states */
890
891 /* Clear VPP Enable */
892 H3800_ASIC2_FlashWP_VPP_ON = 0;
893 ipaq_model_ops = h3800_model_ops;
894}
895
896MACHINE_START(H3800, "Compaq iPAQ H3800")
897 .phys_io = 0x80000000,
898 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
899 .boot_params = 0xc0000100,
900 .map_io = h3800_map_io,
901 .init_irq = h3800_init_irq,
902 .timer = &sa1100_timer,
903 .init_machine = h3xxx_mach_init,
904MACHINE_END
905
906#endif /* CONFIG_SA1100_H3800 */
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index 69e962416e3f..9efb569cdb60 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -14,21 +14,21 @@
14#define __ASM_ARCH_COLLIE_H 14#define __ASM_ARCH_COLLIE_H
15 15
16 16
17#define COLLIE_SCP_CHARGE_ON SCOOP_GPCR_PA11 17#define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1)
18#define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE + 0)
18#define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 19#define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12
19#define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 20#define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13
20#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14 21#define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14
21#define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15 22#define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15
22#define COLLIE_SCP_5VON SCOOP_GPCR_PA16 23#define COLLIE_SCP_5VON SCOOP_GPCR_PA16
23#define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17 24#define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17
24#define COLLIE_SCP_VPEN SCOOP_GPCR_PA18 25#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)
25#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 26#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19
26 27
27#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_CHARGE_ON | COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ 28#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \
28 COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | COLLIE_SCP_VPEN | \ 29 COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \
29 COLLIE_SCP_LB_VOL_CHG ) 30 COLLIE_SCP_LB_VOL_CHG )
30#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | COLLIE_SCP_VPEN | \ 31#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R )
31 COLLIE_SCP_CHARGE_ON )
32 32
33/* GPIOs for which the generic definition doesn't say much */ 33/* GPIOs for which the generic definition doesn't say much */
34 34
diff --git a/arch/arm/mach-sa1100/include/mach/h3600.h b/arch/arm/mach-sa1100/include/mach/h3600.h
index 9cc47fddb335..2827faa47421 100644
--- a/arch/arm/mach-sa1100/include/mach/h3600.h
+++ b/arch/arm/mach-sa1100/include/mach/h3600.h
@@ -29,7 +29,7 @@ typedef int __bitwise pm_request_t;
29#define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */ 29#define PM_RESUME ((__force pm_request_t) 2) /* enter D0 */
30 30
31/* generalized support for H3xxx series Compaq Pocket PC's */ 31/* generalized support for H3xxx series Compaq Pocket PC's */
32#define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600() || machine_is_h3800()) 32#define machine_is_h3xxx() (machine_is_h3100() || machine_is_h3600())
33 33
34/* Physical memory regions corresponding to chip selects */ 34/* Physical memory regions corresponding to chip selects */
35#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000) 35#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000)
@@ -93,76 +93,7 @@ enum ipaq_egpio_type {
93 IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */ 93 IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */
94}; 94};
95 95
96struct ipaq_model_ops { 96extern void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level);
97 const char *generic_name;
98 void (*control)(enum ipaq_egpio_type, int);
99 unsigned long (*read)(void);
100 void (*blank_callback)(int blank);
101 int (*pm_callback)(int req); /* Primary model callback */
102 int (*pm_callback_aux)(int req); /* Secondary callback (used by HAL modules) */
103};
104
105extern struct ipaq_model_ops ipaq_model_ops;
106
107static __inline__ const char * h3600_generic_name(void)
108{
109 return ipaq_model_ops.generic_name;
110}
111
112static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level)
113{
114 if (ipaq_model_ops.control)
115 ipaq_model_ops.control(x,level);
116}
117
118static __inline__ void clr_h3600_egpio(enum ipaq_egpio_type x)
119{
120 if (ipaq_model_ops.control)
121 ipaq_model_ops.control(x,0);
122}
123
124static __inline__ void set_h3600_egpio(enum ipaq_egpio_type x)
125{
126 if (ipaq_model_ops.control)
127 ipaq_model_ops.control(x,1);
128}
129
130static __inline__ unsigned long read_h3600_egpio(void)
131{
132 if (ipaq_model_ops.read)
133 return ipaq_model_ops.read();
134 return 0;
135}
136
137static __inline__ int h3600_register_blank_callback(void (*f)(int))
138{
139 ipaq_model_ops.blank_callback = f;
140 return 0;
141}
142
143static __inline__ void h3600_unregister_blank_callback(void (*f)(int))
144{
145 ipaq_model_ops.blank_callback = NULL;
146}
147
148
149static __inline__ int h3600_register_pm_callback(int (*f)(int))
150{
151 ipaq_model_ops.pm_callback_aux = f;
152 return 0;
153}
154
155static __inline__ void h3600_unregister_pm_callback(int (*f)(int))
156{
157 ipaq_model_ops.pm_callback_aux = NULL;
158}
159
160static __inline__ int h3600_power_management(int req)
161{
162 if (ipaq_model_ops.pm_callback)
163 return ipaq_model_ops.pm_callback(req);
164 return 0;
165}
166 97
167#endif /* ASSEMBLY */ 98#endif /* ASSEMBLY */
168 99
diff --git a/arch/arm/mach-sa1100/include/mach/h3600_gpio.h b/arch/arm/mach-sa1100/include/mach/h3600_gpio.h
index 62b0b7879685..a36ca76d018b 100644
--- a/arch/arm/mach-sa1100/include/mach/h3600_gpio.h
+++ b/arch/arm/mach-sa1100/include/mach/h3600_gpio.h
@@ -48,22 +48,11 @@
48#define GPIO_H3600_OPT_LOCK GPIO_GPIO (22) 48#define GPIO_H3600_OPT_LOCK GPIO_GPIO (22)
49#define GPIO_H3600_OPT_DET GPIO_GPIO (27) 49#define GPIO_H3600_OPT_DET GPIO_GPIO (27)
50 50
51/* H3800 specific pins */
52#define GPIO_H3800_AC_IN GPIO_GPIO (12)
53#define GPIO_H3800_COM_DSR GPIO_GPIO (13)
54#define GPIO_H3800_MMC_INT GPIO_GPIO (18)
55#define GPIO_H3800_NOPT_IND GPIO_GPIO (20) /* Almost exactly the same as GPIO_H3600_OPT_DET */
56#define GPIO_H3800_OPT_BAT_FAULT GPIO_GPIO (22)
57#define GPIO_H3800_CLK_OUT GPIO_GPIO (27)
58
59/****************************************************/ 51/****************************************************/
60 52
61#define IRQ_GPIO_H3600_ACTION_BUTTON IRQ_GPIO18 53#define IRQ_GPIO_H3600_ACTION_BUTTON IRQ_GPIO18
62#define IRQ_GPIO_H3600_OPT_DET IRQ_GPIO27 54#define IRQ_GPIO_H3600_OPT_DET IRQ_GPIO27
63 55
64#define IRQ_GPIO_H3800_MMC_INT IRQ_GPIO18
65#define IRQ_GPIO_H3800_NOPT_IND IRQ_GPIO20 /* almost same as OPT_DET */
66
67/* H3100 / 3600 EGPIO pins */ 56/* H3100 / 3600 EGPIO pins */
68#define EGPIO_H3600_VPP_ON (1 << 0) 57#define EGPIO_H3600_VPP_ON (1 << 0)
69#define EGPIO_H3600_CARD_RESET (1 << 1) /* reset the attached pcmcia/compactflash card. active high. */ 58#define EGPIO_H3600_CARD_RESET (1 << 1) /* reset the attached pcmcia/compactflash card. active high. */
@@ -84,457 +73,5 @@
84#define EGPIO_H3600_LCD_5V_ON (1 << 14) /* enable 5V to LCD. active high. */ 73#define EGPIO_H3600_LCD_5V_ON (1 << 14) /* enable 5V to LCD. active high. */
85#define EGPIO_H3600_LVDD_ON (1 << 15) /* enable 9V and -6.5V to LCD. */ 74#define EGPIO_H3600_LVDD_ON (1 << 15) /* enable 9V and -6.5V to LCD. */
86 75
87/********************* H3800, ASIC #2 ********************/
88
89#define _H3800_ASIC2_Base (H3600_EGPIO_VIRT)
90#define H3800_ASIC2_OFFSET(s,x,y) \
91 (*((volatile s *) (_H3800_ASIC2_Base + _H3800_ASIC2_ ## x ## _Base + _H3800_ASIC2_ ## x ## _ ## y)))
92#define H3800_ASIC2_NOFFSET(s,x,n,y) \
93 (*((volatile s *) (_H3800_ASIC2_Base + _H3800_ASIC2_ ## x ## _ ## n ## _Base + _H3800_ASIC2_ ## x ## _ ## y)))
94
95#define _H3800_ASIC2_GPIO_Base 0x0000
96#define _H3800_ASIC2_GPIO_Direction 0x0000 /* R/W, 16 bits 1:input, 0:output */
97#define _H3800_ASIC2_GPIO_InterruptType 0x0004 /* R/W, 12 bits 1:edge, 0:level */
98#define _H3800_ASIC2_GPIO_InterruptEdgeType 0x0008 /* R/W, 12 bits 1:rising, 0:falling */
99#define _H3800_ASIC2_GPIO_InterruptLevelType 0x000C /* R/W, 12 bits 1:high, 0:low */
100#define _H3800_ASIC2_GPIO_InterruptClear 0x0010 /* W, 12 bits */
101#define _H3800_ASIC2_GPIO_InterruptFlag 0x0010 /* R, 12 bits - reads int status */
102#define _H3800_ASIC2_GPIO_Data 0x0014 /* R/W, 16 bits */
103#define _H3800_ASIC2_GPIO_BattFaultOut 0x0018 /* R/W, 16 bit - sets level on batt fault */
104#define _H3800_ASIC2_GPIO_InterruptEnable 0x001c /* R/W, 12 bits 1:enable interrupt */
105#define _H3800_ASIC2_GPIO_Alternate 0x003c /* R/W, 12+1 bits - set alternate functions */
106
107#define H3800_ASIC2_GPIO_Direction H3800_ASIC2_OFFSET( u16, GPIO, Direction )
108#define H3800_ASIC2_GPIO_InterruptType H3800_ASIC2_OFFSET( u16, GPIO, InterruptType )
109#define H3800_ASIC2_GPIO_InterruptEdgeType H3800_ASIC2_OFFSET( u16, GPIO, InterruptEdgeType )
110#define H3800_ASIC2_GPIO_InterruptLevelType H3800_ASIC2_OFFSET( u16, GPIO, InterruptLevelType )
111#define H3800_ASIC2_GPIO_InterruptClear H3800_ASIC2_OFFSET( u16, GPIO, InterruptClear )
112#define H3800_ASIC2_GPIO_InterruptFlag H3800_ASIC2_OFFSET( u16, GPIO, InterruptFlag )
113#define H3800_ASIC2_GPIO_Data H3800_ASIC2_OFFSET( u16, GPIO, Data )
114#define H3800_ASIC2_GPIO_BattFaultOut H3800_ASIC2_OFFSET( u16, GPIO, BattFaultOut )
115#define H3800_ASIC2_GPIO_InterruptEnable H3800_ASIC2_OFFSET( u16, GPIO, InterruptEnable )
116#define H3800_ASIC2_GPIO_Alternate H3800_ASIC2_OFFSET( u16, GPIO, Alternate )
117
118#define GPIO_H3800_ASIC2_IN_Y1_N (1 << 0) /* Output: Touchscreen Y1 */
119#define GPIO_H3800_ASIC2_IN_X0 (1 << 1) /* Output: Touchscreen X0 */
120#define GPIO_H3800_ASIC2_IN_Y0 (1 << 2) /* Output: Touchscreen Y0 */
121#define GPIO_H3800_ASIC2_IN_X1_N (1 << 3) /* Output: Touchscreen X1 */
122#define GPIO_H3800_ASIC2_BT_RST (1 << 4) /* Output: Bluetooth reset */
123#define GPIO_H3800_ASIC2_PEN_IRQ (1 << 5) /* Input : Pen down */
124#define GPIO_H3800_ASIC2_SD_DETECT (1 << 6) /* Input : SD detect */
125#define GPIO_H3800_ASIC2_EAR_IN_N (1 << 7) /* Input : Audio jack plug inserted */
126#define GPIO_H3800_ASIC2_OPT_PCM_RESET (1 << 8) /* Output: */
127#define GPIO_H3800_ASIC2_OPT_RESET (1 << 9) /* Output: */
128#define GPIO_H3800_ASIC2_USB_DETECT_N (1 << 10) /* Input : */
129#define GPIO_H3800_ASIC2_SD_CON_SLT (1 << 11) /* Input : */
130
131#define _H3800_ASIC2_KPIO_Base 0x0200
132#define _H3800_ASIC2_KPIO_Direction 0x0000 /* R/W, 12 bits 1:input, 0:output */
133#define _H3800_ASIC2_KPIO_InterruptType 0x0004 /* R/W, 12 bits 1:edge, 0:level */
134#define _H3800_ASIC2_KPIO_InterruptEdgeType 0x0008 /* R/W, 12 bits 1:rising, 0:falling */
135#define _H3800_ASIC2_KPIO_InterruptLevelType 0x000C /* R/W, 12 bits 1:high, 0:low */
136#define _H3800_ASIC2_KPIO_InterruptClear 0x0010 /* W, 20 bits - 8 special */
137#define _H3800_ASIC2_KPIO_InterruptFlag 0x0010 /* R, 20 bits - 8 special - reads int status */
138#define _H3800_ASIC2_KPIO_Data 0x0014 /* R/W, 16 bits */
139#define _H3800_ASIC2_KPIO_BattFaultOut 0x0018 /* R/W, 16 bit - sets level on batt fault */
140#define _H3800_ASIC2_KPIO_InterruptEnable 0x001c /* R/W, 20 bits - 8 special */
141#define _H3800_ASIC2_KPIO_Alternate 0x003c /* R/W, 6 bits */
142
143#define H3800_ASIC2_KPIO_Direction H3800_ASIC2_OFFSET( u16, KPIO, Direction )
144#define H3800_ASIC2_KPIO_InterruptType H3800_ASIC2_OFFSET( u16, KPIO, InterruptType )
145#define H3800_ASIC2_KPIO_InterruptEdgeType H3800_ASIC2_OFFSET( u16, KPIO, InterruptEdgeType )
146#define H3800_ASIC2_KPIO_InterruptLevelType H3800_ASIC2_OFFSET( u16, KPIO, InterruptLevelType )
147#define H3800_ASIC2_KPIO_InterruptClear H3800_ASIC2_OFFSET( u32, KPIO, InterruptClear )
148#define H3800_ASIC2_KPIO_InterruptFlag H3800_ASIC2_OFFSET( u32, KPIO, InterruptFlag )
149#define H3800_ASIC2_KPIO_Data H3800_ASIC2_OFFSET( u16, KPIO, Data )
150#define H3800_ASIC2_KPIO_BattFaultOut H3800_ASIC2_OFFSET( u16, KPIO, BattFaultOut )
151#define H3800_ASIC2_KPIO_InterruptEnable H3800_ASIC2_OFFSET( u32, KPIO, InterruptEnable )
152#define H3800_ASIC2_KPIO_Alternate H3800_ASIC2_OFFSET( u16, KPIO, Alternate )
153
154#define H3800_ASIC2_KPIO_SPI_INT ( 1 << 16 )
155#define H3800_ASIC2_KPIO_OWM_INT ( 1 << 17 )
156#define H3800_ASIC2_KPIO_ADC_INT ( 1 << 18 )
157#define H3800_ASIC2_KPIO_UART_0_INT ( 1 << 19 )
158#define H3800_ASIC2_KPIO_UART_1_INT ( 1 << 20 )
159#define H3800_ASIC2_KPIO_TIMER_0_INT ( 1 << 21 )
160#define H3800_ASIC2_KPIO_TIMER_1_INT ( 1 << 22 )
161#define H3800_ASIC2_KPIO_TIMER_2_INT ( 1 << 23 )
162
163#define KPIO_H3800_ASIC2_RECORD_BTN_N (1 << 0) /* Record button */
164#define KPIO_H3800_ASIC2_KEY_5W1_N (1 << 1) /* Keypad */
165#define KPIO_H3800_ASIC2_KEY_5W2_N (1 << 2) /* */
166#define KPIO_H3800_ASIC2_KEY_5W3_N (1 << 3) /* */
167#define KPIO_H3800_ASIC2_KEY_5W4_N (1 << 4) /* */
168#define KPIO_H3800_ASIC2_KEY_5W5_N (1 << 5) /* */
169#define KPIO_H3800_ASIC2_KEY_LEFT_N (1 << 6) /* */
170#define KPIO_H3800_ASIC2_KEY_RIGHT_N (1 << 7) /* */
171#define KPIO_H3800_ASIC2_KEY_AP1_N (1 << 8) /* Old "Calendar" */
172#define KPIO_H3800_ASIC2_KEY_AP2_N (1 << 9) /* Old "Schedule" */
173#define KPIO_H3800_ASIC2_KEY_AP3_N (1 << 10) /* Old "Q" */
174#define KPIO_H3800_ASIC2_KEY_AP4_N (1 << 11) /* Old "Undo" */
175
176/* Alternate KPIO functions (set by default) */
177#define KPIO_ALT_H3800_ASIC2_KEY_5W1_N (1 << 1) /* Action key */
178#define KPIO_ALT_H3800_ASIC2_KEY_5W2_N (1 << 2) /* J1 of keypad input */
179#define KPIO_ALT_H3800_ASIC2_KEY_5W3_N (1 << 3) /* J2 of keypad input */
180#define KPIO_ALT_H3800_ASIC2_KEY_5W4_N (1 << 4) /* J3 of keypad input */
181#define KPIO_ALT_H3800_ASIC2_KEY_5W5_N (1 << 5) /* J4 of keypad input */
182
183#define _H3800_ASIC2_SPI_Base 0x0400
184#define _H3800_ASIC2_SPI_Control 0x0000 /* R/W 8 bits */
185#define _H3800_ASIC2_SPI_Data 0x0004 /* R/W 8 bits */
186#define _H3800_ASIC2_SPI_ChipSelectDisabled 0x0008 /* W 8 bits */
187
188#define H3800_ASIC2_SPI_Control H3800_ASIC2_OFFSET( u8, SPI, Control )
189#define H3800_ASIC2_SPI_Data H3800_ASIC2_OFFSET( u8, SPI, Data )
190#define H3800_ASIC2_SPI_ChipSelectDisabled H3800_ASIC2_OFFSET( u8, SPI, ChipSelectDisabled )
191
192#define _H3800_ASIC2_PWM_0_Base 0x0600
193#define _H3800_ASIC2_PWM_1_Base 0x0700
194#define _H3800_ASIC2_PWM_TimeBase 0x0000 /* R/W 6 bits */
195#define _H3800_ASIC2_PWM_PeriodTime 0x0004 /* R/W 12 bits */
196#define _H3800_ASIC2_PWM_DutyTime 0x0008 /* R/W 12 bits */
197
198#define H3800_ASIC2_PWM_0_TimeBase H3800_ASIC2_NOFFSET( u8, PWM, 0, TimeBase )
199#define H3800_ASIC2_PWM_0_PeriodTime H3800_ASIC2_NOFFSET( u16, PWM, 0, PeriodTime )
200#define H3800_ASIC2_PWM_0_DutyTime H3800_ASIC2_NOFFSET( u16, PWM, 0, DutyTime )
201
202#define H3800_ASIC2_PWM_1_TimeBase H3800_ASIC2_NOFFSET( u8, PWM, 1, TimeBase )
203#define H3800_ASIC2_PWM_1_PeriodTime H3800_ASIC2_NOFFSET( u16, PWM, 1, PeriodTime )
204#define H3800_ASIC2_PWM_1_DutyTime H3800_ASIC2_NOFFSET( u16, PWM, 1, DutyTime )
205
206#define H3800_ASIC2_PWM_TIMEBASE_MASK 0xf /* Low 4 bits sets time base, max = 8 */
207#define H3800_ASIC2_PWM_TIMEBASE_ENABLE ( 1 << 4 ) /* Enable clock */
208#define H3800_ASIC2_PWM_TIMEBASE_CLEAR ( 1 << 5 ) /* Clear the PWM */
209
210#define _H3800_ASIC2_LED_0_Base 0x0800
211#define _H3800_ASIC2_LED_1_Base 0x0880
212#define _H3800_ASIC2_LED_2_Base 0x0900
213#define _H3800_ASIC2_LED_TimeBase 0x0000 /* R/W 7 bits */
214#define _H3800_ASIC2_LED_PeriodTime 0x0004 /* R/W 12 bits */
215#define _H3800_ASIC2_LED_DutyTime 0x0008 /* R/W 12 bits */
216#define _H3800_ASIC2_LED_AutoStopCount 0x000c /* R/W 16 bits */
217
218#define H3800_ASIC2_LED_0_TimeBase H3800_ASIC2_NOFFSET( u8, LED, 0, TimeBase )
219#define H3800_ASIC2_LED_0_PeriodTime H3800_ASIC2_NOFFSET( u16, LED, 0, PeriodTime )
220#define H3800_ASIC2_LED_0_DutyTime H3800_ASIC2_NOFFSET( u16, LED, 0, DutyTime )
221#define H3800_ASIC2_LED_0_AutoStopClock H3800_ASIC2_NOFFSET( u16, LED, 0, AutoStopClock )
222
223#define H3800_ASIC2_LED_1_TimeBase H3800_ASIC2_NOFFSET( u8, LED, 1, TimeBase )
224#define H3800_ASIC2_LED_1_PeriodTime H3800_ASIC2_NOFFSET( u16, LED, 1, PeriodTime )
225#define H3800_ASIC2_LED_1_DutyTime H3800_ASIC2_NOFFSET( u16, LED, 1, DutyTime )
226#define H3800_ASIC2_LED_1_AutoStopClock H3800_ASIC2_NOFFSET( u16, LED, 1, AutoStopClock )
227
228#define H3800_ASIC2_LED_2_TimeBase H3800_ASIC2_NOFFSET( u8, LED, 2, TimeBase )
229#define H3800_ASIC2_LED_2_PeriodTime H3800_ASIC2_NOFFSET( u16, LED, 2, PeriodTime )
230#define H3800_ASIC2_LED_2_DutyTime H3800_ASIC2_NOFFSET( u16, LED, 2, DutyTime )
231#define H3800_ASIC2_LED_2_AutoStopClock H3800_ASIC2_NOFFSET( u16, LED, 2, AutoStopClock )
232
233#define H3800_ASIC2_LED_TIMEBASE_MASK 0x0f /* Low 4 bits sets time base, max = 13 */
234#define H3800_ASIC2_LED_TIMEBASE_BLINK ( 1 << 4 ) /* Enable blinking */
235#define H3800_ASIC2_LED_TIMEBASE_AUTOSTOP ( 1 << 5 )
236#define H3800_ASIC2_LED_TIMEBASE_ALWAYS ( 1 << 6 ) /* Enable blink always */
237
238#define _H3800_ASIC2_UART_0_Base 0x0A00
239#define _H3800_ASIC2_UART_1_Base 0x0C00
240#define _H3800_ASIC2_UART_Receive 0x0000 /* R 8 bits */
241#define _H3800_ASIC2_UART_Transmit 0x0000 /* W 8 bits */
242#define _H3800_ASIC2_UART_IntEnable 0x0004 /* R/W 8 bits */
243#define _H3800_ASIC2_UART_IntVerify 0x0008 /* R/W 8 bits */
244#define _H3800_ASIC2_UART_FIFOControl 0x000c /* R/W 8 bits */
245#define _H3800_ASIC2_UART_LineControl 0x0010 /* R/W 8 bits */
246#define _H3800_ASIC2_UART_ModemStatus 0x0014 /* R/W 8 bits */
247#define _H3800_ASIC2_UART_LineStatus 0x0018 /* R/W 8 bits */
248#define _H3800_ASIC2_UART_ScratchPad 0x001c /* R/W 8 bits */
249#define _H3800_ASIC2_UART_DivisorLatchL 0x0020 /* R/W 8 bits */
250#define _H3800_ASIC2_UART_DivisorLatchH 0x0024 /* R/W 8 bits */
251
252#define H3800_ASIC2_UART_0_Receive H3800_ASIC2_NOFFSET( u8, UART, 0, Receive )
253#define H3800_ASIC2_UART_0_Transmit H3800_ASIC2_NOFFSET( u8, UART, 0, Transmit )
254#define H3800_ASIC2_UART_0_IntEnable H3800_ASIC2_NOFFSET( u8, UART, 0, IntEnable )
255#define H3800_ASIC2_UART_0_IntVerify H3800_ASIC2_NOFFSET( u8, UART, 0, IntVerify )
256#define H3800_ASIC2_UART_0_FIFOControl H3800_ASIC2_NOFFSET( u8, UART, 0, FIFOControl )
257#define H3800_ASIC2_UART_0_LineControl H3800_ASIC2_NOFFSET( u8, UART, 0, LineControl )
258#define H3800_ASIC2_UART_0_ModemStatus H3800_ASIC2_NOFFSET( u8, UART, 0, ModemStatus )
259#define H3800_ASIC2_UART_0_LineStatus H3800_ASIC2_NOFFSET( u8, UART, 0, LineStatus )
260#define H3800_ASIC2_UART_0_ScratchPad H3800_ASIC2_NOFFSET( u8, UART, 0, ScratchPad )
261#define H3800_ASIC2_UART_0_DivisorLatchL H3800_ASIC2_NOFFSET( u8, UART, 0, DivisorLatchL )
262#define H3800_ASIC2_UART_0_DivisorLatchH H3800_ASIC2_NOFFSET( u8, UART, 0, DivisorLatchH )
263
264#define H3800_ASIC2_UART_1_Receive H3800_ASIC2_NOFFSET( u8, UART, 1, Receive )
265#define H3800_ASIC2_UART_1_Transmit H3800_ASIC2_NOFFSET( u8, UART, 1, Transmit )
266#define H3800_ASIC2_UART_1_IntEnable H3800_ASIC2_NOFFSET( u8, UART, 1, IntEnable )
267#define H3800_ASIC2_UART_1_IntVerify H3800_ASIC2_NOFFSET( u8, UART, 1, IntVerify )
268#define H3800_ASIC2_UART_1_FIFOControl H3800_ASIC2_NOFFSET( u8, UART, 1, FIFOControl )
269#define H3800_ASIC2_UART_1_LineControl H3800_ASIC2_NOFFSET( u8, UART, 1, LineControl )
270#define H3800_ASIC2_UART_1_ModemStatus H3800_ASIC2_NOFFSET( u8, UART, 1, ModemStatus )
271#define H3800_ASIC2_UART_1_LineStatus H3800_ASIC2_NOFFSET( u8, UART, 1, LineStatus )
272#define H3800_ASIC2_UART_1_ScratchPad H3800_ASIC2_NOFFSET( u8, UART, 1, ScratchPad )
273#define H3800_ASIC2_UART_1_DivisorLatchL H3800_ASIC2_NOFFSET( u8, UART, 1, DivisorLatchL )
274#define H3800_ASIC2_UART_1_DivisorLatchH H3800_ASIC2_NOFFSET( u8, UART, 1, DivisorLatchH )
275
276#define _H3800_ASIC2_TIMER_Base 0x0E00
277#define _H3800_ASIC2_TIMER_Command 0x0000 /* R/W 8 bits */
278
279#define H3800_ASIC2_TIMER_Command H3800_ASIC2_OFFSET( u8, Timer, Command )
280
281#define H3800_ASIC2_TIMER_GAT_0 ( 1 << 0 ) /* Gate enable, counter 0 */
282#define H3800_ASIC2_TIMER_GAT_1 ( 1 << 1 ) /* Gate enable, counter 1 */
283#define H3800_ASIC2_TIMER_GAT_2 ( 1 << 2 ) /* Gate enable, counter 2 */
284#define H3800_ASIC2_TIMER_CLK_0 ( 1 << 3 ) /* Clock enable, counter 0 */
285#define H3800_ASIC2_TIMER_CLK_1 ( 1 << 4 ) /* Clock enable, counter 1 */
286#define H3800_ASIC2_TIMER_CLK_2 ( 1 << 5 ) /* Clock enable, counter 2 */
287#define H3800_ASIC2_TIMER_MODE_0 ( 1 << 6 ) /* Mode 0 enable, counter 0 */
288#define H3800_ASIC2_TIMER_MODE_1 ( 1 << 7 ) /* Mode 0 enable, counter 1 */
289
290#define _H3800_ASIC2_CLOCK_Base 0x1000
291#define _H3800_ASIC2_CLOCK_Enable 0x0000 /* R/W 18 bits */
292
293#define H3800_ASIC2_CLOCK_Enable H3800_ASIC2_OFFSET( u32, CLOCK, Enable )
294
295#define H3800_ASIC2_CLOCK_AUDIO_1 0x0001 /* Enable 4.1 MHz clock for 8Khz and 4khz sample rate */
296#define H3800_ASIC2_CLOCK_AUDIO_2 0x0002 /* Enable 12.3 MHz clock for 48Khz and 32khz sample rate */
297#define H3800_ASIC2_CLOCK_AUDIO_3 0x0004 /* Enable 5.6 MHz clock for 11 kHZ sample rate */
298#define H3800_ASIC2_CLOCK_AUDIO_4 0x0008 /* Enable 11.289 MHz clock for 44 and 22 kHz sample rate */
299#define H3800_ASIC2_CLOCK_ADC ( 1 << 4 ) /* 1.024 MHz clock to ADC */
300#define H3800_ASIC2_CLOCK_SPI ( 1 << 5 ) /* 4.096 MHz clock to SPI */
301#define H3800_ASIC2_CLOCK_OWM ( 1 << 6 ) /* 4.096 MHz clock to OWM */
302#define H3800_ASIC2_CLOCK_PWM ( 1 << 7 ) /* 2.048 MHz clock to PWM */
303#define H3800_ASIC2_CLOCK_UART_1 ( 1 << 8 ) /* 24.576 MHz clock to UART1 (turn off bit 16) */
304#define H3800_ASIC2_CLOCK_UART_0 ( 1 << 9 ) /* 24.576 MHz clock to UART0 (turn off bit 17) */
305#define H3800_ASIC2_CLOCK_SD_1 ( 1 << 10 ) /* 16.934 MHz to SD */
306#define H3800_ASIC2_CLOCK_SD_2 ( 2 << 10 ) /* 24.576 MHz to SD */
307#define H3800_ASIC2_CLOCK_SD_3 ( 3 << 10 ) /* 33.869 MHz to SD */
308#define H3800_ASIC2_CLOCK_SD_4 ( 4 << 10 ) /* 49.152 MHz to SD */
309#define H3800_ASIC2_CLOCK_EX0 ( 1 << 13 ) /* Enable 32.768 kHz crystal */
310#define H3800_ASIC2_CLOCK_EX1 ( 1 << 14 ) /* Enable 24.576 MHz crystal */
311#define H3800_ASIC2_CLOCK_EX2 ( 1 << 15 ) /* Enable 33.869 MHz crystal */
312#define H3800_ASIC2_CLOCK_SLOW_UART_1 ( 1 << 16 ) /* Enable 3.686 MHz to UART1 (turn off bit 8) */
313#define H3800_ASIC2_CLOCK_SLOW_UART_0 ( 1 << 17 ) /* Enable 3.686 MHz to UART0 (turn off bit 9) */
314
315#define _H3800_ASIC2_ADC_Base 0x1200
316#define _H3800_ASIC2_ADC_Multiplexer 0x0000 /* R/W 4 bits - low 3 bits set channel */
317#define _H3800_ASIC2_ADC_ControlStatus 0x0004 /* R/W 8 bits */
318#define _H3800_ASIC2_ADC_Data 0x0008 /* R 10 bits */
319
320#define H3800_ASIC2_ADC_Multiplexer H3800_ASIC2_OFFSET( u8, ADC, Multiplexer )
321#define H3800_ASIC2_ADC_ControlStatus H3800_ASIC2_OFFSET( u8, ADC, ControlStatus )
322#define H3800_ASIC2_ADC_Data H3800_ASIC2_OFFSET( u16, ADC, Data )
323
324#define H3600_ASIC2_ADC_MUX_CHANNEL_MASK 0x07 /* Low 3 bits sets channel. max = 4 */
325#define H3600_ASIC2_ADC_MUX_CLKEN ( 1 << 3 ) /* Enable clock */
326
327#define H3600_ASIC2_ADC_CSR_ADPS_MASK 0x0f /* Low 4 bits sets prescale, max = 8 */
328#define H3600_ASIC2_ADC_CSR_FREE_RUN ( 1 << 4 )
329#define H3600_ASIC2_ADC_CSR_INT_ENABLE ( 1 << 5 )
330#define H3600_ASIC2_ADC_CSR_START ( 1 << 6 ) /* Set to start conversion. Goes to 0 when done */
331#define H3600_ASIC2_ADC_CSR_ENABLE ( 1 << 7 ) /* 1:power up ADC, 0:power down */
332
333
334#define _H3800_ASIC2_INTR_Base 0x1600
335#define _H3800_ASIC2_INTR_MaskAndFlag 0x0000 /* R/(W) 8bits */
336#define _H3800_ASIC2_INTR_ClockPrescale 0x0004 /* R/(W) 5bits */
337#define _H3800_ASIC2_INTR_TimerSet 0x0008 /* R/(W) 8bits */
338
339#define H3800_ASIC2_INTR_MaskAndFlag H3800_ASIC2_OFFSET( u8, INTR, MaskAndFlag )
340#define H3800_ASIC2_INTR_ClockPrescale H3800_ASIC2_OFFSET( u8, INTR, ClockPrescale )
341#define H3800_ASIC2_INTR_TimerSet H3800_ASIC2_OFFSET( u8, INTR, TimerSet )
342
343#define H3800_ASIC2_INTR_GLOBAL_MASK ( 1 << 0 ) /* Global interrupt mask */
344#define H3800_ASIC2_INTR_POWER_ON_RESET ( 1 << 1 ) /* 01: Power on reset (bits 1 & 2 ) */
345#define H3800_ASIC2_INTR_EXTERNAL_RESET ( 2 << 1 ) /* 10: External reset (bits 1 & 2 ) */
346#define H3800_ASIC2_INTR_MASK_UART_0 ( 1 << 4 )
347#define H3800_ASIC2_INTR_MASK_UART_1 ( 1 << 5 )
348#define H3800_ASIC2_INTR_MASK_TIMER ( 1 << 6 )
349#define H3800_ASIC2_INTR_MASK_OWM ( 1 << 7 )
350
351#define H3800_ASIC2_INTR_CLOCK_PRESCALE 0x0f /* 4 bits, max 14 */
352#define H3800_ASIC2_INTR_SET ( 1 << 4 ) /* Time base enable */
353
354
355#define _H3800_ASIC2_OWM_Base 0x1800
356#define _H3800_ASIC2_OWM_Command 0x0000 /* R/W 4 bits command register */
357#define _H3800_ASIC2_OWM_Data 0x0004 /* R/W 8 bits, transmit / receive buffer */
358#define _H3800_ASIC2_OWM_Interrupt 0x0008 /* R/W Command register */
359#define _H3800_ASIC2_OWM_InterruptEnable 0x000c /* R/W Command register */
360#define _H3800_ASIC2_OWM_ClockDivisor 0x0010 /* R/W 5 bits of divisor and pre-scale */
361
362#define H3800_ASIC2_OWM_Command H3800_ASIC2_OFFSET( u8, OWM, Command )
363#define H3800_ASIC2_OWM_Data H3800_ASIC2_OFFSET( u8, OWM, Data )
364#define H3800_ASIC2_OWM_Interrupt H3800_ASIC2_OFFSET( u8, OWM, Interrupt )
365#define H3800_ASIC2_OWM_InterruptEnable H3800_ASIC2_OFFSET( u8, OWM, InterruptEnable )
366#define H3800_ASIC2_OWM_ClockDivisor H3800_ASIC2_OFFSET( u8, OWM, ClockDivisor )
367
368#define H3800_ASIC2_OWM_CMD_ONE_WIRE_RESET ( 1 << 0 ) /* Set to force reset on 1-wire bus */
369#define H3800_ASIC2_OWM_CMD_SRA ( 1 << 1 ) /* Set to switch to Search ROM accelerator mode */
370#define H3800_ASIC2_OWM_CMD_DQ_OUTPUT ( 1 << 2 ) /* Write only - forces bus low */
371#define H3800_ASIC2_OWM_CMD_DQ_INPUT ( 1 << 3 ) /* Read only - reflects state of bus */
372
373#define H3800_ASIC2_OWM_INT_PD ( 1 << 0 ) /* Presence detect */
374#define H3800_ASIC2_OWM_INT_PDR ( 1 << 1 ) /* Presence detect result */
375#define H3800_ASIC2_OWM_INT_TBE ( 1 << 2 ) /* Transmit buffer empty */
376#define H3800_ASIC2_OWM_INT_TEMT ( 1 << 3 ) /* Transmit shift register empty */
377#define H3800_ASIC2_OWM_INT_RBF ( 1 << 4 ) /* Receive buffer full */
378
379#define H3800_ASIC2_OWM_INTEN_EPD ( 1 << 0 ) /* Enable receive buffer full interrupt */
380#define H3800_ASIC2_OWM_INTEN_IAS ( 1 << 1 ) /* Enable transmit shift register empty interrupt */
381#define H3800_ASIC2_OWM_INTEN_ETBE ( 1 << 2 ) /* Enable transmit buffer empty interrupt */
382#define H3800_ASIC2_OWM_INTEN_ETMT ( 1 << 3 ) /* INTR active state */
383#define H3800_ASIC2_OWM_INTEN_ERBF ( 1 << 4 ) /* Enable presence detect interrupt */
384
385#define _H3800_ASIC2_FlashCtl_Base 0x1A00
386
387/****************************************************/
388/* H3800, ASIC #1
389 * This ASIC is accesed through ASIC #2, and
390 * mapped into the 1c00 - 1f00 region
391 */
392
393#define H3800_ASIC1_OFFSET(s,x,y) \
394 (*((volatile s *) (_H3800_ASIC2_Base + _H3800_ASIC1_ ## x ## _Base + (_H3800_ASIC1_ ## x ## _ ## y << 1))))
395
396#define _H3800_ASIC1_MMC_Base 0x1c00
397
398#define _H3800_ASIC1_MMC_StartStopClock 0x00 /* R/W 8bit */
399#define _H3800_ASIC1_MMC_Status 0x02 /* R See below, default 0x0040 */
400#define _H3800_ASIC1_MMC_ClockRate 0x04 /* R/W 8bit, low 3 bits are clock divisor */
401#define _H3800_ASIC1_MMC_SPIRegister 0x08 /* R/W 8bit, see below */
402#define _H3800_ASIC1_MMC_CmdDataCont 0x0a /* R/W 8bit, write to start MMC adapter */
403#define _H3800_ASIC1_MMC_ResponseTimeout 0x0c /* R/W 8bit, clocks before response timeout */
404#define _H3800_ASIC1_MMC_ReadTimeout 0x0e /* R/W 16bit, clocks before received data timeout */
405#define _H3800_ASIC1_MMC_BlockLength 0x10 /* R/W 10bit */
406#define _H3800_ASIC1_MMC_NumOfBlocks 0x12 /* R/W 16bit, in block mode, number of blocks */
407#define _H3800_ASIC1_MMC_InterruptMask 0x1a /* R/W 8bit */
408#define _H3800_ASIC1_MMC_CommandNumber 0x1c /* R/W 6 bits */
409#define _H3800_ASIC1_MMC_ArgumentH 0x1e /* R/W 16 bits */
410#define _H3800_ASIC1_MMC_ArgumentL 0x20 /* R/W 16 bits */
411#define _H3800_ASIC1_MMC_ResFifo 0x22 /* R 8 x 16 bits - contains response FIFO */
412#define _H3800_ASIC1_MMC_BufferPartFull 0x28 /* R/W 8 bits */
413
414#define H3800_ASIC1_MMC_StartStopClock H3800_ASIC1_OFFSET( u8, MMC, StartStopClock )
415#define H3800_ASIC1_MMC_Status H3800_ASIC1_OFFSET( u16, MMC, Status )
416#define H3800_ASIC1_MMC_ClockRate H3800_ASIC1_OFFSET( u8, MMC, ClockRate )
417#define H3800_ASIC1_MMC_SPIRegister H3800_ASIC1_OFFSET( u8, MMC, SPIRegister )
418#define H3800_ASIC1_MMC_CmdDataCont H3800_ASIC1_OFFSET( u8, MMC, CmdDataCont )
419#define H3800_ASIC1_MMC_ResponseTimeout H3800_ASIC1_OFFSET( u8, MMC, ResponseTimeout )
420#define H3800_ASIC1_MMC_ReadTimeout H3800_ASIC1_OFFSET( u16, MMC, ReadTimeout )
421#define H3800_ASIC1_MMC_BlockLength H3800_ASIC1_OFFSET( u16, MMC, BlockLength )
422#define H3800_ASIC1_MMC_NumOfBlocks H3800_ASIC1_OFFSET( u16, MMC, NumOfBlocks )
423#define H3800_ASIC1_MMC_InterruptMask H3800_ASIC1_OFFSET( u8, MMC, InterruptMask )
424#define H3800_ASIC1_MMC_CommandNumber H3800_ASIC1_OFFSET( u8, MMC, CommandNumber )
425#define H3800_ASIC1_MMC_ArgumentH H3800_ASIC1_OFFSET( u16, MMC, ArgumentH )
426#define H3800_ASIC1_MMC_ArgumentL H3800_ASIC1_OFFSET( u16, MMC, ArgumentL )
427#define H3800_ASIC1_MMC_ResFifo H3800_ASIC1_OFFSET( u16, MMC, ResFifo )
428#define H3800_ASIC1_MMC_BufferPartFull H3800_ASIC1_OFFSET( u8, MMC, BufferPartFull )
429
430#define H3800_ASIC1_MMC_STOP_CLOCK (1 << 0) /* Write to "StartStopClock" register */
431#define H3800_ASIC1_MMC_START_CLOCK (1 << 1)
432
433#define H3800_ASIC1_MMC_STATUS_READ_TIMEOUT (1 << 0)
434#define H3800_ASIC1_MMC_STATUS_RESPONSE_TIMEOUT (1 << 1)
435#define H3800_ASIC1_MMC_STATUS_CRC_WRITE_ERROR (1 << 2)
436#define H3800_ASIC1_MMC_STATUS_CRC_READ_ERROR (1 << 3)
437#define H3800_ASIC1_MMC_STATUS_SPI_READ_ERROR (1 << 4) /* SPI data token error received */
438#define H3800_ASIC1_MMC_STATUS_CRC_RESPONSE_ERROR (1 << 5)
439#define H3800_ASIC1_MMC_STATUS_FIFO_EMPTY (1 << 6)
440#define H3800_ASIC1_MMC_STATUS_FIFO_FULL (1 << 7)
441#define H3800_ASIC1_MMC_STATUS_CLOCK_ENABLE (1 << 8) /* MultiMediaCard clock stopped */
442#define H3800_ASIC1_MMC_STATUS_DATA_TRANSFER_DONE (1 << 11) /* Write operation, indicates transfer finished */
443#define H3800_ASIC1_MMC_STATUS_END_PROGRAM (1 << 12) /* End write and read operations */
444#define H3800_ASIC1_MMC_STATUS_END_COMMAND_RESPONSE (1 << 13) /* End command response */
445
446#define H3800_ASIC1_MMC_SPI_REG_SPI_ENABLE (1 << 0) /* Enables SPI mode */
447#define H3800_ASIC1_MMC_SPI_REG_CRC_ON (1 << 1) /* 1:turn on CRC */
448#define H3800_ASIC1_MMC_SPI_REG_SPI_CS_ENABLE (1 << 2) /* 1:turn on SPI CS */
449#define H3800_ASIC1_MMC_SPI_REG_CS_ADDRESS_MASK 0x38 /* Bits 3,4,5 are the SPI CS relative address */
450
451#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_NO_RESPONSE 0x00
452#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_R1 0x01
453#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_R2 0x02
454#define H3800_ASIC1_MMC_CMD_DATA_CONT_FORMAT_R3 0x03
455#define H3800_ASIC1_MMC_CMD_DATA_CONT_DATA_ENABLE (1 << 2) /* This command contains a data transfer */
456#define H3800_ASIC1_MMC_CMD_DATA_CONT_WRITE (1 << 3) /* This data transfer is a write */
457#define H3800_ASIC1_MMC_CMD_DATA_CONT_STREAM_MODE (1 << 4) /* This data transfer is in stream mode */
458#define H3800_ASIC1_MMC_CMD_DATA_CONT_BUSY_BIT (1 << 5) /* Busy signal expected after current cmd */
459#define H3800_ASIC1_MMC_CMD_DATA_CONT_INITIALIZE (1 << 6) /* Enables the 80 bits for initializing card */
460
461#define H3800_ASIC1_MMC_INT_MASK_DATA_TRANSFER_DONE (1 << 0)
462#define H3800_ASIC1_MMC_INT_MASK_PROGRAM_DONE (1 << 1)
463#define H3800_ASIC1_MMC_INT_MASK_END_COMMAND_RESPONSE (1 << 2)
464#define H3800_ASIC1_MMC_INT_MASK_BUFFER_READY (1 << 3)
465
466#define H3800_ASIC1_MMC_BUFFER_PART_FULL (1 << 0)
467
468/********* GPIO **********/
469
470#define _H3800_ASIC1_GPIO_Base 0x1e00
471
472#define _H3800_ASIC1_GPIO_Mask 0x30 /* R/W 0:don't mask, 1:mask interrupt */
473#define _H3800_ASIC1_GPIO_Direction 0x32 /* R/W 0:input, 1:output */
474#define _H3800_ASIC1_GPIO_Out 0x34 /* R/W 0:output low, 1:output high */
475#define _H3800_ASIC1_GPIO_TriggerType 0x36 /* R/W 0:level, 1:edge */
476#define _H3800_ASIC1_GPIO_EdgeTrigger 0x38 /* R/W 0:falling, 1:rising */
477#define _H3800_ASIC1_GPIO_LevelTrigger 0x3A /* R/W 0:low, 1:high level detect */
478#define _H3800_ASIC1_GPIO_LevelStatus 0x3C /* R/W 0:none, 1:detect */
479#define _H3800_ASIC1_GPIO_EdgeStatus 0x3E /* R/W 0:none, 1:detect */
480#define _H3800_ASIC1_GPIO_State 0x40 /* R See masks below (default 0) */
481#define _H3800_ASIC1_GPIO_Reset 0x42 /* R/W See masks below (default 0x04) */
482#define _H3800_ASIC1_GPIO_SleepMask 0x44 /* R/W 0:don't mask, 1:mask trigger in sleep mode */
483#define _H3800_ASIC1_GPIO_SleepDir 0x46 /* R/W direction 0:input, 1:output in sleep mode */
484#define _H3800_ASIC1_GPIO_SleepOut 0x48 /* R/W level 0:low, 1:high in sleep mode */
485#define _H3800_ASIC1_GPIO_Status 0x4A /* R Pin status */
486#define _H3800_ASIC1_GPIO_BattFaultDir 0x4C /* R/W direction 0:input, 1:output in batt_fault */
487#define _H3800_ASIC1_GPIO_BattFaultOut 0x4E /* R/W level 0:low, 1:high in batt_fault */
488
489#define H3800_ASIC1_GPIO_Mask H3800_ASIC1_OFFSET( u16, GPIO, Mask )
490#define H3800_ASIC1_GPIO_Direction H3800_ASIC1_OFFSET( u16, GPIO, Direction )
491#define H3800_ASIC1_GPIO_Out H3800_ASIC1_OFFSET( u16, GPIO, Out )
492#define H3800_ASIC1_GPIO_TriggerType H3800_ASIC1_OFFSET( u16, GPIO, TriggerType )
493#define H3800_ASIC1_GPIO_EdgeTrigger H3800_ASIC1_OFFSET( u16, GPIO, EdgeTrigger )
494#define H3800_ASIC1_GPIO_LevelTrigger H3800_ASIC1_OFFSET( u16, GPIO, LevelTrigger )
495#define H3800_ASIC1_GPIO_LevelStatus H3800_ASIC1_OFFSET( u16, GPIO, LevelStatus )
496#define H3800_ASIC1_GPIO_EdgeStatus H3800_ASIC1_OFFSET( u16, GPIO, EdgeStatus )
497#define H3800_ASIC1_GPIO_State H3800_ASIC1_OFFSET( u8, GPIO, State )
498#define H3800_ASIC1_GPIO_Reset H3800_ASIC1_OFFSET( u8, GPIO, Reset )
499#define H3800_ASIC1_GPIO_SleepMask H3800_ASIC1_OFFSET( u16, GPIO, SleepMask )
500#define H3800_ASIC1_GPIO_SleepDir H3800_ASIC1_OFFSET( u16, GPIO, SleepDir )
501#define H3800_ASIC1_GPIO_SleepOut H3800_ASIC1_OFFSET( u16, GPIO, SleepOut )
502#define H3800_ASIC1_GPIO_Status H3800_ASIC1_OFFSET( u16, GPIO, Status )
503#define H3800_ASIC1_GPIO_BattFaultDir H3800_ASIC1_OFFSET( u16, GPIO, BattFaultDir )
504#define H3800_ASIC1_GPIO_BattFaultOut H3800_ASIC1_OFFSET( u16, GPIO, BattFaultOut )
505
506#define H3800_ASIC1_GPIO_STATE_MASK (1 << 0)
507#define H3800_ASIC1_GPIO_STATE_DIRECTION (1 << 1)
508#define H3800_ASIC1_GPIO_STATE_OUT (1 << 2)
509#define H3800_ASIC1_GPIO_STATE_TRIGGER_TYPE (1 << 3)
510#define H3800_ASIC1_GPIO_STATE_EDGE_TRIGGER (1 << 4)
511#define H3800_ASIC1_GPIO_STATE_LEVEL_TRIGGER (1 << 5)
512
513#define H3800_ASIC1_GPIO_RESET_SOFTWARE (1 << 0)
514#define H3800_ASIC1_GPIO_RESET_AUTO_SLEEP (1 << 1)
515#define H3800_ASIC1_GPIO_RESET_FIRST_PWR_ON (1 << 2)
516
517/* These are all outputs */
518#define GPIO_H3800_ASIC1_IR_ON_N (1 << 0) /* Apply power to the IR Module */
519#define GPIO_H3800_ASIC1_SD_PWR_ON (1 << 1) /* Secure Digital power on */
520#define GPIO_H3800_ASIC1_RS232_ON (1 << 2) /* Turn on power to the RS232 chip ? */
521#define GPIO_H3800_ASIC1_PULSE_GEN (1 << 3) /* Goes to speaker / earphone */
522#define GPIO_H3800_ASIC1_CH_TIMER (1 << 4) /* */
523#define GPIO_H3800_ASIC1_LCD_5V_ON (1 << 5) /* Enables LCD_5V */
524#define GPIO_H3800_ASIC1_LCD_ON (1 << 6) /* Enables LCD_3V */
525#define GPIO_H3800_ASIC1_LCD_PCI (1 << 7) /* Connects to PDWN on LCD controller */
526#define GPIO_H3800_ASIC1_VGH_ON (1 << 8) /* Drives VGH on the LCD (+9??) */
527#define GPIO_H3800_ASIC1_VGL_ON (1 << 9) /* Drivers VGL on the LCD (-6??) */
528#define GPIO_H3800_ASIC1_FL_PWR_ON (1 << 10) /* Frontlight power on */
529#define GPIO_H3800_ASIC1_BT_PWR_ON (1 << 11) /* Bluetooth power on */
530#define GPIO_H3800_ASIC1_SPK_ON (1 << 12) /* */
531#define GPIO_H3800_ASIC1_EAR_ON_N (1 << 13) /* */
532#define GPIO_H3800_ASIC1_AUD_PWR_ON (1 << 14) /* */
533
534/* Write enable for the flash */
535
536#define _H3800_ASIC1_FlashWP_Base 0x1F00
537#define _H3800_ASIC1_FlashWP_VPP_ON 0x00 /* R 1: write, 0: protect */
538#define H3800_ASIC1_FlashWP_VPP_ON H3800_ASIC1_OFFSET( u8, FlashWP, VPP_ON )
539 76
540#endif /* _INCLUDE_H3600_GPIO_H_ */ 77#endif /* _INCLUDE_H3600_GPIO_H_ */
diff --git a/arch/arm/mach-sa1100/include/mach/irqs.h b/arch/arm/mach-sa1100/include/mach/irqs.h
index 0cb36609b3ac..ae81f80b0cf9 100644
--- a/arch/arm/mach-sa1100/include/mach/irqs.h
+++ b/arch/arm/mach-sa1100/include/mach/irqs.h
@@ -153,8 +153,6 @@
153 */ 153 */
154#ifdef CONFIG_SA1111 154#ifdef CONFIG_SA1111
155#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1) 155#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1)
156#elif defined(CONFIG_SA1100_H3800)
157#define NR_IRQS (IRQ_BOARD_END)
158#elif defined(CONFIG_SHARP_LOCOMO) 156#elif defined(CONFIG_SHARP_LOCOMO)
159#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) 157#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
160#else 158#else
@@ -175,23 +173,3 @@
175#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2) 173#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
176#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3) 174#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
177 175
178/* H3800-specific IRQs (CONFIG_SA1100_H3800) */
179#define H3800_KPIO_IRQ_START (IRQ_BOARD_START)
180#define IRQ_H3800_KEY (IRQ_BOARD_START + 0)
181#define IRQ_H3800_SPI (IRQ_BOARD_START + 1)
182#define IRQ_H3800_OWM (IRQ_BOARD_START + 2)
183#define IRQ_H3800_ADC (IRQ_BOARD_START + 3)
184#define IRQ_H3800_UART_0 (IRQ_BOARD_START + 4)
185#define IRQ_H3800_UART_1 (IRQ_BOARD_START + 5)
186#define IRQ_H3800_TIMER_0 (IRQ_BOARD_START + 6)
187#define IRQ_H3800_TIMER_1 (IRQ_BOARD_START + 7)
188#define IRQ_H3800_TIMER_2 (IRQ_BOARD_START + 8)
189#define H3800_KPIO_IRQ_COUNT 9
190
191#define H3800_GPIO_IRQ_START (IRQ_BOARD_START + 9)
192#define IRQ_H3800_PEN (IRQ_BOARD_START + 9)
193#define IRQ_H3800_SD_DETECT (IRQ_BOARD_START + 10)
194#define IRQ_H3800_EAR_IN (IRQ_BOARD_START + 11)
195#define IRQ_H3800_USB_DETECT (IRQ_BOARD_START + 12)
196#define IRQ_H3800_SD_CON_SLT (IRQ_BOARD_START + 13)
197#define H3800_GPIO_IRQ_COUNT 5
diff --git a/arch/arm/mach-sa1100/include/mach/system.h b/arch/arm/mach-sa1100/include/mach/system.h
index 63755ca5b1b4..942b153e251d 100644
--- a/arch/arm/mach-sa1100/include/mach/system.h
+++ b/arch/arm/mach-sa1100/include/mach/system.h
@@ -10,7 +10,7 @@ static inline void arch_idle(void)
10 cpu_do_idle(); 10 cpu_do_idle();
11} 11}
12 12
13static inline void arch_reset(char mode) 13static inline void arch_reset(char mode, const char *cmd)
14{ 14{
15 if (mode == 's') { 15 if (mode == 's') {
16 /* Jump into ROM at address 0 */ 16 /* Jump into ROM at address 0 */
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 81848aa96424..fd776bb666cd 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -226,12 +226,22 @@ static struct platform_device jornada_ssp_device = {
226 .id = -1, 226 .id = -1,
227}; 227};
228 228
229static struct platform_device jornada_kbd_device = {
230 .name = "jornada720_kbd",
231 .id = -1,
232};
233
234static struct platform_device jornada_ts_device = {
235 .name = "jornada_ts",
236 .id = -1,
237};
238
229static struct platform_device *devices[] __initdata = { 239static struct platform_device *devices[] __initdata = {
230 &sa1111_device, 240 &sa1111_device,
231#ifdef CONFIG_SA1100_JORNADA720_SSP
232 &jornada_ssp_device, 241 &jornada_ssp_device,
233#endif
234 &s1d13xxxfb_device, 242 &s1d13xxxfb_device,
243 &jornada_kbd_device,
244 &jornada_ts_device,
235}; 245};
236 246
237static int __init jornada720_init(void) 247static int __init jornada720_init(void)
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index a23fd3d0163a..358d875ace14 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -16,12 +16,28 @@
16#include <asm/leds.h> 16#include <asm/leds.h>
17#include <asm/param.h> 17#include <asm/param.h>
18 18
19#include <mach/hardware.h>
20
21#include <asm/mach/map.h> 19#include <asm/mach/map.h>
22#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
23#include <asm/mach/time.h> 21#include <asm/mach/time.h>
24 22
23#define IO_BASE 0xe0000000
24#define IO_SIZE 0x08000000
25#define IO_START 0x40000000
26#define ROMCARD_SIZE 0x08000000
27#define ROMCARD_START 0x10000000
28
29void arch_reset(char mode, const char *cmd)
30{
31 short temp;
32 local_irq_disable();
33 /* Reset the Machine via pc[3] of the sequoia chipset */
34 outw(0x09,0x24);
35 temp=inw(0x26);
36 temp = temp | (1<<3) | (1<<10);
37 outw(0x09,0x24);
38 outw(temp,0x26);
39}
40
25static struct plat_serial8250_port serial_platform_data[] = { 41static struct plat_serial8250_port serial_platform_data[] = {
26 { 42 {
27 .iobase = 0x3f8, 43 .iobase = 0x3f8,
@@ -50,14 +66,38 @@ static struct platform_device serial_device = {
50 }, 66 },
51}; 67};
52 68
69static struct resource rtc_resources[] = {
70 [0] = {
71 .start = 0x70,
72 .end = 0x73,
73 .flags = IORESOURCE_IO,
74 },
75 [1] = {
76 .start = IRQ_ISA_RTC_ALARM,
77 .end = IRQ_ISA_RTC_ALARM,
78 .flags = IORESOURCE_IRQ,
79 }
80};
81
82static struct platform_device rtc_device = {
83 .name = "rtc_cmos",
84 .id = -1,
85 .resource = rtc_resources,
86 .num_resources = ARRAY_SIZE(rtc_resources),
87};
88
53static int __init shark_init(void) 89static int __init shark_init(void)
54{ 90{
55 int ret; 91 int ret;
56 92
57 if (machine_is_shark()) 93 if (machine_is_shark())
94 {
95 ret = platform_device_register(&rtc_device);
96 if (ret) printk(KERN_ERR "Unable to register RTC device: %d\n", ret);
58 ret = platform_device_register(&serial_device); 97 ret = platform_device_register(&serial_device);
59 98 if (ret) printk(KERN_ERR "Unable to register Serial device: %d\n", ret);
60 return ret; 99 }
100 return 0;
61} 101}
62 102
63arch_initcall(shark_init); 103arch_initcall(shark_init);
diff --git a/arch/arm/mach-shark/dma.c b/arch/arm/mach-shark/dma.c
index 6774b8d5d13d..10b5b8b3272a 100644
--- a/arch/arm/mach-shark/dma.c
+++ b/arch/arm/mach-shark/dma.c
@@ -13,9 +13,11 @@
13#include <asm/dma.h> 13#include <asm/dma.h>
14#include <asm/mach/dma.h> 14#include <asm/mach/dma.h>
15 15
16void __init arch_dma_init(dma_t *dma) 16static int __init shark_dma_init(void)
17{ 17{
18#ifdef CONFIG_ISA_DMA 18#ifdef CONFIG_ISA_DMA
19 isa_init_dma(dma); 19 isa_init_dma();
20#endif 20#endif
21 return 0;
21} 22}
23core_initcall(shark_dma_init);
diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S
index 0836cb78b29a..f97a7626bd58 100644
--- a/arch/arm/mach-shark/include/mach/debug-macro.S
+++ b/arch/arm/mach-shark/include/mach/debug-macro.S
@@ -27,5 +27,3 @@
27 bne 1001b 27 bne 1001b
28 .endm 28 .endm
29 29
30 .macro waituart,rd,rx
31 .endm
diff --git a/arch/arm/mach-shark/include/mach/framebuffer.h b/arch/arm/mach-shark/include/mach/framebuffer.h
new file mode 100644
index 000000000000..84a5bf6e5ba3
--- /dev/null
+++ b/arch/arm/mach-shark/include/mach/framebuffer.h
@@ -0,0 +1,16 @@
1/*
2 * arch/arm/mach-shark/include/mach/framebuffer.h
3 *
4 * by Alexander Schulz
5 *
6 */
7
8#ifndef __ASM_ARCH_FRAMEBUFFER_H
9#define __ASM_ARCH_FRAMEBUFFER_H
10
11/* defines for the Framebuffer */
12#define FB_START 0x06000000
13#define FB_SIZE 0x01000000
14
15#endif
16
diff --git a/arch/arm/mach-shark/include/mach/hardware.h b/arch/arm/mach-shark/include/mach/hardware.h
index 01bf76099ce5..94d84b27a0cb 100644
--- a/arch/arm/mach-shark/include/mach/hardware.h
+++ b/arch/arm/mach-shark/include/mach/hardware.h
@@ -10,35 +10,8 @@
10#ifndef __ASM_ARCH_HARDWARE_H 10#ifndef __ASM_ARCH_HARDWARE_H
11#define __ASM_ARCH_HARDWARE_H 11#define __ASM_ARCH_HARDWARE_H
12 12
13#ifndef __ASSEMBLY__
14
15/*
16 * Mapping areas
17 */
18#define IO_BASE 0xe0000000
19
20#else
21
22#define IO_BASE 0
23
24#endif
25
26#define IO_SIZE 0x08000000
27#define IO_START 0x40000000
28#define ROMCARD_SIZE 0x08000000
29#define ROMCARD_START 0x10000000
30
31
32/* defines for the Framebuffer */
33#define FB_START 0x06000000
34#define FB_SIZE 0x01000000
35
36#define UNCACHEABLE_ADDR 0xdf010000 13#define UNCACHEABLE_ADDR 0xdf010000
37 14
38#define SEQUOIA_LED_GREEN (1<<6)
39#define SEQUOIA_LED_AMBER (1<<5)
40#define SEQUOIA_LED_BACK (1<<7)
41
42#define pcibios_assign_all_busses() 1 15#define pcibios_assign_all_busses() 1
43 16
44#define PCIBIOS_MIN_IO 0x6000 17#define PCIBIOS_MIN_IO 0x6000
diff --git a/arch/arm/mach-shark/include/mach/io.h b/arch/arm/mach-shark/include/mach/io.h
index c5cee829fc87..9ccbcecc430b 100644
--- a/arch/arm/mach-shark/include/mach/io.h
+++ b/arch/arm/mach-shark/include/mach/io.h
@@ -11,10 +11,10 @@
11#ifndef __ASM_ARM_ARCH_IO_H 11#ifndef __ASM_ARM_ARCH_IO_H
12#define __ASM_ARM_ARCH_IO_H 12#define __ASM_ARM_ARCH_IO_H
13 13
14#define PCIO_BASE 0xe0000000 14#define IO_SPACE_LIMIT 0xffffffff
15#define IO_SPACE_LIMIT 0xffffffff
16 15
17#define __io(a) ((void __iomem *)(PCIO_BASE + (a))) 16#define __io(a) ((void __iomem *)(0xe0000000 + (a)))
18#define __mem_pci(addr) (addr) 17
18#define __mem_pci(addr) (addr)
19 19
20#endif 20#endif
diff --git a/arch/arm/mach-shark/include/mach/irqs.h b/arch/arm/mach-shark/include/mach/irqs.h
index 0586acd7cdd5..c8e8a4e1f61a 100644
--- a/arch/arm/mach-shark/include/mach/irqs.h
+++ b/arch/arm/mach-shark/include/mach/irqs.h
@@ -7,7 +7,7 @@
7#define NR_IRQS 16 7#define NR_IRQS 16
8 8
9#define IRQ_ISA_KEYBOARD 1 9#define IRQ_ISA_KEYBOARD 1
10#define RTC_IRQ 8 10#define IRQ_ISA_RTC_ALARM 8
11#define I8042_KBD_IRQ 1 11#define I8042_KBD_IRQ 1
12#define I8042_AUX_IRQ 12 12#define I8042_AUX_IRQ 12
13#define IRQ_HARDDISK 14 13#define IRQ_HARDDISK 14
diff --git a/arch/arm/mach-shark/include/mach/isa-dma.h b/arch/arm/mach-shark/include/mach/isa-dma.h
index 864298ff3927..96c43b8f8dda 100644
--- a/arch/arm/mach-shark/include/mach/isa-dma.h
+++ b/arch/arm/mach-shark/include/mach/isa-dma.h
@@ -6,10 +6,6 @@
6#ifndef __ASM_ARCH_DMA_H 6#ifndef __ASM_ARCH_DMA_H
7#define __ASM_ARCH_DMA_H 7#define __ASM_ARCH_DMA_H
8 8
9/* Use only the lowest 4MB, nothing else works.
10 * The rest is not DMAable. See dev / .properties
11 * in OpenFirmware.
12 */
13#define MAX_DMA_CHANNELS 8 9#define MAX_DMA_CHANNELS 8
14#define DMA_ISA_CASCADE 4 10#define DMA_ISA_CASCADE 4
15 11
diff --git a/arch/arm/mach-shark/include/mach/memory.h b/arch/arm/mach-shark/include/mach/memory.h
index c5ab038925d6..3053e5b7f168 100644
--- a/arch/arm/mach-shark/include/mach/memory.h
+++ b/arch/arm/mach-shark/include/mach/memory.h
@@ -23,6 +23,7 @@ static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsig
23{ 23{
24 if (node != 0) return; 24 if (node != 0) return;
25 /* Only the first 4 MB (=1024 Pages) are usable for DMA */ 25 /* Only the first 4 MB (=1024 Pages) are usable for DMA */
26 /* See dev / -> .properties in OpenFirmware. */
26 zone_size[1] = zone_size[0] - 1024; 27 zone_size[1] = zone_size[0] - 1024;
27 zone_size[0] = 1024; 28 zone_size[0] = 1024;
28 zhole_size[1] = zhole_size[0]; 29 zhole_size[1] = zhole_size[0];
diff --git a/arch/arm/mach-shark/include/mach/system.h b/arch/arm/mach-shark/include/mach/system.h
index e45bd734a03e..21c373b30bbc 100644
--- a/arch/arm/mach-shark/include/mach/system.h
+++ b/arch/arm/mach-shark/include/mach/system.h
@@ -6,20 +6,8 @@
6#ifndef __ASM_ARCH_SYSTEM_H 6#ifndef __ASM_ARCH_SYSTEM_H
7#define __ASM_ARCH_SYSTEM_H 7#define __ASM_ARCH_SYSTEM_H
8 8
9#include <linux/io.h> 9/* Found in arch/mach-shark/core.c */
10 10extern void arch_reset(char mode, const char *cmd);
11static void arch_reset(char mode)
12{
13 short temp;
14 local_irq_disable();
15 /* Reset the Machine via pc[3] of the sequoia chipset */
16 outw(0x09,0x24);
17 temp=inw(0x26);
18 temp = temp | (1<<3) | (1<<10);
19 outw(0x09,0x24);
20 outw(temp,0x26);
21
22}
23 11
24static inline void arch_idle(void) 12static inline void arch_idle(void)
25{ 13{
diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h
index 3725e1633418..22ccab4c3c5e 100644
--- a/arch/arm/mach-shark/include/mach/uncompress.h
+++ b/arch/arm/mach-shark/include/mach/uncompress.h
@@ -11,7 +11,7 @@
11 11
12static inline void putc(int c) 12static inline void putc(int c)
13{ 13{
14 int t; 14 volatile int t;
15 15
16 SERIAL_BASE[0] = c; 16 SERIAL_BASE[0] = c;
17 t=0x10000; 17 t=0x10000;
diff --git a/arch/arm/mach-shark/leds.c b/arch/arm/mach-shark/leds.c
index 8bd8d6bb4d92..c9e32de4adf9 100644
--- a/arch/arm/mach-shark/leds.c
+++ b/arch/arm/mach-shark/leds.c
@@ -22,12 +22,16 @@
22#include <linux/ioport.h> 22#include <linux/ioport.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <mach/hardware.h>
26#include <asm/leds.h> 25#include <asm/leds.h>
27#include <asm/system.h> 26#include <asm/system.h>
28 27
29#define LED_STATE_ENABLED 1 28#define LED_STATE_ENABLED 1
30#define LED_STATE_CLAIMED 2 29#define LED_STATE_CLAIMED 2
30
31#define SEQUOIA_LED_GREEN (1<<6)
32#define SEQUOIA_LED_AMBER (1<<5)
33#define SEQUOIA_LED_BACK (1<<7)
34
31static char led_state; 35static char led_state;
32static short hw_led_state; 36static short hw_led_state;
33static short saved_state; 37static short saved_state;
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 1c43494f5c42..565776680d8c 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -335,11 +335,25 @@ static struct resource versatile_i2c_resource = {
335 335
336static struct platform_device versatile_i2c_device = { 336static struct platform_device versatile_i2c_device = {
337 .name = "versatile-i2c", 337 .name = "versatile-i2c",
338 .id = -1, 338 .id = 0,
339 .num_resources = 1, 339 .num_resources = 1,
340 .resource = &versatile_i2c_resource, 340 .resource = &versatile_i2c_resource,
341}; 341};
342 342
343static struct i2c_board_info versatile_i2c_board_info[] = {
344 {
345 I2C_BOARD_INFO("rtc-ds1307", 0xd0 >> 1),
346 .type = "ds1338",
347 },
348};
349
350static int __init versatile_i2c_init(void)
351{
352 return i2c_register_board_info(0, versatile_i2c_board_info,
353 ARRAY_SIZE(versatile_i2c_board_info));
354}
355arch_initcall(versatile_i2c_init);
356
343#define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET) 357#define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET)
344 358
345unsigned int mmc_status(struct device *dev) 359unsigned int mmc_status(struct device *dev)
diff --git a/arch/arm/mach-versatile/include/mach/system.h b/arch/arm/mach-versatile/include/mach/system.h
index c59e6100c7e3..8ffc12a7cb25 100644
--- a/arch/arm/mach-versatile/include/mach/system.h
+++ b/arch/arm/mach-versatile/include/mach/system.h
@@ -34,7 +34,7 @@ static inline void arch_idle(void)
34 cpu_do_idle(); 34 cpu_do_idle();
35} 35}
36 36
37static inline void arch_reset(char mode) 37static inline void arch_reset(char mode, const char *cmd)
38{ 38{
39 u32 val; 39 u32 val;
40 40
diff --git a/arch/arm/mach-w90x900/cpu.h b/arch/arm/mach-w90x900/cpu.h
index 40ff40845df0..de29ddcb9459 100644
--- a/arch/arm/mach-w90x900/cpu.h
+++ b/arch/arm/mach-w90x900/cpu.h
@@ -43,35 +43,16 @@ extern void w90p910_init_io(struct map_desc *mach_desc, int size);
43extern void w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no); 43extern void w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no);
44extern void w90p910_init_clocks(int xtal); 44extern void w90p910_init_clocks(int xtal);
45extern void w90p910_map_io(struct map_desc *mach_desc, int size); 45extern void w90p910_map_io(struct map_desc *mach_desc, int size);
46extern struct platform_device w90p910_serial_device;
46extern struct sys_timer w90x900_timer; 47extern struct sys_timer w90x900_timer;
47 48
48#define W90X900_RES(name) \ 49#define W90X900_8250PORT(name) \
49struct resource w90x900_##name##_resource[] = { \ 50{ \
50 [0] = { \ 51 .membase = name##_BA, \
51 .start = name##_PA, \ 52 .mapbase = name##_PA, \
52 .end = name##_PA + 0x0ff, \ 53 .irq = IRQ_##name, \
53 .flags = IORESOURCE_MEM, \ 54 .uartclk = 11313600, \
54 }, \ 55 .regshift = 2, \
55 [1] = { \ 56 .iotype = UPIO_MEM, \
56 .start = IRQ_##name, \ 57 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
57 .end = IRQ_##name, \
58 .flags = IORESOURCE_IRQ, \
59 } \
60}
61
62#define W90X900_DEVICE(devname, regname, devid, platdevname) \
63struct platform_device w90x900_##devname = { \
64 .name = platdevname, \
65 .id = devid, \
66 .num_resources = ARRAY_SIZE(w90x900_##regname##_resource), \
67 .resource = w90x900_##regname##_resource, \
68}
69
70#define W90X900_UARTCFG(port, flag, uc, ulc, ufc) \
71{ \
72 .hwport = port, \
73 .flags = flag, \
74 .ucon = uc, \
75 .ulcon = ulc, \
76 .ufcon = ufc, \
77} 58}
diff --git a/arch/arm/mach-w90x900/include/mach/system.h b/arch/arm/mach-w90x900/include/mach/system.h
index 93753f922618..940640066857 100644
--- a/arch/arm/mach-w90x900/include/mach/system.h
+++ b/arch/arm/mach-w90x900/include/mach/system.h
@@ -21,7 +21,7 @@ static void arch_idle(void)
21{ 21{
22} 22}
23 23
24static void arch_reset(char mode) 24static void arch_reset(char mode, const char *cmd)
25{ 25{
26 cpu_reset(0); 26 cpu_reset(0);
27} 27}
diff --git a/arch/arm/mach-w90x900/mach-w90p910evb.c b/arch/arm/mach-w90x900/mach-w90p910evb.c
index 9ebc93f48530..726ff6798a56 100644
--- a/arch/arm/mach-w90x900/mach-w90p910evb.c
+++ b/arch/arm/mach-w90x900/mach-w90p910evb.c
@@ -22,6 +22,7 @@
22#include <linux/timer.h> 22#include <linux/timer.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/mtd/physmap.h>
25 26
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
@@ -32,28 +33,67 @@
32#include <mach/map.h> 33#include <mach/map.h>
33 34
34#include "cpu.h" 35#include "cpu.h"
36/*w90p910 evb norflash driver data */
35 37
36static struct map_desc w90p910_iodesc[] __initdata = { 38#define W90P910_FLASH_BASE 0xA0000000
39#define W90P910_FLASH_SIZE 0x400000
40
41static struct mtd_partition w90p910_flash_partitions[] = {
42 {
43 .name = "NOR Partition 1 for kernel (960K)",
44 .size = 0xF0000,
45 .offset = 0x10000,
46 },
47 {
48 .name = "NOR Partition 2 for image (1M)",
49 .size = 0x100000,
50 .offset = 0x100000,
51 },
52 {
53 .name = "NOR Partition 3 for user (2M)",
54 .size = 0x200000,
55 .offset = 0x00200000,
56 }
37}; 57};
38 58
39static struct w90x900_uartcfg w90p910_uartcfgs[] = { 59static struct physmap_flash_data w90p910_flash_data = {
40 W90X900_UARTCFG(0, 0, 0, 0, 0), 60 .width = 2,
41 W90X900_UARTCFG(1, 0, 0, 0, 0), 61 .parts = w90p910_flash_partitions,
42 W90X900_UARTCFG(2, 0, 0, 0, 0), 62 .nr_parts = ARRAY_SIZE(w90p910_flash_partitions),
43 W90X900_UARTCFG(3, 0, 0, 0, 0), 63};
44 W90X900_UARTCFG(4, 0, 0, 0, 0), 64
65static struct resource w90p910_flash_resources[] = {
66 {
67 .start = W90P910_FLASH_BASE,
68 .end = W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1,
69 .flags = IORESOURCE_MEM,
70 }
71};
72
73static struct platform_device w90p910_flash_device = {
74 .name = "physmap-flash",
75 .id = 0,
76 .dev = {
77 .platform_data = &w90p910_flash_data,
78 },
79 .resource = w90p910_flash_resources,
80 .num_resources = ARRAY_SIZE(w90p910_flash_resources),
81};
82
83static struct map_desc w90p910_iodesc[] __initdata = {
45}; 84};
46 85
47/*Here should be your evb resourse,such as LCD*/ 86/*Here should be your evb resourse,such as LCD*/
48 87
49static struct platform_device *w90p910evb_dev[] __initdata = { 88static struct platform_device *w90p910evb_dev[] __initdata = {
89 &w90p910_serial_device,
90 &w90p910_flash_device,
50}; 91};
51 92
52static void __init w90p910evb_map_io(void) 93static void __init w90p910evb_map_io(void)
53{ 94{
54 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc)); 95 w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
55 w90p910_init_clocks(0); 96 w90p910_init_clocks(0);
56 w90p910_init_uarts(w90p910_uartcfgs, ARRAY_SIZE(w90p910_uartcfgs));
57} 97}
58 98
59static void __init w90p910evb_init(void) 99static void __init w90p910evb_init(void)
diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/w90p910.c
index aa783bc94310..2bcbaa681b99 100644
--- a/arch/arm/mach-w90x900/w90p910.c
+++ b/arch/arm/mach-w90x900/w90p910.c
@@ -25,6 +25,7 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/serial_8250.h>
28 29
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -36,12 +37,6 @@
36 37
37#include "cpu.h" 38#include "cpu.h"
38 39
39/*W90P910 has five uarts*/
40
41#define MAX_UART_COUNT 5
42static int uart_count;
43static struct platform_device *uart_devs[MAX_UART_COUNT-1];
44
45/* Initial IO mappings */ 40/* Initial IO mappings */
46 41
47static struct map_desc w90p910_iodesc[] __initdata = { 42static struct map_desc w90p910_iodesc[] __initdata = {
@@ -53,48 +48,19 @@ static struct map_desc w90p910_iodesc[] __initdata = {
53 /*IODESC_ENT(LCD),*/ 48 /*IODESC_ENT(LCD),*/
54}; 49};
55 50
56/*Init the dev resource*/ 51/* Initial serial platform data */
57
58static W90X900_RES(UART0);
59static W90X900_RES(UART1);
60static W90X900_RES(UART2);
61static W90X900_RES(UART3);
62static W90X900_RES(UART4);
63static W90X900_DEVICE(uart0, UART0, 0, "w90x900-uart");
64static W90X900_DEVICE(uart1, UART1, 1, "w90x900-uart");
65static W90X900_DEVICE(uart2, UART2, 2, "w90x900-uart");
66static W90X900_DEVICE(uart3, UART3, 3, "w90x900-uart");
67static W90X900_DEVICE(uart4, UART4, 4, "w90x900-uart");
68
69static struct platform_device *uart_devices[] __initdata = {
70 &w90x900_uart0,
71 &w90x900_uart1,
72 &w90x900_uart2,
73 &w90x900_uart3,
74 &w90x900_uart4
75};
76 52
77/*Init W90P910 uart device*/ 53struct plat_serial8250_port w90p910_uart_data[] = {
54 W90X900_8250PORT(UART0),
55};
78 56
79void __init w90p910_init_uarts(struct w90x900_uartcfg *cfg, int no) 57struct platform_device w90p910_serial_device = {
80{ 58 .name = "serial8250",
81 struct platform_device *platdev; 59 .id = PLAT8250_DEV_PLATFORM,
82 int uart, uartdev; 60 .dev = {
83 61 .platform_data = w90p910_uart_data,
84 /*By min() to judge count of uart be used indeed*/ 62 },
85 63};
86 uartdev = ARRAY_SIZE(uart_devices);
87 no = min(uartdev, no);
88
89 for (uart = 0; uart < no; uart++, cfg++) {
90 if (cfg->hwport != uart)
91 printk(KERN_ERR "w90x900_uartcfg[%d] error\n", uart);
92 platdev = uart_devices[cfg->hwport];
93 uart_devs[uart] = platdev;
94 platdev->dev.platform_data = cfg;
95 }
96 uart_count = uart;
97}
98 64
99/*Init W90P910 evb io*/ 65/*Init W90P910 evb io*/
100 66
@@ -122,13 +88,6 @@ static int __init w90p910_init_cpu(void)
122 88
123static int __init w90x900_arch_init(void) 89static int __init w90x900_arch_init(void)
124{ 90{
125 int ret; 91 return w90p910_init_cpu();
126
127 ret = w90p910_init_cpu();
128 if (ret != 0)
129 return ret;
130
131 return platform_add_devices(uart_devs, uart_count);
132
133} 92}
134arch_initcall(w90x900_arch_init); 93arch_initcall(w90x900_arch_init);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index d490f3773c01..20979564e7ee 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -186,6 +186,24 @@ config CPU_ARM926T
186 Say Y if you want support for the ARM926T processor. 186 Say Y if you want support for the ARM926T processor.
187 Otherwise, say N. 187 Otherwise, say N.
188 188
189# FA526
190config CPU_FA526
191 bool
192 select CPU_32v4
193 select CPU_ABRT_EV4
194 select CPU_PABRT_NOIFAR
195 select CPU_CACHE_VIVT
196 select CPU_CP15_MMU
197 select CPU_CACHE_FA
198 select CPU_COPY_FA if MMU
199 select CPU_TLB_FA if MMU
200 help
201 The FA526 is a version of the ARMv4 compatible processor with
202 Branch Target Buffer, Unified TLB and cache line size 16.
203
204 Say Y if you want support for the FA526 processor.
205 Otherwise, say N.
206
189# ARM940T 207# ARM940T
190config CPU_ARM940T 208config CPU_ARM940T
191 bool "Support ARM940T processor" if ARCH_INTEGRATOR 209 bool "Support ARM940T processor" if ARCH_INTEGRATOR
@@ -340,6 +358,17 @@ config CPU_XSC3
340 select CPU_TLB_V4WBI if MMU 358 select CPU_TLB_V4WBI if MMU
341 select IO_36 359 select IO_36
342 360
361# Marvell PJ1 (Mohawk)
362config CPU_MOHAWK
363 bool
364 select CPU_32v5
365 select CPU_ABRT_EV5T
366 select CPU_PABRT_NOIFAR
367 select CPU_CACHE_VIVT
368 select CPU_CP15_MMU
369 select CPU_TLB_V4WBI if MMU
370 select CPU_COPY_V4WB if MMU
371
343# Feroceon 372# Feroceon
344config CPU_FEROCEON 373config CPU_FEROCEON
345 bool 374 bool
@@ -484,6 +513,9 @@ config CPU_CACHE_VIVT
484config CPU_CACHE_VIPT 513config CPU_CACHE_VIPT
485 bool 514 bool
486 515
516config CPU_CACHE_FA
517 bool
518
487if MMU 519if MMU
488# The copy-page model 520# The copy-page model
489config CPU_COPY_V3 521config CPU_COPY_V3
@@ -498,6 +530,9 @@ config CPU_COPY_V4WB
498config CPU_COPY_FEROCEON 530config CPU_COPY_FEROCEON
499 bool 531 bool
500 532
533config CPU_COPY_FA
534 bool
535
501config CPU_COPY_V6 536config CPU_COPY_V6
502 bool 537 bool
503 538
@@ -528,6 +563,13 @@ config CPU_TLB_FEROCEON
528 help 563 help
529 Feroceon TLB (v4wbi with non-outer-cachable page table walks). 564 Feroceon TLB (v4wbi with non-outer-cachable page table walks).
530 565
566config CPU_TLB_FA
567 bool
568 help
569 Faraday ARM FA526 architecture, unified TLB with writeback cache
570 and invalidate instruction cache entry. Branch target buffer is
571 also supported.
572
531config CPU_TLB_V6 573config CPU_TLB_V6
532 bool 574 bool
533 575
@@ -569,7 +611,7 @@ comment "Processor Features"
569 611
570config ARM_THUMB 612config ARM_THUMB
571 bool "Support Thumb user binaries" 613 bool "Support Thumb user binaries"
572 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_V6 || CPU_V7 || CPU_FEROCEON 614 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V7 || CPU_FEROCEON
573 default y 615 default y
574 help 616 help
575 Say Y if you want to include kernel support for running user space 617 Say Y if you want to include kernel support for running user space
@@ -638,7 +680,7 @@ config CPU_DCACHE_SIZE
638 680
639config CPU_DCACHE_WRITETHROUGH 681config CPU_DCACHE_WRITETHROUGH
640 bool "Force write through D-cache" 682 bool "Force write through D-cache"
641 depends on (CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020) && !CPU_DCACHE_DISABLE 683 depends on (CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_FA526) && !CPU_DCACHE_DISABLE
642 default y if CPU_ARM925T 684 default y if CPU_ARM925T
643 help 685 help
644 Say Y here to use the data cache in writethrough mode. Unless you 686 Say Y here to use the data cache in writethrough mode. Unless you
@@ -653,7 +695,7 @@ config CPU_CACHE_ROUND_ROBIN
653 695
654config CPU_BPREDICT_DISABLE 696config CPU_BPREDICT_DISABLE
655 bool "Disable branch prediction" 697 bool "Disable branch prediction"
656 depends on CPU_ARM1020 || CPU_V6 || CPU_XSC3 || CPU_V7 698 depends on CPU_ARM1020 || CPU_V6 || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526
657 help 699 help
658 Say Y here to disable branch prediction. If unsure, say N. 700 Say Y here to disable branch prediction. If unsure, say N.
659 701
@@ -704,7 +746,8 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
704 746
705config CACHE_L2X0 747config CACHE_L2X0
706 bool "Enable the L2x0 outer cache controller" 748 bool "Enable the L2x0 outer cache controller"
707 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || REALVIEW_EB_A9MP 749 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
750 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31
708 default y 751 default y
709 select OUTER_CACHE 752 select OUTER_CACHE
710 help 753 help
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 480f78a3611a..63e3f6dd0e21 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_MODULES) += proc-syms.o
16 16
17obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o 17obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o
18obj-$(CONFIG_DISCONTIGMEM) += discontig.o 18obj-$(CONFIG_DISCONTIGMEM) += discontig.o
19obj-$(CONFIG_HIGHMEM) += highmem.o
19 20
20obj-$(CONFIG_CPU_ABRT_NOMMU) += abort-nommu.o 21obj-$(CONFIG_CPU_ABRT_NOMMU) += abort-nommu.o
21obj-$(CONFIG_CPU_ABRT_EV4) += abort-ev4.o 22obj-$(CONFIG_CPU_ABRT_EV4) += abort-ev4.o
@@ -32,6 +33,7 @@ obj-$(CONFIG_CPU_CACHE_V4WT) += cache-v4wt.o
32obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o 33obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o
33obj-$(CONFIG_CPU_CACHE_V6) += cache-v6.o 34obj-$(CONFIG_CPU_CACHE_V6) += cache-v6.o
34obj-$(CONFIG_CPU_CACHE_V7) += cache-v7.o 35obj-$(CONFIG_CPU_CACHE_V7) += cache-v7.o
36obj-$(CONFIG_CPU_CACHE_FA) += cache-fa.o
35 37
36obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o 38obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o
37obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o 39obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o
@@ -41,6 +43,7 @@ obj-$(CONFIG_CPU_COPY_V6) += copypage-v6.o context.o
41obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o 43obj-$(CONFIG_CPU_SA1100) += copypage-v4mc.o
42obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o 44obj-$(CONFIG_CPU_XSCALE) += copypage-xscale.o
43obj-$(CONFIG_CPU_XSC3) += copypage-xsc3.o 45obj-$(CONFIG_CPU_XSC3) += copypage-xsc3.o
46obj-$(CONFIG_CPU_COPY_FA) += copypage-fa.o
44 47
45obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o 48obj-$(CONFIG_CPU_TLB_V3) += tlb-v3.o
46obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o 49obj-$(CONFIG_CPU_TLB_V4WT) += tlb-v4.o
@@ -49,6 +52,7 @@ obj-$(CONFIG_CPU_TLB_V4WBI) += tlb-v4wbi.o
49obj-$(CONFIG_CPU_TLB_FEROCEON) += tlb-v4wbi.o # reuse v4wbi TLB functions 52obj-$(CONFIG_CPU_TLB_FEROCEON) += tlb-v4wbi.o # reuse v4wbi TLB functions
50obj-$(CONFIG_CPU_TLB_V6) += tlb-v6.o 53obj-$(CONFIG_CPU_TLB_V6) += tlb-v6.o
51obj-$(CONFIG_CPU_TLB_V7) += tlb-v7.o 54obj-$(CONFIG_CPU_TLB_V7) += tlb-v7.o
55obj-$(CONFIG_CPU_TLB_FA) += tlb-fa.o
52 56
53obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o 57obj-$(CONFIG_CPU_ARM610) += proc-arm6_7.o
54obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o 58obj-$(CONFIG_CPU_ARM710) += proc-arm6_7.o
@@ -62,6 +66,7 @@ obj-$(CONFIG_CPU_ARM925T) += proc-arm925.o
62obj-$(CONFIG_CPU_ARM926T) += proc-arm926.o 66obj-$(CONFIG_CPU_ARM926T) += proc-arm926.o
63obj-$(CONFIG_CPU_ARM940T) += proc-arm940.o 67obj-$(CONFIG_CPU_ARM940T) += proc-arm940.o
64obj-$(CONFIG_CPU_ARM946E) += proc-arm946.o 68obj-$(CONFIG_CPU_ARM946E) += proc-arm946.o
69obj-$(CONFIG_CPU_FA526) += proc-fa526.o
65obj-$(CONFIG_CPU_ARM1020) += proc-arm1020.o 70obj-$(CONFIG_CPU_ARM1020) += proc-arm1020.o
66obj-$(CONFIG_CPU_ARM1020E) += proc-arm1020e.o 71obj-$(CONFIG_CPU_ARM1020E) += proc-arm1020e.o
67obj-$(CONFIG_CPU_ARM1022) += proc-arm1022.o 72obj-$(CONFIG_CPU_ARM1022) += proc-arm1022.o
@@ -70,6 +75,7 @@ obj-$(CONFIG_CPU_SA110) += proc-sa110.o
70obj-$(CONFIG_CPU_SA1100) += proc-sa1100.o 75obj-$(CONFIG_CPU_SA1100) += proc-sa1100.o
71obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o 76obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o
72obj-$(CONFIG_CPU_XSC3) += proc-xsc3.o 77obj-$(CONFIG_CPU_XSC3) += proc-xsc3.o
78obj-$(CONFIG_CPU_MOHAWK) += proc-mohawk.o
73obj-$(CONFIG_CPU_FEROCEON) += proc-feroceon.o 79obj-$(CONFIG_CPU_FEROCEON) += proc-feroceon.o
74obj-$(CONFIG_CPU_V6) += proc-v6.o 80obj-$(CONFIG_CPU_V6) += proc-v6.o
75obj-$(CONFIG_CPU_V7) += proc-v7.o 81obj-$(CONFIG_CPU_V7) += proc-v7.o
diff --git a/arch/arm/mm/cache-fa.S b/arch/arm/mm/cache-fa.S
new file mode 100644
index 000000000000..b63a8f7b95cf
--- /dev/null
+++ b/arch/arm/mm/cache-fa.S
@@ -0,0 +1,220 @@
1/*
2 * linux/arch/arm/mm/cache-fa.S
3 *
4 * Copyright (C) 2005 Faraday Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
6 *
7 * Based on cache-v4wb.S:
8 * Copyright (C) 1997-2002 Russell king
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 * Processors: FA520 FA526 FA626
15 */
16#include <linux/linkage.h>
17#include <linux/init.h>
18#include <asm/memory.h>
19#include <asm/page.h>
20
21#include "proc-macros.S"
22
23/*
24 * The size of one data cache line.
25 */
26#define CACHE_DLINESIZE 16
27
28/*
29 * The total size of the data cache.
30 */
31#ifdef CONFIG_ARCH_GEMINI
32#define CACHE_DSIZE 8192
33#else
34#define CACHE_DSIZE 16384
35#endif
36
37/* FIXME: put optimal value here. Current one is just estimation */
38#define CACHE_DLIMIT (CACHE_DSIZE * 2)
39
40/*
41 * flush_user_cache_all()
42 *
43 * Clean and invalidate all cache entries in a particular address
44 * space.
45 */
46ENTRY(fa_flush_user_cache_all)
47 /* FALLTHROUGH */
48/*
49 * flush_kern_cache_all()
50 *
51 * Clean and invalidate the entire cache.
52 */
53ENTRY(fa_flush_kern_cache_all)
54 mov ip, #0
55 mov r2, #VM_EXEC
56__flush_whole_cache:
57 mcr p15, 0, ip, c7, c14, 0 @ clean/invalidate D cache
58 tst r2, #VM_EXEC
59 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
60 mcrne p15, 0, ip, c7, c5, 6 @ invalidate BTB
61 mcrne p15, 0, ip, c7, c10, 4 @ drain write buffer
62 mcrne p15, 0, ip, c7, c5, 4 @ prefetch flush
63 mov pc, lr
64
65/*
66 * flush_user_cache_range(start, end, flags)
67 *
68 * Invalidate a range of cache entries in the specified
69 * address space.
70 *
71 * - start - start address (inclusive, page aligned)
72 * - end - end address (exclusive, page aligned)
73 * - flags - vma_area_struct flags describing address space
74 */
75ENTRY(fa_flush_user_cache_range)
76 mov ip, #0
77 sub r3, r1, r0 @ calculate total size
78 cmp r3, #CACHE_DLIMIT @ total size >= limit?
79 bhs __flush_whole_cache @ flush whole D cache
80
811: tst r2, #VM_EXEC
82 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I line
83 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
84 add r0, r0, #CACHE_DLINESIZE
85 cmp r0, r1
86 blo 1b
87 tst r2, #VM_EXEC
88 mcrne p15, 0, ip, c7, c5, 6 @ invalidate BTB
89 mcrne p15, 0, ip, c7, c10, 4 @ data write barrier
90 mcrne p15, 0, ip, c7, c5, 4 @ prefetch flush
91 mov pc, lr
92
93/*
94 * coherent_kern_range(start, end)
95 *
96 * Ensure coherency between the Icache and the Dcache in the
97 * region described by start. If you have non-snooping
98 * Harvard caches, you need to implement this function.
99 *
100 * - start - virtual start address
101 * - end - virtual end address
102 */
103ENTRY(fa_coherent_kern_range)
104 /* fall through */
105
106/*
107 * coherent_user_range(start, end)
108 *
109 * Ensure coherency between the Icache and the Dcache in the
110 * region described by start. If you have non-snooping
111 * Harvard caches, you need to implement this function.
112 *
113 * - start - virtual start address
114 * - end - virtual end address
115 */
116ENTRY(fa_coherent_user_range)
117 bic r0, r0, #CACHE_DLINESIZE - 1
1181: mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
119 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
120 add r0, r0, #CACHE_DLINESIZE
121 cmp r0, r1
122 blo 1b
123 mov r0, #0
124 mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB
125 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
126 mcr p15, 0, r0, c7, c5, 4 @ prefetch flush
127 mov pc, lr
128
129/*
130 * flush_kern_dcache_page(kaddr)
131 *
132 * Ensure that the data held in the page kaddr is written back
133 * to the page in question.
134 *
135 * - kaddr - kernel address (guaranteed to be page aligned)
136 */
137ENTRY(fa_flush_kern_dcache_page)
138 add r1, r0, #PAGE_SZ
1391: mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line
140 add r0, r0, #CACHE_DLINESIZE
141 cmp r0, r1
142 blo 1b
143 mov r0, #0
144 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
145 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
146 mov pc, lr
147
148/*
149 * dma_inv_range(start, end)
150 *
151 * Invalidate (discard) the specified virtual address range.
152 * May not write back any entries. If 'start' or 'end'
153 * are not cache line aligned, those lines must be written
154 * back.
155 *
156 * - start - virtual start address
157 * - end - virtual end address
158 */
159ENTRY(fa_dma_inv_range)
160 tst r0, #CACHE_DLINESIZE - 1
161 bic r0, r0, #CACHE_DLINESIZE - 1
162 mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D entry
163 tst r1, #CACHE_DLINESIZE - 1
164 bic r1, r1, #CACHE_DLINESIZE - 1
165 mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D entry
1661: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
167 add r0, r0, #CACHE_DLINESIZE
168 cmp r0, r1
169 blo 1b
170 mov r0, #0
171 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
172 mov pc, lr
173
174/*
175 * dma_clean_range(start, end)
176 *
177 * Clean (write back) the specified virtual address range.
178 *
179 * - start - virtual start address
180 * - end - virtual end address
181 */
182ENTRY(fa_dma_clean_range)
183 bic r0, r0, #CACHE_DLINESIZE - 1
1841: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
185 add r0, r0, #CACHE_DLINESIZE
186 cmp r0, r1
187 blo 1b
188 mov r0, #0
189 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
190 mov pc, lr
191
192/*
193 * dma_flush_range(start,end)
194 * - start - virtual start address of region
195 * - end - virtual end address of region
196 */
197ENTRY(fa_dma_flush_range)
198 bic r0, r0, #CACHE_DLINESIZE - 1
1991: mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D entry
200 add r0, r0, #CACHE_DLINESIZE
201 cmp r0, r1
202 blo 1b
203 mov r0, #0
204 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
205 mov pc, lr
206
207 __INITDATA
208
209 .type fa_cache_fns, #object
210ENTRY(fa_cache_fns)
211 .long fa_flush_kern_cache_all
212 .long fa_flush_user_cache_all
213 .long fa_flush_user_cache_range
214 .long fa_coherent_kern_range
215 .long fa_coherent_user_range
216 .long fa_flush_kern_dcache_page
217 .long fa_dma_inv_range
218 .long fa_dma_clean_range
219 .long fa_dma_flush_range
220 .size fa_cache_fns, . - fa_cache_fns
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c
index 80cd207cbaea..d6dd83826f8a 100644
--- a/arch/arm/mm/cache-feroceon-l2.c
+++ b/arch/arm/mm/cache-feroceon-l2.c
@@ -14,8 +14,12 @@
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/kmap_types.h>
18#include <asm/fixmap.h>
19#include <asm/pgtable.h>
20#include <asm/tlbflush.h>
17#include <plat/cache-feroceon-l2.h> 21#include <plat/cache-feroceon-l2.h>
18 22#include "mm.h"
19 23
20/* 24/*
21 * Low-level cache maintenance operations. 25 * Low-level cache maintenance operations.
@@ -34,14 +38,36 @@
34 * The range operations require two successive cp15 writes, in 38 * The range operations require two successive cp15 writes, in
35 * between which we don't want to be preempted. 39 * between which we don't want to be preempted.
36 */ 40 */
41
42static inline unsigned long l2_start_va(unsigned long paddr)
43{
44#ifdef CONFIG_HIGHMEM
45 /*
46 * Let's do our own fixmap stuff in a minimal way here.
47 * Because range ops can't be done on physical addresses,
48 * we simply install a virtual mapping for it only for the
49 * TLB lookup to occur, hence no need to flush the untouched
50 * memory mapping. This is protected with the disabling of
51 * interrupts by the caller.
52 */
53 unsigned long idx = KM_L2_CACHE + KM_TYPE_NR * smp_processor_id();
54 unsigned long vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
55 set_pte_ext(TOP_PTE(vaddr), pfn_pte(paddr >> PAGE_SHIFT, PAGE_KERNEL), 0);
56 local_flush_tlb_kernel_page(vaddr);
57 return vaddr + (paddr & ~PAGE_MASK);
58#else
59 return __phys_to_virt(paddr);
60#endif
61}
62
37static inline void l2_clean_pa(unsigned long addr) 63static inline void l2_clean_pa(unsigned long addr)
38{ 64{
39 __asm__("mcr p15, 1, %0, c15, c9, 3" : : "r" (addr)); 65 __asm__("mcr p15, 1, %0, c15, c9, 3" : : "r" (addr));
40} 66}
41 67
42static inline void l2_clean_mva_range(unsigned long start, unsigned long end) 68static inline void l2_clean_pa_range(unsigned long start, unsigned long end)
43{ 69{
44 unsigned long flags; 70 unsigned long va_start, va_end, flags;
45 71
46 /* 72 /*
47 * Make sure 'start' and 'end' reference the same page, as 73 * Make sure 'start' and 'end' reference the same page, as
@@ -51,17 +77,14 @@ static inline void l2_clean_mva_range(unsigned long start, unsigned long end)
51 BUG_ON((start ^ end) >> PAGE_SHIFT); 77 BUG_ON((start ^ end) >> PAGE_SHIFT);
52 78
53 raw_local_irq_save(flags); 79 raw_local_irq_save(flags);
80 va_start = l2_start_va(start);
81 va_end = va_start + (end - start);
54 __asm__("mcr p15, 1, %0, c15, c9, 4\n\t" 82 __asm__("mcr p15, 1, %0, c15, c9, 4\n\t"
55 "mcr p15, 1, %1, c15, c9, 5" 83 "mcr p15, 1, %1, c15, c9, 5"
56 : : "r" (start), "r" (end)); 84 : : "r" (va_start), "r" (va_end));
57 raw_local_irq_restore(flags); 85 raw_local_irq_restore(flags);
58} 86}
59 87
60static inline void l2_clean_pa_range(unsigned long start, unsigned long end)
61{
62 l2_clean_mva_range(__phys_to_virt(start), __phys_to_virt(end));
63}
64
65static inline void l2_clean_inv_pa(unsigned long addr) 88static inline void l2_clean_inv_pa(unsigned long addr)
66{ 89{
67 __asm__("mcr p15, 1, %0, c15, c10, 3" : : "r" (addr)); 90 __asm__("mcr p15, 1, %0, c15, c10, 3" : : "r" (addr));
@@ -72,9 +95,9 @@ static inline void l2_inv_pa(unsigned long addr)
72 __asm__("mcr p15, 1, %0, c15, c11, 3" : : "r" (addr)); 95 __asm__("mcr p15, 1, %0, c15, c11, 3" : : "r" (addr));
73} 96}
74 97
75static inline void l2_inv_mva_range(unsigned long start, unsigned long end) 98static inline void l2_inv_pa_range(unsigned long start, unsigned long end)
76{ 99{
77 unsigned long flags; 100 unsigned long va_start, va_end, flags;
78 101
79 /* 102 /*
80 * Make sure 'start' and 'end' reference the same page, as 103 * Make sure 'start' and 'end' reference the same page, as
@@ -84,17 +107,14 @@ static inline void l2_inv_mva_range(unsigned long start, unsigned long end)
84 BUG_ON((start ^ end) >> PAGE_SHIFT); 107 BUG_ON((start ^ end) >> PAGE_SHIFT);
85 108
86 raw_local_irq_save(flags); 109 raw_local_irq_save(flags);
110 va_start = l2_start_va(start);
111 va_end = va_start + (end - start);
87 __asm__("mcr p15, 1, %0, c15, c11, 4\n\t" 112 __asm__("mcr p15, 1, %0, c15, c11, 4\n\t"
88 "mcr p15, 1, %1, c15, c11, 5" 113 "mcr p15, 1, %1, c15, c11, 5"
89 : : "r" (start), "r" (end)); 114 : : "r" (va_start), "r" (va_end));
90 raw_local_irq_restore(flags); 115 raw_local_irq_restore(flags);
91} 116}
92 117
93static inline void l2_inv_pa_range(unsigned long start, unsigned long end)
94{
95 l2_inv_mva_range(__phys_to_virt(start), __phys_to_virt(end));
96}
97
98 118
99/* 119/*
100 * Linux primitives. 120 * Linux primitives.
diff --git a/arch/arm/mm/cache-xsc3l2.c b/arch/arm/mm/cache-xsc3l2.c
index 464de893a988..5d180cb0bd94 100644
--- a/arch/arm/mm/cache-xsc3l2.c
+++ b/arch/arm/mm/cache-xsc3l2.c
@@ -17,12 +17,14 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 18 */
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/spinlock.h>
21#include <linux/io.h>
22
23#include <asm/system.h> 20#include <asm/system.h>
24#include <asm/cputype.h> 21#include <asm/cputype.h>
25#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/kmap_types.h>
24#include <asm/fixmap.h>
25#include <asm/pgtable.h>
26#include <asm/tlbflush.h>
27#include "mm.h"
26 28
27#define CR_L2 (1 << 26) 29#define CR_L2 (1 << 26)
28 30
@@ -47,21 +49,11 @@ static inline void xsc3_l2_clean_mva(unsigned long addr)
47 __asm__("mcr p15, 1, %0, c7, c11, 1" : : "r" (addr)); 49 __asm__("mcr p15, 1, %0, c7, c11, 1" : : "r" (addr));
48} 50}
49 51
50static inline void xsc3_l2_clean_pa(unsigned long addr)
51{
52 xsc3_l2_clean_mva(__phys_to_virt(addr));
53}
54
55static inline void xsc3_l2_inv_mva(unsigned long addr) 52static inline void xsc3_l2_inv_mva(unsigned long addr)
56{ 53{
57 __asm__("mcr p15, 1, %0, c7, c7, 1" : : "r" (addr)); 54 __asm__("mcr p15, 1, %0, c7, c7, 1" : : "r" (addr));
58} 55}
59 56
60static inline void xsc3_l2_inv_pa(unsigned long addr)
61{
62 xsc3_l2_inv_mva(__phys_to_virt(addr));
63}
64
65static inline void xsc3_l2_inv_all(void) 57static inline void xsc3_l2_inv_all(void)
66{ 58{
67 unsigned long l2ctype, set_way; 59 unsigned long l2ctype, set_way;
@@ -79,50 +71,103 @@ static inline void xsc3_l2_inv_all(void)
79 dsb(); 71 dsb();
80} 72}
81 73
74#ifdef CONFIG_HIGHMEM
75#define l2_map_save_flags(x) raw_local_save_flags(x)
76#define l2_map_restore_flags(x) raw_local_irq_restore(x)
77#else
78#define l2_map_save_flags(x) ((x) = 0)
79#define l2_map_restore_flags(x) ((void)(x))
80#endif
81
82static inline unsigned long l2_map_va(unsigned long pa, unsigned long prev_va,
83 unsigned long flags)
84{
85#ifdef CONFIG_HIGHMEM
86 unsigned long va = prev_va & PAGE_MASK;
87 unsigned long pa_offset = pa << (32 - PAGE_SHIFT);
88 if (unlikely(pa_offset < (prev_va << (32 - PAGE_SHIFT)))) {
89 /*
90 * Switching to a new page. Because cache ops are
91 * using virtual addresses only, we must put a mapping
92 * in place for it. We also enable interrupts for a
93 * short while and disable them again to protect this
94 * mapping.
95 */
96 unsigned long idx;
97 raw_local_irq_restore(flags);
98 idx = KM_L2_CACHE + KM_TYPE_NR * smp_processor_id();
99 va = __fix_to_virt(FIX_KMAP_BEGIN + idx);
100 raw_local_irq_restore(flags | PSR_I_BIT);
101 set_pte_ext(TOP_PTE(va), pfn_pte(pa >> PAGE_SHIFT, PAGE_KERNEL), 0);
102 local_flush_tlb_kernel_page(va);
103 }
104 return va + (pa_offset >> (32 - PAGE_SHIFT));
105#else
106 return __phys_to_virt(pa);
107#endif
108}
109
82static void xsc3_l2_inv_range(unsigned long start, unsigned long end) 110static void xsc3_l2_inv_range(unsigned long start, unsigned long end)
83{ 111{
112 unsigned long vaddr, flags;
113
84 if (start == 0 && end == -1ul) { 114 if (start == 0 && end == -1ul) {
85 xsc3_l2_inv_all(); 115 xsc3_l2_inv_all();
86 return; 116 return;
87 } 117 }
88 118
119 vaddr = -1; /* to force the first mapping */
120 l2_map_save_flags(flags);
121
89 /* 122 /*
90 * Clean and invalidate partial first cache line. 123 * Clean and invalidate partial first cache line.
91 */ 124 */
92 if (start & (CACHE_LINE_SIZE - 1)) { 125 if (start & (CACHE_LINE_SIZE - 1)) {
93 xsc3_l2_clean_pa(start & ~(CACHE_LINE_SIZE - 1)); 126 vaddr = l2_map_va(start & ~(CACHE_LINE_SIZE - 1), vaddr, flags);
94 xsc3_l2_inv_pa(start & ~(CACHE_LINE_SIZE - 1)); 127 xsc3_l2_clean_mva(vaddr);
128 xsc3_l2_inv_mva(vaddr);
95 start = (start | (CACHE_LINE_SIZE - 1)) + 1; 129 start = (start | (CACHE_LINE_SIZE - 1)) + 1;
96 } 130 }
97 131
98 /* 132 /*
99 * Clean and invalidate partial last cache line. 133 * Invalidate all full cache lines between 'start' and 'end'.
100 */ 134 */
101 if (start < end && (end & (CACHE_LINE_SIZE - 1))) { 135 while (start < (end & ~(CACHE_LINE_SIZE - 1))) {
102 xsc3_l2_clean_pa(end & ~(CACHE_LINE_SIZE - 1)); 136 vaddr = l2_map_va(start, vaddr, flags);
103 xsc3_l2_inv_pa(end & ~(CACHE_LINE_SIZE - 1)); 137 xsc3_l2_inv_mva(vaddr);
104 end &= ~(CACHE_LINE_SIZE - 1); 138 start += CACHE_LINE_SIZE;
105 } 139 }
106 140
107 /* 141 /*
108 * Invalidate all full cache lines between 'start' and 'end'. 142 * Clean and invalidate partial last cache line.
109 */ 143 */
110 while (start < end) { 144 if (start < end) {
111 xsc3_l2_inv_pa(start); 145 vaddr = l2_map_va(start, vaddr, flags);
112 start += CACHE_LINE_SIZE; 146 xsc3_l2_clean_mva(vaddr);
147 xsc3_l2_inv_mva(vaddr);
113 } 148 }
114 149
150 l2_map_restore_flags(flags);
151
115 dsb(); 152 dsb();
116} 153}
117 154
118static void xsc3_l2_clean_range(unsigned long start, unsigned long end) 155static void xsc3_l2_clean_range(unsigned long start, unsigned long end)
119{ 156{
157 unsigned long vaddr, flags;
158
159 vaddr = -1; /* to force the first mapping */
160 l2_map_save_flags(flags);
161
120 start &= ~(CACHE_LINE_SIZE - 1); 162 start &= ~(CACHE_LINE_SIZE - 1);
121 while (start < end) { 163 while (start < end) {
122 xsc3_l2_clean_pa(start); 164 vaddr = l2_map_va(start, vaddr, flags);
165 xsc3_l2_clean_mva(vaddr);
123 start += CACHE_LINE_SIZE; 166 start += CACHE_LINE_SIZE;
124 } 167 }
125 168
169 l2_map_restore_flags(flags);
170
126 dsb(); 171 dsb();
127} 172}
128 173
@@ -148,18 +193,26 @@ static inline void xsc3_l2_flush_all(void)
148 193
149static void xsc3_l2_flush_range(unsigned long start, unsigned long end) 194static void xsc3_l2_flush_range(unsigned long start, unsigned long end)
150{ 195{
196 unsigned long vaddr, flags;
197
151 if (start == 0 && end == -1ul) { 198 if (start == 0 && end == -1ul) {
152 xsc3_l2_flush_all(); 199 xsc3_l2_flush_all();
153 return; 200 return;
154 } 201 }
155 202
203 vaddr = -1; /* to force the first mapping */
204 l2_map_save_flags(flags);
205
156 start &= ~(CACHE_LINE_SIZE - 1); 206 start &= ~(CACHE_LINE_SIZE - 1);
157 while (start < end) { 207 while (start < end) {
158 xsc3_l2_clean_pa(start); 208 vaddr = l2_map_va(start, vaddr, flags);
159 xsc3_l2_inv_pa(start); 209 xsc3_l2_clean_mva(vaddr);
210 xsc3_l2_inv_mva(vaddr);
160 start += CACHE_LINE_SIZE; 211 start += CACHE_LINE_SIZE;
161 } 212 }
162 213
214 l2_map_restore_flags(flags);
215
163 dsb(); 216 dsb();
164} 217}
165 218
diff --git a/arch/arm/mm/copypage-fa.c b/arch/arm/mm/copypage-fa.c
new file mode 100644
index 000000000000..b2a6008b0111
--- /dev/null
+++ b/arch/arm/mm/copypage-fa.c
@@ -0,0 +1,86 @@
1/*
2 * linux/arch/arm/lib/copypage-fa.S
3 *
4 * Copyright (C) 2005 Faraday Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
6 *
7 * Based on copypage-v4wb.S:
8 * Copyright (C) 1995-1999 Russell King
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#include <linux/init.h>
15#include <linux/highmem.h>
16
17/*
18 * Faraday optimised copy_user_page
19 */
20static void __naked
21fa_copy_user_page(void *kto, const void *kfrom)
22{
23 asm("\
24 stmfd sp!, {r4, lr} @ 2\n\
25 mov r2, %0 @ 1\n\
261: ldmia r1!, {r3, r4, ip, lr} @ 4\n\
27 stmia r0, {r3, r4, ip, lr} @ 4\n\
28 mcr p15, 0, r0, c7, c14, 1 @ 1 clean and invalidate D line\n\
29 add r0, r0, #16 @ 1\n\
30 ldmia r1!, {r3, r4, ip, lr} @ 4\n\
31 stmia r0, {r3, r4, ip, lr} @ 4\n\
32 mcr p15, 0, r0, c7, c14, 1 @ 1 clean and invalidate D line\n\
33 add r0, r0, #16 @ 1\n\
34 subs r2, r2, #1 @ 1\n\
35 bne 1b @ 1\n\
36 mcr p15, 0, r2, c7, c10, 4 @ 1 drain WB\n\
37 ldmfd sp!, {r4, pc} @ 3"
38 :
39 : "I" (PAGE_SIZE / 32));
40}
41
42void fa_copy_user_highpage(struct page *to, struct page *from,
43 unsigned long vaddr)
44{
45 void *kto, *kfrom;
46
47 kto = kmap_atomic(to, KM_USER0);
48 kfrom = kmap_atomic(from, KM_USER1);
49 fa_copy_user_page(kto, kfrom);
50 kunmap_atomic(kfrom, KM_USER1);
51 kunmap_atomic(kto, KM_USER0);
52}
53
54/*
55 * Faraday optimised clear_user_page
56 *
57 * Same story as above.
58 */
59void fa_clear_user_highpage(struct page *page, unsigned long vaddr)
60{
61 void *ptr, *kaddr = kmap_atomic(page, KM_USER0);
62 asm volatile("\
63 mov r1, %2 @ 1\n\
64 mov r2, #0 @ 1\n\
65 mov r3, #0 @ 1\n\
66 mov ip, #0 @ 1\n\
67 mov lr, #0 @ 1\n\
681: stmia %0, {r2, r3, ip, lr} @ 4\n\
69 mcr p15, 0, %0, c7, c14, 1 @ 1 clean and invalidate D line\n\
70 add %0, %0, #16 @ 1\n\
71 stmia %0, {r2, r3, ip, lr} @ 4\n\
72 mcr p15, 0, %0, c7, c14, 1 @ 1 clean and invalidate D line\n\
73 add %0, %0, #16 @ 1\n\
74 subs r1, r1, #1 @ 1\n\
75 bne 1b @ 1\n\
76 mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB"
77 : "=r" (ptr)
78 : "0" (kaddr), "I" (PAGE_SIZE / 32)
79 : "r1", "r2", "r3", "ip", "lr");
80 kunmap_atomic(kaddr, KM_USER0);
81}
82
83struct cpu_user_fns fa_user_fns __initdata = {
84 .cpu_clear_user_highpage = fa_clear_user_highpage,
85 .cpu_copy_user_highpage = fa_copy_user_highpage,
86};
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index f1ef5613ccd4..510c179b0ac8 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -19,6 +19,7 @@
19#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
20 20
21#include <asm/memory.h> 21#include <asm/memory.h>
22#include <asm/highmem.h>
22#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
23#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
24#include <asm/sizes.h> 25#include <asm/sizes.h>
@@ -517,6 +518,74 @@ void dma_cache_maint(const void *start, size_t size, int direction)
517} 518}
518EXPORT_SYMBOL(dma_cache_maint); 519EXPORT_SYMBOL(dma_cache_maint);
519 520
521static void dma_cache_maint_contiguous(struct page *page, unsigned long offset,
522 size_t size, int direction)
523{
524 void *vaddr;
525 unsigned long paddr;
526 void (*inner_op)(const void *, const void *);
527 void (*outer_op)(unsigned long, unsigned long);
528
529 switch (direction) {
530 case DMA_FROM_DEVICE: /* invalidate only */
531 inner_op = dmac_inv_range;
532 outer_op = outer_inv_range;
533 break;
534 case DMA_TO_DEVICE: /* writeback only */
535 inner_op = dmac_clean_range;
536 outer_op = outer_clean_range;
537 break;
538 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
539 inner_op = dmac_flush_range;
540 outer_op = outer_flush_range;
541 break;
542 default:
543 BUG();
544 }
545
546 if (!PageHighMem(page)) {
547 vaddr = page_address(page) + offset;
548 inner_op(vaddr, vaddr + size);
549 } else {
550 vaddr = kmap_high_get(page);
551 if (vaddr) {
552 vaddr += offset;
553 inner_op(vaddr, vaddr + size);
554 kunmap_high(page);
555 }
556 }
557
558 paddr = page_to_phys(page) + offset;
559 outer_op(paddr, paddr + size);
560}
561
562void dma_cache_maint_page(struct page *page, unsigned long offset,
563 size_t size, int dir)
564{
565 /*
566 * A single sg entry may refer to multiple physically contiguous
567 * pages. But we still need to process highmem pages individually.
568 * If highmem is not configured then the bulk of this loop gets
569 * optimized out.
570 */
571 size_t left = size;
572 do {
573 size_t len = left;
574 if (PageHighMem(page) && len + offset > PAGE_SIZE) {
575 if (offset >= PAGE_SIZE) {
576 page += offset / PAGE_SIZE;
577 offset %= PAGE_SIZE;
578 }
579 len = PAGE_SIZE - offset;
580 }
581 dma_cache_maint_contiguous(page, offset, len, dir);
582 offset = 0;
583 page++;
584 left -= len;
585 } while (left);
586}
587EXPORT_SYMBOL(dma_cache_maint_page);
588
520/** 589/**
521 * dma_map_sg - map a set of SG buffers for streaming mode DMA 590 * dma_map_sg - map a set of SG buffers for streaming mode DMA
522 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices 591 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
@@ -614,7 +683,8 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
614 continue; 683 continue;
615 684
616 if (!arch_is_coherent()) 685 if (!arch_is_coherent())
617 dma_cache_maint(sg_virt(s), s->length, dir); 686 dma_cache_maint_page(sg_page(s), s->offset,
687 s->length, dir);
618 } 688 }
619} 689}
620EXPORT_SYMBOL(dma_sync_sg_for_device); 690EXPORT_SYMBOL(dma_sync_sg_for_device);
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 0fa9bf388f0b..4e283481cee1 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -192,7 +192,7 @@ void flush_dcache_page(struct page *page)
192 struct address_space *mapping = page_mapping(page); 192 struct address_space *mapping = page_mapping(page);
193 193
194#ifndef CONFIG_SMP 194#ifndef CONFIG_SMP
195 if (mapping && !mapping_mapped(mapping)) 195 if (!PageHighMem(page) && mapping && !mapping_mapped(mapping))
196 set_bit(PG_dcache_dirty, &page->flags); 196 set_bit(PG_dcache_dirty, &page->flags);
197 else 197 else
198#endif 198#endif
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
new file mode 100644
index 000000000000..a34954d9df7d
--- /dev/null
+++ b/arch/arm/mm/highmem.c
@@ -0,0 +1,116 @@
1/*
2 * arch/arm/mm/highmem.c -- ARM highmem support
3 *
4 * Author: Nicolas Pitre
5 * Created: september 8, 2008
6 * Copyright: Marvell Semiconductors Inc.
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/module.h>
14#include <linux/highmem.h>
15#include <linux/interrupt.h>
16#include <asm/fixmap.h>
17#include <asm/cacheflush.h>
18#include <asm/tlbflush.h>
19#include "mm.h"
20
21void *kmap(struct page *page)
22{
23 might_sleep();
24 if (!PageHighMem(page))
25 return page_address(page);
26 return kmap_high(page);
27}
28EXPORT_SYMBOL(kmap);
29
30void kunmap(struct page *page)
31{
32 BUG_ON(in_interrupt());
33 if (!PageHighMem(page))
34 return;
35 kunmap_high(page);
36}
37EXPORT_SYMBOL(kunmap);
38
39void *kmap_atomic(struct page *page, enum km_type type)
40{
41 unsigned int idx;
42 unsigned long vaddr;
43
44 pagefault_disable();
45 if (!PageHighMem(page))
46 return page_address(page);
47
48 idx = type + KM_TYPE_NR * smp_processor_id();
49 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
50#ifdef CONFIG_DEBUG_HIGHMEM
51 /*
52 * With debugging enabled, kunmap_atomic forces that entry to 0.
53 * Make sure it was indeed properly unmapped.
54 */
55 BUG_ON(!pte_none(*(TOP_PTE(vaddr))));
56#endif
57 set_pte_ext(TOP_PTE(vaddr), mk_pte(page, kmap_prot), 0);
58 /*
59 * When debugging is off, kunmap_atomic leaves the previous mapping
60 * in place, so this TLB flush ensures the TLB is updated with the
61 * new mapping.
62 */
63 local_flush_tlb_kernel_page(vaddr);
64
65 return (void *)vaddr;
66}
67EXPORT_SYMBOL(kmap_atomic);
68
69void kunmap_atomic(void *kvaddr, enum km_type type)
70{
71 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
72 unsigned int idx = type + KM_TYPE_NR * smp_processor_id();
73
74 if (kvaddr >= (void *)FIXADDR_START) {
75 __cpuc_flush_dcache_page((void *)vaddr);
76#ifdef CONFIG_DEBUG_HIGHMEM
77 BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
78 set_pte_ext(TOP_PTE(vaddr), __pte(0), 0);
79 local_flush_tlb_kernel_page(vaddr);
80#else
81 (void) idx; /* to kill a warning */
82#endif
83 }
84 pagefault_enable();
85}
86EXPORT_SYMBOL(kunmap_atomic);
87
88void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
89{
90 unsigned int idx;
91 unsigned long vaddr;
92
93 pagefault_disable();
94
95 idx = type + KM_TYPE_NR * smp_processor_id();
96 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
97#ifdef CONFIG_DEBUG_HIGHMEM
98 BUG_ON(!pte_none(*(TOP_PTE(vaddr))));
99#endif
100 set_pte_ext(TOP_PTE(vaddr), pfn_pte(pfn, kmap_prot), 0);
101 local_flush_tlb_kernel_page(vaddr);
102
103 return (void *)vaddr;
104}
105
106struct page *kmap_atomic_to_page(const void *ptr)
107{
108 unsigned long vaddr = (unsigned long)ptr;
109 pte_t *pte;
110
111 if (vaddr < FIXADDR_START)
112 return virt_to_page(ptr);
113
114 pte = TOP_PTE(vaddr);
115 return pte_page(*pte);
116}
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 80fd3b69ae1f..8277802ec859 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -15,6 +15,7 @@
15#include <linux/mman.h> 15#include <linux/mman.h>
16#include <linux/nodemask.h> 16#include <linux/nodemask.h>
17#include <linux/initrd.h> 17#include <linux/initrd.h>
18#include <linux/highmem.h>
18 19
19#include <asm/mach-types.h> 20#include <asm/mach-types.h>
20#include <asm/sections.h> 21#include <asm/sections.h>
@@ -485,7 +486,7 @@ void __init mem_init(void)
485 int i, node; 486 int i, node;
486 487
487#ifndef CONFIG_DISCONTIGMEM 488#ifndef CONFIG_DISCONTIGMEM
488 max_mapnr = virt_to_page(high_memory) - mem_map; 489 max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
489#endif 490#endif
490 491
491 /* this will put all unused low memory onto the freelists */ 492 /* this will put all unused low memory onto the freelists */
@@ -504,6 +505,19 @@ void __init mem_init(void)
504 __phys_to_pfn(__pa(swapper_pg_dir)), NULL); 505 __phys_to_pfn(__pa(swapper_pg_dir)), NULL);
505#endif 506#endif
506 507
508#ifdef CONFIG_HIGHMEM
509 /* set highmem page free */
510 for_each_online_node(node) {
511 for_each_nodebank (i, &meminfo, node) {
512 unsigned long start = bank_pfn_start(&meminfo.bank[i]);
513 unsigned long end = bank_pfn_end(&meminfo.bank[i]);
514 if (start >= max_low_pfn + PHYS_PFN_OFFSET)
515 totalhigh_pages += free_area(start, end, NULL);
516 }
517 }
518 totalram_pages += totalhigh_pages;
519#endif
520
507 /* 521 /*
508 * Since our memory may not be contiguous, calculate the 522 * Since our memory may not be contiguous, calculate the
509 * real number of pages we have in this system 523 * real number of pages we have in this system
@@ -521,9 +535,10 @@ void __init mem_init(void)
521 initsize = __init_end - __init_begin; 535 initsize = __init_end - __init_begin;
522 536
523 printk(KERN_NOTICE "Memory: %luKB available (%dK code, " 537 printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
524 "%dK data, %dK init)\n", 538 "%dK data, %dK init, %luK highmem)\n",
525 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), 539 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
526 codesize >> 10, datasize >> 10, initsize >> 10); 540 codesize >> 10, datasize >> 10, initsize >> 10,
541 (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
527 542
528 if (PAGE_SIZE >= 16384 && num_physpages <= 128) { 543 if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
529 extern int sysctl_overcommit_memory; 544 extern int sysctl_overcommit_memory;
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 95bbe112965e..c4f6f05198e0 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -1,7 +1,6 @@
1/* the upper-most page table pointer */
2
3#ifdef CONFIG_MMU 1#ifdef CONFIG_MMU
4 2
3/* the upper-most page table pointer */
5extern pmd_t *top_pmd; 4extern pmd_t *top_pmd;
6 5
7#define TOP_PTE(x) pte_offset_kernel(top_pmd, x) 6#define TOP_PTE(x) pte_offset_kernel(top_pmd, x)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index d4d082c5c2d4..b438fc4fb77b 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -18,9 +18,11 @@
18#include <asm/cputype.h> 18#include <asm/cputype.h>
19#include <asm/mach-types.h> 19#include <asm/mach-types.h>
20#include <asm/sections.h> 20#include <asm/sections.h>
21#include <asm/cachetype.h>
21#include <asm/setup.h> 22#include <asm/setup.h>
22#include <asm/sizes.h> 23#include <asm/sizes.h>
23#include <asm/tlb.h> 24#include <asm/tlb.h>
25#include <asm/highmem.h>
24 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>
@@ -243,6 +245,10 @@ static struct mem_type mem_types[] = {
243 .prot_sect = PMD_TYPE_SECT, 245 .prot_sect = PMD_TYPE_SECT,
244 .domain = DOMAIN_KERNEL, 246 .domain = DOMAIN_KERNEL,
245 }, 247 },
248 [MT_MEMORY_NONCACHED] = {
249 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
250 .domain = DOMAIN_KERNEL,
251 },
246}; 252};
247 253
248const struct mem_type *get_mem_type(unsigned int type) 254const struct mem_type *get_mem_type(unsigned int type)
@@ -406,9 +412,28 @@ static void __init build_mem_type_table(void)
406 kern_pgprot |= L_PTE_SHARED; 412 kern_pgprot |= L_PTE_SHARED;
407 vecs_pgprot |= L_PTE_SHARED; 413 vecs_pgprot |= L_PTE_SHARED;
408 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; 414 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
415 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
409#endif 416#endif
410 } 417 }
411 418
419 /*
420 * Non-cacheable Normal - intended for memory areas that must
421 * not cause dirty cache line writebacks when used
422 */
423 if (cpu_arch >= CPU_ARCH_ARMv6) {
424 if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
425 /* Non-cacheable Normal is XCB = 001 */
426 mem_types[MT_MEMORY_NONCACHED].prot_sect |=
427 PMD_SECT_BUFFERED;
428 } else {
429 /* For both ARMv6 and non-TEX-remapping ARMv7 */
430 mem_types[MT_MEMORY_NONCACHED].prot_sect |=
431 PMD_SECT_TEX(1);
432 }
433 } else {
434 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE;
435 }
436
412 for (i = 0; i < 16; i++) { 437 for (i = 0; i < 16; i++) {
413 unsigned long v = pgprot_val(protection_map[i]); 438 unsigned long v = pgprot_val(protection_map[i]);
414 protection_map[i] = __pgprot(v | user_pgprot); 439 protection_map[i] = __pgprot(v | user_pgprot);
@@ -677,6 +702,10 @@ static void __init sanity_check_meminfo(void)
677 if (meminfo.nr_banks >= NR_BANKS) { 702 if (meminfo.nr_banks >= NR_BANKS) {
678 printk(KERN_CRIT "NR_BANKS too low, " 703 printk(KERN_CRIT "NR_BANKS too low, "
679 "ignoring high memory\n"); 704 "ignoring high memory\n");
705 } else if (cache_is_vipt_aliasing()) {
706 printk(KERN_CRIT "HIGHMEM is not yet supported "
707 "with VIPT aliasing cache, "
708 "ignoring high memory\n");
680 } else { 709 } else {
681 memmove(bank + 1, bank, 710 memmove(bank + 1, bank,
682 (meminfo.nr_banks - i) * sizeof(*bank)); 711 (meminfo.nr_banks - i) * sizeof(*bank));
@@ -694,7 +723,7 @@ static void __init sanity_check_meminfo(void)
694 * the vmalloc area. 723 * the vmalloc area.
695 */ 724 */
696 if (__va(bank->start) >= VMALLOC_MIN || 725 if (__va(bank->start) >= VMALLOC_MIN ||
697 __va(bank->start) < PAGE_OFFSET) { 726 __va(bank->start) < (void *)PAGE_OFFSET) {
698 printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx " 727 printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
699 "(vmalloc region overlap).\n", 728 "(vmalloc region overlap).\n",
700 bank->start, bank->start + bank->size - 1); 729 bank->start, bank->start + bank->size - 1);
@@ -895,6 +924,17 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
895 flush_cache_all(); 924 flush_cache_all();
896} 925}
897 926
927static void __init kmap_init(void)
928{
929#ifdef CONFIG_HIGHMEM
930 pmd_t *pmd = pmd_off_k(PKMAP_BASE);
931 pte_t *pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t));
932 BUG_ON(!pmd_none(*pmd) || !pte);
933 __pmd_populate(pmd, __pa(pte) | _PAGE_KERNEL_TABLE);
934 pkmap_page_table = pte + PTRS_PER_PTE;
935#endif
936}
937
898/* 938/*
899 * paging_init() sets up the page tables, initialises the zone memory 939 * paging_init() sets up the page tables, initialises the zone memory
900 * maps, and sets up the zero page, bad page and bad page tables. 940 * maps, and sets up the zero page, bad page and bad page tables.
@@ -908,6 +948,7 @@ void __init paging_init(struct machine_desc *mdesc)
908 prepare_page_table(); 948 prepare_page_table();
909 bootmem_init(); 949 bootmem_init();
910 devicemaps_init(mdesc); 950 devicemaps_init(mdesc);
951 kmap_init();
911 952
912 top_pmd = pmd_off_k(0xffff0000); 953 top_pmd = pmd_off_k(0xffff0000);
913 954
diff --git a/arch/arm/mm/proc-fa526.S b/arch/arm/mm/proc-fa526.S
new file mode 100644
index 000000000000..08b8a955d5d7
--- /dev/null
+++ b/arch/arm/mm/proc-fa526.S
@@ -0,0 +1,248 @@
1/*
2 * linux/arch/arm/mm/proc-fa526.S: MMU functions for FA526
3 *
4 * Written by : Luke Lee
5 * Copyright (C) 2005 Faraday Corp.
6 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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 *
14 * These are the low level assembler for performing cache and TLB
15 * functions on the fa526.
16 */
17#include <linux/linkage.h>
18#include <linux/init.h>
19#include <asm/assembler.h>
20#include <asm/hwcap.h>
21#include <asm/pgtable-hwdef.h>
22#include <asm/pgtable.h>
23#include <asm/page.h>
24#include <asm/ptrace.h>
25#include <asm/system.h>
26
27#include "proc-macros.S"
28
29#define CACHE_DLINESIZE 16
30
31 .text
32/*
33 * cpu_fa526_proc_init()
34 */
35ENTRY(cpu_fa526_proc_init)
36 mov pc, lr
37
38/*
39 * cpu_fa526_proc_fin()
40 */
41ENTRY(cpu_fa526_proc_fin)
42 stmfd sp!, {lr}
43 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
44 msr cpsr_c, ip
45 bl fa_flush_kern_cache_all
46 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
47 bic r0, r0, #0x1000 @ ...i............
48 bic r0, r0, #0x000e @ ............wca.
49 mcr p15, 0, r0, c1, c0, 0 @ disable caches
50 nop
51 nop
52 ldmfd sp!, {pc}
53
54/*
55 * cpu_fa526_reset(loc)
56 *
57 * Perform a soft reset of the system. Put the CPU into the
58 * same state as it would be if it had been reset, and branch
59 * to what would be the reset vector.
60 *
61 * loc: location to jump to for soft reset
62 */
63 .align 4
64ENTRY(cpu_fa526_reset)
65/* TODO: Use CP8 if possible... */
66 mov ip, #0
67 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
68 mcr p15, 0, ip, c7, c10, 4 @ drain WB
69#ifdef CONFIG_MMU
70 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
71#endif
72 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
73 bic ip, ip, #0x000f @ ............wcam
74 bic ip, ip, #0x1100 @ ...i...s........
75 bic ip, ip, #0x0800 @ BTB off
76 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
77 nop
78 nop
79 mov pc, r0
80
81/*
82 * cpu_fa526_do_idle()
83 */
84 .align 4
85ENTRY(cpu_fa526_do_idle)
86 mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
87 mov pc, lr
88
89
90ENTRY(cpu_fa526_dcache_clean_area)
911: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
92 add r0, r0, #CACHE_DLINESIZE
93 subs r1, r1, #CACHE_DLINESIZE
94 bhi 1b
95 mcr p15, 0, r0, c7, c10, 4 @ drain WB
96 mov pc, lr
97
98/* =============================== PageTable ============================== */
99
100/*
101 * cpu_fa526_switch_mm(pgd)
102 *
103 * Set the translation base pointer to be as described by pgd.
104 *
105 * pgd: new page tables
106 */
107 .align 4
108ENTRY(cpu_fa526_switch_mm)
109#ifdef CONFIG_MMU
110 mov ip, #0
111#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
112 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache
113#else
114 mcr p15, 0, ip, c7, c14, 0 @ clean and invalidate whole D cache
115#endif
116 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
117 mcr p15, 0, ip, c7, c5, 6 @ invalidate BTB since mm changed
118 mcr p15, 0, ip, c7, c10, 4 @ data write barrier
119 mcr p15, 0, ip, c7, c5, 4 @ prefetch flush
120 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
121 mcr p15, 0, ip, c8, c7, 0 @ invalidate UTLB
122#endif
123 mov pc, lr
124
125/*
126 * cpu_fa526_set_pte_ext(ptep, pte, ext)
127 *
128 * Set a PTE and flush it out
129 */
130 .align 4
131ENTRY(cpu_fa526_set_pte_ext)
132#ifdef CONFIG_MMU
133 armv3_set_pte_ext
134 mov r0, r0
135 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
136 mov r0, #0
137 mcr p15, 0, r0, c7, c10, 4 @ drain WB
138#endif
139 mov pc, lr
140
141 __INIT
142
143 .type __fa526_setup, #function
144__fa526_setup:
145 /* On return of this routine, r0 must carry correct flags for CFG register */
146 mov r0, #0
147 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
148 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
149#ifdef CONFIG_MMU
150 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4
151#endif
152 mcr p15, 0, r0, c7, c5, 5 @ invalidate IScratchpad RAM
153
154 mov r0, #1
155 mcr p15, 0, r0, c1, c1, 0 @ turn-on ECR
156
157 mov r0, #0
158 mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB All
159 mcr p15, 0, r0, c7, c10, 4 @ data write barrier
160 mcr p15, 0, r0, c7, c5, 4 @ prefetch flush
161
162 mov r0, #0x1f @ Domains 0, 1 = manager, 2 = client
163 mcr p15, 0, r0, c3, c0 @ load domain access register
164
165 mrc p15, 0, r0, c1, c0 @ get control register v4
166 ldr r5, fa526_cr1_clear
167 bic r0, r0, r5
168 ldr r5, fa526_cr1_set
169 orr r0, r0, r5
170 mov pc, lr
171 .size __fa526_setup, . - __fa526_setup
172
173 /*
174 * .RVI ZFRS BLDP WCAM
175 * ..11 1001 .111 1101
176 *
177 */
178 .type fa526_cr1_clear, #object
179 .type fa526_cr1_set, #object
180fa526_cr1_clear:
181 .word 0x3f3f
182fa526_cr1_set:
183 .word 0x397D
184
185 __INITDATA
186
187/*
188 * Purpose : Function pointers used to access above functions - all calls
189 * come through these
190 */
191 .type fa526_processor_functions, #object
192fa526_processor_functions:
193 .word v4_early_abort
194 .word pabort_noifar
195 .word cpu_fa526_proc_init
196 .word cpu_fa526_proc_fin
197 .word cpu_fa526_reset
198 .word cpu_fa526_do_idle
199 .word cpu_fa526_dcache_clean_area
200 .word cpu_fa526_switch_mm
201 .word cpu_fa526_set_pte_ext
202 .size fa526_processor_functions, . - fa526_processor_functions
203
204 .section ".rodata"
205
206 .type cpu_arch_name, #object
207cpu_arch_name:
208 .asciz "armv4"
209 .size cpu_arch_name, . - cpu_arch_name
210
211 .type cpu_elf_name, #object
212cpu_elf_name:
213 .asciz "v4"
214 .size cpu_elf_name, . - cpu_elf_name
215
216 .type cpu_fa526_name, #object
217cpu_fa526_name:
218 .asciz "FA526"
219 .size cpu_fa526_name, . - cpu_fa526_name
220
221 .align
222
223 .section ".proc.info.init", #alloc, #execinstr
224
225 .type __fa526_proc_info,#object
226__fa526_proc_info:
227 .long 0x66015261
228 .long 0xff01fff1
229 .long PMD_TYPE_SECT | \
230 PMD_SECT_BUFFERABLE | \
231 PMD_SECT_CACHEABLE | \
232 PMD_BIT4 | \
233 PMD_SECT_AP_WRITE | \
234 PMD_SECT_AP_READ
235 .long PMD_TYPE_SECT | \
236 PMD_BIT4 | \
237 PMD_SECT_AP_WRITE | \
238 PMD_SECT_AP_READ
239 b __fa526_setup
240 .long cpu_arch_name
241 .long cpu_elf_name
242 .long HWCAP_SWP | HWCAP_HALF
243 .long cpu_fa526_name
244 .long fa526_processor_functions
245 .long fa_tlb_fns
246 .long fa_user_fns
247 .long fa_cache_fns
248 .size __fa526_proc_info, . - __fa526_proc_info
diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S
new file mode 100644
index 000000000000..540f5078496b
--- /dev/null
+++ b/arch/arm/mm/proc-mohawk.S
@@ -0,0 +1,416 @@
1/*
2 * linux/arch/arm/mm/proc-mohawk.S: MMU functions for Marvell PJ1 core
3 *
4 * PJ1 (codename Mohawk) is a hybrid of the xscale3 and Marvell's own core.
5 *
6 * Heavily based on proc-arm926.S and proc-xsc3.S
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 <linux/linkage.h>
24#include <linux/init.h>
25#include <asm/assembler.h>
26#include <asm/hwcap.h>
27#include <asm/pgtable-hwdef.h>
28#include <asm/pgtable.h>
29#include <asm/page.h>
30#include <asm/ptrace.h>
31#include "proc-macros.S"
32
33/*
34 * This is the maximum size of an area which will be flushed. If the
35 * area is larger than this, then we flush the whole cache.
36 */
37#define CACHE_DLIMIT 32768
38
39/*
40 * The cache line size of the L1 D cache.
41 */
42#define CACHE_DLINESIZE 32
43
44/*
45 * cpu_mohawk_proc_init()
46 */
47ENTRY(cpu_mohawk_proc_init)
48 mov pc, lr
49
50/*
51 * cpu_mohawk_proc_fin()
52 */
53ENTRY(cpu_mohawk_proc_fin)
54 stmfd sp!, {lr}
55 mov ip, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
56 msr cpsr_c, ip
57 bl mohawk_flush_kern_cache_all
58 mrc p15, 0, r0, c1, c0, 0 @ ctrl register
59 bic r0, r0, #0x1800 @ ...iz...........
60 bic r0, r0, #0x0006 @ .............ca.
61 mcr p15, 0, r0, c1, c0, 0 @ disable caches
62 ldmfd sp!, {pc}
63
64/*
65 * cpu_mohawk_reset(loc)
66 *
67 * Perform a soft reset of the system. Put the CPU into the
68 * same state as it would be if it had been reset, and branch
69 * to what would be the reset vector.
70 *
71 * loc: location to jump to for soft reset
72 *
73 * (same as arm926)
74 */
75 .align 5
76ENTRY(cpu_mohawk_reset)
77 mov ip, #0
78 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
79 mcr p15, 0, ip, c7, c10, 4 @ drain WB
80 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
81 mrc p15, 0, ip, c1, c0, 0 @ ctrl register
82 bic ip, ip, #0x0007 @ .............cam
83 bic ip, ip, #0x1100 @ ...i...s........
84 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
85 mov pc, r0
86
87/*
88 * cpu_mohawk_do_idle()
89 *
90 * Called with IRQs disabled
91 */
92 .align 5
93ENTRY(cpu_mohawk_do_idle)
94 mov r0, #0
95 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
96 mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt
97 mov pc, lr
98
99/*
100 * flush_user_cache_all()
101 *
102 * Clean and invalidate all cache entries in a particular
103 * address space.
104 */
105ENTRY(mohawk_flush_user_cache_all)
106 /* FALLTHROUGH */
107
108/*
109 * flush_kern_cache_all()
110 *
111 * Clean and invalidate the entire cache.
112 */
113ENTRY(mohawk_flush_kern_cache_all)
114 mov r2, #VM_EXEC
115 mov ip, #0
116__flush_whole_cache:
117 mcr p15, 0, ip, c7, c14, 0 @ clean & invalidate all D cache
118 tst r2, #VM_EXEC
119 mcrne p15, 0, ip, c7, c5, 0 @ invalidate I cache
120 mcrne p15, 0, ip, c7, c10, 0 @ drain write buffer
121 mov pc, lr
122
123/*
124 * flush_user_cache_range(start, end, flags)
125 *
126 * Clean and invalidate a range of cache entries in the
127 * specified address range.
128 *
129 * - start - start address (inclusive)
130 * - end - end address (exclusive)
131 * - flags - vm_flags describing address space
132 *
133 * (same as arm926)
134 */
135ENTRY(mohawk_flush_user_cache_range)
136 mov ip, #0
137 sub r3, r1, r0 @ calculate total size
138 cmp r3, #CACHE_DLIMIT
139 bgt __flush_whole_cache
1401: tst r2, #VM_EXEC
141 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
142 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
143 add r0, r0, #CACHE_DLINESIZE
144 mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D entry
145 mcrne p15, 0, r0, c7, c5, 1 @ invalidate I entry
146 add r0, r0, #CACHE_DLINESIZE
147 cmp r0, r1
148 blo 1b
149 tst r2, #VM_EXEC
150 mcrne p15, 0, ip, c7, c10, 4 @ drain WB
151 mov pc, lr
152
153/*
154 * coherent_kern_range(start, end)
155 *
156 * Ensure coherency between the Icache and the Dcache in the
157 * region described by start, end. If you have non-snooping
158 * Harvard caches, you need to implement this function.
159 *
160 * - start - virtual start address
161 * - end - virtual end address
162 */
163ENTRY(mohawk_coherent_kern_range)
164 /* FALLTHROUGH */
165
166/*
167 * coherent_user_range(start, end)
168 *
169 * Ensure coherency between the Icache and the Dcache in the
170 * region described by start, end. If you have non-snooping
171 * Harvard caches, you need to implement this function.
172 *
173 * - start - virtual start address
174 * - end - virtual end address
175 *
176 * (same as arm926)
177 */
178ENTRY(mohawk_coherent_user_range)
179 bic r0, r0, #CACHE_DLINESIZE - 1
1801: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
181 mcr p15, 0, r0, c7, c5, 1 @ invalidate I entry
182 add r0, r0, #CACHE_DLINESIZE
183 cmp r0, r1
184 blo 1b
185 mcr p15, 0, r0, c7, c10, 4 @ drain WB
186 mov pc, lr
187
188/*
189 * flush_kern_dcache_page(void *page)
190 *
191 * Ensure no D cache aliasing occurs, either with itself or
192 * the I cache
193 *
194 * - addr - page aligned address
195 */
196ENTRY(mohawk_flush_kern_dcache_page)
197 add r1, r0, #PAGE_SZ
1981: mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
199 add r0, r0, #CACHE_DLINESIZE
200 cmp r0, r1
201 blo 1b
202 mov r0, #0
203 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
204 mcr p15, 0, r0, c7, c10, 4 @ drain WB
205 mov pc, lr
206
207/*
208 * dma_inv_range(start, end)
209 *
210 * Invalidate (discard) the specified virtual address range.
211 * May not write back any entries. If 'start' or 'end'
212 * are not cache line aligned, those lines must be written
213 * back.
214 *
215 * - start - virtual start address
216 * - end - virtual end address
217 *
218 * (same as v4wb)
219 */
220ENTRY(mohawk_dma_inv_range)
221 tst r0, #CACHE_DLINESIZE - 1
222 mcrne p15, 0, r0, c7, c10, 1 @ clean D entry
223 tst r1, #CACHE_DLINESIZE - 1
224 mcrne p15, 0, r1, c7, c10, 1 @ clean D entry
225 bic r0, r0, #CACHE_DLINESIZE - 1
2261: mcr p15, 0, r0, c7, c6, 1 @ invalidate D entry
227 add r0, r0, #CACHE_DLINESIZE
228 cmp r0, r1
229 blo 1b
230 mcr p15, 0, r0, c7, c10, 4 @ drain WB
231 mov pc, lr
232
233/*
234 * dma_clean_range(start, end)
235 *
236 * Clean the specified virtual address range.
237 *
238 * - start - virtual start address
239 * - end - virtual end address
240 *
241 * (same as v4wb)
242 */
243ENTRY(mohawk_dma_clean_range)
244 bic r0, r0, #CACHE_DLINESIZE - 1
2451: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
246 add r0, r0, #CACHE_DLINESIZE
247 cmp r0, r1
248 blo 1b
249 mcr p15, 0, r0, c7, c10, 4 @ drain WB
250 mov pc, lr
251
252/*
253 * dma_flush_range(start, end)
254 *
255 * Clean and invalidate the specified virtual address range.
256 *
257 * - start - virtual start address
258 * - end - virtual end address
259 */
260ENTRY(mohawk_dma_flush_range)
261 bic r0, r0, #CACHE_DLINESIZE - 1
2621:
263 mcr p15, 0, r0, c7, c14, 1 @ clean+invalidate D entry
264 add r0, r0, #CACHE_DLINESIZE
265 cmp r0, r1
266 blo 1b
267 mcr p15, 0, r0, c7, c10, 4 @ drain WB
268 mov pc, lr
269
270ENTRY(mohawk_cache_fns)
271 .long mohawk_flush_kern_cache_all
272 .long mohawk_flush_user_cache_all
273 .long mohawk_flush_user_cache_range
274 .long mohawk_coherent_kern_range
275 .long mohawk_coherent_user_range
276 .long mohawk_flush_kern_dcache_page
277 .long mohawk_dma_inv_range
278 .long mohawk_dma_clean_range
279 .long mohawk_dma_flush_range
280
281ENTRY(cpu_mohawk_dcache_clean_area)
2821: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
283 add r0, r0, #CACHE_DLINESIZE
284 subs r1, r1, #CACHE_DLINESIZE
285 bhi 1b
286 mcr p15, 0, r0, c7, c10, 4 @ drain WB
287 mov pc, lr
288
289/*
290 * cpu_mohawk_switch_mm(pgd)
291 *
292 * Set the translation base pointer to be as described by pgd.
293 *
294 * pgd: new page tables
295 */
296 .align 5
297ENTRY(cpu_mohawk_switch_mm)
298 mov ip, #0
299 mcr p15, 0, ip, c7, c14, 0 @ clean & invalidate all D cache
300 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
301 mcr p15, 0, ip, c7, c10, 4 @ drain WB
302 orr r0, r0, #0x18 @ cache the page table in L2
303 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
304 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
305 mov pc, lr
306
307/*
308 * cpu_mohawk_set_pte_ext(ptep, pte, ext)
309 *
310 * Set a PTE and flush it out
311 */
312 .align 5
313ENTRY(cpu_mohawk_set_pte_ext)
314 armv3_set_pte_ext
315 mov r0, r0
316 mcr p15, 0, r0, c7, c10, 1 @ clean D entry
317 mcr p15, 0, r0, c7, c10, 4 @ drain WB
318 mov pc, lr
319
320 __INIT
321
322 .type __mohawk_setup, #function
323__mohawk_setup:
324 mov r0, #0
325 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches
326 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
327 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs
328 orr r4, r4, #0x18 @ cache the page table in L2
329 mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
330
331 mov r0, #0 @ don't allow CP access
332 mcr p15, 0, r0, c15, c1, 0 @ write CP access register
333
334 adr r5, mohawk_crval
335 ldmia r5, {r5, r6}
336 mrc p15, 0, r0, c1, c0 @ get control register
337 bic r0, r0, r5
338 orr r0, r0, r6
339 mov pc, lr
340
341 .size __mohawk_setup, . - __mohawk_setup
342
343 /*
344 * R
345 * .RVI ZFRS BLDP WCAM
346 * .011 1001 ..00 0101
347 *
348 */
349 .type mohawk_crval, #object
350mohawk_crval:
351 crval clear=0x00007f3f, mmuset=0x00003905, ucset=0x00001134
352
353 __INITDATA
354
355/*
356 * Purpose : Function pointers used to access above functions - all calls
357 * come through these
358 */
359 .type mohawk_processor_functions, #object
360mohawk_processor_functions:
361 .word v5t_early_abort
362 .word pabort_noifar
363 .word cpu_mohawk_proc_init
364 .word cpu_mohawk_proc_fin
365 .word cpu_mohawk_reset
366 .word cpu_mohawk_do_idle
367 .word cpu_mohawk_dcache_clean_area
368 .word cpu_mohawk_switch_mm
369 .word cpu_mohawk_set_pte_ext
370 .size mohawk_processor_functions, . - mohawk_processor_functions
371
372 .section ".rodata"
373
374 .type cpu_arch_name, #object
375cpu_arch_name:
376 .asciz "armv5te"
377 .size cpu_arch_name, . - cpu_arch_name
378
379 .type cpu_elf_name, #object
380cpu_elf_name:
381 .asciz "v5"
382 .size cpu_elf_name, . - cpu_elf_name
383
384 .type cpu_mohawk_name, #object
385cpu_mohawk_name:
386 .asciz "Marvell 88SV331x"
387 .size cpu_mohawk_name, . - cpu_mohawk_name
388
389 .align
390
391 .section ".proc.info.init", #alloc, #execinstr
392
393 .type __88sv331x_proc_info,#object
394__88sv331x_proc_info:
395 .long 0x56158000 @ Marvell 88SV331x (MOHAWK)
396 .long 0xfffff000
397 .long PMD_TYPE_SECT | \
398 PMD_SECT_BUFFERABLE | \
399 PMD_SECT_CACHEABLE | \
400 PMD_BIT4 | \
401 PMD_SECT_AP_WRITE | \
402 PMD_SECT_AP_READ
403 .long PMD_TYPE_SECT | \
404 PMD_BIT4 | \
405 PMD_SECT_AP_WRITE | \
406 PMD_SECT_AP_READ
407 b __mohawk_setup
408 .long cpu_arch_name
409 .long cpu_elf_name
410 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
411 .long cpu_mohawk_name
412 .long mohawk_processor_functions
413 .long v4wbi_tlb_fns
414 .long v4wb_user_fns
415 .long mohawk_cache_fns
416 .size __88sv331x_proc_info, . - __88sv331x_proc_info
diff --git a/arch/arm/mm/tlb-fa.S b/arch/arm/mm/tlb-fa.S
new file mode 100644
index 000000000000..9694f1f6f485
--- /dev/null
+++ b/arch/arm/mm/tlb-fa.S
@@ -0,0 +1,75 @@
1/*
2 * linux/arch/arm/mm/tlb-fa.S
3 *
4 * Copyright (C) 2005 Faraday Corp.
5 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
6 *
7 * Based on tlb-v4wbi.S:
8 * Copyright (C) 1997-2002 Russell King
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 * ARM architecture version 4, Faraday variation.
15 * This assume an unified TLBs, with a write buffer, and branch target buffer (BTB)
16 *
17 * Processors: FA520 FA526 FA626
18 */
19#include <linux/linkage.h>
20#include <linux/init.h>
21#include <asm/asm-offsets.h>
22#include <asm/tlbflush.h>
23#include "proc-macros.S"
24
25
26/*
27 * flush_user_tlb_range(start, end, mm)
28 *
29 * Invalidate a range of TLB entries in the specified address space.
30 *
31 * - start - range start address
32 * - end - range end address
33 * - mm - mm_struct describing address space
34 */
35 .align 4
36ENTRY(fa_flush_user_tlb_range)
37 vma_vm_mm ip, r2
38 act_mm r3 @ get current->active_mm
39 eors r3, ip, r3 @ == mm ?
40 movne pc, lr @ no, we dont do anything
41 mov r3, #0
42 mcr p15, 0, r3, c7, c10, 4 @ drain WB
43 bic r0, r0, #0x0ff
44 bic r0, r0, #0xf00
451: mcr p15, 0, r0, c8, c7, 1 @ invalidate UTLB entry
46 add r0, r0, #PAGE_SZ
47 cmp r0, r1
48 blo 1b
49 mcr p15, 0, r3, c7, c5, 6 @ invalidate BTB
50 mcr p15, 0, r3, c7, c10, 4 @ data write barrier
51 mov pc, lr
52
53
54ENTRY(fa_flush_kern_tlb_range)
55 mov r3, #0
56 mcr p15, 0, r3, c7, c10, 4 @ drain WB
57 bic r0, r0, #0x0ff
58 bic r0, r0, #0xf00
591: mcr p15, 0, r0, c8, c7, 1 @ invalidate UTLB entry
60 add r0, r0, #PAGE_SZ
61 cmp r0, r1
62 blo 1b
63 mcr p15, 0, r3, c7, c5, 6 @ invalidate BTB
64 mcr p15, 0, r3, c7, c10, 4 @ data write barrier
65 mcr p15, 0, r3, c7, c5, 4 @ prefetch flush
66 mov pc, lr
67
68 __INITDATA
69
70 .type fa_tlb_fns, #object
71ENTRY(fa_tlb_fns)
72 .long fa_flush_user_tlb_range
73 .long fa_flush_kern_tlb_range
74 .long fa_tlb_flags
75 .size fa_tlb_fns, . - fa_tlb_fns
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
index cefc21c2eee4..d805a52b5032 100644
--- a/arch/arm/oprofile/backtrace.c
+++ b/arch/arm/oprofile/backtrace.c
@@ -18,15 +18,14 @@
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/uaccess.h> 19#include <linux/uaccess.h>
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21 21#include <asm/stacktrace.h>
22#include "../kernel/stacktrace.h"
23 22
24static int report_trace(struct stackframe *frame, void *d) 23static int report_trace(struct stackframe *frame, void *d)
25{ 24{
26 unsigned int *depth = d; 25 unsigned int *depth = d;
27 26
28 if (*depth) { 27 if (*depth) {
29 oprofile_add_trace(frame->lr); 28 oprofile_add_trace(frame->pc);
30 (*depth)--; 29 (*depth)--;
31 } 30 }
32 31
@@ -70,9 +69,12 @@ void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
70 struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1; 69 struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1;
71 70
72 if (!user_mode(regs)) { 71 if (!user_mode(regs)) {
73 unsigned long base = ((unsigned long)regs) & ~(THREAD_SIZE - 1); 72 struct stackframe frame;
74 walk_stackframe(regs->ARM_fp, base, base + THREAD_SIZE, 73 frame.fp = regs->ARM_fp;
75 report_trace, &depth); 74 frame.sp = regs->ARM_sp;
75 frame.lr = regs->ARM_lr;
76 frame.pc = regs->ARM_pc;
77 walk_stackframe(&frame, report_trace, &depth);
76 return; 78 return;
77 } 79 }
78 80
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c
index 6d6bd5899240..853d42bb8682 100644
--- a/arch/arm/oprofile/op_model_mpcore.c
+++ b/arch/arm/oprofile/op_model_mpcore.c
@@ -263,7 +263,7 @@ static void em_route_irq(int irq, unsigned int cpu)
263 const struct cpumask *mask = cpumask_of(cpu); 263 const struct cpumask *mask = cpumask_of(cpu);
264 264
265 spin_lock_irq(&desc->lock); 265 spin_lock_irq(&desc->lock);
266 desc->affinity = *mask; 266 cpumask_copy(desc->affinity, mask);
267 desc->chip->set_affinity(irq, mask); 267 desc->chip->set_affinity(irq, mask);
268 spin_unlock_irq(&desc->lock); 268 spin_unlock_irq(&desc->lock);
269} 269}
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 9cc2b16fdf79..17d0e9906d5f 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -3,7 +3,7 @@ if ARCH_MXC
3menu "Freescale MXC Implementations" 3menu "Freescale MXC Implementations"
4 4
5choice 5choice
6 prompt "MXC/iMX Base Type" 6 prompt "Freescale CPU family:"
7 default ARCH_MX3 7 default ARCH_MX3
8 8
9config ARCH_MX1 9config ARCH_MX1
@@ -15,12 +15,14 @@ config ARCH_MX1
15config ARCH_MX2 15config ARCH_MX2
16 bool "MX2-based" 16 bool "MX2-based"
17 select CPU_ARM926T 17 select CPU_ARM926T
18 select COMMON_CLKDEV
18 help 19 help
19 This enables support for systems based on the Freescale i.MX2 family 20 This enables support for systems based on the Freescale i.MX2 family
20 21
21config ARCH_MX3 22config ARCH_MX3
22 bool "MX3-based" 23 bool "MX3-based"
23 select CPU_V6 24 select CPU_V6
25 select COMMON_CLKDEV
24 help 26 help
25 This enables support for systems based on the Freescale i.MX3 family 27 This enables support for systems based on the Freescale i.MX3 family
26 28
@@ -43,4 +45,10 @@ config MXC_IRQ_PRIOR
43 requirements for timing. 45 requirements for timing.
44 Say N here, unless you have a specialized requirement. 46 Say N here, unless you have a specialized requirement.
45 47
48config MXC_PWM
49 tristate "Enable PWM driver"
50 depends on ARCH_MXC
51 help
52 Enable support for the i.MX PWM controller(s).
53
46endif 54endif
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index db74a929179d..055406312b69 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -3,7 +3,8 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := irq.o clock.o gpio.o time.o devices.o 6obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o system.o
7 7
8obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o 8obj-$(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_MXC_PWM) += pwm.o
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index 0a38f0b396eb..92e13566cd4f 100644
--- a/arch/arm/plat-mxc/clock.c
+++ b/arch/arm/plat-mxc/clock.c
@@ -48,6 +48,11 @@ static DEFINE_MUTEX(clocks_mutex);
48 *-------------------------------------------------------------------------*/ 48 *-------------------------------------------------------------------------*/
49 49
50/* 50/*
51 * All the code inside #ifndef CONFIG_COMMON_CLKDEV can be removed once all
52 * MXC architectures have switched to using clkdev.
53 */
54#ifndef CONFIG_COMMON_CLKDEV
55/*
51 * Retrieve a clock by name. 56 * Retrieve a clock by name.
52 * 57 *
53 * Note that we first try to use device id on the bus 58 * Note that we first try to use device id on the bus
@@ -110,6 +115,7 @@ found:
110 return clk; 115 return clk;
111} 116}
112EXPORT_SYMBOL(clk_get); 117EXPORT_SYMBOL(clk_get);
118#endif
113 119
114static void __clk_disable(struct clk *clk) 120static void __clk_disable(struct clk *clk)
115{ 121{
@@ -187,6 +193,7 @@ unsigned long clk_get_rate(struct clk *clk)
187} 193}
188EXPORT_SYMBOL(clk_get_rate); 194EXPORT_SYMBOL(clk_get_rate);
189 195
196#ifndef CONFIG_COMMON_CLKDEV
190/* Decrement the clock's module reference count */ 197/* Decrement the clock's module reference count */
191void clk_put(struct clk *clk) 198void clk_put(struct clk *clk)
192{ 199{
@@ -194,6 +201,7 @@ void clk_put(struct clk *clk)
194 module_put(clk->owner); 201 module_put(clk->owner);
195} 202}
196EXPORT_SYMBOL(clk_put); 203EXPORT_SYMBOL(clk_put);
204#endif
197 205
198/* Round the requested clock rate to the nearest supported 206/* Round the requested clock rate to the nearest supported
199 * rate that is less than or equal to the requested rate. 207 * rate that is less than or equal to the requested rate.
@@ -257,6 +265,7 @@ struct clk *clk_get_parent(struct clk *clk)
257} 265}
258EXPORT_SYMBOL(clk_get_parent); 266EXPORT_SYMBOL(clk_get_parent);
259 267
268#ifndef CONFIG_COMMON_CLKDEV
260/* 269/*
261 * Add a new clock to the clock tree. 270 * Add a new clock to the clock tree.
262 */ 271 */
@@ -327,4 +336,49 @@ static int __init mxc_setup_proc_entry(void)
327} 336}
328 337
329late_initcall(mxc_setup_proc_entry); 338late_initcall(mxc_setup_proc_entry);
339#endif /* CONFIG_PROC_FS */
340#endif
341
342/*
343 * Get the resulting clock rate from a PLL register value and the input
344 * frequency. PLLs with this register layout can at least be found on
345 * MX1, MX21, MX27 and MX31
346 *
347 * mfi + mfn / (mfd + 1)
348 * f = 2 * f_ref * --------------------
349 * pd + 1
350 */
351unsigned long mxc_decode_pll(unsigned int reg_val, u32 freq)
352{
353 long long ll;
354 int mfn_abs;
355 unsigned int mfi, mfn, mfd, pd;
356
357 mfi = (reg_val >> 10) & 0xf;
358 mfn = reg_val & 0x3ff;
359 mfd = (reg_val >> 16) & 0x3ff;
360 pd = (reg_val >> 26) & 0xf;
361
362 mfi = mfi <= 5 ? 5 : mfi;
363
364 mfn_abs = mfn;
365
366#if !defined CONFIG_ARCH_MX1 && !defined CONFIG_ARCH_MX21
367 if (mfn >= 0x200) {
368 mfn |= 0xFFFFFE00;
369 mfn_abs = -mfn;
370 }
330#endif 371#endif
372
373 freq *= 2;
374 freq /= pd + 1;
375
376 ll = (unsigned long long)freq * mfn_abs;
377
378 do_div(ll, mfd + 1);
379 if (mfn < 0)
380 ll = -ll;
381 ll = (freq * mfi) + ll;
382
383 return ll;
384}
diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/plat-mxc/cpu.c
new file mode 100644
index 000000000000..386e0d52cf58
--- /dev/null
+++ b/arch/arm/plat-mxc/cpu.c
@@ -0,0 +1,11 @@
1
2#include <linux/module.h>
3
4unsigned int __mxc_cpu_type;
5EXPORT_SYMBOL(__mxc_cpu_type);
6
7void mxc_set_cpu_type(unsigned int type)
8{
9 __mxc_cpu_type = type;
10}
11
diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/plat-mxc/devices.c
index c66748267c45..56f2fb5cc456 100644
--- a/arch/arm/plat-mxc/devices.c
+++ b/arch/arm/plat-mxc/devices.c
@@ -19,6 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <mach/common.h>
22 23
23int __init mxc_register_device(struct platform_device *pdev, void *data) 24int __init mxc_register_device(struct platform_device *pdev, void *data)
24{ 25{
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c
index 2905ec758758..e364a5ed10f1 100644
--- a/arch/arm/plat-mxc/dma-mx1-mx2.c
+++ b/arch/arm/plat-mxc/dma-mx1-mx2.c
@@ -113,7 +113,7 @@ struct imx_dma_channel {
113 void (*err_handler) (int, void *, int errcode); 113 void (*err_handler) (int, void *, int errcode);
114 void (*prog_handler) (int, void *, struct scatterlist *); 114 void (*prog_handler) (int, void *, struct scatterlist *);
115 void *data; 115 void *data;
116 unsigned int dma_mode; 116 unsigned int dma_mode;
117 struct scatterlist *sg; 117 struct scatterlist *sg;
118 unsigned int resbytes; 118 unsigned int resbytes;
119 int dma_num; 119 int dma_num;
@@ -802,7 +802,7 @@ static int __init imx_dma_init(void)
802 int ret = 0; 802 int ret = 0;
803 int i; 803 int i;
804 804
805 dma_clk = clk_get(NULL, "dma_clk"); 805 dma_clk = clk_get(NULL, "dma");
806 clk_enable(dma_clk); 806 clk_enable(dma_clk);
807 807
808 /* reset DMA module */ 808 /* reset DMA module */
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index ccbd94adc668..c6483bad8a26 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -200,8 +200,8 @@ static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
200static int mxc_gpio_direction_output(struct gpio_chip *chip, 200static int mxc_gpio_direction_output(struct gpio_chip *chip,
201 unsigned offset, int value) 201 unsigned offset, int value)
202{ 202{
203 _set_gpio_direction(chip, offset, 1);
204 mxc_gpio_set(chip, offset, value); 203 mxc_gpio_set(chip, offset, value);
204 _set_gpio_direction(chip, offset, 1);
205 return 0; 205 return 0;
206} 206}
207 207
diff --git a/arch/arm/plat-mxc/include/mach/board-mx27ads.h b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
index 8f34a05afc87..1cac9d1135cd 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx27ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx27ads.h
@@ -48,7 +48,8 @@
48 * Base address of PBC controller, CS4 48 * Base address of PBC controller, CS4
49 */ 49 */
50#define PBC_BASE_ADDRESS 0xEB000000 50#define PBC_BASE_ADDRESS 0xEB000000
51#define PBC_REG_ADDR(offset) (PBC_BASE_ADDRESS + (offset)) 51#define PBC_REG_ADDR(offset) (void __force __iomem *) \
52 (PBC_BASE_ADDRESS + (offset))
52 53
53/* 54/*
54 * PBC Interupt name definitions 55 * PBC Interupt name definitions
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
index 451d510d08c3..318c72ada13d 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
@@ -11,6 +11,8 @@
11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__ 11#ifndef __ASM_ARCH_MXC_BOARD_MX31ADS_H__
12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__ 12#define __ASM_ARCH_MXC_BOARD_MX31ADS_H__
13 13
14#include <mach/hardware.h>
15
14/* Base address of PBC controller */ 16/* Base address of PBC controller */
15#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR) 17#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR)
16/* Offsets for the PBC Controller register */ 18/* Offsets for the PBC Controller register */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
new file mode 100644
index 000000000000..f8aef1babb75
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#ifndef __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
20#define __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__
21
22/* mandatory for CONFIG_LL_DEBUG */
23
24#define MXC_LL_UART_PADDR UART1_BASE_ADDR
25#define MXC_LL_UART_VADDR (AIPI_BASE_ADDR_VIRT + 0x0A000)
26
27#ifndef __ASSEMBLY__
28
29enum mx31moboard_boards {
30 MX31NOBOARD = 0,
31 MX31DEVBOARD = 1,
32 MX31MARXBOT = 2,
33};
34
35/*
36 * This CPU module needs a baseboard to work. After basic initializing
37 * its own devices, it calls baseboard's init function.
38 */
39
40extern void mx31moboard_devboard_init(void);
41extern void mx31moboard_marxbot_init(void);
42
43#endif
44
45#endif /* __ASM_ARCH_MXC_BOARD_MX31MOBOARD_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/board-qong.h b/arch/arm/plat-mxc/include/mach/board-qong.h
new file mode 100644
index 000000000000..4ff762dd45cf
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/board-qong.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
3 */
4
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 __ASM_ARCH_MXC_BOARD_QONG_H__
12#define __ASM_ARCH_MXC_BOARD_QONG_H__
13
14/* mandatory for CONFIG_LL_DEBUG */
15
16#define MXC_LL_UART_PADDR UART1_BASE_ADDR
17#define MXC_LL_UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
18
19/* NOR FLASH */
20#define QONG_NOR_SIZE (128*1024*1024)
21
22#endif /* __ASM_ARCH_MXC_BOARD_QONG_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/clkdev.h b/arch/arm/plat-mxc/include/mach/clkdev.h
new file mode 100644
index 000000000000..04b37a89801c
--- /dev/null
+++ b/arch/arm/plat-mxc/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/plat-mxc/include/mach/clock.h b/arch/arm/plat-mxc/include/mach/clock.h
index d21f78e78819..43a82d0c534d 100644
--- a/arch/arm/plat-mxc/include/mach/clock.h
+++ b/arch/arm/plat-mxc/include/mach/clock.h
@@ -26,9 +26,13 @@
26struct module; 26struct module;
27 27
28struct clk { 28struct clk {
29#ifndef CONFIG_COMMON_CLKDEV
30 /* As soon as i.MX1 and i.MX31 switched to clkdev, this
31 * block can go away */
29 struct list_head node; 32 struct list_head node;
30 struct module *owner; 33 struct module *owner;
31 const char *name; 34 const char *name;
35#endif
32 int id; 36 int id;
33 /* Source clock this clk depends on */ 37 /* Source clock this clk depends on */
34 struct clk *parent; 38 struct clk *parent;
@@ -63,5 +67,7 @@ struct clk {
63int clk_register(struct clk *clk); 67int clk_register(struct clk *clk);
64void clk_unregister(struct clk *clk); 68void clk_unregister(struct clk *clk);
65 69
70unsigned long mxc_decode_pll(unsigned int pll, u32 f_ref);
71
66#endif /* __ASSEMBLY__ */ 72#endif /* __ASSEMBLY__ */
67#endif /* __ASM_ARCH_MXC_CLOCK_H__ */ 73#endif /* __ASM_ARCH_MXC_CLOCK_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index 6350287a59b9..b2f9b72644db 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -12,12 +12,18 @@
12#define __ASM_ARCH_MXC_COMMON_H__ 12#define __ASM_ARCH_MXC_COMMON_H__
13 13
14struct platform_device; 14struct platform_device;
15struct clk;
15 16
16extern void mxc_map_io(void); 17extern void mxc_map_io(void);
17extern void mxc_init_irq(void); 18extern void mxc_init_irq(void);
18extern void mxc_timer_init(const char *clk_timer); 19extern void mxc_timer_init(struct clk *timer_clk);
19extern int mxc_clocks_init(unsigned long fref); 20extern int mx1_clocks_init(unsigned long fref);
21extern int mx21_clocks_init(unsigned long lref, unsigned long fref);
22extern int mx27_clocks_init(unsigned long fref);
23extern int mx31_clocks_init(unsigned long fref);
24extern int mx35_clocks_init(void);
20extern int mxc_register_gpios(void); 25extern int mxc_register_gpios(void);
21extern int mxc_register_device(struct platform_device *pdev, void *data); 26extern int mxc_register_device(struct platform_device *pdev, void *data);
27extern void mxc_set_cpu_type(unsigned int type);
22 28
23#endif 29#endif
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
index 602768b427e2..4f773148bc20 100644
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ b/arch/arm/plat-mxc/include/mach/debug-macro.S
@@ -31,6 +31,9 @@
31#ifdef CONFIG_MACH_MX31_3DS 31#ifdef CONFIG_MACH_MX31_3DS
32#include <mach/board-mx31pdk.h> 32#include <mach/board-mx31pdk.h>
33#endif 33#endif
34#ifdef CONFIG_MACH_QONG
35#include <mach/board-qong.h>
36#endif
34 .macro addruart,rx 37 .macro addruart,rx
35 mrc p15, 0, \rx, c1, c0 38 mrc p15, 0, \rx, c1, c0
36 tst \rx, #1 @ MMU enabled? 39 tst \rx, #1 @ MMU enabled?
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index a612d8bb73c8..42e4ee37ca1f 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -23,10 +23,16 @@
23#include <asm/sizes.h> 23#include <asm/sizes.h>
24 24
25#ifdef CONFIG_ARCH_MX3 25#ifdef CONFIG_ARCH_MX3
26# include <mach/mx31.h> 26#include <mach/mx3x.h>
27#include <mach/mx31.h>
28#include <mach/mx35.h>
27#endif 29#endif
28 30
29#ifdef CONFIG_ARCH_MX2 31#ifdef CONFIG_ARCH_MX2
32# include <mach/mx2x.h>
33# ifdef CONFIG_MACH_MX21
34# include <mach/mx21.h>
35# endif
30# ifdef CONFIG_MACH_MX27 36# ifdef CONFIG_MACH_MX27
31# include <mach/mx27.h> 37# include <mach/mx27.h>
32# endif 38# endif
diff --git a/arch/arm/mach-imx/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h
index 870d0d939616..762a7b0430e2 100644
--- a/arch/arm/mach-imx/include/mach/imxfb.h
+++ b/arch/arm/plat-mxc/include/mach/imxfb.h
@@ -76,6 +76,9 @@ struct imx_fb_platform_data {
76 u_char * fixed_screen_cpu; 76 u_char * fixed_screen_cpu;
77 dma_addr_t fixed_screen_dma; 77 dma_addr_t fixed_screen_dma;
78 78
79 int (*init)(struct platform_device*);
80 int (*exit)(struct platform_device*);
81
79 void (*lcd_power)(int); 82 void (*lcd_power)(int);
80 void (*backlight_power)(int); 83 void (*backlight_power)(int);
81}; 84};
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h b/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
deleted file mode 100644
index 95a383be628e..000000000000
--- a/arch/arm/plat-mxc/include/mach/iomux-mx1-mx2.h
+++ /dev/null
@@ -1,416 +0,0 @@
1/*
2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#ifndef _MXC_GPIO_MX1_MX2_H
20#define _MXC_GPIO_MX1_MX2_H
21
22#include <linux/io.h>
23
24/*
25 * GPIO Module and I/O Multiplexer
26 * x = 0..3 for reg_A, reg_B, reg_C, reg_D
27 */
28#define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR)
29#define MXC_DDIR(x) (0x00 + ((x) << 8))
30#define MXC_OCR1(x) (0x04 + ((x) << 8))
31#define MXC_OCR2(x) (0x08 + ((x) << 8))
32#define MXC_ICONFA1(x) (0x0c + ((x) << 8))
33#define MXC_ICONFA2(x) (0x10 + ((x) << 8))
34#define MXC_ICONFB1(x) (0x14 + ((x) << 8))
35#define MXC_ICONFB2(x) (0x18 + ((x) << 8))
36#define MXC_DR(x) (0x1c + ((x) << 8))
37#define MXC_GIUS(x) (0x20 + ((x) << 8))
38#define MXC_SSR(x) (0x24 + ((x) << 8))
39#define MXC_ICR1(x) (0x28 + ((x) << 8))
40#define MXC_ICR2(x) (0x2c + ((x) << 8))
41#define MXC_IMR(x) (0x30 + ((x) << 8))
42#define MXC_ISR(x) (0x34 + ((x) << 8))
43#define MXC_GPR(x) (0x38 + ((x) << 8))
44#define MXC_SWR(x) (0x3c + ((x) << 8))
45#define MXC_PUEN(x) (0x40 + ((x) << 8))
46
47#ifdef CONFIG_ARCH_MX1
48# define GPIO_PORT_MAX 3
49#endif
50#ifdef CONFIG_ARCH_MX2
51# define GPIO_PORT_MAX 5
52#endif
53
54#ifndef GPIO_PORT_MAX
55# error "GPIO config port count unknown!"
56#endif
57
58#define GPIO_PIN_MASK 0x1f
59
60#define GPIO_PORT_SHIFT 5
61#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
62
63#define GPIO_PORTA (0 << GPIO_PORT_SHIFT)
64#define GPIO_PORTB (1 << GPIO_PORT_SHIFT)
65#define GPIO_PORTC (2 << GPIO_PORT_SHIFT)
66#define GPIO_PORTD (3 << GPIO_PORT_SHIFT)
67#define GPIO_PORTE (4 << GPIO_PORT_SHIFT)
68#define GPIO_PORTF (5 << GPIO_PORT_SHIFT)
69
70#define GPIO_OUT (1 << 8)
71#define GPIO_IN (0 << 8)
72#define GPIO_PUEN (1 << 9)
73
74#define GPIO_PF (1 << 10)
75#define GPIO_AF (1 << 11)
76
77#define GPIO_OCR_SHIFT 12
78#define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT)
79#define GPIO_AIN (0 << GPIO_OCR_SHIFT)
80#define GPIO_BIN (1 << GPIO_OCR_SHIFT)
81#define GPIO_CIN (2 << GPIO_OCR_SHIFT)
82#define GPIO_GPIO (3 << GPIO_OCR_SHIFT)
83
84#define GPIO_AOUT_SHIFT 14
85#define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT)
86#define GPIO_AOUT (0 << GPIO_AOUT_SHIFT)
87#define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT)
88#define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT)
89#define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT)
90
91#define GPIO_BOUT_SHIFT 16
92#define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT)
93#define GPIO_BOUT (0 << GPIO_BOUT_SHIFT)
94#define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT)
95#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT)
96#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT)
97
98extern void mxc_gpio_mode(int gpio_mode);
99extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
100 const char *label);
101extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
102
103/*-------------------------------------------------------------------------*/
104
105/* assignements for GPIO alternate/primary functions */
106
107/* FIXME: This list is not completed. The correct directions are
108 * missing on some (many) pins
109 */
110#ifdef CONFIG_ARCH_MX1
111#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_OUT | 0)
112#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0)
113#define PA1_AOUT_SPI2_RXD (GPIO_PORTA | GPIO_IN | 1)
114#define PA1_PF_TIN (GPIO_PORTA | GPIO_PF | 1)
115#define PA2_PF_PWM0 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 2)
116#define PA3_PF_CSI_MCLK (GPIO_PORTA | GPIO_PF | 3)
117#define PA4_PF_CSI_D0 (GPIO_PORTA | GPIO_PF | 4)
118#define PA5_PF_CSI_D1 (GPIO_PORTA | GPIO_PF | 5)
119#define PA6_PF_CSI_D2 (GPIO_PORTA | GPIO_PF | 6)
120#define PA7_PF_CSI_D3 (GPIO_PORTA | GPIO_PF | 7)
121#define PA8_PF_CSI_D4 (GPIO_PORTA | GPIO_PF | 8)
122#define PA9_PF_CSI_D5 (GPIO_PORTA | GPIO_PF | 9)
123#define PA10_PF_CSI_D6 (GPIO_PORTA | GPIO_PF | 10)
124#define PA11_PF_CSI_D7 (GPIO_PORTA | GPIO_PF | 11)
125#define PA12_PF_CSI_VSYNC (GPIO_PORTA | GPIO_PF | 12)
126#define PA13_PF_CSI_HSYNC (GPIO_PORTA | GPIO_PF | 13)
127#define PA14_PF_CSI_PIXCLK (GPIO_PORTA | GPIO_PF | 14)
128#define PA15_PF_I2C_SDA (GPIO_PORTA | GPIO_OUT | GPIO_PF | 15)
129#define PA16_PF_I2C_SCL (GPIO_PORTA | GPIO_OUT | GPIO_PF | 16)
130#define PA17_AF_ETMTRACEPKT4 (GPIO_PORTA | GPIO_AF | 17)
131#define PA17_AIN_SPI2_SS (GPIO_PORTA | GPIO_OUT | 17)
132#define PA18_AF_ETMTRACEPKT5 (GPIO_PORTA | GPIO_AF | 18)
133#define PA19_AF_ETMTRACEPKT6 (GPIO_PORTA | GPIO_AF | 19)
134#define PA20_AF_ETMTRACEPKT7 (GPIO_PORTA | GPIO_AF | 20)
135#define PA21_PF_A0 (GPIO_PORTA | GPIO_PF | 21)
136#define PA22_PF_CS4 (GPIO_PORTA | GPIO_PF | 22)
137#define PA23_PF_CS5 (GPIO_PORTA | GPIO_PF | 23)
138#define PA24_PF_A16 (GPIO_PORTA | GPIO_PF | 24)
139#define PA24_AF_ETMTRACEPKT0 (GPIO_PORTA | GPIO_AF | 24)
140#define PA25_PF_A17 (GPIO_PORTA | GPIO_PF | 25)
141#define PA25_AF_ETMTRACEPKT1 (GPIO_PORTA | GPIO_AF | 25)
142#define PA26_PF_A18 (GPIO_PORTA | GPIO_PF | 26)
143#define PA26_AF_ETMTRACEPKT2 (GPIO_PORTA | GPIO_AF | 26)
144#define PA27_PF_A19 (GPIO_PORTA | GPIO_PF | 27)
145#define PA27_AF_ETMTRACEPKT3 (GPIO_PORTA | GPIO_AF | 27)
146#define PA28_PF_A20 (GPIO_PORTA | GPIO_PF | 28)
147#define PA28_AF_ETMPIPESTAT0 (GPIO_PORTA | GPIO_AF | 28)
148#define PA29_PF_A21 (GPIO_PORTA | GPIO_PF | 29)
149#define PA29_AF_ETMPIPESTAT1 (GPIO_PORTA | GPIO_AF | 29)
150#define PA30_PF_A22 (GPIO_PORTA | GPIO_PF | 30)
151#define PA30_AF_ETMPIPESTAT2 (GPIO_PORTA | GPIO_AF | 30)
152#define PA31_PF_A23 (GPIO_PORTA | GPIO_PF | 31)
153#define PA31_AF_ETMTRACECLK (GPIO_PORTA | GPIO_AF | 31)
154#define PB8_PF_SD_DAT0 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8)
155#define PB8_AF_MS_PIO (GPIO_PORTB | GPIO_AF | 8)
156#define PB9_PF_SD_DAT1 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9)
157#define PB9_AF_MS_PI1 (GPIO_PORTB | GPIO_AF | 9)
158#define PB10_PF_SD_DAT2 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10)
159#define PB10_AF_MS_SCLKI (GPIO_PORTB | GPIO_AF | 10)
160#define PB11_PF_SD_DAT3 (GPIO_PORTB | GPIO_PF | 11)
161#define PB11_AF_MS_SDIO (GPIO_PORTB | GPIO_AF | 11)
162#define PB12_PF_SD_CLK (GPIO_PORTB | GPIO_PF | 12)
163#define PB12_AF_MS_SCLK0 (GPIO_PORTB | GPIO_AF | 12)
164#define PB13_PF_SD_CMD (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13)
165#define PB13_AF_MS_BS (GPIO_PORTB | GPIO_AF | 13)
166#define PB14_AF_SSI_RXFS (GPIO_PORTB | GPIO_AF | 14)
167#define PB15_AF_SSI_RXCLK (GPIO_PORTB | GPIO_AF | 15)
168#define PB16_AF_SSI_RXDAT (GPIO_PORTB | GPIO_IN | GPIO_AF | 16)
169#define PB17_AF_SSI_TXDAT (GPIO_PORTB | GPIO_OUT | GPIO_AF | 17)
170#define PB18_AF_SSI_TXFS (GPIO_PORTB | GPIO_AF | 18)
171#define PB19_AF_SSI_TXCLK (GPIO_PORTB | GPIO_AF | 19)
172#define PB20_PF_USBD_AFE (GPIO_PORTB | GPIO_PF | 20)
173#define PB21_PF_USBD_OE (GPIO_PORTB | GPIO_PF | 21)
174#define PB22_PFUSBD_RCV (GPIO_PORTB | GPIO_PF | 22)
175#define PB23_PF_USBD_SUSPND (GPIO_PORTB | GPIO_PF | 23)
176#define PB24_PF_USBD_VP (GPIO_PORTB | GPIO_PF | 24)
177#define PB25_PF_USBD_VM (GPIO_PORTB | GPIO_PF | 25)
178#define PB26_PF_USBD_VPO (GPIO_PORTB | GPIO_PF | 26)
179#define PB27_PF_USBD_VMO (GPIO_PORTB | GPIO_PF | 27)
180#define PB28_PF_UART2_CTS (GPIO_PORTB | GPIO_OUT | GPIO_PF | 28)
181#define PB29_PF_UART2_RTS (GPIO_PORTB | GPIO_IN | GPIO_PF | 29)
182#define PB30_PF_UART2_TXD (GPIO_PORTB | GPIO_OUT | GPIO_PF | 30)
183#define PB31_PF_UART2_RXD (GPIO_PORTB | GPIO_IN | GPIO_PF | 31)
184#define PC3_PF_SSI_RXFS (GPIO_PORTC | GPIO_PF | 3)
185#define PC4_PF_SSI_RXCLK (GPIO_PORTC | GPIO_PF | 4)
186#define PC5_PF_SSI_RXDAT (GPIO_PORTC | GPIO_IN | GPIO_PF | 5)
187#define PC6_PF_SSI_TXDAT (GPIO_PORTC | GPIO_OUT | GPIO_PF | 6)
188#define PC7_PF_SSI_TXFS (GPIO_PORTC | GPIO_PF | 7)
189#define PC8_PF_SSI_TXCLK (GPIO_PORTC | GPIO_PF | 8)
190#define PC9_PF_UART1_CTS (GPIO_PORTC | GPIO_OUT | GPIO_PF | 9)
191#define PC10_PF_UART1_RTS (GPIO_PORTC | GPIO_IN | GPIO_PF | 10)
192#define PC11_PF_UART1_TXD (GPIO_PORTC | GPIO_OUT | GPIO_PF | 11)
193#define PC12_PF_UART1_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 12)
194#define PC13_PF_SPI1_SPI_RDY (GPIO_PORTC | GPIO_PF | 13)
195#define PC14_PF_SPI1_SCLK (GPIO_PORTC | GPIO_PF | 14)
196#define PC15_PF_SPI1_SS (GPIO_PORTC | GPIO_PF | 15)
197#define PC16_PF_SPI1_MISO (GPIO_PORTC | GPIO_PF | 16)
198#define PC17_PF_SPI1_MOSI (GPIO_PORTC | GPIO_PF | 17)
199#define PC24_BIN_UART3_RI (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 24)
200#define PC25_BIN_UART3_DSR (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 25)
201#define PC26_AOUT_UART3_DTR (GPIO_PORTC | GPIO_IN | 26)
202#define PC27_BIN_UART3_DCD (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 27)
203#define PC28_BIN_UART3_CTS (GPIO_PORTC | GPIO_OUT | GPIO_BIN | 28)
204#define PC29_AOUT_UART3_RTS (GPIO_PORTC | GPIO_IN | 29)
205#define PC30_BIN_UART3_TX (GPIO_PORTC | GPIO_BIN | 30)
206#define PC31_AOUT_UART3_RX (GPIO_PORTC | GPIO_IN | 31)
207#define PD6_PF_LSCLK (GPIO_PORTD | GPIO_OUT | GPIO_PF | 6)
208#define PD7_PF_REV (GPIO_PORTD | GPIO_PF | 7)
209#define PD7_AF_UART2_DTR (GPIO_PORTD | GPIO_IN | GPIO_AF | 7)
210#define PD7_AIN_SPI2_SCLK (GPIO_PORTD | GPIO_AIN | 7)
211#define PD8_PF_CLS (GPIO_PORTD | GPIO_PF | 8)
212#define PD8_AF_UART2_DCD (GPIO_PORTD | GPIO_OUT | GPIO_AF | 8)
213#define PD8_AIN_SPI2_SS (GPIO_PORTD | GPIO_AIN | 8)
214#define PD9_PF_PS (GPIO_PORTD | GPIO_PF | 9)
215#define PD9_AF_UART2_RI (GPIO_PORTD | GPIO_OUT | GPIO_AF | 9)
216#define PD9_AOUT_SPI2_RXD (GPIO_PORTD | GPIO_IN | 9)
217#define PD10_PF_SPL_SPR (GPIO_PORTD | GPIO_OUT | GPIO_PF | 10)
218#define PD10_AF_UART2_DSR (GPIO_PORTD | GPIO_OUT | GPIO_AF | 10)
219#define PD10_AIN_SPI2_TXD (GPIO_PORTD | GPIO_OUT | 10)
220#define PD11_PF_CONTRAST (GPIO_PORTD | GPIO_OUT | GPIO_PF | 11)
221#define PD12_PF_ACD_OE (GPIO_PORTD | GPIO_OUT | GPIO_PF | 12)
222#define PD13_PF_LP_HSYNC (GPIO_PORTD | GPIO_OUT | GPIO_PF | 13)
223#define PD14_PF_FLM_VSYNC (GPIO_PORTD | GPIO_OUT | GPIO_PF | 14)
224#define PD15_PF_LD0 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 15)
225#define PD16_PF_LD1 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 16)
226#define PD17_PF_LD2 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 17)
227#define PD18_PF_LD3 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 18)
228#define PD19_PF_LD4 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 19)
229#define PD20_PF_LD5 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 20)
230#define PD21_PF_LD6 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 21)
231#define PD22_PF_LD7 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 22)
232#define PD23_PF_LD8 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 23)
233#define PD24_PF_LD9 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 24)
234#define PD25_PF_LD10 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 25)
235#define PD26_PF_LD11 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 26)
236#define PD27_PF_LD12 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 27)
237#define PD28_PF_LD13 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 28)
238#define PD29_PF_LD14 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 29)
239#define PD30_PF_LD15 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 30)
240#define PD31_PF_TMR2OUT (GPIO_PORTD | GPIO_PF | 31)
241#define PD31_BIN_SPI2_TXD (GPIO_PORTD | GPIO_BIN | 31)
242#endif
243
244#ifdef CONFIG_ARCH_MX2
245#define PA0_PF_USBH2_CLK (GPIO_PORTA | GPIO_PF | 0)
246#define PA1_PF_USBH2_DIR (GPIO_PORTA | GPIO_PF | 1)
247#define PA2_PF_USBH2_DATA7 (GPIO_PORTA | GPIO_PF | 2)
248#define PA3_PF_USBH2_NXT (GPIO_PORTA | GPIO_PF | 3)
249#define PA4_PF_USBH2_STP (GPIO_PORTA | GPIO_PF | 4)
250#define PA5_PF_LSCLK (GPIO_PORTA | GPIO_OUT | GPIO_PF | 5)
251#define PA6_PF_LD0 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 6)
252#define PA7_PF_LD1 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 7)
253#define PA8_PF_LD2 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 8)
254#define PA9_PF_LD3 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 9)
255#define PA10_PF_LD4 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 10)
256#define PA11_PF_LD5 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 11)
257#define PA12_PF_LD6 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 12)
258#define PA13_PF_LD7 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 13)
259#define PA14_PF_LD8 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 14)
260#define PA15_PF_LD9 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 15)
261#define PA16_PF_LD10 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 16)
262#define PA17_PF_LD11 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 17)
263#define PA18_PF_LD12 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 18)
264#define PA19_PF_LD13 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 19)
265#define PA20_PF_LD14 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 20)
266#define PA21_PF_LD15 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 21)
267#define PA22_PF_LD16 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 22)
268#define PA23_PF_LD17 (GPIO_PORTA | GPIO_OUT | GPIO_PF | 23)
269#define PA24_PF_REV (GPIO_PORTA | GPIO_OUT | GPIO_PF | 24)
270#define PA25_PF_CLS (GPIO_PORTA | GPIO_OUT | GPIO_PF | 25)
271#define PA26_PF_PS (GPIO_PORTA | GPIO_OUT | GPIO_PF | 26)
272#define PA27_PF_SPL_SPR (GPIO_PORTA | GPIO_OUT | GPIO_PF | 27)
273#define PA28_PF_HSYNC (GPIO_PORTA | GPIO_OUT | GPIO_PF | 28)
274#define PA29_PF_VSYNC (GPIO_PORTA | GPIO_OUT | GPIO_PF | 29)
275#define PA30_PF_CONTRAST (GPIO_PORTA | GPIO_OUT | GPIO_PF | 30)
276#define PA31_PF_OE_ACD (GPIO_PORTA | GPIO_OUT | GPIO_PF | 31)
277#define PB4_PF_SD2_D0 (GPIO_PORTB | GPIO_PF | 4)
278#define PB5_PF_SD2_D1 (GPIO_PORTB | GPIO_PF | 5)
279#define PB6_PF_SD2_D2 (GPIO_PORTB | GPIO_PF | 6)
280#define PB7_PF_SD2_D3 (GPIO_PORTB | GPIO_PF | 7)
281#define PB8_PF_SD2_CMD (GPIO_PORTB | GPIO_PF | 8)
282#define PB9_PF_SD2_CLK (GPIO_PORTB | GPIO_PF | 9)
283#define PB10_PF_CSI_D0 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 10)
284#define PB10_AF_UART6_TXD (GPIO_PORTB | GPIO_OUT | GPIO_AF | 10)
285#define PB11_PF_CSI_D1 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 11)
286#define PB11_AF_UART6_RXD (GPIO_PORTB | GPIO_IN | GPIO_AF | 11)
287#define PB12_PF_CSI_D2 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 12)
288#define PB12_AF_UART6_CTS (GPIO_PORTB | GPIO_OUT | GPIO_AF | 12)
289#define PB13_PF_CSI_D3 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 13)
290#define PB13_AF_UART6_RTS (GPIO_PORTB | GPIO_IN | GPIO_AF | 13)
291#define PB14_PF_CSI_D4 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 14)
292#define PB15_PF_CSI_MCLK (GPIO_PORTB | GPIO_OUT | GPIO_PF | 15)
293#define PB16_PF_CSI_PIXCLK (GPIO_PORTB | GPIO_OUT | GPIO_PF | 16)
294#define PB17_PF_CSI_D5 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 17)
295#define PB18_PF_CSI_D6 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 18)
296#define PB18_AF_UART5_TXD (GPIO_PORTB | GPIO_OUT | GPIO_AF | 18)
297#define PB19_PF_CSI_D7 (GPIO_PORTB | GPIO_OUT | GPIO_PF | 19)
298#define PB19_AF_UART5_RXD (GPIO_PORTB | GPIO_IN | GPIO_AF | 19)
299#define PB20_PF_CSI_VSYNC (GPIO_PORTB | GPIO_OUT | GPIO_PF | 20)
300#define PB20_AF_UART5_CTS (GPIO_PORTB | GPIO_OUT | GPIO_AF | 20)
301#define PB21_PF_CSI_HSYNC (GPIO_PORTB | GPIO_OUT | GPIO_PF | 21)
302#define PB21_AF_UART5_RTS (GPIO_PORTB | GPIO_IN | GPIO_AF | 21)
303#define PB22_PF_USBH1_SUSP (GPIO_PORTB | GPIO_PF | 22)
304#define PB23_PF_USB_PWR (GPIO_PORTB | GPIO_PF | 23)
305#define PB24_PF_USB_OC_B (GPIO_PORTB | GPIO_PF | 24)
306#define PB25_PF_USBH1_RCV (GPIO_PORTB | GPIO_PF | 25)
307#define PB26_PF_USBH1_FS (GPIO_PORTB | GPIO_PF | 26)
308#define PB27_PF_USBH1_OE_B (GPIO_PORTB | GPIO_PF | 27)
309#define PB28_PF_USBH1_TXDM (GPIO_PORTB | GPIO_PF | 28)
310#define PB29_PF_USBH1_TXDP (GPIO_PORTB | GPIO_PF | 29)
311#define PB30_PF_USBH1_RXDM (GPIO_PORTB | GPIO_PF | 30)
312#define PB31_PF_USBH1_RXDP (GPIO_PORTB | GPIO_PF | 31)
313#define PB26_AF_UART4_RTS (GPIO_PORTB | GPIO_IN | GPIO_PF | 26)
314#define PB28_AF_UART4_TXD (GPIO_PORTB | GPIO_OUT | GPIO_AF | 28)
315#define PB29_AF_UART4_CTS (GPIO_PORTB | GPIO_OUT | GPIO_AF | 29)
316#define PB31_AF_UART4_RXD (GPIO_PORTB | GPIO_IN | GPIO_AF | 31)
317#define PC5_PF_I2C2_SDA (GPIO_PORTC | GPIO_IN | GPIO_PF | 5)
318#define PC6_PF_I2C2_SCL (GPIO_PORTC | GPIO_IN | GPIO_PF | 6)
319#define PC7_PF_USBOTG_DATA5 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 7)
320#define PC8_PF_USBOTG_DATA6 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 8)
321#define PC9_PF_USBOTG_DATA0 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 9)
322#define PC10_PF_USBOTG_DATA2 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 10)
323#define PC11_PF_USBOTG_DATA1 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 11)
324#define PC12_PF_USBOTG_DATA4 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 12)
325#define PC13_PF_USBOTG_DATA3 (GPIO_PORTC | GPIO_OUT | GPIO_PF | 13)
326#define PC16_PF_SSI4_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 16)
327#define PC17_PF_SSI4_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 17)
328#define PC18_PF_SSI4_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 18)
329#define PC19_PF_SSI4_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 19)
330#define PC20_PF_SSI1_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 20)
331#define PC21_PF_SSI1_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 21)
332#define PC22_PF_SSI1_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 22)
333#define PC23_PF_SSI1_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 23)
334#define PC24_PF_SSI2_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 24)
335#define PC25_PF_SSI2_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 25)
336#define PC26_PF_SSI2_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 26)
337#define PC27_PF_SSI2_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 27)
338#define PC28_PF_SSI3_FS (GPIO_PORTC | GPIO_IN | GPIO_PF | 28)
339#define PC29_PF_SSI3_RXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 29)
340#define PC30_PF_SSI3_TXD (GPIO_PORTC | GPIO_IN | GPIO_PF | 30)
341#define PC31_PF_SSI3_CLK (GPIO_PORTC | GPIO_IN | GPIO_PF | 31)
342#define PD0_AIN_FEC_TXD0 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 0)
343#define PD1_AIN_FEC_TXD1 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 1)
344#define PD2_AIN_FEC_TXD2 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 2)
345#define PD3_AIN_FEC_TXD3 (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 3)
346#define PD4_AOUT_FEC_RX_ER (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 4)
347#define PD5_AOUT_FEC_RXD1 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 5)
348#define PD6_AOUT_FEC_RXD2 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 6)
349#define PD7_AOUT_FEC_RXD3 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 7)
350#define PD8_AF_FEC_MDIO (GPIO_PORTD | GPIO_IN | GPIO_AF | 8)
351#define PD9_AIN_FEC_MDC (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 9)
352#define PD10_AOUT_FEC_CRS (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 10)
353#define PD11_AOUT_FEC_TX_CLK (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 11)
354#define PD12_AOUT_FEC_RXD0 (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 12)
355#define PD13_AOUT_FEC_RX_DV (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 13)
356#define PD14_AOUT_FEC_CLR (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 14)
357#define PD15_AOUT_FEC_COL (GPIO_PORTD | GPIO_IN | GPIO_AOUT | 15)
358#define PD16_AIN_FEC_TX_ER (GPIO_PORTD | GPIO_OUT | GPIO_AIN | 16)
359#define PD17_PF_I2C_DATA (GPIO_PORTD | GPIO_OUT | GPIO_PF | 17)
360#define PD18_PF_I2C_CLK (GPIO_PORTD | GPIO_OUT | GPIO_PF | 18)
361#define PD19_AF_USBH2_DATA4 (GPIO_PORTD | GPIO_AF | 19)
362#define PD20_AF_USBH2_DATA3 (GPIO_PORTD | GPIO_AF | 20)
363#define PD21_AF_USBH2_DATA6 (GPIO_PORTD | GPIO_AF | 21)
364#define PD22_AF_USBH2_DATA0 (GPIO_PORTD | GPIO_AF | 22)
365#define PD23_AF_USBH2_DATA2 (GPIO_PORTD | GPIO_AF | 23)
366#define PD24_AF_USBH2_DATA1 (GPIO_PORTD | GPIO_AF | 24)
367#define PD25_PF_CSPI1_RDY (GPIO_PORTD | GPIO_OUT | GPIO_PF | 25)
368#define PD26_PF_CSPI1_SS2 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 26)
369#define PD26_AF_USBH2_DATA5 (GPIO_PORTD | GPIO_AF | 26)
370#define PD27_PF_CSPI1_SS1 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 27)
371#define PD28_PF_CSPI1_SS0 (GPIO_PORTD | GPIO_OUT | GPIO_PF | 28)
372#define PD29_PF_CSPI1_SCLK (GPIO_PORTD | GPIO_OUT | GPIO_PF | 29)
373#define PD30_PF_CSPI1_MISO (GPIO_PORTD | GPIO_IN | GPIO_PF | 30)
374#define PD31_PF_CSPI1_MOSI (GPIO_PORTD | GPIO_OUT | GPIO_PF | 31)
375#define PF23_AIN_FEC_TX_EN (GPIO_PORTF | GPIO_OUT | GPIO_AIN | 23)
376#define PE0_PF_USBOTG_NXT (GPIO_PORTE | GPIO_OUT | GPIO_PF | 0)
377#define PE1_PF_USBOTG_STP (GPIO_PORTE | GPIO_OUT | GPIO_PF | 1)
378#define PE2_PF_USBOTG_DIR (GPIO_PORTE | GPIO_OUT | GPIO_PF | 2)
379#define PE3_PF_UART2_CTS (GPIO_PORTE | GPIO_OUT | GPIO_PF | 3)
380#define PE4_PF_UART2_RTS (GPIO_PORTE | GPIO_IN | GPIO_PF | 4)
381#define PE6_PF_UART2_TXD (GPIO_PORTE | GPIO_OUT | GPIO_PF | 6)
382#define PE7_PF_UART2_RXD (GPIO_PORTE | GPIO_IN | GPIO_PF | 7)
383#define PE8_PF_UART3_TXD (GPIO_PORTE | GPIO_OUT | GPIO_PF | 8)
384#define PE9_PF_UART3_RXD (GPIO_PORTE | GPIO_IN | GPIO_PF | 9)
385#define PE10_PF_UART3_CTS (GPIO_PORTE | GPIO_OUT | GPIO_PF | 10)
386#define PE11_PF_UART3_RTS (GPIO_PORTE | GPIO_IN | GPIO_PF | 11)
387#define PE12_PF_UART1_TXD (GPIO_PORTE | GPIO_OUT | GPIO_PF | 12)
388#define PE13_PF_UART1_RXD (GPIO_PORTE | GPIO_IN | GPIO_PF | 13)
389#define PE14_PF_UART1_CTS (GPIO_PORTE | GPIO_OUT | GPIO_PF | 14)
390#define PE15_PF_UART1_RTS (GPIO_PORTE | GPIO_IN | GPIO_PF | 15)
391#define PE16_AF_RTCK (GPIO_PORTE | GPIO_OUT | GPIO_AF | 16)
392#define PE16_PF_RTCK (GPIO_PORTE | GPIO_OUT | GPIO_PF | 16)
393#define PE18_PF_SDHC1_D0 (GPIO_PORTE | GPIO_PF | 18)
394#define PE18_AF_CSPI3_MISO (GPIO_PORTE | GPIO_IN | GPIO_AF | 18)
395#define PE19_PF_SDHC1_D1 (GPIO_PORTE | GPIO_PF | 19)
396#define PE20_PF_SDHC1_D2 (GPIO_PORTE | GPIO_PF | 20)
397#define PE21_PF_SDHC1_D3 (GPIO_PORTE | GPIO_PF | 21)
398#define PE21_AF_CSPI3_SS (GPIO_PORTE | GPIO_OUT | GPIO_AF | 21)
399#define PE22_PF_SDHC1_CMD (GPIO_PORTE | GPIO_PF | 22)
400#define PE22_AF_CSPI3_MOSI (GPIO_PORTE | GPIO_OUT | GPIO_AF | 22)
401#define PE22_PF_SDHC1_CLK (GPIO_PORTE | GPIO_PF | 23)
402#define PE23_AF_CSPI3_SCLK (GPIO_PORTE | GPIO_OUT | GPIO_AF | 23)
403#define PE24_PF_USBOTG_CLK (GPIO_PORTE | GPIO_OUT | GPIO_PF | 24)
404#define PE25_PF_USBOTG_DATA7 (GPIO_PORTE | GPIO_OUT | GPIO_PF | 25)
405#endif
406
407/* decode irq number to use with IMR(x), ISR(x) and friends */
408#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
409
410#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
411#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
412#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
413#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
414#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
415
416#endif /* _MXC_GPIO_MX1_MX2_H */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1.h b/arch/arm/plat-mxc/include/mach/iomux-mx1.h
new file mode 100644
index 000000000000..bf23305c19cc
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx1.h
@@ -0,0 +1,166 @@
1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3*
4* This program is free software; you can redistribute it and/or
5* modify it under the terms of the GNU General Public License
6* as published by the Free Software Foundation; either version 2
7* of the License, or (at your option) any later version.
8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program; if not, write to the Free Software
15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16* MA 02110-1301, USA.
17*/
18
19#ifndef _MXC_IOMUX_MX1_H
20#define _MXC_IOMUX_MX1_H
21
22#ifndef GPIO_PORTA
23#error Please include mach/iomux.h
24#endif
25
26/* FIXME: This list is not completed. The correct directions are
27* missing on some (many) pins
28*/
29
30
31/* Primary GPIO pin functions */
32
33#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
34#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0)
35#define PA1_AOUT_SPI2_RXD (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 1)
36#define PA1_PF_TIN (GPIO_PORTA | GPIO_PF | 1)
37#define PA2_PF_PWM0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 2)
38#define PA3_PF_CSI_MCLK (GPIO_PORTA | GPIO_PF | 3)
39#define PA4_PF_CSI_D0 (GPIO_PORTA | GPIO_PF | 4)
40#define PA5_PF_CSI_D1 (GPIO_PORTA | GPIO_PF | 5)
41#define PA6_PF_CSI_D2 (GPIO_PORTA | GPIO_PF | 6)
42#define PA7_PF_CSI_D3 (GPIO_PORTA | GPIO_PF | 7)
43#define PA8_PF_CSI_D4 (GPIO_PORTA | GPIO_PF | 8)
44#define PA9_PF_CSI_D5 (GPIO_PORTA | GPIO_PF | 9)
45#define PA10_PF_CSI_D6 (GPIO_PORTA | GPIO_PF | 10)
46#define PA11_PF_CSI_D7 (GPIO_PORTA | GPIO_PF | 11)
47#define PA12_PF_CSI_VSYNC (GPIO_PORTA | GPIO_PF | 12)
48#define PA13_PF_CSI_HSYNC (GPIO_PORTA | GPIO_PF | 13)
49#define PA14_PF_CSI_PIXCLK (GPIO_PORTA | GPIO_PF | 14)
50#define PA15_PF_I2C_SDA (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15)
51#define PA16_PF_I2C_SCL (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16)
52#define PA17_AF_ETMTRACEPKT4 (GPIO_PORTA | GPIO_AF | 17)
53#define PA17_AIN_SPI2_SS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17)
54#define PA18_AF_ETMTRACEPKT5 (GPIO_PORTA | GPIO_AF | 18)
55#define PA19_AF_ETMTRACEPKT6 (GPIO_PORTA | GPIO_AF | 19)
56#define PA20_AF_ETMTRACEPKT7 (GPIO_PORTA | GPIO_AF | 20)
57#define PA21_PF_A0 (GPIO_PORTA | GPIO_PF | 21)
58#define PA22_PF_CS4 (GPIO_PORTA | GPIO_PF | 22)
59#define PA23_PF_CS5 (GPIO_PORTA | GPIO_PF | 23)
60#define PA24_PF_A16 (GPIO_PORTA | GPIO_PF | 24)
61#define PA24_AF_ETMTRACEPKT0 (GPIO_PORTA | GPIO_AF | 24)
62#define PA25_PF_A17 (GPIO_PORTA | GPIO_PF | 25)
63#define PA25_AF_ETMTRACEPKT1 (GPIO_PORTA | GPIO_AF | 25)
64#define PA26_PF_A18 (GPIO_PORTA | GPIO_PF | 26)
65#define PA26_AF_ETMTRACEPKT2 (GPIO_PORTA | GPIO_AF | 26)
66#define PA27_PF_A19 (GPIO_PORTA | GPIO_PF | 27)
67#define PA27_AF_ETMTRACEPKT3 (GPIO_PORTA | GPIO_AF | 27)
68#define PA28_PF_A20 (GPIO_PORTA | GPIO_PF | 28)
69#define PA28_AF_ETMPIPESTAT0 (GPIO_PORTA | GPIO_AF | 28)
70#define PA29_PF_A21 (GPIO_PORTA | GPIO_PF | 29)
71#define PA29_AF_ETMPIPESTAT1 (GPIO_PORTA | GPIO_AF | 29)
72#define PA30_PF_A22 (GPIO_PORTA | GPIO_PF | 30)
73#define PA30_AF_ETMPIPESTAT2 (GPIO_PORTA | GPIO_AF | 30)
74#define PA31_PF_A23 (GPIO_PORTA | GPIO_PF | 31)
75#define PA31_AF_ETMTRACECLK (GPIO_PORTA | GPIO_AF | 31)
76#define PB8_PF_SD_DAT0 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8)
77#define PB8_AF_MS_PIO (GPIO_PORTB | GPIO_AF | 8)
78#define PB9_PF_SD_DAT1 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9)
79#define PB9_AF_MS_PI1 (GPIO_PORTB | GPIO_AF | 9)
80#define PB10_PF_SD_DAT2 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10)
81#define PB10_AF_MS_SCLKI (GPIO_PORTB | GPIO_AF | 10)
82#define PB11_PF_SD_DAT3 (GPIO_PORTB | GPIO_PF | 11)
83#define PB11_AF_MS_SDIO (GPIO_PORTB | GPIO_AF | 11)
84#define PB12_PF_SD_CLK (GPIO_PORTB | GPIO_PF | 12)
85#define PB12_AF_MS_SCLK0 (GPIO_PORTB | GPIO_AF | 12)
86#define PB13_PF_SD_CMD (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13)
87#define PB13_AF_MS_BS (GPIO_PORTB | GPIO_AF | 13)
88#define PB14_AF_SSI_RXFS (GPIO_PORTB | GPIO_AF | 14)
89#define PB15_AF_SSI_RXCLK (GPIO_PORTB | GPIO_AF | 15)
90#define PB16_AF_SSI_RXDAT (GPIO_PORTB | GPIO_AF | GPIO_IN | 16)
91#define PB17_AF_SSI_TXDAT (GPIO_PORTB | GPIO_AF | GPIO_OUT | 17)
92#define PB18_AF_SSI_TXFS (GPIO_PORTB | GPIO_AF | 18)
93#define PB19_AF_SSI_TXCLK (GPIO_PORTB | GPIO_AF | 19)
94#define PB20_PF_USBD_AFE (GPIO_PORTB | GPIO_PF | 20)
95#define PB21_PF_USBD_OE (GPIO_PORTB | GPIO_PF | 21)
96#define PB22_PF_USBD_RCV (GPIO_PORTB | GPIO_PF | 22)
97#define PB23_PF_USBD_SUSPND (GPIO_PORTB | GPIO_PF | 23)
98#define PB24_PF_USBD_VP (GPIO_PORTB | GPIO_PF | 24)
99#define PB25_PF_USBD_VM (GPIO_PORTB | GPIO_PF | 25)
100#define PB26_PF_USBD_VPO (GPIO_PORTB | GPIO_PF | 26)
101#define PB27_PF_USBD_VMO (GPIO_PORTB | GPIO_PF | 27)
102#define PB28_PF_UART2_CTS (GPIO_PORTB | GPIO_PF | GPIO_OUT | 28)
103#define PB29_PF_UART2_RTS (GPIO_PORTB | GPIO_PF | GPIO_IN | 29)
104#define PB30_PF_UART2_TXD (GPIO_PORTB | GPIO_PF | GPIO_OUT | 30)
105#define PB31_PF_UART2_RXD (GPIO_PORTB | GPIO_PF | GPIO_IN | 31)
106#define PC3_PF_SSI_RXFS (GPIO_PORTC | GPIO_PF | 3)
107#define PC4_PF_SSI_RXCLK (GPIO_PORTC | GPIO_PF | 4)
108#define PC5_PF_SSI_RXDAT (GPIO_PORTC | GPIO_PF | GPIO_IN | 5)
109#define PC6_PF_SSI_TXDAT (GPIO_PORTC | GPIO_PF | GPIO_OUT | 6)
110#define PC7_PF_SSI_TXFS (GPIO_PORTC | GPIO_PF | 7)
111#define PC8_PF_SSI_TXCLK (GPIO_PORTC | GPIO_PF | 8)
112#define PC9_PF_UART1_CTS (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9)
113#define PC10_PF_UART1_RTS (GPIO_PORTC | GPIO_PF | GPIO_IN | 10)
114#define PC11_PF_UART1_TXD (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11)
115#define PC12_PF_UART1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 12)
116#define PC13_PF_SPI1_SPI_RDY (GPIO_PORTC | GPIO_PF | 13)
117#define PC14_PF_SPI1_SCLK (GPIO_PORTC | GPIO_PF | 14)
118#define PC15_PF_SPI1_SS (GPIO_PORTC | GPIO_PF | 15)
119#define PC16_PF_SPI1_MISO (GPIO_PORTC | GPIO_PF | 16)
120#define PC17_PF_SPI1_MOSI (GPIO_PORTC | GPIO_PF | 17)
121#define PC24_BIN_UART3_RI (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 24)
122#define PC25_BIN_UART3_DSR (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 25)
123#define PC26_AOUT_UART3_DTR (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 26)
124#define PC27_BIN_UART3_DCD (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 27)
125#define PC28_BIN_UART3_CTS (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 28)
126#define PC29_AOUT_UART3_RTS (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 29)
127#define PC30_BIN_UART3_TX (GPIO_PORTC | GPIO_BIN | 30)
128#define PC31_AOUT_UART3_RX (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 31)
129#define PD6_PF_LSCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 6)
130#define PD7_PF_REV (GPIO_PORTD | GPIO_PF | 7)
131#define PD7_AF_UART2_DTR (GPIO_PORTD | GPIO_AF | GPIO_IN | 7)
132#define PD7_AIN_SPI2_SCLK (GPIO_PORTD | GPIO_AIN | 7)
133#define PD8_PF_CLS (GPIO_PORTD | GPIO_PF | 8)
134#define PD8_AF_UART2_DCD (GPIO_PORTD | GPIO_AF | GPIO_OUT | 8)
135#define PD8_AIN_SPI2_SS (GPIO_PORTD | GPIO_AIN | 8)
136#define PD9_PF_PS (GPIO_PORTD | GPIO_PF | 9)
137#define PD9_AF_UART2_RI (GPIO_PORTD | GPIO_AF | GPIO_OUT | 9)
138#define PD9_AOUT_SPI2_RXD (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 9)
139#define PD10_PF_SPL_SPR (GPIO_PORTD | GPIO_PF | GPIO_OUT | 10)
140#define PD10_AF_UART2_DSR (GPIO_PORTD | GPIO_AF | GPIO_OUT | 10)
141#define PD10_AIN_SPI2_TXD (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 10)
142#define PD11_PF_CONTRAST (GPIO_PORTD | GPIO_PF | GPIO_OUT | 11)
143#define PD12_PF_ACD_OE (GPIO_PORTD | GPIO_PF | GPIO_OUT | 12)
144#define PD13_PF_LP_HSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 13)
145#define PD14_PF_FLM_VSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 14)
146#define PD15_PF_LD0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 15)
147#define PD16_PF_LD1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 16)
148#define PD17_PF_LD2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17)
149#define PD18_PF_LD3 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18)
150#define PD19_PF_LD4 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 19)
151#define PD20_PF_LD5 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 20)
152#define PD21_PF_LD6 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 21)
153#define PD22_PF_LD7 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 22)
154#define PD23_PF_LD8 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 23)
155#define PD24_PF_LD9 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 24)
156#define PD25_PF_LD10 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25)
157#define PD26_PF_LD11 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26)
158#define PD27_PF_LD12 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27)
159#define PD28_PF_LD13 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28)
160#define PD29_PF_LD14 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29)
161#define PD30_PF_LD15 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 30)
162#define PD31_PF_TMR2OUT (GPIO_PORTD | GPIO_PF | 31)
163#define PD31_BIN_SPI2_TXD (GPIO_PORTD | GPIO_BIN | 31)
164
165
166#endif
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx21.h b/arch/arm/plat-mxc/include/mach/iomux-mx21.h
new file mode 100644
index 000000000000..63aaa972e275
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx21.h
@@ -0,0 +1,126 @@
1/*
2* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
3*
4* This program is free software; you can redistribute it and/or
5* modify it under the terms of the GNU General Public License
6* as published by the Free Software Foundation; either version 2
7* of the License, or (at your option) any later version.
8* This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program; if not, write to the Free Software
15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16* MA 02110-1301, USA.
17*/
18
19#ifndef _MXC_IOMUX_MX21_H
20#define _MXC_IOMUX_MX21_H
21
22#ifndef GPIO_PORTA
23#error Please include mach/iomux.h
24#endif
25
26
27/* Primary GPIO pin functions */
28
29#define PB22_PF_USBH1_BYP (GPIO_PORTB | GPIO_PF | 22)
30#define PB25_PF_USBH1_ON (GPIO_PORTB | GPIO_PF | 25)
31#define PC5_PF_USBOTG_SDA (GPIO_PORTC | GPIO_PF | 5)
32#define PC6_PF_USBOTG_SCL (GPIO_PORTC | GPIO_PF | 6)
33#define PC7_PF_USBOTG_ON (GPIO_PORTC | GPIO_PF | 7)
34#define PC8_PF_USBOTG_FS (GPIO_PORTC | GPIO_PF | 8)
35#define PC9_PF_USBOTG_OE (GPIO_PORTC | GPIO_PF | 9)
36#define PC10_PF_USBOTG_TXDM (GPIO_PORTC | GPIO_PF | 10)
37#define PC11_PF_USBOTG_TXDP (GPIO_PORTC | GPIO_PF | 11)
38#define PC12_PF_USBOTG_RXDM (GPIO_PORTC | GPIO_PF | 12)
39#define PC13_PF_USBOTG_RXDP (GPIO_PORTC | GPIO_PF | 13)
40#define PC16_PF_SAP_FS (GPIO_PORTC | GPIO_PF | 16)
41#define PC17_PF_SAP_RXD (GPIO_PORTC | GPIO_PF | 17)
42#define PC18_PF_SAP_TXD (GPIO_PORTC | GPIO_PF | 18)
43#define PC19_PF_SAP_CLK (GPIO_PORTC | GPIO_PF | 19)
44#define PE0_PF_TEST_WB2 (GPIO_PORTE | GPIO_PF | 0)
45#define PE1_PF_TEST_WB1 (GPIO_PORTE | GPIO_PF | 1)
46#define PE2_PF_TEST_WB0 (GPIO_PORTE | GPIO_PF | 2)
47#define PF1_PF_NFCE (GPIO_PORTF | GPIO_PF | 1)
48#define PF3_PF_NFCLE (GPIO_PORTF | GPIO_PF | 3)
49#define PF7_PF_NFIO0 (GPIO_PORTF | GPIO_PF | 7)
50#define PF8_PF_NFIO1 (GPIO_PORTF | GPIO_PF | 8)
51#define PF9_PF_NFIO2 (GPIO_PORTF | GPIO_PF | 9)
52#define PF10_PF_NFIO3 (GPIO_PORTF | GPIO_PF | 10)
53#define PF11_PF_NFIO4 (GPIO_PORTF | GPIO_PF | 11)
54#define PF12_PF_NFIO5 (GPIO_PORTF | GPIO_PF | 12)
55#define PF13_PF_NFIO6 (GPIO_PORTF | GPIO_PF | 13)
56#define PF14_PF_NFIO7 (GPIO_PORTF | GPIO_PF | 14)
57#define PF16_PF_RES (GPIO_PORTF | GPIO_PF | 16)
58
59/* Alternate GPIO pin functions */
60
61#define PA5_AF_BMI_CLK_CS (GPIO_PORTA | GPIO_AF | 5)
62#define PA6_AF_BMI_D0 (GPIO_PORTA | GPIO_AF | 6)
63#define PA7_AF_BMI_D1 (GPIO_PORTA | GPIO_AF | 7)
64#define PA8_AF_BMI_D2 (GPIO_PORTA | GPIO_AF | 8)
65#define PA9_AF_BMI_D3 (GPIO_PORTA | GPIO_AF | 9)
66#define PA10_AF_BMI_D4 (GPIO_PORTA | GPIO_AF | 10)
67#define PA11_AF_BMI_D5 (GPIO_PORTA | GPIO_AF | 11)
68#define PA12_AF_BMI_D6 (GPIO_PORTA | GPIO_AF | 12)
69#define PA13_AF_BMI_D7 (GPIO_PORTA | GPIO_AF | 13)
70#define PA14_AF_BMI_D8 (GPIO_PORTA | GPIO_AF | 14)
71#define PA15_AF_BMI_D9 (GPIO_PORTA | GPIO_AF | 15)
72#define PA16_AF_BMI_D10 (GPIO_PORTA | GPIO_AF | 16)
73#define PA17_AF_BMI_D11 (GPIO_PORTA | GPIO_AF | 17)
74#define PA18_AF_BMI_D12 (GPIO_PORTA | GPIO_AF | 18)
75#define PA19_AF_BMI_D13 (GPIO_PORTA | GPIO_AF | 19)
76#define PA20_AF_BMI_D14 (GPIO_PORTA | GPIO_AF | 20)
77#define PA21_AF_BMI_D15 (GPIO_PORTA | GPIO_AF | 21)
78#define PA22_AF_BMI_READ_REQ (GPIO_PORTA | GPIO_AF | 22)
79#define PA23_AF_BMI_WRITE (GPIO_PORTA | GPIO_AF | 23)
80#define PA29_AF_BMI_RX_FULL (GPIO_PORTA | GPIO_AF | 29)
81#define PA30_AF_BMI_READ (GPIO_PORTA | GPIO_AF | 30)
82
83/* AIN GPIO pin functions */
84
85#define PC14_AIN_SYS_CLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14)
86#define PD21_AIN_USBH2_FS (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 21)
87#define PD22_AIN_USBH2_OE (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 22)
88#define PD23_AIN_USBH2_TXDM (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 23)
89#define PD24_AIN_USBH2_TXDP (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 24)
90#define PE8_AIN_IR_TXD (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 8)
91#define PF0_AIN_PC_RST (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 0)
92#define PF1_AIN_PC_CE1 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 1)
93#define PF2_AIN_PC_CE2 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 2)
94#define PF3_AIN_PC_POE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 3)
95#define PF4_AIN_PC_OE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 4)
96#define PF5_AIN_PC_RW (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 5)
97
98/* BIN GPIO pin functions */
99
100#define PC14_BIN_SYS_CLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14)
101#define PD27_BIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_BIN | GPIO_OUT | 27)
102
103/* CIN GPIO pin functions */
104
105#define PB26_CIN_USBH1_RXDAT (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 26)
106
107/* AOUT GPIO pin functions */
108
109#define PA29_AOUT_BMI_WAIT (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 29)
110#define PD19_AOUT_USBH2_RXDM (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 19)
111#define PD20_AOUT_USBH2_RXDP (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 20)
112#define PD25_AOUT_EXT_DMAREQ (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 25)
113#define PD26_AOUT_USBOTG_RXDAT (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 26)
114#define PE9_AOUT_IR_RXD (GPIO_PORTE | GPIO_AOUT | GPIO_IN | 9)
115#define PF6_AOUT_PC_BVD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 6)
116#define PF7_AOUT_PC_BVD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 7)
117#define PF8_AOUT_PC_VS2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 8)
118#define PF9_AOUT_PC_VS1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 9)
119#define PF10_AOUT_PC_WP (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 10)
120#define PF11_AOUT_PC_READY (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 11)
121#define PF12_AOUT_PC_WAIT (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 12)
122#define PF13_AOUT_PC_CD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 13)
123#define PF14_AOUT_PC_CD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 14)
124
125
126#endif
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx27.h b/arch/arm/plat-mxc/include/mach/iomux-mx27.h
new file mode 100644
index 000000000000..5ac158b70f61
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx27.h
@@ -0,0 +1,207 @@
1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.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#ifndef _MXC_IOMUX_MX27_H
21#define _MXC_IOMUX_MX27_H
22
23#ifndef GPIO_PORTA
24#error Please include mach/iomux.h
25#endif
26
27
28/* Primary GPIO pin functions */
29
30#define PA0_PF_USBH2_CLK (GPIO_PORTA | GPIO_PF | 0)
31#define PA1_PF_USBH2_DIR (GPIO_PORTA | GPIO_PF | 1)
32#define PA2_PF_USBH2_DATA7 (GPIO_PORTA | GPIO_PF | 2)
33#define PA3_PF_USBH2_NXT (GPIO_PORTA | GPIO_PF | 3)
34#define PA4_PF_USBH2_STP (GPIO_PORTA | GPIO_PF | 4)
35#define PB22_PF_USBH1_SUSP (GPIO_PORTB | GPIO_PF | 22)
36#define PB25_PF_USBH1_RCV (GPIO_PORTB | GPIO_PF | 25)
37#define PC5_PF_I2C2_SDA (GPIO_PORTC | GPIO_PF | GPIO_IN | 5)
38#define PC6_PF_I2C2_SCL (GPIO_PORTC | GPIO_PF | GPIO_IN | 6)
39#define PC7_PF_USBOTG_DATA5 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 7)
40#define PC8_PF_USBOTG_DATA6 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 8)
41#define PC9_PF_USBOTG_DATA0 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9)
42#define PC10_PF_USBOTG_DATA2 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 10)
43#define PC11_PF_USBOTG_DATA1 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11)
44#define PC12_PF_USBOTG_DATA4 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 12)
45#define PC13_PF_USBOTG_DATA3 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 13)
46#define PC16_PF_SSI4_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 16)
47#define PC17_PF_SSI4_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 17)
48#define PC18_PF_SSI4_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 18)
49#define PC19_PF_SSI4_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 19)
50#define PC25_AF_GPT5_TIN (GPIO_PORTC | GPIO_AF | 25)
51#define PC27_AF_GPT4_TIN (GPIO_PORTC | GPIO_AF | 27)
52#define PD0_PF_SD3_CMD (GPIO_PORTD | GPIO_PF | 0)
53#define PD1_PF_SD3_CLK (GPIO_PORTD | GPIO_PF | 1)
54#define PD2_PF_ATA_DATA0 (GPIO_PORTD | GPIO_PF | 2)
55#define PD3_PF_ATA_DATA1 (GPIO_PORTD | GPIO_PF | 3)
56#define PD4_PF_ATA_DATA2 (GPIO_PORTD | GPIO_PF | 4)
57#define PD5_PF_ATA_DATA3 (GPIO_PORTD | GPIO_PF | 5)
58#define PD6_PF_ATA_DATA4 (GPIO_PORTD | GPIO_PF | 6)
59#define PD7_PF_ATA_DATA5 (GPIO_PORTD | GPIO_PF | 7)
60#define PD8_PF_ATA_DATA6 (GPIO_PORTD | GPIO_PF | 8)
61#define PD9_PF_ATA_DATA7 (GPIO_PORTD | GPIO_PF | 9)
62#define PD10_PF_ATA_DATA8 (GPIO_PORTD | GPIO_PF | 10)
63#define PD11_PF_ATA_DATA9 (GPIO_PORTD | GPIO_PF | 11)
64#define PD12_PF_ATA_DATA10 (GPIO_PORTD | GPIO_PF | 12)
65#define PD13_PF_ATA_DATA11 (GPIO_PORTD | GPIO_PF | 13)
66#define PD14_PF_ATA_DATA12 (GPIO_PORTD | GPIO_PF | 14)
67#define PD15_PF_ATA_DATA13 (GPIO_PORTD | GPIO_PF | 15)
68#define PD16_PF_ATA_DATA14 (GPIO_PORTD | GPIO_PF | 16)
69#define PE0_PF_USBOTG_NXT (GPIO_PORTE | GPIO_PF | GPIO_OUT | 0)
70#define PE1_PF_USBOTG_STP (GPIO_PORTE | GPIO_PF | GPIO_OUT | 1)
71#define PE2_PF_USBOTG_DIR (GPIO_PORTE | GPIO_PF | GPIO_OUT | 2)
72#define PE24_PF_USBOTG_CLK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 24)
73#define PE25_PF_USBOTG_DATA7 (GPIO_PORTE | GPIO_PF | GPIO_OUT | 25)
74#define PF1_PF_NFCLE (GPIO_PORTF | GPIO_PF | 1)
75#define PF3_PF_NFCE (GPIO_PORTF | GPIO_PF | 3)
76#define PF7_PF_PC_POE (GPIO_PORTF | GPIO_PF | 7)
77#define PF8_PF_PC_RW (GPIO_PORTF | GPIO_PF | 8)
78#define PF9_PF_PC_IOIS16 (GPIO_PORTF | GPIO_PF | 9)
79#define PF10_PF_PC_RST (GPIO_PORTF | GPIO_PF | 10)
80#define PF11_PF_PC_BVD2 (GPIO_PORTF | GPIO_PF | 11)
81#define PF12_PF_PC_BVD1 (GPIO_PORTF | GPIO_PF | 12)
82#define PF13_PF_PC_VS2 (GPIO_PORTF | GPIO_PF | 13)
83#define PF14_PF_PC_VS1 (GPIO_PORTF | GPIO_PF | 14)
84#define PF16_PF_PC_PWRON (GPIO_PORTF | GPIO_PF | 16)
85#define PF17_PF_PC_READY (GPIO_PORTF | GPIO_PF | 17)
86#define PF18_PF_PC_WAIT (GPIO_PORTF | GPIO_PF | 18)
87#define PF19_PF_PC_CD2 (GPIO_PORTF | GPIO_PF | 19)
88#define PF20_PF_PC_CD1 (GPIO_PORTF | GPIO_PF | 20)
89#define PF23_PF_ATA_DATA15 (GPIO_PORTF | GPIO_PF | 23)
90
91/* Alternate GPIO pin functions */
92
93#define PB4_AF_MSHC_DATA0 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 4)
94#define PB5_AF_MSHC_DATA1 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 5)
95#define PB6_AF_MSHC_DATA2 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 6)
96#define PB7_AF_MSHC_DATA4 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 7)
97#define PB8_AF_MSHC_BS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 8)
98#define PB9_AF_MSHC_SCLK (GPIO_PORTB | GPIO_AF | GPIO_OUT | 9)
99#define PB10_AF_UART6_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 10)
100#define PB11_AF_UART6_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 11)
101#define PB12_AF_UART6_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 12)
102#define PB13_AF_UART6_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 13)
103#define PB18_AF_UART5_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 18)
104#define PB19_AF_UART5_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 19)
105#define PB20_AF_UART5_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 20)
106#define PB21_AF_UART5_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 21)
107#define PC8_AF_FEC_MDIO (GPIO_PORTC | GPIO_AF | GPIO_IN | 8)
108#define PC24_AF_GPT5_TOUT (GPIO_PORTC | GPIO_AF | 24)
109#define PC26_AF_GPT4_TOUT (GPIO_PORTC | GPIO_AF | 26)
110#define PD1_AF_ETMTRACE_PKT15 (GPIO_PORTD | GPIO_AF | 1)
111#define PD6_AF_ETMTRACE_PKT14 (GPIO_PORTD | GPIO_AF | 6)
112#define PD7_AF_ETMTRACE_PKT13 (GPIO_PORTD | GPIO_AF | 7)
113#define PD9_AF_ETMTRACE_PKT12 (GPIO_PORTD | GPIO_AF | 9)
114#define PD2_AF_SD3_D0 (GPIO_PORTD | GPIO_AF | 2)
115#define PD3_AF_SD3_D1 (GPIO_PORTD | GPIO_AF | 3)
116#define PD4_AF_SD3_D2 (GPIO_PORTD | GPIO_AF | 4)
117#define PD5_AF_SD3_D3 (GPIO_PORTD | GPIO_AF | 5)
118#define PD8_AF_FEC_MDIO (GPIO_PORTD | GPIO_AF | GPIO_IN | 8)
119#define PD10_AF_ETMTRACE_PKT11 (GPIO_PORTD | GPIO_AF | 10)
120#define PD11_AF_ETMTRACE_PKT10 (GPIO_PORTD | GPIO_AF | 11)
121#define PD12_AF_ETMTRACE_PKT9 (GPIO_PORTD | GPIO_AF | 12)
122#define PD13_AF_ETMTRACE_PKT8 (GPIO_PORTD | GPIO_AF | 13)
123#define PD14_AF_ETMTRACE_PKT7 (GPIO_PORTD | GPIO_AF | 14)
124#define PD15_AF_ETMTRACE_PKT6 (GPIO_PORTD | GPIO_AF | 15)
125#define PD16_AF_ETMTRACE_PKT5 (GPIO_PORTD | GPIO_AF | 16)
126#define PF1_AF_ETMTRACE_PKT0 (GPIO_PORTF | GPIO_AF | 1)
127#define PF3_AF_ETMTRACE_PKT2 (GPIO_PORTF | GPIO_AF | 3)
128#define PF5_AF_ETMPIPESTAT11 (GPIO_PORTF | GPIO_AF | 5)
129#define PF7_AF_ATA_BUFFER_EN (GPIO_PORTF | GPIO_AF | 7)
130#define PF8_AF_ATA_IORDY (GPIO_PORTF | GPIO_AF | 8)
131#define PF9_AF_ATA_INTRQ (GPIO_PORTF | GPIO_AF | 9)
132#define PF10_AF_ATA_RESET (GPIO_PORTF | GPIO_AF | 10)
133#define PF11_AF_ATA_DMACK (GPIO_PORTF | GPIO_AF | 11)
134#define PF12_AF_ATA_DMAREQ (GPIO_PORTF | GPIO_AF | 12)
135#define PF13_AF_ATA_DA0 (GPIO_PORTF | GPIO_AF | 13)
136#define PF14_AF_ATA_DA1 (GPIO_PORTF | GPIO_AF | 14)
137#define PF15_AF_ETMTRACE_SYNC (GPIO_PORTF | GPIO_AF | 15)
138#define PF16_AF_ATA_DA2 (GPIO_PORTF | GPIO_AF | 16)
139#define PF17_AF_ATA_CS0 (GPIO_PORTF | GPIO_AF | 17)
140#define PF18_AF_ATA_CS1 (GPIO_PORTF | GPIO_AF | 18)
141#define PF19_AF_ATA_DIOW (GPIO_PORTF | GPIO_AF | 19)
142#define PF20_AF_ATA_DIOR (GPIO_PORTF | GPIO_AF | 20)
143#define PF22_AF_ETMTRACE_CLK (GPIO_PORTF | GPIO_AF | 22)
144#define PF23_AF_ETMTRACE_PKT4 (GPIO_PORTF | GPIO_AF | 23)
145
146/* AIN GPIO pin functions */
147
148#define PC14_AIN_SSI1_MCLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14)
149#define PC15_AIN_GPT6_TOUT (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 15)
150#define PD0_AIN_FEC_TXD0 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 0)
151#define PD1_AIN_FEC_TXD1 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 1)
152#define PD2_AIN_FEC_TXD2 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 2)
153#define PD3_AIN_FEC_TXD3 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 3)
154#define PD9_AIN_FEC_MDC (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 9)
155#define PD16_AIN_FEC_TX_ER (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 16)
156#define PD27_AIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 27)
157#define PF23_AIN_FEC_TX_EN (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 23)
158
159/* BIN GPIO pin functions */
160
161#define PC14_BIN_SSI2_MCLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14)
162
163/* CIN GPIO pin functions */
164
165#define PD2_CIN_SLCDC1_DAT0 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 2)
166#define PD3_CIN_SLCDC1_DAT1 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 3)
167#define PD4_CIN_SLCDC1_DAT2 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 4)
168#define PD5_CIN_SLCDC1_DAT3 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 5)
169#define PD6_CIN_SLCDC1_DAT4 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 6)
170#define PD7_CIN_SLCDC1_DAT5 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 7)
171#define PD8_CIN_SLCDC1_DAT6 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 8)
172#define PD9_CIN_SLCDC1_DAT7 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 9)
173#define PD10_CIN_SLCDC1_DAT8 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 10)
174#define PD11_CIN_SLCDC1_DAT9 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 11)
175#define PD12_CIN_SLCDC1_DAT10 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 12)
176#define PD13_CIN_SLCDC1_DAT11 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 13)
177#define PD14_CIN_SLCDC1_DAT12 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 14)
178#define PD15_CIN_SLCDC1_DAT13 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 15)
179#define PD16_CIN_SLCDC1_DAT14 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 16)
180#define PD23_CIN_SLCDC1_DAT15 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 23)
181#define PF27_CIN_EXT_DMA_GRANT (GPIO_PORTF | GPIO_CIN | GPIO_OUT | 27)
182/* LCDC_TESTx on PBxx omitted, because it's not clear what they do */
183
184/* AOUT GPIO pin functions */
185
186#define PC14_AOUT_GPT6_TIN (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 14)
187#define PD4_AOUT_FEC_RX_ER (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 4)
188#define PD5_AOUT_FEC_RXD1 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 5)
189#define PD6_AOUT_FEC_RXD2 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 6)
190#define PD7_AOUT_FEC_RXD3 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 7)
191#define PD10_AOUT_FEC_CRS (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 10)
192#define PD11_AOUT_FEC_TX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 11)
193#define PD12_AOUT_FEC_RXD0 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 12)
194#define PD13_AOUT_FEC_RX_DV (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 13)
195#define PD14_AOUT_FEC_RX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 14)
196#define PD15_AOUT_FEC_COL (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 15)
197
198#define PC17_BOUT_PC_IOIS16 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 17)
199#define PC18_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 18)
200#define PC19_BOUT_PC_BVD1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 19)
201#define PC28_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 28)
202#define PC29_BOUT_PC_VS1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 29)
203#define PC30_BOUT_PC_READY (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 30)
204#define PC31_BOUT_PC_WAIT (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 31)
205
206
207#endif /* _MXC_GPIO_MX1_MX2_H */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
new file mode 100644
index 000000000000..fb5ae638e79f
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
@@ -0,0 +1,237 @@
1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.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#ifndef _MXC_IOMUX_MX2x_H
21#define _MXC_IOMUX_MX2x_H
22
23#ifndef GPIO_PORTA
24#error Please include mach/iomux.h
25#endif
26
27
28/* Primary GPIO pin functions */
29
30#define PA5_PF_LSCLK (GPIO_PORTA | GPIO_PF | GPIO_OUT | 5)
31#define PA6_PF_LD0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 6)
32#define PA7_PF_LD1 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 7)
33#define PA8_PF_LD2 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 8)
34#define PA9_PF_LD3 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 9)
35#define PA10_PF_LD4 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 10)
36#define PA11_PF_LD5 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 11)
37#define PA12_PF_LD6 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 12)
38#define PA13_PF_LD7 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 13)
39#define PA14_PF_LD8 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 14)
40#define PA15_PF_LD9 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15)
41#define PA16_PF_LD10 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16)
42#define PA17_PF_LD11 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 17)
43#define PA18_PF_LD12 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 18)
44#define PA19_PF_LD13 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 19)
45#define PA20_PF_LD14 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 20)
46#define PA21_PF_LD15 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 21)
47#define PA22_PF_LD16 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 22)
48#define PA23_PF_LD17 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 23)
49#define PA24_PF_REV (GPIO_PORTA | GPIO_PF | GPIO_OUT | 24)
50#define PA25_PF_CLS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 25)
51#define PA26_PF_PS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 26)
52#define PA27_PF_SPL_SPR (GPIO_PORTA | GPIO_PF | GPIO_OUT | 27)
53#define PA28_PF_HSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 28)
54#define PA29_PF_VSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 29)
55#define PA30_PF_CONTRAST (GPIO_PORTA | GPIO_PF | GPIO_OUT | 30)
56#define PA31_PF_OE_ACD (GPIO_PORTA | GPIO_PF | GPIO_OUT | 31)
57#define PB4_PF_SD2_D0 (GPIO_PORTB | GPIO_PF | 4)
58#define PB5_PF_SD2_D1 (GPIO_PORTB | GPIO_PF | 5)
59#define PB6_PF_SD2_D2 (GPIO_PORTB | GPIO_PF | 6)
60#define PB7_PF_SD2_D3 (GPIO_PORTB | GPIO_PF | 7)
61#define PB8_PF_SD2_CMD (GPIO_PORTB | GPIO_PF | 8)
62#define PB9_PF_SD2_CLK (GPIO_PORTB | GPIO_PF | 9)
63#define PB10_PF_CSI_D0 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 10)
64#define PB11_PF_CSI_D1 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 11)
65#define PB12_PF_CSI_D2 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 12)
66#define PB13_PF_CSI_D3 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 13)
67#define PB14_PF_CSI_D4 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 14)
68#define PB15_PF_CSI_MCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 15)
69#define PB16_PF_CSI_PIXCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 16)
70#define PB17_PF_CSI_D5 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 17)
71#define PB18_PF_CSI_D6 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 18)
72#define PB19_PF_CSI_D7 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 19)
73#define PB20_PF_CSI_VSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 20)
74#define PB21_PF_CSI_HSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 21)
75#define PB23_PF_USB_PWR (GPIO_PORTB | GPIO_PF | 23)
76#define PB24_PF_USB_OC (GPIO_PORTB | GPIO_PF | 24)
77#define PB26_PF_USBH1_FS (GPIO_PORTB | GPIO_PF | 26)
78#define PB27_PF_USBH1_OE (GPIO_PORTB | GPIO_PF | 27)
79#define PB28_PF_USBH1_TXDM (GPIO_PORTB | GPIO_PF | 28)
80#define PB29_PF_USBH1_TXDP (GPIO_PORTB | GPIO_PF | 29)
81#define PB30_PF_USBH1_RXDM (GPIO_PORTB | GPIO_PF | 30)
82#define PB31_PF_USBH1_RXDP (GPIO_PORTB | GPIO_PF | 31)
83#define PC14_PF_TOUT (GPIO_PORTC | GPIO_PF | 14)
84#define PC15_PF_TIN (GPIO_PORTC | GPIO_PF | 15)
85#define PC20_PF_SSI1_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 20)
86#define PC21_PF_SSI1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 21)
87#define PC22_PF_SSI1_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 22)
88#define PC23_PF_SSI1_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 23)
89#define PC24_PF_SSI2_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 24)
90#define PC25_PF_SSI2_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 25)
91#define PC26_PF_SSI2_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 26)
92#define PC27_PF_SSI2_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 27)
93#define PC28_PF_SSI3_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 28)
94#define PC29_PF_SSI3_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 29)
95#define PC30_PF_SSI3_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 30)
96#define PC31_PF_SSI3_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 31)
97#define PD17_PF_I2C_DATA (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17)
98#define PD18_PF_I2C_CLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18)
99#define PD19_PF_CSPI2_SS2 (GPIO_PORTD | GPIO_PF | 19)
100#define PD20_PF_CSPI2_SS1 (GPIO_PORTD | GPIO_PF | 20)
101#define PD21_PF_CSPI2_SS0 (GPIO_PORTD | GPIO_PF | 21)
102#define PD22_PF_CSPI2_SCLK (GPIO_PORTD | GPIO_PF | 22)
103#define PD23_PF_CSPI2_MISO (GPIO_PORTD | GPIO_PF | 23)
104#define PD24_PF_CSPI2_MOSI (GPIO_PORTD | GPIO_PF | 24)
105#define PD25_PF_CSPI1_RDY (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25)
106#define PD26_PF_CSPI1_SS2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26)
107#define PD27_PF_CSPI1_SS1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27)
108#define PD28_PF_CSPI1_SS0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28)
109#define PD29_PF_CSPI1_SCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29)
110#define PD30_PF_CSPI1_MISO (GPIO_PORTD | GPIO_PF | GPIO_IN | 30)
111#define PD31_PF_CSPI1_MOSI (GPIO_PORTD | GPIO_PF | GPIO_OUT | 31)
112#define PE3_PF_UART2_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 3)
113#define PE4_PF_UART2_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 4)
114#define PE5_PF_PWMO (GPIO_PORTE | GPIO_PF | 5)
115#define PE6_PF_UART2_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 6)
116#define PE7_PF_UART2_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 7)
117#define PE8_PF_UART3_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 8)
118#define PE9_PF_UART3_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 9)
119#define PE10_PF_UART3_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 10)
120#define PE11_PF_UART3_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 11)
121#define PE12_PF_UART1_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 12)
122#define PE13_PF_UART1_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 13)
123#define PE14_PF_UART1_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 14)
124#define PE15_PF_UART1_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 15)
125#define PE16_PF_RTCK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 16)
126#define PE17_PF_RESET_OUT (GPIO_PORTE | GPIO_PF | 17)
127#define PE18_PF_SD1_D0 (GPIO_PORTE | GPIO_PF | 18)
128#define PE19_PF_SD1_D1 (GPIO_PORTE | GPIO_PF | 19)
129#define PE20_PF_SD1_D2 (GPIO_PORTE | GPIO_PF | 20)
130#define PE21_PF_SD1_D3 (GPIO_PORTE | GPIO_PF | 21)
131#define PE22_PF_SD1_CMD (GPIO_PORTE | GPIO_PF | 22)
132#define PE23_PF_SD1_CLK (GPIO_PORTE | GPIO_PF | 23)
133#define PF0_PF_NRFB (GPIO_PORTF | GPIO_PF | 0)
134#define PF2_PF_NFWP (GPIO_PORTF | GPIO_PF | 2)
135#define PF4_PF_NFALE (GPIO_PORTF | GPIO_PF | 4)
136#define PF5_PF_NFRE (GPIO_PORTF | GPIO_PF | 5)
137#define PF6_PF_NFWE (GPIO_PORTF | GPIO_PF | 6)
138#define PF15_PF_CLKO (GPIO_PORTF | GPIO_PF | 15)
139#define PF21_PF_CS4 (GPIO_PORTF | GPIO_PF | 21)
140#define PF22_PF_CS5 (GPIO_PORTF | GPIO_PF | 22)
141
142/* Alternate GPIO pin functions */
143
144#define PB26_AF_UART4_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 26)
145#define PB28_AF_UART4_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 28)
146#define PB29_AF_UART4_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 29)
147#define PB31_AF_UART4_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 31)
148#define PC28_AF_SLCDC2_D0 (GPIO_PORTC | GPIO_AF | 28)
149#define PC29_AF_SLCDC2_RS (GPIO_PORTC | GPIO_AF | 29)
150#define PC30_AF_SLCDC2_CS (GPIO_PORTC | GPIO_AF | 30)
151#define PC31_AF_SLCDC2_CLK (GPIO_PORTC | GPIO_AF | 31)
152#define PD19_AF_USBH2_DATA4 (GPIO_PORTD | GPIO_AF | 19)
153#define PD20_AF_USBH2_DATA3 (GPIO_PORTD | GPIO_AF | 20)
154#define PD21_AF_USBH2_DATA6 (GPIO_PORTD | GPIO_AF | 21)
155#define PD22_AF_USBH2_DATA0 (GPIO_PORTD | GPIO_AF | 22)
156#define PD23_AF_USBH2_DATA2 (GPIO_PORTD | GPIO_AF | 23)
157#define PD24_AF_USBH2_DATA1 (GPIO_PORTD | GPIO_AF | 24)
158#define PD26_AF_USBH2_DATA5 (GPIO_PORTD | GPIO_AF | 26)
159#define PE0_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 0)
160#define PE1_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 1)
161#define PE2_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 2)
162#define PE3_AF_KP_COL7 (GPIO_PORTE | GPIO_AF | 3)
163#define PE4_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 4)
164#define PE6_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 6)
165#define PE7_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 7)
166#define PE16_AF_OWIRE (GPIO_PORTE | GPIO_AF | 16)
167#define PE18_AF_CSPI3_MISO (GPIO_PORTE | GPIO_AF | GPIO_IN | 18)
168#define PE21_AF_CSPI3_SS (GPIO_PORTE | GPIO_AF | GPIO_OUT | 21)
169#define PE22_AF_CSPI3_MOSI (GPIO_PORTE | GPIO_AF | GPIO_OUT | 22)
170#define PE23_AF_CSPI3_SCLK (GPIO_PORTE | GPIO_AF | GPIO_OUT | 23)
171
172/* AIN GPIO pin functions */
173
174#define PA6_AIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 6)
175#define PA7_AIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 7)
176#define PA8_AIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 8)
177#define PA0_AIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
178#define PA11_AIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 11)
179#define PA13_AIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 13)
180#define PA15_AIN_SLCDC1_DAT9 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 15)
181#define PA17_AIN_SLCDC1_DAT11 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17)
182#define PA19_AIN_SLCDC1_DAT13 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 19)
183#define PA21_AIN_SLCDC1_DAT15 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 21)
184#define PA22_AIN_EXT_DMAGRANT (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 22)
185#define PA24_AIN_SLCDC1_D0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 24)
186#define PA25_AIN_SLCDC1_RS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 25)
187#define PA26_AIN_SLCDC1_CS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 26)
188#define PA27_AIN_SLCDC1_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 27)
189#define PB6_AIN_SLCDC1_D0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 6)
190#define PB7_AIN_SLCDC1_RS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 7)
191#define PB8_AIN_SLCDC1_CS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 8)
192#define PB9_AIN_SLCDC1_CLK (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 9)
193#define PB25_AIN_SLCDC1_DAT0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 25)
194#define PB26_AIN_SLCDC1_DAT1 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 26)
195#define PB27_AIN_SLCDC1_DAT2 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 27)
196#define PB28_AIN_SLCDC1_DAT3 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 28)
197#define PB29_AIN_SLCDC1_DAT4 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 29)
198#define PB30_AIN_SLCDC1_DAT5 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 30)
199#define PB31_AIN_SLCDC1_DAT6 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 31)
200#define PC5_AIN_SLCDC1_DAT7 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 5)
201#define PC6_AIN_SLCDC1_DAT8 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 6)
202#define PC7_AIN_SLCDC1_DAT9 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 7)
203#define PC8_AIN_SLCDC1_DAT10 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 8)
204#define PC9_AIN_SLCDC1_DAT11 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 9)
205#define PC10_AIN_SLCDC1_DAT12 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 10)
206#define PC11_AIN_SLCDC1_DAT13 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 11)
207#define PC12_AIN_SLCDC1_DAT14 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 12)
208#define PC13_AIN_SLCDC1_DAT15 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 13)
209#define PE5_AIN_PC_SPKOUT (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 5)
210
211/* BIN GPIO pin functions */
212
213#define PE5_BIN_TOUT2 (GPIO_PORTE | GPIO_BIN | GPIO_OUT | 5)
214
215/* CIN GPIO pin functions */
216
217#define PA14_CIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 14)
218#define PA15_CIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 15)
219#define PA16_CIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 16)
220#define PA17_CIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 17)
221#define PA18_CIN_SLCDC1_DAT4 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 18)
222#define PA19_CIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 19)
223#define PA20_CIN_SLCDC1_DAT6 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 20)
224#define PA21_CIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 21)
225#define PB30_CIN_UART4_CTS (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 30)
226#define PE5_CIN_TOUT3 (GPIO_PORTE | GPIO_CIN | GPIO_OUT | 5)
227
228/* AOUT GPIO pin functions */
229
230#define PB29_AOUT_UART4_RXD (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 29)
231#define PB31_AOUT_UART4_RTS (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 31)
232#define PC8_AOUT_USBOTG_TXR_INT (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 8)
233#define PC15_AOUT_WKGD (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 15)
234#define PF21_AOUT_DTACK (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 21)
235
236
237#endif
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index c9198c0aea18..ab838cfe94f9 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -92,7 +92,7 @@ enum iomux_gp_func {
92 MUX_EXTDMAREQ2_MBX_SEL = 1 << 15, 92 MUX_EXTDMAREQ2_MBX_SEL = 1 << 15,
93 MUX_TAMPER_DETECT_EN = 1 << 16, 93 MUX_TAMPER_DETECT_EN = 1 << 16,
94 MUX_PGP_USB_4WIRE = 1 << 17, 94 MUX_PGP_USB_4WIRE = 1 << 17,
95 MUX_PGB_USB_COMMON = 1 << 18, 95 MUX_PGP_USB_COMMON = 1 << 18,
96 MUX_SDHC_MEMSTICK1 = 1 << 19, 96 MUX_SDHC_MEMSTICK1 = 1 << 19,
97 MUX_SDHC_MEMSTICK2 = 1 << 20, 97 MUX_SDHC_MEMSTICK2 = 1 << 20,
98 MUX_PGP_SPLL_BYP = 1 << 21, 98 MUX_PGP_SPLL_BYP = 1 << 21,
@@ -109,21 +109,44 @@ enum iomux_gp_func {
109}; 109};
110 110
111/* 111/*
112 * This function enables/disables the general purpose function for a particular 112 * setups a single pin:
113 * signal. 113 * - reserves the pin so that it is not claimed by another driver
114 * - setups the iomux according to the configuration
115 * - if the pin is configured as a GPIO, we claim it throug kernel gpiolib
116 */
117int mxc_iomux_setup_pin(const unsigned int pin, const char *label);
118/*
119 * setups mutliple pins
120 * convenient way to call the above function with tables
114 */ 121 */
115void iomux_config_gpr(enum iomux_gp_func , bool); 122int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
123 const char *label);
116 124
117/* 125/*
118 * set the mode for a IOMUX pin. 126 * releases a single pin:
127 * - make it available for a future use by another driver
128 * - frees the GPIO if the pin was configured as GPIO
129 * - DOES NOT reconfigure the IOMUX in its reset state
119 */ 130 */
120int mxc_iomux_mode(unsigned int); 131void mxc_iomux_release_pin(const unsigned int pin);
132/*
133 * releases multiple pins
134 * convenvient way to call the above function with tables
135 */
136void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count);
121 137
122/* 138/*
123 * This function enables/disables the general purpose function for a particular 139 * This function enables/disables the general purpose function for a particular
124 * signal. 140 * signal.
125 */ 141 */
126void mxc_iomux_set_gpr(enum iomux_gp_func, bool); 142void mxc_iomux_set_gpr(enum iomux_gp_func, bool en);
143
144/*
145 * This function only configures the iomux hardware.
146 * It is called by the setup functions and should not be called directly anymore.
147 * It is here visible for backward compatibility
148 */
149int mxc_iomux_mode(unsigned int pin_mode);
127 150
128#define IOMUX_PADNUM_MASK 0x1ff 151#define IOMUX_PADNUM_MASK 0x1ff
129#define IOMUX_GPIONUM_SHIFT 9 152#define IOMUX_GPIONUM_SHIFT 9
@@ -144,6 +167,11 @@ void mxc_iomux_set_gpr(enum iomux_gp_func, bool);
144 MXC_GPIO_IRQ_START) 167 MXC_GPIO_IRQ_START)
145 168
146/* 169/*
170 * The number of gpio devices among the pads
171 */
172#define GPIO_PORT_MAX 3
173
174/*
147 * This enumeration is constructed based on the Section 175 * This enumeration is constructed based on the Section
148 * "sw_pad_ctl & sw_mux_ctl details" of the MX31 IC Spec. Each enumerated 176 * "sw_pad_ctl & sw_mux_ctl details" of the MX31 IC Spec. Each enumerated
149 * value is constructed based on the rules described above. 177 * value is constructed based on the rules described above.
@@ -480,6 +508,9 @@ enum iomux_pins {
480 MX31_PIN_CAPTURE = IOMUX_PIN( 7, 327), 508 MX31_PIN_CAPTURE = IOMUX_PIN( 7, 327),
481}; 509};
482 510
511#define PIN_MAX 327
512#define NB_PORTS 12 /* NB_PINS/32, we chose 32 pins per "PORT" */
513
483/* 514/*
484 * Convenience values for use with mxc_iomux_mode() 515 * Convenience values for use with mxc_iomux_mode()
485 * 516 *
@@ -507,7 +538,9 @@ enum iomux_pins {
507#define MX31_PIN_CSPI1_SS1__SS1 IOMUX_MODE(MX31_PIN_CSPI1_SS1, IOMUX_CONFIG_FUNC) 538#define MX31_PIN_CSPI1_SS1__SS1 IOMUX_MODE(MX31_PIN_CSPI1_SS1, IOMUX_CONFIG_FUNC)
508#define MX31_PIN_CSPI1_SS2__SS2 IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_FUNC) 539#define MX31_PIN_CSPI1_SS2__SS2 IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_FUNC)
509#define MX31_PIN_CSPI2_MOSI__MOSI IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_FUNC) 540#define MX31_PIN_CSPI2_MOSI__MOSI IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_FUNC)
541#define MX31_PIN_CSPI2_MOSI__SCL IOMUX_MODE(MX31_PIN_CSPI2_MOSI, IOMUX_CONFIG_ALT1)
510#define MX31_PIN_CSPI2_MISO__MISO IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_FUNC) 542#define MX31_PIN_CSPI2_MISO__MISO IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_FUNC)
543#define MX31_PIN_CSPI2_MISO__SDA IOMUX_MODE(MX31_PIN_CSPI2_MISO, IOMUX_CONFIG_ALT1)
511#define MX31_PIN_CSPI2_SCLK__SCLK IOMUX_MODE(MX31_PIN_CSPI2_SCLK, IOMUX_CONFIG_FUNC) 544#define MX31_PIN_CSPI2_SCLK__SCLK IOMUX_MODE(MX31_PIN_CSPI2_SCLK, IOMUX_CONFIG_FUNC)
512#define MX31_PIN_CSPI2_SPI_RDY__SPI_RDY IOMUX_MODE(MX31_PIN_CSPI2_SPI_RDY, IOMUX_CONFIG_FUNC) 545#define MX31_PIN_CSPI2_SPI_RDY__SPI_RDY IOMUX_MODE(MX31_PIN_CSPI2_SPI_RDY, IOMUX_CONFIG_FUNC)
513#define MX31_PIN_CSPI2_SS0__SS0 IOMUX_MODE(MX31_PIN_CSPI2_SS0, IOMUX_CONFIG_FUNC) 546#define MX31_PIN_CSPI2_SS0__SS0 IOMUX_MODE(MX31_PIN_CSPI2_SS0, IOMUX_CONFIG_FUNC)
@@ -525,6 +558,33 @@ enum iomux_pins {
525#define MX31_PIN_SD1_DATA0__SD1_DATA0 IOMUX_MODE(MX31_PIN_SD1_DATA0, IOMUX_CONFIG_FUNC) 558#define MX31_PIN_SD1_DATA0__SD1_DATA0 IOMUX_MODE(MX31_PIN_SD1_DATA0, IOMUX_CONFIG_FUNC)
526#define MX31_PIN_SD1_CLK__SD1_CLK IOMUX_MODE(MX31_PIN_SD1_CLK, IOMUX_CONFIG_FUNC) 559#define MX31_PIN_SD1_CLK__SD1_CLK IOMUX_MODE(MX31_PIN_SD1_CLK, IOMUX_CONFIG_FUNC)
527#define MX31_PIN_SD1_CMD__SD1_CMD IOMUX_MODE(MX31_PIN_SD1_CMD, IOMUX_CONFIG_FUNC) 560#define MX31_PIN_SD1_CMD__SD1_CMD IOMUX_MODE(MX31_PIN_SD1_CMD, IOMUX_CONFIG_FUNC)
561#define MX31_PIN_LD0__LD0 IOMUX_MODE(MX31_PIN_LD0, IOMUX_CONFIG_FUNC)
562#define MX31_PIN_LD1__LD1 IOMUX_MODE(MX31_PIN_LD1, IOMUX_CONFIG_FUNC)
563#define MX31_PIN_LD2__LD2 IOMUX_MODE(MX31_PIN_LD2, IOMUX_CONFIG_FUNC)
564#define MX31_PIN_LD3__LD3 IOMUX_MODE(MX31_PIN_LD3, IOMUX_CONFIG_FUNC)
565#define MX31_PIN_LD4__LD4 IOMUX_MODE(MX31_PIN_LD4, IOMUX_CONFIG_FUNC)
566#define MX31_PIN_LD5__LD5 IOMUX_MODE(MX31_PIN_LD5, IOMUX_CONFIG_FUNC)
567#define MX31_PIN_LD6__LD6 IOMUX_MODE(MX31_PIN_LD6, IOMUX_CONFIG_FUNC)
568#define MX31_PIN_LD7__LD7 IOMUX_MODE(MX31_PIN_LD7, IOMUX_CONFIG_FUNC)
569#define MX31_PIN_LD8__LD8 IOMUX_MODE(MX31_PIN_LD8, IOMUX_CONFIG_FUNC)
570#define MX31_PIN_LD9__LD9 IOMUX_MODE(MX31_PIN_LD9, IOMUX_CONFIG_FUNC)
571#define MX31_PIN_LD10__LD10 IOMUX_MODE(MX31_PIN_LD10, IOMUX_CONFIG_FUNC)
572#define MX31_PIN_LD11__LD11 IOMUX_MODE(MX31_PIN_LD11, IOMUX_CONFIG_FUNC)
573#define MX31_PIN_LD12__LD12 IOMUX_MODE(MX31_PIN_LD12, IOMUX_CONFIG_FUNC)
574#define MX31_PIN_LD13__LD13 IOMUX_MODE(MX31_PIN_LD13, IOMUX_CONFIG_FUNC)
575#define MX31_PIN_LD14__LD14 IOMUX_MODE(MX31_PIN_LD14, IOMUX_CONFIG_FUNC)
576#define MX31_PIN_LD15__LD15 IOMUX_MODE(MX31_PIN_LD15, IOMUX_CONFIG_FUNC)
577#define MX31_PIN_LD16__LD16 IOMUX_MODE(MX31_PIN_LD16, IOMUX_CONFIG_FUNC)
578#define MX31_PIN_LD17__LD17 IOMUX_MODE(MX31_PIN_LD17, IOMUX_CONFIG_FUNC)
579#define MX31_PIN_VSYNC3__VSYNC3 IOMUX_MODE(MX31_PIN_VSYNC3, IOMUX_CONFIG_FUNC)
580#define MX31_PIN_HSYNC__HSYNC IOMUX_MODE(MX31_PIN_HSYNC, IOMUX_CONFIG_FUNC)
581#define MX31_PIN_FPSHIFT__FPSHIFT IOMUX_MODE(MX31_PIN_FPSHIFT, IOMUX_CONFIG_FUNC)
582#define MX31_PIN_DRDY0__DRDY0 IOMUX_MODE(MX31_PIN_DRDY0, IOMUX_CONFIG_FUNC)
583#define MX31_PIN_D3_REV__D3_REV IOMUX_MODE(MX31_PIN_D3_REV, IOMUX_CONFIG_FUNC)
584#define MX31_PIN_CONTRAST__CONTRAST IOMUX_MODE(MX31_PIN_CONTRAST, IOMUX_CONFIG_FUNC)
585#define MX31_PIN_D3_SPL__D3_SPL IOMUX_MODE(MX31_PIN_D3_SPL, IOMUX_CONFIG_FUNC)
586#define MX31_PIN_D3_CLS__D3_CLS IOMUX_MODE(MX31_PIN_D3_CLS, IOMUX_CONFIG_FUNC)
587#define MX31_PIN_LCS0__GPI03_23 IOMUX_MODE(MX31_PIN_LCS0, IOMUX_CONFIG_GPIO)
528 588
529/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 589/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0
530 * cspi1_ss1*/ 590 * cspi1_ss1*/
diff --git a/arch/arm/plat-mxc/include/mach/iomux.h b/arch/arm/plat-mxc/include/mach/iomux.h
new file mode 100644
index 000000000000..171f8adc1109
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux.h
@@ -0,0 +1,127 @@
1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.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#ifndef _MXC_IOMUX_H
21#define _MXC_IOMUX_H
22
23/*
24* GPIO Module and I/O Multiplexer
25* x = 0..3 for reg_A, reg_B, reg_C, reg_D
26*/
27#define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR)
28#define MXC_DDIR(x) (0x00 + ((x) << 8))
29#define MXC_OCR1(x) (0x04 + ((x) << 8))
30#define MXC_OCR2(x) (0x08 + ((x) << 8))
31#define MXC_ICONFA1(x) (0x0c + ((x) << 8))
32#define MXC_ICONFA2(x) (0x10 + ((x) << 8))
33#define MXC_ICONFB1(x) (0x14 + ((x) << 8))
34#define MXC_ICONFB2(x) (0x18 + ((x) << 8))
35#define MXC_DR(x) (0x1c + ((x) << 8))
36#define MXC_GIUS(x) (0x20 + ((x) << 8))
37#define MXC_SSR(x) (0x24 + ((x) << 8))
38#define MXC_ICR1(x) (0x28 + ((x) << 8))
39#define MXC_ICR2(x) (0x2c + ((x) << 8))
40#define MXC_IMR(x) (0x30 + ((x) << 8))
41#define MXC_ISR(x) (0x34 + ((x) << 8))
42#define MXC_GPR(x) (0x38 + ((x) << 8))
43#define MXC_SWR(x) (0x3c + ((x) << 8))
44#define MXC_PUEN(x) (0x40 + ((x) << 8))
45
46#ifdef CONFIG_ARCH_MX1
47# define GPIO_PORT_MAX 3
48#endif
49#ifdef CONFIG_ARCH_MX2
50# define GPIO_PORT_MAX 5
51#endif
52
53#ifndef GPIO_PORT_MAX
54# error "GPIO config port count unknown!"
55#endif
56
57#define GPIO_PIN_MASK 0x1f
58
59#define GPIO_PORT_SHIFT 5
60#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
61
62#define GPIO_PORTA (0 << GPIO_PORT_SHIFT)
63#define GPIO_PORTB (1 << GPIO_PORT_SHIFT)
64#define GPIO_PORTC (2 << GPIO_PORT_SHIFT)
65#define GPIO_PORTD (3 << GPIO_PORT_SHIFT)
66#define GPIO_PORTE (4 << GPIO_PORT_SHIFT)
67#define GPIO_PORTF (5 << GPIO_PORT_SHIFT)
68
69#define GPIO_OUT (1 << 8)
70#define GPIO_IN (0 << 8)
71#define GPIO_PUEN (1 << 9)
72
73#define GPIO_PF (1 << 10)
74#define GPIO_AF (1 << 11)
75
76#define GPIO_OCR_SHIFT 12
77#define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT)
78#define GPIO_AIN (0 << GPIO_OCR_SHIFT)
79#define GPIO_BIN (1 << GPIO_OCR_SHIFT)
80#define GPIO_CIN (2 << GPIO_OCR_SHIFT)
81#define GPIO_GPIO (3 << GPIO_OCR_SHIFT)
82
83#define GPIO_AOUT_SHIFT 14
84#define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT)
85#define GPIO_AOUT (0 << GPIO_AOUT_SHIFT)
86#define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT)
87#define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT)
88#define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT)
89
90#define GPIO_BOUT_SHIFT 16
91#define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT)
92#define GPIO_BOUT (0 << GPIO_BOUT_SHIFT)
93#define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT)
94#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT)
95#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT)
96
97
98#ifdef CONFIG_ARCH_MX1
99#include <mach/iomux-mx1.h>
100#endif
101#ifdef CONFIG_ARCH_MX2
102#include <mach/iomux-mx2x.h>
103#ifdef CONFIG_MACH_MX21
104#include <mach/iomux-mx21.h>
105#endif
106#ifdef CONFIG_MACH_MX27
107#include <mach/iomux-mx27.h>
108#endif
109#endif
110
111
112/* decode irq number to use with IMR(x), ISR(x) and friends */
113#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
114
115#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
116#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
117#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
118#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
119#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
120
121
122extern void mxc_gpio_mode(int gpio_mode);
123extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
124 const char *label);
125extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
126
127#endif
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
index 0b808399097f..e0783e619580 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
@@ -14,7 +14,12 @@
14#if defined CONFIG_ARCH_MX1 14#if defined CONFIG_ARCH_MX1
15#define PHYS_OFFSET UL(0x08000000) 15#define PHYS_OFFSET UL(0x08000000)
16#elif defined CONFIG_ARCH_MX2 16#elif defined CONFIG_ARCH_MX2
17#ifdef CONFIG_MACH_MX21
18#define PHYS_OFFSET UL(0xC0000000)
19#endif
20#ifdef CONFIG_MACH_MX27
17#define PHYS_OFFSET UL(0xA0000000) 21#define PHYS_OFFSET UL(0xA0000000)
22#endif
18#elif defined CONFIG_ARCH_MX3 23#elif defined CONFIG_ARCH_MX3
19#define PHYS_OFFSET UL(0x80000000) 24#define PHYS_OFFSET UL(0x80000000)
20#endif 25#endif
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h
new file mode 100644
index 000000000000..e8c4cf56c24e
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mx21.h
@@ -0,0 +1,78 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 * Copyright 2009 Holger Schurig, hs4233@mail.mn-solutions.de
5 *
6 * This contains i.MX21-specific hardware definitions. For those
7 * hardware pieces that are common between i.MX21 and i.MX27, have a
8 * look at mx2x.h.
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
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 * MA 02110-1301, USA.
23 */
24
25#ifndef __ASM_ARCH_MXC_MX21_H__
26#define __ASM_ARCH_MXC_MX21_H__
27
28#ifndef __ASM_ARCH_MXC_HARDWARE_H__
29#error "Do not include directly."
30#endif
31
32
33/* Memory regions and CS */
34#define SDRAM_BASE_ADDR 0xC0000000
35#define CSD1_BASE_ADDR 0xC4000000
36
37#define CS0_BASE_ADDR 0xC8000000
38#define CS1_BASE_ADDR 0xCC000000
39#define CS2_BASE_ADDR 0xD0000000
40#define CS3_BASE_ADDR 0xD1000000
41#define CS4_BASE_ADDR 0xD2000000
42#define CS5_BASE_ADDR 0xDD000000
43#define PCMCIA_MEM_BASE_ADDR 0xD4000000
44
45/* NAND, SDRAM, WEIM etc controllers */
46#define X_MEMC_BASE_ADDR 0xDF000000
47#define X_MEMC_BASE_ADDR_VIRT 0xF4200000
48#define X_MEMC_SIZE SZ_256K
49
50#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000)
51#define EIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
52#define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
53#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
54
55#define IRAM_BASE_ADDR 0xFFFFE800 /* internal ram */
56
57/* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */
58#define ARCH_NR_GPIOS (6*32 + 16)
59
60/* fixed interrupt numbers */
61#define MXC_INT_USBCTRL 58
62#define MXC_INT_USBCTRL 58
63#define MXC_INT_USBMNP 57
64#define MXC_INT_USBFUNC 56
65#define MXC_INT_USBHOST 55
66#define MXC_INT_USBDMA 54
67#define MXC_INT_USBWKUP 53
68#define MXC_INT_EMMADEC 50
69#define MXC_INT_EMMAENC 49
70#define MXC_INT_BMI 30
71#define MXC_INT_FIRI 9
72
73/* fixed DMA request numbers */
74#define DMA_REQ_BMI_RX 29
75#define DMA_REQ_BMI_TX 28
76#define DMA_REQ_FIRI_RX 4
77
78#endif /* __ASM_ARCH_MXC_MX21_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index 0313be720552..6e93f2c0b7bb 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -2,6 +2,10 @@
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de 3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 * 4 *
5 * This contains i.MX27-specific hardware definitions. For those
6 * hardware pieces that are common between i.MX21 and i.MX27, have a
7 * look at mx2x.h.
8 *
5 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2 11 * as published by the Free Software Foundation; either version 2
@@ -27,35 +31,6 @@
27/* IRAM */ 31/* IRAM */
28#define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */ 32#define IRAM_BASE_ADDR 0xFFFF4C00 /* internal ram */
29 33
30/* Register offests */
31#define AIPI_BASE_ADDR 0x10000000
32#define AIPI_BASE_ADDR_VIRT 0xF4000000
33#define AIPI_SIZE SZ_1M
34
35#define DMA_BASE_ADDR (AIPI_BASE_ADDR + 0x01000)
36#define WDOG_BASE_ADDR (AIPI_BASE_ADDR + 0x02000)
37#define GPT1_BASE_ADDR (AIPI_BASE_ADDR + 0x03000)
38#define GPT2_BASE_ADDR (AIPI_BASE_ADDR + 0x04000)
39#define GPT3_BASE_ADDR (AIPI_BASE_ADDR + 0x05000)
40#define PWM_BASE_ADDR (AIPI_BASE_ADDR + 0x06000)
41#define RTC_BASE_ADDR (AIPI_BASE_ADDR + 0x07000)
42#define KPP_BASE_ADDR (AIPI_BASE_ADDR + 0x08000)
43#define OWIRE_BASE_ADDR (AIPI_BASE_ADDR + 0x09000)
44#define UART1_BASE_ADDR (AIPI_BASE_ADDR + 0x0A000)
45#define UART2_BASE_ADDR (AIPI_BASE_ADDR + 0x0B000)
46#define UART3_BASE_ADDR (AIPI_BASE_ADDR + 0x0C000)
47#define UART4_BASE_ADDR (AIPI_BASE_ADDR + 0x0D000)
48#define CSPI1_BASE_ADDR (AIPI_BASE_ADDR + 0x0E000)
49#define CSPI2_BASE_ADDR (AIPI_BASE_ADDR + 0x0F000)
50#define SSI1_BASE_ADDR (AIPI_BASE_ADDR + 0x10000)
51#define SSI2_BASE_ADDR (AIPI_BASE_ADDR + 0x11000)
52#define I2C_BASE_ADDR (AIPI_BASE_ADDR + 0x12000)
53#define SDHC1_BASE_ADDR (AIPI_BASE_ADDR + 0x13000)
54#define SDHC2_BASE_ADDR (AIPI_BASE_ADDR + 0x14000)
55#define GPIO_BASE_ADDR (AIPI_BASE_ADDR + 0x15000)
56#define AUDMUX_BASE_ADDR (AIPI_BASE_ADDR + 0x16000)
57
58#define CSPI3_BASE_ADDR (AIPI_BASE_ADDR + 0x17000)
59#define MSHC_BASE_ADDR (AIPI_BASE_ADDR + 0x18000) 34#define MSHC_BASE_ADDR (AIPI_BASE_ADDR + 0x18000)
60#define GPT5_BASE_ADDR (AIPI_BASE_ADDR + 0x19000) 35#define GPT5_BASE_ADDR (AIPI_BASE_ADDR + 0x19000)
61#define GPT4_BASE_ADDR (AIPI_BASE_ADDR + 0x1A000) 36#define GPT4_BASE_ADDR (AIPI_BASE_ADDR + 0x1A000)
@@ -64,55 +39,24 @@
64#define I2C2_BASE_ADDR (AIPI_BASE_ADDR + 0x1D000) 39#define I2C2_BASE_ADDR (AIPI_BASE_ADDR + 0x1D000)
65#define SDHC3_BASE_ADDR (AIPI_BASE_ADDR + 0x1E000) 40#define SDHC3_BASE_ADDR (AIPI_BASE_ADDR + 0x1E000)
66#define GPT6_BASE_ADDR (AIPI_BASE_ADDR + 0x1F000) 41#define GPT6_BASE_ADDR (AIPI_BASE_ADDR + 0x1F000)
67
68#define LCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x21000)
69#define SLCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x22000)
70#define VPU_BASE_ADDR (AIPI_BASE_ADDR + 0x23000) 42#define VPU_BASE_ADDR (AIPI_BASE_ADDR + 0x23000)
71#define USBOTG_BASE_ADDR (AIPI_BASE_ADDR + 0x24000)
72/* for mx27*/
73#define OTG_BASE_ADDR USBOTG_BASE_ADDR 43#define OTG_BASE_ADDR USBOTG_BASE_ADDR
74#define SAHARA_BASE_ADDR (AIPI_BASE_ADDR + 0x25000) 44#define SAHARA_BASE_ADDR (AIPI_BASE_ADDR + 0x25000)
75#define EMMA_PP_BASE_ADDR (AIPI_BASE_ADDR + 0x26000)
76#define EMMA_PRP_BASE_ADDR (AIPI_BASE_ADDR + 0x26400)
77#define CCM_BASE_ADDR (AIPI_BASE_ADDR + 0x27000)
78#define SYSCTRL_BASE_ADDR (AIPI_BASE_ADDR + 0x27800)
79#define IIM_BASE_ADDR (AIPI_BASE_ADDR + 0x28000) 45#define IIM_BASE_ADDR (AIPI_BASE_ADDR + 0x28000)
80
81#define RTIC_BASE_ADDR (AIPI_BASE_ADDR + 0x2A000) 46#define RTIC_BASE_ADDR (AIPI_BASE_ADDR + 0x2A000)
82#define FEC_BASE_ADDR (AIPI_BASE_ADDR + 0x2B000) 47#define FEC_BASE_ADDR (AIPI_BASE_ADDR + 0x2B000)
83#define SCC_BASE_ADDR (AIPI_BASE_ADDR + 0x2C000) 48#define SCC_BASE_ADDR (AIPI_BASE_ADDR + 0x2C000)
84#define ETB_BASE_ADDR (AIPI_BASE_ADDR + 0x3B000) 49#define ETB_BASE_ADDR (AIPI_BASE_ADDR + 0x3B000)
85#define ETB_RAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3C000) 50#define ETB_RAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3C000)
86 51
87#define JAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3E000) 52/* ROM patch */
88#define MAX_BASE_ADDR (AIPI_BASE_ADDR + 0x3F000)
89
90/* ROMP and AVIC */
91#define ROMP_BASE_ADDR 0x10041000 53#define ROMP_BASE_ADDR 0x10041000
92 54
93#define AVIC_BASE_ADDR 0x10040000
94
95#define SAHB1_BASE_ADDR 0x80000000
96#define SAHB1_BASE_ADDR_VIRT 0xF4100000
97#define SAHB1_SIZE SZ_1M
98
99#define CSI_BASE_ADDR (SAHB1_BASE_ADDR + 0x0000)
100#define ATA_BASE_ADDR (SAHB1_BASE_ADDR + 0x1000) 55#define ATA_BASE_ADDR (SAHB1_BASE_ADDR + 0x1000)
101 56
102/* NAND, SDRAM, WEIM, M3IF, EMI controllers */
103#define X_MEMC_BASE_ADDR 0xD8000000
104#define X_MEMC_BASE_ADDR_VIRT 0xF4200000
105#define X_MEMC_SIZE SZ_1M
106
107#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR)
108#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
109#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
110#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
111#define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
112
113/* Memory regions and CS */ 57/* Memory regions and CS */
114#define SDRAM_BASE_ADDR 0xA0000000 58#define SDRAM_BASE_ADDR 0xA0000000
115#define CSD1_BASE_ADDR 0xB0000000 59#define CSD1_BASE_ADDR 0xB0000000
116 60
117#define CS0_BASE_ADDR 0xC0000000 61#define CS0_BASE_ADDR 0xC0000000
118#define CS1_BASE_ADDR 0xC8000000 62#define CS1_BASE_ADDR 0xC8000000
@@ -122,44 +66,20 @@
122#define CS5_BASE_ADDR 0xD6000000 66#define CS5_BASE_ADDR 0xD6000000
123#define PCMCIA_MEM_BASE_ADDR 0xDC000000 67#define PCMCIA_MEM_BASE_ADDR 0xDC000000
124 68
125/* 69/* NAND, SDRAM, WEIM, M3IF, EMI controllers */
126 * This macro defines the physical to virtual address mapping for all the 70#define X_MEMC_BASE_ADDR 0xD8000000
127 * peripheral modules. It is used by passing in the physical address as x 71#define X_MEMC_BASE_ADDR_VIRT 0xF4200000
128 * and returning the virtual address. If the physical address is not mapped, 72#define X_MEMC_SIZE SZ_1M
129 * it returns 0xDEADBEEF
130 */
131#define IO_ADDRESS(x) \
132 (void __iomem *) \
133 (((x >= AIPI_BASE_ADDR) && (x < (AIPI_BASE_ADDR + AIPI_SIZE))) ? \
134 AIPI_IO_ADDRESS(x) : \
135 ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \
136 SAHB1_IO_ADDRESS(x) : \
137 ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \
138 X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF)
139
140/* define the address mapping macros: in physical address order */
141#define AIPI_IO_ADDRESS(x) \
142 (((x) - AIPI_BASE_ADDR) + AIPI_BASE_ADDR_VIRT)
143
144#define AVIC_IO_ADDRESS(x) AIPI_IO_ADDRESS(x)
145
146#define SAHB1_IO_ADDRESS(x) \
147 (((x) - SAHB1_BASE_ADDR) + SAHB1_BASE_ADDR_VIRT)
148
149#define CS4_IO_ADDRESS(x) \
150 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
151
152#define X_MEMC_IO_ADDRESS(x) \
153 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
154 73
155#define PCMCIA_IO_ADDRESS(x) \ 74#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR)
156 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) 75#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
76#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
77#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
78#define PCMCIA_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
157 79
158/* fixed interrput numbers */ 80/* fixed interrupt numbers */
159#define MXC_INT_CCM 63 81#define MXC_INT_CCM 63
160#define MXC_INT_IIM 62 82#define MXC_INT_IIM 62
161#define MXC_INT_LCDC 61
162#define MXC_INT_SLCDC 60
163#define MXC_INT_SAHARA 59 83#define MXC_INT_SAHARA 59
164#define MXC_INT_SCC_SCM 58 84#define MXC_INT_SCC_SCM 58
165#define MXC_INT_SCC_SMN 57 85#define MXC_INT_SCC_SMN 57
@@ -167,54 +87,12 @@
167#define MXC_INT_USB2 55 87#define MXC_INT_USB2 55
168#define MXC_INT_USB1 54 88#define MXC_INT_USB1 54
169#define MXC_INT_VPU 53 89#define MXC_INT_VPU 53
170#define MXC_INT_EMMAPP 52
171#define MXC_INT_EMMAPRP 51
172#define MXC_INT_FEC 50 90#define MXC_INT_FEC 50
173#define MXC_INT_UART5 49 91#define MXC_INT_UART5 49
174#define MXC_INT_UART6 48 92#define MXC_INT_UART6 48
175#define MXC_INT_DMACH15 47
176#define MXC_INT_DMACH14 46
177#define MXC_INT_DMACH13 45
178#define MXC_INT_DMACH12 44
179#define MXC_INT_DMACH11 43
180#define MXC_INT_DMACH10 42
181#define MXC_INT_DMACH9 41
182#define MXC_INT_DMACH8 40
183#define MXC_INT_DMACH7 39
184#define MXC_INT_DMACH6 38
185#define MXC_INT_DMACH5 37
186#define MXC_INT_DMACH4 36
187#define MXC_INT_DMACH3 35
188#define MXC_INT_DMACH2 34
189#define MXC_INT_DMACH1 33
190#define MXC_INT_DMACH0 32
191#define MXC_INT_CSI 31
192#define MXC_INT_ATA 30 93#define MXC_INT_ATA 30
193#define MXC_INT_NANDFC 29
194#define MXC_INT_PCMCIA 28
195#define MXC_INT_WDOG 27
196#define MXC_INT_GPT1 26
197#define MXC_INT_GPT2 25
198#define MXC_INT_GPT3 24
199#define MXC_INT_GPT INT_GPT1
200#define MXC_INT_PWM 23
201#define MXC_INT_RTC 22
202#define MXC_INT_KPP 21
203#define MXC_INT_UART1 20
204#define MXC_INT_UART2 19
205#define MXC_INT_UART3 18
206#define MXC_INT_UART4 17
207#define MXC_INT_CSPI1 16
208#define MXC_INT_CSPI2 15
209#define MXC_INT_SSI1 14
210#define MXC_INT_SSI2 13
211#define MXC_INT_I2C 12
212#define MXC_INT_SDHC1 11
213#define MXC_INT_SDHC2 10
214#define MXC_INT_SDHC3 9 94#define MXC_INT_SDHC3 9
215#define MXC_INT_GPIO 8
216#define MXC_INT_SDHC 7 95#define MXC_INT_SDHC 7
217#define MXC_INT_CSPI3 6
218#define MXC_INT_RTIC 5 96#define MXC_INT_RTIC 5
219#define MXC_INT_GPT4 4 97#define MXC_INT_GPT4 4
220#define MXC_INT_GPT5 3 98#define MXC_INT_GPT5 3
@@ -228,36 +106,9 @@
228#define DMA_REQ_UART6_TX 34 106#define DMA_REQ_UART6_TX 34
229#define DMA_REQ_UART5_RX 33 107#define DMA_REQ_UART5_RX 33
230#define DMA_REQ_UART5_TX 32 108#define DMA_REQ_UART5_TX 32
231#define DMA_REQ_CSI_RX 31
232#define DMA_REQ_CSI_STAT 30
233#define DMA_REQ_ATA_RCV 29 109#define DMA_REQ_ATA_RCV 29
234#define DMA_REQ_ATA_TX 28 110#define DMA_REQ_ATA_TX 28
235#define DMA_REQ_UART1_TX 27
236#define DMA_REQ_UART1_RX 26
237#define DMA_REQ_UART2_TX 25
238#define DMA_REQ_UART2_RX 24
239#define DMA_REQ_UART3_TX 23
240#define DMA_REQ_UART3_RX 22
241#define DMA_REQ_UART4_TX 21
242#define DMA_REQ_UART4_RX 20
243#define DMA_REQ_CSPI1_TX 19
244#define DMA_REQ_CSPI1_RX 18
245#define DMA_REQ_CSPI2_TX 17
246#define DMA_REQ_CSPI2_RX 16
247#define DMA_REQ_SSI1_TX1 15
248#define DMA_REQ_SSI1_RX1 14
249#define DMA_REQ_SSI1_TX0 13
250#define DMA_REQ_SSI1_RX0 12
251#define DMA_REQ_SSI2_TX1 11
252#define DMA_REQ_SSI2_RX1 10
253#define DMA_REQ_SSI2_TX0 9
254#define DMA_REQ_SSI2_RX0 8
255#define DMA_REQ_SDHC1 7
256#define DMA_REQ_SDHC2 6
257#define DMA_REQ_MSHC 4 111#define DMA_REQ_MSHC 4
258#define DMA_REQ_EXT 3
259#define DMA_REQ_CSPI3_TX 2
260#define DMA_REQ_CSPI3_RX 1
261 112
262/* silicon revisions specific to i.MX27 */ 113/* silicon revisions specific to i.MX27 */
263#define CHIP_REV_1_0 0x00 114#define CHIP_REV_1_0 0x00
@@ -267,25 +118,8 @@
267extern int mx27_revision(void); 118extern int mx27_revision(void);
268#endif 119#endif
269 120
270/* gpio and gpio based interrupt handling */
271#define GPIO_DR 0x1C
272#define GPIO_GDIR 0x00
273#define GPIO_PSR 0x24
274#define GPIO_ICR1 0x28
275#define GPIO_ICR2 0x2C
276#define GPIO_IMR 0x30
277#define GPIO_ISR 0x34
278#define GPIO_INT_LOW_LEV 0x3
279#define GPIO_INT_HIGH_LEV 0x2
280#define GPIO_INT_RISE_EDGE 0x0
281#define GPIO_INT_FALL_EDGE 0x1
282#define GPIO_INT_NONE 0x4
283
284/* Mandatory defines used globally */ 121/* Mandatory defines used globally */
285 122
286/* this is an i.MX27 CPU */
287#define cpu_is_mx27() (1)
288
289/* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */ 123/* this CPU supports up to 192 GPIOs (don't forget the baseboard!) */
290#define ARCH_NR_GPIOS (192 + 16) 124#define ARCH_NR_GPIOS (192 + 16)
291 125
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h
new file mode 100644
index 000000000000..fc40d3ab8c5b
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mx2x.h
@@ -0,0 +1,200 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 *
5 * This contains hardware definitions that are common between i.MX21 and
6 * i.MX27.
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.
21 */
22
23#ifndef __ASM_ARCH_MXC_MX2x_H__
24#define __ASM_ARCH_MXC_MX2x_H__
25
26#ifndef __ASM_ARCH_MXC_HARDWARE_H__
27#error "Do not include directly."
28#endif
29
30/* The following addresses are common between i.MX21 and i.MX27 */
31
32/* Register offests */
33#define AIPI_BASE_ADDR 0x10000000
34#define AIPI_BASE_ADDR_VIRT 0xF4000000
35#define AIPI_SIZE SZ_1M
36
37#define DMA_BASE_ADDR (AIPI_BASE_ADDR + 0x01000)
38#define WDOG_BASE_ADDR (AIPI_BASE_ADDR + 0x02000)
39#define GPT1_BASE_ADDR (AIPI_BASE_ADDR + 0x03000)
40#define GPT2_BASE_ADDR (AIPI_BASE_ADDR + 0x04000)
41#define GPT3_BASE_ADDR (AIPI_BASE_ADDR + 0x05000)
42#define PWM_BASE_ADDR (AIPI_BASE_ADDR + 0x06000)
43#define RTC_BASE_ADDR (AIPI_BASE_ADDR + 0x07000)
44#define KPP_BASE_ADDR (AIPI_BASE_ADDR + 0x08000)
45#define OWIRE_BASE_ADDR (AIPI_BASE_ADDR + 0x09000)
46#define UART1_BASE_ADDR (AIPI_BASE_ADDR + 0x0A000)
47#define UART2_BASE_ADDR (AIPI_BASE_ADDR + 0x0B000)
48#define UART3_BASE_ADDR (AIPI_BASE_ADDR + 0x0C000)
49#define UART4_BASE_ADDR (AIPI_BASE_ADDR + 0x0D000)
50#define CSPI1_BASE_ADDR (AIPI_BASE_ADDR + 0x0E000)
51#define CSPI2_BASE_ADDR (AIPI_BASE_ADDR + 0x0F000)
52#define SSI1_BASE_ADDR (AIPI_BASE_ADDR + 0x10000)
53#define SSI2_BASE_ADDR (AIPI_BASE_ADDR + 0x11000)
54#define I2C_BASE_ADDR (AIPI_BASE_ADDR + 0x12000)
55#define SDHC1_BASE_ADDR (AIPI_BASE_ADDR + 0x13000)
56#define SDHC2_BASE_ADDR (AIPI_BASE_ADDR + 0x14000)
57#define GPIO_BASE_ADDR (AIPI_BASE_ADDR + 0x15000)
58#define AUDMUX_BASE_ADDR (AIPI_BASE_ADDR + 0x16000)
59#define CSPI3_BASE_ADDR (AIPI_BASE_ADDR + 0x17000)
60#define LCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x21000)
61#define SLCDC_BASE_ADDR (AIPI_BASE_ADDR + 0x22000)
62#define USBOTG_BASE_ADDR (AIPI_BASE_ADDR + 0x24000)
63#define EMMA_PP_BASE_ADDR (AIPI_BASE_ADDR + 0x26000)
64#define EMMA_PRP_BASE_ADDR (AIPI_BASE_ADDR + 0x26400)
65#define CCM_BASE_ADDR (AIPI_BASE_ADDR + 0x27000)
66#define SYSCTRL_BASE_ADDR (AIPI_BASE_ADDR + 0x27800)
67#define JAM_BASE_ADDR (AIPI_BASE_ADDR + 0x3E000)
68#define MAX_BASE_ADDR (AIPI_BASE_ADDR + 0x3F000)
69
70#define AVIC_BASE_ADDR 0x10040000
71
72#define SAHB1_BASE_ADDR 0x80000000
73#define SAHB1_BASE_ADDR_VIRT 0xF4100000
74#define SAHB1_SIZE SZ_1M
75
76#define CSI_BASE_ADDR (SAHB1_BASE_ADDR + 0x0000)
77
78/*
79 * This macro defines the physical to virtual address mapping for all the
80 * peripheral modules. It is used by passing in the physical address as x
81 * and returning the virtual address. If the physical address is not mapped,
82 * it returns 0xDEADBEEF
83 */
84#define IO_ADDRESS(x) \
85 (void __force __iomem *) \
86 (((x >= AIPI_BASE_ADDR) && (x < (AIPI_BASE_ADDR + AIPI_SIZE))) ? \
87 AIPI_IO_ADDRESS(x) : \
88 ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \
89 SAHB1_IO_ADDRESS(x) : \
90 ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \
91 X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF)
92
93/* define the address mapping macros: in physical address order */
94#define AIPI_IO_ADDRESS(x) \
95 (((x) - AIPI_BASE_ADDR) + AIPI_BASE_ADDR_VIRT)
96
97#define AVIC_IO_ADDRESS(x) AIPI_IO_ADDRESS(x)
98
99#define SAHB1_IO_ADDRESS(x) \
100 (((x) - SAHB1_BASE_ADDR) + SAHB1_BASE_ADDR_VIRT)
101
102#define CS4_IO_ADDRESS(x) \
103 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
104
105#define X_MEMC_IO_ADDRESS(x) \
106 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
107
108#define PCMCIA_IO_ADDRESS(x) \
109 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
110
111/* fixed interrupt numbers */
112#define MXC_INT_LCDC 61
113#define MXC_INT_SLCDC 60
114#define MXC_INT_EMMAPP 52
115#define MXC_INT_EMMAPRP 51
116#define MXC_INT_DMACH15 47
117#define MXC_INT_DMACH14 46
118#define MXC_INT_DMACH13 45
119#define MXC_INT_DMACH12 44
120#define MXC_INT_DMACH11 43
121#define MXC_INT_DMACH10 42
122#define MXC_INT_DMACH9 41
123#define MXC_INT_DMACH8 40
124#define MXC_INT_DMACH7 39
125#define MXC_INT_DMACH6 38
126#define MXC_INT_DMACH5 37
127#define MXC_INT_DMACH4 36
128#define MXC_INT_DMACH3 35
129#define MXC_INT_DMACH2 34
130#define MXC_INT_DMACH1 33
131#define MXC_INT_DMACH0 32
132#define MXC_INT_CSI 31
133#define MXC_INT_NANDFC 29
134#define MXC_INT_PCMCIA 28
135#define MXC_INT_WDOG 27
136#define MXC_INT_GPT1 26
137#define MXC_INT_GPT2 25
138#define MXC_INT_GPT3 24
139#define MXC_INT_GPT INT_GPT1
140#define MXC_INT_PWM 23
141#define MXC_INT_RTC 22
142#define MXC_INT_KPP 21
143#define MXC_INT_UART1 20
144#define MXC_INT_UART2 19
145#define MXC_INT_UART3 18
146#define MXC_INT_UART4 17
147#define MXC_INT_CSPI1 16
148#define MXC_INT_CSPI2 15
149#define MXC_INT_SSI1 14
150#define MXC_INT_SSI2 13
151#define MXC_INT_I2C 12
152#define MXC_INT_SDHC1 11
153#define MXC_INT_SDHC2 10
154#define MXC_INT_GPIO 8
155#define MXC_INT_CSPI3 6
156
157/* gpio and gpio based interrupt handling */
158#define GPIO_DR 0x1C
159#define GPIO_GDIR 0x00
160#define GPIO_PSR 0x24
161#define GPIO_ICR1 0x28
162#define GPIO_ICR2 0x2C
163#define GPIO_IMR 0x30
164#define GPIO_ISR 0x34
165#define GPIO_INT_LOW_LEV 0x3
166#define GPIO_INT_HIGH_LEV 0x2
167#define GPIO_INT_RISE_EDGE 0x0
168#define GPIO_INT_FALL_EDGE 0x1
169#define GPIO_INT_NONE 0x4
170
171/* fixed DMA request numbers */
172#define DMA_REQ_CSI_RX 31
173#define DMA_REQ_CSI_STAT 30
174#define DMA_REQ_UART1_TX 27
175#define DMA_REQ_UART1_RX 26
176#define DMA_REQ_UART2_TX 25
177#define DMA_REQ_UART2_RX 24
178#define DMA_REQ_UART3_TX 23
179#define DMA_REQ_UART3_RX 22
180#define DMA_REQ_UART4_TX 21
181#define DMA_REQ_UART4_RX 20
182#define DMA_REQ_CSPI1_TX 19
183#define DMA_REQ_CSPI1_RX 18
184#define DMA_REQ_CSPI2_TX 17
185#define DMA_REQ_CSPI2_RX 16
186#define DMA_REQ_SSI1_TX1 15
187#define DMA_REQ_SSI1_RX1 14
188#define DMA_REQ_SSI1_TX0 13
189#define DMA_REQ_SSI1_RX0 12
190#define DMA_REQ_SSI2_TX1 11
191#define DMA_REQ_SSI2_RX1 10
192#define DMA_REQ_SSI2_TX0 9
193#define DMA_REQ_SSI2_RX0 8
194#define DMA_REQ_SDHC1 7
195#define DMA_REQ_SDHC2 6
196#define DMA_REQ_EXT 3
197#define DMA_REQ_CSPI3_TX 2
198#define DMA_REQ_CSPI3_RX 1
199
200#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 de026654b00e..0b06941b6139 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -1,360 +1,45 @@
1/* 1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 __ASM_ARCH_MXC_MX31_H__
12#define __ASM_ARCH_MXC_MX31_H__
13
14#ifndef __ASM_ARCH_MXC_HARDWARE_H__
15#error "Do not include directly."
16#endif
17
18/*
19 * MX31 memory map:
20 *
21 * Virt Phys Size What
22 * ---------------------------------------------------------------------------
23 * F8000000 1FFC0000 16K IRAM
24 * F9000000 30000000 256M L2CC
25 * FC000000 43F00000 1M AIPS 1
26 * FC100000 50000000 1M SPBA
27 * FC200000 53F00000 1M AIPS 2
28 * FC500000 60000000 128M ROMPATCH
29 * FC400000 68000000 128M AVIC
30 * 70000000 256M IPU (MAX M2)
31 * 80000000 256M CSD0 SDRAM/DDR
32 * 90000000 256M CSD1 SDRAM/DDR
33 * A0000000 128M CS0 Flash
34 * A8000000 128M CS1 Flash
35 * B0000000 32M CS2
36 * B2000000 32M CS3
37 * F4000000 B4000000 32M CS4
38 * B6000000 32M CS5
39 * FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers
40 * C0000000 64M PCMCIA/CF
41 */
42
43#define CS0_BASE_ADDR 0xA0000000
44#define CS1_BASE_ADDR 0xA8000000
45#define CS2_BASE_ADDR 0xB0000000
46#define CS3_BASE_ADDR 0xB2000000
47
48#define CS4_BASE_ADDR 0xB4000000
49#define CS4_BASE_ADDR_VIRT 0xF4000000
50#define CS4_SIZE SZ_32M
51
52#define CS5_BASE_ADDR 0xB6000000
53#define PCMCIA_MEM_BASE_ADDR 0xBC000000
54
55/*
56 * IRAM 2 * IRAM
57 */ 3 */
58#define IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */ 4#define MX31_IRAM_BASE_ADDR 0x1FFC0000 /* internal ram */
59#define IRAM_BASE_ADDR_VIRT 0xF8000000 5#define MX31_IRAM_SIZE SZ_16K
60#define IRAM_SIZE SZ_16K
61
62/*
63 * L2CC
64 */
65#define L2CC_BASE_ADDR 0x30000000
66#define L2CC_BASE_ADDR_VIRT 0xF9000000
67#define L2CC_SIZE SZ_1M
68
69/*
70 * AIPS 1
71 */
72#define AIPS1_BASE_ADDR 0x43F00000
73#define AIPS1_BASE_ADDR_VIRT 0xFC000000
74#define AIPS1_SIZE SZ_1M
75 6
76#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000)
77#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000)
78#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000)
79#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000)
80#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000)
81#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000)
82#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
83#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
84#define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000) 7#define OTG_BASE_ADDR (AIPS1_BASE_ADDR + 0x00088000)
85#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000) 8#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x0008C000)
86#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
87#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
88#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
89#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
90#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
91#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
92#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
93#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
94#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) 9#define UART4_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000)
95#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000) 10#define UART5_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B4000)
96#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
97#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
98
99/*
100 * SPBA global module enabled #0
101 */
102#define SPBA0_BASE_ADDR 0x50000000
103#define SPBA0_BASE_ADDR_VIRT 0xFC100000
104#define SPBA0_SIZE SZ_1M
105 11
106#define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) 12#define MMC_SDHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000)
107#define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) 13#define MMC_SDHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000)
108#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000)
109#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
110#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
111#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) 14#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000)
112#define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000) 15#define IIM_BASE_ADDR (SPBA0_BASE_ADDR + 0x0001C000)
113#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
114#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
115#define MSHC2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
116#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
117 16
118/*
119 * AIPS 2
120 */
121#define AIPS2_BASE_ADDR 0x53F00000
122#define AIPS2_BASE_ADDR_VIRT 0xFC200000
123#define AIPS2_SIZE SZ_1M
124#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
125#define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) 17#define CSPI3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000)
126#define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) 18#define FIRI_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000)
127#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000)
128#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
129#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
130#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
131#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
132#define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000) 19#define SCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AE000)
133#define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000) 20#define SMN_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AF000)
134#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
135#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
136#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
137#define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) 21#define MPEG4_ENC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000)
138#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
139#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
140#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000)
141#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
142#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
143#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
144#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
145
146/*
147 * ROMP and AVIC
148 */
149#define ROMP_BASE_ADDR 0x60000000
150#define ROMP_BASE_ADDR_VIRT 0xFC500000
151#define ROMP_SIZE SZ_1M
152
153#define AVIC_BASE_ADDR 0x68000000
154#define AVIC_BASE_ADDR_VIRT 0xFC400000
155#define AVIC_SIZE SZ_1M
156
157/*
158 * NAND, SDRAM, WEIM, M3IF, EMI controllers
159 */
160#define X_MEMC_BASE_ADDR 0xB8000000
161#define X_MEMC_BASE_ADDR_VIRT 0xFC320000
162#define X_MEMC_SIZE SZ_64K
163 22
164#define NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000) 23#define MX31_NFC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x0000)
165#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
166#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
167#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
168#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
169#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR
170 24
171/*
172 * Memory regions and CS
173 */
174#define IPU_MEM_BASE_ADDR 0x70000000
175#define CSD0_BASE_ADDR 0x80000000
176#define CSD1_BASE_ADDR 0x90000000
177#define CS0_BASE_ADDR 0xA0000000
178#define CS1_BASE_ADDR 0xA8000000
179#define CS2_BASE_ADDR 0xB0000000
180#define CS3_BASE_ADDR 0xB2000000
181
182#define CS4_BASE_ADDR 0xB4000000
183#define CS4_BASE_ADDR_VIRT 0xF4000000
184#define CS4_SIZE SZ_32M
185
186#define CS5_BASE_ADDR 0xB6000000
187#define PCMCIA_MEM_BASE_ADDR 0xBC000000
188
189/*!
190 * This macro defines the physical to virtual address mapping for all the
191 * peripheral modules. It is used by passing in the physical address as x
192 * and returning the virtual address. If the physical address is not mapped,
193 * it returns 0xDEADBEEF
194 */
195#define IO_ADDRESS(x) \
196 (void __iomem *) \
197 (((x >= IRAM_BASE_ADDR) && (x < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x):\
198 ((x >= L2CC_BASE_ADDR) && (x < (L2CC_BASE_ADDR + L2CC_SIZE))) ? L2CC_IO_ADDRESS(x):\
199 ((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\
200 ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\
201 ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\
202 ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\
203 ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\
204 ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\
205 ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\
206 0xDEADBEEF)
207
208/*
209 * define the address mapping macros: in physical address order
210 */
211
212#define IRAM_IO_ADDRESS(x) \
213 (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT)
214
215#define L2CC_IO_ADDRESS(x) \
216 (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT)
217
218#define AIPS1_IO_ADDRESS(x) \
219 (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT)
220
221#define SPBA0_IO_ADDRESS(x) \
222 (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT)
223
224#define AIPS2_IO_ADDRESS(x) \
225 (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT)
226
227#define ROMP_IO_ADDRESS(x) \
228 (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT)
229
230#define AVIC_IO_ADDRESS(x) \
231 (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT)
232
233#define CS4_IO_ADDRESS(x) \
234 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
235
236#define X_MEMC_IO_ADDRESS(x) \
237 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
238
239#define PCMCIA_IO_ADDRESS(x) \
240 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
241
242/*
243 * Interrupt numbers
244 */
245#define MXC_INT_PEN_ADS7843 0
246#define MXC_INT_RESV1 1
247#define MXC_INT_CS8900A 2
248#define MXC_INT_I2C3 3
249#define MXC_INT_I2C2 4
250#define MXC_INT_MPEG4_ENCODER 5 25#define MXC_INT_MPEG4_ENCODER 5
251#define MXC_INT_RTIC 6
252#define MXC_INT_FIRI 7 26#define MXC_INT_FIRI 7
253#define MXC_INT_MMC_SDHC2 8 27#define MX31_INT_MMC_SDHC2 8
254#define MXC_INT_MMC_SDHC1 9 28#define MXC_INT_MMC_SDHC1 9
255#define MXC_INT_I2C 10 29#define MX31_INT_SSI2 11
256#define MXC_INT_SSI2 11 30#define MX31_INT_SSI1 12
257#define MXC_INT_SSI1 12
258#define MXC_INT_CSPI2 13
259#define MXC_INT_CSPI1 14
260#define MXC_INT_ATA 15
261#define MXC_INT_MBX 16 31#define MXC_INT_MBX 16
262#define MXC_INT_CSPI3 17 32#define MXC_INT_CSPI3 17
263#define MXC_INT_UART3 18
264#define MXC_INT_IIM 19
265#define MXC_INT_SIM2 20 33#define MXC_INT_SIM2 20
266#define MXC_INT_SIM1 21 34#define MXC_INT_SIM1 21
267#define MXC_INT_RNGA 22 35#define MXC_INT_CCM_DVFS 31
268#define MXC_INT_EVTMON 23
269#define MXC_INT_KPP 24
270#define MXC_INT_RTC 25
271#define MXC_INT_PWM 26
272#define MXC_INT_EPIT2 27
273#define MXC_INT_EPIT1 28
274#define MXC_INT_GPT 29
275#define MXC_INT_RESV30 30
276#define MXC_INT_RESV31 31
277#define MXC_INT_UART2 32
278#define MXC_INT_NANDFC 33
279#define MXC_INT_SDMA 34
280#define MXC_INT_USB1 35 36#define MXC_INT_USB1 35
281#define MXC_INT_USB2 36 37#define MXC_INT_USB2 36
282#define MXC_INT_USB3 37 38#define MXC_INT_USB3 37
283#define MXC_INT_USB4 38 39#define MXC_INT_USB4 38
284#define MXC_INT_MSHC1 39
285#define MXC_INT_MSHC2 40 40#define MXC_INT_MSHC2 40
286#define MXC_INT_IPU_ERR 41
287#define MXC_INT_IPU_SYN 42
288#define MXC_INT_RESV43 43
289#define MXC_INT_RESV44 44
290#define MXC_INT_UART1 45
291#define MXC_INT_UART4 46 41#define MXC_INT_UART4 46
292#define MXC_INT_UART5 47 42#define MXC_INT_UART5 47
293#define MXC_INT_ECT 48
294#define MXC_INT_SCC_SCM 49
295#define MXC_INT_SCC_SMN 50
296#define MXC_INT_GPIO2 51
297#define MXC_INT_GPIO1 52
298#define MXC_INT_CCM 53 43#define MXC_INT_CCM 53
299#define MXC_INT_PCMCIA 54 44#define MXC_INT_PCMCIA 54
300#define MXC_INT_WDOG 55
301#define MXC_INT_GPIO3 56
302#define MXC_INT_RESV57 57
303#define MXC_INT_EXT_POWER 58
304#define MXC_INT_EXT_TEMPER 59
305#define MXC_INT_EXT_SENSOR60 60
306#define MXC_INT_EXT_SENSOR61 61
307#define MXC_INT_EXT_WDOG 62
308#define MXC_INT_EXT_TV 63
309
310#define PROD_SIGNATURE 0x1 /* For MX31 */
311
312/* silicon revisions specific to i.MX31 */
313#define CHIP_REV_1_0 0x10
314#define CHIP_REV_1_1 0x11
315#define CHIP_REV_1_2 0x12
316#define CHIP_REV_1_3 0x13
317#define CHIP_REV_2_0 0x20
318#define CHIP_REV_2_1 0x21
319#define CHIP_REV_2_2 0x22
320#define CHIP_REV_2_3 0x23
321#define CHIP_REV_3_0 0x30
322#define CHIP_REV_3_1 0x31
323#define CHIP_REV_3_2 0x32
324
325#define SYSTEM_REV_MIN CHIP_REV_1_0
326#define SYSTEM_REV_NUM 3
327
328/* gpio and gpio based interrupt handling */
329#define GPIO_DR 0x00
330#define GPIO_GDIR 0x04
331#define GPIO_PSR 0x08
332#define GPIO_ICR1 0x0C
333#define GPIO_ICR2 0x10
334#define GPIO_IMR 0x14
335#define GPIO_ISR 0x18
336#define GPIO_INT_LOW_LEV 0x0
337#define GPIO_INT_HIGH_LEV 0x1
338#define GPIO_INT_RISE_EDGE 0x2
339#define GPIO_INT_FALL_EDGE 0x3
340#define GPIO_INT_NONE 0x4
341
342/* Mandatory defines used globally */
343
344/* this CPU supports up to 96 GPIOs */
345#define ARCH_NR_GPIOS 96
346
347#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
348
349/* this is a i.MX31 CPU */
350#define cpu_is_mx31() (1)
351
352extern unsigned int system_rev;
353
354static inline int mx31_revision(void)
355{
356 return system_rev;
357}
358#endif
359 45
360#endif /* __ASM_ARCH_MXC_MX31_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h
new file mode 100644
index 000000000000..6465fefb42e3
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mx35.h
@@ -0,0 +1,29 @@
1/*
2 * IRAM
3 */
4#define MX35_IRAM_BASE_ADDR 0x10000000 /* internal ram */
5#define MX35_IRAM_SIZE SZ_128K
6
7#define MXC_FEC_BASE_ADDR 0x50038000
8#define MX35_NFC_BASE_ADDR 0xBB000000
9
10/*
11 * Interrupt numbers
12 */
13#define MXC_INT_OWIRE 2
14#define MX35_INT_MMC_SDHC1 7
15#define MXC_INT_MMC_SDHC2 8
16#define MXC_INT_MMC_SDHC3 9
17#define MX35_INT_SSI1 11
18#define MX35_INT_SSI2 12
19#define MXC_INT_GPU2D 16
20#define MXC_INT_ASRC 17
21#define MXC_INT_USBHS 35
22#define MXC_INT_USBOTG 37
23#define MXC_INT_ESAI 40
24#define MXC_INT_CAN1 43
25#define MXC_INT_CAN2 44
26#define MXC_INT_MLB 46
27#define MXC_INT_SPDIF 47
28#define MXC_INT_FEC 57
29
diff --git a/arch/arm/plat-mxc/include/mach/mx3fb.h b/arch/arm/plat-mxc/include/mach/mx3fb.h
index e391a76ca87d..ac24c5c4bc83 100644
--- a/arch/arm/plat-mxc/include/mach/mx3fb.h
+++ b/arch/arm/plat-mxc/include/mach/mx3fb.h
@@ -14,25 +14,25 @@
14#include <linux/fb.h> 14#include <linux/fb.h>
15 15
16/* Proprietary FB_SYNC_ flags */ 16/* Proprietary FB_SYNC_ flags */
17#define FB_SYNC_OE_ACT_HIGH 0x80000000 17#define FB_SYNC_OE_ACT_HIGH 0x80000000
18#define FB_SYNC_CLK_INVERT 0x40000000 18#define FB_SYNC_CLK_INVERT 0x40000000
19#define FB_SYNC_DATA_INVERT 0x20000000 19#define FB_SYNC_DATA_INVERT 0x20000000
20#define FB_SYNC_CLK_IDLE_EN 0x10000000 20#define FB_SYNC_CLK_IDLE_EN 0x10000000
21#define FB_SYNC_SHARP_MODE 0x08000000 21#define FB_SYNC_SHARP_MODE 0x08000000
22#define FB_SYNC_SWAP_RGB 0x04000000 22#define FB_SYNC_SWAP_RGB 0x04000000
23#define FB_SYNC_CLK_SEL_EN 0x02000000 23#define FB_SYNC_CLK_SEL_EN 0x02000000
24 24
25/** 25/**
26 * struct mx3fb_platform_data - mx3fb platform data 26 * struct mx3fb_platform_data - mx3fb platform data
27 * 27 *
28 * @dma_dev: pointer to the dma-device, used for dma-slave connection 28 * @dma_dev: pointer to the dma-device, used for dma-slave connection
29 * @mode: pointer to a platform-provided per mxc_register_fb() videomode 29 * @mode: pointer to a platform-provided per mxc_register_fb() videomode
30 */ 30 */
31struct mx3fb_platform_data { 31struct mx3fb_platform_data {
32 struct device *dma_dev; 32 struct device *dma_dev;
33 const char *name; 33 const char *name;
34 const struct fb_videomode *mode; 34 const struct fb_videomode *mode;
35 int num_modes; 35 int num_modes;
36}; 36};
37 37
38#endif 38#endif
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h
new file mode 100644
index 000000000000..3878c6085d5c
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mx3x.h
@@ -0,0 +1,290 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 */
4
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 __ASM_ARCH_MXC_MX31_H__
12#define __ASM_ARCH_MXC_MX31_H__
13
14#ifndef __ASM_ARCH_MXC_HARDWARE_H__
15#error "Do not include directly."
16#endif
17
18/*
19 * MX31 memory map:
20 *
21 * Virt Phys Size What
22 * ---------------------------------------------------------------------------
23 * FC000000 43F00000 1M AIPS 1
24 * FC100000 50000000 1M SPBA
25 * FC200000 53F00000 1M AIPS 2
26 * FC500000 60000000 128M ROMPATCH
27 * FC400000 68000000 128M AVIC
28 * 70000000 256M IPU (MAX M2)
29 * 80000000 256M CSD0 SDRAM/DDR
30 * 90000000 256M CSD1 SDRAM/DDR
31 * A0000000 128M CS0 Flash
32 * A8000000 128M CS1 Flash
33 * B0000000 32M CS2
34 * B2000000 32M CS3
35 * F4000000 B4000000 32M CS4
36 * B6000000 32M CS5
37 * FC320000 B8000000 64K NAND, SDRAM, WEIM, M3IF, EMI controllers
38 * C0000000 64M PCMCIA/CF
39 */
40
41#define CS0_BASE_ADDR 0xA0000000
42#define CS1_BASE_ADDR 0xA8000000
43#define CS2_BASE_ADDR 0xB0000000
44#define CS3_BASE_ADDR 0xB2000000
45
46#define CS4_BASE_ADDR 0xB4000000
47#define CS4_BASE_ADDR_VIRT 0xF4000000
48#define CS4_SIZE SZ_32M
49
50#define CS5_BASE_ADDR 0xB6000000
51#define PCMCIA_MEM_BASE_ADDR 0xBC000000
52
53/*
54 * L2CC
55 */
56#define L2CC_BASE_ADDR 0x30000000
57#define L2CC_SIZE SZ_1M
58
59/*
60 * AIPS 1
61 */
62#define AIPS1_BASE_ADDR 0x43F00000
63#define AIPS1_BASE_ADDR_VIRT 0xFC000000
64#define AIPS1_SIZE SZ_1M
65
66#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000)
67#define EVTMON_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000)
68#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000)
69#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000)
70#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000)
71#define ECT_CTIO_BASE_ADDR (AIPS1_BASE_ADDR + 0x00018000)
72#define I2C_BASE_ADDR (AIPS1_BASE_ADDR + 0x00080000)
73#define I2C3_BASE_ADDR (AIPS1_BASE_ADDR + 0x00084000)
74#define UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000)
75#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000)
76#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000)
77#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000)
78#define SSI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000)
79#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000)
80#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000)
81#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000)
82#define ECT_IP1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000)
83#define ECT_IP2_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000)
84
85/*
86 * SPBA global module enabled #0
87 */
88#define SPBA0_BASE_ADDR 0x50000000
89#define SPBA0_BASE_ADDR_VIRT 0xFC100000
90#define SPBA0_SIZE SZ_1M
91
92#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000)
93#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000)
94#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000)
95#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000)
96#define MSHC1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000)
97#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000)
98
99/*
100 * AIPS 2
101 */
102#define AIPS2_BASE_ADDR 0x53F00000
103#define AIPS2_BASE_ADDR_VIRT 0xFC200000
104#define AIPS2_SIZE SZ_1M
105#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000)
106#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000)
107#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000)
108#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000)
109#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000)
110#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000)
111#define RNGA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000)
112#define IPU_CTRL_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000)
113#define AUDMUX_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C4000)
114#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000)
115#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000)
116#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000)
117#define RTC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D8000)
118#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000)
119#define PWM_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000)
120#define RTIC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000EC000)
121
122/*
123 * ROMP and AVIC
124 */
125#define ROMP_BASE_ADDR 0x60000000
126#define ROMP_BASE_ADDR_VIRT 0xFC500000
127#define ROMP_SIZE SZ_1M
128
129#define AVIC_BASE_ADDR 0x68000000
130#define AVIC_BASE_ADDR_VIRT 0xFC400000
131#define AVIC_SIZE SZ_1M
132
133/*
134 * NAND, SDRAM, WEIM, M3IF, EMI controllers
135 */
136#define X_MEMC_BASE_ADDR 0xB8000000
137#define X_MEMC_BASE_ADDR_VIRT 0xFC320000
138#define X_MEMC_SIZE SZ_64K
139
140#define ESDCTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000)
141#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000)
142#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000)
143#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000)
144#define PCMCIA_CTL_BASE_ADDR EMI_CTL_BASE_ADDR
145
146/*
147 * Memory regions and CS
148 */
149#define IPU_MEM_BASE_ADDR 0x70000000
150#define CSD0_BASE_ADDR 0x80000000
151#define CSD1_BASE_ADDR 0x90000000
152
153/*!
154 * This macro defines the physical to virtual address mapping for all the
155 * peripheral modules. It is used by passing in the physical address as x
156 * and returning the virtual address. If the physical address is not mapped,
157 * it returns 0xDEADBEEF
158 */
159#define IO_ADDRESS(x) \
160 (void __force __iomem *) \
161 (((x >= AIPS1_BASE_ADDR) && (x < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x):\
162 ((x >= SPBA0_BASE_ADDR) && (x < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x):\
163 ((x >= AIPS2_BASE_ADDR) && (x < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x):\
164 ((x >= ROMP_BASE_ADDR) && (x < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x):\
165 ((x >= AVIC_BASE_ADDR) && (x < (AVIC_BASE_ADDR + AVIC_SIZE))) ? AVIC_IO_ADDRESS(x):\
166 ((x >= CS4_BASE_ADDR) && (x < (CS4_BASE_ADDR + CS4_SIZE))) ? CS4_IO_ADDRESS(x):\
167 ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x):\
168 0xDEADBEEF)
169
170/*
171 * define the address mapping macros: in physical address order
172 */
173#define L2CC_IO_ADDRESS(x) \
174 (((x) - L2CC_BASE_ADDR) + L2CC_BASE_ADDR_VIRT)
175
176#define AIPS1_IO_ADDRESS(x) \
177 (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT)
178
179#define SPBA0_IO_ADDRESS(x) \
180 (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT)
181
182#define AIPS2_IO_ADDRESS(x) \
183 (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT)
184
185#define ROMP_IO_ADDRESS(x) \
186 (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT)
187
188#define AVIC_IO_ADDRESS(x) \
189 (((x) - AVIC_BASE_ADDR) + AVIC_BASE_ADDR_VIRT)
190
191#define CS4_IO_ADDRESS(x) \
192 (((x) - CS4_BASE_ADDR) + CS4_BASE_ADDR_VIRT)
193
194#define X_MEMC_IO_ADDRESS(x) \
195 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
196
197#define PCMCIA_IO_ADDRESS(x) \
198 (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT)
199
200/*
201 * Interrupt numbers
202 */
203#define MXC_INT_I2C3 3
204#define MXC_INT_I2C2 4
205#define MXC_INT_RTIC 6
206#define MXC_INT_I2C 10
207#define MXC_INT_CSPI2 13
208#define MXC_INT_CSPI1 14
209#define MXC_INT_ATA 15
210#define MXC_INT_UART3 18
211#define MXC_INT_IIM 19
212#define MXC_INT_RNGA 22
213#define MXC_INT_EVTMON 23
214#define MXC_INT_KPP 24
215#define MXC_INT_RTC 25
216#define MXC_INT_PWM 26
217#define MXC_INT_EPIT2 27
218#define MXC_INT_EPIT1 28
219#define MXC_INT_GPT 29
220#define MXC_INT_POWER_FAIL 30
221#define MXC_INT_UART2 32
222#define MXC_INT_NANDFC 33
223#define MXC_INT_SDMA 34
224#define MXC_INT_MSHC1 39
225#define MXC_INT_IPU_ERR 41
226#define MXC_INT_IPU_SYN 42
227#define MXC_INT_UART1 45
228#define MXC_INT_ECT 48
229#define MXC_INT_SCC_SCM 49
230#define MXC_INT_SCC_SMN 50
231#define MXC_INT_GPIO2 51
232#define MXC_INT_GPIO1 52
233#define MXC_INT_WDOG 55
234#define MXC_INT_GPIO3 56
235#define MXC_INT_EXT_POWER 58
236#define MXC_INT_EXT_TEMPER 59
237#define MXC_INT_EXT_SENSOR60 60
238#define MXC_INT_EXT_SENSOR61 61
239#define MXC_INT_EXT_WDOG 62
240#define MXC_INT_EXT_TV 63
241
242#define PROD_SIGNATURE 0x1 /* For MX31 */
243
244/* silicon revisions specific to i.MX31 */
245#define CHIP_REV_1_0 0x10
246#define CHIP_REV_1_1 0x11
247#define CHIP_REV_1_2 0x12
248#define CHIP_REV_1_3 0x13
249#define CHIP_REV_2_0 0x20
250#define CHIP_REV_2_1 0x21
251#define CHIP_REV_2_2 0x22
252#define CHIP_REV_2_3 0x23
253#define CHIP_REV_3_0 0x30
254#define CHIP_REV_3_1 0x31
255#define CHIP_REV_3_2 0x32
256
257#define SYSTEM_REV_MIN CHIP_REV_1_0
258#define SYSTEM_REV_NUM 3
259
260/* gpio and gpio based interrupt handling */
261#define GPIO_DR 0x00
262#define GPIO_GDIR 0x04
263#define GPIO_PSR 0x08
264#define GPIO_ICR1 0x0C
265#define GPIO_ICR2 0x10
266#define GPIO_IMR 0x14
267#define GPIO_ISR 0x18
268#define GPIO_INT_LOW_LEV 0x0
269#define GPIO_INT_HIGH_LEV 0x1
270#define GPIO_INT_RISE_EDGE 0x2
271#define GPIO_INT_FALL_EDGE 0x3
272#define GPIO_INT_NONE 0x4
273
274/* Mandatory defines used globally */
275
276/* this CPU supports up to 96 GPIOs */
277#define ARCH_NR_GPIOS 96
278
279#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
280
281extern unsigned int system_rev;
282
283static inline int mx31_revision(void)
284{
285 return system_rev;
286}
287#endif
288
289#endif /* __ASM_ARCH_MXC_MX31_H__ */
290
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
index f6caab062131..5fa2a07f4eaf 100644
--- a/arch/arm/plat-mxc/include/mach/mxc.h
+++ b/arch/arm/plat-mxc/include/mach/mxc.h
@@ -24,13 +24,74 @@
24#error "Do not include directly." 24#error "Do not include directly."
25#endif 25#endif
26 26
27/* clean up all things that are not used */ 27#define MXC_CPU_MX1 1
28#ifndef CONFIG_ARCH_MX3 28#define MXC_CPU_MX21 21
29# define cpu_is_mx31() (0) 29#define MXC_CPU_MX27 27
30#define MXC_CPU_MX31 31
31#define MXC_CPU_MX35 35
32
33#ifndef __ASSEMBLY__
34extern unsigned int __mxc_cpu_type;
35#endif
36
37#ifdef CONFIG_ARCH_MX1
38# ifdef mxc_cpu_type
39# undef mxc_cpu_type
40# define mxc_cpu_type __mxc_cpu_type
41# else
42# define mxc_cpu_type MXC_CPU_MX1
43# endif
44# define cpu_is_mx1() (mxc_cpu_type == MXC_CPU_MX1)
45#else
46# define cpu_is_mx1() (0)
47#endif
48
49#ifdef CONFIG_MACH_MX21
50# ifdef mxc_cpu_type
51# undef mxc_cpu_type
52# define mxc_cpu_type __mxc_cpu_type
53# else
54# define mxc_cpu_type MXC_CPU_MX21
55# endif
56# define cpu_is_mx21() (mxc_cpu_type == MXC_CPU_MX21)
57#else
58# define cpu_is_mx21() (0)
30#endif 59#endif
31 60
32#ifndef CONFIG_MACH_MX27 61#ifdef CONFIG_MACH_MX27
33# define cpu_is_mx27() (0) 62# ifdef mxc_cpu_type
63# undef mxc_cpu_type
64# define mxc_cpu_type __mxc_cpu_type
65# else
66# define mxc_cpu_type MXC_CPU_MX27
67# endif
68# define cpu_is_mx27() (mxc_cpu_type == MXC_CPU_MX27)
69#else
70# define cpu_is_mx27() (0)
71#endif
72
73#ifdef CONFIG_ARCH_MX31
74# ifdef mxc_cpu_type
75# undef mxc_cpu_type
76# define mxc_cpu_type __mxc_cpu_type
77# else
78# define mxc_cpu_type MXC_CPU_MX31
79# endif
80# define cpu_is_mx31() (mxc_cpu_type == MXC_CPU_MX31)
81#else
82# define cpu_is_mx31() (0)
83#endif
84
85#ifdef CONFIG_ARCH_MX35
86# ifdef mxc_cpu_type
87# undef mxc_cpu_type
88# define mxc_cpu_type __mxc_cpu_type
89# else
90# define mxc_cpu_type MXC_CPU_MX35
91# endif
92# define cpu_is_mx35() (mxc_cpu_type == MXC_CPU_MX35)
93#else
94# define cpu_is_mx35() (0)
34#endif 95#endif
35 96
36#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2) 97#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2)
@@ -39,4 +100,7 @@
39#define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8) 100#define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8)
40#endif 101#endif
41 102
103#define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35())
104#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27())
105
42#endif /* __ASM_ARCH_MXC_H__ */ 106#endif /* __ASM_ARCH_MXC_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/system.h b/arch/arm/plat-mxc/include/mach/system.h
index bbfc37465fc5..e56241af870e 100644
--- a/arch/arm/plat-mxc/include/mach/system.h
+++ b/arch/arm/plat-mxc/include/mach/system.h
@@ -26,9 +26,6 @@ static inline void arch_idle(void)
26 cpu_do_idle(); 26 cpu_do_idle();
27} 27}
28 28
29static inline void arch_reset(char mode) 29void arch_reset(char mode, const char *cmd);
30{
31 cpu_reset(0);
32}
33 30
34#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */ 31#endif /* __ASM_ARCH_MXC_SYSTEM_H__ */
diff --git a/arch/arm/plat-mxc/iomux-mx1-mx2.c b/arch/arm/plat-mxc/iomux-mx1-mx2.c
index df6f18395686..a37163ce280b 100644
--- a/arch/arm/plat-mxc/iomux-mx1-mx2.c
+++ b/arch/arm/plat-mxc/iomux-mx1-mx2.c
@@ -32,7 +32,7 @@
32 32
33#include <mach/hardware.h> 33#include <mach/hardware.h>
34#include <asm/mach/map.h> 34#include <asm/mach/map.h>
35#include <mach/iomux-mx1-mx2.h> 35#include <mach/iomux.h>
36 36
37void mxc_gpio_mode(int gpio_mode) 37void mxc_gpio_mode(int gpio_mode)
38{ 38{
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
new file mode 100644
index 000000000000..9bffbc507cc2
--- /dev/null
+++ b/arch/arm/plat-mxc/pwm.c
@@ -0,0 +1,300 @@
1/*
2 * simple driver for PWM (Pulse Width Modulator) controller
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 * Derived from pxa PWM driver by eric miao <eric.miao@marvell.com>
9 */
10
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/platform_device.h>
14#include <linux/err.h>
15#include <linux/clk.h>
16#include <linux/io.h>
17#include <linux/pwm.h>
18
19#if defined CONFIG_ARCH_MX1 || defined CONFIG_ARCH_MX21
20#define PWM_VER_1
21
22#define PWMCR 0x00 /* PWM Control Register */
23#define PWMSR 0x04 /* PWM Sample Register */
24#define PWMPR 0x08 /* PWM Period Register */
25#define PWMCNR 0x0C /* PWM Counter Register */
26
27#define PWMCR_HCTR (1 << 18) /* Halfword FIFO Data Swapping */
28#define PWMCR_BCTR (1 << 17) /* Byte FIFO Data Swapping */
29#define PWMCR_SWR (1 << 16) /* Software Reset */
30#define PWMCR_CLKSRC_PERCLK (0 << 15) /* PERCLK Clock Source */
31#define PWMCR_CLKSRC_CLK32 (1 << 15) /* 32KHz Clock Source */
32#define PWMCR_PRESCALER(x) (((x - 1) & 0x7F) << 8) /* PRESCALER */
33#define PWMCR_IRQ (1 << 7) /* Interrupt Request */
34#define PWMCR_IRQEN (1 << 6) /* Interrupt Request Enable */
35#define PWMCR_FIFOAV (1 << 5) /* FIFO Available */
36#define PWMCR_EN (1 << 4) /* Enables/Disables the PWM */
37#define PWMCR_REPEAT(x) (((x) & 0x03) << 2) /* Sample Repeats */
38#define PWMCR_DIV(x) (((x) & 0x03) << 0) /* Clock divider 2/4/8/16 */
39
40#define MAX_DIV (128 * 16)
41#endif
42
43#if defined CONFIG_MACH_MX27 || defined CONFIG_ARCH_MX31
44#define PWM_VER_2
45
46#define PWMCR 0x00 /* PWM Control Register */
47#define PWMSR 0x04 /* PWM Status Register */
48#define PWMIR 0x08 /* PWM Interrupt Register */
49#define PWMSAR 0x0C /* PWM Sample Register */
50#define PWMPR 0x10 /* PWM Period Register */
51#define PWMCNR 0x14 /* PWM Counter Register */
52
53#define PWMCR_EN (1 << 0) /* Enables/Disables the PWM */
54#define PWMCR_REPEAT(x) (((x) & 0x03) << 1) /* Sample Repeats */
55#define PWMCR_SWR (1 << 3) /* Software Reset */
56#define PWMCR_PRESCALER(x) (((x - 1) & 0xFFF) << 4)/* PRESCALER */
57#define PWMCR_CLKSRC(x) (((x) & 0x3) << 16)
58#define PWMCR_CLKSRC_OFF (0 << 16)
59#define PWMCR_CLKSRC_IPG (1 << 16)
60#define PWMCR_CLKSRC_IPG_HIGH (2 << 16)
61#define PWMCR_CLKSRC_CLK32 (3 << 16)
62#define PWMCR_POUTC
63#define PWMCR_HCTR (1 << 20) /* Halfword FIFO Data Swapping */
64#define PWMCR_BCTR (1 << 21) /* Byte FIFO Data Swapping */
65#define PWMCR_DBGEN (1 << 22) /* Debug Mode */
66#define PWMCR_WAITEN (1 << 23) /* Wait Mode */
67#define PWMCR_DOZEN (1 << 24) /* Doze Mode */
68#define PWMCR_STOPEN (1 << 25) /* Stop Mode */
69#define PWMCR_FWM(x) (((x) & 0x3) << 26) /* FIFO Water Mark */
70
71#define MAX_DIV 4096
72#endif
73
74#define PWMS_SAMPLE(x) ((x) & 0xFFFF) /* Contains a two-sample word */
75#define PWMP_PERIOD(x) ((x) & 0xFFFF) /* Represents the PWM's period */
76#define PWMC_COUNTER(x) ((x) & 0xFFFF) /* Represents the current count value */
77
78struct pwm_device {
79 struct list_head node;
80 struct platform_device *pdev;
81
82 const char *label;
83 struct clk *clk;
84
85 int clk_enabled;
86 void __iomem *mmio_base;
87
88 unsigned int use_count;
89 unsigned int pwm_id;
90};
91
92int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
93{
94 unsigned long long c;
95 unsigned long period_cycles, duty_cycles, prescale;
96
97 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
98 return -EINVAL;
99
100 c = clk_get_rate(pwm->clk);
101 c = c * period_ns;
102 do_div(c, 1000000000);
103 period_cycles = c;
104
105 prescale = period_cycles / 0x10000 + 1;
106
107 period_cycles /= prescale;
108 c = (unsigned long long)period_cycles * duty_ns;
109 do_div(c, period_ns);
110 duty_cycles = c;
111
112#ifdef PWM_VER_2
113 writel(duty_cycles, pwm->mmio_base + PWMSAR);
114 writel(period_cycles, pwm->mmio_base + PWMPR);
115 writel(PWMCR_PRESCALER(prescale - 1) | PWMCR_CLKSRC_IPG_HIGH | PWMCR_EN,
116 pwm->mmio_base + PWMCR);
117#elif defined PWM_VER_1
118#error PWM not yet working on MX1 / MX21
119#endif
120
121 return 0;
122}
123EXPORT_SYMBOL(pwm_config);
124
125int pwm_enable(struct pwm_device *pwm)
126{
127 int rc = 0;
128
129 if (!pwm->clk_enabled) {
130 rc = clk_enable(pwm->clk);
131 if (!rc)
132 pwm->clk_enabled = 1;
133 }
134 return rc;
135}
136EXPORT_SYMBOL(pwm_enable);
137
138void pwm_disable(struct pwm_device *pwm)
139{
140 if (pwm->clk_enabled) {
141 clk_disable(pwm->clk);
142 pwm->clk_enabled = 0;
143 }
144}
145EXPORT_SYMBOL(pwm_disable);
146
147static DEFINE_MUTEX(pwm_lock);
148static LIST_HEAD(pwm_list);
149
150struct pwm_device *pwm_request(int pwm_id, const char *label)
151{
152 struct pwm_device *pwm;
153 int found = 0;
154
155 mutex_lock(&pwm_lock);
156
157 list_for_each_entry(pwm, &pwm_list, node) {
158 if (pwm->pwm_id == pwm_id) {
159 found = 1;
160 break;
161 }
162 }
163
164 if (found) {
165 if (pwm->use_count == 0) {
166 pwm->use_count++;
167 pwm->label = label;
168 } else
169 pwm = ERR_PTR(-EBUSY);
170 } else
171 pwm = ERR_PTR(-ENOENT);
172
173 mutex_unlock(&pwm_lock);
174 return pwm;
175}
176EXPORT_SYMBOL(pwm_request);
177
178void pwm_free(struct pwm_device *pwm)
179{
180 mutex_lock(&pwm_lock);
181
182 if (pwm->use_count) {
183 pwm->use_count--;
184 pwm->label = NULL;
185 } else
186 pr_warning("PWM device already freed\n");
187
188 mutex_unlock(&pwm_lock);
189}
190EXPORT_SYMBOL(pwm_free);
191
192static int __devinit mxc_pwm_probe(struct platform_device *pdev)
193{
194 struct pwm_device *pwm;
195 struct resource *r;
196 int ret = 0;
197
198 pwm = kzalloc(sizeof(struct pwm_device), GFP_KERNEL);
199 if (pwm == NULL) {
200 dev_err(&pdev->dev, "failed to allocate memory\n");
201 return -ENOMEM;
202 }
203
204 pwm->clk = clk_get(&pdev->dev, "pwm");
205
206 if (IS_ERR(pwm->clk)) {
207 ret = PTR_ERR(pwm->clk);
208 goto err_free;
209 }
210
211 pwm->clk_enabled = 0;
212
213 pwm->use_count = 0;
214 pwm->pwm_id = pdev->id;
215 pwm->pdev = pdev;
216
217 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
218 if (r == NULL) {
219 dev_err(&pdev->dev, "no memory resource defined\n");
220 ret = -ENODEV;
221 goto err_free_clk;
222 }
223
224 r = request_mem_region(r->start, r->end - r->start + 1, pdev->name);
225 if (r == NULL) {
226 dev_err(&pdev->dev, "failed to request memory resource\n");
227 ret = -EBUSY;
228 goto err_free_clk;
229 }
230
231 pwm->mmio_base = ioremap(r->start, r->end - r->start + 1);
232 if (pwm->mmio_base == NULL) {
233 dev_err(&pdev->dev, "failed to ioremap() registers\n");
234 ret = -ENODEV;
235 goto err_free_mem;
236 }
237
238 mutex_lock(&pwm_lock);
239 list_add_tail(&pwm->node, &pwm_list);
240 mutex_unlock(&pwm_lock);
241
242 platform_set_drvdata(pdev, pwm);
243 return 0;
244
245err_free_mem:
246 release_mem_region(r->start, r->end - r->start + 1);
247err_free_clk:
248 clk_put(pwm->clk);
249err_free:
250 kfree(pwm);
251 return ret;
252}
253
254static int __devexit mxc_pwm_remove(struct platform_device *pdev)
255{
256 struct pwm_device *pwm;
257 struct resource *r;
258
259 pwm = platform_get_drvdata(pdev);
260 if (pwm == NULL)
261 return -ENODEV;
262
263 mutex_lock(&pwm_lock);
264 list_del(&pwm->node);
265 mutex_unlock(&pwm_lock);
266
267 iounmap(pwm->mmio_base);
268
269 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
270 release_mem_region(r->start, r->end - r->start + 1);
271
272 clk_put(pwm->clk);
273
274 kfree(pwm);
275 return 0;
276}
277
278static struct platform_driver mxc_pwm_driver = {
279 .driver = {
280 .name = "mxc_pwm",
281 },
282 .probe = mxc_pwm_probe,
283 .remove = __devexit_p(mxc_pwm_remove),
284};
285
286static int __init mxc_pwm_init(void)
287{
288 return platform_driver_register(&mxc_pwm_driver);
289}
290arch_initcall(mxc_pwm_init);
291
292static void __exit mxc_pwm_exit(void)
293{
294 platform_driver_unregister(&mxc_pwm_driver);
295}
296module_exit(mxc_pwm_exit);
297
298MODULE_LICENSE("GPL v2");
299MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
300
diff --git a/arch/arm/mach-mx2/system.c b/arch/arm/plat-mxc/system.c
index 7b8269719d11..79c37577c916 100644
--- a/arch/arm/mach-mx2/system.c
+++ b/arch/arm/plat-mxc/system.c
@@ -3,6 +3,7 @@
3 * Copyright (C) 2000 Deep Blue Solutions Ltd 3 * Copyright (C) 2000 Deep Blue Solutions Ltd
4 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. 4 * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de 5 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
6 * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, yanok@emcraft.com
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify 8 * 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 * it under the terms of the GNU General Public License as published by
@@ -22,42 +23,45 @@
22#include <linux/kernel.h> 23#include <linux/kernel.h>
23#include <linux/clk.h> 24#include <linux/clk.h>
24#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/err.h>
27#include <linux/delay.h>
25 28
26#include <mach/hardware.h> 29#include <mach/hardware.h>
27#include <asm/proc-fns.h> 30#include <asm/proc-fns.h>
28#include <asm/system.h> 31#include <asm/system.h>
29 32
30/* 33#ifdef CONFIG_ARCH_MX1
31 * Put the CPU into idle mode. It is called by default_idle() 34#define WDOG_WCR_REG IO_ADDRESS(WDT_BASE_ADDR)
32 * in process.c file. 35#define WDOG_WCR_ENABLE (1 << 0)
33 */ 36#else
34void arch_idle(void) 37#define WDOG_WCR_REG IO_ADDRESS(WDOG_BASE_ADDR)
35{ 38#define WDOG_WCR_ENABLE (1 << 2)
36 /* 39#endif
37 * This should do all the clock switching
38 * and wait for interrupt tricks.
39 */
40 cpu_do_idle();
41}
42
43#define WDOG_WCR_REG IO_ADDRESS(WDOG_BASE_ADDR)
44#define WDOG_WCR_SRS (1 << 4)
45 40
46/* 41/*
47 * Reset the system. It is called by machine_restart(). 42 * Reset the system. It is called by machine_restart().
48 */ 43 */
49void arch_reset(char mode) 44void arch_reset(char mode, const char *cmd)
50{ 45{
51 struct clk *clk; 46 if (!cpu_is_mx1()) {
47 struct clk *clk;
52 48
53 clk = clk_get(NULL, "wdog_clk"); 49 clk = clk_get_sys("imx-wdt.0", NULL);
54 if (!clk) { 50 if (!IS_ERR(clk))
55 printk(KERN_ERR"Cannot activate the watchdog. Giving up\n"); 51 clk_enable(clk);
56 return;
57 } 52 }
58 53
59 clk_enable(clk);
60
61 /* Assert SRS signal */ 54 /* Assert SRS signal */
62 __raw_writew(__raw_readw(WDOG_WCR_REG) & ~WDOG_WCR_SRS, WDOG_WCR_REG); 55 __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG);
56
57 /* wait for reset to assert... */
58 mdelay(500);
59
60 printk(KERN_ERR "Watchdog reset failed to assert reset\n");
61
62 /* delay to allow the serial port to show the message */
63 mdelay(50);
64
65 /* we'll take a jump through zero as a poor second */
66 cpu_reset(0);
63} 67}
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 758a1293bcfa..ef1b3cd85bd3 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -34,9 +34,6 @@
34static struct clock_event_device clockevent_mxc; 34static struct clock_event_device clockevent_mxc;
35static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; 35static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
36 36
37/* clock source for the timer */
38static struct clk *timer_clk;
39
40/* clock source */ 37/* clock source */
41 38
42static cycle_t mxc_get_cycles(void) 39static cycle_t mxc_get_cycles(void)
@@ -53,13 +50,11 @@ static struct clocksource clocksource_mxc = {
53 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 50 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
54}; 51};
55 52
56static int __init mxc_clocksource_init(void) 53static int __init mxc_clocksource_init(struct clk *timer_clk)
57{ 54{
58 unsigned int clock; 55 unsigned int c = clk_get_rate(timer_clk);
59
60 clock = clk_get_rate(timer_clk);
61 56
62 clocksource_mxc.mult = clocksource_hz2mult(clock, 57 clocksource_mxc.mult = clocksource_hz2mult(c,
63 clocksource_mxc.shift); 58 clocksource_mxc.shift);
64 clocksource_register(&clocksource_mxc); 59 clocksource_register(&clocksource_mxc);
65 60
@@ -177,13 +172,11 @@ static struct clock_event_device clockevent_mxc = {
177 .rating = 200, 172 .rating = 200,
178}; 173};
179 174
180static int __init mxc_clockevent_init(void) 175static int __init mxc_clockevent_init(struct clk *timer_clk)
181{ 176{
182 unsigned int clock; 177 unsigned int c = clk_get_rate(timer_clk);
183
184 clock = clk_get_rate(timer_clk);
185 178
186 clockevent_mxc.mult = div_sc(clock, NSEC_PER_SEC, 179 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
187 clockevent_mxc.shift); 180 clockevent_mxc.shift);
188 clockevent_mxc.max_delta_ns = 181 clockevent_mxc.max_delta_ns =
189 clockevent_delta2ns(0xfffffffe, &clockevent_mxc); 182 clockevent_delta2ns(0xfffffffe, &clockevent_mxc);
@@ -197,14 +190,8 @@ static int __init mxc_clockevent_init(void)
197 return 0; 190 return 0;
198} 191}
199 192
200void __init mxc_timer_init(const char *clk_timer) 193void __init mxc_timer_init(struct clk *timer_clk)
201{ 194{
202 timer_clk = clk_get(NULL, clk_timer);
203 if (!timer_clk) {
204 printk(KERN_ERR"Cannot determine timer clock. Giving up.\n");
205 return;
206 }
207
208 clk_enable(timer_clk); 195 clk_enable(timer_clk);
209 196
210 /* 197 /*
@@ -219,10 +206,9 @@ void __init mxc_timer_init(const char *clk_timer)
219 TIMER_BASE + MXC_TCTL); 206 TIMER_BASE + MXC_TCTL);
220 207
221 /* init and register the timer to the framework */ 208 /* init and register the timer to the framework */
222 mxc_clocksource_init(); 209 mxc_clocksource_init(timer_clk);
223 mxc_clockevent_init(); 210 mxc_clockevent_init(timer_clk);
224 211
225 /* Make irqs happen */ 212 /* Make irqs happen */
226 setup_irq(TIMER_INTERRUPT, &mxc_timer_irq); 213 setup_irq(TIMER_INTERRUPT, &mxc_timer_irq);
227} 214}
228
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 46d3b0b9ce69..9dd68fafb374 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -11,14 +11,17 @@ choice
11 11
12config ARCH_OMAP1 12config ARCH_OMAP1
13 bool "TI OMAP1" 13 bool "TI OMAP1"
14 select COMMON_CLKDEV
14 15
15config ARCH_OMAP2 16config ARCH_OMAP2
16 bool "TI OMAP2" 17 bool "TI OMAP2"
17 select CPU_V6 18 select CPU_V6
19 select COMMON_CLKDEV
18 20
19config ARCH_OMAP3 21config ARCH_OMAP3
20 bool "TI OMAP3" 22 bool "TI OMAP3"
21 select CPU_V7 23 select CPU_V7
24 select COMMON_CLKDEV
22 25
23endchoice 26endchoice
24 27
@@ -104,6 +107,14 @@ config OMAP_MCBSP
104 Say Y here if you want support for the OMAP Multichannel 107 Say Y here if you want support for the OMAP Multichannel
105 Buffered Serial Port. 108 Buffered Serial Port.
106 109
110config OMAP_MBOX_FWK
111 tristate "Mailbox framework support"
112 depends on ARCH_OMAP
113 default n
114 help
115 Say Y here if you want to use OMAP Mailbox framework support for
116 DSP, IVA1.0 and IVA2 in OMAP1/2/3.
117
107choice 118choice
108 prompt "System timer" 119 prompt "System timer"
109 default OMAP_MPU_TIMER 120 default OMAP_MPU_TIMER
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index be6aab9c6834..2e0614552ac8 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -36,44 +36,6 @@ static struct clk_functions *arch_clock;
36 * Standard clock functions defined in include/linux/clk.h 36 * Standard clock functions defined in include/linux/clk.h
37 *-------------------------------------------------------------------------*/ 37 *-------------------------------------------------------------------------*/
38 38
39/*
40 * Returns a clock. Note that we first try to use device id on the bus
41 * and clock name. If this fails, we try to use clock name only.
42 */
43struct clk * clk_get(struct device *dev, const char *id)
44{
45 struct clk *p, *clk = ERR_PTR(-ENOENT);
46 int idno;
47
48 if (dev == NULL || dev->bus != &platform_bus_type)
49 idno = -1;
50 else
51 idno = to_platform_device(dev)->id;
52
53 mutex_lock(&clocks_mutex);
54
55 list_for_each_entry(p, &clocks, node) {
56 if (p->id == idno &&
57 strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
58 clk = p;
59 goto found;
60 }
61 }
62
63 list_for_each_entry(p, &clocks, node) {
64 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
65 clk = p;
66 break;
67 }
68 }
69
70found:
71 mutex_unlock(&clocks_mutex);
72
73 return clk;
74}
75EXPORT_SYMBOL(clk_get);
76
77int clk_enable(struct clk *clk) 39int clk_enable(struct clk *clk)
78{ 40{
79 unsigned long flags; 41 unsigned long flags;
@@ -114,22 +76,6 @@ out:
114} 76}
115EXPORT_SYMBOL(clk_disable); 77EXPORT_SYMBOL(clk_disable);
116 78
117int clk_get_usecount(struct clk *clk)
118{
119 unsigned long flags;
120 int ret = 0;
121
122 if (clk == NULL || IS_ERR(clk))
123 return 0;
124
125 spin_lock_irqsave(&clockfw_lock, flags);
126 ret = clk->usecount;
127 spin_unlock_irqrestore(&clockfw_lock, flags);
128
129 return ret;
130}
131EXPORT_SYMBOL(clk_get_usecount);
132
133unsigned long clk_get_rate(struct clk *clk) 79unsigned long clk_get_rate(struct clk *clk)
134{ 80{
135 unsigned long flags; 81 unsigned long flags;
@@ -146,13 +92,6 @@ unsigned long clk_get_rate(struct clk *clk)
146} 92}
147EXPORT_SYMBOL(clk_get_rate); 93EXPORT_SYMBOL(clk_get_rate);
148 94
149void clk_put(struct clk *clk)
150{
151 if (clk && !IS_ERR(clk))
152 module_put(clk->owner);
153}
154EXPORT_SYMBOL(clk_put);
155
156/*------------------------------------------------------------------------- 95/*-------------------------------------------------------------------------
157 * Optional clock functions defined in include/linux/clk.h 96 * Optional clock functions defined in include/linux/clk.h
158 *-------------------------------------------------------------------------*/ 97 *-------------------------------------------------------------------------*/
@@ -185,6 +124,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
185 spin_lock_irqsave(&clockfw_lock, flags); 124 spin_lock_irqsave(&clockfw_lock, flags);
186 if (arch_clock->clk_set_rate) 125 if (arch_clock->clk_set_rate)
187 ret = arch_clock->clk_set_rate(clk, rate); 126 ret = arch_clock->clk_set_rate(clk, rate);
127 if (ret == 0) {
128 if (clk->recalc)
129 clk->rate = clk->recalc(clk);
130 propagate_rate(clk);
131 }
188 spin_unlock_irqrestore(&clockfw_lock, flags); 132 spin_unlock_irqrestore(&clockfw_lock, flags);
189 133
190 return ret; 134 return ret;
@@ -200,8 +144,16 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
200 return ret; 144 return ret;
201 145
202 spin_lock_irqsave(&clockfw_lock, flags); 146 spin_lock_irqsave(&clockfw_lock, flags);
203 if (arch_clock->clk_set_parent) 147 if (clk->usecount == 0) {
204 ret = arch_clock->clk_set_parent(clk, parent); 148 if (arch_clock->clk_set_parent)
149 ret = arch_clock->clk_set_parent(clk, parent);
150 if (ret == 0) {
151 if (clk->recalc)
152 clk->rate = clk->recalc(clk);
153 propagate_rate(clk);
154 }
155 } else
156 ret = -EBUSY;
205 spin_unlock_irqrestore(&clockfw_lock, flags); 157 spin_unlock_irqrestore(&clockfw_lock, flags);
206 158
207 return ret; 159 return ret;
@@ -210,18 +162,7 @@ EXPORT_SYMBOL(clk_set_parent);
210 162
211struct clk *clk_get_parent(struct clk *clk) 163struct clk *clk_get_parent(struct clk *clk)
212{ 164{
213 unsigned long flags; 165 return clk->parent;
214 struct clk * ret = NULL;
215
216 if (clk == NULL || IS_ERR(clk))
217 return ret;
218
219 spin_lock_irqsave(&clockfw_lock, flags);
220 if (arch_clock->clk_get_parent)
221 ret = arch_clock->clk_get_parent(clk);
222 spin_unlock_irqrestore(&clockfw_lock, flags);
223
224 return ret;
225} 166}
226EXPORT_SYMBOL(clk_get_parent); 167EXPORT_SYMBOL(clk_get_parent);
227 168
@@ -250,14 +191,20 @@ static int __init omap_clk_setup(char *str)
250__setup("mpurate=", omap_clk_setup); 191__setup("mpurate=", omap_clk_setup);
251 192
252/* Used for clocks that always have same value as the parent clock */ 193/* Used for clocks that always have same value as the parent clock */
253void followparent_recalc(struct clk *clk) 194unsigned long followparent_recalc(struct clk *clk)
254{ 195{
255 if (clk == NULL || IS_ERR(clk)) 196 return clk->parent->rate;
256 return; 197}
257 198
258 clk->rate = clk->parent->rate; 199void clk_reparent(struct clk *child, struct clk *parent)
259 if (unlikely(clk->flags & RATE_PROPAGATES)) 200{
260 propagate_rate(clk); 201 list_del_init(&child->sibling);
202 if (parent)
203 list_add(&child->sibling, &parent->children);
204 child->parent = parent;
205
206 /* now do the debugfs renaming to reattach the child
207 to the proper parent */
261} 208}
262 209
263/* Propagate rate to children */ 210/* Propagate rate to children */
@@ -265,17 +212,15 @@ void propagate_rate(struct clk * tclk)
265{ 212{
266 struct clk *clkp; 213 struct clk *clkp;
267 214
268 if (tclk == NULL || IS_ERR(tclk)) 215 list_for_each_entry(clkp, &tclk->children, sibling) {
269 return; 216 if (clkp->recalc)
270 217 clkp->rate = clkp->recalc(clkp);
271 list_for_each_entry(clkp, &clocks, node) { 218 propagate_rate(clkp);
272 if (likely(clkp->parent != tclk))
273 continue;
274 if (likely((u32)clkp->recalc))
275 clkp->recalc(clkp);
276 } 219 }
277} 220}
278 221
222static LIST_HEAD(root_clks);
223
279/** 224/**
280 * recalculate_root_clocks - recalculate and propagate all root clocks 225 * recalculate_root_clocks - recalculate and propagate all root clocks
281 * 226 *
@@ -287,18 +232,35 @@ void recalculate_root_clocks(void)
287{ 232{
288 struct clk *clkp; 233 struct clk *clkp;
289 234
290 list_for_each_entry(clkp, &clocks, node) { 235 list_for_each_entry(clkp, &root_clks, sibling) {
291 if (unlikely(!clkp->parent) && likely((u32)clkp->recalc)) 236 if (clkp->recalc)
292 clkp->recalc(clkp); 237 clkp->rate = clkp->recalc(clkp);
238 propagate_rate(clkp);
293 } 239 }
294} 240}
295 241
242void clk_init_one(struct clk *clk)
243{
244 INIT_LIST_HEAD(&clk->children);
245}
246
296int clk_register(struct clk *clk) 247int clk_register(struct clk *clk)
297{ 248{
298 if (clk == NULL || IS_ERR(clk)) 249 if (clk == NULL || IS_ERR(clk))
299 return -EINVAL; 250 return -EINVAL;
300 251
252 /*
253 * trap out already registered clocks
254 */
255 if (clk->node.next || clk->node.prev)
256 return 0;
257
301 mutex_lock(&clocks_mutex); 258 mutex_lock(&clocks_mutex);
259 if (clk->parent)
260 list_add(&clk->sibling, &clk->parent->children);
261 else
262 list_add(&clk->sibling, &root_clks);
263
302 list_add(&clk->node, &clocks); 264 list_add(&clk->node, &clocks);
303 if (clk->init) 265 if (clk->init)
304 clk->init(clk); 266 clk->init(clk);
@@ -314,39 +276,12 @@ void clk_unregister(struct clk *clk)
314 return; 276 return;
315 277
316 mutex_lock(&clocks_mutex); 278 mutex_lock(&clocks_mutex);
279 list_del(&clk->sibling);
317 list_del(&clk->node); 280 list_del(&clk->node);
318 mutex_unlock(&clocks_mutex); 281 mutex_unlock(&clocks_mutex);
319} 282}
320EXPORT_SYMBOL(clk_unregister); 283EXPORT_SYMBOL(clk_unregister);
321 284
322void clk_deny_idle(struct clk *clk)
323{
324 unsigned long flags;
325
326 if (clk == NULL || IS_ERR(clk))
327 return;
328
329 spin_lock_irqsave(&clockfw_lock, flags);
330 if (arch_clock->clk_deny_idle)
331 arch_clock->clk_deny_idle(clk);
332 spin_unlock_irqrestore(&clockfw_lock, flags);
333}
334EXPORT_SYMBOL(clk_deny_idle);
335
336void clk_allow_idle(struct clk *clk)
337{
338 unsigned long flags;
339
340 if (clk == NULL || IS_ERR(clk))
341 return;
342
343 spin_lock_irqsave(&clockfw_lock, flags);
344 if (arch_clock->clk_allow_idle)
345 arch_clock->clk_allow_idle(clk);
346 spin_unlock_irqrestore(&clockfw_lock, flags);
347}
348EXPORT_SYMBOL(clk_allow_idle);
349
350void clk_enable_init_clocks(void) 285void clk_enable_init_clocks(void)
351{ 286{
352 struct clk *clkp; 287 struct clk *clkp;
@@ -358,6 +293,23 @@ void clk_enable_init_clocks(void)
358} 293}
359EXPORT_SYMBOL(clk_enable_init_clocks); 294EXPORT_SYMBOL(clk_enable_init_clocks);
360 295
296/*
297 * Low level helpers
298 */
299static int clkll_enable_null(struct clk *clk)
300{
301 return 0;
302}
303
304static void clkll_disable_null(struct clk *clk)
305{
306}
307
308const struct clkops clkops_null = {
309 .enable = clkll_enable_null,
310 .disable = clkll_disable_null,
311};
312
361#ifdef CONFIG_CPU_FREQ 313#ifdef CONFIG_CPU_FREQ
362void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) 314void clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
363{ 315{
@@ -383,8 +335,10 @@ static int __init clk_disable_unused(void)
383 unsigned long flags; 335 unsigned long flags;
384 336
385 list_for_each_entry(ck, &clocks, node) { 337 list_for_each_entry(ck, &clocks, node) {
386 if (ck->usecount > 0 || (ck->flags & ALWAYS_ENABLED) || 338 if (ck->ops == &clkops_null)
387 ck->enable_reg == 0) 339 continue;
340
341 if (ck->usecount > 0 || ck->enable_reg == 0)
388 continue; 342 continue;
389 343
390 spin_lock_irqsave(&clockfw_lock, flags); 344 spin_lock_irqsave(&clockfw_lock, flags);
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 6825fbb5a056..d1797147732f 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -245,7 +245,7 @@ static struct omap_globals *omap2_globals;
245static void __init __omap2_set_globals(void) 245static void __init __omap2_set_globals(void)
246{ 246{
247 omap2_set_globals_tap(omap2_globals); 247 omap2_set_globals_tap(omap2_globals);
248 omap2_set_globals_memory(omap2_globals); 248 omap2_set_globals_sdrc(omap2_globals);
249 omap2_set_globals_control(omap2_globals); 249 omap2_set_globals_control(omap2_globals);
250 omap2_set_globals_prcm(omap2_globals); 250 omap2_set_globals_prcm(omap2_globals);
251} 251}
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index b2690242a390..843e8af64066 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -23,10 +23,13 @@
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 <asm/system.h> 27#include <asm/system.h>
27 28
28#define VERY_HI_RATE 900000000 29#define VERY_HI_RATE 900000000
29 30
31static struct cpufreq_frequency_table *freq_table;
32
30#ifdef CONFIG_ARCH_OMAP1 33#ifdef CONFIG_ARCH_OMAP1
31#define MPU_CLK "mpu" 34#define MPU_CLK "mpu"
32#else 35#else
@@ -39,6 +42,9 @@ static struct clk *mpu_clk;
39 42
40int omap_verify_speed(struct cpufreq_policy *policy) 43int omap_verify_speed(struct cpufreq_policy *policy)
41{ 44{
45 if (freq_table)
46 return cpufreq_frequency_table_verify(policy, freq_table);
47
42 if (policy->cpu) 48 if (policy->cpu)
43 return -EINVAL; 49 return -EINVAL;
44 50
@@ -70,12 +76,26 @@ static int omap_target(struct cpufreq_policy *policy,
70 struct cpufreq_freqs freqs; 76 struct cpufreq_freqs freqs;
71 int ret = 0; 77 int ret = 0;
72 78
79 /* Ensure desired rate is within allowed range. Some govenors
80 * (ondemand) will just pass target_freq=0 to get the minimum. */
81 if (target_freq < policy->cpuinfo.min_freq)
82 target_freq = policy->cpuinfo.min_freq;
83 if (target_freq > policy->cpuinfo.max_freq)
84 target_freq = policy->cpuinfo.max_freq;
85
73 freqs.old = omap_getspeed(0); 86 freqs.old = omap_getspeed(0);
74 freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000; 87 freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
75 freqs.cpu = 0; 88 freqs.cpu = 0;
76 89
90 if (freqs.old == freqs.new)
91 return ret;
92
77 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 93 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
78 ret = clk_set_rate(mpu_clk, target_freq * 1000); 94#ifdef CONFIG_CPU_FREQ_DEBUG
95 printk(KERN_DEBUG "cpufreq-omap: transition: %u --> %u\n",
96 freqs.old, freqs.new);
97#endif
98 ret = clk_set_rate(mpu_clk, freqs.new * 1000);
79 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 99 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
80 100
81 return ret; 101 return ret;
@@ -83,16 +103,31 @@ static int omap_target(struct cpufreq_policy *policy,
83 103
84static int __init omap_cpu_init(struct cpufreq_policy *policy) 104static int __init omap_cpu_init(struct cpufreq_policy *policy)
85{ 105{
106 int result = 0;
107
86 mpu_clk = clk_get(NULL, MPU_CLK); 108 mpu_clk = clk_get(NULL, MPU_CLK);
87 if (IS_ERR(mpu_clk)) 109 if (IS_ERR(mpu_clk))
88 return PTR_ERR(mpu_clk); 110 return PTR_ERR(mpu_clk);
89 111
90 if (policy->cpu != 0) 112 if (policy->cpu != 0)
91 return -EINVAL; 113 return -EINVAL;
114
92 policy->cur = policy->min = policy->max = omap_getspeed(0); 115 policy->cur = policy->min = policy->max = omap_getspeed(0);
93 policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000; 116
94 policy->cpuinfo.max_freq = clk_round_rate(mpu_clk, VERY_HI_RATE) / 1000; 117 clk_init_cpufreq_table(&freq_table);
95 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 118 if (freq_table) {
119 result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
120 if (!result)
121 cpufreq_frequency_table_get_attr(freq_table,
122 policy->cpu);
123 } else {
124 policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
125 policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
126 VERY_HI_RATE) / 1000;
127 }
128
129 /* FIXME: what's the actual transition time? */
130 policy->cpuinfo.transition_latency = 10 * 1000 * 1000;
96 131
97 return 0; 132 return 0;
98} 133}
@@ -103,6 +138,11 @@ static int omap_cpu_exit(struct cpufreq_policy *policy)
103 return 0; 138 return 0;
104} 139}
105 140
141static struct freq_attr *omap_cpufreq_attr[] = {
142 &cpufreq_freq_attr_scaling_available_freqs,
143 NULL,
144};
145
106static struct cpufreq_driver omap_driver = { 146static struct cpufreq_driver omap_driver = {
107 .flags = CPUFREQ_STICKY, 147 .flags = CPUFREQ_STICKY,
108 .verify = omap_verify_speed, 148 .verify = omap_verify_speed,
@@ -111,6 +151,7 @@ static struct cpufreq_driver omap_driver = {
111 .init = omap_cpu_init, 151 .init = omap_cpu_init,
112 .exit = omap_cpu_exit, 152 .exit = omap_cpu_exit,
113 .name = "omap", 153 .name = "omap",
154 .attr = omap_cpufreq_attr,
114}; 155};
115 156
116static int __init omap_cpufreq_init(void) 157static int __init omap_cpufreq_init(void)
@@ -119,3 +160,11 @@ static int __init omap_cpufreq_init(void)
119} 160}
120 161
121arch_initcall(omap_cpufreq_init); 162arch_initcall(omap_cpufreq_init);
163
164/*
165 * if ever we want to remove this, upon cleanup call:
166 *
167 * cpufreq_unregister_driver()
168 * cpufreq_frequency_table_put_attr()
169 */
170
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 208dbb121f47..87fb7ff41794 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -228,6 +228,9 @@ int __init omap_mmc_add(const char *name, int id, unsigned long base,
228 ret = platform_device_add(pdev); 228 ret = platform_device_add(pdev);
229 if (ret) 229 if (ret)
230 goto fail; 230 goto fail;
231
232 /* return device handle to board setup code */
233 data->dev = &pdev->dev;
231 return 0; 234 return 0;
232 235
233fail: 236fail:
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 47ec77af4ccb..21cc0142b97a 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -123,6 +123,7 @@ static struct dma_link_info *dma_linked_lch;
123 123
124static int dma_lch_count; 124static int dma_lch_count;
125static int dma_chan_count; 125static int dma_chan_count;
126static int omap_dma_reserve_channels;
126 127
127static spinlock_t dma_chan_lock; 128static spinlock_t dma_chan_lock;
128static struct omap_dma_lch *dma_chan; 129static struct omap_dma_lch *dma_chan;
@@ -737,7 +738,7 @@ int omap_request_dma(int dev_id, const char *dev_name,
737 * id. 738 * id.
738 */ 739 */
739 dma_write(dev_id | (1 << 10), CCR(free_ch)); 740 dma_write(dev_id | (1 << 10), CCR(free_ch));
740 } else if (cpu_is_omap730() || cpu_is_omap15xx()) { 741 } else if (cpu_is_omap7xx() || cpu_is_omap15xx()) {
741 dma_write(dev_id, CCR(free_ch)); 742 dma_write(dev_id, CCR(free_ch));
742 } 743 }
743 744
@@ -1900,7 +1901,7 @@ static int omap2_dma_handle_ch(int ch)
1900/* STATUS register count is from 1-32 while our is 0-31 */ 1901/* STATUS register count is from 1-32 while our is 0-31 */
1901static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id) 1902static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id)
1902{ 1903{
1903 u32 val; 1904 u32 val, enable_reg;
1904 int i; 1905 int i;
1905 1906
1906 val = dma_read(IRQSTATUS_L0); 1907 val = dma_read(IRQSTATUS_L0);
@@ -1909,6 +1910,8 @@ static irqreturn_t omap2_dma_irq_handler(int irq, void *dev_id)
1909 printk(KERN_WARNING "Spurious DMA IRQ\n"); 1910 printk(KERN_WARNING "Spurious DMA IRQ\n");
1910 return IRQ_HANDLED; 1911 return IRQ_HANDLED;
1911 } 1912 }
1913 enable_reg = dma_read(IRQENABLE_L0);
1914 val &= enable_reg; /* Dispatch only relevant interrupts */
1912 for (i = 0; i < dma_lch_count && val != 0; i++) { 1915 for (i = 0; i < dma_lch_count && val != 0; i++) {
1913 if (val & 1) 1916 if (val & 1)
1914 omap2_dma_handle_ch(i); 1917 omap2_dma_handle_ch(i);
@@ -2321,6 +2324,10 @@ static int __init omap_init_dma(void)
2321 return -ENODEV; 2324 return -ENODEV;
2322 } 2325 }
2323 2326
2327 if (cpu_class_is_omap2() && omap_dma_reserve_channels
2328 && (omap_dma_reserve_channels <= dma_lch_count))
2329 dma_lch_count = omap_dma_reserve_channels;
2330
2324 dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count, 2331 dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count,
2325 GFP_KERNEL); 2332 GFP_KERNEL);
2326 if (!dma_chan) 2333 if (!dma_chan)
@@ -2339,7 +2346,7 @@ static int __init omap_init_dma(void)
2339 printk(KERN_INFO "DMA support for OMAP15xx initialized\n"); 2346 printk(KERN_INFO "DMA support for OMAP15xx initialized\n");
2340 dma_chan_count = 9; 2347 dma_chan_count = 9;
2341 enable_1510_mode = 1; 2348 enable_1510_mode = 1;
2342 } else if (cpu_is_omap16xx() || cpu_is_omap730()) { 2349 } else if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
2343 printk(KERN_INFO "OMAP DMA hardware version %d\n", 2350 printk(KERN_INFO "OMAP DMA hardware version %d\n",
2344 dma_read(HW_ID)); 2351 dma_read(HW_ID));
2345 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n", 2352 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
@@ -2371,7 +2378,7 @@ static int __init omap_init_dma(void)
2371 u8 revision = dma_read(REVISION) & 0xff; 2378 u8 revision = dma_read(REVISION) & 0xff;
2372 printk(KERN_INFO "OMAP DMA hardware revision %d.%d\n", 2379 printk(KERN_INFO "OMAP DMA hardware revision %d.%d\n",
2373 revision >> 4, revision & 0xf); 2380 revision >> 4, revision & 0xf);
2374 dma_chan_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; 2381 dma_chan_count = dma_lch_count;
2375 } else { 2382 } else {
2376 dma_chan_count = 0; 2383 dma_chan_count = 0;
2377 return 0; 2384 return 0;
@@ -2437,4 +2444,17 @@ static int __init omap_init_dma(void)
2437 2444
2438arch_initcall(omap_init_dma); 2445arch_initcall(omap_init_dma);
2439 2446
2447/*
2448 * Reserve the omap SDMA channels using cmdline bootarg
2449 * "omap_dma_reserve_ch=". The valid range is 1 to 32
2450 */
2451static int __init omap_dma_cmdline_reserve_ch(char *str)
2452{
2453 if (get_option(&str, &omap_dma_reserve_channels) != 1)
2454 omap_dma_reserve_channels = 0;
2455 return 1;
2456}
2457
2458__setup("omap_dma_reserve_ch=", omap_dma_cmdline_reserve_ch);
2459
2440 2460
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index e4f0ce04ba92..bfd47570cc91 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -33,6 +33,7 @@
33#include <linux/clk.h> 33#include <linux/clk.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/io.h> 35#include <linux/io.h>
36#include <linux/module.h>
36#include <mach/hardware.h> 37#include <mach/hardware.h>
37#include <mach/dmtimer.h> 38#include <mach/dmtimer.h>
38#include <mach/irqs.h> 39#include <mach/irqs.h>
@@ -362,6 +363,7 @@ struct omap_dm_timer *omap_dm_timer_request(void)
362 363
363 return timer; 364 return timer;
364} 365}
366EXPORT_SYMBOL_GPL(omap_dm_timer_request);
365 367
366struct omap_dm_timer *omap_dm_timer_request_specific(int id) 368struct omap_dm_timer *omap_dm_timer_request_specific(int id)
367{ 369{
@@ -385,6 +387,7 @@ struct omap_dm_timer *omap_dm_timer_request_specific(int id)
385 387
386 return timer; 388 return timer;
387} 389}
390EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific);
388 391
389void omap_dm_timer_free(struct omap_dm_timer *timer) 392void omap_dm_timer_free(struct omap_dm_timer *timer)
390{ 393{
@@ -395,6 +398,7 @@ void omap_dm_timer_free(struct omap_dm_timer *timer)
395 WARN_ON(!timer->reserved); 398 WARN_ON(!timer->reserved);
396 timer->reserved = 0; 399 timer->reserved = 0;
397} 400}
401EXPORT_SYMBOL_GPL(omap_dm_timer_free);
398 402
399void omap_dm_timer_enable(struct omap_dm_timer *timer) 403void omap_dm_timer_enable(struct omap_dm_timer *timer)
400{ 404{
@@ -406,6 +410,7 @@ void omap_dm_timer_enable(struct omap_dm_timer *timer)
406 410
407 timer->enabled = 1; 411 timer->enabled = 1;
408} 412}
413EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
409 414
410void omap_dm_timer_disable(struct omap_dm_timer *timer) 415void omap_dm_timer_disable(struct omap_dm_timer *timer)
411{ 416{
@@ -417,11 +422,13 @@ void omap_dm_timer_disable(struct omap_dm_timer *timer)
417 422
418 timer->enabled = 0; 423 timer->enabled = 0;
419} 424}
425EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
420 426
421int omap_dm_timer_get_irq(struct omap_dm_timer *timer) 427int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
422{ 428{
423 return timer->irq; 429 return timer->irq;
424} 430}
431EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
425 432
426#if defined(CONFIG_ARCH_OMAP1) 433#if defined(CONFIG_ARCH_OMAP1)
427 434
@@ -452,6 +459,7 @@ __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
452 459
453 return inputmask; 460 return inputmask;
454} 461}
462EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
455 463
456#elif defined(CONFIG_ARCH_OMAP2) || defined (CONFIG_ARCH_OMAP3) 464#elif defined(CONFIG_ARCH_OMAP2) || defined (CONFIG_ARCH_OMAP3)
457 465
@@ -459,6 +467,7 @@ struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
459{ 467{
460 return timer->fclk; 468 return timer->fclk;
461} 469}
470EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
462 471
463__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask) 472__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
464{ 473{
@@ -466,6 +475,7 @@ __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
466 475
467 return 0; 476 return 0;
468} 477}
478EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
469 479
470#endif 480#endif
471 481
@@ -473,6 +483,7 @@ void omap_dm_timer_trigger(struct omap_dm_timer *timer)
473{ 483{
474 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0); 484 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0);
475} 485}
486EXPORT_SYMBOL_GPL(omap_dm_timer_trigger);
476 487
477void omap_dm_timer_start(struct omap_dm_timer *timer) 488void omap_dm_timer_start(struct omap_dm_timer *timer)
478{ 489{
@@ -484,6 +495,7 @@ void omap_dm_timer_start(struct omap_dm_timer *timer)
484 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 495 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
485 } 496 }
486} 497}
498EXPORT_SYMBOL_GPL(omap_dm_timer_start);
487 499
488void omap_dm_timer_stop(struct omap_dm_timer *timer) 500void omap_dm_timer_stop(struct omap_dm_timer *timer)
489{ 501{
@@ -495,6 +507,7 @@ void omap_dm_timer_stop(struct omap_dm_timer *timer)
495 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 507 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
496 } 508 }
497} 509}
510EXPORT_SYMBOL_GPL(omap_dm_timer_stop);
498 511
499#ifdef CONFIG_ARCH_OMAP1 512#ifdef CONFIG_ARCH_OMAP1
500 513
@@ -507,6 +520,7 @@ void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
507 l |= source << n; 520 l |= source << n;
508 omap_writel(l, MOD_CONF_CTRL_1); 521 omap_writel(l, MOD_CONF_CTRL_1);
509} 522}
523EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
510 524
511#else 525#else
512 526
@@ -523,6 +537,7 @@ void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
523 * cause an abort. */ 537 * cause an abort. */
524 __delay(150000); 538 __delay(150000);
525} 539}
540EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
526 541
527#endif 542#endif
528 543
@@ -541,6 +556,7 @@ void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
541 556
542 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0); 557 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0);
543} 558}
559EXPORT_SYMBOL_GPL(omap_dm_timer_set_load);
544 560
545/* Optimized set_load which removes costly spin wait in timer_start */ 561/* Optimized set_load which removes costly spin wait in timer_start */
546void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, 562void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
@@ -560,6 +576,7 @@ void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
560 omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, load); 576 omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, load);
561 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 577 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
562} 578}
579EXPORT_SYMBOL_GPL(omap_dm_timer_set_load_start);
563 580
564void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, 581void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable,
565 unsigned int match) 582 unsigned int match)
@@ -574,6 +591,7 @@ void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable,
574 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 591 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
575 omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match); 592 omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match);
576} 593}
594EXPORT_SYMBOL_GPL(omap_dm_timer_set_match);
577 595
578void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, 596void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on,
579 int toggle, int trigger) 597 int toggle, int trigger)
@@ -590,6 +608,7 @@ void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on,
590 l |= trigger << 10; 608 l |= trigger << 10;
591 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 609 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
592} 610}
611EXPORT_SYMBOL_GPL(omap_dm_timer_set_pwm);
593 612
594void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler) 613void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler)
595{ 614{
@@ -603,6 +622,7 @@ void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler)
603 } 622 }
604 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 623 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
605} 624}
625EXPORT_SYMBOL_GPL(omap_dm_timer_set_prescaler);
606 626
607void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, 627void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer,
608 unsigned int value) 628 unsigned int value)
@@ -610,6 +630,7 @@ void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer,
610 omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value); 630 omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value);
611 omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG, value); 631 omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG, value);
612} 632}
633EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_enable);
613 634
614unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer) 635unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer)
615{ 636{
@@ -619,11 +640,13 @@ unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer)
619 640
620 return l; 641 return l;
621} 642}
643EXPORT_SYMBOL_GPL(omap_dm_timer_read_status);
622 644
623void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value) 645void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value)
624{ 646{
625 omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value); 647 omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value);
626} 648}
649EXPORT_SYMBOL_GPL(omap_dm_timer_write_status);
627 650
628unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer) 651unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer)
629{ 652{
@@ -633,11 +656,13 @@ unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer)
633 656
634 return l; 657 return l;
635} 658}
659EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);
636 660
637void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value) 661void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value)
638{ 662{
639 omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value); 663 omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value);
640} 664}
665EXPORT_SYMBOL_GPL(omap_dm_timer_write_counter);
641 666
642int omap_dm_timers_active(void) 667int omap_dm_timers_active(void)
643{ 668{
@@ -658,6 +683,7 @@ int omap_dm_timers_active(void)
658 } 683 }
659 return 0; 684 return 0;
660} 685}
686EXPORT_SYMBOL_GPL(omap_dm_timers_active);
661 687
662int __init omap_dm_timer_init(void) 688int __init omap_dm_timer_init(void)
663{ 689{
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index f856a90b264e..d3fa41e3d8c5 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -81,6 +81,22 @@
81#define OMAP730_GPIO_INT_STATUS 0x14 81#define OMAP730_GPIO_INT_STATUS 0x14
82 82
83/* 83/*
84 * OMAP850 specific GPIO registers
85 */
86#define OMAP850_GPIO1_BASE IO_ADDRESS(0xfffbc000)
87#define OMAP850_GPIO2_BASE IO_ADDRESS(0xfffbc800)
88#define OMAP850_GPIO3_BASE IO_ADDRESS(0xfffbd000)
89#define OMAP850_GPIO4_BASE IO_ADDRESS(0xfffbd800)
90#define OMAP850_GPIO5_BASE IO_ADDRESS(0xfffbe000)
91#define OMAP850_GPIO6_BASE IO_ADDRESS(0xfffbe800)
92#define OMAP850_GPIO_DATA_INPUT 0x00
93#define OMAP850_GPIO_DATA_OUTPUT 0x04
94#define OMAP850_GPIO_DIR_CONTROL 0x08
95#define OMAP850_GPIO_INT_CONTROL 0x0c
96#define OMAP850_GPIO_INT_MASK 0x10
97#define OMAP850_GPIO_INT_STATUS 0x14
98
99/*
84 * omap24xx specific GPIO registers 100 * omap24xx specific GPIO registers
85 */ 101 */
86#define OMAP242X_GPIO1_BASE IO_ADDRESS(0x48018000) 102#define OMAP242X_GPIO1_BASE IO_ADDRESS(0x48018000)
@@ -159,7 +175,8 @@ struct gpio_bank {
159#define METHOD_GPIO_1510 1 175#define METHOD_GPIO_1510 1
160#define METHOD_GPIO_1610 2 176#define METHOD_GPIO_1610 2
161#define METHOD_GPIO_730 3 177#define METHOD_GPIO_730 3
162#define METHOD_GPIO_24XX 4 178#define METHOD_GPIO_850 4
179#define METHOD_GPIO_24XX 5
163 180
164#ifdef CONFIG_ARCH_OMAP16XX 181#ifdef CONFIG_ARCH_OMAP16XX
165static struct gpio_bank gpio_bank_1610[5] = { 182static struct gpio_bank gpio_bank_1610[5] = {
@@ -190,6 +207,19 @@ static struct gpio_bank gpio_bank_730[7] = {
190}; 207};
191#endif 208#endif
192 209
210#ifdef CONFIG_ARCH_OMAP850
211static struct gpio_bank gpio_bank_850[7] = {
212 { OMAP_MPUIO_BASE, INT_850_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
213 { OMAP850_GPIO1_BASE, INT_850_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_850 },
214 { OMAP850_GPIO2_BASE, INT_850_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_850 },
215 { OMAP850_GPIO3_BASE, INT_850_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_850 },
216 { OMAP850_GPIO4_BASE, INT_850_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_850 },
217 { OMAP850_GPIO5_BASE, INT_850_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_850 },
218 { OMAP850_GPIO6_BASE, INT_850_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_850 },
219};
220#endif
221
222
193#ifdef CONFIG_ARCH_OMAP24XX 223#ifdef CONFIG_ARCH_OMAP24XX
194 224
195static struct gpio_bank gpio_bank_242x[4] = { 225static struct gpio_bank gpio_bank_242x[4] = {
@@ -236,7 +266,7 @@ static inline struct gpio_bank *get_gpio_bank(int gpio)
236 return &gpio_bank[0]; 266 return &gpio_bank[0];
237 return &gpio_bank[1 + (gpio >> 4)]; 267 return &gpio_bank[1 + (gpio >> 4)];
238 } 268 }
239 if (cpu_is_omap730()) { 269 if (cpu_is_omap7xx()) {
240 if (OMAP_GPIO_IS_MPUIO(gpio)) 270 if (OMAP_GPIO_IS_MPUIO(gpio))
241 return &gpio_bank[0]; 271 return &gpio_bank[0];
242 return &gpio_bank[1 + (gpio >> 5)]; 272 return &gpio_bank[1 + (gpio >> 5)];
@@ -251,7 +281,7 @@ static inline struct gpio_bank *get_gpio_bank(int gpio)
251 281
252static inline int get_gpio_index(int gpio) 282static inline int get_gpio_index(int gpio)
253{ 283{
254 if (cpu_is_omap730()) 284 if (cpu_is_omap7xx())
255 return gpio & 0x1f; 285 return gpio & 0x1f;
256 if (cpu_is_omap24xx()) 286 if (cpu_is_omap24xx())
257 return gpio & 0x1f; 287 return gpio & 0x1f;
@@ -273,7 +303,7 @@ static inline int gpio_valid(int gpio)
273 return 0; 303 return 0;
274 if ((cpu_is_omap16xx()) && gpio < 64) 304 if ((cpu_is_omap16xx()) && gpio < 64)
275 return 0; 305 return 0;
276 if (cpu_is_omap730() && gpio < 192) 306 if (cpu_is_omap7xx() && gpio < 192)
277 return 0; 307 return 0;
278 if (cpu_is_omap24xx() && gpio < 128) 308 if (cpu_is_omap24xx() && gpio < 128)
279 return 0; 309 return 0;
@@ -318,6 +348,11 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input)
318 reg += OMAP730_GPIO_DIR_CONTROL; 348 reg += OMAP730_GPIO_DIR_CONTROL;
319 break; 349 break;
320#endif 350#endif
351#ifdef CONFIG_ARCH_OMAP850
352 case METHOD_GPIO_850:
353 reg += OMAP850_GPIO_DIR_CONTROL;
354 break;
355#endif
321#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 356#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
322 case METHOD_GPIO_24XX: 357 case METHOD_GPIO_24XX:
323 reg += OMAP24XX_GPIO_OE; 358 reg += OMAP24XX_GPIO_OE;
@@ -380,6 +415,16 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable)
380 l &= ~(1 << gpio); 415 l &= ~(1 << gpio);
381 break; 416 break;
382#endif 417#endif
418#ifdef CONFIG_ARCH_OMAP850
419 case METHOD_GPIO_850:
420 reg += OMAP850_GPIO_DATA_OUTPUT;
421 l = __raw_readl(reg);
422 if (enable)
423 l |= 1 << gpio;
424 else
425 l &= ~(1 << gpio);
426 break;
427#endif
383#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 428#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
384 case METHOD_GPIO_24XX: 429 case METHOD_GPIO_24XX:
385 if (enable) 430 if (enable)
@@ -426,6 +471,11 @@ static int __omap_get_gpio_datain(int gpio)
426 reg += OMAP730_GPIO_DATA_INPUT; 471 reg += OMAP730_GPIO_DATA_INPUT;
427 break; 472 break;
428#endif 473#endif
474#ifdef CONFIG_ARCH_OMAP850
475 case METHOD_GPIO_850:
476 reg += OMAP850_GPIO_DATA_INPUT;
477 break;
478#endif
429#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 479#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
430 case METHOD_GPIO_24XX: 480 case METHOD_GPIO_24XX:
431 reg += OMAP24XX_GPIO_DATAIN; 481 reg += OMAP24XX_GPIO_DATAIN;
@@ -598,6 +648,18 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
598 goto bad; 648 goto bad;
599 break; 649 break;
600#endif 650#endif
651#ifdef CONFIG_ARCH_OMAP850
652 case METHOD_GPIO_850:
653 reg += OMAP850_GPIO_INT_CONTROL;
654 l = __raw_readl(reg);
655 if (trigger & IRQ_TYPE_EDGE_RISING)
656 l |= 1 << gpio;
657 else if (trigger & IRQ_TYPE_EDGE_FALLING)
658 l &= ~(1 << gpio);
659 else
660 goto bad;
661 break;
662#endif
601#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 663#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
602 case METHOD_GPIO_24XX: 664 case METHOD_GPIO_24XX:
603 set_24xx_gpio_triggering(bank, gpio, trigger); 665 set_24xx_gpio_triggering(bank, gpio, trigger);
@@ -678,6 +740,11 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask)
678 reg += OMAP730_GPIO_INT_STATUS; 740 reg += OMAP730_GPIO_INT_STATUS;
679 break; 741 break;
680#endif 742#endif
743#ifdef CONFIG_ARCH_OMAP850
744 case METHOD_GPIO_850:
745 reg += OMAP850_GPIO_INT_STATUS;
746 break;
747#endif
681#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 748#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
682 case METHOD_GPIO_24XX: 749 case METHOD_GPIO_24XX:
683 reg += OMAP24XX_GPIO_IRQSTATUS1; 750 reg += OMAP24XX_GPIO_IRQSTATUS1;
@@ -736,6 +803,13 @@ static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
736 inv = 1; 803 inv = 1;
737 break; 804 break;
738#endif 805#endif
806#ifdef CONFIG_ARCH_OMAP850
807 case METHOD_GPIO_850:
808 reg += OMAP850_GPIO_INT_MASK;
809 mask = 0xffffffff;
810 inv = 1;
811 break;
812#endif
739#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 813#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
740 case METHOD_GPIO_24XX: 814 case METHOD_GPIO_24XX:
741 reg += OMAP24XX_GPIO_IRQENABLE1; 815 reg += OMAP24XX_GPIO_IRQENABLE1;
@@ -799,6 +873,16 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab
799 l |= gpio_mask; 873 l |= gpio_mask;
800 break; 874 break;
801#endif 875#endif
876#ifdef CONFIG_ARCH_OMAP850
877 case METHOD_GPIO_850:
878 reg += OMAP850_GPIO_INT_MASK;
879 l = __raw_readl(reg);
880 if (enable)
881 l &= ~(gpio_mask);
882 else
883 l |= gpio_mask;
884 break;
885#endif
802#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 886#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
803 case METHOD_GPIO_24XX: 887 case METHOD_GPIO_24XX:
804 if (enable) 888 if (enable)
@@ -983,6 +1067,10 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
983 if (bank->method == METHOD_GPIO_730) 1067 if (bank->method == METHOD_GPIO_730)
984 isr_reg = bank->base + OMAP730_GPIO_INT_STATUS; 1068 isr_reg = bank->base + OMAP730_GPIO_INT_STATUS;
985#endif 1069#endif
1070#ifdef CONFIG_ARCH_OMAP850
1071 if (bank->method == METHOD_GPIO_850)
1072 isr_reg = bank->base + OMAP850_GPIO_INT_STATUS;
1073#endif
986#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) 1074#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
987 if (bank->method == METHOD_GPIO_24XX) 1075 if (bank->method == METHOD_GPIO_24XX)
988 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1; 1076 isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1;
@@ -1372,6 +1460,13 @@ static int __init _omap_gpio_init(void)
1372 gpio_bank = gpio_bank_730; 1460 gpio_bank = gpio_bank_730;
1373 } 1461 }
1374#endif 1462#endif
1463#ifdef CONFIG_ARCH_OMAP850
1464 if (cpu_is_omap850()) {
1465 printk(KERN_INFO "OMAP850 GPIO hardware\n");
1466 gpio_bank_count = 7;
1467 gpio_bank = gpio_bank_850;
1468 }
1469#endif
1375 1470
1376#ifdef CONFIG_ARCH_OMAP24XX 1471#ifdef CONFIG_ARCH_OMAP24XX
1377 if (cpu_is_omap242x()) { 1472 if (cpu_is_omap242x()) {
@@ -1420,7 +1515,7 @@ static int __init _omap_gpio_init(void)
1420 __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1); 1515 __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1);
1421 __raw_writew(0x0014, bank->base + OMAP1610_GPIO_SYSCONFIG); 1516 __raw_writew(0x0014, bank->base + OMAP1610_GPIO_SYSCONFIG);
1422 } 1517 }
1423 if (cpu_is_omap730() && bank->method == METHOD_GPIO_730) { 1518 if (cpu_is_omap7xx() && bank->method == METHOD_GPIO_730) {
1424 __raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK); 1519 __raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK);
1425 __raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS); 1520 __raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS);
1426 1521
@@ -1743,6 +1838,9 @@ static int gpio_is_input(struct gpio_bank *bank, int mask)
1743 case METHOD_GPIO_730: 1838 case METHOD_GPIO_730:
1744 reg += OMAP730_GPIO_DIR_CONTROL; 1839 reg += OMAP730_GPIO_DIR_CONTROL;
1745 break; 1840 break;
1841 case METHOD_GPIO_850:
1842 reg += OMAP850_GPIO_DIR_CONTROL;
1843 break;
1746 case METHOD_GPIO_24XX: 1844 case METHOD_GPIO_24XX:
1747 reg += OMAP24XX_GPIO_OE; 1845 reg += OMAP24XX_GPIO_OE;
1748 break; 1846 break;
@@ -1762,7 +1860,8 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
1762 1860
1763 if (bank_is_mpuio(bank)) 1861 if (bank_is_mpuio(bank))
1764 gpio = OMAP_MPUIO(0); 1862 gpio = OMAP_MPUIO(0);
1765 else if (cpu_class_is_omap2() || cpu_is_omap730()) 1863 else if (cpu_class_is_omap2() || cpu_is_omap730() ||
1864 cpu_is_omap850())
1766 bankwidth = 32; 1865 bankwidth = 32;
1767 1866
1768 for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) { 1867 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 467531edefd3..a303071d5e36 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -98,6 +98,8 @@ static const int omap34xx_pins[][2] = {
98static const int omap34xx_pins[][2] = {}; 98static const int omap34xx_pins[][2] = {};
99#endif 99#endif
100 100
101#define OMAP_I2C_CMDLINE_SETUP (BIT(31))
102
101static void __init omap_i2c_mux_pins(int bus) 103static void __init omap_i2c_mux_pins(int bus)
102{ 104{
103 int scl, sda; 105 int scl, sda;
@@ -119,14 +121,9 @@ static void __init omap_i2c_mux_pins(int bus)
119 omap_cfg_reg(scl); 121 omap_cfg_reg(scl);
120} 122}
121 123
122int __init omap_register_i2c_bus(int bus_id, u32 clkrate, 124static int __init omap_i2c_nr_ports(void)
123 struct i2c_board_info const *info,
124 unsigned len)
125{ 125{
126 int ports, err; 126 int ports = 0;
127 struct platform_device *pdev;
128 struct resource *res;
129 resource_size_t base, irq;
130 127
131 if (cpu_class_is_omap1()) 128 if (cpu_class_is_omap1())
132 ports = 1; 129 ports = 1;
@@ -135,17 +132,16 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
135 else if (cpu_is_omap34xx()) 132 else if (cpu_is_omap34xx())
136 ports = 3; 133 ports = 3;
137 134
138 BUG_ON(bus_id < 1 || bus_id > ports); 135 return ports;
136}
139 137
140 if (info) { 138static int __init omap_i2c_add_bus(int bus_id)
141 err = i2c_register_board_info(bus_id, info, len); 139{
142 if (err) 140 struct platform_device *pdev;
143 return err; 141 struct resource *res;
144 } 142 resource_size_t base, irq;
145 143
146 pdev = &omap_i2c_devices[bus_id - 1]; 144 pdev = &omap_i2c_devices[bus_id - 1];
147 *(u32 *)pdev->dev.platform_data = clkrate;
148
149 if (bus_id == 1) { 145 if (bus_id == 1) {
150 res = pdev->resource; 146 res = pdev->resource;
151 if (cpu_class_is_omap1()) { 147 if (cpu_class_is_omap1()) {
@@ -163,3 +159,81 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
163 omap_i2c_mux_pins(bus_id - 1); 159 omap_i2c_mux_pins(bus_id - 1);
164 return platform_device_register(pdev); 160 return platform_device_register(pdev);
165} 161}
162
163/**
164 * omap_i2c_bus_setup - Process command line options for the I2C bus speed
165 * @str: String of options
166 *
167 * This function allow to override the default I2C bus speed for given I2C
168 * bus with a command line option.
169 *
170 * Format: i2c_bus=bus_id,clkrate (in kHz)
171 *
172 * Returns 1 on success, 0 otherwise.
173 */
174static int __init omap_i2c_bus_setup(char *str)
175{
176 int ports;
177 int ints[3];
178
179 ports = omap_i2c_nr_ports();
180 get_options(str, 3, ints);
181 if (ints[0] < 2 || ints[1] < 1 || ints[1] > ports)
182 return 0;
183 i2c_rate[ints[1] - 1] = ints[2];
184 i2c_rate[ints[1] - 1] |= OMAP_I2C_CMDLINE_SETUP;
185
186 return 1;
187}
188__setup("i2c_bus=", omap_i2c_bus_setup);
189
190/*
191 * Register busses defined in command line but that are not registered with
192 * omap_register_i2c_bus from board initialization code.
193 */
194static int __init omap_register_i2c_bus_cmdline(void)
195{
196 int i, err = 0;
197
198 for (i = 0; i < ARRAY_SIZE(i2c_rate); i++)
199 if (i2c_rate[i] & OMAP_I2C_CMDLINE_SETUP) {
200 i2c_rate[i] &= ~OMAP_I2C_CMDLINE_SETUP;
201 err = omap_i2c_add_bus(i + 1);
202 if (err)
203 goto out;
204 }
205
206out:
207 return err;
208}
209subsys_initcall(omap_register_i2c_bus_cmdline);
210
211/**
212 * omap_register_i2c_bus - register I2C bus with device descriptors
213 * @bus_id: bus id counting from number 1
214 * @clkrate: clock rate of the bus in kHz
215 * @info: pointer into I2C device descriptor table or NULL
216 * @len: number of descriptors in the table
217 *
218 * Returns 0 on success or an error code.
219 */
220int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
221 struct i2c_board_info const *info,
222 unsigned len)
223{
224 int err;
225
226 BUG_ON(bus_id < 1 || bus_id > omap_i2c_nr_ports());
227
228 if (info) {
229 err = i2c_register_board_info(bus_id, info, len);
230 if (err)
231 return err;
232 }
233
234 if (!i2c_rate[bus_id - 1])
235 i2c_rate[bus_id - 1] = clkrate;
236 i2c_rate[bus_id - 1] &= ~OMAP_I2C_CMDLINE_SETUP;
237
238 return omap_i2c_add_bus(bus_id);
239}
diff --git a/arch/arm/plat-omap/include/mach/board-2430sdp.h b/arch/arm/plat-omap/include/mach/board-2430sdp.h
deleted file mode 100644
index 10d449ea7ed0..000000000000
--- a/arch/arm/plat-omap/include/mach/board-2430sdp.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-2430sdp.h
3 *
4 * Hardware definitions for TI OMAP2430 SDP board.
5 *
6 * Based on board-h4.h by Dirk Behme <dirk.behme@de.bosch.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 as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP_2430SDP_H
30#define __ASM_ARCH_OMAP_2430SDP_H
31
32/* Placeholder for 2430SDP specific defines */
33#define OMAP24XX_ETHR_START 0x08000300
34#define OMAP24XX_ETHR_GPIO_IRQ 149
35#define SDP2430_CS0_BASE 0x04000000
36
37/* Function prototypes */
38extern void sdp2430_flash_init(void);
39extern void sdp2430_usb_init(void);
40
41#endif /* __ASM_ARCH_OMAP_2430SDP_H */
diff --git a/arch/arm/plat-omap/include/mach/board-apollon.h b/arch/arm/plat-omap/include/mach/board-apollon.h
deleted file mode 100644
index 61bd5e8f09b1..000000000000
--- a/arch/arm/plat-omap/include/mach/board-apollon.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-apollon.h
3 *
4 * Hardware definitions for Samsung OMAP24XX Apollon board.
5 *
6 * Initial creation by Kyungmin Park <kyungmin.park@samsung.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 as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP_APOLLON_H
30#define __ASM_ARCH_OMAP_APOLLON_H
31
32#include <mach/cpu.h>
33
34extern void apollon_mmc_init(void);
35
36static inline int apollon_plus(void)
37{
38 /* The apollon plus has IDCODE revision 5 */
39 return omap_rev() & 0xc0;
40}
41
42/* Placeholder for APOLLON specific defines */
43#define APOLLON_ETHR_GPIO_IRQ 74
44
45#endif /* __ASM_ARCH_OMAP_APOLLON_H */
46
diff --git a/arch/arm/plat-omap/include/mach/board-fsample.h b/arch/arm/plat-omap/include/mach/board-fsample.h
deleted file mode 100644
index cb3c5ae12776..000000000000
--- a/arch/arm/plat-omap/include/mach/board-fsample.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-fsample.h
3 *
4 * Board-specific goodies for TI F-Sample.
5 *
6 * Copyright (C) 2006 Google, Inc.
7 * Author: Brian Swetland <swetland@google.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __ASM_ARCH_OMAP_FSAMPLE_H
15#define __ASM_ARCH_OMAP_FSAMPLE_H
16
17/* fsample is pretty close to p2-sample */
18#include <mach/board-perseus2.h>
19
20#define fsample_cpld_read(reg) __raw_readb(reg)
21#define fsample_cpld_write(val, reg) __raw_writeb(val, reg)
22
23#define FSAMPLE_CPLD_BASE 0xE8100000
24#define FSAMPLE_CPLD_SIZE SZ_4K
25#define FSAMPLE_CPLD_START 0x05080000
26
27#define FSAMPLE_CPLD_REG_A (FSAMPLE_CPLD_BASE + 0x00)
28#define FSAMPLE_CPLD_SWITCH (FSAMPLE_CPLD_BASE + 0x02)
29#define FSAMPLE_CPLD_UART (FSAMPLE_CPLD_BASE + 0x02)
30#define FSAMPLE_CPLD_REG_B (FSAMPLE_CPLD_BASE + 0x04)
31#define FSAMPLE_CPLD_VERSION (FSAMPLE_CPLD_BASE + 0x06)
32#define FSAMPLE_CPLD_SET_CLR (FSAMPLE_CPLD_BASE + 0x06)
33
34#define FSAMPLE_CPLD_BIT_BT_RESET 0
35#define FSAMPLE_CPLD_BIT_LCD_RESET 1
36#define FSAMPLE_CPLD_BIT_CAM_PWDN 2
37#define FSAMPLE_CPLD_BIT_CHARGER_ENABLE 3
38#define FSAMPLE_CPLD_BIT_SD_MMC_EN 4
39#define FSAMPLE_CPLD_BIT_aGPS_PWREN 5
40#define FSAMPLE_CPLD_BIT_BACKLIGHT 6
41#define FSAMPLE_CPLD_BIT_aGPS_EN_RESET 7
42#define FSAMPLE_CPLD_BIT_aGPS_SLEEPx_N 8
43#define FSAMPLE_CPLD_BIT_OTG_RESET 9
44
45#define fsample_cpld_set(bit) \
46 fsample_cpld_write((((bit) & 15) << 4) | 0x0f, FSAMPLE_CPLD_SET_CLR)
47
48#define fsample_cpld_clear(bit) \
49 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR)
50
51#endif
diff --git a/arch/arm/plat-omap/include/mach/board-h4.h b/arch/arm/plat-omap/include/mach/board-h4.h
deleted file mode 100644
index 7c3fa0f0a65e..000000000000
--- a/arch/arm/plat-omap/include/mach/board-h4.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-h4.h
3 *
4 * Hardware definitions for TI OMAP2420 H4 board.
5 *
6 * Initial creation by Dirk Behme <dirk.behme@de.bosch.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 as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP_H4_H
30#define __ASM_ARCH_OMAP_H4_H
31
32/* MMC Prototypes */
33extern void h4_mmc_init(void);
34
35/* Placeholder for H4 specific defines */
36#define OMAP24XX_ETHR_GPIO_IRQ 92
37#endif /* __ASM_ARCH_OMAP_H4_H */
38
diff --git a/arch/arm/plat-omap/include/mach/board-innovator.h b/arch/arm/plat-omap/include/mach/board-innovator.h
deleted file mode 100644
index 5ae3e79b9f9c..000000000000
--- a/arch/arm/plat-omap/include/mach/board-innovator.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-innovator.h
3 *
4 * Copyright (C) 2001 RidgeRun, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26#ifndef __ASM_ARCH_OMAP_INNOVATOR_H
27#define __ASM_ARCH_OMAP_INNOVATOR_H
28
29#if defined (CONFIG_ARCH_OMAP15XX)
30
31#ifndef OMAP_SDRAM_DEVICE
32#define OMAP_SDRAM_DEVICE D256M_1X16_4B
33#endif
34
35#define OMAP1510P1_IMIF_PRI_VALUE 0x00
36#define OMAP1510P1_EMIFS_PRI_VALUE 0x00
37#define OMAP1510P1_EMIFF_PRI_VALUE 0x00
38
39#ifndef __ASSEMBLY__
40void fpga_write(unsigned char val, int reg);
41unsigned char fpga_read(int reg);
42#endif
43
44#endif /* CONFIG_ARCH_OMAP15XX */
45
46#if defined (CONFIG_ARCH_OMAP16XX)
47
48/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
49#define INNOVATOR1610_ETHR_START 0x04000300
50
51#endif /* CONFIG_ARCH_OMAP1610 */
52#endif /* __ASM_ARCH_OMAP_INNOVATOR_H */
diff --git a/arch/arm/plat-omap/include/mach/board-ldp.h b/arch/arm/plat-omap/include/mach/board-ldp.h
deleted file mode 100644
index f23399665212..000000000000
--- a/arch/arm/plat-omap/include/mach/board-ldp.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-ldp.h
3 *
4 * Hardware definitions for TI OMAP3 LDP.
5 *
6 * Copyright (C) 2008 Texas Instruments Inc.
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 as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP_LDP_H
30#define __ASM_ARCH_OMAP_LDP_H
31
32extern void twl4030_bci_battery_init(void);
33
34#define TWL4030_IRQNUM INT_34XX_SYS_NIRQ
35#define LDP_SMC911X_CS 1
36#define LDP_SMC911X_GPIO 152
37#define DEBUG_BASE 0x08000000
38#define OMAP34XX_ETHR_START DEBUG_BASE
39#endif /* __ASM_ARCH_OMAP_LDP_H */
diff --git a/arch/arm/plat-omap/include/mach/board-nokia.h b/arch/arm/plat-omap/include/mach/board-nokia.h
deleted file mode 100644
index 2abbe001af8c..000000000000
--- a/arch/arm/plat-omap/include/mach/board-nokia.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-nokia.h
3 *
4 * Information structures for Nokia-specific board config data
5 *
6 * Copyright (C) 2005 Nokia Corporation
7 */
8
9#ifndef _OMAP_BOARD_NOKIA_H
10#define _OMAP_BOARD_NOKIA_H
11
12#include <linux/types.h>
13
14#define OMAP_TAG_NOKIA_BT 0x4e01
15#define OMAP_TAG_WLAN_CX3110X 0x4e02
16#define OMAP_TAG_CBUS 0x4e03
17#define OMAP_TAG_EM_ASIC_BB5 0x4e04
18
19
20#define BT_CHIP_CSR 1
21#define BT_CHIP_TI 2
22
23#define BT_SYSCLK_12 1
24#define BT_SYSCLK_38_4 2
25
26struct omap_bluetooth_config {
27 u8 chip_type;
28 u8 bt_wakeup_gpio;
29 u8 host_wakeup_gpio;
30 u8 reset_gpio;
31 u8 bt_uart;
32 u8 bd_addr[6];
33 u8 bt_sysclk;
34};
35
36struct omap_wlan_cx3110x_config {
37 u8 chip_type;
38 s16 power_gpio;
39 s16 irq_gpio;
40 s16 spi_cs_gpio;
41};
42
43struct omap_cbus_config {
44 s16 clk_gpio;
45 s16 dat_gpio;
46 s16 sel_gpio;
47};
48
49struct omap_em_asic_bb5_config {
50 s16 retu_irq_gpio;
51 s16 tahvo_irq_gpio;
52};
53
54#endif
diff --git a/arch/arm/plat-omap/include/mach/board-omap3beagle.h b/arch/arm/plat-omap/include/mach/board-omap3beagle.h
deleted file mode 100644
index 3080d52d877a..000000000000
--- a/arch/arm/plat-omap/include/mach/board-omap3beagle.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-omap3beagle.h
3 *
4 * Hardware definitions for TI OMAP3 BEAGLE.
5 *
6 * Initial creation by Syed Mohammed Khasim <khasim@ti.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 as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP3_BEAGLE_H
30#define __ASM_ARCH_OMAP3_BEAGLE_H
31
32#endif /* __ASM_ARCH_OMAP3_BEAGLE_H */
33
diff --git a/arch/arm/plat-omap/include/mach/board-osk.h b/arch/arm/plat-omap/include/mach/board-osk.h
deleted file mode 100644
index 3850cb1f220a..000000000000
--- a/arch/arm/plat-omap/include/mach/board-osk.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-osk.h
3 *
4 * Hardware definitions for TI OMAP5912 OSK board.
5 *
6 * Written by Dirk Behme <dirk.behme@de.bosch.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 as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#ifndef __ASM_ARCH_OMAP_OSK_H
30#define __ASM_ARCH_OMAP_OSK_H
31
32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
33#define OMAP_OSK_ETHR_START 0x04800300
34
35/* TPS65010 has four GPIOs. nPG and LED2 can be treated like GPIOs with
36 * alternate pin configurations for hardware-controlled blinking.
37 */
38#define OSK_TPS_GPIO_BASE (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)
39# define OSK_TPS_GPIO_USB_PWR_EN (OSK_TPS_GPIO_BASE + 0)
40# define OSK_TPS_GPIO_LED_D3 (OSK_TPS_GPIO_BASE + 1)
41# define OSK_TPS_GPIO_LAN_RESET (OSK_TPS_GPIO_BASE + 2)
42# define OSK_TPS_GPIO_DSP_PWR_EN (OSK_TPS_GPIO_BASE + 3)
43# define OSK_TPS_GPIO_LED_D9 (OSK_TPS_GPIO_BASE + 4)
44# define OSK_TPS_GPIO_LED_D2 (OSK_TPS_GPIO_BASE + 5)
45
46#endif /* __ASM_ARCH_OMAP_OSK_H */
47
diff --git a/arch/arm/plat-omap/include/mach/board-overo.h b/arch/arm/plat-omap/include/mach/board-overo.h
deleted file mode 100644
index 7ecae66966d1..000000000000
--- a/arch/arm/plat-omap/include/mach/board-overo.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * board-overo.h (Gumstix Overo)
3 *
4 * Initial code: Steve Sakoman <steve@sakoman.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * You should have received a copy of the GNU General Public License along
12 * with this program; if not, write to the Free Software Foundation, Inc.,
13 * 675 Mass Ave, Cambridge, MA 02139, USA.
14 */
15
16#ifndef __ASM_ARCH_OVERO_H
17#define __ASM_ARCH_OVERO_H
18
19#define OVERO_GPIO_BT_XGATE 15
20#define OVERO_GPIO_W2W_NRESET 16
21#define OVERO_GPIO_BT_NRESET 164
22#define OVERO_GPIO_USBH_CPEN 168
23#define OVERO_GPIO_USBH_NRESET 183
24
25#endif /* ____ASM_ARCH_OVERO_H */
26
diff --git a/arch/arm/plat-omap/include/mach/board-palmte.h b/arch/arm/plat-omap/include/mach/board-palmte.h
deleted file mode 100644
index 6906cdebbcfb..000000000000
--- a/arch/arm/plat-omap/include/mach/board-palmte.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-palmte.h
3 *
4 * Hardware definitions for the Palm Tungsten E device.
5 *
6 * Maintainters : http://palmtelinux.sf.net
7 * palmtelinux-developpers@lists.sf.net
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 __OMAP_BOARD_PALMTE_H
15#define __OMAP_BOARD_PALMTE_H
16
17#define PALMTE_USBDETECT_GPIO 0
18#define PALMTE_USB_OR_DC_GPIO 1
19#define PALMTE_TSC_GPIO 4
20#define PALMTE_PINTDAV_GPIO 6
21#define PALMTE_MMC_WP_GPIO 8
22#define PALMTE_MMC_POWER_GPIO 9
23#define PALMTE_HDQ_GPIO 11
24#define PALMTE_HEADPHONES_GPIO 14
25#define PALMTE_SPEAKER_GPIO 15
26#define PALMTE_DC_GPIO OMAP_MPUIO(2)
27#define PALMTE_MMC_SWITCH_GPIO OMAP_MPUIO(4)
28#define PALMTE_MMC1_GPIO OMAP_MPUIO(6)
29#define PALMTE_MMC2_GPIO OMAP_MPUIO(7)
30#define PALMTE_MMC3_GPIO OMAP_MPUIO(11)
31
32#endif /* __OMAP_BOARD_PALMTE_H */
diff --git a/arch/arm/plat-omap/include/mach/board-palmtt.h b/arch/arm/plat-omap/include/mach/board-palmtt.h
deleted file mode 100644
index e79f382b5931..000000000000
--- a/arch/arm/plat-omap/include/mach/board-palmtt.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-palmte.h
3 *
4 * Hardware definitions for the Palm Tungsten|T device.
5 *
6 * Maintainters : Marek Vasut <marek.vasut@gmail.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 version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __OMAP_BOARD_PALMTT_H
14#define __OMAP_BOARD_PALMTT_H
15
16#define PALMTT_USBDETECT_GPIO 0
17#define PALMTT_CABLE_GPIO 1
18#define PALMTT_LED_GPIO 3
19#define PALMTT_PENIRQ_GPIO 6
20#define PALMTT_MMC_WP_GPIO 8
21#define PALMTT_HDQ_GPIO 11
22
23#endif /* __OMAP_BOARD_PALMTT_H */
diff --git a/arch/arm/plat-omap/include/mach/board-palmz71.h b/arch/arm/plat-omap/include/mach/board-palmz71.h
deleted file mode 100644
index b1d7d579b313..000000000000
--- a/arch/arm/plat-omap/include/mach/board-palmz71.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-palmz71.h
3 *
4 * Hardware definitions for the Palm Zire71 device.
5 *
6 * Maintainters : Marek Vasut <marek.vasut@gmail.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 version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __OMAP_BOARD_PALMZ71_H
14#define __OMAP_BOARD_PALMZ71_H
15
16#define PALMZ71_USBDETECT_GPIO 0
17#define PALMZ71_PENIRQ_GPIO 6
18#define PALMZ71_MMC_WP_GPIO 8
19#define PALMZ71_HDQ_GPIO 11
20
21#define PALMZ71_HOTSYNC_GPIO OMAP_MPUIO(1)
22#define PALMZ71_CABLE_GPIO OMAP_MPUIO(2)
23#define PALMZ71_SLIDER_GPIO OMAP_MPUIO(3)
24#define PALMZ71_MMC_IN_GPIO OMAP_MPUIO(4)
25
26#endif /* __OMAP_BOARD_PALMZ71_H */
diff --git a/arch/arm/plat-omap/include/mach/board-perseus2.h b/arch/arm/plat-omap/include/mach/board-perseus2.h
deleted file mode 100644
index c06c3d717d57..000000000000
--- a/arch/arm/plat-omap/include/mach/board-perseus2.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/board-perseus2.h
3 *
4 * Copyright 2003 by Texas Instruments Incorporated
5 * OMAP730 / Perseus2 support by Jean Pihet
6 *
7 * Copyright (C) 2001 RidgeRun, Inc. (http://www.ridgerun.com)
8 * Author: RidgeRun, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
18 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
21 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */
30#ifndef __ASM_ARCH_OMAP_PERSEUS2_H
31#define __ASM_ARCH_OMAP_PERSEUS2_H
32
33#include <mach/fpga.h>
34
35#ifndef OMAP_SDRAM_DEVICE
36#define OMAP_SDRAM_DEVICE D256M_1X16_4B
37#endif
38
39#endif
diff --git a/arch/arm/plat-omap/include/mach/board-voiceblue.h b/arch/arm/plat-omap/include/mach/board-voiceblue.h
index ed6d346ee123..27916b210f57 100644
--- a/arch/arm/plat-omap/include/mach/board-voiceblue.h
+++ b/arch/arm/plat-omap/include/mach/board-voiceblue.h
@@ -14,7 +14,6 @@
14extern void voiceblue_wdt_enable(void); 14extern void voiceblue_wdt_enable(void);
15extern void voiceblue_wdt_disable(void); 15extern void voiceblue_wdt_disable(void);
16extern void voiceblue_wdt_ping(void); 16extern void voiceblue_wdt_ping(void);
17extern void voiceblue_reset(void);
18 17
19#endif /* __ASM_ARCH_VOICEBLUE_H */ 18#endif /* __ASM_ARCH_VOICEBLUE_H */
20 19
diff --git a/arch/arm/plat-omap/include/mach/board.h b/arch/arm/plat-omap/include/mach/board.h
index 9466772fc7c8..50ea79a0efa2 100644
--- a/arch/arm/plat-omap/include/mach/board.h
+++ b/arch/arm/plat-omap/include/mach/board.h
@@ -17,7 +17,6 @@
17/* Different peripheral ids */ 17/* Different peripheral ids */
18#define OMAP_TAG_CLOCK 0x4f01 18#define OMAP_TAG_CLOCK 0x4f01
19#define OMAP_TAG_SERIAL_CONSOLE 0x4f03 19#define OMAP_TAG_SERIAL_CONSOLE 0x4f03
20#define OMAP_TAG_USB 0x4f04
21#define OMAP_TAG_LCD 0x4f05 20#define OMAP_TAG_LCD 0x4f05
22#define OMAP_TAG_GPIO_SWITCH 0x4f06 21#define OMAP_TAG_GPIO_SWITCH 0x4f06
23#define OMAP_TAG_UART 0x4f07 22#define OMAP_TAG_UART 0x4f07
@@ -133,9 +132,6 @@ struct omap_version_config {
133 char version[12]; 132 char version[12];
134}; 133};
135 134
136
137#include <mach/board-nokia.h>
138
139struct omap_board_config_entry { 135struct omap_board_config_entry {
140 u16 tag; 136 u16 tag;
141 u16 len; 137 u16 len;
diff --git a/arch/arm/plat-omap/include/mach/clkdev.h b/arch/arm/plat-omap/include/mach/clkdev.h
new file mode 100644
index 000000000000..730c49d1ebd8
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/clkdev.h
@@ -0,0 +1,13 @@
1#ifndef __MACH_CLKDEV_H
2#define __MACH_CLKDEV_H
3
4static inline int __clk_get(struct clk *clk)
5{
6 return 1;
7}
8
9static inline void __clk_put(struct clk *clk)
10{
11}
12
13#endif
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/mach/clock.h
index 719298554ed7..073a2c5569f0 100644
--- a/arch/arm/plat-omap/include/mach/clock.h
+++ b/arch/arm/plat-omap/include/mach/clock.h
@@ -17,11 +17,16 @@ struct module;
17struct clk; 17struct clk;
18struct clockdomain; 18struct clockdomain;
19 19
20struct clkops {
21 int (*enable)(struct clk *);
22 void (*disable)(struct clk *);
23};
24
20#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 25#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
21 26
22struct clksel_rate { 27struct clksel_rate {
23 u8 div;
24 u32 val; 28 u32 val;
29 u8 div;
25 u8 flags; 30 u8 flags;
26}; 31};
27 32
@@ -34,24 +39,28 @@ struct dpll_data {
34 void __iomem *mult_div1_reg; 39 void __iomem *mult_div1_reg;
35 u32 mult_mask; 40 u32 mult_mask;
36 u32 div1_mask; 41 u32 div1_mask;
42 struct clk *clk_bypass;
43 struct clk *clk_ref;
44 void __iomem *control_reg;
45 u32 enable_mask;
46 unsigned int rate_tolerance;
47 unsigned long last_rounded_rate;
37 u16 last_rounded_m; 48 u16 last_rounded_m;
38 u8 last_rounded_n; 49 u8 last_rounded_n;
39 unsigned long last_rounded_rate; 50 u8 min_divider;
40 unsigned int rate_tolerance;
41 u16 max_multiplier;
42 u8 max_divider; 51 u8 max_divider;
43 u32 max_tolerance; 52 u32 max_tolerance;
53 u16 max_multiplier;
44# if defined(CONFIG_ARCH_OMAP3) 54# if defined(CONFIG_ARCH_OMAP3)
45 u8 modes; 55 u8 modes;
46 void __iomem *control_reg; 56 void __iomem *autoidle_reg;
47 u32 enable_mask; 57 void __iomem *idlest_reg;
58 u32 autoidle_mask;
59 u32 freqsel_mask;
60 u32 idlest_mask;
48 u8 auto_recal_bit; 61 u8 auto_recal_bit;
49 u8 recal_en_bit; 62 u8 recal_en_bit;
50 u8 recal_st_bit; 63 u8 recal_st_bit;
51 void __iomem *autoidle_reg;
52 u32 autoidle_mask;
53 void __iomem *idlest_reg;
54 u8 idlest_bit;
55# endif 64# endif
56}; 65};
57 66
@@ -59,21 +68,21 @@ struct dpll_data {
59 68
60struct clk { 69struct clk {
61 struct list_head node; 70 struct list_head node;
62 struct module *owner; 71 const struct clkops *ops;
63 const char *name; 72 const char *name;
64 int id; 73 int id;
65 struct clk *parent; 74 struct clk *parent;
75 struct list_head children;
76 struct list_head sibling; /* node for children */
66 unsigned long rate; 77 unsigned long rate;
67 __u32 flags; 78 __u32 flags;
68 void __iomem *enable_reg; 79 void __iomem *enable_reg;
69 __u8 enable_bit; 80 unsigned long (*recalc)(struct clk *);
70 __s8 usecount;
71 void (*recalc)(struct clk *);
72 int (*set_rate)(struct clk *, unsigned long); 81 int (*set_rate)(struct clk *, unsigned long);
73 long (*round_rate)(struct clk *, unsigned long); 82 long (*round_rate)(struct clk *, unsigned long);
74 void (*init)(struct clk *); 83 void (*init)(struct clk *);
75 int (*enable)(struct clk *); 84 __u8 enable_bit;
76 void (*disable)(struct clk *); 85 __s8 usecount;
77#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 86#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
78 u8 fixed_div; 87 u8 fixed_div;
79 void __iomem *clksel_reg; 88 void __iomem *clksel_reg;
@@ -99,7 +108,6 @@ struct clk_functions {
99 long (*clk_round_rate)(struct clk *clk, unsigned long rate); 108 long (*clk_round_rate)(struct clk *clk, unsigned long rate);
100 int (*clk_set_rate)(struct clk *clk, unsigned long rate); 109 int (*clk_set_rate)(struct clk *clk, unsigned long rate);
101 int (*clk_set_parent)(struct clk *clk, struct clk *parent); 110 int (*clk_set_parent)(struct clk *clk, struct clk *parent);
102 struct clk * (*clk_get_parent)(struct clk *clk);
103 void (*clk_allow_idle)(struct clk *clk); 111 void (*clk_allow_idle)(struct clk *clk);
104 void (*clk_deny_idle)(struct clk *clk); 112 void (*clk_deny_idle)(struct clk *clk);
105 void (*clk_disable_unused)(struct clk *clk); 113 void (*clk_disable_unused)(struct clk *clk);
@@ -110,42 +118,33 @@ struct clk_functions {
110 118
111extern unsigned int mpurate; 119extern unsigned int mpurate;
112 120
113extern int clk_init(struct clk_functions * custom_clocks); 121extern int clk_init(struct clk_functions *custom_clocks);
122extern void clk_init_one(struct clk *clk);
114extern int clk_register(struct clk *clk); 123extern int clk_register(struct clk *clk);
124extern void clk_reparent(struct clk *child, struct clk *parent);
115extern void clk_unregister(struct clk *clk); 125extern void clk_unregister(struct clk *clk);
116extern void propagate_rate(struct clk *clk); 126extern void propagate_rate(struct clk *clk);
117extern void recalculate_root_clocks(void); 127extern void recalculate_root_clocks(void);
118extern void followparent_recalc(struct clk * clk); 128extern unsigned long followparent_recalc(struct clk *clk);
119extern void clk_allow_idle(struct clk *clk);
120extern void clk_deny_idle(struct clk *clk);
121extern int clk_get_usecount(struct clk *clk);
122extern void clk_enable_init_clocks(void); 129extern void clk_enable_init_clocks(void);
130#ifdef CONFIG_CPU_FREQ
131extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
132#endif
133
134extern const struct clkops clkops_null;
123 135
124/* Clock flags */ 136/* Clock flags */
125#define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ 137/* bit 0 is free */
126#define RATE_FIXED (1 << 1) /* Fixed clock rate */ 138#define RATE_FIXED (1 << 1) /* Fixed clock rate */
127#define RATE_PROPAGATES (1 << 2) /* Program children too */ 139/* bits 2-4 are free */
128#define VIRTUAL_CLOCK (1 << 3) /* Composite clock from table */
129#define ALWAYS_ENABLED (1 << 4) /* Clock cannot be disabled */
130#define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */ 140#define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */
131#define VIRTUAL_IO_ADDRESS (1 << 6) /* Clock in virtual address */
132#define CLOCK_IDLE_CONTROL (1 << 7) 141#define CLOCK_IDLE_CONTROL (1 << 7)
133#define CLOCK_NO_IDLE_PARENT (1 << 8) 142#define CLOCK_NO_IDLE_PARENT (1 << 8)
134#define DELAYED_APP (1 << 9) /* Delay application of clock */ 143#define DELAYED_APP (1 << 9) /* Delay application of clock */
135#define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ 144#define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */
136#define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */ 145#define ENABLE_ON_INIT (1 << 11) /* Enable upon framework init */
137#define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */ 146#define INVERT_ENABLE (1 << 12) /* 0 enables, 1 disables */
138/* bits 13-20 are currently free */ 147/* bits 13-31 are currently free */
139#define CLOCK_IN_OMAP310 (1 << 21)
140#define CLOCK_IN_OMAP730 (1 << 22)
141#define CLOCK_IN_OMAP1510 (1 << 23)
142#define CLOCK_IN_OMAP16XX (1 << 24)
143#define CLOCK_IN_OMAP242X (1 << 25)
144#define CLOCK_IN_OMAP243X (1 << 26)
145#define CLOCK_IN_OMAP343X (1 << 27) /* clocks common to all 343X */
146#define PARENT_CONTROLS_CLOCK (1 << 28)
147#define CLOCK_IN_OMAP3430ES1 (1 << 29) /* 3430ES1 clocks only */
148#define CLOCK_IN_OMAP3430ES2 (1 << 30) /* 3430ES2 clocks only */
149 148
150/* Clksel_rate flags */ 149/* Clksel_rate flags */
151#define DEFAULT_RATE (1 << 0) 150#define DEFAULT_RATE (1 << 0)
@@ -157,9 +156,4 @@ extern void clk_enable_init_clocks(void);
157#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 156#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
158 157
159 158
160/* CM_CLKSEL2_PLL.CORE_CLK_SRC options (24XX) */
161#define CORE_CLK_SRC_32K 0
162#define CORE_CLK_SRC_DPLL 1
163#define CORE_CLK_SRC_DPLL_X2 2
164
165#endif 159#endif
diff --git a/arch/arm/plat-omap/include/mach/clockdomain.h b/arch/arm/plat-omap/include/mach/clockdomain.h
index 1f51f0173784..b9d0dd2da89b 100644
--- a/arch/arm/plat-omap/include/mach/clockdomain.h
+++ b/arch/arm/plat-omap/include/mach/clockdomain.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/asm-arm/arch-omap/clockdomain.h 2 * arch/arm/plat-omap/include/mach/clockdomain.h
3 * 3 *
4 * OMAP2/3 clockdomain framework functions 4 * OMAP2/3 clockdomain framework functions
5 * 5 *
@@ -48,11 +48,13 @@
48 */ 48 */
49struct clkdm_pwrdm_autodep { 49struct clkdm_pwrdm_autodep {
50 50
51 /* Name of the powerdomain to add a wkdep/sleepdep on */ 51 union {
52 const char *pwrdm_name; 52 /* Name of the powerdomain to add a wkdep/sleepdep on */
53 const char *name;
53 54
54 /* Powerdomain pointer (looked up at clkdm_init() time) */ 55 /* Powerdomain pointer (looked up at clkdm_init() time) */
55 struct powerdomain *pwrdm; 56 struct powerdomain *ptr;
57 } pwrdm;
56 58
57 /* OMAP chip types that this clockdomain dep is valid on */ 59 /* OMAP chip types that this clockdomain dep is valid on */
58 const struct omap_chip_id omap_chip; 60 const struct omap_chip_id omap_chip;
@@ -64,8 +66,13 @@ struct clockdomain {
64 /* Clockdomain name */ 66 /* Clockdomain name */
65 const char *name; 67 const char *name;
66 68
67 /* Powerdomain enclosing this clockdomain */ 69 union {
68 const char *pwrdm_name; 70 /* Powerdomain enclosing this clockdomain */
71 const char *name;
72
73 /* Powerdomain pointer assigned at clkdm_register() */
74 struct powerdomain *ptr;
75 } pwrdm;
69 76
70 /* CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg */ 77 /* CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg */
71 const u16 clktrctrl_mask; 78 const u16 clktrctrl_mask;
@@ -79,9 +86,6 @@ struct clockdomain {
79 /* Usecount tracking */ 86 /* Usecount tracking */
80 atomic_t usecount; 87 atomic_t usecount;
81 88
82 /* Powerdomain pointer assigned at clkdm_register() */
83 struct powerdomain *pwrdm;
84
85 struct list_head node; 89 struct list_head node;
86 90
87}; 91};
diff --git a/arch/arm/plat-omap/include/mach/common.h b/arch/arm/plat-omap/include/mach/common.h
index e746ec7e785e..0ecf36deb17b 100644
--- a/arch/arm/plat-omap/include/mach/common.h
+++ b/arch/arm/plat-omap/include/mach/common.h
@@ -65,7 +65,7 @@ void omap2_set_globals_343x(void);
65 65
66/* These get called from omap2_set_globals_xxxx(), do not call these */ 66/* These get called from omap2_set_globals_xxxx(), do not call these */
67void omap2_set_globals_tap(struct omap_globals *); 67void omap2_set_globals_tap(struct omap_globals *);
68void omap2_set_globals_memory(struct omap_globals *); 68void omap2_set_globals_sdrc(struct omap_globals *);
69void omap2_set_globals_control(struct omap_globals *); 69void omap2_set_globals_control(struct omap_globals *);
70void omap2_set_globals_prcm(struct omap_globals *); 70void omap2_set_globals_prcm(struct omap_globals *);
71 71
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/mach/cpu.h
index a8e1178a9468..98b144252364 100644
--- a/arch/arm/plat-omap/include/mach/cpu.h
+++ b/arch/arm/plat-omap/include/mach/cpu.h
@@ -56,6 +56,14 @@ unsigned int omap_rev(void);
56# define OMAP_NAME omap730 56# define OMAP_NAME omap730
57# endif 57# endif
58#endif 58#endif
59#ifdef CONFIG_ARCH_OMAP850
60# ifdef OMAP_NAME
61# undef MULTI_OMAP1
62# define MULTI_OMAP1
63# else
64# define OMAP_NAME omap850
65# endif
66#endif
59#ifdef CONFIG_ARCH_OMAP15XX 67#ifdef CONFIG_ARCH_OMAP15XX
60# ifdef OMAP_NAME 68# ifdef OMAP_NAME
61# undef MULTI_OMAP1 69# undef MULTI_OMAP1
@@ -105,7 +113,7 @@ unsigned int omap_rev(void);
105/* 113/*
106 * Macros to group OMAP into cpu classes. 114 * Macros to group OMAP into cpu classes.
107 * These can be used in most places. 115 * These can be used in most places.
108 * cpu_is_omap7xx(): True for OMAP730 116 * cpu_is_omap7xx(): True for OMAP730, OMAP850
109 * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310 117 * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310
110 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 118 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
111 * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430 119 * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
@@ -153,6 +161,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
153# undef cpu_is_omap7xx 161# undef cpu_is_omap7xx
154# define cpu_is_omap7xx() is_omap7xx() 162# define cpu_is_omap7xx() is_omap7xx()
155# endif 163# endif
164# if defined(CONFIG_ARCH_OMAP850)
165# undef cpu_is_omap7xx
166# define cpu_is_omap7xx() is_omap7xx()
167# endif
156# if defined(CONFIG_ARCH_OMAP15XX) 168# if defined(CONFIG_ARCH_OMAP15XX)
157# undef cpu_is_omap15xx 169# undef cpu_is_omap15xx
158# define cpu_is_omap15xx() is_omap15xx() 170# define cpu_is_omap15xx() is_omap15xx()
@@ -166,6 +178,10 @@ IS_OMAP_SUBCLASS(343x, 0x343)
166# undef cpu_is_omap7xx 178# undef cpu_is_omap7xx
167# define cpu_is_omap7xx() 1 179# define cpu_is_omap7xx() 1
168# endif 180# endif
181# if defined(CONFIG_ARCH_OMAP850)
182# undef cpu_is_omap7xx
183# define cpu_is_omap7xx() 1
184# endif
169# if defined(CONFIG_ARCH_OMAP15XX) 185# if defined(CONFIG_ARCH_OMAP15XX)
170# undef cpu_is_omap15xx 186# undef cpu_is_omap15xx
171# define cpu_is_omap15xx() 1 187# define cpu_is_omap15xx() 1
@@ -219,6 +235,7 @@ IS_OMAP_SUBCLASS(343x, 0x343)
219 * These are only rarely needed. 235 * These are only rarely needed.
220 * cpu_is_omap330(): True for OMAP330 236 * cpu_is_omap330(): True for OMAP330
221 * cpu_is_omap730(): True for OMAP730 237 * cpu_is_omap730(): True for OMAP730
238 * cpu_is_omap850(): True for OMAP850
222 * cpu_is_omap1510(): True for OMAP1510 239 * cpu_is_omap1510(): True for OMAP1510
223 * cpu_is_omap1610(): True for OMAP1610 240 * cpu_is_omap1610(): True for OMAP1610
224 * cpu_is_omap1611(): True for OMAP1611 241 * cpu_is_omap1611(): True for OMAP1611
@@ -241,6 +258,7 @@ static inline int is_omap ##type (void) \
241 258
242IS_OMAP_TYPE(310, 0x0310) 259IS_OMAP_TYPE(310, 0x0310)
243IS_OMAP_TYPE(730, 0x0730) 260IS_OMAP_TYPE(730, 0x0730)
261IS_OMAP_TYPE(850, 0x0850)
244IS_OMAP_TYPE(1510, 0x1510) 262IS_OMAP_TYPE(1510, 0x1510)
245IS_OMAP_TYPE(1610, 0x1610) 263IS_OMAP_TYPE(1610, 0x1610)
246IS_OMAP_TYPE(1611, 0x1611) 264IS_OMAP_TYPE(1611, 0x1611)
@@ -255,6 +273,7 @@ IS_OMAP_TYPE(3430, 0x3430)
255 273
256#define cpu_is_omap310() 0 274#define cpu_is_omap310() 0
257#define cpu_is_omap730() 0 275#define cpu_is_omap730() 0
276#define cpu_is_omap850() 0
258#define cpu_is_omap1510() 0 277#define cpu_is_omap1510() 0
259#define cpu_is_omap1610() 0 278#define cpu_is_omap1610() 0
260#define cpu_is_omap5912() 0 279#define cpu_is_omap5912() 0
@@ -272,12 +291,22 @@ IS_OMAP_TYPE(3430, 0x3430)
272# undef cpu_is_omap730 291# undef cpu_is_omap730
273# define cpu_is_omap730() is_omap730() 292# define cpu_is_omap730() is_omap730()
274# endif 293# endif
294# if defined(CONFIG_ARCH_OMAP850)
295# undef cpu_is_omap850
296# define cpu_is_omap850() is_omap850()
297# endif
275#else 298#else
276# if defined(CONFIG_ARCH_OMAP730) 299# if defined(CONFIG_ARCH_OMAP730)
277# undef cpu_is_omap730 300# undef cpu_is_omap730
278# define cpu_is_omap730() 1 301# define cpu_is_omap730() 1
279# endif 302# endif
280#endif 303#endif
304#else
305# if defined(CONFIG_ARCH_OMAP850)
306# undef cpu_is_omap850
307# define cpu_is_omap850() 1
308# endif
309#endif
281 310
282/* 311/*
283 * Whether we have MULTI_OMAP1 or not, we still need to distinguish 312 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
@@ -320,7 +349,7 @@ IS_OMAP_TYPE(3430, 0x3430)
320#endif 349#endif
321 350
322/* Macros to detect if we have OMAP1 or OMAP2 */ 351/* Macros to detect if we have OMAP1 or OMAP2 */
323#define cpu_class_is_omap1() (cpu_is_omap730() || cpu_is_omap15xx() || \ 352#define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \
324 cpu_is_omap16xx()) 353 cpu_is_omap16xx())
325#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx()) 354#define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx())
326 355
@@ -355,13 +384,27 @@ IS_OMAP_TYPE(3430, 0x3430)
355 * use omap_chip_is(). 384 * use omap_chip_is().
356 * 385 *
357 */ 386 */
358#define CHIP_IS_OMAP2420 (1 << 0) 387#define CHIP_IS_OMAP2420 (1 << 0)
359#define CHIP_IS_OMAP2430 (1 << 1) 388#define CHIP_IS_OMAP2430 (1 << 1)
360#define CHIP_IS_OMAP3430 (1 << 2) 389#define CHIP_IS_OMAP3430 (1 << 2)
361#define CHIP_IS_OMAP3430ES1 (1 << 3) 390#define CHIP_IS_OMAP3430ES1 (1 << 3)
362#define CHIP_IS_OMAP3430ES2 (1 << 4) 391#define CHIP_IS_OMAP3430ES2 (1 << 4)
392#define CHIP_IS_OMAP3430ES3_0 (1 << 5)
393#define CHIP_IS_OMAP3430ES3_1 (1 << 6)
394
395#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
396
397/*
398 * "GE" here represents "greater than or equal to" in terms of ES
399 * levels. So CHIP_GE_OMAP3430ES2 is intended to match all OMAP3430
400 * chips at ES2 and beyond, but not, for example, any OMAP lines after
401 * OMAP3.
402 */
403#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \
404 CHIP_IS_OMAP3430ES3_0 | \
405 CHIP_IS_OMAP3430ES3_1)
406#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1)
363 407
364#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
365 408
366int omap_chip_is(struct omap_chip_id oci); 409int omap_chip_is(struct omap_chip_id oci);
367int omap_type(void); 410int omap_type(void);
@@ -378,5 +421,3 @@ int omap_type(void);
378void omap2_check_revision(void); 421void omap2_check_revision(void);
379 422
380#endif /* defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) */ 423#endif /* defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) */
381
382#endif
diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/mach/gpio.h
index 8d9dfe314387..2b22a8799bc6 100644
--- a/arch/arm/plat-omap/include/mach/gpio.h
+++ b/arch/arm/plat-omap/include/mach/gpio.h
@@ -31,7 +31,8 @@
31 31
32#define OMAP_MPUIO_BASE 0xfffb5000 32#define OMAP_MPUIO_BASE 0xfffb5000
33 33
34#ifdef CONFIG_ARCH_OMAP730 34#if (defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850))
35
35#define OMAP_MPUIO_INPUT_LATCH 0x00 36#define OMAP_MPUIO_INPUT_LATCH 0x00
36#define OMAP_MPUIO_OUTPUT 0x02 37#define OMAP_MPUIO_OUTPUT 0x02
37#define OMAP_MPUIO_IO_CNTL 0x04 38#define OMAP_MPUIO_IO_CNTL 0x04
diff --git a/arch/arm/plat-omap/include/mach/gpmc.h b/arch/arm/plat-omap/include/mach/gpmc.h
index 45b678439bb7..921b16532ff5 100644
--- a/arch/arm/plat-omap/include/mach/gpmc.h
+++ b/arch/arm/plat-omap/include/mach/gpmc.h
@@ -103,6 +103,6 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
103extern void gpmc_cs_free(int cs); 103extern void gpmc_cs_free(int cs);
104extern int gpmc_cs_set_reserved(int cs, int reserved); 104extern int gpmc_cs_set_reserved(int cs, int reserved);
105extern int gpmc_cs_reserved(int cs); 105extern int gpmc_cs_reserved(int cs);
106extern void gpmc_init(void); 106extern void __init gpmc_init(void);
107 107
108#endif 108#endif
diff --git a/arch/arm/plat-omap/include/mach/hardware.h b/arch/arm/plat-omap/include/mach/hardware.h
index 6589ddbb63b2..3dc423ed3e80 100644
--- a/arch/arm/plat-omap/include/mach/hardware.h
+++ b/arch/arm/plat-omap/include/mach/hardware.h
@@ -286,78 +286,4 @@
286#include "omap24xx.h" 286#include "omap24xx.h"
287#include "omap34xx.h" 287#include "omap34xx.h"
288 288
289#ifndef __ASSEMBLER__
290
291/*
292 * ---------------------------------------------------------------------------
293 * Board specific defines
294 * ---------------------------------------------------------------------------
295 */
296
297#ifdef CONFIG_MACH_OMAP_INNOVATOR
298#include "board-innovator.h"
299#endif
300
301#ifdef CONFIG_MACH_OMAP_H2
302#include "board-h2.h"
303#endif
304
305#ifdef CONFIG_MACH_OMAP_PERSEUS2
306#include "board-perseus2.h"
307#endif
308
309#ifdef CONFIG_MACH_OMAP_FSAMPLE
310#include "board-fsample.h"
311#endif
312
313#ifdef CONFIG_MACH_OMAP_H3
314#include "board-h3.h"
315#endif
316
317#ifdef CONFIG_MACH_OMAP_H4
318#include "board-h4.h"
319#endif
320
321#ifdef CONFIG_MACH_OMAP_2430SDP
322#include "board-2430sdp.h"
323#endif
324
325#ifdef CONFIG_MACH_OMAP3_BEAGLE
326#include "board-omap3beagle.h"
327#endif
328
329#ifdef CONFIG_MACH_OMAP_LDP
330#include "board-ldp.h"
331#endif
332
333#ifdef CONFIG_MACH_OMAP_APOLLON
334#include "board-apollon.h"
335#endif
336
337#ifdef CONFIG_MACH_OMAP_OSK
338#include "board-osk.h"
339#endif
340
341#ifdef CONFIG_MACH_VOICEBLUE
342#include "board-voiceblue.h"
343#endif
344
345#ifdef CONFIG_MACH_OMAP_PALMTE
346#include "board-palmte.h"
347#endif
348
349#ifdef CONFIG_MACH_OMAP_PALMZ71
350#include "board-palmz71.h"
351#endif
352
353#ifdef CONFIG_MACH_OMAP_PALMTT
354#include "board-palmtt.h"
355#endif
356
357#ifdef CONFIG_MACH_SX1
358#include "board-sx1.h"
359#endif
360
361#endif /* !__ASSEMBLER__ */
362
363#endif /* __ASM_ARCH_OMAP_HARDWARE_H */ 289#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h
index d92bf7964481..0610d7e2b3d7 100644
--- a/arch/arm/plat-omap/include/mach/io.h
+++ b/arch/arm/plat-omap/include/mach/io.h
@@ -185,11 +185,13 @@
185#define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a)) 185#define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a))
186#define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a)) 186#define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a))
187 187
188struct omap_sdrc_params;
189
188extern void omap1_map_common_io(void); 190extern void omap1_map_common_io(void);
189extern void omap1_init_common_hw(void); 191extern void omap1_init_common_hw(void);
190 192
191extern void omap2_map_common_io(void); 193extern void omap2_map_common_io(void);
192extern void omap2_init_common_hw(void); 194extern void omap2_init_common_hw(struct omap_sdrc_params *sp);
193 195
194#define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) 196#define __arch_ioremap(p,s,t) omap_ioremap(p,s,t)
195#define __arch_iounmap(v) omap_iounmap(v) 197#define __arch_iounmap(v) omap_iounmap(v)
diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/mach/irqs.h
index bed5274c910a..7f57ee66f364 100644
--- a/arch/arm/plat-omap/include/mach/irqs.h
+++ b/arch/arm/plat-omap/include/mach/irqs.h
@@ -105,6 +105,29 @@
105#define INT_730_SPGIO_WR 29 105#define INT_730_SPGIO_WR 29
106 106
107/* 107/*
108 * OMAP-850 specific IRQ numbers for interrupt handler 1
109 */
110#define INT_850_IH2_FIQ 0
111#define INT_850_IH2_IRQ 1
112#define INT_850_USB_NON_ISO 2
113#define INT_850_USB_ISO 3
114#define INT_850_ICR 4
115#define INT_850_EAC 5
116#define INT_850_GPIO_BANK1 6
117#define INT_850_GPIO_BANK2 7
118#define INT_850_GPIO_BANK3 8
119#define INT_850_McBSP2TX 10
120#define INT_850_McBSP2RX 11
121#define INT_850_McBSP2RX_OVF 12
122#define INT_850_LCD_LINE 14
123#define INT_850_GSM_PROTECT 15
124#define INT_850_TIMER3 16
125#define INT_850_GPIO_BANK5 17
126#define INT_850_GPIO_BANK6 18
127#define INT_850_SPGIO_WR 29
128
129
130/*
108 * IRQ numbers for interrupt handler 2 131 * IRQ numbers for interrupt handler 2
109 * 132 *
110 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below 133 * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below
@@ -237,6 +260,64 @@
237#define INT_730_DMA_CH15 (62 + IH2_BASE) 260#define INT_730_DMA_CH15 (62 + IH2_BASE)
238#define INT_730_NAND (63 + IH2_BASE) 261#define INT_730_NAND (63 + IH2_BASE)
239 262
263/*
264 * OMAP-850 specific IRQ numbers for interrupt handler 2
265 */
266#define INT_850_HW_ERRORS (0 + IH2_BASE)
267#define INT_850_NFIQ_PWR_FAIL (1 + IH2_BASE)
268#define INT_850_CFCD (2 + IH2_BASE)
269#define INT_850_CFIREQ (3 + IH2_BASE)
270#define INT_850_I2C (4 + IH2_BASE)
271#define INT_850_PCC (5 + IH2_BASE)
272#define INT_850_MPU_EXT_NIRQ (6 + IH2_BASE)
273#define INT_850_SPI_100K_1 (7 + IH2_BASE)
274#define INT_850_SYREN_SPI (8 + IH2_BASE)
275#define INT_850_VLYNQ (9 + IH2_BASE)
276#define INT_850_GPIO_BANK4 (10 + IH2_BASE)
277#define INT_850_McBSP1TX (11 + IH2_BASE)
278#define INT_850_McBSP1RX (12 + IH2_BASE)
279#define INT_850_McBSP1RX_OF (13 + IH2_BASE)
280#define INT_850_UART_MODEM_IRDA_2 (14 + IH2_BASE)
281#define INT_850_UART_MODEM_1 (15 + IH2_BASE)
282#define INT_850_MCSI (16 + IH2_BASE)
283#define INT_850_uWireTX (17 + IH2_BASE)
284#define INT_850_uWireRX (18 + IH2_BASE)
285#define INT_850_SMC_CD (19 + IH2_BASE)
286#define INT_850_SMC_IREQ (20 + IH2_BASE)
287#define INT_850_HDQ_1WIRE (21 + IH2_BASE)
288#define INT_850_TIMER32K (22 + IH2_BASE)
289#define INT_850_MMC_SDIO (23 + IH2_BASE)
290#define INT_850_UPLD (24 + IH2_BASE)
291#define INT_850_USB_HHC_1 (27 + IH2_BASE)
292#define INT_850_USB_HHC_2 (28 + IH2_BASE)
293#define INT_850_USB_GENI (29 + IH2_BASE)
294#define INT_850_USB_OTG (30 + IH2_BASE)
295#define INT_850_CAMERA_IF (31 + IH2_BASE)
296#define INT_850_RNG (32 + IH2_BASE)
297#define INT_850_DUAL_MODE_TIMER (33 + IH2_BASE)
298#define INT_850_DBB_RF_EN (34 + IH2_BASE)
299#define INT_850_MPUIO_KEYPAD (35 + IH2_BASE)
300#define INT_850_SHA1_MD5 (36 + IH2_BASE)
301#define INT_850_SPI_100K_2 (37 + IH2_BASE)
302#define INT_850_RNG_IDLE (38 + IH2_BASE)
303#define INT_850_MPUIO (39 + IH2_BASE)
304#define INT_850_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
305#define INT_850_LLPC_OE_FALLING (41 + IH2_BASE)
306#define INT_850_LLPC_OE_RISING (42 + IH2_BASE)
307#define INT_850_LLPC_VSYNC (43 + IH2_BASE)
308#define INT_850_WAKE_UP_REQ (46 + IH2_BASE)
309#define INT_850_DMA_CH6 (53 + IH2_BASE)
310#define INT_850_DMA_CH7 (54 + IH2_BASE)
311#define INT_850_DMA_CH8 (55 + IH2_BASE)
312#define INT_850_DMA_CH9 (56 + IH2_BASE)
313#define INT_850_DMA_CH10 (57 + IH2_BASE)
314#define INT_850_DMA_CH11 (58 + IH2_BASE)
315#define INT_850_DMA_CH12 (59 + IH2_BASE)
316#define INT_850_DMA_CH13 (60 + IH2_BASE)
317#define INT_850_DMA_CH14 (61 + IH2_BASE)
318#define INT_850_DMA_CH15 (62 + IH2_BASE)
319#define INT_850_NAND (63 + IH2_BASE)
320
240#define INT_24XX_SYS_NIRQ 7 321#define INT_24XX_SYS_NIRQ 7
241#define INT_24XX_SDMA_IRQ0 12 322#define INT_24XX_SDMA_IRQ0 12
242#define INT_24XX_SDMA_IRQ1 13 323#define INT_24XX_SDMA_IRQ1 13
@@ -341,7 +422,7 @@
341 422
342#define INT_34XX_BENCH_MPU_EMUL 3 423#define INT_34XX_BENCH_MPU_EMUL 3
343 424
344/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and 425/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730/850) and
345 * 16 MPUIO lines */ 426 * 16 MPUIO lines */
346#define OMAP_MAX_GPIO_LINES 192 427#define OMAP_MAX_GPIO_LINES 192
347#define IH_GPIO_BASE (128 + IH2_BASE) 428#define IH_GPIO_BASE (128 + IH2_BASE)
diff --git a/arch/arm/plat-omap/include/mach/mailbox.h b/arch/arm/plat-omap/include/mach/mailbox.h
index 7cbed9332e16..b7a6991814ec 100644
--- a/arch/arm/plat-omap/include/mach/mailbox.h
+++ b/arch/arm/plat-omap/include/mach/mailbox.h
@@ -33,6 +33,9 @@ struct omap_mbox_ops {
33 void (*disable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); 33 void (*disable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
34 void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); 34 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); 35 int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq);
36 /* ctx */
37 void (*save_ctx)(struct omap_mbox *mbox);
38 void (*restore_ctx)(struct omap_mbox *mbox);
36}; 39};
37 40
38struct omap_mbox_queue { 41struct omap_mbox_queue {
@@ -53,7 +56,7 @@ struct omap_mbox {
53 56
54 mbox_msg_t seq_snd, seq_rcv; 57 mbox_msg_t seq_snd, seq_rcv;
55 58
56 struct device dev; 59 struct device *dev;
57 60
58 struct omap_mbox *next; 61 struct omap_mbox *next;
59 void *priv; 62 void *priv;
@@ -67,7 +70,27 @@ void omap_mbox_init_seq(struct omap_mbox *);
67struct omap_mbox *omap_mbox_get(const char *); 70struct omap_mbox *omap_mbox_get(const char *);
68void omap_mbox_put(struct omap_mbox *); 71void omap_mbox_put(struct omap_mbox *);
69 72
70int omap_mbox_register(struct omap_mbox *); 73int omap_mbox_register(struct device *parent, struct omap_mbox *);
71int omap_mbox_unregister(struct omap_mbox *); 74int omap_mbox_unregister(struct omap_mbox *);
72 75
76static inline void omap_mbox_save_ctx(struct omap_mbox *mbox)
77{
78 if (!mbox->ops->save_ctx) {
79 dev_err(mbox->dev, "%s:\tno save\n", __func__);
80 return;
81 }
82
83 mbox->ops->save_ctx(mbox);
84}
85
86static inline void omap_mbox_restore_ctx(struct omap_mbox *mbox)
87{
88 if (!mbox->ops->restore_ctx) {
89 dev_err(mbox->dev, "%s:\tno restore\n", __func__);
90 return;
91 }
92
93 mbox->ops->restore_ctx(mbox);
94}
95
73#endif /* MAILBOX_H */ 96#endif /* MAILBOX_H */
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h
index 113c2466c86a..bb154ea76769 100644
--- a/arch/arm/plat-omap/include/mach/mcbsp.h
+++ b/arch/arm/plat-omap/include/mach/mcbsp.h
@@ -344,8 +344,6 @@ struct omap_mcbsp_platform_data {
344 u8 dma_rx_sync, dma_tx_sync; 344 u8 dma_rx_sync, dma_tx_sync;
345 u16 rx_irq, tx_irq; 345 u16 rx_irq, tx_irq;
346 struct omap_mcbsp_ops *ops; 346 struct omap_mcbsp_ops *ops;
347 char const **clk_names;
348 int num_clks;
349}; 347};
350 348
351struct omap_mcbsp { 349struct omap_mcbsp {
@@ -377,8 +375,8 @@ struct omap_mcbsp {
377 /* Protect the field .free, while checking if the mcbsp is in use */ 375 /* Protect the field .free, while checking if the mcbsp is in use */
378 spinlock_t lock; 376 spinlock_t lock;
379 struct omap_mcbsp_platform_data *pdata; 377 struct omap_mcbsp_platform_data *pdata;
380 struct clk **clks; 378 struct clk *iclk;
381 int num_clks; 379 struct clk *fclk;
382}; 380};
383extern struct omap_mcbsp **mcbsp_ptr; 381extern struct omap_mcbsp **mcbsp_ptr;
384extern int omap_mcbsp_count; 382extern int omap_mcbsp_count;
diff --git a/arch/arm/plat-omap/include/mach/memory.h b/arch/arm/plat-omap/include/mach/memory.h
index d6b5ca6c7da2..99ed564d9277 100644
--- a/arch/arm/plat-omap/include/mach/memory.h
+++ b/arch/arm/plat-omap/include/mach/memory.h
@@ -61,9 +61,11 @@
61#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) 61#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
62#define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0)) 62#define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
63 63
64#define __arch_page_to_dma(dev, page) ({is_lbus_device(dev) ? \ 64#define __arch_page_to_dma(dev, page) \
65 (dma_addr_t)virt_to_lbus(page_address(page)) : \ 65 ({ dma_addr_t __dma = page_to_phys(page); \
66 (dma_addr_t)__virt_to_phys(page_address(page));}) 66 if (is_lbus_device(dev)) \
67 __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
68 __dma; })
67 69
68#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \ 70#define __arch_dma_to_virt(dev, addr) ({ (void *) (is_lbus_device(dev) ? \
69 lbus_to_virt(addr) : \ 71 lbus_to_virt(addr) : \
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/mach/mmc.h
index 73a9e15031b1..4435bd434e17 100644
--- a/arch/arm/plat-omap/include/mach/mmc.h
+++ b/arch/arm/plat-omap/include/mach/mmc.h
@@ -37,6 +37,8 @@
37#define OMAP_MMC_MAX_SLOTS 2 37#define OMAP_MMC_MAX_SLOTS 2
38 38
39struct omap_mmc_platform_data { 39struct omap_mmc_platform_data {
40 /* back-link to device */
41 struct device *dev;
40 42
41 /* number of slots per controller */ 43 /* number of slots per controller */
42 unsigned nr_slots:2; 44 unsigned nr_slots:2;
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h
index f4362b8682c7..85a621705766 100644
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -61,6 +61,16 @@
61 .pull_bit = bit, \ 61 .pull_bit = bit, \
62 .pull_val = status, 62 .pull_val = status,
63 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, \
72 .pull_val = status,
73
64#else 74#else
65 75
66#define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \ 76#define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \
@@ -83,6 +93,15 @@
83 .pull_bit = bit, \ 93 .pull_bit = bit, \
84 .pull_val = status, 94 .pull_val = status,
85 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, \
103 .pull_val = status,
104
86#endif /* CONFIG_OMAP_MUX_DEBUG */ 105#endif /* CONFIG_OMAP_MUX_DEBUG */
87 106
88#define MUX_CFG(desc, mux_reg, mode_offset, mode, \ 107#define MUX_CFG(desc, mux_reg, mode_offset, mode, \
@@ -98,7 +117,7 @@
98 117
99 118
100/* 119/*
101 * OMAP730 has a slightly different config for the pin mux. 120 * OMAP730/850 has a slightly different config for the pin mux.
102 * - config regs are the OMAP730_IO_CONF_x regs (see omap730.h) regs and 121 * - config regs are the OMAP730_IO_CONF_x regs (see omap730.h) regs and
103 * not the FUNC_MUX_CTRL_x regs from hardware.h 122 * not the FUNC_MUX_CTRL_x regs from hardware.h
104 * - for pull-up/down, only has one enable bit which is is in the same register 123 * - for pull-up/down, only has one enable bit which is is in the same register
@@ -114,6 +133,17 @@
114 PU_PD_REG(NA, 0) \ 133 PU_PD_REG(NA, 0) \
115}, 134},
116 135
136#define MUX_CFG_850(desc, mux_reg, mode_offset, mode, \
137 pull_bit, pull_status, debug_status)\
138{ \
139 .name = desc, \
140 .debug = debug_status, \
141 MUX_REG_850(mux_reg, mode_offset, mode) \
142 PULL_REG_850(mux_reg, pull_bit, pull_status) \
143 PU_PD_REG(NA, 0) \
144},
145
146
117#define MUX_CFG_24XX(desc, reg_offset, mode, \ 147#define MUX_CFG_24XX(desc, reg_offset, mode, \
118 pull_en, pull_mode, dbg) \ 148 pull_en, pull_mode, dbg) \
119{ \ 149{ \
@@ -221,6 +251,26 @@ enum omap730_index {
221 W17_730_USB_VBUSI, 251 W17_730_USB_VBUSI,
222}; 252};
223 253
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
224enum omap1xxx_index { 274enum omap1xxx_index {
225 /* UART1 (BT_UART_GATING)*/ 275 /* UART1 (BT_UART_GATING)*/
226 UART1_TX = 0, 276 UART1_TX = 0,
@@ -788,7 +838,20 @@ enum omap34xx_index {
788 * - "_DOWN" suffix (GPIO3_DOWN) with internal pulldown 838 * - "_DOWN" suffix (GPIO3_DOWN) with internal pulldown
789 * - "_OUT" suffix (GPIO3_OUT) for output-only pins (unlike 24xx) 839 * - "_OUT" suffix (GPIO3_OUT) for output-only pins (unlike 24xx)
790 */ 840 */
841 AF26_34XX_GPIO0,
842 AF22_34XX_GPIO9,
791 AH8_34XX_GPIO29, 843 AH8_34XX_GPIO29,
844 U8_34XX_GPIO54_OUT,
845 U8_34XX_GPIO54_DOWN,
846 L8_34XX_GPIO63,
847 G25_34XX_GPIO86_OUT,
848 AG4_34XX_GPIO134_OUT,
849 AE4_34XX_GPIO136_OUT,
850 AF6_34XX_GPIO140_UP,
851 AE6_34XX_GPIO141,
852 AF5_34XX_GPIO142,
853 AE5_34XX_GPIO143,
854 H19_34XX_GPIO164_OUT,
792 J25_34XX_GPIO170, 855 J25_34XX_GPIO170,
793}; 856};
794 857
diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/mach/omap34xx.h
index 8e0479fff05a..ab640151d3ec 100644
--- a/arch/arm/plat-omap/include/mach/omap34xx.h
+++ b/arch/arm/plat-omap/include/mach/omap34xx.h
@@ -49,11 +49,39 @@
49#define OMAP343X_CTRL_BASE OMAP343X_SCM_BASE 49#define OMAP343X_CTRL_BASE OMAP343X_SCM_BASE
50 50
51#define OMAP34XX_IC_BASE 0x48200000 51#define OMAP34XX_IC_BASE 0x48200000
52
53#define OMAP3430_ISP_BASE (L4_34XX_BASE + 0xBC000)
54#define OMAP3430_ISP_CBUFF_BASE (OMAP3430_ISP_BASE + 0x0100)
55#define OMAP3430_ISP_CCP2_BASE (OMAP3430_ISP_BASE + 0x0400)
56#define OMAP3430_ISP_CCDC_BASE (OMAP3430_ISP_BASE + 0x0600)
57#define OMAP3430_ISP_HIST_BASE (OMAP3430_ISP_BASE + 0x0A00)
58#define OMAP3430_ISP_H3A_BASE (OMAP3430_ISP_BASE + 0x0C00)
59#define OMAP3430_ISP_PREV_BASE (OMAP3430_ISP_BASE + 0x0E00)
60#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000)
61#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200)
62#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400)
63#define OMAP3430_ISP_CSI2A_BASE (OMAP3430_ISP_BASE + 0x1800)
64#define OMAP3430_ISP_CSI2PHY_BASE (OMAP3430_ISP_BASE + 0x1970)
65
66#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F)
67#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077)
68#define OMAP3430_ISP_CCP2_END (OMAP3430_ISP_CCP2_BASE + 0x1EF)
69#define OMAP3430_ISP_CCDC_END (OMAP3430_ISP_CCDC_BASE + 0x0A7)
70#define OMAP3430_ISP_HIST_END (OMAP3430_ISP_HIST_BASE + 0x047)
71#define OMAP3430_ISP_H3A_END (OMAP3430_ISP_H3A_BASE + 0x05F)
72#define OMAP3430_ISP_PREV_END (OMAP3430_ISP_PREV_BASE + 0x09F)
73#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB)
74#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB)
75#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F)
76#define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F)
77#define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007)
78
52#define OMAP34XX_IVA_INTC_BASE 0x40000000 79#define OMAP34XX_IVA_INTC_BASE 0x40000000
53#define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) 80#define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000)
54#define OMAP34XX_HSUSB_HOST_BASE (L4_34XX_BASE + 0x64000) 81#define OMAP34XX_HSUSB_HOST_BASE (L4_34XX_BASE + 0x64000)
55#define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000) 82#define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000)
56 83
84#define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000)
57 85
58#if defined(CONFIG_ARCH_OMAP3430) 86#if defined(CONFIG_ARCH_OMAP3430)
59 87
diff --git a/arch/arm/plat-omap/include/mach/omap850.h b/arch/arm/plat-omap/include/mach/omap850.h
new file mode 100644
index 000000000000..c33f67981712
--- /dev/null
+++ b/arch/arm/plat-omap/include/mach/omap850.h
@@ -0,0 +1,102 @@
1/* arch/arm/plat-omap/include/mach/omap850.h
2 *
3 * Hardware definitions for TI OMAP850 processor.
4 *
5 * Derived from omap730.h by Zebediah C. McClure <zmc@lurian.net>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_OMAP850_H
29#define __ASM_ARCH_OMAP850_H
30
31/*
32 * ----------------------------------------------------------------------------
33 * Base addresses
34 * ----------------------------------------------------------------------------
35 */
36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38
39#define OMAP850_DSP_BASE 0xE0000000
40#define OMAP850_DSP_SIZE 0x50000
41#define OMAP850_DSP_START 0xE0000000
42
43#define OMAP850_DSPREG_BASE 0xE1000000
44#define OMAP850_DSPREG_SIZE SZ_128K
45#define OMAP850_DSPREG_START 0xE1000000
46
47/*
48 * ----------------------------------------------------------------------------
49 * OMAP850 specific configuration registers
50 * ----------------------------------------------------------------------------
51 */
52#define OMAP850_CONFIG_BASE 0xfffe1000
53#define OMAP850_IO_CONF_0 0xfffe1070
54#define OMAP850_IO_CONF_1 0xfffe1074
55#define OMAP850_IO_CONF_2 0xfffe1078
56#define OMAP850_IO_CONF_3 0xfffe107c
57#define OMAP850_IO_CONF_4 0xfffe1080
58#define OMAP850_IO_CONF_5 0xfffe1084
59#define OMAP850_IO_CONF_6 0xfffe1088
60#define OMAP850_IO_CONF_7 0xfffe108c
61#define OMAP850_IO_CONF_8 0xfffe1090
62#define OMAP850_IO_CONF_9 0xfffe1094
63#define OMAP850_IO_CONF_10 0xfffe1098
64#define OMAP850_IO_CONF_11 0xfffe109c
65#define OMAP850_IO_CONF_12 0xfffe10a0
66#define OMAP850_IO_CONF_13 0xfffe10a4
67
68#define OMAP850_MODE_1 0xfffe1010
69#define OMAP850_MODE_2 0xfffe1014
70
71/* CSMI specials: in terms of base + offset */
72#define OMAP850_MODE2_OFFSET 0x14
73
74/*
75 * ----------------------------------------------------------------------------
76 * OMAP850 traffic controller configuration registers
77 * ----------------------------------------------------------------------------
78 */
79#define OMAP850_FLASH_CFG_0 0xfffecc10
80#define OMAP850_FLASH_ACFG_0 0xfffecc50
81#define OMAP850_FLASH_CFG_1 0xfffecc14
82#define OMAP850_FLASH_ACFG_1 0xfffecc54
83
84/*
85 * ----------------------------------------------------------------------------
86 * OMAP850 DSP control registers
87 * ----------------------------------------------------------------------------
88 */
89#define OMAP850_ICR_BASE 0xfffbb800
90#define OMAP850_DSP_M_CTL 0xfffbb804
91#define OMAP850_DSP_MMU_BASE 0xfffed200
92
93/*
94 * ----------------------------------------------------------------------------
95 * OMAP850 PCC_UPLD configuration registers
96 * ----------------------------------------------------------------------------
97 */
98#define OMAP850_PCC_UPLD_CTRL_BASE (0xfffe0900)
99#define OMAP850_PCC_UPLD_CTRL (OMAP850_PCC_UPLD_CTRL_BASE + 0x00)
100
101#endif /* __ASM_ARCH_OMAP850_H */
102
diff --git a/arch/arm/plat-omap/include/mach/pm.h b/arch/arm/plat-omap/include/mach/pm.h
index 37e2f0f38b46..ce6ee7927537 100644
--- a/arch/arm/plat-omap/include/mach/pm.h
+++ b/arch/arm/plat-omap/include/mach/pm.h
@@ -118,18 +118,6 @@
118extern void prevent_idle_sleep(void); 118extern void prevent_idle_sleep(void);
119extern void allow_idle_sleep(void); 119extern void allow_idle_sleep(void);
120 120
121/**
122 * clk_deny_idle - Prevents the clock from being idled during MPU idle
123 * @clk: clock signal handle
124 */
125void clk_deny_idle(struct clk *clk);
126
127/**
128 * clk_allow_idle - Counters previous clk_deny_idle
129 * @clk: clock signal handle
130 */
131void clk_allow_idle(struct clk *clk);
132
133extern void omap_pm_idle(void); 121extern void omap_pm_idle(void);
134extern void omap_pm_suspend(void); 122extern void omap_pm_suspend(void);
135extern void omap730_cpu_suspend(unsigned short, unsigned short); 123extern void omap730_cpu_suspend(unsigned short, unsigned short);
diff --git a/arch/arm/plat-omap/include/mach/powerdomain.h b/arch/arm/plat-omap/include/mach/powerdomain.h
index 2806a9c8e4d7..69c9e675d8ee 100644
--- a/arch/arm/plat-omap/include/mach/powerdomain.h
+++ b/arch/arm/plat-omap/include/mach/powerdomain.h
@@ -50,9 +50,9 @@
50 50
51/* 51/*
52 * Maximum number of clockdomains that can be associated with a powerdomain. 52 * Maximum number of clockdomains that can be associated with a powerdomain.
53 * CORE powerdomain is probably the worst case. 53 * CORE powerdomain on OMAP3 is the worst case
54 */ 54 */
55#define PWRDM_MAX_CLKDMS 3 55#define PWRDM_MAX_CLKDMS 4
56 56
57/* XXX A completely arbitrary number. What is reasonable here? */ 57/* XXX A completely arbitrary number. What is reasonable here? */
58#define PWRDM_TRANSITION_BAILOUT 100000 58#define PWRDM_TRANSITION_BAILOUT 100000
@@ -145,6 +145,7 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm);
145 145
146int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst); 146int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst);
147int pwrdm_read_next_pwrst(struct powerdomain *pwrdm); 147int pwrdm_read_next_pwrst(struct powerdomain *pwrdm);
148int pwrdm_read_pwrst(struct powerdomain *pwrdm);
148int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm); 149int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm);
149int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm); 150int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm);
150 151
diff --git a/arch/arm/plat-omap/include/mach/prcm.h b/arch/arm/plat-omap/include/mach/prcm.h
index 56eba0fd6f6a..24ac3c715912 100644
--- a/arch/arm/plat-omap/include/mach/prcm.h
+++ b/arch/arm/plat-omap/include/mach/prcm.h
@@ -20,10 +20,11 @@
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 21 */
22 22
23#ifndef __ASM_ARM_ARCH_DPM_PRCM_H 23#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H
24#define __ASM_ARM_ARCH_DPM_PRCM_H 24#define __ASM_ARM_ARCH_OMAP_PRCM_H
25 25
26u32 omap_prcm_get_reset_sources(void); 26u32 omap_prcm_get_reset_sources(void);
27void omap_prcm_arch_reset(char mode);
27 28
28#endif 29#endif
29 30
diff --git a/arch/arm/plat-omap/include/mach/sdrc.h b/arch/arm/plat-omap/include/mach/sdrc.h
index a98c6c3beb2c..adc73522491f 100644
--- a/arch/arm/plat-omap/include/mach/sdrc.h
+++ b/arch/arm/plat-omap/include/mach/sdrc.h
@@ -4,10 +4,12 @@
4/* 4/*
5 * OMAP2/3 SDRC/SMS register definitions 5 * OMAP2/3 SDRC/SMS register definitions
6 * 6 *
7 * Copyright (C) 2007 Texas Instruments, Inc. 7 * Copyright (C) 2007-2008 Texas Instruments, Inc.
8 * Copyright (C) 2007 Nokia Corporation 8 * Copyright (C) 2007-2008 Nokia Corporation
9 * 9 *
10 * Written by Paul Walmsley 10 * Tony Lindgren
11 * Paul Walmsley
12 * Richard Woodruff
11 * 13 *
12 * This program is free software; you can redistribute it and/or modify 14 * 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 15 * it under the terms of the GNU General Public License version 2 as
@@ -64,14 +66,62 @@
64 * SMS register access 66 * SMS register access
65 */ 67 */
66 68
67 69#define OMAP242X_SMS_REGADDR(reg) \
68#define OMAP242X_SMS_REGADDR(reg) IO_ADDRESS(OMAP2420_SMS_BASE + reg) 70 (void __iomem *)IO_ADDRESS(OMAP2420_SMS_BASE + reg)
69#define OMAP243X_SMS_REGADDR(reg) IO_ADDRESS(OMAP243X_SMS_BASE + reg) 71#define OMAP243X_SMS_REGADDR(reg) \
70#define OMAP343X_SMS_REGADDR(reg) IO_ADDRESS(OMAP343X_SMS_BASE + reg) 72 (void __iomem *)IO_ADDRESS(OMAP243X_SMS_BASE + reg)
73#define OMAP343X_SMS_REGADDR(reg) \
74 (void __iomem *)IO_ADDRESS(OMAP343X_SMS_BASE + reg)
71 75
72/* SMS register offsets - read/write with sms_{read,write}_reg() */ 76/* SMS register offsets - read/write with sms_{read,write}_reg() */
73 77
74#define SMS_SYSCONFIG 0x010 78#define SMS_SYSCONFIG 0x010
75/* REVISIT: fill in other SMS registers here */ 79/* REVISIT: fill in other SMS registers here */
76 80
81
82#ifndef __ASSEMBLER__
83
84/**
85 * struct omap_sdrc_params - SDRC parameters for a given SDRC clock rate
86 * @rate: SDRC clock rate (in Hz)
87 * @actim_ctrla: Value to program to SDRC_ACTIM_CTRLA for this rate
88 * @actim_ctrlb: Value to program to SDRC_ACTIM_CTRLB for this rate
89 * @rfr_ctrl: Value to program to SDRC_RFR_CTRL for this rate
90 * @mr: Value to program to SDRC_MR for this rate
91 *
92 * This structure holds a pre-computed set of register values for the
93 * SDRC for a given SDRC clock rate and SDRAM chip. These are
94 * intended to be pre-computed and specified in an array in the board-*.c
95 * files. The structure is keyed off the 'rate' field.
96 */
97struct omap_sdrc_params {
98 unsigned long rate;
99 u32 actim_ctrla;
100 u32 actim_ctrlb;
101 u32 rfr_ctrl;
102 u32 mr;
103};
104
105void __init omap2_sdrc_init(struct omap_sdrc_params *sp);
106struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r);
107
108#ifdef CONFIG_ARCH_OMAP2
109
110struct memory_timings {
111 u32 m_type; /* ddr = 1, sdr = 0 */
112 u32 dll_mode; /* use lock mode = 1, unlock mode = 0 */
113 u32 slow_dll_ctrl; /* unlock mode, dll value for slow speed */
114 u32 fast_dll_ctrl; /* unlock mode, dll value for fast speed */
115 u32 base_cs; /* base chip select to use for calculations */
116};
117
118extern void omap2xxx_sdrc_init_params(u32 force_lock_to_unlock_mode);
119
120u32 omap2xxx_sdrc_dll_is_unlocked(void);
121u32 omap2xxx_sdrc_reprogram(u32 level, u32 force);
122
123#endif /* CONFIG_ARCH_OMAP2 */
124
125#endif /* __ASSEMBLER__ */
126
77#endif 127#endif
diff --git a/arch/arm/plat-omap/include/mach/system.h b/arch/arm/plat-omap/include/mach/system.h
index 06923f261545..1060e345423b 100644
--- a/arch/arm/plat-omap/include/mach/system.h
+++ b/arch/arm/plat-omap/include/mach/system.h
@@ -9,12 +9,14 @@
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>
13
12#ifndef CONFIG_MACH_VOICEBLUE 14#ifndef CONFIG_MACH_VOICEBLUE
13#define voiceblue_reset() do {} while (0) 15#define voiceblue_reset() do {} while (0)
16#else
17extern void voiceblue_reset(void);
14#endif 18#endif
15 19
16extern void omap_prcm_arch_reset(char mode);
17
18static inline void arch_idle(void) 20static inline void arch_idle(void)
19{ 21{
20 cpu_do_idle(); 22 cpu_do_idle();
@@ -38,7 +40,7 @@ static inline void omap1_arch_reset(char mode)
38 omap_writew(1, ARM_RSTCT1); 40 omap_writew(1, ARM_RSTCT1);
39} 41}
40 42
41static inline void arch_reset(char mode) 43static inline void arch_reset(char mode, const char *cmd)
42{ 44{
43 if (!cpu_class_is_omap2()) 45 if (!cpu_class_is_omap2())
44 omap1_arch_reset(mode); 46 omap1_arch_reset(mode);
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/mach/usb.h
index a56a610950c2..69f0ceed500b 100644
--- a/arch/arm/plat-omap/include/mach/usb.h
+++ b/arch/arm/plat-omap/include/mach/usb.h
@@ -27,8 +27,18 @@
27#define UDC_BASE OMAP2_UDC_BASE 27#define UDC_BASE OMAP2_UDC_BASE
28#define OMAP_OHCI_BASE OMAP2_OHCI_BASE 28#define OMAP_OHCI_BASE OMAP2_OHCI_BASE
29 29
30#ifdef CONFIG_USB_MUSB_SOC
31extern void usb_musb_init(void);
32#else
33static inline void usb_musb_init(void)
34{
35}
36#endif
37
30#endif 38#endif
31 39
40void omap_usb_init(struct omap_usb_config *pdata);
41
32/*-------------------------------------------------------------------------*/ 42/*-------------------------------------------------------------------------*/
33 43
34/* 44/*
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index b52ce053e6f2..0abfbaa59871 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -1,10 +1,9 @@
1/* 1/*
2 * OMAP mailbox driver 2 * OMAP mailbox driver
3 * 3 *
4 * Copyright (C) 2006 Nokia Corporation. All rights reserved. 4 * Copyright (C) 2006-2009 Nokia Corporation. All rights reserved.
5 * 5 *
6 * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com> 6 * Contact: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
7 * Restructured by Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
8 * 7 *
9 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
@@ -22,21 +21,98 @@
22 * 21 *
23 */ 22 */
24 23
25#include <linux/init.h>
26#include <linux/module.h> 24#include <linux/module.h>
27#include <linux/sched.h>
28#include <linux/interrupt.h> 25#include <linux/interrupt.h>
29#include <linux/device.h> 26#include <linux/device.h>
30#include <linux/blkdev.h>
31#include <linux/err.h>
32#include <linux/delay.h> 27#include <linux/delay.h>
33#include <linux/io.h> 28
34#include <mach/mailbox.h> 29#include <mach/mailbox.h>
35#include "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.");
36 34
37static struct omap_mbox *mboxes; 35static struct omap_mbox *mboxes;
38static DEFINE_RWLOCK(mboxes_lock); 36static DEFINE_RWLOCK(mboxes_lock);
39 37
38/*
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
79/* Mailbox FIFO handle functions */
80static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
81{
82 return mbox->ops->fifo_read(mbox);
83}
84static inline void mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
85{
86 mbox->ops->fifo_write(mbox, msg);
87}
88static inline int mbox_fifo_empty(struct omap_mbox *mbox)
89{
90 return mbox->ops->fifo_empty(mbox);
91}
92static inline int mbox_fifo_full(struct omap_mbox *mbox)
93{
94 return mbox->ops->fifo_full(mbox);
95}
96
97/* 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)
107{
108 if (mbox->ops->ack_irq)
109 mbox->ops->ack_irq(mbox, irq);
110}
111static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
112{
113 return mbox->ops->is_irq(mbox, irq);
114}
115
40/* Mailbox Sequence Bit function */ 116/* Mailbox Sequence Bit function */
41void omap_mbox_init_seq(struct omap_mbox *mbox) 117void omap_mbox_init_seq(struct omap_mbox *mbox)
42{ 118{
@@ -136,7 +212,7 @@ static void mbox_rx_work(struct work_struct *work)
136 unsigned long flags; 212 unsigned long flags;
137 213
138 if (mbox->rxq->callback == NULL) { 214 if (mbox->rxq->callback == NULL) {
139 sysfs_notify(&mbox->dev.kobj, NULL, "mbox"); 215 sysfs_notify(&mbox->dev->kobj, NULL, "mbox");
140 return; 216 return;
141 } 217 }
142 218
@@ -204,7 +280,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
204 /* no more messages in the fifo. clear IRQ source. */ 280 /* no more messages in the fifo. clear IRQ source. */
205 ack_mbox_irq(mbox, IRQ_RX); 281 ack_mbox_irq(mbox, IRQ_RX);
206 enable_mbox_irq(mbox, IRQ_RX); 282 enable_mbox_irq(mbox, IRQ_RX);
207 nomem: 283nomem:
208 schedule_work(&mbox->rxq->work); 284 schedule_work(&mbox->rxq->work);
209} 285}
210 286
@@ -286,7 +362,7 @@ static ssize_t mbox_show(struct class *class, char *buf)
286static CLASS_ATTR(mbox, S_IRUGO, mbox_show, NULL); 362static CLASS_ATTR(mbox, S_IRUGO, mbox_show, NULL);
287 363
288static struct class omap_mbox_class = { 364static struct class omap_mbox_class = {
289 .name = "omap_mbox", 365 .name = "omap-mailbox",
290}; 366};
291 367
292static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox, 368static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox,
@@ -333,21 +409,6 @@ static int omap_mbox_init(struct omap_mbox *mbox)
333 return ret; 409 return ret;
334 } 410 }
335 411
336 mbox->dev.class = &omap_mbox_class;
337 dev_set_name(&mbox->dev, "%s", mbox->name);
338 dev_set_drvdata(&mbox->dev, mbox);
339
340 ret = device_register(&mbox->dev);
341 if (unlikely(ret))
342 goto fail_device_reg;
343
344 ret = device_create_file(&mbox->dev, &dev_attr_mbox);
345 if (unlikely(ret)) {
346 printk(KERN_ERR
347 "device_create_file failed: %d\n", ret);
348 goto fail_create_mbox;
349 }
350
351 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_DISABLED, 412 ret = request_irq(mbox->irq, mbox_interrupt, IRQF_DISABLED,
352 mbox->name, mbox); 413 mbox->name, mbox);
353 if (unlikely(ret)) { 414 if (unlikely(ret)) {
@@ -377,10 +438,6 @@ static int omap_mbox_init(struct omap_mbox *mbox)
377 fail_alloc_txq: 438 fail_alloc_txq:
378 free_irq(mbox->irq, mbox); 439 free_irq(mbox->irq, mbox);
379 fail_request_irq: 440 fail_request_irq:
380 device_remove_file(&mbox->dev, &dev_attr_mbox);
381 fail_create_mbox:
382 device_unregister(&mbox->dev);
383 fail_device_reg:
384 if (unlikely(mbox->ops->shutdown)) 441 if (unlikely(mbox->ops->shutdown))
385 mbox->ops->shutdown(mbox); 442 mbox->ops->shutdown(mbox);
386 443
@@ -393,8 +450,6 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
393 mbox_queue_free(mbox->rxq); 450 mbox_queue_free(mbox->rxq);
394 451
395 free_irq(mbox->irq, mbox); 452 free_irq(mbox->irq, mbox);
396 device_remove_file(&mbox->dev, &dev_attr_mbox);
397 class_unregister(&omap_mbox_class);
398 453
399 if (unlikely(mbox->ops->shutdown)) 454 if (unlikely(mbox->ops->shutdown))
400 mbox->ops->shutdown(mbox); 455 mbox->ops->shutdown(mbox);
@@ -440,7 +495,7 @@ void omap_mbox_put(struct omap_mbox *mbox)
440} 495}
441EXPORT_SYMBOL(omap_mbox_put); 496EXPORT_SYMBOL(omap_mbox_put);
442 497
443int omap_mbox_register(struct omap_mbox *mbox) 498int omap_mbox_register(struct device *parent, struct omap_mbox *mbox)
444{ 499{
445 int ret = 0; 500 int ret = 0;
446 struct omap_mbox **tmp; 501 struct omap_mbox **tmp;
@@ -450,14 +505,31 @@ int omap_mbox_register(struct omap_mbox *mbox)
450 if (mbox->next) 505 if (mbox->next)
451 return -EBUSY; 506 return -EBUSY;
452 507
508 mbox->dev = device_create(&omap_mbox_class,
509 parent, 0, mbox, "%s", mbox->name);
510 if (IS_ERR(mbox->dev))
511 return PTR_ERR(mbox->dev);
512
513 ret = device_create_file(mbox->dev, &dev_attr_mbox);
514 if (ret)
515 goto err_sysfs;
516
453 write_lock(&mboxes_lock); 517 write_lock(&mboxes_lock);
454 tmp = find_mboxes(mbox->name); 518 tmp = find_mboxes(mbox->name);
455 if (*tmp) 519 if (*tmp) {
456 ret = -EBUSY; 520 ret = -EBUSY;
457 else 521 write_unlock(&mboxes_lock);
458 *tmp = mbox; 522 goto err_find;
523 }
524 *tmp = mbox;
459 write_unlock(&mboxes_lock); 525 write_unlock(&mboxes_lock);
460 526
527 return 0;
528
529err_find:
530 device_remove_file(mbox->dev, &dev_attr_mbox);
531err_sysfs:
532 device_unregister(mbox->dev);
461 return ret; 533 return ret;
462} 534}
463EXPORT_SYMBOL(omap_mbox_register); 535EXPORT_SYMBOL(omap_mbox_register);
@@ -473,6 +545,8 @@ int omap_mbox_unregister(struct omap_mbox *mbox)
473 *tmp = mbox->next; 545 *tmp = mbox->next;
474 mbox->next = NULL; 546 mbox->next = NULL;
475 write_unlock(&mboxes_lock); 547 write_unlock(&mboxes_lock);
548 device_remove_file(mbox->dev, &dev_attr_mbox);
549 device_unregister(mbox->dev);
476 return 0; 550 return 0;
477 } 551 }
478 tmp = &(*tmp)->next; 552 tmp = &(*tmp)->next;
@@ -501,4 +575,6 @@ static void __exit omap_mbox_class_exit(void)
501subsys_initcall(omap_mbox_class_init); 575subsys_initcall(omap_mbox_class_init);
502module_exit(omap_mbox_class_exit); 576module_exit(omap_mbox_class_exit);
503 577
504MODULE_LICENSE("GPL"); 578MODULE_LICENSE("GPL v2");
579MODULE_DESCRIPTION("omap mailbox: interrupt driven messaging");
580MODULE_AUTHOR("Toshihiro Kobayashi and Hiroshi DOYU");
diff --git a/arch/arm/plat-omap/mailbox.h b/arch/arm/plat-omap/mailbox.h
deleted file mode 100644
index 67c6740b8ad5..000000000000
--- a/arch/arm/plat-omap/mailbox.h
+++ /dev/null
@@ -1,100 +0,0 @@
1/*
2 * Mailbox internal functions
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef __ARCH_ARM_PLAT_MAILBOX_H
13#define __ARCH_ARM_PLAT_MAILBOX_H
14
15/*
16 * Mailbox sequence bit API
17 */
18#if defined(CONFIG_ARCH_OMAP1)
19# define MBOX_USE_SEQ_BIT
20#elif defined(CONFIG_ARCH_OMAP2)
21# define MBOX_USE_SEQ_BIT
22#endif
23
24#ifdef MBOX_USE_SEQ_BIT
25/* seq_rcv should be initialized with any value other than
26 * 0 and 1 << 31, to allow either value for the first
27 * message. */
28static inline void mbox_seq_init(struct omap_mbox *mbox)
29{
30 /* any value other than 0 and 1 << 31 */
31 mbox->seq_rcv = 0xffffffff;
32}
33
34static inline void mbox_seq_toggle(struct omap_mbox *mbox, mbox_msg_t * msg)
35{
36 /* add seq_snd to msg */
37 *msg = (*msg & 0x7fffffff) | mbox->seq_snd;
38 /* flip seq_snd */
39 mbox->seq_snd ^= 1 << 31;
40}
41
42static inline int mbox_seq_test(struct omap_mbox *mbox, mbox_msg_t msg)
43{
44 mbox_msg_t seq = msg & (1 << 31);
45 if (seq == mbox->seq_rcv)
46 return -1;
47 mbox->seq_rcv = seq;
48 return 0;
49}
50#else
51static inline void mbox_seq_init(struct omap_mbox *mbox)
52{
53}
54static inline void mbox_seq_toggle(struct omap_mbox *mbox, mbox_msg_t * msg)
55{
56}
57static inline int mbox_seq_test(struct omap_mbox *mbox, mbox_msg_t msg)
58{
59 return 0;
60}
61#endif
62
63/* Mailbox FIFO handle functions */
64static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox)
65{
66 return mbox->ops->fifo_read(mbox);
67}
68static inline void mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
69{
70 mbox->ops->fifo_write(mbox, msg);
71}
72static inline int mbox_fifo_empty(struct omap_mbox *mbox)
73{
74 return mbox->ops->fifo_empty(mbox);
75}
76static inline int mbox_fifo_full(struct omap_mbox *mbox)
77{
78 return mbox->ops->fifo_full(mbox);
79}
80
81/* Mailbox IRQ handle functions */
82static inline void enable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
83{
84 mbox->ops->enable_irq(mbox, irq);
85}
86static inline void disable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
87{
88 mbox->ops->disable_irq(mbox, irq);
89}
90static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
91{
92 if (mbox->ops->ack_irq)
93 mbox->ops->ack_irq(mbox, irq);
94}
95static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
96{
97 return mbox->ops->is_irq(mbox, irq);
98}
99
100#endif /* __ARCH_ARM_PLAT_MAILBOX_H */
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index e5842e30e534..28b0a824b8cf 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -214,7 +214,6 @@ EXPORT_SYMBOL(omap_mcbsp_set_io_type);
214int omap_mcbsp_request(unsigned int id) 214int omap_mcbsp_request(unsigned int id)
215{ 215{
216 struct omap_mcbsp *mcbsp; 216 struct omap_mcbsp *mcbsp;
217 int i;
218 int err; 217 int err;
219 218
220 if (!omap_mcbsp_check_valid_id(id)) { 219 if (!omap_mcbsp_check_valid_id(id)) {
@@ -223,23 +222,23 @@ int omap_mcbsp_request(unsigned int id)
223 } 222 }
224 mcbsp = id_to_mcbsp_ptr(id); 223 mcbsp = id_to_mcbsp_ptr(id);
225 224
226 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request)
227 mcbsp->pdata->ops->request(id);
228
229 for (i = 0; i < mcbsp->num_clks; i++)
230 clk_enable(mcbsp->clks[i]);
231
232 spin_lock(&mcbsp->lock); 225 spin_lock(&mcbsp->lock);
233 if (!mcbsp->free) { 226 if (!mcbsp->free) {
234 dev_err(mcbsp->dev, "McBSP%d is currently in use\n", 227 dev_err(mcbsp->dev, "McBSP%d is currently in use\n",
235 mcbsp->id); 228 mcbsp->id);
236 spin_unlock(&mcbsp->lock); 229 spin_unlock(&mcbsp->lock);
237 return -1; 230 return -EBUSY;
238 } 231 }
239 232
240 mcbsp->free = 0; 233 mcbsp->free = 0;
241 spin_unlock(&mcbsp->lock); 234 spin_unlock(&mcbsp->lock);
242 235
236 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request)
237 mcbsp->pdata->ops->request(id);
238
239 clk_enable(mcbsp->iclk);
240 clk_enable(mcbsp->fclk);
241
243 /* 242 /*
244 * Make sure that transmitter, receiver and sample-rate generator are 243 * Make sure that transmitter, receiver and sample-rate generator are
245 * not running before activating IRQs. 244 * not running before activating IRQs.
@@ -278,7 +277,6 @@ EXPORT_SYMBOL(omap_mcbsp_request);
278void omap_mcbsp_free(unsigned int id) 277void omap_mcbsp_free(unsigned int id)
279{ 278{
280 struct omap_mcbsp *mcbsp; 279 struct omap_mcbsp *mcbsp;
281 int i;
282 280
283 if (!omap_mcbsp_check_valid_id(id)) { 281 if (!omap_mcbsp_check_valid_id(id)) {
284 printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1); 282 printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
@@ -289,8 +287,14 @@ void omap_mcbsp_free(unsigned int id)
289 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free) 287 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free)
290 mcbsp->pdata->ops->free(id); 288 mcbsp->pdata->ops->free(id);
291 289
292 for (i = mcbsp->num_clks - 1; i >= 0; i--) 290 clk_disable(mcbsp->fclk);
293 clk_disable(mcbsp->clks[i]); 291 clk_disable(mcbsp->iclk);
292
293 if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
294 /* Free IRQs */
295 free_irq(mcbsp->rx_irq, (void *)mcbsp);
296 free_irq(mcbsp->tx_irq, (void *)mcbsp);
297 }
294 298
295 spin_lock(&mcbsp->lock); 299 spin_lock(&mcbsp->lock);
296 if (mcbsp->free) { 300 if (mcbsp->free) {
@@ -302,12 +306,6 @@ void omap_mcbsp_free(unsigned int id)
302 306
303 mcbsp->free = 1; 307 mcbsp->free = 1;
304 spin_unlock(&mcbsp->lock); 308 spin_unlock(&mcbsp->lock);
305
306 if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
307 /* Free IRQs */
308 free_irq(mcbsp->rx_irq, (void *)mcbsp);
309 free_irq(mcbsp->tx_irq, (void *)mcbsp);
310 }
311} 309}
312EXPORT_SYMBOL(omap_mcbsp_free); 310EXPORT_SYMBOL(omap_mcbsp_free);
313 311
@@ -876,7 +874,6 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
876 struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; 874 struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data;
877 struct omap_mcbsp *mcbsp; 875 struct omap_mcbsp *mcbsp;
878 int id = pdev->id - 1; 876 int id = pdev->id - 1;
879 int i;
880 int ret = 0; 877 int ret = 0;
881 878
882 if (!pdata) { 879 if (!pdata) {
@@ -899,7 +896,6 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
899 ret = -ENOMEM; 896 ret = -ENOMEM;
900 goto exit; 897 goto exit;
901 } 898 }
902 mcbsp_ptr[id] = mcbsp;
903 899
904 spin_lock_init(&mcbsp->lock); 900 spin_lock_init(&mcbsp->lock);
905 mcbsp->id = id + 1; 901 mcbsp->id = id + 1;
@@ -921,39 +917,32 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
921 mcbsp->dma_rx_sync = pdata->dma_rx_sync; 917 mcbsp->dma_rx_sync = pdata->dma_rx_sync;
922 mcbsp->dma_tx_sync = pdata->dma_tx_sync; 918 mcbsp->dma_tx_sync = pdata->dma_tx_sync;
923 919
924 if (pdata->num_clks) { 920 mcbsp->iclk = clk_get(&pdev->dev, "ick");
925 mcbsp->num_clks = pdata->num_clks; 921 if (IS_ERR(mcbsp->iclk)) {
926 mcbsp->clks = kzalloc(mcbsp->num_clks * sizeof(struct clk *), 922 ret = PTR_ERR(mcbsp->iclk);
927 GFP_KERNEL); 923 dev_err(&pdev->dev, "unable to get ick: %d\n", ret);
928 if (!mcbsp->clks) { 924 goto err_iclk;
929 ret = -ENOMEM; 925 }
930 goto exit;
931 }
932 for (i = 0; i < mcbsp->num_clks; i++) {
933 mcbsp->clks[i] = clk_get(&pdev->dev, pdata->clk_names[i]);
934 if (IS_ERR(mcbsp->clks[i])) {
935 dev_err(&pdev->dev,
936 "Invalid %s configuration for McBSP%d.\n",
937 pdata->clk_names[i], mcbsp->id);
938 ret = PTR_ERR(mcbsp->clks[i]);
939 goto err_clk;
940 }
941 }
942 926
927 mcbsp->fclk = clk_get(&pdev->dev, "fck");
928 if (IS_ERR(mcbsp->fclk)) {
929 ret = PTR_ERR(mcbsp->fclk);
930 dev_err(&pdev->dev, "unable to get fck: %d\n", ret);
931 goto err_fclk;
943 } 932 }
944 933
945 mcbsp->pdata = pdata; 934 mcbsp->pdata = pdata;
946 mcbsp->dev = &pdev->dev; 935 mcbsp->dev = &pdev->dev;
936 mcbsp_ptr[id] = mcbsp;
947 platform_set_drvdata(pdev, mcbsp); 937 platform_set_drvdata(pdev, mcbsp);
948 return 0; 938 return 0;
949 939
950err_clk: 940err_fclk:
951 while (i--) 941 clk_put(mcbsp->iclk);
952 clk_put(mcbsp->clks[i]); 942err_iclk:
953 kfree(mcbsp->clks);
954 iounmap(mcbsp->io_base); 943 iounmap(mcbsp->io_base);
955err_ioremap: 944err_ioremap:
956 mcbsp->free = 0; 945 kfree(mcbsp);
957exit: 946exit:
958 return ret; 947 return ret;
959} 948}
@@ -961,7 +950,6 @@ exit:
961static int __devexit omap_mcbsp_remove(struct platform_device *pdev) 950static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
962{ 951{
963 struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); 952 struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
964 int i;
965 953
966 platform_set_drvdata(pdev, NULL); 954 platform_set_drvdata(pdev, NULL);
967 if (mcbsp) { 955 if (mcbsp) {
@@ -970,18 +958,15 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
970 mcbsp->pdata->ops->free) 958 mcbsp->pdata->ops->free)
971 mcbsp->pdata->ops->free(mcbsp->id); 959 mcbsp->pdata->ops->free(mcbsp->id);
972 960
973 for (i = mcbsp->num_clks - 1; i >= 0; i--) { 961 clk_disable(mcbsp->fclk);
974 clk_disable(mcbsp->clks[i]); 962 clk_disable(mcbsp->iclk);
975 clk_put(mcbsp->clks[i]); 963 clk_put(mcbsp->fclk);
976 } 964 clk_put(mcbsp->iclk);
977 965
978 iounmap(mcbsp->io_base); 966 iounmap(mcbsp->io_base);
979 967
980 if (mcbsp->num_clks) { 968 mcbsp->fclk = NULL;
981 kfree(mcbsp->clks); 969 mcbsp->iclk = NULL;
982 mcbsp->clks = NULL;
983 mcbsp->num_clks = 0;
984 }
985 mcbsp->free = 0; 970 mcbsp->free = 0;
986 mcbsp->dev = NULL; 971 mcbsp->dev = NULL;
987 } 972 }
@@ -1002,4 +987,3 @@ int __init omap_mcbsp_init(void)
1002 /* Register the McBSP driver */ 987 /* Register the McBSP driver */
1003 return platform_driver_register(&omap_mcbsp_driver); 988 return platform_driver_register(&omap_mcbsp_driver);
1004} 989}
1005
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index be7bcaf2b832..fa5297d643d3 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -148,7 +148,7 @@ void __init omap_detect_sram(void)
148 omap_sram_base = OMAP1_SRAM_VA; 148 omap_sram_base = OMAP1_SRAM_VA;
149 omap_sram_start = OMAP1_SRAM_PA; 149 omap_sram_start = OMAP1_SRAM_PA;
150 150
151 if (cpu_is_omap730()) 151 if (cpu_is_omap7xx())
152 omap_sram_size = 0x32000; /* 200K */ 152 omap_sram_size = 0x32000; /* 200K */
153 else if (cpu_is_omap15xx()) 153 else if (cpu_is_omap15xx())
154 omap_sram_size = 0x30000; /* 192K */ 154 omap_sram_size = 0x30000; /* 192K */
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index e278de6862ae..509f2ed99e21 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -729,30 +729,13 @@ static inline void omap_1510_usb_init(struct omap_usb_config *config) {}
729 729
730/*-------------------------------------------------------------------------*/ 730/*-------------------------------------------------------------------------*/
731 731
732static struct omap_usb_config platform_data; 732void __init omap_usb_init(struct omap_usb_config *pdata)
733
734static int __init
735omap_usb_init(void)
736{ 733{
737 const struct omap_usb_config *config;
738
739 config = omap_get_config(OMAP_TAG_USB, struct omap_usb_config);
740 if (config == NULL) {
741 printk(KERN_ERR "USB: No board-specific "
742 "platform config found\n");
743 return -ENODEV;
744 }
745 platform_data = *config;
746
747 if (cpu_is_omap730() || cpu_is_omap16xx() || cpu_is_omap24xx()) 734 if (cpu_is_omap730() || cpu_is_omap16xx() || cpu_is_omap24xx())
748 omap_otg_init(&platform_data); 735 omap_otg_init(pdata);
749 else if (cpu_is_omap15xx()) 736 else if (cpu_is_omap15xx())
750 omap_1510_usb_init(&platform_data); 737 omap_1510_usb_init(pdata);
751 else { 738 else
752 printk(KERN_ERR "USB: No init for your chip yet\n"); 739 printk(KERN_ERR "USB: No init for your chip yet\n");
753 return -ENODEV;
754 }
755 return 0;
756} 740}
757 741
758subsys_initcall(omap_usb_init);
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 0d12c2164766..32eb9e33bebb 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -19,7 +19,8 @@
19 19
20static DEFINE_SPINLOCK(gpio_lock); 20static DEFINE_SPINLOCK(gpio_lock);
21static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */ 21static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */
22static unsigned long gpio_valid[BITS_TO_LONGS(GPIO_MAX)]; 22static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)];
23static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)];
23 24
24static inline void __set_direction(unsigned pin, int input) 25static inline void __set_direction(unsigned pin, int input)
25{ 26{
@@ -53,7 +54,7 @@ int gpio_direction_input(unsigned pin)
53{ 54{
54 unsigned long flags; 55 unsigned long flags;
55 56
56 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { 57 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_input)) {
57 pr_debug("%s: invalid GPIO %d\n", __func__, pin); 58 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
58 return -EINVAL; 59 return -EINVAL;
59 } 60 }
@@ -83,7 +84,7 @@ int gpio_direction_output(unsigned pin, int value)
83 unsigned long flags; 84 unsigned long flags;
84 u32 u; 85 u32 u;
85 86
86 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { 87 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid_output)) {
87 pr_debug("%s: invalid GPIO %d\n", __func__, pin); 88 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
88 return -EINVAL; 89 return -EINVAL;
89 } 90 }
@@ -161,7 +162,9 @@ int gpio_request(unsigned pin, const char *label)
161 unsigned long flags; 162 unsigned long flags;
162 int ret; 163 int ret;
163 164
164 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { 165 if (pin >= GPIO_MAX ||
166 !(test_bit(pin, gpio_valid_input) ||
167 test_bit(pin, gpio_valid_output))) {
165 pr_debug("%s: invalid GPIO %d\n", __func__, pin); 168 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
166 return -EINVAL; 169 return -EINVAL;
167 } 170 }
@@ -183,7 +186,9 @@ EXPORT_SYMBOL(gpio_request);
183 186
184void gpio_free(unsigned pin) 187void gpio_free(unsigned pin)
185{ 188{
186 if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { 189 if (pin >= GPIO_MAX ||
190 !(test_bit(pin, gpio_valid_input) ||
191 test_bit(pin, gpio_valid_output))) {
187 pr_debug("%s: invalid GPIO %d\n", __func__, pin); 192 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
188 return; 193 return;
189 } 194 }
@@ -208,12 +213,18 @@ void __init orion_gpio_set_unused(unsigned pin)
208 __set_direction(pin, 0); 213 __set_direction(pin, 0);
209} 214}
210 215
211void __init orion_gpio_set_valid(unsigned pin, int valid) 216void __init orion_gpio_set_valid(unsigned pin, int mode)
212{ 217{
213 if (valid) 218 if (mode == 1)
214 __set_bit(pin, gpio_valid); 219 mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK;
220 if (mode & GPIO_INPUT_OK)
221 __set_bit(pin, gpio_valid_input);
215 else 222 else
216 __clear_bit(pin, gpio_valid); 223 __clear_bit(pin, gpio_valid_input);
224 if (mode & GPIO_OUTPUT_OK)
225 __set_bit(pin, gpio_valid_output);
226 else
227 __clear_bit(pin, gpio_valid_output);
217} 228}
218 229
219void orion_gpio_set_blink(unsigned pin, int blink) 230void orion_gpio_set_blink(unsigned pin, int blink)
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index ec743e82c876..33f6c6aec185 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -25,9 +25,13 @@ void gpio_set_value(unsigned pin, int value);
25 * Orion-specific GPIO API extensions. 25 * Orion-specific GPIO API extensions.
26 */ 26 */
27void orion_gpio_set_unused(unsigned pin); 27void orion_gpio_set_unused(unsigned pin);
28void orion_gpio_set_valid(unsigned pin, int valid);
29void orion_gpio_set_blink(unsigned pin, int blink); 28void orion_gpio_set_blink(unsigned pin, int blink);
30 29
30#define GPIO_BIDI_OK (1 << 0)
31#define GPIO_INPUT_OK (1 << 1)
32#define GPIO_OUTPUT_OK (1 << 2)
33void orion_gpio_set_valid(unsigned pin, int mode);
34
31/* 35/*
32 * GPIO interrupt handling. 36 * GPIO interrupt handling.
33 */ 37 */
diff --git a/arch/arm/plat-orion/include/plat/mvsdio.h b/arch/arm/plat-orion/include/plat/mvsdio.h
new file mode 100644
index 000000000000..14ca88676002
--- /dev/null
+++ b/arch/arm/plat-orion/include/plat/mvsdio.h
@@ -0,0 +1,21 @@
1/*
2 * arch/arm/plat-orion/include/plat/mvsdio.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 __MACH_MVSDIO_H
10#define __MACH_MVSDIO_H
11
12#include <linux/mbus.h>
13
14struct mvsdio_platform_data {
15 struct mbus_dram_target_info *dram;
16 unsigned int clock;
17 int gpio_card_detect;
18 int gpio_write_protect;
19};
20
21#endif
diff --git a/arch/arm/plat-orion/include/plat/orion5x_wdt.h b/arch/arm/plat-orion/include/plat/orion5x_wdt.h
new file mode 100644
index 000000000000..3c9cf6a305ef
--- /dev/null
+++ b/arch/arm/plat-orion/include/plat/orion5x_wdt.h
@@ -0,0 +1,18 @@
1/*
2 * arch/arm/plat-orion/include/plat/orion5x_wdt.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 __PLAT_ORION5X_WDT_H
10#define __PLAT_ORION5X_WDT_H
11
12struct orion5x_wdt_platform_data {
13 u32 tclk; /* no <linux/clk.h> support yet */
14};
15
16
17#endif
18
diff --git a/arch/arm/plat-pxa/Kconfig b/arch/arm/plat-pxa/Kconfig
new file mode 100644
index 000000000000..b158e98038ed
--- /dev/null
+++ b/arch/arm/plat-pxa/Kconfig
@@ -0,0 +1,3 @@
1if PLAT_PXA
2
3endif
diff --git a/arch/arm/plat-pxa/Makefile b/arch/arm/plat-pxa/Makefile
new file mode 100644
index 000000000000..8f2c4c7fbd48
--- /dev/null
+++ b/arch/arm/plat-pxa/Makefile
@@ -0,0 +1,9 @@
1#
2# Makefile for code common across different PXA processor families
3#
4
5obj-y := dma.o
6
7obj-$(CONFIG_GENERIC_GPIO) += gpio.o
8obj-$(CONFIG_PXA3xx) += mfp.o
9obj-$(CONFIG_ARCH_MMP) += mfp.o
diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/plat-pxa/dma.c
index 7de17fc5d54b..70aeee407f7d 100644
--- a/arch/arm/mach-pxa/dma.c
+++ b/arch/arm/plat-pxa/dma.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-pxa/dma.c 2 * linux/arch/arm/plat-pxa/dma.c
3 * 3 *
4 * PXA DMA registration and IRQ dispatching 4 * PXA DMA registration and IRQ dispatching
5 * 5 *
@@ -23,8 +23,6 @@
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/dma.h> 24#include <mach/dma.h>
25 25
26#include <mach/pxa-regs.h>
27
28struct dma_channel { 26struct dma_channel {
29 char *name; 27 char *name;
30 pxa_dma_prio prio; 28 pxa_dma_prio prio;
@@ -36,8 +34,8 @@ static struct dma_channel *dma_channels;
36static int num_dma_channels; 34static int num_dma_channels;
37 35
38int pxa_request_dma (char *name, pxa_dma_prio prio, 36int pxa_request_dma (char *name, pxa_dma_prio prio,
39 void (*irq_handler)(int, void *), 37 void (*irq_handler)(int, void *),
40 void *data) 38 void *data)
41{ 39{
42 unsigned long flags; 40 unsigned long flags;
43 int i, found = 0; 41 int i, found = 0;
@@ -113,7 +111,7 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
113 return IRQ_HANDLED; 111 return IRQ_HANDLED;
114} 112}
115 113
116int __init pxa_init_dma(int num_ch) 114int __init pxa_init_dma(int irq, int num_ch)
117{ 115{
118 int i, ret; 116 int i, ret;
119 117
@@ -131,7 +129,7 @@ int __init pxa_init_dma(int num_ch)
131 dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW); 129 dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW);
132 } 130 }
133 131
134 ret = request_irq(IRQ_DMA, dma_irq_handler, IRQF_DISABLED, "DMA", NULL); 132 ret = request_irq(irq, dma_irq_handler, IRQF_DISABLED, "DMA", NULL);
135 if (ret) { 133 if (ret) {
136 printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n"); 134 printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n");
137 kfree(dma_channels); 135 kfree(dma_channels);
diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
new file mode 100644
index 000000000000..af819bf21b63
--- /dev/null
+++ b/arch/arm/plat-pxa/gpio.c
@@ -0,0 +1,337 @@
1/*
2 * linux/arch/arm/plat-pxa/gpio.c
3 *
4 * Generic PXA GPIO handling
5 *
6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001
8 * Copyright: MontaVista Software Inc.
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/init.h>
16#include <linux/irq.h>
17#include <linux/io.h>
18#include <linux/sysdev.h>
19#include <linux/bootmem.h>
20
21#include <mach/gpio.h>
22
23int pxa_last_gpio;
24
25struct pxa_gpio_chip {
26 struct gpio_chip chip;
27 void __iomem *regbase;
28 char label[10];
29
30 unsigned long irq_mask;
31 unsigned long irq_edge_rise;
32 unsigned long irq_edge_fall;
33
34#ifdef CONFIG_PM
35 unsigned long saved_gplr;
36 unsigned long saved_gpdr;
37 unsigned long saved_grer;
38 unsigned long saved_gfer;
39#endif
40};
41
42static DEFINE_SPINLOCK(gpio_lock);
43static struct pxa_gpio_chip *pxa_gpio_chips;
44
45#define for_each_gpio_chip(i, c) \
46 for (i = 0, c = &pxa_gpio_chips[0]; i <= pxa_last_gpio; i += 32, c++)
47
48static inline void __iomem *gpio_chip_base(struct gpio_chip *c)
49{
50 return container_of(c, struct pxa_gpio_chip, chip)->regbase;
51}
52
53static inline struct pxa_gpio_chip *gpio_to_chip(unsigned gpio)
54{
55 return &pxa_gpio_chips[gpio_to_bank(gpio)];
56}
57
58static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
59{
60 void __iomem *base = gpio_chip_base(chip);
61 uint32_t value, mask = 1 << offset;
62 unsigned long flags;
63
64 spin_lock_irqsave(&gpio_lock, flags);
65
66 value = __raw_readl(base + GPDR_OFFSET);
67 if (__gpio_is_inverted(chip->base + offset))
68 value |= mask;
69 else
70 value &= ~mask;
71 __raw_writel(value, base + GPDR_OFFSET);
72
73 spin_unlock_irqrestore(&gpio_lock, flags);
74 return 0;
75}
76
77static int pxa_gpio_direction_output(struct gpio_chip *chip,
78 unsigned offset, int value)
79{
80 void __iomem *base = gpio_chip_base(chip);
81 uint32_t tmp, mask = 1 << offset;
82 unsigned long flags;
83
84 __raw_writel(mask, base + (value ? GPSR_OFFSET : GPCR_OFFSET));
85
86 spin_lock_irqsave(&gpio_lock, flags);
87
88 tmp = __raw_readl(base + GPDR_OFFSET);
89 if (__gpio_is_inverted(chip->base + offset))
90 tmp &= ~mask;
91 else
92 tmp |= mask;
93 __raw_writel(tmp, base + GPDR_OFFSET);
94
95 spin_unlock_irqrestore(&gpio_lock, flags);
96 return 0;
97}
98
99static int pxa_gpio_get(struct gpio_chip *chip, unsigned offset)
100{
101 return __raw_readl(gpio_chip_base(chip) + GPLR_OFFSET) & (1 << offset);
102}
103
104static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
105{
106 __raw_writel(1 << offset, gpio_chip_base(chip) +
107 (value ? GPSR_OFFSET : GPCR_OFFSET));
108}
109
110static int __init pxa_init_gpio_chip(int gpio_end)
111{
112 int i, gpio, nbanks = gpio_to_bank(gpio_end) + 1;
113 struct pxa_gpio_chip *chips;
114
115 /* this is early, we have to use bootmem allocator, and we really
116 * want this to be allocated dynamically for different 'gpio_end'
117 */
118 chips = alloc_bootmem_low(nbanks * sizeof(struct pxa_gpio_chip));
119 if (chips == NULL) {
120 pr_err("%s: failed to allocate GPIO chips\n", __func__);
121 return -ENOMEM;
122 }
123
124 for (i = 0, gpio = 0; i < nbanks; i++, gpio += 32) {
125 struct gpio_chip *c = &chips[i].chip;
126
127 sprintf(chips[i].label, "gpio-%d", i);
128 chips[i].regbase = (void __iomem *)GPIO_BANK(i);
129
130 c->base = gpio;
131 c->label = chips[i].label;
132
133 c->direction_input = pxa_gpio_direction_input;
134 c->direction_output = pxa_gpio_direction_output;
135 c->get = pxa_gpio_get;
136 c->set = pxa_gpio_set;
137
138 /* number of GPIOs on last bank may be less than 32 */
139 c->ngpio = (gpio + 31 > gpio_end) ? (gpio_end - gpio + 1) : 32;
140 gpiochip_add(c);
141 }
142 pxa_gpio_chips = chips;
143 return 0;
144}
145
146static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
147{
148 struct pxa_gpio_chip *c;
149 int gpio = irq_to_gpio(irq);
150 unsigned long gpdr, mask = GPIO_bit(gpio);
151
152 c = gpio_to_chip(gpio);
153
154 if (type == IRQ_TYPE_PROBE) {
155 /* Don't mess with enabled GPIOs using preconfigured edges or
156 * GPIOs set to alternate function or to output during probe
157 */
158 if ((c->irq_edge_rise | c->irq_edge_fall) & GPIO_bit(gpio))
159 return 0;
160
161 if (__gpio_is_occupied(gpio))
162 return 0;
163
164 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
165 }
166
167 gpdr = __raw_readl(c->regbase + GPDR_OFFSET);
168
169 if (__gpio_is_inverted(gpio))
170 __raw_writel(gpdr | mask, c->regbase + GPDR_OFFSET);
171 else
172 __raw_writel(gpdr & ~mask, c->regbase + GPDR_OFFSET);
173
174 if (type & IRQ_TYPE_EDGE_RISING)
175 c->irq_edge_rise |= mask;
176 else
177 c->irq_edge_rise &= ~mask;
178
179 if (type & IRQ_TYPE_EDGE_FALLING)
180 c->irq_edge_fall |= mask;
181 else
182 c->irq_edge_fall &= ~mask;
183
184 __raw_writel(c->irq_edge_rise & c->irq_mask, c->regbase + GRER_OFFSET);
185 __raw_writel(c->irq_edge_fall & c->irq_mask, c->regbase + GFER_OFFSET);
186
187 pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio,
188 ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""),
189 ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : ""));
190 return 0;
191}
192
193static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
194{
195 struct pxa_gpio_chip *c;
196 int loop, gpio, gpio_base, n;
197 unsigned long gedr;
198
199 do {
200 loop = 0;
201 for_each_gpio_chip(gpio, c) {
202 gpio_base = c->chip.base;
203
204 gedr = __raw_readl(c->regbase + GEDR_OFFSET);
205 gedr = gedr & c->irq_mask;
206 __raw_writel(gedr, c->regbase + GEDR_OFFSET);
207
208 n = find_first_bit(&gedr, BITS_PER_LONG);
209 while (n < BITS_PER_LONG) {
210 loop = 1;
211
212 generic_handle_irq(gpio_to_irq(gpio_base + n));
213 n = find_next_bit(&gedr, BITS_PER_LONG, n + 1);
214 }
215 }
216 } while (loop);
217}
218
219static void pxa_ack_muxed_gpio(unsigned int irq)
220{
221 int gpio = irq_to_gpio(irq);
222 struct pxa_gpio_chip *c = gpio_to_chip(gpio);
223
224 __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET);
225}
226
227static void pxa_mask_muxed_gpio(unsigned int irq)
228{
229 int gpio = irq_to_gpio(irq);
230 struct pxa_gpio_chip *c = gpio_to_chip(gpio);
231 uint32_t grer, gfer;
232
233 c->irq_mask &= ~GPIO_bit(gpio);
234
235 grer = __raw_readl(c->regbase + GRER_OFFSET) & ~GPIO_bit(gpio);
236 gfer = __raw_readl(c->regbase + GFER_OFFSET) & ~GPIO_bit(gpio);
237 __raw_writel(grer, c->regbase + GRER_OFFSET);
238 __raw_writel(gfer, c->regbase + GFER_OFFSET);
239}
240
241static void pxa_unmask_muxed_gpio(unsigned int irq)
242{
243 int gpio = irq_to_gpio(irq);
244 struct pxa_gpio_chip *c = gpio_to_chip(gpio);
245
246 c->irq_mask |= GPIO_bit(gpio);
247 __raw_writel(c->irq_edge_rise & c->irq_mask, c->regbase + GRER_OFFSET);
248 __raw_writel(c->irq_edge_fall & c->irq_mask, c->regbase + GFER_OFFSET);
249}
250
251static struct irq_chip pxa_muxed_gpio_chip = {
252 .name = "GPIO",
253 .ack = pxa_ack_muxed_gpio,
254 .mask = pxa_mask_muxed_gpio,
255 .unmask = pxa_unmask_muxed_gpio,
256 .set_type = pxa_gpio_irq_type,
257};
258
259void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn)
260{
261 struct pxa_gpio_chip *c;
262 int gpio, irq;
263
264 pxa_last_gpio = end;
265
266 /* Initialize GPIO chips */
267 pxa_init_gpio_chip(end);
268
269 /* clear all GPIO edge detects */
270 for_each_gpio_chip(gpio, c) {
271 __raw_writel(0, c->regbase + GFER_OFFSET);
272 __raw_writel(0, c->regbase + GRER_OFFSET);
273 __raw_writel(~0,c->regbase + GEDR_OFFSET);
274 }
275
276 for (irq = gpio_to_irq(start); irq <= gpio_to_irq(end); irq++) {
277 set_irq_chip(irq, &pxa_muxed_gpio_chip);
278 set_irq_handler(irq, handle_edge_irq);
279 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
280 }
281
282 /* Install handler for GPIO>=2 edge detect interrupts */
283 set_irq_chained_handler(mux_irq, pxa_gpio_demux_handler);
284 pxa_muxed_gpio_chip.set_wake = fn;
285}
286
287#ifdef CONFIG_PM
288static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
289{
290 struct pxa_gpio_chip *c;
291 int gpio;
292
293 for_each_gpio_chip(gpio, c) {
294 c->saved_gplr = __raw_readl(c->regbase + GPLR_OFFSET);
295 c->saved_gpdr = __raw_readl(c->regbase + GPDR_OFFSET);
296 c->saved_grer = __raw_readl(c->regbase + GRER_OFFSET);
297 c->saved_gfer = __raw_readl(c->regbase + GFER_OFFSET);
298
299 /* Clear GPIO transition detect bits */
300 __raw_writel(0xffffffff, c->regbase + GEDR_OFFSET);
301 }
302 return 0;
303}
304
305static int pxa_gpio_resume(struct sys_device *dev)
306{
307 struct pxa_gpio_chip *c;
308 int gpio;
309
310 for_each_gpio_chip(gpio, c) {
311 /* restore level with set/clear */
312 __raw_writel( c->saved_gplr, c->regbase + GPSR_OFFSET);
313 __raw_writel(~c->saved_gplr, c->regbase + GPCR_OFFSET);
314
315 __raw_writel(c->saved_grer, c->regbase + GRER_OFFSET);
316 __raw_writel(c->saved_gfer, c->regbase + GFER_OFFSET);
317 __raw_writel(c->saved_gpdr, c->regbase + GPDR_OFFSET);
318 }
319 return 0;
320}
321#else
322#define pxa_gpio_suspend NULL
323#define pxa_gpio_resume NULL
324#endif
325
326struct sysdev_class pxa_gpio_sysclass = {
327 .name = "gpio",
328 .suspend = pxa_gpio_suspend,
329 .resume = pxa_gpio_resume,
330};
331
332static int __init pxa_gpio_init(void)
333{
334 return sysdev_class_register(&pxa_gpio_sysclass);
335}
336
337core_initcall(pxa_gpio_init);
diff --git a/arch/arm/plat-pxa/include/plat/dma.h b/arch/arm/plat-pxa/include/plat/dma.h
new file mode 100644
index 000000000000..a7b91dc06852
--- /dev/null
+++ b/arch/arm/plat-pxa/include/plat/dma.h
@@ -0,0 +1,85 @@
1#ifndef __PLAT_DMA_H
2#define __PLAT_DMA_H
3
4#define DMAC_REG(x) (*((volatile u32 *)(DMAC_REGS_VIRT + (x))))
5
6#define DCSR(n) DMAC_REG((n) << 2)
7#define DALGN DMAC_REG(0x00a0) /* DMA Alignment Register */
8#define DINT DMAC_REG(0x00f0) /* DMA Interrupt Register */
9#define DDADR(n) DMAC_REG(0x0200 + ((n) << 4))
10#define DSADR(n) DMAC_REG(0x0204 + ((n) << 4))
11#define DTADR(n) DMAC_REG(0x0208 + ((n) << 4))
12#define DCMD(n) DMAC_REG(0x020c + ((n) << 4))
13#define DRCMR(n) DMAC_REG((((n) < 64) ? 0x0100 : 0x1100) + \
14 (((n) & 0x3f) << 2))
15
16#define DCSR_RUN (1 << 31) /* Run Bit (read / write) */
17#define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch (read / write) */
18#define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */
19#define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */
20#define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */
21#define DCSR_ENDINTR (1 << 2) /* End Interrupt (read / write) */
22#define DCSR_STARTINTR (1 << 1) /* Start Interrupt (read / write) */
23#define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt (read / write) */
24
25#define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */
26#define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */
27#define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */
28#define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */
29#define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */
30#define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */
31#define DCSR_EORINTR (1 << 9) /* The end of Receive */
32
33#define DRCMR_MAPVLD (1 << 7) /* Map Valid (read / write) */
34#define DRCMR_CHLNUM 0x1f /* mask for Channel Number (read / write) */
35
36#define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor (mask) */
37#define DDADR_STOP (1 << 0) /* Stop (read / write) */
38
39#define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */
40#define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */
41#define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */
42#define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */
43#define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */
44#define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */
45#define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */
46#define DCMD_BURST8 (1 << 16) /* 8 byte burst */
47#define DCMD_BURST16 (2 << 16) /* 16 byte burst */
48#define DCMD_BURST32 (3 << 16) /* 32 byte burst */
49#define DCMD_WIDTH1 (1 << 14) /* 1 byte width */
50#define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */
51#define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */
52#define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
53
54/*
55 * Descriptor structure for PXA's DMA engine
56 * Note: this structure must always be aligned to a 16-byte boundary.
57 */
58
59typedef struct pxa_dma_desc {
60 volatile u32 ddadr; /* Points to the next descriptor + flags */
61 volatile u32 dsadr; /* DSADR value for the current transfer */
62 volatile u32 dtadr; /* DTADR value for the current transfer */
63 volatile u32 dcmd; /* DCMD value for the current transfer */
64} pxa_dma_desc;
65
66typedef enum {
67 DMA_PRIO_HIGH = 0,
68 DMA_PRIO_MEDIUM = 1,
69 DMA_PRIO_LOW = 2
70} pxa_dma_prio;
71
72/*
73 * DMA registration
74 */
75
76int __init pxa_init_dma(int irq, int num_ch);
77
78int pxa_request_dma (char *name,
79 pxa_dma_prio prio,
80 void (*irq_handler)(int, void *),
81 void *data);
82
83void pxa_free_dma (int dma_ch);
84
85#endif /* __PLAT_DMA_H */
diff --git a/arch/arm/plat-pxa/include/plat/gpio.h b/arch/arm/plat-pxa/include/plat/gpio.h
new file mode 100644
index 000000000000..44248cb926a5
--- /dev/null
+++ b/arch/arm/plat-pxa/include/plat/gpio.h
@@ -0,0 +1,62 @@
1#ifndef __PLAT_GPIO_H
2#define __PLAT_GPIO_H
3
4/*
5 * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with
6 * one set of registers. The register offsets are organized below:
7 *
8 * GPLR GPDR GPSR GPCR GRER GFER GEDR
9 * BANK 0 - 0x0000 0x000C 0x0018 0x0024 0x0030 0x003C 0x0048
10 * BANK 1 - 0x0004 0x0010 0x001C 0x0028 0x0034 0x0040 0x004C
11 * BANK 2 - 0x0008 0x0014 0x0020 0x002C 0x0038 0x0044 0x0050
12 *
13 * BANK 3 - 0x0100 0x010C 0x0118 0x0124 0x0130 0x013C 0x0148
14 * BANK 4 - 0x0104 0x0110 0x011C 0x0128 0x0134 0x0140 0x014C
15 * BANK 5 - 0x0108 0x0114 0x0120 0x012C 0x0138 0x0144 0x0150
16 *
17 * NOTE:
18 * BANK 3 is only available on PXA27x and later processors.
19 * BANK 4 and 5 are only available on PXA935
20 */
21
22#define GPIO_BANK(n) (GPIO_REGS_VIRT + BANK_OFF(n))
23
24#define GPLR_OFFSET 0x00
25#define GPDR_OFFSET 0x0C
26#define GPSR_OFFSET 0x18
27#define GPCR_OFFSET 0x24
28#define GRER_OFFSET 0x30
29#define GFER_OFFSET 0x3C
30#define GEDR_OFFSET 0x48
31
32static inline int gpio_get_value(unsigned gpio)
33{
34 if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO))
35 return GPLR(gpio) & GPIO_bit(gpio);
36 else
37 return __gpio_get_value(gpio);
38}
39
40static inline void gpio_set_value(unsigned gpio, int value)
41{
42 if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) {
43 if (value)
44 GPSR(gpio) = GPIO_bit(gpio);
45 else
46 GPCR(gpio) = GPIO_bit(gpio);
47 } else
48 __gpio_set_value(gpio, value);
49}
50
51#define gpio_cansleep __gpio_cansleep
52
53/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
54 * Those cases currently cause holes in the GPIO number space, the
55 * actual number of the last GPIO is recorded by 'pxa_last_gpio'.
56 */
57extern int pxa_last_gpio;
58
59typedef int (*set_wake_t)(unsigned int irq, unsigned int on);
60
61extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn);
62#endif /* __PLAT_GPIO_H */
diff --git a/arch/arm/plat-pxa/include/plat/mfp.h b/arch/arm/plat-pxa/include/plat/mfp.h
new file mode 100644
index 000000000000..64019464c8db
--- /dev/null
+++ b/arch/arm/plat-pxa/include/plat/mfp.h
@@ -0,0 +1,399 @@
1/*
2 * arch/arm/plat-pxa/include/plat/mfp.h
3 *
4 * Common Multi-Function Pin Definitions
5 *
6 * Copyright (C) 2007 Marvell International Ltd.
7 *
8 * 2007-8-21: eric miao <eric.miao@marvell.com>
9 * initial version
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#ifndef __ASM_PLAT_MFP_H
17#define __ASM_PLAT_MFP_H
18
19#define mfp_to_gpio(m) ((m) % 128)
20
21/* list of all the configurable MFP pins */
22enum {
23 MFP_PIN_INVALID = -1,
24
25 MFP_PIN_GPIO0 = 0,
26 MFP_PIN_GPIO1,
27 MFP_PIN_GPIO2,
28 MFP_PIN_GPIO3,
29 MFP_PIN_GPIO4,
30 MFP_PIN_GPIO5,
31 MFP_PIN_GPIO6,
32 MFP_PIN_GPIO7,
33 MFP_PIN_GPIO8,
34 MFP_PIN_GPIO9,
35 MFP_PIN_GPIO10,
36 MFP_PIN_GPIO11,
37 MFP_PIN_GPIO12,
38 MFP_PIN_GPIO13,
39 MFP_PIN_GPIO14,
40 MFP_PIN_GPIO15,
41 MFP_PIN_GPIO16,
42 MFP_PIN_GPIO17,
43 MFP_PIN_GPIO18,
44 MFP_PIN_GPIO19,
45 MFP_PIN_GPIO20,
46 MFP_PIN_GPIO21,
47 MFP_PIN_GPIO22,
48 MFP_PIN_GPIO23,
49 MFP_PIN_GPIO24,
50 MFP_PIN_GPIO25,
51 MFP_PIN_GPIO26,
52 MFP_PIN_GPIO27,
53 MFP_PIN_GPIO28,
54 MFP_PIN_GPIO29,
55 MFP_PIN_GPIO30,
56 MFP_PIN_GPIO31,
57 MFP_PIN_GPIO32,
58 MFP_PIN_GPIO33,
59 MFP_PIN_GPIO34,
60 MFP_PIN_GPIO35,
61 MFP_PIN_GPIO36,
62 MFP_PIN_GPIO37,
63 MFP_PIN_GPIO38,
64 MFP_PIN_GPIO39,
65 MFP_PIN_GPIO40,
66 MFP_PIN_GPIO41,
67 MFP_PIN_GPIO42,
68 MFP_PIN_GPIO43,
69 MFP_PIN_GPIO44,
70 MFP_PIN_GPIO45,
71 MFP_PIN_GPIO46,
72 MFP_PIN_GPIO47,
73 MFP_PIN_GPIO48,
74 MFP_PIN_GPIO49,
75 MFP_PIN_GPIO50,
76 MFP_PIN_GPIO51,
77 MFP_PIN_GPIO52,
78 MFP_PIN_GPIO53,
79 MFP_PIN_GPIO54,
80 MFP_PIN_GPIO55,
81 MFP_PIN_GPIO56,
82 MFP_PIN_GPIO57,
83 MFP_PIN_GPIO58,
84 MFP_PIN_GPIO59,
85 MFP_PIN_GPIO60,
86 MFP_PIN_GPIO61,
87 MFP_PIN_GPIO62,
88 MFP_PIN_GPIO63,
89 MFP_PIN_GPIO64,
90 MFP_PIN_GPIO65,
91 MFP_PIN_GPIO66,
92 MFP_PIN_GPIO67,
93 MFP_PIN_GPIO68,
94 MFP_PIN_GPIO69,
95 MFP_PIN_GPIO70,
96 MFP_PIN_GPIO71,
97 MFP_PIN_GPIO72,
98 MFP_PIN_GPIO73,
99 MFP_PIN_GPIO74,
100 MFP_PIN_GPIO75,
101 MFP_PIN_GPIO76,
102 MFP_PIN_GPIO77,
103 MFP_PIN_GPIO78,
104 MFP_PIN_GPIO79,
105 MFP_PIN_GPIO80,
106 MFP_PIN_GPIO81,
107 MFP_PIN_GPIO82,
108 MFP_PIN_GPIO83,
109 MFP_PIN_GPIO84,
110 MFP_PIN_GPIO85,
111 MFP_PIN_GPIO86,
112 MFP_PIN_GPIO87,
113 MFP_PIN_GPIO88,
114 MFP_PIN_GPIO89,
115 MFP_PIN_GPIO90,
116 MFP_PIN_GPIO91,
117 MFP_PIN_GPIO92,
118 MFP_PIN_GPIO93,
119 MFP_PIN_GPIO94,
120 MFP_PIN_GPIO95,
121 MFP_PIN_GPIO96,
122 MFP_PIN_GPIO97,
123 MFP_PIN_GPIO98,
124 MFP_PIN_GPIO99,
125 MFP_PIN_GPIO100,
126 MFP_PIN_GPIO101,
127 MFP_PIN_GPIO102,
128 MFP_PIN_GPIO103,
129 MFP_PIN_GPIO104,
130 MFP_PIN_GPIO105,
131 MFP_PIN_GPIO106,
132 MFP_PIN_GPIO107,
133 MFP_PIN_GPIO108,
134 MFP_PIN_GPIO109,
135 MFP_PIN_GPIO110,
136 MFP_PIN_GPIO111,
137 MFP_PIN_GPIO112,
138 MFP_PIN_GPIO113,
139 MFP_PIN_GPIO114,
140 MFP_PIN_GPIO115,
141 MFP_PIN_GPIO116,
142 MFP_PIN_GPIO117,
143 MFP_PIN_GPIO118,
144 MFP_PIN_GPIO119,
145 MFP_PIN_GPIO120,
146 MFP_PIN_GPIO121,
147 MFP_PIN_GPIO122,
148 MFP_PIN_GPIO123,
149 MFP_PIN_GPIO124,
150 MFP_PIN_GPIO125,
151 MFP_PIN_GPIO126,
152 MFP_PIN_GPIO127,
153 MFP_PIN_GPIO0_2,
154 MFP_PIN_GPIO1_2,
155 MFP_PIN_GPIO2_2,
156 MFP_PIN_GPIO3_2,
157 MFP_PIN_GPIO4_2,
158 MFP_PIN_GPIO5_2,
159 MFP_PIN_GPIO6_2,
160 MFP_PIN_GPIO7_2,
161 MFP_PIN_GPIO8_2,
162 MFP_PIN_GPIO9_2,
163 MFP_PIN_GPIO10_2,
164 MFP_PIN_GPIO11_2,
165 MFP_PIN_GPIO12_2,
166 MFP_PIN_GPIO13_2,
167 MFP_PIN_GPIO14_2,
168 MFP_PIN_GPIO15_2,
169 MFP_PIN_GPIO16_2,
170 MFP_PIN_GPIO17_2,
171
172 MFP_PIN_ULPI_STP,
173 MFP_PIN_ULPI_NXT,
174 MFP_PIN_ULPI_DIR,
175
176 MFP_PIN_nXCVREN,
177 MFP_PIN_DF_CLE_nOE,
178 MFP_PIN_DF_nADV1_ALE,
179 MFP_PIN_DF_SCLK_E,
180 MFP_PIN_DF_SCLK_S,
181 MFP_PIN_nBE0,
182 MFP_PIN_nBE1,
183 MFP_PIN_DF_nADV2_ALE,
184 MFP_PIN_DF_INT_RnB,
185 MFP_PIN_DF_nCS0,
186 MFP_PIN_DF_nCS1,
187 MFP_PIN_nLUA,
188 MFP_PIN_nLLA,
189 MFP_PIN_DF_nWE,
190 MFP_PIN_DF_ALE_nWE,
191 MFP_PIN_DF_nRE_nOE,
192 MFP_PIN_DF_ADDR0,
193 MFP_PIN_DF_ADDR1,
194 MFP_PIN_DF_ADDR2,
195 MFP_PIN_DF_ADDR3,
196 MFP_PIN_DF_IO0,
197 MFP_PIN_DF_IO1,
198 MFP_PIN_DF_IO2,
199 MFP_PIN_DF_IO3,
200 MFP_PIN_DF_IO4,
201 MFP_PIN_DF_IO5,
202 MFP_PIN_DF_IO6,
203 MFP_PIN_DF_IO7,
204 MFP_PIN_DF_IO8,
205 MFP_PIN_DF_IO9,
206 MFP_PIN_DF_IO10,
207 MFP_PIN_DF_IO11,
208 MFP_PIN_DF_IO12,
209 MFP_PIN_DF_IO13,
210 MFP_PIN_DF_IO14,
211 MFP_PIN_DF_IO15,
212 MFP_PIN_DF_nCS0_SM_nCS2,
213 MFP_PIN_DF_nCS1_SM_nCS3,
214 MFP_PIN_SM_nCS0,
215 MFP_PIN_SM_nCS1,
216 MFP_PIN_DF_WEn,
217 MFP_PIN_DF_REn,
218 MFP_PIN_DF_CLE_SM_OEn,
219 MFP_PIN_DF_ALE_SM_WEn,
220 MFP_PIN_DF_RDY0,
221 MFP_PIN_DF_RDY1,
222
223 MFP_PIN_SM_SCLK,
224 MFP_PIN_SM_BE0,
225 MFP_PIN_SM_BE1,
226 MFP_PIN_SM_ADV,
227 MFP_PIN_SM_ADVMUX,
228 MFP_PIN_SM_RDY,
229
230 MFP_PIN_MMC1_DAT7,
231 MFP_PIN_MMC1_DAT6,
232 MFP_PIN_MMC1_DAT5,
233 MFP_PIN_MMC1_DAT4,
234 MFP_PIN_MMC1_DAT3,
235 MFP_PIN_MMC1_DAT2,
236 MFP_PIN_MMC1_DAT1,
237 MFP_PIN_MMC1_DAT0,
238 MFP_PIN_MMC1_CMD,
239 MFP_PIN_MMC1_CLK,
240 MFP_PIN_MMC1_CD,
241 MFP_PIN_MMC1_WP,
242
243 /* additional pins on PXA930 */
244 MFP_PIN_GSIM_UIO,
245 MFP_PIN_GSIM_UCLK,
246 MFP_PIN_GSIM_UDET,
247 MFP_PIN_GSIM_nURST,
248 MFP_PIN_PMIC_INT,
249 MFP_PIN_RDY,
250
251 MFP_PIN_MAX,
252};
253
254/*
255 * a possible MFP configuration is represented by a 32-bit integer
256 *
257 * bit 0.. 9 - MFP Pin Number (1024 Pins Maximum)
258 * bit 10..12 - Alternate Function Selection
259 * bit 13..15 - Drive Strength
260 * bit 16..18 - Low Power Mode State
261 * bit 19..20 - Low Power Mode Edge Detection
262 * bit 21..22 - Run Mode Pull State
263 *
264 * to facilitate the definition, the following macros are provided
265 *
266 * MFP_CFG_DEFAULT - default MFP configuration value, with
267 * alternate function = 0,
268 * drive strength = fast 3mA (MFP_DS03X)
269 * low power mode = default
270 * edge detection = none
271 *
272 * MFP_CFG - default MFPR value with alternate function
273 * MFP_CFG_DRV - default MFPR value with alternate function and
274 * pin drive strength
275 * MFP_CFG_LPM - default MFPR value with alternate function and
276 * low power mode
277 * MFP_CFG_X - default MFPR value with alternate function,
278 * pin drive strength and low power mode
279 */
280
281typedef unsigned long mfp_cfg_t;
282
283#define MFP_PIN(x) ((x) & 0x3ff)
284
285#define MFP_AF0 (0x0 << 10)
286#define MFP_AF1 (0x1 << 10)
287#define MFP_AF2 (0x2 << 10)
288#define MFP_AF3 (0x3 << 10)
289#define MFP_AF4 (0x4 << 10)
290#define MFP_AF5 (0x5 << 10)
291#define MFP_AF6 (0x6 << 10)
292#define MFP_AF7 (0x7 << 10)
293#define MFP_AF_MASK (0x7 << 10)
294#define MFP_AF(x) (((x) >> 10) & 0x7)
295
296#define MFP_DS01X (0x0 << 13)
297#define MFP_DS02X (0x1 << 13)
298#define MFP_DS03X (0x2 << 13)
299#define MFP_DS04X (0x3 << 13)
300#define MFP_DS06X (0x4 << 13)
301#define MFP_DS08X (0x5 << 13)
302#define MFP_DS10X (0x6 << 13)
303#define MFP_DS13X (0x7 << 13)
304#define MFP_DS_MASK (0x7 << 13)
305#define MFP_DS(x) (((x) >> 13) & 0x7)
306
307#define MFP_LPM_DEFAULT (0x0 << 16)
308#define MFP_LPM_DRIVE_LOW (0x1 << 16)
309#define MFP_LPM_DRIVE_HIGH (0x2 << 16)
310#define MFP_LPM_PULL_LOW (0x3 << 16)
311#define MFP_LPM_PULL_HIGH (0x4 << 16)
312#define MFP_LPM_FLOAT (0x5 << 16)
313#define MFP_LPM_INPUT (0x6 << 16)
314#define MFP_LPM_STATE_MASK (0x7 << 16)
315#define MFP_LPM_STATE(x) (((x) >> 16) & 0x7)
316
317#define MFP_LPM_EDGE_NONE (0x0 << 19)
318#define MFP_LPM_EDGE_RISE (0x1 << 19)
319#define MFP_LPM_EDGE_FALL (0x2 << 19)
320#define MFP_LPM_EDGE_BOTH (0x3 << 19)
321#define MFP_LPM_EDGE_MASK (0x3 << 19)
322#define MFP_LPM_EDGE(x) (((x) >> 19) & 0x3)
323
324#define MFP_PULL_NONE (0x0 << 21)
325#define MFP_PULL_LOW (0x1 << 21)
326#define MFP_PULL_HIGH (0x2 << 21)
327#define MFP_PULL_BOTH (0x3 << 21)
328#define MFP_PULL_MASK (0x3 << 21)
329#define MFP_PULL(x) (((x) >> 21) & 0x3)
330
331#define MFP_CFG_DEFAULT (MFP_AF0 | MFP_DS03X | MFP_LPM_DEFAULT |\
332 MFP_LPM_EDGE_NONE | MFP_PULL_NONE)
333
334#define MFP_CFG(pin, af) \
335 ((MFP_CFG_DEFAULT & ~MFP_AF_MASK) |\
336 (MFP_PIN(MFP_PIN_##pin) | MFP_##af))
337
338#define MFP_CFG_DRV(pin, af, drv) \
339 ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK)) |\
340 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv))
341
342#define MFP_CFG_LPM(pin, af, lpm) \
343 ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_LPM_STATE_MASK)) |\
344 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_LPM_##lpm))
345
346#define MFP_CFG_X(pin, af, drv, lpm) \
347 ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\
348 (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm))
349
350#if defined(CONFIG_PXA3xx) || defined(CONFIG_ARCH_MMP)
351/*
352 * each MFP pin will have a MFPR register, since the offset of the
353 * register varies between processors, the processor specific code
354 * should initialize the pin offsets by mfp_init()
355 *
356 * mfp_init_base() - accepts a virtual base for all MFPR registers and
357 * initialize the MFP table to a default state
358 *
359 * mfp_init_addr() - accepts a table of "mfp_addr_map" structure, which
360 * represents a range of MFP pins from "start" to "end", with the offset
361 * begining at "offset", to define a single pin, let "end" = -1.
362 *
363 * use
364 *
365 * MFP_ADDR_X() to define a range of pins
366 * MFP_ADDR() to define a single pin
367 * MFP_ADDR_END to signal the end of pin offset definitions
368 */
369struct mfp_addr_map {
370 unsigned int start;
371 unsigned int end;
372 unsigned long offset;
373};
374
375#define MFP_ADDR_X(start, end, offset) \
376 { MFP_PIN_##start, MFP_PIN_##end, offset }
377
378#define MFP_ADDR(pin, offset) \
379 { MFP_PIN_##pin, -1, offset }
380
381#define MFP_ADDR_END { MFP_PIN_INVALID, 0 }
382
383void __init mfp_init_base(unsigned long mfpr_base);
384void __init mfp_init_addr(struct mfp_addr_map *map);
385
386/*
387 * mfp_{read, write}() - for direct read/write access to the MFPR register
388 * mfp_config() - for configuring a group of MFPR registers
389 * mfp_config_lpm() - configuring all low power MFPR registers for suspend
390 * mfp_config_run() - configuring all run time MFPR registers after resume
391 */
392unsigned long mfp_read(int mfp);
393void mfp_write(int mfp, unsigned long mfpr_val);
394void mfp_config(unsigned long *mfp_cfgs, int num);
395void mfp_config_run(void);
396void mfp_config_lpm(void);
397#endif /* CONFIG_PXA3xx || CONFIG_ARCH_MMP */
398
399#endif /* __ASM_PLAT_MFP_H */
diff --git a/arch/arm/plat-pxa/mfp.c b/arch/arm/plat-pxa/mfp.c
new file mode 100644
index 000000000000..e716c622a17c
--- /dev/null
+++ b/arch/arm/plat-pxa/mfp.c
@@ -0,0 +1,278 @@
1/*
2 * linux/arch/arm/plat-pxa/mfp.c
3 *
4 * Multi-Function Pin Support
5 *
6 * Copyright (C) 2007 Marvell Internation Ltd.
7 *
8 * 2007-08-21: eric miao <eric.miao@marvell.com>
9 * initial version
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/module.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/io.h>
20#include <linux/sysdev.h>
21
22#include <plat/mfp.h>
23
24#define MFPR_SIZE (PAGE_SIZE)
25
26/* MFPR register bit definitions */
27#define MFPR_PULL_SEL (0x1 << 15)
28#define MFPR_PULLUP_EN (0x1 << 14)
29#define MFPR_PULLDOWN_EN (0x1 << 13)
30#define MFPR_SLEEP_SEL (0x1 << 9)
31#define MFPR_SLEEP_OE_N (0x1 << 7)
32#define MFPR_EDGE_CLEAR (0x1 << 6)
33#define MFPR_EDGE_FALL_EN (0x1 << 5)
34#define MFPR_EDGE_RISE_EN (0x1 << 4)
35
36#define MFPR_SLEEP_DATA(x) ((x) << 8)
37#define MFPR_DRIVE(x) (((x) & 0x7) << 10)
38#define MFPR_AF_SEL(x) (((x) & 0x7) << 0)
39
40#define MFPR_EDGE_NONE (0)
41#define MFPR_EDGE_RISE (MFPR_EDGE_RISE_EN)
42#define MFPR_EDGE_FALL (MFPR_EDGE_FALL_EN)
43#define MFPR_EDGE_BOTH (MFPR_EDGE_RISE | MFPR_EDGE_FALL)
44
45/*
46 * Table that determines the low power modes outputs, with actual settings
47 * used in parentheses for don't-care values. Except for the float output,
48 * the configured driven and pulled levels match, so if there is a need for
49 * non-LPM pulled output, the same configuration could probably be used.
50 *
51 * Output value sleep_oe_n sleep_data pullup_en pulldown_en pull_sel
52 * (bit 7) (bit 8) (bit 14) (bit 13) (bit 15)
53 *
54 * Input 0 X(0) X(0) X(0) 0
55 * Drive 0 0 0 0 X(1) 0
56 * Drive 1 0 1 X(1) 0 0
57 * Pull hi (1) 1 X(1) 1 0 0
58 * Pull lo (0) 1 X(0) 0 1 0
59 * Z (float) 1 X(0) 0 0 0
60 */
61#define MFPR_LPM_INPUT (0)
62#define MFPR_LPM_DRIVE_LOW (MFPR_SLEEP_DATA(0) | MFPR_PULLDOWN_EN)
63#define MFPR_LPM_DRIVE_HIGH (MFPR_SLEEP_DATA(1) | MFPR_PULLUP_EN)
64#define MFPR_LPM_PULL_LOW (MFPR_LPM_DRIVE_LOW | MFPR_SLEEP_OE_N)
65#define MFPR_LPM_PULL_HIGH (MFPR_LPM_DRIVE_HIGH | MFPR_SLEEP_OE_N)
66#define MFPR_LPM_FLOAT (MFPR_SLEEP_OE_N)
67#define MFPR_LPM_MASK (0xe080)
68
69/*
70 * The pullup and pulldown state of the MFP pin at run mode is by default
71 * determined by the selected alternate function. In case that some buggy
72 * devices need to override this default behavior, the definitions below
73 * indicates the setting of corresponding MFPR bits
74 *
75 * Definition pull_sel pullup_en pulldown_en
76 * MFPR_PULL_NONE 0 0 0
77 * MFPR_PULL_LOW 1 0 1
78 * MFPR_PULL_HIGH 1 1 0
79 * MFPR_PULL_BOTH 1 1 1
80 */
81#define MFPR_PULL_NONE (0)
82#define MFPR_PULL_LOW (MFPR_PULL_SEL | MFPR_PULLDOWN_EN)
83#define MFPR_PULL_BOTH (MFPR_PULL_LOW | MFPR_PULLUP_EN)
84#define MFPR_PULL_HIGH (MFPR_PULL_SEL | MFPR_PULLUP_EN)
85
86/* mfp_spin_lock is used to ensure that MFP register configuration
87 * (most likely a read-modify-write operation) is atomic, and that
88 * mfp_table[] is consistent
89 */
90static DEFINE_SPINLOCK(mfp_spin_lock);
91
92static void __iomem *mfpr_mmio_base;
93
94struct mfp_pin {
95 unsigned long config; /* -1 for not configured */
96 unsigned long mfpr_off; /* MFPRxx Register offset */
97 unsigned long mfpr_run; /* Run-Mode Register Value */
98 unsigned long mfpr_lpm; /* Low Power Mode Register Value */
99};
100
101static struct mfp_pin mfp_table[MFP_PIN_MAX];
102
103/* mapping of MFP_LPM_* definitions to MFPR_LPM_* register bits */
104static const unsigned long mfpr_lpm[] = {
105 MFPR_LPM_INPUT,
106 MFPR_LPM_DRIVE_LOW,
107 MFPR_LPM_DRIVE_HIGH,
108 MFPR_LPM_PULL_LOW,
109 MFPR_LPM_PULL_HIGH,
110 MFPR_LPM_FLOAT,
111};
112
113/* mapping of MFP_PULL_* definitions to MFPR_PULL_* register bits */
114static const unsigned long mfpr_pull[] = {
115 MFPR_PULL_NONE,
116 MFPR_PULL_LOW,
117 MFPR_PULL_HIGH,
118 MFPR_PULL_BOTH,
119};
120
121/* mapping of MFP_LPM_EDGE_* definitions to MFPR_EDGE_* register bits */
122static const unsigned long mfpr_edge[] = {
123 MFPR_EDGE_NONE,
124 MFPR_EDGE_RISE,
125 MFPR_EDGE_FALL,
126 MFPR_EDGE_BOTH,
127};
128
129#define mfpr_readl(off) \
130 __raw_readl(mfpr_mmio_base + (off))
131
132#define mfpr_writel(off, val) \
133 __raw_writel(val, mfpr_mmio_base + (off))
134
135#define mfp_configured(p) ((p)->config != -1)
136
137/*
138 * perform a read-back of any MFPR register to make sure the
139 * previous writings are finished
140 */
141#define mfpr_sync() (void)__raw_readl(mfpr_mmio_base + 0)
142
143static inline void __mfp_config_run(struct mfp_pin *p)
144{
145 if (mfp_configured(p))
146 mfpr_writel(p->mfpr_off, p->mfpr_run);
147}
148
149static inline void __mfp_config_lpm(struct mfp_pin *p)
150{
151 if (mfp_configured(p)) {
152 unsigned long mfpr_clr = (p->mfpr_run & ~MFPR_EDGE_BOTH) | MFPR_EDGE_CLEAR;
153 if (mfpr_clr != p->mfpr_run)
154 mfpr_writel(p->mfpr_off, mfpr_clr);
155 if (p->mfpr_lpm != mfpr_clr)
156 mfpr_writel(p->mfpr_off, p->mfpr_lpm);
157 }
158}
159
160void mfp_config(unsigned long *mfp_cfgs, int num)
161{
162 unsigned long flags;
163 int i;
164
165 spin_lock_irqsave(&mfp_spin_lock, flags);
166
167 for (i = 0; i < num; i++, mfp_cfgs++) {
168 unsigned long tmp, c = *mfp_cfgs;
169 struct mfp_pin *p;
170 int pin, af, drv, lpm, edge, pull;
171
172 pin = MFP_PIN(c);
173 BUG_ON(pin >= MFP_PIN_MAX);
174 p = &mfp_table[pin];
175
176 af = MFP_AF(c);
177 drv = MFP_DS(c);
178 lpm = MFP_LPM_STATE(c);
179 edge = MFP_LPM_EDGE(c);
180 pull = MFP_PULL(c);
181
182 /* run-mode pull settings will conflict with MFPR bits of
183 * low power mode state, calculate mfpr_run and mfpr_lpm
184 * individually if pull != MFP_PULL_NONE
185 */
186 tmp = MFPR_AF_SEL(af) | MFPR_DRIVE(drv);
187
188 if (likely(pull == MFP_PULL_NONE)) {
189 p->mfpr_run = tmp | mfpr_lpm[lpm] | mfpr_edge[edge];
190 p->mfpr_lpm = p->mfpr_run;
191 } else {
192 p->mfpr_lpm = tmp | mfpr_lpm[lpm] | mfpr_edge[edge];
193 p->mfpr_run = tmp | mfpr_pull[pull];
194 }
195
196 p->config = c; __mfp_config_run(p);
197 }
198
199 mfpr_sync();
200 spin_unlock_irqrestore(&mfp_spin_lock, flags);
201}
202
203unsigned long mfp_read(int mfp)
204{
205 unsigned long val, flags;
206
207 BUG_ON(mfp >= MFP_PIN_MAX);
208
209 spin_lock_irqsave(&mfp_spin_lock, flags);
210 val = mfpr_readl(mfp_table[mfp].mfpr_off);
211 spin_unlock_irqrestore(&mfp_spin_lock, flags);
212
213 return val;
214}
215
216void mfp_write(int mfp, unsigned long val)
217{
218 unsigned long flags;
219
220 BUG_ON(mfp >= MFP_PIN_MAX);
221
222 spin_lock_irqsave(&mfp_spin_lock, flags);
223 mfpr_writel(mfp_table[mfp].mfpr_off, val);
224 mfpr_sync();
225 spin_unlock_irqrestore(&mfp_spin_lock, flags);
226}
227
228void __init mfp_init_base(unsigned long mfpr_base)
229{
230 int i;
231
232 /* initialize the table with default - unconfigured */
233 for (i = 0; i < ARRAY_SIZE(mfp_table); i++)
234 mfp_table[i].config = -1;
235
236 mfpr_mmio_base = (void __iomem *)mfpr_base;
237}
238
239void __init mfp_init_addr(struct mfp_addr_map *map)
240{
241 struct mfp_addr_map *p;
242 unsigned long offset, flags;
243 int i;
244
245 spin_lock_irqsave(&mfp_spin_lock, flags);
246
247 for (p = map; p->start != MFP_PIN_INVALID; p++) {
248 offset = p->offset;
249 i = p->start;
250
251 do {
252 mfp_table[i].mfpr_off = offset;
253 mfp_table[i].mfpr_run = 0;
254 mfp_table[i].mfpr_lpm = 0;
255 offset += 4; i++;
256 } while ((i <= p->end) && (p->end != -1));
257 }
258
259 spin_unlock_irqrestore(&mfp_spin_lock, flags);
260}
261
262void mfp_config_lpm(void)
263{
264 struct mfp_pin *p = &mfp_table[0];
265 int pin;
266
267 for (pin = 0; pin < ARRAY_SIZE(mfp_table); pin++, p++)
268 __mfp_config_lpm(p);
269}
270
271void mfp_config_run(void)
272{
273 struct mfp_pin *p = &mfp_table[0];
274 int pin;
275
276 for (pin = 0; pin < ARRAY_SIZE(mfp_table); pin++, p++)
277 __mfp_config_run(p);
278}
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
index 39195f972d5e..8d7815d25a51 100644
--- a/arch/arm/plat-s3c/Makefile
+++ b/arch/arm/plat-s3c/Makefile
@@ -18,6 +18,11 @@ obj-y += pwm-clock.o
18obj-y += gpio.o 18obj-y += gpio.o
19obj-y += gpio-config.o 19obj-y += gpio-config.o
20 20
21# PM support
22
23obj-$(CONFIG_PM) += pm.o
24obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o
25
21# devices 26# devices
22 27
23obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o 28obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
diff --git a/arch/arm/mach-s3c2410/include/mach/audio.h b/arch/arm/plat-s3c/include/plat/audio.h
index de0e8da48bc3..de0e8da48bc3 100644
--- a/arch/arm/mach-s3c2410/include/mach/audio.h
+++ b/arch/arm/plat-s3c/include/plat/audio.h
diff --git a/arch/arm/plat-s3c/include/plat/pm.h b/arch/arm/plat-s3c/include/plat/pm.h
new file mode 100644
index 000000000000..3779775133a9
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/pm.h
@@ -0,0 +1,174 @@
1/* linux/include/asm-arm/plat-s3c24xx/pm.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Written by Ben Dooks, <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12/* s3c_pm_init
13 *
14 * called from board at initialisation time to setup the power
15 * management
16*/
17
18#ifdef CONFIG_PM
19
20extern __init int s3c_pm_init(void);
21
22#else
23
24static inline int s3c_pm_init(void)
25{
26 return 0;
27}
28#endif
29
30/* configuration for the IRQ mask over sleep */
31extern unsigned long s3c_irqwake_intmask;
32extern unsigned long s3c_irqwake_eintmask;
33
34/* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
35extern unsigned long s3c_irqwake_intallow;
36extern unsigned long s3c_irqwake_eintallow;
37
38/* per-cpu sleep functions */
39
40extern void (*pm_cpu_prep)(void);
41extern void (*pm_cpu_sleep)(void);
42
43/* Flags for PM Control */
44
45extern unsigned long s3c_pm_flags;
46
47/* from sleep.S */
48
49extern int s3c_cpu_save(unsigned long *saveblk);
50extern void s3c_cpu_resume(void);
51
52extern void s3c2410_cpu_suspend(void);
53
54extern unsigned long s3c_sleep_save_phys;
55
56/* sleep save info */
57
58/**
59 * struct sleep_save - save information for shared peripherals.
60 * @reg: Pointer to the register to save.
61 * @val: Holder for the value saved from reg.
62 *
63 * This describes a list of registers which is used by the pm core and
64 * other subsystem to save and restore register values over suspend.
65 */
66struct sleep_save {
67 void __iomem *reg;
68 unsigned long val;
69};
70
71#define SAVE_ITEM(x) \
72 { .reg = (x) }
73
74/**
75 * struct pm_uart_save - save block for core UART
76 * @ulcon: Save value for S3C2410_ULCON
77 * @ucon: Save value for S3C2410_UCON
78 * @ufcon: Save value for S3C2410_UFCON
79 * @umcon: Save value for S3C2410_UMCON
80 * @ubrdiv: Save value for S3C2410_UBRDIV
81 *
82 * Save block for UART registers to be held over sleep and restored if they
83 * are needed (say by debug).
84*/
85struct pm_uart_save {
86 u32 ulcon;
87 u32 ucon;
88 u32 ufcon;
89 u32 umcon;
90 u32 ubrdiv;
91};
92
93/* helper functions to save/restore lists of registers. */
94
95extern void s3c_pm_do_save(struct sleep_save *ptr, int count);
96extern void s3c_pm_do_restore(struct sleep_save *ptr, int count);
97extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
98
99#ifdef CONFIG_PM
100extern int s3c_irqext_wake(unsigned int irqno, unsigned int state);
101extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
102extern int s3c24xx_irq_resume(struct sys_device *dev);
103#else
104#define s3c_irqext_wake NULL
105#define s3c24xx_irq_suspend NULL
106#define s3c24xx_irq_resume NULL
107#endif
108
109/* PM debug functions */
110
111#ifdef CONFIG_S3C2410_PM_DEBUG
112/**
113 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
114 * @msg: The message to print.
115 *
116 * This function is used mainly to debug the resume process before the system
117 * can rely on printk/console output. It uses the low-level debugging output
118 * routine printascii() to do its work.
119 */
120extern void s3c_pm_dbg(const char *msg, ...);
121
122#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
123#else
124#define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt)
125#endif
126
127/* suspend memory checking */
128
129#ifdef CONFIG_S3C2410_PM_CHECK
130extern void s3c_pm_check_prepare(void);
131extern void s3c_pm_check_restore(void);
132extern void s3c_pm_check_cleanup(void);
133extern void s3c_pm_check_store(void);
134#else
135#define s3c_pm_check_prepare() do { } while(0)
136#define s3c_pm_check_restore() do { } while(0)
137#define s3c_pm_check_cleanup() do { } while(0)
138#define s3c_pm_check_store() do { } while(0)
139#endif
140
141/**
142 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ
143 *
144 * Setup all the necessary GPIO pins for waking the system on external
145 * interrupt.
146 */
147extern void s3c_pm_configure_extint(void);
148
149/**
150 * s3c_pm_restore_gpios() - restore the state of the gpios after sleep.
151 *
152 * Restore the state of the GPIO pins after sleep, which may involve ensuring
153 * that we do not glitch the state of the pins from that the bootloader's
154 * resume code has done.
155*/
156extern void s3c_pm_restore_gpios(void);
157
158/**
159 * s3c_pm_save_gpios() - save the state of the GPIOs for restoring after sleep.
160 *
161 * Save the GPIO states for resotration on resume. See s3c_pm_restore_gpios().
162 */
163extern void s3c_pm_save_gpios(void);
164
165/**
166 * s3c_pm_cb_flushcache - callback for assembly code
167 *
168 * Callback to issue flush_cache_all() as this call is
169 * not a directly callable object.
170 */
171extern void s3c_pm_cb_flushcache(void);
172
173extern void s3c_pm_save_core(void);
174extern void s3c_pm_restore_core(void);
diff --git a/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h b/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
new file mode 100644
index 000000000000..0fad7571030e
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
@@ -0,0 +1,75 @@
1/* linux/include/asm-arm/plat-s3c24xx/regs-s3c2412-iis.h
2 *
3 * Copyright 2007 Simtec Electronics <linux@simtec.co.uk>
4 * http://armlinux.simtec.co.uk/
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 * S3C2412 IIS register definition
11*/
12
13#ifndef __ASM_ARCH_REGS_S3C2412_IIS_H
14#define __ASM_ARCH_REGS_S3C2412_IIS_H
15
16#define S3C2412_IISCON (0x00)
17#define S3C2412_IISMOD (0x04)
18#define S3C2412_IISFIC (0x08)
19#define S3C2412_IISPSR (0x0C)
20#define S3C2412_IISTXD (0x10)
21#define S3C2412_IISRXD (0x14)
22
23#define S3C2412_IISCON_LRINDEX (1 << 11)
24#define S3C2412_IISCON_TXFIFO_EMPTY (1 << 10)
25#define S3C2412_IISCON_RXFIFO_EMPTY (1 << 9)
26#define S3C2412_IISCON_TXFIFO_FULL (1 << 8)
27#define S3C2412_IISCON_RXFIFO_FULL (1 << 7)
28#define S3C2412_IISCON_TXDMA_PAUSE (1 << 6)
29#define S3C2412_IISCON_RXDMA_PAUSE (1 << 5)
30#define S3C2412_IISCON_TXCH_PAUSE (1 << 4)
31#define S3C2412_IISCON_RXCH_PAUSE (1 << 3)
32#define S3C2412_IISCON_TXDMA_ACTIVE (1 << 2)
33#define S3C2412_IISCON_RXDMA_ACTIVE (1 << 1)
34#define S3C2412_IISCON_IIS_ACTIVE (1 << 0)
35
36#define S3C64XX_IISMOD_IMS_PCLK (0 << 10)
37#define S3C64XX_IISMOD_IMS_SYSMUX (1 << 10)
38
39#define S3C2412_IISMOD_MASTER_INTERNAL (0 << 10)
40#define S3C2412_IISMOD_MASTER_EXTERNAL (1 << 10)
41#define S3C2412_IISMOD_SLAVE (2 << 10)
42#define S3C2412_IISMOD_MASTER_MASK (3 << 10)
43#define S3C2412_IISMOD_MODE_TXONLY (0 << 8)
44#define S3C2412_IISMOD_MODE_RXONLY (1 << 8)
45#define S3C2412_IISMOD_MODE_TXRX (2 << 8)
46#define S3C2412_IISMOD_MODE_MASK (3 << 8)
47#define S3C2412_IISMOD_LR_LLOW (0 << 7)
48#define S3C2412_IISMOD_LR_RLOW (1 << 7)
49#define S3C2412_IISMOD_SDF_IIS (0 << 5)
50#define S3C2412_IISMOD_SDF_MSB (1 << 5)
51#define S3C2412_IISMOD_SDF_LSB (2 << 5)
52#define S3C2412_IISMOD_SDF_MASK (3 << 5)
53#define S3C2412_IISMOD_RCLK_256FS (0 << 3)
54#define S3C2412_IISMOD_RCLK_512FS (1 << 3)
55#define S3C2412_IISMOD_RCLK_384FS (2 << 3)
56#define S3C2412_IISMOD_RCLK_768FS (3 << 3)
57#define S3C2412_IISMOD_RCLK_MASK (3 << 3)
58#define S3C2412_IISMOD_BCLK_32FS (0 << 1)
59#define S3C2412_IISMOD_BCLK_48FS (1 << 1)
60#define S3C2412_IISMOD_BCLK_16FS (2 << 1)
61#define S3C2412_IISMOD_BCLK_24FS (3 << 1)
62#define S3C2412_IISMOD_BCLK_MASK (3 << 1)
63#define S3C2412_IISMOD_8BIT (1 << 0)
64
65#define S3C2412_IISPSR_PSREN (1 << 15)
66
67#define S3C2412_IISFIC_TXFLUSH (1 << 15)
68#define S3C2412_IISFIC_RXFLUSH (1 << 7)
69#define S3C2412_IISFIC_TXCOUNT(x) (((x) >> 8) & 0xf)
70#define S3C2412_IISFIC_RXCOUNT(x) (((x) >> 0) & 0xf)
71
72
73
74#endif /* __ASM_ARCH_REGS_S3C2412_IIS_H */
75
diff --git a/arch/arm/plat-s3c/include/plat/uncompress.h b/arch/arm/plat-s3c/include/plat/uncompress.h
index 6061de87f225..dc66a477f62e 100644
--- a/arch/arm/plat-s3c/include/plat/uncompress.h
+++ b/arch/arm/plat-s3c/include/plat/uncompress.h
@@ -90,7 +90,10 @@ static inline void flush(void)
90{ 90{
91} 91}
92 92
93#define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0) 93#define __raw_writel(d, ad) \
94 do { \
95 *((volatile unsigned int __force *)(ad)) = (d); \
96 } while (0)
94 97
95/* CONFIG_S3C_BOOT_WATCHDOG 98/* CONFIG_S3C_BOOT_WATCHDOG
96 * 99 *
diff --git a/arch/arm/mach-s3c2410/include/mach/usb-control.h b/arch/arm/plat-s3c/include/plat/usb-control.h
index cd91d1591f31..822c87fe948e 100644
--- a/arch/arm/mach-s3c2410/include/mach/usb-control.h
+++ b/arch/arm/plat-s3c/include/plat/usb-control.h
@@ -1,9 +1,9 @@
1/* arch/arm/mach-s3c2410/include/mach/usb-control.h 1/* arch/arm/plat-s3c/include/plat/usb-control.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - usb port information 6 * S3C - USB host port information
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 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 9 * it under the terms of the GNU General Public License version 2 as
@@ -11,7 +11,7 @@
11*/ 11*/
12 12
13#ifndef __ASM_ARCH_USBCONTROL_H 13#ifndef __ASM_ARCH_USBCONTROL_H
14#define __ASM_ARCH_USBCONTROL_H "arch/arm/mach-s3c2410/include/mach/usb-control.h" 14#define __ASM_ARCH_USBCONTROL_H
15 15
16#define S3C_HCDFLG_USED (1) 16#define S3C_HCDFLG_USED (1)
17 17
diff --git a/arch/arm/plat-s3c/pm-check.c b/arch/arm/plat-s3c/pm-check.c
new file mode 100644
index 000000000000..39f2555564da
--- /dev/null
+++ b/arch/arm/plat-s3c/pm-check.c
@@ -0,0 +1,242 @@
1/* linux/arch/arm/plat-s3c/pm-check.c
2 * originally in linux/arch/arm/plat-s3c24xx/pm.c
3 *
4 * Copyright (c) 2004,2006,2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C Power Mangament - suspend/resume memory corruptiuon check.
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/suspend.h>
17#include <linux/init.h>
18#include <linux/crc32.h>
19#include <linux/ioport.h>
20
21#include <plat/pm.h>
22
23#if CONFIG_S3C2410_PM_CHECK_CHUNKSIZE < 1
24#error CONFIG_S3C2410_PM_CHECK_CHUNKSIZE must be a positive non-zero value
25#endif
26
27/* suspend checking code...
28 *
29 * this next area does a set of crc checks over all the installed
30 * memory, so the system can verify if the resume was ok.
31 *
32 * CONFIG_S3C2410_PM_CHECK_CHUNKSIZE defines the block-size for the CRC,
33 * increasing it will mean that the area corrupted will be less easy to spot,
34 * and reducing the size will cause the CRC save area to grow
35*/
36
37#define CHECK_CHUNKSIZE (CONFIG_S3C2410_PM_CHECK_CHUNKSIZE * 1024)
38
39static u32 crc_size; /* size needed for the crc block */
40static u32 *crcs; /* allocated over suspend/resume */
41
42typedef u32 *(run_fn_t)(struct resource *ptr, u32 *arg);
43
44/* s3c_pm_run_res
45 *
46 * go through the given resource list, and look for system ram
47*/
48
49static void s3c_pm_run_res(struct resource *ptr, run_fn_t fn, u32 *arg)
50{
51 while (ptr != NULL) {
52 if (ptr->child != NULL)
53 s3c_pm_run_res(ptr->child, fn, arg);
54
55 if ((ptr->flags & IORESOURCE_MEM) &&
56 strcmp(ptr->name, "System RAM") == 0) {
57 S3C_PMDBG("Found system RAM at %08lx..%08lx\n",
58 (unsigned long)ptr->start,
59 (unsigned long)ptr->end);
60 arg = (fn)(ptr, arg);
61 }
62
63 ptr = ptr->sibling;
64 }
65}
66
67static void s3c_pm_run_sysram(run_fn_t fn, u32 *arg)
68{
69 s3c_pm_run_res(&iomem_resource, fn, arg);
70}
71
72static u32 *s3c_pm_countram(struct resource *res, u32 *val)
73{
74 u32 size = (u32)(res->end - res->start)+1;
75
76 size += CHECK_CHUNKSIZE-1;
77 size /= CHECK_CHUNKSIZE;
78
79 S3C_PMDBG("Area %08lx..%08lx, %d blocks\n",
80 (unsigned long)res->start, (unsigned long)res->end, size);
81
82 *val += size * sizeof(u32);
83 return val;
84}
85
86/* s3c_pm_prepare_check
87 *
88 * prepare the necessary information for creating the CRCs. This
89 * must be done before the final save, as it will require memory
90 * allocating, and thus touching bits of the kernel we do not
91 * know about.
92*/
93
94void s3c_pm_check_prepare(void)
95{
96 crc_size = 0;
97
98 s3c_pm_run_sysram(s3c_pm_countram, &crc_size);
99
100 S3C_PMDBG("s3c_pm_prepare_check: %u checks needed\n", crc_size);
101
102 crcs = kmalloc(crc_size+4, GFP_KERNEL);
103 if (crcs == NULL)
104 printk(KERN_ERR "Cannot allocated CRC save area\n");
105}
106
107static u32 *s3c_pm_makecheck(struct resource *res, u32 *val)
108{
109 unsigned long addr, left;
110
111 for (addr = res->start; addr < res->end;
112 addr += CHECK_CHUNKSIZE) {
113 left = res->end - addr;
114
115 if (left > CHECK_CHUNKSIZE)
116 left = CHECK_CHUNKSIZE;
117
118 *val = crc32_le(~0, phys_to_virt(addr), left);
119 val++;
120 }
121
122 return val;
123}
124
125/* s3c_pm_check_store
126 *
127 * compute the CRC values for the memory blocks before the final
128 * sleep.
129*/
130
131void s3c_pm_check_store(void)
132{
133 if (crcs != NULL)
134 s3c_pm_run_sysram(s3c_pm_makecheck, crcs);
135}
136
137/* in_region
138 *
139 * return TRUE if the area defined by ptr..ptr+size contains the
140 * what..what+whatsz
141*/
142
143static inline int in_region(void *ptr, int size, void *what, size_t whatsz)
144{
145 if ((what+whatsz) < ptr)
146 return 0;
147
148 if (what > (ptr+size))
149 return 0;
150
151 return 1;
152}
153
154/**
155 * s3c_pm_runcheck() - helper to check a resource on restore.
156 * @res: The resource to check
157 * @vak: Pointer to list of CRC32 values to check.
158 *
159 * Called from the s3c_pm_check_restore() via s3c_pm_run_sysram(), this
160 * function runs the given memory resource checking it against the stored
161 * CRC to ensure that memory is restored. The function tries to skip as
162 * many of the areas used during the suspend process.
163 */
164static u32 *s3c_pm_runcheck(struct resource *res, u32 *val)
165{
166 void *save_at = phys_to_virt(s3c_sleep_save_phys);
167 unsigned long addr;
168 unsigned long left;
169 void *stkpage;
170 void *ptr;
171 u32 calc;
172
173 stkpage = (void *)((u32)&calc & ~PAGE_MASK);
174
175 for (addr = res->start; addr < res->end;
176 addr += CHECK_CHUNKSIZE) {
177 left = res->end - addr;
178
179 if (left > CHECK_CHUNKSIZE)
180 left = CHECK_CHUNKSIZE;
181
182 ptr = phys_to_virt(addr);
183
184 if (in_region(ptr, left, stkpage, 4096)) {
185 S3C_PMDBG("skipping %08lx, has stack in\n", addr);
186 goto skip_check;
187 }
188
189 if (in_region(ptr, left, crcs, crc_size)) {
190 S3C_PMDBG("skipping %08lx, has crc block in\n", addr);
191 goto skip_check;
192 }
193
194 if (in_region(ptr, left, save_at, 32*4 )) {
195 S3C_PMDBG("skipping %08lx, has save block in\n", addr);
196 goto skip_check;
197 }
198
199 /* calculate and check the checksum */
200
201 calc = crc32_le(~0, ptr, left);
202 if (calc != *val) {
203 printk(KERN_ERR "Restore CRC error at "
204 "%08lx (%08x vs %08x)\n", addr, calc, *val);
205
206 S3C_PMDBG("Restore CRC error at %08lx (%08x vs %08x)\n",
207 addr, calc, *val);
208 }
209
210 skip_check:
211 val++;
212 }
213
214 return val;
215}
216
217/**
218 * s3c_pm_check_restore() - memory check called on resume
219 *
220 * check the CRCs after the restore event and free the memory used
221 * to hold them
222*/
223void s3c_pm_check_restore(void)
224{
225 if (crcs != NULL)
226 s3c_pm_run_sysram(s3c_pm_runcheck, crcs);
227}
228
229/**
230 * s3c_pm_check_cleanup() - free memory resources
231 *
232 * Free the resources that where allocated by the suspend
233 * memory check code. We do this separately from the
234 * s3c_pm_check_restore() function as we cannot call any
235 * functions that might sleep during that resume.
236 */
237void s3c_pm_check_cleanup(void)
238{
239 kfree(crcs);
240 crcs = NULL;
241}
242
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-s3c/pm.c
new file mode 100644
index 000000000000..061182ca66e3
--- /dev/null
+++ b/arch/arm/plat-s3c/pm.c
@@ -0,0 +1,363 @@
1/* linux/arch/arm/plat-s3c/pm.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2004,2006,2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C common power management (suspend to ram) support.
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/init.h>
16#include <linux/suspend.h>
17#include <linux/errno.h>
18#include <linux/delay.h>
19#include <linux/serial_core.h>
20#include <linux/io.h>
21
22#include <asm/cacheflush.h>
23#include <mach/hardware.h>
24
25#include <plat/regs-serial.h>
26#include <mach/regs-clock.h>
27#include <mach/regs-gpio.h>
28#include <mach/regs-mem.h>
29#include <mach/regs-irq.h>
30#include <asm/irq.h>
31
32#include <plat/pm.h>
33#include <plat/pm-core.h>
34
35/* for external use */
36
37unsigned long s3c_pm_flags;
38
39/* Debug code:
40 *
41 * This code supports debug output to the low level UARTs for use on
42 * resume before the console layer is available.
43*/
44
45#ifdef CONFIG_S3C2410_PM_DEBUG
46extern void printascii(const char *);
47
48void s3c_pm_dbg(const char *fmt, ...)
49{
50 va_list va;
51 char buff[256];
52
53 va_start(va, fmt);
54 vsprintf(buff, fmt, va);
55 va_end(va);
56
57 printascii(buff);
58}
59
60static inline void s3c_pm_debug_init(void)
61{
62 /* restart uart clocks so we can use them to output */
63 s3c_pm_debug_init_uart();
64}
65
66#else
67#define s3c_pm_debug_init() do { } while(0)
68
69#endif /* CONFIG_S3C2410_PM_DEBUG */
70
71/* Save the UART configurations if we are configured for debug. */
72
73#ifdef CONFIG_S3C2410_PM_DEBUG
74
75struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS];
76
77static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
78{
79 void __iomem *regs = S3C_VA_UARTx(uart);
80
81 save->ulcon = __raw_readl(regs + S3C2410_ULCON);
82 save->ucon = __raw_readl(regs + S3C2410_UCON);
83 save->ufcon = __raw_readl(regs + S3C2410_UFCON);
84 save->umcon = __raw_readl(regs + S3C2410_UMCON);
85 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV);
86}
87
88static void s3c_pm_save_uarts(void)
89{
90 struct pm_uart_save *save = uart_save;
91 unsigned int uart;
92
93 for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++)
94 s3c_pm_save_uart(uart, save);
95}
96
97static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
98{
99 void __iomem *regs = S3C_VA_UARTx(uart);
100
101 __raw_writel(save->ulcon, regs + S3C2410_ULCON);
102 __raw_writel(save->ucon, regs + S3C2410_UCON);
103 __raw_writel(save->ufcon, regs + S3C2410_UFCON);
104 __raw_writel(save->umcon, regs + S3C2410_UMCON);
105 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV);
106}
107
108static void s3c_pm_restore_uarts(void)
109{
110 struct pm_uart_save *save = uart_save;
111 unsigned int uart;
112
113 for (uart = 0; uart < CONFIG_SERIAL_SAMSUNG_UARTS; uart++, save++)
114 s3c_pm_restore_uart(uart, save);
115}
116#else
117static void s3c_pm_save_uarts(void) { }
118static void s3c_pm_restore_uarts(void) { }
119#endif
120
121/* The IRQ ext-int code goes here, it is too small to currently bother
122 * with its own file. */
123
124unsigned long s3c_irqwake_intmask = 0xffffffffL;
125unsigned long s3c_irqwake_eintmask = 0xffffffffL;
126
127int s3c_irqext_wake(unsigned int irqno, unsigned int state)
128{
129 unsigned long bit = 1L << IRQ_EINT_BIT(irqno);
130
131 if (!(s3c_irqwake_eintallow & bit))
132 return -ENOENT;
133
134 printk(KERN_INFO "wake %s for irq %d\n",
135 state ? "enabled" : "disabled", irqno);
136
137 if (!state)
138 s3c_irqwake_eintmask |= bit;
139 else
140 s3c_irqwake_eintmask &= ~bit;
141
142 return 0;
143}
144
145/* helper functions to save and restore register state */
146
147/**
148 * s3c_pm_do_save() - save a set of registers for restoration on resume.
149 * @ptr: Pointer to an array of registers.
150 * @count: Size of the ptr array.
151 *
152 * Run through the list of registers given, saving their contents in the
153 * array for later restoration when we wakeup.
154 */
155void s3c_pm_do_save(struct sleep_save *ptr, int count)
156{
157 for (; count > 0; count--, ptr++) {
158 ptr->val = __raw_readl(ptr->reg);
159 S3C_PMDBG("saved %p value %08lx\n", ptr->reg, ptr->val);
160 }
161}
162
163/**
164 * s3c_pm_do_restore() - restore register values from the save list.
165 * @ptr: Pointer to an array of registers.
166 * @count: Size of the ptr array.
167 *
168 * Restore the register values saved from s3c_pm_do_save().
169 *
170 * Note, we do not use S3C_PMDBG() in here, as the system may not have
171 * restore the UARTs state yet
172*/
173
174void s3c_pm_do_restore(struct sleep_save *ptr, int count)
175{
176 for (; count > 0; count--, ptr++) {
177 printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n",
178 ptr->reg, ptr->val, __raw_readl(ptr->reg));
179
180 __raw_writel(ptr->val, ptr->reg);
181 }
182}
183
184/**
185 * s3c_pm_do_restore_core() - early restore register values from save list.
186 *
187 * This is similar to s3c_pm_do_restore() except we try and minimise the
188 * side effects of the function in case registers that hardware might need
189 * to work has been restored.
190 *
191 * WARNING: Do not put any debug in here that may effect memory or use
192 * peripherals, as things may be changing!
193*/
194
195void s3c_pm_do_restore_core(struct sleep_save *ptr, int count)
196{
197 for (; count > 0; count--, ptr++)
198 __raw_writel(ptr->val, ptr->reg);
199}
200
201/* s3c2410_pm_show_resume_irqs
202 *
203 * print any IRQs asserted at resume time (ie, we woke from)
204*/
205static void s3c_pm_show_resume_irqs(int start, unsigned long which,
206 unsigned long mask)
207{
208 int i;
209
210 which &= ~mask;
211
212 for (i = 0; i <= 31; i++) {
213 if (which & (1L<<i)) {
214 S3C_PMDBG("IRQ %d asserted at resume\n", start+i);
215 }
216 }
217}
218
219
220void (*pm_cpu_prep)(void);
221void (*pm_cpu_sleep)(void);
222
223#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
224
225/* s3c_pm_enter
226 *
227 * central control for sleep/resume process
228*/
229
230static int s3c_pm_enter(suspend_state_t state)
231{
232 static unsigned long regs_save[16];
233
234 /* ensure the debug is initialised (if enabled) */
235
236 s3c_pm_debug_init();
237
238 S3C_PMDBG("%s(%d)\n", __func__, state);
239
240 if (pm_cpu_prep == NULL || pm_cpu_sleep == NULL) {
241 printk(KERN_ERR "%s: error: no cpu sleep function\n", __func__);
242 return -EINVAL;
243 }
244
245 /* check if we have anything to wake-up with... bad things seem
246 * to happen if you suspend with no wakeup (system will often
247 * require a full power-cycle)
248 */
249
250 if (!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
251 !any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) {
252 printk(KERN_ERR "%s: No wake-up sources!\n", __func__);
253 printk(KERN_ERR "%s: Aborting sleep\n", __func__);
254 return -EINVAL;
255 }
256
257 /* store the physical address of the register recovery block */
258
259 s3c_sleep_save_phys = virt_to_phys(regs_save);
260
261 S3C_PMDBG("s3c_sleep_save_phys=0x%08lx\n", s3c_sleep_save_phys);
262
263 /* save all necessary core registers not covered by the drivers */
264
265 s3c_pm_save_gpios();
266 s3c_pm_save_uarts();
267 s3c_pm_save_core();
268
269 /* set the irq configuration for wake */
270
271 s3c_pm_configure_extint();
272
273 S3C_PMDBG("sleep: irq wakeup masks: %08lx,%08lx\n",
274 s3c_irqwake_intmask, s3c_irqwake_eintmask);
275
276 s3c_pm_arch_prepare_irqs();
277
278 /* call cpu specific preparation */
279
280 pm_cpu_prep();
281
282 /* flush cache back to ram */
283
284 flush_cache_all();
285
286 s3c_pm_check_store();
287
288 /* send the cpu to sleep... */
289
290 s3c_pm_arch_stop_clocks();
291
292 /* s3c_cpu_save will also act as our return point from when
293 * we resume as it saves its own register state and restores it
294 * during the resume. */
295
296 s3c_cpu_save(regs_save);
297
298 /* restore the cpu state using the kernel's cpu init code. */
299
300 cpu_init();
301
302 /* restore the system state */
303
304 s3c_pm_restore_core();
305 s3c_pm_restore_uarts();
306 s3c_pm_restore_gpios();
307
308 s3c_pm_debug_init();
309
310 /* check what irq (if any) restored the system */
311
312 s3c_pm_arch_show_resume_irqs();
313
314 S3C_PMDBG("%s: post sleep, preparing to return\n", __func__);
315
316 s3c_pm_check_restore();
317
318 /* ok, let's return from sleep */
319
320 S3C_PMDBG("S3C PM Resume (post-restore)\n");
321 return 0;
322}
323
324/* callback from assembly code */
325void s3c_pm_cb_flushcache(void)
326{
327 flush_cache_all();
328}
329
330static int s3c_pm_prepare(void)
331{
332 /* prepare check area if configured */
333
334 s3c_pm_check_prepare();
335 return 0;
336}
337
338static void s3c_pm_finish(void)
339{
340 s3c_pm_check_cleanup();
341}
342
343static struct platform_suspend_ops s3c_pm_ops = {
344 .enter = s3c_pm_enter,
345 .prepare = s3c_pm_prepare,
346 .finish = s3c_pm_finish,
347 .valid = suspend_valid_only_mem,
348};
349
350/* s3c_pm_init
351 *
352 * Attach the power management functions. This should be called
353 * from the board specific initialisation if the board supports
354 * it.
355*/
356
357int __init s3c_pm_init(void)
358{
359 printk("S3C Power Management, Copyright 2004 Simtec Electronics\n");
360
361 suspend_set_ops(&s3c_pm_ops);
362 return 0;
363}
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 1e0767b266b8..636cb12711df 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o
27obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o 27obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o
28obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o 28obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
29obj-$(CONFIG_PM) += pm.o 29obj-$(CONFIG_PM) += pm.o
30obj-$(CONFIG_PM) += irq-pm.o
30obj-$(CONFIG_PM) += sleep.o 31obj-$(CONFIG_PM) += sleep.o
31obj-$(CONFIG_HAVE_PWM) += pwm.o 32obj-$(CONFIG_HAVE_PWM) += pwm.o
32obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o 33obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index 3d4837021ac7..1a8347cec20a 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -201,5 +201,5 @@ void __init smdk_machine_init(void)
201 201
202 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); 202 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
203 203
204 s3c2410_pm_init(); 204 s3c_pm_init();
205} 205}
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 542062f8cbc1..1932b7e0da15 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -182,7 +182,7 @@ static unsigned long s3c24xx_read_idcode_v4(void)
182 * with the caches enabled. It seems at least the S3C2440 has a problem 182 * with the caches enabled. It seems at least the S3C2440 has a problem
183 * resetting if there is bus activity interrupted by the reset. 183 * resetting if there is bus activity interrupted by the reset.
184 */ 184 */
185static void s3c24xx_pm_restart(char mode) 185static void s3c24xx_pm_restart(char mode, const char *cmd)
186{ 186{
187 if (mode != 's') { 187 if (mode != 's') {
188 unsigned long flags; 188 unsigned long flags;
@@ -191,12 +191,12 @@ static void s3c24xx_pm_restart(char mode)
191 __cpuc_flush_kern_all(); 191 __cpuc_flush_kern_all();
192 __cpuc_flush_user_all(); 192 __cpuc_flush_user_all();
193 193
194 arch_reset(mode); 194 arch_reset(mode, cmd);
195 local_irq_restore(flags); 195 local_irq_restore(flags);
196 } 196 }
197 197
198 /* fallback, or unhandled */ 198 /* fallback, or unhandled */
199 arm_machine_restart(mode); 199 arm_machine_restart(mode, cmd);
200} 200}
201 201
202void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) 202void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
diff --git a/arch/arm/plat-s3c24xx/include/plat/irq.h b/arch/arm/plat-s3c24xx/include/plat/irq.h
index 45746a995343..69e1be8bec35 100644
--- a/arch/arm/plat-s3c24xx/include/plat/irq.h
+++ b/arch/arm/plat-s3c24xx/include/plat/irq.h
@@ -10,6 +10,12 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <linux/io.h>
14
15#include <mach/hardware.h>
16#include <mach/regs-irq.h>
17#include <mach/regs-gpio.h>
18
13#define irqdbf(x...) 19#define irqdbf(x...)
14#define irqdbf2(x...) 20#define irqdbf2(x...)
15 21
diff --git a/arch/arm/plat-s3c24xx/include/plat/map.h b/arch/arm/plat-s3c24xx/include/plat/map.h
index fef8ea8b8e1e..eed8f78e7593 100644
--- a/arch/arm/plat-s3c24xx/include/plat/map.h
+++ b/arch/arm/plat-s3c24xx/include/plat/map.h
@@ -31,6 +31,8 @@
31#define S3C24XX_SZ_UART SZ_1M 31#define S3C24XX_SZ_UART SZ_1M
32#define S3C_UART_OFFSET (0x4000) 32#define S3C_UART_OFFSET (0x4000)
33 33
34#define S3C_VA_UARTx(uart) (S3C_VA_UART + ((uart * S3C_UART_OFFSET)))
35
34/* Timers */ 36/* Timers */
35#define S3C24XX_VA_TIMER S3C_VA_TIMER 37#define S3C24XX_VA_TIMER S3C_VA_TIMER
36#define S3C2410_PA_TIMER (0x51000000) 38#define S3C2410_PA_TIMER (0x51000000)
diff --git a/arch/arm/plat-s3c24xx/include/plat/pm-core.h b/arch/arm/plat-s3c24xx/include/plat/pm-core.h
new file mode 100644
index 000000000000..c75882113e04
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/include/plat/pm-core.h
@@ -0,0 +1,59 @@
1/* linux/arch/arm/plat-s3c24xx/include/plat/pll.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C24xx - PM core support for arch/arm/plat-s3c/pm.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
14static inline void s3c_pm_debug_init_uart(void)
15{
16 unsigned long tmp = __raw_readl(S3C2410_CLKCON);
17
18 /* re-start uart clocks */
19 tmp |= S3C2410_CLKCON_UART0;
20 tmp |= S3C2410_CLKCON_UART1;
21 tmp |= S3C2410_CLKCON_UART2;
22
23 __raw_writel(tmp, S3C2410_CLKCON);
24 udelay(10);
25}
26
27static inline void s3c_pm_arch_prepare_irqs(void)
28{
29 __raw_writel(s3c_irqwake_intmask, S3C2410_INTMSK);
30 __raw_writel(s3c_irqwake_eintmask, S3C2410_EINTMASK);
31
32 /* ack any outstanding external interrupts before we go to sleep */
33
34 __raw_writel(__raw_readl(S3C2410_EINTPEND), S3C2410_EINTPEND);
35 __raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND);
36 __raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND);
37
38}
39
40static inline void s3c_pm_arch_stop_clocks(void)
41{
42 __raw_writel(0x00, S3C2410_CLKCON); /* turn off clocks over sleep */
43}
44
45static void s3c_pm_show_resume_irqs(int start, unsigned long which,
46 unsigned long mask);
47
48static inline void s3c_pm_arch_show_resume_irqs(void)
49{
50 S3C_PMDBG("post sleep: IRQs 0x%08x, 0x%08x\n",
51 __raw_readl(S3C2410_SRCPND),
52 __raw_readl(S3C2410_EINTPEND));
53
54 s3c_pm_show_resume_irqs(IRQ_EINT0, __raw_readl(S3C2410_SRCPND),
55 s3c_irqwake_intmask);
56
57 s3c_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND),
58 s3c_irqwake_eintmask);
59}
diff --git a/arch/arm/plat-s3c24xx/include/plat/pm.h b/arch/arm/plat-s3c24xx/include/plat/pm.h
deleted file mode 100644
index cc623667e48a..000000000000
--- a/arch/arm/plat-s3c24xx/include/plat/pm.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/pm.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Written by Ben Dooks, <ben@simtec.co.uk>
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/* s3c2410_pm_init
12 *
13 * called from board at initialisation time to setup the power
14 * management
15*/
16
17#ifdef CONFIG_PM
18
19extern __init int s3c2410_pm_init(void);
20
21#else
22
23static inline int s3c2410_pm_init(void)
24{
25 return 0;
26}
27#endif
28
29/* configuration for the IRQ mask over sleep */
30extern unsigned long s3c_irqwake_intmask;
31extern unsigned long s3c_irqwake_eintmask;
32
33/* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
34extern unsigned long s3c_irqwake_intallow;
35extern unsigned long s3c_irqwake_eintallow;
36
37/* per-cpu sleep functions */
38
39extern void (*pm_cpu_prep)(void);
40extern void (*pm_cpu_sleep)(void);
41
42/* Flags for PM Control */
43
44extern unsigned long s3c_pm_flags;
45
46/* from sleep.S */
47
48extern int s3c2410_cpu_save(unsigned long *saveblk);
49extern void s3c2410_cpu_suspend(void);
50extern void s3c2410_cpu_resume(void);
51
52extern unsigned long s3c2410_sleep_save_phys;
53
54/* sleep save info */
55
56struct sleep_save {
57 void __iomem *reg;
58 unsigned long val;
59};
60
61#define SAVE_ITEM(x) \
62 { .reg = (x) }
63
64extern void s3c2410_pm_do_save(struct sleep_save *ptr, int count);
65extern void s3c2410_pm_do_restore(struct sleep_save *ptr, int count);
66
67#ifdef CONFIG_PM
68extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
69extern int s3c24xx_irq_resume(struct sys_device *dev);
70#else
71#define s3c24xx_irq_suspend NULL
72#define s3c24xx_irq_resume NULL
73#endif
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-iis.h b/arch/arm/plat-s3c24xx/include/plat/regs-iis.h
new file mode 100644
index 000000000000..a6f1d5df13b4
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/include/plat/regs-iis.h
@@ -0,0 +1,77 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-iis.h
2 *
3 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
4 * http://www.simtec.co.uk/products/SWLINUX/
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 * S3C2410 IIS register definition
11*/
12
13#ifndef __ASM_ARCH_REGS_IIS_H
14#define __ASM_ARCH_REGS_IIS_H
15
16#define S3C2410_IISCON (0x00)
17
18#define S3C2410_IISCON_LRINDEX (1<<8)
19#define S3C2410_IISCON_TXFIFORDY (1<<7)
20#define S3C2410_IISCON_RXFIFORDY (1<<6)
21#define S3C2410_IISCON_TXDMAEN (1<<5)
22#define S3C2410_IISCON_RXDMAEN (1<<4)
23#define S3C2410_IISCON_TXIDLE (1<<3)
24#define S3C2410_IISCON_RXIDLE (1<<2)
25#define S3C2410_IISCON_PSCEN (1<<1)
26#define S3C2410_IISCON_IISEN (1<<0)
27
28#define S3C2410_IISMOD (0x04)
29
30#define S3C2440_IISMOD_MPLL (1<<9)
31#define S3C2410_IISMOD_SLAVE (1<<8)
32#define S3C2410_IISMOD_NOXFER (0<<6)
33#define S3C2410_IISMOD_RXMODE (1<<6)
34#define S3C2410_IISMOD_TXMODE (2<<6)
35#define S3C2410_IISMOD_TXRXMODE (3<<6)
36#define S3C2410_IISMOD_LR_LLOW (0<<5)
37#define S3C2410_IISMOD_LR_RLOW (1<<5)
38#define S3C2410_IISMOD_IIS (0<<4)
39#define S3C2410_IISMOD_MSB (1<<4)
40#define S3C2410_IISMOD_8BIT (0<<3)
41#define S3C2410_IISMOD_16BIT (1<<3)
42#define S3C2410_IISMOD_BITMASK (1<<3)
43#define S3C2410_IISMOD_256FS (0<<2)
44#define S3C2410_IISMOD_384FS (1<<2)
45#define S3C2410_IISMOD_16FS (0<<0)
46#define S3C2410_IISMOD_32FS (1<<0)
47#define S3C2410_IISMOD_48FS (2<<0)
48#define S3C2410_IISMOD_FS_MASK (3<<0)
49
50#define S3C2410_IISPSR (0x08)
51#define S3C2410_IISPSR_INTMASK (31<<5)
52#define S3C2410_IISPSR_INTSHIFT (5)
53#define S3C2410_IISPSR_EXTMASK (31<<0)
54#define S3C2410_IISPSR_EXTSHFIT (0)
55
56#define S3C2410_IISFCON (0x0c)
57
58#define S3C2410_IISFCON_TXDMA (1<<15)
59#define S3C2410_IISFCON_RXDMA (1<<14)
60#define S3C2410_IISFCON_TXENABLE (1<<13)
61#define S3C2410_IISFCON_RXENABLE (1<<12)
62#define S3C2410_IISFCON_TXMASK (0x3f << 6)
63#define S3C2410_IISFCON_TXSHIFT (6)
64#define S3C2410_IISFCON_RXMASK (0x3f)
65#define S3C2410_IISFCON_RXSHIFT (0)
66
67#define S3C2400_IISFCON_TXDMA (1<<11)
68#define S3C2400_IISFCON_RXDMA (1<<10)
69#define S3C2400_IISFCON_TXENABLE (1<<9)
70#define S3C2400_IISFCON_RXENABLE (1<<8)
71#define S3C2400_IISFCON_TXMASK (0x07 << 4)
72#define S3C2400_IISFCON_TXSHIFT (4)
73#define S3C2400_IISFCON_RXMASK (0x07)
74#define S3C2400_IISFCON_RXSHIFT (0)
75
76#define S3C2410_IISFIFO (0x10)
77#endif /* __ASM_ARCH_REGS_IIS_H */
diff --git a/arch/arm/plat-s3c24xx/irq-pm.c b/arch/arm/plat-s3c24xx/irq-pm.c
new file mode 100644
index 000000000000..b7acf1a8ecd2
--- /dev/null
+++ b/arch/arm/plat-s3c24xx/irq-pm.c
@@ -0,0 +1,95 @@
1/* linux/arch/arm/plat-s3c24xx/irq-om.c
2 *
3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C24XX - IRQ PM code
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/sysdev.h>
18
19#include <plat/cpu.h>
20#include <plat/pm.h>
21#include <plat/irq.h>
22
23/* state for IRQs over sleep */
24
25/* default is to allow for EINT0..EINT15, and IRQ_RTC as wakeup sources
26 *
27 * set bit to 1 in allow bitfield to enable the wakeup settings on it
28*/
29
30unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
31unsigned long s3c_irqwake_eintallow = 0x0000fff0L;
32
33int s3c_irq_wake(unsigned int irqno, unsigned int state)
34{
35 unsigned long irqbit = 1 << (irqno - IRQ_EINT0);
36
37 if (!(s3c_irqwake_intallow & irqbit))
38 return -ENOENT;
39
40 printk(KERN_INFO "wake %s for irq %d\n",
41 state ? "enabled" : "disabled", irqno);
42
43 if (!state)
44 s3c_irqwake_intmask |= irqbit;
45 else
46 s3c_irqwake_intmask &= ~irqbit;
47
48 return 0;
49}
50
51static struct sleep_save irq_save[] = {
52 SAVE_ITEM(S3C2410_INTMSK),
53 SAVE_ITEM(S3C2410_INTSUBMSK),
54};
55
56/* the extint values move between the s3c2410/s3c2440 and the s3c2412
57 * so we use an array to hold them, and to calculate the address of
58 * the register at run-time
59*/
60
61static unsigned long save_extint[3];
62static unsigned long save_eintflt[4];
63static unsigned long save_eintmask;
64
65int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)
66{
67 unsigned int i;
68
69 for (i = 0; i < ARRAY_SIZE(save_extint); i++)
70 save_extint[i] = __raw_readl(S3C24XX_EXTINT0 + (i*4));
71
72 for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
73 save_eintflt[i] = __raw_readl(S3C24XX_EINFLT0 + (i*4));
74
75 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
76 save_eintmask = __raw_readl(S3C24XX_EINTMASK);
77
78 return 0;
79}
80
81int s3c24xx_irq_resume(struct sys_device *dev)
82{
83 unsigned int i;
84
85 for (i = 0; i < ARRAY_SIZE(save_extint); i++)
86 __raw_writel(save_extint[i], S3C24XX_EXTINT0 + (i*4));
87
88 for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
89 __raw_writel(save_eintflt[i], S3C24XX_EINFLT0 + (i*4));
90
91 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
92 __raw_writel(save_eintmask, S3C24XX_EINTMASK);
93
94 return 0;
95}
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index 0192ecdc1442..958737775ad2 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
@@ -16,38 +16,6 @@
16 * You should have received a copy of the GNU General Public License 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 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 *
20 * Changelog:
21 *
22 * 22-Jul-2004 Ben Dooks <ben@simtec.co.uk>
23 * Fixed compile warnings
24 *
25 * 22-Jul-2004 Roc Wu <cooloney@yahoo.com.cn>
26 * Fixed s3c_extirq_type
27 *
28 * 21-Jul-2004 Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
29 * Addition of ADC/TC demux
30 *
31 * 04-Oct-2004 Klaus Fetscher <k.fetscher@fetron.de>
32 * Fix for set_irq_type() on low EINT numbers
33 *
34 * 05-Oct-2004 Ben Dooks <ben@simtec.co.uk>
35 * Tidy up KF's patch and sort out new release
36 *
37 * 05-Oct-2004 Ben Dooks <ben@simtec.co.uk>
38 * Add support for power management controls
39 *
40 * 04-Nov-2004 Ben Dooks
41 * Fix standard IRQ wake for EINT0..4 and RTC
42 *
43 * 22-Feb-2005 Ben Dooks
44 * Fixed edge-triggering on ADC IRQ
45 *
46 * 28-Jun-2005 Ben Dooks
47 * Mark IRQ_LCD valid
48 *
49 * 25-Jul-2005 Ben Dooks
50 * Split the S3C2440 IRQ code to separate file
51*/ 19*/
52 20
53#include <linux/init.h> 21#include <linux/init.h>
@@ -55,81 +23,16 @@
55#include <linux/interrupt.h> 23#include <linux/interrupt.h>
56#include <linux/ioport.h> 24#include <linux/ioport.h>
57#include <linux/sysdev.h> 25#include <linux/sysdev.h>
58#include <linux/io.h>
59 26
60#include <mach/hardware.h>
61#include <asm/irq.h> 27#include <asm/irq.h>
62
63#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
64 29
65#include <plat/regs-irqtype.h> 30#include <plat/regs-irqtype.h>
66#include <mach/regs-irq.h>
67#include <mach/regs-gpio.h>
68 31
69#include <plat/cpu.h> 32#include <plat/cpu.h>
70#include <plat/pm.h> 33#include <plat/pm.h>
71#include <plat/irq.h> 34#include <plat/irq.h>
72 35
73/* wakeup irq control */
74
75#ifdef CONFIG_PM
76
77/* state for IRQs over sleep */
78
79/* default is to allow for EINT0..EINT15, and IRQ_RTC as wakeup sources
80 *
81 * set bit to 1 in allow bitfield to enable the wakeup settings on it
82*/
83
84unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL;
85unsigned long s3c_irqwake_intmask = 0xffffffffL;
86unsigned long s3c_irqwake_eintallow = 0x0000fff0L;
87unsigned long s3c_irqwake_eintmask = 0xffffffffL;
88
89int
90s3c_irq_wake(unsigned int irqno, unsigned int state)
91{
92 unsigned long irqbit = 1 << (irqno - IRQ_EINT0);
93
94 if (!(s3c_irqwake_intallow & irqbit))
95 return -ENOENT;
96
97 printk(KERN_INFO "wake %s for irq %d\n",
98 state ? "enabled" : "disabled", irqno);
99
100 if (!state)
101 s3c_irqwake_intmask |= irqbit;
102 else
103 s3c_irqwake_intmask &= ~irqbit;
104
105 return 0;
106}
107
108static int
109s3c_irqext_wake(unsigned int irqno, unsigned int state)
110{
111 unsigned long bit = 1L << (irqno - EXTINT_OFF);
112
113 if (!(s3c_irqwake_eintallow & bit))
114 return -ENOENT;
115
116 printk(KERN_INFO "wake %s for irq %d\n",
117 state ? "enabled" : "disabled", irqno);
118
119 if (!state)
120 s3c_irqwake_eintmask |= bit;
121 else
122 s3c_irqwake_eintmask &= ~bit;
123
124 return 0;
125}
126
127#else
128#define s3c_irqext_wake NULL
129#define s3c_irq_wake NULL
130#endif
131
132
133static void 36static void
134s3c_irq_mask(unsigned int irqno) 37s3c_irq_mask(unsigned int irqno)
135{ 38{
@@ -590,59 +493,6 @@ s3c_irq_demux_extint4t7(unsigned int irq,
590 } 493 }
591} 494}
592 495
593#ifdef CONFIG_PM
594
595static struct sleep_save irq_save[] = {
596 SAVE_ITEM(S3C2410_INTMSK),
597 SAVE_ITEM(S3C2410_INTSUBMSK),
598};
599
600/* the extint values move between the s3c2410/s3c2440 and the s3c2412
601 * so we use an array to hold them, and to calculate the address of
602 * the register at run-time
603*/
604
605static unsigned long save_extint[3];
606static unsigned long save_eintflt[4];
607static unsigned long save_eintmask;
608
609int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)
610{
611 unsigned int i;
612
613 for (i = 0; i < ARRAY_SIZE(save_extint); i++)
614 save_extint[i] = __raw_readl(S3C24XX_EXTINT0 + (i*4));
615
616 for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
617 save_eintflt[i] = __raw_readl(S3C24XX_EINFLT0 + (i*4));
618
619 s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
620 save_eintmask = __raw_readl(S3C24XX_EINTMASK);
621
622 return 0;
623}
624
625int s3c24xx_irq_resume(struct sys_device *dev)
626{
627 unsigned int i;
628
629 for (i = 0; i < ARRAY_SIZE(save_extint); i++)
630 __raw_writel(save_extint[i], S3C24XX_EXTINT0 + (i*4));
631
632 for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
633 __raw_writel(save_eintflt[i], S3C24XX_EINFLT0 + (i*4));
634
635 s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
636 __raw_writel(save_eintmask, S3C24XX_EINTMASK);
637
638 return 0;
639}
640
641#else
642#define s3c24xx_irq_suspend NULL
643#define s3c24xx_irq_resume NULL
644#endif
645
646/* s3c24xx_init_irq 496/* s3c24xx_init_irq
647 * 497 *
648 * Initialise S3C2410 IRQ system 498 * Initialise S3C2410 IRQ system
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/plat-s3c24xx/pm-simtec.c
index 21dfa74773d1..da0d3217d3e3 100644
--- a/arch/arm/plat-s3c24xx/pm-simtec.c
+++ b/arch/arm/plat-s3c24xx/pm-simtec.c
@@ -61,7 +61,7 @@ static __init int pm_simtec_init(void)
61 61
62 __raw_writel(gstatus4, S3C2410_GSTATUS4); 62 __raw_writel(gstatus4, S3C2410_GSTATUS4);
63 63
64 return s3c2410_pm_init(); 64 return s3c_pm_init();
65} 65}
66 66
67arch_initcall(pm_simtec_init); 67arch_initcall(pm_simtec_init);
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
index 34ef18e5b2a1..062a29339a91 100644
--- a/arch/arm/plat-s3c24xx/pm.c
+++ b/arch/arm/plat-s3c24xx/pm.c
@@ -31,14 +31,9 @@
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/time.h> 32#include <linux/time.h>
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/crc32.h>
35#include <linux/ioport.h>
36#include <linux/serial_core.h> 34#include <linux/serial_core.h>
37#include <linux/io.h> 35#include <linux/io.h>
38 36
39#include <asm/cacheflush.h>
40#include <mach/hardware.h>
41
42#include <plat/regs-serial.h> 37#include <plat/regs-serial.h>
43#include <mach/regs-clock.h> 38#include <mach/regs-clock.h>
44#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
@@ -49,10 +44,6 @@
49 44
50#include <plat/pm.h> 45#include <plat/pm.h>
51 46
52/* for external use */
53
54unsigned long s3c_pm_flags;
55
56#define PFX "s3c24xx-pm: " 47#define PFX "s3c24xx-pm: "
57 48
58static struct sleep_save core_save[] = { 49static struct sleep_save core_save[] = {
@@ -120,328 +111,14 @@ static struct sleep_save misc_save[] = {
120 SAVE_ITEM(S3C2410_DCLKCON), 111 SAVE_ITEM(S3C2410_DCLKCON),
121}; 112};
122 113
123#ifdef CONFIG_S3C2410_PM_DEBUG
124
125#define SAVE_UART(va) \
126 SAVE_ITEM((va) + S3C2410_ULCON), \
127 SAVE_ITEM((va) + S3C2410_UCON), \
128 SAVE_ITEM((va) + S3C2410_UFCON), \
129 SAVE_ITEM((va) + S3C2410_UMCON), \
130 SAVE_ITEM((va) + S3C2410_UBRDIV)
131
132static struct sleep_save uart_save[] = {
133 SAVE_UART(S3C24XX_VA_UART0),
134 SAVE_UART(S3C24XX_VA_UART1),
135#ifndef CONFIG_CPU_S3C2400
136 SAVE_UART(S3C24XX_VA_UART2),
137#endif
138};
139
140/* debug
141 *
142 * we send the debug to printascii() to allow it to be seen if the
143 * system never wakes up from the sleep
144*/
145
146extern void printascii(const char *);
147
148void pm_dbg(const char *fmt, ...)
149{
150 va_list va;
151 char buff[256];
152
153 va_start(va, fmt);
154 vsprintf(buff, fmt, va);
155 va_end(va);
156
157 printascii(buff);
158}
159
160static void s3c2410_pm_debug_init(void)
161{
162 unsigned long tmp = __raw_readl(S3C2410_CLKCON);
163
164 /* re-start uart clocks */
165 tmp |= S3C2410_CLKCON_UART0;
166 tmp |= S3C2410_CLKCON_UART1;
167 tmp |= S3C2410_CLKCON_UART2;
168
169 __raw_writel(tmp, S3C2410_CLKCON);
170 udelay(10);
171}
172
173#define DBG(fmt...) pm_dbg(fmt)
174#else
175#define DBG(fmt...) printk(KERN_DEBUG fmt)
176
177#define s3c2410_pm_debug_init() do { } while(0)
178
179static struct sleep_save uart_save[] = {};
180#endif
181
182#if defined(CONFIG_S3C2410_PM_CHECK) && CONFIG_S3C2410_PM_CHECK_CHUNKSIZE != 0
183
184/* suspend checking code...
185 *
186 * this next area does a set of crc checks over all the installed
187 * memory, so the system can verify if the resume was ok.
188 *
189 * CONFIG_S3C2410_PM_CHECK_CHUNKSIZE defines the block-size for the CRC,
190 * increasing it will mean that the area corrupted will be less easy to spot,
191 * and reducing the size will cause the CRC save area to grow
192*/
193
194#define CHECK_CHUNKSIZE (CONFIG_S3C2410_PM_CHECK_CHUNKSIZE * 1024)
195
196static u32 crc_size; /* size needed for the crc block */
197static u32 *crcs; /* allocated over suspend/resume */
198
199typedef u32 *(run_fn_t)(struct resource *ptr, u32 *arg);
200
201/* s3c2410_pm_run_res
202 *
203 * go thorugh the given resource list, and look for system ram
204*/
205
206static void s3c2410_pm_run_res(struct resource *ptr, run_fn_t fn, u32 *arg)
207{
208 while (ptr != NULL) {
209 if (ptr->child != NULL)
210 s3c2410_pm_run_res(ptr->child, fn, arg);
211
212 if ((ptr->flags & IORESOURCE_MEM) &&
213 strcmp(ptr->name, "System RAM") == 0) {
214 DBG("Found system RAM at %08lx..%08lx\n",
215 ptr->start, ptr->end);
216 arg = (fn)(ptr, arg);
217 }
218
219 ptr = ptr->sibling;
220 }
221}
222
223static void s3c2410_pm_run_sysram(run_fn_t fn, u32 *arg)
224{
225 s3c2410_pm_run_res(&iomem_resource, fn, arg);
226}
227
228static u32 *s3c2410_pm_countram(struct resource *res, u32 *val)
229{
230 u32 size = (u32)(res->end - res->start)+1;
231
232 size += CHECK_CHUNKSIZE-1;
233 size /= CHECK_CHUNKSIZE;
234
235 DBG("Area %08lx..%08lx, %d blocks\n", res->start, res->end, size);
236
237 *val += size * sizeof(u32);
238 return val;
239}
240
241/* s3c2410_pm_prepare_check
242 *
243 * prepare the necessary information for creating the CRCs. This
244 * must be done before the final save, as it will require memory
245 * allocating, and thus touching bits of the kernel we do not
246 * know about.
247*/
248
249static void s3c2410_pm_check_prepare(void)
250{
251 crc_size = 0;
252
253 s3c2410_pm_run_sysram(s3c2410_pm_countram, &crc_size);
254
255 DBG("s3c2410_pm_prepare_check: %u checks needed\n", crc_size);
256
257 crcs = kmalloc(crc_size+4, GFP_KERNEL);
258 if (crcs == NULL)
259 printk(KERN_ERR "Cannot allocated CRC save area\n");
260}
261
262static u32 *s3c2410_pm_makecheck(struct resource *res, u32 *val)
263{
264 unsigned long addr, left;
265
266 for (addr = res->start; addr < res->end;
267 addr += CHECK_CHUNKSIZE) {
268 left = res->end - addr;
269
270 if (left > CHECK_CHUNKSIZE)
271 left = CHECK_CHUNKSIZE;
272
273 *val = crc32_le(~0, phys_to_virt(addr), left);
274 val++;
275 }
276
277 return val;
278}
279
280/* s3c2410_pm_check_store
281 *
282 * compute the CRC values for the memory blocks before the final
283 * sleep.
284*/
285
286static void s3c2410_pm_check_store(void)
287{
288 if (crcs != NULL)
289 s3c2410_pm_run_sysram(s3c2410_pm_makecheck, crcs);
290}
291
292/* in_region
293 *
294 * return TRUE if the area defined by ptr..ptr+size contatins the
295 * what..what+whatsz
296*/
297
298static inline int in_region(void *ptr, int size, void *what, size_t whatsz)
299{
300 if ((what+whatsz) < ptr)
301 return 0;
302
303 if (what > (ptr+size))
304 return 0;
305
306 return 1;
307}
308
309static u32 *s3c2410_pm_runcheck(struct resource *res, u32 *val)
310{
311 void *save_at = phys_to_virt(s3c2410_sleep_save_phys);
312 unsigned long addr;
313 unsigned long left;
314 void *ptr;
315 u32 calc;
316
317 for (addr = res->start; addr < res->end;
318 addr += CHECK_CHUNKSIZE) {
319 left = res->end - addr;
320
321 if (left > CHECK_CHUNKSIZE)
322 left = CHECK_CHUNKSIZE;
323
324 ptr = phys_to_virt(addr);
325
326 if (in_region(ptr, left, crcs, crc_size)) {
327 DBG("skipping %08lx, has crc block in\n", addr);
328 goto skip_check;
329 }
330
331 if (in_region(ptr, left, save_at, 32*4 )) {
332 DBG("skipping %08lx, has save block in\n", addr);
333 goto skip_check;
334 }
335
336 /* calculate and check the checksum */
337
338 calc = crc32_le(~0, ptr, left);
339 if (calc != *val) {
340 printk(KERN_ERR PFX "Restore CRC error at "
341 "%08lx (%08x vs %08x)\n", addr, calc, *val);
342
343 DBG("Restore CRC error at %08lx (%08x vs %08x)\n",
344 addr, calc, *val);
345 }
346
347 skip_check:
348 val++;
349 }
350
351 return val;
352}
353
354/* s3c2410_pm_check_restore
355 *
356 * check the CRCs after the restore event and free the memory used
357 * to hold them
358*/
359
360static void s3c2410_pm_check_restore(void)
361{
362 if (crcs != NULL) {
363 s3c2410_pm_run_sysram(s3c2410_pm_runcheck, crcs);
364 kfree(crcs);
365 crcs = NULL;
366 }
367}
368
369#else
370
371#define s3c2410_pm_check_prepare() do { } while(0)
372#define s3c2410_pm_check_restore() do { } while(0)
373#define s3c2410_pm_check_store() do { } while(0)
374#endif
375
376/* helper functions to save and restore register state */
377
378void s3c2410_pm_do_save(struct sleep_save *ptr, int count)
379{
380 for (; count > 0; count--, ptr++) {
381 ptr->val = __raw_readl(ptr->reg);
382 DBG("saved %p value %08lx\n", ptr->reg, ptr->val);
383 }
384}
385
386/* s3c2410_pm_do_restore
387 *
388 * restore the system from the given list of saved registers
389 *
390 * Note, we do not use DBG() in here, as the system may not have
391 * restore the UARTs state yet
392*/
393
394void s3c2410_pm_do_restore(struct sleep_save *ptr, int count)
395{
396 for (; count > 0; count--, ptr++) {
397 printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n",
398 ptr->reg, ptr->val, __raw_readl(ptr->reg));
399
400 __raw_writel(ptr->val, ptr->reg);
401 }
402}
403
404/* s3c2410_pm_do_restore_core
405 *
406 * similar to s3c2410_pm_do_restore_core
407 *
408 * WARNING: Do not put any debug in here that may effect memory or use
409 * peripherals, as things may be changing!
410*/
411
412static void s3c2410_pm_do_restore_core(struct sleep_save *ptr, int count)
413{
414 for (; count > 0; count--, ptr++) {
415 __raw_writel(ptr->val, ptr->reg);
416 }
417}
418 114
419/* s3c2410_pm_show_resume_irqs 115/* s3c_pm_check_resume_pin
420 *
421 * print any IRQs asserted at resume time (ie, we woke from)
422*/
423
424static void s3c2410_pm_show_resume_irqs(int start, unsigned long which,
425 unsigned long mask)
426{
427 int i;
428
429 which &= ~mask;
430
431 for (i = 0; i <= 31; i++) {
432 if ((which) & (1L<<i)) {
433 DBG("IRQ %d asserted at resume\n", start+i);
434 }
435 }
436}
437
438/* s3c2410_pm_check_resume_pin
439 * 116 *
440 * check to see if the pin is configured correctly for sleep mode, and 117 * check to see if the pin is configured correctly for sleep mode, and
441 * make any necessary adjustments if it is not 118 * make any necessary adjustments if it is not
442*/ 119*/
443 120
444static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs) 121static void s3c_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
445{ 122{
446 unsigned long irqstate; 123 unsigned long irqstate;
447 unsigned long pinstate; 124 unsigned long pinstate;
@@ -456,21 +133,21 @@ static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
456 133
457 if (!irqstate) { 134 if (!irqstate) {
458 if (pinstate == S3C2410_GPIO_IRQ) 135 if (pinstate == S3C2410_GPIO_IRQ)
459 DBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin); 136 S3C_PMDBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin);
460 } else { 137 } else {
461 if (pinstate == S3C2410_GPIO_IRQ) { 138 if (pinstate == S3C2410_GPIO_IRQ) {
462 DBG("Disabling IRQ %d (pin %d)\n", irq, pin); 139 S3C_PMDBG("Disabling IRQ %d (pin %d)\n", irq, pin);
463 s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT); 140 s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT);
464 } 141 }
465 } 142 }
466} 143}
467 144
468/* s3c2410_pm_configure_extint 145/* s3c_pm_configure_extint
469 * 146 *
470 * configure all external interrupt pins 147 * configure all external interrupt pins
471*/ 148*/
472 149
473static void s3c2410_pm_configure_extint(void) 150void s3c_pm_configure_extint(void)
474{ 151{
475 int pin; 152 int pin;
476 153
@@ -480,11 +157,11 @@ static void s3c2410_pm_configure_extint(void)
480 */ 157 */
481 158
482 for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) { 159 for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) {
483 s3c2410_pm_check_resume_pin(pin, pin - S3C2410_GPF0); 160 s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF0);
484 } 161 }
485 162
486 for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) { 163 for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) {
487 s3c2410_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8); 164 s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8);
488 } 165 }
489} 166}
490 167
@@ -494,12 +171,12 @@ static void s3c2410_pm_configure_extint(void)
494#define OFFS_DAT (S3C2410_GPADAT - S3C2410_GPACON) 171#define OFFS_DAT (S3C2410_GPADAT - S3C2410_GPACON)
495#define OFFS_UP (S3C2410_GPBUP - S3C2410_GPBCON) 172#define OFFS_UP (S3C2410_GPBUP - S3C2410_GPBCON)
496 173
497/* s3c2410_pm_save_gpios() 174/* s3c_pm_save_gpios()
498 * 175 *
499 * Save the state of the GPIOs 176 * Save the state of the GPIOs
500 */ 177 */
501 178
502static void s3c2410_pm_save_gpios(void) 179void s3c_pm_save_gpios(void)
503{ 180{
504 struct gpio_sleep *gps = gpio_save; 181 struct gpio_sleep *gps = gpio_save;
505 unsigned int gpio; 182 unsigned int gpio;
@@ -538,7 +215,10 @@ static inline int is_out(unsigned long con)
538 return con == 1; 215 return con == 1;
539} 216}
540 217
541/* s3c2410_pm_restore_gpio() 218/**
219 * s3c2410_pm_restore_gpio() - restore the given GPIO bank
220 * @index: The number of the GPIO bank being resumed.
221 * @gps: The sleep confgiuration for the bank.
542 * 222 *
543 * Restore one of the GPIO banks that was saved during suspend. This is 223 * Restore one of the GPIO banks that was saved during suspend. This is
544 * not as simple as once thought, due to the possibility of glitches 224 * not as simple as once thought, due to the possibility of glitches
@@ -646,8 +326,8 @@ static void s3c2410_pm_restore_gpio(int index, struct gpio_sleep *gps)
646 __raw_writel(gps->gpup, base + OFFS_UP); 326 __raw_writel(gps->gpup, base + OFFS_UP);
647 } 327 }
648 328
649 DBG("GPIO[%d] CON %08lx => %08lx, DAT %08lx => %08lx\n", 329 S3C_PMDBG("GPIO[%d] CON %08lx => %08lx, DAT %08lx => %08lx\n",
650 index, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); 330 index, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat);
651} 331}
652 332
653 333
@@ -656,7 +336,7 @@ static void s3c2410_pm_restore_gpio(int index, struct gpio_sleep *gps)
656 * Restore the state of the GPIOs 336 * Restore the state of the GPIOs
657 */ 337 */
658 338
659static void s3c2410_pm_restore_gpios(void) 339void s3c_pm_restore_gpios(void)
660{ 340{
661 struct gpio_sleep *gps = gpio_save; 341 struct gpio_sleep *gps = gpio_save;
662 int gpio; 342 int gpio;
@@ -666,150 +346,15 @@ static void s3c2410_pm_restore_gpios(void)
666 } 346 }
667} 347}
668 348
669void (*pm_cpu_prep)(void); 349void s3c_pm_restore_core(void)
670void (*pm_cpu_sleep)(void);
671
672#define any_allowed(mask, allow) (((mask) & (allow)) != (allow))
673
674/* s3c2410_pm_enter
675 *
676 * central control for sleep/resume process
677*/
678
679static int s3c2410_pm_enter(suspend_state_t state)
680{ 350{
681 unsigned long regs_save[16]; 351 s3c_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
682 352 s3c_pm_do_restore(misc_save, ARRAY_SIZE(misc_save));
683 /* ensure the debug is initialised (if enabled) */
684
685 s3c2410_pm_debug_init();
686
687 DBG("s3c2410_pm_enter(%d)\n", state);
688
689 if (pm_cpu_prep == NULL || pm_cpu_sleep == NULL) {
690 printk(KERN_ERR PFX "error: no cpu sleep functions set\n");
691 return -EINVAL;
692 }
693
694 /* check if we have anything to wake-up with... bad things seem
695 * to happen if you suspend with no wakeup (system will often
696 * require a full power-cycle)
697 */
698
699 if (!any_allowed(s3c_irqwake_intmask, s3c_irqwake_intallow) &&
700 !any_allowed(s3c_irqwake_eintmask, s3c_irqwake_eintallow)) {
701 printk(KERN_ERR PFX "No sources enabled for wake-up!\n");
702 printk(KERN_ERR PFX "Aborting sleep\n");
703 return -EINVAL;
704 }
705
706 /* prepare check area if configured */
707
708 s3c2410_pm_check_prepare();
709
710 /* store the physical address of the register recovery block */
711
712 s3c2410_sleep_save_phys = virt_to_phys(regs_save);
713
714 DBG("s3c2410_sleep_save_phys=0x%08lx\n", s3c2410_sleep_save_phys);
715
716 /* save all necessary core registers not covered by the drivers */
717
718 s3c2410_pm_save_gpios();
719 s3c2410_pm_do_save(misc_save, ARRAY_SIZE(misc_save));
720 s3c2410_pm_do_save(core_save, ARRAY_SIZE(core_save));
721 s3c2410_pm_do_save(uart_save, ARRAY_SIZE(uart_save));
722
723 /* set the irq configuration for wake */
724
725 s3c2410_pm_configure_extint();
726
727 DBG("sleep: irq wakeup masks: %08lx,%08lx\n",
728 s3c_irqwake_intmask, s3c_irqwake_eintmask);
729
730 __raw_writel(s3c_irqwake_intmask, S3C2410_INTMSK);
731 __raw_writel(s3c_irqwake_eintmask, S3C2410_EINTMASK);
732
733 /* ack any outstanding external interrupts before we go to sleep */
734
735 __raw_writel(__raw_readl(S3C2410_EINTPEND), S3C2410_EINTPEND);
736 __raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND);
737 __raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND);
738
739 /* call cpu specific preparation */
740
741 pm_cpu_prep();
742
743 /* flush cache back to ram */
744
745 flush_cache_all();
746
747 s3c2410_pm_check_store();
748
749 /* send the cpu to sleep... */
750
751 __raw_writel(0x00, S3C2410_CLKCON); /* turn off clocks over sleep */
752
753 /* s3c2410_cpu_save will also act as our return point from when
754 * we resume as it saves its own register state, so use the return
755 * code to differentiate return from save and return from sleep */
756
757 if (s3c2410_cpu_save(regs_save) == 0) {
758 flush_cache_all();
759 pm_cpu_sleep();
760 }
761
762 /* restore the cpu state */
763
764 cpu_init();
765
766 /* restore the system state */
767
768 s3c2410_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
769 s3c2410_pm_do_restore(misc_save, ARRAY_SIZE(misc_save));
770 s3c2410_pm_do_restore(uart_save, ARRAY_SIZE(uart_save));
771 s3c2410_pm_restore_gpios();
772
773 s3c2410_pm_debug_init();
774
775 /* check what irq (if any) restored the system */
776
777 DBG("post sleep: IRQs 0x%08x, 0x%08x\n",
778 __raw_readl(S3C2410_SRCPND),
779 __raw_readl(S3C2410_EINTPEND));
780
781 s3c2410_pm_show_resume_irqs(IRQ_EINT0, __raw_readl(S3C2410_SRCPND),
782 s3c_irqwake_intmask);
783
784 s3c2410_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND),
785 s3c_irqwake_eintmask);
786
787 DBG("post sleep, preparing to return\n");
788
789 s3c2410_pm_check_restore();
790
791 /* ok, let's return from sleep */
792
793 DBG("S3C2410 PM Resume (post-restore)\n");
794 return 0;
795} 353}
796 354
797static struct platform_suspend_ops s3c2410_pm_ops = { 355void s3c_pm_save_core(void)
798 .enter = s3c2410_pm_enter,
799 .valid = suspend_valid_only_mem,
800};
801
802/* s3c2410_pm_init
803 *
804 * Attach the power management functions. This should be called
805 * from the board specific initialisation if the board supports
806 * it.
807*/
808
809int __init s3c2410_pm_init(void)
810{ 356{
811 printk("S3C2410 Power Management, (c) 2004 Simtec Electronics\n"); 357 s3c_pm_do_save(misc_save, ARRAY_SIZE(misc_save));
812 358 s3c_pm_do_save(core_save, ARRAY_SIZE(core_save));
813 suspend_set_ops(&s3c2410_pm_ops);
814 return 0;
815} 359}
360
diff --git a/arch/arm/plat-s3c24xx/s3c244x.c b/arch/arm/plat-s3c24xx/s3c244x.c
index c1de6bb0101b..1364317d421e 100644
--- a/arch/arm/plat-s3c24xx/s3c244x.c
+++ b/arch/arm/plat-s3c24xx/s3c244x.c
@@ -145,13 +145,13 @@ static struct sleep_save s3c244x_sleep[] = {
145 145
146static int s3c244x_suspend(struct sys_device *dev, pm_message_t state) 146static int s3c244x_suspend(struct sys_device *dev, pm_message_t state)
147{ 147{
148 s3c2410_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); 148 s3c_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
149 return 0; 149 return 0;
150} 150}
151 151
152static int s3c244x_resume(struct sys_device *dev) 152static int s3c244x_resume(struct sys_device *dev)
153{ 153{
154 s3c2410_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep)); 154 s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
155 return 0; 155 return 0;
156} 156}
157 157
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S
index 76594b212802..e73e3b6e88d2 100644
--- a/arch/arm/plat-s3c24xx/sleep.S
+++ b/arch/arm/plat-s3c24xx/sleep.S
@@ -41,25 +41,13 @@
41 41
42 .text 42 .text
43 43
44 /* s3c2410_cpu_save 44 /* s3c_cpu_save
45 *
46 * save enough of the CPU state to allow us to re-start
47 * pm.c code. as we store items like the sp/lr, we will
48 * end up returning from this function when the cpu resumes
49 * so the return value is set to mark this.
50 *
51 * This arangement means we avoid having to flush the cache
52 * from this code.
53 * 45 *
54 * entry: 46 * entry:
55 * r0 = pointer to save block 47 * r0 = save address (virtual addr of s3c_sleep_save_phys)
56 *
57 * exit:
58 * r0 = 0 => we stored everything
59 * 1 => resumed from sleep
60 */ 48 */
61 49
62ENTRY(s3c2410_cpu_save) 50ENTRY(s3c_cpu_save)
63 stmfd sp!, { r4 - r12, lr } 51 stmfd sp!, { r4 - r12, lr }
64 52
65 @@ store co-processor registers 53 @@ store co-processor registers
@@ -71,20 +59,25 @@ ENTRY(s3c2410_cpu_save)
71 59
72 stmia r0, { r4 - r13 } 60 stmia r0, { r4 - r13 }
73 61
74 mov r0, #0 62 @@ write our state back to RAM
75 ldmfd sp, { r4 - r12, pc } 63 bl s3c_pm_cb_flushcache
76 64
65 @@ jump to final code to send system to sleep
66 ldr r0, =pm_cpu_sleep
67 @@ldr pc, [ r0 ]
68 ldr r0, [ r0 ]
69 mov pc, r0
70
77 @@ return to the caller, after having the MMU 71 @@ return to the caller, after having the MMU
78 @@ turned on, this restores the last bits from the 72 @@ turned on, this restores the last bits from the
79 @@ stack 73 @@ stack
80resume_with_mmu: 74resume_with_mmu:
81 mov r0, #1
82 ldmfd sp!, { r4 - r12, pc } 75 ldmfd sp!, { r4 - r12, pc }
83 76
84 .ltorg 77 .ltorg
85 78
86 @@ the next bits sit in the .data segment, even though they 79 @@ the next bits sit in the .data segment, even though they
87 @@ happen to be code... the s3c2410_sleep_save_phys needs to be 80 @@ happen to be code... the s3c_sleep_save_phys needs to be
88 @@ accessed by the resume code before it can restore the MMU. 81 @@ accessed by the resume code before it can restore the MMU.
89 @@ This means that the variable has to be close enough for the 82 @@ This means that the variable has to be close enough for the
90 @@ code to read it... since the .text segment needs to be RO, 83 @@ code to read it... since the .text segment needs to be RO,
@@ -92,19 +85,19 @@ resume_with_mmu:
92 85
93 .data 86 .data
94 87
95 .global s3c2410_sleep_save_phys 88 .global s3c_sleep_save_phys
96s3c2410_sleep_save_phys: 89s3c_sleep_save_phys:
97 .word 0 90 .word 0
98 91
99 92
100 /* sleep magic, to allow the bootloader to check for an valid 93 /* sleep magic, to allow the bootloader to check for an valid
101 * image to resume to. Must be the first word before the 94 * image to resume to. Must be the first word before the
102 * s3c2410_cpu_resume entry. 95 * s3c_cpu_resume entry.
103 */ 96 */
104 97
105 .word 0x2bedf00d 98 .word 0x2bedf00d
106 99
107 /* s3c2410_cpu_resume 100 /* s3c_cpu_resume
108 * 101 *
109 * resume code entry for bootloader to call 102 * resume code entry for bootloader to call
110 * 103 *
@@ -113,7 +106,7 @@ s3c2410_sleep_save_phys:
113 * must not write to the code segment (code is read-only) 106 * must not write to the code segment (code is read-only)
114 */ 107 */
115 108
116ENTRY(s3c2410_cpu_resume) 109ENTRY(s3c_cpu_resume)
117 mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE 110 mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
118 msr cpsr_c, r0 111 msr cpsr_c, r0
119 112
@@ -145,7 +138,7 @@ ENTRY(s3c2410_cpu_resume)
145 mcr p15, 0, r1, c8, c7, 0 @@ invalidate I & D TLBs 138 mcr p15, 0, r1, c8, c7, 0 @@ invalidate I & D TLBs
146 mcr p15, 0, r1, c7, c7, 0 @@ invalidate I & D caches 139 mcr p15, 0, r1, c7, c7, 0 @@ invalidate I & D caches
147 140
148 ldr r0, s3c2410_sleep_save_phys @ address of restore block 141 ldr r0, s3c_sleep_save_phys @ address of restore block
149 ldmia r0, { r4 - r13 } 142 ldmia r0, { r4 - r13 }
150 143
151 mcr p15, 0, r4, c13, c0, 0 @ PID 144 mcr p15, 0, r4, c13, c0, 0 @ PID
diff --git a/arch/arm/plat-s3c64xx/cpu.c b/arch/arm/plat-s3c64xx/cpu.c
index fbde183a4560..91f49a3a665d 100644
--- a/arch/arm/plat-s3c64xx/cpu.c
+++ b/arch/arm/plat-s3c64xx/cpu.c
@@ -96,6 +96,11 @@ static struct map_desc s3c_iodesc[] __initdata = {
96 .pfn = __phys_to_pfn(S3C64XX_PA_GPIO), 96 .pfn = __phys_to_pfn(S3C64XX_PA_GPIO),
97 .length = SZ_4K, 97 .length = SZ_4K,
98 .type = MT_DEVICE, 98 .type = MT_DEVICE,
99 }, {
100 .virtual = (unsigned long)S3C64XX_VA_MODEM,
101 .pfn = __phys_to_pfn(S3C64XX_PA_MODEM),
102 .length = SZ_4K,
103 .type = MT_DEVICE,
99 }, 104 },
100}; 105};
101 106
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h b/arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h
new file mode 100644
index 000000000000..82342f6fd27d
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h
@@ -0,0 +1,25 @@
1/* linux/arch/arm/plat-s3c64xx/include/mach/regs-gpio-memport.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - GPIO memory port register definitions
9 */
10
11#ifndef __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H
12#define __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H __FILE__
13
14#define S3C64XX_MEM0CONSTOP S3C64XX_GPIOREG(0x1B0)
15#define S3C64XX_MEM1CONSTOP S3C64XX_GPIOREG(0x1B4)
16
17#define S3C64XX_MEM0CONSLP0 S3C64XX_GPIOREG(0x1C0)
18#define S3C64XX_MEM0CONSLP1 S3C64XX_GPIOREG(0x1C4)
19#define S3C64XX_MEM1CONSLP S3C64XX_GPIOREG(0x1C8)
20
21#define S3C64XX_MEM0DRVCON S3C64XX_GPIOREG(0x1D0)
22#define S3C64XX_MEM1DRVCON S3C64XX_GPIOREG(0x1D4)
23
24#endif /* __ASM_PLAT_S3C64XX_REGS_GPIO_MEMPORT_H */
25
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-gpio.h b/arch/arm/plat-s3c64xx/include/plat/regs-gpio.h
index 75b873d82808..81f7f6e6832e 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-gpio.h
+++ b/arch/arm/plat-s3c64xx/include/plat/regs-gpio.h
@@ -13,23 +13,175 @@
13 13
14/* Base addresses for each of the banks */ 14/* Base addresses for each of the banks */
15 15
16#define S3C64XX_GPA_BASE (S3C64XX_VA_GPIO + 0x0000) 16#define S3C64XX_GPIOREG(reg) (S3C64XX_VA_GPIO + (reg))
17#define S3C64XX_GPB_BASE (S3C64XX_VA_GPIO + 0x0020) 17
18#define S3C64XX_GPC_BASE (S3C64XX_VA_GPIO + 0x0040) 18#define S3C64XX_GPA_BASE S3C64XX_GPIOREG(0x0000)
19#define S3C64XX_GPD_BASE (S3C64XX_VA_GPIO + 0x0060) 19#define S3C64XX_GPB_BASE S3C64XX_GPIOREG(0x0020)
20#define S3C64XX_GPE_BASE (S3C64XX_VA_GPIO + 0x0080) 20#define S3C64XX_GPC_BASE S3C64XX_GPIOREG(0x0040)
21#define S3C64XX_GPF_BASE (S3C64XX_VA_GPIO + 0x00A0) 21#define S3C64XX_GPD_BASE S3C64XX_GPIOREG(0x0060)
22#define S3C64XX_GPG_BASE (S3C64XX_VA_GPIO + 0x00C0) 22#define S3C64XX_GPE_BASE S3C64XX_GPIOREG(0x0080)
23#define S3C64XX_GPH_BASE (S3C64XX_VA_GPIO + 0x00E0) 23#define S3C64XX_GPF_BASE S3C64XX_GPIOREG(0x00A0)
24#define S3C64XX_GPI_BASE (S3C64XX_VA_GPIO + 0x0100) 24#define S3C64XX_GPG_BASE S3C64XX_GPIOREG(0x00C0)
25#define S3C64XX_GPJ_BASE (S3C64XX_VA_GPIO + 0x0120) 25#define S3C64XX_GPH_BASE S3C64XX_GPIOREG(0x00E0)
26#define S3C64XX_GPK_BASE (S3C64XX_VA_GPIO + 0x0800) 26#define S3C64XX_GPI_BASE S3C64XX_GPIOREG(0x0100)
27#define S3C64XX_GPL_BASE (S3C64XX_VA_GPIO + 0x0810) 27#define S3C64XX_GPJ_BASE S3C64XX_GPIOREG(0x0120)
28#define S3C64XX_GPM_BASE (S3C64XX_VA_GPIO + 0x0820) 28#define S3C64XX_GPK_BASE S3C64XX_GPIOREG(0x0800)
29#define S3C64XX_GPN_BASE (S3C64XX_VA_GPIO + 0x0830) 29#define S3C64XX_GPL_BASE S3C64XX_GPIOREG(0x0810)
30#define S3C64XX_GPO_BASE (S3C64XX_VA_GPIO + 0x0140) 30#define S3C64XX_GPM_BASE S3C64XX_GPIOREG(0x0820)
31#define S3C64XX_GPP_BASE (S3C64XX_VA_GPIO + 0x0160) 31#define S3C64XX_GPN_BASE S3C64XX_GPIOREG(0x0830)
32#define S3C64XX_GPQ_BASE (S3C64XX_VA_GPIO + 0x0180) 32#define S3C64XX_GPO_BASE S3C64XX_GPIOREG(0x0140)
33#define S3C64XX_GPP_BASE S3C64XX_GPIOREG(0x0160)
34#define S3C64XX_GPQ_BASE S3C64XX_GPIOREG(0x0180)
35
36/* SPCON */
37
38#define S3C64XX_SPCON S3C64XX_GPIOREG(0x1A0)
39
40#define S3C64XX_SPCON_DRVCON_CAM_MASK (0x3 << 30)
41#define S3C64XX_SPCON_DRVCON_CAM_SHIFT (30)
42#define S3C64XX_SPCON_DRVCON_CAM_2mA (0x0 << 30)
43#define S3C64XX_SPCON_DRVCON_CAM_4mA (0x1 << 30)
44#define S3C64XX_SPCON_DRVCON_CAM_7mA (0x2 << 30)
45#define S3C64XX_SPCON_DRVCON_CAM_9mA (0x3 << 30)
46
47#define S3C64XX_SPCON_DRVCON_HSSPI_MASK (0x3 << 28)
48#define S3C64XX_SPCON_DRVCON_HSSPI_SHIFT (28)
49#define S3C64XX_SPCON_DRVCON_HSSPI_2mA (0x0 << 28)
50#define S3C64XX_SPCON_DRVCON_HSSPI_4mA (0x1 << 28)
51#define S3C64XX_SPCON_DRVCON_HSSPI_7mA (0x2 << 28)
52#define S3C64XX_SPCON_DRVCON_HSSPI_9mA (0x3 << 28)
53
54#define S3C64XX_SPCON_DRVCON_HSMMC_MASK (0x3 << 26)
55#define S3C64XX_SPCON_DRVCON_HSMMC_SHIFT (26)
56#define S3C64XX_SPCON_DRVCON_HSMMC_2mA (0x0 << 26)
57#define S3C64XX_SPCON_DRVCON_HSMMC_4mA (0x1 << 26)
58#define S3C64XX_SPCON_DRVCON_HSMMC_7mA (0x2 << 26)
59#define S3C64XX_SPCON_DRVCON_HSMMC_9mA (0x3 << 26)
60
61#define S3C64XX_SPCON_DRVCON_LCD_MASK (0x3 << 24)
62#define S3C64XX_SPCON_DRVCON_LCD_SHIFT (24)
63#define S3C64XX_SPCON_DRVCON_LCD_2mA (0x0 << 24)
64#define S3C64XX_SPCON_DRVCON_LCD_4mA (0x1 << 24)
65#define S3C64XX_SPCON_DRVCON_LCD_7mA (0x2 << 24)
66#define S3C64XX_SPCON_DRVCON_LCD_9mA (0x3 << 24)
67
68#define S3C64XX_SPCON_DRVCON_MODEM_MASK (0x3 << 22)
69#define S3C64XX_SPCON_DRVCON_MODEM_SHIFT (22)
70#define S3C64XX_SPCON_DRVCON_MODEM_2mA (0x0 << 22)
71#define S3C64XX_SPCON_DRVCON_MODEM_4mA (0x1 << 22)
72#define S3C64XX_SPCON_DRVCON_MODEM_7mA (0x2 << 22)
73#define S3C64XX_SPCON_DRVCON_MODEM_9mA (0x3 << 22)
74
75#define S3C64XX_SPCON_nRSTOUT_OEN (1 << 21)
76
77#define S3C64XX_SPCON_DRVCON_SPICLK1_MASK (0x3 << 18)
78#define S3C64XX_SPCON_DRVCON_SPICLK1_SHIFT (18)
79#define S3C64XX_SPCON_DRVCON_SPICLK1_2mA (0x0 << 18)
80#define S3C64XX_SPCON_DRVCON_SPICLK1_4mA (0x1 << 18)
81#define S3C64XX_SPCON_DRVCON_SPICLK1_7mA (0x2 << 18)
82#define S3C64XX_SPCON_DRVCON_SPICLK1_9mA (0x3 << 18)
83
84#define S3C64XX_SPCON_MEM1_DQS_PUD_MASK (0x3 << 16)
85#define S3C64XX_SPCON_MEM1_DQS_PUD_SHIFT (16)
86#define S3C64XX_SPCON_MEM1_DQS_PUD_DISABLED (0x0 << 16)
87#define S3C64XX_SPCON_MEM1_DQS_PUD_DOWN (0x1 << 16)
88#define S3C64XX_SPCON_MEM1_DQS_PUD_UP (0x2 << 16)
89
90#define S3C64XX_SPCON_MEM1_D_PUD1_MASK (0x3 << 14)
91#define S3C64XX_SPCON_MEM1_D_PUD1_SHIFT (14)
92#define S3C64XX_SPCON_MEM1_D_PUD1_DISABLED (0x0 << 14)
93#define S3C64XX_SPCON_MEM1_D_PUD1_DOWN (0x1 << 14)
94#define S3C64XX_SPCON_MEM1_D_PUD1_UP (0x2 << 14)
95
96#define S3C64XX_SPCON_MEM1_D_PUD0_MASK (0x3 << 12)
97#define S3C64XX_SPCON_MEM1_D_PUD0_SHIFT (12)
98#define S3C64XX_SPCON_MEM1_D_PUD0_DISABLED (0x0 << 12)
99#define S3C64XX_SPCON_MEM1_D_PUD0_DOWN (0x1 << 12)
100#define S3C64XX_SPCON_MEM1_D_PUD0_UP (0x2 << 12)
101
102#define S3C64XX_SPCON_MEM0_D_PUD_MASK (0x3 << 8)
103#define S3C64XX_SPCON_MEM0_D_PUD_SHIFT (8)
104#define S3C64XX_SPCON_MEM0_D_PUD_DISABLED (0x0 << 8)
105#define S3C64XX_SPCON_MEM0_D_PUD_DOWN (0x1 << 8)
106#define S3C64XX_SPCON_MEM0_D_PUD_UP (0x2 << 8)
107
108#define S3C64XX_SPCON_USBH_DMPD (1 << 7)
109#define S3C64XX_SPCON_USBH_DPPD (1 << 6)
110#define S3C64XX_SPCON_USBH_PUSW2 (1 << 5)
111#define S3C64XX_SPCON_USBH_PUSW1 (1 << 4)
112#define S3C64XX_SPCON_USBH_SUSPND (1 << 3)
113
114#define S3C64XX_SPCON_LCD_SEL_MASK (0x3 << 0)
115#define S3C64XX_SPCON_LCD_SEL_SHIFT (0)
116#define S3C64XX_SPCON_LCD_SEL_HOST (0x0 << 0)
117#define S3C64XX_SPCON_LCD_SEL_RGB (0x1 << 0)
118#define S3C64XX_SPCON_LCD_SEL_606_656 (0x2 << 0)
119
120
121/* External interrupt registers */
122
123#define S3C64XX_EINT12CON S3C64XX_GPIOREG(0x200)
124#define S3C64XX_EINT34CON S3C64XX_GPIOREG(0x204)
125#define S3C64XX_EINT56CON S3C64XX_GPIOREG(0x208)
126#define S3C64XX_EINT78CON S3C64XX_GPIOREG(0x20C)
127#define S3C64XX_EINT9CON S3C64XX_GPIOREG(0x210)
128
129#define S3C64XX_EINT12FLTCON S3C64XX_GPIOREG(0x220)
130#define S3C64XX_EINT34FLTCON S3C64XX_GPIOREG(0x224)
131#define S3C64XX_EINT56FLTCON S3C64XX_GPIOREG(0x228)
132#define S3C64XX_EINT78FLTCON S3C64XX_GPIOREG(0x22C)
133#define S3C64XX_EINT9FLTCON S3C64XX_GPIOREG(0x230)
134
135#define S3C64XX_EINT12MASK S3C64XX_GPIOREG(0x240)
136#define S3C64XX_EINT34MASK S3C64XX_GPIOREG(0x244)
137#define S3C64XX_EINT56MASK S3C64XX_GPIOREG(0x248)
138#define S3C64XX_EINT78MASK S3C64XX_GPIOREG(0x24C)
139#define S3C64XX_EINT9MASK S3C64XX_GPIOREG(0x250)
140
141#define S3C64XX_EINT12PEND S3C64XX_GPIOREG(0x260)
142#define S3C64XX_EINT34PEND S3C64XX_GPIOREG(0x264)
143#define S3C64XX_EINT56PEND S3C64XX_GPIOREG(0x268)
144#define S3C64XX_EINT78PEND S3C64XX_GPIOREG(0x26C)
145#define S3C64XX_EINT9PEND S3C64XX_GPIOREG(0x270)
146
147#define S3C64XX_PRIORITY S3C64XX_GPIOREG(0x280)
148#define S3C64XX_PRIORITY_ARB(x) (1 << (x))
149
150#define S3C64XX_SERVICE S3C64XX_GPIOREG(0x284)
151#define S3C64XX_SERVICEPEND S3C64XX_GPIOREG(0x288)
152
153#define S3C64XX_EINT0CON0 S3C64XX_GPIOREG(0x900)
154#define S3C64XX_EINT0CON1 S3C64XX_GPIOREG(0x904)
155#define S3C64XX_EINT0FLTCON0 S3C64XX_GPIOREG(0x910)
156#define S3C64XX_EINT0FLTCON1 S3C64XX_GPIOREG(0x914)
157#define S3C64XX_EINT0FLTCON2 S3C64XX_GPIOREG(0x918)
158#define S3C64XX_EINT0FLTCON3 S3C64XX_GPIOREG(0x91C)
159
160#define S3C64XX_EINT0MASK S3C64XX_GPIOREG(0x920)
161#define S3C64XX_EINT0PEND S3C64XX_GPIOREG(0x924)
162
163/* GPIO sleep configuration */
164
165#define S3C64XX_SPCONSLP S3C64XX_GPIOREG(0x880)
166
167#define S3C64XX_SPCONSLP_TDO_PULLDOWN (1 << 14)
168#define S3C64XX_SPCONSLP_CKE1INIT (1 << 5)
169
170#define S3C64XX_SPCONSLP_RSTOUT_MASK (0x3 << 12)
171#define S3C64XX_SPCONSLP_RSTOUT_OUT0 (0x0 << 12)
172#define S3C64XX_SPCONSLP_RSTOUT_OUT1 (0x1 << 12)
173#define S3C64XX_SPCONSLP_RSTOUT_HIZ (0x2 << 12)
174
175#define S3C64XX_SPCONSLP_KPCOL_MASK (0x3 << 0)
176#define S3C64XX_SPCONSLP_KPCOL_OUT0 (0x0 << 0)
177#define S3C64XX_SPCONSLP_KPCOL_OUT1 (0x1 << 0)
178#define S3C64XX_SPCONSLP_KPCOL_INP (0x2 << 0)
179
180
181#define S3C64XX_SLPEN S3C64XX_GPIOREG(0x930)
182
183#define S3C64XX_SLPEN_USE_xSLP (1 << 0)
184#define S3C64XX_SLPEN_CFG_BYSLPEN (1 << 1)
33 185
34#endif /* __ASM_PLAT_S3C64XX_REGS_GPIO_H */ 186#endif /* __ASM_PLAT_S3C64XX_REGS_GPIO_H */
35 187
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-modem.h b/arch/arm/plat-s3c64xx/include/plat/regs-modem.h
new file mode 100644
index 000000000000..49f7759dedfa
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/include/plat/regs-modem.h
@@ -0,0 +1,31 @@
1/* arch/arm/plat-s3c64xx/include/plat/regs-modem.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 - modem block registers
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#ifndef __PLAT_S3C64XX_REGS_MODEM_H
16#define __PLAT_S3C64XX_REGS_MODEM_H __FILE__
17
18#define S3C64XX_MODEMREG(x) (S3C64XX_VA_MODEM + (x))
19
20#define S3C64XX_MODEM_INT2AP S3C64XX_MODEMREG(0x0)
21#define S3C64XX_MODEM_INT2MODEM S3C64XX_MODEMREG(0x4)
22#define S3C64XX_MODEM_MIFCON S3C64XX_MODEMREG(0x8)
23#define S3C64XX_MODEM_MIFPCON S3C64XX_MODEMREG(0xC)
24#define S3C64XX_MODEM_INTCLR S3C64XX_MODEMREG(0x10)
25#define S3C64XX_MODEM_DMA_TXADDR S3C64XX_MODEMREG(0x14)
26#define S3C64XX_MODEM_DMA_RXADDR S3C64XX_MODEMREG(0x18)
27
28#define MIFPCON_INT2M_LEVEL (1 << 4)
29#define MIFPCON_LCD_BYPASS (1 << 3)
30
31#endif /* __PLAT_S3C64XX_REGS_MODEM_H */
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-sys.h b/arch/arm/plat-s3c64xx/include/plat/regs-sys.h
index d8ed82917096..69b78d9f83b8 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-sys.h
+++ b/arch/arm/plat-s3c64xx/include/plat/regs-sys.h
@@ -17,6 +17,10 @@
17 17
18#define S3C_SYSREG(x) (S3C_VA_SYS + (x)) 18#define S3C_SYSREG(x) (S3C_VA_SYS + (x))
19 19
20#define S3C64XX_AHB_CON0 S3C_SYSREG(0x100)
21#define S3C64XX_AHB_CON1 S3C_SYSREG(0x104)
22#define S3C64XX_AHB_CON2 S3C_SYSREG(0x108)
23
20#define S3C64XX_OTHERS S3C_SYSREG(0x900) 24#define S3C64XX_OTHERS S3C_SYSREG(0x900)
21 25
22#define S3C64XX_OTHERS_USBMASK (1 << 16) 26#define S3C64XX_OTHERS_USBMASK (1 << 16)
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h b/arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h
new file mode 100644
index 000000000000..270d96ac9705
--- /dev/null
+++ b/arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h
@@ -0,0 +1,116 @@
1/* arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.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 - syscon power and sleep control registers
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#ifndef __PLAT_S3C64XX_REGS_SYSCON_POWER_H
16#define __PLAT_S3C64XX_REGS_SYSCON_POWER_H __FILE__
17
18#define S3C64XX_PWR_CFG S3C_SYSREG(0x804)
19
20#define S3C64XX_PWRCFG_OSC_OTG_DISABLE (1 << 17)
21#define S3C64XX_PWRCFG_MMC2_DISABLE (1 << 16)
22#define S3C64XX_PWRCFG_MMC1_DISABLE (1 << 15)
23#define S3C64XX_PWRCFG_MMC0_DISABLE (1 << 14)
24#define S3C64XX_PWRCFG_HSI_DISABLE (1 << 13)
25#define S3C64XX_PWRCFG_TS_DISABLE (1 << 12)
26#define S3C64XX_PWRCFG_RTC_TICK_DISABLE (1 << 11)
27#define S3C64XX_PWRCFG_RTC_ALARM_DISABLE (1 << 10)
28#define S3C64XX_PWRCFG_MSM_DISABLE (1 << 9)
29#define S3C64XX_PWRCFG_KEY_DISABLE (1 << 8)
30#define S3C64XX_PWRCFG_BATF_DISABLE (1 << 7)
31
32#define S3C64XX_PWRCFG_CFG_WFI_MASK (0x3 << 5)
33#define S3C64XX_PWRCFG_CFG_WFI_SHIFT (5)
34#define S3C64XX_PWRCFG_CFG_WFI_IGNORE (0x0 << 5)
35#define S3C64XX_PWRCFG_CFG_WFI_IDLE (0x1 << 5)
36#define S3C64XX_PWRCFG_CFG_WFI_STOP (0x2 << 5)
37#define S3C64XX_PWRCFG_CFG_WFI_SLEEP (0x3 << 5)
38
39#define S3C64XX_PWRCFG_CFG_BATFLT_MASK (0x3 << 3)
40#define S3C64XX_PWRCFG_CFG_BATFLT_SHIFT (3)
41#define S3C64XX_PWRCFG_CFG_BATFLT_IGNORE (0x0 << 3)
42#define S3C64XX_PWRCFG_CFG_BATFLT_IRQ (0x1 << 3)
43#define S3C64XX_PWRCFG_CFG_BATFLT_SLEEP (0x3 << 3)
44
45#define S3C64XX_PWRCFG_CFG_BAT_WAKE (1 << 2)
46#define S3C64XX_PWRCFG_OSC27_EN (1 << 0)
47
48#define S3C64XX_EINT_MASK S3C_SYSREG(0x808)
49
50#define S3C64XX_NORMAL_CFG S3C_SYSREG(0x810)
51
52#define S3C64XX_NORMALCFG_IROM_ON (1 << 30)
53#define S3C64XX_NORMALCFG_DOMAIN_ETM_ON (1 << 16)
54#define S3C64XX_NORMALCFG_DOMAIN_S_ON (1 << 15)
55#define S3C64XX_NORMALCFG_DOMAIN_F_ON (1 << 14)
56#define S3C64XX_NORMALCFG_DOMAIN_P_ON (1 << 13)
57#define S3C64XX_NORMALCFG_DOMAIN_I_ON (1 << 12)
58#define S3C64XX_NORMALCFG_DOMAIN_G_ON (1 << 10)
59#define S3C64XX_NORMALCFG_DOMAIN_V_ON (1 << 9)
60
61#define S3C64XX_STOP_CFG S3C_SYSREG(0x814)
62
63#define S3C64XX_STOPCFG_MEMORY_ARM_ON (1 << 29)
64#define S3C64XX_STOPCFG_TOP_MEMORY_ON (1 << 20)
65#define S3C64XX_STOPCFG_ARM_LOGIC_ON (1 << 17)
66#define S3C64XX_STOPCFG_TOP_LOGIC_ON (1 << 8)
67#define S3C64XX_STOPCFG_OSC_EN (1 << 0)
68
69#define S3C64XX_SLEEP_CFG S3C_SYSREG(0x818)
70
71#define S3C64XX_SLEEPCFG_OSC_EN (1 << 0)
72
73#define S3C64XX_STOP_MEM_CFG S3C_SYSREG(0x81c)
74
75#define S3C64XX_STOPMEMCFG_MODEMIF_RETAIN (1 << 6)
76#define S3C64XX_STOPMEMCFG_HOSTIF_RETAIN (1 << 5)
77#define S3C64XX_STOPMEMCFG_OTG_RETAIN (1 << 4)
78#define S3C64XX_STOPMEMCFG_HSMCC_RETAIN (1 << 3)
79#define S3C64XX_STOPMEMCFG_IROM_RETAIN (1 << 2)
80#define S3C64XX_STOPMEMCFG_IRDA_RETAIN (1 << 1)
81#define S3C64XX_STOPMEMCFG_NFCON_RETAIN (1 << 0)
82
83#define S3C64XX_OSC_STABLE S3C_SYSREG(0x824)
84#define S3C64XX_PWR_STABLE S3C_SYSREG(0x828)
85
86#define S3C64XX_WAKEUP_STAT S3C_SYSREG(0x908)
87
88#define S3C64XX_WAKEUPSTAT_MMC2 (1 << 11)
89#define S3C64XX_WAKEUPSTAT_MMC1 (1 << 10)
90#define S3C64XX_WAKEUPSTAT_MMC0 (1 << 9)
91#define S3C64XX_WAKEUPSTAT_HSI (1 << 8)
92#define S3C64XX_WAKEUPSTAT_BATFLT (1 << 6)
93#define S3C64XX_WAKEUPSTAT_MSM (1 << 5)
94#define S3C64XX_WAKEUPSTAT_KEY (1 << 4)
95#define S3C64XX_WAKEUPSTAT_TS (1 << 3)
96#define S3C64XX_WAKEUPSTAT_RTC_TICK (1 << 2)
97#define S3C64XX_WAKEUPSTAT_RTC_ALARM (1 << 1)
98#define S3C64XX_WAKEUPSTAT_EINT (1 << 0)
99
100#define S3C64XX_BLK_PWR_STAT S3C_SYSREG(0x90c)
101
102#define S3C64XX_BLKPWRSTAT_G (1 << 7)
103#define S3C64XX_BLKPWRSTAT_ETM (1 << 6)
104#define S3C64XX_BLKPWRSTAT_S (1 << 5)
105#define S3C64XX_BLKPWRSTAT_F (1 << 4)
106#define S3C64XX_BLKPWRSTAT_P (1 << 3)
107#define S3C64XX_BLKPWRSTAT_I (1 << 2)
108#define S3C64XX_BLKPWRSTAT_V (1 << 1)
109#define S3C64XX_BLKPWRSTAT_TOP (1 << 0)
110
111#define S3C64XX_INFORM0 S3C_SYSREG(0xA00)
112#define S3C64XX_INFORM1 S3C_SYSREG(0xA04)
113#define S3C64XX_INFORM2 S3C_SYSREG(0xA08)
114#define S3C64XX_INFORM3 S3C_SYSREG(0xA0C)
115
116#endif /* __PLAT_S3C64XX_REGS_SYSCON_POWER_H */
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c
index cf524826c93a..47e5155bb13e 100644
--- a/arch/arm/plat-s3c64xx/irq-eint.c
+++ b/arch/arm/plat-s3c64xx/irq-eint.c
@@ -27,20 +27,6 @@
27#include <mach/map.h> 27#include <mach/map.h>
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29 29
30/* GPIO is 0x7F008xxx, */
31#define S3C64XX_GPIOREG(x) (S3C64XX_VA_GPIO + (x))
32
33#define S3C64XX_EINT0CON0 S3C64XX_GPIOREG(0x900)
34#define S3C64XX_EINT0CON1 S3C64XX_GPIOREG(0x904)
35#define S3C64XX_EINT0FLTCON0 S3C64XX_GPIOREG(0x910)
36#define S3C64XX_EINT0FLTCON1 S3C64XX_GPIOREG(0x914)
37#define S3C64XX_EINT0FLTCON2 S3C64XX_GPIOREG(0x918)
38#define S3C64XX_EINT0FLTCON3 S3C64XX_GPIOREG(0x91C)
39
40#define S3C64XX_EINT0MASK S3C64XX_GPIOREG(0x920)
41#define S3C64XX_EINT0PEND S3C64XX_GPIOREG(0x924)
42
43
44#define eint_offset(irq) ((irq) - IRQ_EINT(0)) 30#define eint_offset(irq) ((irq) - IRQ_EINT(0))
45#define eint_irq_to_bit(irq) (1 << eint_offset(irq)) 31#define eint_irq_to_bit(irq) (1 << eint_offset(irq))
46 32
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index b4211d8b2ac7..945e0d237a1d 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: Thu Mar 12 18:01:45 2009 15# Last update: Mon Mar 23 20:09:01 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#
@@ -2124,3 +2124,11 @@ mx27wallace MACH_MX27WALLACE MX27WALLACE 2133
2124fmzwebmodul MACH_FMZWEBMODUL FMZWEBMODUL 2134 2124fmzwebmodul MACH_FMZWEBMODUL FMZWEBMODUL 2134
2125rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135 2125rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135
2126smallogger MACH_SMALLOGGER SMALLOGGER 2136 2126smallogger MACH_SMALLOGGER SMALLOGGER 2136
2127ccw9p9215 MACH_CCW9P9215 CCW9P9215 2137
2128dm355_leopard MACH_DM355_LEOPARD DM355_LEOPARD 2138
2129ts219 MACH_TS219 TS219 2139
2130tny_a9263 MACH_TNY_A9263 TNY_A9263 2140
2131apollo MACH_APOLLO APOLLO 2141
2132at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142
2133spc300 MACH_SPC300 SPC300 2143
2134eko MACH_EKO EKO 2144
diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
index 8de86e4feada..c8c98dd44ad4 100644
--- a/arch/arm/vfp/vfp.h
+++ b/arch/arm/vfp/vfp.h
@@ -377,6 +377,4 @@ struct op {
377 u32 flags; 377 u32 flags;
378}; 378};
379 379
380#if defined(CONFIG_SMP) || defined(CONFIG_PM)
381extern void vfp_save_state(void *location, u32 fpexc); 380extern void vfp_save_state(void *location, u32 fpexc);
382#endif
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index c92a08bd6a86..a5a4e57763c3 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -172,7 +172,6 @@ process_exception:
172 @ retry the faulted instruction 172 @ retry the faulted instruction
173ENDPROC(vfp_support_entry) 173ENDPROC(vfp_support_entry)
174 174
175#if defined(CONFIG_SMP) || defined(CONFIG_PM)
176ENTRY(vfp_save_state) 175ENTRY(vfp_save_state)
177 @ Save the current VFP state 176 @ Save the current VFP state
178 @ r0 - save location 177 @ r0 - save location
@@ -190,7 +189,6 @@ ENTRY(vfp_save_state)
190 stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2 189 stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2
191 mov pc, lr 190 mov pc, lr
192ENDPROC(vfp_save_state) 191ENDPROC(vfp_save_state)
193#endif
194 192
195last_VFP_context_address: 193last_VFP_context_address:
196 .word last_VFP_context 194 .word last_VFP_context
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 9f476a1be2ca..75457b30d813 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -377,6 +377,55 @@ static void vfp_pm_init(void)
377static inline void vfp_pm_init(void) { } 377static inline void vfp_pm_init(void) { }
378#endif /* CONFIG_PM */ 378#endif /* CONFIG_PM */
379 379
380/*
381 * Synchronise the hardware VFP state of a thread other than current with the
382 * saved one. This function is used by the ptrace mechanism.
383 */
384#ifdef CONFIG_SMP
385void vfp_sync_state(struct thread_info *thread)
386{
387 /*
388 * On SMP systems, the VFP state is automatically saved at every
389 * context switch. We mark the thread VFP state as belonging to a
390 * non-existent CPU so that the saved one will be reloaded when
391 * needed.
392 */
393 thread->vfpstate.hard.cpu = NR_CPUS;
394}
395#else
396void vfp_sync_state(struct thread_info *thread)
397{
398 unsigned int cpu = get_cpu();
399 u32 fpexc = fmrx(FPEXC);
400
401 /*
402 * If VFP is enabled, the previous state was already saved and
403 * last_VFP_context updated.
404 */
405 if (fpexc & FPEXC_EN)
406 goto out;
407
408 if (!last_VFP_context[cpu])
409 goto out;
410
411 /*
412 * Save the last VFP state on this CPU.
413 */
414 fmxr(FPEXC, fpexc | FPEXC_EN);
415 vfp_save_state(last_VFP_context[cpu], fpexc);
416 fmxr(FPEXC, fpexc);
417
418 /*
419 * Set the context to NULL to force a reload the next time the thread
420 * uses the VFP.
421 */
422 last_VFP_context[cpu] = NULL;
423
424out:
425 put_cpu();
426}
427#endif
428
380#include <linux/smp.h> 429#include <linux/smp.h>
381 430
382/* 431/*
@@ -427,6 +476,18 @@ static int __init vfp_init(void)
427 * in place; report VFP support to userspace. 476 * in place; report VFP support to userspace.
428 */ 477 */
429 elf_hwcap |= HWCAP_VFP; 478 elf_hwcap |= HWCAP_VFP;
479#ifdef CONFIG_VFPv3
480 if (VFP_arch >= 3) {
481 elf_hwcap |= HWCAP_VFPv3;
482
483 /*
484 * Check for VFPv3 D16. CPUs in this configuration
485 * only have 16 x 64bit registers.
486 */
487 if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1)
488 elf_hwcap |= HWCAP_VFPv3D16;
489 }
490#endif
430#ifdef CONFIG_NEON 491#ifdef CONFIG_NEON
431 /* 492 /*
432 * Check for the presence of the Advanced SIMD 493 * Check for the presence of the Advanced SIMD
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index b189680d18b0..05fe3053dcae 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -181,7 +181,7 @@ source "kernel/Kconfig.preempt"
181config QUICKLIST 181config QUICKLIST
182 def_bool y 182 def_bool y
183 183
184config HAVE_ARCH_BOOTMEM_NODE 184config HAVE_ARCH_BOOTMEM
185 def_bool n 185 def_bool n
186 186
187config ARCH_HAVE_MEMORY_PRESENT 187config ARCH_HAVE_MEMORY_PRESENT
diff --git a/arch/avr32/boards/hammerhead/flash.c b/arch/avr32/boards/hammerhead/flash.c
index a98c6dd3a028..559bbcb03f9b 100644
--- a/arch/avr32/boards/hammerhead/flash.c
+++ b/arch/avr32/boards/hammerhead/flash.c
@@ -15,7 +15,6 @@
15#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
16#include <linux/usb/isp116x.h> 16#include <linux/usb/isp116x.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/platform_device.h>
19#include <linux/delay.h> 18#include <linux/delay.h>
20 19
21#include <mach/portmux.h> 20#include <mach/portmux.h>
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h
index 35863f260929..04c860619700 100644
--- a/arch/avr32/include/asm/socket.h
+++ b/arch/avr32/include/asm/socket.h
@@ -54,4 +54,7 @@
54 54
55#define SO_MARK 36 55#define SO_MARK 36
56 56
57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
57#endif /* __ASM_AVR32_SOCKET_H */ 60#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/avr32/include/asm/swab.h b/arch/avr32/include/asm/swab.h
index a14aa5b46d98..14cc737bbca6 100644
--- a/arch/avr32/include/asm/swab.h
+++ b/arch/avr32/include/asm/swab.h
@@ -4,7 +4,7 @@
4#ifndef __ASM_AVR32_SWAB_H 4#ifndef __ASM_AVR32_SWAB_H
5#define __ASM_AVR32_SWAB_H 5#define __ASM_AVR32_SWAB_H
6 6
7#include <asm/types.h> 7#include <linux/types.h>
8#include <linux/compiler.h> 8#include <linux/compiler.h>
9 9
10#define __SWAB_64_THRU_32__ 10#define __SWAB_64_THRU_32__
diff --git a/arch/avr32/include/asm/uaccess.h b/arch/avr32/include/asm/uaccess.h
index ed092395215e..245b2ee213c9 100644
--- a/arch/avr32/include/asm/uaccess.h
+++ b/arch/avr32/include/asm/uaccess.h
@@ -230,10 +230,10 @@ extern int __put_user_bad(void);
230 asm volatile( \ 230 asm volatile( \
231 "1: ld." suffix " %1, %3 \n" \ 231 "1: ld." suffix " %1, %3 \n" \
232 "2: \n" \ 232 "2: \n" \
233 " .section .fixup, \"ax\" \n" \ 233 " .subsection 1 \n" \
234 "3: mov %0, %4 \n" \ 234 "3: mov %0, %4 \n" \
235 " rjmp 2b \n" \ 235 " rjmp 2b \n" \
236 " .previous \n" \ 236 " .subsection 0 \n" \
237 " .section __ex_table, \"a\" \n" \ 237 " .section __ex_table, \"a\" \n" \
238 " .long 1b, 3b \n" \ 238 " .long 1b, 3b \n" \
239 " .previous \n" \ 239 " .previous \n" \
@@ -295,10 +295,10 @@ extern int __put_user_bad(void);
295 asm volatile( \ 295 asm volatile( \
296 "1: st." suffix " %1, %3 \n" \ 296 "1: st." suffix " %1, %3 \n" \
297 "2: \n" \ 297 "2: \n" \
298 " .section .fixup, \"ax\" \n" \ 298 " .subsection 1 \n" \
299 "3: mov %0, %4 \n" \ 299 "3: mov %0, %4 \n" \
300 " rjmp 2b \n" \ 300 " rjmp 2b \n" \
301 " .previous \n" \ 301 " .subsection 0 \n" \
302 " .section __ex_table, \"a\" \n" \ 302 " .section __ex_table, \"a\" \n" \
303 " .long 1b, 3b \n" \ 303 " .long 1b, 3b \n" \
304 " .previous \n" \ 304 " .previous \n" \
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index 33d49377b8be..009a80155d67 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -150,10 +150,10 @@ page_not_present:
150 tlbmiss_restore 150 tlbmiss_restore
151 sub sp, 4 151 sub sp, 4
152 stmts --sp, r0-lr 152 stmts --sp, r0-lr
153 rcall save_full_context_ex 153 call save_full_context_ex
154 mfsr r12, SYSREG_ECR 154 mfsr r12, SYSREG_ECR
155 mov r11, sp 155 mov r11, sp
156 rcall do_page_fault 156 call do_page_fault
157 rjmp ret_from_exception 157 rjmp ret_from_exception
158 158
159 .align 2 159 .align 2
@@ -250,7 +250,7 @@ syscall_badsys:
250 250
251 .global ret_from_fork 251 .global ret_from_fork
252ret_from_fork: 252ret_from_fork:
253 rcall schedule_tail 253 call schedule_tail
254 254
255 /* check for syscall tracing */ 255 /* check for syscall tracing */
256 get_thread_info r0 256 get_thread_info r0
@@ -261,7 +261,7 @@ ret_from_fork:
261 261
262syscall_trace_enter: 262syscall_trace_enter:
263 pushm r8-r12 263 pushm r8-r12
264 rcall syscall_trace 264 call syscall_trace
265 popm r8-r12 265 popm r8-r12
266 rjmp syscall_trace_cont 266 rjmp syscall_trace_cont
267 267
@@ -269,14 +269,14 @@ syscall_exit_work:
269 bld r1, TIF_SYSCALL_TRACE 269 bld r1, TIF_SYSCALL_TRACE
270 brcc 1f 270 brcc 1f
271 unmask_interrupts 271 unmask_interrupts
272 rcall syscall_trace 272 call syscall_trace
273 mask_interrupts 273 mask_interrupts
274 ld.w r1, r0[TI_flags] 274 ld.w r1, r0[TI_flags]
275 275
2761: bld r1, TIF_NEED_RESCHED 2761: bld r1, TIF_NEED_RESCHED
277 brcc 2f 277 brcc 2f
278 unmask_interrupts 278 unmask_interrupts
279 rcall schedule 279 call schedule
280 mask_interrupts 280 mask_interrupts
281 ld.w r1, r0[TI_flags] 281 ld.w r1, r0[TI_flags]
282 rjmp 1b 282 rjmp 1b
@@ -287,7 +287,7 @@ syscall_exit_work:
287 unmask_interrupts 287 unmask_interrupts
288 mov r12, sp 288 mov r12, sp
289 mov r11, r0 289 mov r11, r0
290 rcall do_notify_resume 290 call do_notify_resume
291 mask_interrupts 291 mask_interrupts
292 ld.w r1, r0[TI_flags] 292 ld.w r1, r0[TI_flags]
293 rjmp 1b 293 rjmp 1b
@@ -394,7 +394,7 @@ handle_critical:
394 394
395 mfsr r12, SYSREG_ECR 395 mfsr r12, SYSREG_ECR
396 mov r11, sp 396 mov r11, sp
397 rcall do_critical_exception 397 call do_critical_exception
398 398
399 /* We should never get here... */ 399 /* We should never get here... */
400bad_return: 400bad_return:
@@ -407,18 +407,18 @@ bad_return:
407do_bus_error_write: 407do_bus_error_write:
408 sub sp, 4 408 sub sp, 4
409 stmts --sp, r0-lr 409 stmts --sp, r0-lr
410 rcall save_full_context_ex 410 call save_full_context_ex
411 mov r11, 1 411 mov r11, 1
412 rjmp 1f 412 rjmp 1f
413 413
414do_bus_error_read: 414do_bus_error_read:
415 sub sp, 4 415 sub sp, 4
416 stmts --sp, r0-lr 416 stmts --sp, r0-lr
417 rcall save_full_context_ex 417 call save_full_context_ex
418 mov r11, 0 418 mov r11, 0
4191: mfsr r12, SYSREG_BEAR 4191: mfsr r12, SYSREG_BEAR
420 mov r10, sp 420 mov r10, sp
421 rcall do_bus_error 421 call do_bus_error
422 rjmp ret_from_exception 422 rjmp ret_from_exception
423 423
424 .align 1 424 .align 1
@@ -433,7 +433,7 @@ do_nmi_ll:
4331: pushm r8, r9 /* PC and SR */ 4331: pushm r8, r9 /* PC and SR */
434 mfsr r12, SYSREG_ECR 434 mfsr r12, SYSREG_ECR
435 mov r11, sp 435 mov r11, sp
436 rcall do_nmi 436 call do_nmi
437 popm r8-r9 437 popm r8-r9
438 mtsr SYSREG_RAR_NMI, r8 438 mtsr SYSREG_RAR_NMI, r8
439 tst r0, r0 439 tst r0, r0
@@ -457,29 +457,29 @@ do_nmi_ll:
457handle_address_fault: 457handle_address_fault:
458 sub sp, 4 458 sub sp, 4
459 stmts --sp, r0-lr 459 stmts --sp, r0-lr
460 rcall save_full_context_ex 460 call save_full_context_ex
461 mfsr r12, SYSREG_ECR 461 mfsr r12, SYSREG_ECR
462 mov r11, sp 462 mov r11, sp
463 rcall do_address_exception 463 call do_address_exception
464 rjmp ret_from_exception 464 rjmp ret_from_exception
465 465
466handle_protection_fault: 466handle_protection_fault:
467 sub sp, 4 467 sub sp, 4
468 stmts --sp, r0-lr 468 stmts --sp, r0-lr
469 rcall save_full_context_ex 469 call save_full_context_ex
470 mfsr r12, SYSREG_ECR 470 mfsr r12, SYSREG_ECR
471 mov r11, sp 471 mov r11, sp
472 rcall do_page_fault 472 call do_page_fault
473 rjmp ret_from_exception 473 rjmp ret_from_exception
474 474
475 .align 1 475 .align 1
476do_illegal_opcode_ll: 476do_illegal_opcode_ll:
477 sub sp, 4 477 sub sp, 4
478 stmts --sp, r0-lr 478 stmts --sp, r0-lr
479 rcall save_full_context_ex 479 call save_full_context_ex
480 mfsr r12, SYSREG_ECR 480 mfsr r12, SYSREG_ECR
481 mov r11, sp 481 mov r11, sp
482 rcall do_illegal_opcode 482 call do_illegal_opcode
483 rjmp ret_from_exception 483 rjmp ret_from_exception
484 484
485do_dtlb_modified: 485do_dtlb_modified:
@@ -513,11 +513,11 @@ do_dtlb_modified:
513do_fpe_ll: 513do_fpe_ll:
514 sub sp, 4 514 sub sp, 4
515 stmts --sp, r0-lr 515 stmts --sp, r0-lr
516 rcall save_full_context_ex 516 call save_full_context_ex
517 unmask_interrupts 517 unmask_interrupts
518 mov r12, 26 518 mov r12, 26
519 mov r11, sp 519 mov r11, sp
520 rcall do_fpe 520 call do_fpe
521 rjmp ret_from_exception 521 rjmp ret_from_exception
522 522
523ret_from_exception: 523ret_from_exception:
@@ -553,7 +553,7 @@ fault_resume_kernel:
553 lddsp r4, sp[REG_SR] 553 lddsp r4, sp[REG_SR]
554 bld r4, SYSREG_GM_OFFSET 554 bld r4, SYSREG_GM_OFFSET
555 brcs 1f 555 brcs 1f
556 rcall preempt_schedule_irq 556 call preempt_schedule_irq
5571: 5571:
558#endif 558#endif
559 559
@@ -582,7 +582,7 @@ fault_exit_work:
582 bld r1, TIF_NEED_RESCHED 582 bld r1, TIF_NEED_RESCHED
583 brcc 1f 583 brcc 1f
584 unmask_interrupts 584 unmask_interrupts
585 rcall schedule 585 call schedule
586 mask_interrupts 586 mask_interrupts
587 ld.w r1, r0[TI_flags] 587 ld.w r1, r0[TI_flags]
588 rjmp fault_exit_work 588 rjmp fault_exit_work
@@ -593,7 +593,7 @@ fault_exit_work:
593 unmask_interrupts 593 unmask_interrupts
594 mov r12, sp 594 mov r12, sp
595 mov r11, r0 595 mov r11, r0
596 rcall do_notify_resume 596 call do_notify_resume
597 mask_interrupts 597 mask_interrupts
598 ld.w r1, r0[TI_flags] 598 ld.w r1, r0[TI_flags]
599 rjmp fault_exit_work 599 rjmp fault_exit_work
@@ -616,10 +616,10 @@ handle_debug:
616 616
617.Ldebug_fixup_cont: 617.Ldebug_fixup_cont:
618#ifdef CONFIG_TRACE_IRQFLAGS 618#ifdef CONFIG_TRACE_IRQFLAGS
619 rcall trace_hardirqs_off 619 call trace_hardirqs_off
620#endif 620#endif
621 mov r12, sp 621 mov r12, sp
622 rcall do_debug 622 call do_debug
623 mov sp, r12 623 mov sp, r12
624 624
625 lddsp r2, sp[REG_SR] 625 lddsp r2, sp[REG_SR]
@@ -643,7 +643,7 @@ handle_debug:
643 mtsr SYSREG_RSR_DBG, r11 643 mtsr SYSREG_RSR_DBG, r11
644 mtsr SYSREG_RAR_DBG, r10 644 mtsr SYSREG_RAR_DBG, r10
645#ifdef CONFIG_TRACE_IRQFLAGS 645#ifdef CONFIG_TRACE_IRQFLAGS
646 rcall trace_hardirqs_on 646 call trace_hardirqs_on
6471: 6471:
648#endif 648#endif
649 ldmts sp++, r0-lr 649 ldmts sp++, r0-lr
@@ -676,7 +676,7 @@ debug_resume_kernel:
676#ifdef CONFIG_TRACE_IRQFLAGS 676#ifdef CONFIG_TRACE_IRQFLAGS
677 bld r11, SYSREG_GM_OFFSET 677 bld r11, SYSREG_GM_OFFSET
678 brcc 1f 678 brcc 1f
679 rcall trace_hardirqs_on 679 call trace_hardirqs_on
6801: 6801:
681#endif 681#endif
682 mfsr r2, SYSREG_SR 682 mfsr r2, SYSREG_SR
@@ -747,7 +747,7 @@ irq_level\level:
747 mov r11, sp 747 mov r11, sp
748 mov r12, \level 748 mov r12, \level
749 749
750 rcall do_IRQ 750 call do_IRQ
751 751
752 lddsp r4, sp[REG_SR] 752 lddsp r4, sp[REG_SR]
753 bfextu r4, r4, SYSREG_M0_OFFSET, 3 753 bfextu r4, r4, SYSREG_M0_OFFSET, 3
@@ -767,7 +767,7 @@ irq_level\level:
767 767
7681: 7681:
769#ifdef CONFIG_TRACE_IRQFLAGS 769#ifdef CONFIG_TRACE_IRQFLAGS
770 rcall trace_hardirqs_on 770 call trace_hardirqs_on
771#endif 771#endif
772 popm r8-r9 772 popm r8-r9
773 mtsr rar_int\level, r8 773 mtsr rar_int\level, r8
@@ -807,7 +807,7 @@ irq_level\level:
807 lddsp r4, sp[REG_SR] 807 lddsp r4, sp[REG_SR]
808 bld r4, SYSREG_GM_OFFSET 808 bld r4, SYSREG_GM_OFFSET
809 brcs 1b 809 brcs 1b
810 rcall preempt_schedule_irq 810 call preempt_schedule_irq
811#endif 811#endif
812 rjmp 1b 812 rjmp 1b
813 .endm 813 .endm
diff --git a/arch/avr32/kernel/irq.c b/arch/avr32/kernel/irq.c
index a8e767d836aa..9f572229d318 100644
--- a/arch/avr32/kernel/irq.c
+++ b/arch/avr32/kernel/irq.c
@@ -58,7 +58,7 @@ int show_interrupts(struct seq_file *p, void *v)
58 58
59 seq_printf(p, "%3d: ", i); 59 seq_printf(p, "%3d: ", i);
60 for_each_online_cpu(cpu) 60 for_each_online_cpu(cpu)
61 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]); 61 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
62 seq_printf(p, " %8s", irq_desc[i].chip->name ? : "-"); 62 seq_printf(p, " %8s", irq_desc[i].chip->name ? : "-");
63 seq_printf(p, " %s", action->name); 63 seq_printf(p, " %s", action->name);
64 for (action = action->next; action; action = action->next) 64 for (action = action->next; action; action = action->next)
diff --git a/arch/avr32/kernel/syscall-stubs.S b/arch/avr32/kernel/syscall-stubs.S
index 673178e235f3..f7244cd02fbb 100644
--- a/arch/avr32/kernel/syscall-stubs.S
+++ b/arch/avr32/kernel/syscall-stubs.S
@@ -61,7 +61,7 @@ __sys_execve:
61__sys_mmap2: 61__sys_mmap2:
62 pushm lr 62 pushm lr
63 st.w --sp, ARG6 63 st.w --sp, ARG6
64 rcall sys_mmap2 64 call sys_mmap2
65 sub sp, -4 65 sub sp, -4
66 popm pc 66 popm pc
67 67
@@ -70,7 +70,7 @@ __sys_mmap2:
70__sys_sendto: 70__sys_sendto:
71 pushm lr 71 pushm lr
72 st.w --sp, ARG6 72 st.w --sp, ARG6
73 rcall sys_sendto 73 call sys_sendto
74 sub sp, -4 74 sub sp, -4
75 popm pc 75 popm pc
76 76
@@ -79,7 +79,7 @@ __sys_sendto:
79__sys_recvfrom: 79__sys_recvfrom:
80 pushm lr 80 pushm lr
81 st.w --sp, ARG6 81 st.w --sp, ARG6
82 rcall sys_recvfrom 82 call sys_recvfrom
83 sub sp, -4 83 sub sp, -4
84 popm pc 84 popm pc
85 85
@@ -88,7 +88,7 @@ __sys_recvfrom:
88__sys_pselect6: 88__sys_pselect6:
89 pushm lr 89 pushm lr
90 st.w --sp, ARG6 90 st.w --sp, ARG6
91 rcall sys_pselect6 91 call sys_pselect6
92 sub sp, -4 92 sub sp, -4
93 popm pc 93 popm pc
94 94
@@ -97,7 +97,7 @@ __sys_pselect6:
97__sys_splice: 97__sys_splice:
98 pushm lr 98 pushm lr
99 st.w --sp, ARG6 99 st.w --sp, ARG6
100 rcall sys_splice 100 call sys_splice
101 sub sp, -4 101 sub sp, -4
102 popm pc 102 popm pc
103 103
@@ -106,7 +106,7 @@ __sys_splice:
106__sys_epoll_pwait: 106__sys_epoll_pwait:
107 pushm lr 107 pushm lr
108 st.w --sp, ARG6 108 st.w --sp, ARG6
109 rcall sys_epoll_pwait 109 call sys_epoll_pwait
110 sub sp, -4 110 sub sp, -4
111 popm pc 111 popm pc
112 112
@@ -115,6 +115,6 @@ __sys_epoll_pwait:
115__sys_sync_file_range: 115__sys_sync_file_range:
116 pushm lr 116 pushm lr
117 st.w --sp, ARG6 117 st.w --sp, ARG6
118 rcall sys_sync_file_range 118 call sys_sync_file_range
119 sub sp, -4 119 sub sp, -4
120 popm pc 120 popm pc
diff --git a/arch/avr32/lib/strnlen_user.S b/arch/avr32/lib/strnlen_user.S
index 65ce11afa66a..e46f4724962b 100644
--- a/arch/avr32/lib/strnlen_user.S
+++ b/arch/avr32/lib/strnlen_user.S
@@ -48,7 +48,7 @@ adjust_length:
48 lddpc lr, _task_size 48 lddpc lr, _task_size
49 sub r11, lr, r12 49 sub r11, lr, r12
50 mov r9, r11 50 mov r9, r11
51 rcall __strnlen_user 51 call __strnlen_user
52 cp.w r12, r9 52 cp.w r12, r9
53 brgt 1f 53 brgt 1f
54 popm pc 54 popm pc
diff --git a/arch/blackfin/configs/BF518F-EZBRD_defconfig b/arch/blackfin/configs/BF518F-EZBRD_defconfig
index 281f4b60e603..c121d6e6e2b8 100644
--- a/arch/blackfin/configs/BF518F-EZBRD_defconfig
+++ b/arch/blackfin/configs/BF518F-EZBRD_defconfig
@@ -1,7 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28 3# Linux kernel version: 2.6.28.7
4# Fri Feb 20 10:01:44 2009
5# 4#
6# CONFIG_MMU is not set 5# CONFIG_MMU is not set
7# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -43,7 +42,7 @@ CONFIG_LOG_BUF_SHIFT=14
43CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
48CONFIG_UID16=y 47CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -56,13 +55,13 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 60CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
65CONFIG_AIO=y 64# CONFIG_AIO is not set
66CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 66CONFIG_SLAB=y
68# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -314,7 +313,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
314# CONFIG_PHYS_ADDR_T_64BIT is not set 313# CONFIG_PHYS_ADDR_T_64BIT is not set
315CONFIG_ZONE_DMA_FLAG=1 314CONFIG_ZONE_DMA_FLAG=1
316CONFIG_VIRT_TO_BUS=y 315CONFIG_VIRT_TO_BUS=y
317CONFIG_BFIN_GPTIMERS=y 316CONFIG_BFIN_GPTIMERS=m
318# CONFIG_DMA_UNCACHED_4M is not set 317# CONFIG_DMA_UNCACHED_4M is not set
319# CONFIG_DMA_UNCACHED_2M is not set 318# CONFIG_DMA_UNCACHED_2M is not set
320CONFIG_DMA_UNCACHED_1M=y 319CONFIG_DMA_UNCACHED_1M=y
@@ -375,7 +374,6 @@ CONFIG_BINFMT_ZFLAT=y
375# 374#
376# CONFIG_PM is not set 375# CONFIG_PM is not set
377CONFIG_ARCH_SUSPEND_POSSIBLE=y 376CONFIG_ARCH_SUSPEND_POSSIBLE=y
378# CONFIG_PM_WAKEUP_BY_GPIO is not set
379 377
380# 378#
381# CPU Frequency scaling 379# CPU Frequency scaling
@@ -634,6 +632,7 @@ CONFIG_BFIN_RX_DESC_NUM=20
634# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 632# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
635# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 633# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
636# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 634# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
635# CONFIG_B44 is not set
637# CONFIG_NETDEV_1000 is not set 636# CONFIG_NETDEV_1000 is not set
638# CONFIG_NETDEV_10000 is not set 637# CONFIG_NETDEV_10000 is not set
639 638
@@ -793,6 +792,7 @@ CONFIG_SPI_MASTER=y
793# 792#
794CONFIG_SPI_BFIN=y 793CONFIG_SPI_BFIN=y
795# CONFIG_SPI_BFIN_LOCK is not set 794# CONFIG_SPI_BFIN_LOCK is not set
795# CONFIG_SPI_BFIN_SPORT is not set
796# CONFIG_SPI_BITBANG is not set 796# CONFIG_SPI_BITBANG is not set
797 797
798# 798#
@@ -816,6 +816,12 @@ CONFIG_WATCHDOG=y
816# 816#
817# CONFIG_SOFT_WATCHDOG is not set 817# CONFIG_SOFT_WATCHDOG is not set
818CONFIG_BFIN_WDT=y 818CONFIG_BFIN_WDT=y
819CONFIG_SSB_POSSIBLE=y
820
821#
822# Sonics Silicon Backplane
823#
824# CONFIG_SSB is not set
819 825
820# 826#
821# Multifunction device drivers 827# Multifunction device drivers
@@ -865,7 +871,26 @@ CONFIG_DUMMY_CONSOLE=y
865# CONFIG_SOUND is not set 871# CONFIG_SOUND is not set
866# CONFIG_HID_SUPPORT is not set 872# CONFIG_HID_SUPPORT is not set
867# CONFIG_USB_SUPPORT is not set 873# CONFIG_USB_SUPPORT is not set
868# CONFIG_MMC is not set 874CONFIG_MMC=y
875# CONFIG_MMC_DEBUG is not set
876# CONFIG_MMC_UNSAFE_RESUME is not set
877
878#
879# MMC/SD/SDIO Card Drivers
880#
881CONFIG_MMC_BLOCK=y
882CONFIG_MMC_BLOCK_BOUNCE=y
883# CONFIG_SDIO_UART is not set
884# CONFIG_MMC_TEST is not set
885
886#
887# MMC/SD/SDIO Host Controller Drivers
888#
889# CONFIG_MMC_SDHCI is not set
890CONFIG_SDH_BFIN=m
891CONFIG_SDH_BFIN_MISSING_CMD_PULLUP_WORKAROUND=y
892CONFIG_SDH_BFIN_ENABLE_SDIO_IRQ=y
893# CONFIG_MMC_SPI is not set
869# CONFIG_MEMSTICK is not set 894# CONFIG_MEMSTICK is not set
870# CONFIG_NEW_LEDS is not set 895# CONFIG_NEW_LEDS is not set
871# CONFIG_ACCESSIBILITY is not set 896# CONFIG_ACCESSIBILITY is not set
@@ -1121,7 +1146,6 @@ CONFIG_HAVE_ARCH_KGDB=y
1121# CONFIG_KGDB is not set 1146# CONFIG_KGDB is not set
1122# CONFIG_DEBUG_STACKOVERFLOW is not set 1147# CONFIG_DEBUG_STACKOVERFLOW is not set
1123# CONFIG_DEBUG_STACK_USAGE is not set 1148# CONFIG_DEBUG_STACK_USAGE is not set
1124# CONFIG_KGDB_TESTCASE is not set
1125CONFIG_DEBUG_VERBOSE=y 1149CONFIG_DEBUG_VERBOSE=y
1126CONFIG_DEBUG_MMRS=y 1150CONFIG_DEBUG_MMRS=y
1127# CONFIG_DEBUG_HWERR is not set 1151# CONFIG_DEBUG_HWERR is not set
diff --git a/arch/blackfin/configs/BF526-EZBRD_defconfig b/arch/blackfin/configs/BF526-EZBRD_defconfig
index 8e2b855b8db7..3e562b2775d4 100644
--- a/arch/blackfin/configs/BF526-EZBRD_defconfig
+++ b/arch/blackfin/configs/BF526-EZBRD_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -42,7 +42,7 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
46CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
47CONFIG_UID16=y 47CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -55,13 +55,13 @@ CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
58CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
62CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
63CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
64CONFIG_AIO=y 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 66CONFIG_SLAB=y
67# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -132,15 +132,20 @@ CONFIG_BF526=y
132# CONFIG_BF538 is not set 132# CONFIG_BF538 is not set
133# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
134# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
135# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
136# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
137# CONFIG_BF548 is not set 140# CONFIG_BF548 is not set
141# CONFIG_BF548M is not set
138# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
139# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
140CONFIG_BF_REV_MIN=0 145CONFIG_BF_REV_MIN=0
141CONFIG_BF_REV_MAX=2 146CONFIG_BF_REV_MAX=2
142CONFIG_BF_REV_0_0=y 147# CONFIG_BF_REV_0_0 is not set
143# CONFIG_BF_REV_0_1 is not set 148CONFIG_BF_REV_0_1=y
144# CONFIG_BF_REV_0_2 is not set 149# CONFIG_BF_REV_0_2 is not set
145# CONFIG_BF_REV_0_3 is not set 150# CONFIG_BF_REV_0_3 is not set
146# CONFIG_BF_REV_0_4 is not set 151# CONFIG_BF_REV_0_4 is not set
@@ -313,7 +318,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
313# CONFIG_PHYS_ADDR_T_64BIT is not set 318# CONFIG_PHYS_ADDR_T_64BIT is not set
314CONFIG_ZONE_DMA_FLAG=1 319CONFIG_ZONE_DMA_FLAG=1
315CONFIG_VIRT_TO_BUS=y 320CONFIG_VIRT_TO_BUS=y
316CONFIG_BFIN_GPTIMERS=y 321CONFIG_BFIN_GPTIMERS=m
317# CONFIG_DMA_UNCACHED_4M is not set 322# CONFIG_DMA_UNCACHED_4M is not set
318# CONFIG_DMA_UNCACHED_2M is not set 323# CONFIG_DMA_UNCACHED_2M is not set
319CONFIG_DMA_UNCACHED_1M=y 324CONFIG_DMA_UNCACHED_1M=y
@@ -374,7 +379,6 @@ CONFIG_BINFMT_ZFLAT=y
374# 379#
375# CONFIG_PM is not set 380# CONFIG_PM is not set
376CONFIG_ARCH_SUSPEND_POSSIBLE=y 381CONFIG_ARCH_SUSPEND_POSSIBLE=y
377# CONFIG_PM_WAKEUP_BY_GPIO is not set
378 382
379# 383#
380# CPU Frequency scaling 384# CPU Frequency scaling
@@ -583,7 +587,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
583# CONFIG_BLK_DEV_HD is not set 587# CONFIG_BLK_DEV_HD is not set
584CONFIG_MISC_DEVICES=y 588CONFIG_MISC_DEVICES=y
585# CONFIG_EEPROM_93CX6 is not set 589# CONFIG_EEPROM_93CX6 is not set
590# CONFIG_ICS932S401 is not set
586# CONFIG_ENCLOSURE_SERVICES is not set 591# CONFIG_ENCLOSURE_SERVICES is not set
592# CONFIG_C2PORT is not set
587CONFIG_HAVE_IDE=y 593CONFIG_HAVE_IDE=y
588# CONFIG_IDE is not set 594# CONFIG_IDE is not set
589 595
@@ -637,6 +643,7 @@ CONFIG_BFIN_MAC_RMII=y
637# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 643# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
638# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 644# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
639# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 645# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
646# CONFIG_B44 is not set
640CONFIG_NETDEV_1000=y 647CONFIG_NETDEV_1000=y
641# CONFIG_AX88180 is not set 648# CONFIG_AX88180 is not set
642CONFIG_NETDEV_10000=y 649CONFIG_NETDEV_10000=y
@@ -815,6 +822,7 @@ CONFIG_SPI_MASTER=y
815# 822#
816CONFIG_SPI_BFIN=y 823CONFIG_SPI_BFIN=y
817# CONFIG_SPI_BFIN_LOCK is not set 824# CONFIG_SPI_BFIN_LOCK is not set
825# CONFIG_SPI_BFIN_SPORT is not set
818# CONFIG_SPI_BITBANG is not set 826# CONFIG_SPI_BITBANG is not set
819 827
820# 828#
@@ -838,6 +846,7 @@ CONFIG_HWMON=y
838# CONFIG_SENSORS_ADM1029 is not set 846# CONFIG_SENSORS_ADM1029 is not set
839# CONFIG_SENSORS_ADM1031 is not set 847# CONFIG_SENSORS_ADM1031 is not set
840# CONFIG_SENSORS_ADM9240 is not set 848# CONFIG_SENSORS_ADM9240 is not set
849# CONFIG_SENSORS_ADT7462 is not set
841# CONFIG_SENSORS_ADT7470 is not set 850# CONFIG_SENSORS_ADT7470 is not set
842# CONFIG_SENSORS_ADT7473 is not set 851# CONFIG_SENSORS_ADT7473 is not set
843# CONFIG_SENSORS_ATXP1 is not set 852# CONFIG_SENSORS_ATXP1 is not set
@@ -896,6 +905,12 @@ CONFIG_BFIN_WDT=y
896# USB-based Watchdog Cards 905# USB-based Watchdog Cards
897# 906#
898# CONFIG_USBPCWATCHDOG is not set 907# CONFIG_USBPCWATCHDOG is not set
908CONFIG_SSB_POSSIBLE=y
909
910#
911# Sonics Silicon Backplane
912#
913# CONFIG_SSB is not set
899 914
900# 915#
901# Multifunction device drivers 916# Multifunction device drivers
@@ -904,8 +919,10 @@ CONFIG_BFIN_WDT=y
904# CONFIG_MFD_SM501 is not set 919# CONFIG_MFD_SM501 is not set
905# CONFIG_HTC_PASIC3 is not set 920# CONFIG_HTC_PASIC3 is not set
906# CONFIG_MFD_TMIO is not set 921# CONFIG_MFD_TMIO is not set
922# CONFIG_PMIC_DA903X is not set
907# CONFIG_MFD_WM8400 is not set 923# CONFIG_MFD_WM8400 is not set
908# CONFIG_MFD_WM8350_I2C is not set 924# CONFIG_MFD_WM8350_I2C is not set
925# CONFIG_REGULATOR is not set
909 926
910# 927#
911# Multimedia devices 928# Multimedia devices
@@ -940,55 +957,7 @@ CONFIG_BFIN_WDT=y
940# Console display driver support 957# Console display driver support
941# 958#
942CONFIG_DUMMY_CONSOLE=y 959CONFIG_DUMMY_CONSOLE=y
943CONFIG_SOUND=m 960# CONFIG_SOUND is not set
944CONFIG_SOUND_OSS_CORE=y
945CONFIG_SND=m
946CONFIG_SND_TIMER=m
947CONFIG_SND_PCM=m
948# CONFIG_SND_SEQUENCER is not set
949CONFIG_SND_OSSEMUL=y
950CONFIG_SND_MIXER_OSS=m
951CONFIG_SND_PCM_OSS=m
952CONFIG_SND_PCM_OSS_PLUGINS=y
953# CONFIG_SND_DYNAMIC_MINORS is not set
954CONFIG_SND_SUPPORT_OLD_API=y
955CONFIG_SND_VERBOSE_PROCFS=y
956# CONFIG_SND_VERBOSE_PRINTK is not set
957# CONFIG_SND_DEBUG is not set
958CONFIG_SND_DRIVERS=y
959# CONFIG_SND_DUMMY is not set
960# CONFIG_SND_MTPAV is not set
961# CONFIG_SND_SERIAL_U16550 is not set
962# CONFIG_SND_MPU401 is not set
963CONFIG_SND_SPI=y
964
965#
966# ALSA Blackfin devices
967#
968# CONFIG_SND_BLACKFIN_AD1836 is not set
969# CONFIG_SND_BFIN_AD73322 is not set
970CONFIG_SND_USB=y
971# CONFIG_SND_USB_AUDIO is not set
972# CONFIG_SND_USB_CAIAQ is not set
973CONFIG_SND_SOC=m
974CONFIG_SND_SOC_AC97_BUS=y
975CONFIG_SND_BF5XX_I2S=m
976CONFIG_SND_BF5XX_SOC_SSM2602=m
977# CONFIG_SND_BF5XX_SOC_AD73311 is not set
978CONFIG_SND_BF5XX_AC97=m
979CONFIG_SND_BF5XX_MMAP_SUPPORT=y
980# CONFIG_SND_BF5XX_MULTICHAN_SUPPORT is not set
981CONFIG_SND_BF5XX_SOC_SPORT=m
982CONFIG_SND_BF5XX_SOC_I2S=m
983CONFIG_SND_BF5XX_SOC_AC97=m
984CONFIG_SND_BF5XX_SOC_AD1980=m
985CONFIG_SND_BF5XX_SPORT_NUM=0
986# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
987# CONFIG_SND_SOC_ALL_CODECS is not set
988CONFIG_SND_SOC_AD1980=m
989CONFIG_SND_SOC_SSM2602=m
990# CONFIG_SOUND_PRIME is not set
991CONFIG_AC97_BUS=m
992CONFIG_HID_SUPPORT=y 961CONFIG_HID_SUPPORT=y
993CONFIG_HID=y 962CONFIG_HID=y
994# CONFIG_HID_DEBUG is not set 963# CONFIG_HID_DEBUG is not set
@@ -1063,13 +1032,15 @@ CONFIG_USB_MUSB_HDRC=y
1063CONFIG_USB_MUSB_SOC=y 1032CONFIG_USB_MUSB_SOC=y
1064 1033
1065# 1034#
1066# Blackfin high speed USB support 1035# Blackfin high speed USB Support
1067# 1036#
1068CONFIG_USB_MUSB_HOST=y 1037CONFIG_USB_MUSB_HOST=y
1069# CONFIG_USB_MUSB_PERIPHERAL is not set 1038# CONFIG_USB_MUSB_PERIPHERAL is not set
1070# CONFIG_USB_MUSB_OTG is not set 1039# CONFIG_USB_MUSB_OTG is not set
1040# CONFIG_USB_GADGET_MUSB_HDRC is not set
1071CONFIG_USB_MUSB_HDRC_HCD=y 1041CONFIG_USB_MUSB_HDRC_HCD=y
1072CONFIG_MUSB_PIO_ONLY=y 1042CONFIG_MUSB_PIO_ONLY=y
1043CONFIG_MUSB_DMA_POLL=y
1073# CONFIG_USB_MUSB_DEBUG is not set 1044# CONFIG_USB_MUSB_DEBUG is not set
1074 1045
1075# 1046#
@@ -1081,18 +1052,33 @@ CONFIG_MUSB_PIO_ONLY=y
1081# CONFIG_USB_TMC is not set 1052# CONFIG_USB_TMC is not set
1082 1053
1083# 1054#
1084# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1055# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1085# 1056#
1086 1057
1087# 1058#
1088# may also be needed; see USB_STORAGE Help for more information 1059# see USB_STORAGE Help for more information
1089# 1060#
1061CONFIG_USB_STORAGE=m
1062# CONFIG_USB_STORAGE_DEBUG is not set
1063# CONFIG_USB_STORAGE_DATAFAB is not set
1064# CONFIG_USB_STORAGE_FREECOM is not set
1065# CONFIG_USB_STORAGE_ISD200 is not set
1066# CONFIG_USB_STORAGE_DPCM is not set
1067# CONFIG_USB_STORAGE_USBAT is not set
1068# CONFIG_USB_STORAGE_SDDR09 is not set
1069# CONFIG_USB_STORAGE_SDDR55 is not set
1070# CONFIG_USB_STORAGE_JUMPSHOT is not set
1071# CONFIG_USB_STORAGE_ALAUDA is not set
1072# CONFIG_USB_STORAGE_ONETOUCH is not set
1073# CONFIG_USB_STORAGE_KARMA is not set
1074# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1090# CONFIG_USB_LIBUSUAL is not set 1075# CONFIG_USB_LIBUSUAL is not set
1091 1076
1092# 1077#
1093# USB Imaging devices 1078# USB Imaging devices
1094# 1079#
1095# CONFIG_USB_MDC800 is not set 1080# CONFIG_USB_MDC800 is not set
1081# CONFIG_USB_MICROTEK is not set
1096 1082
1097# 1083#
1098# USB port drivers 1084# USB port drivers
@@ -1124,6 +1110,30 @@ CONFIG_MUSB_PIO_ONLY=y
1124# CONFIG_USB_ISIGHTFW is not set 1110# CONFIG_USB_ISIGHTFW is not set
1125# CONFIG_USB_VST is not set 1111# CONFIG_USB_VST is not set
1126# CONFIG_USB_GADGET is not set 1112# CONFIG_USB_GADGET is not set
1113# CONFIG_USB_GADGET_AT91 is not set
1114# CONFIG_USB_GADGET_ATMEL_USBA is not set
1115# CONFIG_USB_GADGET_FSL_USB2 is not set
1116# CONFIG_USB_GADGET_LH7A40X is not set
1117# CONFIG_USB_GADGET_OMAP is not set
1118# CONFIG_USB_GADGET_PXA25X is not set
1119# CONFIG_USB_GADGET_PXA27X is not set
1120# CONFIG_USB_GADGET_S3C2410 is not set
1121# CONFIG_USB_GADGET_M66592 is not set
1122# CONFIG_USB_GADGET_AMD5536UDC is not set
1123# CONFIG_USB_GADGET_FSL_QE is not set
1124# CONFIG_USB_GADGET_NET2272 is not set
1125# CONFIG_USB_GADGET_NET2280 is not set
1126# CONFIG_USB_GADGET_GOKU is not set
1127# CONFIG_USB_GADGET_DUMMY_HCD is not set
1128# CONFIG_USB_ZERO is not set
1129# CONFIG_USB_AUDIO is not set
1130# CONFIG_USB_ETH is not set
1131# CONFIG_USB_GADGETFS is not set
1132# CONFIG_USB_FILE_STORAGE is not set
1133# CONFIG_USB_G_SERIAL is not set
1134# CONFIG_USB_MIDI_GADGET is not set
1135# CONFIG_USB_G_PRINTER is not set
1136# CONFIG_USB_CDC_COMPOSITE is not set
1127# CONFIG_MMC is not set 1137# CONFIG_MMC is not set
1128# CONFIG_MEMSTICK is not set 1138# CONFIG_MEMSTICK is not set
1129# CONFIG_NEW_LEDS is not set 1139# CONFIG_NEW_LEDS is not set
@@ -1158,12 +1168,14 @@ CONFIG_RTC_INTF_DEV=y
1158# CONFIG_RTC_DRV_M41T80 is not set 1168# CONFIG_RTC_DRV_M41T80 is not set
1159# CONFIG_RTC_DRV_S35390A is not set 1169# CONFIG_RTC_DRV_S35390A is not set
1160# CONFIG_RTC_DRV_FM3130 is not set 1170# CONFIG_RTC_DRV_FM3130 is not set
1171# CONFIG_RTC_DRV_RX8581 is not set
1161 1172
1162# 1173#
1163# SPI RTC drivers 1174# SPI RTC drivers
1164# 1175#
1165# CONFIG_RTC_DRV_M41T94 is not set 1176# CONFIG_RTC_DRV_M41T94 is not set
1166# CONFIG_RTC_DRV_DS1305 is not set 1177# CONFIG_RTC_DRV_DS1305 is not set
1178# CONFIG_RTC_DRV_DS1390 is not set
1167# CONFIG_RTC_DRV_MAX6902 is not set 1179# CONFIG_RTC_DRV_MAX6902 is not set
1168# CONFIG_RTC_DRV_R9701 is not set 1180# CONFIG_RTC_DRV_R9701 is not set
1169# CONFIG_RTC_DRV_RS5C348 is not set 1181# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1384,6 +1396,13 @@ CONFIG_DEBUG_INFO=y
1384# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1396# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1385# CONFIG_FAULT_INJECTION is not set 1397# CONFIG_FAULT_INJECTION is not set
1386CONFIG_SYSCTL_SYSCALL_CHECK=y 1398CONFIG_SYSCTL_SYSCALL_CHECK=y
1399
1400#
1401# Tracers
1402#
1403# CONFIG_SCHED_TRACER is not set
1404# CONFIG_CONTEXT_SWITCH_TRACER is not set
1405# CONFIG_BOOT_TRACER is not set
1387# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1406# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1388# CONFIG_SAMPLES is not set 1407# CONFIG_SAMPLES is not set
1389CONFIG_HAVE_ARCH_KGDB=y 1408CONFIG_HAVE_ARCH_KGDB=y
@@ -1423,6 +1442,7 @@ CONFIG_CRYPTO=y
1423# 1442#
1424# CONFIG_CRYPTO_FIPS is not set 1443# CONFIG_CRYPTO_FIPS is not set
1425# CONFIG_CRYPTO_MANAGER is not set 1444# CONFIG_CRYPTO_MANAGER is not set
1445# CONFIG_CRYPTO_MANAGER2 is not set
1426# CONFIG_CRYPTO_GF128MUL is not set 1446# CONFIG_CRYPTO_GF128MUL is not set
1427# CONFIG_CRYPTO_NULL is not set 1447# CONFIG_CRYPTO_NULL is not set
1428# CONFIG_CRYPTO_CRYPTD is not set 1448# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BF527-EZKIT_defconfig b/arch/blackfin/configs/BF527-EZKIT_defconfig
index a50050f17706..911b5dba1dbc 100644
--- a/arch/blackfin/configs/BF527-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF527-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -36,14 +36,13 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
37# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
38# CONFIG_GROUP_SCHED is not set 38# CONFIG_GROUP_SCHED is not set
39# CONFIG_SYSFS_DEPRECATED is not set
40# CONFIG_SYSFS_DEPRECATED_V2 is not set 39# CONFIG_SYSFS_DEPRECATED_V2 is not set
41# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set 41# CONFIG_NAMESPACES is not set
43CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
48CONFIG_UID16=y 47CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -56,13 +55,13 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 60CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
65CONFIG_AIO=y 64# CONFIG_AIO is not set
66CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 66CONFIG_SLAB=y
68# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -133,15 +132,20 @@ CONFIG_BF527=y
133# CONFIG_BF538 is not set 132# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
135# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
136# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
137# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
138# CONFIG_BF548 is not set 140# CONFIG_BF548 is not set
141# CONFIG_BF548M is not set
139# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
140# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=0 145CONFIG_BF_REV_MIN=0
142CONFIG_BF_REV_MAX=2 146CONFIG_BF_REV_MAX=2
143CONFIG_BF_REV_0_0=y 147# CONFIG_BF_REV_0_0 is not set
144# CONFIG_BF_REV_0_1 is not set 148CONFIG_BF_REV_0_1=y
145# CONFIG_BF_REV_0_2 is not set 149# CONFIG_BF_REV_0_2 is not set
146# CONFIG_BF_REV_0_3 is not set 150# CONFIG_BF_REV_0_3 is not set
147# CONFIG_BF_REV_0_4 is not set 151# CONFIG_BF_REV_0_4 is not set
@@ -314,7 +318,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
314# CONFIG_PHYS_ADDR_T_64BIT is not set 318# CONFIG_PHYS_ADDR_T_64BIT is not set
315CONFIG_ZONE_DMA_FLAG=1 319CONFIG_ZONE_DMA_FLAG=1
316CONFIG_VIRT_TO_BUS=y 320CONFIG_VIRT_TO_BUS=y
317CONFIG_BFIN_GPTIMERS=y 321CONFIG_BFIN_GPTIMERS=m
318# CONFIG_DMA_UNCACHED_4M is not set 322# CONFIG_DMA_UNCACHED_4M is not set
319# CONFIG_DMA_UNCACHED_2M is not set 323# CONFIG_DMA_UNCACHED_2M is not set
320CONFIG_DMA_UNCACHED_1M=y 324CONFIG_DMA_UNCACHED_1M=y
@@ -375,7 +379,6 @@ CONFIG_BINFMT_ZFLAT=y
375# 379#
376# CONFIG_PM is not set 380# CONFIG_PM is not set
377CONFIG_ARCH_SUSPEND_POSSIBLE=y 381CONFIG_ARCH_SUSPEND_POSSIBLE=y
378# CONFIG_PM_WAKEUP_BY_GPIO is not set
379 382
380# 383#
381# CPU Frequency scaling 384# CPU Frequency scaling
@@ -626,7 +629,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
626# CONFIG_BLK_DEV_HD is not set 629# CONFIG_BLK_DEV_HD is not set
627CONFIG_MISC_DEVICES=y 630CONFIG_MISC_DEVICES=y
628# CONFIG_EEPROM_93CX6 is not set 631# CONFIG_EEPROM_93CX6 is not set
632# CONFIG_ICS932S401 is not set
629# CONFIG_ENCLOSURE_SERVICES is not set 633# CONFIG_ENCLOSURE_SERVICES is not set
634# CONFIG_C2PORT is not set
630CONFIG_HAVE_IDE=y 635CONFIG_HAVE_IDE=y
631# CONFIG_IDE is not set 636# CONFIG_IDE is not set
632 637
@@ -681,6 +686,7 @@ CONFIG_BFIN_MAC_RMII=y
681# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 686# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
682# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 687# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
683# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 688# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
689# CONFIG_B44 is not set
684CONFIG_NETDEV_1000=y 690CONFIG_NETDEV_1000=y
685# CONFIG_AX88180 is not set 691# CONFIG_AX88180 is not set
686CONFIG_NETDEV_10000=y 692CONFIG_NETDEV_10000=y
@@ -755,8 +761,8 @@ CONFIG_INPUT_MISC=y
755# CONFIG_SPI_ADC_BF533 is not set 761# CONFIG_SPI_ADC_BF533 is not set
756# CONFIG_BF5xx_PPIFCD is not set 762# CONFIG_BF5xx_PPIFCD is not set
757# CONFIG_BFIN_SIMPLE_TIMER is not set 763# CONFIG_BFIN_SIMPLE_TIMER is not set
758# CONFIG_BF5xx_PPI is not set 764CONFIG_BF5xx_PPI=m
759# CONFIG_BFIN_SPORT is not set 765CONFIG_BFIN_SPORT=m
760# CONFIG_BFIN_TIMER_LATENCY is not set 766# CONFIG_BFIN_TIMER_LATENCY is not set
761# CONFIG_TWI_LCD is not set 767# CONFIG_TWI_LCD is not set
762CONFIG_BFIN_DMA_INTERFACE=m 768CONFIG_BFIN_DMA_INTERFACE=m
@@ -859,6 +865,7 @@ CONFIG_SPI_MASTER=y
859# 865#
860CONFIG_SPI_BFIN=y 866CONFIG_SPI_BFIN=y
861# CONFIG_SPI_BFIN_LOCK is not set 867# CONFIG_SPI_BFIN_LOCK is not set
868# CONFIG_SPI_BFIN_SPORT is not set
862# CONFIG_SPI_BITBANG is not set 869# CONFIG_SPI_BITBANG is not set
863 870
864# 871#
@@ -871,60 +878,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
871# CONFIG_GPIOLIB is not set 878# CONFIG_GPIOLIB is not set
872# CONFIG_W1 is not set 879# CONFIG_W1 is not set
873# CONFIG_POWER_SUPPLY is not set 880# CONFIG_POWER_SUPPLY is not set
874CONFIG_HWMON=y 881# CONFIG_HWMON is not set
875# CONFIG_HWMON_VID is not set
876# CONFIG_SENSORS_AD7414 is not set
877# CONFIG_SENSORS_AD7418 is not set
878# CONFIG_SENSORS_ADCXX is not set
879# CONFIG_SENSORS_ADM1021 is not set
880# CONFIG_SENSORS_ADM1025 is not set
881# CONFIG_SENSORS_ADM1026 is not set
882# CONFIG_SENSORS_ADM1029 is not set
883# CONFIG_SENSORS_ADM1031 is not set
884# CONFIG_SENSORS_ADM9240 is not set
885# CONFIG_SENSORS_ADT7470 is not set
886# CONFIG_SENSORS_ADT7473 is not set
887# CONFIG_SENSORS_ATXP1 is not set
888# CONFIG_SENSORS_DS1621 is not set
889# CONFIG_SENSORS_F71805F is not set
890# CONFIG_SENSORS_F71882FG is not set
891# CONFIG_SENSORS_F75375S is not set
892# CONFIG_SENSORS_GL518SM is not set
893# CONFIG_SENSORS_GL520SM is not set
894# CONFIG_SENSORS_IT87 is not set
895# CONFIG_SENSORS_LM63 is not set
896# CONFIG_SENSORS_LM70 is not set
897# CONFIG_SENSORS_LM75 is not set
898# CONFIG_SENSORS_LM77 is not set
899# CONFIG_SENSORS_LM78 is not set
900# CONFIG_SENSORS_LM80 is not set
901# CONFIG_SENSORS_LM83 is not set
902# CONFIG_SENSORS_LM85 is not set
903# CONFIG_SENSORS_LM87 is not set
904# CONFIG_SENSORS_LM90 is not set
905# CONFIG_SENSORS_LM92 is not set
906# CONFIG_SENSORS_LM93 is not set
907# CONFIG_SENSORS_MAX1111 is not set
908# CONFIG_SENSORS_MAX1619 is not set
909# CONFIG_SENSORS_MAX6650 is not set
910# CONFIG_SENSORS_PC87360 is not set
911# CONFIG_SENSORS_PC87427 is not set
912# CONFIG_SENSORS_DME1737 is not set
913# CONFIG_SENSORS_SMSC47M1 is not set
914# CONFIG_SENSORS_SMSC47M192 is not set
915# CONFIG_SENSORS_SMSC47B397 is not set
916# CONFIG_SENSORS_ADS7828 is not set
917# CONFIG_SENSORS_THMC50 is not set
918# CONFIG_SENSORS_VT1211 is not set
919# CONFIG_SENSORS_W83781D is not set
920# CONFIG_SENSORS_W83791D is not set
921# CONFIG_SENSORS_W83792D is not set
922# CONFIG_SENSORS_W83793 is not set
923# CONFIG_SENSORS_W83L785TS is not set
924# CONFIG_SENSORS_W83L786NG is not set
925# CONFIG_SENSORS_W83627HF is not set
926# CONFIG_SENSORS_W83627EHF is not set
927# CONFIG_HWMON_DEBUG_CHIP is not set
928# CONFIG_THERMAL is not set 882# CONFIG_THERMAL is not set
929# CONFIG_THERMAL_HWMON is not set 883# CONFIG_THERMAL_HWMON is not set
930CONFIG_WATCHDOG=y 884CONFIG_WATCHDOG=y
@@ -940,6 +894,12 @@ CONFIG_BFIN_WDT=y
940# USB-based Watchdog Cards 894# USB-based Watchdog Cards
941# 895#
942# CONFIG_USBPCWATCHDOG is not set 896# CONFIG_USBPCWATCHDOG is not set
897CONFIG_SSB_POSSIBLE=y
898
899#
900# Sonics Silicon Backplane
901#
902# CONFIG_SSB is not set
943 903
944# 904#
945# Multifunction device drivers 905# Multifunction device drivers
@@ -948,8 +908,10 @@ CONFIG_BFIN_WDT=y
948# CONFIG_MFD_SM501 is not set 908# CONFIG_MFD_SM501 is not set
949# CONFIG_HTC_PASIC3 is not set 909# CONFIG_HTC_PASIC3 is not set
950# CONFIG_MFD_TMIO is not set 910# CONFIG_MFD_TMIO is not set
911# CONFIG_PMIC_DA903X is not set
951# CONFIG_MFD_WM8400 is not set 912# CONFIG_MFD_WM8400 is not set
952# CONFIG_MFD_WM8350_I2C is not set 913# CONFIG_MFD_WM8350_I2C is not set
914# CONFIG_REGULATOR is not set
953 915
954# 916#
955# Multimedia devices 917# Multimedia devices
@@ -1000,6 +962,7 @@ CONFIG_FB_BFIN_T350MCQB=y
1000# CONFIG_FB_S1D13XXX is not set 962# CONFIG_FB_S1D13XXX is not set
1001# CONFIG_FB_VIRTUAL is not set 963# CONFIG_FB_VIRTUAL is not set
1002# CONFIG_FB_METRONOME is not set 964# CONFIG_FB_METRONOME is not set
965# CONFIG_FB_MB862XX is not set
1003CONFIG_BACKLIGHT_LCD_SUPPORT=y 966CONFIG_BACKLIGHT_LCD_SUPPORT=y
1004CONFIG_LCD_CLASS_DEVICE=m 967CONFIG_LCD_CLASS_DEVICE=m
1005CONFIG_LCD_LTV350QV=m 968CONFIG_LCD_LTV350QV=m
@@ -1152,13 +1115,15 @@ CONFIG_USB_MUSB_HDRC=y
1152CONFIG_USB_MUSB_SOC=y 1115CONFIG_USB_MUSB_SOC=y
1153 1116
1154# 1117#
1155# Blackfin high speed USB support 1118# Blackfin high speed USB Support
1156# 1119#
1157CONFIG_USB_MUSB_HOST=y 1120CONFIG_USB_MUSB_HOST=y
1158# CONFIG_USB_MUSB_PERIPHERAL is not set 1121# CONFIG_USB_MUSB_PERIPHERAL is not set
1159# CONFIG_USB_MUSB_OTG is not set 1122# CONFIG_USB_MUSB_OTG is not set
1123# CONFIG_USB_GADGET_MUSB_HDRC is not set
1160CONFIG_USB_MUSB_HDRC_HCD=y 1124CONFIG_USB_MUSB_HDRC_HCD=y
1161CONFIG_MUSB_PIO_ONLY=y 1125CONFIG_MUSB_PIO_ONLY=y
1126CONFIG_MUSB_DMA_POLL=y
1162# CONFIG_USB_MUSB_DEBUG is not set 1127# CONFIG_USB_MUSB_DEBUG is not set
1163 1128
1164# 1129#
@@ -1170,18 +1135,33 @@ CONFIG_MUSB_PIO_ONLY=y
1170# CONFIG_USB_TMC is not set 1135# CONFIG_USB_TMC is not set
1171 1136
1172# 1137#
1173# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1138# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1174# 1139#
1175 1140
1176# 1141#
1177# may also be needed; see USB_STORAGE Help for more information 1142# see USB_STORAGE Help for more information
1178# 1143#
1144CONFIG_USB_STORAGE=m
1145# CONFIG_USB_STORAGE_DEBUG is not set
1146# CONFIG_USB_STORAGE_DATAFAB is not set
1147# CONFIG_USB_STORAGE_FREECOM is not set
1148# CONFIG_USB_STORAGE_ISD200 is not set
1149# CONFIG_USB_STORAGE_DPCM is not set
1150# CONFIG_USB_STORAGE_USBAT is not set
1151# CONFIG_USB_STORAGE_SDDR09 is not set
1152# CONFIG_USB_STORAGE_SDDR55 is not set
1153# CONFIG_USB_STORAGE_JUMPSHOT is not set
1154# CONFIG_USB_STORAGE_ALAUDA is not set
1155# CONFIG_USB_STORAGE_ONETOUCH is not set
1156# CONFIG_USB_STORAGE_KARMA is not set
1157# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1179# CONFIG_USB_LIBUSUAL is not set 1158# CONFIG_USB_LIBUSUAL is not set
1180 1159
1181# 1160#
1182# USB Imaging devices 1161# USB Imaging devices
1183# 1162#
1184# CONFIG_USB_MDC800 is not set 1163# CONFIG_USB_MDC800 is not set
1164# CONFIG_USB_MICROTEK is not set
1185 1165
1186# 1166#
1187# USB port drivers 1167# USB port drivers
@@ -1213,6 +1193,30 @@ CONFIG_MUSB_PIO_ONLY=y
1213# CONFIG_USB_ISIGHTFW is not set 1193# CONFIG_USB_ISIGHTFW is not set
1214# CONFIG_USB_VST is not set 1194# CONFIG_USB_VST is not set
1215# CONFIG_USB_GADGET is not set 1195# CONFIG_USB_GADGET is not set
1196# CONFIG_USB_GADGET_AT91 is not set
1197# CONFIG_USB_GADGET_ATMEL_USBA is not set
1198# CONFIG_USB_GADGET_FSL_USB2 is not set
1199# CONFIG_USB_GADGET_LH7A40X is not set
1200# CONFIG_USB_GADGET_OMAP is not set
1201# CONFIG_USB_GADGET_PXA25X is not set
1202# CONFIG_USB_GADGET_PXA27X is not set
1203# CONFIG_USB_GADGET_S3C2410 is not set
1204# CONFIG_USB_GADGET_M66592 is not set
1205# CONFIG_USB_GADGET_AMD5536UDC is not set
1206# CONFIG_USB_GADGET_FSL_QE is not set
1207# CONFIG_USB_GADGET_NET2272 is not set
1208# CONFIG_USB_GADGET_NET2280 is not set
1209# CONFIG_USB_GADGET_GOKU is not set
1210# CONFIG_USB_GADGET_DUMMY_HCD is not set
1211# CONFIG_USB_ZERO is not set
1212# CONFIG_USB_AUDIO is not set
1213# CONFIG_USB_ETH is not set
1214# CONFIG_USB_GADGETFS is not set
1215# CONFIG_USB_FILE_STORAGE is not set
1216# CONFIG_USB_G_SERIAL is not set
1217# CONFIG_USB_MIDI_GADGET is not set
1218# CONFIG_USB_G_PRINTER is not set
1219# CONFIG_USB_CDC_COMPOSITE is not set
1216# CONFIG_MMC is not set 1220# CONFIG_MMC is not set
1217# CONFIG_MEMSTICK is not set 1221# CONFIG_MEMSTICK is not set
1218# CONFIG_NEW_LEDS is not set 1222# CONFIG_NEW_LEDS is not set
@@ -1247,12 +1251,14 @@ CONFIG_RTC_INTF_DEV=y
1247# CONFIG_RTC_DRV_M41T80 is not set 1251# CONFIG_RTC_DRV_M41T80 is not set
1248# CONFIG_RTC_DRV_S35390A is not set 1252# CONFIG_RTC_DRV_S35390A is not set
1249# CONFIG_RTC_DRV_FM3130 is not set 1253# CONFIG_RTC_DRV_FM3130 is not set
1254# CONFIG_RTC_DRV_RX8581 is not set
1250 1255
1251# 1256#
1252# SPI RTC drivers 1257# SPI RTC drivers
1253# 1258#
1254# CONFIG_RTC_DRV_M41T94 is not set 1259# CONFIG_RTC_DRV_M41T94 is not set
1255# CONFIG_RTC_DRV_DS1305 is not set 1260# CONFIG_RTC_DRV_DS1305 is not set
1261# CONFIG_RTC_DRV_DS1390 is not set
1256# CONFIG_RTC_DRV_MAX6902 is not set 1262# CONFIG_RTC_DRV_MAX6902 is not set
1257# CONFIG_RTC_DRV_R9701 is not set 1263# CONFIG_RTC_DRV_R9701 is not set
1258# CONFIG_RTC_DRV_RS5C348 is not set 1264# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1473,6 +1479,13 @@ CONFIG_DEBUG_INFO=y
1473# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1479# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1474# CONFIG_FAULT_INJECTION is not set 1480# CONFIG_FAULT_INJECTION is not set
1475# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1481# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1482
1483#
1484# Tracers
1485#
1486# CONFIG_SCHED_TRACER is not set
1487# CONFIG_CONTEXT_SWITCH_TRACER is not set
1488# CONFIG_BOOT_TRACER is not set
1476# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1489# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1477# CONFIG_SAMPLES is not set 1490# CONFIG_SAMPLES is not set
1478CONFIG_HAVE_ARCH_KGDB=y 1491CONFIG_HAVE_ARCH_KGDB=y
@@ -1512,6 +1525,7 @@ CONFIG_CRYPTO=y
1512# 1525#
1513# CONFIG_CRYPTO_FIPS is not set 1526# CONFIG_CRYPTO_FIPS is not set
1514# CONFIG_CRYPTO_MANAGER is not set 1527# CONFIG_CRYPTO_MANAGER is not set
1528# CONFIG_CRYPTO_MANAGER2 is not set
1515# CONFIG_CRYPTO_GF128MUL is not set 1529# CONFIG_CRYPTO_GF128MUL is not set
1516# CONFIG_CRYPTO_NULL is not set 1530# CONFIG_CRYPTO_NULL is not set
1517# CONFIG_CRYPTO_CRYPTD is not set 1531# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BF533-EZKIT_defconfig b/arch/blackfin/configs/BF533-EZKIT_defconfig
index 0a2a00d63887..4c41e03efe0f 100644
--- a/arch/blackfin/configs/BF533-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF533-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -36,14 +36,13 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
37# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
38# CONFIG_GROUP_SCHED is not set 38# CONFIG_GROUP_SCHED is not set
39# CONFIG_SYSFS_DEPRECATED is not set
40# CONFIG_SYSFS_DEPRECATED_V2 is not set 39# CONFIG_SYSFS_DEPRECATED_V2 is not set
41# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set 41# CONFIG_NAMESPACES is not set
43CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
48CONFIG_UID16=y 47CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -56,13 +55,13 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 60CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
65CONFIG_AIO=y 64# CONFIG_AIO is not set
66CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 66CONFIG_SLAB=y
68# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -133,10 +132,15 @@ CONFIG_BF533=y
133# CONFIG_BF538 is not set 132# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
135# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
136# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
137# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
138# CONFIG_BF548 is not set 140# CONFIG_BF548 is not set
141# CONFIG_BF548M is not set
139# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
140# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=3 145CONFIG_BF_REV_MIN=3
142CONFIG_BF_REV_MAX=6 146CONFIG_BF_REV_MAX=6
@@ -157,7 +161,6 @@ CONFIG_BFIN533_EZKIT=y
157# CONFIG_BFIN533_BLUETECHNIX_CM is not set 161# CONFIG_BFIN533_BLUETECHNIX_CM is not set
158# CONFIG_H8606_HVSISTEMAS is not set 162# CONFIG_H8606_HVSISTEMAS is not set
159# CONFIG_BFIN532_IP0X is not set 163# CONFIG_BFIN532_IP0X is not set
160# CONFIG_GENERIC_BF533_BOARD is not set
161 164
162# 165#
163# BF533/2/1 Specific Configuration 166# BF533/2/1 Specific Configuration
@@ -277,7 +280,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
277# CONFIG_PHYS_ADDR_T_64BIT is not set 280# CONFIG_PHYS_ADDR_T_64BIT is not set
278CONFIG_ZONE_DMA_FLAG=1 281CONFIG_ZONE_DMA_FLAG=1
279CONFIG_VIRT_TO_BUS=y 282CONFIG_VIRT_TO_BUS=y
280# CONFIG_BFIN_GPTIMERS is not set 283CONFIG_BFIN_GPTIMERS=m
281# CONFIG_DMA_UNCACHED_4M is not set 284# CONFIG_DMA_UNCACHED_4M is not set
282# CONFIG_DMA_UNCACHED_2M is not set 285# CONFIG_DMA_UNCACHED_2M is not set
283CONFIG_DMA_UNCACHED_1M=y 286CONFIG_DMA_UNCACHED_1M=y
@@ -575,6 +578,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
575CONFIG_MISC_DEVICES=y 578CONFIG_MISC_DEVICES=y
576# CONFIG_EEPROM_93CX6 is not set 579# CONFIG_EEPROM_93CX6 is not set
577# CONFIG_ENCLOSURE_SERVICES is not set 580# CONFIG_ENCLOSURE_SERVICES is not set
581# CONFIG_C2PORT is not set
578CONFIG_HAVE_IDE=y 582CONFIG_HAVE_IDE=y
579# CONFIG_IDE is not set 583# CONFIG_IDE is not set
580 584
@@ -608,6 +612,7 @@ CONFIG_SMC91X=y
608# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 612# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
609# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 613# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
610# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 614# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
615# CONFIG_B44 is not set
611CONFIG_NETDEV_1000=y 616CONFIG_NETDEV_1000=y
612# CONFIG_AX88180 is not set 617# CONFIG_AX88180 is not set
613CONFIG_NETDEV_10000=y 618CONFIG_NETDEV_10000=y
@@ -714,6 +719,7 @@ CONFIG_SPI_MASTER=y
714# 719#
715CONFIG_SPI_BFIN=y 720CONFIG_SPI_BFIN=y
716# CONFIG_SPI_BFIN_LOCK is not set 721# CONFIG_SPI_BFIN_LOCK is not set
722# CONFIG_SPI_BFIN_SPORT is not set
717# CONFIG_SPI_BITBANG is not set 723# CONFIG_SPI_BITBANG is not set
718 724
719# 725#
@@ -726,22 +732,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
726# CONFIG_GPIOLIB is not set 732# CONFIG_GPIOLIB is not set
727# CONFIG_W1 is not set 733# CONFIG_W1 is not set
728# CONFIG_POWER_SUPPLY is not set 734# CONFIG_POWER_SUPPLY is not set
729CONFIG_HWMON=y 735# CONFIG_HWMON is not set
730# CONFIG_HWMON_VID is not set
731# CONFIG_SENSORS_ADCXX is not set
732# CONFIG_SENSORS_F71805F is not set
733# CONFIG_SENSORS_F71882FG is not set
734# CONFIG_SENSORS_IT87 is not set
735# CONFIG_SENSORS_LM70 is not set
736# CONFIG_SENSORS_MAX1111 is not set
737# CONFIG_SENSORS_PC87360 is not set
738# CONFIG_SENSORS_PC87427 is not set
739# CONFIG_SENSORS_SMSC47M1 is not set
740# CONFIG_SENSORS_SMSC47B397 is not set
741# CONFIG_SENSORS_VT1211 is not set
742# CONFIG_SENSORS_W83627HF is not set
743# CONFIG_SENSORS_W83627EHF is not set
744# CONFIG_HWMON_DEBUG_CHIP is not set
745# CONFIG_THERMAL is not set 736# CONFIG_THERMAL is not set
746# CONFIG_THERMAL_HWMON is not set 737# CONFIG_THERMAL_HWMON is not set
747CONFIG_WATCHDOG=y 738CONFIG_WATCHDOG=y
@@ -752,6 +743,12 @@ CONFIG_WATCHDOG=y
752# 743#
753# CONFIG_SOFT_WATCHDOG is not set 744# CONFIG_SOFT_WATCHDOG is not set
754CONFIG_BFIN_WDT=y 745CONFIG_BFIN_WDT=y
746CONFIG_SSB_POSSIBLE=y
747
748#
749# Sonics Silicon Backplane
750#
751# CONFIG_SSB is not set
755 752
756# 753#
757# Multifunction device drivers 754# Multifunction device drivers
@@ -760,7 +757,7 @@ CONFIG_BFIN_WDT=y
760# CONFIG_MFD_SM501 is not set 757# CONFIG_MFD_SM501 is not set
761# CONFIG_HTC_PASIC3 is not set 758# CONFIG_HTC_PASIC3 is not set
762# CONFIG_MFD_TMIO is not set 759# CONFIG_MFD_TMIO is not set
763# CONFIG_MFD_WM8400 is not set 760# CONFIG_REGULATOR is not set
764 761
765# 762#
766# Multimedia devices 763# Multimedia devices
@@ -826,6 +823,7 @@ CONFIG_RTC_INTF_DEV=y
826# 823#
827# CONFIG_RTC_DRV_M41T94 is not set 824# CONFIG_RTC_DRV_M41T94 is not set
828# CONFIG_RTC_DRV_DS1305 is not set 825# CONFIG_RTC_DRV_DS1305 is not set
826# CONFIG_RTC_DRV_DS1390 is not set
829# CONFIG_RTC_DRV_MAX6902 is not set 827# CONFIG_RTC_DRV_MAX6902 is not set
830# CONFIG_RTC_DRV_R9701 is not set 828# CONFIG_RTC_DRV_R9701 is not set
831# CONFIG_RTC_DRV_RS5C348 is not set 829# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1046,6 +1044,13 @@ CONFIG_DEBUG_INFO=y
1046# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1044# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1047# CONFIG_FAULT_INJECTION is not set 1045# CONFIG_FAULT_INJECTION is not set
1048# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1046# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1047
1048#
1049# Tracers
1050#
1051# CONFIG_SCHED_TRACER is not set
1052# CONFIG_CONTEXT_SWITCH_TRACER is not set
1053# CONFIG_BOOT_TRACER is not set
1049# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1054# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1050# CONFIG_SAMPLES is not set 1055# CONFIG_SAMPLES is not set
1051CONFIG_HAVE_ARCH_KGDB=y 1056CONFIG_HAVE_ARCH_KGDB=y
@@ -1084,6 +1089,7 @@ CONFIG_CRYPTO=y
1084# 1089#
1085# CONFIG_CRYPTO_FIPS is not set 1090# CONFIG_CRYPTO_FIPS is not set
1086# CONFIG_CRYPTO_MANAGER is not set 1091# CONFIG_CRYPTO_MANAGER is not set
1092# CONFIG_CRYPTO_MANAGER2 is not set
1087# CONFIG_CRYPTO_GF128MUL is not set 1093# CONFIG_CRYPTO_GF128MUL is not set
1088# CONFIG_CRYPTO_NULL is not set 1094# CONFIG_CRYPTO_NULL is not set
1089# CONFIG_CRYPTO_CRYPTD is not set 1095# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BF533-STAMP_defconfig b/arch/blackfin/configs/BF533-STAMP_defconfig
index eb027587a355..9c482cd1b343 100644
--- a/arch/blackfin/configs/BF533-STAMP_defconfig
+++ b/arch/blackfin/configs/BF533-STAMP_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -36,14 +36,13 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
37# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
38# CONFIG_GROUP_SCHED is not set 38# CONFIG_GROUP_SCHED is not set
39# CONFIG_SYSFS_DEPRECATED is not set
40# CONFIG_SYSFS_DEPRECATED_V2 is not set 39# CONFIG_SYSFS_DEPRECATED_V2 is not set
41# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set 41# CONFIG_NAMESPACES is not set
43CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
48CONFIG_UID16=y 47CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -56,13 +55,13 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 60CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
65CONFIG_AIO=y 64# CONFIG_AIO is not set
66CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 66CONFIG_SLAB=y
68# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -133,10 +132,15 @@ CONFIG_BF533=y
133# CONFIG_BF538 is not set 132# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
135# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
136# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
137# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
138# CONFIG_BF548 is not set 140# CONFIG_BF548 is not set
141# CONFIG_BF548M is not set
139# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
140# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=3 145CONFIG_BF_REV_MIN=3
142CONFIG_BF_REV_MAX=6 146CONFIG_BF_REV_MAX=6
@@ -157,7 +161,6 @@ CONFIG_BFIN533_STAMP=y
157# CONFIG_BFIN533_BLUETECHNIX_CM is not set 161# CONFIG_BFIN533_BLUETECHNIX_CM is not set
158# CONFIG_H8606_HVSISTEMAS is not set 162# CONFIG_H8606_HVSISTEMAS is not set
159# CONFIG_BFIN532_IP0X is not set 163# CONFIG_BFIN532_IP0X is not set
160# CONFIG_GENERIC_BF533_BOARD is not set
161 164
162# 165#
163# BF533/2/1 Specific Configuration 166# BF533/2/1 Specific Configuration
@@ -277,7 +280,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
277# CONFIG_PHYS_ADDR_T_64BIT is not set 280# CONFIG_PHYS_ADDR_T_64BIT is not set
278CONFIG_ZONE_DMA_FLAG=1 281CONFIG_ZONE_DMA_FLAG=1
279CONFIG_VIRT_TO_BUS=y 282CONFIG_VIRT_TO_BUS=y
280# CONFIG_BFIN_GPTIMERS is not set 283CONFIG_BFIN_GPTIMERS=m
281# CONFIG_DMA_UNCACHED_4M is not set 284# CONFIG_DMA_UNCACHED_4M is not set
282# CONFIG_DMA_UNCACHED_2M is not set 285# CONFIG_DMA_UNCACHED_2M is not set
283CONFIG_DMA_UNCACHED_1M=y 286CONFIG_DMA_UNCACHED_1M=y
@@ -578,7 +581,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
578# CONFIG_BLK_DEV_HD is not set 581# CONFIG_BLK_DEV_HD is not set
579CONFIG_MISC_DEVICES=y 582CONFIG_MISC_DEVICES=y
580# CONFIG_EEPROM_93CX6 is not set 583# CONFIG_EEPROM_93CX6 is not set
584# CONFIG_ICS932S401 is not set
581# CONFIG_ENCLOSURE_SERVICES is not set 585# CONFIG_ENCLOSURE_SERVICES is not set
586# CONFIG_C2PORT is not set
582CONFIG_HAVE_IDE=y 587CONFIG_HAVE_IDE=y
583# CONFIG_IDE is not set 588# CONFIG_IDE is not set
584 589
@@ -612,6 +617,7 @@ CONFIG_SMC91X=y
612# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 617# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
613# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 618# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
614# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 619# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
620# CONFIG_B44 is not set
615CONFIG_NETDEV_1000=y 621CONFIG_NETDEV_1000=y
616# CONFIG_AX88180 is not set 622# CONFIG_AX88180 is not set
617CONFIG_NETDEV_10000=y 623CONFIG_NETDEV_10000=y
@@ -671,10 +677,10 @@ CONFIG_CONFIG_INPUT_PCF8574=m
671# CONFIG_SPI_ADC_BF533 is not set 677# CONFIG_SPI_ADC_BF533 is not set
672# CONFIG_BF5xx_PPIFCD is not set 678# CONFIG_BF5xx_PPIFCD is not set
673# CONFIG_BFIN_SIMPLE_TIMER is not set 679# CONFIG_BFIN_SIMPLE_TIMER is not set
674# CONFIG_BF5xx_PPI is not set 680CONFIG_BF5xx_PPI=m
675CONFIG_BFIN_SPORT=y 681CONFIG_BFIN_SPORT=m
676# CONFIG_BFIN_TIMER_LATENCY is not set 682# CONFIG_BFIN_TIMER_LATENCY is not set
677CONFIG_TWI_LCD=m 683# CONFIG_TWI_LCD is not set
678CONFIG_BFIN_DMA_INTERFACE=m 684CONFIG_BFIN_DMA_INTERFACE=m
679CONFIG_SIMPLE_GPIO=m 685CONFIG_SIMPLE_GPIO=m
680# CONFIG_VT is not set 686# CONFIG_VT is not set
@@ -765,6 +771,7 @@ CONFIG_SPI_MASTER=y
765# 771#
766CONFIG_SPI_BFIN=y 772CONFIG_SPI_BFIN=y
767# CONFIG_SPI_BFIN_LOCK is not set 773# CONFIG_SPI_BFIN_LOCK is not set
774# CONFIG_SPI_BFIN_SPORT is not set
768# CONFIG_SPI_BITBANG is not set 775# CONFIG_SPI_BITBANG is not set
769 776
770# 777#
@@ -777,60 +784,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
777# CONFIG_GPIOLIB is not set 784# CONFIG_GPIOLIB is not set
778# CONFIG_W1 is not set 785# CONFIG_W1 is not set
779# CONFIG_POWER_SUPPLY is not set 786# CONFIG_POWER_SUPPLY is not set
780CONFIG_HWMON=y 787# CONFIG_HWMON is not set
781# CONFIG_HWMON_VID is not set
782# CONFIG_SENSORS_AD7414 is not set
783# CONFIG_SENSORS_AD7418 is not set
784# CONFIG_SENSORS_ADCXX is not set
785# CONFIG_SENSORS_ADM1021 is not set
786# CONFIG_SENSORS_ADM1025 is not set
787# CONFIG_SENSORS_ADM1026 is not set
788# CONFIG_SENSORS_ADM1029 is not set
789# CONFIG_SENSORS_ADM1031 is not set
790# CONFIG_SENSORS_ADM9240 is not set
791# CONFIG_SENSORS_ADT7470 is not set
792# CONFIG_SENSORS_ADT7473 is not set
793# CONFIG_SENSORS_ATXP1 is not set
794# CONFIG_SENSORS_DS1621 is not set
795# CONFIG_SENSORS_F71805F is not set
796# CONFIG_SENSORS_F71882FG is not set
797# CONFIG_SENSORS_F75375S is not set
798# CONFIG_SENSORS_GL518SM is not set
799# CONFIG_SENSORS_GL520SM is not set
800# CONFIG_SENSORS_IT87 is not set
801# CONFIG_SENSORS_LM63 is not set
802# CONFIG_SENSORS_LM70 is not set
803# CONFIG_SENSORS_LM75 is not set
804# CONFIG_SENSORS_LM77 is not set
805# CONFIG_SENSORS_LM78 is not set
806# CONFIG_SENSORS_LM80 is not set
807# CONFIG_SENSORS_LM83 is not set
808# CONFIG_SENSORS_LM85 is not set
809# CONFIG_SENSORS_LM87 is not set
810# CONFIG_SENSORS_LM90 is not set
811# CONFIG_SENSORS_LM92 is not set
812# CONFIG_SENSORS_LM93 is not set
813# CONFIG_SENSORS_MAX1111 is not set
814# CONFIG_SENSORS_MAX1619 is not set
815# CONFIG_SENSORS_MAX6650 is not set
816# CONFIG_SENSORS_PC87360 is not set
817# CONFIG_SENSORS_PC87427 is not set
818# CONFIG_SENSORS_DME1737 is not set
819# CONFIG_SENSORS_SMSC47M1 is not set
820# CONFIG_SENSORS_SMSC47M192 is not set
821# CONFIG_SENSORS_SMSC47B397 is not set
822# CONFIG_SENSORS_ADS7828 is not set
823# CONFIG_SENSORS_THMC50 is not set
824# CONFIG_SENSORS_VT1211 is not set
825# CONFIG_SENSORS_W83781D is not set
826# CONFIG_SENSORS_W83791D is not set
827# CONFIG_SENSORS_W83792D is not set
828# CONFIG_SENSORS_W83793 is not set
829# CONFIG_SENSORS_W83L785TS is not set
830# CONFIG_SENSORS_W83L786NG is not set
831# CONFIG_SENSORS_W83627HF is not set
832# CONFIG_SENSORS_W83627EHF is not set
833# CONFIG_HWMON_DEBUG_CHIP is not set
834# CONFIG_THERMAL is not set 788# CONFIG_THERMAL is not set
835# CONFIG_THERMAL_HWMON is not set 789# CONFIG_THERMAL_HWMON is not set
836CONFIG_WATCHDOG=y 790CONFIG_WATCHDOG=y
@@ -841,6 +795,12 @@ CONFIG_WATCHDOG=y
841# 795#
842# CONFIG_SOFT_WATCHDOG is not set 796# CONFIG_SOFT_WATCHDOG is not set
843CONFIG_BFIN_WDT=y 797CONFIG_BFIN_WDT=y
798CONFIG_SSB_POSSIBLE=y
799
800#
801# Sonics Silicon Backplane
802#
803# CONFIG_SSB is not set
844 804
845# 805#
846# Multifunction device drivers 806# Multifunction device drivers
@@ -851,6 +811,7 @@ CONFIG_BFIN_WDT=y
851# CONFIG_MFD_TMIO is not set 811# CONFIG_MFD_TMIO is not set
852# CONFIG_MFD_WM8400 is not set 812# CONFIG_MFD_WM8400 is not set
853# CONFIG_MFD_WM8350_I2C is not set 813# CONFIG_MFD_WM8350_I2C is not set
814# CONFIG_REGULATOR is not set
854 815
855# 816#
856# Multimedia devices 817# Multimedia devices
@@ -909,6 +870,7 @@ CONFIG_ADV7393_1XMEM=y
909# CONFIG_FB_S1D13XXX is not set 870# CONFIG_FB_S1D13XXX is not set
910# CONFIG_FB_VIRTUAL is not set 871# CONFIG_FB_VIRTUAL is not set
911# CONFIG_FB_METRONOME is not set 872# CONFIG_FB_METRONOME is not set
873# CONFIG_FB_MB862XX is not set
912# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 874# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
913 875
914# 876#
@@ -1018,12 +980,14 @@ CONFIG_RTC_INTF_DEV=y
1018# CONFIG_RTC_DRV_M41T80 is not set 980# CONFIG_RTC_DRV_M41T80 is not set
1019# CONFIG_RTC_DRV_S35390A is not set 981# CONFIG_RTC_DRV_S35390A is not set
1020# CONFIG_RTC_DRV_FM3130 is not set 982# CONFIG_RTC_DRV_FM3130 is not set
983# CONFIG_RTC_DRV_RX8581 is not set
1021 984
1022# 985#
1023# SPI RTC drivers 986# SPI RTC drivers
1024# 987#
1025# CONFIG_RTC_DRV_M41T94 is not set 988# CONFIG_RTC_DRV_M41T94 is not set
1026# CONFIG_RTC_DRV_DS1305 is not set 989# CONFIG_RTC_DRV_DS1305 is not set
990# CONFIG_RTC_DRV_DS1390 is not set
1027# CONFIG_RTC_DRV_MAX6902 is not set 991# CONFIG_RTC_DRV_MAX6902 is not set
1028# CONFIG_RTC_DRV_R9701 is not set 992# CONFIG_RTC_DRV_R9701 is not set
1029# CONFIG_RTC_DRV_RS5C348 is not set 993# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1244,6 +1208,13 @@ CONFIG_DEBUG_INFO=y
1244# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1208# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1245# CONFIG_FAULT_INJECTION is not set 1209# CONFIG_FAULT_INJECTION is not set
1246# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1210# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1211
1212#
1213# Tracers
1214#
1215# CONFIG_SCHED_TRACER is not set
1216# CONFIG_CONTEXT_SWITCH_TRACER is not set
1217# CONFIG_BOOT_TRACER is not set
1247# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1218# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1248# CONFIG_SAMPLES is not set 1219# CONFIG_SAMPLES is not set
1249CONFIG_HAVE_ARCH_KGDB=y 1220CONFIG_HAVE_ARCH_KGDB=y
@@ -1282,6 +1253,7 @@ CONFIG_CRYPTO=y
1282# 1253#
1283# CONFIG_CRYPTO_FIPS is not set 1254# CONFIG_CRYPTO_FIPS is not set
1284# CONFIG_CRYPTO_MANAGER is not set 1255# CONFIG_CRYPTO_MANAGER is not set
1256# CONFIG_CRYPTO_MANAGER2 is not set
1285# CONFIG_CRYPTO_GF128MUL is not set 1257# CONFIG_CRYPTO_GF128MUL is not set
1286# CONFIG_CRYPTO_NULL is not set 1258# CONFIG_CRYPTO_NULL is not set
1287# CONFIG_CRYPTO_CRYPTD is not set 1259# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BF537-STAMP_defconfig b/arch/blackfin/configs/BF537-STAMP_defconfig
index 9e62b9f40eb1..591f6edda4f7 100644
--- a/arch/blackfin/configs/BF537-STAMP_defconfig
+++ b/arch/blackfin/configs/BF537-STAMP_defconfig
@@ -1,7 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# Tue Dec 30 17:24:37 2008
5# 4#
6# CONFIG_MMU is not set 5# CONFIG_MMU is not set
7# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -37,14 +36,13 @@ CONFIG_IKCONFIG_PROC=y
37CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
38# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
39# CONFIG_GROUP_SCHED is not set 38# CONFIG_GROUP_SCHED is not set
40# CONFIG_SYSFS_DEPRECATED is not set
41# CONFIG_SYSFS_DEPRECATED_V2 is not set 39# CONFIG_SYSFS_DEPRECATED_V2 is not set
42# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
43# CONFIG_NAMESPACES is not set 41# CONFIG_NAMESPACES is not set
44CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
45CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
47CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
48CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
49CONFIG_UID16=y 47CONFIG_UID16=y
50CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -57,13 +55,13 @@ CONFIG_BUG=y
57# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
58CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 60CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
64CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
65CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
66CONFIG_AIO=y 64# CONFIG_AIO is not set
67CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
68CONFIG_SLAB=y 66CONFIG_SLAB=y
69# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -134,10 +132,15 @@ CONFIG_BF537=y
134# CONFIG_BF538 is not set 132# CONFIG_BF538 is not set
135# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
136# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
137# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
138# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
139# CONFIG_BF548 is not set 140# CONFIG_BF548 is not set
141# CONFIG_BF548M is not set
140# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
141# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
142CONFIG_BF_REV_MIN=2 145CONFIG_BF_REV_MIN=2
143CONFIG_BF_REV_MAX=3 146CONFIG_BF_REV_MAX=3
@@ -184,7 +187,6 @@ CONFIG_BFIN537_STAMP=y
184# CONFIG_BFIN537_BLUETECHNIX_TCM is not set 187# CONFIG_BFIN537_BLUETECHNIX_TCM is not set
185# CONFIG_PNAV10 is not set 188# CONFIG_PNAV10 is not set
186# CONFIG_CAMSIG_MINOTAUR is not set 189# CONFIG_CAMSIG_MINOTAUR is not set
187# CONFIG_GENERIC_BF537_BOARD is not set
188 190
189# 191#
190# BF537 Specific Configuration 192# BF537 Specific Configuration
@@ -589,7 +591,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
589# CONFIG_BLK_DEV_HD is not set 591# CONFIG_BLK_DEV_HD is not set
590CONFIG_MISC_DEVICES=y 592CONFIG_MISC_DEVICES=y
591# CONFIG_EEPROM_93CX6 is not set 593# CONFIG_EEPROM_93CX6 is not set
594# CONFIG_ICS932S401 is not set
592# CONFIG_ENCLOSURE_SERVICES is not set 595# CONFIG_ENCLOSURE_SERVICES is not set
596# CONFIG_C2PORT is not set
593CONFIG_HAVE_IDE=y 597CONFIG_HAVE_IDE=y
594# CONFIG_IDE is not set 598# CONFIG_IDE is not set
595 599
@@ -644,6 +648,7 @@ CONFIG_BFIN_RX_DESC_NUM=20
644# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 648# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
645# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 649# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
646# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 650# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
651# CONFIG_B44 is not set
647CONFIG_NETDEV_1000=y 652CONFIG_NETDEV_1000=y
648# CONFIG_AX88180 is not set 653# CONFIG_AX88180 is not set
649CONFIG_NETDEV_10000=y 654CONFIG_NETDEV_10000=y
@@ -706,10 +711,10 @@ CONFIG_SERIO_LIBPS2=y
706# CONFIG_SPI_ADC_BF533 is not set 711# CONFIG_SPI_ADC_BF533 is not set
707# CONFIG_BF5xx_PPIFCD is not set 712# CONFIG_BF5xx_PPIFCD is not set
708# CONFIG_BFIN_SIMPLE_TIMER is not set 713# CONFIG_BFIN_SIMPLE_TIMER is not set
709# CONFIG_BF5xx_PPI is not set 714CONFIG_BF5xx_PPI=m
710CONFIG_BFIN_SPORT=m 715CONFIG_BFIN_SPORT=m
711# CONFIG_BFIN_TIMER_LATENCY is not set 716# CONFIG_BFIN_TIMER_LATENCY is not set
712CONFIG_TWI_LCD=m 717# CONFIG_TWI_LCD is not set
713CONFIG_BFIN_DMA_INTERFACE=m 718CONFIG_BFIN_DMA_INTERFACE=m
714CONFIG_SIMPLE_GPIO=m 719CONFIG_SIMPLE_GPIO=m
715# CONFIG_VT is not set 720# CONFIG_VT is not set
@@ -808,6 +813,7 @@ CONFIG_SPI_MASTER=y
808# 813#
809CONFIG_SPI_BFIN=y 814CONFIG_SPI_BFIN=y
810# CONFIG_SPI_BFIN_LOCK is not set 815# CONFIG_SPI_BFIN_LOCK is not set
816# CONFIG_SPI_BFIN_SPORT is not set
811# CONFIG_SPI_BITBANG is not set 817# CONFIG_SPI_BITBANG is not set
812 818
813# 819#
@@ -820,60 +826,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
820# CONFIG_GPIOLIB is not set 826# CONFIG_GPIOLIB is not set
821# CONFIG_W1 is not set 827# CONFIG_W1 is not set
822# CONFIG_POWER_SUPPLY is not set 828# CONFIG_POWER_SUPPLY is not set
823CONFIG_HWMON=y 829# CONFIG_HWMON is not set
824# CONFIG_HWMON_VID is not set
825# CONFIG_SENSORS_AD7414 is not set
826# CONFIG_SENSORS_AD7418 is not set
827# CONFIG_SENSORS_ADCXX is not set
828# CONFIG_SENSORS_ADM1021 is not set
829# CONFIG_SENSORS_ADM1025 is not set
830# CONFIG_SENSORS_ADM1026 is not set
831# CONFIG_SENSORS_ADM1029 is not set
832# CONFIG_SENSORS_ADM1031 is not set
833# CONFIG_SENSORS_ADM9240 is not set
834# CONFIG_SENSORS_ADT7470 is not set
835# CONFIG_SENSORS_ADT7473 is not set
836# CONFIG_SENSORS_ATXP1 is not set
837# CONFIG_SENSORS_DS1621 is not set
838# CONFIG_SENSORS_F71805F is not set
839# CONFIG_SENSORS_F71882FG is not set
840# CONFIG_SENSORS_F75375S is not set
841# CONFIG_SENSORS_GL518SM is not set
842# CONFIG_SENSORS_GL520SM is not set
843# CONFIG_SENSORS_IT87 is not set
844# CONFIG_SENSORS_LM63 is not set
845# CONFIG_SENSORS_LM70 is not set
846# CONFIG_SENSORS_LM75 is not set
847# CONFIG_SENSORS_LM77 is not set
848# CONFIG_SENSORS_LM78 is not set
849# CONFIG_SENSORS_LM80 is not set
850# CONFIG_SENSORS_LM83 is not set
851# CONFIG_SENSORS_LM85 is not set
852# CONFIG_SENSORS_LM87 is not set
853# CONFIG_SENSORS_LM90 is not set
854# CONFIG_SENSORS_LM92 is not set
855# CONFIG_SENSORS_LM93 is not set
856# CONFIG_SENSORS_MAX1111 is not set
857# CONFIG_SENSORS_MAX1619 is not set
858# CONFIG_SENSORS_MAX6650 is not set
859# CONFIG_SENSORS_PC87360 is not set
860# CONFIG_SENSORS_PC87427 is not set
861# CONFIG_SENSORS_DME1737 is not set
862# CONFIG_SENSORS_SMSC47M1 is not set
863# CONFIG_SENSORS_SMSC47M192 is not set
864# CONFIG_SENSORS_SMSC47B397 is not set
865# CONFIG_SENSORS_ADS7828 is not set
866# CONFIG_SENSORS_THMC50 is not set
867# CONFIG_SENSORS_VT1211 is not set
868# CONFIG_SENSORS_W83781D is not set
869# CONFIG_SENSORS_W83791D is not set
870# CONFIG_SENSORS_W83792D is not set
871# CONFIG_SENSORS_W83793 is not set
872# CONFIG_SENSORS_W83L785TS is not set
873# CONFIG_SENSORS_W83L786NG is not set
874# CONFIG_SENSORS_W83627HF is not set
875# CONFIG_SENSORS_W83627EHF is not set
876# CONFIG_HWMON_DEBUG_CHIP is not set
877# CONFIG_THERMAL is not set 830# CONFIG_THERMAL is not set
878# CONFIG_THERMAL_HWMON is not set 831# CONFIG_THERMAL_HWMON is not set
879CONFIG_WATCHDOG=y 832CONFIG_WATCHDOG=y
@@ -884,6 +837,12 @@ CONFIG_WATCHDOG=y
884# 837#
885# CONFIG_SOFT_WATCHDOG is not set 838# CONFIG_SOFT_WATCHDOG is not set
886CONFIG_BFIN_WDT=y 839CONFIG_BFIN_WDT=y
840CONFIG_SSB_POSSIBLE=y
841
842#
843# Sonics Silicon Backplane
844#
845# CONFIG_SSB is not set
887 846
888# 847#
889# Multifunction device drivers 848# Multifunction device drivers
@@ -894,6 +853,7 @@ CONFIG_BFIN_WDT=y
894# CONFIG_MFD_TMIO is not set 853# CONFIG_MFD_TMIO is not set
895# CONFIG_MFD_WM8400 is not set 854# CONFIG_MFD_WM8400 is not set
896# CONFIG_MFD_WM8350_I2C is not set 855# CONFIG_MFD_WM8350_I2C is not set
856# CONFIG_REGULATOR is not set
897 857
898# 858#
899# Multimedia devices 859# Multimedia devices
@@ -957,6 +917,7 @@ CONFIG_ADV7393_1XMEM=y
957# CONFIG_FB_S1D13XXX is not set 917# CONFIG_FB_S1D13XXX is not set
958# CONFIG_FB_VIRTUAL is not set 918# CONFIG_FB_VIRTUAL is not set
959# CONFIG_FB_METRONOME is not set 919# CONFIG_FB_METRONOME is not set
920# CONFIG_FB_MB862XX is not set
960CONFIG_BACKLIGHT_LCD_SUPPORT=y 921CONFIG_BACKLIGHT_LCD_SUPPORT=y
961CONFIG_LCD_CLASS_DEVICE=m 922CONFIG_LCD_CLASS_DEVICE=m
962# CONFIG_LCD_LTV350QV is not set 923# CONFIG_LCD_LTV350QV is not set
@@ -1074,12 +1035,14 @@ CONFIG_RTC_INTF_DEV=y
1074# CONFIG_RTC_DRV_M41T80 is not set 1035# CONFIG_RTC_DRV_M41T80 is not set
1075# CONFIG_RTC_DRV_S35390A is not set 1036# CONFIG_RTC_DRV_S35390A is not set
1076# CONFIG_RTC_DRV_FM3130 is not set 1037# CONFIG_RTC_DRV_FM3130 is not set
1038# CONFIG_RTC_DRV_RX8581 is not set
1077 1039
1078# 1040#
1079# SPI RTC drivers 1041# SPI RTC drivers
1080# 1042#
1081# CONFIG_RTC_DRV_M41T94 is not set 1043# CONFIG_RTC_DRV_M41T94 is not set
1082# CONFIG_RTC_DRV_DS1305 is not set 1044# CONFIG_RTC_DRV_DS1305 is not set
1045# CONFIG_RTC_DRV_DS1390 is not set
1083# CONFIG_RTC_DRV_MAX6902 is not set 1046# CONFIG_RTC_DRV_MAX6902 is not set
1084# CONFIG_RTC_DRV_R9701 is not set 1047# CONFIG_RTC_DRV_R9701 is not set
1085# CONFIG_RTC_DRV_RS5C348 is not set 1048# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1300,6 +1263,13 @@ CONFIG_DEBUG_INFO=y
1300# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1263# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1301# CONFIG_FAULT_INJECTION is not set 1264# CONFIG_FAULT_INJECTION is not set
1302# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1265# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1266
1267#
1268# Tracers
1269#
1270# CONFIG_SCHED_TRACER is not set
1271# CONFIG_CONTEXT_SWITCH_TRACER is not set
1272# CONFIG_BOOT_TRACER is not set
1303# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1273# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1304# CONFIG_SAMPLES is not set 1274# CONFIG_SAMPLES is not set
1305CONFIG_HAVE_ARCH_KGDB=y 1275CONFIG_HAVE_ARCH_KGDB=y
@@ -1338,6 +1308,7 @@ CONFIG_CRYPTO=y
1338# 1308#
1339# CONFIG_CRYPTO_FIPS is not set 1309# CONFIG_CRYPTO_FIPS is not set
1340# CONFIG_CRYPTO_MANAGER is not set 1310# CONFIG_CRYPTO_MANAGER is not set
1311# CONFIG_CRYPTO_MANAGER2 is not set
1341# CONFIG_CRYPTO_GF128MUL is not set 1312# CONFIG_CRYPTO_GF128MUL is not set
1342# CONFIG_CRYPTO_NULL is not set 1313# CONFIG_CRYPTO_NULL is not set
1343# CONFIG_CRYPTO_CRYPTD is not set 1314# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BF538-EZKIT_defconfig b/arch/blackfin/configs/BF538-EZKIT_defconfig
index dd6ad6be1c87..1a8e8c3adf98 100644
--- a/arch/blackfin/configs/BF538-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF538-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -42,7 +42,7 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
46CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
47CONFIG_UID16=y 47CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -55,13 +55,13 @@ CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
58CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
59CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
62CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
63CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
64CONFIG_AIO=y 64# CONFIG_AIO is not set
65CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 66CONFIG_SLAB=y
67# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -132,10 +132,15 @@ CONFIG_PREEMPT_VOLUNTARY=y
132CONFIG_BF538=y 132CONFIG_BF538=y
133# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
134# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
135# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
136# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
137# CONFIG_BF548 is not set 140# CONFIG_BF548 is not set
141# CONFIG_BF548M is not set
138# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
139# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
140CONFIG_BF_REV_MIN=4 145CONFIG_BF_REV_MIN=4
141CONFIG_BF_REV_MAX=5 146CONFIG_BF_REV_MAX=5
@@ -293,7 +298,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
293# CONFIG_PHYS_ADDR_T_64BIT is not set 298# CONFIG_PHYS_ADDR_T_64BIT is not set
294CONFIG_ZONE_DMA_FLAG=1 299CONFIG_ZONE_DMA_FLAG=1
295CONFIG_VIRT_TO_BUS=y 300CONFIG_VIRT_TO_BUS=y
296CONFIG_BFIN_GPTIMERS=y 301CONFIG_BFIN_GPTIMERS=m
297# CONFIG_DMA_UNCACHED_4M is not set 302# CONFIG_DMA_UNCACHED_4M is not set
298# CONFIG_DMA_UNCACHED_2M is not set 303# CONFIG_DMA_UNCACHED_2M is not set
299CONFIG_DMA_UNCACHED_1M=y 304CONFIG_DMA_UNCACHED_1M=y
@@ -354,7 +359,6 @@ CONFIG_BINFMT_ZFLAT=y
354# 359#
355# CONFIG_PM is not set 360# CONFIG_PM is not set
356CONFIG_ARCH_SUSPEND_POSSIBLE=y 361CONFIG_ARCH_SUSPEND_POSSIBLE=y
357# CONFIG_PM_WAKEUP_BY_GPIO is not set
358 362
359# 363#
360# CPU Frequency scaling 364# CPU Frequency scaling
@@ -645,6 +649,7 @@ CONFIG_SMC91X=y
645# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 649# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
646# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 650# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
647# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 651# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
652# CONFIG_B44 is not set
648# CONFIG_NETDEV_1000 is not set 653# CONFIG_NETDEV_1000 is not set
649# CONFIG_NETDEV_10000 is not set 654# CONFIG_NETDEV_10000 is not set
650 655
@@ -690,7 +695,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
690# CONFIG_TOUCHSCREEN_AD7877 is not set 695# CONFIG_TOUCHSCREEN_AD7877 is not set
691# CONFIG_TOUCHSCREEN_AD7879_I2C is not set 696# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
692CONFIG_TOUCHSCREEN_AD7879_SPI=y 697CONFIG_TOUCHSCREEN_AD7879_SPI=y
693CONFIG_TOUCHSCREEN_AD7879=m 698CONFIG_TOUCHSCREEN_AD7879=y
694# CONFIG_TOUCHSCREEN_FUJITSU is not set 699# CONFIG_TOUCHSCREEN_FUJITSU is not set
695# CONFIG_TOUCHSCREEN_GUNZE is not set 700# CONFIG_TOUCHSCREEN_GUNZE is not set
696# CONFIG_TOUCHSCREEN_ELO is not set 701# CONFIG_TOUCHSCREEN_ELO is not set
@@ -718,8 +723,8 @@ CONFIG_INPUT_MISC=y
718# CONFIG_SPI_ADC_BF533 is not set 723# CONFIG_SPI_ADC_BF533 is not set
719# CONFIG_BF5xx_PPIFCD is not set 724# CONFIG_BF5xx_PPIFCD is not set
720# CONFIG_BFIN_SIMPLE_TIMER is not set 725# CONFIG_BFIN_SIMPLE_TIMER is not set
721# CONFIG_BF5xx_PPI is not set 726CONFIG_BF5xx_PPI=m
722CONFIG_BFIN_SPORT=y 727CONFIG_BFIN_SPORT=m
723# CONFIG_BFIN_TIMER_LATENCY is not set 728# CONFIG_BFIN_TIMER_LATENCY is not set
724# CONFIG_TWI_LCD is not set 729# CONFIG_TWI_LCD is not set
725CONFIG_BFIN_DMA_INTERFACE=m 730CONFIG_BFIN_DMA_INTERFACE=m
@@ -762,7 +767,7 @@ CONFIG_UNIX98_PTYS=y
762# CONFIG_R3964 is not set 767# CONFIG_R3964 is not set
763# CONFIG_RAW_DRIVER is not set 768# CONFIG_RAW_DRIVER is not set
764# CONFIG_TCG_TPM is not set 769# CONFIG_TCG_TPM is not set
765CONFIG_I2C=y 770CONFIG_I2C=m
766CONFIG_I2C_BOARDINFO=y 771CONFIG_I2C_BOARDINFO=y
767# CONFIG_I2C_CHARDEV is not set 772# CONFIG_I2C_CHARDEV is not set
768CONFIG_I2C_HELPER_AUTO=y 773CONFIG_I2C_HELPER_AUTO=y
@@ -774,7 +779,7 @@ CONFIG_I2C_HELPER_AUTO=y
774# 779#
775# I2C system bus drivers (mostly embedded / system-on-chip) 780# I2C system bus drivers (mostly embedded / system-on-chip)
776# 781#
777CONFIG_I2C_BLACKFIN_TWI=y 782CONFIG_I2C_BLACKFIN_TWI=m
778CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100 783CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
779# CONFIG_I2C_GPIO is not set 784# CONFIG_I2C_GPIO is not set
780# CONFIG_I2C_OCORES is not set 785# CONFIG_I2C_OCORES is not set
@@ -818,6 +823,7 @@ CONFIG_SPI_MASTER=y
818# 823#
819CONFIG_SPI_BFIN=y 824CONFIG_SPI_BFIN=y
820# CONFIG_SPI_BFIN_LOCK is not set 825# CONFIG_SPI_BFIN_LOCK is not set
826# CONFIG_SPI_BFIN_SPORT is not set
821# CONFIG_SPI_BITBANG is not set 827# CONFIG_SPI_BITBANG is not set
822 828
823# 829#
@@ -830,60 +836,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
830# CONFIG_GPIOLIB is not set 836# CONFIG_GPIOLIB is not set
831# CONFIG_W1 is not set 837# CONFIG_W1 is not set
832# CONFIG_POWER_SUPPLY is not set 838# CONFIG_POWER_SUPPLY is not set
833CONFIG_HWMON=y 839# CONFIG_HWMON is not set
834# CONFIG_HWMON_VID is not set
835# CONFIG_SENSORS_AD7414 is not set
836# CONFIG_SENSORS_AD7418 is not set
837# CONFIG_SENSORS_ADCXX is not set
838# CONFIG_SENSORS_ADM1021 is not set
839# CONFIG_SENSORS_ADM1025 is not set
840# CONFIG_SENSORS_ADM1026 is not set
841# CONFIG_SENSORS_ADM1029 is not set
842# CONFIG_SENSORS_ADM1031 is not set
843# CONFIG_SENSORS_ADM9240 is not set
844# CONFIG_SENSORS_ADT7470 is not set
845# CONFIG_SENSORS_ADT7473 is not set
846# CONFIG_SENSORS_ATXP1 is not set
847# CONFIG_SENSORS_DS1621 is not set
848# CONFIG_SENSORS_F71805F is not set
849# CONFIG_SENSORS_F71882FG is not set
850# CONFIG_SENSORS_F75375S is not set
851# CONFIG_SENSORS_GL518SM is not set
852# CONFIG_SENSORS_GL520SM is not set
853# CONFIG_SENSORS_IT87 is not set
854# CONFIG_SENSORS_LM63 is not set
855# CONFIG_SENSORS_LM70 is not set
856# CONFIG_SENSORS_LM75 is not set
857# CONFIG_SENSORS_LM77 is not set
858# CONFIG_SENSORS_LM78 is not set
859# CONFIG_SENSORS_LM80 is not set
860# CONFIG_SENSORS_LM83 is not set
861# CONFIG_SENSORS_LM85 is not set
862# CONFIG_SENSORS_LM87 is not set
863# CONFIG_SENSORS_LM90 is not set
864# CONFIG_SENSORS_LM92 is not set
865# CONFIG_SENSORS_LM93 is not set
866# CONFIG_SENSORS_MAX1111 is not set
867# CONFIG_SENSORS_MAX1619 is not set
868# CONFIG_SENSORS_MAX6650 is not set
869# CONFIG_SENSORS_PC87360 is not set
870# CONFIG_SENSORS_PC87427 is not set
871# CONFIG_SENSORS_DME1737 is not set
872# CONFIG_SENSORS_SMSC47M1 is not set
873# CONFIG_SENSORS_SMSC47M192 is not set
874# CONFIG_SENSORS_SMSC47B397 is not set
875# CONFIG_SENSORS_ADS7828 is not set
876# CONFIG_SENSORS_THMC50 is not set
877# CONFIG_SENSORS_VT1211 is not set
878# CONFIG_SENSORS_W83781D is not set
879# CONFIG_SENSORS_W83791D is not set
880# CONFIG_SENSORS_W83792D is not set
881# CONFIG_SENSORS_W83793 is not set
882# CONFIG_SENSORS_W83L785TS is not set
883# CONFIG_SENSORS_W83L786NG is not set
884# CONFIG_SENSORS_W83627HF is not set
885# CONFIG_SENSORS_W83627EHF is not set
886# CONFIG_HWMON_DEBUG_CHIP is not set
887# CONFIG_THERMAL is not set 840# CONFIG_THERMAL is not set
888# CONFIG_THERMAL_HWMON is not set 841# CONFIG_THERMAL_HWMON is not set
889CONFIG_WATCHDOG=y 842CONFIG_WATCHDOG=y
@@ -894,6 +847,12 @@ CONFIG_WATCHDOG=y
894# 847#
895# CONFIG_SOFT_WATCHDOG is not set 848# CONFIG_SOFT_WATCHDOG is not set
896CONFIG_BFIN_WDT=y 849CONFIG_BFIN_WDT=y
850CONFIG_SSB_POSSIBLE=y
851
852#
853# Sonics Silicon Backplane
854#
855# CONFIG_SSB is not set
897 856
898# 857#
899# Multifunction device drivers 858# Multifunction device drivers
@@ -904,6 +863,7 @@ CONFIG_BFIN_WDT=y
904# CONFIG_MFD_TMIO is not set 863# CONFIG_MFD_TMIO is not set
905# CONFIG_MFD_WM8400 is not set 864# CONFIG_MFD_WM8400 is not set
906# CONFIG_MFD_WM8350_I2C is not set 865# CONFIG_MFD_WM8350_I2C is not set
866# CONFIG_REGULATOR is not set
907 867
908# 868#
909# Multimedia devices 869# Multimedia devices
@@ -954,6 +914,7 @@ CONFIG_FB_BFIN_LQ035Q1=m
954# CONFIG_FB_S1D13XXX is not set 914# CONFIG_FB_S1D13XXX is not set
955# CONFIG_FB_VIRTUAL is not set 915# CONFIG_FB_VIRTUAL is not set
956# CONFIG_FB_METRONOME is not set 916# CONFIG_FB_METRONOME is not set
917# CONFIG_FB_MB862XX is not set
957# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 918# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
958 919
959# 920#
@@ -1007,12 +968,14 @@ CONFIG_RTC_INTF_DEV=y
1007# CONFIG_RTC_DRV_M41T80 is not set 968# CONFIG_RTC_DRV_M41T80 is not set
1008# CONFIG_RTC_DRV_S35390A is not set 969# CONFIG_RTC_DRV_S35390A is not set
1009# CONFIG_RTC_DRV_FM3130 is not set 970# CONFIG_RTC_DRV_FM3130 is not set
971# CONFIG_RTC_DRV_RX8581 is not set
1010 972
1011# 973#
1012# SPI RTC drivers 974# SPI RTC drivers
1013# 975#
1014# CONFIG_RTC_DRV_M41T94 is not set 976# CONFIG_RTC_DRV_M41T94 is not set
1015# CONFIG_RTC_DRV_DS1305 is not set 977# CONFIG_RTC_DRV_DS1305 is not set
978# CONFIG_RTC_DRV_DS1390 is not set
1016# CONFIG_RTC_DRV_MAX6902 is not set 979# CONFIG_RTC_DRV_MAX6902 is not set
1017# CONFIG_RTC_DRV_R9701 is not set 980# CONFIG_RTC_DRV_R9701 is not set
1018# CONFIG_RTC_DRV_RS5C348 is not set 981# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1233,6 +1196,13 @@ CONFIG_DEBUG_INFO=y
1233# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1196# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1234# CONFIG_FAULT_INJECTION is not set 1197# CONFIG_FAULT_INJECTION is not set
1235CONFIG_SYSCTL_SYSCALL_CHECK=y 1198CONFIG_SYSCTL_SYSCALL_CHECK=y
1199
1200#
1201# Tracers
1202#
1203# CONFIG_SCHED_TRACER is not set
1204# CONFIG_CONTEXT_SWITCH_TRACER is not set
1205# CONFIG_BOOT_TRACER is not set
1236# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1206# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1237# CONFIG_SAMPLES is not set 1207# CONFIG_SAMPLES is not set
1238CONFIG_HAVE_ARCH_KGDB=y 1208CONFIG_HAVE_ARCH_KGDB=y
@@ -1271,6 +1241,7 @@ CONFIG_CRYPTO=y
1271# 1241#
1272# CONFIG_CRYPTO_FIPS is not set 1242# CONFIG_CRYPTO_FIPS is not set
1273# CONFIG_CRYPTO_MANAGER is not set 1243# CONFIG_CRYPTO_MANAGER is not set
1244# CONFIG_CRYPTO_MANAGER2 is not set
1274# CONFIG_CRYPTO_GF128MUL is not set 1245# CONFIG_CRYPTO_GF128MUL is not set
1275# CONFIG_CRYPTO_NULL is not set 1246# CONFIG_CRYPTO_NULL is not set
1276# CONFIG_CRYPTO_CRYPTD is not set 1247# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig b/arch/blackfin/configs/BF548-EZKIT_defconfig
index 6bc2fb1b2a70..2cd1c2b218d7 100644
--- a/arch/blackfin/configs/BF548-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF548-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -36,14 +36,13 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
37# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
38# CONFIG_GROUP_SCHED is not set 38# CONFIG_GROUP_SCHED is not set
39# CONFIG_SYSFS_DEPRECATED is not set
40# CONFIG_SYSFS_DEPRECATED_V2 is not set 39# CONFIG_SYSFS_DEPRECATED_V2 is not set
41# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set 41# CONFIG_NAMESPACES is not set
43CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
48CONFIG_UID16=y 47CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -56,13 +55,13 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 60CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
65CONFIG_AIO=y 64# CONFIG_AIO is not set
66CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 66CONFIG_SLAB=y
68# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -133,16 +132,21 @@ CONFIG_PREEMPT_VOLUNTARY=y
133# CONFIG_BF538 is not set 132# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
135# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
136# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
137# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
138CONFIG_BF548=y 140CONFIG_BF548=y
141# CONFIG_BF548M is not set
139# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
140# CONFIG_BF561 is not set 144# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=0 145CONFIG_BF_REV_MIN=0
142CONFIG_BF_REV_MAX=2 146CONFIG_BF_REV_MAX=2
143CONFIG_BF_REV_0_0=y 147# CONFIG_BF_REV_0_0 is not set
144# CONFIG_BF_REV_0_1 is not set 148# CONFIG_BF_REV_0_1 is not set
145# CONFIG_BF_REV_0_2 is not set 149CONFIG_BF_REV_0_2=y
146# CONFIG_BF_REV_0_3 is not set 150# CONFIG_BF_REV_0_3 is not set
147# CONFIG_BF_REV_0_4 is not set 151# CONFIG_BF_REV_0_4 is not set
148# CONFIG_BF_REV_0_5 is not set 152# CONFIG_BF_REV_0_5 is not set
@@ -348,7 +352,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
348# CONFIG_PHYS_ADDR_T_64BIT is not set 352# CONFIG_PHYS_ADDR_T_64BIT is not set
349CONFIG_ZONE_DMA_FLAG=1 353CONFIG_ZONE_DMA_FLAG=1
350CONFIG_VIRT_TO_BUS=y 354CONFIG_VIRT_TO_BUS=y
351# CONFIG_BFIN_GPTIMERS is not set 355CONFIG_BFIN_GPTIMERS=m
352# CONFIG_DMA_UNCACHED_4M is not set 356# CONFIG_DMA_UNCACHED_4M is not set
353CONFIG_DMA_UNCACHED_2M=y 357CONFIG_DMA_UNCACHED_2M=y
354# CONFIG_DMA_UNCACHED_1M is not set 358# CONFIG_DMA_UNCACHED_1M is not set
@@ -413,7 +417,6 @@ CONFIG_BINFMT_ZFLAT=y
413# 417#
414# CONFIG_PM is not set 418# CONFIG_PM is not set
415CONFIG_ARCH_SUSPEND_POSSIBLE=y 419CONFIG_ARCH_SUSPEND_POSSIBLE=y
416# CONFIG_PM_WAKEUP_BY_GPIO is not set
417 420
418# 421#
419# CPU Frequency scaling 422# CPU Frequency scaling
@@ -512,9 +515,9 @@ CONFIG_IRCOMM=m
512# 515#
513CONFIG_IRTTY_SIR=m 516CONFIG_IRTTY_SIR=m
514CONFIG_BFIN_SIR=m 517CONFIG_BFIN_SIR=m
515CONFIG_BFIN_SIR3=y
516# CONFIG_BFIN_SIR0 is not set 518# CONFIG_BFIN_SIR0 is not set
517# CONFIG_BFIN_SIR2 is not set 519# CONFIG_BFIN_SIR2 is not set
520CONFIG_BFIN_SIR3=y
518CONFIG_SIR_BFIN_DMA=y 521CONFIG_SIR_BFIN_DMA=y
519# CONFIG_SIR_BFIN_PIO is not set 522# CONFIG_SIR_BFIN_PIO is not set
520 523
@@ -538,7 +541,8 @@ CONFIG_SIR_BFIN_DMA=y
538CONFIG_WIRELESS=y 541CONFIG_WIRELESS=y
539# CONFIG_CFG80211 is not set 542# CONFIG_CFG80211 is not set
540CONFIG_WIRELESS_OLD_REGULATORY=y 543CONFIG_WIRELESS_OLD_REGULATORY=y
541# CONFIG_WIRELESS_EXT is not set 544CONFIG_WIRELESS_EXT=y
545CONFIG_WIRELESS_EXT_SYSFS=y
542# CONFIG_MAC80211 is not set 546# CONFIG_MAC80211 is not set
543# CONFIG_IEEE80211 is not set 547# CONFIG_IEEE80211 is not set
544# CONFIG_RFKILL is not set 548# CONFIG_RFKILL is not set
@@ -554,7 +558,9 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
554CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 558CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
555CONFIG_STANDALONE=y 559CONFIG_STANDALONE=y
556CONFIG_PREVENT_FIRMWARE_BUILD=y 560CONFIG_PREVENT_FIRMWARE_BUILD=y
557# CONFIG_FW_LOADER is not set 561CONFIG_FW_LOADER=m
562CONFIG_FIRMWARE_IN_KERNEL=y
563CONFIG_EXTRA_FIRMWARE=""
558# CONFIG_DEBUG_DRIVER is not set 564# CONFIG_DEBUG_DRIVER is not set
559# CONFIG_DEBUG_DEVRES is not set 565# CONFIG_DEBUG_DEVRES is not set
560# CONFIG_SYS_HYPERVISOR is not set 566# CONFIG_SYS_HYPERVISOR is not set
@@ -668,7 +674,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
668# CONFIG_BLK_DEV_HD is not set 674# CONFIG_BLK_DEV_HD is not set
669CONFIG_MISC_DEVICES=y 675CONFIG_MISC_DEVICES=y
670# CONFIG_EEPROM_93CX6 is not set 676# CONFIG_EEPROM_93CX6 is not set
677# CONFIG_ICS932S401 is not set
671# CONFIG_ENCLOSURE_SERVICES is not set 678# CONFIG_ENCLOSURE_SERVICES is not set
679# CONFIG_C2PORT is not set
672CONFIG_HAVE_IDE=y 680CONFIG_HAVE_IDE=y
673# CONFIG_IDE is not set 681# CONFIG_IDE is not set
674 682
@@ -743,6 +751,7 @@ CONFIG_SMSC911X=y
743# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 751# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
744# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 752# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
745# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 753# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
754# CONFIG_B44 is not set
746CONFIG_NETDEV_1000=y 755CONFIG_NETDEV_1000=y
747# CONFIG_AX88180 is not set 756# CONFIG_AX88180 is not set
748CONFIG_NETDEV_10000=y 757CONFIG_NETDEV_10000=y
@@ -751,8 +760,16 @@ CONFIG_NETDEV_10000=y
751# Wireless LAN 760# Wireless LAN
752# 761#
753# CONFIG_WLAN_PRE80211 is not set 762# CONFIG_WLAN_PRE80211 is not set
754# CONFIG_WLAN_80211 is not set 763CONFIG_WLAN_80211=y
764CONFIG_LIBERTAS=m
765# CONFIG_LIBERTAS_USB is not set
766CONFIG_LIBERTAS_SDIO=m
767CONFIG_POWEROF2_BLOCKSIZE_ONLY=y
768# CONFIG_LIBERTAS_DEBUG is not set
769# CONFIG_USB_ZD1201 is not set
770# CONFIG_USB_NET_RNDIS_WLAN is not set
755# CONFIG_IWLWIFI_LEDS is not set 771# CONFIG_IWLWIFI_LEDS is not set
772# CONFIG_HOSTAP is not set
756 773
757# 774#
758# USB Network Adapters 775# USB Network Adapters
@@ -844,8 +861,8 @@ CONFIG_INPUT_MISC=y
844# CONFIG_SPI_ADC_BF533 is not set 861# CONFIG_SPI_ADC_BF533 is not set
845# CONFIG_BF5xx_PPIFCD is not set 862# CONFIG_BF5xx_PPIFCD is not set
846# CONFIG_BFIN_SIMPLE_TIMER is not set 863# CONFIG_BFIN_SIMPLE_TIMER is not set
847# CONFIG_BF5xx_PPI is not set 864CONFIG_BF5xx_PPI=m
848# CONFIG_BFIN_SPORT is not set 865CONFIG_BFIN_SPORT=m
849# CONFIG_BFIN_TIMER_LATENCY is not set 866# CONFIG_BFIN_TIMER_LATENCY is not set
850# CONFIG_TWI_LCD is not set 867# CONFIG_TWI_LCD is not set
851CONFIG_BFIN_DMA_INTERFACE=m 868CONFIG_BFIN_DMA_INTERFACE=m
@@ -950,6 +967,7 @@ CONFIG_SPI_MASTER=y
950# 967#
951CONFIG_SPI_BFIN=y 968CONFIG_SPI_BFIN=y
952# CONFIG_SPI_BFIN_LOCK is not set 969# CONFIG_SPI_BFIN_LOCK is not set
970# CONFIG_SPI_BFIN_SPORT is not set
953# CONFIG_SPI_BITBANG is not set 971# CONFIG_SPI_BITBANG is not set
954 972
955# 973#
@@ -962,60 +980,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
962# CONFIG_GPIOLIB is not set 980# CONFIG_GPIOLIB is not set
963# CONFIG_W1 is not set 981# CONFIG_W1 is not set
964# CONFIG_POWER_SUPPLY is not set 982# CONFIG_POWER_SUPPLY is not set
965CONFIG_HWMON=y 983# CONFIG_HWMON is not set
966# CONFIG_HWMON_VID is not set
967# CONFIG_SENSORS_AD7414 is not set
968# CONFIG_SENSORS_AD7418 is not set
969# CONFIG_SENSORS_ADCXX is not set
970# CONFIG_SENSORS_ADM1021 is not set
971# CONFIG_SENSORS_ADM1025 is not set
972# CONFIG_SENSORS_ADM1026 is not set
973# CONFIG_SENSORS_ADM1029 is not set
974# CONFIG_SENSORS_ADM1031 is not set
975# CONFIG_SENSORS_ADM9240 is not set
976# CONFIG_SENSORS_ADT7470 is not set
977# CONFIG_SENSORS_ADT7473 is not set
978# CONFIG_SENSORS_ATXP1 is not set
979# CONFIG_SENSORS_DS1621 is not set
980# CONFIG_SENSORS_F71805F is not set
981# CONFIG_SENSORS_F71882FG is not set
982# CONFIG_SENSORS_F75375S is not set
983# CONFIG_SENSORS_GL518SM is not set
984# CONFIG_SENSORS_GL520SM is not set
985# CONFIG_SENSORS_IT87 is not set
986# CONFIG_SENSORS_LM63 is not set
987# CONFIG_SENSORS_LM70 is not set
988# CONFIG_SENSORS_LM75 is not set
989# CONFIG_SENSORS_LM77 is not set
990# CONFIG_SENSORS_LM78 is not set
991# CONFIG_SENSORS_LM80 is not set
992# CONFIG_SENSORS_LM83 is not set
993# CONFIG_SENSORS_LM85 is not set
994# CONFIG_SENSORS_LM87 is not set
995# CONFIG_SENSORS_LM90 is not set
996# CONFIG_SENSORS_LM92 is not set
997# CONFIG_SENSORS_LM93 is not set
998# CONFIG_SENSORS_MAX1111 is not set
999# CONFIG_SENSORS_MAX1619 is not set
1000# CONFIG_SENSORS_MAX6650 is not set
1001# CONFIG_SENSORS_PC87360 is not set
1002# CONFIG_SENSORS_PC87427 is not set
1003# CONFIG_SENSORS_DME1737 is not set
1004# CONFIG_SENSORS_SMSC47M1 is not set
1005# CONFIG_SENSORS_SMSC47M192 is not set
1006# CONFIG_SENSORS_SMSC47B397 is not set
1007# CONFIG_SENSORS_ADS7828 is not set
1008# CONFIG_SENSORS_THMC50 is not set
1009# CONFIG_SENSORS_VT1211 is not set
1010# CONFIG_SENSORS_W83781D is not set
1011# CONFIG_SENSORS_W83791D is not set
1012# CONFIG_SENSORS_W83792D is not set
1013# CONFIG_SENSORS_W83793 is not set
1014# CONFIG_SENSORS_W83L785TS is not set
1015# CONFIG_SENSORS_W83L786NG is not set
1016# CONFIG_SENSORS_W83627HF is not set
1017# CONFIG_SENSORS_W83627EHF is not set
1018# CONFIG_HWMON_DEBUG_CHIP is not set
1019# CONFIG_THERMAL is not set 984# CONFIG_THERMAL is not set
1020# CONFIG_THERMAL_HWMON is not set 985# CONFIG_THERMAL_HWMON is not set
1021CONFIG_WATCHDOG=y 986CONFIG_WATCHDOG=y
@@ -1031,6 +996,12 @@ CONFIG_BFIN_WDT=y
1031# USB-based Watchdog Cards 996# USB-based Watchdog Cards
1032# 997#
1033# CONFIG_USBPCWATCHDOG is not set 998# CONFIG_USBPCWATCHDOG is not set
999CONFIG_SSB_POSSIBLE=y
1000
1001#
1002# Sonics Silicon Backplane
1003#
1004# CONFIG_SSB is not set
1034 1005
1035# 1006#
1036# Multifunction device drivers 1007# Multifunction device drivers
@@ -1039,8 +1010,10 @@ CONFIG_BFIN_WDT=y
1039# CONFIG_MFD_SM501 is not set 1010# CONFIG_MFD_SM501 is not set
1040# CONFIG_HTC_PASIC3 is not set 1011# CONFIG_HTC_PASIC3 is not set
1041# CONFIG_MFD_TMIO is not set 1012# CONFIG_MFD_TMIO is not set
1013# CONFIG_PMIC_DA903X is not set
1042# CONFIG_MFD_WM8400 is not set 1014# CONFIG_MFD_WM8400 is not set
1043# CONFIG_MFD_WM8350_I2C is not set 1015# CONFIG_MFD_WM8350_I2C is not set
1016# CONFIG_REGULATOR is not set
1044 1017
1045# 1018#
1046# Multimedia devices 1019# Multimedia devices
@@ -1092,6 +1065,7 @@ CONFIG_FB_BF54X_LQ043=y
1092# CONFIG_FB_S1D13XXX is not set 1065# CONFIG_FB_S1D13XXX is not set
1093# CONFIG_FB_VIRTUAL is not set 1066# CONFIG_FB_VIRTUAL is not set
1094# CONFIG_FB_METRONOME is not set 1067# CONFIG_FB_METRONOME is not set
1068# CONFIG_FB_MB862XX is not set
1095# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1069# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1096 1070
1097# 1071#
@@ -1243,15 +1217,15 @@ CONFIG_USB_MUSB_HDRC=y
1243CONFIG_USB_MUSB_SOC=y 1217CONFIG_USB_MUSB_SOC=y
1244 1218
1245# 1219#
1246# Blackfin high speed USB support 1220# Blackfin high speed USB Support
1247# 1221#
1248CONFIG_USB_MUSB_HOST=y 1222CONFIG_USB_MUSB_HOST=y
1249# CONFIG_USB_MUSB_PERIPHERAL is not set 1223# CONFIG_USB_MUSB_PERIPHERAL is not set
1250# CONFIG_USB_MUSB_OTG is not set 1224# CONFIG_USB_MUSB_OTG is not set
1225# CONFIG_USB_GADGET_MUSB_HDRC is not set
1251CONFIG_USB_MUSB_HDRC_HCD=y 1226CONFIG_USB_MUSB_HDRC_HCD=y
1252# CONFIG_MUSB_PIO_ONLY is not set 1227CONFIG_MUSB_PIO_ONLY=y
1253CONFIG_USB_INVENTRA_DMA=y 1228CONFIG_MUSB_DMA_POLL=y
1254# CONFIG_USB_TI_CPPI_DMA is not set
1255# CONFIG_USB_MUSB_DEBUG is not set 1229# CONFIG_USB_MUSB_DEBUG is not set
1256 1230
1257# 1231#
@@ -1263,11 +1237,11 @@ CONFIG_USB_INVENTRA_DMA=y
1263# CONFIG_USB_TMC is not set 1237# CONFIG_USB_TMC is not set
1264 1238
1265# 1239#
1266# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1240# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1267# 1241#
1268 1242
1269# 1243#
1270# may also be needed; see USB_STORAGE Help for more information 1244# see USB_STORAGE Help for more information
1271# 1245#
1272CONFIG_USB_STORAGE=m 1246CONFIG_USB_STORAGE=m
1273# CONFIG_USB_STORAGE_DEBUG is not set 1247# CONFIG_USB_STORAGE_DEBUG is not set
@@ -1321,7 +1295,31 @@ CONFIG_USB_STORAGE=m
1321# CONFIG_USB_ISIGHTFW is not set 1295# CONFIG_USB_ISIGHTFW is not set
1322# CONFIG_USB_VST is not set 1296# CONFIG_USB_VST is not set
1323# CONFIG_USB_GADGET is not set 1297# CONFIG_USB_GADGET is not set
1324CONFIG_MMC=m 1298# CONFIG_USB_GADGET_AT91 is not set
1299# CONFIG_USB_GADGET_ATMEL_USBA is not set
1300# CONFIG_USB_GADGET_FSL_USB2 is not set
1301# CONFIG_USB_GADGET_LH7A40X is not set
1302# CONFIG_USB_GADGET_OMAP is not set
1303# CONFIG_USB_GADGET_PXA25X is not set
1304# CONFIG_USB_GADGET_PXA27X is not set
1305# CONFIG_USB_GADGET_S3C2410 is not set
1306# CONFIG_USB_GADGET_M66592 is not set
1307# CONFIG_USB_GADGET_AMD5536UDC is not set
1308# CONFIG_USB_GADGET_FSL_QE is not set
1309# CONFIG_USB_GADGET_NET2272 is not set
1310# CONFIG_USB_GADGET_NET2280 is not set
1311# CONFIG_USB_GADGET_GOKU is not set
1312# CONFIG_USB_GADGET_DUMMY_HCD is not set
1313# CONFIG_USB_ZERO is not set
1314# CONFIG_USB_AUDIO is not set
1315# CONFIG_USB_ETH is not set
1316# CONFIG_USB_GADGETFS is not set
1317# CONFIG_USB_FILE_STORAGE is not set
1318# CONFIG_USB_G_SERIAL is not set
1319# CONFIG_USB_MIDI_GADGET is not set
1320# CONFIG_USB_G_PRINTER is not set
1321# CONFIG_USB_CDC_COMPOSITE is not set
1322CONFIG_MMC=y
1325# CONFIG_MMC_DEBUG is not set 1323# CONFIG_MMC_DEBUG is not set
1326# CONFIG_MMC_UNSAFE_RESUME is not set 1324# CONFIG_MMC_UNSAFE_RESUME is not set
1327 1325
@@ -1337,8 +1335,9 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1337# MMC/SD/SDIO Host Controller Drivers 1335# MMC/SD/SDIO Host Controller Drivers
1338# 1336#
1339# CONFIG_MMC_SDHCI is not set 1337# CONFIG_MMC_SDHCI is not set
1340CONFIG_SDH_BFIN=m 1338CONFIG_SDH_BFIN=y
1341# CONFIG_SDH_BFIN_MISSING_CMD_PULLUP_WORKAROUND is not set 1339# CONFIG_SDH_BFIN_MISSING_CMD_PULLUP_WORKAROUND is not set
1340# CONFIG_SDH_BFIN_ENABLE_SDIO_IRQ is not set
1342# CONFIG_MMC_SPI is not set 1341# CONFIG_MMC_SPI is not set
1343# CONFIG_MEMSTICK is not set 1342# CONFIG_MEMSTICK is not set
1344# CONFIG_NEW_LEDS is not set 1343# CONFIG_NEW_LEDS is not set
@@ -1373,12 +1372,14 @@ CONFIG_RTC_INTF_DEV=y
1373# CONFIG_RTC_DRV_M41T80 is not set 1372# CONFIG_RTC_DRV_M41T80 is not set
1374# CONFIG_RTC_DRV_S35390A is not set 1373# CONFIG_RTC_DRV_S35390A is not set
1375# CONFIG_RTC_DRV_FM3130 is not set 1374# CONFIG_RTC_DRV_FM3130 is not set
1375# CONFIG_RTC_DRV_RX8581 is not set
1376 1376
1377# 1377#
1378# SPI RTC drivers 1378# SPI RTC drivers
1379# 1379#
1380# CONFIG_RTC_DRV_M41T94 is not set 1380# CONFIG_RTC_DRV_M41T94 is not set
1381# CONFIG_RTC_DRV_DS1305 is not set 1381# CONFIG_RTC_DRV_DS1305 is not set
1382# CONFIG_RTC_DRV_DS1390 is not set
1382# CONFIG_RTC_DRV_MAX6902 is not set 1383# CONFIG_RTC_DRV_MAX6902 is not set
1383# CONFIG_RTC_DRV_R9701 is not set 1384# CONFIG_RTC_DRV_R9701 is not set
1384# CONFIG_RTC_DRV_RS5C348 is not set 1385# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1641,6 +1642,13 @@ CONFIG_DEBUG_INFO=y
1641# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1642# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1642# CONFIG_FAULT_INJECTION is not set 1643# CONFIG_FAULT_INJECTION is not set
1643# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1644# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1645
1646#
1647# Tracers
1648#
1649# CONFIG_SCHED_TRACER is not set
1650# CONFIG_CONTEXT_SWITCH_TRACER is not set
1651# CONFIG_BOOT_TRACER is not set
1644# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1652# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1645# CONFIG_SAMPLES is not set 1653# CONFIG_SAMPLES is not set
1646CONFIG_HAVE_ARCH_KGDB=y 1654CONFIG_HAVE_ARCH_KGDB=y
@@ -1680,6 +1688,7 @@ CONFIG_CRYPTO=y
1680# 1688#
1681# CONFIG_CRYPTO_FIPS is not set 1689# CONFIG_CRYPTO_FIPS is not set
1682# CONFIG_CRYPTO_MANAGER is not set 1690# CONFIG_CRYPTO_MANAGER is not set
1691# CONFIG_CRYPTO_MANAGER2 is not set
1683# CONFIG_CRYPTO_GF128MUL is not set 1692# CONFIG_CRYPTO_GF128MUL is not set
1684# CONFIG_CRYPTO_NULL is not set 1693# CONFIG_CRYPTO_NULL is not set
1685# CONFIG_CRYPTO_CRYPTD is not set 1694# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BF561-EZKIT_defconfig b/arch/blackfin/configs/BF561-EZKIT_defconfig
index 69714fb3e608..4a6ea8e31df7 100644
--- a/arch/blackfin/configs/BF561-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF561-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -36,14 +36,13 @@ CONFIG_IKCONFIG_PROC=y
36CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
37# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
38# CONFIG_GROUP_SCHED is not set 38# CONFIG_GROUP_SCHED is not set
39# CONFIG_SYSFS_DEPRECATED is not set
40# CONFIG_SYSFS_DEPRECATED_V2 is not set 39# CONFIG_SYSFS_DEPRECATED_V2 is not set
41# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set 41# CONFIG_NAMESPACES is not set
43CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 43CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 45# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
48CONFIG_UID16=y 47CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
@@ -56,13 +55,13 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 55# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 58# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 59CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 60CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
65CONFIG_AIO=y 64# CONFIG_AIO is not set
66CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 66CONFIG_SLAB=y
68# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -133,10 +132,15 @@ CONFIG_PREEMPT_VOLUNTARY=y
133# CONFIG_BF538 is not set 132# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set 133# CONFIG_BF539 is not set
135# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
135# CONFIG_BF542M is not set
136# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
137# CONFIG_BF544M is not set
137# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
139# CONFIG_BF547M is not set
138# CONFIG_BF548 is not set 140# CONFIG_BF548 is not set
141# CONFIG_BF548M is not set
139# CONFIG_BF549 is not set 142# CONFIG_BF549 is not set
143# CONFIG_BF549M is not set
140CONFIG_BF561=y 144CONFIG_BF561=y
141# CONFIG_SMP is not set 145# CONFIG_SMP is not set
142CONFIG_BF_REV_MIN=3 146CONFIG_BF_REV_MIN=3
@@ -166,7 +170,6 @@ CONFIG_IRQ_SPI_ERROR=7
166CONFIG_BFIN561_EZKIT=y 170CONFIG_BFIN561_EZKIT=y
167# CONFIG_BFIN561_TEPLA is not set 171# CONFIG_BFIN561_TEPLA is not set
168# CONFIG_BFIN561_BLUETECHNIX_CM is not set 172# CONFIG_BFIN561_BLUETECHNIX_CM is not set
169# CONFIG_GENERIC_BF561_BOARD is not set
170 173
171# 174#
172# BF561 Specific Configuration 175# BF561 Specific Configuration
@@ -316,7 +319,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
316# CONFIG_PHYS_ADDR_T_64BIT is not set 319# CONFIG_PHYS_ADDR_T_64BIT is not set
317CONFIG_ZONE_DMA_FLAG=1 320CONFIG_ZONE_DMA_FLAG=1
318CONFIG_VIRT_TO_BUS=y 321CONFIG_VIRT_TO_BUS=y
319# CONFIG_BFIN_GPTIMERS is not set 322CONFIG_BFIN_GPTIMERS=m
320# CONFIG_DMA_UNCACHED_4M is not set 323# CONFIG_DMA_UNCACHED_4M is not set
321# CONFIG_DMA_UNCACHED_2M is not set 324# CONFIG_DMA_UNCACHED_2M is not set
322CONFIG_DMA_UNCACHED_1M=y 325CONFIG_DMA_UNCACHED_1M=y
@@ -382,7 +385,6 @@ CONFIG_BINFMT_ZFLAT=y
382# 385#
383# CONFIG_PM is not set 386# CONFIG_PM is not set
384CONFIG_ARCH_SUSPEND_POSSIBLE=y 387CONFIG_ARCH_SUSPEND_POSSIBLE=y
385# CONFIG_PM_WAKEUP_BY_GPIO is not set
386 388
387# 389#
388# CPU Frequency scaling 390# CPU Frequency scaling
@@ -612,6 +614,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
612CONFIG_MISC_DEVICES=y 614CONFIG_MISC_DEVICES=y
613# CONFIG_EEPROM_93CX6 is not set 615# CONFIG_EEPROM_93CX6 is not set
614# CONFIG_ENCLOSURE_SERVICES is not set 616# CONFIG_ENCLOSURE_SERVICES is not set
617# CONFIG_C2PORT is not set
615CONFIG_HAVE_IDE=y 618CONFIG_HAVE_IDE=y
616# CONFIG_IDE is not set 619# CONFIG_IDE is not set
617 620
@@ -645,6 +648,7 @@ CONFIG_SMC91X=y
645# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 648# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
646# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 649# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
647# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 650# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
651# CONFIG_B44 is not set
648CONFIG_NETDEV_1000=y 652CONFIG_NETDEV_1000=y
649# CONFIG_AX88180 is not set 653# CONFIG_AX88180 is not set
650CONFIG_NETDEV_10000=y 654CONFIG_NETDEV_10000=y
@@ -751,6 +755,7 @@ CONFIG_SPI_MASTER=y
751# 755#
752CONFIG_SPI_BFIN=y 756CONFIG_SPI_BFIN=y
753# CONFIG_SPI_BFIN_LOCK is not set 757# CONFIG_SPI_BFIN_LOCK is not set
758# CONFIG_SPI_BFIN_SPORT is not set
754# CONFIG_SPI_BITBANG is not set 759# CONFIG_SPI_BITBANG is not set
755 760
756# 761#
@@ -763,22 +768,7 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
763# CONFIG_GPIOLIB is not set 768# CONFIG_GPIOLIB is not set
764# CONFIG_W1 is not set 769# CONFIG_W1 is not set
765# CONFIG_POWER_SUPPLY is not set 770# CONFIG_POWER_SUPPLY is not set
766CONFIG_HWMON=y 771# CONFIG_HWMON is not set
767# CONFIG_HWMON_VID is not set
768# CONFIG_SENSORS_ADCXX is not set
769# CONFIG_SENSORS_F71805F is not set
770# CONFIG_SENSORS_F71882FG is not set
771# CONFIG_SENSORS_IT87 is not set
772# CONFIG_SENSORS_LM70 is not set
773# CONFIG_SENSORS_MAX1111 is not set
774# CONFIG_SENSORS_PC87360 is not set
775# CONFIG_SENSORS_PC87427 is not set
776# CONFIG_SENSORS_SMSC47M1 is not set
777# CONFIG_SENSORS_SMSC47B397 is not set
778# CONFIG_SENSORS_VT1211 is not set
779# CONFIG_SENSORS_W83627HF is not set
780# CONFIG_SENSORS_W83627EHF is not set
781# CONFIG_HWMON_DEBUG_CHIP is not set
782# CONFIG_THERMAL is not set 772# CONFIG_THERMAL is not set
783# CONFIG_THERMAL_HWMON is not set 773# CONFIG_THERMAL_HWMON is not set
784CONFIG_WATCHDOG=y 774CONFIG_WATCHDOG=y
@@ -789,6 +779,12 @@ CONFIG_WATCHDOG=y
789# 779#
790# CONFIG_SOFT_WATCHDOG is not set 780# CONFIG_SOFT_WATCHDOG is not set
791CONFIG_BFIN_WDT=y 781CONFIG_BFIN_WDT=y
782CONFIG_SSB_POSSIBLE=y
783
784#
785# Sonics Silicon Backplane
786#
787# CONFIG_SSB is not set
792 788
793# 789#
794# Multifunction device drivers 790# Multifunction device drivers
@@ -797,7 +793,7 @@ CONFIG_BFIN_WDT=y
797# CONFIG_MFD_SM501 is not set 793# CONFIG_MFD_SM501 is not set
798# CONFIG_HTC_PASIC3 is not set 794# CONFIG_HTC_PASIC3 is not set
799# CONFIG_MFD_TMIO is not set 795# CONFIG_MFD_TMIO is not set
800# CONFIG_MFD_WM8400 is not set 796# CONFIG_REGULATOR is not set
801 797
802# 798#
803# Multimedia devices 799# Multimedia devices
@@ -1041,6 +1037,13 @@ CONFIG_DEBUG_INFO=y
1041# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1037# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1042# CONFIG_FAULT_INJECTION is not set 1038# CONFIG_FAULT_INJECTION is not set
1043# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1039# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1040
1041#
1042# Tracers
1043#
1044# CONFIG_SCHED_TRACER is not set
1045# CONFIG_CONTEXT_SWITCH_TRACER is not set
1046# CONFIG_BOOT_TRACER is not set
1044# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1047# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1045# CONFIG_SAMPLES is not set 1048# CONFIG_SAMPLES is not set
1046CONFIG_HAVE_ARCH_KGDB=y 1049CONFIG_HAVE_ARCH_KGDB=y
@@ -1079,6 +1082,7 @@ CONFIG_CRYPTO=y
1079# 1082#
1080# CONFIG_CRYPTO_FIPS is not set 1083# CONFIG_CRYPTO_FIPS is not set
1081# CONFIG_CRYPTO_MANAGER is not set 1084# CONFIG_CRYPTO_MANAGER is not set
1085# CONFIG_CRYPTO_MANAGER2 is not set
1082# CONFIG_CRYPTO_GF128MUL is not set 1086# CONFIG_CRYPTO_GF128MUL is not set
1083# CONFIG_CRYPTO_NULL is not set 1087# CONFIG_CRYPTO_NULL is not set
1084# CONFIG_CRYPTO_CRYPTD is not set 1088# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/BlackStamp_defconfig b/arch/blackfin/configs/BlackStamp_defconfig
index 017c6ea071b5..ef1a2c84ace1 100644
--- a/arch/blackfin/configs/BlackStamp_defconfig
+++ b/arch/blackfin/configs/BlackStamp_defconfig
@@ -43,7 +43,7 @@ CONFIG_SYSFS_DEPRECATED_V2=y
43CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 46# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 47CONFIG_EMBEDDED=y
48CONFIG_UID16=y 48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 49CONFIG_SYSCTL_SYSCALL=y
@@ -56,7 +56,7 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 57CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 59# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 61CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/CM-BF527_defconfig b/arch/blackfin/configs/CM-BF527_defconfig
index d880ef786770..e2fc588e4336 100644
--- a/arch/blackfin/configs/CM-BF527_defconfig
+++ b/arch/blackfin/configs/CM-BF527_defconfig
@@ -43,7 +43,7 @@ CONFIG_SYSFS_DEPRECATED_V2=y
43CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
44CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 46# CONFIG_SYSCTL is not set
47CONFIG_EMBEDDED=y 47CONFIG_EMBEDDED=y
48CONFIG_UID16=y 48CONFIG_UID16=y
49CONFIG_SYSCTL_SYSCALL=y 49CONFIG_SYSCTL_SYSCALL=y
@@ -56,13 +56,13 @@ CONFIG_BUG=y
56# CONFIG_ELF_CORE is not set 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 57CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 59# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 61CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y 63CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 64CONFIG_EVENTFD=y
65CONFIG_AIO=y 65# CONFIG_AIO is not set
66CONFIG_VM_EVENT_COUNTERS=y 66CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 67CONFIG_SLAB=y
68# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
diff --git a/arch/blackfin/configs/CM-BF533_defconfig b/arch/blackfin/configs/CM-BF533_defconfig
index 085211b9e4e4..65a8bbb8d647 100644
--- a/arch/blackfin/configs/CM-BF533_defconfig
+++ b/arch/blackfin/configs/CM-BF533_defconfig
@@ -46,7 +46,7 @@ CONFIG_LOG_BUF_SHIFT=14
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49CONFIG_SYSCTL=y 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 51# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 52CONFIG_SYSCTL_SYSCALL=y
@@ -57,7 +57,7 @@ CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58# CONFIG_ELF_CORE is not set 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 62CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 63CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/CM-BF537E_defconfig b/arch/blackfin/configs/CM-BF537E_defconfig
index 750203e27a46..9b7e9d781145 100644
--- a/arch/blackfin/configs/CM-BF537E_defconfig
+++ b/arch/blackfin/configs/CM-BF537E_defconfig
@@ -46,7 +46,7 @@ CONFIG_LOG_BUF_SHIFT=14
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49CONFIG_SYSCTL=y 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 51# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 52CONFIG_SYSCTL_SYSCALL=y
@@ -57,7 +57,7 @@ CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58# CONFIG_ELF_CORE is not set 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 62CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 63CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/CM-BF537U_defconfig b/arch/blackfin/configs/CM-BF537U_defconfig
index dec8a7d5cc0e..569523c1c034 100644
--- a/arch/blackfin/configs/CM-BF537U_defconfig
+++ b/arch/blackfin/configs/CM-BF537U_defconfig
@@ -46,7 +46,7 @@ CONFIG_LOG_BUF_SHIFT=14
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49CONFIG_SYSCTL=y 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 51# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 52CONFIG_SYSCTL_SYSCALL=y
@@ -57,7 +57,7 @@ CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58# CONFIG_ELF_CORE is not set 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 62CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 63CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/CM-BF548_defconfig b/arch/blackfin/configs/CM-BF548_defconfig
index f410430b4e3d..035b635e599c 100644
--- a/arch/blackfin/configs/CM-BF548_defconfig
+++ b/arch/blackfin/configs/CM-BF548_defconfig
@@ -46,7 +46,7 @@ CONFIG_FAIR_USER_SCHED=y
46CONFIG_BLK_DEV_INITRD=y 46CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 47CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49CONFIG_SYSCTL=y 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51CONFIG_UID16=y 51CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 52CONFIG_SYSCTL_SYSCALL=y
@@ -57,7 +57,7 @@ CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58# CONFIG_ELF_CORE is not set 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 62CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 63CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/CM-BF561_defconfig b/arch/blackfin/configs/CM-BF561_defconfig
index 346bc7af8f42..7015e42ccce5 100644
--- a/arch/blackfin/configs/CM-BF561_defconfig
+++ b/arch/blackfin/configs/CM-BF561_defconfig
@@ -46,7 +46,7 @@ CONFIG_FAIR_USER_SCHED=y
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49CONFIG_SYSCTL=y 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51# CONFIG_UID16 is not set 51# CONFIG_UID16 is not set
52CONFIG_SYSCTL_SYSCALL=y 52CONFIG_SYSCTL_SYSCALL=y
@@ -57,7 +57,7 @@ CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58# CONFIG_ELF_CORE is not set 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 62CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 63CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/H8606_defconfig b/arch/blackfin/configs/H8606_defconfig
index bd553da15db8..dfc8e1ddd77a 100644
--- a/arch/blackfin/configs/H8606_defconfig
+++ b/arch/blackfin/configs/H8606_defconfig
@@ -45,7 +45,7 @@ CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 45# CONFIG_RELAY is not set
46# CONFIG_BLK_DEV_INITRD is not set 46# CONFIG_BLK_DEV_INITRD is not set
47# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 47# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
48CONFIG_SYSCTL=y 48# CONFIG_SYSCTL is not set
49CONFIG_EMBEDDED=y 49CONFIG_EMBEDDED=y
50CONFIG_UID16=y 50CONFIG_UID16=y
51CONFIG_SYSCTL_SYSCALL=y 51CONFIG_SYSCTL_SYSCALL=y
@@ -56,7 +56,7 @@ CONFIG_PRINTK=y
56CONFIG_BUG=y 56CONFIG_BUG=y
57# CONFIG_ELF_CORE is not set 57# CONFIG_ELF_CORE is not set
58CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 59# CONFIG_FUTEX is not set
60CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 61CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/IP0X_defconfig b/arch/blackfin/configs/IP0X_defconfig
index 7db93874c987..95a5f91aebaa 100644
--- a/arch/blackfin/configs/IP0X_defconfig
+++ b/arch/blackfin/configs/IP0X_defconfig
@@ -46,7 +46,7 @@ CONFIG_SYSFS_DEPRECATED=y
46CONFIG_BLK_DEV_INITRD=y 46CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 47CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
49CONFIG_SYSCTL=y 49# CONFIG_SYSCTL is not set
50CONFIG_EMBEDDED=y 50CONFIG_EMBEDDED=y
51CONFIG_UID16=y 51CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 52CONFIG_SYSCTL_SYSCALL=y
@@ -57,7 +57,7 @@ CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58# CONFIG_ELF_CORE is not set 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60# CONFIG_FUTEX is not set
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 62CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 63CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/PNAV-10_defconfig b/arch/blackfin/configs/PNAV-10_defconfig
index ad096702ac16..78e24080e7f1 100644
--- a/arch/blackfin/configs/PNAV-10_defconfig
+++ b/arch/blackfin/configs/PNAV-10_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2 3# Linux kernel version: 2.6.28.7
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -35,13 +35,12 @@ CONFIG_SYSVIPC_SYSCTL=y
35CONFIG_LOG_BUF_SHIFT=14 35CONFIG_LOG_BUF_SHIFT=14
36# CONFIG_CGROUPS is not set 36# CONFIG_CGROUPS is not set
37# CONFIG_GROUP_SCHED is not set 37# CONFIG_GROUP_SCHED is not set
38# CONFIG_SYSFS_DEPRECATED is not set
39# CONFIG_SYSFS_DEPRECATED_V2 is not set 38# CONFIG_SYSFS_DEPRECATED_V2 is not set
40# CONFIG_RELAY is not set 39# CONFIG_RELAY is not set
41# CONFIG_NAMESPACES is not set 40# CONFIG_NAMESPACES is not set
42# CONFIG_BLK_DEV_INITRD is not set 41# CONFIG_BLK_DEV_INITRD is not set
43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
44CONFIG_SYSCTL=y 43# CONFIG_SYSCTL is not set
45CONFIG_EMBEDDED=y 44CONFIG_EMBEDDED=y
46CONFIG_UID16=y 45CONFIG_UID16=y
47CONFIG_SYSCTL_SYSCALL=y 46CONFIG_SYSCTL_SYSCALL=y
@@ -53,13 +52,13 @@ CONFIG_BUG=y
53# CONFIG_ELF_CORE is not set 52# CONFIG_ELF_CORE is not set
54CONFIG_COMPAT_BRK=y 53CONFIG_COMPAT_BRK=y
55CONFIG_BASE_FULL=y 54CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y 55# CONFIG_FUTEX is not set
57CONFIG_ANON_INODES=y 56CONFIG_ANON_INODES=y
58CONFIG_EPOLL=y 57CONFIG_EPOLL=y
59CONFIG_SIGNALFD=y 58CONFIG_SIGNALFD=y
60CONFIG_TIMERFD=y 59CONFIG_TIMERFD=y
61CONFIG_EVENTFD=y 60CONFIG_EVENTFD=y
62CONFIG_AIO=y 61# CONFIG_AIO is not set
63CONFIG_VM_EVENT_COUNTERS=y 62CONFIG_VM_EVENT_COUNTERS=y
64CONFIG_SLAB=y 63CONFIG_SLAB=y
65# CONFIG_SLUB is not set 64# CONFIG_SLUB is not set
@@ -130,10 +129,15 @@ CONFIG_BF537=y
130# CONFIG_BF538 is not set 129# CONFIG_BF538 is not set
131# CONFIG_BF539 is not set 130# CONFIG_BF539 is not set
132# CONFIG_BF542 is not set 131# CONFIG_BF542 is not set
132# CONFIG_BF542M is not set
133# CONFIG_BF544 is not set 133# CONFIG_BF544 is not set
134# CONFIG_BF544M is not set
134# CONFIG_BF547 is not set 135# CONFIG_BF547 is not set
136# CONFIG_BF547M is not set
135# CONFIG_BF548 is not set 137# CONFIG_BF548 is not set
138# CONFIG_BF548M is not set
136# CONFIG_BF549 is not set 139# CONFIG_BF549 is not set
140# CONFIG_BF549M is not set
137# CONFIG_BF561 is not set 141# CONFIG_BF561 is not set
138CONFIG_BF_REV_MIN=2 142CONFIG_BF_REV_MIN=2
139CONFIG_BF_REV_MAX=3 143CONFIG_BF_REV_MAX=3
@@ -180,7 +184,6 @@ CONFIG_IRQ_SPI=10
180# CONFIG_BFIN537_BLUETECHNIX_TCM is not set 184# CONFIG_BFIN537_BLUETECHNIX_TCM is not set
181CONFIG_PNAV10=y 185CONFIG_PNAV10=y
182# CONFIG_CAMSIG_MINOTAUR is not set 186# CONFIG_CAMSIG_MINOTAUR is not set
183# CONFIG_GENERIC_BF537_BOARD is not set
184 187
185# 188#
186# BF537 Specific Configuration 189# BF537 Specific Configuration
@@ -341,7 +344,6 @@ CONFIG_BINFMT_ZFLAT=y
341# 344#
342# CONFIG_PM is not set 345# CONFIG_PM is not set
343CONFIG_ARCH_SUSPEND_POSSIBLE=y 346CONFIG_ARCH_SUSPEND_POSSIBLE=y
344# CONFIG_PM_WAKEUP_BY_GPIO is not set
345 347
346# 348#
347# CPU Frequency scaling 349# CPU Frequency scaling
@@ -538,7 +540,9 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
538# CONFIG_BLK_DEV_HD is not set 540# CONFIG_BLK_DEV_HD is not set
539CONFIG_MISC_DEVICES=y 541CONFIG_MISC_DEVICES=y
540# CONFIG_EEPROM_93CX6 is not set 542# CONFIG_EEPROM_93CX6 is not set
543# CONFIG_ICS932S401 is not set
541# CONFIG_ENCLOSURE_SERVICES is not set 544# CONFIG_ENCLOSURE_SERVICES is not set
545# CONFIG_C2PORT is not set
542CONFIG_HAVE_IDE=y 546CONFIG_HAVE_IDE=y
543# CONFIG_IDE is not set 547# CONFIG_IDE is not set
544 548
@@ -593,6 +597,7 @@ CONFIG_BFIN_MAC_RMII=y
593# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set 597# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
594# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 598# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
595# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 599# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
600# CONFIG_B44 is not set
596CONFIG_NETDEV_1000=y 601CONFIG_NETDEV_1000=y
597# CONFIG_AX88180 is not set 602# CONFIG_AX88180 is not set
598CONFIG_NETDEV_10000=y 603CONFIG_NETDEV_10000=y
@@ -776,6 +781,7 @@ CONFIG_SPI_MASTER=y
776# 781#
777CONFIG_SPI_BFIN=y 782CONFIG_SPI_BFIN=y
778# CONFIG_SPI_BFIN_LOCK is not set 783# CONFIG_SPI_BFIN_LOCK is not set
784# CONFIG_SPI_BFIN_SPORT is not set
779# CONFIG_SPI_BITBANG is not set 785# CONFIG_SPI_BITBANG is not set
780 786
781# 787#
@@ -799,6 +805,7 @@ CONFIG_HWMON=y
799# CONFIG_SENSORS_ADM1029 is not set 805# CONFIG_SENSORS_ADM1029 is not set
800# CONFIG_SENSORS_ADM1031 is not set 806# CONFIG_SENSORS_ADM1031 is not set
801# CONFIG_SENSORS_ADM9240 is not set 807# CONFIG_SENSORS_ADM9240 is not set
808# CONFIG_SENSORS_ADT7462 is not set
802# CONFIG_SENSORS_ADT7470 is not set 809# CONFIG_SENSORS_ADT7470 is not set
803# CONFIG_SENSORS_ADT7473 is not set 810# CONFIG_SENSORS_ADT7473 is not set
804# CONFIG_SENSORS_ATXP1 is not set 811# CONFIG_SENSORS_ATXP1 is not set
@@ -845,6 +852,12 @@ CONFIG_HWMON=y
845# CONFIG_THERMAL is not set 852# CONFIG_THERMAL is not set
846# CONFIG_THERMAL_HWMON is not set 853# CONFIG_THERMAL_HWMON is not set
847# CONFIG_WATCHDOG is not set 854# CONFIG_WATCHDOG is not set
855CONFIG_SSB_POSSIBLE=y
856
857#
858# Sonics Silicon Backplane
859#
860# CONFIG_SSB is not set
848 861
849# 862#
850# Multifunction device drivers 863# Multifunction device drivers
@@ -853,8 +866,10 @@ CONFIG_HWMON=y
853# CONFIG_MFD_SM501 is not set 866# CONFIG_MFD_SM501 is not set
854# CONFIG_HTC_PASIC3 is not set 867# CONFIG_HTC_PASIC3 is not set
855# CONFIG_MFD_TMIO is not set 868# CONFIG_MFD_TMIO is not set
869# CONFIG_PMIC_DA903X is not set
856# CONFIG_MFD_WM8400 is not set 870# CONFIG_MFD_WM8400 is not set
857# CONFIG_MFD_WM8350_I2C is not set 871# CONFIG_MFD_WM8350_I2C is not set
872# CONFIG_REGULATOR is not set
858 873
859# 874#
860# Multimedia devices 875# Multimedia devices
@@ -910,6 +925,7 @@ CONFIG_FB_BFIN_LANDSCAPE=y
910# CONFIG_FB_S1D13XXX is not set 925# CONFIG_FB_S1D13XXX is not set
911# CONFIG_FB_VIRTUAL is not set 926# CONFIG_FB_VIRTUAL is not set
912# CONFIG_FB_METRONOME is not set 927# CONFIG_FB_METRONOME is not set
928# CONFIG_FB_MB862XX is not set
913CONFIG_BACKLIGHT_LCD_SUPPORT=y 929CONFIG_BACKLIGHT_LCD_SUPPORT=y
914CONFIG_LCD_CLASS_DEVICE=y 930CONFIG_LCD_CLASS_DEVICE=y
915# CONFIG_LCD_LTV350QV is not set 931# CONFIG_LCD_LTV350QV is not set
@@ -966,7 +982,7 @@ CONFIG_USB_ARCH_HAS_HCD=y
966# 982#
967 983
968# 984#
969# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 985# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
970# 986#
971# CONFIG_USB_GADGET is not set 987# CONFIG_USB_GADGET is not set
972# CONFIG_MMC is not set 988# CONFIG_MMC is not set
@@ -1003,12 +1019,14 @@ CONFIG_RTC_INTF_DEV=y
1003# CONFIG_RTC_DRV_M41T80 is not set 1019# CONFIG_RTC_DRV_M41T80 is not set
1004# CONFIG_RTC_DRV_S35390A is not set 1020# CONFIG_RTC_DRV_S35390A is not set
1005# CONFIG_RTC_DRV_FM3130 is not set 1021# CONFIG_RTC_DRV_FM3130 is not set
1022# CONFIG_RTC_DRV_RX8581 is not set
1006 1023
1007# 1024#
1008# SPI RTC drivers 1025# SPI RTC drivers
1009# 1026#
1010# CONFIG_RTC_DRV_M41T94 is not set 1027# CONFIG_RTC_DRV_M41T94 is not set
1011# CONFIG_RTC_DRV_DS1305 is not set 1028# CONFIG_RTC_DRV_DS1305 is not set
1029# CONFIG_RTC_DRV_DS1390 is not set
1012# CONFIG_RTC_DRV_MAX6902 is not set 1030# CONFIG_RTC_DRV_MAX6902 is not set
1013# CONFIG_RTC_DRV_R9701 is not set 1031# CONFIG_RTC_DRV_R9701 is not set
1014# CONFIG_RTC_DRV_RS5C348 is not set 1032# CONFIG_RTC_DRV_RS5C348 is not set
@@ -1196,6 +1214,10 @@ CONFIG_FRAME_WARN=1024
1196# CONFIG_DEBUG_MEMORY_INIT is not set 1214# CONFIG_DEBUG_MEMORY_INIT is not set
1197# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1215# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1198# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1216# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1217
1218#
1219# Tracers
1220#
1199# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1221# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1200# CONFIG_SAMPLES is not set 1222# CONFIG_SAMPLES is not set
1201CONFIG_HAVE_ARCH_KGDB=y 1223CONFIG_HAVE_ARCH_KGDB=y
@@ -1230,6 +1252,7 @@ CONFIG_CRYPTO=y
1230# 1252#
1231# CONFIG_CRYPTO_FIPS is not set 1253# CONFIG_CRYPTO_FIPS is not set
1232# CONFIG_CRYPTO_MANAGER is not set 1254# CONFIG_CRYPTO_MANAGER is not set
1255# CONFIG_CRYPTO_MANAGER2 is not set
1233# CONFIG_CRYPTO_GF128MUL is not set 1256# CONFIG_CRYPTO_GF128MUL is not set
1234# CONFIG_CRYPTO_NULL is not set 1257# CONFIG_CRYPTO_NULL is not set
1235# CONFIG_CRYPTO_CRYPTD is not set 1258# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/blackfin/configs/SRV1_defconfig b/arch/blackfin/configs/SRV1_defconfig
index a46529c6ade3..2bc0779d22ea 100644
--- a/arch/blackfin/configs/SRV1_defconfig
+++ b/arch/blackfin/configs/SRV1_defconfig
@@ -49,7 +49,7 @@ CONFIG_SYSFS_DEPRECATED=y
49CONFIG_BLK_DEV_INITRD=y 49CONFIG_BLK_DEV_INITRD=y
50CONFIG_INITRAMFS_SOURCE="" 50CONFIG_INITRAMFS_SOURCE=""
51# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 51# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52CONFIG_SYSCTL=y 52# CONFIG_SYSCTL is not set
53CONFIG_EMBEDDED=y 53CONFIG_EMBEDDED=y
54CONFIG_UID16=y 54CONFIG_UID16=y
55CONFIG_SYSCTL_SYSCALL=y 55CONFIG_SYSCTL_SYSCALL=y
@@ -61,7 +61,7 @@ CONFIG_PRINTK=y
61CONFIG_BUG=y 61CONFIG_BUG=y
62# CONFIG_ELF_CORE is not set 62# CONFIG_ELF_CORE is not set
63CONFIG_BASE_FULL=y 63CONFIG_BASE_FULL=y
64CONFIG_FUTEX=y 64# CONFIG_FUTEX is not set
65CONFIG_ANON_INODES=y 65CONFIG_ANON_INODES=y
66CONFIG_EPOLL=y 66CONFIG_EPOLL=y
67CONFIG_SIGNALFD=y 67CONFIG_SIGNALFD=y
diff --git a/arch/blackfin/configs/TCM-BF537_defconfig b/arch/blackfin/configs/TCM-BF537_defconfig
index 97a1f1d20dcf..e65b3a49214f 100644
--- a/arch/blackfin/configs/TCM-BF537_defconfig
+++ b/arch/blackfin/configs/TCM-BF537_defconfig
@@ -39,7 +39,7 @@ CONFIG_LOG_BUF_SHIFT=14
39# CONFIG_NAMESPACES is not set 39# CONFIG_NAMESPACES is not set
40# CONFIG_BLK_DEV_INITRD is not set 40# CONFIG_BLK_DEV_INITRD is not set
41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
42CONFIG_SYSCTL=y 42# CONFIG_SYSCTL is not set
43CONFIG_EMBEDDED=y 43CONFIG_EMBEDDED=y
44# CONFIG_UID16 is not set 44# CONFIG_UID16 is not set
45CONFIG_SYSCTL_SYSCALL=y 45CONFIG_SYSCTL_SYSCALL=y
@@ -51,13 +51,13 @@ CONFIG_BUG=y
51# CONFIG_ELF_CORE is not set 51# CONFIG_ELF_CORE is not set
52CONFIG_COMPAT_BRK=y 52CONFIG_COMPAT_BRK=y
53CONFIG_BASE_FULL=y 53CONFIG_BASE_FULL=y
54CONFIG_FUTEX=y 54# CONFIG_FUTEX is not set
55CONFIG_ANON_INODES=y 55CONFIG_ANON_INODES=y
56CONFIG_EPOLL=y 56CONFIG_EPOLL=y
57CONFIG_SIGNALFD=y 57CONFIG_SIGNALFD=y
58CONFIG_TIMERFD=y 58CONFIG_TIMERFD=y
59CONFIG_EVENTFD=y 59CONFIG_EVENTFD=y
60CONFIG_AIO=y 60# CONFIG_AIO is not set
61CONFIG_VM_EVENT_COUNTERS=y 61CONFIG_VM_EVENT_COUNTERS=y
62CONFIG_SLAB=y 62CONFIG_SLAB=y
63# CONFIG_SLUB is not set 63# CONFIG_SLUB is not set
diff --git a/arch/blackfin/include/asm/bfin5xx_spi.h b/arch/blackfin/include/asm/bfin5xx_spi.h
index 1306e6b22946..0292d58f9362 100644
--- a/arch/blackfin/include/asm/bfin5xx_spi.h
+++ b/arch/blackfin/include/asm/bfin5xx_spi.h
@@ -110,7 +110,7 @@
110struct bfin5xx_spi_master { 110struct bfin5xx_spi_master {
111 u16 num_chipselect; 111 u16 num_chipselect;
112 u8 enable_dma; 112 u8 enable_dma;
113 u16 pin_req[4]; 113 u16 pin_req[7];
114}; 114};
115 115
116/* spi_board_info.controller_data for SPI slave devices, 116/* spi_board_info.controller_data for SPI slave devices,
diff --git a/arch/blackfin/include/asm/bfin_sport.h b/arch/blackfin/include/asm/bfin_sport.h
index 65a651db5b07..b558908e1c79 100644
--- a/arch/blackfin/include/asm/bfin_sport.h
+++ b/arch/blackfin/include/asm/bfin_sport.h
@@ -9,6 +9,13 @@
9#ifndef __BFIN_SPORT_H__ 9#ifndef __BFIN_SPORT_H__
10#define __BFIN_SPORT_H__ 10#define __BFIN_SPORT_H__
11 11
12#ifdef __KERNEL__
13#include <linux/cdev.h>
14#include <linux/mutex.h>
15#include <linux/sched.h>
16#include <linux/wait.h>
17#endif
18
12#define SPORT_MAJOR 237 19#define SPORT_MAJOR 237
13#define SPORT_NR_DEVS 2 20#define SPORT_NR_DEVS 2
14 21
@@ -119,7 +126,7 @@ struct sport_dev {
119 int tx_len; 126 int tx_len;
120 int tx_sent; 127 int tx_sent;
121 128
122 int sport_err_irq; 129 int err_irq;
123 130
124 struct mutex mutex; /* mutual exclusion semaphore */ 131 struct mutex mutex; /* mutual exclusion semaphore */
125 struct task_struct *task; 132 struct task_struct *task;
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h
index d4a082ef75b4..fe139619351f 100644
--- a/arch/blackfin/include/asm/gpio.h
+++ b/arch/blackfin/include/asm/gpio.h
@@ -110,7 +110,7 @@
110* MODIFICATION HISTORY : 110* MODIFICATION HISTORY :
111**************************************************************/ 111**************************************************************/
112 112
113#ifndef BF548_FAMILY 113#ifndef CONFIG_BF54x
114void set_gpio_dir(unsigned, unsigned short); 114void set_gpio_dir(unsigned, unsigned short);
115void set_gpio_inen(unsigned, unsigned short); 115void set_gpio_inen(unsigned, unsigned short);
116void set_gpio_polar(unsigned, unsigned short); 116void set_gpio_polar(unsigned, unsigned short);
@@ -303,7 +303,10 @@ static inline void gpio_set_value(unsigned gpio, int value)
303 303
304static inline int gpio_to_irq(unsigned gpio) 304static inline int gpio_to_irq(unsigned gpio)
305{ 305{
306 return (gpio + GPIO_IRQ_BASE); 306 if (likely(gpio < MAX_BLACKFIN_GPIOS))
307 return gpio + GPIO_IRQ_BASE;
308
309 return -EINVAL;
307} 310}
308 311
309static inline int irq_to_gpio(unsigned irq) 312static inline int irq_to_gpio(unsigned irq)
diff --git a/arch/blackfin/include/asm/gptimers.h b/arch/blackfin/include/asm/gptimers.h
index 0520d2aac8f3..b0f847ae4bf4 100644
--- a/arch/blackfin/include/asm/gptimers.h
+++ b/arch/blackfin/include/asm/gptimers.h
@@ -15,16 +15,16 @@
15#include <asm/blackfin.h> 15#include <asm/blackfin.h>
16 16
17/* 17/*
18 * BF537/BF527: 8 timers: 18 * BF51x/BF52x/BF537: 8 timers:
19 */ 19 */
20#if defined(BF527_FAMILY) || defined(BF537_FAMILY) 20#if defined(CONFIG_BF51x) || defined(CONFIG_BF52x) || defined(BF537_FAMILY)
21# define MAX_BLACKFIN_GPTIMERS 8 21# define MAX_BLACKFIN_GPTIMERS 8
22# define TIMER0_GROUP_REG TIMER_ENABLE 22# define TIMER0_GROUP_REG TIMER_ENABLE
23#endif 23#endif
24/* 24/*
25 * BF54x: 11 timers (BF542: 8 timers): 25 * BF54x: 11 timers (BF542: 8 timers):
26 */ 26 */
27#if defined(BF548_FAMILY) 27#if defined(CONFIG_BF54x)
28# ifdef CONFIG_BF542 28# ifdef CONFIG_BF542
29# define MAX_BLACKFIN_GPTIMERS 8 29# define MAX_BLACKFIN_GPTIMERS 8
30# else 30# else
diff --git a/arch/blackfin/include/asm/percpu.h b/arch/blackfin/include/asm/percpu.h
index 797c0c165069..c94c7bc88c71 100644
--- a/arch/blackfin/include/asm/percpu.h
+++ b/arch/blackfin/include/asm/percpu.h
@@ -3,14 +3,4 @@
3 3
4#include <asm-generic/percpu.h> 4#include <asm-generic/percpu.h>
5 5
6#ifdef CONFIG_MODULES
7#define PERCPU_MODULE_RESERVE 8192
8#else
9#define PERCPU_MODULE_RESERVE 0
10#endif
11
12#define PERCPU_ENOUGH_ROOM \
13 (ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES) + \
14 PERCPU_MODULE_RESERVE)
15
16#endif /* __ARCH_BLACKFIN_PERCPU__ */ 6#endif /* __ARCH_BLACKFIN_PERCPU__ */
diff --git a/arch/blackfin/include/asm/socket.h b/arch/blackfin/include/asm/socket.h
index 2ca702e44d47..fac7fe9e1f8a 100644
--- a/arch/blackfin/include/asm/socket.h
+++ b/arch/blackfin/include/asm/socket.h
@@ -53,4 +53,7 @@
53 53
54#define SO_MARK 36 54#define SO_MARK 36
55 55
56#define SO_TIMESTAMPING 37
57#define SCM_TIMESTAMPING SO_TIMESTAMPING
58
56#endif /* _ASM_SOCKET_H */ 59#endif /* _ASM_SOCKET_H */
diff --git a/arch/blackfin/include/asm/swab.h b/arch/blackfin/include/asm/swab.h
index 69a051b612bd..6403ad2932eb 100644
--- a/arch/blackfin/include/asm/swab.h
+++ b/arch/blackfin/include/asm/swab.h
@@ -1,7 +1,7 @@
1#ifndef _BLACKFIN_SWAB_H 1#ifndef _BLACKFIN_SWAB_H
2#define _BLACKFIN_SWAB_H 2#define _BLACKFIN_SWAB_H
3 3
4#include <asm/types.h> 4#include <linux/types.h>
5#include <linux/compiler.h> 5#include <linux/compiler.h>
6 6
7#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) 7#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 51dac55c524a..a0678da40532 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -69,7 +69,7 @@ enum {
69static struct gpio_port_t * const gpio_array[] = { 69static struct gpio_port_t * const gpio_array[] = {
70#if defined(BF533_FAMILY) || defined(BF538_FAMILY) 70#if defined(BF533_FAMILY) || defined(BF538_FAMILY)
71 (struct gpio_port_t *) FIO_FLAG_D, 71 (struct gpio_port_t *) FIO_FLAG_D,
72#elif defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) 72#elif defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
73 (struct gpio_port_t *) PORTFIO, 73 (struct gpio_port_t *) PORTFIO,
74 (struct gpio_port_t *) PORTGIO, 74 (struct gpio_port_t *) PORTGIO,
75 (struct gpio_port_t *) PORTHIO, 75 (struct gpio_port_t *) PORTHIO,
@@ -77,7 +77,7 @@ static struct gpio_port_t * const gpio_array[] = {
77 (struct gpio_port_t *) FIO0_FLAG_D, 77 (struct gpio_port_t *) FIO0_FLAG_D,
78 (struct gpio_port_t *) FIO1_FLAG_D, 78 (struct gpio_port_t *) FIO1_FLAG_D,
79 (struct gpio_port_t *) FIO2_FLAG_D, 79 (struct gpio_port_t *) FIO2_FLAG_D,
80#elif defined(BF548_FAMILY) 80#elif defined(CONFIG_BF54x)
81 (struct gpio_port_t *)PORTA_FER, 81 (struct gpio_port_t *)PORTA_FER,
82 (struct gpio_port_t *)PORTB_FER, 82 (struct gpio_port_t *)PORTB_FER,
83 (struct gpio_port_t *)PORTC_FER, 83 (struct gpio_port_t *)PORTC_FER,
@@ -93,7 +93,7 @@ static struct gpio_port_t * const gpio_array[] = {
93#endif 93#endif
94}; 94};
95 95
96#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) 96#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
97static unsigned short * const port_fer[] = { 97static unsigned short * const port_fer[] = {
98 (unsigned short *) PORTF_FER, 98 (unsigned short *) PORTF_FER,
99 (unsigned short *) PORTG_FER, 99 (unsigned short *) PORTG_FER,
@@ -109,11 +109,11 @@ static unsigned short * const port_mux[] = {
109 109
110static const 110static const
111u8 pmux_offset[][16] = { 111u8 pmux_offset[][16] = {
112# if defined(BF527_FAMILY) 112# if defined(CONFIG_BF52x)
113 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */ 113 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */
114 { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */ 114 { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */
115 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */ 115 { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */
116# elif defined(BF518_FAMILY) 116# elif defined(CONFIG_BF51x)
117 { 0, 2, 2, 2, 2, 2, 2, 4, 6, 6, 6, 8, 8, 8, 8, 10 }, /* PORTF */ 117 { 0, 2, 2, 2, 2, 2, 2, 4, 6, 6, 6, 8, 8, 8, 8, 10 }, /* PORTF */
118 { 0, 0, 0, 2, 4, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14 }, /* PORTG */ 118 { 0, 0, 0, 2, 4, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14 }, /* PORTG */
119 { 0, 0, 0, 0, 2, 2, 4, 6, 10, 10, 10, 10, 10, 10, 10, 10 }, /* PORTH */ 119 { 0, 0, 0, 0, 2, 2, 4, 6, 10, 10, 10, 10, 10, 10, 10, 10 }, /* PORTH */
@@ -139,7 +139,7 @@ static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM];
139 139
140inline int check_gpio(unsigned gpio) 140inline int check_gpio(unsigned gpio)
141{ 141{
142#if defined(BF548_FAMILY) 142#if defined(CONFIG_BF54x)
143 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 143 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
144 || gpio == GPIO_PH14 || gpio == GPIO_PH15 144 || gpio == GPIO_PH14 || gpio == GPIO_PH15
145 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15) 145 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
@@ -187,13 +187,13 @@ static void port_setup(unsigned gpio, unsigned short usage)
187 if (check_gpio(gpio)) 187 if (check_gpio(gpio))
188 return; 188 return;
189 189
190#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) 190#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
191 if (usage == GPIO_USAGE) 191 if (usage == GPIO_USAGE)
192 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); 192 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
193 else 193 else
194 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 194 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
195 SSYNC(); 195 SSYNC();
196#elif defined(BF548_FAMILY) 196#elif defined(CONFIG_BF54x)
197 if (usage == GPIO_USAGE) 197 if (usage == GPIO_USAGE)
198 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); 198 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
199 else 199 else
@@ -273,7 +273,7 @@ static void portmux_setup(unsigned short per)
273 } 273 }
274 } 274 }
275} 275}
276#elif defined(BF548_FAMILY) 276#elif defined(CONFIG_BF54x)
277inline void portmux_setup(unsigned short per) 277inline void portmux_setup(unsigned short per)
278{ 278{
279 u32 pmux; 279 u32 pmux;
@@ -297,7 +297,7 @@ inline u16 get_portmux(unsigned short per)
297 297
298 return (pmux >> (2 * gpio_sub_n(ident)) & 0x3); 298 return (pmux >> (2 * gpio_sub_n(ident)) & 0x3);
299} 299}
300#elif defined(BF527_FAMILY) || defined(BF518_FAMILY) 300#elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
301inline void portmux_setup(unsigned short per) 301inline void portmux_setup(unsigned short per)
302{ 302{
303 u16 pmux, ident = P_IDENT(per), function = P_FUNCT2MUX(per); 303 u16 pmux, ident = P_IDENT(per), function = P_FUNCT2MUX(per);
@@ -322,7 +322,7 @@ static int __init bfin_gpio_init(void)
322arch_initcall(bfin_gpio_init); 322arch_initcall(bfin_gpio_init);
323 323
324 324
325#ifndef BF548_FAMILY 325#ifndef CONFIG_BF54x
326/*********************************************************** 326/***********************************************************
327* 327*
328* FUNCTIONS: Blackfin General Purpose Ports Access Functions 328* FUNCTIONS: Blackfin General Purpose Ports Access Functions
@@ -489,7 +489,7 @@ static const unsigned int sic_iwr_irqs[] = {
489 IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX 489 IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX
490#elif defined(BF538_FAMILY) 490#elif defined(BF538_FAMILY)
491 IRQ_PORTF_INTB 491 IRQ_PORTF_INTB
492#elif defined(BF527_FAMILY) || defined(BF518_FAMILY) 492#elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
493 IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB 493 IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB
494#elif defined(BF561_FAMILY) 494#elif defined(BF561_FAMILY)
495 IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB 495 IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB
@@ -586,7 +586,7 @@ u32 bfin_pm_standby_setup(void)
586 gpio_array[bank]->maskb = 0; 586 gpio_array[bank]->maskb = 0;
587 587
588 if (mask) { 588 if (mask) {
589#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) 589#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
590 gpio_bank_saved[bank].fer = *port_fer[bank]; 590 gpio_bank_saved[bank].fer = *port_fer[bank];
591#endif 591#endif
592 gpio_bank_saved[bank].inen = gpio_array[bank]->inen; 592 gpio_bank_saved[bank].inen = gpio_array[bank]->inen;
@@ -631,7 +631,7 @@ void bfin_pm_standby_restore(void)
631 bank = gpio_bank(i); 631 bank = gpio_bank(i);
632 632
633 if (mask) { 633 if (mask) {
634#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) 634#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
635 *port_fer[bank] = gpio_bank_saved[bank].fer; 635 *port_fer[bank] = gpio_bank_saved[bank].fer;
636#endif 636#endif
637 gpio_array[bank]->inen = gpio_bank_saved[bank].inen; 637 gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
@@ -657,9 +657,9 @@ void bfin_gpio_pm_hibernate_suspend(void)
657 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 657 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
658 bank = gpio_bank(i); 658 bank = gpio_bank(i);
659 659
660#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) 660#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
661 gpio_bank_saved[bank].fer = *port_fer[bank]; 661 gpio_bank_saved[bank].fer = *port_fer[bank];
662#if defined(BF527_FAMILY) || defined(BF518_FAMILY) 662#if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
663 gpio_bank_saved[bank].mux = *port_mux[bank]; 663 gpio_bank_saved[bank].mux = *port_mux[bank];
664#else 664#else
665 if (bank == 0) 665 if (bank == 0)
@@ -685,8 +685,8 @@ void bfin_gpio_pm_hibernate_restore(void)
685 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 685 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
686 bank = gpio_bank(i); 686 bank = gpio_bank(i);
687 687
688#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY) 688#if defined(CONFIG_BF52x) || defined(BF537_FAMILY) || defined(CONFIG_BF51x)
689#if defined(BF527_FAMILY) || defined(BF518_FAMILY) 689#if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
690 *port_mux[bank] = gpio_bank_saved[bank].mux; 690 *port_mux[bank] = gpio_bank_saved[bank].mux;
691#else 691#else
692 if (bank == 0) 692 if (bank == 0)
@@ -710,7 +710,7 @@ void bfin_gpio_pm_hibernate_restore(void)
710 710
711 711
712#endif 712#endif
713#else /* BF548_FAMILY */ 713#else /* CONFIG_BF54x */
714#ifdef CONFIG_PM 714#ifdef CONFIG_PM
715 715
716u32 bfin_pm_standby_setup(void) 716u32 bfin_pm_standby_setup(void)
@@ -762,7 +762,7 @@ unsigned short get_gpio_dir(unsigned gpio)
762} 762}
763EXPORT_SYMBOL(get_gpio_dir); 763EXPORT_SYMBOL(get_gpio_dir);
764 764
765#endif /* BF548_FAMILY */ 765#endif /* CONFIG_BF54x */
766 766
767/*********************************************************** 767/***********************************************************
768* 768*
@@ -802,7 +802,8 @@ int peripheral_request(unsigned short per, const char *label)
802 */ 802 */
803 if (unlikely(!check_gpio(ident) && 803 if (unlikely(!check_gpio(ident) &&
804 reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) { 804 reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
805 dump_stack(); 805 if (system_state == SYSTEM_BOOTING)
806 dump_stack();
806 printk(KERN_ERR 807 printk(KERN_ERR
807 "%s: Peripheral %d is already reserved as GPIO by %s !\n", 808 "%s: Peripheral %d is already reserved as GPIO by %s !\n",
808 __func__, ident, get_label(ident)); 809 __func__, ident, get_label(ident));
@@ -817,7 +818,7 @@ int peripheral_request(unsigned short per, const char *label)
817 * be requested and used by several drivers 818 * be requested and used by several drivers
818 */ 819 */
819 820
820#ifdef BF548_FAMILY 821#ifdef CONFIG_BF54x
821 if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) { 822 if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) {
822#else 823#else
823 if (!(per & P_MAYSHARE)) { 824 if (!(per & P_MAYSHARE)) {
@@ -830,7 +831,8 @@ int peripheral_request(unsigned short per, const char *label)
830 if (cmp_label(ident, label) == 0) 831 if (cmp_label(ident, label) == 0)
831 goto anyway; 832 goto anyway;
832 833
833 dump_stack(); 834 if (system_state == SYSTEM_BOOTING)
835 dump_stack();
834 printk(KERN_ERR 836 printk(KERN_ERR
835 "%s: Peripheral %d function %d is already reserved by %s !\n", 837 "%s: Peripheral %d function %d is already reserved by %s !\n",
836 __func__, ident, P_FUNCT2MUX(per), get_label(ident)); 838 __func__, ident, P_FUNCT2MUX(per), get_label(ident));
@@ -946,14 +948,16 @@ int bfin_gpio_request(unsigned gpio, const char *label)
946 } 948 }
947 949
948 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 950 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
949 dump_stack(); 951 if (system_state == SYSTEM_BOOTING)
952 dump_stack();
950 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n", 953 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
951 gpio, get_label(gpio)); 954 gpio, get_label(gpio));
952 local_irq_restore_hw(flags); 955 local_irq_restore_hw(flags);
953 return -EBUSY; 956 return -EBUSY;
954 } 957 }
955 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 958 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
956 dump_stack(); 959 if (system_state == SYSTEM_BOOTING)
960 dump_stack();
957 printk(KERN_ERR 961 printk(KERN_ERR
958 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", 962 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
959 gpio, get_label(gpio)); 963 gpio, get_label(gpio));
@@ -964,7 +968,7 @@ int bfin_gpio_request(unsigned gpio, const char *label)
964 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!" 968 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!"
965 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio); 969 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio);
966 } 970 }
967#ifndef BF548_FAMILY 971#ifndef CONFIG_BF54x
968 else { /* Reset POLAR setting when acquiring a gpio for the first time */ 972 else { /* Reset POLAR setting when acquiring a gpio for the first time */
969 set_gpio_polar(gpio, 0); 973 set_gpio_polar(gpio, 0);
970 } 974 }
@@ -993,7 +997,8 @@ void bfin_gpio_free(unsigned gpio)
993 local_irq_save_hw(flags); 997 local_irq_save_hw(flags);
994 998
995 if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { 999 if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
996 dump_stack(); 1000 if (system_state == SYSTEM_BOOTING)
1001 dump_stack();
997 gpio_error(gpio); 1002 gpio_error(gpio);
998 local_irq_restore_hw(flags); 1003 local_irq_restore_hw(flags);
999 return; 1004 return;
@@ -1017,7 +1022,8 @@ int bfin_gpio_irq_request(unsigned gpio, const char *label)
1017 local_irq_save_hw(flags); 1022 local_irq_save_hw(flags);
1018 1023
1019 if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 1024 if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1020 dump_stack(); 1025 if (system_state == SYSTEM_BOOTING)
1026 dump_stack();
1021 printk(KERN_ERR 1027 printk(KERN_ERR
1022 "bfin-gpio: GPIO %d is already reserved as gpio-irq !\n", 1028 "bfin-gpio: GPIO %d is already reserved as gpio-irq !\n",
1023 gpio); 1029 gpio);
@@ -1025,7 +1031,8 @@ int bfin_gpio_irq_request(unsigned gpio, const char *label)
1025 return -EBUSY; 1031 return -EBUSY;
1026 } 1032 }
1027 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 1033 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1028 dump_stack(); 1034 if (system_state == SYSTEM_BOOTING)
1035 dump_stack();
1029 printk(KERN_ERR 1036 printk(KERN_ERR
1030 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", 1037 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
1031 gpio, get_label(gpio)); 1038 gpio, get_label(gpio));
@@ -1057,7 +1064,8 @@ void bfin_gpio_irq_free(unsigned gpio)
1057 local_irq_save_hw(flags); 1064 local_irq_save_hw(flags);
1058 1065
1059 if (unlikely(!(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { 1066 if (unlikely(!(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
1060 dump_stack(); 1067 if (system_state == SYSTEM_BOOTING)
1068 dump_stack();
1061 gpio_error(gpio); 1069 gpio_error(gpio);
1062 local_irq_restore_hw(flags); 1070 local_irq_restore_hw(flags);
1063 return; 1071 return;
@@ -1072,7 +1080,7 @@ void bfin_gpio_irq_free(unsigned gpio)
1072 1080
1073static inline void __bfin_gpio_direction_input(unsigned gpio) 1081static inline void __bfin_gpio_direction_input(unsigned gpio)
1074{ 1082{
1075#ifdef BF548_FAMILY 1083#ifdef CONFIG_BF54x
1076 gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio); 1084 gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio);
1077#else 1085#else
1078 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); 1086 gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
@@ -1100,13 +1108,13 @@ EXPORT_SYMBOL(bfin_gpio_direction_input);
1100 1108
1101void bfin_gpio_irq_prepare(unsigned gpio) 1109void bfin_gpio_irq_prepare(unsigned gpio)
1102{ 1110{
1103#ifdef BF548_FAMILY 1111#ifdef CONFIG_BF54x
1104 unsigned long flags; 1112 unsigned long flags;
1105#endif 1113#endif
1106 1114
1107 port_setup(gpio, GPIO_USAGE); 1115 port_setup(gpio, GPIO_USAGE);
1108 1116
1109#ifdef BF548_FAMILY 1117#ifdef CONFIG_BF54x
1110 local_irq_save_hw(flags); 1118 local_irq_save_hw(flags);
1111 __bfin_gpio_direction_input(gpio); 1119 __bfin_gpio_direction_input(gpio);
1112 local_irq_restore_hw(flags); 1120 local_irq_restore_hw(flags);
@@ -1135,7 +1143,7 @@ int bfin_gpio_direction_output(unsigned gpio, int value)
1135 1143
1136 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); 1144 gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
1137 gpio_set_value(gpio, value); 1145 gpio_set_value(gpio, value);
1138#ifdef BF548_FAMILY 1146#ifdef CONFIG_BF54x
1139 gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio); 1147 gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio);
1140#else 1148#else
1141 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio); 1149 gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
@@ -1150,7 +1158,7 @@ EXPORT_SYMBOL(bfin_gpio_direction_output);
1150 1158
1151int bfin_gpio_get_value(unsigned gpio) 1159int bfin_gpio_get_value(unsigned gpio)
1152{ 1160{
1153#ifdef BF548_FAMILY 1161#ifdef CONFIG_BF54x
1154 return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio))); 1162 return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)));
1155#else 1163#else
1156 unsigned long flags; 1164 unsigned long flags;
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c
index 7fd126564846..401bd32aa499 100644
--- a/arch/blackfin/kernel/irqchip.c
+++ b/arch/blackfin/kernel/irqchip.c
@@ -70,6 +70,11 @@ static struct irq_desc bad_irq_desc = {
70#endif 70#endif
71}; 71};
72 72
73#ifdef CONFIG_CPUMASK_OFFSTACK
74/* We are not allocating a variable-sized bad_irq_desc.affinity */
75#error "Blackfin architecture does not support CONFIG_CPUMASK_OFFSTACK."
76#endif
77
73int show_interrupts(struct seq_file *p, void *v) 78int show_interrupts(struct seq_file *p, void *v)
74{ 79{
75 int i = *(loff_t *) v, j; 80 int i = *(loff_t *) v, j;
@@ -83,7 +88,7 @@ int show_interrupts(struct seq_file *p, void *v)
83 goto skip; 88 goto skip;
84 seq_printf(p, "%3d: ", i); 89 seq_printf(p, "%3d: ", i);
85 for_each_online_cpu(j) 90 for_each_online_cpu(j)
86 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 91 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
87 seq_printf(p, " %8s", irq_desc[i].chip->name); 92 seq_printf(p, " %8s", irq_desc[i].chip->name);
88 seq_printf(p, " %s", action->name); 93 seq_printf(p, " %s", action->name);
89 for (action = action->next; action; action = action->next) 94 for (action = action->next; action; action = action->next)
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 4b4341da0585..27952ae047d8 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -183,6 +183,7 @@ SECTIONS
183 . = ALIGN(4); 183 . = ALIGN(4);
184 __etext_l1 = .; 184 __etext_l1 = .;
185 } 185 }
186 ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!")
186 187
187 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1)) 188 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1))
188 { 189 {
@@ -200,6 +201,7 @@ SECTIONS
200 . = ALIGN(4); 201 . = ALIGN(4);
201 __ebss_l1 = .; 202 __ebss_l1 = .;
202 } 203 }
204 ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!")
203 205
204 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) 206 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1))
205 { 207 {
@@ -214,6 +216,7 @@ SECTIONS
214 . = ALIGN(4); 216 . = ALIGN(4);
215 __ebss_b_l1 = .; 217 __ebss_b_l1 = .;
216 } 218 }
219 ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!")
217 220
218 __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); 221 __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
219 222
@@ -239,6 +242,7 @@ SECTIONS
239 . = ALIGN(4); 242 . = ALIGN(4);
240 __ebss_l2 = .; 243 __ebss_l2 = .;
241 } 244 }
245 ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!")
242 246
243 /* Force trailing alignment of our init section so that when we 247 /* Force trailing alignment of our init section so that when we
244 * free our init memory, we don't leave behind a partial page. 248 * free our init memory, we don't leave behind a partial page.
diff --git a/arch/blackfin/mach-bf518/include/mach/blackfin.h b/arch/blackfin/mach-bf518/include/mach/blackfin.h
index d1a2b9ca6227..267bb7c8bfb5 100644
--- a/arch/blackfin/mach-bf518/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf518/include/mach/blackfin.h
@@ -32,8 +32,6 @@
32#ifndef _MACH_BLACKFIN_H_ 32#ifndef _MACH_BLACKFIN_H_
33#define _MACH_BLACKFIN_H_ 33#define _MACH_BLACKFIN_H_
34 34
35#define BF518_FAMILY
36
37#include "bf518.h" 35#include "bf518.h"
38#include "mem_map.h" 36#include "mem_map.h"
39#include "defBF512.h" 37#include "defBF512.h"
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF514.h b/arch/blackfin/mach-bf518/include/mach/cdefBF514.h
index 9521e178fb28..dfe492dfe54e 100644
--- a/arch/blackfin/mach-bf518/include/mach/cdefBF514.h
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF514.h
@@ -45,4 +45,71 @@
45 45
46/* The following are the #defines needed by ADSP-BF514 that are not in the common header */ 46/* The following are the #defines needed by ADSP-BF514 that are not in the common header */
47 47
48/* Removable Storage Interface Registers */
49
50#define bfin_read_RSI_PWR_CTL() bfin_read16(RSI_PWR_CONTROL)
51#define bfin_write_RSI_PWR_CTL(val) bfin_write16(RSI_PWR_CONTROL, val)
52#define bfin_read_RSI_CLK_CTL() bfin_read16(RSI_CLK_CONTROL)
53#define bfin_write_RSI_CLK_CTL(val) bfin_write16(RSI_CLK_CONTROL, val)
54#define bfin_read_RSI_ARGUMENT() bfin_read32(RSI_ARGUMENT)
55#define bfin_write_RSI_ARGUMENT(val) bfin_write32(RSI_ARGUMENT, val)
56#define bfin_read_RSI_COMMAND() bfin_read16(RSI_COMMAND)
57#define bfin_write_RSI_COMMAND(val) bfin_write16(RSI_COMMAND, val)
58#define bfin_read_RSI_RESP_CMD() bfin_read16(RSI_RESP_CMD)
59#define bfin_write_RSI_RESP_CMD(val) bfin_write16(RSI_RESP_CMD, val)
60#define bfin_read_RSI_RESPONSE0() bfin_read32(RSI_RESPONSE0)
61#define bfin_write_RSI_RESPONSE0(val) bfin_write32(RSI_RESPONSE0, val)
62#define bfin_read_RSI_RESPONSE1() bfin_read32(RSI_RESPONSE1)
63#define bfin_write_RSI_RESPONSE1(val) bfin_write32(RSI_RESPONSE1, val)
64#define bfin_read_RSI_RESPONSE2() bfin_read32(RSI_RESPONSE2)
65#define bfin_write_RSI_RESPONSE2(val) bfin_write32(RSI_RESPONSE2, val)
66#define bfin_read_RSI_RESPONSE3() bfin_read32(RSI_RESPONSE3)
67#define bfin_write_RSI_RESPONSE3(val) bfin_write32(RSI_RESPONSE3, val)
68#define bfin_read_RSI_DATA_TIMER() bfin_read32(RSI_DATA_TIMER)
69#define bfin_write_RSI_DATA_TIMER(val) bfin_write32(RSI_DATA_TIMER, val)
70#define bfin_read_RSI_DATA_LGTH() bfin_read16(RSI_DATA_LGTH)
71#define bfin_write_RSI_DATA_LGTH(val) bfin_write16(RSI_DATA_LGTH, val)
72#define bfin_read_RSI_DATA_CTL() bfin_read16(RSI_DATA_CONTROL)
73#define bfin_write_RSI_DATA_CTL(val) bfin_write16(RSI_DATA_CONTROL, val)
74#define bfin_read_RSI_DATA_CNT() bfin_read16(RSI_DATA_CNT)
75#define bfin_write_RSI_DATA_CNT(val) bfin_write16(RSI_DATA_CNT, val)
76#define bfin_read_RSI_STATUS() bfin_read32(RSI_STATUS)
77#define bfin_write_RSI_STATUS(val) bfin_write32(RSI_STATUS, val)
78#define bfin_read_RSI_STATUS_CLR() bfin_read16(RSI_STATUSCL)
79#define bfin_write_RSI_STATUS_CLR(val) bfin_write16(RSI_STATUSCL, val)
80#define bfin_read_RSI_MASK0() bfin_read32(RSI_MASK0)
81#define bfin_write_RSI_MASK0(val) bfin_write32(RSI_MASK0, val)
82#define bfin_read_RSI_MASK1() bfin_read32(RSI_MASK1)
83#define bfin_write_RSI_MASK1(val) bfin_write32(RSI_MASK1, val)
84#define bfin_read_RSI_FIFO_CNT() bfin_read16(RSI_FIFO_CNT)
85#define bfin_write_RSI_FIFO_CNT(val) bfin_write16(RSI_FIFO_CNT, val)
86#define bfin_read_RSI_CEATA_CTL() bfin_read16(RSI_CEATA_CONTROL)
87#define bfin_write_RSI_CEATA_CTL(val) bfin_write16(RSI_CEATA_CONTROL, val)
88#define bfin_read_RSI_FIFO() bfin_read32(RSI_FIFO)
89#define bfin_write_RSI_FIFO(val) bfin_write32(RSI_FIFO, val)
90#define bfin_read_RSI_E_STATUS() bfin_read16(RSI_ESTAT)
91#define bfin_write_RSI_E_STATUS(val) bfin_write16(RSI_ESTAT, val)
92#define bfin_read_RSI_E_MASK() bfin_read16(RSI_EMASK)
93#define bfin_write_RSI_E_MASK(val) bfin_write16(RSI_EMASK, val)
94#define bfin_read_RSI_CFG() bfin_read16(RSI_CONFIG)
95#define bfin_write_RSI_CFG(val) bfin_write16(RSI_CONFIG, val)
96#define bfin_read_RSI_RD_WAIT_EN() bfin_read16(RSI_RD_WAIT_EN)
97#define bfin_write_RSI_RD_WAIT_EN(val) bfin_write16(RSI_RD_WAIT_EN, val)
98#define bfin_read_RSI_PID0() bfin_read16(RSI_PID0)
99#define bfin_write_RSI_PID0(val) bfin_write16(RSI_PID0, val)
100#define bfin_read_RSI_PID1() bfin_read16(RSI_PID1)
101#define bfin_write_RSI_PID1(val) bfin_write16(RSI_PID1, val)
102#define bfin_read_RSI_PID2() bfin_read16(RSI_PID2)
103#define bfin_write_RSI_PID2(val) bfin_write16(RSI_PID2, val)
104#define bfin_read_RSI_PID3() bfin_read16(RSI_PID3)
105#define bfin_write_RSI_PID3(val) bfin_write16(RSI_PID3, val)
106#define bfin_read_RSI_PID4() bfin_read16(RSI_PID4)
107#define bfin_write_RSI_PID4(val) bfin_write16(RSI_PID4, val)
108#define bfin_read_RSI_PID5() bfin_read16(RSI_PID5)
109#define bfin_write_RSI_PID5(val) bfin_write16(RSI_PID5, val)
110#define bfin_read_RSI_PID6() bfin_read16(RSI_PID6)
111#define bfin_write_RSI_PID6(val) bfin_write16(RSI_PID6, val)
112#define bfin_read_RSI_PID7() bfin_read16(RSI_PID7)
113#define bfin_write_RSI_PID7(val) bfin_write16(RSI_PID7, val)
114
48#endif /* _CDEF_BF514_H */ 115#endif /* _CDEF_BF514_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF516.h b/arch/blackfin/mach-bf518/include/mach/cdefBF516.h
index 4e26ccfcef97..14df43d4677a 100644
--- a/arch/blackfin/mach-bf518/include/mach/cdefBF516.h
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF516.h
@@ -210,4 +210,71 @@
210#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT) 210#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
211#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT, val) 211#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT, val)
212 212
213/* Removable Storage Interface Registers */
214
215#define bfin_read_RSI_PWR_CTL() bfin_read16(RSI_PWR_CONTROL)
216#define bfin_write_RSI_PWR_CTL(val) bfin_write16(RSI_PWR_CONTROL, val)
217#define bfin_read_RSI_CLK_CTL() bfin_read16(RSI_CLK_CONTROL)
218#define bfin_write_RSI_CLK_CTL(val) bfin_write16(RSI_CLK_CONTROL, val)
219#define bfin_read_RSI_ARGUMENT() bfin_read32(RSI_ARGUMENT)
220#define bfin_write_RSI_ARGUMENT(val) bfin_write32(RSI_ARGUMENT, val)
221#define bfin_read_RSI_COMMAND() bfin_read16(RSI_COMMAND)
222#define bfin_write_RSI_COMMAND(val) bfin_write16(RSI_COMMAND, val)
223#define bfin_read_RSI_RESP_CMD() bfin_read16(RSI_RESP_CMD)
224#define bfin_write_RSI_RESP_CMD(val) bfin_write16(RSI_RESP_CMD, val)
225#define bfin_read_RSI_RESPONSE0() bfin_read32(RSI_RESPONSE0)
226#define bfin_write_RSI_RESPONSE0(val) bfin_write32(RSI_RESPONSE0, val)
227#define bfin_read_RSI_RESPONSE1() bfin_read32(RSI_RESPONSE1)
228#define bfin_write_RSI_RESPONSE1(val) bfin_write32(RSI_RESPONSE1, val)
229#define bfin_read_RSI_RESPONSE2() bfin_read32(RSI_RESPONSE2)
230#define bfin_write_RSI_RESPONSE2(val) bfin_write32(RSI_RESPONSE2, val)
231#define bfin_read_RSI_RESPONSE3() bfin_read32(RSI_RESPONSE3)
232#define bfin_write_RSI_RESPONSE3(val) bfin_write32(RSI_RESPONSE3, val)
233#define bfin_read_RSI_DATA_TIMER() bfin_read32(RSI_DATA_TIMER)
234#define bfin_write_RSI_DATA_TIMER(val) bfin_write32(RSI_DATA_TIMER, val)
235#define bfin_read_RSI_DATA_LGTH() bfin_read16(RSI_DATA_LGTH)
236#define bfin_write_RSI_DATA_LGTH(val) bfin_write16(RSI_DATA_LGTH, val)
237#define bfin_read_RSI_DATA_CTL() bfin_read16(RSI_DATA_CONTROL)
238#define bfin_write_RSI_DATA_CTL(val) bfin_write16(RSI_DATA_CONTROL, val)
239#define bfin_read_RSI_DATA_CNT() bfin_read16(RSI_DATA_CNT)
240#define bfin_write_RSI_DATA_CNT(val) bfin_write16(RSI_DATA_CNT, val)
241#define bfin_read_RSI_STATUS() bfin_read32(RSI_STATUS)
242#define bfin_write_RSI_STATUS(val) bfin_write32(RSI_STATUS, val)
243#define bfin_read_RSI_STATUS_CLR() bfin_read16(RSI_STATUSCL)
244#define bfin_write_RSI_STATUS_CLR(val) bfin_write16(RSI_STATUSCL, val)
245#define bfin_read_RSI_MASK0() bfin_read32(RSI_MASK0)
246#define bfin_write_RSI_MASK0(val) bfin_write32(RSI_MASK0, val)
247#define bfin_read_RSI_MASK1() bfin_read32(RSI_MASK1)
248#define bfin_write_RSI_MASK1(val) bfin_write32(RSI_MASK1, val)
249#define bfin_read_RSI_FIFO_CNT() bfin_read16(RSI_FIFO_CNT)
250#define bfin_write_RSI_FIFO_CNT(val) bfin_write16(RSI_FIFO_CNT, val)
251#define bfin_read_RSI_CEATA_CTL() bfin_read16(RSI_CEATA_CONTROL)
252#define bfin_write_RSI_CEATA_CTL(val) bfin_write16(RSI_CEATA_CONTROL, val)
253#define bfin_read_RSI_FIFO() bfin_read32(RSI_FIFO)
254#define bfin_write_RSI_FIFO(val) bfin_write32(RSI_FIFO, val)
255#define bfin_read_RSI_E_STATUS() bfin_read16(RSI_ESTAT)
256#define bfin_write_RSI_E_STATUS(val) bfin_write16(RSI_ESTAT, val)
257#define bfin_read_RSI_E_MASK() bfin_read16(RSI_EMASK)
258#define bfin_write_RSI_E_MASK(val) bfin_write16(RSI_EMASK, val)
259#define bfin_read_RSI_CFG() bfin_read16(RSI_CONFIG)
260#define bfin_write_RSI_CFG(val) bfin_write16(RSI_CONFIG, val)
261#define bfin_read_RSI_RD_WAIT_EN() bfin_read16(RSI_RD_WAIT_EN)
262#define bfin_write_RSI_RD_WAIT_EN(val) bfin_write16(RSI_RD_WAIT_EN, val)
263#define bfin_read_RSI_PID0() bfin_read16(RSI_PID0)
264#define bfin_write_RSI_PID0(val) bfin_write16(RSI_PID0, val)
265#define bfin_read_RSI_PID1() bfin_read16(RSI_PID1)
266#define bfin_write_RSI_PID1(val) bfin_write16(RSI_PID1, val)
267#define bfin_read_RSI_PID2() bfin_read16(RSI_PID2)
268#define bfin_write_RSI_PID2(val) bfin_write16(RSI_PID2, val)
269#define bfin_read_RSI_PID3() bfin_read16(RSI_PID3)
270#define bfin_write_RSI_PID3(val) bfin_write16(RSI_PID3, val)
271#define bfin_read_RSI_PID4() bfin_read16(RSI_PID4)
272#define bfin_write_RSI_PID4(val) bfin_write16(RSI_PID4, val)
273#define bfin_read_RSI_PID5() bfin_read16(RSI_PID5)
274#define bfin_write_RSI_PID5(val) bfin_write16(RSI_PID5, val)
275#define bfin_read_RSI_PID6() bfin_read16(RSI_PID6)
276#define bfin_write_RSI_PID6(val) bfin_write16(RSI_PID6, val)
277#define bfin_read_RSI_PID7() bfin_read16(RSI_PID7)
278#define bfin_write_RSI_PID7(val) bfin_write16(RSI_PID7, val)
279
213#endif /* _CDEF_BF516_H */ 280#endif /* _CDEF_BF516_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/defBF514.h b/arch/blackfin/mach-bf518/include/mach/defBF514.h
index 543f2913b3f5..56ee5a7c2007 100644
--- a/arch/blackfin/mach-bf518/include/mach/defBF514.h
+++ b/arch/blackfin/mach-bf518/include/mach/defBF514.h
@@ -110,4 +110,139 @@
110#define RSI_PID6 0xFFC03FF8 /* RSI Peripheral ID Register 6 */ 110#define RSI_PID6 0xFFC03FF8 /* RSI Peripheral ID Register 6 */
111#define RSI_PID7 0xFFC03FFC /* RSI Peripheral ID Register 7 */ 111#define RSI_PID7 0xFFC03FFC /* RSI Peripheral ID Register 7 */
112 112
113/* ********************************************************** */
114/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
115/* and MULTI BIT READ MACROS */
116/* ********************************************************** */
117
118/* Bit masks for SDH_COMMAND */
119
120#define CMD_IDX 0x3f /* Command Index */
121#define CMD_RSP 0x40 /* Response */
122#define CMD_L_RSP 0x80 /* Long Response */
123#define CMD_INT_E 0x100 /* Command Interrupt */
124#define CMD_PEND_E 0x200 /* Command Pending */
125#define CMD_E 0x400 /* Command Enable */
126
127/* Bit masks for SDH_PWR_CTL */
128
129#define PWR_ON 0x3 /* Power On */
130#if 0
131#define TBD 0x3c /* TBD */
132#endif
133#define SD_CMD_OD 0x40 /* Open Drain Output */
134#define ROD_CTL 0x80 /* Rod Control */
135
136/* Bit masks for SDH_CLK_CTL */
137
138#define CLKDIV 0xff /* MC_CLK Divisor */
139#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
140#define PWR_SV_E 0x200 /* Power Save Enable */
141#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
142#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
143
144/* Bit masks for SDH_RESP_CMD */
145
146#define RESP_CMD 0x3f /* Response Command */
147
148/* Bit masks for SDH_DATA_CTL */
149
150#define DTX_E 0x1 /* Data Transfer Enable */
151#define DTX_DIR 0x2 /* Data Transfer Direction */
152#define DTX_MODE 0x4 /* Data Transfer Mode */
153#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
154#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
155
156/* Bit masks for SDH_STATUS */
157
158#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
159#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
160#define CMD_TIME_OUT 0x4 /* CMD Time Out */
161#define DAT_TIME_OUT 0x8 /* Data Time Out */
162#define TX_UNDERRUN 0x10 /* Transmit Underrun */
163#define RX_OVERRUN 0x20 /* Receive Overrun */
164#define CMD_RESP_END 0x40 /* CMD Response End */
165#define CMD_SENT 0x80 /* CMD Sent */
166#define DAT_END 0x100 /* Data End */
167#define START_BIT_ERR 0x200 /* Start Bit Error */
168#define DAT_BLK_END 0x400 /* Data Block End */
169#define CMD_ACT 0x800 /* CMD Active */
170#define TX_ACT 0x1000 /* Transmit Active */
171#define RX_ACT 0x2000 /* Receive Active */
172#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
173#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
174#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
175#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
176#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
177#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
178#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
179#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
180
181/* Bit masks for SDH_STATUS_CLR */
182
183#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
184#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
185#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
186#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
187#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
188#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
189#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
190#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
191#define DAT_END_STAT 0x100 /* Data End Status */
192#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
193#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
194
195/* Bit masks for SDH_MASK0 */
196
197#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
198#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
199#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
200#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
201#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
202#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
203#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
204#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
205#define DAT_END_MASK 0x100 /* Data End Mask */
206#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
207#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
208#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
209#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
210#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
211#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
212#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
213#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
214#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
215#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
216#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
217#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
218#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
219
220/* Bit masks for SDH_FIFO_CNT */
221
222#define FIFO_COUNT 0x7fff /* FIFO Count */
223
224/* Bit masks for SDH_E_STATUS */
225
226#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
227#define SD_CARD_DET 0x10 /* SD Card Detect */
228
229/* Bit masks for SDH_E_MASK */
230
231#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
232#define SCD_MSK 0x40 /* Mask Card Detect */
233
234/* Bit masks for SDH_CFG */
235
236#define CLKS_EN 0x1 /* Clocks Enable */
237#define SD4E 0x4 /* SDIO 4-Bit Enable */
238#define MWE 0x8 /* Moving Window Enable */
239#define SD_RST 0x10 /* SDMMC Reset */
240#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
241#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
242#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
243
244/* Bit masks for SDH_RD_WAIT_EN */
245
246#define RWR 0x1 /* Read Wait Request */
247
113#endif /* _DEF_BF514_H */ 248#endif /* _DEF_BF514_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/defBF516.h b/arch/blackfin/mach-bf518/include/mach/defBF516.h
index 149a269306c5..dfc93843517d 100644
--- a/arch/blackfin/mach-bf518/include/mach/defBF516.h
+++ b/arch/blackfin/mach-bf518/include/mach/defBF516.h
@@ -487,4 +487,139 @@
487#define RSI_PID6 0xFFC03FF8 /* RSI Peripheral ID Register 6 */ 487#define RSI_PID6 0xFFC03FF8 /* RSI Peripheral ID Register 6 */
488#define RSI_PID7 0xFFC03FFC /* RSI Peripheral ID Register 7 */ 488#define RSI_PID7 0xFFC03FFC /* RSI Peripheral ID Register 7 */
489 489
490/* ********************************************************** */
491/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
492/* and MULTI BIT READ MACROS */
493/* ********************************************************** */
494
495/* Bit masks for SDH_COMMAND */
496
497#define CMD_IDX 0x3f /* Command Index */
498#define CMD_RSP 0x40 /* Response */
499#define CMD_L_RSP 0x80 /* Long Response */
500#define CMD_INT_E 0x100 /* Command Interrupt */
501#define CMD_PEND_E 0x200 /* Command Pending */
502#define CMD_E 0x400 /* Command Enable */
503
504/* Bit masks for SDH_PWR_CTL */
505
506#define PWR_ON 0x3 /* Power On */
507#if 0
508#define TBD 0x3c /* TBD */
509#endif
510#define SD_CMD_OD 0x40 /* Open Drain Output */
511#define ROD_CTL 0x80 /* Rod Control */
512
513/* Bit masks for SDH_CLK_CTL */
514
515#define CLKDIV 0xff /* MC_CLK Divisor */
516#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
517#define PWR_SV_E 0x200 /* Power Save Enable */
518#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
519#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
520
521/* Bit masks for SDH_RESP_CMD */
522
523#define RESP_CMD 0x3f /* Response Command */
524
525/* Bit masks for SDH_DATA_CTL */
526
527#define DTX_E 0x1 /* Data Transfer Enable */
528#define DTX_DIR 0x2 /* Data Transfer Direction */
529#define DTX_MODE 0x4 /* Data Transfer Mode */
530#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
531#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
532
533/* Bit masks for SDH_STATUS */
534
535#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
536#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
537#define CMD_TIME_OUT 0x4 /* CMD Time Out */
538#define DAT_TIME_OUT 0x8 /* Data Time Out */
539#define TX_UNDERRUN 0x10 /* Transmit Underrun */
540#define RX_OVERRUN 0x20 /* Receive Overrun */
541#define CMD_RESP_END 0x40 /* CMD Response End */
542#define CMD_SENT 0x80 /* CMD Sent */
543#define DAT_END 0x100 /* Data End */
544#define START_BIT_ERR 0x200 /* Start Bit Error */
545#define DAT_BLK_END 0x400 /* Data Block End */
546#define CMD_ACT 0x800 /* CMD Active */
547#define TX_ACT 0x1000 /* Transmit Active */
548#define RX_ACT 0x2000 /* Receive Active */
549#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
550#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
551#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
552#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
553#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
554#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
555#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
556#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
557
558/* Bit masks for SDH_STATUS_CLR */
559
560#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
561#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
562#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
563#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
564#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
565#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
566#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
567#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
568#define DAT_END_STAT 0x100 /* Data End Status */
569#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
570#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
571
572/* Bit masks for SDH_MASK0 */
573
574#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
575#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
576#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
577#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
578#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
579#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
580#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
581#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
582#define DAT_END_MASK 0x100 /* Data End Mask */
583#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
584#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
585#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
586#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
587#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
588#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
589#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
590#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
591#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
592#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
593#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
594#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
595#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
596
597/* Bit masks for SDH_FIFO_CNT */
598
599#define FIFO_COUNT 0x7fff /* FIFO Count */
600
601/* Bit masks for SDH_E_STATUS */
602
603#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
604#define SD_CARD_DET 0x10 /* SD Card Detect */
605
606/* Bit masks for SDH_E_MASK */
607
608#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
609#define SCD_MSK 0x40 /* Mask Card Detect */
610
611/* Bit masks for SDH_CFG */
612
613#define CLKS_EN 0x1 /* Clocks Enable */
614#define SD4E 0x4 /* SDIO 4-Bit Enable */
615#define MWE 0x8 /* Moving Window Enable */
616#define SD_RST 0x10 /* SDMMC Reset */
617#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
618#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
619#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
620
621/* Bit masks for SDH_RD_WAIT_EN */
622
623#define RWR 0x1 /* Read Wait Request */
624
490#endif /* _DEF_BF516_H */ 625#endif /* _DEF_BF516_H */
diff --git a/arch/blackfin/mach-bf527/include/mach/blackfin.h b/arch/blackfin/mach-bf527/include/mach/blackfin.h
index 297821e2d79a..417abcd61f4d 100644
--- a/arch/blackfin/mach-bf527/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf527/include/mach/blackfin.h
@@ -32,8 +32,6 @@
32#ifndef _MACH_BLACKFIN_H_ 32#ifndef _MACH_BLACKFIN_H_
33#define _MACH_BLACKFIN_H_ 33#define _MACH_BLACKFIN_H_
34 34
35#define BF527_FAMILY
36
37#include "bf527.h" 35#include "bf527.h"
38#include "mem_map.h" 36#include "mem_map.h"
39#include "defBF522.h" 37#include "defBF522.h"
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index cd04c5e44878..0572926da23f 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -843,6 +843,71 @@ static struct platform_device bfin_spi0_device = {
843}; 843};
844#endif /* spi master and devices */ 844#endif /* spi master and devices */
845 845
846#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
847
848/* SPORT SPI controller data */
849static struct bfin5xx_spi_master bfin_sport_spi0_info = {
850 .num_chipselect = 1, /* master only supports one device */
851 .enable_dma = 0, /* master don't support DMA */
852 .pin_req = {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_DRPRI,
853 P_SPORT0_RSCLK, P_SPORT0_TFS, P_SPORT0_RFS, 0},
854};
855
856static struct resource bfin_sport_spi0_resource[] = {
857 [0] = {
858 .start = SPORT0_TCR1,
859 .end = SPORT0_TCR1 + 0xFF,
860 .flags = IORESOURCE_MEM,
861 },
862 [1] = {
863 .start = IRQ_SPORT0_ERROR,
864 .end = IRQ_SPORT0_ERROR,
865 .flags = IORESOURCE_IRQ,
866 },
867};
868
869static struct platform_device bfin_sport_spi0_device = {
870 .name = "bfin-sport-spi",
871 .id = 1, /* Bus number */
872 .num_resources = ARRAY_SIZE(bfin_sport_spi0_resource),
873 .resource = bfin_sport_spi0_resource,
874 .dev = {
875 .platform_data = &bfin_sport_spi0_info, /* Passed to driver */
876 },
877};
878
879static struct bfin5xx_spi_master bfin_sport_spi1_info = {
880 .num_chipselect = 1, /* master only supports one device */
881 .enable_dma = 0, /* master don't support DMA */
882 .pin_req = {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_DRPRI,
883 P_SPORT1_RSCLK, P_SPORT1_TFS, P_SPORT1_RFS, 0},
884};
885
886static struct resource bfin_sport_spi1_resource[] = {
887 [0] = {
888 .start = SPORT1_TCR1,
889 .end = SPORT1_TCR1 + 0xFF,
890 .flags = IORESOURCE_MEM,
891 },
892 [1] = {
893 .start = IRQ_SPORT1_ERROR,
894 .end = IRQ_SPORT1_ERROR,
895 .flags = IORESOURCE_IRQ,
896 },
897};
898
899static struct platform_device bfin_sport_spi1_device = {
900 .name = "bfin-sport-spi",
901 .id = 2, /* Bus number */
902 .num_resources = ARRAY_SIZE(bfin_sport_spi1_resource),
903 .resource = bfin_sport_spi1_resource,
904 .dev = {
905 .platform_data = &bfin_sport_spi1_info, /* Passed to driver */
906 },
907};
908
909#endif /* sport spi master and devices */
910
846#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 911#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
847static struct platform_device bfin_fb_device = { 912static struct platform_device bfin_fb_device = {
848 .name = "bf537-lq035", 913 .name = "bf537-lq035",
@@ -1073,6 +1138,141 @@ static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1073}; 1138};
1074#endif 1139#endif
1075 1140
1141#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1142#include <linux/mfd/adp5520.h>
1143
1144 /*
1145 * ADP5520/5501 Backlight Data
1146 */
1147
1148static struct adp5520_backlight_platfrom_data adp5520_backlight_data = {
1149 .fade_in = FADE_T_1200ms,
1150 .fade_out = FADE_T_1200ms,
1151 .fade_led_law = BL_LAW_LINEAR,
1152 .en_ambl_sens = 1,
1153 .abml_filt = BL_AMBL_FILT_640ms,
1154 .l1_daylight_max = BL_CUR_mA(15),
1155 .l1_daylight_dim = BL_CUR_mA(0),
1156 .l2_office_max = BL_CUR_mA(7),
1157 .l2_office_dim = BL_CUR_mA(0),
1158 .l3_dark_max = BL_CUR_mA(3),
1159 .l3_dark_dim = BL_CUR_mA(0),
1160 .l2_trip = L2_COMP_CURR_uA(700),
1161 .l2_hyst = L2_COMP_CURR_uA(50),
1162 .l3_trip = L3_COMP_CURR_uA(80),
1163 .l3_hyst = L3_COMP_CURR_uA(20),
1164};
1165
1166 /*
1167 * ADP5520/5501 LEDs Data
1168 */
1169
1170#include <linux/leds.h>
1171
1172static struct led_info adp5520_leds[] = {
1173 {
1174 .name = "adp5520-led1",
1175 .default_trigger = "none",
1176 .flags = FLAG_ID_ADP5520_LED1_ADP5501_LED0 | LED_OFFT_600ms,
1177 },
1178#ifdef ADP5520_EN_ALL_LEDS
1179 {
1180 .name = "adp5520-led2",
1181 .default_trigger = "none",
1182 .flags = FLAG_ID_ADP5520_LED2_ADP5501_LED1,
1183 },
1184 {
1185 .name = "adp5520-led3",
1186 .default_trigger = "none",
1187 .flags = FLAG_ID_ADP5520_LED3_ADP5501_LED2,
1188 },
1189#endif
1190};
1191
1192static struct adp5520_leds_platfrom_data adp5520_leds_data = {
1193 .num_leds = ARRAY_SIZE(adp5520_leds),
1194 .leds = adp5520_leds,
1195 .fade_in = FADE_T_600ms,
1196 .fade_out = FADE_T_600ms,
1197 .led_on_time = LED_ONT_600ms,
1198};
1199
1200 /*
1201 * ADP5520 GPIO Data
1202 */
1203
1204static struct adp5520_gpio_platfrom_data adp5520_gpio_data = {
1205 .gpio_start = 50,
1206 .gpio_en_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
1207 .gpio_pullup_mask = GPIO_C1 | GPIO_C2 | GPIO_R2,
1208};
1209
1210 /*
1211 * ADP5520 Keypad Data
1212 */
1213
1214#include <linux/input.h>
1215static const unsigned short adp5520_keymap[ADP5520_KEYMAPSIZE] = {
1216 [KEY(0, 0)] = KEY_GRAVE,
1217 [KEY(0, 1)] = KEY_1,
1218 [KEY(0, 2)] = KEY_2,
1219 [KEY(0, 3)] = KEY_3,
1220 [KEY(1, 0)] = KEY_4,
1221 [KEY(1, 1)] = KEY_5,
1222 [KEY(1, 2)] = KEY_6,
1223 [KEY(1, 3)] = KEY_7,
1224 [KEY(2, 0)] = KEY_8,
1225 [KEY(2, 1)] = KEY_9,
1226 [KEY(2, 2)] = KEY_0,
1227 [KEY(2, 3)] = KEY_MINUS,
1228 [KEY(3, 0)] = KEY_EQUAL,
1229 [KEY(3, 1)] = KEY_BACKSLASH,
1230 [KEY(3, 2)] = KEY_BACKSPACE,
1231 [KEY(3, 3)] = KEY_ENTER,
1232};
1233
1234static struct adp5520_keys_platfrom_data adp5520_keys_data = {
1235 .rows_en_mask = ROW_R3 | ROW_R2 | ROW_R1 | ROW_R0,
1236 .cols_en_mask = COL_C3 | COL_C2 | COL_C1 | COL_C0,
1237 .keymap = adp5520_keymap,
1238 .keymapsize = ARRAY_SIZE(adp5520_keymap),
1239 .repeat = 0,
1240};
1241
1242 /*
1243 * ADP5520/5501 Multifuction Device Init Data
1244 */
1245
1246static struct adp5520_subdev_info adp5520_subdevs[] = {
1247 {
1248 .name = "adp5520-backlight",
1249 .id = ID_ADP5520,
1250 .platform_data = &adp5520_backlight_data,
1251 },
1252 {
1253 .name = "adp5520-led",
1254 .id = ID_ADP5520,
1255 .platform_data = &adp5520_leds_data,
1256 },
1257 {
1258 .name = "adp5520-gpio",
1259 .id = ID_ADP5520,
1260 .platform_data = &adp5520_gpio_data,
1261 },
1262 {
1263 .name = "adp5520-keys",
1264 .id = ID_ADP5520,
1265 .platform_data = &adp5520_keys_data,
1266 },
1267};
1268
1269static struct adp5520_platform_data adp5520_pdev_data = {
1270 .num_subdevs = ARRAY_SIZE(adp5520_subdevs),
1271 .subdevs = adp5520_subdevs,
1272};
1273
1274#endif
1275
1076static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 1276static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1077#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 1277#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
1078 { 1278 {
@@ -1105,6 +1305,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1105 .platform_data = (void *)&adp5588_kpad_data, 1305 .platform_data = (void *)&adp5588_kpad_data,
1106 }, 1306 },
1107#endif 1307#endif
1308#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1309 {
1310 I2C_BOARD_INFO("pmic-adp5520", 0x32),
1311 .irq = IRQ_PF7,
1312 .platform_data = (void *)&adp5520_pdev_data,
1313 },
1314#endif
1108}; 1315};
1109 1316
1110#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1317#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
@@ -1120,8 +1327,11 @@ static struct platform_device bfin_sport1_uart_device = {
1120#endif 1327#endif
1121 1328
1122#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 1329#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1123#define PATA_INT IRQ_PF5 1330#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1331/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
1124 1332
1333#ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1334#define PATA_INT IRQ_PF5
1125static struct pata_platform_info bfin_pata_platform_data = { 1335static struct pata_platform_info bfin_pata_platform_data = {
1126 .ioport_shift = 1, 1336 .ioport_shift = 1,
1127 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED, 1337 .irq_flags = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
@@ -1144,6 +1354,24 @@ static struct resource bfin_pata_resources[] = {
1144 .flags = IORESOURCE_IRQ, 1354 .flags = IORESOURCE_IRQ,
1145 }, 1355 },
1146}; 1356};
1357#elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
1358static struct pata_platform_info bfin_pata_platform_data = {
1359 .ioport_shift = 0,
1360};
1361
1362static struct resource bfin_pata_resources[] = {
1363 {
1364 .start = 0x20211820,
1365 .end = 0x2021183F,
1366 .flags = IORESOURCE_MEM,
1367 },
1368 {
1369 .start = 0x2021181C,
1370 .end = 0x2021181F,
1371 .flags = IORESOURCE_MEM,
1372 },
1373};
1374#endif
1147 1375
1148static struct platform_device bfin_pata_device = { 1376static struct platform_device bfin_pata_device = {
1149 .name = "pata_platform", 1377 .name = "pata_platform",
@@ -1232,6 +1460,11 @@ static struct platform_device *stamp_devices[] __initdata = {
1232 &bfin_spi0_device, 1460 &bfin_spi0_device,
1233#endif 1461#endif
1234 1462
1463#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1464 &bfin_sport_spi0_device,
1465 &bfin_sport_spi1_device,
1466#endif
1467
1235#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 1468#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1236 &bfin_fb_device, 1469 &bfin_fb_device,
1237#endif 1470#endif
diff --git a/arch/blackfin/mach-bf548/include/mach/blackfin.h b/arch/blackfin/mach-bf548/include/mach/blackfin.h
index 0c0e3e2c3c21..cf6c1500222a 100644
--- a/arch/blackfin/mach-bf548/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf548/include/mach/blackfin.h
@@ -32,8 +32,6 @@
32#ifndef _MACH_BLACKFIN_H_ 32#ifndef _MACH_BLACKFIN_H_
33#define _MACH_BLACKFIN_H_ 33#define _MACH_BLACKFIN_H_
34 34
35#define BF548_FAMILY
36
37#include "bf548.h" 35#include "bf548.h"
38#include "mem_map.h" 36#include "mem_map.h"
39#include "anomaly.h" 37#include "anomaly.h"
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index f48a6aebb49b..bce5a84be49f 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -287,7 +287,7 @@ int bfin_pm_suspend_mem_enter(void)
287static int bfin_pm_valid(suspend_state_t state) 287static int bfin_pm_valid(suspend_state_t state)
288{ 288{
289 return (state == PM_SUSPEND_STANDBY 289 return (state == PM_SUSPEND_STANDBY
290#ifndef BF533_FAMILY 290#if !(defined(BF533_FAMILY) || defined(CONFIG_BF561))
291 /* 291 /*
292 * On BF533/2/1: 292 * On BF533/2/1:
293 * If we enter Hibernate the SCKE Pin is driven Low, 293 * If we enter Hibernate the SCKE Pin is driven Low,
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h
index 9df0ca82f5de..d5cf74005408 100644
--- a/arch/cris/include/asm/socket.h
+++ b/arch/cris/include/asm/socket.h
@@ -56,6 +56,9 @@
56 56
57#define SO_MARK 36 57#define SO_MARK 36
58 58
59#define SO_TIMESTAMPING 37
60#define SCM_TIMESTAMPING SO_TIMESTAMPING
61
59#endif /* _ASM_SOCKET_H */ 62#endif /* _ASM_SOCKET_H */
60 63
61 64
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index 2dfac8c79090..7f642fcffbfc 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -66,7 +66,7 @@ int show_interrupts(struct seq_file *p, void *v)
66 seq_printf(p, "%10u ", kstat_irqs(i)); 66 seq_printf(p, "%10u ", kstat_irqs(i));
67#else 67#else
68 for_each_online_cpu(j) 68 for_each_online_cpu(j)
69 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 69 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
70#endif 70#endif
71 seq_printf(p, " %14s", irq_desc[i].chip->typename); 71 seq_printf(p, " %14s", irq_desc[i].chip->typename);
72 seq_printf(p, " %s", action->name); 72 seq_printf(p, " %s", action->name);
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c
index 73abae767fdc..af3e824b91b3 100644
--- a/arch/frv/kernel/irq.c
+++ b/arch/frv/kernel/irq.c
@@ -74,7 +74,7 @@ int show_interrupts(struct seq_file *p, void *v)
74 if (action) { 74 if (action) {
75 seq_printf(p, "%3d: ", i); 75 seq_printf(p, "%3d: ", i);
76 for_each_present_cpu(cpu) 76 for_each_present_cpu(cpu)
77 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]); 77 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
78 seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-"); 78 seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-");
79 seq_printf(p, " %s", action->name); 79 seq_printf(p, " %s", action->name);
80 for (action = action->next; 80 for (action = action->next;
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h
index da2520dbf254..602518a70a1a 100644
--- a/arch/h8300/include/asm/socket.h
+++ b/arch/h8300/include/asm/socket.h
@@ -54,4 +54,7 @@
54 54
55#define SO_MARK 36 55#define SO_MARK 36
56 56
57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
57#endif /* _ASM_SOCKET_H */ 60#endif /* _ASM_SOCKET_H */
diff --git a/arch/h8300/include/asm/swab.h b/arch/h8300/include/asm/swab.h
index c108f39b8bc4..39abbf52807d 100644
--- a/arch/h8300/include/asm/swab.h
+++ b/arch/h8300/include/asm/swab.h
@@ -1,7 +1,7 @@
1#ifndef _H8300_SWAB_H 1#ifndef _H8300_SWAB_H
2#define _H8300_SWAB_H 2#define _H8300_SWAB_H
3 3
4#include <asm/types.h> 4#include <linux/types.h>
5 5
6#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) 6#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
7# define __SWAB_64_THRU_32__ 7# define __SWAB_64_THRU_32__
diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c
index ef4f0047067d..74f8dd7b34d2 100644
--- a/arch/h8300/kernel/irq.c
+++ b/arch/h8300/kernel/irq.c
@@ -183,7 +183,7 @@ asmlinkage void do_IRQ(int irq)
183#if defined(CONFIG_PROC_FS) 183#if defined(CONFIG_PROC_FS)
184int show_interrupts(struct seq_file *p, void *v) 184int show_interrupts(struct seq_file *p, void *v)
185{ 185{
186 int i = *(loff_t *) v, j; 186 int i = *(loff_t *) v;
187 struct irqaction * action; 187 struct irqaction * action;
188 unsigned long flags; 188 unsigned long flags;
189 189
@@ -196,7 +196,7 @@ int show_interrupts(struct seq_file *p, void *v)
196 if (!action) 196 if (!action)
197 goto unlock; 197 goto unlock;
198 seq_printf(p, "%3d: ",i); 198 seq_printf(p, "%3d: ",i);
199 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 199 seq_printf(p, "%10u ", kstat_irqs(i));
200 seq_printf(p, " %14s", irq_desc[i].chip->name); 200 seq_printf(p, " %14s", irq_desc[i].chip->name);
201 seq_printf(p, "-%-8s", irq_desc[i].name); 201 seq_printf(p, "-%-8s", irq_desc[i].name);
202 seq_printf(p, " %s", action->name); 202 seq_printf(p, " %s", action->name);
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index a46f8395e9a5..af9405cd70e5 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -240,7 +240,7 @@ ia32_syscall_table:
240 data8 sys_ni_syscall 240 data8 sys_ni_syscall
241 data8 sys_umask /* 60 */ 241 data8 sys_umask /* 60 */
242 data8 sys_chroot 242 data8 sys_chroot
243 data8 sys_ustat 243 data8 compat_sys_ustat
244 data8 sys_dup2 244 data8 sys_dup2
245 data8 sys_getppid 245 data8 sys_getppid
246 data8 sys_getpgrp /* 65 */ 246 data8 sys_getpgrp /* 65 */
diff --git a/arch/ia64/include/asm/fpu.h b/arch/ia64/include/asm/fpu.h
index 3859558ff0a4..0c26157cffa5 100644
--- a/arch/ia64/include/asm/fpu.h
+++ b/arch/ia64/include/asm/fpu.h
@@ -6,8 +6,6 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 */ 7 */
8 8
9#include <asm/types.h>
10
11/* floating point status register: */ 9/* floating point status register: */
12#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */ 10#define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */
13#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */ 11#define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */
diff --git a/arch/ia64/include/asm/gcc_intrin.h b/arch/ia64/include/asm/gcc_intrin.h
index 0f5b55921758..c2c5fd8fcac4 100644
--- a/arch/ia64/include/asm/gcc_intrin.h
+++ b/arch/ia64/include/asm/gcc_intrin.h
@@ -6,6 +6,7 @@
6 * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com> 6 * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com>
7 */ 7 */
8 8
9#include <linux/types.h>
9#include <linux/compiler.h> 10#include <linux/compiler.h>
10 11
11/* define this macro to get some asm stmts included in 'c' files */ 12/* define this macro to get some asm stmts included in 'c' files */
diff --git a/arch/ia64/include/asm/intrinsics.h b/arch/ia64/include/asm/intrinsics.h
index a3e44a5ed497..c47830e26cb7 100644
--- a/arch/ia64/include/asm/intrinsics.h
+++ b/arch/ia64/include/asm/intrinsics.h
@@ -10,6 +10,7 @@
10 10
11#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
12 12
13#include <linux/types.h>
13/* include compiler specific intrinsics */ 14/* include compiler specific intrinsics */
14#include <asm/ia64regs.h> 15#include <asm/ia64regs.h>
15#ifdef __INTEL_COMPILER 16#ifdef __INTEL_COMPILER
diff --git a/arch/ia64/include/asm/kvm.h b/arch/ia64/include/asm/kvm.h
index bfa86b6af7cd..18a7e49abbc5 100644
--- a/arch/ia64/include/asm/kvm.h
+++ b/arch/ia64/include/asm/kvm.h
@@ -21,8 +21,7 @@
21 * 21 *
22 */ 22 */
23 23
24#include <asm/types.h> 24#include <linux/types.h>
25
26#include <linux/ioctl.h> 25#include <linux/ioctl.h>
27 26
28/* Select x86 specific features in <linux/kvm.h> */ 27/* Select x86 specific features in <linux/kvm.h> */
@@ -166,7 +165,40 @@ struct saved_vpd {
166 unsigned long vcpuid[5]; 165 unsigned long vcpuid[5];
167 unsigned long vpsr; 166 unsigned long vpsr;
168 unsigned long vpr; 167 unsigned long vpr;
169 unsigned long vcr[128]; 168 union {
169 unsigned long vcr[128];
170 struct {
171 unsigned long dcr;
172 unsigned long itm;
173 unsigned long iva;
174 unsigned long rsv1[5];
175 unsigned long pta;
176 unsigned long rsv2[7];
177 unsigned long ipsr;
178 unsigned long isr;
179 unsigned long rsv3;
180 unsigned long iip;
181 unsigned long ifa;
182 unsigned long itir;
183 unsigned long iipa;
184 unsigned long ifs;
185 unsigned long iim;
186 unsigned long iha;
187 unsigned long rsv4[38];
188 unsigned long lid;
189 unsigned long ivr;
190 unsigned long tpr;
191 unsigned long eoi;
192 unsigned long irr[4];
193 unsigned long itv;
194 unsigned long pmv;
195 unsigned long cmcv;
196 unsigned long rsv5[5];
197 unsigned long lrr0;
198 unsigned long lrr1;
199 unsigned long rsv6[46];
200 };
201 };
170}; 202};
171 203
172struct kvm_regs { 204struct kvm_regs {
@@ -214,4 +246,18 @@ struct kvm_sregs {
214struct kvm_fpu { 246struct kvm_fpu {
215}; 247};
216 248
249#define KVM_IA64_VCPU_STACK_SHIFT 16
250#define KVM_IA64_VCPU_STACK_SIZE (1UL << KVM_IA64_VCPU_STACK_SHIFT)
251
252struct kvm_ia64_vcpu_stack {
253 unsigned char stack[KVM_IA64_VCPU_STACK_SIZE];
254};
255
256struct kvm_debug_exit_arch {
257};
258
259/* for KVM_SET_GUEST_DEBUG */
260struct kvm_guest_debug_arch {
261};
262
217#endif 263#endif
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h
index 348663661659..4542651e6acb 100644
--- a/arch/ia64/include/asm/kvm_host.h
+++ b/arch/ia64/include/asm/kvm_host.h
@@ -112,7 +112,11 @@
112#define VCPU_STRUCT_SHIFT 16 112#define VCPU_STRUCT_SHIFT 16
113#define VCPU_STRUCT_SIZE (__IA64_UL_CONST(1) << VCPU_STRUCT_SHIFT) 113#define VCPU_STRUCT_SIZE (__IA64_UL_CONST(1) << VCPU_STRUCT_SHIFT)
114 114
115#define KVM_STK_OFFSET VCPU_STRUCT_SIZE 115/*
116 * This must match KVM_IA64_VCPU_STACK_{SHIFT,SIZE} arch/ia64/include/asm/kvm.h
117 */
118#define KVM_STK_SHIFT 16
119#define KVM_STK_OFFSET (__IA64_UL_CONST(1)<< KVM_STK_SHIFT)
116 120
117#define KVM_VM_STRUCT_SHIFT 19 121#define KVM_VM_STRUCT_SHIFT 19
118#define KVM_VM_STRUCT_SIZE (__IA64_UL_CONST(1) << KVM_VM_STRUCT_SHIFT) 122#define KVM_VM_STRUCT_SIZE (__IA64_UL_CONST(1) << KVM_VM_STRUCT_SHIFT)
@@ -153,10 +157,10 @@ struct kvm_vm_data {
153 struct kvm_vcpu_data vcpu_data[KVM_MAX_VCPUS]; 157 struct kvm_vcpu_data vcpu_data[KVM_MAX_VCPUS];
154}; 158};
155 159
156#define VCPU_BASE(n) KVM_VM_DATA_BASE + \ 160#define VCPU_BASE(n) (KVM_VM_DATA_BASE + \
157 offsetof(struct kvm_vm_data, vcpu_data[n]) 161 offsetof(struct kvm_vm_data, vcpu_data[n]))
158#define VM_BASE KVM_VM_DATA_BASE + \ 162#define KVM_VM_BASE (KVM_VM_DATA_BASE + \
159 offsetof(struct kvm_vm_data, kvm_vm_struct) 163 offsetof(struct kvm_vm_data, kvm_vm_struct))
160#define KVM_MEM_DIRTY_LOG_BASE KVM_VM_DATA_BASE + \ 164#define KVM_MEM_DIRTY_LOG_BASE KVM_VM_DATA_BASE + \
161 offsetof(struct kvm_vm_data, kvm_mem_dirty_log) 165 offsetof(struct kvm_vm_data, kvm_mem_dirty_log)
162 166
@@ -235,8 +239,6 @@ struct kvm_vm_data {
235 239
236struct kvm; 240struct kvm;
237struct kvm_vcpu; 241struct kvm_vcpu;
238struct kvm_guest_debug{
239};
240 242
241struct kvm_mmio_req { 243struct kvm_mmio_req {
242 uint64_t addr; /* physical address */ 244 uint64_t addr; /* physical address */
@@ -462,6 +464,8 @@ struct kvm_arch {
462 unsigned long metaphysical_rr4; 464 unsigned long metaphysical_rr4;
463 unsigned long vmm_init_rr; 465 unsigned long vmm_init_rr;
464 466
467 int online_vcpus;
468
465 struct kvm_ioapic *vioapic; 469 struct kvm_ioapic *vioapic;
466 struct kvm_vm_stat stat; 470 struct kvm_vm_stat stat;
467 struct kvm_sal_data rdv_sal_data; 471 struct kvm_sal_data rdv_sal_data;
diff --git a/arch/ia64/include/asm/msidef.h b/arch/ia64/include/asm/msidef.h
new file mode 100644
index 000000000000..592c1047a0c5
--- /dev/null
+++ b/arch/ia64/include/asm/msidef.h
@@ -0,0 +1,42 @@
1#ifndef _IA64_MSI_DEF_H
2#define _IA64_MSI_DEF_H
3
4/*
5 * Shifts for APIC-based data
6 */
7
8#define MSI_DATA_VECTOR_SHIFT 0
9#define MSI_DATA_VECTOR(v) (((u8)v) << MSI_DATA_VECTOR_SHIFT)
10#define MSI_DATA_VECTOR_MASK 0xffffff00
11
12#define MSI_DATA_DELIVERY_MODE_SHIFT 8
13#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_MODE_SHIFT)
14#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_MODE_SHIFT)
15
16#define MSI_DATA_LEVEL_SHIFT 14
17#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT)
18#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT)
19
20#define MSI_DATA_TRIGGER_SHIFT 15
21#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT)
22#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT)
23
24/*
25 * Shift/mask fields for APIC-based bus address
26 */
27
28#define MSI_ADDR_DEST_ID_SHIFT 4
29#define MSI_ADDR_HEADER 0xfee00000
30
31#define MSI_ADDR_DEST_ID_MASK 0xfff0000f
32#define MSI_ADDR_DEST_ID_CPU(cpu) ((cpu) << MSI_ADDR_DEST_ID_SHIFT)
33
34#define MSI_ADDR_DEST_MODE_SHIFT 2
35#define MSI_ADDR_DEST_MODE_PHYS (0 << MSI_ADDR_DEST_MODE_SHIFT)
36#define MSI_ADDR_DEST_MODE_LOGIC (1 << MSI_ADDR_DEST_MODE_SHIFT)
37
38#define MSI_ADDR_REDIRECTION_SHIFT 3
39#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT)
40#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT)
41
42#endif/* _IA64_MSI_DEF_H */
diff --git a/arch/ia64/include/asm/percpu.h b/arch/ia64/include/asm/percpu.h
index 77f30b664b4e..30cf46534dd2 100644
--- a/arch/ia64/include/asm/percpu.h
+++ b/arch/ia64/include/asm/percpu.h
@@ -27,12 +27,12 @@ extern void *per_cpu_init(void);
27 27
28#else /* ! SMP */ 28#else /* ! SMP */
29 29
30#define PER_CPU_ATTRIBUTES __attribute__((__section__(".data.percpu")))
31
32#define per_cpu_init() (__phys_per_cpu_start) 30#define per_cpu_init() (__phys_per_cpu_start)
33 31
34#endif /* SMP */ 32#endif /* SMP */
35 33
34#define PER_CPU_BASE_SECTION ".data.percpu"
35
36/* 36/*
37 * Be extremely careful when taking the address of this variable! Due to virtual 37 * Be extremely careful when taking the address of this variable! Due to virtual
38 * remapping, it is different from the canonical address returned by __get_cpu_var(var)! 38 * remapping, it is different from the canonical address returned by __get_cpu_var(var)!
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h
index d5ef0aa3e312..745421225ec6 100644
--- a/arch/ia64/include/asm/socket.h
+++ b/arch/ia64/include/asm/socket.h
@@ -63,4 +63,7 @@
63 63
64#define SO_MARK 36 64#define SO_MARK 36
65 65
66#define SO_TIMESTAMPING 37
67#define SCM_TIMESTAMPING SO_TIMESTAMPING
68
66#endif /* _ASM_IA64_SOCKET_H */ 69#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/ia64/include/asm/swab.h b/arch/ia64/include/asm/swab.h
index 6aa58b699eea..c89a8cb5d8a5 100644
--- a/arch/ia64/include/asm/swab.h
+++ b/arch/ia64/include/asm/swab.h
@@ -6,7 +6,7 @@
6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co. 6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
7 */ 7 */
8 8
9#include <asm/types.h> 9#include <linux/types.h>
10#include <asm/intrinsics.h> 10#include <asm/intrinsics.h>
11#include <linux/compiler.h> 11#include <linux/compiler.h>
12 12
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h
index 32f3af1641c5..3193f4417e16 100644
--- a/arch/ia64/include/asm/topology.h
+++ b/arch/ia64/include/asm/topology.h
@@ -84,7 +84,7 @@ void build_cpu_to_node_map(void);
84 .child = NULL, \ 84 .child = NULL, \
85 .groups = NULL, \ 85 .groups = NULL, \
86 .min_interval = 8, \ 86 .min_interval = 8, \
87 .max_interval = 8*(min(num_online_cpus(), 32)), \ 87 .max_interval = 8*(min(num_online_cpus(), 32U)), \
88 .busy_factor = 64, \ 88 .busy_factor = 64, \
89 .imbalance_pct = 125, \ 89 .imbalance_pct = 125, \
90 .cache_nice_tries = 2, \ 90 .cache_nice_tries = 2, \
diff --git a/arch/ia64/include/asm/uv/uv.h b/arch/ia64/include/asm/uv/uv.h
new file mode 100644
index 000000000000..61b5bdfd980e
--- /dev/null
+++ b/arch/ia64/include/asm/uv/uv.h
@@ -0,0 +1,13 @@
1#ifndef _ASM_IA64_UV_UV_H
2#define _ASM_IA64_UV_UV_H
3
4#include <asm/system.h>
5#include <asm/sn/simulator.h>
6
7static inline int is_uv_system(void)
8{
9 /* temporary support for running on hardware simulator */
10 return IS_MEDUSA() || ia64_platform_is("uv");
11}
12
13#endif /* _ASM_IA64_UV_UV_H */
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index d541671caf4a..bdef2ce38c8b 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -199,6 +199,10 @@ char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size)
199 return __va(phys_addr); 199 return __va(phys_addr);
200} 200}
201 201
202void __init __acpi_unmap_table(char *map, unsigned long size)
203{
204}
205
202/* -------------------------------------------------------------------------- 206/* --------------------------------------------------------------------------
203 Boot-time Table Parsing 207 Boot-time Table Parsing
204 -------------------------------------------------------------------------- */ 208 -------------------------------------------------------------------------- */
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index e13125058bed..166e0d839fa0 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -880,7 +880,7 @@ iosapic_unregister_intr (unsigned int gsi)
880 if (iosapic_intr_info[irq].count == 0) { 880 if (iosapic_intr_info[irq].count == 0) {
881#ifdef CONFIG_SMP 881#ifdef CONFIG_SMP
882 /* Clear affinity */ 882 /* Clear affinity */
883 cpus_setall(idesc->affinity); 883 cpumask_setall(idesc->affinity);
884#endif 884#endif
885 /* Clear the interrupt information */ 885 /* Clear the interrupt information */
886 iosapic_intr_info[irq].dest = 0; 886 iosapic_intr_info[irq].dest = 0;
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index a58f64ca9f0e..7429752ef5ad 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -80,7 +80,7 @@ int show_interrupts(struct seq_file *p, void *v)
80 seq_printf(p, "%10u ", kstat_irqs(i)); 80 seq_printf(p, "%10u ", kstat_irqs(i));
81#else 81#else
82 for_each_online_cpu(j) { 82 for_each_online_cpu(j) {
83 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 83 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
84 } 84 }
85#endif 85#endif
86 seq_printf(p, " %14s", irq_desc[i].chip->name); 86 seq_printf(p, " %14s", irq_desc[i].chip->name);
@@ -103,7 +103,7 @@ static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 };
103void set_irq_affinity_info (unsigned int irq, int hwid, int redir) 103void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
104{ 104{
105 if (irq < NR_IRQS) { 105 if (irq < NR_IRQS) {
106 cpumask_copy(&irq_desc[irq].affinity, 106 cpumask_copy(irq_desc[irq].affinity,
107 cpumask_of(cpu_logical_id(hwid))); 107 cpumask_of(cpu_logical_id(hwid)));
108 irq_redir[irq] = (char) (redir & 0xff); 108 irq_redir[irq] = (char) (redir & 0xff);
109 } 109 }
@@ -148,7 +148,7 @@ static void migrate_irqs(void)
148 if (desc->status == IRQ_PER_CPU) 148 if (desc->status == IRQ_PER_CPU)
149 continue; 149 continue;
150 150
151 if (cpumask_any_and(&irq_desc[irq].affinity, cpu_online_mask) 151 if (cpumask_any_and(irq_desc[irq].affinity, cpu_online_mask)
152 >= nr_cpu_ids) { 152 >= nr_cpu_ids) {
153 /* 153 /*
154 * Save it for phase 2 processing 154 * Save it for phase 2 processing
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 28d3d483db92..acc4d19ae62a 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -493,14 +493,15 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
493 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR); 493 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
494 ia64_srlz_d(); 494 ia64_srlz_d();
495 while (vector != IA64_SPURIOUS_INT_VECTOR) { 495 while (vector != IA64_SPURIOUS_INT_VECTOR) {
496 int irq = local_vector_to_irq(vector);
497 struct irq_desc *desc = irq_to_desc(irq);
498
496 if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) { 499 if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
497 smp_local_flush_tlb(); 500 smp_local_flush_tlb();
498 kstat_this_cpu.irqs[vector]++; 501 kstat_incr_irqs_this_cpu(irq, desc);
499 } else if (unlikely(IS_RESCHEDULE(vector))) 502 } else if (unlikely(IS_RESCHEDULE(vector))) {
500 kstat_this_cpu.irqs[vector]++; 503 kstat_incr_irqs_this_cpu(irq, desc);
501 else { 504 } else {
502 int irq = local_vector_to_irq(vector);
503
504 ia64_setreg(_IA64_REG_CR_TPR, vector); 505 ia64_setreg(_IA64_REG_CR_TPR, vector);
505 ia64_srlz_d(); 506 ia64_srlz_d();
506 507
@@ -543,22 +544,24 @@ void ia64_process_pending_intr(void)
543 544
544 vector = ia64_get_ivr(); 545 vector = ia64_get_ivr();
545 546
546 irq_enter(); 547 irq_enter();
547 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR); 548 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
548 ia64_srlz_d(); 549 ia64_srlz_d();
549 550
550 /* 551 /*
551 * Perform normal interrupt style processing 552 * Perform normal interrupt style processing
552 */ 553 */
553 while (vector != IA64_SPURIOUS_INT_VECTOR) { 554 while (vector != IA64_SPURIOUS_INT_VECTOR) {
555 int irq = local_vector_to_irq(vector);
556 struct irq_desc *desc = irq_to_desc(irq);
557
554 if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) { 558 if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
555 smp_local_flush_tlb(); 559 smp_local_flush_tlb();
556 kstat_this_cpu.irqs[vector]++; 560 kstat_incr_irqs_this_cpu(irq, desc);
557 } else if (unlikely(IS_RESCHEDULE(vector))) 561 } else if (unlikely(IS_RESCHEDULE(vector))) {
558 kstat_this_cpu.irqs[vector]++; 562 kstat_incr_irqs_this_cpu(irq, desc);
559 else { 563 } else {
560 struct pt_regs *old_regs = set_irq_regs(NULL); 564 struct pt_regs *old_regs = set_irq_regs(NULL);
561 int irq = local_vector_to_irq(vector);
562 565
563 ia64_setreg(_IA64_REG_CR_TPR, vector); 566 ia64_setreg(_IA64_REG_CR_TPR, vector);
564 ia64_srlz_d(); 567 ia64_srlz_d();
diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c
index 890339339035..2b15e233f7fe 100644
--- a/arch/ia64/kernel/msi_ia64.c
+++ b/arch/ia64/kernel/msi_ia64.c
@@ -7,44 +7,7 @@
7#include <linux/msi.h> 7#include <linux/msi.h>
8#include <linux/dmar.h> 8#include <linux/dmar.h>
9#include <asm/smp.h> 9#include <asm/smp.h>
10 10#include <asm/msidef.h>
11/*
12 * Shifts for APIC-based data
13 */
14
15#define MSI_DATA_VECTOR_SHIFT 0
16#define MSI_DATA_VECTOR(v) (((u8)v) << MSI_DATA_VECTOR_SHIFT)
17#define MSI_DATA_VECTOR_MASK 0xffffff00
18
19#define MSI_DATA_DELIVERY_SHIFT 8
20#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_SHIFT)
21#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_SHIFT)
22
23#define MSI_DATA_LEVEL_SHIFT 14
24#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT)
25#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT)
26
27#define MSI_DATA_TRIGGER_SHIFT 15
28#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT)
29#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT)
30
31/*
32 * Shift/mask fields for APIC-based bus address
33 */
34
35#define MSI_TARGET_CPU_SHIFT 4
36#define MSI_ADDR_HEADER 0xfee00000
37
38#define MSI_ADDR_DESTID_MASK 0xfff0000f
39#define MSI_ADDR_DESTID_CPU(cpu) ((cpu) << MSI_TARGET_CPU_SHIFT)
40
41#define MSI_ADDR_DESTMODE_SHIFT 2
42#define MSI_ADDR_DESTMODE_PHYS (0 << MSI_ADDR_DESTMODE_SHIFT)
43#define MSI_ADDR_DESTMODE_LOGIC (1 << MSI_ADDR_DESTMODE_SHIFT)
44
45#define MSI_ADDR_REDIRECTION_SHIFT 3
46#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT)
47#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT)
48 11
49static struct irq_chip ia64_msi_chip; 12static struct irq_chip ia64_msi_chip;
50 13
@@ -65,8 +28,8 @@ static void ia64_set_msi_irq_affinity(unsigned int irq,
65 read_msi_msg(irq, &msg); 28 read_msi_msg(irq, &msg);
66 29
67 addr = msg.address_lo; 30 addr = msg.address_lo;
68 addr &= MSI_ADDR_DESTID_MASK; 31 addr &= MSI_ADDR_DEST_ID_MASK;
69 addr |= MSI_ADDR_DESTID_CPU(cpu_physical_id(cpu)); 32 addr |= MSI_ADDR_DEST_ID_CPU(cpu_physical_id(cpu));
70 msg.address_lo = addr; 33 msg.address_lo = addr;
71 34
72 data = msg.data; 35 data = msg.data;
@@ -75,7 +38,7 @@ static void ia64_set_msi_irq_affinity(unsigned int irq,
75 msg.data = data; 38 msg.data = data;
76 39
77 write_msi_msg(irq, &msg); 40 write_msi_msg(irq, &msg);
78 irq_desc[irq].affinity = cpumask_of_cpu(cpu); 41 cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu));
79} 42}
80#endif /* CONFIG_SMP */ 43#endif /* CONFIG_SMP */
81 44
@@ -98,9 +61,9 @@ int ia64_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
98 msg.address_hi = 0; 61 msg.address_hi = 0;
99 msg.address_lo = 62 msg.address_lo =
100 MSI_ADDR_HEADER | 63 MSI_ADDR_HEADER |
101 MSI_ADDR_DESTMODE_PHYS | 64 MSI_ADDR_DEST_MODE_PHYS |
102 MSI_ADDR_REDIRECTION_CPU | 65 MSI_ADDR_REDIRECTION_CPU |
103 MSI_ADDR_DESTID_CPU(dest_phys_id); 66 MSI_ADDR_DEST_ID_CPU(dest_phys_id);
104 67
105 msg.data = 68 msg.data =
106 MSI_DATA_TRIGGER_EDGE | 69 MSI_DATA_TRIGGER_EDGE |
@@ -183,11 +146,11 @@ static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
183 146
184 msg.data &= ~MSI_DATA_VECTOR_MASK; 147 msg.data &= ~MSI_DATA_VECTOR_MASK;
185 msg.data |= MSI_DATA_VECTOR(cfg->vector); 148 msg.data |= MSI_DATA_VECTOR(cfg->vector);
186 msg.address_lo &= ~MSI_ADDR_DESTID_MASK; 149 msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
187 msg.address_lo |= MSI_ADDR_DESTID_CPU(cpu_physical_id(cpu)); 150 msg.address_lo |= MSI_ADDR_DEST_ID_CPU(cpu_physical_id(cpu));
188 151
189 dmar_msi_write(irq, &msg); 152 dmar_msi_write(irq, &msg);
190 irq_desc[irq].affinity = *mask; 153 cpumask_copy(irq_desc[irq].affinity, mask);
191} 154}
192#endif /* CONFIG_SMP */ 155#endif /* CONFIG_SMP */
193 156
@@ -215,9 +178,9 @@ msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg)
215 msg->address_hi = 0; 178 msg->address_hi = 0;
216 msg->address_lo = 179 msg->address_lo =
217 MSI_ADDR_HEADER | 180 MSI_ADDR_HEADER |
218 MSI_ADDR_DESTMODE_PHYS | 181 MSI_ADDR_DEST_MODE_PHYS |
219 MSI_ADDR_REDIRECTION_CPU | 182 MSI_ADDR_REDIRECTION_CPU |
220 MSI_ADDR_DESTID_CPU(dest); 183 MSI_ADDR_DEST_ID_CPU(dest);
221 184
222 msg->data = 185 msg->data =
223 MSI_DATA_TRIGGER_EDGE | 186 MSI_DATA_TRIGGER_EDGE |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 0e499757309b..5c0f408cfd71 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2196,7 +2196,7 @@ pfmfs_delete_dentry(struct dentry *dentry)
2196 return 1; 2196 return 1;
2197} 2197}
2198 2198
2199static struct dentry_operations pfmfs_dentry_operations = { 2199static const struct dentry_operations pfmfs_dentry_operations = {
2200 .d_delete = pfmfs_delete_dentry, 2200 .d_delete = pfmfs_delete_dentry,
2201}; 2201};
2202 2202
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 10a7d47e8510..3765efc5f963 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -213,16 +213,9 @@ SECTIONS
213 { *(.data.cacheline_aligned) } 213 { *(.data.cacheline_aligned) }
214 214
215 /* Per-cpu data: */ 215 /* Per-cpu data: */
216 percpu : { } :percpu
217 . = ALIGN(PERCPU_PAGE_SIZE); 216 . = ALIGN(PERCPU_PAGE_SIZE);
218 __phys_per_cpu_start = .; 217 PERCPU_VADDR(PERCPU_ADDR, :percpu)
219 .data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - LOAD_OFFSET) 218 __phys_per_cpu_start = __per_cpu_load;
220 {
221 __per_cpu_start = .;
222 *(.data.percpu)
223 *(.data.percpu.shared_aligned)
224 __per_cpu_end = .;
225 }
226 . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits 219 . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
227 * into percpu page size 220 * into percpu page size
228 */ 221 */
diff --git a/arch/ia64/kvm/Kconfig b/arch/ia64/kvm/Kconfig
index f833a0b4188d..0a2d6b86075a 100644
--- a/arch/ia64/kvm/Kconfig
+++ b/arch/ia64/kvm/Kconfig
@@ -4,6 +4,10 @@
4config HAVE_KVM 4config HAVE_KVM
5 bool 5 bool
6 6
7config HAVE_KVM_IRQCHIP
8 bool
9 default y
10
7menuconfig VIRTUALIZATION 11menuconfig VIRTUALIZATION
8 bool "Virtualization" 12 bool "Virtualization"
9 depends on HAVE_KVM || IA64 13 depends on HAVE_KVM || IA64
diff --git a/arch/ia64/kvm/irq.h b/arch/ia64/kvm/irq.h
index c6786e8b1bf4..c0785a728271 100644
--- a/arch/ia64/kvm/irq.h
+++ b/arch/ia64/kvm/irq.h
@@ -23,6 +23,8 @@
23#ifndef __IRQ_H 23#ifndef __IRQ_H
24#define __IRQ_H 24#define __IRQ_H
25 25
26#include "lapic.h"
27
26static inline int irqchip_in_kernel(struct kvm *kvm) 28static inline int irqchip_in_kernel(struct kvm *kvm)
27{ 29{
28 return 1; 30 return 1;
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index 28f982045f29..076b00d1dbff 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -182,7 +182,7 @@ int kvm_dev_ioctl_check_extension(long ext)
182 switch (ext) { 182 switch (ext) {
183 case KVM_CAP_IRQCHIP: 183 case KVM_CAP_IRQCHIP:
184 case KVM_CAP_MP_STATE: 184 case KVM_CAP_MP_STATE:
185 185 case KVM_CAP_IRQ_INJECT_STATUS:
186 r = 1; 186 r = 1;
187 break; 187 break;
188 case KVM_CAP_COALESCED_MMIO: 188 case KVM_CAP_COALESCED_MMIO:
@@ -314,7 +314,7 @@ static struct kvm_vcpu *lid_to_vcpu(struct kvm *kvm, unsigned long id,
314 union ia64_lid lid; 314 union ia64_lid lid;
315 int i; 315 int i;
316 316
317 for (i = 0; i < KVM_MAX_VCPUS; i++) { 317 for (i = 0; i < kvm->arch.online_vcpus; i++) {
318 if (kvm->vcpus[i]) { 318 if (kvm->vcpus[i]) {
319 lid.val = VCPU_LID(kvm->vcpus[i]); 319 lid.val = VCPU_LID(kvm->vcpus[i]);
320 if (lid.id == id && lid.eid == eid) 320 if (lid.id == id && lid.eid == eid)
@@ -388,7 +388,7 @@ static int handle_global_purge(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
388 388
389 call_data.ptc_g_data = p->u.ptc_g_data; 389 call_data.ptc_g_data = p->u.ptc_g_data;
390 390
391 for (i = 0; i < KVM_MAX_VCPUS; i++) { 391 for (i = 0; i < kvm->arch.online_vcpus; i++) {
392 if (!kvm->vcpus[i] || kvm->vcpus[i]->arch.mp_state == 392 if (!kvm->vcpus[i] || kvm->vcpus[i]->arch.mp_state ==
393 KVM_MP_STATE_UNINITIALIZED || 393 KVM_MP_STATE_UNINITIALIZED ||
394 vcpu == kvm->vcpus[i]) 394 vcpu == kvm->vcpus[i])
@@ -788,6 +788,8 @@ struct kvm *kvm_arch_create_vm(void)
788 return ERR_PTR(-ENOMEM); 788 return ERR_PTR(-ENOMEM);
789 kvm_init_vm(kvm); 789 kvm_init_vm(kvm);
790 790
791 kvm->arch.online_vcpus = 0;
792
791 return kvm; 793 return kvm;
792 794
793} 795}
@@ -919,7 +921,13 @@ long kvm_arch_vm_ioctl(struct file *filp,
919 r = kvm_ioapic_init(kvm); 921 r = kvm_ioapic_init(kvm);
920 if (r) 922 if (r)
921 goto out; 923 goto out;
924 r = kvm_setup_default_irq_routing(kvm);
925 if (r) {
926 kfree(kvm->arch.vioapic);
927 goto out;
928 }
922 break; 929 break;
930 case KVM_IRQ_LINE_STATUS:
923 case KVM_IRQ_LINE: { 931 case KVM_IRQ_LINE: {
924 struct kvm_irq_level irq_event; 932 struct kvm_irq_level irq_event;
925 933
@@ -927,10 +935,17 @@ long kvm_arch_vm_ioctl(struct file *filp,
927 if (copy_from_user(&irq_event, argp, sizeof irq_event)) 935 if (copy_from_user(&irq_event, argp, sizeof irq_event))
928 goto out; 936 goto out;
929 if (irqchip_in_kernel(kvm)) { 937 if (irqchip_in_kernel(kvm)) {
938 __s32 status;
930 mutex_lock(&kvm->lock); 939 mutex_lock(&kvm->lock);
931 kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 940 status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
932 irq_event.irq, irq_event.level); 941 irq_event.irq, irq_event.level);
933 mutex_unlock(&kvm->lock); 942 mutex_unlock(&kvm->lock);
943 if (ioctl == KVM_IRQ_LINE_STATUS) {
944 irq_event.status = status;
945 if (copy_to_user(argp, &irq_event,
946 sizeof irq_event))
947 goto out;
948 }
934 r = 0; 949 r = 0;
935 } 950 }
936 break; 951 break;
@@ -1149,7 +1164,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
1149 1164
1150 /*Initialize itc offset for vcpus*/ 1165 /*Initialize itc offset for vcpus*/
1151 itc_offset = 0UL - ia64_getreg(_IA64_REG_AR_ITC); 1166 itc_offset = 0UL - ia64_getreg(_IA64_REG_AR_ITC);
1152 for (i = 0; i < KVM_MAX_VCPUS; i++) { 1167 for (i = 0; i < kvm->arch.online_vcpus; i++) {
1153 v = (struct kvm_vcpu *)((char *)vcpu + 1168 v = (struct kvm_vcpu *)((char *)vcpu +
1154 sizeof(struct kvm_vcpu_data) * i); 1169 sizeof(struct kvm_vcpu_data) * i);
1155 v->arch.itc_offset = itc_offset; 1170 v->arch.itc_offset = itc_offset;
@@ -1283,6 +1298,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
1283 goto fail; 1298 goto fail;
1284 } 1299 }
1285 1300
1301 kvm->arch.online_vcpus++;
1302
1286 return vcpu; 1303 return vcpu;
1287fail: 1304fail:
1288 return ERR_PTR(r); 1305 return ERR_PTR(r);
@@ -1303,8 +1320,8 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
1303 return -EINVAL; 1320 return -EINVAL;
1304} 1321}
1305 1322
1306int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, 1323int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
1307 struct kvm_debug_guest *dbg) 1324 struct kvm_guest_debug *dbg)
1308{ 1325{
1309 return -EINVAL; 1326 return -EINVAL;
1310} 1327}
@@ -1421,6 +1438,23 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
1421 return 0; 1438 return 0;
1422} 1439}
1423 1440
1441int kvm_arch_vcpu_ioctl_get_stack(struct kvm_vcpu *vcpu,
1442 struct kvm_ia64_vcpu_stack *stack)
1443{
1444 memcpy(stack, vcpu, sizeof(struct kvm_ia64_vcpu_stack));
1445 return 0;
1446}
1447
1448int kvm_arch_vcpu_ioctl_set_stack(struct kvm_vcpu *vcpu,
1449 struct kvm_ia64_vcpu_stack *stack)
1450{
1451 memcpy(vcpu + 1, &stack->stack[0] + sizeof(struct kvm_vcpu),
1452 sizeof(struct kvm_ia64_vcpu_stack) - sizeof(struct kvm_vcpu));
1453
1454 vcpu->arch.exit_data = ((struct kvm_vcpu *)stack)->arch.exit_data;
1455 return 0;
1456}
1457
1424void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) 1458void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
1425{ 1459{
1426 1460
@@ -1430,9 +1464,78 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
1430 1464
1431 1465
1432long kvm_arch_vcpu_ioctl(struct file *filp, 1466long kvm_arch_vcpu_ioctl(struct file *filp,
1433 unsigned int ioctl, unsigned long arg) 1467 unsigned int ioctl, unsigned long arg)
1434{ 1468{
1435 return -EINVAL; 1469 struct kvm_vcpu *vcpu = filp->private_data;
1470 void __user *argp = (void __user *)arg;
1471 struct kvm_ia64_vcpu_stack *stack = NULL;
1472 long r;
1473
1474 switch (ioctl) {
1475 case KVM_IA64_VCPU_GET_STACK: {
1476 struct kvm_ia64_vcpu_stack __user *user_stack;
1477 void __user *first_p = argp;
1478
1479 r = -EFAULT;
1480 if (copy_from_user(&user_stack, first_p, sizeof(void *)))
1481 goto out;
1482
1483 if (!access_ok(VERIFY_WRITE, user_stack,
1484 sizeof(struct kvm_ia64_vcpu_stack))) {
1485 printk(KERN_INFO "KVM_IA64_VCPU_GET_STACK: "
1486 "Illegal user destination address for stack\n");
1487 goto out;
1488 }
1489 stack = kzalloc(sizeof(struct kvm_ia64_vcpu_stack), GFP_KERNEL);
1490 if (!stack) {
1491 r = -ENOMEM;
1492 goto out;
1493 }
1494
1495 r = kvm_arch_vcpu_ioctl_get_stack(vcpu, stack);
1496 if (r)
1497 goto out;
1498
1499 if (copy_to_user(user_stack, stack,
1500 sizeof(struct kvm_ia64_vcpu_stack)))
1501 goto out;
1502
1503 break;
1504 }
1505 case KVM_IA64_VCPU_SET_STACK: {
1506 struct kvm_ia64_vcpu_stack __user *user_stack;
1507 void __user *first_p = argp;
1508
1509 r = -EFAULT;
1510 if (copy_from_user(&user_stack, first_p, sizeof(void *)))
1511 goto out;
1512
1513 if (!access_ok(VERIFY_READ, user_stack,
1514 sizeof(struct kvm_ia64_vcpu_stack))) {
1515 printk(KERN_INFO "KVM_IA64_VCPU_SET_STACK: "
1516 "Illegal user address for stack\n");
1517 goto out;
1518 }
1519 stack = kmalloc(sizeof(struct kvm_ia64_vcpu_stack), GFP_KERNEL);
1520 if (!stack) {
1521 r = -ENOMEM;
1522 goto out;
1523 }
1524 if (copy_from_user(stack, user_stack,
1525 sizeof(struct kvm_ia64_vcpu_stack)))
1526 goto out;
1527
1528 r = kvm_arch_vcpu_ioctl_set_stack(vcpu, stack);
1529 break;
1530 }
1531
1532 default:
1533 r = -EINVAL;
1534 }
1535
1536out:
1537 kfree(stack);
1538 return r;
1436} 1539}
1437 1540
1438int kvm_arch_set_memory_region(struct kvm *kvm, 1541int kvm_arch_set_memory_region(struct kvm *kvm,
@@ -1472,7 +1575,7 @@ void kvm_arch_flush_shadow(struct kvm *kvm)
1472} 1575}
1473 1576
1474long kvm_arch_dev_ioctl(struct file *filp, 1577long kvm_arch_dev_ioctl(struct file *filp,
1475 unsigned int ioctl, unsigned long arg) 1578 unsigned int ioctl, unsigned long arg)
1476{ 1579{
1477 return -EINVAL; 1580 return -EINVAL;
1478} 1581}
@@ -1737,7 +1840,7 @@ struct kvm_vcpu *kvm_get_lowest_prio_vcpu(struct kvm *kvm, u8 vector,
1737 struct kvm_vcpu *lvcpu = kvm->vcpus[0]; 1840 struct kvm_vcpu *lvcpu = kvm->vcpus[0];
1738 int i; 1841 int i;
1739 1842
1740 for (i = 1; i < KVM_MAX_VCPUS; i++) { 1843 for (i = 1; i < kvm->arch.online_vcpus; i++) {
1741 if (!kvm->vcpus[i]) 1844 if (!kvm->vcpus[i])
1742 continue; 1845 continue;
1743 if (lvcpu->arch.xtp > kvm->vcpus[i]->arch.xtp) 1846 if (lvcpu->arch.xtp > kvm->vcpus[i]->arch.xtp)
diff --git a/arch/ia64/kvm/kvm_fw.c b/arch/ia64/kvm/kvm_fw.c
index cb7600bdff9d..a8ae52ed5635 100644
--- a/arch/ia64/kvm/kvm_fw.c
+++ b/arch/ia64/kvm/kvm_fw.c
@@ -227,6 +227,18 @@ static struct ia64_pal_retval pal_proc_get_features(struct kvm_vcpu *vcpu)
227 return result; 227 return result;
228} 228}
229 229
230static struct ia64_pal_retval pal_register_info(struct kvm_vcpu *vcpu)
231{
232
233 struct ia64_pal_retval result = {0, 0, 0, 0};
234 long in0, in1, in2, in3;
235
236 kvm_get_pal_call_data(vcpu, &in0, &in1, &in2, &in3);
237 result.status = ia64_pal_register_info(in1, &result.v1, &result.v2);
238
239 return result;
240}
241
230static struct ia64_pal_retval pal_cache_info(struct kvm_vcpu *vcpu) 242static struct ia64_pal_retval pal_cache_info(struct kvm_vcpu *vcpu)
231{ 243{
232 244
@@ -268,8 +280,12 @@ static struct ia64_pal_retval pal_vm_summary(struct kvm_vcpu *vcpu)
268static struct ia64_pal_retval pal_vm_info(struct kvm_vcpu *vcpu) 280static struct ia64_pal_retval pal_vm_info(struct kvm_vcpu *vcpu)
269{ 281{
270 struct ia64_pal_retval result; 282 struct ia64_pal_retval result;
283 unsigned long in0, in1, in2, in3;
271 284
272 INIT_PAL_STATUS_UNIMPLEMENTED(result); 285 kvm_get_pal_call_data(vcpu, &in0, &in1, &in2, &in3);
286
287 result.status = ia64_pal_vm_info(in1, in2,
288 (pal_tc_info_u_t *)&result.v1, &result.v2);
273 289
274 return result; 290 return result;
275} 291}
@@ -292,6 +308,108 @@ static void prepare_for_halt(struct kvm_vcpu *vcpu)
292 vcpu->arch.timer_fired = 0; 308 vcpu->arch.timer_fired = 0;
293} 309}
294 310
311static struct ia64_pal_retval pal_perf_mon_info(struct kvm_vcpu *vcpu)
312{
313 long status;
314 unsigned long in0, in1, in2, in3, r9;
315 unsigned long pm_buffer[16];
316
317 kvm_get_pal_call_data(vcpu, &in0, &in1, &in2, &in3);
318 status = ia64_pal_perf_mon_info(pm_buffer,
319 (pal_perf_mon_info_u_t *) &r9);
320 if (status != 0) {
321 printk(KERN_DEBUG"PAL_PERF_MON_INFO fails ret=%ld\n", status);
322 } else {
323 if (in1)
324 memcpy((void *)in1, pm_buffer, sizeof(pm_buffer));
325 else {
326 status = PAL_STATUS_EINVAL;
327 printk(KERN_WARNING"Invalid parameters "
328 "for PAL call:0x%lx!\n", in0);
329 }
330 }
331 return (struct ia64_pal_retval){status, r9, 0, 0};
332}
333
334static struct ia64_pal_retval pal_halt_info(struct kvm_vcpu *vcpu)
335{
336 unsigned long in0, in1, in2, in3;
337 long status;
338 unsigned long res = 1000UL | (1000UL << 16) | (10UL << 32)
339 | (1UL << 61) | (1UL << 60);
340
341 kvm_get_pal_call_data(vcpu, &in0, &in1, &in2, &in3);
342 if (in1) {
343 memcpy((void *)in1, &res, sizeof(res));
344 status = 0;
345 } else{
346 status = PAL_STATUS_EINVAL;
347 printk(KERN_WARNING"Invalid parameters "
348 "for PAL call:0x%lx!\n", in0);
349 }
350
351 return (struct ia64_pal_retval){status, 0, 0, 0};
352}
353
354static struct ia64_pal_retval pal_mem_attrib(struct kvm_vcpu *vcpu)
355{
356 unsigned long r9;
357 long status;
358
359 status = ia64_pal_mem_attrib(&r9);
360
361 return (struct ia64_pal_retval){status, r9, 0, 0};
362}
363
364static void remote_pal_prefetch_visibility(void *v)
365{
366 s64 trans_type = (s64)v;
367 ia64_pal_prefetch_visibility(trans_type);
368}
369
370static struct ia64_pal_retval pal_prefetch_visibility(struct kvm_vcpu *vcpu)
371{
372 struct ia64_pal_retval result = {0, 0, 0, 0};
373 unsigned long in0, in1, in2, in3;
374 kvm_get_pal_call_data(vcpu, &in0, &in1, &in2, &in3);
375 result.status = ia64_pal_prefetch_visibility(in1);
376 if (result.status == 0) {
377 /* Must be performed on all remote processors
378 in the coherence domain. */
379 smp_call_function(remote_pal_prefetch_visibility,
380 (void *)in1, 1);
381 /* Unnecessary on remote processor for other vcpus!*/
382 result.status = 1;
383 }
384 return result;
385}
386
387static void remote_pal_mc_drain(void *v)
388{
389 ia64_pal_mc_drain();
390}
391
392static struct ia64_pal_retval pal_get_brand_info(struct kvm_vcpu *vcpu)
393{
394 struct ia64_pal_retval result = {0, 0, 0, 0};
395 unsigned long in0, in1, in2, in3;
396
397 kvm_get_pal_call_data(vcpu, &in0, &in1, &in2, &in3);
398
399 if (in1 == 0 && in2) {
400 char brand_info[128];
401 result.status = ia64_pal_get_brand_info(brand_info);
402 if (result.status == PAL_STATUS_SUCCESS)
403 memcpy((void *)in2, brand_info, 128);
404 } else {
405 result.status = PAL_STATUS_REQUIRES_MEMORY;
406 printk(KERN_WARNING"Invalid parameters for "
407 "PAL call:0x%lx!\n", in0);
408 }
409
410 return result;
411}
412
295int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run) 413int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run)
296{ 414{
297 415
@@ -300,14 +418,22 @@ int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run)
300 int ret = 1; 418 int ret = 1;
301 419
302 gr28 = kvm_get_pal_call_index(vcpu); 420 gr28 = kvm_get_pal_call_index(vcpu);
303 /*printk("pal_call index:%lx\n",gr28);*/
304 switch (gr28) { 421 switch (gr28) {
305 case PAL_CACHE_FLUSH: 422 case PAL_CACHE_FLUSH:
306 result = pal_cache_flush(vcpu); 423 result = pal_cache_flush(vcpu);
307 break; 424 break;
425 case PAL_MEM_ATTRIB:
426 result = pal_mem_attrib(vcpu);
427 break;
308 case PAL_CACHE_SUMMARY: 428 case PAL_CACHE_SUMMARY:
309 result = pal_cache_summary(vcpu); 429 result = pal_cache_summary(vcpu);
310 break; 430 break;
431 case PAL_PERF_MON_INFO:
432 result = pal_perf_mon_info(vcpu);
433 break;
434 case PAL_HALT_INFO:
435 result = pal_halt_info(vcpu);
436 break;
311 case PAL_HALT_LIGHT: 437 case PAL_HALT_LIGHT:
312 { 438 {
313 INIT_PAL_STATUS_SUCCESS(result); 439 INIT_PAL_STATUS_SUCCESS(result);
@@ -317,6 +443,16 @@ int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run)
317 } 443 }
318 break; 444 break;
319 445
446 case PAL_PREFETCH_VISIBILITY:
447 result = pal_prefetch_visibility(vcpu);
448 break;
449 case PAL_MC_DRAIN:
450 result.status = ia64_pal_mc_drain();
451 /* FIXME: All vcpus likely call PAL_MC_DRAIN.
452 That causes the congestion. */
453 smp_call_function(remote_pal_mc_drain, NULL, 1);
454 break;
455
320 case PAL_FREQ_RATIOS: 456 case PAL_FREQ_RATIOS:
321 result = pal_freq_ratios(vcpu); 457 result = pal_freq_ratios(vcpu);
322 break; 458 break;
@@ -346,6 +482,9 @@ int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run)
346 INIT_PAL_STATUS_SUCCESS(result); 482 INIT_PAL_STATUS_SUCCESS(result);
347 result.v1 = (1L << 32) | 1L; 483 result.v1 = (1L << 32) | 1L;
348 break; 484 break;
485 case PAL_REGISTER_INFO:
486 result = pal_register_info(vcpu);
487 break;
349 case PAL_VM_PAGE_SIZE: 488 case PAL_VM_PAGE_SIZE:
350 result.status = ia64_pal_vm_page_size(&result.v0, 489 result.status = ia64_pal_vm_page_size(&result.v0,
351 &result.v1); 490 &result.v1);
@@ -365,12 +504,18 @@ int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run)
365 result.status = ia64_pal_version( 504 result.status = ia64_pal_version(
366 (pal_version_u_t *)&result.v0, 505 (pal_version_u_t *)&result.v0,
367 (pal_version_u_t *)&result.v1); 506 (pal_version_u_t *)&result.v1);
368
369 break; 507 break;
370 case PAL_FIXED_ADDR: 508 case PAL_FIXED_ADDR:
371 result.status = PAL_STATUS_SUCCESS; 509 result.status = PAL_STATUS_SUCCESS;
372 result.v0 = vcpu->vcpu_id; 510 result.v0 = vcpu->vcpu_id;
373 break; 511 break;
512 case PAL_BRAND_INFO:
513 result = pal_get_brand_info(vcpu);
514 break;
515 case PAL_GET_PSTATE:
516 case PAL_CACHE_SHARED_INFO:
517 INIT_PAL_STATUS_UNIMPLEMENTED(result);
518 break;
374 default: 519 default:
375 INIT_PAL_STATUS_UNIMPLEMENTED(result); 520 INIT_PAL_STATUS_UNIMPLEMENTED(result);
376 printk(KERN_WARNING"kvm: Unsupported pal call," 521 printk(KERN_WARNING"kvm: Unsupported pal call,"
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c
index 230eae482f32..b1dc80952d91 100644
--- a/arch/ia64/kvm/process.c
+++ b/arch/ia64/kvm/process.c
@@ -167,7 +167,6 @@ static u64 vcpu_get_itir_on_fault(struct kvm_vcpu *vcpu, u64 ifa)
167 return (rr1.val); 167 return (rr1.val);
168} 168}
169 169
170
171/* 170/*
172 * Set vIFA & vITIR & vIHA, when vPSR.ic =1 171 * Set vIFA & vITIR & vIHA, when vPSR.ic =1
173 * Parameter: 172 * Parameter:
@@ -222,8 +221,6 @@ void itlb_fault(struct kvm_vcpu *vcpu, u64 vadr)
222 inject_guest_interruption(vcpu, IA64_INST_TLB_VECTOR); 221 inject_guest_interruption(vcpu, IA64_INST_TLB_VECTOR);
223} 222}
224 223
225
226
227/* 224/*
228 * Data Nested TLB Fault 225 * Data Nested TLB Fault
229 * @ Data Nested TLB Vector 226 * @ Data Nested TLB Vector
@@ -245,7 +242,6 @@ void alt_dtlb(struct kvm_vcpu *vcpu, u64 vadr)
245 inject_guest_interruption(vcpu, IA64_ALT_DATA_TLB_VECTOR); 242 inject_guest_interruption(vcpu, IA64_ALT_DATA_TLB_VECTOR);
246} 243}
247 244
248
249/* 245/*
250 * Data TLB Fault 246 * Data TLB Fault
251 * @ Data TLB vector 247 * @ Data TLB vector
@@ -265,8 +261,6 @@ static void _vhpt_fault(struct kvm_vcpu *vcpu, u64 vadr)
265 /* If vPSR.ic, IFA, ITIR, IHA*/ 261 /* If vPSR.ic, IFA, ITIR, IHA*/
266 set_ifa_itir_iha(vcpu, vadr, 1, 1, 1); 262 set_ifa_itir_iha(vcpu, vadr, 1, 1, 1);
267 inject_guest_interruption(vcpu, IA64_VHPT_TRANS_VECTOR); 263 inject_guest_interruption(vcpu, IA64_VHPT_TRANS_VECTOR);
268
269
270} 264}
271 265
272/* 266/*
@@ -279,7 +273,6 @@ void ivhpt_fault(struct kvm_vcpu *vcpu, u64 vadr)
279 _vhpt_fault(vcpu, vadr); 273 _vhpt_fault(vcpu, vadr);
280} 274}
281 275
282
283/* 276/*
284 * VHPT Data Fault 277 * VHPT Data Fault
285 * @ VHPT Translation vector 278 * @ VHPT Translation vector
@@ -290,8 +283,6 @@ void dvhpt_fault(struct kvm_vcpu *vcpu, u64 vadr)
290 _vhpt_fault(vcpu, vadr); 283 _vhpt_fault(vcpu, vadr);
291} 284}
292 285
293
294
295/* 286/*
296 * Deal with: 287 * Deal with:
297 * General Exception vector 288 * General Exception vector
@@ -301,7 +292,6 @@ void _general_exception(struct kvm_vcpu *vcpu)
301 inject_guest_interruption(vcpu, IA64_GENEX_VECTOR); 292 inject_guest_interruption(vcpu, IA64_GENEX_VECTOR);
302} 293}
303 294
304
305/* 295/*
306 * Illegal Operation Fault 296 * Illegal Operation Fault
307 * @ General Exception Vector 297 * @ General Exception Vector
@@ -419,19 +409,16 @@ static void __page_not_present(struct kvm_vcpu *vcpu, u64 vadr)
419 inject_guest_interruption(vcpu, IA64_PAGE_NOT_PRESENT_VECTOR); 409 inject_guest_interruption(vcpu, IA64_PAGE_NOT_PRESENT_VECTOR);
420} 410}
421 411
422
423void data_page_not_present(struct kvm_vcpu *vcpu, u64 vadr) 412void data_page_not_present(struct kvm_vcpu *vcpu, u64 vadr)
424{ 413{
425 __page_not_present(vcpu, vadr); 414 __page_not_present(vcpu, vadr);
426} 415}
427 416
428
429void inst_page_not_present(struct kvm_vcpu *vcpu, u64 vadr) 417void inst_page_not_present(struct kvm_vcpu *vcpu, u64 vadr)
430{ 418{
431 __page_not_present(vcpu, vadr); 419 __page_not_present(vcpu, vadr);
432} 420}
433 421
434
435/* Deal with 422/* Deal with
436 * Data access rights vector 423 * Data access rights vector
437 */ 424 */
@@ -563,22 +550,64 @@ void reflect_interruption(u64 ifa, u64 isr, u64 iim,
563 inject_guest_interruption(vcpu, vector); 550 inject_guest_interruption(vcpu, vector);
564} 551}
565 552
553static unsigned long kvm_trans_pal_call_args(struct kvm_vcpu *vcpu,
554 unsigned long arg)
555{
556 struct thash_data *data;
557 unsigned long gpa, poff;
558
559 if (!is_physical_mode(vcpu)) {
560 /* Depends on caller to provide the DTR or DTC mapping.*/
561 data = vtlb_lookup(vcpu, arg, D_TLB);
562 if (data)
563 gpa = data->page_flags & _PAGE_PPN_MASK;
564 else {
565 data = vhpt_lookup(arg);
566 if (!data)
567 return 0;
568 gpa = data->gpaddr & _PAGE_PPN_MASK;
569 }
570
571 poff = arg & (PSIZE(data->ps) - 1);
572 arg = PAGEALIGN(gpa, data->ps) | poff;
573 }
574 arg = kvm_gpa_to_mpa(arg << 1 >> 1);
575
576 return (unsigned long)__va(arg);
577}
578
566static void set_pal_call_data(struct kvm_vcpu *vcpu) 579static void set_pal_call_data(struct kvm_vcpu *vcpu)
567{ 580{
568 struct exit_ctl_data *p = &vcpu->arch.exit_data; 581 struct exit_ctl_data *p = &vcpu->arch.exit_data;
582 unsigned long gr28 = vcpu_get_gr(vcpu, 28);
583 unsigned long gr29 = vcpu_get_gr(vcpu, 29);
584 unsigned long gr30 = vcpu_get_gr(vcpu, 30);
569 585
570 /*FIXME:For static and stacked convention, firmware 586 /*FIXME:For static and stacked convention, firmware
571 * has put the parameters in gr28-gr31 before 587 * has put the parameters in gr28-gr31 before
572 * break to vmm !!*/ 588 * break to vmm !!*/
573 589
574 p->u.pal_data.gr28 = vcpu_get_gr(vcpu, 28); 590 switch (gr28) {
575 p->u.pal_data.gr29 = vcpu_get_gr(vcpu, 29); 591 case PAL_PERF_MON_INFO:
576 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30); 592 case PAL_HALT_INFO:
593 p->u.pal_data.gr29 = kvm_trans_pal_call_args(vcpu, gr29);
594 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
595 break;
596 case PAL_BRAND_INFO:
597 p->u.pal_data.gr29 = gr29;;
598 p->u.pal_data.gr30 = kvm_trans_pal_call_args(vcpu, gr30);
599 break;
600 default:
601 p->u.pal_data.gr29 = gr29;;
602 p->u.pal_data.gr30 = vcpu_get_gr(vcpu, 30);
603 }
604 p->u.pal_data.gr28 = gr28;
577 p->u.pal_data.gr31 = vcpu_get_gr(vcpu, 31); 605 p->u.pal_data.gr31 = vcpu_get_gr(vcpu, 31);
606
578 p->exit_reason = EXIT_REASON_PAL_CALL; 607 p->exit_reason = EXIT_REASON_PAL_CALL;
579} 608}
580 609
581static void set_pal_call_result(struct kvm_vcpu *vcpu) 610static void get_pal_call_result(struct kvm_vcpu *vcpu)
582{ 611{
583 struct exit_ctl_data *p = &vcpu->arch.exit_data; 612 struct exit_ctl_data *p = &vcpu->arch.exit_data;
584 613
@@ -606,7 +635,7 @@ static void set_sal_call_data(struct kvm_vcpu *vcpu)
606 p->exit_reason = EXIT_REASON_SAL_CALL; 635 p->exit_reason = EXIT_REASON_SAL_CALL;
607} 636}
608 637
609static void set_sal_call_result(struct kvm_vcpu *vcpu) 638static void get_sal_call_result(struct kvm_vcpu *vcpu)
610{ 639{
611 struct exit_ctl_data *p = &vcpu->arch.exit_data; 640 struct exit_ctl_data *p = &vcpu->arch.exit_data;
612 641
@@ -629,13 +658,13 @@ void kvm_ia64_handle_break(unsigned long ifa, struct kvm_pt_regs *regs,
629 if (iim == DOMN_PAL_REQUEST) { 658 if (iim == DOMN_PAL_REQUEST) {
630 set_pal_call_data(v); 659 set_pal_call_data(v);
631 vmm_transition(v); 660 vmm_transition(v);
632 set_pal_call_result(v); 661 get_pal_call_result(v);
633 vcpu_increment_iip(v); 662 vcpu_increment_iip(v);
634 return; 663 return;
635 } else if (iim == DOMN_SAL_REQUEST) { 664 } else if (iim == DOMN_SAL_REQUEST) {
636 set_sal_call_data(v); 665 set_sal_call_data(v);
637 vmm_transition(v); 666 vmm_transition(v);
638 set_sal_call_result(v); 667 get_sal_call_result(v);
639 vcpu_increment_iip(v); 668 vcpu_increment_iip(v);
640 return; 669 return;
641 } 670 }
@@ -703,7 +732,6 @@ void vhpi_detection(struct kvm_vcpu *vcpu)
703 } 732 }
704} 733}
705 734
706
707void leave_hypervisor_tail(void) 735void leave_hypervisor_tail(void)
708{ 736{
709 struct kvm_vcpu *v = current_vcpu; 737 struct kvm_vcpu *v = current_vcpu;
@@ -737,7 +765,6 @@ void leave_hypervisor_tail(void)
737 } 765 }
738} 766}
739 767
740
741static inline void handle_lds(struct kvm_pt_regs *regs) 768static inline void handle_lds(struct kvm_pt_regs *regs)
742{ 769{
743 regs->cr_ipsr |= IA64_PSR_ED; 770 regs->cr_ipsr |= IA64_PSR_ED;
diff --git a/arch/ia64/kvm/vcpu.c b/arch/ia64/kvm/vcpu.c
index ecd526b55323..d4d280505878 100644
--- a/arch/ia64/kvm/vcpu.c
+++ b/arch/ia64/kvm/vcpu.c
@@ -112,7 +112,6 @@ void switch_to_physical_rid(struct kvm_vcpu *vcpu)
112 return; 112 return;
113} 113}
114 114
115
116void switch_to_virtual_rid(struct kvm_vcpu *vcpu) 115void switch_to_virtual_rid(struct kvm_vcpu *vcpu)
117{ 116{
118 unsigned long psr; 117 unsigned long psr;
@@ -166,8 +165,6 @@ void switch_mm_mode(struct kvm_vcpu *vcpu, struct ia64_psr old_psr,
166 return; 165 return;
167} 166}
168 167
169
170
171/* 168/*
172 * In physical mode, insert tc/tr for region 0 and 4 uses 169 * In physical mode, insert tc/tr for region 0 and 4 uses
173 * RID[0] and RID[4] which is for physical mode emulation. 170 * RID[0] and RID[4] which is for physical mode emulation.
@@ -269,7 +266,6 @@ static inline unsigned long fph_index(struct kvm_pt_regs *regs,
269 return rotate_reg(96, rrb_fr, (regnum - IA64_FIRST_ROTATING_FR)); 266 return rotate_reg(96, rrb_fr, (regnum - IA64_FIRST_ROTATING_FR));
270} 267}
271 268
272
273/* 269/*
274 * The inverse of the above: given bspstore and the number of 270 * The inverse of the above: given bspstore and the number of
275 * registers, calculate ar.bsp. 271 * registers, calculate ar.bsp.
@@ -811,12 +807,15 @@ static inline void vcpu_set_itm(struct kvm_vcpu *vcpu, u64 val);
811static void vcpu_set_itc(struct kvm_vcpu *vcpu, u64 val) 807static void vcpu_set_itc(struct kvm_vcpu *vcpu, u64 val)
812{ 808{
813 struct kvm_vcpu *v; 809 struct kvm_vcpu *v;
810 struct kvm *kvm;
814 int i; 811 int i;
815 long itc_offset = val - ia64_getreg(_IA64_REG_AR_ITC); 812 long itc_offset = val - ia64_getreg(_IA64_REG_AR_ITC);
816 unsigned long vitv = VCPU(vcpu, itv); 813 unsigned long vitv = VCPU(vcpu, itv);
817 814
815 kvm = (struct kvm *)KVM_VM_BASE;
816
818 if (vcpu->vcpu_id == 0) { 817 if (vcpu->vcpu_id == 0) {
819 for (i = 0; i < KVM_MAX_VCPUS; i++) { 818 for (i = 0; i < kvm->arch.online_vcpus; i++) {
820 v = (struct kvm_vcpu *)((char *)vcpu + 819 v = (struct kvm_vcpu *)((char *)vcpu +
821 sizeof(struct kvm_vcpu_data) * i); 820 sizeof(struct kvm_vcpu_data) * i);
822 VMX(v, itc_offset) = itc_offset; 821 VMX(v, itc_offset) = itc_offset;
@@ -1039,8 +1038,6 @@ u64 vcpu_tak(struct kvm_vcpu *vcpu, u64 vadr)
1039 return key; 1038 return key;
1040} 1039}
1041 1040
1042
1043
1044void kvm_thash(struct kvm_vcpu *vcpu, INST64 inst) 1041void kvm_thash(struct kvm_vcpu *vcpu, INST64 inst)
1045{ 1042{
1046 unsigned long thash, vadr; 1043 unsigned long thash, vadr;
@@ -1050,7 +1047,6 @@ void kvm_thash(struct kvm_vcpu *vcpu, INST64 inst)
1050 vcpu_set_gr(vcpu, inst.M46.r1, thash, 0); 1047 vcpu_set_gr(vcpu, inst.M46.r1, thash, 0);
1051} 1048}
1052 1049
1053
1054void kvm_ttag(struct kvm_vcpu *vcpu, INST64 inst) 1050void kvm_ttag(struct kvm_vcpu *vcpu, INST64 inst)
1055{ 1051{
1056 unsigned long tag, vadr; 1052 unsigned long tag, vadr;
@@ -1131,7 +1127,6 @@ int vcpu_tpa(struct kvm_vcpu *vcpu, u64 vadr, u64 *padr)
1131 return IA64_NO_FAULT; 1127 return IA64_NO_FAULT;
1132} 1128}
1133 1129
1134
1135int kvm_tpa(struct kvm_vcpu *vcpu, INST64 inst) 1130int kvm_tpa(struct kvm_vcpu *vcpu, INST64 inst)
1136{ 1131{
1137 unsigned long r1, r3; 1132 unsigned long r1, r3;
@@ -1154,7 +1149,6 @@ void kvm_tak(struct kvm_vcpu *vcpu, INST64 inst)
1154 vcpu_set_gr(vcpu, inst.M46.r1, r1, 0); 1149 vcpu_set_gr(vcpu, inst.M46.r1, r1, 0);
1155} 1150}
1156 1151
1157
1158/************************************ 1152/************************************
1159 * Insert/Purge translation register/cache 1153 * Insert/Purge translation register/cache
1160 ************************************/ 1154 ************************************/
@@ -1385,7 +1379,6 @@ void kvm_mov_to_ar_reg(struct kvm_vcpu *vcpu, INST64 inst)
1385 vcpu_set_itc(vcpu, r2); 1379 vcpu_set_itc(vcpu, r2);
1386} 1380}
1387 1381
1388
1389void kvm_mov_from_ar_reg(struct kvm_vcpu *vcpu, INST64 inst) 1382void kvm_mov_from_ar_reg(struct kvm_vcpu *vcpu, INST64 inst)
1390{ 1383{
1391 unsigned long r1; 1384 unsigned long r1;
@@ -1393,8 +1386,9 @@ void kvm_mov_from_ar_reg(struct kvm_vcpu *vcpu, INST64 inst)
1393 r1 = vcpu_get_itc(vcpu); 1386 r1 = vcpu_get_itc(vcpu);
1394 vcpu_set_gr(vcpu, inst.M31.r1, r1, 0); 1387 vcpu_set_gr(vcpu, inst.M31.r1, r1, 0);
1395} 1388}
1389
1396/************************************************************************** 1390/**************************************************************************
1397 struct kvm_vcpu*protection key register access routines 1391 struct kvm_vcpu protection key register access routines
1398 **************************************************************************/ 1392 **************************************************************************/
1399 1393
1400unsigned long vcpu_get_pkr(struct kvm_vcpu *vcpu, unsigned long reg) 1394unsigned long vcpu_get_pkr(struct kvm_vcpu *vcpu, unsigned long reg)
@@ -1407,20 +1401,6 @@ void vcpu_set_pkr(struct kvm_vcpu *vcpu, unsigned long reg, unsigned long val)
1407 ia64_set_pkr(reg, val); 1401 ia64_set_pkr(reg, val);
1408} 1402}
1409 1403
1410
1411unsigned long vcpu_get_itir_on_fault(struct kvm_vcpu *vcpu, unsigned long ifa)
1412{
1413 union ia64_rr rr, rr1;
1414
1415 rr.val = vcpu_get_rr(vcpu, ifa);
1416 rr1.val = 0;
1417 rr1.ps = rr.ps;
1418 rr1.rid = rr.rid;
1419 return (rr1.val);
1420}
1421
1422
1423
1424/******************************** 1404/********************************
1425 * Moves to privileged registers 1405 * Moves to privileged registers
1426 ********************************/ 1406 ********************************/
@@ -1464,8 +1444,6 @@ unsigned long vcpu_set_rr(struct kvm_vcpu *vcpu, unsigned long reg,
1464 return (IA64_NO_FAULT); 1444 return (IA64_NO_FAULT);
1465} 1445}
1466 1446
1467
1468
1469void kvm_mov_to_rr(struct kvm_vcpu *vcpu, INST64 inst) 1447void kvm_mov_to_rr(struct kvm_vcpu *vcpu, INST64 inst)
1470{ 1448{
1471 unsigned long r3, r2; 1449 unsigned long r3, r2;
@@ -1510,8 +1488,6 @@ void kvm_mov_to_pkr(struct kvm_vcpu *vcpu, INST64 inst)
1510 vcpu_set_pkr(vcpu, r3, r2); 1488 vcpu_set_pkr(vcpu, r3, r2);
1511} 1489}
1512 1490
1513
1514
1515void kvm_mov_from_rr(struct kvm_vcpu *vcpu, INST64 inst) 1491void kvm_mov_from_rr(struct kvm_vcpu *vcpu, INST64 inst)
1516{ 1492{
1517 unsigned long r3, r1; 1493 unsigned long r3, r1;
@@ -1557,7 +1533,6 @@ void kvm_mov_from_pmc(struct kvm_vcpu *vcpu, INST64 inst)
1557 vcpu_set_gr(vcpu, inst.M43.r1, r1, 0); 1533 vcpu_set_gr(vcpu, inst.M43.r1, r1, 0);
1558} 1534}
1559 1535
1560
1561unsigned long vcpu_get_cpuid(struct kvm_vcpu *vcpu, unsigned long reg) 1536unsigned long vcpu_get_cpuid(struct kvm_vcpu *vcpu, unsigned long reg)
1562{ 1537{
1563 /* FIXME: This could get called as a result of a rsvd-reg fault */ 1538 /* FIXME: This could get called as a result of a rsvd-reg fault */
@@ -1609,7 +1584,6 @@ unsigned long kvm_mov_to_cr(struct kvm_vcpu *vcpu, INST64 inst)
1609 return 0; 1584 return 0;
1610} 1585}
1611 1586
1612
1613unsigned long kvm_mov_from_cr(struct kvm_vcpu *vcpu, INST64 inst) 1587unsigned long kvm_mov_from_cr(struct kvm_vcpu *vcpu, INST64 inst)
1614{ 1588{
1615 unsigned long tgt = inst.M33.r1; 1589 unsigned long tgt = inst.M33.r1;
@@ -1633,8 +1607,6 @@ unsigned long kvm_mov_from_cr(struct kvm_vcpu *vcpu, INST64 inst)
1633 return 0; 1607 return 0;
1634} 1608}
1635 1609
1636
1637
1638void vcpu_set_psr(struct kvm_vcpu *vcpu, unsigned long val) 1610void vcpu_set_psr(struct kvm_vcpu *vcpu, unsigned long val)
1639{ 1611{
1640 1612
@@ -1776,9 +1748,6 @@ void vcpu_bsw1(struct kvm_vcpu *vcpu)
1776 } 1748 }
1777} 1749}
1778 1750
1779
1780
1781
1782void vcpu_rfi(struct kvm_vcpu *vcpu) 1751void vcpu_rfi(struct kvm_vcpu *vcpu)
1783{ 1752{
1784 unsigned long ifs, psr; 1753 unsigned long ifs, psr;
@@ -1796,7 +1765,6 @@ void vcpu_rfi(struct kvm_vcpu *vcpu)
1796 regs->cr_iip = VCPU(vcpu, iip); 1765 regs->cr_iip = VCPU(vcpu, iip);
1797} 1766}
1798 1767
1799
1800/* 1768/*
1801 VPSR can't keep track of below bits of guest PSR 1769 VPSR can't keep track of below bits of guest PSR
1802 This function gets guest PSR 1770 This function gets guest PSR
diff --git a/arch/ia64/kvm/vcpu.h b/arch/ia64/kvm/vcpu.h
index b2f12a562bdf..042af92ced83 100644
--- a/arch/ia64/kvm/vcpu.h
+++ b/arch/ia64/kvm/vcpu.h
@@ -703,7 +703,7 @@ extern u64 guest_vhpt_lookup(u64 iha, u64 *pte);
703extern void thash_purge_entries(struct kvm_vcpu *v, u64 va, u64 ps); 703extern void thash_purge_entries(struct kvm_vcpu *v, u64 va, u64 ps);
704extern void thash_purge_entries_remote(struct kvm_vcpu *v, u64 va, u64 ps); 704extern void thash_purge_entries_remote(struct kvm_vcpu *v, u64 va, u64 ps);
705extern u64 translate_phy_pte(u64 *pte, u64 itir, u64 va); 705extern u64 translate_phy_pte(u64 *pte, u64 itir, u64 va);
706extern int thash_purge_and_insert(struct kvm_vcpu *v, u64 pte, 706extern void thash_purge_and_insert(struct kvm_vcpu *v, u64 pte,
707 u64 itir, u64 ifa, int type); 707 u64 itir, u64 ifa, int type);
708extern void thash_purge_all(struct kvm_vcpu *v); 708extern void thash_purge_all(struct kvm_vcpu *v);
709extern struct thash_data *vtlb_lookup(struct kvm_vcpu *v, 709extern struct thash_data *vtlb_lookup(struct kvm_vcpu *v,
@@ -738,7 +738,7 @@ void kvm_init_vhpt(struct kvm_vcpu *v);
738void thash_init(struct thash_cb *hcb, u64 sz); 738void thash_init(struct thash_cb *hcb, u64 sz);
739 739
740void panic_vm(struct kvm_vcpu *v, const char *fmt, ...); 740void panic_vm(struct kvm_vcpu *v, const char *fmt, ...);
741 741u64 kvm_gpa_to_mpa(u64 gpa);
742extern u64 ia64_call_vsa(u64 proc, u64 arg1, u64 arg2, u64 arg3, 742extern u64 ia64_call_vsa(u64 proc, u64 arg1, u64 arg2, u64 arg3,
743 u64 arg4, u64 arg5, u64 arg6, u64 arg7); 743 u64 arg4, u64 arg5, u64 arg6, u64 arg7);
744 744
diff --git a/arch/ia64/kvm/vtlb.c b/arch/ia64/kvm/vtlb.c
index 6b6307a3bd55..38232b37668b 100644
--- a/arch/ia64/kvm/vtlb.c
+++ b/arch/ia64/kvm/vtlb.c
@@ -164,11 +164,11 @@ static void vhpt_insert(u64 pte, u64 itir, u64 ifa, u64 gpte)
164 unsigned long ps, gpaddr; 164 unsigned long ps, gpaddr;
165 165
166 ps = itir_ps(itir); 166 ps = itir_ps(itir);
167 rr.val = ia64_get_rr(ifa);
167 168
168 gpaddr = ((gpte & _PAGE_PPN_MASK) >> ps << ps) | 169 gpaddr = ((gpte & _PAGE_PPN_MASK) >> ps << ps) |
169 (ifa & ((1UL << ps) - 1)); 170 (ifa & ((1UL << ps) - 1));
170 171
171 rr.val = ia64_get_rr(ifa);
172 head = (struct thash_data *)ia64_thash(ifa); 172 head = (struct thash_data *)ia64_thash(ifa);
173 head->etag = INVALID_TI_TAG; 173 head->etag = INVALID_TI_TAG;
174 ia64_mf(); 174 ia64_mf();
@@ -412,16 +412,14 @@ u64 translate_phy_pte(u64 *pte, u64 itir, u64 va)
412 412
413/* 413/*
414 * Purge overlap TCs and then insert the new entry to emulate itc ops. 414 * Purge overlap TCs and then insert the new entry to emulate itc ops.
415 * Notes: Only TC entry can purge and insert. 415 * Notes: Only TC entry can purge and insert.
416 * 1 indicates this is MMIO
417 */ 416 */
418int thash_purge_and_insert(struct kvm_vcpu *v, u64 pte, u64 itir, 417void thash_purge_and_insert(struct kvm_vcpu *v, u64 pte, u64 itir,
419 u64 ifa, int type) 418 u64 ifa, int type)
420{ 419{
421 u64 ps; 420 u64 ps;
422 u64 phy_pte, io_mask, index; 421 u64 phy_pte, io_mask, index;
423 union ia64_rr vrr, mrr; 422 union ia64_rr vrr, mrr;
424 int ret = 0;
425 423
426 ps = itir_ps(itir); 424 ps = itir_ps(itir);
427 vrr.val = vcpu_get_rr(v, ifa); 425 vrr.val = vcpu_get_rr(v, ifa);
@@ -441,25 +439,19 @@ int thash_purge_and_insert(struct kvm_vcpu *v, u64 pte, u64 itir,
441 phy_pte &= ~_PAGE_MA_MASK; 439 phy_pte &= ~_PAGE_MA_MASK;
442 } 440 }
443 441
444 if (pte & VTLB_PTE_IO)
445 ret = 1;
446
447 vtlb_purge(v, ifa, ps); 442 vtlb_purge(v, ifa, ps);
448 vhpt_purge(v, ifa, ps); 443 vhpt_purge(v, ifa, ps);
449 444
450 if (ps == mrr.ps) { 445 if ((ps != mrr.ps) || (pte & VTLB_PTE_IO)) {
451 if (!(pte&VTLB_PTE_IO)) {
452 vhpt_insert(phy_pte, itir, ifa, pte);
453 } else {
454 vtlb_insert(v, pte, itir, ifa);
455 vcpu_quick_region_set(VMX(v, tc_regions), ifa);
456 }
457 } else if (ps > mrr.ps) {
458 vtlb_insert(v, pte, itir, ifa); 446 vtlb_insert(v, pte, itir, ifa);
459 vcpu_quick_region_set(VMX(v, tc_regions), ifa); 447 vcpu_quick_region_set(VMX(v, tc_regions), ifa);
460 if (!(pte&VTLB_PTE_IO)) 448 }
461 vhpt_insert(phy_pte, itir, ifa, pte); 449 if (pte & VTLB_PTE_IO)
462 } else { 450 return;
451
452 if (ps >= mrr.ps)
453 vhpt_insert(phy_pte, itir, ifa, pte);
454 else {
463 u64 psr; 455 u64 psr;
464 phy_pte &= ~PAGE_FLAGS_RV_MASK; 456 phy_pte &= ~PAGE_FLAGS_RV_MASK;
465 psr = ia64_clear_ic(); 457 psr = ia64_clear_ic();
@@ -469,7 +461,6 @@ int thash_purge_and_insert(struct kvm_vcpu *v, u64 pte, u64 itir,
469 if (!(pte&VTLB_PTE_IO)) 461 if (!(pte&VTLB_PTE_IO))
470 mark_pages_dirty(v, pte, ps); 462 mark_pages_dirty(v, pte, ps);
471 463
472 return ret;
473} 464}
474 465
475/* 466/*
@@ -509,7 +500,6 @@ void thash_purge_all(struct kvm_vcpu *v)
509 local_flush_tlb_all(); 500 local_flush_tlb_all();
510} 501}
511 502
512
513/* 503/*
514 * Lookup the hash table and its collision chain to find an entry 504 * Lookup the hash table and its collision chain to find an entry
515 * covering this address rid:va or the entry. 505 * covering this address rid:va or the entry.
@@ -517,7 +507,6 @@ void thash_purge_all(struct kvm_vcpu *v)
517 * INPUT: 507 * INPUT:
518 * in: TLB format for both VHPT & TLB. 508 * in: TLB format for both VHPT & TLB.
519 */ 509 */
520
521struct thash_data *vtlb_lookup(struct kvm_vcpu *v, u64 va, int is_data) 510struct thash_data *vtlb_lookup(struct kvm_vcpu *v, u64 va, int is_data)
522{ 511{
523 struct thash_data *cch; 512 struct thash_data *cch;
@@ -547,7 +536,6 @@ struct thash_data *vtlb_lookup(struct kvm_vcpu *v, u64 va, int is_data)
547 return NULL; 536 return NULL;
548} 537}
549 538
550
551/* 539/*
552 * Initialize internal control data before service. 540 * Initialize internal control data before service.
553 */ 541 */
@@ -573,6 +561,10 @@ void thash_init(struct thash_cb *hcb, u64 sz)
573u64 kvm_get_mpt_entry(u64 gpfn) 561u64 kvm_get_mpt_entry(u64 gpfn)
574{ 562{
575 u64 *base = (u64 *) KVM_P2M_BASE; 563 u64 *base = (u64 *) KVM_P2M_BASE;
564
565 if (gpfn >= (KVM_P2M_SIZE >> 3))
566 panic_vm(current_vcpu, "Invalid gpfn =%lx\n", gpfn);
567
576 return *(base + gpfn); 568 return *(base + gpfn);
577} 569}
578 570
@@ -589,7 +581,6 @@ u64 kvm_gpa_to_mpa(u64 gpa)
589 return (pte >> PAGE_SHIFT << PAGE_SHIFT) | (gpa & ~PAGE_MASK); 581 return (pte >> PAGE_SHIFT << PAGE_SHIFT) | (gpa & ~PAGE_MASK);
590} 582}
591 583
592
593/* 584/*
594 * Fetch guest bundle code. 585 * Fetch guest bundle code.
595 * INPUT: 586 * INPUT:
@@ -631,7 +622,6 @@ int fetch_code(struct kvm_vcpu *vcpu, u64 gip, IA64_BUNDLE *pbundle)
631 return IA64_NO_FAULT; 622 return IA64_NO_FAULT;
632} 623}
633 624
634
635void kvm_init_vhpt(struct kvm_vcpu *v) 625void kvm_init_vhpt(struct kvm_vcpu *v)
636{ 626{
637 v->arch.vhpt.num = VHPT_NUM_ENTRIES; 627 v->arch.vhpt.num = VHPT_NUM_ENTRIES;
diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c
index ca553b0429ce..81e428943d73 100644
--- a/arch/ia64/sn/kernel/msi_sn.c
+++ b/arch/ia64/sn/kernel/msi_sn.c
@@ -205,7 +205,7 @@ static void sn_set_msi_irq_affinity(unsigned int irq,
205 msg.address_lo = (u32)(bus_addr & 0x00000000ffffffff); 205 msg.address_lo = (u32)(bus_addr & 0x00000000ffffffff);
206 206
207 write_msi_msg(irq, &msg); 207 write_msi_msg(irq, &msg);
208 irq_desc[irq].affinity = *cpu_mask; 208 cpumask_copy(irq_desc[irq].affinity, cpu_mask);
209} 209}
210#endif /* CONFIG_SMP */ 210#endif /* CONFIG_SMP */
211 211
diff --git a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c
index 2aeae4670098..8dfd31e87c4c 100644
--- a/arch/m32r/kernel/irq.c
+++ b/arch/m32r/kernel/irq.c
@@ -49,7 +49,7 @@ int show_interrupts(struct seq_file *p, void *v)
49 seq_printf(p, "%10u ", kstat_irqs(i)); 49 seq_printf(p, "%10u ", kstat_irqs(i));
50#else 50#else
51 for_each_online_cpu(j) 51 for_each_online_cpu(j)
52 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 52 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
53#endif 53#endif
54 seq_printf(p, " %14s", irq_desc[i].chip->typename); 54 seq_printf(p, " %14s", irq_desc[i].chip->typename);
55 seq_printf(p, " %s", action->name); 55 seq_printf(p, " %s", action->name);
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 8133dbc44964..570d85c3f97f 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -117,3 +117,6 @@ endif
117 117
118archclean: 118archclean:
119 rm -f vmlinux.gz vmlinux.bz2 119 rm -f vmlinux.gz vmlinux.bz2
120
121install:
122 sh $(srctree)/arch/m68k/install.sh $(KERNELRELEASE) vmlinux.gz System.map "$(INSTALL_PATH)"
diff --git a/arch/m68k/include/asm/irq_mm.h b/arch/m68k/include/asm/irq_mm.h
index 226bfc0f21b1..0cab42cad79e 100644
--- a/arch/m68k/include/asm/irq_mm.h
+++ b/arch/m68k/include/asm/irq_mm.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/linkage.h> 4#include <linux/linkage.h>
5#include <linux/hardirq.h> 5#include <linux/hardirq.h>
6#include <linux/irqreturn.h>
6#include <linux/spinlock_types.h> 7#include <linux/spinlock_types.h>
7 8
8/* 9/*
@@ -80,7 +81,7 @@ struct pt_regs;
80 * interrupt source (if it supports chaining). 81 * interrupt source (if it supports chaining).
81 */ 82 */
82typedef struct irq_node { 83typedef struct irq_node {
83 int (*handler)(int, void *); 84 irqreturn_t (*handler)(int, void *);
84 void *dev_id; 85 void *dev_id;
85 struct irq_node *next; 86 struct irq_node *next;
86 unsigned long flags; 87 unsigned long flags;
diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h
index 05309f7e3d06..50db3591ca15 100644
--- a/arch/m68k/include/asm/macintosh.h
+++ b/arch/m68k/include/asm/macintosh.h
@@ -34,6 +34,7 @@ struct mac_model
34 char scc_type; 34 char scc_type;
35 char ether_type; 35 char ether_type;
36 char nubus_type; 36 char nubus_type;
37 char floppy_type;
37}; 38};
38 39
39#define MAC_ADB_NONE 0 40#define MAC_ADB_NONE 0
@@ -71,6 +72,12 @@ struct mac_model
71#define MAC_NO_NUBUS 0 72#define MAC_NO_NUBUS 0
72#define MAC_NUBUS 1 73#define MAC_NUBUS 1
73 74
75#define MAC_FLOPPY_IWM 0
76#define MAC_FLOPPY_SWIM_ADDR1 1
77#define MAC_FLOPPY_SWIM_ADDR2 2
78#define MAC_FLOPPY_SWIM_IOP 3
79#define MAC_FLOPPY_AV 4
80
74/* 81/*
75 * Gestalt numbers 82 * Gestalt numbers
76 */ 83 */
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h
index dbc64e92c41a..ca87f938b03f 100644
--- a/arch/m68k/include/asm/socket.h
+++ b/arch/m68k/include/asm/socket.h
@@ -54,4 +54,7 @@
54 54
55#define SO_MARK 36 55#define SO_MARK 36
56 56
57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
57#endif /* _ASM_SOCKET_H */ 60#endif /* _ASM_SOCKET_H */
diff --git a/arch/m68k/install.sh b/arch/m68k/install.sh
new file mode 100644
index 000000000000..9c6bae6112e3
--- /dev/null
+++ b/arch/m68k/install.sh
@@ -0,0 +1,52 @@
1#!/bin/sh
2#
3# This file is subject to the terms and conditions of the GNU General Public
4# License. See the file "COPYING" in the main directory of this archive
5# for more details.
6#
7# Copyright (C) 1995 by Linus Torvalds
8#
9# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
10#
11# "make install" script for m68k architecture
12#
13# Arguments:
14# $1 - kernel version
15# $2 - kernel image file
16# $3 - kernel map file
17# $4 - default install path (blank if root directory)
18#
19
20verify () {
21 if [ ! -f "$1" ]; then
22 echo "" 1>&2
23 echo " *** Missing file: $1" 1>&2
24 echo ' *** You need to run "make" before "make install".' 1>&2
25 echo "" 1>&2
26 exit 1
27 fi
28}
29
30# Make sure the files actually exist
31verify "$2"
32verify "$3"
33
34# User may have a custom install script
35
36if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
37if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi
38
39# Default install - same as make zlilo
40
41if [ -f $4/vmlinuz ]; then
42 mv $4/vmlinuz $4/vmlinuz.old
43fi
44
45if [ -f $4/System.map ]; then
46 mv $4/System.map $4/System.old
47fi
48
49cat $2 > $4/vmlinuz
50cp $3 $4/System.map
51
52sync
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index 98b6bcfb37bf..be017984a456 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -22,6 +22,7 @@
22/* keyb */ 22/* keyb */
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/vt_kern.h> 24#include <linux/vt_kern.h>
25#include <linux/platform_device.h>
25 26
26#define BOOTINFO_COMPAT_1_0 27#define BOOTINFO_COMPAT_1_0
27#include <asm/setup.h> 28#include <asm/setup.h>
@@ -43,6 +44,10 @@
43#include <asm/mac_oss.h> 44#include <asm/mac_oss.h>
44#include <asm/mac_psc.h> 45#include <asm/mac_psc.h>
45 46
47/* platform device info */
48
49#define SWIM_IO_SIZE 0x2000 /* SWIM IO resource size */
50
46/* Mac bootinfo struct */ 51/* Mac bootinfo struct */
47 52
48struct mac_booter_data mac_bi_data; 53struct mac_booter_data mac_bi_data;
@@ -224,7 +229,8 @@ static struct mac_model mac_data_table[] = {
224 .via_type = MAC_VIA_II, 229 .via_type = MAC_VIA_II,
225 .scsi_type = MAC_SCSI_OLD, 230 .scsi_type = MAC_SCSI_OLD,
226 .scc_type = MAC_SCC_II, 231 .scc_type = MAC_SCC_II,
227 .nubus_type = MAC_NUBUS 232 .nubus_type = MAC_NUBUS,
233 .floppy_type = MAC_FLOPPY_IWM
228 }, 234 },
229 235
230 /* 236 /*
@@ -239,7 +245,8 @@ static struct mac_model mac_data_table[] = {
239 .via_type = MAC_VIA_II, 245 .via_type = MAC_VIA_II,
240 .scsi_type = MAC_SCSI_OLD, 246 .scsi_type = MAC_SCSI_OLD,
241 .scc_type = MAC_SCC_II, 247 .scc_type = MAC_SCC_II,
242 .nubus_type = MAC_NUBUS 248 .nubus_type = MAC_NUBUS,
249 .floppy_type = MAC_FLOPPY_IWM
243 }, { 250 }, {
244 .ident = MAC_MODEL_IIX, 251 .ident = MAC_MODEL_IIX,
245 .name = "IIx", 252 .name = "IIx",
@@ -247,7 +254,8 @@ static struct mac_model mac_data_table[] = {
247 .via_type = MAC_VIA_II, 254 .via_type = MAC_VIA_II,
248 .scsi_type = MAC_SCSI_OLD, 255 .scsi_type = MAC_SCSI_OLD,
249 .scc_type = MAC_SCC_II, 256 .scc_type = MAC_SCC_II,
250 .nubus_type = MAC_NUBUS 257 .nubus_type = MAC_NUBUS,
258 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
251 }, { 259 }, {
252 .ident = MAC_MODEL_IICX, 260 .ident = MAC_MODEL_IICX,
253 .name = "IIcx", 261 .name = "IIcx",
@@ -255,7 +263,8 @@ static struct mac_model mac_data_table[] = {
255 .via_type = MAC_VIA_II, 263 .via_type = MAC_VIA_II,
256 .scsi_type = MAC_SCSI_OLD, 264 .scsi_type = MAC_SCSI_OLD,
257 .scc_type = MAC_SCC_II, 265 .scc_type = MAC_SCC_II,
258 .nubus_type = MAC_NUBUS 266 .nubus_type = MAC_NUBUS,
267 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
259 }, { 268 }, {
260 .ident = MAC_MODEL_SE30, 269 .ident = MAC_MODEL_SE30,
261 .name = "SE/30", 270 .name = "SE/30",
@@ -263,7 +272,8 @@ static struct mac_model mac_data_table[] = {
263 .via_type = MAC_VIA_II, 272 .via_type = MAC_VIA_II,
264 .scsi_type = MAC_SCSI_OLD, 273 .scsi_type = MAC_SCSI_OLD,
265 .scc_type = MAC_SCC_II, 274 .scc_type = MAC_SCC_II,
266 .nubus_type = MAC_NUBUS 275 .nubus_type = MAC_NUBUS,
276 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
267 }, 277 },
268 278
269 /* 279 /*
@@ -280,7 +290,8 @@ static struct mac_model mac_data_table[] = {
280 .via_type = MAC_VIA_IIci, 290 .via_type = MAC_VIA_IIci,
281 .scsi_type = MAC_SCSI_OLD, 291 .scsi_type = MAC_SCSI_OLD,
282 .scc_type = MAC_SCC_II, 292 .scc_type = MAC_SCC_II,
283 .nubus_type = MAC_NUBUS 293 .nubus_type = MAC_NUBUS,
294 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
284 }, { 295 }, {
285 .ident = MAC_MODEL_IIFX, 296 .ident = MAC_MODEL_IIFX,
286 .name = "IIfx", 297 .name = "IIfx",
@@ -288,7 +299,8 @@ static struct mac_model mac_data_table[] = {
288 .via_type = MAC_VIA_IIci, 299 .via_type = MAC_VIA_IIci,
289 .scsi_type = MAC_SCSI_OLD, 300 .scsi_type = MAC_SCSI_OLD,
290 .scc_type = MAC_SCC_IOP, 301 .scc_type = MAC_SCC_IOP,
291 .nubus_type = MAC_NUBUS 302 .nubus_type = MAC_NUBUS,
303 .floppy_type = MAC_FLOPPY_SWIM_IOP
292 }, { 304 }, {
293 .ident = MAC_MODEL_IISI, 305 .ident = MAC_MODEL_IISI,
294 .name = "IIsi", 306 .name = "IIsi",
@@ -296,7 +308,8 @@ static struct mac_model mac_data_table[] = {
296 .via_type = MAC_VIA_IIci, 308 .via_type = MAC_VIA_IIci,
297 .scsi_type = MAC_SCSI_OLD, 309 .scsi_type = MAC_SCSI_OLD,
298 .scc_type = MAC_SCC_II, 310 .scc_type = MAC_SCC_II,
299 .nubus_type = MAC_NUBUS 311 .nubus_type = MAC_NUBUS,
312 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
300 }, { 313 }, {
301 .ident = MAC_MODEL_IIVI, 314 .ident = MAC_MODEL_IIVI,
302 .name = "IIvi", 315 .name = "IIvi",
@@ -304,7 +317,8 @@ static struct mac_model mac_data_table[] = {
304 .via_type = MAC_VIA_IIci, 317 .via_type = MAC_VIA_IIci,
305 .scsi_type = MAC_SCSI_OLD, 318 .scsi_type = MAC_SCSI_OLD,
306 .scc_type = MAC_SCC_II, 319 .scc_type = MAC_SCC_II,
307 .nubus_type = MAC_NUBUS 320 .nubus_type = MAC_NUBUS,
321 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
308 }, { 322 }, {
309 .ident = MAC_MODEL_IIVX, 323 .ident = MAC_MODEL_IIVX,
310 .name = "IIvx", 324 .name = "IIvx",
@@ -312,7 +326,8 @@ static struct mac_model mac_data_table[] = {
312 .via_type = MAC_VIA_IIci, 326 .via_type = MAC_VIA_IIci,
313 .scsi_type = MAC_SCSI_OLD, 327 .scsi_type = MAC_SCSI_OLD,
314 .scc_type = MAC_SCC_II, 328 .scc_type = MAC_SCC_II,
315 .nubus_type = MAC_NUBUS 329 .nubus_type = MAC_NUBUS,
330 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
316 }, 331 },
317 332
318 /* 333 /*
@@ -326,7 +341,8 @@ static struct mac_model mac_data_table[] = {
326 .via_type = MAC_VIA_IIci, 341 .via_type = MAC_VIA_IIci,
327 .scsi_type = MAC_SCSI_OLD, 342 .scsi_type = MAC_SCSI_OLD,
328 .scc_type = MAC_SCC_II, 343 .scc_type = MAC_SCC_II,
329 .nubus_type = MAC_NUBUS 344 .nubus_type = MAC_NUBUS,
345 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
330 }, { 346 }, {
331 .ident = MAC_MODEL_CCL, 347 .ident = MAC_MODEL_CCL,
332 .name = "Color Classic", 348 .name = "Color Classic",
@@ -334,7 +350,9 @@ static struct mac_model mac_data_table[] = {
334 .via_type = MAC_VIA_IIci, 350 .via_type = MAC_VIA_IIci,
335 .scsi_type = MAC_SCSI_OLD, 351 .scsi_type = MAC_SCSI_OLD,
336 .scc_type = MAC_SCC_II, 352 .scc_type = MAC_SCC_II,
337 .nubus_type = MAC_NUBUS}, 353 .nubus_type = MAC_NUBUS,
354 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
355 },
338 356
339 /* 357 /*
340 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi 358 * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi
@@ -347,7 +365,8 @@ static struct mac_model mac_data_table[] = {
347 .via_type = MAC_VIA_IIci, 365 .via_type = MAC_VIA_IIci,
348 .scsi_type = MAC_SCSI_OLD, 366 .scsi_type = MAC_SCSI_OLD,
349 .scc_type = MAC_SCC_II, 367 .scc_type = MAC_SCC_II,
350 .nubus_type = MAC_NUBUS 368 .nubus_type = MAC_NUBUS,
369 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
351 }, { 370 }, {
352 .ident = MAC_MODEL_LCII, 371 .ident = MAC_MODEL_LCII,
353 .name = "LC II", 372 .name = "LC II",
@@ -355,7 +374,8 @@ static struct mac_model mac_data_table[] = {
355 .via_type = MAC_VIA_IIci, 374 .via_type = MAC_VIA_IIci,
356 .scsi_type = MAC_SCSI_OLD, 375 .scsi_type = MAC_SCSI_OLD,
357 .scc_type = MAC_SCC_II, 376 .scc_type = MAC_SCC_II,
358 .nubus_type = MAC_NUBUS 377 .nubus_type = MAC_NUBUS,
378 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
359 }, { 379 }, {
360 .ident = MAC_MODEL_LCIII, 380 .ident = MAC_MODEL_LCIII,
361 .name = "LC III", 381 .name = "LC III",
@@ -363,7 +383,8 @@ static struct mac_model mac_data_table[] = {
363 .via_type = MAC_VIA_IIci, 383 .via_type = MAC_VIA_IIci,
364 .scsi_type = MAC_SCSI_OLD, 384 .scsi_type = MAC_SCSI_OLD,
365 .scc_type = MAC_SCC_II, 385 .scc_type = MAC_SCC_II,
366 .nubus_type = MAC_NUBUS 386 .nubus_type = MAC_NUBUS,
387 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
367 }, 388 },
368 389
369 /* 390 /*
@@ -383,7 +404,8 @@ static struct mac_model mac_data_table[] = {
383 .via_type = MAC_VIA_QUADRA, 404 .via_type = MAC_VIA_QUADRA,
384 .scsi_type = MAC_SCSI_QUADRA, 405 .scsi_type = MAC_SCSI_QUADRA,
385 .scc_type = MAC_SCC_QUADRA, 406 .scc_type = MAC_SCC_QUADRA,
386 .nubus_type = MAC_NUBUS 407 .nubus_type = MAC_NUBUS,
408 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
387 }, { 409 }, {
388 .ident = MAC_MODEL_Q605_ACC, 410 .ident = MAC_MODEL_Q605_ACC,
389 .name = "Quadra 605", 411 .name = "Quadra 605",
@@ -391,7 +413,8 @@ static struct mac_model mac_data_table[] = {
391 .via_type = MAC_VIA_QUADRA, 413 .via_type = MAC_VIA_QUADRA,
392 .scsi_type = MAC_SCSI_QUADRA, 414 .scsi_type = MAC_SCSI_QUADRA,
393 .scc_type = MAC_SCC_QUADRA, 415 .scc_type = MAC_SCC_QUADRA,
394 .nubus_type = MAC_NUBUS 416 .nubus_type = MAC_NUBUS,
417 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
395 }, { 418 }, {
396 .ident = MAC_MODEL_Q610, 419 .ident = MAC_MODEL_Q610,
397 .name = "Quadra 610", 420 .name = "Quadra 610",
@@ -400,7 +423,8 @@ static struct mac_model mac_data_table[] = {
400 .scsi_type = MAC_SCSI_QUADRA, 423 .scsi_type = MAC_SCSI_QUADRA,
401 .scc_type = MAC_SCC_QUADRA, 424 .scc_type = MAC_SCC_QUADRA,
402 .ether_type = MAC_ETHER_SONIC, 425 .ether_type = MAC_ETHER_SONIC,
403 .nubus_type = MAC_NUBUS 426 .nubus_type = MAC_NUBUS,
427 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
404 }, { 428 }, {
405 .ident = MAC_MODEL_Q630, 429 .ident = MAC_MODEL_Q630,
406 .name = "Quadra 630", 430 .name = "Quadra 630",
@@ -410,7 +434,8 @@ static struct mac_model mac_data_table[] = {
410 .ide_type = MAC_IDE_QUADRA, 434 .ide_type = MAC_IDE_QUADRA,
411 .scc_type = MAC_SCC_QUADRA, 435 .scc_type = MAC_SCC_QUADRA,
412 .ether_type = MAC_ETHER_SONIC, 436 .ether_type = MAC_ETHER_SONIC,
413 .nubus_type = MAC_NUBUS 437 .nubus_type = MAC_NUBUS,
438 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
414 }, { 439 }, {
415 .ident = MAC_MODEL_Q650, 440 .ident = MAC_MODEL_Q650,
416 .name = "Quadra 650", 441 .name = "Quadra 650",
@@ -419,7 +444,8 @@ static struct mac_model mac_data_table[] = {
419 .scsi_type = MAC_SCSI_QUADRA, 444 .scsi_type = MAC_SCSI_QUADRA,
420 .scc_type = MAC_SCC_QUADRA, 445 .scc_type = MAC_SCC_QUADRA,
421 .ether_type = MAC_ETHER_SONIC, 446 .ether_type = MAC_ETHER_SONIC,
422 .nubus_type = MAC_NUBUS 447 .nubus_type = MAC_NUBUS,
448 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
423 }, 449 },
424 /* The Q700 does have a NS Sonic */ 450 /* The Q700 does have a NS Sonic */
425 { 451 {
@@ -430,7 +456,8 @@ static struct mac_model mac_data_table[] = {
430 .scsi_type = MAC_SCSI_QUADRA2, 456 .scsi_type = MAC_SCSI_QUADRA2,
431 .scc_type = MAC_SCC_QUADRA, 457 .scc_type = MAC_SCC_QUADRA,
432 .ether_type = MAC_ETHER_SONIC, 458 .ether_type = MAC_ETHER_SONIC,
433 .nubus_type = MAC_NUBUS 459 .nubus_type = MAC_NUBUS,
460 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
434 }, { 461 }, {
435 .ident = MAC_MODEL_Q800, 462 .ident = MAC_MODEL_Q800,
436 .name = "Quadra 800", 463 .name = "Quadra 800",
@@ -439,7 +466,8 @@ static struct mac_model mac_data_table[] = {
439 .scsi_type = MAC_SCSI_QUADRA, 466 .scsi_type = MAC_SCSI_QUADRA,
440 .scc_type = MAC_SCC_QUADRA, 467 .scc_type = MAC_SCC_QUADRA,
441 .ether_type = MAC_ETHER_SONIC, 468 .ether_type = MAC_ETHER_SONIC,
442 .nubus_type = MAC_NUBUS 469 .nubus_type = MAC_NUBUS,
470 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
443 }, { 471 }, {
444 .ident = MAC_MODEL_Q840, 472 .ident = MAC_MODEL_Q840,
445 .name = "Quadra 840AV", 473 .name = "Quadra 840AV",
@@ -448,7 +476,8 @@ static struct mac_model mac_data_table[] = {
448 .scsi_type = MAC_SCSI_QUADRA3, 476 .scsi_type = MAC_SCSI_QUADRA3,
449 .scc_type = MAC_SCC_PSC, 477 .scc_type = MAC_SCC_PSC,
450 .ether_type = MAC_ETHER_MACE, 478 .ether_type = MAC_ETHER_MACE,
451 .nubus_type = MAC_NUBUS 479 .nubus_type = MAC_NUBUS,
480 .floppy_type = MAC_FLOPPY_AV
452 }, { 481 }, {
453 .ident = MAC_MODEL_Q900, 482 .ident = MAC_MODEL_Q900,
454 .name = "Quadra 900", 483 .name = "Quadra 900",
@@ -457,7 +486,8 @@ static struct mac_model mac_data_table[] = {
457 .scsi_type = MAC_SCSI_QUADRA2, 486 .scsi_type = MAC_SCSI_QUADRA2,
458 .scc_type = MAC_SCC_IOP, 487 .scc_type = MAC_SCC_IOP,
459 .ether_type = MAC_ETHER_SONIC, 488 .ether_type = MAC_ETHER_SONIC,
460 .nubus_type = MAC_NUBUS 489 .nubus_type = MAC_NUBUS,
490 .floppy_type = MAC_FLOPPY_SWIM_IOP
461 }, { 491 }, {
462 .ident = MAC_MODEL_Q950, 492 .ident = MAC_MODEL_Q950,
463 .name = "Quadra 950", 493 .name = "Quadra 950",
@@ -466,7 +496,8 @@ static struct mac_model mac_data_table[] = {
466 .scsi_type = MAC_SCSI_QUADRA2, 496 .scsi_type = MAC_SCSI_QUADRA2,
467 .scc_type = MAC_SCC_IOP, 497 .scc_type = MAC_SCC_IOP,
468 .ether_type = MAC_ETHER_SONIC, 498 .ether_type = MAC_ETHER_SONIC,
469 .nubus_type = MAC_NUBUS 499 .nubus_type = MAC_NUBUS,
500 .floppy_type = MAC_FLOPPY_SWIM_IOP
470 }, 501 },
471 502
472 /* 503 /*
@@ -480,7 +511,8 @@ static struct mac_model mac_data_table[] = {
480 .via_type = MAC_VIA_IIci, 511 .via_type = MAC_VIA_IIci,
481 .scsi_type = MAC_SCSI_OLD, 512 .scsi_type = MAC_SCSI_OLD,
482 .scc_type = MAC_SCC_II, 513 .scc_type = MAC_SCC_II,
483 .nubus_type = MAC_NUBUS 514 .nubus_type = MAC_NUBUS,
515 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
484 }, { 516 }, {
485 .ident = MAC_MODEL_P475, 517 .ident = MAC_MODEL_P475,
486 .name = "Performa 475", 518 .name = "Performa 475",
@@ -488,7 +520,8 @@ static struct mac_model mac_data_table[] = {
488 .via_type = MAC_VIA_QUADRA, 520 .via_type = MAC_VIA_QUADRA,
489 .scsi_type = MAC_SCSI_QUADRA, 521 .scsi_type = MAC_SCSI_QUADRA,
490 .scc_type = MAC_SCC_II, 522 .scc_type = MAC_SCC_II,
491 .nubus_type = MAC_NUBUS 523 .nubus_type = MAC_NUBUS,
524 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
492 }, { 525 }, {
493 .ident = MAC_MODEL_P475F, 526 .ident = MAC_MODEL_P475F,
494 .name = "Performa 475", 527 .name = "Performa 475",
@@ -496,7 +529,8 @@ static struct mac_model mac_data_table[] = {
496 .via_type = MAC_VIA_QUADRA, 529 .via_type = MAC_VIA_QUADRA,
497 .scsi_type = MAC_SCSI_QUADRA, 530 .scsi_type = MAC_SCSI_QUADRA,
498 .scc_type = MAC_SCC_II, 531 .scc_type = MAC_SCC_II,
499 .nubus_type = MAC_NUBUS 532 .nubus_type = MAC_NUBUS,
533 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
500 }, { 534 }, {
501 .ident = MAC_MODEL_P520, 535 .ident = MAC_MODEL_P520,
502 .name = "Performa 520", 536 .name = "Performa 520",
@@ -504,7 +538,8 @@ static struct mac_model mac_data_table[] = {
504 .via_type = MAC_VIA_IIci, 538 .via_type = MAC_VIA_IIci,
505 .scsi_type = MAC_SCSI_OLD, 539 .scsi_type = MAC_SCSI_OLD,
506 .scc_type = MAC_SCC_II, 540 .scc_type = MAC_SCC_II,
507 .nubus_type = MAC_NUBUS 541 .nubus_type = MAC_NUBUS,
542 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
508 }, { 543 }, {
509 .ident = MAC_MODEL_P550, 544 .ident = MAC_MODEL_P550,
510 .name = "Performa 550", 545 .name = "Performa 550",
@@ -512,7 +547,8 @@ static struct mac_model mac_data_table[] = {
512 .via_type = MAC_VIA_IIci, 547 .via_type = MAC_VIA_IIci,
513 .scsi_type = MAC_SCSI_OLD, 548 .scsi_type = MAC_SCSI_OLD,
514 .scc_type = MAC_SCC_II, 549 .scc_type = MAC_SCC_II,
515 .nubus_type = MAC_NUBUS 550 .nubus_type = MAC_NUBUS,
551 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
516 }, 552 },
517 /* These have the comm slot, and therefore the possibility of SONIC ethernet */ 553 /* These have the comm slot, and therefore the possibility of SONIC ethernet */
518 { 554 {
@@ -523,7 +559,8 @@ static struct mac_model mac_data_table[] = {
523 .scsi_type = MAC_SCSI_QUADRA, 559 .scsi_type = MAC_SCSI_QUADRA,
524 .scc_type = MAC_SCC_II, 560 .scc_type = MAC_SCC_II,
525 .ether_type = MAC_ETHER_SONIC, 561 .ether_type = MAC_ETHER_SONIC,
526 .nubus_type = MAC_NUBUS 562 .nubus_type = MAC_NUBUS,
563 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
527 }, { 564 }, {
528 .ident = MAC_MODEL_P588, 565 .ident = MAC_MODEL_P588,
529 .name = "Performa 588", 566 .name = "Performa 588",
@@ -533,7 +570,8 @@ static struct mac_model mac_data_table[] = {
533 .ide_type = MAC_IDE_QUADRA, 570 .ide_type = MAC_IDE_QUADRA,
534 .scc_type = MAC_SCC_II, 571 .scc_type = MAC_SCC_II,
535 .ether_type = MAC_ETHER_SONIC, 572 .ether_type = MAC_ETHER_SONIC,
536 .nubus_type = MAC_NUBUS 573 .nubus_type = MAC_NUBUS,
574 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
537 }, { 575 }, {
538 .ident = MAC_MODEL_TV, 576 .ident = MAC_MODEL_TV,
539 .name = "TV", 577 .name = "TV",
@@ -541,7 +579,8 @@ static struct mac_model mac_data_table[] = {
541 .via_type = MAC_VIA_QUADRA, 579 .via_type = MAC_VIA_QUADRA,
542 .scsi_type = MAC_SCSI_OLD, 580 .scsi_type = MAC_SCSI_OLD,
543 .scc_type = MAC_SCC_II, 581 .scc_type = MAC_SCC_II,
544 .nubus_type = MAC_NUBUS 582 .nubus_type = MAC_NUBUS,
583 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
545 }, { 584 }, {
546 .ident = MAC_MODEL_P600, 585 .ident = MAC_MODEL_P600,
547 .name = "Performa 600", 586 .name = "Performa 600",
@@ -549,7 +588,8 @@ static struct mac_model mac_data_table[] = {
549 .via_type = MAC_VIA_IIci, 588 .via_type = MAC_VIA_IIci,
550 .scsi_type = MAC_SCSI_OLD, 589 .scsi_type = MAC_SCSI_OLD,
551 .scc_type = MAC_SCC_II, 590 .scc_type = MAC_SCC_II,
552 .nubus_type = MAC_NUBUS 591 .nubus_type = MAC_NUBUS,
592 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
553 }, 593 },
554 594
555 /* 595 /*
@@ -565,7 +605,8 @@ static struct mac_model mac_data_table[] = {
565 .scsi_type = MAC_SCSI_QUADRA, 605 .scsi_type = MAC_SCSI_QUADRA,
566 .scc_type = MAC_SCC_QUADRA, 606 .scc_type = MAC_SCC_QUADRA,
567 .ether_type = MAC_ETHER_SONIC, 607 .ether_type = MAC_ETHER_SONIC,
568 .nubus_type = MAC_NUBUS 608 .nubus_type = MAC_NUBUS,
609 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
569 }, { 610 }, {
570 .ident = MAC_MODEL_C650, 611 .ident = MAC_MODEL_C650,
571 .name = "Centris 650", 612 .name = "Centris 650",
@@ -574,7 +615,8 @@ static struct mac_model mac_data_table[] = {
574 .scsi_type = MAC_SCSI_QUADRA, 615 .scsi_type = MAC_SCSI_QUADRA,
575 .scc_type = MAC_SCC_QUADRA, 616 .scc_type = MAC_SCC_QUADRA,
576 .ether_type = MAC_ETHER_SONIC, 617 .ether_type = MAC_ETHER_SONIC,
577 .nubus_type = MAC_NUBUS 618 .nubus_type = MAC_NUBUS,
619 .floppy_type = MAC_FLOPPY_SWIM_ADDR1
578 }, { 620 }, {
579 .ident = MAC_MODEL_C660, 621 .ident = MAC_MODEL_C660,
580 .name = "Centris 660AV", 622 .name = "Centris 660AV",
@@ -583,7 +625,8 @@ static struct mac_model mac_data_table[] = {
583 .scsi_type = MAC_SCSI_QUADRA3, 625 .scsi_type = MAC_SCSI_QUADRA3,
584 .scc_type = MAC_SCC_PSC, 626 .scc_type = MAC_SCC_PSC,
585 .ether_type = MAC_ETHER_MACE, 627 .ether_type = MAC_ETHER_MACE,
586 .nubus_type = MAC_NUBUS 628 .nubus_type = MAC_NUBUS,
629 .floppy_type = MAC_FLOPPY_AV
587 }, 630 },
588 631
589 /* 632 /*
@@ -599,7 +642,8 @@ static struct mac_model mac_data_table[] = {
599 .via_type = MAC_VIA_QUADRA, 642 .via_type = MAC_VIA_QUADRA,
600 .scsi_type = MAC_SCSI_OLD, 643 .scsi_type = MAC_SCSI_OLD,
601 .scc_type = MAC_SCC_QUADRA, 644 .scc_type = MAC_SCC_QUADRA,
602 .nubus_type = MAC_NUBUS 645 .nubus_type = MAC_NUBUS,
646 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
603 }, { 647 }, {
604 .ident = MAC_MODEL_PB145, 648 .ident = MAC_MODEL_PB145,
605 .name = "PowerBook 145", 649 .name = "PowerBook 145",
@@ -607,7 +651,8 @@ static struct mac_model mac_data_table[] = {
607 .via_type = MAC_VIA_QUADRA, 651 .via_type = MAC_VIA_QUADRA,
608 .scsi_type = MAC_SCSI_OLD, 652 .scsi_type = MAC_SCSI_OLD,
609 .scc_type = MAC_SCC_QUADRA, 653 .scc_type = MAC_SCC_QUADRA,
610 .nubus_type = MAC_NUBUS 654 .nubus_type = MAC_NUBUS,
655 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
611 }, { 656 }, {
612 .ident = MAC_MODEL_PB150, 657 .ident = MAC_MODEL_PB150,
613 .name = "PowerBook 150", 658 .name = "PowerBook 150",
@@ -616,7 +661,8 @@ static struct mac_model mac_data_table[] = {
616 .scsi_type = MAC_SCSI_OLD, 661 .scsi_type = MAC_SCSI_OLD,
617 .ide_type = MAC_IDE_PB, 662 .ide_type = MAC_IDE_PB,
618 .scc_type = MAC_SCC_QUADRA, 663 .scc_type = MAC_SCC_QUADRA,
619 .nubus_type = MAC_NUBUS 664 .nubus_type = MAC_NUBUS,
665 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
620 }, { 666 }, {
621 .ident = MAC_MODEL_PB160, 667 .ident = MAC_MODEL_PB160,
622 .name = "PowerBook 160", 668 .name = "PowerBook 160",
@@ -624,7 +670,8 @@ static struct mac_model mac_data_table[] = {
624 .via_type = MAC_VIA_QUADRA, 670 .via_type = MAC_VIA_QUADRA,
625 .scsi_type = MAC_SCSI_OLD, 671 .scsi_type = MAC_SCSI_OLD,
626 .scc_type = MAC_SCC_QUADRA, 672 .scc_type = MAC_SCC_QUADRA,
627 .nubus_type = MAC_NUBUS 673 .nubus_type = MAC_NUBUS,
674 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
628 }, { 675 }, {
629 .ident = MAC_MODEL_PB165, 676 .ident = MAC_MODEL_PB165,
630 .name = "PowerBook 165", 677 .name = "PowerBook 165",
@@ -632,7 +679,8 @@ static struct mac_model mac_data_table[] = {
632 .via_type = MAC_VIA_QUADRA, 679 .via_type = MAC_VIA_QUADRA,
633 .scsi_type = MAC_SCSI_OLD, 680 .scsi_type = MAC_SCSI_OLD,
634 .scc_type = MAC_SCC_QUADRA, 681 .scc_type = MAC_SCC_QUADRA,
635 .nubus_type = MAC_NUBUS 682 .nubus_type = MAC_NUBUS,
683 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
636 }, { 684 }, {
637 .ident = MAC_MODEL_PB165C, 685 .ident = MAC_MODEL_PB165C,
638 .name = "PowerBook 165c", 686 .name = "PowerBook 165c",
@@ -640,7 +688,8 @@ static struct mac_model mac_data_table[] = {
640 .via_type = MAC_VIA_QUADRA, 688 .via_type = MAC_VIA_QUADRA,
641 .scsi_type = MAC_SCSI_OLD, 689 .scsi_type = MAC_SCSI_OLD,
642 .scc_type = MAC_SCC_QUADRA, 690 .scc_type = MAC_SCC_QUADRA,
643 .nubus_type = MAC_NUBUS 691 .nubus_type = MAC_NUBUS,
692 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
644 }, { 693 }, {
645 .ident = MAC_MODEL_PB170, 694 .ident = MAC_MODEL_PB170,
646 .name = "PowerBook 170", 695 .name = "PowerBook 170",
@@ -648,7 +697,8 @@ static struct mac_model mac_data_table[] = {
648 .via_type = MAC_VIA_QUADRA, 697 .via_type = MAC_VIA_QUADRA,
649 .scsi_type = MAC_SCSI_OLD, 698 .scsi_type = MAC_SCSI_OLD,
650 .scc_type = MAC_SCC_QUADRA, 699 .scc_type = MAC_SCC_QUADRA,
651 .nubus_type = MAC_NUBUS 700 .nubus_type = MAC_NUBUS,
701 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
652 }, { 702 }, {
653 .ident = MAC_MODEL_PB180, 703 .ident = MAC_MODEL_PB180,
654 .name = "PowerBook 180", 704 .name = "PowerBook 180",
@@ -656,7 +706,8 @@ static struct mac_model mac_data_table[] = {
656 .via_type = MAC_VIA_QUADRA, 706 .via_type = MAC_VIA_QUADRA,
657 .scsi_type = MAC_SCSI_OLD, 707 .scsi_type = MAC_SCSI_OLD,
658 .scc_type = MAC_SCC_QUADRA, 708 .scc_type = MAC_SCC_QUADRA,
659 .nubus_type = MAC_NUBUS 709 .nubus_type = MAC_NUBUS,
710 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
660 }, { 711 }, {
661 .ident = MAC_MODEL_PB180C, 712 .ident = MAC_MODEL_PB180C,
662 .name = "PowerBook 180c", 713 .name = "PowerBook 180c",
@@ -664,7 +715,8 @@ static struct mac_model mac_data_table[] = {
664 .via_type = MAC_VIA_QUADRA, 715 .via_type = MAC_VIA_QUADRA,
665 .scsi_type = MAC_SCSI_OLD, 716 .scsi_type = MAC_SCSI_OLD,
666 .scc_type = MAC_SCC_QUADRA, 717 .scc_type = MAC_SCC_QUADRA,
667 .nubus_type = MAC_NUBUS 718 .nubus_type = MAC_NUBUS,
719 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
668 }, { 720 }, {
669 .ident = MAC_MODEL_PB190, 721 .ident = MAC_MODEL_PB190,
670 .name = "PowerBook 190", 722 .name = "PowerBook 190",
@@ -673,7 +725,8 @@ static struct mac_model mac_data_table[] = {
673 .scsi_type = MAC_SCSI_OLD, 725 .scsi_type = MAC_SCSI_OLD,
674 .ide_type = MAC_IDE_BABOON, 726 .ide_type = MAC_IDE_BABOON,
675 .scc_type = MAC_SCC_QUADRA, 727 .scc_type = MAC_SCC_QUADRA,
676 .nubus_type = MAC_NUBUS 728 .nubus_type = MAC_NUBUS,
729 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
677 }, { 730 }, {
678 .ident = MAC_MODEL_PB520, 731 .ident = MAC_MODEL_PB520,
679 .name = "PowerBook 520", 732 .name = "PowerBook 520",
@@ -682,7 +735,8 @@ static struct mac_model mac_data_table[] = {
682 .scsi_type = MAC_SCSI_OLD, 735 .scsi_type = MAC_SCSI_OLD,
683 .scc_type = MAC_SCC_QUADRA, 736 .scc_type = MAC_SCC_QUADRA,
684 .ether_type = MAC_ETHER_SONIC, 737 .ether_type = MAC_ETHER_SONIC,
685 .nubus_type = MAC_NUBUS 738 .nubus_type = MAC_NUBUS,
739 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
686 }, 740 },
687 741
688 /* 742 /*
@@ -702,7 +756,8 @@ static struct mac_model mac_data_table[] = {
702 .via_type = MAC_VIA_IIci, 756 .via_type = MAC_VIA_IIci,
703 .scsi_type = MAC_SCSI_OLD, 757 .scsi_type = MAC_SCSI_OLD,
704 .scc_type = MAC_SCC_QUADRA, 758 .scc_type = MAC_SCC_QUADRA,
705 .nubus_type = MAC_NUBUS 759 .nubus_type = MAC_NUBUS,
760 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
706 }, { 761 }, {
707 .ident = MAC_MODEL_PB230, 762 .ident = MAC_MODEL_PB230,
708 .name = "PowerBook Duo 230", 763 .name = "PowerBook Duo 230",
@@ -710,7 +765,8 @@ static struct mac_model mac_data_table[] = {
710 .via_type = MAC_VIA_IIci, 765 .via_type = MAC_VIA_IIci,
711 .scsi_type = MAC_SCSI_OLD, 766 .scsi_type = MAC_SCSI_OLD,
712 .scc_type = MAC_SCC_QUADRA, 767 .scc_type = MAC_SCC_QUADRA,
713 .nubus_type = MAC_NUBUS 768 .nubus_type = MAC_NUBUS,
769 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
714 }, { 770 }, {
715 .ident = MAC_MODEL_PB250, 771 .ident = MAC_MODEL_PB250,
716 .name = "PowerBook Duo 250", 772 .name = "PowerBook Duo 250",
@@ -718,7 +774,8 @@ static struct mac_model mac_data_table[] = {
718 .via_type = MAC_VIA_IIci, 774 .via_type = MAC_VIA_IIci,
719 .scsi_type = MAC_SCSI_OLD, 775 .scsi_type = MAC_SCSI_OLD,
720 .scc_type = MAC_SCC_QUADRA, 776 .scc_type = MAC_SCC_QUADRA,
721 .nubus_type = MAC_NUBUS 777 .nubus_type = MAC_NUBUS,
778 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
722 }, { 779 }, {
723 .ident = MAC_MODEL_PB270C, 780 .ident = MAC_MODEL_PB270C,
724 .name = "PowerBook Duo 270c", 781 .name = "PowerBook Duo 270c",
@@ -726,7 +783,8 @@ static struct mac_model mac_data_table[] = {
726 .via_type = MAC_VIA_IIci, 783 .via_type = MAC_VIA_IIci,
727 .scsi_type = MAC_SCSI_OLD, 784 .scsi_type = MAC_SCSI_OLD,
728 .scc_type = MAC_SCC_QUADRA, 785 .scc_type = MAC_SCC_QUADRA,
729 .nubus_type = MAC_NUBUS 786 .nubus_type = MAC_NUBUS,
787 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
730 }, { 788 }, {
731 .ident = MAC_MODEL_PB280, 789 .ident = MAC_MODEL_PB280,
732 .name = "PowerBook Duo 280", 790 .name = "PowerBook Duo 280",
@@ -734,7 +792,8 @@ static struct mac_model mac_data_table[] = {
734 .via_type = MAC_VIA_IIci, 792 .via_type = MAC_VIA_IIci,
735 .scsi_type = MAC_SCSI_OLD, 793 .scsi_type = MAC_SCSI_OLD,
736 .scc_type = MAC_SCC_QUADRA, 794 .scc_type = MAC_SCC_QUADRA,
737 .nubus_type = MAC_NUBUS 795 .nubus_type = MAC_NUBUS,
796 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
738 }, { 797 }, {
739 .ident = MAC_MODEL_PB280C, 798 .ident = MAC_MODEL_PB280C,
740 .name = "PowerBook Duo 280c", 799 .name = "PowerBook Duo 280c",
@@ -742,7 +801,8 @@ static struct mac_model mac_data_table[] = {
742 .via_type = MAC_VIA_IIci, 801 .via_type = MAC_VIA_IIci,
743 .scsi_type = MAC_SCSI_OLD, 802 .scsi_type = MAC_SCSI_OLD,
744 .scc_type = MAC_SCC_QUADRA, 803 .scc_type = MAC_SCC_QUADRA,
745 .nubus_type = MAC_NUBUS 804 .nubus_type = MAC_NUBUS,
805 .floppy_type = MAC_FLOPPY_SWIM_ADDR2
746 }, 806 },
747 807
748 /* 808 /*
@@ -815,3 +875,42 @@ static void mac_get_model(char *str)
815 strcpy(str, "Macintosh "); 875 strcpy(str, "Macintosh ");
816 strcat(str, macintosh_config->name); 876 strcat(str, macintosh_config->name);
817} 877}
878
879static struct resource swim_resources[1];
880
881static struct platform_device swim_device = {
882 .name = "swim",
883 .id = -1,
884 .num_resources = ARRAY_SIZE(swim_resources),
885 .resource = swim_resources,
886};
887
888static struct platform_device *mac_platform_devices[] __initdata = {
889 &swim_device
890};
891
892int __init mac_platform_init(void)
893{
894 u8 *swim_base;
895
896 switch (macintosh_config->floppy_type) {
897 case MAC_FLOPPY_SWIM_ADDR1:
898 swim_base = (u8 *)(VIA1_BASE + 0x1E000);
899 break;
900 case MAC_FLOPPY_SWIM_ADDR2:
901 swim_base = (u8 *)(VIA1_BASE + 0x16000);
902 break;
903 default:
904 return 0;
905 }
906
907 swim_resources[0].name = "swim-regs";
908 swim_resources[0].start = (resource_size_t)swim_base;
909 swim_resources[0].end = (resource_size_t)(swim_base + SWIM_IO_SIZE);
910 swim_resources[0].flags = IORESOURCE_MEM;
911
912 return platform_add_devices(mac_platform_devices,
913 ARRAY_SIZE(mac_platform_devices));
914}
915
916arch_initcall(mac_platform_init);
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index 7d97ba54536e..11bce3cb6482 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -645,3 +645,12 @@ int via_irq_pending(int irq)
645 } 645 }
646 return 0; 646 return 0;
647} 647}
648
649void via1_set_head(int head)
650{
651 if (head == 0)
652 via1[vBufA] &= ~VIA1A_vHeadSel;
653 else
654 via1[vBufA] |= VIA1A_vHeadSel;
655}
656EXPORT_SYMBOL(via1_set_head);
diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c
index 06d887cdcbfb..855fc6a79d72 100644
--- a/arch/m68knommu/platform/520x/config.c
+++ b/arch/m68knommu/platform/520x/config.c
@@ -49,8 +49,39 @@ static struct platform_device m520x_uart = {
49 .dev.platform_data = m520x_uart_platform, 49 .dev.platform_data = m520x_uart_platform,
50}; 50};
51 51
52static struct resource m520x_fec_resources[] = {
53 {
54 .start = MCF_MBAR + 0x30000,
55 .end = MCF_MBAR + 0x30000 + 0x7ff,
56 .flags = IORESOURCE_MEM,
57 },
58 {
59 .start = 64 + 36,
60 .end = 64 + 36,
61 .flags = IORESOURCE_IRQ,
62 },
63 {
64 .start = 64 + 40,
65 .end = 64 + 40,
66 .flags = IORESOURCE_IRQ,
67 },
68 {
69 .start = 64 + 42,
70 .end = 64 + 42,
71 .flags = IORESOURCE_IRQ,
72 },
73};
74
75static struct platform_device m520x_fec = {
76 .name = "fec",
77 .id = 0,
78 .num_resources = ARRAY_SIZE(m520x_fec_resources),
79 .resource = m520x_fec_resources,
80};
81
52static struct platform_device *m520x_devices[] __initdata = { 82static struct platform_device *m520x_devices[] __initdata = {
53 &m520x_uart, 83 &m520x_uart,
84 &m520x_fec,
54}; 85};
55 86
56/***************************************************************************/ 87/***************************************************************************/
@@ -103,6 +134,30 @@ static void __init m520x_uarts_init(void)
103 134
104/***************************************************************************/ 135/***************************************************************************/
105 136
137static void __init m520x_fec_init(void)
138{
139 u32 imr;
140 u8 v;
141
142 /* Unmask FEC interrupts at ColdFire interrupt controller */
143 writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 36);
144 writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 40);
145 writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 42);
146
147 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
148 imr &= ~0x0001FFF0;
149 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
150
151 /* Set multi-function pins to ethernet mode */
152 v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FEC);
153 writeb(v | 0xf0, MCF_IPSBAR + MCF_GPIO_PAR_FEC);
154
155 v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FECI2C);
156 writeb(v | 0x0f, MCF_IPSBAR + MCF_GPIO_PAR_FECI2C);
157}
158
159/***************************************************************************/
160
106/* 161/*
107 * Program the vector to be an auto-vectored. 162 * Program the vector to be an auto-vectored.
108 */ 163 */
@@ -118,6 +173,7 @@ void __init config_BSP(char *commandp, int size)
118{ 173{
119 mach_reset = coldfire_reset; 174 mach_reset = coldfire_reset;
120 m520x_uarts_init(); 175 m520x_uarts_init();
176 m520x_fec_init();
121} 177}
122 178
123/***************************************************************************/ 179/***************************************************************************/
diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c
index 13f02611ea23..74133f27b30c 100644
--- a/arch/m68knommu/platform/523x/config.c
+++ b/arch/m68knommu/platform/523x/config.c
@@ -50,8 +50,39 @@ static struct platform_device m523x_uart = {
50 .dev.platform_data = m523x_uart_platform, 50 .dev.platform_data = m523x_uart_platform,
51}; 51};
52 52
53static struct resource m523x_fec_resources[] = {
54 {
55 .start = MCF_MBAR + 0x1000,
56 .end = MCF_MBAR + 0x1000 + 0x7ff,
57 .flags = IORESOURCE_MEM,
58 },
59 {
60 .start = 64 + 23,
61 .end = 64 + 23,
62 .flags = IORESOURCE_IRQ,
63 },
64 {
65 .start = 64 + 27,
66 .end = 64 + 27,
67 .flags = IORESOURCE_IRQ,
68 },
69 {
70 .start = 64 + 29,
71 .end = 64 + 29,
72 .flags = IORESOURCE_IRQ,
73 },
74};
75
76static struct platform_device m523x_fec = {
77 .name = "fec",
78 .id = 0,
79 .num_resources = ARRAY_SIZE(m523x_fec_resources),
80 .resource = m523x_fec_resources,
81};
82
53static struct platform_device *m523x_devices[] __initdata = { 83static struct platform_device *m523x_devices[] __initdata = {
54 &m523x_uart, 84 &m523x_uart,
85 &m523x_fec,
55}; 86};
56 87
57/***************************************************************************/ 88/***************************************************************************/
@@ -83,6 +114,25 @@ static void __init m523x_uarts_init(void)
83 114
84/***************************************************************************/ 115/***************************************************************************/
85 116
117static void __init m523x_fec_init(void)
118{
119 u32 imr;
120
121 /* Unmask FEC interrupts at ColdFire interrupt controller */
122 writeb(0x28, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 23);
123 writeb(0x27, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 27);
124 writeb(0x26, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 29);
125
126 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
127 imr &= ~0xf;
128 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
129 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
130 imr &= ~0xff800001;
131 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
132}
133
134/***************************************************************************/
135
86void mcf_disableall(void) 136void mcf_disableall(void)
87{ 137{
88 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff; 138 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
@@ -103,6 +153,7 @@ void __init config_BSP(char *commandp, int size)
103 mcf_disableall(); 153 mcf_disableall();
104 mach_reset = coldfire_reset; 154 mach_reset = coldfire_reset;
105 m523x_uarts_init(); 155 m523x_uarts_init();
156 m523x_fec_init();
106} 157}
107 158
108/***************************************************************************/ 159/***************************************************************************/
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index 230bae691a7f..e049245f4092 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/config.c
@@ -55,8 +55,39 @@ static struct platform_device m5272_uart = {
55 .dev.platform_data = m5272_uart_platform, 55 .dev.platform_data = m5272_uart_platform,
56}; 56};
57 57
58static struct resource m5272_fec_resources[] = {
59 {
60 .start = MCF_MBAR + 0x840,
61 .end = MCF_MBAR + 0x840 + 0x1cf,
62 .flags = IORESOURCE_MEM,
63 },
64 {
65 .start = 86,
66 .end = 86,
67 .flags = IORESOURCE_IRQ,
68 },
69 {
70 .start = 87,
71 .end = 87,
72 .flags = IORESOURCE_IRQ,
73 },
74 {
75 .start = 88,
76 .end = 88,
77 .flags = IORESOURCE_IRQ,
78 },
79};
80
81static struct platform_device m5272_fec = {
82 .name = "fec",
83 .id = 0,
84 .num_resources = ARRAY_SIZE(m5272_fec_resources),
85 .resource = m5272_fec_resources,
86};
87
58static struct platform_device *m5272_devices[] __initdata = { 88static struct platform_device *m5272_devices[] __initdata = {
59 &m5272_uart, 89 &m5272_uart,
90 &m5272_fec,
60}; 91};
61 92
62/***************************************************************************/ 93/***************************************************************************/
@@ -91,6 +122,22 @@ static void __init m5272_uarts_init(void)
91 122
92/***************************************************************************/ 123/***************************************************************************/
93 124
125static void __init m5272_fec_init(void)
126{
127 u32 imr;
128
129 /* Unmask FEC interrupts at ColdFire interrupt controller */
130 imr = readl(MCF_MBAR + MCFSIM_ICR3);
131 imr = (imr & ~0x00000fff) | 0x00000ddd;
132 writel(imr, MCF_MBAR + MCFSIM_ICR3);
133
134 imr = readl(MCF_MBAR + MCFSIM_ICR1);
135 imr = (imr & ~0x0f000000) | 0x0d000000;
136 writel(imr, MCF_MBAR + MCFSIM_ICR1);
137}
138
139/***************************************************************************/
140
94void mcf_disableall(void) 141void mcf_disableall(void)
95{ 142{
96 volatile unsigned long *icrp; 143 volatile unsigned long *icrp;
@@ -155,6 +202,7 @@ void __init config_BSP(char *commandp, int size)
155static int __init init_BSP(void) 202static int __init init_BSP(void)
156{ 203{
157 m5272_uarts_init(); 204 m5272_uarts_init();
205 m5272_fec_init();
158 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices)); 206 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
159 return 0; 207 return 0;
160} 208}
diff --git a/arch/m68knommu/platform/527x/config.c b/arch/m68knommu/platform/527x/config.c
index 73cd1aef4a90..49343fb157b0 100644
--- a/arch/m68knommu/platform/527x/config.c
+++ b/arch/m68knommu/platform/527x/config.c
@@ -50,8 +50,73 @@ static struct platform_device m527x_uart = {
50 .dev.platform_data = m527x_uart_platform, 50 .dev.platform_data = m527x_uart_platform,
51}; 51};
52 52
53static struct resource m527x_fec0_resources[] = {
54 {
55 .start = MCF_MBAR + 0x1000,
56 .end = MCF_MBAR + 0x1000 + 0x7ff,
57 .flags = IORESOURCE_MEM,
58 },
59 {
60 .start = 64 + 23,
61 .end = 64 + 23,
62 .flags = IORESOURCE_IRQ,
63 },
64 {
65 .start = 64 + 27,
66 .end = 64 + 27,
67 .flags = IORESOURCE_IRQ,
68 },
69 {
70 .start = 64 + 29,
71 .end = 64 + 29,
72 .flags = IORESOURCE_IRQ,
73 },
74};
75
76static struct resource m527x_fec1_resources[] = {
77 {
78 .start = MCF_MBAR + 0x1800,
79 .end = MCF_MBAR + 0x1800 + 0x7ff,
80 .flags = IORESOURCE_MEM,
81 },
82 {
83 .start = 128 + 23,
84 .end = 128 + 23,
85 .flags = IORESOURCE_IRQ,
86 },
87 {
88 .start = 128 + 27,
89 .end = 128 + 27,
90 .flags = IORESOURCE_IRQ,
91 },
92 {
93 .start = 128 + 29,
94 .end = 128 + 29,
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99static struct platform_device m527x_fec[] = {
100 {
101 .name = "fec",
102 .id = 0,
103 .num_resources = ARRAY_SIZE(m527x_fec0_resources),
104 .resource = m527x_fec0_resources,
105 },
106 {
107 .name = "fec",
108 .id = 1,
109 .num_resources = ARRAY_SIZE(m527x_fec1_resources),
110 .resource = m527x_fec1_resources,
111 },
112};
113
53static struct platform_device *m527x_devices[] __initdata = { 114static struct platform_device *m527x_devices[] __initdata = {
54 &m527x_uart, 115 &m527x_uart,
116 &m527x_fec[0],
117#ifdef CONFIG_FEC2
118 &m527x_fec[1],
119#endif
55}; 120};
56 121
57/***************************************************************************/ 122/***************************************************************************/
@@ -97,6 +162,51 @@ static void __init m527x_uarts_init(void)
97 162
98/***************************************************************************/ 163/***************************************************************************/
99 164
165static void __init m527x_fec_irq_init(int nr)
166{
167 unsigned long base;
168 u32 imr;
169
170 base = MCF_IPSBAR + (nr ? MCFICM_INTC1 : MCFICM_INTC0);
171
172 writeb(0x28, base + MCFINTC_ICR0 + 23);
173 writeb(0x27, base + MCFINTC_ICR0 + 27);
174 writeb(0x26, base + MCFINTC_ICR0 + 29);
175
176 imr = readl(base + MCFINTC_IMRH);
177 imr &= ~0xf;
178 writel(imr, base + MCFINTC_IMRH);
179 imr = readl(base + MCFINTC_IMRL);
180 imr &= ~0xff800001;
181 writel(imr, base + MCFINTC_IMRL);
182}
183
184static void __init m527x_fec_init(void)
185{
186 u16 par;
187 u8 v;
188
189 m527x_fec_irq_init(0);
190
191 /* Set multi-function pins to ethernet mode for fec0 */
192 par = readw(MCF_IPSBAR + 0x100082);
193 writew(par | 0xf00, MCF_IPSBAR + 0x100082);
194 v = readb(MCF_IPSBAR + 0x100078);
195 writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
196
197#ifdef CONFIG_FEC2
198 m527x_fec_irq_init(1);
199
200 /* Set multi-function pins to ethernet mode for fec1 */
201 par = readw(MCF_IPSBAR + 0x100082);
202 writew(par | 0xa0, MCF_IPSBAR + 0x100082);
203 v = readb(MCF_IPSBAR + 0x100079);
204 writeb(v | 0xc0, MCF_IPSBAR + 0x100079);
205#endif
206}
207
208/***************************************************************************/
209
100void mcf_disableall(void) 210void mcf_disableall(void)
101{ 211{
102 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff; 212 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
@@ -116,13 +226,14 @@ void __init config_BSP(char *commandp, int size)
116{ 226{
117 mcf_disableall(); 227 mcf_disableall();
118 mach_reset = coldfire_reset; 228 mach_reset = coldfire_reset;
229 m527x_uarts_init();
230 m527x_fec_init();
119} 231}
120 232
121/***************************************************************************/ 233/***************************************************************************/
122 234
123static int __init init_BSP(void) 235static int __init init_BSP(void)
124{ 236{
125 m527x_uarts_init();
126 platform_add_devices(m527x_devices, ARRAY_SIZE(m527x_devices)); 237 platform_add_devices(m527x_devices, ARRAY_SIZE(m527x_devices));
127 return 0; 238 return 0;
128} 239}
diff --git a/arch/m68knommu/platform/528x/config.c b/arch/m68knommu/platform/528x/config.c
index 44baeb225dc7..bee526f4d1af 100644
--- a/arch/m68knommu/platform/528x/config.c
+++ b/arch/m68knommu/platform/528x/config.c
@@ -57,8 +57,40 @@ static struct platform_device m528x_uart = {
57 .dev.platform_data = m528x_uart_platform, 57 .dev.platform_data = m528x_uart_platform,
58}; 58};
59 59
60static struct resource m528x_fec_resources[] = {
61 {
62 .start = MCF_MBAR + 0x1000,
63 .end = MCF_MBAR + 0x1000 + 0x7ff,
64 .flags = IORESOURCE_MEM,
65 },
66 {
67 .start = 64 + 23,
68 .end = 64 + 23,
69 .flags = IORESOURCE_IRQ,
70 },
71 {
72 .start = 64 + 27,
73 .end = 64 + 27,
74 .flags = IORESOURCE_IRQ,
75 },
76 {
77 .start = 64 + 29,
78 .end = 64 + 29,
79 .flags = IORESOURCE_IRQ,
80 },
81};
82
83static struct platform_device m528x_fec = {
84 .name = "fec",
85 .id = 0,
86 .num_resources = ARRAY_SIZE(m528x_fec_resources),
87 .resource = m528x_fec_resources,
88};
89
90
60static struct platform_device *m528x_devices[] __initdata = { 91static struct platform_device *m528x_devices[] __initdata = {
61 &m528x_uart, 92 &m528x_uart,
93 &m528x_fec,
62}; 94};
63 95
64/***************************************************************************/ 96/***************************************************************************/
@@ -99,6 +131,31 @@ static void __init m528x_uarts_init(void)
99 131
100/***************************************************************************/ 132/***************************************************************************/
101 133
134static void __init m528x_fec_init(void)
135{
136 u32 imr;
137 u16 v16;
138
139 /* Unmask FEC interrupts at ColdFire interrupt controller */
140 writeb(0x28, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 23);
141 writeb(0x27, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 27);
142 writeb(0x26, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 29);
143
144 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
145 imr &= ~0xf;
146 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH);
147 imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
148 imr &= ~0xff800001;
149 writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
150
151 /* Set multi-function pins to ethernet mode for fec0 */
152 v16 = readw(MCF_IPSBAR + 0x100056);
153 writew(v16 | 0xf00, MCF_IPSBAR + 0x100056);
154 writeb(0xc0, MCF_IPSBAR + 0x100058);
155}
156
157/***************************************************************************/
158
102void mcf_disableall(void) 159void mcf_disableall(void)
103{ 160{
104 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff; 161 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
@@ -158,6 +215,7 @@ void __init config_BSP(char *commandp, int size)
158static int __init init_BSP(void) 215static int __init init_BSP(void)
159{ 216{
160 m528x_uarts_init(); 217 m528x_uarts_init();
218 m528x_fec_init();
161 platform_add_devices(m528x_devices, ARRAY_SIZE(m528x_devices)); 219 platform_add_devices(m528x_devices, ARRAY_SIZE(m528x_devices));
162 return 0; 220 return 0;
163} 221}
diff --git a/arch/m68knommu/platform/532x/config.c b/arch/m68knommu/platform/532x/config.c
index a347623d6ee6..591f2f801134 100644
--- a/arch/m68knommu/platform/532x/config.c
+++ b/arch/m68knommu/platform/532x/config.c
@@ -61,8 +61,38 @@ static struct platform_device m532x_uart = {
61 .dev.platform_data = m532x_uart_platform, 61 .dev.platform_data = m532x_uart_platform,
62}; 62};
63 63
64static struct resource m532x_fec_resources[] = {
65 {
66 .start = 0xfc030000,
67 .end = 0xfc0307ff,
68 .flags = IORESOURCE_MEM,
69 },
70 {
71 .start = 64 + 36,
72 .end = 64 + 36,
73 .flags = IORESOURCE_IRQ,
74 },
75 {
76 .start = 64 + 40,
77 .end = 64 + 40,
78 .flags = IORESOURCE_IRQ,
79 },
80 {
81 .start = 64 + 42,
82 .end = 64 + 42,
83 .flags = IORESOURCE_IRQ,
84 },
85};
86
87static struct platform_device m532x_fec = {
88 .name = "fec",
89 .id = 0,
90 .num_resources = ARRAY_SIZE(m532x_fec_resources),
91 .resource = m532x_fec_resources,
92};
64static struct platform_device *m532x_devices[] __initdata = { 93static struct platform_device *m532x_devices[] __initdata = {
65 &m532x_uart, 94 &m532x_uart,
95 &m532x_fec,
66}; 96};
67 97
68/***************************************************************************/ 98/***************************************************************************/
@@ -93,6 +123,24 @@ static void __init m532x_uarts_init(void)
93 for (line = 0; (line < nrlines); line++) 123 for (line = 0; (line < nrlines); line++)
94 m532x_uart_init_line(line, m532x_uart_platform[line].irq); 124 m532x_uart_init_line(line, m532x_uart_platform[line].irq);
95} 125}
126/***************************************************************************/
127
128static void __init m532x_fec_init(void)
129{
130 /* Unmask FEC interrupts at ColdFire interrupt controller */
131 MCF_INTC0_ICR36 = 0x2;
132 MCF_INTC0_ICR40 = 0x2;
133 MCF_INTC0_ICR42 = 0x2;
134
135 MCF_INTC0_IMRH &= ~(MCF_INTC_IMRH_INT_MASK36 |
136 MCF_INTC_IMRH_INT_MASK40 | MCF_INTC_IMRH_INT_MASK42);
137
138 /* Set multi-function pins to ethernet mode for fec0 */
139 MCF_GPIO_PAR_FECI2C |= (MCF_GPIO_PAR_FECI2C_PAR_MDC_EMDC |
140 MCF_GPIO_PAR_FECI2C_PAR_MDIO_EMDIO);
141 MCF_GPIO_PAR_FEC = (MCF_GPIO_PAR_FEC_PAR_FEC_7W_FEC |
142 MCF_GPIO_PAR_FEC_PAR_FEC_MII_FEC);
143}
96 144
97/***************************************************************************/ 145/***************************************************************************/
98 146
@@ -150,6 +198,7 @@ void __init config_BSP(char *commandp, int size)
150static int __init init_BSP(void) 198static int __init init_BSP(void)
151{ 199{
152 m532x_uarts_init(); 200 m532x_uarts_init();
201 m532x_fec_init();
153 platform_add_devices(m532x_devices, ARRAY_SIZE(m532x_devices)); 202 platform_add_devices(m532x_devices, ARRAY_SIZE(m532x_devices));
154 return 0; 203 return 0;
155} 204}
diff --git a/arch/mips/basler/excite/excite_iodev.c b/arch/mips/basler/excite/excite_iodev.c
index a1e3526b4a94..dfbfd7e2ac08 100644
--- a/arch/mips/basler/excite/excite_iodev.c
+++ b/arch/mips/basler/excite/excite_iodev.c
@@ -33,8 +33,8 @@
33 33
34 34
35static const struct resource *iodev_get_resource(struct platform_device *, const char *, unsigned int); 35static const struct resource *iodev_get_resource(struct platform_device *, const char *, unsigned int);
36static int __init iodev_probe(struct device *); 36static int __init iodev_probe(struct platform_device *);
37static int __exit iodev_remove(struct device *); 37static int __exit iodev_remove(struct platform_device *);
38static int iodev_open(struct inode *, struct file *); 38static int iodev_open(struct inode *, struct file *);
39static int iodev_release(struct inode *, struct file *); 39static int iodev_release(struct inode *, struct file *);
40static ssize_t iodev_read(struct file *, char __user *, size_t s, loff_t *); 40static ssize_t iodev_read(struct file *, char __user *, size_t s, loff_t *);
@@ -65,13 +65,13 @@ static struct miscdevice miscdev =
65 .fops = &fops 65 .fops = &fops
66}; 66};
67 67
68static struct device_driver iodev_driver = 68static struct platform_driver iodev_driver = {
69{ 69 .driver = {
70 .name = (char *) iodev_name, 70 .name = iodev_name,
71 .bus = &platform_bus_type, 71 .owner = THIS_MODULE,
72 .owner = THIS_MODULE, 72 },
73 .probe = iodev_probe, 73 .probe = iodev_probe,
74 .remove = __exit_p(iodev_remove) 74 .remove = __devexit_p(iodev_remove),
75}; 75};
76 76
77 77
@@ -89,11 +89,10 @@ iodev_get_resource(struct platform_device *pdv, const char *name,
89 89
90 90
91/* No hotplugging on the platform bus - use __init */ 91/* No hotplugging on the platform bus - use __init */
92static int __init iodev_probe(struct device *dev) 92static int __init iodev_probe(struct platform_device *dev)
93{ 93{
94 struct platform_device * const pdv = to_platform_device(dev);
95 const struct resource * const ri = 94 const struct resource * const ri =
96 iodev_get_resource(pdv, IODEV_RESOURCE_IRQ, IORESOURCE_IRQ); 95 iodev_get_resource(dev, IODEV_RESOURCE_IRQ, IORESOURCE_IRQ);
97 96
98 if (unlikely(!ri)) 97 if (unlikely(!ri))
99 return -ENXIO; 98 return -ENXIO;
@@ -104,7 +103,7 @@ static int __init iodev_probe(struct device *dev)
104 103
105 104
106 105
107static int __exit iodev_remove(struct device *dev) 106static int __exit iodev_remove(struct platform_device *dev)
108{ 107{
109 return misc_deregister(&miscdev); 108 return misc_deregister(&miscdev);
110} 109}
@@ -160,14 +159,14 @@ static irqreturn_t iodev_irqhdl(int irq, void *ctxt)
160 159
161static int __init iodev_init_module(void) 160static int __init iodev_init_module(void)
162{ 161{
163 return driver_register(&iodev_driver); 162 return platform_driver_register(&iodev_driver);
164} 163}
165 164
166 165
167 166
168static void __exit iodev_cleanup_module(void) 167static void __exit iodev_cleanup_module(void)
169{ 168{
170 driver_unregister(&iodev_driver); 169 platform_driver_unregister(&iodev_driver);
171} 170}
172 171
173module_init(iodev_init_module); 172module_init(iodev_init_module);
diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h
index abc62aa744ac..3214ade02d10 100644
--- a/arch/mips/include/asm/irq.h
+++ b/arch/mips/include/asm/irq.h
@@ -66,7 +66,7 @@ extern void smtc_forward_irq(unsigned int irq);
66 */ 66 */
67#define IRQ_AFFINITY_HOOK(irq) \ 67#define IRQ_AFFINITY_HOOK(irq) \
68do { \ 68do { \
69 if (!cpu_isset(smp_processor_id(), irq_desc[irq].affinity)) { \ 69 if (!cpumask_test_cpu(smp_processor_id(), irq_desc[irq].affinity)) {\
70 smtc_forward_irq(irq); \ 70 smtc_forward_irq(irq); \
71 irq_exit(); \ 71 irq_exit(); \
72 return; \ 72 return; \
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 0417516503f6..526f327475ce 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -1391,11 +1391,11 @@ static inline void tlb_write_random(void)
1391static inline unsigned int \ 1391static inline unsigned int \
1392set_c0_##name(unsigned int set) \ 1392set_c0_##name(unsigned int set) \
1393{ \ 1393{ \
1394 unsigned int res; \ 1394 unsigned int res, new; \
1395 \ 1395 \
1396 res = read_c0_##name(); \ 1396 res = read_c0_##name(); \
1397 res |= set; \ 1397 new = res | set; \
1398 write_c0_##name(res); \ 1398 write_c0_##name(new); \
1399 \ 1399 \
1400 return res; \ 1400 return res; \
1401} \ 1401} \
@@ -1403,24 +1403,24 @@ set_c0_##name(unsigned int set) \
1403static inline unsigned int \ 1403static inline unsigned int \
1404clear_c0_##name(unsigned int clear) \ 1404clear_c0_##name(unsigned int clear) \
1405{ \ 1405{ \
1406 unsigned int res; \ 1406 unsigned int res, new; \
1407 \ 1407 \
1408 res = read_c0_##name(); \ 1408 res = read_c0_##name(); \
1409 res &= ~clear; \ 1409 new = res & ~clear; \
1410 write_c0_##name(res); \ 1410 write_c0_##name(new); \
1411 \ 1411 \
1412 return res; \ 1412 return res; \
1413} \ 1413} \
1414 \ 1414 \
1415static inline unsigned int \ 1415static inline unsigned int \
1416change_c0_##name(unsigned int change, unsigned int new) \ 1416change_c0_##name(unsigned int change, unsigned int val) \
1417{ \ 1417{ \
1418 unsigned int res; \ 1418 unsigned int res, new; \
1419 \ 1419 \
1420 res = read_c0_##name(); \ 1420 res = read_c0_##name(); \
1421 res &= ~change; \ 1421 new = res & ~change; \
1422 res |= (new & change); \ 1422 new |= (val & change); \
1423 write_c0_##name(res); \ 1423 write_c0_##name(new); \
1424 \ 1424 \
1425 return res; \ 1425 return res; \
1426} 1426}
diff --git a/arch/mips/include/asm/sigcontext.h b/arch/mips/include/asm/sigcontext.h
index 9ce0607d7a4e..9e89cf99d4e4 100644
--- a/arch/mips/include/asm/sigcontext.h
+++ b/arch/mips/include/asm/sigcontext.h
@@ -9,6 +9,7 @@
9#ifndef _ASM_SIGCONTEXT_H 9#ifndef _ASM_SIGCONTEXT_H
10#define _ASM_SIGCONTEXT_H 10#define _ASM_SIGCONTEXT_H
11 11
12#include <linux/types.h>
12#include <asm/sgidefs.h> 13#include <asm/sgidefs.h>
13 14
14#if _MIPS_SIM == _MIPS_SIM_ABI32 15#if _MIPS_SIM == _MIPS_SIM_ABI32
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index facc2d7a87ca..2abca1780169 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -75,6 +75,9 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
75 75
76#define SO_MARK 36 76#define SO_MARK 36
77 77
78#define SO_TIMESTAMPING 37
79#define SCM_TIMESTAMPING SO_TIMESTAMPING
80
78#ifdef __KERNEL__ 81#ifdef __KERNEL__
79 82
80/** sock_type - Socket types 83/** sock_type - Socket types
diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/asm/swab.h
index 88f1f7d555cb..99993c0d6c12 100644
--- a/arch/mips/include/asm/swab.h
+++ b/arch/mips/include/asm/swab.h
@@ -9,7 +9,7 @@
9#define _ASM_SWAB_H 9#define _ASM_SWAB_H
10 10
11#include <linux/compiler.h> 11#include <linux/compiler.h>
12#include <asm/types.h> 12#include <linux/types.h>
13 13
14#define __SWAB_64_THRU_32__ 14#define __SWAB_64_THRU_32__
15 15
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index 494a49a317e9..87deb8f6c458 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -187,7 +187,7 @@ static void gic_set_affinity(unsigned int irq, const struct cpumask *cpumask)
187 set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask); 187 set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);
188 188
189 } 189 }
190 irq_desc[irq].affinity = *cpumask; 190 cpumask_copy(irq_desc[irq].affinity, cpumask);
191 spin_unlock_irqrestore(&gic_lock, flags); 191 spin_unlock_irqrestore(&gic_lock, flags);
192 192
193} 193}
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 4b4007b3083a..7b845ba9dff4 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -108,7 +108,7 @@ int show_interrupts(struct seq_file *p, void *v)
108 seq_printf(p, "%10u ", kstat_irqs(i)); 108 seq_printf(p, "%10u ", kstat_irqs(i));
109#else 109#else
110 for_each_online_cpu(j) 110 for_each_online_cpu(j)
111 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 111 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
112#endif 112#endif
113 seq_printf(p, " %14s", irq_desc[i].chip->name); 113 seq_printf(p, " %14s", irq_desc[i].chip->name);
114 seq_printf(p, " %s", action->name); 114 seq_printf(p, " %s", action->name);
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 1a86f84fa947..2a472713de8e 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -32,7 +32,6 @@
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/binfmts.h> 33#include <linux/binfmts.h>
34#include <linux/security.h> 34#include <linux/security.h>
35#include <linux/syscalls.h>
36#include <linux/compat.h> 35#include <linux/compat.h>
37#include <linux/vfs.h> 36#include <linux/vfs.h>
38#include <linux/ipc.h> 37#include <linux/ipc.h>
@@ -356,40 +355,6 @@ SYSCALL_DEFINE1(32_personality, unsigned long, personality)
356 return ret; 355 return ret;
357} 356}
358 357
359/* ustat compatibility */
360struct ustat32 {
361 compat_daddr_t f_tfree;
362 compat_ino_t f_tinode;
363 char f_fname[6];
364 char f_fpack[6];
365};
366
367extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf);
368
369SYSCALL_DEFINE2(32_ustat, dev_t, dev, struct ustat32 __user *, ubuf32)
370{
371 int err;
372 struct ustat tmp;
373 struct ustat32 tmp32;
374 mm_segment_t old_fs = get_fs();
375
376 set_fs(KERNEL_DS);
377 err = sys_ustat(dev, (struct ustat __user *)&tmp);
378 set_fs(old_fs);
379
380 if (err)
381 goto out;
382
383 memset(&tmp32, 0, sizeof(struct ustat32));
384 tmp32.f_tfree = tmp.f_tfree;
385 tmp32.f_tinode = tmp.f_tinode;
386
387 err = copy_to_user(ubuf32, &tmp32, sizeof(struct ustat32)) ? -EFAULT : 0;
388
389out:
390 return err;
391}
392
393SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd, 358SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd,
394 compat_off_t __user *, offset, s32, count) 359 compat_off_t __user *, offset, s32, count)
395{ 360{
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 7438e92f8a01..f61d6b0e5731 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -253,7 +253,7 @@ EXPORT(sysn32_call_table)
253 PTR compat_sys_utime /* 6130 */ 253 PTR compat_sys_utime /* 6130 */
254 PTR sys_mknod 254 PTR sys_mknod
255 PTR sys_32_personality 255 PTR sys_32_personality
256 PTR sys_32_ustat 256 PTR compat_sys_ustat
257 PTR compat_sys_statfs 257 PTR compat_sys_statfs
258 PTR compat_sys_fstatfs /* 6135 */ 258 PTR compat_sys_fstatfs /* 6135 */
259 PTR sys_sysfs 259 PTR sys_sysfs
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index b0fef4ff9827..60997f1f69d4 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -265,7 +265,7 @@ sys_call_table:
265 PTR sys_olduname 265 PTR sys_olduname
266 PTR sys_umask /* 4060 */ 266 PTR sys_umask /* 4060 */
267 PTR sys_chroot 267 PTR sys_chroot
268 PTR sys_32_ustat 268 PTR compat_sys_ustat
269 PTR sys_dup2 269 PTR sys_dup2
270 PTR sys_getppid 270 PTR sys_getppid
271 PTR sys_getpgrp /* 4065 */ 271 PTR sys_getpgrp /* 4065 */
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index b6cca01ff82b..5f5af7d4c890 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -686,7 +686,7 @@ void smtc_forward_irq(unsigned int irq)
686 * and efficiency, we just pick the easiest one to find. 686 * and efficiency, we just pick the easiest one to find.
687 */ 687 */
688 688
689 target = first_cpu(irq_desc[irq].affinity); 689 target = cpumask_first(irq_desc[irq].affinity);
690 690
691 /* 691 /*
692 * We depend on the platform code to have correctly processed 692 * We depend on the platform code to have correctly processed
@@ -921,11 +921,13 @@ void ipi_decode(struct smtc_ipi *pipi)
921 struct clock_event_device *cd; 921 struct clock_event_device *cd;
922 void *arg_copy = pipi->arg; 922 void *arg_copy = pipi->arg;
923 int type_copy = pipi->type; 923 int type_copy = pipi->type;
924 int irq = MIPS_CPU_IRQ_BASE + 1;
925
924 smtc_ipi_nq(&freeIPIq, pipi); 926 smtc_ipi_nq(&freeIPIq, pipi);
925 switch (type_copy) { 927 switch (type_copy) {
926 case SMTC_CLOCK_TICK: 928 case SMTC_CLOCK_TICK:
927 irq_enter(); 929 irq_enter();
928 kstat_this_cpu.irqs[MIPS_CPU_IRQ_BASE + 1]++; 930 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
929 cd = &per_cpu(mips_clockevent_device, cpu); 931 cd = &per_cpu(mips_clockevent_device, cpu);
930 cd->event_handler(cd); 932 cd->event_handler(cd);
931 irq_exit(); 933 irq_exit();
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index b2d7041341b8..29fadaccecdd 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void)
1520#endif /* CONFIG_MIPS_MT_SMTC */ 1520#endif /* CONFIG_MIPS_MT_SMTC */
1521 1521
1522 if (cpu_has_veic || cpu_has_vint) { 1522 if (cpu_has_veic || cpu_has_vint) {
1523 unsigned long sr = set_c0_status(ST0_BEV);
1523 write_c0_ebase(ebase); 1524 write_c0_ebase(ebase);
1525 write_c0_status(sr);
1524 /* Setting vector spacing enables EI/VI mode */ 1526 /* Setting vector spacing enables EI/VI mode */
1525 change_c0_intctl(0x3e0, VECTORSPACING); 1527 change_c0_intctl(0x3e0, VECTORSPACING);
1526 } 1528 }
@@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
1602#ifdef CONFIG_64BIT 1604#ifdef CONFIG_64BIT
1603 unsigned long uncached_ebase = TO_UNCAC(ebase); 1605 unsigned long uncached_ebase = TO_UNCAC(ebase);
1604#endif 1606#endif
1605 if (cpu_has_mips_r2)
1606 uncached_ebase += (read_c0_ebase() & 0x3ffff000);
1607 1607
1608 if (!addr) 1608 if (!addr)
1609 panic(panic_null_cerr); 1609 panic(panic_null_cerr);
@@ -1635,9 +1635,11 @@ void __init trap_init(void)
1635 return; /* Already done */ 1635 return; /* Already done */
1636#endif 1636#endif
1637 1637
1638 if (cpu_has_veic || cpu_has_vint) 1638 if (cpu_has_veic || cpu_has_vint) {
1639 ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64); 1639 unsigned long size = 0x200 + VECTORSPACING*64;
1640 else { 1640 ebase = (unsigned long)
1641 __alloc_bootmem(size, 1 << fls(size), 0);
1642 } else {
1641 ebase = CAC_BASE; 1643 ebase = CAC_BASE;
1642 if (cpu_has_mips_r2) 1644 if (cpu_has_mips_r2)
1643 ebase += (read_c0_ebase() & 0x3ffff000); 1645 ebase += (read_c0_ebase() & 0x3ffff000);
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index c43f4b26a690..871e828bc62a 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -780,7 +780,7 @@ static void __cpuinit probe_pcache(void)
780 c->dcache.ways = 2; 780 c->dcache.ways = 2;
781 c->dcache.waybit = 0; 781 c->dcache.waybit = 0;
782 782
783 c->options |= MIPS_CPU_CACHE_CDEX_P; 783 c->options |= MIPS_CPU_CACHE_CDEX_P | MIPS_CPU_PREFETCH;
784 break; 784 break;
785 785
786 case CPU_TX49XX: 786 case CPU_TX49XX:
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 546e6977d4ff..bed56f1ac837 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -225,7 +225,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
225 if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) { 225 if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) {
226 unsigned long addr; 226 unsigned long addr;
227 227
228 addr = plat_dma_addr_to_phys(dma_address); 228 addr = dma_addr_to_virt(dma_address);
229 dma_cache_wback_inv(addr, size); 229 dma_cache_wback_inv(addr, size);
230 } 230 }
231 231
diff --git a/arch/mips/mti-malta/malta-smtc.c b/arch/mips/mti-malta/malta-smtc.c
index aabd7274507b..5ba31888fefb 100644
--- a/arch/mips/mti-malta/malta-smtc.c
+++ b/arch/mips/mti-malta/malta-smtc.c
@@ -116,7 +116,7 @@ struct plat_smp_ops msmtc_smp_ops = {
116 116
117void plat_set_irq_affinity(unsigned int irq, const struct cpumask *affinity) 117void plat_set_irq_affinity(unsigned int irq, const struct cpumask *affinity)
118{ 118{
119 cpumask_t tmask = *affinity; 119 cpumask_t tmask;
120 int cpu = 0; 120 int cpu = 0;
121 void smtc_set_irq_affinity(unsigned int irq, cpumask_t aff); 121 void smtc_set_irq_affinity(unsigned int irq, cpumask_t aff);
122 122
@@ -139,11 +139,12 @@ void plat_set_irq_affinity(unsigned int irq, const struct cpumask *affinity)
139 * be made to forward to an offline "CPU". 139 * be made to forward to an offline "CPU".
140 */ 140 */
141 141
142 cpumask_copy(&tmask, affinity);
142 for_each_cpu(cpu, affinity) { 143 for_each_cpu(cpu, affinity) {
143 if ((cpu_data[cpu].vpe_id != 0) || !cpu_online(cpu)) 144 if ((cpu_data[cpu].vpe_id != 0) || !cpu_online(cpu))
144 cpu_clear(cpu, tmask); 145 cpu_clear(cpu, tmask);
145 } 146 }
146 irq_desc[irq].affinity = tmask; 147 cpumask_copy(irq_desc[irq].affinity, &tmask);
147 148
148 if (cpus_empty(tmask)) 149 if (cpus_empty(tmask))
149 /* 150 /*
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
index f8b18af141a1..0ecd5fe9486e 100644
--- a/arch/mips/sgi-ip22/ip22-int.c
+++ b/arch/mips/sgi-ip22/ip22-int.c
@@ -155,7 +155,7 @@ static void indy_buserror_irq(void)
155 int irq = SGI_BUSERR_IRQ; 155 int irq = SGI_BUSERR_IRQ;
156 156
157 irq_enter(); 157 irq_enter();
158 kstat_this_cpu.irqs[irq]++; 158 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
159 ip22_be_interrupt(irq); 159 ip22_be_interrupt(irq);
160 irq_exit(); 160 irq_exit();
161} 161}
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index 3dcb27ec0c53..c8f7d2328b24 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -122,7 +122,7 @@ void indy_8254timer_irq(void)
122 char c; 122 char c;
123 123
124 irq_enter(); 124 irq_enter();
125 kstat_this_cpu.irqs[irq]++; 125 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
126 printk(KERN_ALERT "Oops, got 8254 interrupt.\n"); 126 printk(KERN_ALERT "Oops, got 8254 interrupt.\n");
127 ArcRead(0, &c, 1, &cnt); 127 ArcRead(0, &c, 1, &cnt);
128 ArcEnterInteractiveMode(); 128 ArcEnterInteractiveMode();
diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c
index dddfda8e8294..314691648c97 100644
--- a/arch/mips/sibyte/bcm1480/smp.c
+++ b/arch/mips/sibyte/bcm1480/smp.c
@@ -178,9 +178,10 @@ struct plat_smp_ops bcm1480_smp_ops = {
178void bcm1480_mailbox_interrupt(void) 178void bcm1480_mailbox_interrupt(void)
179{ 179{
180 int cpu = smp_processor_id(); 180 int cpu = smp_processor_id();
181 int irq = K_BCM1480_INT_MBOX_0_0;
181 unsigned int action; 182 unsigned int action;
182 183
183 kstat_this_cpu.irqs[K_BCM1480_INT_MBOX_0_0]++; 184 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
184 /* Load the mailbox register to figure out what we're supposed to do */ 185 /* Load the mailbox register to figure out what we're supposed to do */
185 action = (__raw_readq(mailbox_0_regs[cpu]) >> 48) & 0xffff; 186 action = (__raw_readq(mailbox_0_regs[cpu]) >> 48) & 0xffff;
186 187
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c
index 5950a288a7da..cad14003b84f 100644
--- a/arch/mips/sibyte/sb1250/smp.c
+++ b/arch/mips/sibyte/sb1250/smp.c
@@ -166,9 +166,10 @@ struct plat_smp_ops sb_smp_ops = {
166void sb1250_mailbox_interrupt(void) 166void sb1250_mailbox_interrupt(void)
167{ 167{
168 int cpu = smp_processor_id(); 168 int cpu = smp_processor_id();
169 int irq = K_INT_MBOX_0;
169 unsigned int action; 170 unsigned int action;
170 171
171 kstat_this_cpu.irqs[K_INT_MBOX_0]++; 172 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
172 /* Load the mailbox register to figure out what we're supposed to do */ 173 /* Load the mailbox register to figure out what we're supposed to do */
173 action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff; 174 action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff;
174 175
diff --git a/arch/mn10300/kernel/irq.c b/arch/mn10300/kernel/irq.c
index 56c64ccc9c21..50fdb5c16e0c 100644
--- a/arch/mn10300/kernel/irq.c
+++ b/arch/mn10300/kernel/irq.c
@@ -221,7 +221,7 @@ int show_interrupts(struct seq_file *p, void *v)
221 if (action) { 221 if (action) {
222 seq_printf(p, "%3d: ", i); 222 seq_printf(p, "%3d: ", i);
223 for_each_present_cpu(cpu) 223 for_each_present_cpu(cpu)
224 seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]); 224 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
225 seq_printf(p, " %14s.%u", irq_desc[i].chip->name, 225 seq_printf(p, " %14s.%u", irq_desc[i].chip->name,
226 (GxICR(i) & GxICR_LEVEL) >> 226 (GxICR(i) & GxICR_LEVEL) >>
227 GxICR_LEVEL_SHIFT); 227 GxICR_LEVEL_SHIFT);
diff --git a/arch/mn10300/kernel/mn10300-watchdog.c b/arch/mn10300/kernel/mn10300-watchdog.c
index 10811e981d20..2e370d88a87a 100644
--- a/arch/mn10300/kernel/mn10300-watchdog.c
+++ b/arch/mn10300/kernel/mn10300-watchdog.c
@@ -130,6 +130,7 @@ void watchdog_interrupt(struct pt_regs *regs, enum exception_code excep)
130 * the stack NMI-atomically, it's safe to use smp_processor_id(). 130 * the stack NMI-atomically, it's safe to use smp_processor_id().
131 */ 131 */
132 int sum, cpu = smp_processor_id(); 132 int sum, cpu = smp_processor_id();
133 int irq = NMIIRQ;
133 u8 wdt, tmp; 134 u8 wdt, tmp;
134 135
135 wdt = WDCTR & ~WDCTR_WDCNE; 136 wdt = WDCTR & ~WDCTR_WDCNE;
@@ -138,7 +139,7 @@ void watchdog_interrupt(struct pt_regs *regs, enum exception_code excep)
138 NMICR = NMICR_WDIF; 139 NMICR = NMICR_WDIF;
139 140
140 nmi_count(cpu)++; 141 nmi_count(cpu)++;
141 kstat_this_cpu.irqs[NMIIRQ]++; 142 kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
142 sum = irq_stat[cpu].__irq_count; 143 sum = irq_stat[cpu].__irq_count;
143 144
144 if (last_irq_sums[cpu] == sum) { 145 if (last_irq_sums[cpu] == sum) {
diff --git a/arch/parisc/include/asm/pdc.h b/arch/parisc/include/asm/pdc.h
index c584b00c6074..430f1aeea0b8 100644
--- a/arch/parisc/include/asm/pdc.h
+++ b/arch/parisc/include/asm/pdc.h
@@ -336,10 +336,11 @@
336#define NUM_PDC_RESULT 32 336#define NUM_PDC_RESULT 32
337 337
338#if !defined(__ASSEMBLY__) 338#if !defined(__ASSEMBLY__)
339#ifdef __KERNEL__
340 339
341#include <linux/types.h> 340#include <linux/types.h>
342 341
342#ifdef __KERNEL__
343
343extern int pdc_type; 344extern int pdc_type;
344 345
345/* Values for pdc_type */ 346/* Values for pdc_type */
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h
index fba402c95ac2..885472bf7b78 100644
--- a/arch/parisc/include/asm/socket.h
+++ b/arch/parisc/include/asm/socket.h
@@ -54,6 +54,9 @@
54 54
55#define SO_MARK 0x401f 55#define SO_MARK 0x401f
56 56
57#define SO_TIMESTAMPING 0x4020
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
57/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 60/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
58 * have to define SOCK_NONBLOCK to a different value here. 61 * have to define SOCK_NONBLOCK to a different value here.
59 */ 62 */
diff --git a/arch/parisc/include/asm/swab.h b/arch/parisc/include/asm/swab.h
index 3ff16c5a3358..e78403b129ef 100644
--- a/arch/parisc/include/asm/swab.h
+++ b/arch/parisc/include/asm/swab.h
@@ -1,7 +1,7 @@
1#ifndef _PARISC_SWAB_H 1#ifndef _PARISC_SWAB_H
2#define _PARISC_SWAB_H 2#define _PARISC_SWAB_H
3 3
4#include <asm/types.h> 4#include <linux/types.h>
5#include <linux/compiler.h> 5#include <linux/compiler.h>
6 6
7#define __SWAB_64_THRU_32__ 7#define __SWAB_64_THRU_32__
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 29e70e16ede8..1c740f5cbd63 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -138,7 +138,7 @@ static void cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
138 if (cpu_dest < 0) 138 if (cpu_dest < 0)
139 return; 139 return;
140 140
141 cpumask_copy(&irq_desc[irq].affinity, &cpumask_of_cpu(cpu_dest)); 141 cpumask_copy(&irq_desc[irq].affinity, dest);
142} 142}
143#endif 143#endif
144 144
@@ -185,7 +185,7 @@ int show_interrupts(struct seq_file *p, void *v)
185 seq_printf(p, "%3d: ", i); 185 seq_printf(p, "%3d: ", i);
186#ifdef CONFIG_SMP 186#ifdef CONFIG_SMP
187 for_each_online_cpu(j) 187 for_each_online_cpu(j)
188 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 188 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
189#else 189#else
190 seq_printf(p, "%10u ", kstat_irqs(i)); 190 seq_printf(p, "%10u ", kstat_irqs(i));
191#endif 191#endif
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 303d2b647e41..03b9a01bc16c 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -130,7 +130,7 @@
130 ENTRY_OURS(newuname) 130 ENTRY_OURS(newuname)
131 ENTRY_SAME(umask) /* 60 */ 131 ENTRY_SAME(umask) /* 60 */
132 ENTRY_SAME(chroot) 132 ENTRY_SAME(chroot)
133 ENTRY_SAME(ustat) 133 ENTRY_COMP(ustat)
134 ENTRY_SAME(dup2) 134 ENTRY_SAME(dup2)
135 ENTRY_SAME(getppid) 135 ENTRY_SAME(getppid)
136 ENTRY_SAME(getpgrp) /* 65 */ 136 ENTRY_SAME(getpgrp) /* 65 */
diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
index 540ec3241f72..5fd1ad09bdf2 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -127,6 +127,13 @@
127 dcr-reg = <0x010 0x002>; 127 dcr-reg = <0x010 0x002>;
128 }; 128 };
129 129
130 CRYPTO: crypto@180000 {
131 compatible = "amcc,ppc460ex-crypto", "amcc,ppc4xx-crypto";
132 reg = <4 0x00180000 0x80400>;
133 interrupt-parent = <&UIC0>;
134 interrupts = <0x1d 0x4>;
135 };
136
130 MAL0: mcmal { 137 MAL0: mcmal {
131 compatible = "ibm,mcmal-460ex", "ibm,mcmal2"; 138 compatible = "ibm,mcmal-460ex", "ibm,mcmal2";
132 dcr-reg = <0x180 0x062>; 139 dcr-reg = <0x180 0x062>;
diff --git a/arch/powerpc/boot/dts/kilauea.dts b/arch/powerpc/boot/dts/kilauea.dts
index 2804444812e5..5e6b08ff6f67 100644
--- a/arch/powerpc/boot/dts/kilauea.dts
+++ b/arch/powerpc/boot/dts/kilauea.dts
@@ -97,6 +97,13 @@
97 0x6 0x4>; /* ECC SEC Error */ 97 0x6 0x4>; /* ECC SEC Error */
98 }; 98 };
99 99
100 CRYPTO: crypto@ef700000 {
101 compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto";
102 reg = <0xef700000 0x80400>;
103 interrupt-parent = <&UIC0>;
104 interrupts = <0x17 0x2>;
105 };
106
100 MAL0: mcmal { 107 MAL0: mcmal {
101 compatible = "ibm,mcmal-405ex", "ibm,mcmal2"; 108 compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
102 dcr-reg = <0x180 0x062>; 109 dcr-reg = <0x180 0x062>;
diff --git a/arch/powerpc/include/asm/kvm.h b/arch/powerpc/include/asm/kvm.h
index 4e0cf65f7f5a..bb2de6aa5ce0 100644
--- a/arch/powerpc/include/asm/kvm.h
+++ b/arch/powerpc/include/asm/kvm.h
@@ -52,4 +52,11 @@ struct kvm_fpu {
52 __u64 fpr[32]; 52 __u64 fpr[32];
53}; 53};
54 54
55struct kvm_debug_exit_arch {
56};
57
58/* for KVM_SET_GUEST_DEBUG */
59struct kvm_guest_debug_arch {
60};
61
55#endif /* __LINUX_KVM_POWERPC_H */ 62#endif /* __LINUX_KVM_POWERPC_H */
diff --git a/arch/powerpc/include/asm/kvm_44x.h b/arch/powerpc/include/asm/kvm_44x.h
index f49031b632ca..d22d39942a92 100644
--- a/arch/powerpc/include/asm/kvm_44x.h
+++ b/arch/powerpc/include/asm/kvm_44x.h
@@ -28,6 +28,13 @@
28 * need to find some way of advertising it. */ 28 * need to find some way of advertising it. */
29#define KVM44x_GUEST_TLB_SIZE 64 29#define KVM44x_GUEST_TLB_SIZE 64
30 30
31struct kvmppc_44x_tlbe {
32 u32 tid; /* Only the low 8 bits are used. */
33 u32 word0;
34 u32 word1;
35 u32 word2;
36};
37
31struct kvmppc_44x_shadow_ref { 38struct kvmppc_44x_shadow_ref {
32 struct page *page; 39 struct page *page;
33 u16 gtlb_index; 40 u16 gtlb_index;
diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
index 2197764796d9..56bfae59837f 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -42,7 +42,12 @@
42#define BOOKE_INTERRUPT_DTLB_MISS 13 42#define BOOKE_INTERRUPT_DTLB_MISS 13
43#define BOOKE_INTERRUPT_ITLB_MISS 14 43#define BOOKE_INTERRUPT_ITLB_MISS 14
44#define BOOKE_INTERRUPT_DEBUG 15 44#define BOOKE_INTERRUPT_DEBUG 15
45#define BOOKE_MAX_INTERRUPT 15 45
46/* E500 */
47#define BOOKE_INTERRUPT_SPE_UNAVAIL 32
48#define BOOKE_INTERRUPT_SPE_FP_DATA 33
49#define BOOKE_INTERRUPT_SPE_FP_ROUND 34
50#define BOOKE_INTERRUPT_PERFORMANCE_MONITOR 35
46 51
47#define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */ 52#define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */
48#define RESUME_FLAG_HOST (1<<1) /* Resume host? */ 53#define RESUME_FLAG_HOST (1<<1) /* Resume host? */
diff --git a/arch/powerpc/include/asm/kvm_e500.h b/arch/powerpc/include/asm/kvm_e500.h
new file mode 100644
index 000000000000..9d497ce49726
--- /dev/null
+++ b/arch/powerpc/include/asm/kvm_e500.h
@@ -0,0 +1,67 @@
1/*
2 * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
3 *
4 * Author: Yu Liu, <yu.liu@freescale.com>
5 *
6 * Description:
7 * This file is derived from arch/powerpc/include/asm/kvm_44x.h,
8 * by Hollis Blanchard <hollisb@us.ibm.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#ifndef __ASM_KVM_E500_H__
16#define __ASM_KVM_E500_H__
17
18#include <linux/kvm_host.h>
19
20#define BOOKE_INTERRUPT_SIZE 36
21
22#define E500_PID_NUM 3
23#define E500_TLB_NUM 2
24
25struct tlbe{
26 u32 mas1;
27 u32 mas2;
28 u32 mas3;
29 u32 mas7;
30};
31
32struct kvmppc_vcpu_e500 {
33 /* Unmodified copy of the guest's TLB. */
34 struct tlbe *guest_tlb[E500_TLB_NUM];
35 /* TLB that's actually used when the guest is running. */
36 struct tlbe *shadow_tlb[E500_TLB_NUM];
37 /* Pages which are referenced in the shadow TLB. */
38 struct page **shadow_pages[E500_TLB_NUM];
39
40 unsigned int guest_tlb_size[E500_TLB_NUM];
41 unsigned int shadow_tlb_size[E500_TLB_NUM];
42 unsigned int guest_tlb_nv[E500_TLB_NUM];
43
44 u32 host_pid[E500_PID_NUM];
45 u32 pid[E500_PID_NUM];
46
47 u32 mas0;
48 u32 mas1;
49 u32 mas2;
50 u32 mas3;
51 u32 mas4;
52 u32 mas5;
53 u32 mas6;
54 u32 mas7;
55 u32 l1csr1;
56 u32 hid0;
57 u32 hid1;
58
59 struct kvm_vcpu vcpu;
60};
61
62static inline struct kvmppc_vcpu_e500 *to_e500(struct kvm_vcpu *vcpu)
63{
64 return container_of(vcpu, struct kvmppc_vcpu_e500, vcpu);
65}
66
67#endif /* __ASM_KVM_E500_H__ */
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index c1e436fe7738..dfdf13c9fefd 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -64,13 +64,6 @@ struct kvm_vcpu_stat {
64 u32 halt_wakeup; 64 u32 halt_wakeup;
65}; 65};
66 66
67struct kvmppc_44x_tlbe {
68 u32 tid; /* Only the low 8 bits are used. */
69 u32 word0;
70 u32 word1;
71 u32 word2;
72};
73
74enum kvm_exit_types { 67enum kvm_exit_types {
75 MMIO_EXITS, 68 MMIO_EXITS,
76 DCR_EXITS, 69 DCR_EXITS,
@@ -118,11 +111,6 @@ struct kvm_arch {
118struct kvm_vcpu_arch { 111struct kvm_vcpu_arch {
119 u32 host_stack; 112 u32 host_stack;
120 u32 host_pid; 113 u32 host_pid;
121 u32 host_dbcr0;
122 u32 host_dbcr1;
123 u32 host_dbcr2;
124 u32 host_iac[4];
125 u32 host_msr;
126 114
127 u64 fpr[32]; 115 u64 fpr[32];
128 ulong gpr[32]; 116 ulong gpr[32];
@@ -157,7 +145,7 @@ struct kvm_vcpu_arch {
157 u32 tbu; 145 u32 tbu;
158 u32 tcr; 146 u32 tcr;
159 u32 tsr; 147 u32 tsr;
160 u32 ivor[16]; 148 u32 ivor[64];
161 ulong ivpr; 149 ulong ivpr;
162 u32 pir; 150 u32 pir;
163 151
@@ -170,6 +158,7 @@ struct kvm_vcpu_arch {
170 u32 ccr1; 158 u32 ccr1;
171 u32 dbcr0; 159 u32 dbcr0;
172 u32 dbcr1; 160 u32 dbcr1;
161 u32 dbsr;
173 162
174#ifdef CONFIG_KVM_EXIT_TIMING 163#ifdef CONFIG_KVM_EXIT_TIMING
175 struct kvmppc_exit_timing timing_exit; 164 struct kvmppc_exit_timing timing_exit;
@@ -200,10 +189,4 @@ struct kvm_vcpu_arch {
200 unsigned long pending_exceptions; 189 unsigned long pending_exceptions;
201}; 190};
202 191
203struct kvm_guest_debug {
204 int enabled;
205 unsigned long bp[4];
206 int singlestep;
207};
208
209#endif /* __POWERPC_KVM_HOST_H__ */ 192#endif /* __POWERPC_KVM_HOST_H__ */
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 36d2a50a8487..2c6ee349df5e 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -52,13 +52,19 @@ extern int kvmppc_emulate_instruction(struct kvm_run *run,
52extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu); 52extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu);
53extern void kvmppc_emulate_dec(struct kvm_vcpu *vcpu); 53extern void kvmppc_emulate_dec(struct kvm_vcpu *vcpu);
54 54
55/* Core-specific hooks */
56
55extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr, 57extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr,
56 u64 asid, u32 flags, u32 max_bytes,
57 unsigned int gtlb_idx); 58 unsigned int gtlb_idx);
58extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); 59extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode);
59extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid); 60extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid);
60 61extern void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu);
61/* Core-specific hooks */ 62extern int kvmppc_mmu_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
63extern int kvmppc_mmu_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
64extern gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int gtlb_index,
65 gva_t eaddr);
66extern void kvmppc_mmu_dtlb_miss(struct kvm_vcpu *vcpu);
67extern void kvmppc_mmu_itlb_miss(struct kvm_vcpu *vcpu);
62 68
63extern struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, 69extern struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm,
64 unsigned int id); 70 unsigned int id);
@@ -71,9 +77,6 @@ extern int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
71extern void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu); 77extern void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
72extern void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu); 78extern void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu);
73 79
74extern void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu);
75extern void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu);
76
77extern void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu); 80extern void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu);
78extern int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu); 81extern int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu);
79extern void kvmppc_core_queue_program(struct kvm_vcpu *vcpu); 82extern void kvmppc_core_queue_program(struct kvm_vcpu *vcpu);
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h
index c5363c3a7207..7e74cff81d86 100644
--- a/arch/powerpc/include/asm/mmu-book3e.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -93,6 +93,8 @@
93 93
94#ifndef __ASSEMBLY__ 94#ifndef __ASSEMBLY__
95 95
96extern unsigned int tlbcam_index;
97
96typedef struct { 98typedef struct {
97 unsigned int id; 99 unsigned int id;
98 unsigned int active; 100 unsigned int active;
diff --git a/arch/powerpc/include/asm/ps3fb.h b/arch/powerpc/include/asm/ps3fb.h
index 1a91daf362c8..90dbefb8cfc4 100644
--- a/arch/powerpc/include/asm/ps3fb.h
+++ b/arch/powerpc/include/asm/ps3fb.h
@@ -19,6 +19,7 @@
19#ifndef _ASM_POWERPC_PS3FB_H_ 19#ifndef _ASM_POWERPC_PS3FB_H_
20#define _ASM_POWERPC_PS3FB_H_ 20#define _ASM_POWERPC_PS3FB_H_
21 21
22#include <linux/types.h>
22#include <linux/ioctl.h> 23#include <linux/ioctl.h>
23#include <linux/types.h> 24#include <linux/types.h>
24 25
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h
index f5a4e168e498..1e5cfad0e3f7 100644
--- a/arch/powerpc/include/asm/socket.h
+++ b/arch/powerpc/include/asm/socket.h
@@ -61,4 +61,7 @@
61 61
62#define SO_MARK 36 62#define SO_MARK 36
63 63
64#define SO_TIMESTAMPING 37
65#define SCM_TIMESTAMPING SO_TIMESTAMPING
66
64#endif /* _ASM_POWERPC_SOCKET_H */ 67#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index 72353f6070a4..fe166491e9dc 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -65,7 +65,7 @@ SYSCALL(ni_syscall)
65SYSX(sys_ni_syscall,sys_olduname, sys_olduname) 65SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
66COMPAT_SYS_SPU(umask) 66COMPAT_SYS_SPU(umask)
67SYSCALL_SPU(chroot) 67SYSCALL_SPU(chroot)
68SYSCALL(ustat) 68COMPAT_SYS(ustat)
69SYSCALL_SPU(dup2) 69SYSCALL_SPU(dup2)
70SYSCALL_SPU(getppid) 70SYSCALL_SPU(getppid)
71SYSCALL_SPU(getpgrp) 71SYSCALL_SPU(getpgrp)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 10377df38f36..1e40bc053946 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -49,7 +49,7 @@
49#include <asm/iseries/alpaca.h> 49#include <asm/iseries/alpaca.h>
50#endif 50#endif
51#ifdef CONFIG_KVM 51#ifdef CONFIG_KVM
52#include <asm/kvm_44x.h> 52#include <linux/kvm_host.h>
53#endif 53#endif
54 54
55#if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 55#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
@@ -358,8 +358,6 @@ int main(void)
358 DEFINE(PTE_SIZE, sizeof(pte_t)); 358 DEFINE(PTE_SIZE, sizeof(pte_t));
359 359
360#ifdef CONFIG_KVM 360#ifdef CONFIG_KVM
361 DEFINE(TLBE_BYTES, sizeof(struct kvmppc_44x_tlbe));
362
363 DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack)); 361 DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack));
364 DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid)); 362 DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid));
365 DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr)); 363 DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr));
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 48ea2008b20d..5576147e57b6 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -190,7 +190,7 @@ int show_interrupts(struct seq_file *p, void *v)
190 seq_printf(p, "%3d: ", i); 190 seq_printf(p, "%3d: ", i);
191#ifdef CONFIG_SMP 191#ifdef CONFIG_SMP
192 for_each_online_cpu(j) 192 for_each_online_cpu(j)
193 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 193 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
194#else 194#else
195 seq_printf(p, "%10u ", kstat_irqs(i)); 195 seq_printf(p, "%10u ", kstat_irqs(i));
196#endif /* CONFIG_SMP */ 196#endif /* CONFIG_SMP */
@@ -231,7 +231,7 @@ void fixup_irqs(cpumask_t map)
231 if (irq_desc[irq].status & IRQ_PER_CPU) 231 if (irq_desc[irq].status & IRQ_PER_CPU)
232 continue; 232 continue;
233 233
234 cpus_and(mask, irq_desc[irq].affinity, map); 234 cpumask_and(&mask, irq_desc[irq].affinity, &map);
235 if (any_online_cpu(mask) == NR_CPUS) { 235 if (any_online_cpu(mask) == NR_CPUS) {
236 printk("Breaking affinity for irq %i\n", irq); 236 printk("Breaking affinity for irq %i\n", irq);
237 mask = map; 237 mask = map;
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 895af44bf1f4..b9ef1644a722 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -182,13 +182,7 @@ SECTIONS
182 __initramfs_end = .; 182 __initramfs_end = .;
183 } 183 }
184#endif 184#endif
185 . = ALIGN(PAGE_SIZE); 185 PERCPU(PAGE_SIZE)
186 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
187 __per_cpu_start = .;
188 *(.data.percpu)
189 *(.data.percpu.shared_aligned)
190 __per_cpu_end = .;
191 }
192 186
193 . = ALIGN(8); 187 . = ALIGN(8);
194 .machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) { 188 .machine.desc : AT(ADDR(.machine.desc) - LOAD_OFFSET) {
diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
index a66bec57265a..0cef809cec21 100644
--- a/arch/powerpc/kvm/44x.c
+++ b/arch/powerpc/kvm/44x.c
@@ -28,72 +28,6 @@
28 28
29#include "44x_tlb.h" 29#include "44x_tlb.h"
30 30
31/* Note: clearing MSR[DE] just means that the debug interrupt will not be
32 * delivered *immediately*. Instead, it simply sets the appropriate DBSR bits.
33 * If those DBSR bits are still set when MSR[DE] is re-enabled, the interrupt
34 * will be delivered as an "imprecise debug event" (which is indicated by
35 * DBSR[IDE].
36 */
37static void kvm44x_disable_debug_interrupts(void)
38{
39 mtmsr(mfmsr() & ~MSR_DE);
40}
41
42void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu)
43{
44 kvm44x_disable_debug_interrupts();
45
46 mtspr(SPRN_IAC1, vcpu->arch.host_iac[0]);
47 mtspr(SPRN_IAC2, vcpu->arch.host_iac[1]);
48 mtspr(SPRN_IAC3, vcpu->arch.host_iac[2]);
49 mtspr(SPRN_IAC4, vcpu->arch.host_iac[3]);
50 mtspr(SPRN_DBCR1, vcpu->arch.host_dbcr1);
51 mtspr(SPRN_DBCR2, vcpu->arch.host_dbcr2);
52 mtspr(SPRN_DBCR0, vcpu->arch.host_dbcr0);
53 mtmsr(vcpu->arch.host_msr);
54}
55
56void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
57{
58 struct kvm_guest_debug *dbg = &vcpu->guest_debug;
59 u32 dbcr0 = 0;
60
61 vcpu->arch.host_msr = mfmsr();
62 kvm44x_disable_debug_interrupts();
63
64 /* Save host debug register state. */
65 vcpu->arch.host_iac[0] = mfspr(SPRN_IAC1);
66 vcpu->arch.host_iac[1] = mfspr(SPRN_IAC2);
67 vcpu->arch.host_iac[2] = mfspr(SPRN_IAC3);
68 vcpu->arch.host_iac[3] = mfspr(SPRN_IAC4);
69 vcpu->arch.host_dbcr0 = mfspr(SPRN_DBCR0);
70 vcpu->arch.host_dbcr1 = mfspr(SPRN_DBCR1);
71 vcpu->arch.host_dbcr2 = mfspr(SPRN_DBCR2);
72
73 /* set registers up for guest */
74
75 if (dbg->bp[0]) {
76 mtspr(SPRN_IAC1, dbg->bp[0]);
77 dbcr0 |= DBCR0_IAC1 | DBCR0_IDM;
78 }
79 if (dbg->bp[1]) {
80 mtspr(SPRN_IAC2, dbg->bp[1]);
81 dbcr0 |= DBCR0_IAC2 | DBCR0_IDM;
82 }
83 if (dbg->bp[2]) {
84 mtspr(SPRN_IAC3, dbg->bp[2]);
85 dbcr0 |= DBCR0_IAC3 | DBCR0_IDM;
86 }
87 if (dbg->bp[3]) {
88 mtspr(SPRN_IAC4, dbg->bp[3]);
89 dbcr0 |= DBCR0_IAC4 | DBCR0_IDM;
90 }
91
92 mtspr(SPRN_DBCR0, dbcr0);
93 mtspr(SPRN_DBCR1, 0);
94 mtspr(SPRN_DBCR2, 0);
95}
96
97void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 31void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
98{ 32{
99 kvmppc_44x_tlb_load(vcpu); 33 kvmppc_44x_tlb_load(vcpu);
@@ -149,8 +83,6 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
149int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu, 83int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
150 struct kvm_translation *tr) 84 struct kvm_translation *tr)
151{ 85{
152 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
153 struct kvmppc_44x_tlbe *gtlbe;
154 int index; 86 int index;
155 gva_t eaddr; 87 gva_t eaddr;
156 u8 pid; 88 u8 pid;
@@ -166,9 +98,7 @@ int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
166 return 0; 98 return 0;
167 } 99 }
168 100
169 gtlbe = &vcpu_44x->guest_tlb[index]; 101 tr->physical_address = kvmppc_mmu_xlate(vcpu, index, eaddr);
170
171 tr->physical_address = tlb_xlate(gtlbe, eaddr);
172 /* XXX what does "writeable" and "usermode" even mean? */ 102 /* XXX what does "writeable" and "usermode" even mean? */
173 tr->valid = 1; 103 tr->valid = 1;
174 104
diff --git a/arch/powerpc/kvm/44x_emulate.c b/arch/powerpc/kvm/44x_emulate.c
index 82489a743a6f..61af58fcecee 100644
--- a/arch/powerpc/kvm/44x_emulate.c
+++ b/arch/powerpc/kvm/44x_emulate.c
@@ -27,25 +27,12 @@
27#include "booke.h" 27#include "booke.h"
28#include "44x_tlb.h" 28#include "44x_tlb.h"
29 29
30#define OP_RFI 19
31
32#define XOP_RFI 50
33#define XOP_MFMSR 83
34#define XOP_WRTEE 131
35#define XOP_MTMSR 146
36#define XOP_WRTEEI 163
37#define XOP_MFDCR 323 30#define XOP_MFDCR 323
38#define XOP_MTDCR 451 31#define XOP_MTDCR 451
39#define XOP_TLBSX 914 32#define XOP_TLBSX 914
40#define XOP_ICCCI 966 33#define XOP_ICCCI 966
41#define XOP_TLBWE 978 34#define XOP_TLBWE 978
42 35
43static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)
44{
45 vcpu->arch.pc = vcpu->arch.srr0;
46 kvmppc_set_msr(vcpu, vcpu->arch.srr1);
47}
48
49int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu, 36int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
50 unsigned int inst, int *advance) 37 unsigned int inst, int *advance)
51{ 38{
@@ -59,48 +46,9 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
59 int ws; 46 int ws;
60 47
61 switch (get_op(inst)) { 48 switch (get_op(inst)) {
62 case OP_RFI:
63 switch (get_xop(inst)) {
64 case XOP_RFI:
65 kvmppc_emul_rfi(vcpu);
66 kvmppc_set_exit_type(vcpu, EMULATED_RFI_EXITS);
67 *advance = 0;
68 break;
69
70 default:
71 emulated = EMULATE_FAIL;
72 break;
73 }
74 break;
75
76 case 31: 49 case 31:
77 switch (get_xop(inst)) { 50 switch (get_xop(inst)) {
78 51
79 case XOP_MFMSR:
80 rt = get_rt(inst);
81 vcpu->arch.gpr[rt] = vcpu->arch.msr;
82 kvmppc_set_exit_type(vcpu, EMULATED_MFMSR_EXITS);
83 break;
84
85 case XOP_MTMSR:
86 rs = get_rs(inst);
87 kvmppc_set_exit_type(vcpu, EMULATED_MTMSR_EXITS);
88 kvmppc_set_msr(vcpu, vcpu->arch.gpr[rs]);
89 break;
90
91 case XOP_WRTEE:
92 rs = get_rs(inst);
93 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
94 | (vcpu->arch.gpr[rs] & MSR_EE);
95 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS);
96 break;
97
98 case XOP_WRTEEI:
99 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
100 | (inst & MSR_EE);
101 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS);
102 break;
103
104 case XOP_MFDCR: 52 case XOP_MFDCR:
105 dcrn = get_dcrn(inst); 53 dcrn = get_dcrn(inst);
106 rt = get_rt(inst); 54 rt = get_rt(inst);
@@ -186,186 +134,51 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
186 emulated = EMULATE_FAIL; 134 emulated = EMULATE_FAIL;
187 } 135 }
188 136
137 if (emulated == EMULATE_FAIL)
138 emulated = kvmppc_booke_emulate_op(run, vcpu, inst, advance);
139
189 return emulated; 140 return emulated;
190} 141}
191 142
192int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs) 143int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
193{ 144{
145 int emulated = EMULATE_DONE;
146
194 switch (sprn) { 147 switch (sprn) {
195 case SPRN_MMUCR:
196 vcpu->arch.mmucr = vcpu->arch.gpr[rs]; break;
197 case SPRN_PID: 148 case SPRN_PID:
198 kvmppc_set_pid(vcpu, vcpu->arch.gpr[rs]); break; 149 kvmppc_set_pid(vcpu, vcpu->arch.gpr[rs]); break;
150 case SPRN_MMUCR:
151 vcpu->arch.mmucr = vcpu->arch.gpr[rs]; break;
199 case SPRN_CCR0: 152 case SPRN_CCR0:
200 vcpu->arch.ccr0 = vcpu->arch.gpr[rs]; break; 153 vcpu->arch.ccr0 = vcpu->arch.gpr[rs]; break;
201 case SPRN_CCR1: 154 case SPRN_CCR1:
202 vcpu->arch.ccr1 = vcpu->arch.gpr[rs]; break; 155 vcpu->arch.ccr1 = vcpu->arch.gpr[rs]; break;
203 case SPRN_DEAR:
204 vcpu->arch.dear = vcpu->arch.gpr[rs]; break;
205 case SPRN_ESR:
206 vcpu->arch.esr = vcpu->arch.gpr[rs]; break;
207 case SPRN_DBCR0:
208 vcpu->arch.dbcr0 = vcpu->arch.gpr[rs]; break;
209 case SPRN_DBCR1:
210 vcpu->arch.dbcr1 = vcpu->arch.gpr[rs]; break;
211 case SPRN_TSR:
212 vcpu->arch.tsr &= ~vcpu->arch.gpr[rs]; break;
213 case SPRN_TCR:
214 vcpu->arch.tcr = vcpu->arch.gpr[rs];
215 kvmppc_emulate_dec(vcpu);
216 break;
217
218 /* Note: SPRG4-7 are user-readable. These values are
219 * loaded into the real SPRGs when resuming the
220 * guest. */
221 case SPRN_SPRG4:
222 vcpu->arch.sprg4 = vcpu->arch.gpr[rs]; break;
223 case SPRN_SPRG5:
224 vcpu->arch.sprg5 = vcpu->arch.gpr[rs]; break;
225 case SPRN_SPRG6:
226 vcpu->arch.sprg6 = vcpu->arch.gpr[rs]; break;
227 case SPRN_SPRG7:
228 vcpu->arch.sprg7 = vcpu->arch.gpr[rs]; break;
229
230 case SPRN_IVPR:
231 vcpu->arch.ivpr = vcpu->arch.gpr[rs];
232 break;
233 case SPRN_IVOR0:
234 vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL] = vcpu->arch.gpr[rs];
235 break;
236 case SPRN_IVOR1:
237 vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK] = vcpu->arch.gpr[rs];
238 break;
239 case SPRN_IVOR2:
240 vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE] = vcpu->arch.gpr[rs];
241 break;
242 case SPRN_IVOR3:
243 vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE] = vcpu->arch.gpr[rs];
244 break;
245 case SPRN_IVOR4:
246 vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL] = vcpu->arch.gpr[rs];
247 break;
248 case SPRN_IVOR5:
249 vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT] = vcpu->arch.gpr[rs];
250 break;
251 case SPRN_IVOR6:
252 vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM] = vcpu->arch.gpr[rs];
253 break;
254 case SPRN_IVOR7:
255 vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL] = vcpu->arch.gpr[rs];
256 break;
257 case SPRN_IVOR8:
258 vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL] = vcpu->arch.gpr[rs];
259 break;
260 case SPRN_IVOR9:
261 vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL] = vcpu->arch.gpr[rs];
262 break;
263 case SPRN_IVOR10:
264 vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER] = vcpu->arch.gpr[rs];
265 break;
266 case SPRN_IVOR11:
267 vcpu->arch.ivor[BOOKE_IRQPRIO_FIT] = vcpu->arch.gpr[rs];
268 break;
269 case SPRN_IVOR12:
270 vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG] = vcpu->arch.gpr[rs];
271 break;
272 case SPRN_IVOR13:
273 vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS] = vcpu->arch.gpr[rs];
274 break;
275 case SPRN_IVOR14:
276 vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS] = vcpu->arch.gpr[rs];
277 break;
278 case SPRN_IVOR15:
279 vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG] = vcpu->arch.gpr[rs];
280 break;
281
282 default: 156 default:
283 return EMULATE_FAIL; 157 emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, rs);
284 } 158 }
285 159
286 kvmppc_set_exit_type(vcpu, EMULATED_MTSPR_EXITS); 160 kvmppc_set_exit_type(vcpu, EMULATED_MTSPR_EXITS);
287 return EMULATE_DONE; 161 return emulated;
288} 162}
289 163
290int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt) 164int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
291{ 165{
166 int emulated = EMULATE_DONE;
167
292 switch (sprn) { 168 switch (sprn) {
293 /* 440 */ 169 case SPRN_PID:
170 vcpu->arch.gpr[rt] = vcpu->arch.pid; break;
294 case SPRN_MMUCR: 171 case SPRN_MMUCR:
295 vcpu->arch.gpr[rt] = vcpu->arch.mmucr; break; 172 vcpu->arch.gpr[rt] = vcpu->arch.mmucr; break;
296 case SPRN_CCR0: 173 case SPRN_CCR0:
297 vcpu->arch.gpr[rt] = vcpu->arch.ccr0; break; 174 vcpu->arch.gpr[rt] = vcpu->arch.ccr0; break;
298 case SPRN_CCR1: 175 case SPRN_CCR1:
299 vcpu->arch.gpr[rt] = vcpu->arch.ccr1; break; 176 vcpu->arch.gpr[rt] = vcpu->arch.ccr1; break;
300
301 /* Book E */
302 case SPRN_PID:
303 vcpu->arch.gpr[rt] = vcpu->arch.pid; break;
304 case SPRN_IVPR:
305 vcpu->arch.gpr[rt] = vcpu->arch.ivpr; break;
306 case SPRN_DEAR:
307 vcpu->arch.gpr[rt] = vcpu->arch.dear; break;
308 case SPRN_ESR:
309 vcpu->arch.gpr[rt] = vcpu->arch.esr; break;
310 case SPRN_DBCR0:
311 vcpu->arch.gpr[rt] = vcpu->arch.dbcr0; break;
312 case SPRN_DBCR1:
313 vcpu->arch.gpr[rt] = vcpu->arch.dbcr1; break;
314
315 case SPRN_IVOR0:
316 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL];
317 break;
318 case SPRN_IVOR1:
319 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK];
320 break;
321 case SPRN_IVOR2:
322 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE];
323 break;
324 case SPRN_IVOR3:
325 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE];
326 break;
327 case SPRN_IVOR4:
328 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL];
329 break;
330 case SPRN_IVOR5:
331 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT];
332 break;
333 case SPRN_IVOR6:
334 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM];
335 break;
336 case SPRN_IVOR7:
337 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL];
338 break;
339 case SPRN_IVOR8:
340 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL];
341 break;
342 case SPRN_IVOR9:
343 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL];
344 break;
345 case SPRN_IVOR10:
346 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER];
347 break;
348 case SPRN_IVOR11:
349 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_FIT];
350 break;
351 case SPRN_IVOR12:
352 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG];
353 break;
354 case SPRN_IVOR13:
355 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS];
356 break;
357 case SPRN_IVOR14:
358 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS];
359 break;
360 case SPRN_IVOR15:
361 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG];
362 break;
363
364 default: 177 default:
365 return EMULATE_FAIL; 178 emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, rt);
366 } 179 }
367 180
368 kvmppc_set_exit_type(vcpu, EMULATED_MFSPR_EXITS); 181 kvmppc_set_exit_type(vcpu, EMULATED_MFSPR_EXITS);
369 return EMULATE_DONE; 182 return emulated;
370} 183}
371 184
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c
index 9a34b8edb9e2..4a16f472cc18 100644
--- a/arch/powerpc/kvm/44x_tlb.c
+++ b/arch/powerpc/kvm/44x_tlb.c
@@ -208,20 +208,38 @@ int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, unsigned int pid,
208 return -1; 208 return -1;
209} 209}
210 210
211int kvmppc_44x_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr) 211gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int gtlb_index,
212 gva_t eaddr)
213{
214 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
215 struct kvmppc_44x_tlbe *gtlbe = &vcpu_44x->guest_tlb[gtlb_index];
216 unsigned int pgmask = get_tlb_bytes(gtlbe) - 1;
217
218 return get_tlb_raddr(gtlbe) | (eaddr & pgmask);
219}
220
221int kvmppc_mmu_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr)
212{ 222{
213 unsigned int as = !!(vcpu->arch.msr & MSR_IS); 223 unsigned int as = !!(vcpu->arch.msr & MSR_IS);
214 224
215 return kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as); 225 return kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as);
216} 226}
217 227
218int kvmppc_44x_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr) 228int kvmppc_mmu_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr)
219{ 229{
220 unsigned int as = !!(vcpu->arch.msr & MSR_DS); 230 unsigned int as = !!(vcpu->arch.msr & MSR_DS);
221 231
222 return kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as); 232 return kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as);
223} 233}
224 234
235void kvmppc_mmu_itlb_miss(struct kvm_vcpu *vcpu)
236{
237}
238
239void kvmppc_mmu_dtlb_miss(struct kvm_vcpu *vcpu)
240{
241}
242
225static void kvmppc_44x_shadow_release(struct kvmppc_vcpu_44x *vcpu_44x, 243static void kvmppc_44x_shadow_release(struct kvmppc_vcpu_44x *vcpu_44x,
226 unsigned int stlb_index) 244 unsigned int stlb_index)
227{ 245{
@@ -248,7 +266,7 @@ static void kvmppc_44x_shadow_release(struct kvmppc_vcpu_44x *vcpu_44x,
248 KVMTRACE_1D(STLB_INVAL, &vcpu_44x->vcpu, stlb_index, handler); 266 KVMTRACE_1D(STLB_INVAL, &vcpu_44x->vcpu, stlb_index, handler);
249} 267}
250 268
251void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu) 269void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu)
252{ 270{
253 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu); 271 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
254 int i; 272 int i;
@@ -269,15 +287,19 @@ void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu)
269 * Caller must ensure that the specified guest TLB entry is safe to insert into 287 * Caller must ensure that the specified guest TLB entry is safe to insert into
270 * the shadow TLB. 288 * the shadow TLB.
271 */ 289 */
272void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr, u64 asid, 290void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr,
273 u32 flags, u32 max_bytes, unsigned int gtlb_index) 291 unsigned int gtlb_index)
274{ 292{
275 struct kvmppc_44x_tlbe stlbe; 293 struct kvmppc_44x_tlbe stlbe;
276 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu); 294 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
295 struct kvmppc_44x_tlbe *gtlbe = &vcpu_44x->guest_tlb[gtlb_index];
277 struct kvmppc_44x_shadow_ref *ref; 296 struct kvmppc_44x_shadow_ref *ref;
278 struct page *new_page; 297 struct page *new_page;
279 hpa_t hpaddr; 298 hpa_t hpaddr;
280 gfn_t gfn; 299 gfn_t gfn;
300 u32 asid = gtlbe->tid;
301 u32 flags = gtlbe->word2;
302 u32 max_bytes = get_tlb_bytes(gtlbe);
281 unsigned int victim; 303 unsigned int victim;
282 304
283 /* Select TLB entry to clobber. Indirectly guard against races with the TLB 305 /* Select TLB entry to clobber. Indirectly guard against races with the TLB
@@ -448,10 +470,8 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
448 } 470 }
449 471
450 if (tlbe_is_host_safe(vcpu, tlbe)) { 472 if (tlbe_is_host_safe(vcpu, tlbe)) {
451 u64 asid;
452 gva_t eaddr; 473 gva_t eaddr;
453 gpa_t gpaddr; 474 gpa_t gpaddr;
454 u32 flags;
455 u32 bytes; 475 u32 bytes;
456 476
457 eaddr = get_tlb_eaddr(tlbe); 477 eaddr = get_tlb_eaddr(tlbe);
@@ -462,10 +482,7 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
462 eaddr &= ~(bytes - 1); 482 eaddr &= ~(bytes - 1);
463 gpaddr &= ~(bytes - 1); 483 gpaddr &= ~(bytes - 1);
464 484
465 asid = (tlbe->word0 & PPC44x_TLB_TS) | tlbe->tid; 485 kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlb_index);
466 flags = tlbe->word2 & 0xffff;
467
468 kvmppc_mmu_map(vcpu, eaddr, gpaddr, asid, flags, bytes, gtlb_index);
469 } 486 }
470 487
471 KVMTRACE_5D(GTLB_WRITE, vcpu, gtlb_index, tlbe->tid, tlbe->word0, 488 KVMTRACE_5D(GTLB_WRITE, vcpu, gtlb_index, tlbe->tid, tlbe->word0,
diff --git a/arch/powerpc/kvm/44x_tlb.h b/arch/powerpc/kvm/44x_tlb.h
index 772191f29e62..a9ff80e51526 100644
--- a/arch/powerpc/kvm/44x_tlb.h
+++ b/arch/powerpc/kvm/44x_tlb.h
@@ -25,8 +25,6 @@
25 25
26extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, 26extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr,
27 unsigned int pid, unsigned int as); 27 unsigned int pid, unsigned int as);
28extern int kvmppc_44x_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
29extern int kvmppc_44x_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
30 28
31extern int kvmppc_44x_emul_tlbsx(struct kvm_vcpu *vcpu, u8 rt, u8 ra, u8 rb, 29extern int kvmppc_44x_emul_tlbsx(struct kvm_vcpu *vcpu, u8 rt, u8 ra, u8 rb,
32 u8 rc); 30 u8 rc);
@@ -85,11 +83,4 @@ static inline unsigned int get_mmucr_sts(const struct kvm_vcpu *vcpu)
85 return (vcpu->arch.mmucr >> 16) & 0x1; 83 return (vcpu->arch.mmucr >> 16) & 0x1;
86} 84}
87 85
88static inline gpa_t tlb_xlate(struct kvmppc_44x_tlbe *tlbe, gva_t eaddr)
89{
90 unsigned int pgmask = get_tlb_bytes(tlbe) - 1;
91
92 return get_tlb_raddr(tlbe) | (eaddr & pgmask);
93}
94
95#endif /* __KVM_POWERPC_TLB_H__ */ 86#endif /* __KVM_POWERPC_TLB_H__ */
diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig
index 6dbdc4817d80..5a152a52796f 100644
--- a/arch/powerpc/kvm/Kconfig
+++ b/arch/powerpc/kvm/Kconfig
@@ -2,6 +2,9 @@
2# KVM configuration 2# KVM configuration
3# 3#
4 4
5config HAVE_KVM_IRQCHIP
6 bool
7
5menuconfig VIRTUALIZATION 8menuconfig VIRTUALIZATION
6 bool "Virtualization" 9 bool "Virtualization"
7 ---help--- 10 ---help---
@@ -43,6 +46,19 @@ config KVM_EXIT_TIMING
43 46
44 If unsure, say N. 47 If unsure, say N.
45 48
49config KVM_E500
50 bool "KVM support for PowerPC E500 processors"
51 depends on EXPERIMENTAL && E500
52 select KVM
53 ---help---
54 Support running unmodified E500 guest kernels in virtual machines on
55 E500 host processors.
56
57 This module provides access to the hardware capabilities through
58 a character device node named /dev/kvm.
59
60 If unsure, say N.
61
46config KVM_TRACE 62config KVM_TRACE
47 bool "KVM trace support" 63 bool "KVM trace support"
48 depends on KVM && MARKERS && SYSFS 64 depends on KVM && MARKERS && SYSFS
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index df7ba59e6d53..4b2df66c79d8 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -16,8 +16,18 @@ AFLAGS_booke_interrupts.o := -I$(obj)
16 16
17kvm-440-objs := \ 17kvm-440-objs := \
18 booke.o \ 18 booke.o \
19 booke_emulate.o \
19 booke_interrupts.o \ 20 booke_interrupts.o \
20 44x.o \ 21 44x.o \
21 44x_tlb.o \ 22 44x_tlb.o \
22 44x_emulate.o 23 44x_emulate.o
23obj-$(CONFIG_KVM_440) += kvm-440.o 24obj-$(CONFIG_KVM_440) += kvm-440.o
25
26kvm-e500-objs := \
27 booke.o \
28 booke_emulate.o \
29 booke_interrupts.o \
30 e500.o \
31 e500_tlb.o \
32 e500_emulate.o
33obj-$(CONFIG_KVM_E500) += kvm-e500.o
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 35485dd6927e..642e4204cf25 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -30,10 +30,8 @@
30#include <asm/kvm_ppc.h> 30#include <asm/kvm_ppc.h>
31#include "timing.h" 31#include "timing.h"
32#include <asm/cacheflush.h> 32#include <asm/cacheflush.h>
33#include <asm/kvm_44x.h>
34 33
35#include "booke.h" 34#include "booke.h"
36#include "44x_tlb.h"
37 35
38unsigned long kvmppc_booke_handlers; 36unsigned long kvmppc_booke_handlers;
39 37
@@ -120,6 +118,9 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
120 case BOOKE_IRQPRIO_DATA_STORAGE: 118 case BOOKE_IRQPRIO_DATA_STORAGE:
121 case BOOKE_IRQPRIO_INST_STORAGE: 119 case BOOKE_IRQPRIO_INST_STORAGE:
122 case BOOKE_IRQPRIO_FP_UNAVAIL: 120 case BOOKE_IRQPRIO_FP_UNAVAIL:
121 case BOOKE_IRQPRIO_SPE_UNAVAIL:
122 case BOOKE_IRQPRIO_SPE_FP_DATA:
123 case BOOKE_IRQPRIO_SPE_FP_ROUND:
123 case BOOKE_IRQPRIO_AP_UNAVAIL: 124 case BOOKE_IRQPRIO_AP_UNAVAIL:
124 case BOOKE_IRQPRIO_ALIGNMENT: 125 case BOOKE_IRQPRIO_ALIGNMENT:
125 allowed = 1; 126 allowed = 1;
@@ -165,7 +166,7 @@ void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu)
165 unsigned int priority; 166 unsigned int priority;
166 167
167 priority = __ffs(*pending); 168 priority = __ffs(*pending);
168 while (priority <= BOOKE_MAX_INTERRUPT) { 169 while (priority <= BOOKE_IRQPRIO_MAX) {
169 if (kvmppc_booke_irqprio_deliver(vcpu, priority)) 170 if (kvmppc_booke_irqprio_deliver(vcpu, priority))
170 break; 171 break;
171 172
@@ -263,6 +264,21 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
263 r = RESUME_GUEST; 264 r = RESUME_GUEST;
264 break; 265 break;
265 266
267 case BOOKE_INTERRUPT_SPE_UNAVAIL:
268 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_UNAVAIL);
269 r = RESUME_GUEST;
270 break;
271
272 case BOOKE_INTERRUPT_SPE_FP_DATA:
273 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_DATA);
274 r = RESUME_GUEST;
275 break;
276
277 case BOOKE_INTERRUPT_SPE_FP_ROUND:
278 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SPE_FP_ROUND);
279 r = RESUME_GUEST;
280 break;
281
266 case BOOKE_INTERRUPT_DATA_STORAGE: 282 case BOOKE_INTERRUPT_DATA_STORAGE:
267 vcpu->arch.dear = vcpu->arch.fault_dear; 283 vcpu->arch.dear = vcpu->arch.fault_dear;
268 vcpu->arch.esr = vcpu->arch.fault_esr; 284 vcpu->arch.esr = vcpu->arch.fault_esr;
@@ -284,29 +300,27 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
284 r = RESUME_GUEST; 300 r = RESUME_GUEST;
285 break; 301 break;
286 302
287 /* XXX move to a 440-specific file. */
288 case BOOKE_INTERRUPT_DTLB_MISS: { 303 case BOOKE_INTERRUPT_DTLB_MISS: {
289 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
290 struct kvmppc_44x_tlbe *gtlbe;
291 unsigned long eaddr = vcpu->arch.fault_dear; 304 unsigned long eaddr = vcpu->arch.fault_dear;
292 int gtlb_index; 305 int gtlb_index;
306 gpa_t gpaddr;
293 gfn_t gfn; 307 gfn_t gfn;
294 308
295 /* Check the guest TLB. */ 309 /* Check the guest TLB. */
296 gtlb_index = kvmppc_44x_dtlb_index(vcpu, eaddr); 310 gtlb_index = kvmppc_mmu_dtlb_index(vcpu, eaddr);
297 if (gtlb_index < 0) { 311 if (gtlb_index < 0) {
298 /* The guest didn't have a mapping for it. */ 312 /* The guest didn't have a mapping for it. */
299 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DTLB_MISS); 313 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DTLB_MISS);
300 vcpu->arch.dear = vcpu->arch.fault_dear; 314 vcpu->arch.dear = vcpu->arch.fault_dear;
301 vcpu->arch.esr = vcpu->arch.fault_esr; 315 vcpu->arch.esr = vcpu->arch.fault_esr;
316 kvmppc_mmu_dtlb_miss(vcpu);
302 kvmppc_account_exit(vcpu, DTLB_REAL_MISS_EXITS); 317 kvmppc_account_exit(vcpu, DTLB_REAL_MISS_EXITS);
303 r = RESUME_GUEST; 318 r = RESUME_GUEST;
304 break; 319 break;
305 } 320 }
306 321
307 gtlbe = &vcpu_44x->guest_tlb[gtlb_index]; 322 gpaddr = kvmppc_mmu_xlate(vcpu, gtlb_index, eaddr);
308 vcpu->arch.paddr_accessed = tlb_xlate(gtlbe, eaddr); 323 gfn = gpaddr >> PAGE_SHIFT;
309 gfn = vcpu->arch.paddr_accessed >> PAGE_SHIFT;
310 324
311 if (kvm_is_visible_gfn(vcpu->kvm, gfn)) { 325 if (kvm_is_visible_gfn(vcpu->kvm, gfn)) {
312 /* The guest TLB had a mapping, but the shadow TLB 326 /* The guest TLB had a mapping, but the shadow TLB
@@ -315,13 +329,13 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
315 * b) the guest used a large mapping which we're faking 329 * b) the guest used a large mapping which we're faking
316 * Either way, we need to satisfy the fault without 330 * Either way, we need to satisfy the fault without
317 * invoking the guest. */ 331 * invoking the guest. */
318 kvmppc_mmu_map(vcpu, eaddr, vcpu->arch.paddr_accessed, gtlbe->tid, 332 kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlb_index);
319 gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index);
320 kvmppc_account_exit(vcpu, DTLB_VIRT_MISS_EXITS); 333 kvmppc_account_exit(vcpu, DTLB_VIRT_MISS_EXITS);
321 r = RESUME_GUEST; 334 r = RESUME_GUEST;
322 } else { 335 } else {
323 /* Guest has mapped and accessed a page which is not 336 /* Guest has mapped and accessed a page which is not
324 * actually RAM. */ 337 * actually RAM. */
338 vcpu->arch.paddr_accessed = gpaddr;
325 r = kvmppc_emulate_mmio(run, vcpu); 339 r = kvmppc_emulate_mmio(run, vcpu);
326 kvmppc_account_exit(vcpu, MMIO_EXITS); 340 kvmppc_account_exit(vcpu, MMIO_EXITS);
327 } 341 }
@@ -329,10 +343,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
329 break; 343 break;
330 } 344 }
331 345
332 /* XXX move to a 440-specific file. */
333 case BOOKE_INTERRUPT_ITLB_MISS: { 346 case BOOKE_INTERRUPT_ITLB_MISS: {
334 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
335 struct kvmppc_44x_tlbe *gtlbe;
336 unsigned long eaddr = vcpu->arch.pc; 347 unsigned long eaddr = vcpu->arch.pc;
337 gpa_t gpaddr; 348 gpa_t gpaddr;
338 gfn_t gfn; 349 gfn_t gfn;
@@ -341,18 +352,18 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
341 r = RESUME_GUEST; 352 r = RESUME_GUEST;
342 353
343 /* Check the guest TLB. */ 354 /* Check the guest TLB. */
344 gtlb_index = kvmppc_44x_itlb_index(vcpu, eaddr); 355 gtlb_index = kvmppc_mmu_itlb_index(vcpu, eaddr);
345 if (gtlb_index < 0) { 356 if (gtlb_index < 0) {
346 /* The guest didn't have a mapping for it. */ 357 /* The guest didn't have a mapping for it. */
347 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ITLB_MISS); 358 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ITLB_MISS);
359 kvmppc_mmu_itlb_miss(vcpu);
348 kvmppc_account_exit(vcpu, ITLB_REAL_MISS_EXITS); 360 kvmppc_account_exit(vcpu, ITLB_REAL_MISS_EXITS);
349 break; 361 break;
350 } 362 }
351 363
352 kvmppc_account_exit(vcpu, ITLB_VIRT_MISS_EXITS); 364 kvmppc_account_exit(vcpu, ITLB_VIRT_MISS_EXITS);
353 365
354 gtlbe = &vcpu_44x->guest_tlb[gtlb_index]; 366 gpaddr = kvmppc_mmu_xlate(vcpu, gtlb_index, eaddr);
355 gpaddr = tlb_xlate(gtlbe, eaddr);
356 gfn = gpaddr >> PAGE_SHIFT; 367 gfn = gpaddr >> PAGE_SHIFT;
357 368
358 if (kvm_is_visible_gfn(vcpu->kvm, gfn)) { 369 if (kvm_is_visible_gfn(vcpu->kvm, gfn)) {
@@ -362,8 +373,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
362 * b) the guest used a large mapping which we're faking 373 * b) the guest used a large mapping which we're faking
363 * Either way, we need to satisfy the fault without 374 * Either way, we need to satisfy the fault without
364 * invoking the guest. */ 375 * invoking the guest. */
365 kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlbe->tid, 376 kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlb_index);
366 gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index);
367 } else { 377 } else {
368 /* Guest mapped and leaped at non-RAM! */ 378 /* Guest mapped and leaped at non-RAM! */
369 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_MACHINE_CHECK); 379 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_MACHINE_CHECK);
diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
index cf7c94ca24bf..d59bcca1f9d8 100644
--- a/arch/powerpc/kvm/booke.h
+++ b/arch/powerpc/kvm/booke.h
@@ -22,6 +22,7 @@
22 22
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/kvm_host.h> 24#include <linux/kvm_host.h>
25#include <asm/kvm_ppc.h>
25#include "timing.h" 26#include "timing.h"
26 27
27/* interrupt priortity ordering */ 28/* interrupt priortity ordering */
@@ -30,17 +31,24 @@
30#define BOOKE_IRQPRIO_ALIGNMENT 2 31#define BOOKE_IRQPRIO_ALIGNMENT 2
31#define BOOKE_IRQPRIO_PROGRAM 3 32#define BOOKE_IRQPRIO_PROGRAM 3
32#define BOOKE_IRQPRIO_FP_UNAVAIL 4 33#define BOOKE_IRQPRIO_FP_UNAVAIL 4
33#define BOOKE_IRQPRIO_SYSCALL 5 34#define BOOKE_IRQPRIO_SPE_UNAVAIL 5
34#define BOOKE_IRQPRIO_AP_UNAVAIL 6 35#define BOOKE_IRQPRIO_SPE_FP_DATA 6
35#define BOOKE_IRQPRIO_DTLB_MISS 7 36#define BOOKE_IRQPRIO_SPE_FP_ROUND 7
36#define BOOKE_IRQPRIO_ITLB_MISS 8 37#define BOOKE_IRQPRIO_SYSCALL 8
37#define BOOKE_IRQPRIO_MACHINE_CHECK 9 38#define BOOKE_IRQPRIO_AP_UNAVAIL 9
38#define BOOKE_IRQPRIO_DEBUG 10 39#define BOOKE_IRQPRIO_DTLB_MISS 10
39#define BOOKE_IRQPRIO_CRITICAL 11 40#define BOOKE_IRQPRIO_ITLB_MISS 11
40#define BOOKE_IRQPRIO_WATCHDOG 12 41#define BOOKE_IRQPRIO_MACHINE_CHECK 12
41#define BOOKE_IRQPRIO_EXTERNAL 13 42#define BOOKE_IRQPRIO_DEBUG 13
42#define BOOKE_IRQPRIO_FIT 14 43#define BOOKE_IRQPRIO_CRITICAL 14
43#define BOOKE_IRQPRIO_DECREMENTER 15 44#define BOOKE_IRQPRIO_WATCHDOG 15
45#define BOOKE_IRQPRIO_EXTERNAL 16
46#define BOOKE_IRQPRIO_FIT 17
47#define BOOKE_IRQPRIO_DECREMENTER 18
48#define BOOKE_IRQPRIO_PERFORMANCE_MONITOR 19
49#define BOOKE_IRQPRIO_MAX 19
50
51extern unsigned long kvmppc_booke_handlers;
44 52
45/* Helper function for "full" MSR writes. No need to call this if only EE is 53/* Helper function for "full" MSR writes. No need to call this if only EE is
46 * changing. */ 54 * changing. */
@@ -57,4 +65,9 @@ static inline void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr)
57 }; 65 };
58} 66}
59 67
68int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
69 unsigned int inst, int *advance);
70int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt);
71int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs);
72
60#endif /* __KVM_BOOKE_H__ */ 73#endif /* __KVM_BOOKE_H__ */
diff --git a/arch/powerpc/kvm/booke_emulate.c b/arch/powerpc/kvm/booke_emulate.c
new file mode 100644
index 000000000000..aebc65e93f4b
--- /dev/null
+++ b/arch/powerpc/kvm/booke_emulate.c
@@ -0,0 +1,266 @@
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, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 */
19
20#include <linux/kvm_host.h>
21#include <asm/disassemble.h>
22
23#include "booke.h"
24
25#define OP_19_XOP_RFI 50
26
27#define OP_31_XOP_MFMSR 83
28#define OP_31_XOP_WRTEE 131
29#define OP_31_XOP_MTMSR 146
30#define OP_31_XOP_WRTEEI 163
31
32static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)
33{
34 vcpu->arch.pc = vcpu->arch.srr0;
35 kvmppc_set_msr(vcpu, vcpu->arch.srr1);
36}
37
38int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
39 unsigned int inst, int *advance)
40{
41 int emulated = EMULATE_DONE;
42 int rs;
43 int rt;
44
45 switch (get_op(inst)) {
46 case 19:
47 switch (get_xop(inst)) {
48 case OP_19_XOP_RFI:
49 kvmppc_emul_rfi(vcpu);
50 kvmppc_set_exit_type(vcpu, EMULATED_RFI_EXITS);
51 *advance = 0;
52 break;
53
54 default:
55 emulated = EMULATE_FAIL;
56 break;
57 }
58 break;
59
60 case 31:
61 switch (get_xop(inst)) {
62
63 case OP_31_XOP_MFMSR:
64 rt = get_rt(inst);
65 vcpu->arch.gpr[rt] = vcpu->arch.msr;
66 kvmppc_set_exit_type(vcpu, EMULATED_MFMSR_EXITS);
67 break;
68
69 case OP_31_XOP_MTMSR:
70 rs = get_rs(inst);
71 kvmppc_set_exit_type(vcpu, EMULATED_MTMSR_EXITS);
72 kvmppc_set_msr(vcpu, vcpu->arch.gpr[rs]);
73 break;
74
75 case OP_31_XOP_WRTEE:
76 rs = get_rs(inst);
77 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
78 | (vcpu->arch.gpr[rs] & MSR_EE);
79 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS);
80 break;
81
82 case OP_31_XOP_WRTEEI:
83 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
84 | (inst & MSR_EE);
85 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS);
86 break;
87
88 default:
89 emulated = EMULATE_FAIL;
90 }
91
92 break;
93
94 default:
95 emulated = EMULATE_FAIL;
96 }
97
98 return emulated;
99}
100
101int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
102{
103 int emulated = EMULATE_DONE;
104
105 switch (sprn) {
106 case SPRN_DEAR:
107 vcpu->arch.dear = vcpu->arch.gpr[rs]; break;
108 case SPRN_ESR:
109 vcpu->arch.esr = vcpu->arch.gpr[rs]; break;
110 case SPRN_DBCR0:
111 vcpu->arch.dbcr0 = vcpu->arch.gpr[rs]; break;
112 case SPRN_DBCR1:
113 vcpu->arch.dbcr1 = vcpu->arch.gpr[rs]; break;
114 case SPRN_DBSR:
115 vcpu->arch.dbsr &= ~vcpu->arch.gpr[rs]; break;
116 case SPRN_TSR:
117 vcpu->arch.tsr &= ~vcpu->arch.gpr[rs]; break;
118 case SPRN_TCR:
119 vcpu->arch.tcr = vcpu->arch.gpr[rs];
120 kvmppc_emulate_dec(vcpu);
121 break;
122
123 /* Note: SPRG4-7 are user-readable. These values are
124 * loaded into the real SPRGs when resuming the
125 * guest. */
126 case SPRN_SPRG4:
127 vcpu->arch.sprg4 = vcpu->arch.gpr[rs]; break;
128 case SPRN_SPRG5:
129 vcpu->arch.sprg5 = vcpu->arch.gpr[rs]; break;
130 case SPRN_SPRG6:
131 vcpu->arch.sprg6 = vcpu->arch.gpr[rs]; break;
132 case SPRN_SPRG7:
133 vcpu->arch.sprg7 = vcpu->arch.gpr[rs]; break;
134
135 case SPRN_IVPR:
136 vcpu->arch.ivpr = vcpu->arch.gpr[rs];
137 break;
138 case SPRN_IVOR0:
139 vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL] = vcpu->arch.gpr[rs];
140 break;
141 case SPRN_IVOR1:
142 vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK] = vcpu->arch.gpr[rs];
143 break;
144 case SPRN_IVOR2:
145 vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE] = vcpu->arch.gpr[rs];
146 break;
147 case SPRN_IVOR3:
148 vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE] = vcpu->arch.gpr[rs];
149 break;
150 case SPRN_IVOR4:
151 vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL] = vcpu->arch.gpr[rs];
152 break;
153 case SPRN_IVOR5:
154 vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT] = vcpu->arch.gpr[rs];
155 break;
156 case SPRN_IVOR6:
157 vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM] = vcpu->arch.gpr[rs];
158 break;
159 case SPRN_IVOR7:
160 vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL] = vcpu->arch.gpr[rs];
161 break;
162 case SPRN_IVOR8:
163 vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL] = vcpu->arch.gpr[rs];
164 break;
165 case SPRN_IVOR9:
166 vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL] = vcpu->arch.gpr[rs];
167 break;
168 case SPRN_IVOR10:
169 vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER] = vcpu->arch.gpr[rs];
170 break;
171 case SPRN_IVOR11:
172 vcpu->arch.ivor[BOOKE_IRQPRIO_FIT] = vcpu->arch.gpr[rs];
173 break;
174 case SPRN_IVOR12:
175 vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG] = vcpu->arch.gpr[rs];
176 break;
177 case SPRN_IVOR13:
178 vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS] = vcpu->arch.gpr[rs];
179 break;
180 case SPRN_IVOR14:
181 vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS] = vcpu->arch.gpr[rs];
182 break;
183 case SPRN_IVOR15:
184 vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG] = vcpu->arch.gpr[rs];
185 break;
186
187 default:
188 emulated = EMULATE_FAIL;
189 }
190
191 return emulated;
192}
193
194int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
195{
196 int emulated = EMULATE_DONE;
197
198 switch (sprn) {
199 case SPRN_IVPR:
200 vcpu->arch.gpr[rt] = vcpu->arch.ivpr; break;
201 case SPRN_DEAR:
202 vcpu->arch.gpr[rt] = vcpu->arch.dear; break;
203 case SPRN_ESR:
204 vcpu->arch.gpr[rt] = vcpu->arch.esr; break;
205 case SPRN_DBCR0:
206 vcpu->arch.gpr[rt] = vcpu->arch.dbcr0; break;
207 case SPRN_DBCR1:
208 vcpu->arch.gpr[rt] = vcpu->arch.dbcr1; break;
209 case SPRN_DBSR:
210 vcpu->arch.gpr[rt] = vcpu->arch.dbsr; break;
211
212 case SPRN_IVOR0:
213 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL];
214 break;
215 case SPRN_IVOR1:
216 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK];
217 break;
218 case SPRN_IVOR2:
219 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE];
220 break;
221 case SPRN_IVOR3:
222 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE];
223 break;
224 case SPRN_IVOR4:
225 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL];
226 break;
227 case SPRN_IVOR5:
228 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT];
229 break;
230 case SPRN_IVOR6:
231 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM];
232 break;
233 case SPRN_IVOR7:
234 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL];
235 break;
236 case SPRN_IVOR8:
237 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL];
238 break;
239 case SPRN_IVOR9:
240 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL];
241 break;
242 case SPRN_IVOR10:
243 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER];
244 break;
245 case SPRN_IVOR11:
246 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_FIT];
247 break;
248 case SPRN_IVOR12:
249 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG];
250 break;
251 case SPRN_IVOR13:
252 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS];
253 break;
254 case SPRN_IVOR14:
255 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS];
256 break;
257 case SPRN_IVOR15:
258 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG];
259 break;
260
261 default:
262 emulated = EMULATE_FAIL;
263 }
264
265 return emulated;
266}
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S
index 084ebcd7dd83..d0c6f841bbd1 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -86,6 +86,9 @@ KVM_HANDLER BOOKE_INTERRUPT_WATCHDOG
86KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS 86KVM_HANDLER BOOKE_INTERRUPT_DTLB_MISS
87KVM_HANDLER BOOKE_INTERRUPT_ITLB_MISS 87KVM_HANDLER BOOKE_INTERRUPT_ITLB_MISS
88KVM_HANDLER BOOKE_INTERRUPT_DEBUG 88KVM_HANDLER BOOKE_INTERRUPT_DEBUG
89KVM_HANDLER BOOKE_INTERRUPT_SPE_UNAVAIL
90KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_DATA
91KVM_HANDLER BOOKE_INTERRUPT_SPE_FP_ROUND
89 92
90_GLOBAL(kvmppc_handler_len) 93_GLOBAL(kvmppc_handler_len)
91 .long kvmppc_handler_1 - kvmppc_handler_0 94 .long kvmppc_handler_1 - kvmppc_handler_0
@@ -347,7 +350,9 @@ lightweight_exit:
347 lwz r3, VCPU_SHADOW_PID(r4) 350 lwz r3, VCPU_SHADOW_PID(r4)
348 mtspr SPRN_PID, r3 351 mtspr SPRN_PID, r3
349 352
353#ifdef CONFIG_44x
350 iccci 0, 0 /* XXX hack */ 354 iccci 0, 0 /* XXX hack */
355#endif
351 356
352 /* Load some guest volatiles. */ 357 /* Load some guest volatiles. */
353 lwz r0, VCPU_GPR(r0)(r4) 358 lwz r0, VCPU_GPR(r0)(r4)
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
new file mode 100644
index 000000000000..d8067fd81cdd
--- /dev/null
+++ b/arch/powerpc/kvm/e500.c
@@ -0,0 +1,169 @@
1/*
2 * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
3 *
4 * Author: Yu Liu, <yu.liu@freescale.com>
5 *
6 * Description:
7 * This file is derived from arch/powerpc/kvm/44x.c,
8 * by Hollis Blanchard <hollisb@us.ibm.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/kvm_host.h>
16#include <linux/err.h>
17
18#include <asm/reg.h>
19#include <asm/cputable.h>
20#include <asm/tlbflush.h>
21#include <asm/kvm_e500.h>
22#include <asm/kvm_ppc.h>
23
24#include "booke.h"
25#include "e500_tlb.h"
26
27void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu)
28{
29}
30
31void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
32{
33}
34
35void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
36{
37 kvmppc_e500_tlb_load(vcpu, cpu);
38}
39
40void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu)
41{
42 kvmppc_e500_tlb_put(vcpu);
43}
44
45int kvmppc_core_check_processor_compat(void)
46{
47 int r;
48
49 if (strcmp(cur_cpu_spec->cpu_name, "e500v2") == 0)
50 r = 0;
51 else
52 r = -ENOTSUPP;
53
54 return r;
55}
56
57int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
58{
59 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
60
61 kvmppc_e500_tlb_setup(vcpu_e500);
62
63 /* Use the same core vertion as host's */
64 vcpu->arch.pvr = mfspr(SPRN_PVR);
65
66 return 0;
67}
68
69/* 'linear_address' is actually an encoding of AS|PID|EADDR . */
70int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
71 struct kvm_translation *tr)
72{
73 int index;
74 gva_t eaddr;
75 u8 pid;
76 u8 as;
77
78 eaddr = tr->linear_address;
79 pid = (tr->linear_address >> 32) & 0xff;
80 as = (tr->linear_address >> 40) & 0x1;
81
82 index = kvmppc_e500_tlb_search(vcpu, eaddr, pid, as);
83 if (index < 0) {
84 tr->valid = 0;
85 return 0;
86 }
87
88 tr->physical_address = kvmppc_mmu_xlate(vcpu, index, eaddr);
89 /* XXX what does "writeable" and "usermode" even mean? */
90 tr->valid = 1;
91
92 return 0;
93}
94
95struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
96{
97 struct kvmppc_vcpu_e500 *vcpu_e500;
98 struct kvm_vcpu *vcpu;
99 int err;
100
101 vcpu_e500 = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
102 if (!vcpu_e500) {
103 err = -ENOMEM;
104 goto out;
105 }
106
107 vcpu = &vcpu_e500->vcpu;
108 err = kvm_vcpu_init(vcpu, kvm, id);
109 if (err)
110 goto free_vcpu;
111
112 err = kvmppc_e500_tlb_init(vcpu_e500);
113 if (err)
114 goto uninit_vcpu;
115
116 return vcpu;
117
118uninit_vcpu:
119 kvm_vcpu_uninit(vcpu);
120free_vcpu:
121 kmem_cache_free(kvm_vcpu_cache, vcpu_e500);
122out:
123 return ERR_PTR(err);
124}
125
126void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu)
127{
128 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
129
130 kvmppc_e500_tlb_uninit(vcpu_e500);
131 kvm_vcpu_uninit(vcpu);
132 kmem_cache_free(kvm_vcpu_cache, vcpu_e500);
133}
134
135static int kvmppc_e500_init(void)
136{
137 int r, i;
138 unsigned long ivor[3];
139 unsigned long max_ivor = 0;
140
141 r = kvmppc_booke_init();
142 if (r)
143 return r;
144
145 /* copy extra E500 exception handlers */
146 ivor[0] = mfspr(SPRN_IVOR32);
147 ivor[1] = mfspr(SPRN_IVOR33);
148 ivor[2] = mfspr(SPRN_IVOR34);
149 for (i = 0; i < 3; i++) {
150 if (ivor[i] > max_ivor)
151 max_ivor = ivor[i];
152
153 memcpy((void *)kvmppc_booke_handlers + ivor[i],
154 kvmppc_handlers_start + (i + 16) * kvmppc_handler_len,
155 kvmppc_handler_len);
156 }
157 flush_icache_range(kvmppc_booke_handlers,
158 kvmppc_booke_handlers + max_ivor + kvmppc_handler_len);
159
160 return kvm_init(NULL, sizeof(struct kvmppc_vcpu_e500), THIS_MODULE);
161}
162
163static void kvmppc_e500_exit(void)
164{
165 kvmppc_booke_exit();
166}
167
168module_init(kvmppc_e500_init);
169module_exit(kvmppc_e500_exit);
diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
new file mode 100644
index 000000000000..3f760414b9f8
--- /dev/null
+++ b/arch/powerpc/kvm/e500_emulate.c
@@ -0,0 +1,202 @@
1/*
2 * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
3 *
4 * Author: Yu Liu, <yu.liu@freescale.com>
5 *
6 * Description:
7 * This file is derived from arch/powerpc/kvm/44x_emulate.c,
8 * by Hollis Blanchard <hollisb@us.ibm.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 <asm/kvm_ppc.h>
16#include <asm/disassemble.h>
17#include <asm/kvm_e500.h>
18
19#include "booke.h"
20#include "e500_tlb.h"
21
22#define XOP_TLBIVAX 786
23#define XOP_TLBSX 914
24#define XOP_TLBRE 946
25#define XOP_TLBWE 978
26
27int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
28 unsigned int inst, int *advance)
29{
30 int emulated = EMULATE_DONE;
31 int ra;
32 int rb;
33
34 switch (get_op(inst)) {
35 case 31:
36 switch (get_xop(inst)) {
37
38 case XOP_TLBRE:
39 emulated = kvmppc_e500_emul_tlbre(vcpu);
40 break;
41
42 case XOP_TLBWE:
43 emulated = kvmppc_e500_emul_tlbwe(vcpu);
44 break;
45
46 case XOP_TLBSX:
47 rb = get_rb(inst);
48 emulated = kvmppc_e500_emul_tlbsx(vcpu,rb);
49 break;
50
51 case XOP_TLBIVAX:
52 ra = get_ra(inst);
53 rb = get_rb(inst);
54 emulated = kvmppc_e500_emul_tlbivax(vcpu, ra, rb);
55 break;
56
57 default:
58 emulated = EMULATE_FAIL;
59 }
60
61 break;
62
63 default:
64 emulated = EMULATE_FAIL;
65 }
66
67 if (emulated == EMULATE_FAIL)
68 emulated = kvmppc_booke_emulate_op(run, vcpu, inst, advance);
69
70 return emulated;
71}
72
73int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
74{
75 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
76 int emulated = EMULATE_DONE;
77
78 switch (sprn) {
79 case SPRN_PID:
80 vcpu_e500->pid[0] = vcpu->arch.shadow_pid =
81 vcpu->arch.pid = vcpu->arch.gpr[rs];
82 break;
83 case SPRN_PID1:
84 vcpu_e500->pid[1] = vcpu->arch.gpr[rs]; break;
85 case SPRN_PID2:
86 vcpu_e500->pid[2] = vcpu->arch.gpr[rs]; break;
87 case SPRN_MAS0:
88 vcpu_e500->mas0 = vcpu->arch.gpr[rs]; break;
89 case SPRN_MAS1:
90 vcpu_e500->mas1 = vcpu->arch.gpr[rs]; break;
91 case SPRN_MAS2:
92 vcpu_e500->mas2 = vcpu->arch.gpr[rs]; break;
93 case SPRN_MAS3:
94 vcpu_e500->mas3 = vcpu->arch.gpr[rs]; break;
95 case SPRN_MAS4:
96 vcpu_e500->mas4 = vcpu->arch.gpr[rs]; break;
97 case SPRN_MAS6:
98 vcpu_e500->mas6 = vcpu->arch.gpr[rs]; break;
99 case SPRN_MAS7:
100 vcpu_e500->mas7 = vcpu->arch.gpr[rs]; break;
101 case SPRN_L1CSR1:
102 vcpu_e500->l1csr1 = vcpu->arch.gpr[rs]; break;
103 case SPRN_HID0:
104 vcpu_e500->hid0 = vcpu->arch.gpr[rs]; break;
105 case SPRN_HID1:
106 vcpu_e500->hid1 = vcpu->arch.gpr[rs]; break;
107
108 case SPRN_MMUCSR0:
109 emulated = kvmppc_e500_emul_mt_mmucsr0(vcpu_e500,
110 vcpu->arch.gpr[rs]);
111 break;
112
113 /* extra exceptions */
114 case SPRN_IVOR32:
115 vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL] = vcpu->arch.gpr[rs];
116 break;
117 case SPRN_IVOR33:
118 vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA] = vcpu->arch.gpr[rs];
119 break;
120 case SPRN_IVOR34:
121 vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND] = vcpu->arch.gpr[rs];
122 break;
123 case SPRN_IVOR35:
124 vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR] = vcpu->arch.gpr[rs];
125 break;
126
127 default:
128 emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, rs);
129 }
130
131 return emulated;
132}
133
134int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
135{
136 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
137 int emulated = EMULATE_DONE;
138
139 switch (sprn) {
140 case SPRN_PID:
141 vcpu->arch.gpr[rt] = vcpu_e500->pid[0]; break;
142 case SPRN_PID1:
143 vcpu->arch.gpr[rt] = vcpu_e500->pid[1]; break;
144 case SPRN_PID2:
145 vcpu->arch.gpr[rt] = vcpu_e500->pid[2]; break;
146 case SPRN_MAS0:
147 vcpu->arch.gpr[rt] = vcpu_e500->mas0; break;
148 case SPRN_MAS1:
149 vcpu->arch.gpr[rt] = vcpu_e500->mas1; break;
150 case SPRN_MAS2:
151 vcpu->arch.gpr[rt] = vcpu_e500->mas2; break;
152 case SPRN_MAS3:
153 vcpu->arch.gpr[rt] = vcpu_e500->mas3; break;
154 case SPRN_MAS4:
155 vcpu->arch.gpr[rt] = vcpu_e500->mas4; break;
156 case SPRN_MAS6:
157 vcpu->arch.gpr[rt] = vcpu_e500->mas6; break;
158 case SPRN_MAS7:
159 vcpu->arch.gpr[rt] = vcpu_e500->mas7; break;
160
161 case SPRN_TLB0CFG:
162 vcpu->arch.gpr[rt] = mfspr(SPRN_TLB0CFG);
163 vcpu->arch.gpr[rt] &= ~0xfffUL;
164 vcpu->arch.gpr[rt] |= vcpu_e500->guest_tlb_size[0];
165 break;
166
167 case SPRN_TLB1CFG:
168 vcpu->arch.gpr[rt] = mfspr(SPRN_TLB1CFG);
169 vcpu->arch.gpr[rt] &= ~0xfffUL;
170 vcpu->arch.gpr[rt] |= vcpu_e500->guest_tlb_size[1];
171 break;
172
173 case SPRN_L1CSR1:
174 vcpu->arch.gpr[rt] = vcpu_e500->l1csr1; break;
175 case SPRN_HID0:
176 vcpu->arch.gpr[rt] = vcpu_e500->hid0; break;
177 case SPRN_HID1:
178 vcpu->arch.gpr[rt] = vcpu_e500->hid1; break;
179
180 case SPRN_MMUCSR0:
181 vcpu->arch.gpr[rt] = 0; break;
182
183 /* extra exceptions */
184 case SPRN_IVOR32:
185 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL];
186 break;
187 case SPRN_IVOR33:
188 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA];
189 break;
190 case SPRN_IVOR34:
191 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND];
192 break;
193 case SPRN_IVOR35:
194 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR];
195 break;
196 default:
197 emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, rt);
198 }
199
200 return emulated;
201}
202
diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
new file mode 100644
index 000000000000..0e773fc2d5e4
--- /dev/null
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -0,0 +1,757 @@
1/*
2 * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
3 *
4 * Author: Yu Liu, yu.liu@freescale.com
5 *
6 * Description:
7 * This file is based on arch/powerpc/kvm/44x_tlb.c,
8 * by Hollis Blanchard <hollisb@us.ibm.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/types.h>
16#include <linux/string.h>
17#include <linux/kvm.h>
18#include <linux/kvm_host.h>
19#include <linux/highmem.h>
20#include <asm/kvm_ppc.h>
21#include <asm/kvm_e500.h>
22
23#include "../mm/mmu_decl.h"
24#include "e500_tlb.h"
25
26#define to_htlb1_esel(esel) (tlb1_entry_num - (esel) - 1)
27
28static unsigned int tlb1_entry_num;
29
30void kvmppc_dump_tlbs(struct kvm_vcpu *vcpu)
31{
32 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
33 struct tlbe *tlbe;
34 int i, tlbsel;
35
36 printk("| %8s | %8s | %8s | %8s | %8s |\n",
37 "nr", "mas1", "mas2", "mas3", "mas7");
38
39 for (tlbsel = 0; tlbsel < 2; tlbsel++) {
40 printk("Guest TLB%d:\n", tlbsel);
41 for (i = 0; i < vcpu_e500->guest_tlb_size[tlbsel]; i++) {
42 tlbe = &vcpu_e500->guest_tlb[tlbsel][i];
43 if (tlbe->mas1 & MAS1_VALID)
44 printk(" G[%d][%3d] | %08X | %08X | %08X | %08X |\n",
45 tlbsel, i, tlbe->mas1, tlbe->mas2,
46 tlbe->mas3, tlbe->mas7);
47 }
48 }
49
50 for (tlbsel = 0; tlbsel < 2; tlbsel++) {
51 printk("Shadow TLB%d:\n", tlbsel);
52 for (i = 0; i < vcpu_e500->shadow_tlb_size[tlbsel]; i++) {
53 tlbe = &vcpu_e500->shadow_tlb[tlbsel][i];
54 if (tlbe->mas1 & MAS1_VALID)
55 printk(" S[%d][%3d] | %08X | %08X | %08X | %08X |\n",
56 tlbsel, i, tlbe->mas1, tlbe->mas2,
57 tlbe->mas3, tlbe->mas7);
58 }
59 }
60}
61
62static inline unsigned int tlb0_get_next_victim(
63 struct kvmppc_vcpu_e500 *vcpu_e500)
64{
65 unsigned int victim;
66
67 victim = vcpu_e500->guest_tlb_nv[0]++;
68 if (unlikely(vcpu_e500->guest_tlb_nv[0] >= KVM_E500_TLB0_WAY_NUM))
69 vcpu_e500->guest_tlb_nv[0] = 0;
70
71 return victim;
72}
73
74static inline unsigned int tlb1_max_shadow_size(void)
75{
76 return tlb1_entry_num - tlbcam_index;
77}
78
79static inline int tlbe_is_writable(struct tlbe *tlbe)
80{
81 return tlbe->mas3 & (MAS3_SW|MAS3_UW);
82}
83
84static inline u32 e500_shadow_mas3_attrib(u32 mas3, int usermode)
85{
86 /* Mask off reserved bits. */
87 mas3 &= MAS3_ATTRIB_MASK;
88
89 if (!usermode) {
90 /* Guest is in supervisor mode,
91 * so we need to translate guest
92 * supervisor permissions into user permissions. */
93 mas3 &= ~E500_TLB_USER_PERM_MASK;
94 mas3 |= (mas3 & E500_TLB_SUPER_PERM_MASK) << 1;
95 }
96
97 return mas3 | E500_TLB_SUPER_PERM_MASK;
98}
99
100static inline u32 e500_shadow_mas2_attrib(u32 mas2, int usermode)
101{
102#ifdef CONFIG_SMP
103 return (mas2 & MAS2_ATTRIB_MASK) | MAS2_M;
104#else
105 return mas2 & MAS2_ATTRIB_MASK;
106#endif
107}
108
109/*
110 * writing shadow tlb entry to host TLB
111 */
112static inline void __write_host_tlbe(struct tlbe *stlbe)
113{
114 mtspr(SPRN_MAS1, stlbe->mas1);
115 mtspr(SPRN_MAS2, stlbe->mas2);
116 mtspr(SPRN_MAS3, stlbe->mas3);
117 mtspr(SPRN_MAS7, stlbe->mas7);
118 __asm__ __volatile__ ("tlbwe\n" : : );
119}
120
121static inline void write_host_tlbe(struct kvmppc_vcpu_e500 *vcpu_e500,
122 int tlbsel, int esel)
123{
124 struct tlbe *stlbe = &vcpu_e500->shadow_tlb[tlbsel][esel];
125
126 local_irq_disable();
127 if (tlbsel == 0) {
128 __write_host_tlbe(stlbe);
129 } else {
130 unsigned register mas0;
131
132 mas0 = mfspr(SPRN_MAS0);
133
134 mtspr(SPRN_MAS0, MAS0_TLBSEL(1) | MAS0_ESEL(to_htlb1_esel(esel)));
135 __write_host_tlbe(stlbe);
136
137 mtspr(SPRN_MAS0, mas0);
138 }
139 local_irq_enable();
140}
141
142void kvmppc_e500_tlb_load(struct kvm_vcpu *vcpu, int cpu)
143{
144 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
145 int i;
146 unsigned register mas0;
147
148 /* Load all valid TLB1 entries to reduce guest tlb miss fault */
149 local_irq_disable();
150 mas0 = mfspr(SPRN_MAS0);
151 for (i = 0; i < tlb1_max_shadow_size(); i++) {
152 struct tlbe *stlbe = &vcpu_e500->shadow_tlb[1][i];
153
154 if (get_tlb_v(stlbe)) {
155 mtspr(SPRN_MAS0, MAS0_TLBSEL(1)
156 | MAS0_ESEL(to_htlb1_esel(i)));
157 __write_host_tlbe(stlbe);
158 }
159 }
160 mtspr(SPRN_MAS0, mas0);
161 local_irq_enable();
162}
163
164void kvmppc_e500_tlb_put(struct kvm_vcpu *vcpu)
165{
166 _tlbil_all();
167}
168
169/* Search the guest TLB for a matching entry. */
170static int kvmppc_e500_tlb_index(struct kvmppc_vcpu_e500 *vcpu_e500,
171 gva_t eaddr, int tlbsel, unsigned int pid, int as)
172{
173 int i;
174
175 /* XXX Replace loop with fancy data structures. */
176 for (i = 0; i < vcpu_e500->guest_tlb_size[tlbsel]; i++) {
177 struct tlbe *tlbe = &vcpu_e500->guest_tlb[tlbsel][i];
178 unsigned int tid;
179
180 if (eaddr < get_tlb_eaddr(tlbe))
181 continue;
182
183 if (eaddr > get_tlb_end(tlbe))
184 continue;
185
186 tid = get_tlb_tid(tlbe);
187 if (tid && (tid != pid))
188 continue;
189
190 if (!get_tlb_v(tlbe))
191 continue;
192
193 if (get_tlb_ts(tlbe) != as && as != -1)
194 continue;
195
196 return i;
197 }
198
199 return -1;
200}
201
202static void kvmppc_e500_shadow_release(struct kvmppc_vcpu_e500 *vcpu_e500,
203 int tlbsel, int esel)
204{
205 struct tlbe *stlbe = &vcpu_e500->shadow_tlb[tlbsel][esel];
206 struct page *page = vcpu_e500->shadow_pages[tlbsel][esel];
207
208 if (page) {
209 vcpu_e500->shadow_pages[tlbsel][esel] = NULL;
210
211 if (get_tlb_v(stlbe)) {
212 if (tlbe_is_writable(stlbe))
213 kvm_release_page_dirty(page);
214 else
215 kvm_release_page_clean(page);
216 }
217 }
218}
219
220static void kvmppc_e500_stlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
221 int tlbsel, int esel)
222{
223 struct tlbe *stlbe = &vcpu_e500->shadow_tlb[tlbsel][esel];
224
225 kvmppc_e500_shadow_release(vcpu_e500, tlbsel, esel);
226 stlbe->mas1 = 0;
227 KVMTRACE_5D(STLB_INVAL, &vcpu_e500->vcpu, index_of(tlbsel, esel),
228 stlbe->mas1, stlbe->mas2, stlbe->mas3, stlbe->mas7,
229 handler);
230}
231
232static void kvmppc_e500_tlb1_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
233 gva_t eaddr, gva_t eend, u32 tid)
234{
235 unsigned int pid = tid & 0xff;
236 unsigned int i;
237
238 /* XXX Replace loop with fancy data structures. */
239 for (i = 0; i < vcpu_e500->guest_tlb_size[1]; i++) {
240 struct tlbe *stlbe = &vcpu_e500->shadow_tlb[1][i];
241 unsigned int tid;
242
243 if (!get_tlb_v(stlbe))
244 continue;
245
246 if (eend < get_tlb_eaddr(stlbe))
247 continue;
248
249 if (eaddr > get_tlb_end(stlbe))
250 continue;
251
252 tid = get_tlb_tid(stlbe);
253 if (tid && (tid != pid))
254 continue;
255
256 kvmppc_e500_stlbe_invalidate(vcpu_e500, 1, i);
257 write_host_tlbe(vcpu_e500, 1, i);
258 }
259}
260
261static inline void kvmppc_e500_deliver_tlb_miss(struct kvm_vcpu *vcpu,
262 unsigned int eaddr, int as)
263{
264 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
265 unsigned int victim, pidsel, tsized;
266 int tlbsel;
267
268 /* since we only have two TLBs, only lower bit is used. */
269 tlbsel = (vcpu_e500->mas4 >> 28) & 0x1;
270 victim = (tlbsel == 0) ? tlb0_get_next_victim(vcpu_e500) : 0;
271 pidsel = (vcpu_e500->mas4 >> 16) & 0xf;
272 tsized = (vcpu_e500->mas4 >> 8) & 0xf;
273
274 vcpu_e500->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(victim)
275 | MAS0_NV(vcpu_e500->guest_tlb_nv[tlbsel]);
276 vcpu_e500->mas1 = MAS1_VALID | (as ? MAS1_TS : 0)
277 | MAS1_TID(vcpu_e500->pid[pidsel])
278 | MAS1_TSIZE(tsized);
279 vcpu_e500->mas2 = (eaddr & MAS2_EPN)
280 | (vcpu_e500->mas4 & MAS2_ATTRIB_MASK);
281 vcpu_e500->mas3 &= MAS3_U0 | MAS3_U1 | MAS3_U2 | MAS3_U3;
282 vcpu_e500->mas6 = (vcpu_e500->mas6 & MAS6_SPID1)
283 | (get_cur_pid(vcpu) << 16)
284 | (as ? MAS6_SAS : 0);
285 vcpu_e500->mas7 = 0;
286}
287
288static inline void kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,
289 u64 gvaddr, gfn_t gfn, struct tlbe *gtlbe, int tlbsel, int esel)
290{
291 struct page *new_page;
292 struct tlbe *stlbe;
293 hpa_t hpaddr;
294
295 stlbe = &vcpu_e500->shadow_tlb[tlbsel][esel];
296
297 /* Get reference to new page. */
298 new_page = gfn_to_page(vcpu_e500->vcpu.kvm, gfn);
299 if (is_error_page(new_page)) {
300 printk(KERN_ERR "Couldn't get guest page for gfn %lx!\n", gfn);
301 kvm_release_page_clean(new_page);
302 return;
303 }
304 hpaddr = page_to_phys(new_page);
305
306 /* Drop reference to old page. */
307 kvmppc_e500_shadow_release(vcpu_e500, tlbsel, esel);
308
309 vcpu_e500->shadow_pages[tlbsel][esel] = new_page;
310
311 /* Force TS=1 IPROT=0 TSIZE=4KB for all guest mappings. */
312 stlbe->mas1 = MAS1_TSIZE(BOOKE_PAGESZ_4K)
313 | MAS1_TID(get_tlb_tid(gtlbe)) | MAS1_TS | MAS1_VALID;
314 stlbe->mas2 = (gvaddr & MAS2_EPN)
315 | e500_shadow_mas2_attrib(gtlbe->mas2,
316 vcpu_e500->vcpu.arch.msr & MSR_PR);
317 stlbe->mas3 = (hpaddr & MAS3_RPN)
318 | e500_shadow_mas3_attrib(gtlbe->mas3,
319 vcpu_e500->vcpu.arch.msr & MSR_PR);
320 stlbe->mas7 = (hpaddr >> 32) & MAS7_RPN;
321
322 KVMTRACE_5D(STLB_WRITE, &vcpu_e500->vcpu, index_of(tlbsel, esel),
323 stlbe->mas1, stlbe->mas2, stlbe->mas3, stlbe->mas7,
324 handler);
325}
326
327/* XXX only map the one-one case, for now use TLB0 */
328static int kvmppc_e500_stlbe_map(struct kvmppc_vcpu_e500 *vcpu_e500,
329 int tlbsel, int esel)
330{
331 struct tlbe *gtlbe;
332
333 gtlbe = &vcpu_e500->guest_tlb[tlbsel][esel];
334
335 kvmppc_e500_shadow_map(vcpu_e500, get_tlb_eaddr(gtlbe),
336 get_tlb_raddr(gtlbe) >> PAGE_SHIFT,
337 gtlbe, tlbsel, esel);
338
339 return esel;
340}
341
342/* Caller must ensure that the specified guest TLB entry is safe to insert into
343 * the shadow TLB. */
344/* XXX for both one-one and one-to-many , for now use TLB1 */
345static int kvmppc_e500_tlb1_map(struct kvmppc_vcpu_e500 *vcpu_e500,
346 u64 gvaddr, gfn_t gfn, struct tlbe *gtlbe)
347{
348 unsigned int victim;
349
350 victim = vcpu_e500->guest_tlb_nv[1]++;
351
352 if (unlikely(vcpu_e500->guest_tlb_nv[1] >= tlb1_max_shadow_size()))
353 vcpu_e500->guest_tlb_nv[1] = 0;
354
355 kvmppc_e500_shadow_map(vcpu_e500, gvaddr, gfn, gtlbe, 1, victim);
356
357 return victim;
358}
359
360/* Invalidate all guest kernel mappings when enter usermode,
361 * so that when they fault back in they will get the
362 * proper permission bits. */
363void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode)
364{
365 if (usermode) {
366 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
367 int i;
368
369 /* XXX Replace loop with fancy data structures. */
370 for (i = 0; i < tlb1_max_shadow_size(); i++)
371 kvmppc_e500_stlbe_invalidate(vcpu_e500, 1, i);
372
373 _tlbil_all();
374 }
375}
376
377static int kvmppc_e500_gtlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
378 int tlbsel, int esel)
379{
380 struct tlbe *gtlbe = &vcpu_e500->guest_tlb[tlbsel][esel];
381
382 if (unlikely(get_tlb_iprot(gtlbe)))
383 return -1;
384
385 if (tlbsel == 1) {
386 kvmppc_e500_tlb1_invalidate(vcpu_e500, get_tlb_eaddr(gtlbe),
387 get_tlb_end(gtlbe),
388 get_tlb_tid(gtlbe));
389 } else {
390 kvmppc_e500_stlbe_invalidate(vcpu_e500, tlbsel, esel);
391 }
392
393 gtlbe->mas1 = 0;
394
395 return 0;
396}
397
398int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 *vcpu_e500, ulong value)
399{
400 int esel;
401
402 if (value & MMUCSR0_TLB0FI)
403 for (esel = 0; esel < vcpu_e500->guest_tlb_size[0]; esel++)
404 kvmppc_e500_gtlbe_invalidate(vcpu_e500, 0, esel);
405 if (value & MMUCSR0_TLB1FI)
406 for (esel = 0; esel < vcpu_e500->guest_tlb_size[1]; esel++)
407 kvmppc_e500_gtlbe_invalidate(vcpu_e500, 1, esel);
408
409 _tlbil_all();
410
411 return EMULATE_DONE;
412}
413
414int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *vcpu, int ra, int rb)
415{
416 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
417 unsigned int ia;
418 int esel, tlbsel;
419 gva_t ea;
420
421 ea = ((ra) ? vcpu->arch.gpr[ra] : 0) + vcpu->arch.gpr[rb];
422
423 ia = (ea >> 2) & 0x1;
424
425 /* since we only have two TLBs, only lower bit is used. */
426 tlbsel = (ea >> 3) & 0x1;
427
428 if (ia) {
429 /* invalidate all entries */
430 for (esel = 0; esel < vcpu_e500->guest_tlb_size[tlbsel]; esel++)
431 kvmppc_e500_gtlbe_invalidate(vcpu_e500, tlbsel, esel);
432 } else {
433 ea &= 0xfffff000;
434 esel = kvmppc_e500_tlb_index(vcpu_e500, ea, tlbsel,
435 get_cur_pid(vcpu), -1);
436 if (esel >= 0)
437 kvmppc_e500_gtlbe_invalidate(vcpu_e500, tlbsel, esel);
438 }
439
440 _tlbil_all();
441
442 return EMULATE_DONE;
443}
444
445int kvmppc_e500_emul_tlbre(struct kvm_vcpu *vcpu)
446{
447 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
448 int tlbsel, esel;
449 struct tlbe *gtlbe;
450
451 tlbsel = get_tlb_tlbsel(vcpu_e500);
452 esel = get_tlb_esel(vcpu_e500, tlbsel);
453
454 gtlbe = &vcpu_e500->guest_tlb[tlbsel][esel];
455 vcpu_e500->mas0 &= ~MAS0_NV(~0);
456 vcpu_e500->mas0 |= MAS0_NV(vcpu_e500->guest_tlb_nv[tlbsel]);
457 vcpu_e500->mas1 = gtlbe->mas1;
458 vcpu_e500->mas2 = gtlbe->mas2;
459 vcpu_e500->mas3 = gtlbe->mas3;
460 vcpu_e500->mas7 = gtlbe->mas7;
461
462 return EMULATE_DONE;
463}
464
465int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb)
466{
467 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
468 int as = !!get_cur_sas(vcpu_e500);
469 unsigned int pid = get_cur_spid(vcpu_e500);
470 int esel, tlbsel;
471 struct tlbe *gtlbe = NULL;
472 gva_t ea;
473
474 ea = vcpu->arch.gpr[rb];
475
476 for (tlbsel = 0; tlbsel < 2; tlbsel++) {
477 esel = kvmppc_e500_tlb_index(vcpu_e500, ea, tlbsel, pid, as);
478 if (esel >= 0) {
479 gtlbe = &vcpu_e500->guest_tlb[tlbsel][esel];
480 break;
481 }
482 }
483
484 if (gtlbe) {
485 vcpu_e500->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(esel)
486 | MAS0_NV(vcpu_e500->guest_tlb_nv[tlbsel]);
487 vcpu_e500->mas1 = gtlbe->mas1;
488 vcpu_e500->mas2 = gtlbe->mas2;
489 vcpu_e500->mas3 = gtlbe->mas3;
490 vcpu_e500->mas7 = gtlbe->mas7;
491 } else {
492 int victim;
493
494 /* since we only have two TLBs, only lower bit is used. */
495 tlbsel = vcpu_e500->mas4 >> 28 & 0x1;
496 victim = (tlbsel == 0) ? tlb0_get_next_victim(vcpu_e500) : 0;
497
498 vcpu_e500->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(victim)
499 | MAS0_NV(vcpu_e500->guest_tlb_nv[tlbsel]);
500 vcpu_e500->mas1 = (vcpu_e500->mas6 & MAS6_SPID0)
501 | (vcpu_e500->mas6 & (MAS6_SAS ? MAS1_TS : 0))
502 | (vcpu_e500->mas4 & MAS4_TSIZED(~0));
503 vcpu_e500->mas2 &= MAS2_EPN;
504 vcpu_e500->mas2 |= vcpu_e500->mas4 & MAS2_ATTRIB_MASK;
505 vcpu_e500->mas3 &= MAS3_U0 | MAS3_U1 | MAS3_U2 | MAS3_U3;
506 vcpu_e500->mas7 = 0;
507 }
508
509 return EMULATE_DONE;
510}
511
512int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu)
513{
514 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
515 u64 eaddr;
516 u64 raddr;
517 u32 tid;
518 struct tlbe *gtlbe;
519 int tlbsel, esel, stlbsel, sesel;
520
521 tlbsel = get_tlb_tlbsel(vcpu_e500);
522 esel = get_tlb_esel(vcpu_e500, tlbsel);
523
524 gtlbe = &vcpu_e500->guest_tlb[tlbsel][esel];
525
526 if (get_tlb_v(gtlbe) && tlbsel == 1) {
527 eaddr = get_tlb_eaddr(gtlbe);
528 tid = get_tlb_tid(gtlbe);
529 kvmppc_e500_tlb1_invalidate(vcpu_e500, eaddr,
530 get_tlb_end(gtlbe), tid);
531 }
532
533 gtlbe->mas1 = vcpu_e500->mas1;
534 gtlbe->mas2 = vcpu_e500->mas2;
535 gtlbe->mas3 = vcpu_e500->mas3;
536 gtlbe->mas7 = vcpu_e500->mas7;
537
538 KVMTRACE_5D(GTLB_WRITE, vcpu, vcpu_e500->mas0,
539 gtlbe->mas1, gtlbe->mas2, gtlbe->mas3, gtlbe->mas7,
540 handler);
541
542 /* Invalidate shadow mappings for the about-to-be-clobbered TLBE. */
543 if (tlbe_is_host_safe(vcpu, gtlbe)) {
544 switch (tlbsel) {
545 case 0:
546 /* TLB0 */
547 gtlbe->mas1 &= ~MAS1_TSIZE(~0);
548 gtlbe->mas1 |= MAS1_TSIZE(BOOKE_PAGESZ_4K);
549
550 stlbsel = 0;
551 sesel = kvmppc_e500_stlbe_map(vcpu_e500, 0, esel);
552
553 break;
554
555 case 1:
556 /* TLB1 */
557 eaddr = get_tlb_eaddr(gtlbe);
558 raddr = get_tlb_raddr(gtlbe);
559
560 /* Create a 4KB mapping on the host.
561 * If the guest wanted a large page,
562 * only the first 4KB is mapped here and the rest
563 * are mapped on the fly. */
564 stlbsel = 1;
565 sesel = kvmppc_e500_tlb1_map(vcpu_e500, eaddr,
566 raddr >> PAGE_SHIFT, gtlbe);
567 break;
568
569 default:
570 BUG();
571 }
572 write_host_tlbe(vcpu_e500, stlbsel, sesel);
573 }
574
575 return EMULATE_DONE;
576}
577
578int kvmppc_mmu_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr)
579{
580 unsigned int as = !!(vcpu->arch.msr & MSR_IS);
581
582 return kvmppc_e500_tlb_search(vcpu, eaddr, get_cur_pid(vcpu), as);
583}
584
585int kvmppc_mmu_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr)
586{
587 unsigned int as = !!(vcpu->arch.msr & MSR_DS);
588
589 return kvmppc_e500_tlb_search(vcpu, eaddr, get_cur_pid(vcpu), as);
590}
591
592void kvmppc_mmu_itlb_miss(struct kvm_vcpu *vcpu)
593{
594 unsigned int as = !!(vcpu->arch.msr & MSR_IS);
595
596 kvmppc_e500_deliver_tlb_miss(vcpu, vcpu->arch.pc, as);
597}
598
599void kvmppc_mmu_dtlb_miss(struct kvm_vcpu *vcpu)
600{
601 unsigned int as = !!(vcpu->arch.msr & MSR_DS);
602
603 kvmppc_e500_deliver_tlb_miss(vcpu, vcpu->arch.fault_dear, as);
604}
605
606gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int index,
607 gva_t eaddr)
608{
609 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
610 struct tlbe *gtlbe =
611 &vcpu_e500->guest_tlb[tlbsel_of(index)][esel_of(index)];
612 u64 pgmask = get_tlb_bytes(gtlbe) - 1;
613
614 return get_tlb_raddr(gtlbe) | (eaddr & pgmask);
615}
616
617void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu)
618{
619 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
620 int tlbsel, i;
621
622 for (tlbsel = 0; tlbsel < 2; tlbsel++)
623 for (i = 0; i < vcpu_e500->guest_tlb_size[tlbsel]; i++)
624 kvmppc_e500_shadow_release(vcpu_e500, tlbsel, i);
625
626 /* discard all guest mapping */
627 _tlbil_all();
628}
629
630void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr,
631 unsigned int index)
632{
633 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
634 int tlbsel = tlbsel_of(index);
635 int esel = esel_of(index);
636 int stlbsel, sesel;
637
638 switch (tlbsel) {
639 case 0:
640 stlbsel = 0;
641 sesel = esel;
642 break;
643
644 case 1: {
645 gfn_t gfn = gpaddr >> PAGE_SHIFT;
646 struct tlbe *gtlbe
647 = &vcpu_e500->guest_tlb[tlbsel][esel];
648
649 stlbsel = 1;
650 sesel = kvmppc_e500_tlb1_map(vcpu_e500, eaddr, gfn, gtlbe);
651 break;
652 }
653
654 default:
655 BUG();
656 break;
657 }
658 write_host_tlbe(vcpu_e500, stlbsel, sesel);
659}
660
661int kvmppc_e500_tlb_search(struct kvm_vcpu *vcpu,
662 gva_t eaddr, unsigned int pid, int as)
663{
664 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
665 int esel, tlbsel;
666
667 for (tlbsel = 0; tlbsel < 2; tlbsel++) {
668 esel = kvmppc_e500_tlb_index(vcpu_e500, eaddr, tlbsel, pid, as);
669 if (esel >= 0)
670 return index_of(tlbsel, esel);
671 }
672
673 return -1;
674}
675
676void kvmppc_e500_tlb_setup(struct kvmppc_vcpu_e500 *vcpu_e500)
677{
678 struct tlbe *tlbe;
679
680 /* Insert large initial mapping for guest. */
681 tlbe = &vcpu_e500->guest_tlb[1][0];
682 tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOKE_PAGESZ_256M);
683 tlbe->mas2 = 0;
684 tlbe->mas3 = E500_TLB_SUPER_PERM_MASK;
685 tlbe->mas7 = 0;
686
687 /* 4K map for serial output. Used by kernel wrapper. */
688 tlbe = &vcpu_e500->guest_tlb[1][1];
689 tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOKE_PAGESZ_4K);
690 tlbe->mas2 = (0xe0004500 & 0xFFFFF000) | MAS2_I | MAS2_G;
691 tlbe->mas3 = (0xe0004500 & 0xFFFFF000) | E500_TLB_SUPER_PERM_MASK;
692 tlbe->mas7 = 0;
693}
694
695int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500)
696{
697 tlb1_entry_num = mfspr(SPRN_TLB1CFG) & 0xFFF;
698
699 vcpu_e500->guest_tlb_size[0] = KVM_E500_TLB0_SIZE;
700 vcpu_e500->guest_tlb[0] =
701 kzalloc(sizeof(struct tlbe) * KVM_E500_TLB0_SIZE, GFP_KERNEL);
702 if (vcpu_e500->guest_tlb[0] == NULL)
703 goto err_out;
704
705 vcpu_e500->shadow_tlb_size[0] = KVM_E500_TLB0_SIZE;
706 vcpu_e500->shadow_tlb[0] =
707 kzalloc(sizeof(struct tlbe) * KVM_E500_TLB0_SIZE, GFP_KERNEL);
708 if (vcpu_e500->shadow_tlb[0] == NULL)
709 goto err_out_guest0;
710
711 vcpu_e500->guest_tlb_size[1] = KVM_E500_TLB1_SIZE;
712 vcpu_e500->guest_tlb[1] =
713 kzalloc(sizeof(struct tlbe) * KVM_E500_TLB1_SIZE, GFP_KERNEL);
714 if (vcpu_e500->guest_tlb[1] == NULL)
715 goto err_out_shadow0;
716
717 vcpu_e500->shadow_tlb_size[1] = tlb1_entry_num;
718 vcpu_e500->shadow_tlb[1] =
719 kzalloc(sizeof(struct tlbe) * tlb1_entry_num, GFP_KERNEL);
720 if (vcpu_e500->shadow_tlb[1] == NULL)
721 goto err_out_guest1;
722
723 vcpu_e500->shadow_pages[0] = (struct page **)
724 kzalloc(sizeof(struct page *) * KVM_E500_TLB0_SIZE, GFP_KERNEL);
725 if (vcpu_e500->shadow_pages[0] == NULL)
726 goto err_out_shadow1;
727
728 vcpu_e500->shadow_pages[1] = (struct page **)
729 kzalloc(sizeof(struct page *) * tlb1_entry_num, GFP_KERNEL);
730 if (vcpu_e500->shadow_pages[1] == NULL)
731 goto err_out_page0;
732
733 return 0;
734
735err_out_page0:
736 kfree(vcpu_e500->shadow_pages[0]);
737err_out_shadow1:
738 kfree(vcpu_e500->shadow_tlb[1]);
739err_out_guest1:
740 kfree(vcpu_e500->guest_tlb[1]);
741err_out_shadow0:
742 kfree(vcpu_e500->shadow_tlb[0]);
743err_out_guest0:
744 kfree(vcpu_e500->guest_tlb[0]);
745err_out:
746 return -1;
747}
748
749void kvmppc_e500_tlb_uninit(struct kvmppc_vcpu_e500 *vcpu_e500)
750{
751 kfree(vcpu_e500->shadow_pages[1]);
752 kfree(vcpu_e500->shadow_pages[0]);
753 kfree(vcpu_e500->shadow_tlb[1]);
754 kfree(vcpu_e500->guest_tlb[1]);
755 kfree(vcpu_e500->shadow_tlb[0]);
756 kfree(vcpu_e500->guest_tlb[0]);
757}
diff --git a/arch/powerpc/kvm/e500_tlb.h b/arch/powerpc/kvm/e500_tlb.h
new file mode 100644
index 000000000000..45b064b76906
--- /dev/null
+++ b/arch/powerpc/kvm/e500_tlb.h
@@ -0,0 +1,185 @@
1/*
2 * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
3 *
4 * Author: Yu Liu, yu.liu@freescale.com
5 *
6 * Description:
7 * This file is based on arch/powerpc/kvm/44x_tlb.h,
8 * by Hollis Blanchard <hollisb@us.ibm.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#ifndef __KVM_E500_TLB_H__
16#define __KVM_E500_TLB_H__
17
18#include <linux/kvm_host.h>
19#include <asm/mmu-fsl-booke.h>
20#include <asm/tlb.h>
21#include <asm/kvm_e500.h>
22
23#define KVM_E500_TLB0_WAY_SIZE_BIT 7 /* Fixed */
24#define KVM_E500_TLB0_WAY_SIZE (1UL << KVM_E500_TLB0_WAY_SIZE_BIT)
25#define KVM_E500_TLB0_WAY_SIZE_MASK (KVM_E500_TLB0_WAY_SIZE - 1)
26
27#define KVM_E500_TLB0_WAY_NUM_BIT 1 /* No greater than 7 */
28#define KVM_E500_TLB0_WAY_NUM (1UL << KVM_E500_TLB0_WAY_NUM_BIT)
29#define KVM_E500_TLB0_WAY_NUM_MASK (KVM_E500_TLB0_WAY_NUM - 1)
30
31#define KVM_E500_TLB0_SIZE (KVM_E500_TLB0_WAY_SIZE * KVM_E500_TLB0_WAY_NUM)
32#define KVM_E500_TLB1_SIZE 16
33
34#define index_of(tlbsel, esel) (((tlbsel) << 16) | ((esel) & 0xFFFF))
35#define tlbsel_of(index) ((index) >> 16)
36#define esel_of(index) ((index) & 0xFFFF)
37
38#define E500_TLB_USER_PERM_MASK (MAS3_UX|MAS3_UR|MAS3_UW)
39#define E500_TLB_SUPER_PERM_MASK (MAS3_SX|MAS3_SR|MAS3_SW)
40#define MAS2_ATTRIB_MASK \
41 (MAS2_X0 | MAS2_X1)
42#define MAS3_ATTRIB_MASK \
43 (MAS3_U0 | MAS3_U1 | MAS3_U2 | MAS3_U3 \
44 | E500_TLB_USER_PERM_MASK | E500_TLB_SUPER_PERM_MASK)
45
46extern void kvmppc_dump_tlbs(struct kvm_vcpu *);
47extern int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 *, ulong);
48extern int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *);
49extern int kvmppc_e500_emul_tlbre(struct kvm_vcpu *);
50extern int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *, int, int);
51extern int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *, int);
52extern int kvmppc_e500_tlb_search(struct kvm_vcpu *, gva_t, unsigned int, int);
53extern void kvmppc_e500_tlb_put(struct kvm_vcpu *);
54extern void kvmppc_e500_tlb_load(struct kvm_vcpu *, int);
55extern int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *);
56extern void kvmppc_e500_tlb_uninit(struct kvmppc_vcpu_e500 *);
57extern void kvmppc_e500_tlb_setup(struct kvmppc_vcpu_e500 *);
58
59/* TLB helper functions */
60static inline unsigned int get_tlb_size(const struct tlbe *tlbe)
61{
62 return (tlbe->mas1 >> 8) & 0xf;
63}
64
65static inline gva_t get_tlb_eaddr(const struct tlbe *tlbe)
66{
67 return tlbe->mas2 & 0xfffff000;
68}
69
70static inline u64 get_tlb_bytes(const struct tlbe *tlbe)
71{
72 unsigned int pgsize = get_tlb_size(tlbe);
73 return 1ULL << 10 << (pgsize << 1);
74}
75
76static inline gva_t get_tlb_end(const struct tlbe *tlbe)
77{
78 u64 bytes = get_tlb_bytes(tlbe);
79 return get_tlb_eaddr(tlbe) + bytes - 1;
80}
81
82static inline u64 get_tlb_raddr(const struct tlbe *tlbe)
83{
84 u64 rpn = tlbe->mas7;
85 return (rpn << 32) | (tlbe->mas3 & 0xfffff000);
86}
87
88static inline unsigned int get_tlb_tid(const struct tlbe *tlbe)
89{
90 return (tlbe->mas1 >> 16) & 0xff;
91}
92
93static inline unsigned int get_tlb_ts(const struct tlbe *tlbe)
94{
95 return (tlbe->mas1 >> 12) & 0x1;
96}
97
98static inline unsigned int get_tlb_v(const struct tlbe *tlbe)
99{
100 return (tlbe->mas1 >> 31) & 0x1;
101}
102
103static inline unsigned int get_tlb_iprot(const struct tlbe *tlbe)
104{
105 return (tlbe->mas1 >> 30) & 0x1;
106}
107
108static inline unsigned int get_cur_pid(struct kvm_vcpu *vcpu)
109{
110 return vcpu->arch.pid & 0xff;
111}
112
113static inline unsigned int get_cur_spid(
114 const struct kvmppc_vcpu_e500 *vcpu_e500)
115{
116 return (vcpu_e500->mas6 >> 16) & 0xff;
117}
118
119static inline unsigned int get_cur_sas(
120 const struct kvmppc_vcpu_e500 *vcpu_e500)
121{
122 return vcpu_e500->mas6 & 0x1;
123}
124
125static inline unsigned int get_tlb_tlbsel(
126 const struct kvmppc_vcpu_e500 *vcpu_e500)
127{
128 /*
129 * Manual says that tlbsel has 2 bits wide.
130 * Since we only have two TLBs, only lower bit is used.
131 */
132 return (vcpu_e500->mas0 >> 28) & 0x1;
133}
134
135static inline unsigned int get_tlb_nv_bit(
136 const struct kvmppc_vcpu_e500 *vcpu_e500)
137{
138 return vcpu_e500->mas0 & 0xfff;
139}
140
141static inline unsigned int get_tlb_esel_bit(
142 const struct kvmppc_vcpu_e500 *vcpu_e500)
143{
144 return (vcpu_e500->mas0 >> 16) & 0xfff;
145}
146
147static inline unsigned int get_tlb_esel(
148 const struct kvmppc_vcpu_e500 *vcpu_e500,
149 int tlbsel)
150{
151 unsigned int esel = get_tlb_esel_bit(vcpu_e500);
152
153 if (tlbsel == 0) {
154 esel &= KVM_E500_TLB0_WAY_NUM_MASK;
155 esel |= ((vcpu_e500->mas2 >> 12) & KVM_E500_TLB0_WAY_SIZE_MASK)
156 << KVM_E500_TLB0_WAY_NUM_BIT;
157 } else {
158 esel &= KVM_E500_TLB1_SIZE - 1;
159 }
160
161 return esel;
162}
163
164static inline int tlbe_is_host_safe(const struct kvm_vcpu *vcpu,
165 const struct tlbe *tlbe)
166{
167 gpa_t gpa;
168
169 if (!get_tlb_v(tlbe))
170 return 0;
171
172 /* Does it match current guest AS? */
173 /* XXX what about IS != DS? */
174 if (get_tlb_ts(tlbe) != !!(vcpu->arch.msr & MSR_IS))
175 return 0;
176
177 gpa = get_tlb_raddr(tlbe);
178 if (!gfn_to_memslot(vcpu->kvm, gpa >> PAGE_SHIFT))
179 /* Mapping is not for RAM. */
180 return 0;
181
182 return 1;
183}
184
185#endif /* __KVM_E500_TLB_H__ */
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index d1d38daa93fb..a561d6e8da1c 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -30,6 +30,39 @@
30#include <asm/disassemble.h> 30#include <asm/disassemble.h>
31#include "timing.h" 31#include "timing.h"
32 32
33#define OP_TRAP 3
34
35#define OP_31_XOP_LWZX 23
36#define OP_31_XOP_LBZX 87
37#define OP_31_XOP_STWX 151
38#define OP_31_XOP_STBX 215
39#define OP_31_XOP_STBUX 247
40#define OP_31_XOP_LHZX 279
41#define OP_31_XOP_LHZUX 311
42#define OP_31_XOP_MFSPR 339
43#define OP_31_XOP_STHX 407
44#define OP_31_XOP_STHUX 439
45#define OP_31_XOP_MTSPR 467
46#define OP_31_XOP_DCBI 470
47#define OP_31_XOP_LWBRX 534
48#define OP_31_XOP_TLBSYNC 566
49#define OP_31_XOP_STWBRX 662
50#define OP_31_XOP_LHBRX 790
51#define OP_31_XOP_STHBRX 918
52
53#define OP_LWZ 32
54#define OP_LWZU 33
55#define OP_LBZ 34
56#define OP_LBZU 35
57#define OP_STW 36
58#define OP_STWU 37
59#define OP_STB 38
60#define OP_STBU 39
61#define OP_LHZ 40
62#define OP_LHZU 41
63#define OP_STH 44
64#define OP_STHU 45
65
33void kvmppc_emulate_dec(struct kvm_vcpu *vcpu) 66void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
34{ 67{
35 if (vcpu->arch.tcr & TCR_DIE) { 68 if (vcpu->arch.tcr & TCR_DIE) {
@@ -78,7 +111,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
78 kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS); 111 kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
79 112
80 switch (get_op(inst)) { 113 switch (get_op(inst)) {
81 case 3: /* trap */ 114 case OP_TRAP:
82 vcpu->arch.esr |= ESR_PTR; 115 vcpu->arch.esr |= ESR_PTR;
83 kvmppc_core_queue_program(vcpu); 116 kvmppc_core_queue_program(vcpu);
84 advance = 0; 117 advance = 0;
@@ -87,31 +120,31 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
87 case 31: 120 case 31:
88 switch (get_xop(inst)) { 121 switch (get_xop(inst)) {
89 122
90 case 23: /* lwzx */ 123 case OP_31_XOP_LWZX:
91 rt = get_rt(inst); 124 rt = get_rt(inst);
92 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1); 125 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1);
93 break; 126 break;
94 127
95 case 87: /* lbzx */ 128 case OP_31_XOP_LBZX:
96 rt = get_rt(inst); 129 rt = get_rt(inst);
97 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1); 130 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1);
98 break; 131 break;
99 132
100 case 151: /* stwx */ 133 case OP_31_XOP_STWX:
101 rs = get_rs(inst); 134 rs = get_rs(inst);
102 emulated = kvmppc_handle_store(run, vcpu, 135 emulated = kvmppc_handle_store(run, vcpu,
103 vcpu->arch.gpr[rs], 136 vcpu->arch.gpr[rs],
104 4, 1); 137 4, 1);
105 break; 138 break;
106 139
107 case 215: /* stbx */ 140 case OP_31_XOP_STBX:
108 rs = get_rs(inst); 141 rs = get_rs(inst);
109 emulated = kvmppc_handle_store(run, vcpu, 142 emulated = kvmppc_handle_store(run, vcpu,
110 vcpu->arch.gpr[rs], 143 vcpu->arch.gpr[rs],
111 1, 1); 144 1, 1);
112 break; 145 break;
113 146
114 case 247: /* stbux */ 147 case OP_31_XOP_STBUX:
115 rs = get_rs(inst); 148 rs = get_rs(inst);
116 ra = get_ra(inst); 149 ra = get_ra(inst);
117 rb = get_rb(inst); 150 rb = get_rb(inst);
@@ -126,12 +159,12 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
126 vcpu->arch.gpr[rs] = ea; 159 vcpu->arch.gpr[rs] = ea;
127 break; 160 break;
128 161
129 case 279: /* lhzx */ 162 case OP_31_XOP_LHZX:
130 rt = get_rt(inst); 163 rt = get_rt(inst);
131 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 1); 164 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 1);
132 break; 165 break;
133 166
134 case 311: /* lhzux */ 167 case OP_31_XOP_LHZUX:
135 rt = get_rt(inst); 168 rt = get_rt(inst);
136 ra = get_ra(inst); 169 ra = get_ra(inst);
137 rb = get_rb(inst); 170 rb = get_rb(inst);
@@ -144,7 +177,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
144 vcpu->arch.gpr[ra] = ea; 177 vcpu->arch.gpr[ra] = ea;
145 break; 178 break;
146 179
147 case 339: /* mfspr */ 180 case OP_31_XOP_MFSPR:
148 sprn = get_sprn(inst); 181 sprn = get_sprn(inst);
149 rt = get_rt(inst); 182 rt = get_rt(inst);
150 183
@@ -185,7 +218,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
185 } 218 }
186 break; 219 break;
187 220
188 case 407: /* sthx */ 221 case OP_31_XOP_STHX:
189 rs = get_rs(inst); 222 rs = get_rs(inst);
190 ra = get_ra(inst); 223 ra = get_ra(inst);
191 rb = get_rb(inst); 224 rb = get_rb(inst);
@@ -195,7 +228,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
195 2, 1); 228 2, 1);
196 break; 229 break;
197 230
198 case 439: /* sthux */ 231 case OP_31_XOP_STHUX:
199 rs = get_rs(inst); 232 rs = get_rs(inst);
200 ra = get_ra(inst); 233 ra = get_ra(inst);
201 rb = get_rb(inst); 234 rb = get_rb(inst);
@@ -210,7 +243,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
210 vcpu->arch.gpr[ra] = ea; 243 vcpu->arch.gpr[ra] = ea;
211 break; 244 break;
212 245
213 case 467: /* mtspr */ 246 case OP_31_XOP_MTSPR:
214 sprn = get_sprn(inst); 247 sprn = get_sprn(inst);
215 rs = get_rs(inst); 248 rs = get_rs(inst);
216 switch (sprn) { 249 switch (sprn) {
@@ -246,7 +279,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
246 } 279 }
247 break; 280 break;
248 281
249 case 470: /* dcbi */ 282 case OP_31_XOP_DCBI:
250 /* Do nothing. The guest is performing dcbi because 283 /* Do nothing. The guest is performing dcbi because
251 * hardware DMA is not snooped by the dcache, but 284 * hardware DMA is not snooped by the dcache, but
252 * emulated DMA either goes through the dcache as 285 * emulated DMA either goes through the dcache as
@@ -254,15 +287,15 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
254 * coherence. */ 287 * coherence. */
255 break; 288 break;
256 289
257 case 534: /* lwbrx */ 290 case OP_31_XOP_LWBRX:
258 rt = get_rt(inst); 291 rt = get_rt(inst);
259 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 0); 292 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 0);
260 break; 293 break;
261 294
262 case 566: /* tlbsync */ 295 case OP_31_XOP_TLBSYNC:
263 break; 296 break;
264 297
265 case 662: /* stwbrx */ 298 case OP_31_XOP_STWBRX:
266 rs = get_rs(inst); 299 rs = get_rs(inst);
267 ra = get_ra(inst); 300 ra = get_ra(inst);
268 rb = get_rb(inst); 301 rb = get_rb(inst);
@@ -272,12 +305,12 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
272 4, 0); 305 4, 0);
273 break; 306 break;
274 307
275 case 790: /* lhbrx */ 308 case OP_31_XOP_LHBRX:
276 rt = get_rt(inst); 309 rt = get_rt(inst);
277 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 0); 310 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 0);
278 break; 311 break;
279 312
280 case 918: /* sthbrx */ 313 case OP_31_XOP_STHBRX:
281 rs = get_rs(inst); 314 rs = get_rs(inst);
282 ra = get_ra(inst); 315 ra = get_ra(inst);
283 rb = get_rb(inst); 316 rb = get_rb(inst);
@@ -293,37 +326,37 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
293 } 326 }
294 break; 327 break;
295 328
296 case 32: /* lwz */ 329 case OP_LWZ:
297 rt = get_rt(inst); 330 rt = get_rt(inst);
298 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1); 331 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1);
299 break; 332 break;
300 333
301 case 33: /* lwzu */ 334 case OP_LWZU:
302 ra = get_ra(inst); 335 ra = get_ra(inst);
303 rt = get_rt(inst); 336 rt = get_rt(inst);
304 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1); 337 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1);
305 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed; 338 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed;
306 break; 339 break;
307 340
308 case 34: /* lbz */ 341 case OP_LBZ:
309 rt = get_rt(inst); 342 rt = get_rt(inst);
310 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1); 343 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1);
311 break; 344 break;
312 345
313 case 35: /* lbzu */ 346 case OP_LBZU:
314 ra = get_ra(inst); 347 ra = get_ra(inst);
315 rt = get_rt(inst); 348 rt = get_rt(inst);
316 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1); 349 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1);
317 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed; 350 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed;
318 break; 351 break;
319 352
320 case 36: /* stw */ 353 case OP_STW:
321 rs = get_rs(inst); 354 rs = get_rs(inst);
322 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs], 355 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs],
323 4, 1); 356 4, 1);
324 break; 357 break;
325 358
326 case 37: /* stwu */ 359 case OP_STWU:
327 ra = get_ra(inst); 360 ra = get_ra(inst);
328 rs = get_rs(inst); 361 rs = get_rs(inst);
329 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs], 362 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs],
@@ -331,13 +364,13 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
331 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed; 364 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed;
332 break; 365 break;
333 366
334 case 38: /* stb */ 367 case OP_STB:
335 rs = get_rs(inst); 368 rs = get_rs(inst);
336 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs], 369 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs],
337 1, 1); 370 1, 1);
338 break; 371 break;
339 372
340 case 39: /* stbu */ 373 case OP_STBU:
341 ra = get_ra(inst); 374 ra = get_ra(inst);
342 rs = get_rs(inst); 375 rs = get_rs(inst);
343 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs], 376 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs],
@@ -345,25 +378,25 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
345 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed; 378 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed;
346 break; 379 break;
347 380
348 case 40: /* lhz */ 381 case OP_LHZ:
349 rt = get_rt(inst); 382 rt = get_rt(inst);
350 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 1); 383 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 1);
351 break; 384 break;
352 385
353 case 41: /* lhzu */ 386 case OP_LHZU:
354 ra = get_ra(inst); 387 ra = get_ra(inst);
355 rt = get_rt(inst); 388 rt = get_rt(inst);
356 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 1); 389 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 1);
357 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed; 390 vcpu->arch.gpr[ra] = vcpu->arch.paddr_accessed;
358 break; 391 break;
359 392
360 case 44: /* sth */ 393 case OP_STH:
361 rs = get_rs(inst); 394 rs = get_rs(inst);
362 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs], 395 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs],
363 2, 1); 396 2, 1);
364 break; 397 break;
365 398
366 case 45: /* sthu */ 399 case OP_STHU:
367 ra = get_ra(inst); 400 ra = get_ra(inst);
368 rs = get_rs(inst); 401 rs = get_rs(inst);
369 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs], 402 emulated = kvmppc_handle_store(run, vcpu, vcpu->arch.gpr[rs],
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 5f81256287f5..9057335fdc61 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -216,46 +216,23 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
216 216
217void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) 217void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
218{ 218{
219 kvmppc_core_destroy_mmu(vcpu); 219 kvmppc_mmu_destroy(vcpu);
220} 220}
221 221
222void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 222void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
223{ 223{
224 if (vcpu->guest_debug.enabled)
225 kvmppc_core_load_guest_debugstate(vcpu);
226
227 kvmppc_core_vcpu_load(vcpu, cpu); 224 kvmppc_core_vcpu_load(vcpu, cpu);
228} 225}
229 226
230void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) 227void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
231{ 228{
232 if (vcpu->guest_debug.enabled)
233 kvmppc_core_load_host_debugstate(vcpu);
234
235 /* Don't leave guest TLB entries resident when being de-scheduled. */
236 /* XXX It would be nice to differentiate between heavyweight exit and
237 * sched_out here, since we could avoid the TLB flush for heavyweight
238 * exits. */
239 _tlbil_all();
240 kvmppc_core_vcpu_put(vcpu); 229 kvmppc_core_vcpu_put(vcpu);
241} 230}
242 231
243int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, 232int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
244 struct kvm_debug_guest *dbg) 233 struct kvm_guest_debug *dbg)
245{ 234{
246 int i; 235 return -EINVAL;
247
248 vcpu->guest_debug.enabled = dbg->enabled;
249 if (vcpu->guest_debug.enabled) {
250 for (i=0; i < ARRAY_SIZE(vcpu->guest_debug.bp); i++) {
251 if (dbg->breakpoints[i].enabled)
252 vcpu->guest_debug.bp[i] = dbg->breakpoints[i].address;
253 else
254 vcpu->guest_debug.bp[i] = 0;
255 }
256 }
257
258 return 0;
259} 236}
260 237
261static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu, 238static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 28c04dab2633..882e47080e74 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -237,8 +237,6 @@ extern int noirqdebug;
237 237
238static void handle_iic_irq(unsigned int irq, struct irq_desc *desc) 238static void handle_iic_irq(unsigned int irq, struct irq_desc *desc)
239{ 239{
240 const unsigned int cpu = smp_processor_id();
241
242 spin_lock(&desc->lock); 240 spin_lock(&desc->lock);
243 241
244 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); 242 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
@@ -254,7 +252,7 @@ static void handle_iic_irq(unsigned int irq, struct irq_desc *desc)
254 goto out_eoi; 252 goto out_eoi;
255 } 253 }
256 254
257 kstat_cpu(cpu).irqs[irq]++; 255 kstat_incr_irqs_this_cpu(irq, desc);
258 256
259 /* Mark the IRQ currently in progress.*/ 257 /* Mark the IRQ currently in progress.*/
260 desc->status |= IRQ_INPROGRESS; 258 desc->status |= IRQ_INPROGRESS;
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 6a0ad196aeb3..f085369301b1 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -508,7 +508,7 @@ static void __spu_add_to_rq(struct spu_context *ctx)
508 list_add_tail(&ctx->rq, &spu_prio->runq[ctx->prio]); 508 list_add_tail(&ctx->rq, &spu_prio->runq[ctx->prio]);
509 set_bit(ctx->prio, spu_prio->bitmap); 509 set_bit(ctx->prio, spu_prio->bitmap);
510 if (!spu_prio->nr_waiting++) 510 if (!spu_prio->nr_waiting++)
511 __mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK); 511 mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
512 } 512 }
513} 513}
514 514
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 58311a867851..a705fffbb498 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -376,7 +376,7 @@ static int ps3_system_bus_probe(struct device *_dev)
376 struct ps3_system_bus_driver *drv; 376 struct ps3_system_bus_driver *drv;
377 377
378 BUG_ON(!dev); 378 BUG_ON(!dev);
379 pr_debug(" -> %s:%d: %s\n", __func__, __LINE__, _dev->bus_id); 379 dev_dbg(_dev, "%s:%d\n", __func__, __LINE__);
380 380
381 drv = ps3_system_bus_dev_to_system_bus_drv(dev); 381 drv = ps3_system_bus_dev_to_system_bus_drv(dev);
382 BUG_ON(!drv); 382 BUG_ON(!drv);
@@ -398,7 +398,7 @@ static int ps3_system_bus_remove(struct device *_dev)
398 struct ps3_system_bus_driver *drv; 398 struct ps3_system_bus_driver *drv;
399 399
400 BUG_ON(!dev); 400 BUG_ON(!dev);
401 pr_debug(" -> %s:%d: %s\n", __func__, __LINE__, _dev->bus_id); 401 dev_dbg(_dev, "%s:%d\n", __func__, __LINE__);
402 402
403 drv = ps3_system_bus_dev_to_system_bus_drv(dev); 403 drv = ps3_system_bus_dev_to_system_bus_drv(dev);
404 BUG_ON(!drv); 404 BUG_ON(!drv);
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 84e058f1e1cc..80b513449f4c 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -153,9 +153,10 @@ static int get_irq_server(unsigned int virq, unsigned int strict_check)
153{ 153{
154 int server; 154 int server;
155 /* For the moment only implement delivery to all cpus or one cpu */ 155 /* For the moment only implement delivery to all cpus or one cpu */
156 cpumask_t cpumask = irq_desc[virq].affinity; 156 cpumask_t cpumask;
157 cpumask_t tmp = CPU_MASK_NONE; 157 cpumask_t tmp = CPU_MASK_NONE;
158 158
159 cpumask_copy(&cpumask, irq_desc[virq].affinity);
159 if (!distribute_irqs) 160 if (!distribute_irqs)
160 return default_server; 161 return default_server;
161 162
@@ -869,7 +870,7 @@ void xics_migrate_irqs_away(void)
869 virq, cpu); 870 virq, cpu);
870 871
871 /* Reset affinity to all cpus */ 872 /* Reset affinity to all cpus */
872 irq_desc[virq].affinity = CPU_MASK_ALL; 873 cpumask_setall(irq_desc[virq].affinity);
873 desc->chip->set_affinity(virq, cpu_all_mask); 874 desc->chip->set_affinity(virq, cpu_all_mask);
874unlock: 875unlock:
875 spin_unlock_irqrestore(&desc->lock, flags); 876 spin_unlock_irqrestore(&desc->lock, flags);
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index a35297dbac28..532e205303a2 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -566,9 +566,10 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
566#ifdef CONFIG_SMP 566#ifdef CONFIG_SMP
567static int irq_choose_cpu(unsigned int virt_irq) 567static int irq_choose_cpu(unsigned int virt_irq)
568{ 568{
569 cpumask_t mask = irq_desc[virt_irq].affinity; 569 cpumask_t mask;
570 int cpuid; 570 int cpuid;
571 571
572 cpumask_copy(&mask, irq_desc[virt_irq].affinity);
572 if (cpus_equal(mask, CPU_MASK_ALL)) { 573 if (cpus_equal(mask, CPU_MASK_ALL)) {
573 static int irq_rover; 574 static int irq_rover;
574 static DEFINE_SPINLOCK(irq_rover_lock); 575 static DEFINE_SPINLOCK(irq_rover_lock);
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 6b0a3538dc63..2a8af5e16345 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -343,13 +343,6 @@ source "mm/Kconfig"
343 343
344comment "I/O subsystem configuration" 344comment "I/O subsystem configuration"
345 345
346config MACHCHK_WARNING
347 bool "Process warning machine checks"
348 help
349 Select this option if you want the machine check handler on IBM S/390 or
350 zSeries to process warning machine checks (e.g. on power failures).
351 If unsure, say "Y".
352
353config QDIO 346config QDIO
354 tristate "QDIO support" 347 tristate "QDIO support"
355 ---help--- 348 ---help---
@@ -521,7 +514,7 @@ config APPLDATA_OS
521 514
522config APPLDATA_NET_SUM 515config APPLDATA_NET_SUM
523 tristate "Monitor overall network statistics" 516 tristate "Monitor overall network statistics"
524 depends on APPLDATA_BASE 517 depends on APPLDATA_BASE && NET
525 help 518 help
526 This provides network related data to the Linux - VM Monitor Stream, 519 This provides network related data to the Linux - VM Monitor Stream,
527 currently there is only a total sum of network I/O statistics, no 520 currently there is only a total sum of network I/O statistics, no
@@ -552,7 +545,7 @@ config KEXEC
552 but is independent of hardware/microcode support. 545 but is independent of hardware/microcode support.
553 546
554config ZFCPDUMP 547config ZFCPDUMP
555 tristate "zfcpdump support" 548 bool "zfcpdump support"
556 select SMP 549 select SMP
557 default n 550 default n
558 help 551 help
diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c
index eca724d229ec..b49c00ce65e9 100644
--- a/arch/s390/crypto/prng.c
+++ b/arch/s390/crypto/prng.c
@@ -201,8 +201,7 @@ out_free:
201static void __exit prng_exit(void) 201static void __exit prng_exit(void)
202{ 202{
203 /* wipe me */ 203 /* wipe me */
204 memset(p->buf, 0, prng_chunk_size); 204 kzfree(p->buf);
205 kfree(p->buf);
206 kfree(p); 205 kfree(p);
207 206
208 misc_deregister(&prng_dev); 207 misc_deregister(&prng_dev);
diff --git a/arch/s390/crypto/sha.h b/arch/s390/crypto/sha.h
index 1ceafa571eab..f4e9dc71675f 100644
--- a/arch/s390/crypto/sha.h
+++ b/arch/s390/crypto/sha.h
@@ -29,7 +29,9 @@ struct s390_sha_ctx {
29 int func; /* KIMD function to use */ 29 int func; /* KIMD function to use */
30}; 30};
31 31
32void s390_sha_update(struct crypto_tfm *tfm, const u8 *data, unsigned int len); 32struct shash_desc;
33void s390_sha_final(struct crypto_tfm *tfm, u8 *out); 33
34int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len);
35int s390_sha_final(struct shash_desc *desc, u8 *out);
34 36
35#endif 37#endif
diff --git a/arch/s390/crypto/sha1_s390.c b/arch/s390/crypto/sha1_s390.c
index b3cb5a89b00d..e85ba348722a 100644
--- a/arch/s390/crypto/sha1_s390.c
+++ b/arch/s390/crypto/sha1_s390.c
@@ -23,17 +23,17 @@
23 * any later version. 23 * any later version.
24 * 24 *
25 */ 25 */
26#include <crypto/internal/hash.h>
26#include <linux/init.h> 27#include <linux/init.h>
27#include <linux/module.h> 28#include <linux/module.h>
28#include <linux/crypto.h>
29#include <crypto/sha.h> 29#include <crypto/sha.h>
30 30
31#include "crypt_s390.h" 31#include "crypt_s390.h"
32#include "sha.h" 32#include "sha.h"
33 33
34static void sha1_init(struct crypto_tfm *tfm) 34static int sha1_init(struct shash_desc *desc)
35{ 35{
36 struct s390_sha_ctx *sctx = crypto_tfm_ctx(tfm); 36 struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
37 37
38 sctx->state[0] = SHA1_H0; 38 sctx->state[0] = SHA1_H0;
39 sctx->state[1] = SHA1_H1; 39 sctx->state[1] = SHA1_H1;
@@ -42,34 +42,36 @@ static void sha1_init(struct crypto_tfm *tfm)
42 sctx->state[4] = SHA1_H4; 42 sctx->state[4] = SHA1_H4;
43 sctx->count = 0; 43 sctx->count = 0;
44 sctx->func = KIMD_SHA_1; 44 sctx->func = KIMD_SHA_1;
45
46 return 0;
45} 47}
46 48
47static struct crypto_alg alg = { 49static struct shash_alg alg = {
48 .cra_name = "sha1", 50 .digestsize = SHA1_DIGEST_SIZE,
49 .cra_driver_name= "sha1-s390", 51 .init = sha1_init,
50 .cra_priority = CRYPT_S390_PRIORITY, 52 .update = s390_sha_update,
51 .cra_flags = CRYPTO_ALG_TYPE_DIGEST, 53 .final = s390_sha_final,
52 .cra_blocksize = SHA1_BLOCK_SIZE, 54 .descsize = sizeof(struct s390_sha_ctx),
53 .cra_ctxsize = sizeof(struct s390_sha_ctx), 55 .base = {
54 .cra_module = THIS_MODULE, 56 .cra_name = "sha1",
55 .cra_list = LIST_HEAD_INIT(alg.cra_list), 57 .cra_driver_name= "sha1-s390",
56 .cra_u = { .digest = { 58 .cra_priority = CRYPT_S390_PRIORITY,
57 .dia_digestsize = SHA1_DIGEST_SIZE, 59 .cra_flags = CRYPTO_ALG_TYPE_SHASH,
58 .dia_init = sha1_init, 60 .cra_blocksize = SHA1_BLOCK_SIZE,
59 .dia_update = s390_sha_update, 61 .cra_module = THIS_MODULE,
60 .dia_final = s390_sha_final } } 62 }
61}; 63};
62 64
63static int __init sha1_s390_init(void) 65static int __init sha1_s390_init(void)
64{ 66{
65 if (!crypt_s390_func_available(KIMD_SHA_1)) 67 if (!crypt_s390_func_available(KIMD_SHA_1))
66 return -EOPNOTSUPP; 68 return -EOPNOTSUPP;
67 return crypto_register_alg(&alg); 69 return crypto_register_shash(&alg);
68} 70}
69 71
70static void __exit sha1_s390_fini(void) 72static void __exit sha1_s390_fini(void)
71{ 73{
72 crypto_unregister_alg(&alg); 74 crypto_unregister_shash(&alg);
73} 75}
74 76
75module_init(sha1_s390_init); 77module_init(sha1_s390_init);
diff --git a/arch/s390/crypto/sha256_s390.c b/arch/s390/crypto/sha256_s390.c
index 19c03fb6ba7e..f9fefc569632 100644
--- a/arch/s390/crypto/sha256_s390.c
+++ b/arch/s390/crypto/sha256_s390.c
@@ -16,17 +16,17 @@
16 * any later version. 16 * any later version.
17 * 17 *
18 */ 18 */
19#include <crypto/internal/hash.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/module.h> 21#include <linux/module.h>
21#include <linux/crypto.h>
22#include <crypto/sha.h> 22#include <crypto/sha.h>
23 23
24#include "crypt_s390.h" 24#include "crypt_s390.h"
25#include "sha.h" 25#include "sha.h"
26 26
27static void sha256_init(struct crypto_tfm *tfm) 27static int sha256_init(struct shash_desc *desc)
28{ 28{
29 struct s390_sha_ctx *sctx = crypto_tfm_ctx(tfm); 29 struct s390_sha_ctx *sctx = shash_desc_ctx(desc);
30 30
31 sctx->state[0] = SHA256_H0; 31 sctx->state[0] = SHA256_H0;
32 sctx->state[1] = SHA256_H1; 32 sctx->state[1] = SHA256_H1;
@@ -38,22 +38,24 @@ static void sha256_init(struct crypto_tfm *tfm)
38 sctx->state[7] = SHA256_H7; 38 sctx->state[7] = SHA256_H7;
39 sctx->count = 0; 39 sctx->count = 0;
40 sctx->func = KIMD_SHA_256; 40 sctx->func = KIMD_SHA_256;
41
42 return 0;
41} 43}
42 44
43static struct crypto_alg alg = { 45static struct shash_alg alg = {
44 .cra_name = "sha256", 46 .digestsize = SHA256_DIGEST_SIZE,
45 .cra_driver_name = "sha256-s390", 47 .init = sha256_init,
46 .cra_priority = CRYPT_S390_PRIORITY, 48 .update = s390_sha_update,
47 .cra_flags = CRYPTO_ALG_TYPE_DIGEST, 49 .final = s390_sha_final,
48 .cra_blocksize = SHA256_BLOCK_SIZE, 50 .descsize = sizeof(struct s390_sha_ctx),
49 .cra_ctxsize = sizeof(struct s390_sha_ctx), 51 .base = {
50 .cra_module = THIS_MODULE, 52 .cra_name = "sha256",
51 .cra_list = LIST_HEAD_INIT(alg.cra_list), 53 .cra_driver_name= "sha256-s390",
52 .cra_u = { .digest = { 54 .cra_priority = CRYPT_S390_PRIORITY,
53 .dia_digestsize = SHA256_DIGEST_SIZE, 55 .cra_flags = CRYPTO_ALG_TYPE_SHASH,
54 .dia_init = sha256_init, 56 .cra_blocksize = SHA256_BLOCK_SIZE,
55 .dia_update = s390_sha_update, 57 .cra_module = THIS_MODULE,
56 .dia_final = s390_sha_final } } 58 }
57}; 59};
58 60
59static int sha256_s390_init(void) 61static int sha256_s390_init(void)
@@ -61,12 +63,12 @@ static int sha256_s390_init(void)
61 if (!crypt_s390_func_available(KIMD_SHA_256)) 63 if (!crypt_s390_func_available(KIMD_SHA_256))
62 return -EOPNOTSUPP; 64 return -EOPNOTSUPP;
63 65
64 return crypto_register_alg(&alg); 66 return crypto_register_shash(&alg);
65} 67}
66 68
67static void __exit sha256_s390_fini(void) 69static void __exit sha256_s390_fini(void)
68{ 70{
69 crypto_unregister_alg(&alg); 71 crypto_unregister_shash(&alg);
70} 72}
71 73
72module_init(sha256_s390_init); 74module_init(sha256_s390_init);
diff --git a/arch/s390/crypto/sha512_s390.c b/arch/s390/crypto/sha512_s390.c
index 23c7861f6aeb..83192bfc8048 100644
--- a/arch/s390/crypto/sha512_s390.c
+++ b/arch/s390/crypto/sha512_s390.c
@@ -12,16 +12,16 @@
12 * any later version. 12 * any later version.
13 * 13 *
14 */ 14 */
15#include <crypto/internal/hash.h>
15#include <linux/init.h> 16#include <linux/init.h>
16#include <linux/module.h> 17#include <linux/module.h>
17#include <linux/crypto.h>
18 18
19#include "sha.h" 19#include "sha.h"
20#include "crypt_s390.h" 20#include "crypt_s390.h"
21 21
22static void sha512_init(struct crypto_tfm *tfm) 22static int sha512_init(struct shash_desc *desc)
23{ 23{
24 struct s390_sha_ctx *ctx = crypto_tfm_ctx(tfm); 24 struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
25 25
26 *(__u64 *)&ctx->state[0] = 0x6a09e667f3bcc908ULL; 26 *(__u64 *)&ctx->state[0] = 0x6a09e667f3bcc908ULL;
27 *(__u64 *)&ctx->state[2] = 0xbb67ae8584caa73bULL; 27 *(__u64 *)&ctx->state[2] = 0xbb67ae8584caa73bULL;
@@ -33,29 +33,31 @@ static void sha512_init(struct crypto_tfm *tfm)
33 *(__u64 *)&ctx->state[14] = 0x5be0cd19137e2179ULL; 33 *(__u64 *)&ctx->state[14] = 0x5be0cd19137e2179ULL;
34 ctx->count = 0; 34 ctx->count = 0;
35 ctx->func = KIMD_SHA_512; 35 ctx->func = KIMD_SHA_512;
36
37 return 0;
36} 38}
37 39
38static struct crypto_alg sha512_alg = { 40static struct shash_alg sha512_alg = {
39 .cra_name = "sha512", 41 .digestsize = SHA512_DIGEST_SIZE,
40 .cra_driver_name = "sha512-s390", 42 .init = sha512_init,
41 .cra_priority = CRYPT_S390_PRIORITY, 43 .update = s390_sha_update,
42 .cra_flags = CRYPTO_ALG_TYPE_DIGEST, 44 .final = s390_sha_final,
43 .cra_blocksize = SHA512_BLOCK_SIZE, 45 .descsize = sizeof(struct s390_sha_ctx),
44 .cra_ctxsize = sizeof(struct s390_sha_ctx), 46 .base = {
45 .cra_module = THIS_MODULE, 47 .cra_name = "sha512",
46 .cra_list = LIST_HEAD_INIT(sha512_alg.cra_list), 48 .cra_driver_name= "sha512-s390",
47 .cra_u = { .digest = { 49 .cra_priority = CRYPT_S390_PRIORITY,
48 .dia_digestsize = SHA512_DIGEST_SIZE, 50 .cra_flags = CRYPTO_ALG_TYPE_SHASH,
49 .dia_init = sha512_init, 51 .cra_blocksize = SHA512_BLOCK_SIZE,
50 .dia_update = s390_sha_update, 52 .cra_module = THIS_MODULE,
51 .dia_final = s390_sha_final } } 53 }
52}; 54};
53 55
54MODULE_ALIAS("sha512"); 56MODULE_ALIAS("sha512");
55 57
56static void sha384_init(struct crypto_tfm *tfm) 58static int sha384_init(struct shash_desc *desc)
57{ 59{
58 struct s390_sha_ctx *ctx = crypto_tfm_ctx(tfm); 60 struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
59 61
60 *(__u64 *)&ctx->state[0] = 0xcbbb9d5dc1059ed8ULL; 62 *(__u64 *)&ctx->state[0] = 0xcbbb9d5dc1059ed8ULL;
61 *(__u64 *)&ctx->state[2] = 0x629a292a367cd507ULL; 63 *(__u64 *)&ctx->state[2] = 0x629a292a367cd507ULL;
@@ -67,22 +69,25 @@ static void sha384_init(struct crypto_tfm *tfm)
67 *(__u64 *)&ctx->state[14] = 0x47b5481dbefa4fa4ULL; 69 *(__u64 *)&ctx->state[14] = 0x47b5481dbefa4fa4ULL;
68 ctx->count = 0; 70 ctx->count = 0;
69 ctx->func = KIMD_SHA_512; 71 ctx->func = KIMD_SHA_512;
72
73 return 0;
70} 74}
71 75
72static struct crypto_alg sha384_alg = { 76static struct shash_alg sha384_alg = {
73 .cra_name = "sha384", 77 .digestsize = SHA384_DIGEST_SIZE,
74 .cra_driver_name = "sha384-s390", 78 .init = sha384_init,
75 .cra_priority = CRYPT_S390_PRIORITY, 79 .update = s390_sha_update,
76 .cra_flags = CRYPTO_ALG_TYPE_DIGEST, 80 .final = s390_sha_final,
77 .cra_blocksize = SHA384_BLOCK_SIZE, 81 .descsize = sizeof(struct s390_sha_ctx),
78 .cra_ctxsize = sizeof(struct s390_sha_ctx), 82 .base = {
79 .cra_module = THIS_MODULE, 83 .cra_name = "sha384",
80 .cra_list = LIST_HEAD_INIT(sha384_alg.cra_list), 84 .cra_driver_name= "sha384-s390",
81 .cra_u = { .digest = { 85 .cra_priority = CRYPT_S390_PRIORITY,
82 .dia_digestsize = SHA384_DIGEST_SIZE, 86 .cra_flags = CRYPTO_ALG_TYPE_SHASH,
83 .dia_init = sha384_init, 87 .cra_blocksize = SHA384_BLOCK_SIZE,
84 .dia_update = s390_sha_update, 88 .cra_ctxsize = sizeof(struct s390_sha_ctx),
85 .dia_final = s390_sha_final } } 89 .cra_module = THIS_MODULE,
90 }
86}; 91};
87 92
88MODULE_ALIAS("sha384"); 93MODULE_ALIAS("sha384");
@@ -93,18 +98,18 @@ static int __init init(void)
93 98
94 if (!crypt_s390_func_available(KIMD_SHA_512)) 99 if (!crypt_s390_func_available(KIMD_SHA_512))
95 return -EOPNOTSUPP; 100 return -EOPNOTSUPP;
96 if ((ret = crypto_register_alg(&sha512_alg)) < 0) 101 if ((ret = crypto_register_shash(&sha512_alg)) < 0)
97 goto out; 102 goto out;
98 if ((ret = crypto_register_alg(&sha384_alg)) < 0) 103 if ((ret = crypto_register_shash(&sha384_alg)) < 0)
99 crypto_unregister_alg(&sha512_alg); 104 crypto_unregister_shash(&sha512_alg);
100out: 105out:
101 return ret; 106 return ret;
102} 107}
103 108
104static void __exit fini(void) 109static void __exit fini(void)
105{ 110{
106 crypto_unregister_alg(&sha512_alg); 111 crypto_unregister_shash(&sha512_alg);
107 crypto_unregister_alg(&sha384_alg); 112 crypto_unregister_shash(&sha384_alg);
108} 113}
109 114
110module_init(init); 115module_init(init);
diff --git a/arch/s390/crypto/sha_common.c b/arch/s390/crypto/sha_common.c
index 9d6eb8c3d37e..7903ec47e6b9 100644
--- a/arch/s390/crypto/sha_common.c
+++ b/arch/s390/crypto/sha_common.c
@@ -13,14 +13,14 @@
13 * 13 *
14 */ 14 */
15 15
16#include <linux/crypto.h> 16#include <crypto/internal/hash.h>
17#include "sha.h" 17#include "sha.h"
18#include "crypt_s390.h" 18#include "crypt_s390.h"
19 19
20void s390_sha_update(struct crypto_tfm *tfm, const u8 *data, unsigned int len) 20int s390_sha_update(struct shash_desc *desc, const u8 *data, unsigned int len)
21{ 21{
22 struct s390_sha_ctx *ctx = crypto_tfm_ctx(tfm); 22 struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
23 unsigned int bsize = crypto_tfm_alg_blocksize(tfm); 23 unsigned int bsize = crypto_shash_blocksize(desc->tfm);
24 unsigned int index; 24 unsigned int index;
25 int ret; 25 int ret;
26 26
@@ -51,13 +51,15 @@ void s390_sha_update(struct crypto_tfm *tfm, const u8 *data, unsigned int len)
51store: 51store:
52 if (len) 52 if (len)
53 memcpy(ctx->buf + index , data, len); 53 memcpy(ctx->buf + index , data, len);
54
55 return 0;
54} 56}
55EXPORT_SYMBOL_GPL(s390_sha_update); 57EXPORT_SYMBOL_GPL(s390_sha_update);
56 58
57void s390_sha_final(struct crypto_tfm *tfm, u8 *out) 59int s390_sha_final(struct shash_desc *desc, u8 *out)
58{ 60{
59 struct s390_sha_ctx *ctx = crypto_tfm_ctx(tfm); 61 struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
60 unsigned int bsize = crypto_tfm_alg_blocksize(tfm); 62 unsigned int bsize = crypto_shash_blocksize(desc->tfm);
61 u64 bits; 63 u64 bits;
62 unsigned int index, end, plen; 64 unsigned int index, end, plen;
63 int ret; 65 int ret;
@@ -87,9 +89,11 @@ void s390_sha_final(struct crypto_tfm *tfm, u8 *out)
87 BUG_ON(ret != end); 89 BUG_ON(ret != end);
88 90
89 /* copy digest to out */ 91 /* copy digest to out */
90 memcpy(out, ctx->state, crypto_hash_digestsize(crypto_hash_cast(tfm))); 92 memcpy(out, ctx->state, crypto_shash_digestsize(desc->tfm));
91 /* wipe context */ 93 /* wipe context */
92 memset(ctx, 0, sizeof *ctx); 94 memset(ctx, 0, sizeof *ctx);
95
96 return 0;
93} 97}
94EXPORT_SYMBOL_GPL(s390_sha_final); 98EXPORT_SYMBOL_GPL(s390_sha_final);
95 99
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 8e9243ae0c19..b30606f6d523 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -57,7 +57,7 @@
57 * with operation of the form "set_bit(bitnr, flags)". 57 * with operation of the form "set_bit(bitnr, flags)".
58 */ 58 */
59 59
60/* bitmap tables from arch/S390/kernel/bitmap.S */ 60/* bitmap tables from arch/s390/kernel/bitmap.c */
61extern const char _oi_bitmap[]; 61extern const char _oi_bitmap[];
62extern const char _ni_bitmap[]; 62extern const char _ni_bitmap[];
63extern const char _zb_findmap[]; 63extern const char _zb_findmap[];
@@ -525,16 +525,16 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
525static inline unsigned long __ffz_word(unsigned long nr, unsigned long word) 525static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
526{ 526{
527#ifdef __s390x__ 527#ifdef __s390x__
528 if (likely((word & 0xffffffff) == 0xffffffff)) { 528 if ((word & 0xffffffff) == 0xffffffff) {
529 word >>= 32; 529 word >>= 32;
530 nr += 32; 530 nr += 32;
531 } 531 }
532#endif 532#endif
533 if (likely((word & 0xffff) == 0xffff)) { 533 if ((word & 0xffff) == 0xffff) {
534 word >>= 16; 534 word >>= 16;
535 nr += 16; 535 nr += 16;
536 } 536 }
537 if (likely((word & 0xff) == 0xff)) { 537 if ((word & 0xff) == 0xff) {
538 word >>= 8; 538 word >>= 8;
539 nr += 8; 539 nr += 8;
540 } 540 }
@@ -549,16 +549,16 @@ static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
549static inline unsigned long __ffs_word(unsigned long nr, unsigned long word) 549static inline unsigned long __ffs_word(unsigned long nr, unsigned long word)
550{ 550{
551#ifdef __s390x__ 551#ifdef __s390x__
552 if (likely((word & 0xffffffff) == 0)) { 552 if ((word & 0xffffffff) == 0) {
553 word >>= 32; 553 word >>= 32;
554 nr += 32; 554 nr += 32;
555 } 555 }
556#endif 556#endif
557 if (likely((word & 0xffff) == 0)) { 557 if ((word & 0xffff) == 0) {
558 word >>= 16; 558 word >>= 16;
559 nr += 16; 559 nr += 16;
560 } 560 }
561 if (likely((word & 0xff) == 0)) { 561 if ((word & 0xff) == 0) {
562 word >>= 8; 562 word >>= 8;
563 nr += 8; 563 nr += 8;
564 } 564 }
diff --git a/arch/s390/include/asm/crw.h b/arch/s390/include/asm/crw.h
new file mode 100644
index 000000000000..2185a6d619d3
--- /dev/null
+++ b/arch/s390/include/asm/crw.h
@@ -0,0 +1,68 @@
1/*
2 * Data definitions for channel report processing
3 * Copyright IBM Corp. 2000,2009
4 * Author(s): Ingo Adlung <adlung@de.ibm.com>,
5 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
6 * Cornelia Huck <cornelia.huck@de.ibm.com>,
7 * Heiko Carstens <heiko.carstens@de.ibm.com>,
8 */
9
10#ifndef _ASM_S390_CRW_H
11#define _ASM_S390_CRW_H
12
13#include <linux/types.h>
14
15/*
16 * Channel Report Word
17 */
18struct crw {
19 __u32 res1 : 1; /* reserved zero */
20 __u32 slct : 1; /* solicited */
21 __u32 oflw : 1; /* overflow */
22 __u32 chn : 1; /* chained */
23 __u32 rsc : 4; /* reporting source code */
24 __u32 anc : 1; /* ancillary report */
25 __u32 res2 : 1; /* reserved zero */
26 __u32 erc : 6; /* error-recovery code */
27 __u32 rsid : 16; /* reporting-source ID */
28} __attribute__ ((packed));
29
30typedef void (*crw_handler_t)(struct crw *, struct crw *, int);
31
32extern int crw_register_handler(int rsc, crw_handler_t handler);
33extern void crw_unregister_handler(int rsc);
34extern void crw_handle_channel_report(void);
35
36#define NR_RSCS 16
37
38#define CRW_RSC_MONITOR 0x2 /* monitoring facility */
39#define CRW_RSC_SCH 0x3 /* subchannel */
40#define CRW_RSC_CPATH 0x4 /* channel path */
41#define CRW_RSC_CONFIG 0x9 /* configuration-alert facility */
42#define CRW_RSC_CSS 0xB /* channel subsystem */
43
44#define CRW_ERC_EVENT 0x00 /* event information pending */
45#define CRW_ERC_AVAIL 0x01 /* available */
46#define CRW_ERC_INIT 0x02 /* initialized */
47#define CRW_ERC_TERROR 0x03 /* temporary error */
48#define CRW_ERC_IPARM 0x04 /* installed parm initialized */
49#define CRW_ERC_TERM 0x05 /* terminal */
50#define CRW_ERC_PERRN 0x06 /* perm. error, fac. not init */
51#define CRW_ERC_PERRI 0x07 /* perm. error, facility init */
52#define CRW_ERC_PMOD 0x08 /* installed parameters modified */
53
54static inline int stcrw(struct crw *pcrw)
55{
56 int ccode;
57
58 asm volatile(
59 " stcrw 0(%2)\n"
60 " ipm %0\n"
61 " srl %0,28\n"
62 : "=d" (ccode), "=m" (*pcrw)
63 : "a" (pcrw)
64 : "cc" );
65 return ccode;
66}
67
68#endif /* _ASM_S390_CRW_H */
diff --git a/arch/s390/include/asm/dasd.h b/arch/s390/include/asm/dasd.h
index e2db6f16d9c8..218bce81ec70 100644
--- a/arch/s390/include/asm/dasd.h
+++ b/arch/s390/include/asm/dasd.h
@@ -162,15 +162,15 @@ typedef struct dasd_profile_info_t {
162 unsigned int dasd_io_nr_req[32]; /* histogram of # of requests in chanq */ 162 unsigned int dasd_io_nr_req[32]; /* histogram of # of requests in chanq */
163} dasd_profile_info_t; 163} dasd_profile_info_t;
164 164
165/* 165/*
166 * struct format_data_t 166 * struct format_data_t
167 * represents all data necessary to format a dasd 167 * represents all data necessary to format a dasd
168 */ 168 */
169typedef struct format_data_t { 169typedef struct format_data_t {
170 int start_unit; /* from track */ 170 unsigned int start_unit; /* from track */
171 int stop_unit; /* to track */ 171 unsigned int stop_unit; /* to track */
172 int blksize; /* sectorsize */ 172 unsigned int blksize; /* sectorsize */
173 int intensity; 173 unsigned int intensity;
174} format_data_t; 174} format_data_t;
175 175
176/* 176/*
diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h
index e82c10efe65a..aae276d00383 100644
--- a/arch/s390/include/asm/idals.h
+++ b/arch/s390/include/asm/idals.h
@@ -44,24 +44,18 @@ idal_is_needed(void *vaddr, unsigned int length)
44/* 44/*
45 * Return the number of idal words needed for an address/length pair. 45 * Return the number of idal words needed for an address/length pair.
46 */ 46 */
47static inline unsigned int 47static inline unsigned int idal_nr_words(void *vaddr, unsigned int length)
48idal_nr_words(void *vaddr, unsigned int length)
49{ 48{
50#ifdef __s390x__ 49 return ((__pa(vaddr) & (IDA_BLOCK_SIZE-1)) + length +
51 if (idal_is_needed(vaddr, length)) 50 (IDA_BLOCK_SIZE-1)) >> IDA_SIZE_LOG;
52 return ((__pa(vaddr) & (IDA_BLOCK_SIZE-1)) + length +
53 (IDA_BLOCK_SIZE-1)) >> IDA_SIZE_LOG;
54#endif
55 return 0;
56} 51}
57 52
58/* 53/*
59 * Create the list of idal words for an address/length pair. 54 * Create the list of idal words for an address/length pair.
60 */ 55 */
61static inline unsigned long * 56static inline unsigned long *idal_create_words(unsigned long *idaws,
62idal_create_words(unsigned long *idaws, void *vaddr, unsigned int length) 57 void *vaddr, unsigned int length)
63{ 58{
64#ifdef __s390x__
65 unsigned long paddr; 59 unsigned long paddr;
66 unsigned int cidaw; 60 unsigned int cidaw;
67 61
@@ -74,7 +68,6 @@ idal_create_words(unsigned long *idaws, void *vaddr, unsigned int length)
74 paddr += IDA_BLOCK_SIZE; 68 paddr += IDA_BLOCK_SIZE;
75 *idaws++ = paddr; 69 *idaws++ = paddr;
76 } 70 }
77#endif
78 return idaws; 71 return idaws;
79} 72}
80 73
diff --git a/arch/s390/include/asm/kvm.h b/arch/s390/include/asm/kvm.h
index e1f54654e3ae..0b2f829f6d50 100644
--- a/arch/s390/include/asm/kvm.h
+++ b/arch/s390/include/asm/kvm.h
@@ -42,4 +42,11 @@ struct kvm_fpu {
42 __u64 fprs[16]; 42 __u64 fprs[16];
43}; 43};
44 44
45struct kvm_debug_exit_arch {
46};
47
48/* for KVM_SET_GUEST_DEBUG */
49struct kvm_guest_debug_arch {
50};
51
45#endif 52#endif
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 3c55e4107dcc..c6e674f5fca9 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -21,9 +21,6 @@
21/* memory slots that does not exposed to userspace */ 21/* memory slots that does not exposed to userspace */
22#define KVM_PRIVATE_MEM_SLOTS 4 22#define KVM_PRIVATE_MEM_SLOTS 4
23 23
24struct kvm_guest_debug {
25};
26
27struct sca_entry { 24struct sca_entry {
28 atomic_t scn; 25 atomic_t scn;
29 __u64 reserved; 26 __u64 reserved;
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
index f3720defdd16..b349f1c7fdfa 100644
--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -11,129 +11,118 @@
11#ifndef _ASM_S390_LOWCORE_H 11#ifndef _ASM_S390_LOWCORE_H
12#define _ASM_S390_LOWCORE_H 12#define _ASM_S390_LOWCORE_H
13 13
14#ifndef __s390x__ 14#define __LC_IPL_PARMBLOCK_PTR 0x0014
15#define __LC_EXT_OLD_PSW 0x018 15#define __LC_EXT_PARAMS 0x0080
16#define __LC_SVC_OLD_PSW 0x020 16#define __LC_CPU_ADDRESS 0x0084
17#define __LC_PGM_OLD_PSW 0x028 17#define __LC_EXT_INT_CODE 0x0086
18#define __LC_MCK_OLD_PSW 0x030
19#define __LC_IO_OLD_PSW 0x038
20#define __LC_EXT_NEW_PSW 0x058
21#define __LC_SVC_NEW_PSW 0x060
22#define __LC_PGM_NEW_PSW 0x068
23#define __LC_MCK_NEW_PSW 0x070
24#define __LC_IO_NEW_PSW 0x078
25#else /* !__s390x__ */
26#define __LC_EXT_OLD_PSW 0x0130
27#define __LC_SVC_OLD_PSW 0x0140
28#define __LC_PGM_OLD_PSW 0x0150
29#define __LC_MCK_OLD_PSW 0x0160
30#define __LC_IO_OLD_PSW 0x0170
31#define __LC_EXT_NEW_PSW 0x01b0
32#define __LC_SVC_NEW_PSW 0x01c0
33#define __LC_PGM_NEW_PSW 0x01d0
34#define __LC_MCK_NEW_PSW 0x01e0
35#define __LC_IO_NEW_PSW 0x01f0
36#endif /* !__s390x__ */
37
38#define __LC_IPL_PARMBLOCK_PTR 0x014
39#define __LC_EXT_PARAMS 0x080
40#define __LC_CPU_ADDRESS 0x084
41#define __LC_EXT_INT_CODE 0x086
42
43#define __LC_SVC_ILC 0x088
44#define __LC_SVC_INT_CODE 0x08A
45#define __LC_PGM_ILC 0x08C
46#define __LC_PGM_INT_CODE 0x08E
47 18
48#define __LC_PER_ATMID 0x096 19#define __LC_SVC_ILC 0x0088
49#define __LC_PER_ADDRESS 0x098 20#define __LC_SVC_INT_CODE 0x008a
50#define __LC_PER_ACCESS_ID 0x0A1 21#define __LC_PGM_ILC 0x008c
51#define __LC_AR_MODE_ID 0x0A3 22#define __LC_PGM_INT_CODE 0x008e
52 23
53#define __LC_SUBCHANNEL_ID 0x0B8 24#define __LC_PER_ATMID 0x0096
54#define __LC_SUBCHANNEL_NR 0x0BA 25#define __LC_PER_ADDRESS 0x0098
55#define __LC_IO_INT_PARM 0x0BC 26#define __LC_PER_ACCESS_ID 0x00a1
56#define __LC_IO_INT_WORD 0x0C0 27#define __LC_AR_MODE_ID 0x00a3
57#define __LC_MCCK_CODE 0x0E8
58 28
59#define __LC_LAST_BREAK 0x110 29#define __LC_SUBCHANNEL_ID 0x00b8
60 30#define __LC_SUBCHANNEL_NR 0x00ba
61#define __LC_RETURN_PSW 0x200 31#define __LC_IO_INT_PARM 0x00bc
62 32#define __LC_IO_INT_WORD 0x00c0
63#define __LC_SAVE_AREA 0xC00 33#define __LC_MCCK_CODE 0x00e8
64
65#ifndef __s390x__
66#define __LC_IRB 0x208
67#define __LC_SYNC_ENTER_TIMER 0x248
68#define __LC_ASYNC_ENTER_TIMER 0x250
69#define __LC_EXIT_TIMER 0x258
70#define __LC_USER_TIMER 0x260
71#define __LC_SYSTEM_TIMER 0x268
72#define __LC_STEAL_TIMER 0x270
73#define __LC_LAST_UPDATE_TIMER 0x278
74#define __LC_LAST_UPDATE_CLOCK 0x280
75#define __LC_RETURN_MCCK_PSW 0x288
76#define __LC_KERNEL_STACK 0xC40
77#define __LC_THREAD_INFO 0xC44
78#define __LC_ASYNC_STACK 0xC48
79#define __LC_KERNEL_ASCE 0xC4C
80#define __LC_USER_ASCE 0xC50
81#define __LC_PANIC_STACK 0xC54
82#define __LC_CPUID 0xC60
83#define __LC_CPUADDR 0xC68
84#define __LC_IPLDEV 0xC7C
85#define __LC_CURRENT 0xC90
86#define __LC_INT_CLOCK 0xC98
87#else /* __s390x__ */
88#define __LC_IRB 0x210
89#define __LC_SYNC_ENTER_TIMER 0x250
90#define __LC_ASYNC_ENTER_TIMER 0x258
91#define __LC_EXIT_TIMER 0x260
92#define __LC_USER_TIMER 0x268
93#define __LC_SYSTEM_TIMER 0x270
94#define __LC_STEAL_TIMER 0x278
95#define __LC_LAST_UPDATE_TIMER 0x280
96#define __LC_LAST_UPDATE_CLOCK 0x288
97#define __LC_RETURN_MCCK_PSW 0x290
98#define __LC_KERNEL_STACK 0xD40
99#define __LC_THREAD_INFO 0xD48
100#define __LC_ASYNC_STACK 0xD50
101#define __LC_KERNEL_ASCE 0xD58
102#define __LC_USER_ASCE 0xD60
103#define __LC_PANIC_STACK 0xD68
104#define __LC_CPUID 0xD80
105#define __LC_CPUADDR 0xD88
106#define __LC_IPLDEV 0xDB8
107#define __LC_CURRENT 0xDD8
108#define __LC_INT_CLOCK 0xDE8
109#define __LC_VDSO_PER_CPU 0xE38
110#endif /* __s390x__ */
111 34
112#define __LC_PASTE 0xE40 35#define __LC_DUMP_REIPL 0x0e00
113 36
114#define __LC_PANIC_MAGIC 0xE00
115#ifndef __s390x__ 37#ifndef __s390x__
116#define __LC_PFAULT_INTPARM 0x080 38#define __LC_EXT_OLD_PSW 0x0018
117#define __LC_CPU_TIMER_SAVE_AREA 0x0D8 39#define __LC_SVC_OLD_PSW 0x0020
118#define __LC_CLOCK_COMP_SAVE_AREA 0x0E0 40#define __LC_PGM_OLD_PSW 0x0028
119#define __LC_PSW_SAVE_AREA 0x100 41#define __LC_MCK_OLD_PSW 0x0030
120#define __LC_PREFIX_SAVE_AREA 0x108 42#define __LC_IO_OLD_PSW 0x0038
121#define __LC_AREGS_SAVE_AREA 0x120 43#define __LC_EXT_NEW_PSW 0x0058
122#define __LC_FPREGS_SAVE_AREA 0x160 44#define __LC_SVC_NEW_PSW 0x0060
123#define __LC_GPREGS_SAVE_AREA 0x180 45#define __LC_PGM_NEW_PSW 0x0068
124#define __LC_CREGS_SAVE_AREA 0x1C0 46#define __LC_MCK_NEW_PSW 0x0070
47#define __LC_IO_NEW_PSW 0x0078
48#define __LC_SAVE_AREA 0x0200
49#define __LC_RETURN_PSW 0x0240
50#define __LC_RETURN_MCCK_PSW 0x0248
51#define __LC_SYNC_ENTER_TIMER 0x0250
52#define __LC_ASYNC_ENTER_TIMER 0x0258
53#define __LC_EXIT_TIMER 0x0260
54#define __LC_USER_TIMER 0x0268
55#define __LC_SYSTEM_TIMER 0x0270
56#define __LC_STEAL_TIMER 0x0278
57#define __LC_LAST_UPDATE_TIMER 0x0280
58#define __LC_LAST_UPDATE_CLOCK 0x0288
59#define __LC_CURRENT 0x0290
60#define __LC_THREAD_INFO 0x0294
61#define __LC_KERNEL_STACK 0x0298
62#define __LC_ASYNC_STACK 0x029c
63#define __LC_PANIC_STACK 0x02a0
64#define __LC_KERNEL_ASCE 0x02a4
65#define __LC_USER_ASCE 0x02a8
66#define __LC_USER_EXEC_ASCE 0x02ac
67#define __LC_CPUID 0x02b0
68#define __LC_INT_CLOCK 0x02c8
69#define __LC_IRB 0x0300
70#define __LC_PFAULT_INTPARM 0x0080
71#define __LC_CPU_TIMER_SAVE_AREA 0x00d8
72#define __LC_CLOCK_COMP_SAVE_AREA 0x00e0
73#define __LC_PSW_SAVE_AREA 0x0100
74#define __LC_PREFIX_SAVE_AREA 0x0108
75#define __LC_AREGS_SAVE_AREA 0x0120
76#define __LC_FPREGS_SAVE_AREA 0x0160
77#define __LC_GPREGS_SAVE_AREA 0x0180
78#define __LC_CREGS_SAVE_AREA 0x01c0
125#else /* __s390x__ */ 79#else /* __s390x__ */
126#define __LC_PFAULT_INTPARM 0x11B8 80#define __LC_LAST_BREAK 0x0110
81#define __LC_EXT_OLD_PSW 0x0130
82#define __LC_SVC_OLD_PSW 0x0140
83#define __LC_PGM_OLD_PSW 0x0150
84#define __LC_MCK_OLD_PSW 0x0160
85#define __LC_IO_OLD_PSW 0x0170
86#define __LC_EXT_NEW_PSW 0x01b0
87#define __LC_SVC_NEW_PSW 0x01c0
88#define __LC_PGM_NEW_PSW 0x01d0
89#define __LC_MCK_NEW_PSW 0x01e0
90#define __LC_IO_NEW_PSW 0x01f0
91#define __LC_SAVE_AREA 0x0200
92#define __LC_RETURN_PSW 0x0280
93#define __LC_RETURN_MCCK_PSW 0x0290
94#define __LC_SYNC_ENTER_TIMER 0x02a0
95#define __LC_ASYNC_ENTER_TIMER 0x02a8
96#define __LC_EXIT_TIMER 0x02b0
97#define __LC_USER_TIMER 0x02b8
98#define __LC_SYSTEM_TIMER 0x02c0
99#define __LC_STEAL_TIMER 0x02c8
100#define __LC_LAST_UPDATE_TIMER 0x02d0
101#define __LC_LAST_UPDATE_CLOCK 0x02d8
102#define __LC_CURRENT 0x02e0
103#define __LC_THREAD_INFO 0x02e8
104#define __LC_KERNEL_STACK 0x02f0
105#define __LC_ASYNC_STACK 0x02f8
106#define __LC_PANIC_STACK 0x0300
107#define __LC_KERNEL_ASCE 0x0308
108#define __LC_USER_ASCE 0x0310
109#define __LC_USER_EXEC_ASCE 0x0318
110#define __LC_CPUID 0x0320
111#define __LC_INT_CLOCK 0x0340
112#define __LC_VDSO_PER_CPU 0x0350
113#define __LC_IRB 0x0380
114#define __LC_PASTE 0x03c0
115#define __LC_PFAULT_INTPARM 0x11b8
127#define __LC_FPREGS_SAVE_AREA 0x1200 116#define __LC_FPREGS_SAVE_AREA 0x1200
128#define __LC_GPREGS_SAVE_AREA 0x1280 117#define __LC_GPREGS_SAVE_AREA 0x1280
129#define __LC_PSW_SAVE_AREA 0x1300 118#define __LC_PSW_SAVE_AREA 0x1300
130#define __LC_PREFIX_SAVE_AREA 0x1318 119#define __LC_PREFIX_SAVE_AREA 0x1318
131#define __LC_FP_CREG_SAVE_AREA 0x131C 120#define __LC_FP_CREG_SAVE_AREA 0x131c
132#define __LC_TODREG_SAVE_AREA 0x1324 121#define __LC_TODREG_SAVE_AREA 0x1324
133#define __LC_CPU_TIMER_SAVE_AREA 0x1328 122#define __LC_CPU_TIMER_SAVE_AREA 0x1328
134#define __LC_CLOCK_COMP_SAVE_AREA 0x1331 123#define __LC_CLOCK_COMP_SAVE_AREA 0x1331
135#define __LC_AREGS_SAVE_AREA 0x1340 124#define __LC_AREGS_SAVE_AREA 0x1340
136#define __LC_CREGS_SAVE_AREA 0x1380 125#define __LC_CREGS_SAVE_AREA 0x1380
137#endif /* __s390x__ */ 126#endif /* __s390x__ */
138 127
139#ifndef __ASSEMBLY__ 128#ifndef __ASSEMBLY__
@@ -198,222 +187,240 @@ union save_area {
198struct _lowcore 187struct _lowcore
199{ 188{
200#ifndef __s390x__ 189#ifndef __s390x__
201 /* prefix area: defined by architecture */ 190 /* 0x0000 - 0x01ff: defined by architecture */
202 psw_t restart_psw; /* 0x000 */ 191 psw_t restart_psw; /* 0x0000 */
203 __u32 ccw2[4]; /* 0x008 */ 192 __u32 ccw2[4]; /* 0x0008 */
204 psw_t external_old_psw; /* 0x018 */ 193 psw_t external_old_psw; /* 0x0018 */
205 psw_t svc_old_psw; /* 0x020 */ 194 psw_t svc_old_psw; /* 0x0020 */
206 psw_t program_old_psw; /* 0x028 */ 195 psw_t program_old_psw; /* 0x0028 */
207 psw_t mcck_old_psw; /* 0x030 */ 196 psw_t mcck_old_psw; /* 0x0030 */
208 psw_t io_old_psw; /* 0x038 */ 197 psw_t io_old_psw; /* 0x0038 */
209 __u8 pad1[0x58-0x40]; /* 0x040 */ 198 __u8 pad_0x0040[0x0058-0x0040]; /* 0x0040 */
210 psw_t external_new_psw; /* 0x058 */ 199 psw_t external_new_psw; /* 0x0058 */
211 psw_t svc_new_psw; /* 0x060 */ 200 psw_t svc_new_psw; /* 0x0060 */
212 psw_t program_new_psw; /* 0x068 */ 201 psw_t program_new_psw; /* 0x0068 */
213 psw_t mcck_new_psw; /* 0x070 */ 202 psw_t mcck_new_psw; /* 0x0070 */
214 psw_t io_new_psw; /* 0x078 */ 203 psw_t io_new_psw; /* 0x0078 */
215 __u32 ext_params; /* 0x080 */ 204 __u32 ext_params; /* 0x0080 */
216 __u16 cpu_addr; /* 0x084 */ 205 __u16 cpu_addr; /* 0x0084 */
217 __u16 ext_int_code; /* 0x086 */ 206 __u16 ext_int_code; /* 0x0086 */
218 __u16 svc_ilc; /* 0x088 */ 207 __u16 svc_ilc; /* 0x0088 */
219 __u16 svc_code; /* 0x08a */ 208 __u16 svc_code; /* 0x008a */
220 __u16 pgm_ilc; /* 0x08c */ 209 __u16 pgm_ilc; /* 0x008c */
221 __u16 pgm_code; /* 0x08e */ 210 __u16 pgm_code; /* 0x008e */
222 __u32 trans_exc_code; /* 0x090 */ 211 __u32 trans_exc_code; /* 0x0090 */
223 __u16 mon_class_num; /* 0x094 */ 212 __u16 mon_class_num; /* 0x0094 */
224 __u16 per_perc_atmid; /* 0x096 */ 213 __u16 per_perc_atmid; /* 0x0096 */
225 __u32 per_address; /* 0x098 */ 214 __u32 per_address; /* 0x0098 */
226 __u32 monitor_code; /* 0x09c */ 215 __u32 monitor_code; /* 0x009c */
227 __u8 exc_access_id; /* 0x0a0 */ 216 __u8 exc_access_id; /* 0x00a0 */
228 __u8 per_access_id; /* 0x0a1 */ 217 __u8 per_access_id; /* 0x00a1 */
229 __u8 pad2[0xB8-0xA2]; /* 0x0a2 */ 218 __u8 pad_0x00a2[0x00b8-0x00a2]; /* 0x00a2 */
230 __u16 subchannel_id; /* 0x0b8 */ 219 __u16 subchannel_id; /* 0x00b8 */
231 __u16 subchannel_nr; /* 0x0ba */ 220 __u16 subchannel_nr; /* 0x00ba */
232 __u32 io_int_parm; /* 0x0bc */ 221 __u32 io_int_parm; /* 0x00bc */
233 __u32 io_int_word; /* 0x0c0 */ 222 __u32 io_int_word; /* 0x00c0 */
234 __u8 pad3[0xc8-0xc4]; /* 0x0c4 */ 223 __u8 pad_0x00c4[0x00c8-0x00c4]; /* 0x00c4 */
235 __u32 stfl_fac_list; /* 0x0c8 */ 224 __u32 stfl_fac_list; /* 0x00c8 */
236 __u8 pad4[0xd4-0xcc]; /* 0x0cc */ 225 __u8 pad_0x00cc[0x00d4-0x00cc]; /* 0x00cc */
237 __u32 extended_save_area_addr; /* 0x0d4 */ 226 __u32 extended_save_area_addr; /* 0x00d4 */
238 __u32 cpu_timer_save_area[2]; /* 0x0d8 */ 227 __u32 cpu_timer_save_area[2]; /* 0x00d8 */
239 __u32 clock_comp_save_area[2]; /* 0x0e0 */ 228 __u32 clock_comp_save_area[2]; /* 0x00e0 */
240 __u32 mcck_interruption_code[2]; /* 0x0e8 */ 229 __u32 mcck_interruption_code[2]; /* 0x00e8 */
241 __u8 pad5[0xf4-0xf0]; /* 0x0f0 */ 230 __u8 pad_0x00f0[0x00f4-0x00f0]; /* 0x00f0 */
242 __u32 external_damage_code; /* 0x0f4 */ 231 __u32 external_damage_code; /* 0x00f4 */
243 __u32 failing_storage_address; /* 0x0f8 */ 232 __u32 failing_storage_address; /* 0x00f8 */
244 __u8 pad6[0x100-0xfc]; /* 0x0fc */ 233 __u8 pad_0x00fc[0x0100-0x00fc]; /* 0x00fc */
245 __u32 st_status_fixed_logout[4];/* 0x100 */ 234 __u32 st_status_fixed_logout[4]; /* 0x0100 */
246 __u8 pad7[0x120-0x110]; /* 0x110 */ 235 __u8 pad_0x0110[0x0120-0x0110]; /* 0x0110 */
247 __u32 access_regs_save_area[16];/* 0x120 */ 236
248 __u32 floating_pt_save_area[8]; /* 0x160 */ 237 /* CPU register save area: defined by architecture */
249 __u32 gpregs_save_area[16]; /* 0x180 */ 238 __u32 access_regs_save_area[16]; /* 0x0120 */
250 __u32 cregs_save_area[16]; /* 0x1c0 */ 239 __u32 floating_pt_save_area[8]; /* 0x0160 */
251 240 __u32 gpregs_save_area[16]; /* 0x0180 */
252 psw_t return_psw; /* 0x200 */ 241 __u32 cregs_save_area[16]; /* 0x01c0 */
253 __u8 irb[64]; /* 0x208 */ 242
254 __u64 sync_enter_timer; /* 0x248 */ 243 /* Return psws. */
255 __u64 async_enter_timer; /* 0x250 */ 244 __u32 save_area[16]; /* 0x0200 */
256 __u64 exit_timer; /* 0x258 */ 245 psw_t return_psw; /* 0x0240 */
257 __u64 user_timer; /* 0x260 */ 246 psw_t return_mcck_psw; /* 0x0248 */
258 __u64 system_timer; /* 0x268 */ 247
259 __u64 steal_timer; /* 0x270 */ 248 /* CPU time accounting values */
260 __u64 last_update_timer; /* 0x278 */ 249 __u64 sync_enter_timer; /* 0x0250 */
261 __u64 last_update_clock; /* 0x280 */ 250 __u64 async_enter_timer; /* 0x0258 */
262 psw_t return_mcck_psw; /* 0x288 */ 251 __u64 exit_timer; /* 0x0260 */
263 __u8 pad8[0xc00-0x290]; /* 0x290 */ 252 __u64 user_timer; /* 0x0268 */
264 253 __u64 system_timer; /* 0x0270 */
265 /* System info area */ 254 __u64 steal_timer; /* 0x0278 */
266 __u32 save_area[16]; /* 0xc00 */ 255 __u64 last_update_timer; /* 0x0280 */
267 __u32 kernel_stack; /* 0xc40 */ 256 __u64 last_update_clock; /* 0x0288 */
268 __u32 thread_info; /* 0xc44 */ 257
269 __u32 async_stack; /* 0xc48 */ 258 /* Current process. */
270 __u32 kernel_asce; /* 0xc4c */ 259 __u32 current_task; /* 0x0290 */
271 __u32 user_asce; /* 0xc50 */ 260 __u32 thread_info; /* 0x0294 */
272 __u32 panic_stack; /* 0xc54 */ 261 __u32 kernel_stack; /* 0x0298 */
273 __u32 user_exec_asce; /* 0xc58 */ 262
274 __u8 pad10[0xc60-0xc5c]; /* 0xc5c */ 263 /* Interrupt and panic stack. */
275 /* entry.S sensitive area start */ 264 __u32 async_stack; /* 0x029c */
276 struct cpuinfo_S390 cpu_data; /* 0xc60 */ 265 __u32 panic_stack; /* 0x02a0 */
277 __u32 ipl_device; /* 0xc7c */ 266
278 /* entry.S sensitive area end */ 267 /* Address space pointer. */
279 268 __u32 kernel_asce; /* 0x02a4 */
280 /* SMP info area: defined by DJB */ 269 __u32 user_asce; /* 0x02a8 */
281 __u64 clock_comparator; /* 0xc80 */ 270 __u32 user_exec_asce; /* 0x02ac */
282 __u32 ext_call_fast; /* 0xc88 */ 271
283 __u32 percpu_offset; /* 0xc8c */ 272 /* SMP info area */
284 __u32 current_task; /* 0xc90 */ 273 cpuid_t cpu_id; /* 0x02b0 */
285 __u32 softirq_pending; /* 0xc94 */ 274 __u32 cpu_nr; /* 0x02b8 */
286 __u64 int_clock; /* 0xc98 */ 275 __u32 softirq_pending; /* 0x02bc */
287 __u8 pad11[0xe00-0xca0]; /* 0xca0 */ 276 __u32 percpu_offset; /* 0x02c0 */
288 277 __u32 ext_call_fast; /* 0x02c4 */
289 /* 0xe00 is used as indicator for dump tools */ 278 __u64 int_clock; /* 0x02c8 */
290 /* whether the kernel died with panic() or not */ 279 __u64 clock_comparator; /* 0x02d0 */
291 __u32 panic_magic; /* 0xe00 */ 280 __u8 pad_0x02d8[0x0300-0x02d8]; /* 0x02d8 */
292 281
293 /* Align to the top 1k of prefix area */ 282 /* Interrupt response block */
294 __u8 pad12[0x1000-0xe04]; /* 0xe04 */ 283 __u8 irb[64]; /* 0x0300 */
284
285 __u8 pad_0x0400[0x0e00-0x0400]; /* 0x0400 */
286
287 /*
288 * 0xe00 contains the address of the IPL Parameter Information
289 * block. Dump tools need IPIB for IPL after dump.
290 * Note: do not change the position of any fields in 0x0e00-0x0f00
291 */
292 __u32 ipib; /* 0x0e00 */
293 __u32 ipib_checksum; /* 0x0e04 */
294
295 /* Align to the top 1k of prefix area */
296 __u8 pad_0x0e08[0x1000-0x0e08]; /* 0x0e08 */
295#else /* !__s390x__ */ 297#else /* !__s390x__ */
296 /* prefix area: defined by architecture */ 298 /* 0x0000 - 0x01ff: defined by architecture */
297 __u32 ccw1[2]; /* 0x000 */ 299 __u32 ccw1[2]; /* 0x0000 */
298 __u32 ccw2[4]; /* 0x008 */ 300 __u32 ccw2[4]; /* 0x0008 */
299 __u8 pad1[0x80-0x18]; /* 0x018 */ 301 __u8 pad_0x0018[0x0080-0x0018]; /* 0x0018 */
300 __u32 ext_params; /* 0x080 */ 302 __u32 ext_params; /* 0x0080 */
301 __u16 cpu_addr; /* 0x084 */ 303 __u16 cpu_addr; /* 0x0084 */
302 __u16 ext_int_code; /* 0x086 */ 304 __u16 ext_int_code; /* 0x0086 */
303 __u16 svc_ilc; /* 0x088 */ 305 __u16 svc_ilc; /* 0x0088 */
304 __u16 svc_code; /* 0x08a */ 306 __u16 svc_code; /* 0x008a */
305 __u16 pgm_ilc; /* 0x08c */ 307 __u16 pgm_ilc; /* 0x008c */
306 __u16 pgm_code; /* 0x08e */ 308 __u16 pgm_code; /* 0x008e */
307 __u32 data_exc_code; /* 0x090 */ 309 __u32 data_exc_code; /* 0x0090 */
308 __u16 mon_class_num; /* 0x094 */ 310 __u16 mon_class_num; /* 0x0094 */
309 __u16 per_perc_atmid; /* 0x096 */ 311 __u16 per_perc_atmid; /* 0x0096 */
310 addr_t per_address; /* 0x098 */ 312 addr_t per_address; /* 0x0098 */
311 __u8 exc_access_id; /* 0x0a0 */ 313 __u8 exc_access_id; /* 0x00a0 */
312 __u8 per_access_id; /* 0x0a1 */ 314 __u8 per_access_id; /* 0x00a1 */
313 __u8 op_access_id; /* 0x0a2 */ 315 __u8 op_access_id; /* 0x00a2 */
314 __u8 ar_access_id; /* 0x0a3 */ 316 __u8 ar_access_id; /* 0x00a3 */
315 __u8 pad2[0xA8-0xA4]; /* 0x0a4 */ 317 __u8 pad_0x00a4[0x00a8-0x00a4]; /* 0x00a4 */
316 addr_t trans_exc_code; /* 0x0A0 */ 318 addr_t trans_exc_code; /* 0x00a8 */
317 addr_t monitor_code; /* 0x09c */ 319 addr_t monitor_code; /* 0x00b0 */
318 __u16 subchannel_id; /* 0x0b8 */ 320 __u16 subchannel_id; /* 0x00b8 */
319 __u16 subchannel_nr; /* 0x0ba */ 321 __u16 subchannel_nr; /* 0x00ba */
320 __u32 io_int_parm; /* 0x0bc */ 322 __u32 io_int_parm; /* 0x00bc */
321 __u32 io_int_word; /* 0x0c0 */ 323 __u32 io_int_word; /* 0x00c0 */
322 __u8 pad3[0xc8-0xc4]; /* 0x0c4 */ 324 __u8 pad_0x00c4[0x00c8-0x00c4]; /* 0x00c4 */
323 __u32 stfl_fac_list; /* 0x0c8 */ 325 __u32 stfl_fac_list; /* 0x00c8 */
324 __u8 pad4[0xe8-0xcc]; /* 0x0cc */ 326 __u8 pad_0x00cc[0x00e8-0x00cc]; /* 0x00cc */
325 __u32 mcck_interruption_code[2]; /* 0x0e8 */ 327 __u32 mcck_interruption_code[2]; /* 0x00e8 */
326 __u8 pad5[0xf4-0xf0]; /* 0x0f0 */ 328 __u8 pad_0x00f0[0x00f4-0x00f0]; /* 0x00f0 */
327 __u32 external_damage_code; /* 0x0f4 */ 329 __u32 external_damage_code; /* 0x00f4 */
328 addr_t failing_storage_address; /* 0x0f8 */ 330 addr_t failing_storage_address; /* 0x00f8 */
329 __u8 pad6[0x120-0x100]; /* 0x100 */ 331 __u8 pad_0x0100[0x0120-0x0100]; /* 0x0100 */
330 psw_t restart_old_psw; /* 0x120 */ 332 psw_t restart_old_psw; /* 0x0120 */
331 psw_t external_old_psw; /* 0x130 */ 333 psw_t external_old_psw; /* 0x0130 */
332 psw_t svc_old_psw; /* 0x140 */ 334 psw_t svc_old_psw; /* 0x0140 */
333 psw_t program_old_psw; /* 0x150 */ 335 psw_t program_old_psw; /* 0x0150 */
334 psw_t mcck_old_psw; /* 0x160 */ 336 psw_t mcck_old_psw; /* 0x0160 */
335 psw_t io_old_psw; /* 0x170 */ 337 psw_t io_old_psw; /* 0x0170 */
336 __u8 pad7[0x1a0-0x180]; /* 0x180 */ 338 __u8 pad_0x0180[0x01a0-0x0180]; /* 0x0180 */
337 psw_t restart_psw; /* 0x1a0 */ 339 psw_t restart_psw; /* 0x01a0 */
338 psw_t external_new_psw; /* 0x1b0 */ 340 psw_t external_new_psw; /* 0x01b0 */
339 psw_t svc_new_psw; /* 0x1c0 */ 341 psw_t svc_new_psw; /* 0x01c0 */
340 psw_t program_new_psw; /* 0x1d0 */ 342 psw_t program_new_psw; /* 0x01d0 */
341 psw_t mcck_new_psw; /* 0x1e0 */ 343 psw_t mcck_new_psw; /* 0x01e0 */
342 psw_t io_new_psw; /* 0x1f0 */ 344 psw_t io_new_psw; /* 0x01f0 */
343 psw_t return_psw; /* 0x200 */ 345
344 __u8 irb[64]; /* 0x210 */ 346 /* Entry/exit save area & return psws. */
345 __u64 sync_enter_timer; /* 0x250 */ 347 __u64 save_area[16]; /* 0x0200 */
346 __u64 async_enter_timer; /* 0x258 */ 348 psw_t return_psw; /* 0x0280 */
347 __u64 exit_timer; /* 0x260 */ 349 psw_t return_mcck_psw; /* 0x0290 */
348 __u64 user_timer; /* 0x268 */ 350
349 __u64 system_timer; /* 0x270 */ 351 /* CPU accounting and timing values. */
350 __u64 steal_timer; /* 0x278 */ 352 __u64 sync_enter_timer; /* 0x02a0 */
351 __u64 last_update_timer; /* 0x280 */ 353 __u64 async_enter_timer; /* 0x02a8 */
352 __u64 last_update_clock; /* 0x288 */ 354 __u64 exit_timer; /* 0x02b0 */
353 psw_t return_mcck_psw; /* 0x290 */ 355 __u64 user_timer; /* 0x02b8 */
354 __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */ 356 __u64 system_timer; /* 0x02c0 */
355 /* System info area */ 357 __u64 steal_timer; /* 0x02c8 */
356 __u64 save_area[16]; /* 0xc00 */ 358 __u64 last_update_timer; /* 0x02d0 */
357 __u8 pad9[0xd40-0xc80]; /* 0xc80 */ 359 __u64 last_update_clock; /* 0x02d8 */
358 __u64 kernel_stack; /* 0xd40 */ 360
359 __u64 thread_info; /* 0xd48 */ 361 /* Current process. */
360 __u64 async_stack; /* 0xd50 */ 362 __u64 current_task; /* 0x02e0 */
361 __u64 kernel_asce; /* 0xd58 */ 363 __u64 thread_info; /* 0x02e8 */
362 __u64 user_asce; /* 0xd60 */ 364 __u64 kernel_stack; /* 0x02f0 */
363 __u64 panic_stack; /* 0xd68 */ 365
364 __u64 user_exec_asce; /* 0xd70 */ 366 /* Interrupt and panic stack. */
365 __u8 pad10[0xd80-0xd78]; /* 0xd78 */ 367 __u64 async_stack; /* 0x02f8 */
366 /* entry.S sensitive area start */ 368 __u64 panic_stack; /* 0x0300 */
367 struct cpuinfo_S390 cpu_data; /* 0xd80 */ 369
368 __u32 ipl_device; /* 0xdb8 */ 370 /* Address space pointer. */
369 __u32 pad11; /* 0xdbc */ 371 __u64 kernel_asce; /* 0x0308 */
370 /* entry.S sensitive area end */ 372 __u64 user_asce; /* 0x0310 */
371 373 __u64 user_exec_asce; /* 0x0318 */
372 /* SMP info area: defined by DJB */ 374
373 __u64 clock_comparator; /* 0xdc0 */ 375 /* SMP info area */
374 __u64 ext_call_fast; /* 0xdc8 */ 376 cpuid_t cpu_id; /* 0x0320 */
375 __u64 percpu_offset; /* 0xdd0 */ 377 __u32 cpu_nr; /* 0x0328 */
376 __u64 current_task; /* 0xdd8 */ 378 __u32 softirq_pending; /* 0x032c */
377 __u32 softirq_pending; /* 0xde0 */ 379 __u64 percpu_offset; /* 0x0330 */
378 __u32 pad_0x0de4; /* 0xde4 */ 380 __u64 ext_call_fast; /* 0x0338 */
379 __u64 int_clock; /* 0xde8 */ 381 __u64 int_clock; /* 0x0340 */
380 __u8 pad12[0xe00-0xdf0]; /* 0xdf0 */ 382 __u64 clock_comparator; /* 0x0348 */
381 383 __u64 vdso_per_cpu_data; /* 0x0350 */
382 /* 0xe00 is used as indicator for dump tools */ 384 __u8 pad_0x0358[0x0380-0x0358]; /* 0x0358 */
383 /* whether the kernel died with panic() or not */ 385
384 __u32 panic_magic; /* 0xe00 */ 386 /* Interrupt response block. */
387 __u8 irb[64]; /* 0x0380 */
385 388
386 /* Per cpu primary space access list */ 389 /* Per cpu primary space access list */
387 __u8 pad_0xe04[0xe38-0xe04]; /* 0xe04 */ 390 __u32 paste[16]; /* 0x03c0 */
388 __u64 vdso_per_cpu_data; /* 0xe38 */ 391
389 __u32 paste[16]; /* 0xe40 */ 392 __u8 pad_0x0400[0x0e00-0x0400]; /* 0x0400 */
390 393
391 __u8 pad13[0x11b8-0xe80]; /* 0xe80 */ 394 /*
392 395 * 0xe00 contains the address of the IPL Parameter Information
393 /* 64 bit extparam used for pfault, diag 250 etc */ 396 * block. Dump tools need IPIB for IPL after dump.
394 __u64 ext_params2; /* 0x11B8 */ 397 * Note: do not change the position of any fields in 0x0e00-0x0f00
395 398 */
396 __u8 pad14[0x1200-0x11C0]; /* 0x11C0 */ 399 __u64 ipib; /* 0x0e00 */
397 400 __u32 ipib_checksum; /* 0x0e08 */
398 /* System info area */ 401 __u8 pad_0x0e0c[0x11b8-0x0e0c]; /* 0x0e0c */
399 402
400 __u64 floating_pt_save_area[16]; /* 0x1200 */ 403 /* 64 bit extparam used for pfault/diag 250: defined by architecture */
401 __u64 gpregs_save_area[16]; /* 0x1280 */ 404 __u64 ext_params2; /* 0x11B8 */
402 __u32 st_status_fixed_logout[4]; /* 0x1300 */ 405 __u8 pad_0x11c0[0x1200-0x11C0]; /* 0x11C0 */
403 __u8 pad15[0x1318-0x1310]; /* 0x1310 */ 406
404 __u32 prefixreg_save_area; /* 0x1318 */ 407 /* CPU register save area: defined by architecture */
405 __u32 fpt_creg_save_area; /* 0x131c */ 408 __u64 floating_pt_save_area[16]; /* 0x1200 */
406 __u8 pad16[0x1324-0x1320]; /* 0x1320 */ 409 __u64 gpregs_save_area[16]; /* 0x1280 */
407 __u32 tod_progreg_save_area; /* 0x1324 */ 410 __u32 st_status_fixed_logout[4]; /* 0x1300 */
408 __u32 cpu_timer_save_area[2]; /* 0x1328 */ 411 __u8 pad_0x1310[0x1318-0x1310]; /* 0x1310 */
409 __u32 clock_comp_save_area[2]; /* 0x1330 */ 412 __u32 prefixreg_save_area; /* 0x1318 */
410 __u8 pad17[0x1340-0x1338]; /* 0x1338 */ 413 __u32 fpt_creg_save_area; /* 0x131c */
411 __u32 access_regs_save_area[16]; /* 0x1340 */ 414 __u8 pad_0x1320[0x1324-0x1320]; /* 0x1320 */
412 __u64 cregs_save_area[16]; /* 0x1380 */ 415 __u32 tod_progreg_save_area; /* 0x1324 */
416 __u32 cpu_timer_save_area[2]; /* 0x1328 */
417 __u32 clock_comp_save_area[2]; /* 0x1330 */
418 __u8 pad_0x1338[0x1340-0x1338]; /* 0x1338 */
419 __u32 access_regs_save_area[16]; /* 0x1340 */
420 __u64 cregs_save_area[16]; /* 0x1380 */
413 421
414 /* align to the top of the prefix area */ 422 /* align to the top of the prefix area */
415 423 __u8 pad_0x1400[0x2000-0x1400]; /* 0x1400 */
416 __u8 pad18[0x2000-0x1400]; /* 0x1400 */
417#endif /* !__s390x__ */ 424#endif /* !__s390x__ */
418} __attribute__((packed)); /* End structure*/ 425} __attribute__((packed)); /* End structure*/
419 426
@@ -433,8 +440,6 @@ static inline __u32 store_prefix(void)
433 return address; 440 return address;
434} 441}
435 442
436#define __PANIC_MAGIC 0xDEADC0DE
437
438#endif 443#endif
439 444
440#endif 445#endif
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index 28ec870655af..fc7edd6f41b6 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -74,7 +74,7 @@ static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
74static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 74static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
75 struct task_struct *tsk) 75 struct task_struct *tsk)
76{ 76{
77 cpu_set(smp_processor_id(), next->cpu_vm_mask); 77 cpumask_set_cpu(smp_processor_id(), mm_cpumask(next));
78 update_mm(next, tsk); 78 update_mm(next, tsk);
79} 79}
80 80
diff --git a/arch/s390/include/asm/nmi.h b/arch/s390/include/asm/nmi.h
new file mode 100644
index 000000000000..f4b60441adca
--- /dev/null
+++ b/arch/s390/include/asm/nmi.h
@@ -0,0 +1,66 @@
1/*
2 * Machine check handler definitions
3 *
4 * Copyright IBM Corp. 2000,2009
5 * Author(s): Ingo Adlung <adlung@de.ibm.com>,
6 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
7 * Cornelia Huck <cornelia.huck@de.ibm.com>,
8 * Heiko Carstens <heiko.carstens@de.ibm.com>,
9 */
10
11#ifndef _ASM_S390_NMI_H
12#define _ASM_S390_NMI_H
13
14#include <linux/types.h>
15
16struct mci {
17 __u32 sd : 1; /* 00 system damage */
18 __u32 pd : 1; /* 01 instruction-processing damage */
19 __u32 sr : 1; /* 02 system recovery */
20 __u32 : 1; /* 03 */
21 __u32 cd : 1; /* 04 timing-facility damage */
22 __u32 ed : 1; /* 05 external damage */
23 __u32 : 1; /* 06 */
24 __u32 dg : 1; /* 07 degradation */
25 __u32 w : 1; /* 08 warning pending */
26 __u32 cp : 1; /* 09 channel-report pending */
27 __u32 sp : 1; /* 10 service-processor damage */
28 __u32 ck : 1; /* 11 channel-subsystem damage */
29 __u32 : 2; /* 12-13 */
30 __u32 b : 1; /* 14 backed up */
31 __u32 : 1; /* 15 */
32 __u32 se : 1; /* 16 storage error uncorrected */
33 __u32 sc : 1; /* 17 storage error corrected */
34 __u32 ke : 1; /* 18 storage-key error uncorrected */
35 __u32 ds : 1; /* 19 storage degradation */
36 __u32 wp : 1; /* 20 psw mwp validity */
37 __u32 ms : 1; /* 21 psw mask and key validity */
38 __u32 pm : 1; /* 22 psw program mask and cc validity */
39 __u32 ia : 1; /* 23 psw instruction address validity */
40 __u32 fa : 1; /* 24 failing storage address validity */
41 __u32 : 1; /* 25 */
42 __u32 ec : 1; /* 26 external damage code validity */
43 __u32 fp : 1; /* 27 floating point register validity */
44 __u32 gr : 1; /* 28 general register validity */
45 __u32 cr : 1; /* 29 control register validity */
46 __u32 : 1; /* 30 */
47 __u32 st : 1; /* 31 storage logical validity */
48 __u32 ie : 1; /* 32 indirect storage error */
49 __u32 ar : 1; /* 33 access register validity */
50 __u32 da : 1; /* 34 delayed access exception */
51 __u32 : 7; /* 35-41 */
52 __u32 pr : 1; /* 42 tod programmable register validity */
53 __u32 fc : 1; /* 43 fp control register validity */
54 __u32 ap : 1; /* 44 ancillary report */
55 __u32 : 1; /* 45 */
56 __u32 ct : 1; /* 46 cpu timer validity */
57 __u32 cc : 1; /* 47 clock comparator validity */
58 __u32 : 16; /* 47-63 */
59};
60
61struct pt_regs;
62
63extern void s390_handle_mcck(void);
64extern void s390_do_machine_check(struct pt_regs *regs);
65
66#endif /* _ASM_S390_NMI_H */
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index db4523fe38ac..61862b3ac794 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -42,22 +42,8 @@ static inline void get_cpu_id(cpuid_t *ptr)
42 asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); 42 asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr));
43} 43}
44 44
45struct cpuinfo_S390
46{
47 cpuid_t cpu_id;
48 __u16 cpu_addr;
49 __u16 cpu_nr;
50 unsigned long loops_per_jiffy;
51 unsigned long *pgd_quick;
52#ifdef __s390x__
53 unsigned long *pmd_quick;
54#endif /* __s390x__ */
55 unsigned long *pte_quick;
56 unsigned long pgtable_cache_sz;
57};
58
59extern void s390_adjust_jiffies(void); 45extern void s390_adjust_jiffies(void);
60extern void print_cpu_info(struct cpuinfo_S390 *); 46extern void print_cpu_info(void);
61extern int get_cpu_capability(unsigned int *); 47extern int get_cpu_capability(unsigned int *);
62 48
63/* 49/*
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index 8920025c3c02..f1b051630c50 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -172,6 +172,8 @@
172#define NUM_CRS 16 172#define NUM_CRS 16
173#define NUM_ACRS 16 173#define NUM_ACRS 16
174 174
175#define NUM_CR_WORDS 3
176
175#define FPR_SIZE 8 177#define FPR_SIZE 8
176#define FPC_SIZE 4 178#define FPC_SIZE 4
177#define FPC_PAD_SIZE 4 /* gcc insists on aligning the fpregs */ 179#define FPC_PAD_SIZE 4 /* gcc insists on aligning the fpregs */
@@ -334,7 +336,7 @@ struct pt_regs
334 */ 336 */
335typedef struct 337typedef struct
336{ 338{
337 unsigned long cr[3]; 339 unsigned long cr[NUM_CR_WORDS];
338} per_cr_words; 340} per_cr_words;
339 341
340#define PER_EM_MASK 0xE8000000UL 342#define PER_EM_MASK 0xE8000000UL
diff --git a/arch/s390/include/asm/qdio.h b/arch/s390/include/asm/qdio.h
index 27fc1746de15..402d6dcf0d26 100644
--- a/arch/s390/include/asm/qdio.h
+++ b/arch/s390/include/asm/qdio.h
@@ -314,6 +314,7 @@ typedef void qdio_handler_t(struct ccw_device *, unsigned int, int,
314 int, int, unsigned long); 314 int, int, unsigned long);
315 315
316/* qdio errors reported to the upper-layer program */ 316/* qdio errors reported to the upper-layer program */
317#define QDIO_ERROR_SIGA_TARGET 0x02
317#define QDIO_ERROR_SIGA_ACCESS_EXCEPTION 0x10 318#define QDIO_ERROR_SIGA_ACCESS_EXCEPTION 0x10
318#define QDIO_ERROR_SIGA_BUSY 0x20 319#define QDIO_ERROR_SIGA_BUSY 0x20
319#define QDIO_ERROR_ACTIVATE_CHECK_CONDITION 0x40 320#define QDIO_ERROR_ACTIVATE_CHECK_CONDITION 0x40
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h
index 024b91e06239..2009158a4502 100644
--- a/arch/s390/include/asm/smp.h
+++ b/arch/s390/include/asm/smp.h
@@ -50,12 +50,7 @@ extern void machine_power_off_smp(void);
50 50
51#define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ 51#define PROC_CHANGE_PENALTY 20 /* Schedule penalty */
52 52
53#define raw_smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) 53#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
54
55static inline __u16 hard_smp_processor_id(void)
56{
57 return stap();
58}
59 54
60/* 55/*
61 * returns 1 if cpu is in stopped/check stopped state or not operational 56 * returns 1 if cpu is in stopped/check stopped state or not operational
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h
index c786ab623b2d..02330c50241b 100644
--- a/arch/s390/include/asm/socket.h
+++ b/arch/s390/include/asm/socket.h
@@ -62,4 +62,7 @@
62 62
63#define SO_MARK 36 63#define SO_MARK 36
64 64
65#define SO_TIMESTAMPING 37
66#define SCM_TIMESTAMPING SO_TIMESTAMPING
67
65#endif /* _ASM_SOCKET_H */ 68#endif /* _ASM_SOCKET_H */
diff --git a/arch/s390/include/asm/string.h b/arch/s390/include/asm/string.h
index d074673a6d9b..cd0241db5a46 100644
--- a/arch/s390/include/asm/string.h
+++ b/arch/s390/include/asm/string.h
@@ -100,6 +100,7 @@ static inline char *strcat(char *dst, const char *src)
100 100
101static inline char *strcpy(char *dst, const char *src) 101static inline char *strcpy(char *dst, const char *src)
102{ 102{
103#if __GNUC__ < 4
103 register int r0 asm("0") = 0; 104 register int r0 asm("0") = 0;
104 char *ret = dst; 105 char *ret = dst;
105 106
@@ -109,10 +110,14 @@ static inline char *strcpy(char *dst, const char *src)
109 : "+&a" (dst), "+&a" (src) : "d" (r0) 110 : "+&a" (dst), "+&a" (src) : "d" (r0)
110 : "cc", "memory"); 111 : "cc", "memory");
111 return ret; 112 return ret;
113#else
114 return __builtin_strcpy(dst, src);
115#endif
112} 116}
113 117
114static inline size_t strlen(const char *s) 118static inline size_t strlen(const char *s)
115{ 119{
120#if __GNUC__ < 4
116 register unsigned long r0 asm("0") = 0; 121 register unsigned long r0 asm("0") = 0;
117 const char *tmp = s; 122 const char *tmp = s;
118 123
@@ -121,6 +126,9 @@ static inline size_t strlen(const char *s)
121 " jo 0b" 126 " jo 0b"
122 : "+d" (r0), "+a" (tmp) : : "cc"); 127 : "+d" (r0), "+a" (tmp) : : "cc");
123 return r0 - (unsigned long) s; 128 return r0 - (unsigned long) s;
129#else
130 return __builtin_strlen(s);
131#endif
124} 132}
125 133
126static inline size_t strnlen(const char * s, size_t n) 134static inline size_t strnlen(const char * s, size_t n)
@@ -135,7 +143,13 @@ static inline size_t strnlen(const char * s, size_t n)
135 : "+a" (end), "+a" (tmp) : "d" (r0) : "cc"); 143 : "+a" (end), "+a" (tmp) : "d" (r0) : "cc");
136 return end - s; 144 return end - s;
137} 145}
138 146#else /* IN_ARCH_STRING_C */
147void *memchr(const void * s, int c, size_t n);
148void *memscan(void *s, int c, size_t n);
149char *strcat(char *dst, const char *src);
150char *strcpy(char *dst, const char *src);
151size_t strlen(const char *s);
152size_t strnlen(const char * s, size_t n);
139#endif /* !IN_ARCH_STRING_C */ 153#endif /* !IN_ARCH_STRING_C */
140 154
141#endif /* __KERNEL__ */ 155#endif /* __KERNEL__ */
diff --git a/arch/s390/include/asm/sysinfo.h b/arch/s390/include/asm/sysinfo.h
index ad93212d9e16..9d70057d828c 100644
--- a/arch/s390/include/asm/sysinfo.h
+++ b/arch/s390/include/asm/sysinfo.h
@@ -100,6 +100,7 @@ struct sysinfo_3_2_2 {
100 char reserved_1[24]; 100 char reserved_1[24];
101 101
102 } vm[8]; 102 } vm[8];
103 char reserved_544[3552];
103}; 104};
104 105
105static inline int stsi(void *sysinfo, int fc, int sel1, int sel2) 106static inline int stsi(void *sysinfo, int fc, int sel1, int sel2)
diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h
index d60394b9745e..304cffa623e1 100644
--- a/arch/s390/include/asm/tlbflush.h
+++ b/arch/s390/include/asm/tlbflush.h
@@ -51,7 +51,7 @@ static inline void __tlb_flush_full(struct mm_struct *mm)
51 * If the process only ran on the local cpu, do a local flush. 51 * If the process only ran on the local cpu, do a local flush.
52 */ 52 */
53 local_cpumask = cpumask_of_cpu(smp_processor_id()); 53 local_cpumask = cpumask_of_cpu(smp_processor_id());
54 if (cpus_equal(mm->cpu_vm_mask, local_cpumask)) 54 if (cpumask_equal(mm_cpumask(mm), &local_cpumask))
55 __tlb_flush_local(); 55 __tlb_flush_local();
56 else 56 else
57 __tlb_flush_global(); 57 __tlb_flush_global();
@@ -73,7 +73,7 @@ static inline void __tlb_flush_idte(unsigned long asce)
73 73
74static inline void __tlb_flush_mm(struct mm_struct * mm) 74static inline void __tlb_flush_mm(struct mm_struct * mm)
75{ 75{
76 if (unlikely(cpus_empty(mm->cpu_vm_mask))) 76 if (unlikely(cpumask_empty(mm_cpumask(mm))))
77 return; 77 return;
78 /* 78 /*
79 * If the machine has IDTE we prefer to do a per mm flush 79 * If the machine has IDTE we prefer to do a per mm flush
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h
index c979c3b56ab0..5e0ad618dc45 100644
--- a/arch/s390/include/asm/topology.h
+++ b/arch/s390/include/asm/topology.h
@@ -5,7 +5,6 @@
5 5
6#define mc_capable() (1) 6#define mc_capable() (1)
7 7
8cpumask_t cpu_coregroup_map(unsigned int cpu);
9const struct cpumask *cpu_coregroup_mask(unsigned int cpu); 8const struct cpumask *cpu_coregroup_mask(unsigned int cpu);
10 9
11extern cpumask_t cpu_core_map[NR_CPUS]; 10extern cpumask_t cpu_core_map[NR_CPUS];
diff --git a/arch/s390/include/asm/vtoc.h b/arch/s390/include/asm/vtoc.h
index 3a5267d90d29..8406a2b3157a 100644
--- a/arch/s390/include/asm/vtoc.h
+++ b/arch/s390/include/asm/vtoc.h
@@ -39,7 +39,7 @@ struct vtoc_labeldate
39 __u16 day; 39 __u16 day;
40} __attribute__ ((packed)); 40} __attribute__ ((packed));
41 41
42struct vtoc_volume_label 42struct vtoc_volume_label_cdl
43{ 43{
44 char volkey[4]; /* volume key = volume label */ 44 char volkey[4]; /* volume key = volume label */
45 char vollbl[4]; /* volume label */ 45 char vollbl[4]; /* volume label */
@@ -56,6 +56,14 @@ struct vtoc_volume_label
56 char res3[29]; /* reserved */ 56 char res3[29]; /* reserved */
57} __attribute__ ((packed)); 57} __attribute__ ((packed));
58 58
59struct vtoc_volume_label_ldl {
60 char vollbl[4]; /* volume label */
61 char volid[6]; /* volume identifier */
62 char res3[69]; /* reserved */
63 char ldl_version; /* version number, valid for ldl format */
64 __u64 formatted_blocks; /* valid when ldl_version >= f2 */
65} __attribute__ ((packed));
66
59struct vtoc_extent 67struct vtoc_extent
60{ 68{
61 __u8 typeind; /* extent type indicator */ 69 __u8 typeind; /* extent type indicator */
@@ -140,7 +148,11 @@ struct vtoc_format4_label
140 char res2[10]; /* reserved */ 148 char res2[10]; /* reserved */
141 __u8 DS4EFLVL; /* extended free-space management level */ 149 __u8 DS4EFLVL; /* extended free-space management level */
142 struct vtoc_cchhb DS4EFPTR; /* pointer to extended free-space info */ 150 struct vtoc_cchhb DS4EFPTR; /* pointer to extended free-space info */
143 char res3[9]; /* reserved */ 151 char res3; /* reserved */
152 __u32 DS4DCYL; /* number of logical cyls */
153 char res4[2]; /* reserved */
154 __u8 DS4DEVF2; /* device flags */
155 char res5; /* reserved */
144} __attribute__ ((packed)); 156} __attribute__ ((packed));
145 157
146struct vtoc_ds5ext 158struct vtoc_ds5ext
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 3edc6c6f258b..228e3105ded7 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -17,10 +17,12 @@ CFLAGS_smp.o := -Wno-nonnull
17# 17#
18CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' 18CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
19 19
20CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w
21
20obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \ 22obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \
21 processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ 23 processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
22 s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \ 24 s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \
23 vdso.o vtime.o 25 vdso.o vtime.o sysinfo.o nmi.o
24 26
25obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) 27obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o)
26obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) 28obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)
diff --git a/arch/s390/kernel/bitmap.S b/arch/s390/kernel/bitmap.S
deleted file mode 100644
index dfb41f946e23..000000000000
--- a/arch/s390/kernel/bitmap.S
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * arch/s390/kernel/bitmap.S
3 * Bitmaps for set_bit, clear_bit, test_and_set_bit, ...
4 * See include/asm-s390/{bitops.h|posix_types.h} for details
5 *
6 * S390 version
7 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
8 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
9 */
10
11 .globl _oi_bitmap
12_oi_bitmap:
13 .byte 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
14
15 .globl _ni_bitmap
16_ni_bitmap:
17 .byte 0xFE,0xFD,0xFB,0xF7,0xEF,0xDF,0xBF,0x7F
18
19 .globl _zb_findmap
20_zb_findmap:
21 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
22 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
23 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
24 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6
25 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
26 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
27 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
28 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7
29 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
30 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
31 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
32 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6
33 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
34 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5
35 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4
36 .byte 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,8
37
38 .globl _sb_findmap
39_sb_findmap:
40 .byte 8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
41 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
42 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
43 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
44 .byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
45 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
46 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
47 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
48 .byte 7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
49 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
50 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
51 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
52 .byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
53 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
54 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
55 .byte 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
56
diff --git a/arch/s390/kernel/bitmap.c b/arch/s390/kernel/bitmap.c
new file mode 100644
index 000000000000..3ae4757b006a
--- /dev/null
+++ b/arch/s390/kernel/bitmap.c
@@ -0,0 +1,54 @@
1/*
2 * Bitmaps for set_bit, clear_bit, test_and_set_bit, ...
3 * See include/asm/{bitops.h|posix_types.h} for details
4 *
5 * Copyright IBM Corp. 1999,2009
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>,
7 */
8
9#include <linux/bitops.h>
10#include <linux/module.h>
11
12const char _oi_bitmap[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
13EXPORT_SYMBOL(_oi_bitmap);
14
15const char _ni_bitmap[] = { 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f };
16EXPORT_SYMBOL(_ni_bitmap);
17
18const char _zb_findmap[] = {
19 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
20 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
21 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
22 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,
23 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
24 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
25 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
26 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,
27 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
28 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
29 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
30 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,
31 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
32 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
33 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
34 0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,8 };
35EXPORT_SYMBOL(_zb_findmap);
36
37const char _sb_findmap[] = {
38 8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
39 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
40 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
41 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
42 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
43 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
44 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
45 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
46 7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
47 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
48 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
49 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
50 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
51 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
52 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
53 4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0 };
54EXPORT_SYMBOL(_sb_findmap);
diff --git a/arch/s390/kernel/compat_ptrace.h b/arch/s390/kernel/compat_ptrace.h
index a2be3a978d5c..123dd660d7fb 100644
--- a/arch/s390/kernel/compat_ptrace.h
+++ b/arch/s390/kernel/compat_ptrace.h
@@ -1,10 +1,11 @@
1#ifndef _PTRACE32_H 1#ifndef _PTRACE32_H
2#define _PTRACE32_H 2#define _PTRACE32_H
3 3
4#include <asm/ptrace.h> /* needed for NUM_CR_WORDS */
4#include "compat_linux.h" /* needed for psw_compat_t */ 5#include "compat_linux.h" /* needed for psw_compat_t */
5 6
6typedef struct { 7typedef struct {
7 __u32 cr[3]; 8 __u32 cr[NUM_CR_WORDS];
8} per_cr_words32; 9} per_cr_words32;
9 10
10typedef struct { 11typedef struct {
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 62c706eb0de6..87cf5a79a351 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -252,7 +252,7 @@ sys32_chroot_wrapper:
252sys32_ustat_wrapper: 252sys32_ustat_wrapper:
253 llgfr %r2,%r2 # dev_t 253 llgfr %r2,%r2 # dev_t
254 llgtr %r3,%r3 # struct ustat * 254 llgtr %r3,%r3 # struct ustat *
255 jg sys_ustat 255 jg compat_sys_ustat
256 256
257 .globl sys32_dup2_wrapper 257 .globl sys32_dup2_wrapper
258sys32_dup2_wrapper: 258sys32_dup2_wrapper:
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index ba03fc0a3a56..be8bceaf37d9 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -603,7 +603,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length,
603static int 603static int
604debug_open(struct inode *inode, struct file *file) 604debug_open(struct inode *inode, struct file *file)
605{ 605{
606 int i = 0, rc = 0; 606 int i, rc = 0;
607 file_private_info_t *p_info; 607 file_private_info_t *p_info;
608 debug_info_t *debug_info, *debug_info_snapshot; 608 debug_info_t *debug_info, *debug_info_snapshot;
609 609
@@ -642,8 +642,7 @@ found:
642 p_info = kmalloc(sizeof(file_private_info_t), 642 p_info = kmalloc(sizeof(file_private_info_t),
643 GFP_KERNEL); 643 GFP_KERNEL);
644 if(!p_info){ 644 if(!p_info){
645 if(debug_info_snapshot) 645 debug_info_free(debug_info_snapshot);
646 debug_info_free(debug_info_snapshot);
647 rc = -ENOMEM; 646 rc = -ENOMEM;
648 goto out; 647 goto out;
649 } 648 }
@@ -698,8 +697,7 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area,
698 if ((uid != 0) || (gid != 0)) 697 if ((uid != 0) || (gid != 0))
699 pr_warning("Root becomes the owner of all s390dbf files " 698 pr_warning("Root becomes the owner of all s390dbf files "
700 "in sysfs\n"); 699 "in sysfs\n");
701 if (!initialized) 700 BUG_ON(!initialized);
702 BUG();
703 mutex_lock(&debug_mutex); 701 mutex_lock(&debug_mutex);
704 702
705 /* create new debug_info */ 703 /* create new debug_info */
@@ -1156,7 +1154,6 @@ debug_unregister_view(debug_info_t * id, struct debug_view *view)
1156 else { 1154 else {
1157 debugfs_remove(id->debugfs_entries[i]); 1155 debugfs_remove(id->debugfs_entries[i]);
1158 id->views[i] = NULL; 1156 id->views[i] = NULL;
1159 rc = 0;
1160 } 1157 }
1161 spin_unlock_irqrestore(&id->lock, flags); 1158 spin_unlock_irqrestore(&id->lock, flags);
1162out: 1159out:
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 2a2ca268b1dd..4d221c81c849 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -6,6 +6,7 @@
6 * Heiko Carstens <heiko.carstens@de.ibm.com> 6 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 */ 7 */
8 8
9#include <linux/compiler.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/errno.h> 11#include <linux/errno.h>
11#include <linux/string.h> 12#include <linux/string.h>
@@ -20,6 +21,7 @@
20#include <asm/processor.h> 21#include <asm/processor.h>
21#include <asm/sections.h> 22#include <asm/sections.h>
22#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/sysinfo.h>
23#include <asm/cpcmd.h> 25#include <asm/cpcmd.h>
24#include <asm/sclp.h> 26#include <asm/sclp.h>
25#include "entry.h" 27#include "entry.h"
@@ -173,19 +175,21 @@ static noinline __init void init_kernel_storage_key(void)
173 page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY); 175 page_set_storage_key(init_pfn << PAGE_SHIFT, PAGE_DEFAULT_KEY);
174} 176}
175 177
178static __initdata struct sysinfo_3_2_2 vmms __aligned(PAGE_SIZE);
179
176static noinline __init void detect_machine_type(void) 180static noinline __init void detect_machine_type(void)
177{ 181{
178 struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data; 182 /* No VM information? Looks like LPAR */
179 183 if (stsi(&vmms, 3, 2, 2) == -ENOSYS)
180 get_cpu_id(&S390_lowcore.cpu_data.cpu_id); 184 return;
181 185 if (!vmms.count)
182 /* Running under z/VM ? */ 186 return;
183 if (cpuinfo->cpu_id.version == 0xff)
184 machine_flags |= MACHINE_FLAG_VM;
185 187
186 /* Running under KVM ? */ 188 /* Running under KVM? If not we assume z/VM */
187 if (cpuinfo->cpu_id.version == 0xfe) 189 if (!memcmp(vmms.vm[0].cpi, "\xd2\xe5\xd4", 3))
188 machine_flags |= MACHINE_FLAG_KVM; 190 machine_flags |= MACHINE_FLAG_KVM;
191 else
192 machine_flags |= MACHINE_FLAG_VM;
189} 193}
190 194
191static __init void early_pgm_check_handler(void) 195static __init void early_pgm_check_handler(void)
@@ -348,7 +352,6 @@ static void __init setup_boot_command_line(void)
348 352
349 /* copy arch command line */ 353 /* copy arch command line */
350 strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); 354 strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
351 boot_command_line[ARCH_COMMAND_LINE_SIZE - 1] = 0;
352 355
353 /* append IPL PARM data to the boot command line */ 356 /* append IPL PARM data to the boot command line */
354 if (MACHINE_IS_VM) { 357 if (MACHINE_IS_VM) {
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index ec7e35f6055b..1046c2c9f8d1 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -469,6 +469,8 @@ start:
469 .org 0x10000 469 .org 0x10000
470startup:basr %r13,0 # get base 470startup:basr %r13,0 # get base
471.LPG0: 471.LPG0:
472 xc 0x200(256),0x200 # partially clear lowcore
473 xc 0x300(256),0x300
472 474
473#ifndef CONFIG_MARCH_G5 475#ifndef CONFIG_MARCH_G5
474 # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10} 476 # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10}
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index db476d114caa..2ced846065b7 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -20,7 +20,6 @@ startup_continue:
20 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 20 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
21 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area 21 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
22 # move IPL device to lowcore 22 # move IPL device to lowcore
23 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
24# 23#
25# Setup stack 24# Setup stack
26# 25#
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index f9f70aa15244..65667b2e65ce 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -86,7 +86,6 @@ startup_continue:
86 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 86 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
87 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area 87 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
88 # move IPL device to lowcore 88 # move IPL device to lowcore
89 mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12)
90 lghi %r0,__LC_PASTE 89 lghi %r0,__LC_PASTE
91 stg %r0,__LC_VDSO_PER_CPU 90 stg %r0,__LC_VDSO_PER_CPU
92# 91#
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 2dcf590faba6..6f3711a0eaaa 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -23,7 +23,7 @@
23#include <asm/ebcdic.h> 23#include <asm/ebcdic.h>
24#include <asm/reset.h> 24#include <asm/reset.h>
25#include <asm/sclp.h> 25#include <asm/sclp.h>
26#include <asm/setup.h> 26#include <asm/checksum.h>
27 27
28#define IPL_PARM_BLOCK_VERSION 0 28#define IPL_PARM_BLOCK_VERSION 0
29 29
@@ -56,13 +56,14 @@ struct shutdown_trigger {
56}; 56};
57 57
58/* 58/*
59 * Five shutdown action types are supported: 59 * The following shutdown action types are supported:
60 */ 60 */
61#define SHUTDOWN_ACTION_IPL_STR "ipl" 61#define SHUTDOWN_ACTION_IPL_STR "ipl"
62#define SHUTDOWN_ACTION_REIPL_STR "reipl" 62#define SHUTDOWN_ACTION_REIPL_STR "reipl"
63#define SHUTDOWN_ACTION_DUMP_STR "dump" 63#define SHUTDOWN_ACTION_DUMP_STR "dump"
64#define SHUTDOWN_ACTION_VMCMD_STR "vmcmd" 64#define SHUTDOWN_ACTION_VMCMD_STR "vmcmd"
65#define SHUTDOWN_ACTION_STOP_STR "stop" 65#define SHUTDOWN_ACTION_STOP_STR "stop"
66#define SHUTDOWN_ACTION_DUMP_REIPL_STR "dump_reipl"
66 67
67struct shutdown_action { 68struct shutdown_action {
68 char *name; 69 char *name;
@@ -146,6 +147,7 @@ static enum ipl_method reipl_method = REIPL_METHOD_DEFAULT;
146static struct ipl_parameter_block *reipl_block_fcp; 147static struct ipl_parameter_block *reipl_block_fcp;
147static struct ipl_parameter_block *reipl_block_ccw; 148static struct ipl_parameter_block *reipl_block_ccw;
148static struct ipl_parameter_block *reipl_block_nss; 149static struct ipl_parameter_block *reipl_block_nss;
150static struct ipl_parameter_block *reipl_block_actual;
149 151
150static int dump_capabilities = DUMP_TYPE_NONE; 152static int dump_capabilities = DUMP_TYPE_NONE;
151static enum dump_type dump_type = DUMP_TYPE_NONE; 153static enum dump_type dump_type = DUMP_TYPE_NONE;
@@ -835,6 +837,7 @@ static int reipl_set_type(enum ipl_type type)
835 reipl_method = REIPL_METHOD_CCW_VM; 837 reipl_method = REIPL_METHOD_CCW_VM;
836 else 838 else
837 reipl_method = REIPL_METHOD_CCW_CIO; 839 reipl_method = REIPL_METHOD_CCW_CIO;
840 reipl_block_actual = reipl_block_ccw;
838 break; 841 break;
839 case IPL_TYPE_FCP: 842 case IPL_TYPE_FCP:
840 if (diag308_set_works) 843 if (diag308_set_works)
@@ -843,6 +846,7 @@ static int reipl_set_type(enum ipl_type type)
843 reipl_method = REIPL_METHOD_FCP_RO_VM; 846 reipl_method = REIPL_METHOD_FCP_RO_VM;
844 else 847 else
845 reipl_method = REIPL_METHOD_FCP_RO_DIAG; 848 reipl_method = REIPL_METHOD_FCP_RO_DIAG;
849 reipl_block_actual = reipl_block_fcp;
846 break; 850 break;
847 case IPL_TYPE_FCP_DUMP: 851 case IPL_TYPE_FCP_DUMP:
848 reipl_method = REIPL_METHOD_FCP_DUMP; 852 reipl_method = REIPL_METHOD_FCP_DUMP;
@@ -852,6 +856,7 @@ static int reipl_set_type(enum ipl_type type)
852 reipl_method = REIPL_METHOD_NSS_DIAG; 856 reipl_method = REIPL_METHOD_NSS_DIAG;
853 else 857 else
854 reipl_method = REIPL_METHOD_NSS; 858 reipl_method = REIPL_METHOD_NSS;
859 reipl_block_actual = reipl_block_nss;
855 break; 860 break;
856 case IPL_TYPE_UNKNOWN: 861 case IPL_TYPE_UNKNOWN:
857 reipl_method = REIPL_METHOD_DEFAULT; 862 reipl_method = REIPL_METHOD_DEFAULT;
@@ -960,7 +965,6 @@ static void reipl_run(struct shutdown_trigger *trigger)
960 diag308(DIAG308_IPL, NULL); 965 diag308(DIAG308_IPL, NULL);
961 break; 966 break;
962 case REIPL_METHOD_FCP_DUMP: 967 case REIPL_METHOD_FCP_DUMP:
963 default:
964 break; 968 break;
965 } 969 }
966 disabled_wait((unsigned long) __builtin_return_address(0)); 970 disabled_wait((unsigned long) __builtin_return_address(0));
@@ -1069,10 +1073,12 @@ static int __init reipl_fcp_init(void)
1069{ 1073{
1070 int rc; 1074 int rc;
1071 1075
1072 if ((!diag308_set_works) && (ipl_info.type != IPL_TYPE_FCP)) 1076 if (!diag308_set_works) {
1073 return 0; 1077 if (ipl_info.type == IPL_TYPE_FCP)
1074 if ((!diag308_set_works) && (ipl_info.type == IPL_TYPE_FCP)) 1078 make_attrs_ro(reipl_fcp_attrs);
1075 make_attrs_ro(reipl_fcp_attrs); 1079 else
1080 return 0;
1081 }
1076 1082
1077 reipl_block_fcp = (void *) get_zeroed_page(GFP_KERNEL); 1083 reipl_block_fcp = (void *) get_zeroed_page(GFP_KERNEL);
1078 if (!reipl_block_fcp) 1084 if (!reipl_block_fcp)
@@ -1253,7 +1259,6 @@ static void dump_run(struct shutdown_trigger *trigger)
1253 diag308(DIAG308_DUMP, NULL); 1259 diag308(DIAG308_DUMP, NULL);
1254 break; 1260 break;
1255 case DUMP_METHOD_NONE: 1261 case DUMP_METHOD_NONE:
1256 default:
1257 return; 1262 return;
1258 } 1263 }
1259 printk(KERN_EMERG "Dump failed!\n"); 1264 printk(KERN_EMERG "Dump failed!\n");
@@ -1332,6 +1337,49 @@ static struct shutdown_action __refdata dump_action = {
1332 .init = dump_init, 1337 .init = dump_init,
1333}; 1338};
1334 1339
1340static void dump_reipl_run(struct shutdown_trigger *trigger)
1341{
1342 preempt_disable();
1343 /*
1344 * Bypass dynamic address translation (DAT) when storing IPL parameter
1345 * information block address and checksum into the prefix area
1346 * (corresponding to absolute addresses 0-8191).
1347 * When enhanced DAT applies and the STE format control in one,
1348 * the absolute address is formed without prefixing. In this case a
1349 * normal store (stg/st) into the prefix area would no more match to
1350 * absolute addresses 0-8191.
1351 */
1352#ifdef CONFIG_64BIT
1353 asm volatile("sturg %0,%1"
1354 :: "a" ((unsigned long) reipl_block_actual),
1355 "a" (&lowcore_ptr[smp_processor_id()]->ipib));
1356#else
1357 asm volatile("stura %0,%1"
1358 :: "a" ((unsigned long) reipl_block_actual),
1359 "a" (&lowcore_ptr[smp_processor_id()]->ipib));
1360#endif
1361 asm volatile("stura %0,%1"
1362 :: "a" (csum_partial(reipl_block_actual,
1363 reipl_block_actual->hdr.len, 0)),
1364 "a" (&lowcore_ptr[smp_processor_id()]->ipib_checksum));
1365 preempt_enable();
1366 dump_run(trigger);
1367}
1368
1369static int __init dump_reipl_init(void)
1370{
1371 if (!diag308_set_works)
1372 return -EOPNOTSUPP;
1373 else
1374 return 0;
1375}
1376
1377static struct shutdown_action __refdata dump_reipl_action = {
1378 .name = SHUTDOWN_ACTION_DUMP_REIPL_STR,
1379 .fn = dump_reipl_run,
1380 .init = dump_reipl_init,
1381};
1382
1335/* 1383/*
1336 * vmcmd shutdown action: Trigger vm command on shutdown. 1384 * vmcmd shutdown action: Trigger vm command on shutdown.
1337 */ 1385 */
@@ -1421,7 +1469,8 @@ static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR,
1421/* action list */ 1469/* action list */
1422 1470
1423static struct shutdown_action *shutdown_actions_list[] = { 1471static struct shutdown_action *shutdown_actions_list[] = {
1424 &ipl_action, &reipl_action, &dump_action, &vmcmd_action, &stop_action}; 1472 &ipl_action, &reipl_action, &dump_reipl_action, &dump_action,
1473 &vmcmd_action, &stop_action};
1425#define SHUTDOWN_ACTIONS_COUNT (sizeof(shutdown_actions_list) / sizeof(void *)) 1474#define SHUTDOWN_ACTIONS_COUNT (sizeof(shutdown_actions_list) / sizeof(void *))
1426 1475
1427/* 1476/*
@@ -1434,11 +1483,11 @@ static int set_trigger(const char *buf, struct shutdown_trigger *trigger,
1434 size_t len) 1483 size_t len)
1435{ 1484{
1436 int i; 1485 int i;
1486
1437 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) { 1487 for (i = 0; i < SHUTDOWN_ACTIONS_COUNT; i++) {
1438 if (!shutdown_actions_list[i]) 1488 if (!shutdown_actions_list[i])
1439 continue; 1489 continue;
1440 if (strncmp(buf, shutdown_actions_list[i]->name, 1490 if (sysfs_streq(buf, shutdown_actions_list[i]->name)) {
1441 strlen(shutdown_actions_list[i]->name)) == 0) {
1442 trigger->action = shutdown_actions_list[i]; 1491 trigger->action = shutdown_actions_list[i];
1443 return len; 1492 return len;
1444 } 1493 }
@@ -1672,7 +1721,7 @@ static int on_panic_notify(struct notifier_block *self,
1672 1721
1673static struct notifier_block on_panic_nb = { 1722static struct notifier_block on_panic_nb = {
1674 .notifier_call = on_panic_notify, 1723 .notifier_call = on_panic_notify,
1675 .priority = 0, 1724 .priority = INT_MIN,
1676}; 1725};
1677 1726
1678void __init setup_ipl(void) 1727void __init setup_ipl(void)
@@ -1696,7 +1745,6 @@ void __init setup_ipl(void)
1696 sizeof(ipl_info.data.nss.name)); 1745 sizeof(ipl_info.data.nss.name));
1697 break; 1746 break;
1698 case IPL_TYPE_UNKNOWN: 1747 case IPL_TYPE_UNKNOWN:
1699 default:
1700 /* We have no info to copy */ 1748 /* We have no info to copy */
1701 break; 1749 break;
1702 } 1750 }
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index 59b4e796680a..eed4a00cb676 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -310,15 +310,20 @@ apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
310 info->plt_initialized = 1; 310 info->plt_initialized = 1;
311 } 311 }
312 if (r_type == R_390_PLTOFF16 || 312 if (r_type == R_390_PLTOFF16 ||
313 r_type == R_390_PLTOFF32 313 r_type == R_390_PLTOFF32 ||
314 || r_type == R_390_PLTOFF64 314 r_type == R_390_PLTOFF64)
315 )
316 val = me->arch.plt_offset - me->arch.got_offset + 315 val = me->arch.plt_offset - me->arch.got_offset +
317 info->plt_offset + rela->r_addend; 316 info->plt_offset + rela->r_addend;
318 else 317 else {
319 val = (Elf_Addr) me->module_core + 318 if (!((r_type == R_390_PLT16DBL &&
320 me->arch.plt_offset + info->plt_offset + 319 val - loc + 0xffffUL < 0x1ffffeUL) ||
321 rela->r_addend - loc; 320 (r_type == R_390_PLT32DBL &&
321 val - loc + 0xffffffffULL < 0x1fffffffeULL)))
322 val = (Elf_Addr) me->module_core +
323 me->arch.plt_offset +
324 info->plt_offset;
325 val += rela->r_addend - loc;
326 }
322 if (r_type == R_390_PLT16DBL) 327 if (r_type == R_390_PLT16DBL)
323 *(unsigned short *) loc = val >> 1; 328 *(unsigned short *) loc = val >> 1;
324 else if (r_type == R_390_PLTOFF16) 329 else if (r_type == R_390_PLTOFF16)
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c
new file mode 100644
index 000000000000..4bfdc421d7e9
--- /dev/null
+++ b/arch/s390/kernel/nmi.c
@@ -0,0 +1,376 @@
1/*
2 * Machine check handler
3 *
4 * Copyright IBM Corp. 2000,2009
5 * Author(s): Ingo Adlung <adlung@de.ibm.com>,
6 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
7 * Cornelia Huck <cornelia.huck@de.ibm.com>,
8 * Heiko Carstens <heiko.carstens@de.ibm.com>,
9 */
10
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/time.h>
14#include <linux/module.h>
15#include <asm/lowcore.h>
16#include <asm/smp.h>
17#include <asm/etr.h>
18#include <asm/cpu.h>
19#include <asm/nmi.h>
20#include <asm/crw.h>
21
22struct mcck_struct {
23 int kill_task;
24 int channel_report;
25 int warning;
26 unsigned long long mcck_code;
27};
28
29static DEFINE_PER_CPU(struct mcck_struct, cpu_mcck);
30
31static NORET_TYPE void s390_handle_damage(char *msg)
32{
33 smp_send_stop();
34 disabled_wait((unsigned long) __builtin_return_address(0));
35 while (1);
36}
37
38/*
39 * Main machine check handler function. Will be called with interrupts enabled
40 * or disabled and machine checks enabled or disabled.
41 */
42void s390_handle_mcck(void)
43{
44 unsigned long flags;
45 struct mcck_struct mcck;
46
47 /*
48 * Disable machine checks and get the current state of accumulated
49 * machine checks. Afterwards delete the old state and enable machine
50 * checks again.
51 */
52 local_irq_save(flags);
53 local_mcck_disable();
54 mcck = __get_cpu_var(cpu_mcck);
55 memset(&__get_cpu_var(cpu_mcck), 0, sizeof(struct mcck_struct));
56 clear_thread_flag(TIF_MCCK_PENDING);
57 local_mcck_enable();
58 local_irq_restore(flags);
59
60 if (mcck.channel_report)
61 crw_handle_channel_report();
62 /*
63 * A warning may remain for a prolonged period on the bare iron.
64 * (actually until the machine is powered off, or the problem is gone)
65 * So we just stop listening for the WARNING MCH and avoid continuously
66 * being interrupted. One caveat is however, that we must do this per
67 * processor and cannot use the smp version of ctl_clear_bit().
68 * On VM we only get one interrupt per virtally presented machinecheck.
69 * Though one suffices, we may get one interrupt per (virtual) cpu.
70 */
71 if (mcck.warning) { /* WARNING pending ? */
72 static int mchchk_wng_posted = 0;
73
74 /* Use single cpu clear, as we cannot handle smp here. */
75 __ctl_clear_bit(14, 24); /* Disable WARNING MCH */
76 if (xchg(&mchchk_wng_posted, 1) == 0)
77 kill_cad_pid(SIGPWR, 1);
78 }
79 if (mcck.kill_task) {
80 local_irq_enable();
81 printk(KERN_EMERG "mcck: Terminating task because of machine "
82 "malfunction (code 0x%016llx).\n", mcck.mcck_code);
83 printk(KERN_EMERG "mcck: task: %s, pid: %d.\n",
84 current->comm, current->pid);
85 do_exit(SIGSEGV);
86 }
87}
88EXPORT_SYMBOL_GPL(s390_handle_mcck);
89
90/*
91 * returns 0 if all registers could be validated
92 * returns 1 otherwise
93 */
94static int notrace s390_revalidate_registers(struct mci *mci)
95{
96 int kill_task;
97 u64 tmpclock;
98 u64 zero;
99 void *fpt_save_area, *fpt_creg_save_area;
100
101 kill_task = 0;
102 zero = 0;
103
104 if (!mci->gr) {
105 /*
106 * General purpose registers couldn't be restored and have
107 * unknown contents. Process needs to be terminated.
108 */
109 kill_task = 1;
110 }
111 if (!mci->fp) {
112 /*
113 * Floating point registers can't be restored and
114 * therefore the process needs to be terminated.
115 */
116 kill_task = 1;
117 }
118#ifndef CONFIG_64BIT
119 asm volatile(
120 " ld 0,0(%0)\n"
121 " ld 2,8(%0)\n"
122 " ld 4,16(%0)\n"
123 " ld 6,24(%0)"
124 : : "a" (&S390_lowcore.floating_pt_save_area));
125#endif
126
127 if (MACHINE_HAS_IEEE) {
128#ifdef CONFIG_64BIT
129 fpt_save_area = &S390_lowcore.floating_pt_save_area;
130 fpt_creg_save_area = &S390_lowcore.fpt_creg_save_area;
131#else
132 fpt_save_area = (void *) S390_lowcore.extended_save_area_addr;
133 fpt_creg_save_area = fpt_save_area + 128;
134#endif
135 if (!mci->fc) {
136 /*
137 * Floating point control register can't be restored.
138 * Task will be terminated.
139 */
140 asm volatile("lfpc 0(%0)" : : "a" (&zero), "m" (zero));
141 kill_task = 1;
142
143 } else
144 asm volatile("lfpc 0(%0)" : : "a" (fpt_creg_save_area));
145
146 asm volatile(
147 " ld 0,0(%0)\n"
148 " ld 1,8(%0)\n"
149 " ld 2,16(%0)\n"
150 " ld 3,24(%0)\n"
151 " ld 4,32(%0)\n"
152 " ld 5,40(%0)\n"
153 " ld 6,48(%0)\n"
154 " ld 7,56(%0)\n"
155 " ld 8,64(%0)\n"
156 " ld 9,72(%0)\n"
157 " ld 10,80(%0)\n"
158 " ld 11,88(%0)\n"
159 " ld 12,96(%0)\n"
160 " ld 13,104(%0)\n"
161 " ld 14,112(%0)\n"
162 " ld 15,120(%0)\n"
163 : : "a" (fpt_save_area));
164 }
165 /* Revalidate access registers */
166 asm volatile(
167 " lam 0,15,0(%0)"
168 : : "a" (&S390_lowcore.access_regs_save_area));
169 if (!mci->ar) {
170 /*
171 * Access registers have unknown contents.
172 * Terminating task.
173 */
174 kill_task = 1;
175 }
176 /* Revalidate control registers */
177 if (!mci->cr) {
178 /*
179 * Control registers have unknown contents.
180 * Can't recover and therefore stopping machine.
181 */
182 s390_handle_damage("invalid control registers.");
183 } else {
184#ifdef CONFIG_64BIT
185 asm volatile(
186 " lctlg 0,15,0(%0)"
187 : : "a" (&S390_lowcore.cregs_save_area));
188#else
189 asm volatile(
190 " lctl 0,15,0(%0)"
191 : : "a" (&S390_lowcore.cregs_save_area));
192#endif
193 }
194 /*
195 * We don't even try to revalidate the TOD register, since we simply
196 * can't write something sensible into that register.
197 */
198#ifdef CONFIG_64BIT
199 /*
200 * See if we can revalidate the TOD programmable register with its
201 * old contents (should be zero) otherwise set it to zero.
202 */
203 if (!mci->pr)
204 asm volatile(
205 " sr 0,0\n"
206 " sckpf"
207 : : : "0", "cc");
208 else
209 asm volatile(
210 " l 0,0(%0)\n"
211 " sckpf"
212 : : "a" (&S390_lowcore.tod_progreg_save_area)
213 : "0", "cc");
214#endif
215 /* Revalidate clock comparator register */
216 asm volatile(
217 " stck 0(%1)\n"
218 " sckc 0(%1)"
219 : "=m" (tmpclock) : "a" (&(tmpclock)) : "cc", "memory");
220
221 /* Check if old PSW is valid */
222 if (!mci->wp)
223 /*
224 * Can't tell if we come from user or kernel mode
225 * -> stopping machine.
226 */
227 s390_handle_damage("old psw invalid.");
228
229 if (!mci->ms || !mci->pm || !mci->ia)
230 kill_task = 1;
231
232 return kill_task;
233}
234
235#define MAX_IPD_COUNT 29
236#define MAX_IPD_TIME (5 * 60 * USEC_PER_SEC) /* 5 minutes */
237
238#define ED_STP_ISLAND 6 /* External damage STP island check */
239#define ED_STP_SYNC 7 /* External damage STP sync check */
240#define ED_ETR_SYNC 12 /* External damage ETR sync check */
241#define ED_ETR_SWITCH 13 /* External damage ETR switch to local */
242
243/*
244 * machine check handler.
245 */
246void notrace s390_do_machine_check(struct pt_regs *regs)
247{
248 static int ipd_count;
249 static DEFINE_SPINLOCK(ipd_lock);
250 static unsigned long long last_ipd;
251 struct mcck_struct *mcck;
252 unsigned long long tmp;
253 struct mci *mci;
254 int umode;
255
256 lockdep_off();
257 s390_idle_check();
258
259 mci = (struct mci *) &S390_lowcore.mcck_interruption_code;
260 mcck = &__get_cpu_var(cpu_mcck);
261 umode = user_mode(regs);
262
263 if (mci->sd) {
264 /* System damage -> stopping machine */
265 s390_handle_damage("received system damage machine check.");
266 }
267 if (mci->pd) {
268 if (mci->b) {
269 /* Processing backup -> verify if we can survive this */
270 u64 z_mcic, o_mcic, t_mcic;
271#ifdef CONFIG_64BIT
272 z_mcic = (1ULL<<63 | 1ULL<<59 | 1ULL<<29);
273 o_mcic = (1ULL<<43 | 1ULL<<42 | 1ULL<<41 | 1ULL<<40 |
274 1ULL<<36 | 1ULL<<35 | 1ULL<<34 | 1ULL<<32 |
275 1ULL<<30 | 1ULL<<21 | 1ULL<<20 | 1ULL<<17 |
276 1ULL<<16);
277#else
278 z_mcic = (1ULL<<63 | 1ULL<<59 | 1ULL<<57 | 1ULL<<50 |
279 1ULL<<29);
280 o_mcic = (1ULL<<43 | 1ULL<<42 | 1ULL<<41 | 1ULL<<40 |
281 1ULL<<36 | 1ULL<<35 | 1ULL<<34 | 1ULL<<32 |
282 1ULL<<30 | 1ULL<<20 | 1ULL<<17 | 1ULL<<16);
283#endif
284 t_mcic = *(u64 *)mci;
285
286 if (((t_mcic & z_mcic) != 0) ||
287 ((t_mcic & o_mcic) != o_mcic)) {
288 s390_handle_damage("processing backup machine "
289 "check with damage.");
290 }
291
292 /*
293 * Nullifying exigent condition, therefore we might
294 * retry this instruction.
295 */
296 spin_lock(&ipd_lock);
297 tmp = get_clock();
298 if (((tmp - last_ipd) >> 12) < MAX_IPD_TIME)
299 ipd_count++;
300 else
301 ipd_count = 1;
302 last_ipd = tmp;
303 if (ipd_count == MAX_IPD_COUNT)
304 s390_handle_damage("too many ipd retries.");
305 spin_unlock(&ipd_lock);
306 } else {
307 /* Processing damage -> stopping machine */
308 s390_handle_damage("received instruction processing "
309 "damage machine check.");
310 }
311 }
312 if (s390_revalidate_registers(mci)) {
313 if (umode) {
314 /*
315 * Couldn't restore all register contents while in
316 * user mode -> mark task for termination.
317 */
318 mcck->kill_task = 1;
319 mcck->mcck_code = *(unsigned long long *) mci;
320 set_thread_flag(TIF_MCCK_PENDING);
321 } else {
322 /*
323 * Couldn't restore all register contents while in
324 * kernel mode -> stopping machine.
325 */
326 s390_handle_damage("unable to revalidate registers.");
327 }
328 }
329 if (mci->cd) {
330 /* Timing facility damage */
331 s390_handle_damage("TOD clock damaged");
332 }
333 if (mci->ed && mci->ec) {
334 /* External damage */
335 if (S390_lowcore.external_damage_code & (1U << ED_ETR_SYNC))
336 etr_sync_check();
337 if (S390_lowcore.external_damage_code & (1U << ED_ETR_SWITCH))
338 etr_switch_to_local();
339 if (S390_lowcore.external_damage_code & (1U << ED_STP_SYNC))
340 stp_sync_check();
341 if (S390_lowcore.external_damage_code & (1U << ED_STP_ISLAND))
342 stp_island_check();
343 }
344 if (mci->se)
345 /* Storage error uncorrected */
346 s390_handle_damage("received storage error uncorrected "
347 "machine check.");
348 if (mci->ke)
349 /* Storage key-error uncorrected */
350 s390_handle_damage("received storage key-error uncorrected "
351 "machine check.");
352 if (mci->ds && mci->fa)
353 /* Storage degradation */
354 s390_handle_damage("received storage degradation machine "
355 "check.");
356 if (mci->cp) {
357 /* Channel report word pending */
358 mcck->channel_report = 1;
359 set_thread_flag(TIF_MCCK_PENDING);
360 }
361 if (mci->w) {
362 /* Warning pending */
363 mcck->warning = 1;
364 set_thread_flag(TIF_MCCK_PENDING);
365 }
366 lockdep_on();
367}
368
369static int __init machine_check_init(void)
370{
371 ctl_set_bit(14, 25); /* enable external damage MCH */
372 ctl_set_bit(14, 27); /* enable system recovery MCH */
373 ctl_set_bit(14, 24); /* enable warning MCH */
374 return 0;
375}
376arch_initcall(machine_check_init);
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 5cd38a90e64d..b48e961a38f6 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -1,18 +1,10 @@
1/* 1/*
2 * arch/s390/kernel/process.c 2 * This file handles the architecture dependent parts of process handling.
3 * 3 *
4 * S390 version 4 * Copyright IBM Corp. 1999,2009
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>,
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 6 * Hartmut Penner <hp@de.ibm.com>,
7 * Hartmut Penner (hp@de.ibm.com), 7 * Denis Joseph Barrow,
8 * Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
9 *
10 * Derived from "arch/i386/kernel/process.c"
11 * Copyright (C) 1995, Linus Torvalds
12 */
13
14/*
15 * This file handles the architecture-dependent parts of process handling..
16 */ 8 */
17 9
18#include <linux/compiler.h> 10#include <linux/compiler.h>
@@ -47,6 +39,7 @@
47#include <asm/processor.h> 39#include <asm/processor.h>
48#include <asm/irq.h> 40#include <asm/irq.h>
49#include <asm/timer.h> 41#include <asm/timer.h>
42#include <asm/nmi.h>
50#include "entry.h" 43#include "entry.h"
51 44
52asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); 45asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
@@ -76,7 +69,6 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
76 return sf->gprs[8]; 69 return sf->gprs[8];
77} 70}
78 71
79extern void s390_handle_mcck(void);
80/* 72/*
81 * The idle loop on a S390... 73 * The idle loop on a S390...
82 */ 74 */
@@ -149,6 +141,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
149 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 141 return do_fork(flags | CLONE_VM | CLONE_UNTRACED,
150 0, &regs, 0, NULL, NULL); 142 0, &regs, 0, NULL, NULL);
151} 143}
144EXPORT_SYMBOL(kernel_thread);
152 145
153/* 146/*
154 * Free current thread data structures etc.. 147 * Free current thread data structures etc..
@@ -168,34 +161,35 @@ void release_thread(struct task_struct *dead_task)
168} 161}
169 162
170int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp, 163int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
171 unsigned long unused, 164 unsigned long unused,
172 struct task_struct * p, struct pt_regs * regs) 165 struct task_struct *p, struct pt_regs *regs)
173{ 166{
174 struct fake_frame 167 struct thread_info *ti;
175 { 168 struct fake_frame
176 struct stack_frame sf; 169 {
177 struct pt_regs childregs; 170 struct stack_frame sf;
178 } *frame; 171 struct pt_regs childregs;
179 172 } *frame;
180 frame = container_of(task_pt_regs(p), struct fake_frame, childregs); 173
181 p->thread.ksp = (unsigned long) frame; 174 frame = container_of(task_pt_regs(p), struct fake_frame, childregs);
175 p->thread.ksp = (unsigned long) frame;
182 /* Store access registers to kernel stack of new process. */ 176 /* Store access registers to kernel stack of new process. */
183 frame->childregs = *regs; 177 frame->childregs = *regs;
184 frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */ 178 frame->childregs.gprs[2] = 0; /* child returns 0 on fork. */
185 frame->childregs.gprs[15] = new_stackp; 179 frame->childregs.gprs[15] = new_stackp;
186 frame->sf.back_chain = 0; 180 frame->sf.back_chain = 0;
187 181
188 /* new return point is ret_from_fork */ 182 /* new return point is ret_from_fork */
189 frame->sf.gprs[8] = (unsigned long) ret_from_fork; 183 frame->sf.gprs[8] = (unsigned long) ret_from_fork;
190 184
191 /* fake return stack for resume(), don't go back to schedule */ 185 /* fake return stack for resume(), don't go back to schedule */
192 frame->sf.gprs[9] = (unsigned long) frame; 186 frame->sf.gprs[9] = (unsigned long) frame;
193 187
194 /* Save access registers to new thread structure. */ 188 /* Save access registers to new thread structure. */
195 save_access_regs(&p->thread.acrs[0]); 189 save_access_regs(&p->thread.acrs[0]);
196 190
197#ifndef CONFIG_64BIT 191#ifndef CONFIG_64BIT
198 /* 192 /*
199 * save fprs to current->thread.fp_regs to merge them with 193 * save fprs to current->thread.fp_regs to merge them with
200 * the emulated registers and then copy the result to the child. 194 * the emulated registers and then copy the result to the child.
201 */ 195 */
@@ -220,10 +214,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
220#endif /* CONFIG_64BIT */ 214#endif /* CONFIG_64BIT */
221 /* start new process with ar4 pointing to the correct address space */ 215 /* start new process with ar4 pointing to the correct address space */
222 p->thread.mm_segment = get_fs(); 216 p->thread.mm_segment = get_fs();
223 /* Don't copy debug registers */ 217 /* Don't copy debug registers */
224 memset(&p->thread.per_info,0,sizeof(p->thread.per_info)); 218 memset(&p->thread.per_info, 0, sizeof(p->thread.per_info));
225 219 /* Initialize per thread user and system timer values */
226 return 0; 220 ti = task_thread_info(p);
221 ti->user_timer = 0;
222 ti->system_timer = 0;
223 return 0;
227} 224}
228 225
229SYSCALL_DEFINE0(fork) 226SYSCALL_DEFINE0(fork)
@@ -311,7 +308,7 @@ out:
311int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs) 308int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs)
312{ 309{
313#ifndef CONFIG_64BIT 310#ifndef CONFIG_64BIT
314 /* 311 /*
315 * save fprs to current->thread.fp_regs to merge them with 312 * save fprs to current->thread.fp_regs to merge them with
316 * the emulated registers and then copy the result to the dump. 313 * the emulated registers and then copy the result to the dump.
317 */ 314 */
@@ -322,6 +319,7 @@ int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs)
322#endif /* CONFIG_64BIT */ 319#endif /* CONFIG_64BIT */
323 return 1; 320 return 1;
324} 321}
322EXPORT_SYMBOL(dump_fpu);
325 323
326unsigned long get_wchan(struct task_struct *p) 324unsigned long get_wchan(struct task_struct *p)
327{ 325{
@@ -346,4 +344,3 @@ unsigned long get_wchan(struct task_struct *p)
346 } 344 }
347 return 0; 345 return 0;
348} 346}
349
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c
index 82c1872cfe80..802c8ab247f3 100644
--- a/arch/s390/kernel/processor.c
+++ b/arch/s390/kernel/processor.c
@@ -18,10 +18,11 @@
18#include <asm/lowcore.h> 18#include <asm/lowcore.h>
19#include <asm/param.h> 19#include <asm/param.h>
20 20
21void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo) 21void __cpuinit print_cpu_info(void)
22{ 22{
23 pr_info("Processor %d started, address %d, identification %06X\n", 23 pr_info("Processor %d started, address %d, identification %06X\n",
24 cpuinfo->cpu_nr, cpuinfo->cpu_addr, cpuinfo->cpu_id.ident); 24 S390_lowcore.cpu_nr, S390_lowcore.cpu_addr,
25 S390_lowcore.cpu_id.ident);
25} 26}
26 27
27/* 28/*
@@ -30,48 +31,46 @@ void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo)
30 31
31static int show_cpuinfo(struct seq_file *m, void *v) 32static int show_cpuinfo(struct seq_file *m, void *v)
32{ 33{
33 static const char *hwcap_str[8] = { 34 static const char *hwcap_str[9] = {
34 "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", 35 "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp",
35 "edat" 36 "edat", "etf3eh"
36 }; 37 };
37 struct cpuinfo_S390 *cpuinfo; 38 struct _lowcore *lc;
38 unsigned long n = (unsigned long) v - 1; 39 unsigned long n = (unsigned long) v - 1;
39 int i; 40 int i;
40 41
41 s390_adjust_jiffies(); 42 s390_adjust_jiffies();
42 preempt_disable(); 43 preempt_disable();
43 if (!n) { 44 if (!n) {
44 seq_printf(m, "vendor_id : IBM/S390\n" 45 seq_printf(m, "vendor_id : IBM/S390\n"
45 "# processors : %i\n" 46 "# processors : %i\n"
46 "bogomips per cpu: %lu.%02lu\n", 47 "bogomips per cpu: %lu.%02lu\n",
47 num_online_cpus(), loops_per_jiffy/(500000/HZ), 48 num_online_cpus(), loops_per_jiffy/(500000/HZ),
48 (loops_per_jiffy/(5000/HZ))%100); 49 (loops_per_jiffy/(5000/HZ))%100);
49 seq_puts(m, "features\t: "); 50 seq_puts(m, "features\t: ");
50 for (i = 0; i < 8; i++) 51 for (i = 0; i < 9; i++)
51 if (hwcap_str[i] && (elf_hwcap & (1UL << i))) 52 if (hwcap_str[i] && (elf_hwcap & (1UL << i)))
52 seq_printf(m, "%s ", hwcap_str[i]); 53 seq_printf(m, "%s ", hwcap_str[i]);
53 seq_puts(m, "\n"); 54 seq_puts(m, "\n");
54 } 55 }
55 56
56 if (cpu_online(n)) { 57 if (cpu_online(n)) {
57#ifdef CONFIG_SMP 58#ifdef CONFIG_SMP
58 if (smp_processor_id() == n) 59 lc = (smp_processor_id() == n) ?
59 cpuinfo = &S390_lowcore.cpu_data; 60 &S390_lowcore : lowcore_ptr[n];
60 else
61 cpuinfo = &lowcore_ptr[n]->cpu_data;
62#else 61#else
63 cpuinfo = &S390_lowcore.cpu_data; 62 lc = &S390_lowcore;
64#endif 63#endif
65 seq_printf(m, "processor %li: " 64 seq_printf(m, "processor %li: "
66 "version = %02X, " 65 "version = %02X, "
67 "identification = %06X, " 66 "identification = %06X, "
68 "machine = %04X\n", 67 "machine = %04X\n",
69 n, cpuinfo->cpu_id.version, 68 n, lc->cpu_id.version,
70 cpuinfo->cpu_id.ident, 69 lc->cpu_id.ident,
71 cpuinfo->cpu_id.machine); 70 lc->cpu_id.machine);
72 } 71 }
73 preempt_enable(); 72 preempt_enable();
74 return 0; 73 return 0;
75} 74}
76 75
77static void *c_start(struct seq_file *m, loff_t *pos) 76static void *c_start(struct seq_file *m, loff_t *pos)
diff --git a/arch/s390/kernel/reipl64.S b/arch/s390/kernel/reipl64.S
index c41930499a5f..774147824c3d 100644
--- a/arch/s390/kernel/reipl64.S
+++ b/arch/s390/kernel/reipl64.S
@@ -1,10 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/reipl.S 2 * Copyright IBM Corp 2000,2009
3 * 3 * Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>,
4 * S390 version 4 * Denis Joseph Barrow,
5 * Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com)
7 Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
8 */ 5 */
9 6
10#include <asm/lowcore.h> 7#include <asm/lowcore.h>
@@ -30,7 +27,7 @@ do_reipl_asm: basr %r13,0
30 mvc __LC_PREFIX_SAVE_AREA-0x1000(4,%r1),0(%r10) 27 mvc __LC_PREFIX_SAVE_AREA-0x1000(4,%r1),0(%r10)
31 stfpc __LC_FP_CREG_SAVE_AREA-0x1000(%r1) 28 stfpc __LC_FP_CREG_SAVE_AREA-0x1000(%r1)
32 stckc .Lclkcmp-.Lpg0(%r13) 29 stckc .Lclkcmp-.Lpg0(%r13)
33 mvc __LC_CLOCK_COMP_SAVE_AREA-0x1000(8,%r1),.Lclkcmp-.Lpg0(%r13) 30 mvc __LC_CLOCK_COMP_SAVE_AREA-0x1000(7,%r1),.Lclkcmp-.Lpg0(%r13)
34 stpt __LC_CPU_TIMER_SAVE_AREA-0x1000(%r1) 31 stpt __LC_CPU_TIMER_SAVE_AREA-0x1000(%r1)
35 stg %r13, __LC_PSW_SAVE_AREA-0x1000+8(%r1) 32 stg %r13, __LC_PSW_SAVE_AREA-0x1000+8(%r1)
36 33
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
index 46b90cb03707..656fcbb9bd83 100644
--- a/arch/s390/kernel/s390_ksyms.c
+++ b/arch/s390/kernel/s390_ksyms.c
@@ -1,49 +1,5 @@
1/*
2 * arch/s390/kernel/s390_ksyms.c
3 *
4 * S390 version
5 */
6#include <linux/highuid.h>
7#include <linux/module.h> 1#include <linux/module.h>
8#include <linux/mm.h>
9#include <linux/smp.h>
10#include <linux/syscalls.h>
11#include <linux/interrupt.h>
12#include <asm/checksum.h>
13#include <asm/cpcmd.h>
14#include <asm/delay.h>
15#include <asm/pgalloc.h>
16#include <asm/setup.h>
17#include <asm/ftrace.h> 2#include <asm/ftrace.h>
18#ifdef CONFIG_IP_MULTICAST
19#include <net/arp.h>
20#endif
21
22/*
23 * memory management
24 */
25EXPORT_SYMBOL(_oi_bitmap);
26EXPORT_SYMBOL(_ni_bitmap);
27EXPORT_SYMBOL(_zb_findmap);
28EXPORT_SYMBOL(_sb_findmap);
29
30/*
31 * binfmt_elf loader
32 */
33extern int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs);
34EXPORT_SYMBOL(dump_fpu);
35EXPORT_SYMBOL(empty_zero_page);
36
37/*
38 * misc.
39 */
40EXPORT_SYMBOL(machine_flags);
41EXPORT_SYMBOL(__udelay);
42EXPORT_SYMBOL(kernel_thread);
43EXPORT_SYMBOL(csum_fold);
44EXPORT_SYMBOL(console_mode);
45EXPORT_SYMBOL(console_devno);
46EXPORT_SYMBOL(console_irq);
47 3
48#ifdef CONFIG_FUNCTION_TRACER 4#ifdef CONFIG_FUNCTION_TRACER
49EXPORT_SYMBOL(_mcount); 5EXPORT_SYMBOL(_mcount);
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index c5cfb6185eac..06201b93cbbf 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -74,9 +74,17 @@ EXPORT_SYMBOL(uaccess);
74 * Machine setup.. 74 * Machine setup..
75 */ 75 */
76unsigned int console_mode = 0; 76unsigned int console_mode = 0;
77EXPORT_SYMBOL(console_mode);
78
77unsigned int console_devno = -1; 79unsigned int console_devno = -1;
80EXPORT_SYMBOL(console_devno);
81
78unsigned int console_irq = -1; 82unsigned int console_irq = -1;
83EXPORT_SYMBOL(console_irq);
84
79unsigned long machine_flags; 85unsigned long machine_flags;
86EXPORT_SYMBOL(machine_flags);
87
80unsigned long elf_hwcap = 0; 88unsigned long elf_hwcap = 0;
81char elf_platform[ELF_PLATFORM_SIZE]; 89char elf_platform[ELF_PLATFORM_SIZE];
82 90
@@ -86,6 +94,10 @@ volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */
86int __initdata memory_end_set; 94int __initdata memory_end_set;
87unsigned long __initdata memory_end; 95unsigned long __initdata memory_end;
88 96
97/* An array with a pointer to the lowcore of every CPU. */
98struct _lowcore *lowcore_ptr[NR_CPUS];
99EXPORT_SYMBOL(lowcore_ptr);
100
89/* 101/*
90 * This is set up by the setup-routine at boot-time 102 * This is set up by the setup-routine at boot-time
91 * for S390 need to find out, what we have to setup 103 * for S390 need to find out, what we have to setup
@@ -109,13 +121,10 @@ static struct resource data_resource = {
109 */ 121 */
110void __cpuinit cpu_init(void) 122void __cpuinit cpu_init(void)
111{ 123{
112 int addr = hard_smp_processor_id();
113
114 /* 124 /*
115 * Store processor id in lowcore (used e.g. in timer_interrupt) 125 * Store processor id in lowcore (used e.g. in timer_interrupt)
116 */ 126 */
117 get_cpu_id(&S390_lowcore.cpu_data.cpu_id); 127 get_cpu_id(&S390_lowcore.cpu_id);
118 S390_lowcore.cpu_data.cpu_addr = addr;
119 128
120 /* 129 /*
121 * Force FPU initialization: 130 * Force FPU initialization:
@@ -125,8 +134,7 @@ void __cpuinit cpu_init(void)
125 134
126 atomic_inc(&init_mm.mm_count); 135 atomic_inc(&init_mm.mm_count);
127 current->active_mm = &init_mm; 136 current->active_mm = &init_mm;
128 if (current->mm) 137 BUG_ON(current->mm);
129 BUG();
130 enter_lazy_tlb(&init_mm, current); 138 enter_lazy_tlb(&init_mm, current);
131} 139}
132 140
@@ -217,7 +225,7 @@ static void __init conmode_default(void)
217 } 225 }
218} 226}
219 227
220#if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) 228#ifdef CONFIG_ZFCPDUMP
221static void __init setup_zfcpdump(unsigned int console_devno) 229static void __init setup_zfcpdump(unsigned int console_devno)
222{ 230{
223 static char str[41]; 231 static char str[41];
@@ -289,11 +297,7 @@ static int __init early_parse_mem(char *p)
289early_param("mem", early_parse_mem); 297early_param("mem", early_parse_mem);
290 298
291#ifdef CONFIG_S390_SWITCH_AMODE 299#ifdef CONFIG_S390_SWITCH_AMODE
292#ifdef CONFIG_PGSTE
293unsigned int switch_amode = 1;
294#else
295unsigned int switch_amode = 0; 300unsigned int switch_amode = 0;
296#endif
297EXPORT_SYMBOL_GPL(switch_amode); 301EXPORT_SYMBOL_GPL(switch_amode);
298 302
299static int set_amode_and_uaccess(unsigned long user_amode, 303static int set_amode_and_uaccess(unsigned long user_amode,
@@ -414,7 +418,6 @@ setup_lowcore(void)
414 PSW_ADDR_AMODE | (unsigned long) mcck_int_handler; 418 PSW_ADDR_AMODE | (unsigned long) mcck_int_handler;
415 lc->io_new_psw.mask = psw_kernel_bits; 419 lc->io_new_psw.mask = psw_kernel_bits;
416 lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler; 420 lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler;
417 lc->ipl_device = S390_lowcore.ipl_device;
418 lc->clock_comparator = -1ULL; 421 lc->clock_comparator = -1ULL;
419 lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE; 422 lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE;
420 lc->async_stack = (unsigned long) 423 lc->async_stack = (unsigned long)
@@ -434,6 +437,7 @@ setup_lowcore(void)
434 lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0]; 437 lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0];
435#endif 438#endif
436 set_prefix((u32)(unsigned long) lc); 439 set_prefix((u32)(unsigned long) lc);
440 lowcore_ptr[0] = lc;
437} 441}
438 442
439static void __init 443static void __init
@@ -510,7 +514,7 @@ static void __init setup_memory_end(void)
510 unsigned long max_mem; 514 unsigned long max_mem;
511 int i; 515 int i;
512 516
513#if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) 517#ifdef CONFIG_ZFCPDUMP
514 if (ipl_info.type == IPL_TYPE_FCP_DUMP) { 518 if (ipl_info.type == IPL_TYPE_FCP_DUMP) {
515 memory_end = ZFCPDUMP_HSA_SIZE; 519 memory_end = ZFCPDUMP_HSA_SIZE;
516 memory_end_set = 1; 520 memory_end_set = 1;
@@ -677,7 +681,6 @@ setup_memory(void)
677static void __init setup_hwcaps(void) 681static void __init setup_hwcaps(void)
678{ 682{
679 static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; 683 static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 };
680 struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data;
681 unsigned long long facility_list_extended; 684 unsigned long long facility_list_extended;
682 unsigned int facility_list; 685 unsigned int facility_list;
683 int i; 686 int i;
@@ -693,15 +696,22 @@ static void __init setup_hwcaps(void)
693 * Bit 17: the message-security assist is installed 696 * Bit 17: the message-security assist is installed
694 * Bit 19: the long-displacement facility is installed 697 * Bit 19: the long-displacement facility is installed
695 * Bit 21: the extended-immediate facility is installed 698 * Bit 21: the extended-immediate facility is installed
699 * Bit 22: extended-translation facility 3 is installed
700 * Bit 30: extended-translation facility 3 enhancement facility
696 * These get translated to: 701 * These get translated to:
697 * HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1, 702 * HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1,
698 * HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3, 703 * HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3,
699 * HWCAP_S390_LDISP bit 4, and HWCAP_S390_EIMM bit 5. 704 * HWCAP_S390_LDISP bit 4, HWCAP_S390_EIMM bit 5 and
705 * HWCAP_S390_ETF3EH bit 8 (22 && 30).
700 */ 706 */
701 for (i = 0; i < 6; i++) 707 for (i = 0; i < 6; i++)
702 if (facility_list & (1UL << (31 - stfl_bits[i]))) 708 if (facility_list & (1UL << (31 - stfl_bits[i])))
703 elf_hwcap |= 1UL << i; 709 elf_hwcap |= 1UL << i;
704 710
711 if ((facility_list & (1UL << (31 - 22)))
712 && (facility_list & (1UL << (31 - 30))))
713 elf_hwcap |= 1UL << 8;
714
705 /* 715 /*
706 * Check for additional facilities with store-facility-list-extended. 716 * Check for additional facilities with store-facility-list-extended.
707 * stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0 717 * stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0
@@ -710,20 +720,22 @@ static void __init setup_hwcaps(void)
710 * How many facility words are stored depends on the number of 720 * How many facility words are stored depends on the number of
711 * doublewords passed to the instruction. The additional facilites 721 * doublewords passed to the instruction. The additional facilites
712 * are: 722 * are:
713 * Bit 43: decimal floating point facility is installed 723 * Bit 42: decimal floating point facility is installed
724 * Bit 44: perform floating point operation facility is installed
714 * translated to: 725 * translated to:
715 * HWCAP_S390_DFP bit 6. 726 * HWCAP_S390_DFP bit 6 (42 && 44).
716 */ 727 */
717 if ((elf_hwcap & (1UL << 2)) && 728 if ((elf_hwcap & (1UL << 2)) &&
718 __stfle(&facility_list_extended, 1) > 0) { 729 __stfle(&facility_list_extended, 1) > 0) {
719 if (facility_list_extended & (1ULL << (64 - 43))) 730 if ((facility_list_extended & (1ULL << (63 - 42)))
731 && (facility_list_extended & (1ULL << (63 - 44))))
720 elf_hwcap |= 1UL << 6; 732 elf_hwcap |= 1UL << 6;
721 } 733 }
722 734
723 if (MACHINE_HAS_HPAGE) 735 if (MACHINE_HAS_HPAGE)
724 elf_hwcap |= 1UL << 7; 736 elf_hwcap |= 1UL << 7;
725 737
726 switch (cpuinfo->cpu_id.machine) { 738 switch (S390_lowcore.cpu_id.machine) {
727 case 0x9672: 739 case 0x9672:
728#if !defined(CONFIG_64BIT) 740#if !defined(CONFIG_64BIT)
729 default: /* Use "g5" as default for 31 bit kernels. */ 741 default: /* Use "g5" as default for 31 bit kernels. */
@@ -816,7 +828,7 @@ setup_arch(char **cmdline_p)
816 setup_lowcore(); 828 setup_lowcore();
817 829
818 cpu_init(); 830 cpu_init();
819 __cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr; 831 __cpu_logical_map[0] = stap();
820 s390_init_cpu_topology(); 832 s390_init_cpu_topology();
821 833
822 /* 834 /*
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 2d337cbb9329..006ed5016eb4 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -32,6 +32,7 @@
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/cache.h> 33#include <linux/cache.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/irqflags.h>
35#include <linux/cpu.h> 36#include <linux/cpu.h>
36#include <linux/timex.h> 37#include <linux/timex.h>
37#include <linux/bootmem.h> 38#include <linux/bootmem.h>
@@ -50,12 +51,6 @@
50#include <asm/vdso.h> 51#include <asm/vdso.h>
51#include "entry.h" 52#include "entry.h"
52 53
53/*
54 * An array with a pointer the lowcore of every CPU.
55 */
56struct _lowcore *lowcore_ptr[NR_CPUS];
57EXPORT_SYMBOL(lowcore_ptr);
58
59static struct task_struct *current_set[NR_CPUS]; 54static struct task_struct *current_set[NR_CPUS];
60 55
61static u8 smp_cpu_type; 56static u8 smp_cpu_type;
@@ -81,9 +76,7 @@ void smp_send_stop(void)
81 76
82 /* Disable all interrupts/machine checks */ 77 /* Disable all interrupts/machine checks */
83 __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); 78 __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
84 79 trace_hardirqs_off();
85 /* write magic number to zero page (absolute 0) */
86 lowcore_ptr[smp_processor_id()]->panic_magic = __PANIC_MAGIC;
87 80
88 /* stop all processors */ 81 /* stop all processors */
89 for_each_online_cpu(cpu) { 82 for_each_online_cpu(cpu) {
@@ -233,7 +226,7 @@ EXPORT_SYMBOL(smp_ctl_clear_bit);
233 */ 226 */
234#define CPU_INIT_NO 1 227#define CPU_INIT_NO 1
235 228
236#if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE) 229#ifdef CONFIG_ZFCPDUMP
237 230
238/* 231/*
239 * zfcpdump_prefix_array holds prefix registers for the following scenario: 232 * zfcpdump_prefix_array holds prefix registers for the following scenario:
@@ -274,7 +267,7 @@ EXPORT_SYMBOL_GPL(zfcpdump_save_areas);
274 267
275static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { } 268static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { }
276 269
277#endif /* CONFIG_ZFCPDUMP || CONFIG_ZFCPDUMP_MODULE */ 270#endif /* CONFIG_ZFCPDUMP */
278 271
279static int cpu_stopped(int cpu) 272static int cpu_stopped(int cpu)
280{ 273{
@@ -304,8 +297,8 @@ static int smp_rescan_cpus_sigp(cpumask_t avail)
304{ 297{
305 int cpu_id, logical_cpu; 298 int cpu_id, logical_cpu;
306 299
307 logical_cpu = first_cpu(avail); 300 logical_cpu = cpumask_first(&avail);
308 if (logical_cpu == NR_CPUS) 301 if (logical_cpu >= nr_cpu_ids)
309 return 0; 302 return 0;
310 for (cpu_id = 0; cpu_id <= 65535; cpu_id++) { 303 for (cpu_id = 0; cpu_id <= 65535; cpu_id++) {
311 if (cpu_known(cpu_id)) 304 if (cpu_known(cpu_id))
@@ -316,8 +309,8 @@ static int smp_rescan_cpus_sigp(cpumask_t avail)
316 continue; 309 continue;
317 cpu_set(logical_cpu, cpu_present_map); 310 cpu_set(logical_cpu, cpu_present_map);
318 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED; 311 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED;
319 logical_cpu = next_cpu(logical_cpu, avail); 312 logical_cpu = cpumask_next(logical_cpu, &avail);
320 if (logical_cpu == NR_CPUS) 313 if (logical_cpu >= nr_cpu_ids)
321 break; 314 break;
322 } 315 }
323 return 0; 316 return 0;
@@ -329,8 +322,8 @@ static int smp_rescan_cpus_sclp(cpumask_t avail)
329 int cpu_id, logical_cpu, cpu; 322 int cpu_id, logical_cpu, cpu;
330 int rc; 323 int rc;
331 324
332 logical_cpu = first_cpu(avail); 325 logical_cpu = cpumask_first(&avail);
333 if (logical_cpu == NR_CPUS) 326 if (logical_cpu >= nr_cpu_ids)
334 return 0; 327 return 0;
335 info = kmalloc(sizeof(*info), GFP_KERNEL); 328 info = kmalloc(sizeof(*info), GFP_KERNEL);
336 if (!info) 329 if (!info)
@@ -351,8 +344,8 @@ static int smp_rescan_cpus_sclp(cpumask_t avail)
351 smp_cpu_state[logical_cpu] = CPU_STATE_STANDBY; 344 smp_cpu_state[logical_cpu] = CPU_STATE_STANDBY;
352 else 345 else
353 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED; 346 smp_cpu_state[logical_cpu] = CPU_STATE_CONFIGURED;
354 logical_cpu = next_cpu(logical_cpu, avail); 347 logical_cpu = cpumask_next(logical_cpu, &avail);
355 if (logical_cpu == NR_CPUS) 348 if (logical_cpu >= nr_cpu_ids)
356 break; 349 break;
357 } 350 }
358out: 351out:
@@ -379,7 +372,7 @@ static void __init smp_detect_cpus(void)
379 372
380 c_cpus = 1; 373 c_cpus = 1;
381 s_cpus = 0; 374 s_cpus = 0;
382 boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; 375 boot_cpu_addr = __cpu_logical_map[0];
383 info = kmalloc(sizeof(*info), GFP_KERNEL); 376 info = kmalloc(sizeof(*info), GFP_KERNEL);
384 if (!info) 377 if (!info)
385 panic("smp_detect_cpus failed to allocate memory\n"); 378 panic("smp_detect_cpus failed to allocate memory\n");
@@ -453,7 +446,7 @@ int __cpuinit start_secondary(void *cpuvoid)
453 /* Switch on interrupts */ 446 /* Switch on interrupts */
454 local_irq_enable(); 447 local_irq_enable();
455 /* Print info about this processor */ 448 /* Print info about this processor */
456 print_cpu_info(&S390_lowcore.cpu_data); 449 print_cpu_info();
457 /* cpu_idle will call schedule for us */ 450 /* cpu_idle will call schedule for us */
458 cpu_idle(); 451 cpu_idle();
459 return 0; 452 return 0;
@@ -515,7 +508,6 @@ out:
515 return -ENOMEM; 508 return -ENOMEM;
516} 509}
517 510
518#ifdef CONFIG_HOTPLUG_CPU
519static void smp_free_lowcore(int cpu) 511static void smp_free_lowcore(int cpu)
520{ 512{
521 struct _lowcore *lowcore; 513 struct _lowcore *lowcore;
@@ -534,7 +526,6 @@ static void smp_free_lowcore(int cpu)
534 free_pages((unsigned long) lowcore, lc_order); 526 free_pages((unsigned long) lowcore, lc_order);
535 lowcore_ptr[cpu] = NULL; 527 lowcore_ptr[cpu] = NULL;
536} 528}
537#endif /* CONFIG_HOTPLUG_CPU */
538 529
539/* Upping and downing of CPUs */ 530/* Upping and downing of CPUs */
540int __cpuinit __cpu_up(unsigned int cpu) 531int __cpuinit __cpu_up(unsigned int cpu)
@@ -543,16 +534,23 @@ int __cpuinit __cpu_up(unsigned int cpu)
543 struct _lowcore *cpu_lowcore; 534 struct _lowcore *cpu_lowcore;
544 struct stack_frame *sf; 535 struct stack_frame *sf;
545 sigp_ccode ccode; 536 sigp_ccode ccode;
537 u32 lowcore;
546 538
547 if (smp_cpu_state[cpu] != CPU_STATE_CONFIGURED) 539 if (smp_cpu_state[cpu] != CPU_STATE_CONFIGURED)
548 return -EIO; 540 return -EIO;
549 if (smp_alloc_lowcore(cpu)) 541 if (smp_alloc_lowcore(cpu))
550 return -ENOMEM; 542 return -ENOMEM;
551 543 do {
552 ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]), 544 ccode = signal_processor(cpu, sigp_initial_cpu_reset);
553 cpu, sigp_set_prefix); 545 if (ccode == sigp_busy)
554 if (ccode) 546 udelay(10);
555 return -EIO; 547 if (ccode == sigp_not_operational)
548 goto err_out;
549 } while (ccode == sigp_busy);
550
551 lowcore = (u32)(unsigned long)lowcore_ptr[cpu];
552 while (signal_processor_p(lowcore, cpu, sigp_set_prefix) == sigp_busy)
553 udelay(10);
556 554
557 idle = current_set[cpu]; 555 idle = current_set[cpu];
558 cpu_lowcore = lowcore_ptr[cpu]; 556 cpu_lowcore = lowcore_ptr[cpu];
@@ -571,9 +569,8 @@ int __cpuinit __cpu_up(unsigned int cpu)
571 : : "a" (&cpu_lowcore->access_regs_save_area) : "memory"); 569 : : "a" (&cpu_lowcore->access_regs_save_area) : "memory");
572 cpu_lowcore->percpu_offset = __per_cpu_offset[cpu]; 570 cpu_lowcore->percpu_offset = __per_cpu_offset[cpu];
573 cpu_lowcore->current_task = (unsigned long) idle; 571 cpu_lowcore->current_task = (unsigned long) idle;
574 cpu_lowcore->cpu_data.cpu_nr = cpu; 572 cpu_lowcore->cpu_nr = cpu;
575 cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce; 573 cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce;
576 cpu_lowcore->ipl_device = S390_lowcore.ipl_device;
577 eieio(); 574 eieio();
578 575
579 while (signal_processor(cpu, sigp_restart) == sigp_busy) 576 while (signal_processor(cpu, sigp_restart) == sigp_busy)
@@ -582,6 +579,10 @@ int __cpuinit __cpu_up(unsigned int cpu)
582 while (!cpu_online(cpu)) 579 while (!cpu_online(cpu))
583 cpu_relax(); 580 cpu_relax();
584 return 0; 581 return 0;
582
583err_out:
584 smp_free_lowcore(cpu);
585 return -EIO;
585} 586}
586 587
587static int __init setup_possible_cpus(char *s) 588static int __init setup_possible_cpus(char *s)
@@ -589,9 +590,8 @@ static int __init setup_possible_cpus(char *s)
589 int pcpus, cpu; 590 int pcpus, cpu;
590 591
591 pcpus = simple_strtoul(s, NULL, 0); 592 pcpus = simple_strtoul(s, NULL, 0);
592 cpu_possible_map = cpumask_of_cpu(0); 593 for (cpu = 0; cpu < pcpus && cpu < nr_cpu_ids; cpu++)
593 for (cpu = 1; cpu < pcpus && cpu < NR_CPUS; cpu++) 594 set_cpu_possible(cpu, true);
594 cpu_set(cpu, cpu_possible_map);
595 return 0; 595 return 0;
596} 596}
597early_param("possible_cpus", setup_possible_cpus); 597early_param("possible_cpus", setup_possible_cpus);
@@ -663,7 +663,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
663 /* request the 0x1201 emergency signal external interrupt */ 663 /* request the 0x1201 emergency signal external interrupt */
664 if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) 664 if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0)
665 panic("Couldn't request external interrupt 0x1201"); 665 panic("Couldn't request external interrupt 0x1201");
666 print_cpu_info(&S390_lowcore.cpu_data); 666 print_cpu_info();
667 667
668 /* Reallocate current lowcore, but keep its contents. */ 668 /* Reallocate current lowcore, but keep its contents. */
669 lc_order = sizeof(long) == 8 ? 1 : 0; 669 lc_order = sizeof(long) == 8 ? 1 : 0;
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c
new file mode 100644
index 000000000000..b5e75e1061c8
--- /dev/null
+++ b/arch/s390/kernel/sysinfo.c
@@ -0,0 +1,428 @@
1/*
2 * Copyright IBM Corp. 2001, 2009
3 * Author(s): Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
4 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
5 */
6
7#include <linux/kernel.h>
8#include <linux/mm.h>
9#include <linux/proc_fs.h>
10#include <linux/seq_file.h>
11#include <linux/init.h>
12#include <linux/delay.h>
13#include <linux/module.h>
14#include <asm/ebcdic.h>
15#include <asm/sysinfo.h>
16#include <asm/cpcmd.h>
17
18/* Sigh, math-emu. Don't ask. */
19#include <asm/sfp-util.h>
20#include <math-emu/soft-fp.h>
21#include <math-emu/single.h>
22
23static inline int stsi_0(void)
24{
25 int rc = stsi(NULL, 0, 0, 0);
26 return rc == -ENOSYS ? rc : (((unsigned int) rc) >> 28);
27}
28
29static int stsi_1_1_1(struct sysinfo_1_1_1 *info, char *page, int len)
30{
31 if (stsi(info, 1, 1, 1) == -ENOSYS)
32 return len;
33
34 EBCASC(info->manufacturer, sizeof(info->manufacturer));
35 EBCASC(info->type, sizeof(info->type));
36 EBCASC(info->model, sizeof(info->model));
37 EBCASC(info->sequence, sizeof(info->sequence));
38 EBCASC(info->plant, sizeof(info->plant));
39 EBCASC(info->model_capacity, sizeof(info->model_capacity));
40 EBCASC(info->model_perm_cap, sizeof(info->model_perm_cap));
41 EBCASC(info->model_temp_cap, sizeof(info->model_temp_cap));
42 len += sprintf(page + len, "Manufacturer: %-16.16s\n",
43 info->manufacturer);
44 len += sprintf(page + len, "Type: %-4.4s\n",
45 info->type);
46 if (info->model[0] != '\0')
47 /*
48 * Sigh: the model field has been renamed with System z9
49 * to model_capacity and a new model field has been added
50 * after the plant field. To avoid confusing older programs
51 * the "Model:" prints "model_capacity model" or just
52 * "model_capacity" if the model string is empty .
53 */
54 len += sprintf(page + len,
55 "Model: %-16.16s %-16.16s\n",
56 info->model_capacity, info->model);
57 else
58 len += sprintf(page + len, "Model: %-16.16s\n",
59 info->model_capacity);
60 len += sprintf(page + len, "Sequence Code: %-16.16s\n",
61 info->sequence);
62 len += sprintf(page + len, "Plant: %-4.4s\n",
63 info->plant);
64 len += sprintf(page + len, "Model Capacity: %-16.16s %08u\n",
65 info->model_capacity, *(u32 *) info->model_cap_rating);
66 if (info->model_perm_cap[0] != '\0')
67 len += sprintf(page + len,
68 "Model Perm. Capacity: %-16.16s %08u\n",
69 info->model_perm_cap,
70 *(u32 *) info->model_perm_cap_rating);
71 if (info->model_temp_cap[0] != '\0')
72 len += sprintf(page + len,
73 "Model Temp. Capacity: %-16.16s %08u\n",
74 info->model_temp_cap,
75 *(u32 *) info->model_temp_cap_rating);
76 return len;
77}
78
79static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len)
80{
81 struct sysinfo_1_2_2_extension *ext;
82 int i;
83
84 if (stsi(info, 1, 2, 2) == -ENOSYS)
85 return len;
86 ext = (struct sysinfo_1_2_2_extension *)
87 ((unsigned long) info + info->acc_offset);
88
89 len += sprintf(page + len, "\n");
90 len += sprintf(page + len, "CPUs Total: %d\n",
91 info->cpus_total);
92 len += sprintf(page + len, "CPUs Configured: %d\n",
93 info->cpus_configured);
94 len += sprintf(page + len, "CPUs Standby: %d\n",
95 info->cpus_standby);
96 len += sprintf(page + len, "CPUs Reserved: %d\n",
97 info->cpus_reserved);
98
99 if (info->format == 1) {
100 /*
101 * Sigh 2. According to the specification the alternate
102 * capability field is a 32 bit floating point number
103 * if the higher order 8 bits are not zero. Printing
104 * a floating point number in the kernel is a no-no,
105 * always print the number as 32 bit unsigned integer.
106 * The user-space needs to know about the strange
107 * encoding of the alternate cpu capability.
108 */
109 len += sprintf(page + len, "Capability: %u %u\n",
110 info->capability, ext->alt_capability);
111 for (i = 2; i <= info->cpus_total; i++)
112 len += sprintf(page + len,
113 "Adjustment %02d-way: %u %u\n",
114 i, info->adjustment[i-2],
115 ext->alt_adjustment[i-2]);
116
117 } else {
118 len += sprintf(page + len, "Capability: %u\n",
119 info->capability);
120 for (i = 2; i <= info->cpus_total; i++)
121 len += sprintf(page + len,
122 "Adjustment %02d-way: %u\n",
123 i, info->adjustment[i-2]);
124 }
125
126 if (info->secondary_capability != 0)
127 len += sprintf(page + len, "Secondary Capability: %d\n",
128 info->secondary_capability);
129 return len;
130}
131
132static int stsi_2_2_2(struct sysinfo_2_2_2 *info, char *page, int len)
133{
134 if (stsi(info, 2, 2, 2) == -ENOSYS)
135 return len;
136
137 EBCASC(info->name, sizeof(info->name));
138
139 len += sprintf(page + len, "\n");
140 len += sprintf(page + len, "LPAR Number: %d\n",
141 info->lpar_number);
142
143 len += sprintf(page + len, "LPAR Characteristics: ");
144 if (info->characteristics & LPAR_CHAR_DEDICATED)
145 len += sprintf(page + len, "Dedicated ");
146 if (info->characteristics & LPAR_CHAR_SHARED)
147 len += sprintf(page + len, "Shared ");
148 if (info->characteristics & LPAR_CHAR_LIMITED)
149 len += sprintf(page + len, "Limited ");
150 len += sprintf(page + len, "\n");
151
152 len += sprintf(page + len, "LPAR Name: %-8.8s\n",
153 info->name);
154
155 len += sprintf(page + len, "LPAR Adjustment: %d\n",
156 info->caf);
157
158 len += sprintf(page + len, "LPAR CPUs Total: %d\n",
159 info->cpus_total);
160 len += sprintf(page + len, "LPAR CPUs Configured: %d\n",
161 info->cpus_configured);
162 len += sprintf(page + len, "LPAR CPUs Standby: %d\n",
163 info->cpus_standby);
164 len += sprintf(page + len, "LPAR CPUs Reserved: %d\n",
165 info->cpus_reserved);
166 len += sprintf(page + len, "LPAR CPUs Dedicated: %d\n",
167 info->cpus_dedicated);
168 len += sprintf(page + len, "LPAR CPUs Shared: %d\n",
169 info->cpus_shared);
170 return len;
171}
172
173static int stsi_3_2_2(struct sysinfo_3_2_2 *info, char *page, int len)
174{
175 int i;
176
177 if (stsi(info, 3, 2, 2) == -ENOSYS)
178 return len;
179 for (i = 0; i < info->count; i++) {
180 EBCASC(info->vm[i].name, sizeof(info->vm[i].name));
181 EBCASC(info->vm[i].cpi, sizeof(info->vm[i].cpi));
182 len += sprintf(page + len, "\n");
183 len += sprintf(page + len, "VM%02d Name: %-8.8s\n",
184 i, info->vm[i].name);
185 len += sprintf(page + len, "VM%02d Control Program: %-16.16s\n",
186 i, info->vm[i].cpi);
187
188 len += sprintf(page + len, "VM%02d Adjustment: %d\n",
189 i, info->vm[i].caf);
190
191 len += sprintf(page + len, "VM%02d CPUs Total: %d\n",
192 i, info->vm[i].cpus_total);
193 len += sprintf(page + len, "VM%02d CPUs Configured: %d\n",
194 i, info->vm[i].cpus_configured);
195 len += sprintf(page + len, "VM%02d CPUs Standby: %d\n",
196 i, info->vm[i].cpus_standby);
197 len += sprintf(page + len, "VM%02d CPUs Reserved: %d\n",
198 i, info->vm[i].cpus_reserved);
199 }
200 return len;
201}
202
203static int proc_read_sysinfo(char *page, char **start,
204 off_t off, int count,
205 int *eof, void *data)
206{
207 unsigned long info = get_zeroed_page(GFP_KERNEL);
208 int level, len;
209
210 if (!info)
211 return 0;
212
213 len = 0;
214 level = stsi_0();
215 if (level >= 1)
216 len = stsi_1_1_1((struct sysinfo_1_1_1 *) info, page, len);
217
218 if (level >= 1)
219 len = stsi_1_2_2((struct sysinfo_1_2_2 *) info, page, len);
220
221 if (level >= 2)
222 len = stsi_2_2_2((struct sysinfo_2_2_2 *) info, page, len);
223
224 if (level >= 3)
225 len = stsi_3_2_2((struct sysinfo_3_2_2 *) info, page, len);
226
227 free_page(info);
228 return len;
229}
230
231static __init int create_proc_sysinfo(void)
232{
233 create_proc_read_entry("sysinfo", 0444, NULL,
234 proc_read_sysinfo, NULL);
235 return 0;
236}
237device_initcall(create_proc_sysinfo);
238
239/*
240 * Service levels interface.
241 */
242
243static DECLARE_RWSEM(service_level_sem);
244static LIST_HEAD(service_level_list);
245
246int register_service_level(struct service_level *slr)
247{
248 struct service_level *ptr;
249
250 down_write(&service_level_sem);
251 list_for_each_entry(ptr, &service_level_list, list)
252 if (ptr == slr) {
253 up_write(&service_level_sem);
254 return -EEXIST;
255 }
256 list_add_tail(&slr->list, &service_level_list);
257 up_write(&service_level_sem);
258 return 0;
259}
260EXPORT_SYMBOL(register_service_level);
261
262int unregister_service_level(struct service_level *slr)
263{
264 struct service_level *ptr, *next;
265 int rc = -ENOENT;
266
267 down_write(&service_level_sem);
268 list_for_each_entry_safe(ptr, next, &service_level_list, list) {
269 if (ptr != slr)
270 continue;
271 list_del(&ptr->list);
272 rc = 0;
273 break;
274 }
275 up_write(&service_level_sem);
276 return rc;
277}
278EXPORT_SYMBOL(unregister_service_level);
279
280static void *service_level_start(struct seq_file *m, loff_t *pos)
281{
282 down_read(&service_level_sem);
283 return seq_list_start(&service_level_list, *pos);
284}
285
286static void *service_level_next(struct seq_file *m, void *p, loff_t *pos)
287{
288 return seq_list_next(p, &service_level_list, pos);
289}
290
291static void service_level_stop(struct seq_file *m, void *p)
292{
293 up_read(&service_level_sem);
294}
295
296static int service_level_show(struct seq_file *m, void *p)
297{
298 struct service_level *slr;
299
300 slr = list_entry(p, struct service_level, list);
301 slr->seq_print(m, slr);
302 return 0;
303}
304
305static const struct seq_operations service_level_seq_ops = {
306 .start = service_level_start,
307 .next = service_level_next,
308 .stop = service_level_stop,
309 .show = service_level_show
310};
311
312static int service_level_open(struct inode *inode, struct file *file)
313{
314 return seq_open(file, &service_level_seq_ops);
315}
316
317static const struct file_operations service_level_ops = {
318 .open = service_level_open,
319 .read = seq_read,
320 .llseek = seq_lseek,
321 .release = seq_release
322};
323
324static void service_level_vm_print(struct seq_file *m,
325 struct service_level *slr)
326{
327 char *query_buffer, *str;
328
329 query_buffer = kmalloc(1024, GFP_KERNEL | GFP_DMA);
330 if (!query_buffer)
331 return;
332 cpcmd("QUERY CPLEVEL", query_buffer, 1024, NULL);
333 str = strchr(query_buffer, '\n');
334 if (str)
335 *str = 0;
336 seq_printf(m, "VM: %s\n", query_buffer);
337 kfree(query_buffer);
338}
339
340static struct service_level service_level_vm = {
341 .seq_print = service_level_vm_print
342};
343
344static __init int create_proc_service_level(void)
345{
346 proc_create("service_levels", 0, NULL, &service_level_ops);
347 if (MACHINE_IS_VM)
348 register_service_level(&service_level_vm);
349 return 0;
350}
351subsys_initcall(create_proc_service_level);
352
353/*
354 * Bogomips calculation based on cpu capability.
355 */
356int get_cpu_capability(unsigned int *capability)
357{
358 struct sysinfo_1_2_2 *info;
359 int rc;
360
361 info = (void *) get_zeroed_page(GFP_KERNEL);
362 if (!info)
363 return -ENOMEM;
364 rc = stsi(info, 1, 2, 2);
365 if (rc == -ENOSYS)
366 goto out;
367 rc = 0;
368 *capability = info->capability;
369out:
370 free_page((unsigned long) info);
371 return rc;
372}
373
374/*
375 * CPU capability might have changed. Therefore recalculate loops_per_jiffy.
376 */
377void s390_adjust_jiffies(void)
378{
379 struct sysinfo_1_2_2 *info;
380 const unsigned int fmil = 0x4b189680; /* 1e7 as 32-bit float. */
381 FP_DECL_S(SA); FP_DECL_S(SB); FP_DECL_S(SR);
382 FP_DECL_EX;
383 unsigned int capability;
384
385 info = (void *) get_zeroed_page(GFP_KERNEL);
386 if (!info)
387 return;
388
389 if (stsi(info, 1, 2, 2) != -ENOSYS) {
390 /*
391 * Major sigh. The cpu capability encoding is "special".
392 * If the first 9 bits of info->capability are 0 then it
393 * is a 32 bit unsigned integer in the range 0 .. 2^23.
394 * If the first 9 bits are != 0 then it is a 32 bit float.
395 * In addition a lower value indicates a proportionally
396 * higher cpu capacity. Bogomips are the other way round.
397 * To get to a halfway suitable number we divide 1e7
398 * by the cpu capability number. Yes, that means a floating
399 * point division .. math-emu here we come :-)
400 */
401 FP_UNPACK_SP(SA, &fmil);
402 if ((info->capability >> 23) == 0)
403 FP_FROM_INT_S(SB, info->capability, 32, int);
404 else
405 FP_UNPACK_SP(SB, &info->capability);
406 FP_DIV_S(SR, SA, SB);
407 FP_TO_INT_S(capability, SR, 32, 0);
408 } else
409 /*
410 * Really old machine without stsi block for basic
411 * cpu information. Report 42.0 bogomips.
412 */
413 capability = 42;
414 loops_per_jiffy = capability * (500000/HZ);
415 free_page((unsigned long) info);
416}
417
418/*
419 * calibrate the delay loop
420 */
421void __cpuinit calibrate_delay(void)
422{
423 s390_adjust_jiffies();
424 /* Print the good old Bogomips line .. */
425 printk(KERN_DEBUG "Calibrating delay loop (skipped)... "
426 "%lu.%02lu BogoMIPS preset\n", loops_per_jiffy/(500000/HZ),
427 (loops_per_jiffy/(5000/HZ)) % 100);
428}
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index fc468cae4460..f72d41068dc2 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -331,6 +331,7 @@ static unsigned long long adjust_time(unsigned long long old,
331} 331}
332 332
333static DEFINE_PER_CPU(atomic_t, clock_sync_word); 333static DEFINE_PER_CPU(atomic_t, clock_sync_word);
334static DEFINE_MUTEX(clock_sync_mutex);
334static unsigned long clock_sync_flags; 335static unsigned long clock_sync_flags;
335 336
336#define CLOCK_SYNC_HAS_ETR 0 337#define CLOCK_SYNC_HAS_ETR 0
@@ -394,6 +395,20 @@ static void enable_sync_clock(void)
394 atomic_set_mask(0x80000000, sw_ptr); 395 atomic_set_mask(0x80000000, sw_ptr);
395} 396}
396 397
398/*
399 * Function to check if the clock is in sync.
400 */
401static inline int check_sync_clock(void)
402{
403 atomic_t *sw_ptr;
404 int rc;
405
406 sw_ptr = &get_cpu_var(clock_sync_word);
407 rc = (atomic_read(sw_ptr) & 0x80000000U) != 0;
408 put_cpu_var(clock_sync_sync);
409 return rc;
410}
411
397/* Single threaded workqueue used for etr and stp sync events */ 412/* Single threaded workqueue used for etr and stp sync events */
398static struct workqueue_struct *time_sync_wq; 413static struct workqueue_struct *time_sync_wq;
399 414
@@ -485,6 +500,8 @@ static void etr_reset(void)
485 if (etr_setr(&etr_eacr) == 0) { 500 if (etr_setr(&etr_eacr) == 0) {
486 etr_tolec = get_clock(); 501 etr_tolec = get_clock();
487 set_bit(CLOCK_SYNC_HAS_ETR, &clock_sync_flags); 502 set_bit(CLOCK_SYNC_HAS_ETR, &clock_sync_flags);
503 if (etr_port0_online && etr_port1_online)
504 set_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
488 } else if (etr_port0_online || etr_port1_online) { 505 } else if (etr_port0_online || etr_port1_online) {
489 pr_warning("The real or virtual hardware system does " 506 pr_warning("The real or virtual hardware system does "
490 "not provide an ETR interface\n"); 507 "not provide an ETR interface\n");
@@ -533,8 +550,7 @@ void etr_switch_to_local(void)
533{ 550{
534 if (!etr_eacr.sl) 551 if (!etr_eacr.sl)
535 return; 552 return;
536 if (test_bit(CLOCK_SYNC_ETR, &clock_sync_flags)) 553 disable_sync_clock(NULL);
537 disable_sync_clock(NULL);
538 set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events); 554 set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events);
539 queue_work(time_sync_wq, &etr_work); 555 queue_work(time_sync_wq, &etr_work);
540} 556}
@@ -549,8 +565,7 @@ void etr_sync_check(void)
549{ 565{
550 if (!etr_eacr.es) 566 if (!etr_eacr.es)
551 return; 567 return;
552 if (test_bit(CLOCK_SYNC_ETR, &clock_sync_flags)) 568 disable_sync_clock(NULL);
553 disable_sync_clock(NULL);
554 set_bit(ETR_EVENT_SYNC_CHECK, &etr_events); 569 set_bit(ETR_EVENT_SYNC_CHECK, &etr_events);
555 queue_work(time_sync_wq, &etr_work); 570 queue_work(time_sync_wq, &etr_work);
556} 571}
@@ -914,7 +929,7 @@ static struct etr_eacr etr_handle_update(struct etr_aib *aib,
914 * Do not try to get the alternate port aib if the clock 929 * Do not try to get the alternate port aib if the clock
915 * is not in sync yet. 930 * is not in sync yet.
916 */ 931 */
917 if (!test_bit(CLOCK_SYNC_STP, &clock_sync_flags) && !eacr.es) 932 if (!check_sync_clock())
918 return eacr; 933 return eacr;
919 934
920 /* 935 /*
@@ -997,7 +1012,6 @@ static void etr_work_fn(struct work_struct *work)
997 on_each_cpu(disable_sync_clock, NULL, 1); 1012 on_each_cpu(disable_sync_clock, NULL, 1);
998 del_timer_sync(&etr_timer); 1013 del_timer_sync(&etr_timer);
999 etr_update_eacr(eacr); 1014 etr_update_eacr(eacr);
1000 clear_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1001 goto out_unlock; 1015 goto out_unlock;
1002 } 1016 }
1003 1017
@@ -1071,18 +1085,13 @@ static void etr_work_fn(struct work_struct *work)
1071 /* Both ports not usable. */ 1085 /* Both ports not usable. */
1072 eacr.es = eacr.sl = 0; 1086 eacr.es = eacr.sl = 0;
1073 sync_port = -1; 1087 sync_port = -1;
1074 clear_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1075 } 1088 }
1076 1089
1077 if (!test_bit(CLOCK_SYNC_ETR, &clock_sync_flags))
1078 eacr.es = 0;
1079
1080 /* 1090 /*
1081 * If the clock is in sync just update the eacr and return. 1091 * If the clock is in sync just update the eacr and return.
1082 * If there is no valid sync port wait for a port update. 1092 * If there is no valid sync port wait for a port update.
1083 */ 1093 */
1084 if (test_bit(CLOCK_SYNC_STP, &clock_sync_flags) || 1094 if (check_sync_clock() || sync_port < 0) {
1085 eacr.es || sync_port < 0) {
1086 etr_update_eacr(eacr); 1095 etr_update_eacr(eacr);
1087 etr_set_tolec_timeout(now); 1096 etr_set_tolec_timeout(now);
1088 goto out_unlock; 1097 goto out_unlock;
@@ -1103,13 +1112,11 @@ static void etr_work_fn(struct work_struct *work)
1103 * and set up a timer to try again after 0.5 seconds 1112 * and set up a timer to try again after 0.5 seconds
1104 */ 1113 */
1105 etr_update_eacr(eacr); 1114 etr_update_eacr(eacr);
1106 set_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1107 if (now < etr_tolec + (1600000 << 12) || 1115 if (now < etr_tolec + (1600000 << 12) ||
1108 etr_sync_clock_stop(&aib, sync_port) != 0) { 1116 etr_sync_clock_stop(&aib, sync_port) != 0) {
1109 /* Sync failed. Try again in 1/2 second. */ 1117 /* Sync failed. Try again in 1/2 second. */
1110 eacr.es = 0; 1118 eacr.es = 0;
1111 etr_update_eacr(eacr); 1119 etr_update_eacr(eacr);
1112 clear_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1113 etr_set_sync_timeout(); 1120 etr_set_sync_timeout();
1114 } else 1121 } else
1115 etr_set_tolec_timeout(now); 1122 etr_set_tolec_timeout(now);
@@ -1191,19 +1198,30 @@ static ssize_t etr_online_store(struct sys_device *dev,
1191 return -EINVAL; 1198 return -EINVAL;
1192 if (!test_bit(CLOCK_SYNC_HAS_ETR, &clock_sync_flags)) 1199 if (!test_bit(CLOCK_SYNC_HAS_ETR, &clock_sync_flags))
1193 return -EOPNOTSUPP; 1200 return -EOPNOTSUPP;
1201 mutex_lock(&clock_sync_mutex);
1194 if (dev == &etr_port0_dev) { 1202 if (dev == &etr_port0_dev) {
1195 if (etr_port0_online == value) 1203 if (etr_port0_online == value)
1196 return count; /* Nothing to do. */ 1204 goto out; /* Nothing to do. */
1197 etr_port0_online = value; 1205 etr_port0_online = value;
1206 if (etr_port0_online && etr_port1_online)
1207 set_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1208 else
1209 clear_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1198 set_bit(ETR_EVENT_PORT0_CHANGE, &etr_events); 1210 set_bit(ETR_EVENT_PORT0_CHANGE, &etr_events);
1199 queue_work(time_sync_wq, &etr_work); 1211 queue_work(time_sync_wq, &etr_work);
1200 } else { 1212 } else {
1201 if (etr_port1_online == value) 1213 if (etr_port1_online == value)
1202 return count; /* Nothing to do. */ 1214 goto out; /* Nothing to do. */
1203 etr_port1_online = value; 1215 etr_port1_online = value;
1216 if (etr_port0_online && etr_port1_online)
1217 set_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1218 else
1219 clear_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
1204 set_bit(ETR_EVENT_PORT1_CHANGE, &etr_events); 1220 set_bit(ETR_EVENT_PORT1_CHANGE, &etr_events);
1205 queue_work(time_sync_wq, &etr_work); 1221 queue_work(time_sync_wq, &etr_work);
1206 } 1222 }
1223out:
1224 mutex_unlock(&clock_sync_mutex);
1207 return count; 1225 return count;
1208} 1226}
1209 1227
@@ -1471,8 +1489,6 @@ static void stp_timing_alert(struct stp_irq_parm *intparm)
1471 */ 1489 */
1472void stp_sync_check(void) 1490void stp_sync_check(void)
1473{ 1491{
1474 if (!test_bit(CLOCK_SYNC_STP, &clock_sync_flags))
1475 return;
1476 disable_sync_clock(NULL); 1492 disable_sync_clock(NULL);
1477 queue_work(time_sync_wq, &stp_work); 1493 queue_work(time_sync_wq, &stp_work);
1478} 1494}
@@ -1485,8 +1501,6 @@ void stp_sync_check(void)
1485 */ 1501 */
1486void stp_island_check(void) 1502void stp_island_check(void)
1487{ 1503{
1488 if (!test_bit(CLOCK_SYNC_STP, &clock_sync_flags))
1489 return;
1490 disable_sync_clock(NULL); 1504 disable_sync_clock(NULL);
1491 queue_work(time_sync_wq, &stp_work); 1505 queue_work(time_sync_wq, &stp_work);
1492} 1506}
@@ -1513,10 +1527,6 @@ static int stp_sync_clock(void *data)
1513 1527
1514 enable_sync_clock(); 1528 enable_sync_clock();
1515 1529
1516 set_bit(CLOCK_SYNC_STP, &clock_sync_flags);
1517 if (test_and_clear_bit(CLOCK_SYNC_ETR, &clock_sync_flags))
1518 queue_work(time_sync_wq, &etr_work);
1519
1520 rc = 0; 1530 rc = 0;
1521 if (stp_info.todoff[0] || stp_info.todoff[1] || 1531 if (stp_info.todoff[0] || stp_info.todoff[1] ||
1522 stp_info.todoff[2] || stp_info.todoff[3] || 1532 stp_info.todoff[2] || stp_info.todoff[3] ||
@@ -1535,9 +1545,6 @@ static int stp_sync_clock(void *data)
1535 if (rc) { 1545 if (rc) {
1536 disable_sync_clock(NULL); 1546 disable_sync_clock(NULL);
1537 stp_sync->in_sync = -EAGAIN; 1547 stp_sync->in_sync = -EAGAIN;
1538 clear_bit(CLOCK_SYNC_STP, &clock_sync_flags);
1539 if (etr_port0_online || etr_port1_online)
1540 queue_work(time_sync_wq, &etr_work);
1541 } else 1548 } else
1542 stp_sync->in_sync = 1; 1549 stp_sync->in_sync = 1;
1543 xchg(&first, 0); 1550 xchg(&first, 0);
@@ -1569,6 +1576,10 @@ static void stp_work_fn(struct work_struct *work)
1569 if (rc || stp_info.c == 0) 1576 if (rc || stp_info.c == 0)
1570 goto out_unlock; 1577 goto out_unlock;
1571 1578
1579 /* Skip synchronization if the clock is already in sync. */
1580 if (check_sync_clock())
1581 goto out_unlock;
1582
1572 memset(&stp_sync, 0, sizeof(stp_sync)); 1583 memset(&stp_sync, 0, sizeof(stp_sync));
1573 get_online_cpus(); 1584 get_online_cpus();
1574 atomic_set(&stp_sync.cpus, num_online_cpus() - 1); 1585 atomic_set(&stp_sync.cpus, num_online_cpus() - 1);
@@ -1684,8 +1695,14 @@ static ssize_t stp_online_store(struct sysdev_class *class,
1684 return -EINVAL; 1695 return -EINVAL;
1685 if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags)) 1696 if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags))
1686 return -EOPNOTSUPP; 1697 return -EOPNOTSUPP;
1698 mutex_lock(&clock_sync_mutex);
1687 stp_online = value; 1699 stp_online = value;
1700 if (stp_online)
1701 set_bit(CLOCK_SYNC_STP, &clock_sync_flags);
1702 else
1703 clear_bit(CLOCK_SYNC_STP, &clock_sync_flags);
1688 queue_work(time_sync_wq, &stp_work); 1704 queue_work(time_sync_wq, &stp_work);
1705 mutex_unlock(&clock_sync_mutex);
1689 return count; 1706 return count;
1690} 1707}
1691 1708
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index cc362c9ea8f1..3c72c9cf22b6 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -74,7 +74,7 @@ static DEFINE_SPINLOCK(topology_lock);
74 74
75cpumask_t cpu_core_map[NR_CPUS]; 75cpumask_t cpu_core_map[NR_CPUS];
76 76
77cpumask_t cpu_coregroup_map(unsigned int cpu) 77static cpumask_t cpu_coregroup_map(unsigned int cpu)
78{ 78{
79 struct core_info *core = &core_info; 79 struct core_info *core = &core_info;
80 unsigned long flags; 80 unsigned long flags;
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 4584d81984c0..c2e42cc65ce7 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -61,9 +61,11 @@ extern pgm_check_handler_t do_asce_exception;
61#define stack_pointer ({ void **sp; asm("la %0,0(15)" : "=&d" (sp)); sp; }) 61#define stack_pointer ({ void **sp; asm("la %0,0(15)" : "=&d" (sp)); sp; })
62 62
63#ifndef CONFIG_64BIT 63#ifndef CONFIG_64BIT
64#define LONG "%08lx "
64#define FOURLONG "%08lx %08lx %08lx %08lx\n" 65#define FOURLONG "%08lx %08lx %08lx %08lx\n"
65static int kstack_depth_to_print = 12; 66static int kstack_depth_to_print = 12;
66#else /* CONFIG_64BIT */ 67#else /* CONFIG_64BIT */
68#define LONG "%016lx "
67#define FOURLONG "%016lx %016lx %016lx %016lx\n" 69#define FOURLONG "%016lx %016lx %016lx %016lx\n"
68static int kstack_depth_to_print = 20; 70static int kstack_depth_to_print = 20;
69#endif /* CONFIG_64BIT */ 71#endif /* CONFIG_64BIT */
@@ -155,7 +157,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
155 break; 157 break;
156 if (i && ((i * sizeof (long) % 32) == 0)) 158 if (i && ((i * sizeof (long) % 32) == 0))
157 printk("\n "); 159 printk("\n ");
158 printk("%p ", (void *)*stack++); 160 printk(LONG, *stack++);
159 } 161 }
160 printk("\n"); 162 printk("\n");
161 show_trace(task, sp); 163 show_trace(task, sp);
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 690e17819686..89b2e7f1b7a9 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -144,7 +144,6 @@ out:
144 return -ENOMEM; 144 return -ENOMEM;
145} 145}
146 146
147#ifdef CONFIG_HOTPLUG_CPU
148void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore) 147void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore)
149{ 148{
150 unsigned long segment_table, page_table, page_frame; 149 unsigned long segment_table, page_table, page_frame;
@@ -163,7 +162,6 @@ void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore)
163 free_page(page_table); 162 free_page(page_table);
164 free_pages(segment_table, SEGMENT_ORDER); 163 free_pages(segment_table, SEGMENT_ORDER);
165} 164}
166#endif /* CONFIG_HOTPLUG_CPU */
167 165
168static void __vdso_init_cr5(void *dummy) 166static void __vdso_init_cr5(void *dummy)
169{ 167{
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index d796d05c9c01..7a2063eb88f0 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -108,6 +108,8 @@ SECTIONS
108 EXIT_TEXT 108 EXIT_TEXT
109 } 109 }
110 110
111 /* early.c uses stsi, which requires page aligned data. */
112 . = ALIGN(PAGE_SIZE);
111 .init.data : { 113 .init.data : {
112 INIT_DATA 114 INIT_DATA
113 } 115 }
diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig
index e051cad1f1e0..3e260b7e37b2 100644
--- a/arch/s390/kvm/Kconfig
+++ b/arch/s390/kvm/Kconfig
@@ -4,6 +4,9 @@
4config HAVE_KVM 4config HAVE_KVM
5 bool 5 bool
6 6
7config HAVE_KVM_IRQCHIP
8 bool
9
7menuconfig VIRTUALIZATION 10menuconfig VIRTUALIZATION
8 bool "Virtualization" 11 bool "Virtualization"
9 default y 12 default y
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index 61236102203e..9d19803111ba 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -103,7 +103,7 @@ static int handle_lctl(struct kvm_vcpu *vcpu)
103static intercept_handler_t instruction_handlers[256] = { 103static intercept_handler_t instruction_handlers[256] = {
104 [0x83] = kvm_s390_handle_diag, 104 [0x83] = kvm_s390_handle_diag,
105 [0xae] = kvm_s390_handle_sigp, 105 [0xae] = kvm_s390_handle_sigp,
106 [0xb2] = kvm_s390_handle_priv, 106 [0xb2] = kvm_s390_handle_b2,
107 [0xb7] = handle_lctl, 107 [0xb7] = handle_lctl,
108 [0xeb] = handle_lctlg, 108 [0xeb] = handle_lctlg,
109}; 109};
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index f4fe28a2521a..0189356fe209 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -555,9 +555,14 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
555 VCPU_EVENT(vcpu, 3, "inject: program check %d (from user)", 555 VCPU_EVENT(vcpu, 3, "inject: program check %d (from user)",
556 s390int->parm); 556 s390int->parm);
557 break; 557 break;
558 case KVM_S390_SIGP_SET_PREFIX:
559 inti->prefix.address = s390int->parm;
560 inti->type = s390int->type;
561 VCPU_EVENT(vcpu, 3, "inject: set prefix to %x (from user)",
562 s390int->parm);
563 break;
558 case KVM_S390_SIGP_STOP: 564 case KVM_S390_SIGP_STOP:
559 case KVM_S390_RESTART: 565 case KVM_S390_RESTART:
560 case KVM_S390_SIGP_SET_PREFIX:
561 case KVM_S390_INT_EMERGENCY: 566 case KVM_S390_INT_EMERGENCY:
562 VCPU_EVENT(vcpu, 3, "inject: type %x", s390int->type); 567 VCPU_EVENT(vcpu, 3, "inject: type %x", s390int->type);
563 inti->type = s390int->type; 568 inti->type = s390int->type;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 0d33893e1e89..f4d56e9939c9 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -23,7 +23,7 @@
23#include <linux/timer.h> 23#include <linux/timer.h>
24#include <asm/lowcore.h> 24#include <asm/lowcore.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26 26#include <asm/nmi.h>
27#include "kvm-s390.h" 27#include "kvm-s390.h"
28#include "gaccess.h" 28#include "gaccess.h"
29 29
@@ -286,7 +286,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
286 setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, 286 setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup,
287 (unsigned long) vcpu); 287 (unsigned long) vcpu);
288 get_cpu_id(&vcpu->arch.cpu_id); 288 get_cpu_id(&vcpu->arch.cpu_id);
289 vcpu->arch.cpu_id.version = 0xfe; 289 vcpu->arch.cpu_id.version = 0xff;
290 return 0; 290 return 0;
291} 291}
292 292
@@ -422,8 +422,8 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
422 return -EINVAL; /* not implemented yet */ 422 return -EINVAL; /* not implemented yet */
423} 423}
424 424
425int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, 425int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
426 struct kvm_debug_guest *dbg) 426 struct kvm_guest_debug *dbg)
427{ 427{
428 return -EINVAL; /* not implemented yet */ 428 return -EINVAL; /* not implemented yet */
429} 429}
@@ -440,8 +440,6 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu,
440 return -EINVAL; /* not implemented yet */ 440 return -EINVAL; /* not implemented yet */
441} 441}
442 442
443extern void s390_handle_mcck(void);
444
445static void __vcpu_run(struct kvm_vcpu *vcpu) 443static void __vcpu_run(struct kvm_vcpu *vcpu)
446{ 444{
447 memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); 445 memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16);
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index 3893cf12eacf..00bbe69b78da 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -50,7 +50,7 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
50int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code); 50int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code);
51 51
52/* implemented in priv.c */ 52/* implemented in priv.c */
53int kvm_s390_handle_priv(struct kvm_vcpu *vcpu); 53int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);
54 54
55/* implemented in sigp.c */ 55/* implemented in sigp.c */
56int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu); 56int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu);
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 3605df45dd41..4b88834b8dd8 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -304,12 +304,24 @@ static intercept_handler_t priv_handlers[256] = {
304 [0xb1] = handle_stfl, 304 [0xb1] = handle_stfl,
305}; 305};
306 306
307int kvm_s390_handle_priv(struct kvm_vcpu *vcpu) 307int kvm_s390_handle_b2(struct kvm_vcpu *vcpu)
308{ 308{
309 intercept_handler_t handler; 309 intercept_handler_t handler;
310 310
311 /*
312 * a lot of B2 instructions are priviledged. We first check for
313 * the priviledges ones, that we can handle in the kernel. If the
314 * kernel can handle this instruction, we check for the problem
315 * state bit and (a) handle the instruction or (b) send a code 2
316 * program check.
317 * Anything else goes to userspace.*/
311 handler = priv_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; 318 handler = priv_handlers[vcpu->arch.sie_block->ipa & 0x00ff];
312 if (handler) 319 if (handler) {
313 return handler(vcpu); 320 if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
321 return kvm_s390_inject_program_int(vcpu,
322 PGM_PRIVILEGED_OPERATION);
323 else
324 return handler(vcpu);
325 }
314 return -ENOTSUPP; 326 return -ENOTSUPP;
315} 327}
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 2a01b9e02801..f27dbedf0866 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -153,8 +153,6 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
153 153
154 switch (parameter & 0xff) { 154 switch (parameter & 0xff) {
155 case 0: 155 case 0:
156 printk(KERN_WARNING "kvm: request to switch to ESA/390 mode"
157 " not supported");
158 rc = 3; /* not operational */ 156 rc = 3; /* not operational */
159 break; 157 break;
160 case 1: 158 case 1:
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c
index 6ccb9fab055a..3f5f680726ed 100644
--- a/arch/s390/lib/delay.c
+++ b/arch/s390/lib/delay.c
@@ -9,6 +9,7 @@
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/delay.h> 10#include <linux/delay.h>
11#include <linux/timex.h> 11#include <linux/timex.h>
12#include <linux/module.h>
12#include <linux/irqflags.h> 13#include <linux/irqflags.h>
13#include <linux/interrupt.h> 14#include <linux/interrupt.h>
14 15
@@ -92,6 +93,7 @@ out:
92 local_irq_restore(flags); 93 local_irq_restore(flags);
93 preempt_enable(); 94 preempt_enable();
94} 95}
96EXPORT_SYMBOL(__udelay);
95 97
96/* 98/*
97 * Simple udelay variant. To be used on startup and reboot 99 * Simple udelay variant. To be used on startup and reboot
diff --git a/arch/s390/lib/string.c b/arch/s390/lib/string.c
index ae5cf5d03d41..4143b7c19096 100644
--- a/arch/s390/lib/string.c
+++ b/arch/s390/lib/string.c
@@ -44,7 +44,11 @@ static inline char *__strnend(const char *s, size_t n)
44 */ 44 */
45size_t strlen(const char *s) 45size_t strlen(const char *s)
46{ 46{
47#if __GNUC__ < 4
47 return __strend(s) - s; 48 return __strend(s) - s;
49#else
50 return __builtin_strlen(s);
51#endif
48} 52}
49EXPORT_SYMBOL(strlen); 53EXPORT_SYMBOL(strlen);
50 54
@@ -70,6 +74,7 @@ EXPORT_SYMBOL(strnlen);
70 */ 74 */
71char *strcpy(char *dest, const char *src) 75char *strcpy(char *dest, const char *src)
72{ 76{
77#if __GNUC__ < 4
73 register int r0 asm("0") = 0; 78 register int r0 asm("0") = 0;
74 char *ret = dest; 79 char *ret = dest;
75 80
@@ -78,6 +83,9 @@ char *strcpy(char *dest, const char *src)
78 : "+&a" (dest), "+&a" (src) : "d" (r0) 83 : "+&a" (dest), "+&a" (src) : "d" (r0)
79 : "cc", "memory" ); 84 : "cc", "memory" );
80 return ret; 85 return ret;
86#else
87 return __builtin_strcpy(dest, src);
88#endif
81} 89}
82EXPORT_SYMBOL(strcpy); 90EXPORT_SYMBOL(strcpy);
83 91
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 4d537205e83c..833e8366c351 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -200,29 +200,6 @@ static void do_low_address(struct pt_regs *regs, unsigned long error_code)
200 do_no_context(regs, error_code, 0); 200 do_no_context(regs, error_code, 0);
201} 201}
202 202
203/*
204 * We ran out of memory, or some other thing happened to us that made
205 * us unable to handle the page fault gracefully.
206 */
207static int do_out_of_memory(struct pt_regs *regs, unsigned long error_code,
208 unsigned long address)
209{
210 struct task_struct *tsk = current;
211 struct mm_struct *mm = tsk->mm;
212
213 up_read(&mm->mmap_sem);
214 if (is_global_init(tsk)) {
215 yield();
216 down_read(&mm->mmap_sem);
217 return 1;
218 }
219 printk("VM: killing process %s\n", tsk->comm);
220 if (regs->psw.mask & PSW_MASK_PSTATE)
221 do_group_exit(SIGKILL);
222 do_no_context(regs, error_code, address);
223 return 0;
224}
225
226static void do_sigbus(struct pt_regs *regs, unsigned long error_code, 203static void do_sigbus(struct pt_regs *regs, unsigned long error_code,
227 unsigned long address) 204 unsigned long address)
228{ 205{
@@ -367,7 +344,6 @@ good_area:
367 goto bad_area; 344 goto bad_area;
368 } 345 }
369 346
370survive:
371 if (is_vm_hugetlb_page(vma)) 347 if (is_vm_hugetlb_page(vma))
372 address &= HPAGE_MASK; 348 address &= HPAGE_MASK;
373 /* 349 /*
@@ -378,8 +354,8 @@ survive:
378 fault = handle_mm_fault(mm, vma, address, write); 354 fault = handle_mm_fault(mm, vma, address, write);
379 if (unlikely(fault & VM_FAULT_ERROR)) { 355 if (unlikely(fault & VM_FAULT_ERROR)) {
380 if (fault & VM_FAULT_OOM) { 356 if (fault & VM_FAULT_OOM) {
381 if (do_out_of_memory(regs, error_code, address)) 357 up_read(&mm->mmap_sem);
382 goto survive; 358 pagefault_out_of_memory();
383 return; 359 return;
384 } else if (fault & VM_FAULT_SIGBUS) { 360 } else if (fault & VM_FAULT_SIGBUS) {
385 do_sigbus(regs, error_code, address); 361 do_sigbus(regs, error_code, address);
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index f0258ca3b17e..c634dfbe92e9 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -40,7 +40,9 @@
40DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 40DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
41 41
42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); 42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
43
43char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); 44char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
45EXPORT_SYMBOL(empty_zero_page);
44 46
45/* 47/*
46 * paging_init() sets up the page tables 48 * paging_init() sets up the page tables
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 6b6ddc4ea02b..be6c1cf4ad5a 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -258,6 +258,10 @@ int s390_enable_sie(void)
258 struct task_struct *tsk = current; 258 struct task_struct *tsk = current;
259 struct mm_struct *mm, *old_mm; 259 struct mm_struct *mm, *old_mm;
260 260
261 /* Do we have switched amode? If no, we cannot do sie */
262 if (!switch_amode)
263 return -EINVAL;
264
261 /* Do we have pgstes? if yes, we are done */ 265 /* Do we have pgstes? if yes, we are done */
262 if (tsk->mm->context.has_pgste) 266 if (tsk->mm->context.has_pgste)
263 return 0; 267 return 0;
@@ -292,7 +296,7 @@ int s390_enable_sie(void)
292 tsk->mm = tsk->active_mm = mm; 296 tsk->mm = tsk->active_mm = mm;
293 preempt_disable(); 297 preempt_disable();
294 update_mm(mm, tsk); 298 update_mm(mm, tsk);
295 cpu_set(smp_processor_id(), mm->cpu_vm_mask); 299 cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
296 preempt_enable(); 300 preempt_enable();
297 task_unlock(tsk); 301 task_unlock(tsk);
298 mmput(old_mm); 302 mmput(old_mm);
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index ebabe518e729..8d50d527c595 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -107,6 +107,9 @@ config SYS_SUPPORTS_NUMA
107config SYS_SUPPORTS_PCI 107config SYS_SUPPORTS_PCI
108 bool 108 bool
109 109
110config SYS_SUPPORTS_CMT
111 bool
112
110config STACKTRACE_SUPPORT 113config STACKTRACE_SUPPORT
111 def_bool y 114 def_bool y
112 115
@@ -176,6 +179,10 @@ config CPU_SHX2
176config CPU_SHX3 179config CPU_SHX3
177 bool 180 bool
178 181
182config ARCH_SHMOBILE
183 bool
184 select ARCH_SUSPEND_POSSIBLE
185
179choice 186choice
180 prompt "Processor sub-type selection" 187 prompt "Processor sub-type selection"
181 188
@@ -188,6 +195,7 @@ choice
188config CPU_SUBTYPE_SH7619 195config CPU_SUBTYPE_SH7619
189 bool "Support SH7619 processor" 196 bool "Support SH7619 processor"
190 select CPU_SH2 197 select CPU_SH2
198 select SYS_SUPPORTS_CMT
191 199
192# SH-2A Processor Support 200# SH-2A Processor Support
193 201
@@ -200,15 +208,18 @@ config CPU_SUBTYPE_SH7203
200 bool "Support SH7203 processor" 208 bool "Support SH7203 processor"
201 select CPU_SH2A 209 select CPU_SH2A
202 select CPU_HAS_FPU 210 select CPU_HAS_FPU
211 select SYS_SUPPORTS_CMT
203 212
204config CPU_SUBTYPE_SH7206 213config CPU_SUBTYPE_SH7206
205 bool "Support SH7206 processor" 214 bool "Support SH7206 processor"
206 select CPU_SH2A 215 select CPU_SH2A
216 select SYS_SUPPORTS_CMT
207 217
208config CPU_SUBTYPE_SH7263 218config CPU_SUBTYPE_SH7263
209 bool "Support SH7263 processor" 219 bool "Support SH7263 processor"
210 select CPU_SH2A 220 select CPU_SH2A
211 select CPU_HAS_FPU 221 select CPU_HAS_FPU
222 select SYS_SUPPORTS_CMT
212 223
213config CPU_SUBTYPE_MXG 224config CPU_SUBTYPE_MXG
214 bool "Support MX-G processor" 225 bool "Support MX-G processor"
@@ -323,7 +334,9 @@ config CPU_SUBTYPE_SH7723
323 bool "Support SH7723 processor" 334 bool "Support SH7723 processor"
324 select CPU_SH4A 335 select CPU_SH4A
325 select CPU_SHX2 336 select CPU_SHX2
337 select ARCH_SHMOBILE
326 select ARCH_SPARSEMEM_ENABLE 338 select ARCH_SPARSEMEM_ENABLE
339 select SYS_SUPPORTS_CMT
327 help 340 help
328 Select SH7723 if you have an SH-MobileR2 CPU. 341 Select SH7723 if you have an SH-MobileR2 CPU.
329 342
@@ -348,6 +361,14 @@ config CPU_SUBTYPE_SH7785
348 select ARCH_SPARSEMEM_ENABLE 361 select ARCH_SPARSEMEM_ENABLE
349 select SYS_SUPPORTS_NUMA 362 select SYS_SUPPORTS_NUMA
350 363
364config CPU_SUBTYPE_SH7786
365 bool "Support SH7786 processor"
366 select CPU_SH4A
367 select CPU_SHX3
368 select CPU_HAS_PTEAEX
369 select ARCH_SPARSEMEM_ENABLE
370 select SYS_SUPPORTS_NUMA
371
351config CPU_SUBTYPE_SHX3 372config CPU_SUBTYPE_SHX3
352 bool "Support SH-X3 processor" 373 bool "Support SH-X3 processor"
353 select CPU_SH4A 374 select CPU_SH4A
@@ -362,20 +383,26 @@ config CPU_SUBTYPE_SHX3
362config CPU_SUBTYPE_SH7343 383config CPU_SUBTYPE_SH7343
363 bool "Support SH7343 processor" 384 bool "Support SH7343 processor"
364 select CPU_SH4AL_DSP 385 select CPU_SH4AL_DSP
386 select ARCH_SHMOBILE
387 select SYS_SUPPORTS_CMT
365 388
366config CPU_SUBTYPE_SH7722 389config CPU_SUBTYPE_SH7722
367 bool "Support SH7722 processor" 390 bool "Support SH7722 processor"
368 select CPU_SH4AL_DSP 391 select CPU_SH4AL_DSP
369 select CPU_SHX2 392 select CPU_SHX2
393 select ARCH_SHMOBILE
370 select ARCH_SPARSEMEM_ENABLE 394 select ARCH_SPARSEMEM_ENABLE
371 select SYS_SUPPORTS_NUMA 395 select SYS_SUPPORTS_NUMA
396 select SYS_SUPPORTS_CMT
372 397
373config CPU_SUBTYPE_SH7366 398config CPU_SUBTYPE_SH7366
374 bool "Support SH7366 processor" 399 bool "Support SH7366 processor"
375 select CPU_SH4AL_DSP 400 select CPU_SH4AL_DSP
376 select CPU_SHX2 401 select CPU_SHX2
402 select ARCH_SHMOBILE
377 select ARCH_SPARSEMEM_ENABLE 403 select ARCH_SPARSEMEM_ENABLE
378 select SYS_SUPPORTS_NUMA 404 select SYS_SUPPORTS_NUMA
405 select SYS_SUPPORTS_CMT
379 406
380# SH-5 Processor Support 407# SH-5 Processor Support
381 408
@@ -398,25 +425,34 @@ source "arch/sh/boards/Kconfig"
398menu "Timer and clock configuration" 425menu "Timer and clock configuration"
399 426
400config SH_TMU 427config SH_TMU
401 def_bool y 428 bool "TMU timer support"
402 prompt "TMU timer support"
403 depends on CPU_SH3 || CPU_SH4 429 depends on CPU_SH3 || CPU_SH4
430 default y
404 select GENERIC_TIME 431 select GENERIC_TIME
405 select GENERIC_CLOCKEVENTS 432 select GENERIC_CLOCKEVENTS
406 help 433 help
407 This enables the use of the TMU as the system timer. 434 This enables the use of the TMU as the system timer.
408 435
409config SH_CMT 436config SH_CMT
410 def_bool y 437 bool "CMT timer support"
411 prompt "CMT timer support" 438 depends on SYS_SUPPORTS_CMT && CPU_SH2
412 depends on CPU_SH2 && !CPU_SUBTYPE_MXG 439 default y
413 help 440 help
414 This enables the use of the CMT as the system timer. 441 This enables the use of the CMT as the system timer.
415 442
443#
444# Support for the new-style CMT driver. This will replace SH_CMT
445# once its other dependencies are merged.
446#
447config SH_TIMER_CMT
448 bool "CMT clockevents driver"
449 depends on SYS_SUPPORTS_CMT && !SH_CMT
450 select GENERIC_CLOCKEVENTS
451
416config SH_MTU2 452config SH_MTU2
417 def_bool n 453 bool "MTU2 timer support"
418 prompt "MTU2 timer support"
419 depends on CPU_SH2A 454 depends on CPU_SH2A
455 default y
420 help 456 help
421 This enables the use of the MTU2 as the system timer. 457 This enables the use of the MTU2 as the system timer.
422 458
@@ -426,7 +462,8 @@ config SH_TIMER_IRQ
426 CPU_SUBTYPE_SH7763 462 CPU_SUBTYPE_SH7763
427 default "86" if CPU_SUBTYPE_SH7619 463 default "86" if CPU_SUBTYPE_SH7619
428 default "140" if CPU_SUBTYPE_SH7206 464 default "140" if CPU_SUBTYPE_SH7206
429 default "142" if CPU_SUBTYPE_SH7203 465 default "142" if CPU_SUBTYPE_SH7203 && SH_CMT
466 default "153" if CPU_SUBTYPE_SH7203 && SH_MTU2
430 default "238" if CPU_SUBTYPE_MXG 467 default "238" if CPU_SUBTYPE_MXG
431 default "16" 468 default "16"
432 469
@@ -438,7 +475,8 @@ config SH_PCLK_FREQ
438 default "33333333" if CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7723 || \ 475 default "33333333" if CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7723 || \
439 CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \ 476 CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \
440 CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7206 || \ 477 CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7206 || \
441 CPU_SUBTYPE_SH7263 || CPU_SUBTYPE_MXG 478 CPU_SUBTYPE_SH7263 || CPU_SUBTYPE_MXG || \
479 CPU_SUBTYPE_SH7786
442 default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R 480 default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R
443 default "66000000" if CPU_SUBTYPE_SH4_202 481 default "66000000" if CPU_SUBTYPE_SH4_202
444 default "50000000" 482 default "50000000"
@@ -521,6 +559,13 @@ config CRASH_DUMP
521 559
522 For more details see Documentation/kdump/kdump.txt 560 For more details see Documentation/kdump/kdump.txt
523 561
562config KEXEC_JUMP
563 bool "kexec jump (EXPERIMENTAL)"
564 depends on SUPERH32 && KEXEC && HIBERNATION && EXPERIMENTAL
565 help
566 Jump between original kernel and kexeced kernel and invoke
567 code via KEXEC
568
524config SECCOMP 569config SECCOMP
525 bool "Enable seccomp to safely compute untrusted bytecode" 570 bool "Enable seccomp to safely compute untrusted bytecode"
526 depends on PROC_FS 571 depends on PROC_FS
diff --git a/arch/sh/Kconfig.cpu b/arch/sh/Kconfig.cpu
index 0e27fe3b182b..c7d704381a6d 100644
--- a/arch/sh/Kconfig.cpu
+++ b/arch/sh/Kconfig.cpu
@@ -104,6 +104,9 @@ config CPU_HAS_SR_RB
104config CPU_HAS_PTEA 104config CPU_HAS_PTEA
105 bool 105 bool
106 106
107config CPU_HAS_PTEAEX
108 bool
109
107config CPU_HAS_DSP 110config CPU_HAS_DSP
108 bool 111 bool
109 112
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 4067b0d9287b..bece1f7535f2 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -80,6 +80,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \
80defaultimage-$(CONFIG_SUPERH32) := zImage 80defaultimage-$(CONFIG_SUPERH32) := zImage
81defaultimage-$(CONFIG_SH_SH7785LCR) := uImage 81defaultimage-$(CONFIG_SH_SH7785LCR) := uImage
82defaultimage-$(CONFIG_SH_RSK) := uImage 82defaultimage-$(CONFIG_SH_RSK) := uImage
83defaultimage-$(CONFIG_SH_URQUELL) := uImage
83defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux 84defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux
84defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux 85defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux
85 86
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index 861914747e4e..dcc1af8a2cfe 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -155,17 +155,22 @@ config SH_SH7785LCR
155 155
156config SH_SH7785LCR_29BIT_PHYSMAPS 156config SH_SH7785LCR_29BIT_PHYSMAPS
157 bool "SH7785LCR 29bit physmaps" 157 bool "SH7785LCR 29bit physmaps"
158 depends on SH_SH7785LCR 158 depends on SH_SH7785LCR && 29BIT
159 default y 159 default y
160 help 160 help
161 This board has 2 physical memory maps. It can be changed with 161 This board has 2 physical memory maps. It can be changed with
162 DIP switch(S2-5). If you set the DIP switch for S2-5 = ON, 162 DIP switch(S2-5). If you set the DIP switch for S2-5 = ON,
163 you can access all on-board device in 29bit address mode. 163 you can access all on-board device in 29bit address mode.
164 164
165config SH_URQUELL
166 bool "Urquell"
167 depends on CPU_SUBTYPE_SH7786
168 select ARCH_REQUIRE_GPIOLIB
169
165config SH_MIGOR 170config SH_MIGOR
166 bool "Migo-R" 171 bool "Migo-R"
167 depends on CPU_SUBTYPE_SH7722 172 depends on CPU_SUBTYPE_SH7722
168 select GENERIC_GPIO 173 select ARCH_REQUIRE_GPIOLIB
169 help 174 help
170 Select Migo-R if configuring for the SH7722 Migo-R platform 175 Select Migo-R if configuring for the SH7722 Migo-R platform
171 by Renesas System Solutions Asia Pte. Ltd. 176 by Renesas System Solutions Asia Pte. Ltd.
@@ -173,7 +178,7 @@ config SH_MIGOR
173config SH_AP325RXA 178config SH_AP325RXA
174 bool "AP-325RXA" 179 bool "AP-325RXA"
175 depends on CPU_SUBTYPE_SH7723 180 depends on CPU_SUBTYPE_SH7723
176 select GENERIC_GPIO 181 select ARCH_REQUIRE_GPIOLIB
177 help 182 help
178 Renesas "AP-325RXA" support. 183 Renesas "AP-325RXA" support.
179 Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" 184 Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
@@ -185,6 +190,13 @@ config SH_SH7763RDP
185 Select SH7763RDP if configuring for a Renesas SH7763 190 Select SH7763RDP if configuring for a Renesas SH7763
186 evaluation board. 191 evaluation board.
187 192
193config SH_ESPT
194 bool "ESPT"
195 depends on CPU_SUBTYPE_SH7763
196 help
197 Select ESPT if configuring for a Renesas SH7763
198 with gigabit ether evaluation board.
199
188config SH_EDOSK7705 200config SH_EDOSK7705
189 bool "EDOSK7705" 201 bool "EDOSK7705"
190 depends on CPU_SUBTYPE_SH7705 202 depends on CPU_SUBTYPE_SH7705
@@ -240,7 +252,7 @@ config SH_X3PROTO
240config SH_MAGIC_PANEL_R2 252config SH_MAGIC_PANEL_R2
241 bool "Magic Panel R2" 253 bool "Magic Panel R2"
242 depends on CPU_SUBTYPE_SH7720 254 depends on CPU_SUBTYPE_SH7720
243 select GENERIC_GPIO 255 select ARCH_REQUIRE_GPIOLIB
244 help 256 help
245 Select Magic Panel R2 if configuring for Magic Panel R2. 257 Select Magic Panel R2 if configuring for Magic Panel R2.
246 258
@@ -249,6 +261,13 @@ config SH_CAYMAN
249 depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103 261 depends on CPU_SUBTYPE_SH5_101 || CPU_SUBTYPE_SH5_103
250 select SYS_SUPPORTS_PCI 262 select SYS_SUPPORTS_PCI
251 263
264config SH_POLARIS
265 bool "SMSC Polaris"
266 select CPU_HAS_IPR_IRQ
267 depends on CPU_SUBTYPE_SH7709
268 help
269 Select if configuring for an SMSC Polaris development board
270
252endmenu 271endmenu
253 272
254source "arch/sh/boards/mach-r2d/Kconfig" 273source "arch/sh/boards/mach-r2d/Kconfig"
diff --git a/arch/sh/boards/Makefile b/arch/sh/boards/Makefile
index 269ae2be49ef..7baa21090231 100644
--- a/arch/sh/boards/Makefile
+++ b/arch/sh/boards/Makefile
@@ -4,5 +4,8 @@
4obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o 4obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o
5obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o 5obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o
6obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o 6obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o
7obj-$(CONFIG_SH_URQUELL) += board-urquell.o
7obj-$(CONFIG_SH_SHMIN) += board-shmin.o 8obj-$(CONFIG_SH_SHMIN) += board-shmin.o
8obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o 9obj-$(CONFIG_SH_EDOSK7760) += board-edosk7760.o
10obj-$(CONFIG_SH_ESPT) += board-espt.o
11obj-$(CONFIG_SH_POLARIS) += board-polaris.o
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c
index 15b6d450fbf0..a64e38841c49 100644
--- a/arch/sh/boards/board-ap325rxa.c
+++ b/arch/sh/boards/board-ap325rxa.c
@@ -166,6 +166,16 @@ static void ap320_wvga_power_on(void *board_data)
166 ctrl_outw(0x100, FPGA_BKLREG); 166 ctrl_outw(0x100, FPGA_BKLREG);
167} 167}
168 168
169static void ap320_wvga_power_off(void *board_data)
170{
171 /* backlight */
172 ctrl_outw(0, FPGA_BKLREG);
173 gpio_set_value(GPIO_PTS3, 1);
174
175 /* ASD AP-320/325 LCD OFF */
176 ctrl_outw(0, FPGA_LCDREG);
177}
178
169static struct sh_mobile_lcdc_info lcdc_info = { 179static struct sh_mobile_lcdc_info lcdc_info = {
170 .clock_source = LCDC_CLK_EXTERNAL, 180 .clock_source = LCDC_CLK_EXTERNAL,
171 .ch[0] = { 181 .ch[0] = {
@@ -191,6 +201,7 @@ static struct sh_mobile_lcdc_info lcdc_info = {
191 }, 201 },
192 .board_cfg = { 202 .board_cfg = {
193 .display_on = ap320_wvga_power_on, 203 .display_on = ap320_wvga_power_on,
204 .display_off = ap320_wvga_power_off,
194 }, 205 },
195 } 206 }
196}; 207};
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c
new file mode 100644
index 000000000000..d5ce5e18eb37
--- /dev/null
+++ b/arch/sh/boards/board-espt.c
@@ -0,0 +1,102 @@
1/*
2 * Data Technology Inc. ESPT-GIGA board suport
3 *
4 * Copyright (C) 2008, 2009 Renesas Solutions Corp.
5 * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/interrupt.h>
14#include <linux/mtd/physmap.h>
15#include <linux/io.h>
16#include <asm/machvec.h>
17#include <asm/sizes.h>
18#include <asm/sh_eth.h>
19
20/* NOR Flash */
21static struct mtd_partition espt_nor_flash_partitions[] = {
22 {
23 .name = "U-Boot",
24 .offset = 0,
25 .size = (2 * SZ_128K),
26 .mask_flags = MTD_WRITEABLE, /* Read-only */
27 }, {
28 .name = "Linux-Kernel",
29 .offset = MTDPART_OFS_APPEND,
30 .size = (20 * SZ_128K),
31 }, {
32 .name = "Root Filesystem",
33 .offset = MTDPART_OFS_APPEND,
34 .size = MTDPART_SIZ_FULL,
35 },
36};
37
38static struct physmap_flash_data espt_nor_flash_data = {
39 .width = 2,
40 .parts = espt_nor_flash_partitions,
41 .nr_parts = ARRAY_SIZE(espt_nor_flash_partitions),
42};
43
44static struct resource espt_nor_flash_resources[] = {
45 [0] = {
46 .name = "NOR Flash",
47 .start = 0,
48 .end = SZ_8M - 1,
49 .flags = IORESOURCE_MEM,
50 },
51};
52
53static struct platform_device espt_nor_flash_device = {
54 .name = "physmap-flash",
55 .resource = espt_nor_flash_resources,
56 .num_resources = ARRAY_SIZE(espt_nor_flash_resources),
57 .dev = {
58 .platform_data = &espt_nor_flash_data,
59 },
60};
61
62/* SH-Ether */
63static struct resource sh_eth_resources[] = {
64 {
65 .start = 0xFEE00800, /* use eth1 */
66 .end = 0xFEE00F7C - 1,
67 .flags = IORESOURCE_MEM,
68 }, {
69 .start = 57, /* irq number */
70 .flags = IORESOURCE_IRQ,
71 },
72};
73
74static struct sh_eth_plat_data sh7763_eth_pdata = {
75 .phy = 0,
76 .edmac_endian = EDMAC_LITTLE_ENDIAN,
77};
78
79static struct platform_device espt_eth_device = {
80 .name = "sh-eth",
81 .resource = sh_eth_resources,
82 .num_resources = ARRAY_SIZE(sh_eth_resources),
83 .dev = {
84 .platform_data = &sh7763_eth_pdata,
85 },
86};
87
88static struct platform_device *espt_devices[] __initdata = {
89 &espt_nor_flash_device,
90 &espt_eth_device,
91};
92
93static int __init espt_devices_setup(void)
94{
95 return platform_add_devices(espt_devices,
96 ARRAY_SIZE(espt_devices));
97}
98device_initcall(espt_devices_setup);
99
100static struct sh_machine_vector mv_espt __initmv = {
101 .mv_name = "ESPT-GIGA",
102};
diff --git a/arch/sh/boards/board-polaris.c b/arch/sh/boards/board-polaris.c
new file mode 100644
index 000000000000..62607eb51004
--- /dev/null
+++ b/arch/sh/boards/board-polaris.c
@@ -0,0 +1,149 @@
1/*
2 * June 2006 steve.glendinning@smsc.com
3 *
4 * Polaris-specific resource declaration
5 *
6 */
7
8#include <linux/init.h>
9#include <linux/interrupt.h>
10#include <linux/irq.h>
11#include <linux/platform_device.h>
12#include <linux/smsc911x.h>
13#include <linux/io.h>
14#include <asm/irq.h>
15#include <asm/machvec.h>
16#include <asm/heartbeat.h>
17#include <cpu/gpio.h>
18#include <mach-se/mach/se.h>
19
20#define BCR2 (0xFFFFFF62)
21#define WCR2 (0xFFFFFF66)
22#define AREA5_WAIT_CTRL (0x1C00)
23#define WAIT_STATES_10 (0x7)
24
25static struct resource smsc911x_resources[] = {
26 [0] = {
27 .name = "smsc911x-memory",
28 .start = PA_EXT5,
29 .end = PA_EXT5 + 0x1fff,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .name = "smsc911x-irq",
34 .start = IRQ0_IRQ,
35 .end = IRQ0_IRQ,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40static struct smsc911x_platform_config smsc911x_config = {
41 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
42 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
43 .flags = SMSC911X_USE_32BIT,
44 .phy_interface = PHY_INTERFACE_MODE_MII,
45};
46
47static struct platform_device smsc911x_device = {
48 .name = "smsc911x",
49 .id = 0,
50 .num_resources = ARRAY_SIZE(smsc911x_resources),
51 .resource = smsc911x_resources,
52 .dev = {
53 .platform_data = &smsc911x_config,
54 },
55};
56
57static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 };
58
59static struct heartbeat_data heartbeat_data = {
60 .bit_pos = heartbeat_bit_pos,
61 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
62 .regsize = 8,
63};
64
65static struct resource heartbeat_resources[] = {
66 [0] = {
67 .start = PORT_PCDR,
68 .end = PORT_PCDR,
69 .flags = IORESOURCE_MEM,
70 },
71};
72
73static struct platform_device heartbeat_device = {
74 .name = "heartbeat",
75 .id = -1,
76 .dev = {
77 .platform_data = &heartbeat_data,
78 },
79 .num_resources = ARRAY_SIZE(heartbeat_resources),
80 .resource = heartbeat_resources,
81};
82
83static struct platform_device *polaris_devices[] __initdata = {
84 &smsc911x_device,
85 &heartbeat_device,
86};
87
88static int __init polaris_initialise(void)
89{
90 u16 wcr, bcr_mask;
91
92 printk(KERN_INFO "Configuring Polaris external bus\n");
93
94 /* Configure area 5 with 2 wait states */
95 wcr = ctrl_inw(WCR2);
96 wcr &= (~AREA5_WAIT_CTRL);
97 wcr |= (WAIT_STATES_10 << 10);
98 ctrl_outw(wcr, WCR2);
99
100 /* Configure area 5 for 32-bit access */
101 bcr_mask = ctrl_inw(BCR2);
102 bcr_mask |= 1 << 10;
103 ctrl_outw(bcr_mask, BCR2);
104
105 return platform_add_devices(polaris_devices,
106 ARRAY_SIZE(polaris_devices));
107}
108arch_initcall(polaris_initialise);
109
110static struct ipr_data ipr_irq_table[] = {
111 /* External IRQs */
112 { IRQ0_IRQ, 0, 0, 1, }, /* IRQ0 */
113 { IRQ1_IRQ, 0, 4, 1, }, /* IRQ1 */
114};
115
116static unsigned long ipr_offsets[] = {
117 INTC_IPRC
118};
119
120static struct ipr_desc ipr_irq_desc = {
121 .ipr_offsets = ipr_offsets,
122 .nr_offsets = ARRAY_SIZE(ipr_offsets),
123
124 .ipr_data = ipr_irq_table,
125 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
126 .chip = {
127 .name = "sh7709-ext",
128 },
129};
130
131static void __init init_polaris_irq(void)
132{
133 /* Disable all interrupts */
134 ctrl_outw(0, BCR_ILCRA);
135 ctrl_outw(0, BCR_ILCRB);
136 ctrl_outw(0, BCR_ILCRC);
137 ctrl_outw(0, BCR_ILCRD);
138 ctrl_outw(0, BCR_ILCRE);
139 ctrl_outw(0, BCR_ILCRF);
140 ctrl_outw(0, BCR_ILCRG);
141
142 register_ipr_controller(&ipr_irq_desc);
143}
144
145static struct sh_machine_vector mv_polaris __initmv = {
146 .mv_name = "Polaris",
147 .mv_nr_irqs = 61,
148 .mv_init_irq = init_polaris_irq,
149};
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
index 38a64968d7bf..6f94f17adc46 100644
--- a/arch/sh/boards/board-sh7785lcr.c
+++ b/arch/sh/boards/board-sh7785lcr.c
@@ -229,7 +229,7 @@ static struct resource i2c_resources[] = {
229static struct i2c_pca9564_pf_platform_data i2c_platform_data = { 229static struct i2c_pca9564_pf_platform_data i2c_platform_data = {
230 .gpio = 0, 230 .gpio = 0,
231 .i2c_clock_speed = I2C_PCA_CON_330kHz, 231 .i2c_clock_speed = I2C_PCA_CON_330kHz,
232 .timeout = 100, 232 .timeout = HZ,
233}; 233};
234 234
235static struct platform_device i2c_device = { 235static struct platform_device i2c_device = {
@@ -275,7 +275,18 @@ void __init init_sh7785lcr_IRQ(void)
275 275
276static void sh7785lcr_power_off(void) 276static void sh7785lcr_power_off(void)
277{ 277{
278 ctrl_outb(0x01, P2SEGADDR(PLD_POFCR)); 278 unsigned char *p;
279
280 p = ioremap(PLD_POFCR, PLD_POFCR + 1);
281 if (!p) {
282 printk(KERN_ERR "%s: ioremap error.\n", __func__);
283 return;
284 }
285 *p = 0x01;
286 iounmap(p);
287 set_bl_bit();
288 while (1)
289 cpu_relax();
279} 290}
280 291
281/* Initialize the board */ 292/* Initialize the board */
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c
new file mode 100644
index 000000000000..17036ce20086
--- /dev/null
+++ b/arch/sh/boards/board-urquell.c
@@ -0,0 +1,162 @@
1/*
2 * Renesas Technology Corp. SH7786 Urquell Support.
3 *
4 * Copyright (C) 2008 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/fb.h>
14#include <linux/smc91x.h>
15#include <linux/mtd/physmap.h>
16#include <linux/delay.h>
17#include <linux/gpio.h>
18#include <linux/irq.h>
19#include <mach/urquell.h>
20#include <cpu/sh7786.h>
21#include <asm/heartbeat.h>
22#include <asm/sizes.h>
23
24static struct resource heartbeat_resources[] = {
25 [0] = {
26 .start = BOARDREG(SLEDR),
27 .end = BOARDREG(SLEDR),
28 .flags = IORESOURCE_MEM,
29 },
30};
31
32static struct heartbeat_data heartbeat_data = {
33 .regsize = 16,
34};
35
36static struct platform_device heartbeat_device = {
37 .name = "heartbeat",
38 .id = -1,
39 .dev = {
40 .platform_data = &heartbeat_data,
41 },
42 .num_resources = ARRAY_SIZE(heartbeat_resources),
43 .resource = heartbeat_resources,
44};
45
46static struct smc91x_platdata smc91x_info = {
47 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
48};
49
50static struct resource smc91x_eth_resources[] = {
51 [0] = {
52 .name = "SMC91C111" ,
53 .start = 0x05800300,
54 .end = 0x0580030f,
55 .flags = IORESOURCE_MEM,
56 },
57 [1] = {
58 .start = 11,
59 .flags = IORESOURCE_IRQ,
60 },
61};
62
63static struct platform_device smc91x_eth_device = {
64 .name = "smc91x",
65 .num_resources = ARRAY_SIZE(smc91x_eth_resources),
66 .resource = smc91x_eth_resources,
67 .dev = {
68 .platform_data = &smc91x_info,
69 },
70};
71
72static struct mtd_partition nor_flash_partitions[] = {
73 {
74 .name = "loader",
75 .offset = 0x00000000,
76 .size = SZ_512K,
77 .mask_flags = MTD_WRITEABLE, /* Read-only */
78 },
79 {
80 .name = "bootenv",
81 .offset = MTDPART_OFS_APPEND,
82 .size = SZ_512K,
83 .mask_flags = MTD_WRITEABLE, /* Read-only */
84 },
85 {
86 .name = "kernel",
87 .offset = MTDPART_OFS_APPEND,
88 .size = SZ_4M,
89 },
90 {
91 .name = "data",
92 .offset = MTDPART_OFS_APPEND,
93 .size = MTDPART_SIZ_FULL,
94 },
95};
96
97static struct physmap_flash_data nor_flash_data = {
98 .width = 2,
99 .parts = nor_flash_partitions,
100 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
101};
102
103static struct resource nor_flash_resources[] = {
104 [0] = {
105 .start = NOR_FLASH_ADDR,
106 .end = NOR_FLASH_ADDR + NOR_FLASH_SIZE - 1,
107 .flags = IORESOURCE_MEM,
108 }
109};
110
111static struct platform_device nor_flash_device = {
112 .name = "physmap-flash",
113 .dev = {
114 .platform_data = &nor_flash_data,
115 },
116 .num_resources = ARRAY_SIZE(nor_flash_resources),
117 .resource = nor_flash_resources,
118};
119
120static struct platform_device *urquell_devices[] __initdata = {
121 &heartbeat_device,
122 &smc91x_eth_device,
123 &nor_flash_device,
124};
125
126static int __init urquell_devices_setup(void)
127{
128 /* USB */
129 gpio_request(GPIO_FN_USB_OVC0, NULL);
130 gpio_request(GPIO_FN_USB_PENC0, NULL);
131
132 return platform_add_devices(urquell_devices,
133 ARRAY_SIZE(urquell_devices));
134}
135device_initcall(urquell_devices_setup);
136
137static void urquell_power_off(void)
138{
139 __raw_writew(0xa5a5, UBOARDREG(SRSTR));
140}
141
142static void __init urquell_init_irq(void)
143{
144 plat_irq_setup_pins(IRQ_MODE_IRL3210_MASK);
145}
146
147/* Initialize the board */
148static void __init urquell_setup(char **cmdline_p)
149{
150 printk(KERN_INFO "Renesas Technology Corp. Urquell support.\n");
151
152 pm_power_off = urquell_power_off;
153}
154
155/*
156 * The Machine Vector
157 */
158static struct sh_machine_vector mv_urquell __initmv = {
159 .mv_name = "Urquell",
160 .mv_setup = urquell_setup,
161 .mv_init_irq = urquell_init_irq,
162};
diff --git a/arch/sh/boards/mach-highlander/Kconfig b/arch/sh/boards/mach-highlander/Kconfig
index 08057f62687b..def49cc0a7b9 100644
--- a/arch/sh/boards/mach-highlander/Kconfig
+++ b/arch/sh/boards/mach-highlander/Kconfig
@@ -18,7 +18,7 @@ config SH_R7780MP
18config SH_R7785RP 18config SH_R7785RP
19 bool "R7785RP board support" 19 bool "R7785RP board support"
20 depends on CPU_SUBTYPE_SH7785 20 depends on CPU_SUBTYPE_SH7785
21 select GENERIC_GPIO 21 select ARCH_REQUIRE_GPIOLIB
22 22
23endchoice 23endchoice
24 24
diff --git a/arch/sh/boards/mach-hp6xx/pm_wakeup.S b/arch/sh/boards/mach-hp6xx/pm_wakeup.S
index 44b648cf6f23..4f18d44e0541 100644
--- a/arch/sh/boards/mach-hp6xx/pm_wakeup.S
+++ b/arch/sh/boards/mach-hp6xx/pm_wakeup.S
@@ -10,47 +10,32 @@
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <cpu/mmu_context.h> 11#include <cpu/mmu_context.h>
12 12
13#define k0 r0
14#define k1 r1
15#define k2 r2
16#define k3 r3
17#define k4 r4
18
19/* 13/*
20 * Kernel mode register usage: 14 * Kernel mode register usage:
21 * k0 scratch 15 * k0 scratch
22 * k1 scratch 16 * k1 scratch
23 * k2 scratch (Exception code) 17 * For more details, please have a look at entry.S
24 * k3 scratch (Return address)
25 * k4 scratch
26 * k5 reserved
27 * k6 Global Interrupt Mask (0--15 << 4)
28 * k7 CURRENT_THREAD_INFO (pointer to current thread info)
29 */ 18 */
30 19
20#define k0 r0
21#define k1 r1
22
31ENTRY(wakeup_start) 23ENTRY(wakeup_start)
32! clear STBY bit 24! clear STBY bit
33 mov #-126, k2 25 mov #-126, k1
34 and #127, k0 26 and #127, k0
35 mov.b k0, @k2 27 mov.b k0, @k1
36! enable refresh 28! enable refresh
37 mov.l 5f, k1 29 mov.l 5f, k1
38 mov.w 6f, k0 30 mov.w 6f, k0
39 mov.w k0, @k1 31 mov.w k0, @k1
40! jump to handler 32! jump to handler
41 mov.l 2f, k2
42 mov.l 3f, k3
43 mov.l @k2, k2
44
45 mov.l 4f, k1 33 mov.l 4f, k1
46 jmp @k1 34 jmp @k1
47 nop 35 nop
48 36
49 .align 2 37 .align 2
501: .long EXPEVT 384: .long handle_interrupt
512: .long INTEVT
523: .long ret_from_irq
534: .long handle_exception
545: .long 0xffffff68 395: .long 0xffffff68
556: .word 0x0524 406: .word 0x0524
56 41
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
index 746742bdc014..8f305b36358b 100644
--- a/arch/sh/boards/mach-hp6xx/setup.c
+++ b/arch/sh/boards/mach-hp6xx/setup.c
@@ -115,7 +115,6 @@ static struct sh_machine_vector mv_hp6xx __initmv = {
115 .mv_setup = hp6xx_setup, 115 .mv_setup = hp6xx_setup,
116 /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */ 116 /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
117 .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6, 117 .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
118 .mv_irq_demux = hd64461_irq_demux,
119 /* Enable IRQ0 -> IRQ3 in IRQ_MODE */ 118 /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
120 .mv_init_irq = hp6xx_init_irq, 119 .mv_init_irq = hp6xx_init_irq,
121}; 120};
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 28e56c5809a2..bc35b4cae6b3 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -450,6 +450,14 @@ static struct spi_board_info migor_spi_devices[] = {
450 450
451static int __init migor_devices_setup(void) 451static int __init migor_devices_setup(void)
452{ 452{
453
454#ifdef CONFIG_PM
455 /* Let D11 LED show STATUS0 */
456 gpio_request(GPIO_FN_STATUS0, NULL);
457
458 /* Lit D12 LED show PDSTATUS */
459 gpio_request(GPIO_FN_PDSTATUS, NULL);
460#else
453 /* Lit D11 LED */ 461 /* Lit D11 LED */
454 gpio_request(GPIO_PTJ7, NULL); 462 gpio_request(GPIO_PTJ7, NULL);
455 gpio_direction_output(GPIO_PTJ7, 1); 463 gpio_direction_output(GPIO_PTJ7, 1);
@@ -459,6 +467,7 @@ static int __init migor_devices_setup(void)
459 gpio_request(GPIO_PTJ5, NULL); 467 gpio_request(GPIO_PTJ5, NULL);
460 gpio_direction_output(GPIO_PTJ5, 1); 468 gpio_direction_output(GPIO_PTJ5, 1);
461 gpio_export(GPIO_PTJ5, 0); 469 gpio_export(GPIO_PTJ5, 0);
470#endif
462 471
463 /* SMC91C111 - Enable IRQ0, Setup CS4 for 16-bit fast access */ 472 /* SMC91C111 - Enable IRQ0, Setup CS4 for 16-bit fast access */
464 gpio_request(GPIO_FN_IRQ0, NULL); 473 gpio_request(GPIO_FN_IRQ0, NULL);
diff --git a/arch/sh/boards/mach-rsk/Kconfig b/arch/sh/boards/mach-rsk/Kconfig
index bff095dffc02..aeff3b042205 100644
--- a/arch/sh/boards/mach-rsk/Kconfig
+++ b/arch/sh/boards/mach-rsk/Kconfig
@@ -10,7 +10,7 @@ config SH_RSK7201
10 10
11config SH_RSK7203 11config SH_RSK7203
12 bool "RSK7203" 12 bool "RSK7203"
13 select GENERIC_GPIO 13 select ARCH_REQUIRE_GPIOLIB
14 depends on CPU_SUBTYPE_SH7203 14 depends on CPU_SUBTYPE_SH7203
15 15
16endchoice 16endchoice
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
index 6f926fd2162b..390534a0b35c 100644
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
@@ -63,15 +63,19 @@ static struct platform_device sh7763rdp_nor_flash_device = {
63 }, 63 },
64}; 64};
65 65
66/* SH-Ether */ 66/*
67 * SH-Ether
68 *
69 * SH Ether of SH7763 has multi IRQ handling.
70 * (57,58,59 -> 57)
71 */
67static struct resource sh_eth_resources[] = { 72static struct resource sh_eth_resources[] = {
68 { 73 {
69 .start = 0xFEE00800, /* use eth1 */ 74 .start = 0xFEE00800, /* use eth1 */
70 .end = 0xFEE00F7C - 1, 75 .end = 0xFEE00F7C - 1,
71 .flags = IORESOURCE_MEM, 76 .flags = IORESOURCE_MEM,
72 }, { 77 }, {
73 .start = 58, /* irq number */ 78 .start = 57, /* irq number */
74 .end = 58,
75 .flags = IORESOURCE_IRQ, 79 .flags = IORESOURCE_IRQ,
76 }, 80 },
77}; 81};
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile
index c16ccd4bfa16..95483d161258 100644
--- a/arch/sh/boot/Makefile
+++ b/arch/sh/boot/Makefile
@@ -33,20 +33,24 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
33$(obj)/compressed/vmlinux: FORCE 33$(obj)/compressed/vmlinux: FORCE
34 $(Q)$(MAKE) $(build)=$(obj)/compressed $@ 34 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
35 35
36ifeq ($(CONFIG_32BIT),y) 36KERNEL_MEMORY := 0x00000000
37KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \ 37ifeq ($(CONFIG_PMB_FIXED),y)
38 $$[$(CONFIG_PAGE_OFFSET) + \ 38KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
39 $(CONFIG_ZERO_PAGE_OFFSET)]') 39 $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
40else 40endif
41ifeq ($(CONFIG_29BIT),y)
42KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
43 $$[$(CONFIG_MEMORY_START)]')
44endif
45
41KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \ 46KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
42 $$[$(CONFIG_PAGE_OFFSET) + \ 47 $$[$(CONFIG_PAGE_OFFSET) + \
43 $(CONFIG_MEMORY_START) + \ 48 $(KERNEL_MEMORY) + \
44 $(CONFIG_ZERO_PAGE_OFFSET)]') 49 $(CONFIG_ZERO_PAGE_OFFSET)]')
45endif
46 50
47KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \ 51KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
48 $$[$(CONFIG_PAGE_OFFSET) + \ 52 $$[$(CONFIG_PAGE_OFFSET) + \
49 $(CONFIG_MEMORY_START) + \ 53 $(KERNEL_MEMORY) + \
50 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') 54 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
51 55
52quiet_cmd_uimage = UIMAGE $@ 56quiet_cmd_uimage = UIMAGE $@
diff --git a/arch/sh/cchips/hd6446x/hd64461.c b/arch/sh/cchips/hd6446x/hd64461.c
index 27ceeb948bb1..25ef91061521 100644
--- a/arch/sh/cchips/hd6446x/hd64461.c
+++ b/arch/sh/cchips/hd6446x/hd64461.c
@@ -53,21 +53,22 @@ static struct irq_chip hd64461_irq_chip = {
53 .unmask = hd64461_unmask_irq, 53 .unmask = hd64461_unmask_irq,
54}; 54};
55 55
56int hd64461_irq_demux(int irq) 56static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc)
57{ 57{
58 if (irq == CONFIG_HD64461_IRQ) { 58 unsigned short intv = ctrl_inw(HD64461_NIRR);
59 unsigned short bit; 59 struct irq_desc *ext_desc;
60 unsigned short nirr = inw(HD64461_NIRR); 60 unsigned int ext_irq = HD64461_IRQBASE;
61 unsigned short nimr = inw(HD64461_NIMR); 61
62 int i; 62 intv &= (1 << HD64461_IRQ_NUM) - 1;
63 63
64 nirr &= ~nimr; 64 while (intv) {
65 for (bit = 1, i = 0; i < 16; bit <<= 1, i++) 65 if (intv & 1) {
66 if (nirr & bit) 66 ext_desc = irq_desc + ext_irq;
67 break; 67 handle_level_irq(ext_irq, ext_desc);
68 irq = HD64461_IRQBASE + i; 68 }
69 intv >>= 1;
70 ext_irq++;
69 } 71 }
70 return irq;
71} 72}
72 73
73int __init setup_hd64461(void) 74int __init setup_hd64461(void)
@@ -93,6 +94,9 @@ int __init setup_hd64461(void)
93 set_irq_chip_and_handler(i, &hd64461_irq_chip, 94 set_irq_chip_and_handler(i, &hd64461_irq_chip,
94 handle_level_irq); 95 handle_level_irq);
95 96
97 set_irq_chained_handler(CONFIG_HD64461_IRQ, hd64461_irq_demux);
98 set_irq_type(CONFIG_HD64461_IRQ, IRQ_TYPE_LEVEL_LOW);
99
96#ifdef CONFIG_HD64461_ENABLER 100#ifdef CONFIG_HD64461_ENABLER
97 printk(KERN_INFO "HD64461: enabling PCMCIA devices\n"); 101 printk(KERN_INFO "HD64461: enabling PCMCIA devices\n");
98 __raw_writeb(0x4c, HD64461_PCC1CSCIER); 102 __raw_writeb(0x4c, HD64461_PCC1CSCIER);
diff --git a/arch/sh/configs/espt_defconfig b/arch/sh/configs/espt_defconfig
new file mode 100644
index 000000000000..873ec42c6e69
--- /dev/null
+++ b/arch/sh/configs/espt_defconfig
@@ -0,0 +1,1190 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc7
4# Tue Mar 17 13:25:58 2009
5#
6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y
8CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_BUG=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
15CONFIG_GENERIC_IRQ_PROBE=y
16# CONFIG_GENERIC_GPIO is not set
17CONFIG_GENERIC_TIME=y
18CONFIG_GENERIC_CLOCKEVENTS=y
19# CONFIG_ARCH_SUSPEND_POSSIBLE is not set
20# CONFIG_ARCH_HIBERNATION_POSSIBLE is not set
21CONFIG_STACKTRACE_SUPPORT=y
22CONFIG_LOCKDEP_SUPPORT=y
23CONFIG_HAVE_LATENCYTOP_SUPPORT=y
24# CONFIG_ARCH_HAS_ILOG2_U32 is not set
25# CONFIG_ARCH_HAS_ILOG2_U64 is not set
26CONFIG_ARCH_NO_VIRT_TO_BUS=y
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_INIT_ENV_ARG_LIMIT=32
35CONFIG_LOCALVERSION=""
36CONFIG_LOCALVERSION_AUTO=y
37CONFIG_SWAP=y
38CONFIG_SYSVIPC=y
39CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_POSIX_MQUEUE is not set
41# CONFIG_BSD_PROCESS_ACCT is not set
42# CONFIG_TASKSTATS is not set
43# CONFIG_AUDIT is not set
44
45#
46# RCU Subsystem
47#
48CONFIG_CLASSIC_RCU=y
49# CONFIG_TREE_RCU is not set
50# CONFIG_PREEMPT_RCU is not set
51# CONFIG_TREE_RCU_TRACE is not set
52# CONFIG_PREEMPT_RCU_TRACE is not set
53CONFIG_IKCONFIG=y
54CONFIG_IKCONFIG_PROC=y
55CONFIG_LOG_BUF_SHIFT=14
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
65CONFIG_NAMESPACES=y
66CONFIG_UTS_NS=y
67CONFIG_IPC_NS=y
68# CONFIG_USER_NS is not set
69# CONFIG_PID_NS is not set
70# CONFIG_NET_NS is not set
71# CONFIG_BLK_DEV_INITRD is not set
72CONFIG_CC_OPTIMIZE_FOR_SIZE=y
73CONFIG_SYSCTL=y
74CONFIG_EMBEDDED=y
75CONFIG_UID16=y
76# CONFIG_SYSCTL_SYSCALL is not set
77CONFIG_KALLSYMS=y
78# CONFIG_KALLSYMS_EXTRA_PASS is not set
79CONFIG_HOTPLUG=y
80CONFIG_PRINTK=y
81CONFIG_BUG=y
82CONFIG_ELF_CORE=y
83CONFIG_COMPAT_BRK=y
84CONFIG_BASE_FULL=y
85CONFIG_FUTEX=y
86CONFIG_ANON_INODES=y
87CONFIG_EPOLL=y
88CONFIG_SIGNALFD=y
89CONFIG_TIMERFD=y
90CONFIG_EVENTFD=y
91CONFIG_SHMEM=y
92CONFIG_AIO=y
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_SLAB=y
95# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set
97CONFIG_PROFILING=y
98CONFIG_TRACEPOINTS=y
99# CONFIG_MARKERS is not set
100CONFIG_OPROFILE=y
101CONFIG_HAVE_OPROFILE=y
102# CONFIG_KPROBES is not set
103CONFIG_HAVE_IOREMAP_PROT=y
104CONFIG_HAVE_KPROBES=y
105CONFIG_HAVE_KRETPROBES=y
106CONFIG_HAVE_ARCH_TRACEHOOK=y
107CONFIG_HAVE_CLK=y
108CONFIG_HAVE_GENERIC_DMA_COHERENT=y
109CONFIG_SLABINFO=y
110CONFIG_RT_MUTEXES=y
111CONFIG_BASE_SMALL=0
112CONFIG_MODULES=y
113# CONFIG_MODULE_FORCE_LOAD is not set
114# CONFIG_MODULE_UNLOAD is not set
115# CONFIG_MODVERSIONS is not set
116# CONFIG_MODULE_SRCVERSION_ALL is not set
117CONFIG_BLOCK=y
118# CONFIG_LBD is not set
119# CONFIG_BLK_DEV_IO_TRACE is not set
120# CONFIG_BLK_DEV_BSG is not set
121# CONFIG_BLK_DEV_INTEGRITY is not set
122
123#
124# IO Schedulers
125#
126CONFIG_IOSCHED_NOOP=y
127CONFIG_IOSCHED_AS=y
128CONFIG_IOSCHED_DEADLINE=y
129CONFIG_IOSCHED_CFQ=y
130CONFIG_DEFAULT_AS=y
131# CONFIG_DEFAULT_DEADLINE is not set
132# CONFIG_DEFAULT_CFQ is not set
133# CONFIG_DEFAULT_NOOP is not set
134CONFIG_DEFAULT_IOSCHED="anticipatory"
135# CONFIG_FREEZER is not set
136
137#
138# System type
139#
140CONFIG_CPU_SH4=y
141CONFIG_CPU_SH4A=y
142# CONFIG_CPU_SUBTYPE_SH7619 is not set
143# CONFIG_CPU_SUBTYPE_SH7201 is not set
144# CONFIG_CPU_SUBTYPE_SH7203 is not set
145# CONFIG_CPU_SUBTYPE_SH7206 is not set
146# CONFIG_CPU_SUBTYPE_SH7263 is not set
147# CONFIG_CPU_SUBTYPE_MXG is not set
148# CONFIG_CPU_SUBTYPE_SH7705 is not set
149# CONFIG_CPU_SUBTYPE_SH7706 is not set
150# CONFIG_CPU_SUBTYPE_SH7707 is not set
151# CONFIG_CPU_SUBTYPE_SH7708 is not set
152# CONFIG_CPU_SUBTYPE_SH7709 is not set
153# CONFIG_CPU_SUBTYPE_SH7710 is not set
154# CONFIG_CPU_SUBTYPE_SH7712 is not set
155# CONFIG_CPU_SUBTYPE_SH7720 is not set
156# CONFIG_CPU_SUBTYPE_SH7721 is not set
157# CONFIG_CPU_SUBTYPE_SH7750 is not set
158# CONFIG_CPU_SUBTYPE_SH7091 is not set
159# CONFIG_CPU_SUBTYPE_SH7750R is not set
160# CONFIG_CPU_SUBTYPE_SH7750S is not set
161# CONFIG_CPU_SUBTYPE_SH7751 is not set
162# CONFIG_CPU_SUBTYPE_SH7751R is not set
163# CONFIG_CPU_SUBTYPE_SH7760 is not set
164# CONFIG_CPU_SUBTYPE_SH4_202 is not set
165# CONFIG_CPU_SUBTYPE_SH7723 is not set
166CONFIG_CPU_SUBTYPE_SH7763=y
167# CONFIG_CPU_SUBTYPE_SH7770 is not set
168# CONFIG_CPU_SUBTYPE_SH7780 is not set
169# CONFIG_CPU_SUBTYPE_SH7785 is not set
170# CONFIG_CPU_SUBTYPE_SH7786 is not set
171# CONFIG_CPU_SUBTYPE_SHX3 is not set
172# CONFIG_CPU_SUBTYPE_SH7343 is not set
173# CONFIG_CPU_SUBTYPE_SH7722 is not set
174# CONFIG_CPU_SUBTYPE_SH7366 is not set
175# CONFIG_CPU_SUBTYPE_SH5_101 is not set
176# CONFIG_CPU_SUBTYPE_SH5_103 is not set
177
178#
179# Memory management options
180#
181CONFIG_QUICKLIST=y
182CONFIG_MMU=y
183CONFIG_PAGE_OFFSET=0x80000000
184CONFIG_MEMORY_START=0x0c000000
185CONFIG_MEMORY_SIZE=0x04000000
186CONFIG_29BIT=y
187CONFIG_VSYSCALL=y
188CONFIG_ARCH_FLATMEM_ENABLE=y
189CONFIG_ARCH_SPARSEMEM_ENABLE=y
190CONFIG_ARCH_SPARSEMEM_DEFAULT=y
191CONFIG_MAX_ACTIVE_REGIONS=1
192CONFIG_ARCH_POPULATES_NODE_MAP=y
193CONFIG_ARCH_SELECT_MEMORY_MODEL=y
194CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
195CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
196CONFIG_PAGE_SIZE_4KB=y
197# CONFIG_PAGE_SIZE_8KB is not set
198# CONFIG_PAGE_SIZE_16KB is not set
199# CONFIG_PAGE_SIZE_64KB is not set
200CONFIG_ENTRY_OFFSET=0x00001000
201CONFIG_SELECT_MEMORY_MODEL=y
202# CONFIG_FLATMEM_MANUAL is not set
203# CONFIG_DISCONTIGMEM_MANUAL is not set
204CONFIG_SPARSEMEM_MANUAL=y
205CONFIG_SPARSEMEM=y
206CONFIG_HAVE_MEMORY_PRESENT=y
207CONFIG_SPARSEMEM_STATIC=y
208# CONFIG_MEMORY_HOTPLUG is not set
209CONFIG_PAGEFLAGS_EXTENDED=y
210CONFIG_SPLIT_PTLOCK_CPUS=4
211CONFIG_MIGRATION=y
212# CONFIG_PHYS_ADDR_T_64BIT is not set
213CONFIG_ZONE_DMA_FLAG=0
214CONFIG_NR_QUICK=2
215CONFIG_UNEVICTABLE_LRU=y
216
217#
218# Cache configuration
219#
220# CONFIG_SH_DIRECT_MAPPED is not set
221CONFIG_CACHE_WRITEBACK=y
222# CONFIG_CACHE_WRITETHROUGH is not set
223# CONFIG_CACHE_OFF is not set
224
225#
226# Processor features
227#
228CONFIG_CPU_LITTLE_ENDIAN=y
229# CONFIG_CPU_BIG_ENDIAN is not set
230CONFIG_SH_FPU=y
231# CONFIG_SH_STORE_QUEUES is not set
232CONFIG_CPU_HAS_INTEVT=y
233CONFIG_CPU_HAS_SR_RB=y
234CONFIG_CPU_HAS_FPU=y
235
236#
237# Board support
238#
239# CONFIG_SH_SH7763RDP is not set
240CONFIG_SH_ESPT=y
241
242#
243# Timer and clock configuration
244#
245CONFIG_SH_TMU=y
246CONFIG_SH_TIMER_IRQ=28
247CONFIG_SH_PCLK_FREQ=66666666
248# CONFIG_NO_HZ is not set
249# CONFIG_HIGH_RES_TIMERS is not set
250CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
251
252#
253# CPU Frequency scaling
254#
255# CONFIG_CPU_FREQ is not set
256
257#
258# DMA support
259#
260# CONFIG_SH_DMA is not set
261
262#
263# Companion Chips
264#
265
266#
267# Additional SuperH Device Drivers
268#
269# CONFIG_HEARTBEAT is not set
270# CONFIG_PUSH_SWITCH is not set
271
272#
273# Kernel features
274#
275# CONFIG_HZ_100 is not set
276CONFIG_HZ_250=y
277# CONFIG_HZ_300 is not set
278# CONFIG_HZ_1000 is not set
279CONFIG_HZ=250
280# CONFIG_SCHED_HRTICK is not set
281# CONFIG_KEXEC is not set
282# CONFIG_CRASH_DUMP is not set
283CONFIG_SECCOMP=y
284CONFIG_PREEMPT_NONE=y
285# CONFIG_PREEMPT_VOLUNTARY is not set
286# CONFIG_PREEMPT is not set
287CONFIG_GUSA=y
288
289#
290# Boot options
291#
292CONFIG_ZERO_PAGE_OFFSET=0x00001000
293CONFIG_BOOT_LINK_OFFSET=0x00800000
294CONFIG_CMDLINE_BOOL=y
295CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/nfs ip=bootp"
296
297#
298# Bus options
299#
300# CONFIG_ARCH_SUPPORTS_MSI is not set
301# CONFIG_PCCARD is not set
302
303#
304# Executable file formats
305#
306CONFIG_BINFMT_ELF=y
307# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
308# CONFIG_HAVE_AOUT is not set
309# CONFIG_BINFMT_MISC is not set
310
311#
312# Power management options (EXPERIMENTAL)
313#
314# CONFIG_PM is not set
315# CONFIG_CPU_IDLE is not set
316CONFIG_NET=y
317
318#
319# Networking options
320#
321CONFIG_COMPAT_NET_DEV_OPS=y
322CONFIG_PACKET=y
323# CONFIG_PACKET_MMAP is not set
324CONFIG_UNIX=y
325CONFIG_XFRM=y
326# CONFIG_XFRM_USER is not set
327# CONFIG_XFRM_SUB_POLICY is not set
328# CONFIG_XFRM_MIGRATE is not set
329# CONFIG_XFRM_STATISTICS is not set
330# CONFIG_NET_KEY is not set
331CONFIG_INET=y
332# CONFIG_IP_MULTICAST is not set
333# CONFIG_IP_ADVANCED_ROUTER is not set
334CONFIG_IP_FIB_HASH=y
335CONFIG_IP_PNP=y
336CONFIG_IP_PNP_DHCP=y
337CONFIG_IP_PNP_BOOTP=y
338# CONFIG_IP_PNP_RARP is not set
339# CONFIG_NET_IPIP is not set
340# CONFIG_NET_IPGRE is not set
341# CONFIG_ARPD is not set
342# CONFIG_SYN_COOKIES is not set
343# CONFIG_INET_AH is not set
344# CONFIG_INET_ESP is not set
345# CONFIG_INET_IPCOMP is not set
346# CONFIG_INET_XFRM_TUNNEL is not set
347# CONFIG_INET_TUNNEL is not set
348CONFIG_INET_XFRM_MODE_TRANSPORT=y
349CONFIG_INET_XFRM_MODE_TUNNEL=y
350CONFIG_INET_XFRM_MODE_BEET=y
351# CONFIG_INET_LRO is not set
352CONFIG_INET_DIAG=y
353CONFIG_INET_TCP_DIAG=y
354# CONFIG_TCP_CONG_ADVANCED is not set
355CONFIG_TCP_CONG_CUBIC=y
356CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_TCP_MD5SIG is not set
358# CONFIG_IPV6 is not set
359# CONFIG_NETWORK_SECMARK is not set
360# CONFIG_NETFILTER is not set
361# CONFIG_IP_DCCP is not set
362# CONFIG_IP_SCTP is not set
363# CONFIG_TIPC is not set
364# CONFIG_ATM is not set
365# CONFIG_BRIDGE is not set
366# CONFIG_NET_DSA is not set
367# CONFIG_VLAN_8021Q is not set
368# CONFIG_DECNET is not set
369# CONFIG_LLC2 is not set
370# CONFIG_IPX is not set
371# CONFIG_ATALK is not set
372# CONFIG_X25 is not set
373# CONFIG_LAPB is not set
374# CONFIG_ECONET is not set
375# CONFIG_WAN_ROUTER is not set
376# CONFIG_NET_SCHED is not set
377# CONFIG_DCB is not set
378
379#
380# Network testing
381#
382# CONFIG_NET_PKTGEN is not set
383# CONFIG_HAMRADIO is not set
384# CONFIG_CAN is not set
385# CONFIG_IRDA is not set
386# CONFIG_BT is not set
387# CONFIG_AF_RXRPC is not set
388# CONFIG_PHONET is not set
389# CONFIG_WIRELESS is not set
390# CONFIG_WIMAX is not set
391# CONFIG_RFKILL is not set
392# CONFIG_NET_9P is not set
393
394#
395# Device Drivers
396#
397
398#
399# Generic Driver Options
400#
401CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
402CONFIG_STANDALONE=y
403CONFIG_PREVENT_FIRMWARE_BUILD=y
404CONFIG_FW_LOADER=y
405CONFIG_FIRMWARE_IN_KERNEL=y
406CONFIG_EXTRA_FIRMWARE=""
407# CONFIG_SYS_HYPERVISOR is not set
408# CONFIG_CONNECTOR is not set
409CONFIG_MTD=y
410# CONFIG_MTD_DEBUG is not set
411# CONFIG_MTD_CONCAT is not set
412CONFIG_MTD_PARTITIONS=y
413# CONFIG_MTD_TESTS is not set
414# CONFIG_MTD_REDBOOT_PARTS is not set
415CONFIG_MTD_CMDLINE_PARTS=y
416# CONFIG_MTD_AR7_PARTS is not set
417
418#
419# User Modules And Translation Layers
420#
421CONFIG_MTD_CHAR=y
422CONFIG_MTD_BLKDEVS=y
423CONFIG_MTD_BLOCK=y
424# CONFIG_FTL is not set
425# CONFIG_NFTL is not set
426# CONFIG_INFTL is not set
427# CONFIG_RFD_FTL is not set
428# CONFIG_SSFDC is not set
429# CONFIG_MTD_OOPS is not set
430
431#
432# RAM/ROM/Flash chip drivers
433#
434CONFIG_MTD_CFI=y
435CONFIG_MTD_JEDECPROBE=y
436CONFIG_MTD_GEN_PROBE=y
437CONFIG_MTD_CFI_ADV_OPTIONS=y
438CONFIG_MTD_CFI_NOSWAP=y
439# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
440# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
441CONFIG_MTD_CFI_GEOMETRY=y
442# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
443CONFIG_MTD_MAP_BANK_WIDTH_2=y
444# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
445# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
446# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
447# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
448CONFIG_MTD_CFI_I1=y
449CONFIG_MTD_CFI_I2=y
450# CONFIG_MTD_CFI_I4 is not set
451# CONFIG_MTD_CFI_I8 is not set
452# CONFIG_MTD_OTP is not set
453# CONFIG_MTD_CFI_INTELEXT is not set
454CONFIG_MTD_CFI_AMDSTD=y
455# CONFIG_MTD_CFI_STAA is not set
456CONFIG_MTD_CFI_UTIL=y
457# CONFIG_MTD_RAM is not set
458# CONFIG_MTD_ROM is not set
459# CONFIG_MTD_ABSENT is not set
460
461#
462# Mapping drivers for chip access
463#
464CONFIG_MTD_COMPLEX_MAPPINGS=y
465CONFIG_MTD_PHYSMAP=y
466# CONFIG_MTD_PHYSMAP_COMPAT is not set
467# CONFIG_MTD_PLATRAM is not set
468
469#
470# Self-contained MTD device drivers
471#
472# CONFIG_MTD_SLRAM is not set
473# CONFIG_MTD_PHRAM is not set
474# CONFIG_MTD_MTDRAM is not set
475# CONFIG_MTD_BLOCK2MTD is not set
476
477#
478# Disk-On-Chip Device Drivers
479#
480# CONFIG_MTD_DOC2000 is not set
481# CONFIG_MTD_DOC2001 is not set
482# CONFIG_MTD_DOC2001PLUS is not set
483# CONFIG_MTD_NAND is not set
484# CONFIG_MTD_ONENAND is not set
485
486#
487# LPDDR flash memory drivers
488#
489# CONFIG_MTD_LPDDR is not set
490
491#
492# UBI - Unsorted block images
493#
494# CONFIG_MTD_UBI is not set
495# CONFIG_PARPORT is not set
496CONFIG_BLK_DEV=y
497# CONFIG_BLK_DEV_COW_COMMON is not set
498# CONFIG_BLK_DEV_LOOP is not set
499# CONFIG_BLK_DEV_NBD is not set
500# CONFIG_BLK_DEV_UB is not set
501# CONFIG_BLK_DEV_RAM is not set
502# CONFIG_CDROM_PKTCDVD is not set
503# CONFIG_ATA_OVER_ETH is not set
504# CONFIG_BLK_DEV_HD is not set
505# CONFIG_MISC_DEVICES is not set
506CONFIG_HAVE_IDE=y
507# CONFIG_IDE is not set
508
509#
510# SCSI device support
511#
512# CONFIG_RAID_ATTRS is not set
513CONFIG_SCSI=y
514CONFIG_SCSI_DMA=y
515# CONFIG_SCSI_TGT is not set
516# CONFIG_SCSI_NETLINK is not set
517CONFIG_SCSI_PROC_FS=y
518
519#
520# SCSI support type (disk, tape, CD-ROM)
521#
522CONFIG_BLK_DEV_SD=y
523# CONFIG_CHR_DEV_ST is not set
524# CONFIG_CHR_DEV_OSST is not set
525# CONFIG_BLK_DEV_SR is not set
526# CONFIG_CHR_DEV_SG is not set
527# CONFIG_CHR_DEV_SCH is not set
528
529#
530# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
531#
532# CONFIG_SCSI_MULTI_LUN is not set
533# CONFIG_SCSI_CONSTANTS is not set
534# CONFIG_SCSI_LOGGING is not set
535# CONFIG_SCSI_SCAN_ASYNC is not set
536CONFIG_SCSI_WAIT_SCAN=m
537
538#
539# SCSI Transports
540#
541# CONFIG_SCSI_SPI_ATTRS is not set
542# CONFIG_SCSI_FC_ATTRS is not set
543# CONFIG_SCSI_ISCSI_ATTRS is not set
544# CONFIG_SCSI_SAS_LIBSAS is not set
545# CONFIG_SCSI_SRP_ATTRS is not set
546CONFIG_SCSI_LOWLEVEL=y
547# CONFIG_ISCSI_TCP is not set
548# CONFIG_LIBFC is not set
549# CONFIG_SCSI_DEBUG is not set
550# CONFIG_SCSI_DH is not set
551# CONFIG_ATA is not set
552# CONFIG_MD is not set
553CONFIG_NETDEVICES=y
554# CONFIG_DUMMY is not set
555# CONFIG_BONDING is not set
556# CONFIG_MACVLAN is not set
557# CONFIG_EQUALIZER is not set
558# CONFIG_TUN is not set
559# CONFIG_VETH is not set
560CONFIG_PHYLIB=y
561
562#
563# MII PHY device drivers
564#
565# CONFIG_MARVELL_PHY is not set
566# CONFIG_DAVICOM_PHY is not set
567# CONFIG_QSEMI_PHY is not set
568# CONFIG_LXT_PHY is not set
569# CONFIG_CICADA_PHY is not set
570# CONFIG_VITESSE_PHY is not set
571# CONFIG_SMSC_PHY is not set
572# CONFIG_BROADCOM_PHY is not set
573# CONFIG_ICPLUS_PHY is not set
574# CONFIG_REALTEK_PHY is not set
575# CONFIG_NATIONAL_PHY is not set
576# CONFIG_STE10XP is not set
577# CONFIG_LSI_ET1011C_PHY is not set
578# CONFIG_FIXED_PHY is not set
579CONFIG_MDIO_BITBANG=y
580CONFIG_NET_ETHERNET=y
581CONFIG_MII=y
582# CONFIG_AX88796 is not set
583# CONFIG_STNIC is not set
584CONFIG_SH_ETH=y
585# CONFIG_SMC91X is not set
586# CONFIG_SMC911X is not set
587# CONFIG_SMSC911X is not set
588# CONFIG_IBM_NEW_EMAC_ZMII is not set
589# CONFIG_IBM_NEW_EMAC_RGMII is not set
590# CONFIG_IBM_NEW_EMAC_TAH is not set
591# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
592# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
593# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
594# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
595# CONFIG_B44 is not set
596# CONFIG_NETDEV_1000 is not set
597# CONFIG_NETDEV_10000 is not set
598
599#
600# Wireless LAN
601#
602# CONFIG_WLAN_PRE80211 is not set
603# CONFIG_WLAN_80211 is not set
604# CONFIG_IWLWIFI_LEDS is not set
605
606#
607# Enable WiMAX (Networking options) to see the WiMAX drivers
608#
609
610#
611# USB Network Adapters
612#
613# CONFIG_USB_CATC is not set
614# CONFIG_USB_KAWETH is not set
615# CONFIG_USB_PEGASUS is not set
616# CONFIG_USB_RTL8150 is not set
617# CONFIG_USB_USBNET is not set
618# CONFIG_WAN is not set
619# CONFIG_PPP is not set
620# CONFIG_SLIP is not set
621# CONFIG_NETCONSOLE is not set
622# CONFIG_NETPOLL is not set
623# CONFIG_NET_POLL_CONTROLLER is not set
624# CONFIG_ISDN is not set
625# CONFIG_PHONE is not set
626
627#
628# Input device support
629#
630CONFIG_INPUT=y
631# CONFIG_INPUT_FF_MEMLESS is not set
632# CONFIG_INPUT_POLLDEV is not set
633
634#
635# Userland interfaces
636#
637# CONFIG_INPUT_MOUSEDEV is not set
638# CONFIG_INPUT_JOYDEV is not set
639# CONFIG_INPUT_EVDEV is not set
640# CONFIG_INPUT_EVBUG is not set
641
642#
643# Input Device Drivers
644#
645# CONFIG_INPUT_KEYBOARD is not set
646# CONFIG_INPUT_MOUSE is not set
647# CONFIG_INPUT_JOYSTICK is not set
648# CONFIG_INPUT_TABLET is not set
649# CONFIG_INPUT_TOUCHSCREEN is not set
650# CONFIG_INPUT_MISC is not set
651
652#
653# Hardware I/O ports
654#
655# CONFIG_SERIO is not set
656# CONFIG_GAMEPORT is not set
657
658#
659# Character devices
660#
661CONFIG_VT=y
662CONFIG_CONSOLE_TRANSLATIONS=y
663CONFIG_VT_CONSOLE=y
664CONFIG_HW_CONSOLE=y
665# CONFIG_VT_HW_CONSOLE_BINDING is not set
666CONFIG_DEVKMEM=y
667# CONFIG_SERIAL_NONSTANDARD is not set
668
669#
670# Serial drivers
671#
672# CONFIG_SERIAL_8250 is not set
673
674#
675# Non-8250 serial port support
676#
677CONFIG_SERIAL_SH_SCI=y
678CONFIG_SERIAL_SH_SCI_NR_UARTS=3
679CONFIG_SERIAL_SH_SCI_CONSOLE=y
680CONFIG_SERIAL_CORE=y
681CONFIG_SERIAL_CORE_CONSOLE=y
682CONFIG_UNIX98_PTYS=y
683# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
684CONFIG_LEGACY_PTYS=y
685CONFIG_LEGACY_PTY_COUNT=256
686# CONFIG_IPMI_HANDLER is not set
687CONFIG_HW_RANDOM=y
688# CONFIG_R3964 is not set
689# CONFIG_RAW_DRIVER is not set
690# CONFIG_TCG_TPM is not set
691# CONFIG_I2C is not set
692# CONFIG_SPI is not set
693# CONFIG_W1 is not set
694# CONFIG_POWER_SUPPLY is not set
695# CONFIG_HWMON is not set
696# CONFIG_THERMAL is not set
697# CONFIG_THERMAL_HWMON is not set
698# CONFIG_WATCHDOG is not set
699CONFIG_SSB_POSSIBLE=y
700
701#
702# Sonics Silicon Backplane
703#
704# CONFIG_SSB is not set
705
706#
707# Multifunction device drivers
708#
709# CONFIG_MFD_CORE is not set
710# CONFIG_MFD_SM501 is not set
711# CONFIG_HTC_PASIC3 is not set
712# CONFIG_MFD_TMIO is not set
713# CONFIG_REGULATOR is not set
714
715#
716# Multimedia devices
717#
718
719#
720# Multimedia core support
721#
722# CONFIG_VIDEO_DEV is not set
723# CONFIG_DVB_CORE is not set
724# CONFIG_VIDEO_MEDIA is not set
725
726#
727# Multimedia drivers
728#
729# CONFIG_DAB is not set
730
731#
732# Graphics support
733#
734# CONFIG_VGASTATE is not set
735# CONFIG_VIDEO_OUTPUT_CONTROL is not set
736CONFIG_FB=y
737# CONFIG_FIRMWARE_EDID is not set
738# CONFIG_FB_DDC is not set
739# CONFIG_FB_BOOT_VESA_SUPPORT is not set
740CONFIG_FB_CFB_FILLRECT=y
741CONFIG_FB_CFB_COPYAREA=y
742CONFIG_FB_CFB_IMAGEBLIT=y
743# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
744# CONFIG_FB_SYS_FILLRECT is not set
745# CONFIG_FB_SYS_COPYAREA is not set
746# CONFIG_FB_SYS_IMAGEBLIT is not set
747CONFIG_FB_FOREIGN_ENDIAN=y
748CONFIG_FB_BOTH_ENDIAN=y
749# CONFIG_FB_BIG_ENDIAN is not set
750# CONFIG_FB_LITTLE_ENDIAN is not set
751# CONFIG_FB_SYS_FOPS is not set
752# CONFIG_FB_SVGALIB is not set
753# CONFIG_FB_MACMODES is not set
754# CONFIG_FB_BACKLIGHT is not set
755# CONFIG_FB_MODE_HELPERS is not set
756# CONFIG_FB_TILEBLITTING is not set
757
758#
759# Frame buffer hardware drivers
760#
761# CONFIG_FB_S1D13XXX is not set
762# CONFIG_FB_SH_MOBILE_LCDC is not set
763CONFIG_FB_SH7760=y
764# CONFIG_FB_VIRTUAL is not set
765# CONFIG_FB_METRONOME is not set
766# CONFIG_FB_MB862XX is not set
767# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
768
769#
770# Display device support
771#
772# CONFIG_DISPLAY_SUPPORT is not set
773
774#
775# Console display driver support
776#
777CONFIG_DUMMY_CONSOLE=y
778CONFIG_FRAMEBUFFER_CONSOLE=y
779# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
780# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
781# CONFIG_FONTS is not set
782CONFIG_FONT_8x8=y
783CONFIG_FONT_8x16=y
784CONFIG_LOGO=y
785CONFIG_LOGO_LINUX_MONO=y
786CONFIG_LOGO_LINUX_VGA16=y
787CONFIG_LOGO_LINUX_CLUT224=y
788CONFIG_LOGO_SUPERH_MONO=y
789CONFIG_LOGO_SUPERH_VGA16=y
790CONFIG_LOGO_SUPERH_CLUT224=y
791# CONFIG_SOUND is not set
792# CONFIG_HID_SUPPORT is not set
793CONFIG_USB_SUPPORT=y
794CONFIG_USB_ARCH_HAS_HCD=y
795CONFIG_USB_ARCH_HAS_OHCI=y
796# CONFIG_USB_ARCH_HAS_EHCI is not set
797CONFIG_USB=y
798# CONFIG_USB_DEBUG is not set
799# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
800
801#
802# Miscellaneous USB options
803#
804# CONFIG_USB_DEVICEFS is not set
805CONFIG_USB_DEVICE_CLASS=y
806# CONFIG_USB_DYNAMIC_MINORS is not set
807# CONFIG_USB_OTG is not set
808# CONFIG_USB_OTG_WHITELIST is not set
809# CONFIG_USB_OTG_BLACKLIST_HUB is not set
810CONFIG_USB_MON=y
811# CONFIG_USB_WUSB is not set
812# CONFIG_USB_WUSB_CBAF is not set
813
814#
815# USB Host Controller Drivers
816#
817# CONFIG_USB_C67X00_HCD is not set
818# CONFIG_USB_OXU210HP_HCD is not set
819# CONFIG_USB_ISP116X_HCD is not set
820CONFIG_USB_OHCI_HCD=y
821# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
822# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
823CONFIG_USB_OHCI_LITTLE_ENDIAN=y
824# CONFIG_USB_SL811_HCD is not set
825# CONFIG_USB_R8A66597_HCD is not set
826# CONFIG_USB_HWA_HCD is not set
827
828#
829# USB Device Class drivers
830#
831# CONFIG_USB_ACM is not set
832# CONFIG_USB_PRINTER is not set
833# CONFIG_USB_WDM is not set
834# CONFIG_USB_TMC is not set
835
836#
837# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
838#
839
840#
841# see USB_STORAGE Help for more information
842#
843CONFIG_USB_STORAGE=y
844# CONFIG_USB_STORAGE_DEBUG is not set
845# CONFIG_USB_STORAGE_DATAFAB is not set
846# CONFIG_USB_STORAGE_FREECOM is not set
847# CONFIG_USB_STORAGE_ISD200 is not set
848# CONFIG_USB_STORAGE_USBAT is not set
849# CONFIG_USB_STORAGE_SDDR09 is not set
850# CONFIG_USB_STORAGE_SDDR55 is not set
851# CONFIG_USB_STORAGE_JUMPSHOT is not set
852# CONFIG_USB_STORAGE_ALAUDA is not set
853# CONFIG_USB_STORAGE_ONETOUCH is not set
854# CONFIG_USB_STORAGE_KARMA is not set
855# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
856# CONFIG_USB_LIBUSUAL is not set
857
858#
859# USB Imaging devices
860#
861# CONFIG_USB_MDC800 is not set
862# CONFIG_USB_MICROTEK is not set
863
864#
865# USB port drivers
866#
867# CONFIG_USB_SERIAL is not set
868
869#
870# USB Miscellaneous drivers
871#
872# CONFIG_USB_EMI62 is not set
873# CONFIG_USB_EMI26 is not set
874# CONFIG_USB_ADUTUX is not set
875# CONFIG_USB_SEVSEG is not set
876# CONFIG_USB_RIO500 is not set
877# CONFIG_USB_LEGOTOWER is not set
878# CONFIG_USB_LCD is not set
879# CONFIG_USB_BERRY_CHARGE is not set
880# CONFIG_USB_LED is not set
881# CONFIG_USB_CYPRESS_CY7C63 is not set
882# CONFIG_USB_CYTHERM is not set
883# CONFIG_USB_PHIDGET is not set
884# CONFIG_USB_IDMOUSE is not set
885# CONFIG_USB_FTDI_ELAN is not set
886# CONFIG_USB_APPLEDISPLAY is not set
887# CONFIG_USB_LD is not set
888# CONFIG_USB_TRANCEVIBRATOR is not set
889# CONFIG_USB_IOWARRIOR is not set
890# CONFIG_USB_ISIGHTFW is not set
891# CONFIG_USB_VST is not set
892# CONFIG_USB_GADGET is not set
893
894#
895# OTG and related infrastructure
896#
897# CONFIG_MMC is not set
898# CONFIG_MEMSTICK is not set
899# CONFIG_NEW_LEDS is not set
900# CONFIG_ACCESSIBILITY is not set
901# CONFIG_RTC_CLASS is not set
902# CONFIG_DMADEVICES is not set
903# CONFIG_UIO is not set
904# CONFIG_STAGING is not set
905
906#
907# File systems
908#
909CONFIG_EXT2_FS=y
910# CONFIG_EXT2_FS_XATTR is not set
911# CONFIG_EXT2_FS_XIP is not set
912CONFIG_EXT3_FS=y
913CONFIG_EXT3_FS_XATTR=y
914# CONFIG_EXT3_FS_POSIX_ACL is not set
915# CONFIG_EXT3_FS_SECURITY is not set
916# CONFIG_EXT4_FS is not set
917CONFIG_JBD=y
918# CONFIG_JBD_DEBUG is not set
919CONFIG_FS_MBCACHE=y
920# CONFIG_REISERFS_FS is not set
921# CONFIG_JFS_FS is not set
922CONFIG_FS_POSIX_ACL=y
923CONFIG_FILE_LOCKING=y
924# CONFIG_XFS_FS is not set
925# CONFIG_OCFS2_FS is not set
926# CONFIG_BTRFS_FS is not set
927CONFIG_DNOTIFY=y
928CONFIG_INOTIFY=y
929CONFIG_INOTIFY_USER=y
930# CONFIG_QUOTA is not set
931CONFIG_AUTOFS_FS=y
932CONFIG_AUTOFS4_FS=y
933# CONFIG_FUSE_FS is not set
934CONFIG_GENERIC_ACL=y
935
936#
937# CD-ROM/DVD Filesystems
938#
939# CONFIG_ISO9660_FS is not set
940# CONFIG_UDF_FS is not set
941
942#
943# DOS/FAT/NT Filesystems
944#
945# CONFIG_MSDOS_FS is not set
946# CONFIG_VFAT_FS is not set
947# CONFIG_NTFS_FS is not set
948
949#
950# Pseudo filesystems
951#
952CONFIG_PROC_FS=y
953CONFIG_PROC_KCORE=y
954CONFIG_PROC_SYSCTL=y
955CONFIG_PROC_PAGE_MONITOR=y
956CONFIG_SYSFS=y
957CONFIG_TMPFS=y
958CONFIG_TMPFS_POSIX_ACL=y
959# CONFIG_HUGETLBFS is not set
960# CONFIG_HUGETLB_PAGE is not set
961# CONFIG_CONFIGFS_FS is not set
962CONFIG_MISC_FILESYSTEMS=y
963# CONFIG_ADFS_FS is not set
964# CONFIG_AFFS_FS is not set
965# CONFIG_HFS_FS is not set
966# CONFIG_HFSPLUS_FS is not set
967# CONFIG_BEFS_FS is not set
968# CONFIG_BFS_FS is not set
969# CONFIG_EFS_FS is not set
970# CONFIG_JFFS2_FS is not set
971CONFIG_CRAMFS=y
972# CONFIG_SQUASHFS is not set
973# CONFIG_VXFS_FS is not set
974# CONFIG_MINIX_FS is not set
975# CONFIG_OMFS_FS is not set
976# CONFIG_HPFS_FS is not set
977# CONFIG_QNX4FS_FS is not set
978CONFIG_ROMFS_FS=y
979# CONFIG_SYSV_FS is not set
980# CONFIG_UFS_FS is not set
981CONFIG_NETWORK_FILESYSTEMS=y
982CONFIG_NFS_FS=y
983# CONFIG_NFS_V3 is not set
984# CONFIG_NFS_V4 is not set
985CONFIG_ROOT_NFS=y
986# CONFIG_NFSD is not set
987CONFIG_LOCKD=y
988CONFIG_NFS_COMMON=y
989CONFIG_SUNRPC=y
990# CONFIG_SUNRPC_REGISTER_V4 is not set
991# CONFIG_RPCSEC_GSS_KRB5 is not set
992# CONFIG_RPCSEC_GSS_SPKM3 is not set
993# CONFIG_SMB_FS is not set
994# CONFIG_CIFS is not set
995# CONFIG_NCP_FS is not set
996# CONFIG_CODA_FS is not set
997# CONFIG_AFS_FS is not set
998
999#
1000# Partition Types
1001#
1002# CONFIG_PARTITION_ADVANCED is not set
1003CONFIG_MSDOS_PARTITION=y
1004CONFIG_NLS=y
1005CONFIG_NLS_DEFAULT="iso8859-1"
1006CONFIG_NLS_CODEPAGE_437=y
1007CONFIG_NLS_CODEPAGE_737=y
1008CONFIG_NLS_CODEPAGE_775=y
1009CONFIG_NLS_CODEPAGE_850=y
1010CONFIG_NLS_CODEPAGE_852=y
1011CONFIG_NLS_CODEPAGE_855=y
1012CONFIG_NLS_CODEPAGE_857=y
1013CONFIG_NLS_CODEPAGE_860=y
1014CONFIG_NLS_CODEPAGE_861=y
1015CONFIG_NLS_CODEPAGE_862=y
1016CONFIG_NLS_CODEPAGE_863=y
1017CONFIG_NLS_CODEPAGE_864=y
1018CONFIG_NLS_CODEPAGE_865=y
1019CONFIG_NLS_CODEPAGE_866=y
1020CONFIG_NLS_CODEPAGE_869=y
1021CONFIG_NLS_CODEPAGE_936=y
1022CONFIG_NLS_CODEPAGE_950=y
1023CONFIG_NLS_CODEPAGE_932=y
1024CONFIG_NLS_CODEPAGE_949=y
1025CONFIG_NLS_CODEPAGE_874=y
1026CONFIG_NLS_ISO8859_8=y
1027CONFIG_NLS_CODEPAGE_1250=y
1028CONFIG_NLS_CODEPAGE_1251=y
1029CONFIG_NLS_ASCII=y
1030CONFIG_NLS_ISO8859_1=y
1031CONFIG_NLS_ISO8859_2=y
1032CONFIG_NLS_ISO8859_3=y
1033CONFIG_NLS_ISO8859_4=y
1034CONFIG_NLS_ISO8859_5=y
1035CONFIG_NLS_ISO8859_6=y
1036CONFIG_NLS_ISO8859_7=y
1037CONFIG_NLS_ISO8859_9=y
1038CONFIG_NLS_ISO8859_13=y
1039CONFIG_NLS_ISO8859_14=y
1040CONFIG_NLS_ISO8859_15=y
1041CONFIG_NLS_KOI8_R=y
1042CONFIG_NLS_KOI8_U=y
1043CONFIG_NLS_UTF8=y
1044# CONFIG_DLM is not set
1045
1046#
1047# Kernel hacking
1048#
1049CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1050# CONFIG_PRINTK_TIME is not set
1051# CONFIG_ENABLE_WARN_DEPRECATED is not set
1052# CONFIG_ENABLE_MUST_CHECK is not set
1053CONFIG_FRAME_WARN=1024
1054# CONFIG_MAGIC_SYSRQ is not set
1055# CONFIG_UNUSED_SYMBOLS is not set
1056CONFIG_DEBUG_FS=y
1057# CONFIG_HEADERS_CHECK is not set
1058# CONFIG_DEBUG_KERNEL is not set
1059CONFIG_STACKTRACE=y
1060# CONFIG_DEBUG_BUGVERBOSE is not set
1061# CONFIG_DEBUG_MEMORY_INIT is not set
1062# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1063# CONFIG_LATENCYTOP is not set
1064CONFIG_NOP_TRACER=y
1065CONFIG_HAVE_FUNCTION_TRACER=y
1066CONFIG_HAVE_DYNAMIC_FTRACE=y
1067CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1068CONFIG_RING_BUFFER=y
1069CONFIG_TRACING=y
1070
1071#
1072# Tracers
1073#
1074# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1075# CONFIG_SAMPLES is not set
1076CONFIG_HAVE_ARCH_KGDB=y
1077# CONFIG_SH_STANDARD_BIOS is not set
1078# CONFIG_EARLY_SCIF_CONSOLE is not set
1079# CONFIG_MORE_COMPILE_OPTIONS is not set
1080
1081#
1082# Security options
1083#
1084# CONFIG_KEYS is not set
1085# CONFIG_SECURITY is not set
1086# CONFIG_SECURITYFS is not set
1087# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1088CONFIG_CRYPTO=y
1089
1090#
1091# Crypto core or helper
1092#
1093# CONFIG_CRYPTO_FIPS is not set
1094# CONFIG_CRYPTO_MANAGER is not set
1095# CONFIG_CRYPTO_MANAGER2 is not set
1096# CONFIG_CRYPTO_GF128MUL is not set
1097# CONFIG_CRYPTO_NULL is not set
1098# CONFIG_CRYPTO_CRYPTD is not set
1099# CONFIG_CRYPTO_AUTHENC is not set
1100# CONFIG_CRYPTO_TEST is not set
1101
1102#
1103# Authenticated Encryption with Associated Data
1104#
1105# CONFIG_CRYPTO_CCM is not set
1106# CONFIG_CRYPTO_GCM is not set
1107# CONFIG_CRYPTO_SEQIV is not set
1108
1109#
1110# Block modes
1111#
1112# CONFIG_CRYPTO_CBC is not set
1113# CONFIG_CRYPTO_CTR is not set
1114# CONFIG_CRYPTO_CTS is not set
1115# CONFIG_CRYPTO_ECB is not set
1116# CONFIG_CRYPTO_LRW is not set
1117# CONFIG_CRYPTO_PCBC is not set
1118# CONFIG_CRYPTO_XTS is not set
1119
1120#
1121# Hash modes
1122#
1123# CONFIG_CRYPTO_HMAC is not set
1124# CONFIG_CRYPTO_XCBC is not set
1125
1126#
1127# Digest
1128#
1129# CONFIG_CRYPTO_CRC32C is not set
1130# CONFIG_CRYPTO_MD4 is not set
1131# CONFIG_CRYPTO_MD5 is not set
1132# CONFIG_CRYPTO_MICHAEL_MIC is not set
1133# CONFIG_CRYPTO_RMD128 is not set
1134# CONFIG_CRYPTO_RMD160 is not set
1135# CONFIG_CRYPTO_RMD256 is not set
1136# CONFIG_CRYPTO_RMD320 is not set
1137# CONFIG_CRYPTO_SHA1 is not set
1138# CONFIG_CRYPTO_SHA256 is not set
1139# CONFIG_CRYPTO_SHA512 is not set
1140# CONFIG_CRYPTO_TGR192 is not set
1141# CONFIG_CRYPTO_WP512 is not set
1142
1143#
1144# Ciphers
1145#
1146# CONFIG_CRYPTO_AES is not set
1147# CONFIG_CRYPTO_ANUBIS is not set
1148# CONFIG_CRYPTO_ARC4 is not set
1149# CONFIG_CRYPTO_BLOWFISH is not set
1150# CONFIG_CRYPTO_CAMELLIA is not set
1151# CONFIG_CRYPTO_CAST5 is not set
1152# CONFIG_CRYPTO_CAST6 is not set
1153# CONFIG_CRYPTO_DES is not set
1154# CONFIG_CRYPTO_FCRYPT is not set
1155# CONFIG_CRYPTO_KHAZAD is not set
1156# CONFIG_CRYPTO_SALSA20 is not set
1157# CONFIG_CRYPTO_SEED is not set
1158# CONFIG_CRYPTO_SERPENT is not set
1159# CONFIG_CRYPTO_TEA is not set
1160# CONFIG_CRYPTO_TWOFISH is not set
1161
1162#
1163# Compression
1164#
1165# CONFIG_CRYPTO_DEFLATE is not set
1166# CONFIG_CRYPTO_LZO is not set
1167
1168#
1169# Random Number Generation
1170#
1171# CONFIG_CRYPTO_ANSI_CPRNG is not set
1172CONFIG_CRYPTO_HW=y
1173
1174#
1175# Library routines
1176#
1177CONFIG_BITREVERSE=y
1178CONFIG_GENERIC_FIND_LAST_BIT=y
1179# CONFIG_CRC_CCITT is not set
1180# CONFIG_CRC16 is not set
1181CONFIG_CRC_T10DIF=y
1182# CONFIG_CRC_ITU_T is not set
1183CONFIG_CRC32=y
1184# CONFIG_CRC7 is not set
1185# CONFIG_LIBCRC32C is not set
1186CONFIG_ZLIB_INFLATE=y
1187CONFIG_PLIST=y
1188CONFIG_HAS_IOMEM=y
1189CONFIG_HAS_IOPORT=y
1190CONFIG_HAS_DMA=y
diff --git a/arch/sh/configs/polaris_defconfig b/arch/sh/configs/polaris_defconfig
new file mode 100644
index 000000000000..320def233b2f
--- /dev/null
+++ b/arch/sh/configs/polaris_defconfig
@@ -0,0 +1,969 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc4
4# Wed Feb 11 18:41:59 2009
5#
6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y
8CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_BUG=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
15CONFIG_GENERIC_IRQ_PROBE=y
16# CONFIG_GENERIC_GPIO is not set
17CONFIG_GENERIC_TIME=y
18CONFIG_GENERIC_CLOCKEVENTS=y
19# CONFIG_ARCH_SUSPEND_POSSIBLE is not set
20# CONFIG_ARCH_HIBERNATION_POSSIBLE is not set
21CONFIG_STACKTRACE_SUPPORT=y
22CONFIG_LOCKDEP_SUPPORT=y
23CONFIG_HAVE_LATENCYTOP_SUPPORT=y
24# CONFIG_ARCH_HAS_ILOG2_U32 is not set
25# CONFIG_ARCH_HAS_ILOG2_U64 is not set
26CONFIG_ARCH_NO_VIRT_TO_BUS=y
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37# CONFIG_LOCALVERSION_AUTO is not set
38# CONFIG_SWAP is not set
39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
41CONFIG_POSIX_MQUEUE=y
42CONFIG_BSD_PROCESS_ACCT=y
43CONFIG_BSD_PROCESS_ACCT_V3=y
44# CONFIG_TASKSTATS is not set
45CONFIG_AUDIT=y
46# CONFIG_AUDITSYSCALL is not set
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56# CONFIG_IKCONFIG is not set
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
64CONFIG_SYSFS_DEPRECATED=y
65CONFIG_SYSFS_DEPRECATED_V2=y
66# CONFIG_RELAY is not set
67# CONFIG_NAMESPACES is not set
68# CONFIG_BLK_DEV_INITRD is not set
69# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
70CONFIG_SYSCTL=y
71CONFIG_EMBEDDED=y
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_COMPAT_BRK=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_ANON_INODES=y
85CONFIG_EPOLL=y
86CONFIG_SIGNALFD=y
87CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y
90CONFIG_AIO=y
91CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_SLAB=y
93# CONFIG_SLUB is not set
94# CONFIG_SLOB is not set
95# CONFIG_PROFILING is not set
96CONFIG_HAVE_OPROFILE=y
97# CONFIG_KPROBES is not set
98CONFIG_HAVE_IOREMAP_PROT=y
99CONFIG_HAVE_KPROBES=y
100CONFIG_HAVE_KRETPROBES=y
101CONFIG_HAVE_ARCH_TRACEHOOK=y
102CONFIG_HAVE_CLK=y
103CONFIG_HAVE_GENERIC_DMA_COHERENT=y
104CONFIG_SLABINFO=y
105CONFIG_RT_MUTEXES=y
106CONFIG_BASE_SMALL=0
107CONFIG_MODULES=y
108# CONFIG_MODULE_FORCE_LOAD is not set
109CONFIG_MODULE_UNLOAD=y
110# CONFIG_MODULE_FORCE_UNLOAD is not set
111CONFIG_MODVERSIONS=y
112# CONFIG_MODULE_SRCVERSION_ALL is not set
113CONFIG_BLOCK=y
114# CONFIG_LBD is not set
115# CONFIG_BLK_DEV_IO_TRACE is not set
116# CONFIG_BLK_DEV_BSG is not set
117# CONFIG_BLK_DEV_INTEGRITY is not set
118
119#
120# IO Schedulers
121#
122CONFIG_IOSCHED_NOOP=y
123# CONFIG_IOSCHED_AS is not set
124# CONFIG_IOSCHED_DEADLINE is not set
125CONFIG_IOSCHED_CFQ=y
126# CONFIG_DEFAULT_AS is not set
127# CONFIG_DEFAULT_DEADLINE is not set
128CONFIG_DEFAULT_CFQ=y
129# CONFIG_DEFAULT_NOOP is not set
130CONFIG_DEFAULT_IOSCHED="cfq"
131# CONFIG_FREEZER is not set
132
133#
134# System type
135#
136CONFIG_CPU_SH3=y
137# CONFIG_CPU_SUBTYPE_SH7619 is not set
138# CONFIG_CPU_SUBTYPE_SH7201 is not set
139# CONFIG_CPU_SUBTYPE_SH7203 is not set
140# CONFIG_CPU_SUBTYPE_SH7206 is not set
141# CONFIG_CPU_SUBTYPE_SH7263 is not set
142# CONFIG_CPU_SUBTYPE_MXG is not set
143# CONFIG_CPU_SUBTYPE_SH7705 is not set
144# CONFIG_CPU_SUBTYPE_SH7706 is not set
145# CONFIG_CPU_SUBTYPE_SH7707 is not set
146# CONFIG_CPU_SUBTYPE_SH7708 is not set
147CONFIG_CPU_SUBTYPE_SH7709=y
148# CONFIG_CPU_SUBTYPE_SH7710 is not set
149# CONFIG_CPU_SUBTYPE_SH7712 is not set
150# CONFIG_CPU_SUBTYPE_SH7720 is not set
151# CONFIG_CPU_SUBTYPE_SH7721 is not set
152# CONFIG_CPU_SUBTYPE_SH7750 is not set
153# CONFIG_CPU_SUBTYPE_SH7091 is not set
154# CONFIG_CPU_SUBTYPE_SH7750R is not set
155# CONFIG_CPU_SUBTYPE_SH7750S is not set
156# CONFIG_CPU_SUBTYPE_SH7751 is not set
157# CONFIG_CPU_SUBTYPE_SH7751R is not set
158# CONFIG_CPU_SUBTYPE_SH7760 is not set
159# CONFIG_CPU_SUBTYPE_SH4_202 is not set
160# CONFIG_CPU_SUBTYPE_SH7723 is not set
161# CONFIG_CPU_SUBTYPE_SH7763 is not set
162# CONFIG_CPU_SUBTYPE_SH7770 is not set
163# CONFIG_CPU_SUBTYPE_SH7780 is not set
164# CONFIG_CPU_SUBTYPE_SH7785 is not set
165# CONFIG_CPU_SUBTYPE_SHX3 is not set
166# CONFIG_CPU_SUBTYPE_SH7343 is not set
167# CONFIG_CPU_SUBTYPE_SH7722 is not set
168# CONFIG_CPU_SUBTYPE_SH7366 is not set
169# CONFIG_CPU_SUBTYPE_SH5_101 is not set
170# CONFIG_CPU_SUBTYPE_SH5_103 is not set
171
172#
173# Memory management options
174#
175CONFIG_QUICKLIST=y
176CONFIG_MMU=y
177CONFIG_PAGE_OFFSET=0x80000000
178CONFIG_MEMORY_START=0x0C000000
179CONFIG_MEMORY_SIZE=0x04000000
180CONFIG_29BIT=y
181CONFIG_VSYSCALL=y
182CONFIG_ARCH_FLATMEM_ENABLE=y
183CONFIG_ARCH_SPARSEMEM_ENABLE=y
184CONFIG_ARCH_SPARSEMEM_DEFAULT=y
185CONFIG_MAX_ACTIVE_REGIONS=1
186CONFIG_ARCH_POPULATES_NODE_MAP=y
187CONFIG_ARCH_SELECT_MEMORY_MODEL=y
188CONFIG_PAGE_SIZE_4KB=y
189# CONFIG_PAGE_SIZE_8KB is not set
190# CONFIG_PAGE_SIZE_16KB is not set
191# CONFIG_PAGE_SIZE_64KB is not set
192CONFIG_ENTRY_OFFSET=0x00001000
193CONFIG_SELECT_MEMORY_MODEL=y
194CONFIG_FLATMEM_MANUAL=y
195# CONFIG_DISCONTIGMEM_MANUAL is not set
196# CONFIG_SPARSEMEM_MANUAL is not set
197CONFIG_FLATMEM=y
198CONFIG_FLAT_NODE_MEM_MAP=y
199CONFIG_SPARSEMEM_STATIC=y
200CONFIG_PAGEFLAGS_EXTENDED=y
201CONFIG_SPLIT_PTLOCK_CPUS=4
202# CONFIG_PHYS_ADDR_T_64BIT is not set
203CONFIG_ZONE_DMA_FLAG=0
204CONFIG_NR_QUICK=2
205CONFIG_UNEVICTABLE_LRU=y
206
207#
208# Cache configuration
209#
210# CONFIG_SH_DIRECT_MAPPED is not set
211CONFIG_CACHE_WRITEBACK=y
212# CONFIG_CACHE_WRITETHROUGH is not set
213# CONFIG_CACHE_OFF is not set
214
215#
216# Processor features
217#
218CONFIG_CPU_LITTLE_ENDIAN=y
219# CONFIG_CPU_BIG_ENDIAN is not set
220CONFIG_SH_FPU_EMU=y
221CONFIG_SH_ADC=y
222CONFIG_CPU_HAS_INTEVT=y
223CONFIG_CPU_HAS_IPR_IRQ=y
224CONFIG_CPU_HAS_SR_RB=y
225
226#
227# Board support
228#
229# CONFIG_SH_SOLUTION_ENGINE is not set
230# CONFIG_SH_HP6XX is not set
231CONFIG_SH_POLARIS=y
232
233#
234# Timer and clock configuration
235#
236CONFIG_SH_TMU=y
237CONFIG_SH_TIMER_IRQ=16
238CONFIG_SH_PCLK_FREQ=33000000
239CONFIG_TICK_ONESHOT=y
240CONFIG_NO_HZ=y
241CONFIG_HIGH_RES_TIMERS=y
242CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
243
244#
245# CPU Frequency scaling
246#
247# CONFIG_CPU_FREQ is not set
248
249#
250# DMA support
251#
252CONFIG_SH_DMA_API=y
253CONFIG_SH_DMA=y
254CONFIG_NR_ONCHIP_DMA_CHANNELS=4
255# CONFIG_NR_DMA_CHANNELS_BOOL is not set
256
257#
258# Companion Chips
259#
260
261#
262# Additional SuperH Device Drivers
263#
264CONFIG_HEARTBEAT=y
265# CONFIG_PUSH_SWITCH is not set
266
267#
268# Kernel features
269#
270CONFIG_HZ_100=y
271# CONFIG_HZ_250 is not set
272# CONFIG_HZ_300 is not set
273# CONFIG_HZ_1000 is not set
274CONFIG_HZ=100
275CONFIG_SCHED_HRTICK=y
276# CONFIG_KEXEC is not set
277# CONFIG_CRASH_DUMP is not set
278# CONFIG_SECCOMP is not set
279# CONFIG_PREEMPT_NONE is not set
280# CONFIG_PREEMPT_VOLUNTARY is not set
281CONFIG_PREEMPT=y
282CONFIG_GUSA=y
283# CONFIG_GUSA_RB is not set
284
285#
286# Boot options
287#
288CONFIG_ZERO_PAGE_OFFSET=0x00001000
289CONFIG_BOOT_LINK_OFFSET=0x00800000
290CONFIG_CMDLINE_BOOL=y
291CONFIG_CMDLINE="console=ttySC1,115200 root=/dev/mtdblock2 rootfstype=jffs2 mem=63M mtdparts=physmap-flash.0:0x00100000(bootloader)ro,0x00500000(Kernel)ro,0x00A00000(Filesystem)"
292
293#
294# Bus options
295#
296# CONFIG_ARCH_SUPPORTS_MSI is not set
297# CONFIG_PCCARD is not set
298
299#
300# Executable file formats
301#
302CONFIG_BINFMT_ELF=y
303# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
304# CONFIG_HAVE_AOUT is not set
305# CONFIG_BINFMT_MISC is not set
306
307#
308# Power management options (EXPERIMENTAL)
309#
310# CONFIG_PM is not set
311# CONFIG_CPU_IDLE is not set
312CONFIG_NET=y
313
314#
315# Networking options
316#
317CONFIG_COMPAT_NET_DEV_OPS=y
318CONFIG_PACKET=y
319CONFIG_PACKET_MMAP=y
320CONFIG_UNIX=y
321# CONFIG_NET_KEY is not set
322CONFIG_INET=y
323CONFIG_IP_MULTICAST=y
324# CONFIG_IP_ADVANCED_ROUTER is not set
325CONFIG_IP_FIB_HASH=y
326# CONFIG_IP_PNP is not set
327# CONFIG_NET_IPIP is not set
328# CONFIG_NET_IPGRE is not set
329# CONFIG_IP_MROUTE is not set
330# CONFIG_ARPD is not set
331# CONFIG_SYN_COOKIES is not set
332# CONFIG_INET_AH is not set
333# CONFIG_INET_ESP is not set
334# CONFIG_INET_IPCOMP is not set
335# CONFIG_INET_XFRM_TUNNEL is not set
336# CONFIG_INET_TUNNEL is not set
337# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
338# CONFIG_INET_XFRM_MODE_TUNNEL is not set
339# CONFIG_INET_XFRM_MODE_BEET is not set
340# CONFIG_INET_LRO is not set
341CONFIG_INET_DIAG=y
342CONFIG_INET_TCP_DIAG=y
343# CONFIG_TCP_CONG_ADVANCED is not set
344CONFIG_TCP_CONG_CUBIC=y
345CONFIG_DEFAULT_TCP_CONG="cubic"
346# CONFIG_TCP_MD5SIG is not set
347# CONFIG_IPV6 is not set
348# CONFIG_NETWORK_SECMARK is not set
349# CONFIG_NETFILTER is not set
350# CONFIG_IP_DCCP is not set
351# CONFIG_IP_SCTP 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_NET_SCHED is not set
366# CONFIG_DCB is not set
367
368#
369# Network testing
370#
371# CONFIG_NET_PKTGEN is not set
372# CONFIG_HAMRADIO is not set
373# CONFIG_CAN is not set
374# CONFIG_IRDA is not set
375# CONFIG_BT is not set
376# CONFIG_AF_RXRPC is not set
377# CONFIG_PHONET is not set
378# CONFIG_WIRELESS is not set
379# CONFIG_WIMAX is not set
380# CONFIG_RFKILL is not set
381# CONFIG_NET_9P is not set
382
383#
384# Device Drivers
385#
386
387#
388# Generic Driver Options
389#
390CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
391CONFIG_STANDALONE=y
392CONFIG_PREVENT_FIRMWARE_BUILD=y
393CONFIG_FW_LOADER=y
394# CONFIG_FIRMWARE_IN_KERNEL is not set
395CONFIG_EXTRA_FIRMWARE=""
396# CONFIG_DEBUG_DRIVER is not set
397# CONFIG_DEBUG_DEVRES is not set
398# CONFIG_SYS_HYPERVISOR is not set
399# CONFIG_CONNECTOR is not set
400CONFIG_MTD=y
401# CONFIG_MTD_DEBUG is not set
402# CONFIG_MTD_CONCAT is not set
403CONFIG_MTD_PARTITIONS=y
404# CONFIG_MTD_TESTS is not set
405# CONFIG_MTD_REDBOOT_PARTS is not set
406CONFIG_MTD_CMDLINE_PARTS=y
407# CONFIG_MTD_AR7_PARTS is not set
408
409#
410# User Modules And Translation Layers
411#
412CONFIG_MTD_CHAR=y
413CONFIG_MTD_BLKDEVS=y
414CONFIG_MTD_BLOCK=y
415# CONFIG_FTL is not set
416# CONFIG_NFTL is not set
417# CONFIG_INFTL is not set
418# CONFIG_RFD_FTL is not set
419# CONFIG_SSFDC is not set
420# CONFIG_MTD_OOPS is not set
421
422#
423# RAM/ROM/Flash chip drivers
424#
425CONFIG_MTD_CFI=y
426# CONFIG_MTD_JEDECPROBE is not set
427CONFIG_MTD_GEN_PROBE=y
428CONFIG_MTD_CFI_ADV_OPTIONS=y
429CONFIG_MTD_CFI_NOSWAP=y
430# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
431# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
432# CONFIG_MTD_CFI_GEOMETRY is not set
433CONFIG_MTD_MAP_BANK_WIDTH_1=y
434CONFIG_MTD_MAP_BANK_WIDTH_2=y
435CONFIG_MTD_MAP_BANK_WIDTH_4=y
436# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
437# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
438# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
439CONFIG_MTD_CFI_I1=y
440CONFIG_MTD_CFI_I2=y
441# CONFIG_MTD_CFI_I4 is not set
442# CONFIG_MTD_CFI_I8 is not set
443# CONFIG_MTD_OTP is not set
444CONFIG_MTD_CFI_INTELEXT=y
445# CONFIG_MTD_CFI_AMDSTD is not set
446# CONFIG_MTD_CFI_STAA is not set
447CONFIG_MTD_CFI_UTIL=y
448# CONFIG_MTD_RAM is not set
449# CONFIG_MTD_ROM is not set
450# CONFIG_MTD_ABSENT is not set
451
452#
453# Mapping drivers for chip access
454#
455# CONFIG_MTD_COMPLEX_MAPPINGS is not set
456CONFIG_MTD_PHYSMAP=y
457CONFIG_MTD_PHYSMAP_COMPAT=y
458CONFIG_MTD_PHYSMAP_START=0x00000000
459CONFIG_MTD_PHYSMAP_LEN=0x01000000
460CONFIG_MTD_PHYSMAP_BANKWIDTH=2
461# CONFIG_MTD_PLATRAM is not set
462
463#
464# Self-contained MTD device drivers
465#
466# CONFIG_MTD_SLRAM is not set
467# CONFIG_MTD_PHRAM is not set
468# CONFIG_MTD_MTDRAM is not set
469# CONFIG_MTD_BLOCK2MTD is not set
470
471#
472# Disk-On-Chip Device Drivers
473#
474# CONFIG_MTD_DOC2000 is not set
475# CONFIG_MTD_DOC2001 is not set
476# CONFIG_MTD_DOC2001PLUS is not set
477# CONFIG_MTD_NAND is not set
478# CONFIG_MTD_ONENAND is not set
479
480#
481# LPDDR flash memory drivers
482#
483# CONFIG_MTD_LPDDR is not set
484# CONFIG_MTD_QINFO_PROBE is not set
485
486#
487# UBI - Unsorted block images
488#
489# CONFIG_MTD_UBI is not set
490# CONFIG_PARPORT is not set
491CONFIG_BLK_DEV=y
492# CONFIG_BLK_DEV_COW_COMMON is not set
493# CONFIG_BLK_DEV_LOOP is not set
494# CONFIG_BLK_DEV_NBD is not set
495# CONFIG_BLK_DEV_RAM is not set
496# CONFIG_CDROM_PKTCDVD is not set
497# CONFIG_ATA_OVER_ETH is not set
498# CONFIG_BLK_DEV_HD is not set
499CONFIG_MISC_DEVICES=y
500# CONFIG_ENCLOSURE_SERVICES is not set
501# CONFIG_C2PORT is not set
502
503#
504# EEPROM support
505#
506# CONFIG_EEPROM_93CX6 is not set
507CONFIG_HAVE_IDE=y
508# CONFIG_IDE is not set
509
510#
511# SCSI device support
512#
513# CONFIG_RAID_ATTRS is not set
514# CONFIG_SCSI is not set
515# CONFIG_SCSI_DMA is not set
516# CONFIG_SCSI_NETLINK is not set
517# CONFIG_ATA is not set
518# CONFIG_MD is not set
519CONFIG_NETDEVICES=y
520# CONFIG_DUMMY is not set
521# CONFIG_BONDING is not set
522# CONFIG_MACVLAN is not set
523# CONFIG_EQUALIZER is not set
524# CONFIG_TUN is not set
525# CONFIG_VETH is not set
526CONFIG_PHYLIB=y
527
528#
529# MII PHY device drivers
530#
531# CONFIG_MARVELL_PHY is not set
532# CONFIG_DAVICOM_PHY is not set
533# CONFIG_QSEMI_PHY is not set
534# CONFIG_LXT_PHY is not set
535# CONFIG_CICADA_PHY is not set
536# CONFIG_VITESSE_PHY is not set
537CONFIG_SMSC_PHY=y
538# CONFIG_BROADCOM_PHY is not set
539# CONFIG_ICPLUS_PHY is not set
540# CONFIG_REALTEK_PHY is not set
541# CONFIG_NATIONAL_PHY is not set
542# CONFIG_STE10XP is not set
543# CONFIG_LSI_ET1011C_PHY is not set
544# CONFIG_FIXED_PHY is not set
545# CONFIG_MDIO_BITBANG is not set
546CONFIG_NET_ETHERNET=y
547CONFIG_MII=y
548# CONFIG_AX88796 is not set
549# CONFIG_STNIC is not set
550# CONFIG_SMC91X is not set
551# CONFIG_SMC911X is not set
552CONFIG_SMSC911X=y
553# CONFIG_IBM_NEW_EMAC_ZMII is not set
554# CONFIG_IBM_NEW_EMAC_RGMII is not set
555# CONFIG_IBM_NEW_EMAC_TAH is not set
556# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
557# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
558# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
559# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
560# CONFIG_B44 is not set
561# CONFIG_NETDEV_1000 is not set
562# CONFIG_NETDEV_10000 is not set
563
564#
565# Wireless LAN
566#
567# CONFIG_WLAN_PRE80211 is not set
568# CONFIG_WLAN_80211 is not set
569# CONFIG_IWLWIFI_LEDS is not set
570
571#
572# Enable WiMAX (Networking options) to see the WiMAX drivers
573#
574# CONFIG_WAN is not set
575# CONFIG_PPP is not set
576# CONFIG_SLIP is not set
577# CONFIG_NETCONSOLE is not set
578# CONFIG_NETPOLL is not set
579# CONFIG_NET_POLL_CONTROLLER is not set
580# CONFIG_ISDN is not set
581# CONFIG_PHONE is not set
582
583#
584# Input device support
585#
586CONFIG_INPUT=y
587# CONFIG_INPUT_FF_MEMLESS is not set
588# CONFIG_INPUT_POLLDEV is not set
589
590#
591# Userland interfaces
592#
593# CONFIG_INPUT_MOUSEDEV is not set
594# CONFIG_INPUT_JOYDEV is not set
595# CONFIG_INPUT_EVDEV is not set
596# CONFIG_INPUT_EVBUG is not set
597
598#
599# Input Device Drivers
600#
601# CONFIG_INPUT_KEYBOARD is not set
602# CONFIG_INPUT_MOUSE is not set
603# CONFIG_INPUT_JOYSTICK is not set
604# CONFIG_INPUT_TABLET is not set
605# CONFIG_INPUT_TOUCHSCREEN is not set
606# CONFIG_INPUT_MISC is not set
607
608#
609# Hardware I/O ports
610#
611# CONFIG_SERIO is not set
612# CONFIG_GAMEPORT is not set
613
614#
615# Character devices
616#
617CONFIG_VT=y
618CONFIG_CONSOLE_TRANSLATIONS=y
619CONFIG_VT_CONSOLE=y
620CONFIG_HW_CONSOLE=y
621CONFIG_VT_HW_CONSOLE_BINDING=y
622CONFIG_DEVKMEM=y
623CONFIG_SERIAL_NONSTANDARD=y
624# CONFIG_N_HDLC is not set
625# CONFIG_RISCOM8 is not set
626# CONFIG_SPECIALIX is not set
627# CONFIG_RIO is not set
628# CONFIG_STALDRV is not set
629
630#
631# Serial drivers
632#
633# CONFIG_SERIAL_8250 is not set
634
635#
636# Non-8250 serial port support
637#
638CONFIG_SERIAL_SH_SCI=y
639CONFIG_SERIAL_SH_SCI_NR_UARTS=3
640CONFIG_SERIAL_SH_SCI_CONSOLE=y
641CONFIG_SERIAL_CORE=y
642CONFIG_SERIAL_CORE_CONSOLE=y
643CONFIG_UNIX98_PTYS=y
644# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
645# CONFIG_LEGACY_PTYS is not set
646# CONFIG_IPMI_HANDLER is not set
647# CONFIG_HW_RANDOM is not set
648# CONFIG_R3964 is not set
649# CONFIG_RAW_DRIVER is not set
650# CONFIG_TCG_TPM is not set
651# CONFIG_I2C is not set
652# CONFIG_SPI is not set
653# CONFIG_W1 is not set
654# CONFIG_POWER_SUPPLY is not set
655# CONFIG_HWMON is not set
656# CONFIG_THERMAL is not set
657# CONFIG_THERMAL_HWMON is not set
658# CONFIG_WATCHDOG is not set
659CONFIG_SSB_POSSIBLE=y
660
661#
662# Sonics Silicon Backplane
663#
664# CONFIG_SSB is not set
665
666#
667# Multifunction device drivers
668#
669# CONFIG_MFD_CORE is not set
670# CONFIG_MFD_SM501 is not set
671# CONFIG_HTC_PASIC3 is not set
672# CONFIG_MFD_TMIO is not set
673# CONFIG_REGULATOR is not set
674
675#
676# Multimedia devices
677#
678
679#
680# Multimedia core support
681#
682# CONFIG_VIDEO_DEV is not set
683# CONFIG_DVB_CORE is not set
684# CONFIG_VIDEO_MEDIA is not set
685
686#
687# Multimedia drivers
688#
689# CONFIG_DAB is not set
690
691#
692# Graphics support
693#
694# CONFIG_VGASTATE is not set
695# CONFIG_VIDEO_OUTPUT_CONTROL is not set
696# CONFIG_FB is not set
697# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
698
699#
700# Display device support
701#
702# CONFIG_DISPLAY_SUPPORT is not set
703
704#
705# Console display driver support
706#
707CONFIG_DUMMY_CONSOLE=y
708# CONFIG_SOUND is not set
709# CONFIG_HID_SUPPORT is not set
710# CONFIG_USB_SUPPORT is not set
711# CONFIG_MMC is not set
712# CONFIG_MEMSTICK is not set
713# CONFIG_NEW_LEDS is not set
714# CONFIG_ACCESSIBILITY is not set
715CONFIG_RTC_LIB=y
716CONFIG_RTC_CLASS=y
717CONFIG_RTC_HCTOSYS=y
718CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
719# CONFIG_RTC_DEBUG is not set
720
721#
722# RTC interfaces
723#
724CONFIG_RTC_INTF_SYSFS=y
725CONFIG_RTC_INTF_PROC=y
726CONFIG_RTC_INTF_DEV=y
727# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
728# CONFIG_RTC_DRV_TEST is not set
729
730#
731# SPI RTC drivers
732#
733
734#
735# Platform RTC drivers
736#
737# CONFIG_RTC_DRV_DS1286 is not set
738# CONFIG_RTC_DRV_DS1511 is not set
739# CONFIG_RTC_DRV_DS1553 is not set
740# CONFIG_RTC_DRV_DS1742 is not set
741# CONFIG_RTC_DRV_STK17TA8 is not set
742# CONFIG_RTC_DRV_M48T86 is not set
743# CONFIG_RTC_DRV_M48T35 is not set
744# CONFIG_RTC_DRV_M48T59 is not set
745# CONFIG_RTC_DRV_BQ4802 is not set
746# CONFIG_RTC_DRV_V3020 is not set
747
748#
749# on-CPU RTC drivers
750#
751CONFIG_RTC_DRV_SH=y
752# CONFIG_DMADEVICES is not set
753# CONFIG_UIO is not set
754# CONFIG_STAGING is not set
755
756#
757# File systems
758#
759# CONFIG_EXT2_FS is not set
760# CONFIG_EXT3_FS is not set
761# CONFIG_EXT4_FS is not set
762# CONFIG_REISERFS_FS is not set
763# CONFIG_JFS_FS is not set
764# CONFIG_FS_POSIX_ACL is not set
765CONFIG_FILE_LOCKING=y
766# CONFIG_XFS_FS is not set
767# CONFIG_OCFS2_FS is not set
768# CONFIG_BTRFS_FS is not set
769# CONFIG_DNOTIFY is not set
770# CONFIG_INOTIFY is not set
771# CONFIG_QUOTA is not set
772# CONFIG_AUTOFS_FS is not set
773# CONFIG_AUTOFS4_FS is not set
774# CONFIG_FUSE_FS is not set
775
776#
777# CD-ROM/DVD Filesystems
778#
779# CONFIG_ISO9660_FS is not set
780# CONFIG_UDF_FS is not set
781
782#
783# DOS/FAT/NT Filesystems
784#
785# CONFIG_MSDOS_FS is not set
786# CONFIG_VFAT_FS is not set
787# CONFIG_NTFS_FS is not set
788
789#
790# Pseudo filesystems
791#
792CONFIG_PROC_FS=y
793CONFIG_PROC_KCORE=y
794CONFIG_PROC_SYSCTL=y
795CONFIG_PROC_PAGE_MONITOR=y
796CONFIG_SYSFS=y
797CONFIG_TMPFS=y
798# CONFIG_TMPFS_POSIX_ACL is not set
799# CONFIG_HUGETLBFS is not set
800# CONFIG_HUGETLB_PAGE is not set
801# CONFIG_CONFIGFS_FS is not set
802CONFIG_MISC_FILESYSTEMS=y
803# CONFIG_ADFS_FS is not set
804# CONFIG_AFFS_FS is not set
805# CONFIG_HFS_FS is not set
806# CONFIG_HFSPLUS_FS is not set
807# CONFIG_BEFS_FS is not set
808# CONFIG_BFS_FS is not set
809# CONFIG_EFS_FS is not set
810CONFIG_JFFS2_FS=y
811CONFIG_JFFS2_FS_DEBUG=0
812# CONFIG_JFFS2_FS_WRITEBUFFER is not set
813# CONFIG_JFFS2_SUMMARY is not set
814# CONFIG_JFFS2_FS_XATTR is not set
815# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
816CONFIG_JFFS2_ZLIB=y
817# CONFIG_JFFS2_LZO is not set
818CONFIG_JFFS2_RTIME=y
819# CONFIG_JFFS2_RUBIN is not set
820# CONFIG_CRAMFS is not set
821# CONFIG_SQUASHFS is not set
822# CONFIG_VXFS_FS is not set
823# CONFIG_MINIX_FS is not set
824# CONFIG_OMFS_FS is not set
825# CONFIG_HPFS_FS is not set
826# CONFIG_QNX4FS_FS is not set
827# CONFIG_ROMFS_FS is not set
828# CONFIG_SYSV_FS is not set
829# CONFIG_UFS_FS is not set
830CONFIG_NETWORK_FILESYSTEMS=y
831CONFIG_NFS_FS=y
832CONFIG_NFS_V3=y
833# CONFIG_NFS_V3_ACL is not set
834# CONFIG_NFS_V4 is not set
835# CONFIG_NFSD is not set
836CONFIG_LOCKD=y
837CONFIG_LOCKD_V4=y
838CONFIG_NFS_COMMON=y
839CONFIG_SUNRPC=y
840# CONFIG_SUNRPC_REGISTER_V4 is not set
841# CONFIG_RPCSEC_GSS_KRB5 is not set
842# CONFIG_RPCSEC_GSS_SPKM3 is not set
843# CONFIG_SMB_FS is not set
844# CONFIG_CIFS is not set
845# CONFIG_NCP_FS is not set
846# CONFIG_CODA_FS is not set
847# CONFIG_AFS_FS is not set
848
849#
850# Partition Types
851#
852# CONFIG_PARTITION_ADVANCED is not set
853CONFIG_MSDOS_PARTITION=y
854# CONFIG_NLS is not set
855# CONFIG_DLM is not set
856
857#
858# Kernel hacking
859#
860CONFIG_TRACE_IRQFLAGS_SUPPORT=y
861# CONFIG_PRINTK_TIME is not set
862CONFIG_ENABLE_WARN_DEPRECATED=y
863CONFIG_ENABLE_MUST_CHECK=y
864CONFIG_FRAME_WARN=1024
865# CONFIG_MAGIC_SYSRQ is not set
866# CONFIG_UNUSED_SYMBOLS is not set
867# CONFIG_DEBUG_FS is not set
868# CONFIG_HEADERS_CHECK is not set
869CONFIG_DEBUG_KERNEL=y
870CONFIG_DEBUG_SHIRQ=y
871CONFIG_DETECT_SOFTLOCKUP=y
872# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
873CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
874# CONFIG_SCHED_DEBUG is not set
875# CONFIG_SCHEDSTATS is not set
876# CONFIG_TIMER_STATS is not set
877# CONFIG_DEBUG_OBJECTS is not set
878# CONFIG_DEBUG_SLAB is not set
879CONFIG_DEBUG_PREEMPT=y
880CONFIG_DEBUG_RT_MUTEXES=y
881CONFIG_DEBUG_PI_LIST=y
882# CONFIG_RT_MUTEX_TESTER is not set
883CONFIG_DEBUG_SPINLOCK=y
884CONFIG_DEBUG_MUTEXES=y
885CONFIG_DEBUG_LOCK_ALLOC=y
886# CONFIG_PROVE_LOCKING is not set
887CONFIG_LOCKDEP=y
888# CONFIG_LOCK_STAT is not set
889# CONFIG_DEBUG_LOCKDEP is not set
890CONFIG_DEBUG_SPINLOCK_SLEEP=y
891# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
892CONFIG_STACKTRACE=y
893# CONFIG_DEBUG_KOBJECT is not set
894CONFIG_DEBUG_BUGVERBOSE=y
895CONFIG_DEBUG_INFO=y
896# CONFIG_DEBUG_VM is not set
897# CONFIG_DEBUG_WRITECOUNT is not set
898# CONFIG_DEBUG_MEMORY_INIT is not set
899# CONFIG_DEBUG_LIST is not set
900CONFIG_DEBUG_SG=y
901# CONFIG_DEBUG_NOTIFIERS is not set
902CONFIG_FRAME_POINTER=y
903# CONFIG_RCU_TORTURE_TEST is not set
904# CONFIG_RCU_CPU_STALL_DETECTOR is not set
905# CONFIG_BACKTRACE_SELF_TEST is not set
906# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
907# CONFIG_FAULT_INJECTION is not set
908# CONFIG_LATENCYTOP is not set
909CONFIG_SYSCTL_SYSCALL_CHECK=y
910CONFIG_HAVE_FUNCTION_TRACER=y
911CONFIG_HAVE_DYNAMIC_FTRACE=y
912CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
913
914#
915# Tracers
916#
917# CONFIG_FUNCTION_TRACER is not set
918# CONFIG_IRQSOFF_TRACER is not set
919# CONFIG_PREEMPT_TRACER is not set
920# CONFIG_SCHED_TRACER is not set
921# CONFIG_CONTEXT_SWITCH_TRACER is not set
922# CONFIG_BOOT_TRACER is not set
923# CONFIG_TRACE_BRANCH_PROFILING is not set
924# CONFIG_STACK_TRACER is not set
925# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
926# CONFIG_SAMPLES is not set
927CONFIG_HAVE_ARCH_KGDB=y
928# CONFIG_KGDB is not set
929# CONFIG_SH_STANDARD_BIOS is not set
930CONFIG_EARLY_SCIF_CONSOLE=y
931CONFIG_EARLY_SCIF_CONSOLE_PORT=0x00000000
932CONFIG_EARLY_PRINTK=y
933# CONFIG_DEBUG_BOOTMEM is not set
934# CONFIG_DEBUG_STACKOVERFLOW is not set
935# CONFIG_DEBUG_STACK_USAGE is not set
936# CONFIG_4KSTACKS is not set
937# CONFIG_IRQSTACKS is not set
938CONFIG_DUMP_CODE=y
939# CONFIG_SH_NO_BSS_INIT is not set
940# CONFIG_MORE_COMPILE_OPTIONS is not set
941
942#
943# Security options
944#
945# CONFIG_KEYS is not set
946# CONFIG_SECURITY is not set
947# CONFIG_SECURITYFS is not set
948# CONFIG_SECURITY_FILE_CAPABILITIES is not set
949# CONFIG_CRYPTO is not set
950
951#
952# Library routines
953#
954CONFIG_BITREVERSE=y
955CONFIG_GENERIC_FIND_LAST_BIT=y
956# CONFIG_CRC_CCITT is not set
957# CONFIG_CRC16 is not set
958# CONFIG_CRC_T10DIF is not set
959# CONFIG_CRC_ITU_T is not set
960CONFIG_CRC32=y
961# CONFIG_CRC7 is not set
962# CONFIG_LIBCRC32C is not set
963CONFIG_AUDIT_GENERIC=y
964CONFIG_ZLIB_INFLATE=y
965CONFIG_ZLIB_DEFLATE=y
966CONFIG_PLIST=y
967CONFIG_HAS_IOMEM=y
968CONFIG_HAS_IOPORT=y
969CONFIG_HAS_DMA=y
diff --git a/arch/sh/configs/sh7785lcr_32bit_defconfig b/arch/sh/configs/sh7785lcr_32bit_defconfig
new file mode 100644
index 000000000000..54e1dee8e24a
--- /dev/null
+++ b/arch/sh/configs/sh7785lcr_32bit_defconfig
@@ -0,0 +1,1553 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc4
4# Fri Feb 20 18:25:29 2009
5#
6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y
8CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_BUG=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
15CONFIG_GENERIC_IRQ_PROBE=y
16# CONFIG_GENERIC_GPIO is not set
17CONFIG_GENERIC_TIME=y
18CONFIG_GENERIC_CLOCKEVENTS=y
19# CONFIG_ARCH_SUSPEND_POSSIBLE is not set
20# CONFIG_ARCH_HIBERNATION_POSSIBLE is not set
21CONFIG_SYS_SUPPORTS_NUMA=y
22CONFIG_SYS_SUPPORTS_PCI=y
23CONFIG_STACKTRACE_SUPPORT=y
24CONFIG_LOCKDEP_SUPPORT=y
25CONFIG_HAVE_LATENCYTOP_SUPPORT=y
26# CONFIG_ARCH_HAS_ILOG2_U32 is not set
27# CONFIG_ARCH_HAS_ILOG2_U64 is not set
28CONFIG_ARCH_NO_VIRT_TO_BUS=y
29CONFIG_IO_TRAPPED=y
30CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
31
32#
33# General setup
34#
35CONFIG_EXPERIMENTAL=y
36CONFIG_BROKEN_ON_SMP=y
37CONFIG_LOCK_KERNEL=y
38CONFIG_INIT_ENV_ARG_LIMIT=32
39CONFIG_LOCALVERSION=""
40CONFIG_LOCALVERSION_AUTO=y
41CONFIG_SWAP=y
42CONFIG_SYSVIPC=y
43CONFIG_SYSVIPC_SYSCTL=y
44# CONFIG_POSIX_MQUEUE is not set
45CONFIG_BSD_PROCESS_ACCT=y
46# CONFIG_BSD_PROCESS_ACCT_V3 is not set
47# CONFIG_TASKSTATS is not set
48# CONFIG_AUDIT is not set
49
50#
51# RCU Subsystem
52#
53CONFIG_CLASSIC_RCU=y
54# CONFIG_TREE_RCU is not set
55# CONFIG_PREEMPT_RCU is not set
56# CONFIG_TREE_RCU_TRACE is not set
57# CONFIG_PREEMPT_RCU_TRACE is not set
58CONFIG_IKCONFIG=y
59CONFIG_IKCONFIG_PROC=y
60CONFIG_LOG_BUF_SHIFT=14
61CONFIG_GROUP_SCHED=y
62CONFIG_FAIR_GROUP_SCHED=y
63# CONFIG_RT_GROUP_SCHED is not set
64CONFIG_USER_SCHED=y
65# CONFIG_CGROUP_SCHED is not set
66# CONFIG_CGROUPS is not set
67CONFIG_SYSFS_DEPRECATED=y
68CONFIG_SYSFS_DEPRECATED_V2=y
69# CONFIG_RELAY is not set
70# CONFIG_NAMESPACES is not set
71# CONFIG_BLK_DEV_INITRD is not set
72CONFIG_CC_OPTIMIZE_FOR_SIZE=y
73CONFIG_SYSCTL=y
74CONFIG_EMBEDDED=y
75CONFIG_UID16=y
76CONFIG_SYSCTL_SYSCALL=y
77CONFIG_KALLSYMS=y
78# CONFIG_KALLSYMS_ALL is not set
79# CONFIG_KALLSYMS_EXTRA_PASS is not set
80CONFIG_HOTPLUG=y
81CONFIG_PRINTK=y
82CONFIG_BUG=y
83CONFIG_ELF_CORE=y
84CONFIG_COMPAT_BRK=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_ANON_INODES=y
88CONFIG_EPOLL=y
89CONFIG_SIGNALFD=y
90CONFIG_TIMERFD=y
91CONFIG_EVENTFD=y
92CONFIG_SHMEM=y
93CONFIG_AIO=y
94CONFIG_VM_EVENT_COUNTERS=y
95CONFIG_PCI_QUIRKS=y
96CONFIG_SLAB=y
97# CONFIG_SLUB is not set
98# CONFIG_SLOB is not set
99CONFIG_PROFILING=y
100# CONFIG_OPROFILE is not set
101CONFIG_HAVE_OPROFILE=y
102# CONFIG_KPROBES is not set
103CONFIG_HAVE_IOREMAP_PROT=y
104CONFIG_HAVE_KPROBES=y
105CONFIG_HAVE_KRETPROBES=y
106CONFIG_HAVE_ARCH_TRACEHOOK=y
107CONFIG_HAVE_CLK=y
108CONFIG_HAVE_GENERIC_DMA_COHERENT=y
109CONFIG_SLABINFO=y
110CONFIG_RT_MUTEXES=y
111CONFIG_BASE_SMALL=0
112CONFIG_MODULES=y
113# CONFIG_MODULE_FORCE_LOAD is not set
114CONFIG_MODULE_UNLOAD=y
115# CONFIG_MODULE_FORCE_UNLOAD is not set
116# CONFIG_MODVERSIONS is not set
117# CONFIG_MODULE_SRCVERSION_ALL is not set
118CONFIG_BLOCK=y
119# CONFIG_LBD is not set
120# CONFIG_BLK_DEV_IO_TRACE is not set
121# CONFIG_BLK_DEV_BSG is not set
122# CONFIG_BLK_DEV_INTEGRITY is not set
123
124#
125# IO Schedulers
126#
127CONFIG_IOSCHED_NOOP=y
128CONFIG_IOSCHED_AS=y
129CONFIG_IOSCHED_DEADLINE=y
130CONFIG_IOSCHED_CFQ=y
131# CONFIG_DEFAULT_AS is not set
132# CONFIG_DEFAULT_DEADLINE is not set
133CONFIG_DEFAULT_CFQ=y
134# CONFIG_DEFAULT_NOOP is not set
135CONFIG_DEFAULT_IOSCHED="cfq"
136# CONFIG_FREEZER is not set
137
138#
139# System type
140#
141CONFIG_CPU_SH4=y
142CONFIG_CPU_SH4A=y
143CONFIG_CPU_SHX2=y
144# CONFIG_CPU_SUBTYPE_SH7619 is not set
145# CONFIG_CPU_SUBTYPE_SH7201 is not set
146# CONFIG_CPU_SUBTYPE_SH7203 is not set
147# CONFIG_CPU_SUBTYPE_SH7206 is not set
148# CONFIG_CPU_SUBTYPE_SH7263 is not set
149# CONFIG_CPU_SUBTYPE_MXG is not set
150# CONFIG_CPU_SUBTYPE_SH7705 is not set
151# CONFIG_CPU_SUBTYPE_SH7706 is not set
152# CONFIG_CPU_SUBTYPE_SH7707 is not set
153# CONFIG_CPU_SUBTYPE_SH7708 is not set
154# CONFIG_CPU_SUBTYPE_SH7709 is not set
155# CONFIG_CPU_SUBTYPE_SH7710 is not set
156# CONFIG_CPU_SUBTYPE_SH7712 is not set
157# CONFIG_CPU_SUBTYPE_SH7720 is not set
158# CONFIG_CPU_SUBTYPE_SH7721 is not set
159# CONFIG_CPU_SUBTYPE_SH7750 is not set
160# CONFIG_CPU_SUBTYPE_SH7091 is not set
161# CONFIG_CPU_SUBTYPE_SH7750R is not set
162# CONFIG_CPU_SUBTYPE_SH7750S is not set
163# CONFIG_CPU_SUBTYPE_SH7751 is not set
164# CONFIG_CPU_SUBTYPE_SH7751R is not set
165# CONFIG_CPU_SUBTYPE_SH7760 is not set
166# CONFIG_CPU_SUBTYPE_SH4_202 is not set
167# CONFIG_CPU_SUBTYPE_SH7723 is not set
168# CONFIG_CPU_SUBTYPE_SH7763 is not set
169# CONFIG_CPU_SUBTYPE_SH7770 is not set
170# CONFIG_CPU_SUBTYPE_SH7780 is not set
171CONFIG_CPU_SUBTYPE_SH7785=y
172# CONFIG_CPU_SUBTYPE_SHX3 is not set
173# CONFIG_CPU_SUBTYPE_SH7343 is not set
174# CONFIG_CPU_SUBTYPE_SH7722 is not set
175# CONFIG_CPU_SUBTYPE_SH7366 is not set
176# CONFIG_CPU_SUBTYPE_SH5_101 is not set
177# CONFIG_CPU_SUBTYPE_SH5_103 is not set
178
179#
180# Memory management options
181#
182CONFIG_QUICKLIST=y
183CONFIG_MMU=y
184CONFIG_PAGE_OFFSET=0x80000000
185CONFIG_MEMORY_START=0x40000000
186CONFIG_MEMORY_SIZE=0x20000000
187# CONFIG_29BIT is not set
188CONFIG_32BIT=y
189CONFIG_PMB_ENABLE=y
190# CONFIG_PMB is not set
191CONFIG_PMB_FIXED=y
192# CONFIG_X2TLB is not set
193CONFIG_VSYSCALL=y
194# CONFIG_NUMA is not set
195CONFIG_ARCH_FLATMEM_ENABLE=y
196CONFIG_ARCH_SPARSEMEM_ENABLE=y
197CONFIG_ARCH_SPARSEMEM_DEFAULT=y
198CONFIG_MAX_ACTIVE_REGIONS=2
199CONFIG_ARCH_POPULATES_NODE_MAP=y
200CONFIG_ARCH_SELECT_MEMORY_MODEL=y
201CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
202CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
203CONFIG_PAGE_SIZE_4KB=y
204# CONFIG_PAGE_SIZE_8KB is not set
205# CONFIG_PAGE_SIZE_16KB is not set
206# CONFIG_PAGE_SIZE_64KB is not set
207CONFIG_ENTRY_OFFSET=0x00001000
208CONFIG_SELECT_MEMORY_MODEL=y
209# CONFIG_FLATMEM_MANUAL is not set
210# CONFIG_DISCONTIGMEM_MANUAL is not set
211CONFIG_SPARSEMEM_MANUAL=y
212CONFIG_SPARSEMEM=y
213CONFIG_HAVE_MEMORY_PRESENT=y
214CONFIG_SPARSEMEM_STATIC=y
215# CONFIG_MEMORY_HOTPLUG is not set
216CONFIG_PAGEFLAGS_EXTENDED=y
217CONFIG_SPLIT_PTLOCK_CPUS=4
218CONFIG_MIGRATION=y
219# CONFIG_PHYS_ADDR_T_64BIT is not set
220CONFIG_ZONE_DMA_FLAG=0
221CONFIG_NR_QUICK=2
222CONFIG_UNEVICTABLE_LRU=y
223
224#
225# Cache configuration
226#
227# CONFIG_SH_DIRECT_MAPPED is not set
228CONFIG_CACHE_WRITEBACK=y
229# CONFIG_CACHE_WRITETHROUGH is not set
230# CONFIG_CACHE_OFF is not set
231
232#
233# Processor features
234#
235CONFIG_CPU_LITTLE_ENDIAN=y
236# CONFIG_CPU_BIG_ENDIAN is not set
237CONFIG_SH_FPU=y
238CONFIG_SH_STORE_QUEUES=y
239CONFIG_CPU_HAS_INTEVT=y
240CONFIG_CPU_HAS_SR_RB=y
241CONFIG_CPU_HAS_PTEA=y
242CONFIG_CPU_HAS_FPU=y
243
244#
245# Board support
246#
247# CONFIG_SH_HIGHLANDER is not set
248CONFIG_SH_SH7785LCR=y
249
250#
251# Timer and clock configuration
252#
253CONFIG_SH_TMU=y
254CONFIG_SH_TIMER_IRQ=28
255CONFIG_SH_PCLK_FREQ=50000000
256CONFIG_TICK_ONESHOT=y
257# CONFIG_NO_HZ is not set
258CONFIG_HIGH_RES_TIMERS=y
259CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
260
261#
262# CPU Frequency scaling
263#
264# CONFIG_CPU_FREQ is not set
265
266#
267# DMA support
268#
269# CONFIG_SH_DMA is not set
270
271#
272# Companion Chips
273#
274
275#
276# Additional SuperH Device Drivers
277#
278CONFIG_HEARTBEAT=y
279# CONFIG_PUSH_SWITCH is not set
280
281#
282# Kernel features
283#
284# CONFIG_HZ_100 is not set
285CONFIG_HZ_250=y
286# CONFIG_HZ_300 is not set
287# CONFIG_HZ_1000 is not set
288CONFIG_HZ=250
289CONFIG_SCHED_HRTICK=y
290CONFIG_KEXEC=y
291# CONFIG_CRASH_DUMP is not set
292# CONFIG_SECCOMP is not set
293# CONFIG_PREEMPT_NONE is not set
294# CONFIG_PREEMPT_VOLUNTARY is not set
295CONFIG_PREEMPT=y
296CONFIG_GUSA=y
297
298#
299# Boot options
300#
301CONFIG_ZERO_PAGE_OFFSET=0x00001000
302CONFIG_BOOT_LINK_OFFSET=0x00800000
303# CONFIG_CMDLINE_BOOL is not set
304
305#
306# Bus options
307#
308CONFIG_PCI=y
309CONFIG_SH_PCIDMA_NONCOHERENT=y
310CONFIG_PCI_AUTO=y
311CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
312# CONFIG_PCIEPORTBUS is not set
313# CONFIG_ARCH_SUPPORTS_MSI is not set
314CONFIG_PCI_LEGACY=y
315# CONFIG_PCI_DEBUG is not set
316# CONFIG_PCI_STUB is not set
317# CONFIG_PCCARD is not set
318# CONFIG_HOTPLUG_PCI is not set
319
320#
321# Executable file formats
322#
323CONFIG_BINFMT_ELF=y
324# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
325# CONFIG_HAVE_AOUT is not set
326# CONFIG_BINFMT_MISC is not set
327
328#
329# Power management options (EXPERIMENTAL)
330#
331# CONFIG_PM is not set
332# CONFIG_CPU_IDLE is not set
333CONFIG_NET=y
334
335#
336# Networking options
337#
338CONFIG_COMPAT_NET_DEV_OPS=y
339CONFIG_PACKET=y
340# CONFIG_PACKET_MMAP is not set
341CONFIG_UNIX=y
342CONFIG_XFRM=y
343# CONFIG_XFRM_USER is not set
344# CONFIG_XFRM_SUB_POLICY is not set
345# CONFIG_XFRM_MIGRATE is not set
346# CONFIG_XFRM_STATISTICS is not set
347# CONFIG_NET_KEY is not set
348CONFIG_INET=y
349# CONFIG_IP_MULTICAST is not set
350CONFIG_IP_ADVANCED_ROUTER=y
351CONFIG_ASK_IP_FIB_HASH=y
352# CONFIG_IP_FIB_TRIE is not set
353CONFIG_IP_FIB_HASH=y
354# CONFIG_IP_MULTIPLE_TABLES is not set
355# CONFIG_IP_ROUTE_MULTIPATH is not set
356# CONFIG_IP_ROUTE_VERBOSE is not set
357CONFIG_IP_PNP=y
358CONFIG_IP_PNP_DHCP=y
359# CONFIG_IP_PNP_BOOTP is not set
360# CONFIG_IP_PNP_RARP is not set
361# CONFIG_NET_IPIP is not set
362# CONFIG_NET_IPGRE is not set
363# CONFIG_ARPD is not set
364# CONFIG_SYN_COOKIES is not set
365# CONFIG_INET_AH is not set
366# CONFIG_INET_ESP is not set
367# CONFIG_INET_IPCOMP is not set
368# CONFIG_INET_XFRM_TUNNEL is not set
369# CONFIG_INET_TUNNEL is not set
370CONFIG_INET_XFRM_MODE_TRANSPORT=y
371CONFIG_INET_XFRM_MODE_TUNNEL=y
372CONFIG_INET_XFRM_MODE_BEET=y
373# CONFIG_INET_LRO is not set
374CONFIG_INET_DIAG=y
375CONFIG_INET_TCP_DIAG=y
376# CONFIG_TCP_CONG_ADVANCED is not set
377CONFIG_TCP_CONG_CUBIC=y
378CONFIG_DEFAULT_TCP_CONG="cubic"
379# CONFIG_TCP_MD5SIG is not set
380# CONFIG_IPV6 is not set
381# CONFIG_NETWORK_SECMARK is not set
382# CONFIG_NETFILTER is not set
383# CONFIG_IP_DCCP is not set
384# CONFIG_IP_SCTP is not set
385# CONFIG_TIPC is not set
386# CONFIG_ATM is not set
387# CONFIG_BRIDGE is not set
388# CONFIG_NET_DSA is not set
389# CONFIG_VLAN_8021Q is not set
390# CONFIG_DECNET is not set
391# CONFIG_LLC2 is not set
392# CONFIG_IPX is not set
393# CONFIG_ATALK is not set
394# CONFIG_X25 is not set
395# CONFIG_LAPB is not set
396# CONFIG_ECONET is not set
397# CONFIG_WAN_ROUTER is not set
398# CONFIG_NET_SCHED is not set
399# CONFIG_DCB is not set
400
401#
402# Network testing
403#
404# CONFIG_NET_PKTGEN is not set
405# CONFIG_HAMRADIO is not set
406# CONFIG_CAN is not set
407# CONFIG_IRDA is not set
408# CONFIG_BT is not set
409# CONFIG_AF_RXRPC is not set
410# CONFIG_PHONET is not set
411CONFIG_WIRELESS=y
412# CONFIG_CFG80211 is not set
413# CONFIG_WIRELESS_OLD_REGULATORY is not set
414CONFIG_WIRELESS_EXT=y
415CONFIG_WIRELESS_EXT_SYSFS=y
416# CONFIG_LIB80211 is not set
417# CONFIG_MAC80211 is not set
418# CONFIG_WIMAX is not set
419# CONFIG_RFKILL is not set
420# CONFIG_NET_9P is not set
421
422#
423# Device Drivers
424#
425
426#
427# Generic Driver Options
428#
429CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
430CONFIG_STANDALONE=y
431CONFIG_PREVENT_FIRMWARE_BUILD=y
432# CONFIG_FW_LOADER is not set
433# CONFIG_DEBUG_DRIVER is not set
434# CONFIG_DEBUG_DEVRES is not set
435# CONFIG_SYS_HYPERVISOR is not set
436# CONFIG_CONNECTOR is not set
437CONFIG_MTD=y
438# CONFIG_MTD_DEBUG is not set
439CONFIG_MTD_CONCAT=y
440CONFIG_MTD_PARTITIONS=y
441# CONFIG_MTD_TESTS is not set
442# CONFIG_MTD_REDBOOT_PARTS is not set
443# CONFIG_MTD_CMDLINE_PARTS is not set
444# CONFIG_MTD_AR7_PARTS is not set
445
446#
447# User Modules And Translation Layers
448#
449CONFIG_MTD_CHAR=y
450CONFIG_MTD_BLKDEVS=y
451CONFIG_MTD_BLOCK=y
452# CONFIG_FTL is not set
453# CONFIG_NFTL is not set
454# CONFIG_INFTL is not set
455# CONFIG_RFD_FTL is not set
456# CONFIG_SSFDC is not set
457# CONFIG_MTD_OOPS is not set
458
459#
460# RAM/ROM/Flash chip drivers
461#
462CONFIG_MTD_CFI=y
463# CONFIG_MTD_JEDECPROBE is not set
464CONFIG_MTD_GEN_PROBE=y
465# CONFIG_MTD_CFI_ADV_OPTIONS is not set
466CONFIG_MTD_MAP_BANK_WIDTH_1=y
467CONFIG_MTD_MAP_BANK_WIDTH_2=y
468CONFIG_MTD_MAP_BANK_WIDTH_4=y
469# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
470# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
471# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
472CONFIG_MTD_CFI_I1=y
473CONFIG_MTD_CFI_I2=y
474# CONFIG_MTD_CFI_I4 is not set
475# CONFIG_MTD_CFI_I8 is not set
476# CONFIG_MTD_CFI_INTELEXT is not set
477CONFIG_MTD_CFI_AMDSTD=y
478# CONFIG_MTD_CFI_STAA is not set
479CONFIG_MTD_CFI_UTIL=y
480# CONFIG_MTD_RAM is not set
481# CONFIG_MTD_ROM is not set
482# CONFIG_MTD_ABSENT is not set
483
484#
485# Mapping drivers for chip access
486#
487# CONFIG_MTD_COMPLEX_MAPPINGS is not set
488CONFIG_MTD_PHYSMAP=y
489# CONFIG_MTD_PHYSMAP_COMPAT is not set
490# CONFIG_MTD_INTEL_VR_NOR is not set
491# CONFIG_MTD_PLATRAM is not set
492
493#
494# Self-contained MTD device drivers
495#
496# CONFIG_MTD_PMC551 is not set
497# CONFIG_MTD_SLRAM is not set
498# CONFIG_MTD_PHRAM is not set
499# CONFIG_MTD_MTDRAM is not set
500# CONFIG_MTD_BLOCK2MTD is not set
501
502#
503# Disk-On-Chip Device Drivers
504#
505# CONFIG_MTD_DOC2000 is not set
506# CONFIG_MTD_DOC2001 is not set
507# CONFIG_MTD_DOC2001PLUS is not set
508# CONFIG_MTD_NAND is not set
509# CONFIG_MTD_ONENAND is not set
510
511#
512# LPDDR flash memory drivers
513#
514# CONFIG_MTD_LPDDR is not set
515# CONFIG_MTD_QINFO_PROBE is not set
516
517#
518# UBI - Unsorted block images
519#
520# CONFIG_MTD_UBI is not set
521# CONFIG_PARPORT is not set
522CONFIG_BLK_DEV=y
523# CONFIG_BLK_CPQ_CISS_DA is not set
524# CONFIG_BLK_DEV_DAC960 is not set
525# CONFIG_BLK_DEV_UMEM is not set
526# CONFIG_BLK_DEV_COW_COMMON is not set
527# CONFIG_BLK_DEV_LOOP is not set
528# CONFIG_BLK_DEV_NBD is not set
529# CONFIG_BLK_DEV_SX8 is not set
530# CONFIG_BLK_DEV_UB is not set
531CONFIG_BLK_DEV_RAM=y
532CONFIG_BLK_DEV_RAM_COUNT=16
533CONFIG_BLK_DEV_RAM_SIZE=4096
534# CONFIG_BLK_DEV_XIP is not set
535# CONFIG_CDROM_PKTCDVD is not set
536# CONFIG_ATA_OVER_ETH is not set
537# CONFIG_BLK_DEV_HD is not set
538# CONFIG_MISC_DEVICES is not set
539CONFIG_HAVE_IDE=y
540# CONFIG_IDE is not set
541
542#
543# SCSI device support
544#
545# CONFIG_RAID_ATTRS is not set
546CONFIG_SCSI=y
547CONFIG_SCSI_DMA=y
548# CONFIG_SCSI_TGT is not set
549# CONFIG_SCSI_NETLINK is not set
550CONFIG_SCSI_PROC_FS=y
551
552#
553# SCSI support type (disk, tape, CD-ROM)
554#
555CONFIG_BLK_DEV_SD=y
556# CONFIG_CHR_DEV_ST is not set
557# CONFIG_CHR_DEV_OSST is not set
558# CONFIG_BLK_DEV_SR is not set
559# CONFIG_CHR_DEV_SG is not set
560# CONFIG_CHR_DEV_SCH is not set
561
562#
563# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
564#
565# CONFIG_SCSI_MULTI_LUN is not set
566# CONFIG_SCSI_CONSTANTS is not set
567# CONFIG_SCSI_LOGGING is not set
568# CONFIG_SCSI_SCAN_ASYNC is not set
569CONFIG_SCSI_WAIT_SCAN=m
570
571#
572# SCSI Transports
573#
574# CONFIG_SCSI_SPI_ATTRS is not set
575# CONFIG_SCSI_FC_ATTRS is not set
576# CONFIG_SCSI_ISCSI_ATTRS is not set
577# CONFIG_SCSI_SAS_LIBSAS is not set
578# CONFIG_SCSI_SRP_ATTRS is not set
579# CONFIG_SCSI_LOWLEVEL is not set
580# CONFIG_SCSI_DH is not set
581CONFIG_ATA=y
582# CONFIG_ATA_NONSTANDARD is not set
583CONFIG_SATA_PMP=y
584# CONFIG_SATA_AHCI is not set
585# CONFIG_SATA_SIL24 is not set
586CONFIG_ATA_SFF=y
587# CONFIG_SATA_SVW is not set
588# CONFIG_ATA_PIIX is not set
589# CONFIG_SATA_MV is not set
590# CONFIG_SATA_NV is not set
591# CONFIG_PDC_ADMA is not set
592# CONFIG_SATA_QSTOR is not set
593# CONFIG_SATA_PROMISE is not set
594# CONFIG_SATA_SX4 is not set
595CONFIG_SATA_SIL=y
596# CONFIG_SATA_SIS is not set
597# CONFIG_SATA_ULI is not set
598# CONFIG_SATA_VIA is not set
599# CONFIG_SATA_VITESSE is not set
600# CONFIG_SATA_INIC162X is not set
601# CONFIG_PATA_ALI is not set
602# CONFIG_PATA_AMD is not set
603# CONFIG_PATA_ARTOP is not set
604# CONFIG_PATA_ATIIXP is not set
605# CONFIG_PATA_CMD640_PCI is not set
606# CONFIG_PATA_CMD64X is not set
607# CONFIG_PATA_CS5520 is not set
608# CONFIG_PATA_CS5530 is not set
609# CONFIG_PATA_CYPRESS is not set
610# CONFIG_PATA_EFAR is not set
611# CONFIG_ATA_GENERIC is not set
612# CONFIG_PATA_HPT366 is not set
613# CONFIG_PATA_HPT37X is not set
614# CONFIG_PATA_HPT3X2N is not set
615# CONFIG_PATA_HPT3X3 is not set
616# CONFIG_PATA_IT821X is not set
617# CONFIG_PATA_IT8213 is not set
618# CONFIG_PATA_JMICRON is not set
619# CONFIG_PATA_TRIFLEX is not set
620# CONFIG_PATA_MARVELL is not set
621# CONFIG_PATA_MPIIX is not set
622# CONFIG_PATA_OLDPIIX is not set
623# CONFIG_PATA_NETCELL is not set
624# CONFIG_PATA_NINJA32 is not set
625# CONFIG_PATA_NS87410 is not set
626# CONFIG_PATA_NS87415 is not set
627# CONFIG_PATA_OPTI is not set
628# CONFIG_PATA_OPTIDMA is not set
629# CONFIG_PATA_PDC_OLD is not set
630# CONFIG_PATA_RADISYS is not set
631# CONFIG_PATA_RZ1000 is not set
632# CONFIG_PATA_SC1200 is not set
633# CONFIG_PATA_SERVERWORKS is not set
634# CONFIG_PATA_PDC2027X is not set
635# CONFIG_PATA_SIL680 is not set
636# CONFIG_PATA_SIS is not set
637# CONFIG_PATA_VIA is not set
638# CONFIG_PATA_WINBOND is not set
639# CONFIG_PATA_PLATFORM is not set
640# CONFIG_PATA_SCH is not set
641# CONFIG_MD is not set
642# CONFIG_FUSION is not set
643
644#
645# IEEE 1394 (FireWire) support
646#
647
648#
649# Enable only one of the two stacks, unless you know what you are doing
650#
651# CONFIG_FIREWIRE is not set
652# CONFIG_IEEE1394 is not set
653# CONFIG_I2O is not set
654CONFIG_NETDEVICES=y
655# CONFIG_DUMMY is not set
656# CONFIG_BONDING is not set
657# CONFIG_MACVLAN is not set
658# CONFIG_EQUALIZER is not set
659# CONFIG_TUN is not set
660# CONFIG_VETH is not set
661# CONFIG_ARCNET is not set
662# CONFIG_NET_ETHERNET is not set
663CONFIG_MII=y
664CONFIG_NETDEV_1000=y
665# CONFIG_ACENIC is not set
666# CONFIG_DL2K is not set
667# CONFIG_E1000 is not set
668# CONFIG_E1000E is not set
669# CONFIG_IP1000 is not set
670# CONFIG_IGB is not set
671# CONFIG_NS83820 is not set
672# CONFIG_HAMACHI is not set
673# CONFIG_YELLOWFIN is not set
674CONFIG_R8169=y
675# CONFIG_SIS190 is not set
676# CONFIG_SKGE is not set
677# CONFIG_SKY2 is not set
678# CONFIG_VIA_VELOCITY is not set
679# CONFIG_TIGON3 is not set
680# CONFIG_BNX2 is not set
681# CONFIG_QLA3XXX is not set
682# CONFIG_ATL1 is not set
683# CONFIG_ATL1E is not set
684# CONFIG_JME is not set
685# CONFIG_NETDEV_10000 is not set
686# CONFIG_TR is not set
687
688#
689# Wireless LAN
690#
691# CONFIG_WLAN_PRE80211 is not set
692# CONFIG_WLAN_80211 is not set
693# CONFIG_IWLWIFI_LEDS is not set
694
695#
696# Enable WiMAX (Networking options) to see the WiMAX drivers
697#
698
699#
700# USB Network Adapters
701#
702# CONFIG_USB_CATC is not set
703# CONFIG_USB_KAWETH is not set
704# CONFIG_USB_PEGASUS is not set
705# CONFIG_USB_RTL8150 is not set
706# CONFIG_USB_USBNET is not set
707# CONFIG_WAN is not set
708# CONFIG_FDDI is not set
709# CONFIG_HIPPI is not set
710# CONFIG_PPP is not set
711# CONFIG_SLIP is not set
712# CONFIG_NET_FC is not set
713# CONFIG_NETCONSOLE is not set
714# CONFIG_NETPOLL is not set
715# CONFIG_NET_POLL_CONTROLLER is not set
716# CONFIG_ISDN is not set
717# CONFIG_PHONE is not set
718
719#
720# Input device support
721#
722CONFIG_INPUT=y
723CONFIG_INPUT_FF_MEMLESS=m
724# CONFIG_INPUT_POLLDEV is not set
725
726#
727# Userland interfaces
728#
729CONFIG_INPUT_MOUSEDEV=y
730# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
731CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
732CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
733# CONFIG_INPUT_JOYDEV is not set
734# CONFIG_INPUT_EVDEV is not set
735# CONFIG_INPUT_EVBUG is not set
736
737#
738# Input Device Drivers
739#
740CONFIG_INPUT_KEYBOARD=y
741# CONFIG_KEYBOARD_ATKBD is not set
742# CONFIG_KEYBOARD_SUNKBD is not set
743# CONFIG_KEYBOARD_LKKBD is not set
744# CONFIG_KEYBOARD_XTKBD is not set
745# CONFIG_KEYBOARD_NEWTON is not set
746# CONFIG_KEYBOARD_STOWAWAY is not set
747# CONFIG_KEYBOARD_SH_KEYSC is not set
748# CONFIG_INPUT_MOUSE is not set
749# CONFIG_INPUT_JOYSTICK is not set
750# CONFIG_INPUT_TABLET is not set
751# CONFIG_INPUT_TOUCHSCREEN is not set
752# CONFIG_INPUT_MISC is not set
753
754#
755# Hardware I/O ports
756#
757# CONFIG_SERIO is not set
758# CONFIG_GAMEPORT is not set
759
760#
761# Character devices
762#
763CONFIG_VT=y
764CONFIG_CONSOLE_TRANSLATIONS=y
765CONFIG_VT_CONSOLE=y
766CONFIG_HW_CONSOLE=y
767CONFIG_VT_HW_CONSOLE_BINDING=y
768CONFIG_DEVKMEM=y
769# CONFIG_SERIAL_NONSTANDARD is not set
770# CONFIG_NOZOMI is not set
771
772#
773# Serial drivers
774#
775# CONFIG_SERIAL_8250 is not set
776
777#
778# Non-8250 serial port support
779#
780CONFIG_SERIAL_SH_SCI=y
781CONFIG_SERIAL_SH_SCI_NR_UARTS=6
782CONFIG_SERIAL_SH_SCI_CONSOLE=y
783CONFIG_SERIAL_CORE=y
784CONFIG_SERIAL_CORE_CONSOLE=y
785# CONFIG_SERIAL_JSM is not set
786CONFIG_UNIX98_PTYS=y
787# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
788CONFIG_LEGACY_PTYS=y
789CONFIG_LEGACY_PTY_COUNT=256
790# CONFIG_IPMI_HANDLER is not set
791CONFIG_HW_RANDOM=y
792# CONFIG_R3964 is not set
793# CONFIG_APPLICOM is not set
794# CONFIG_RAW_DRIVER is not set
795# CONFIG_TCG_TPM is not set
796CONFIG_DEVPORT=y
797CONFIG_I2C=y
798CONFIG_I2C_BOARDINFO=y
799# CONFIG_I2C_CHARDEV is not set
800CONFIG_I2C_HELPER_AUTO=y
801CONFIG_I2C_ALGOPCA=y
802
803#
804# I2C Hardware Bus support
805#
806
807#
808# PC SMBus host controller drivers
809#
810# CONFIG_I2C_ALI1535 is not set
811# CONFIG_I2C_ALI1563 is not set
812# CONFIG_I2C_ALI15X3 is not set
813# CONFIG_I2C_AMD756 is not set
814# CONFIG_I2C_AMD8111 is not set
815# CONFIG_I2C_I801 is not set
816# CONFIG_I2C_ISCH is not set
817# CONFIG_I2C_PIIX4 is not set
818# CONFIG_I2C_NFORCE2 is not set
819# CONFIG_I2C_SIS5595 is not set
820# CONFIG_I2C_SIS630 is not set
821# CONFIG_I2C_SIS96X is not set
822# CONFIG_I2C_VIA is not set
823# CONFIG_I2C_VIAPRO is not set
824
825#
826# I2C system bus drivers (mostly embedded / system-on-chip)
827#
828# CONFIG_I2C_OCORES is not set
829# CONFIG_I2C_SH_MOBILE is not set
830# CONFIG_I2C_SIMTEC is not set
831
832#
833# External I2C/SMBus adapter drivers
834#
835# CONFIG_I2C_PARPORT_LIGHT is not set
836# CONFIG_I2C_TAOS_EVM is not set
837# CONFIG_I2C_TINY_USB is not set
838
839#
840# Graphics adapter I2C/DDC channel drivers
841#
842# CONFIG_I2C_VOODOO3 is not set
843
844#
845# Other I2C/SMBus bus drivers
846#
847CONFIG_I2C_PCA_PLATFORM=y
848# CONFIG_I2C_STUB is not set
849
850#
851# Miscellaneous I2C Chip support
852#
853# CONFIG_DS1682 is not set
854# CONFIG_SENSORS_PCF8574 is not set
855# CONFIG_PCF8575 is not set
856# CONFIG_SENSORS_PCA9539 is not set
857# CONFIG_SENSORS_PCF8591 is not set
858# CONFIG_SENSORS_MAX6875 is not set
859# CONFIG_SENSORS_TSL2550 is not set
860# CONFIG_I2C_DEBUG_CORE is not set
861# CONFIG_I2C_DEBUG_ALGO is not set
862# CONFIG_I2C_DEBUG_BUS is not set
863# CONFIG_I2C_DEBUG_CHIP is not set
864# CONFIG_SPI is not set
865# CONFIG_W1 is not set
866# CONFIG_POWER_SUPPLY is not set
867# CONFIG_HWMON is not set
868# CONFIG_THERMAL is not set
869# CONFIG_THERMAL_HWMON is not set
870# CONFIG_WATCHDOG is not set
871CONFIG_SSB_POSSIBLE=y
872
873#
874# Sonics Silicon Backplane
875#
876# CONFIG_SSB is not set
877
878#
879# Multifunction device drivers
880#
881# CONFIG_MFD_CORE is not set
882CONFIG_MFD_SM501=y
883# CONFIG_HTC_PASIC3 is not set
884# CONFIG_TWL4030_CORE is not set
885# CONFIG_MFD_TMIO is not set
886# CONFIG_PMIC_DA903X is not set
887# CONFIG_MFD_WM8400 is not set
888# CONFIG_MFD_WM8350_I2C is not set
889# CONFIG_MFD_PCF50633 is not set
890# CONFIG_REGULATOR is not set
891
892#
893# Multimedia devices
894#
895
896#
897# Multimedia core support
898#
899# CONFIG_VIDEO_DEV is not set
900# CONFIG_DVB_CORE is not set
901# CONFIG_VIDEO_MEDIA is not set
902
903#
904# Multimedia drivers
905#
906# CONFIG_DAB is not set
907
908#
909# Graphics support
910#
911# CONFIG_DRM is not set
912# CONFIG_VGASTATE is not set
913# CONFIG_VIDEO_OUTPUT_CONTROL is not set
914CONFIG_FB=y
915# CONFIG_FIRMWARE_EDID is not set
916# CONFIG_FB_DDC is not set
917# CONFIG_FB_BOOT_VESA_SUPPORT is not set
918CONFIG_FB_CFB_FILLRECT=y
919CONFIG_FB_CFB_COPYAREA=y
920CONFIG_FB_CFB_IMAGEBLIT=y
921# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
922CONFIG_FB_SYS_FILLRECT=m
923CONFIG_FB_SYS_COPYAREA=m
924CONFIG_FB_SYS_IMAGEBLIT=m
925# CONFIG_FB_FOREIGN_ENDIAN is not set
926CONFIG_FB_SYS_FOPS=m
927CONFIG_FB_DEFERRED_IO=y
928# CONFIG_FB_SVGALIB is not set
929# CONFIG_FB_MACMODES is not set
930# CONFIG_FB_BACKLIGHT is not set
931# CONFIG_FB_MODE_HELPERS is not set
932# CONFIG_FB_TILEBLITTING is not set
933
934#
935# Frame buffer hardware drivers
936#
937# CONFIG_FB_CIRRUS is not set
938# CONFIG_FB_PM2 is not set
939# CONFIG_FB_CYBER2000 is not set
940# CONFIG_FB_ASILIANT is not set
941# CONFIG_FB_IMSTT is not set
942# CONFIG_FB_S1D13XXX is not set
943# CONFIG_FB_NVIDIA is not set
944# CONFIG_FB_RIVA is not set
945# CONFIG_FB_MATROX is not set
946# CONFIG_FB_RADEON is not set
947# CONFIG_FB_ATY128 is not set
948# CONFIG_FB_ATY is not set
949# CONFIG_FB_S3 is not set
950# CONFIG_FB_SAVAGE is not set
951# CONFIG_FB_SIS is not set
952# CONFIG_FB_VIA is not set
953# CONFIG_FB_NEOMAGIC is not set
954# CONFIG_FB_KYRO is not set
955# CONFIG_FB_3DFX is not set
956# CONFIG_FB_VOODOO1 is not set
957# CONFIG_FB_VT8623 is not set
958# CONFIG_FB_TRIDENT is not set
959# CONFIG_FB_ARK is not set
960# CONFIG_FB_PM3 is not set
961# CONFIG_FB_CARMINE is not set
962CONFIG_FB_SH_MOBILE_LCDC=m
963CONFIG_FB_SM501=y
964# CONFIG_FB_VIRTUAL is not set
965# CONFIG_FB_METRONOME is not set
966# CONFIG_FB_MB862XX is not set
967# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
968
969#
970# Display device support
971#
972# CONFIG_DISPLAY_SUPPORT is not set
973
974#
975# Console display driver support
976#
977CONFIG_DUMMY_CONSOLE=y
978CONFIG_FRAMEBUFFER_CONSOLE=y
979# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
980# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
981# CONFIG_FONTS is not set
982CONFIG_FONT_8x8=y
983CONFIG_FONT_8x16=y
984CONFIG_LOGO=y
985# CONFIG_LOGO_LINUX_MONO is not set
986# CONFIG_LOGO_LINUX_VGA16 is not set
987CONFIG_LOGO_LINUX_CLUT224=y
988# CONFIG_LOGO_SUPERH_MONO is not set
989# CONFIG_LOGO_SUPERH_VGA16 is not set
990# CONFIG_LOGO_SUPERH_CLUT224 is not set
991# CONFIG_SOUND is not set
992CONFIG_HID_SUPPORT=y
993CONFIG_HID=y
994# CONFIG_HID_DEBUG is not set
995# CONFIG_HIDRAW is not set
996
997#
998# USB Input Devices
999#
1000CONFIG_USB_HID=y
1001# CONFIG_HID_PID is not set
1002# CONFIG_USB_HIDDEV is not set
1003
1004#
1005# Special HID drivers
1006#
1007CONFIG_HID_COMPAT=y
1008CONFIG_HID_A4TECH=y
1009CONFIG_HID_APPLE=y
1010CONFIG_HID_BELKIN=y
1011CONFIG_HID_CHERRY=y
1012CONFIG_HID_CHICONY=y
1013CONFIG_HID_CYPRESS=y
1014CONFIG_HID_EZKEY=y
1015CONFIG_HID_GYRATION=y
1016CONFIG_HID_LOGITECH=y
1017# CONFIG_LOGITECH_FF is not set
1018# CONFIG_LOGIRUMBLEPAD2_FF is not set
1019CONFIG_HID_MICROSOFT=y
1020CONFIG_HID_MONTEREY=y
1021# CONFIG_HID_NTRIG is not set
1022CONFIG_HID_PANTHERLORD=y
1023# CONFIG_PANTHERLORD_FF is not set
1024CONFIG_HID_PETALYNX=y
1025CONFIG_HID_SAMSUNG=y
1026CONFIG_HID_SONY=y
1027CONFIG_HID_SUNPLUS=y
1028# CONFIG_GREENASIA_FF is not set
1029# CONFIG_HID_TOPSEED is not set
1030CONFIG_THRUSTMASTER_FF=m
1031CONFIG_ZEROPLUS_FF=m
1032CONFIG_USB_SUPPORT=y
1033CONFIG_USB_ARCH_HAS_HCD=y
1034CONFIG_USB_ARCH_HAS_OHCI=y
1035CONFIG_USB_ARCH_HAS_EHCI=y
1036CONFIG_USB=y
1037# CONFIG_USB_DEBUG is not set
1038# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1039
1040#
1041# Miscellaneous USB options
1042#
1043CONFIG_USB_DEVICEFS=y
1044CONFIG_USB_DEVICE_CLASS=y
1045# CONFIG_USB_DYNAMIC_MINORS is not set
1046# CONFIG_USB_OTG is not set
1047# CONFIG_USB_OTG_WHITELIST is not set
1048# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1049CONFIG_USB_MON=y
1050# CONFIG_USB_WUSB is not set
1051# CONFIG_USB_WUSB_CBAF is not set
1052
1053#
1054# USB Host Controller Drivers
1055#
1056# CONFIG_USB_C67X00_HCD is not set
1057CONFIG_USB_EHCI_HCD=m
1058# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1059# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1060# CONFIG_USB_OXU210HP_HCD is not set
1061# CONFIG_USB_ISP116X_HCD is not set
1062# CONFIG_USB_ISP1760_HCD is not set
1063CONFIG_USB_OHCI_HCD=m
1064# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1065# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1066CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1067# CONFIG_USB_UHCI_HCD is not set
1068# CONFIG_USB_SL811_HCD is not set
1069CONFIG_USB_R8A66597_HCD=y
1070# CONFIG_USB_WHCI_HCD is not set
1071# CONFIG_USB_HWA_HCD is not set
1072
1073#
1074# USB Device Class drivers
1075#
1076# CONFIG_USB_ACM is not set
1077# CONFIG_USB_PRINTER is not set
1078# CONFIG_USB_WDM is not set
1079# CONFIG_USB_TMC is not set
1080
1081#
1082# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1083#
1084
1085#
1086# see USB_STORAGE Help for more information
1087#
1088CONFIG_USB_STORAGE=y
1089# CONFIG_USB_STORAGE_DEBUG is not set
1090# CONFIG_USB_STORAGE_DATAFAB is not set
1091# CONFIG_USB_STORAGE_FREECOM is not set
1092# CONFIG_USB_STORAGE_ISD200 is not set
1093# CONFIG_USB_STORAGE_USBAT is not set
1094# CONFIG_USB_STORAGE_SDDR09 is not set
1095# CONFIG_USB_STORAGE_SDDR55 is not set
1096# CONFIG_USB_STORAGE_JUMPSHOT is not set
1097# CONFIG_USB_STORAGE_ALAUDA is not set
1098# CONFIG_USB_STORAGE_ONETOUCH is not set
1099# CONFIG_USB_STORAGE_KARMA is not set
1100# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1101# CONFIG_USB_LIBUSUAL is not set
1102
1103#
1104# USB Imaging devices
1105#
1106# CONFIG_USB_MDC800 is not set
1107# CONFIG_USB_MICROTEK is not set
1108
1109#
1110# USB port drivers
1111#
1112# CONFIG_USB_SERIAL is not set
1113
1114#
1115# USB Miscellaneous drivers
1116#
1117# CONFIG_USB_EMI62 is not set
1118# CONFIG_USB_EMI26 is not set
1119# CONFIG_USB_ADUTUX is not set
1120# CONFIG_USB_SEVSEG is not set
1121# CONFIG_USB_RIO500 is not set
1122# CONFIG_USB_LEGOTOWER is not set
1123# CONFIG_USB_LCD is not set
1124# CONFIG_USB_BERRY_CHARGE is not set
1125# CONFIG_USB_LED is not set
1126# CONFIG_USB_CYPRESS_CY7C63 is not set
1127# CONFIG_USB_CYTHERM is not set
1128# CONFIG_USB_PHIDGET is not set
1129# CONFIG_USB_IDMOUSE is not set
1130# CONFIG_USB_FTDI_ELAN is not set
1131# CONFIG_USB_APPLEDISPLAY is not set
1132# CONFIG_USB_SISUSBVGA is not set
1133# CONFIG_USB_LD is not set
1134# CONFIG_USB_TRANCEVIBRATOR is not set
1135# CONFIG_USB_IOWARRIOR is not set
1136CONFIG_USB_TEST=m
1137# CONFIG_USB_ISIGHTFW is not set
1138# CONFIG_USB_VST is not set
1139# CONFIG_USB_GADGET is not set
1140
1141#
1142# OTG and related infrastructure
1143#
1144# CONFIG_UWB is not set
1145# CONFIG_MMC is not set
1146# CONFIG_MEMSTICK is not set
1147# CONFIG_NEW_LEDS is not set
1148# CONFIG_ACCESSIBILITY is not set
1149# CONFIG_INFINIBAND is not set
1150CONFIG_RTC_LIB=y
1151CONFIG_RTC_CLASS=y
1152CONFIG_RTC_HCTOSYS=y
1153CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1154# CONFIG_RTC_DEBUG is not set
1155
1156#
1157# RTC interfaces
1158#
1159CONFIG_RTC_INTF_SYSFS=y
1160CONFIG_RTC_INTF_PROC=y
1161CONFIG_RTC_INTF_DEV=y
1162# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1163# CONFIG_RTC_DRV_TEST is not set
1164
1165#
1166# I2C RTC drivers
1167#
1168# CONFIG_RTC_DRV_DS1307 is not set
1169# CONFIG_RTC_DRV_DS1374 is not set
1170# CONFIG_RTC_DRV_DS1672 is not set
1171# CONFIG_RTC_DRV_MAX6900 is not set
1172CONFIG_RTC_DRV_RS5C372=y
1173# CONFIG_RTC_DRV_ISL1208 is not set
1174# CONFIG_RTC_DRV_X1205 is not set
1175# CONFIG_RTC_DRV_PCF8563 is not set
1176# CONFIG_RTC_DRV_PCF8583 is not set
1177# CONFIG_RTC_DRV_M41T80 is not set
1178# CONFIG_RTC_DRV_S35390A is not set
1179# CONFIG_RTC_DRV_FM3130 is not set
1180# CONFIG_RTC_DRV_RX8581 is not set
1181
1182#
1183# SPI RTC drivers
1184#
1185
1186#
1187# Platform RTC drivers
1188#
1189# CONFIG_RTC_DRV_DS1286 is not set
1190# CONFIG_RTC_DRV_DS1511 is not set
1191# CONFIG_RTC_DRV_DS1553 is not set
1192# CONFIG_RTC_DRV_DS1742 is not set
1193# CONFIG_RTC_DRV_STK17TA8 is not set
1194# CONFIG_RTC_DRV_M48T86 is not set
1195# CONFIG_RTC_DRV_M48T35 is not set
1196# CONFIG_RTC_DRV_M48T59 is not set
1197# CONFIG_RTC_DRV_BQ4802 is not set
1198# CONFIG_RTC_DRV_V3020 is not set
1199
1200#
1201# on-CPU RTC drivers
1202#
1203# CONFIG_RTC_DRV_SH is not set
1204# CONFIG_DMADEVICES is not set
1205# CONFIG_UIO is not set
1206# CONFIG_STAGING is not set
1207
1208#
1209# File systems
1210#
1211CONFIG_EXT2_FS=y
1212# CONFIG_EXT2_FS_XATTR is not set
1213# CONFIG_EXT2_FS_XIP is not set
1214CONFIG_EXT3_FS=y
1215CONFIG_EXT3_FS_XATTR=y
1216# CONFIG_EXT3_FS_POSIX_ACL is not set
1217# CONFIG_EXT3_FS_SECURITY is not set
1218# CONFIG_EXT4_FS is not set
1219CONFIG_JBD=y
1220CONFIG_FS_MBCACHE=y
1221# CONFIG_REISERFS_FS is not set
1222# CONFIG_JFS_FS is not set
1223CONFIG_FS_POSIX_ACL=y
1224CONFIG_FILE_LOCKING=y
1225# CONFIG_XFS_FS is not set
1226# CONFIG_OCFS2_FS is not set
1227# CONFIG_BTRFS_FS is not set
1228CONFIG_DNOTIFY=y
1229CONFIG_INOTIFY=y
1230CONFIG_INOTIFY_USER=y
1231# CONFIG_QUOTA is not set
1232# CONFIG_AUTOFS_FS is not set
1233# CONFIG_AUTOFS4_FS is not set
1234# CONFIG_FUSE_FS is not set
1235
1236#
1237# CD-ROM/DVD Filesystems
1238#
1239# CONFIG_ISO9660_FS is not set
1240# CONFIG_UDF_FS is not set
1241
1242#
1243# DOS/FAT/NT Filesystems
1244#
1245CONFIG_FAT_FS=y
1246CONFIG_MSDOS_FS=y
1247CONFIG_VFAT_FS=y
1248CONFIG_FAT_DEFAULT_CODEPAGE=437
1249CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1250CONFIG_NTFS_FS=y
1251# CONFIG_NTFS_DEBUG is not set
1252CONFIG_NTFS_RW=y
1253
1254#
1255# Pseudo filesystems
1256#
1257CONFIG_PROC_FS=y
1258CONFIG_PROC_KCORE=y
1259CONFIG_PROC_SYSCTL=y
1260CONFIG_PROC_PAGE_MONITOR=y
1261CONFIG_SYSFS=y
1262CONFIG_TMPFS=y
1263# CONFIG_TMPFS_POSIX_ACL is not set
1264# CONFIG_HUGETLBFS is not set
1265# CONFIG_HUGETLB_PAGE is not set
1266# CONFIG_CONFIGFS_FS is not set
1267CONFIG_MISC_FILESYSTEMS=y
1268# CONFIG_ADFS_FS is not set
1269# CONFIG_AFFS_FS is not set
1270# CONFIG_HFS_FS is not set
1271# CONFIG_HFSPLUS_FS is not set
1272# CONFIG_BEFS_FS is not set
1273# CONFIG_BFS_FS is not set
1274# CONFIG_EFS_FS is not set
1275# CONFIG_JFFS2_FS is not set
1276# CONFIG_CRAMFS is not set
1277# CONFIG_SQUASHFS is not set
1278# CONFIG_VXFS_FS is not set
1279CONFIG_MINIX_FS=y
1280# CONFIG_OMFS_FS is not set
1281# CONFIG_HPFS_FS is not set
1282# CONFIG_QNX4FS_FS is not set
1283# CONFIG_ROMFS_FS is not set
1284# CONFIG_SYSV_FS is not set
1285# CONFIG_UFS_FS is not set
1286CONFIG_NETWORK_FILESYSTEMS=y
1287CONFIG_NFS_FS=y
1288CONFIG_NFS_V3=y
1289# CONFIG_NFS_V3_ACL is not set
1290CONFIG_NFS_V4=y
1291CONFIG_ROOT_NFS=y
1292CONFIG_NFSD=y
1293CONFIG_NFSD_V3=y
1294# CONFIG_NFSD_V3_ACL is not set
1295CONFIG_NFSD_V4=y
1296CONFIG_LOCKD=y
1297CONFIG_LOCKD_V4=y
1298CONFIG_EXPORTFS=y
1299CONFIG_NFS_COMMON=y
1300CONFIG_SUNRPC=y
1301CONFIG_SUNRPC_GSS=y
1302# CONFIG_SUNRPC_REGISTER_V4 is not set
1303CONFIG_RPCSEC_GSS_KRB5=y
1304# CONFIG_RPCSEC_GSS_SPKM3 is not set
1305# CONFIG_SMB_FS is not set
1306# CONFIG_CIFS is not set
1307# CONFIG_NCP_FS is not set
1308# CONFIG_CODA_FS is not set
1309# CONFIG_AFS_FS is not set
1310
1311#
1312# Partition Types
1313#
1314# CONFIG_PARTITION_ADVANCED is not set
1315CONFIG_MSDOS_PARTITION=y
1316CONFIG_NLS=y
1317CONFIG_NLS_DEFAULT="iso8859-1"
1318CONFIG_NLS_CODEPAGE_437=y
1319# CONFIG_NLS_CODEPAGE_737 is not set
1320# CONFIG_NLS_CODEPAGE_775 is not set
1321# CONFIG_NLS_CODEPAGE_850 is not set
1322# CONFIG_NLS_CODEPAGE_852 is not set
1323# CONFIG_NLS_CODEPAGE_855 is not set
1324# CONFIG_NLS_CODEPAGE_857 is not set
1325# CONFIG_NLS_CODEPAGE_860 is not set
1326# CONFIG_NLS_CODEPAGE_861 is not set
1327# CONFIG_NLS_CODEPAGE_862 is not set
1328# CONFIG_NLS_CODEPAGE_863 is not set
1329# CONFIG_NLS_CODEPAGE_864 is not set
1330# CONFIG_NLS_CODEPAGE_865 is not set
1331# CONFIG_NLS_CODEPAGE_866 is not set
1332# CONFIG_NLS_CODEPAGE_869 is not set
1333# CONFIG_NLS_CODEPAGE_936 is not set
1334# CONFIG_NLS_CODEPAGE_950 is not set
1335CONFIG_NLS_CODEPAGE_932=y
1336# CONFIG_NLS_CODEPAGE_949 is not set
1337# CONFIG_NLS_CODEPAGE_874 is not set
1338# CONFIG_NLS_ISO8859_8 is not set
1339# CONFIG_NLS_CODEPAGE_1250 is not set
1340# CONFIG_NLS_CODEPAGE_1251 is not set
1341# CONFIG_NLS_ASCII is not set
1342CONFIG_NLS_ISO8859_1=y
1343# CONFIG_NLS_ISO8859_2 is not set
1344# CONFIG_NLS_ISO8859_3 is not set
1345# CONFIG_NLS_ISO8859_4 is not set
1346# CONFIG_NLS_ISO8859_5 is not set
1347# CONFIG_NLS_ISO8859_6 is not set
1348# CONFIG_NLS_ISO8859_7 is not set
1349# CONFIG_NLS_ISO8859_9 is not set
1350# CONFIG_NLS_ISO8859_13 is not set
1351# CONFIG_NLS_ISO8859_14 is not set
1352# CONFIG_NLS_ISO8859_15 is not set
1353# CONFIG_NLS_KOI8_R is not set
1354# CONFIG_NLS_KOI8_U is not set
1355# CONFIG_NLS_UTF8 is not set
1356# CONFIG_DLM is not set
1357
1358#
1359# Kernel hacking
1360#
1361CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1362# CONFIG_PRINTK_TIME is not set
1363# CONFIG_ENABLE_WARN_DEPRECATED is not set
1364# CONFIG_ENABLE_MUST_CHECK is not set
1365CONFIG_FRAME_WARN=1024
1366# CONFIG_MAGIC_SYSRQ is not set
1367# CONFIG_UNUSED_SYMBOLS is not set
1368# CONFIG_DEBUG_FS is not set
1369# CONFIG_HEADERS_CHECK is not set
1370CONFIG_DEBUG_KERNEL=y
1371# CONFIG_DEBUG_SHIRQ is not set
1372CONFIG_DETECT_SOFTLOCKUP=y
1373# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1374CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1375CONFIG_SCHED_DEBUG=y
1376# CONFIG_SCHEDSTATS is not set
1377# CONFIG_TIMER_STATS is not set
1378# CONFIG_DEBUG_OBJECTS is not set
1379# CONFIG_DEBUG_SLAB is not set
1380CONFIG_DEBUG_PREEMPT=y
1381# CONFIG_DEBUG_RT_MUTEXES is not set
1382# CONFIG_RT_MUTEX_TESTER is not set
1383# CONFIG_DEBUG_SPINLOCK is not set
1384# CONFIG_DEBUG_MUTEXES is not set
1385# CONFIG_DEBUG_LOCK_ALLOC is not set
1386# CONFIG_PROVE_LOCKING is not set
1387# CONFIG_LOCK_STAT is not set
1388# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1389# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1390# CONFIG_DEBUG_KOBJECT is not set
1391# CONFIG_DEBUG_BUGVERBOSE is not set
1392# CONFIG_DEBUG_INFO is not set
1393# CONFIG_DEBUG_VM is not set
1394# CONFIG_DEBUG_WRITECOUNT is not set
1395# CONFIG_DEBUG_MEMORY_INIT is not set
1396# CONFIG_DEBUG_LIST is not set
1397# CONFIG_DEBUG_SG is not set
1398# CONFIG_DEBUG_NOTIFIERS is not set
1399# CONFIG_FRAME_POINTER is not set
1400# CONFIG_RCU_TORTURE_TEST is not set
1401# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1402# CONFIG_BACKTRACE_SELF_TEST is not set
1403# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1404# CONFIG_FAULT_INJECTION is not set
1405# CONFIG_LATENCYTOP is not set
1406CONFIG_SYSCTL_SYSCALL_CHECK=y
1407CONFIG_HAVE_FUNCTION_TRACER=y
1408CONFIG_HAVE_DYNAMIC_FTRACE=y
1409CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1410
1411#
1412# Tracers
1413#
1414# CONFIG_FUNCTION_TRACER is not set
1415# CONFIG_IRQSOFF_TRACER is not set
1416# CONFIG_PREEMPT_TRACER is not set
1417# CONFIG_SCHED_TRACER is not set
1418# CONFIG_CONTEXT_SWITCH_TRACER is not set
1419# CONFIG_BOOT_TRACER is not set
1420# CONFIG_TRACE_BRANCH_PROFILING is not set
1421# CONFIG_STACK_TRACER is not set
1422# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1423# CONFIG_SAMPLES is not set
1424CONFIG_HAVE_ARCH_KGDB=y
1425# CONFIG_KGDB is not set
1426# CONFIG_SH_STANDARD_BIOS is not set
1427# CONFIG_EARLY_SCIF_CONSOLE is not set
1428# CONFIG_DEBUG_BOOTMEM is not set
1429# CONFIG_DEBUG_STACKOVERFLOW is not set
1430# CONFIG_DEBUG_STACK_USAGE is not set
1431# CONFIG_4KSTACKS is not set
1432# CONFIG_IRQSTACKS is not set
1433# CONFIG_DUMP_CODE is not set
1434# CONFIG_SH_NO_BSS_INIT is not set
1435# CONFIG_MORE_COMPILE_OPTIONS is not set
1436
1437#
1438# Security options
1439#
1440# CONFIG_KEYS is not set
1441# CONFIG_SECURITY is not set
1442# CONFIG_SECURITYFS is not set
1443# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1444CONFIG_CRYPTO=y
1445
1446#
1447# Crypto core or helper
1448#
1449# CONFIG_CRYPTO_FIPS is not set
1450CONFIG_CRYPTO_ALGAPI=y
1451CONFIG_CRYPTO_ALGAPI2=y
1452CONFIG_CRYPTO_AEAD2=y
1453CONFIG_CRYPTO_BLKCIPHER=y
1454CONFIG_CRYPTO_BLKCIPHER2=y
1455CONFIG_CRYPTO_HASH=y
1456CONFIG_CRYPTO_HASH2=y
1457CONFIG_CRYPTO_RNG2=y
1458CONFIG_CRYPTO_MANAGER=y
1459CONFIG_CRYPTO_MANAGER2=y
1460# CONFIG_CRYPTO_GF128MUL is not set
1461# CONFIG_CRYPTO_NULL is not set
1462# CONFIG_CRYPTO_CRYPTD is not set
1463# CONFIG_CRYPTO_AUTHENC is not set
1464# CONFIG_CRYPTO_TEST is not set
1465
1466#
1467# Authenticated Encryption with Associated Data
1468#
1469# CONFIG_CRYPTO_CCM is not set
1470# CONFIG_CRYPTO_GCM is not set
1471# CONFIG_CRYPTO_SEQIV is not set
1472
1473#
1474# Block modes
1475#
1476CONFIG_CRYPTO_CBC=y
1477# CONFIG_CRYPTO_CTR is not set
1478# CONFIG_CRYPTO_CTS is not set
1479# CONFIG_CRYPTO_ECB is not set
1480# CONFIG_CRYPTO_LRW is not set
1481# CONFIG_CRYPTO_PCBC is not set
1482# CONFIG_CRYPTO_XTS is not set
1483
1484#
1485# Hash modes
1486#
1487CONFIG_CRYPTO_HMAC=y
1488# CONFIG_CRYPTO_XCBC is not set
1489
1490#
1491# Digest
1492#
1493# CONFIG_CRYPTO_CRC32C is not set
1494# CONFIG_CRYPTO_MD4 is not set
1495CONFIG_CRYPTO_MD5=y
1496# CONFIG_CRYPTO_MICHAEL_MIC is not set
1497# CONFIG_CRYPTO_RMD128 is not set
1498# CONFIG_CRYPTO_RMD160 is not set
1499# CONFIG_CRYPTO_RMD256 is not set
1500# CONFIG_CRYPTO_RMD320 is not set
1501# CONFIG_CRYPTO_SHA1 is not set
1502# CONFIG_CRYPTO_SHA256 is not set
1503# CONFIG_CRYPTO_SHA512 is not set
1504# CONFIG_CRYPTO_TGR192 is not set
1505# CONFIG_CRYPTO_WP512 is not set
1506
1507#
1508# Ciphers
1509#
1510# CONFIG_CRYPTO_AES is not set
1511# CONFIG_CRYPTO_ANUBIS is not set
1512# CONFIG_CRYPTO_ARC4 is not set
1513# CONFIG_CRYPTO_BLOWFISH is not set
1514# CONFIG_CRYPTO_CAMELLIA is not set
1515# CONFIG_CRYPTO_CAST5 is not set
1516# CONFIG_CRYPTO_CAST6 is not set
1517CONFIG_CRYPTO_DES=y
1518# CONFIG_CRYPTO_FCRYPT is not set
1519# CONFIG_CRYPTO_KHAZAD is not set
1520# CONFIG_CRYPTO_SALSA20 is not set
1521# CONFIG_CRYPTO_SEED is not set
1522# CONFIG_CRYPTO_SERPENT is not set
1523# CONFIG_CRYPTO_TEA is not set
1524# CONFIG_CRYPTO_TWOFISH is not set
1525
1526#
1527# Compression
1528#
1529# CONFIG_CRYPTO_DEFLATE is not set
1530# CONFIG_CRYPTO_LZO is not set
1531
1532#
1533# Random Number Generation
1534#
1535# CONFIG_CRYPTO_ANSI_CPRNG is not set
1536# CONFIG_CRYPTO_HW is not set
1537
1538#
1539# Library routines
1540#
1541CONFIG_BITREVERSE=y
1542CONFIG_GENERIC_FIND_LAST_BIT=y
1543# CONFIG_CRC_CCITT is not set
1544# CONFIG_CRC16 is not set
1545# CONFIG_CRC_T10DIF is not set
1546# CONFIG_CRC_ITU_T is not set
1547CONFIG_CRC32=y
1548# CONFIG_CRC7 is not set
1549# CONFIG_LIBCRC32C is not set
1550CONFIG_PLIST=y
1551CONFIG_HAS_IOMEM=y
1552CONFIG_HAS_IOPORT=y
1553CONFIG_HAS_DMA=y
diff --git a/arch/sh/configs/urquell_defconfig b/arch/sh/configs/urquell_defconfig
new file mode 100644
index 000000000000..be726c7cdf91
--- /dev/null
+++ b/arch/sh/configs/urquell_defconfig
@@ -0,0 +1,1332 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc4
4# Thu Mar 5 17:28:13 2009
5#
6CONFIG_SUPERH=y
7CONFIG_SUPERH32=y
8CONFIG_ARCH_DEFCONFIG="arch/sh/configs/shx3_defconfig"
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_BUG=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
15CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_GENERIC_GPIO=y
17CONFIG_GENERIC_TIME=y
18CONFIG_GENERIC_CLOCKEVENTS=y
19# CONFIG_ARCH_SUSPEND_POSSIBLE is not set
20# CONFIG_ARCH_HIBERNATION_POSSIBLE is not set
21CONFIG_SYS_SUPPORTS_NUMA=y
22CONFIG_STACKTRACE_SUPPORT=y
23CONFIG_LOCKDEP_SUPPORT=y
24CONFIG_HAVE_LATENCYTOP_SUPPORT=y
25# CONFIG_ARCH_HAS_ILOG2_U32 is not set
26# CONFIG_ARCH_HAS_ILOG2_U64 is not set
27CONFIG_ARCH_NO_VIRT_TO_BUS=y
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29
30#
31# General setup
32#
33CONFIG_EXPERIMENTAL=y
34CONFIG_BROKEN_ON_SMP=y
35CONFIG_LOCK_KERNEL=y
36CONFIG_INIT_ENV_ARG_LIMIT=32
37CONFIG_LOCALVERSION=""
38CONFIG_LOCALVERSION_AUTO=y
39CONFIG_SWAP=y
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42# CONFIG_POSIX_MQUEUE is not set
43CONFIG_BSD_PROCESS_ACCT=y
44# CONFIG_BSD_PROCESS_ACCT_V3 is not set
45# CONFIG_TASKSTATS is not set
46# CONFIG_AUDIT is not set
47
48#
49# RCU Subsystem
50#
51CONFIG_CLASSIC_RCU=y
52# CONFIG_TREE_RCU is not set
53# CONFIG_PREEMPT_RCU is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_PREEMPT_RCU_TRACE is not set
56CONFIG_IKCONFIG=y
57CONFIG_IKCONFIG_PROC=y
58CONFIG_LOG_BUF_SHIFT=14
59CONFIG_GROUP_SCHED=y
60CONFIG_FAIR_GROUP_SCHED=y
61# CONFIG_RT_GROUP_SCHED is not set
62CONFIG_USER_SCHED=y
63# CONFIG_CGROUP_SCHED is not set
64# CONFIG_CGROUPS is not set
65CONFIG_SYSFS_DEPRECATED=y
66CONFIG_SYSFS_DEPRECATED_V2=y
67# CONFIG_RELAY is not set
68# CONFIG_NAMESPACES is not set
69# CONFIG_BLK_DEV_INITRD is not set
70CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71CONFIG_SYSCTL=y
72CONFIG_EMBEDDED=y
73CONFIG_UID16=y
74CONFIG_SYSCTL_SYSCALL=y
75CONFIG_KALLSYMS=y
76# CONFIG_KALLSYMS_EXTRA_PASS is not set
77CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y
79CONFIG_BUG=y
80CONFIG_ELF_CORE=y
81CONFIG_COMPAT_BRK=y
82CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y
84CONFIG_ANON_INODES=y
85CONFIG_EPOLL=y
86CONFIG_SIGNALFD=y
87CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y
90CONFIG_AIO=y
91CONFIG_VM_EVENT_COUNTERS=y
92CONFIG_SLAB=y
93# CONFIG_SLUB is not set
94# CONFIG_SLOB is not set
95CONFIG_PROFILING=y
96# CONFIG_OPROFILE is not set
97CONFIG_HAVE_OPROFILE=y
98# CONFIG_KPROBES is not set
99CONFIG_HAVE_IOREMAP_PROT=y
100CONFIG_HAVE_KPROBES=y
101CONFIG_HAVE_KRETPROBES=y
102CONFIG_HAVE_ARCH_TRACEHOOK=y
103CONFIG_HAVE_CLK=y
104CONFIG_HAVE_GENERIC_DMA_COHERENT=y
105CONFIG_SLABINFO=y
106CONFIG_RT_MUTEXES=y
107CONFIG_BASE_SMALL=0
108CONFIG_MODULES=y
109# CONFIG_MODULE_FORCE_LOAD is not set
110CONFIG_MODULE_UNLOAD=y
111# CONFIG_MODULE_FORCE_UNLOAD is not set
112# CONFIG_MODVERSIONS is not set
113# CONFIG_MODULE_SRCVERSION_ALL is not set
114CONFIG_BLOCK=y
115# CONFIG_LBD is not set
116# CONFIG_BLK_DEV_IO_TRACE is not set
117# CONFIG_BLK_DEV_BSG is not set
118# CONFIG_BLK_DEV_INTEGRITY is not set
119
120#
121# IO Schedulers
122#
123CONFIG_IOSCHED_NOOP=y
124CONFIG_IOSCHED_AS=y
125CONFIG_IOSCHED_DEADLINE=y
126CONFIG_IOSCHED_CFQ=y
127# CONFIG_DEFAULT_AS is not set
128# CONFIG_DEFAULT_DEADLINE is not set
129CONFIG_DEFAULT_CFQ=y
130# CONFIG_DEFAULT_NOOP is not set
131CONFIG_DEFAULT_IOSCHED="cfq"
132# CONFIG_FREEZER is not set
133
134#
135# System type
136#
137CONFIG_CPU_SH4=y
138CONFIG_CPU_SH4A=y
139CONFIG_CPU_SHX3=y
140# CONFIG_CPU_SUBTYPE_SH7619 is not set
141# CONFIG_CPU_SUBTYPE_SH7201 is not set
142# CONFIG_CPU_SUBTYPE_SH7203 is not set
143# CONFIG_CPU_SUBTYPE_SH7206 is not set
144# CONFIG_CPU_SUBTYPE_SH7263 is not set
145# CONFIG_CPU_SUBTYPE_MXG is not set
146# CONFIG_CPU_SUBTYPE_SH7705 is not set
147# CONFIG_CPU_SUBTYPE_SH7706 is not set
148# CONFIG_CPU_SUBTYPE_SH7707 is not set
149# CONFIG_CPU_SUBTYPE_SH7708 is not set
150# CONFIG_CPU_SUBTYPE_SH7709 is not set
151# CONFIG_CPU_SUBTYPE_SH7710 is not set
152# CONFIG_CPU_SUBTYPE_SH7712 is not set
153# CONFIG_CPU_SUBTYPE_SH7720 is not set
154# CONFIG_CPU_SUBTYPE_SH7721 is not set
155# CONFIG_CPU_SUBTYPE_SH7750 is not set
156# CONFIG_CPU_SUBTYPE_SH7091 is not set
157# CONFIG_CPU_SUBTYPE_SH7750R is not set
158# CONFIG_CPU_SUBTYPE_SH7750S is not set
159# CONFIG_CPU_SUBTYPE_SH7751 is not set
160# CONFIG_CPU_SUBTYPE_SH7751R is not set
161# CONFIG_CPU_SUBTYPE_SH7760 is not set
162# CONFIG_CPU_SUBTYPE_SH4_202 is not set
163# CONFIG_CPU_SUBTYPE_SH7723 is not set
164# CONFIG_CPU_SUBTYPE_SH7763 is not set
165# CONFIG_CPU_SUBTYPE_SH7770 is not set
166# CONFIG_CPU_SUBTYPE_SH7780 is not set
167# CONFIG_CPU_SUBTYPE_SH7785 is not set
168CONFIG_CPU_SUBTYPE_SH7786=y
169# CONFIG_CPU_SUBTYPE_SHX3 is not set
170# CONFIG_CPU_SUBTYPE_SH7343 is not set
171# CONFIG_CPU_SUBTYPE_SH7722 is not set
172# CONFIG_CPU_SUBTYPE_SH7366 is not set
173# CONFIG_CPU_SUBTYPE_SH5_101 is not set
174# CONFIG_CPU_SUBTYPE_SH5_103 is not set
175
176#
177# Memory management options
178#
179CONFIG_QUICKLIST=y
180CONFIG_MMU=y
181CONFIG_PAGE_OFFSET=0x80000000
182CONFIG_MEMORY_START=0x08000000
183CONFIG_MEMORY_SIZE=0x08000000
184CONFIG_29BIT=y
185# CONFIG_X2TLB is not set
186CONFIG_VSYSCALL=y
187# CONFIG_NUMA is not set
188CONFIG_ARCH_FLATMEM_ENABLE=y
189CONFIG_ARCH_SPARSEMEM_ENABLE=y
190CONFIG_ARCH_SPARSEMEM_DEFAULT=y
191CONFIG_MAX_ACTIVE_REGIONS=1
192CONFIG_ARCH_POPULATES_NODE_MAP=y
193CONFIG_ARCH_SELECT_MEMORY_MODEL=y
194CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
195CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
196CONFIG_PAGE_SIZE_4KB=y
197# CONFIG_PAGE_SIZE_8KB is not set
198# CONFIG_PAGE_SIZE_16KB is not set
199# CONFIG_PAGE_SIZE_64KB is not set
200CONFIG_ENTRY_OFFSET=0x00001000
201CONFIG_SELECT_MEMORY_MODEL=y
202# CONFIG_FLATMEM_MANUAL is not set
203# CONFIG_DISCONTIGMEM_MANUAL is not set
204CONFIG_SPARSEMEM_MANUAL=y
205CONFIG_SPARSEMEM=y
206CONFIG_HAVE_MEMORY_PRESENT=y
207CONFIG_SPARSEMEM_STATIC=y
208# CONFIG_MEMORY_HOTPLUG is not set
209CONFIG_PAGEFLAGS_EXTENDED=y
210CONFIG_SPLIT_PTLOCK_CPUS=4
211CONFIG_MIGRATION=y
212# CONFIG_PHYS_ADDR_T_64BIT is not set
213CONFIG_ZONE_DMA_FLAG=0
214CONFIG_NR_QUICK=2
215CONFIG_UNEVICTABLE_LRU=y
216
217#
218# Cache configuration
219#
220# CONFIG_SH_DIRECT_MAPPED is not set
221CONFIG_CACHE_WRITEBACK=y
222# CONFIG_CACHE_WRITETHROUGH is not set
223# CONFIG_CACHE_OFF is not set
224
225#
226# Processor features
227#
228CONFIG_CPU_LITTLE_ENDIAN=y
229# CONFIG_CPU_BIG_ENDIAN is not set
230CONFIG_SH_FPU=y
231CONFIG_SH_STORE_QUEUES=y
232CONFIG_CPU_HAS_INTEVT=y
233CONFIG_CPU_HAS_SR_RB=y
234CONFIG_CPU_HAS_FPU=y
235
236#
237# Board support
238#
239CONFIG_SH_URQUELL=y
240
241#
242# Timer and clock configuration
243#
244CONFIG_SH_TMU=y
245CONFIG_SH_TIMER_IRQ=16
246CONFIG_SH_PCLK_FREQ=33333333
247CONFIG_TICK_ONESHOT=y
248# CONFIG_NO_HZ is not set
249CONFIG_HIGH_RES_TIMERS=y
250CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
251
252#
253# CPU Frequency scaling
254#
255# CONFIG_CPU_FREQ is not set
256
257#
258# DMA support
259#
260# CONFIG_SH_DMA is not set
261
262#
263# Companion Chips
264#
265
266#
267# Additional SuperH Device Drivers
268#
269CONFIG_HEARTBEAT=y
270# CONFIG_PUSH_SWITCH is not set
271
272#
273# Kernel features
274#
275# CONFIG_HZ_100 is not set
276CONFIG_HZ_250=y
277# CONFIG_HZ_300 is not set
278# CONFIG_HZ_1000 is not set
279CONFIG_HZ=250
280CONFIG_SCHED_HRTICK=y
281CONFIG_KEXEC=y
282# CONFIG_CRASH_DUMP is not set
283# CONFIG_SECCOMP is not set
284# CONFIG_PREEMPT_NONE is not set
285# CONFIG_PREEMPT_VOLUNTARY is not set
286CONFIG_PREEMPT=y
287CONFIG_GUSA=y
288
289#
290# Boot options
291#
292CONFIG_ZERO_PAGE_OFFSET=0x00001000
293CONFIG_BOOT_LINK_OFFSET=0x00800000
294CONFIG_CMDLINE_BOOL=y
295CONFIG_CMDLINE="console=ttySC1, 38400 earlyprintk=serial ip=on ignore_loglevel root=/dev/nfs ip=dhcp memchunk.vpu=4m"
296
297#
298# Bus options
299#
300# CONFIG_ARCH_SUPPORTS_MSI is not set
301# CONFIG_PCCARD is not set
302
303#
304# Executable file formats
305#
306CONFIG_BINFMT_ELF=y
307# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
308# CONFIG_HAVE_AOUT is not set
309# CONFIG_BINFMT_MISC is not set
310
311#
312# Power management options (EXPERIMENTAL)
313#
314# CONFIG_PM is not set
315# CONFIG_CPU_IDLE is not set
316CONFIG_NET=y
317
318#
319# Networking options
320#
321CONFIG_COMPAT_NET_DEV_OPS=y
322CONFIG_PACKET=y
323# CONFIG_PACKET_MMAP is not set
324CONFIG_UNIX=y
325CONFIG_XFRM=y
326# CONFIG_XFRM_USER is not set
327# CONFIG_XFRM_SUB_POLICY is not set
328# CONFIG_XFRM_MIGRATE is not set
329# CONFIG_XFRM_STATISTICS is not set
330# CONFIG_NET_KEY is not set
331CONFIG_INET=y
332# CONFIG_IP_MULTICAST is not set
333CONFIG_IP_ADVANCED_ROUTER=y
334CONFIG_ASK_IP_FIB_HASH=y
335# CONFIG_IP_FIB_TRIE is not set
336CONFIG_IP_FIB_HASH=y
337# CONFIG_IP_MULTIPLE_TABLES is not set
338# CONFIG_IP_ROUTE_MULTIPATH is not set
339# CONFIG_IP_ROUTE_VERBOSE is not set
340CONFIG_IP_PNP=y
341CONFIG_IP_PNP_DHCP=y
342# CONFIG_IP_PNP_BOOTP is not set
343# CONFIG_IP_PNP_RARP is not set
344# CONFIG_NET_IPIP is not set
345# CONFIG_NET_IPGRE is not set
346# CONFIG_ARPD is not set
347# CONFIG_SYN_COOKIES is not set
348# CONFIG_INET_AH is not set
349# CONFIG_INET_ESP is not set
350# CONFIG_INET_IPCOMP is not set
351# CONFIG_INET_XFRM_TUNNEL is not set
352# CONFIG_INET_TUNNEL is not set
353CONFIG_INET_XFRM_MODE_TRANSPORT=y
354CONFIG_INET_XFRM_MODE_TUNNEL=y
355CONFIG_INET_XFRM_MODE_BEET=y
356# CONFIG_INET_LRO is not set
357CONFIG_INET_DIAG=y
358CONFIG_INET_TCP_DIAG=y
359# CONFIG_TCP_CONG_ADVANCED is not set
360CONFIG_TCP_CONG_CUBIC=y
361CONFIG_DEFAULT_TCP_CONG="cubic"
362# CONFIG_TCP_MD5SIG is not set
363# CONFIG_IPV6 is not set
364# CONFIG_NETWORK_SECMARK is not set
365# CONFIG_NETFILTER is not set
366# CONFIG_IP_DCCP is not set
367# CONFIG_IP_SCTP is not set
368# CONFIG_TIPC is not set
369# CONFIG_ATM is not set
370# CONFIG_BRIDGE is not set
371# CONFIG_NET_DSA is not set
372# CONFIG_VLAN_8021Q is not set
373# CONFIG_DECNET is not set
374# CONFIG_LLC2 is not set
375# CONFIG_IPX is not set
376# CONFIG_ATALK is not set
377# CONFIG_X25 is not set
378# CONFIG_LAPB is not set
379# CONFIG_ECONET is not set
380# CONFIG_WAN_ROUTER is not set
381# CONFIG_NET_SCHED is not set
382# CONFIG_DCB is not set
383
384#
385# Network testing
386#
387# CONFIG_NET_PKTGEN is not set
388# CONFIG_HAMRADIO is not set
389# CONFIG_CAN is not set
390# CONFIG_IRDA is not set
391# CONFIG_BT is not set
392# CONFIG_AF_RXRPC is not set
393# CONFIG_PHONET is not set
394CONFIG_WIRELESS=y
395# CONFIG_CFG80211 is not set
396# CONFIG_WIRELESS_OLD_REGULATORY is not set
397CONFIG_WIRELESS_EXT=y
398CONFIG_WIRELESS_EXT_SYSFS=y
399# CONFIG_LIB80211 is not set
400# CONFIG_MAC80211 is not set
401# CONFIG_WIMAX is not set
402# CONFIG_RFKILL is not set
403# CONFIG_NET_9P is not set
404
405#
406# Device Drivers
407#
408
409#
410# Generic Driver Options
411#
412CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
413CONFIG_STANDALONE=y
414CONFIG_PREVENT_FIRMWARE_BUILD=y
415# CONFIG_FW_LOADER is not set
416# CONFIG_SYS_HYPERVISOR is not set
417# CONFIG_CONNECTOR is not set
418CONFIG_MTD=y
419# CONFIG_MTD_DEBUG is not set
420CONFIG_MTD_CONCAT=y
421CONFIG_MTD_PARTITIONS=y
422# CONFIG_MTD_TESTS is not set
423# CONFIG_MTD_REDBOOT_PARTS is not set
424# CONFIG_MTD_CMDLINE_PARTS is not set
425# CONFIG_MTD_AR7_PARTS is not set
426
427#
428# User Modules And Translation Layers
429#
430CONFIG_MTD_CHAR=y
431CONFIG_MTD_BLKDEVS=y
432CONFIG_MTD_BLOCK=y
433# CONFIG_FTL is not set
434# CONFIG_NFTL is not set
435# CONFIG_INFTL is not set
436# CONFIG_RFD_FTL is not set
437# CONFIG_SSFDC is not set
438# CONFIG_MTD_OOPS is not set
439
440#
441# RAM/ROM/Flash chip drivers
442#
443CONFIG_MTD_CFI=y
444# CONFIG_MTD_JEDECPROBE is not set
445CONFIG_MTD_GEN_PROBE=y
446# CONFIG_MTD_CFI_ADV_OPTIONS is not set
447CONFIG_MTD_MAP_BANK_WIDTH_1=y
448CONFIG_MTD_MAP_BANK_WIDTH_2=y
449CONFIG_MTD_MAP_BANK_WIDTH_4=y
450# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
451# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
452# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
453CONFIG_MTD_CFI_I1=y
454CONFIG_MTD_CFI_I2=y
455# CONFIG_MTD_CFI_I4 is not set
456# CONFIG_MTD_CFI_I8 is not set
457# CONFIG_MTD_CFI_INTELEXT is not set
458CONFIG_MTD_CFI_AMDSTD=y
459# CONFIG_MTD_CFI_STAA is not set
460CONFIG_MTD_CFI_UTIL=y
461# CONFIG_MTD_RAM is not set
462# CONFIG_MTD_ROM is not set
463# CONFIG_MTD_ABSENT is not set
464
465#
466# Mapping drivers for chip access
467#
468# CONFIG_MTD_COMPLEX_MAPPINGS is not set
469CONFIG_MTD_PHYSMAP=y
470# CONFIG_MTD_PHYSMAP_COMPAT is not set
471# CONFIG_MTD_PLATRAM is not set
472
473#
474# Self-contained MTD device drivers
475#
476# CONFIG_MTD_SLRAM is not set
477# CONFIG_MTD_PHRAM is not set
478# CONFIG_MTD_MTDRAM is not set
479# CONFIG_MTD_BLOCK2MTD is not set
480
481#
482# Disk-On-Chip Device Drivers
483#
484# CONFIG_MTD_DOC2000 is not set
485# CONFIG_MTD_DOC2001 is not set
486# CONFIG_MTD_DOC2001PLUS is not set
487# CONFIG_MTD_NAND is not set
488# CONFIG_MTD_ONENAND is not set
489
490#
491# LPDDR flash memory drivers
492#
493# CONFIG_MTD_LPDDR is not set
494# CONFIG_MTD_QINFO_PROBE is not set
495
496#
497# UBI - Unsorted block images
498#
499# CONFIG_MTD_UBI is not set
500# CONFIG_PARPORT is not set
501CONFIG_BLK_DEV=y
502# CONFIG_BLK_DEV_COW_COMMON is not set
503# CONFIG_BLK_DEV_LOOP is not set
504# CONFIG_BLK_DEV_NBD is not set
505# CONFIG_BLK_DEV_UB is not set
506CONFIG_BLK_DEV_RAM=y
507CONFIG_BLK_DEV_RAM_COUNT=16
508CONFIG_BLK_DEV_RAM_SIZE=4096
509# CONFIG_BLK_DEV_XIP is not set
510# CONFIG_CDROM_PKTCDVD is not set
511# CONFIG_ATA_OVER_ETH is not set
512# CONFIG_BLK_DEV_HD is not set
513# CONFIG_MISC_DEVICES is not set
514CONFIG_HAVE_IDE=y
515# CONFIG_IDE is not set
516
517#
518# SCSI device support
519#
520# CONFIG_RAID_ATTRS is not set
521CONFIG_SCSI=y
522CONFIG_SCSI_DMA=y
523# CONFIG_SCSI_TGT is not set
524# CONFIG_SCSI_NETLINK is not set
525CONFIG_SCSI_PROC_FS=y
526
527#
528# SCSI support type (disk, tape, CD-ROM)
529#
530CONFIG_BLK_DEV_SD=y
531# CONFIG_CHR_DEV_ST is not set
532# CONFIG_CHR_DEV_OSST is not set
533# CONFIG_BLK_DEV_SR is not set
534# CONFIG_CHR_DEV_SG is not set
535# CONFIG_CHR_DEV_SCH is not set
536
537#
538# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
539#
540# CONFIG_SCSI_MULTI_LUN is not set
541# CONFIG_SCSI_CONSTANTS is not set
542# CONFIG_SCSI_LOGGING is not set
543# CONFIG_SCSI_SCAN_ASYNC is not set
544CONFIG_SCSI_WAIT_SCAN=m
545
546#
547# SCSI Transports
548#
549# CONFIG_SCSI_SPI_ATTRS is not set
550# CONFIG_SCSI_FC_ATTRS is not set
551# CONFIG_SCSI_ISCSI_ATTRS is not set
552# CONFIG_SCSI_SAS_LIBSAS is not set
553# CONFIG_SCSI_SRP_ATTRS is not set
554# CONFIG_SCSI_LOWLEVEL is not set
555# CONFIG_SCSI_DH is not set
556CONFIG_ATA=y
557# CONFIG_ATA_NONSTANDARD is not set
558CONFIG_SATA_PMP=y
559CONFIG_ATA_SFF=y
560# CONFIG_SATA_MV is not set
561# CONFIG_PATA_PLATFORM is not set
562# CONFIG_MD is not set
563CONFIG_NETDEVICES=y
564# CONFIG_DUMMY is not set
565# CONFIG_BONDING is not set
566# CONFIG_MACVLAN is not set
567# CONFIG_EQUALIZER is not set
568# CONFIG_TUN is not set
569# CONFIG_VETH is not set
570CONFIG_PHYLIB=y
571
572#
573# MII PHY device drivers
574#
575# CONFIG_MARVELL_PHY is not set
576# CONFIG_DAVICOM_PHY is not set
577# CONFIG_QSEMI_PHY is not set
578# CONFIG_LXT_PHY is not set
579# CONFIG_CICADA_PHY is not set
580# CONFIG_VITESSE_PHY is not set
581# CONFIG_SMSC_PHY is not set
582# CONFIG_BROADCOM_PHY is not set
583# CONFIG_ICPLUS_PHY is not set
584# CONFIG_REALTEK_PHY is not set
585# CONFIG_NATIONAL_PHY is not set
586# CONFIG_STE10XP is not set
587# CONFIG_LSI_ET1011C_PHY is not set
588# CONFIG_FIXED_PHY is not set
589# CONFIG_MDIO_BITBANG is not set
590CONFIG_NET_ETHERNET=y
591CONFIG_MII=y
592# CONFIG_AX88796 is not set
593# CONFIG_STNIC is not set
594CONFIG_SMC91X=y
595# CONFIG_SMC911X is not set
596# CONFIG_SMSC911X is not set
597# CONFIG_IBM_NEW_EMAC_ZMII is not set
598# CONFIG_IBM_NEW_EMAC_RGMII is not set
599# CONFIG_IBM_NEW_EMAC_TAH is not set
600# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
601# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
602# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
603# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
604# CONFIG_B44 is not set
605# CONFIG_NETDEV_1000 is not set
606# CONFIG_NETDEV_10000 is not set
607
608#
609# Wireless LAN
610#
611# CONFIG_WLAN_PRE80211 is not set
612# CONFIG_WLAN_80211 is not set
613# CONFIG_IWLWIFI_LEDS is not set
614
615#
616# Enable WiMAX (Networking options) to see the WiMAX drivers
617#
618
619#
620# USB Network Adapters
621#
622# CONFIG_USB_CATC is not set
623# CONFIG_USB_KAWETH is not set
624# CONFIG_USB_PEGASUS is not set
625# CONFIG_USB_RTL8150 is not set
626# CONFIG_USB_USBNET is not set
627# CONFIG_WAN is not set
628# CONFIG_PPP is not set
629# CONFIG_SLIP is not set
630# CONFIG_NETCONSOLE is not set
631# CONFIG_NETPOLL is not set
632# CONFIG_NET_POLL_CONTROLLER is not set
633# CONFIG_ISDN is not set
634# CONFIG_PHONE is not set
635
636#
637# Input device support
638#
639CONFIG_INPUT=y
640CONFIG_INPUT_FF_MEMLESS=m
641# CONFIG_INPUT_POLLDEV is not set
642
643#
644# Userland interfaces
645#
646CONFIG_INPUT_MOUSEDEV=y
647# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
648CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
649CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
650# CONFIG_INPUT_JOYDEV is not set
651# CONFIG_INPUT_EVDEV is not set
652# CONFIG_INPUT_EVBUG is not set
653
654#
655# Input Device Drivers
656#
657CONFIG_INPUT_KEYBOARD=y
658# CONFIG_KEYBOARD_ATKBD is not set
659# CONFIG_KEYBOARD_SUNKBD is not set
660# CONFIG_KEYBOARD_LKKBD is not set
661# CONFIG_KEYBOARD_XTKBD is not set
662# CONFIG_KEYBOARD_NEWTON is not set
663# CONFIG_KEYBOARD_STOWAWAY is not set
664# CONFIG_KEYBOARD_GPIO is not set
665# CONFIG_KEYBOARD_SH_KEYSC is not set
666# CONFIG_INPUT_MOUSE is not set
667# CONFIG_INPUT_JOYSTICK is not set
668# CONFIG_INPUT_TABLET is not set
669# CONFIG_INPUT_TOUCHSCREEN is not set
670# CONFIG_INPUT_MISC is not set
671
672#
673# Hardware I/O ports
674#
675# CONFIG_SERIO is not set
676# CONFIG_GAMEPORT is not set
677
678#
679# Character devices
680#
681CONFIG_VT=y
682CONFIG_CONSOLE_TRANSLATIONS=y
683CONFIG_VT_CONSOLE=y
684CONFIG_HW_CONSOLE=y
685CONFIG_VT_HW_CONSOLE_BINDING=y
686CONFIG_DEVKMEM=y
687# CONFIG_SERIAL_NONSTANDARD is not set
688
689#
690# Serial drivers
691#
692# CONFIG_SERIAL_8250 is not set
693
694#
695# Non-8250 serial port support
696#
697CONFIG_SERIAL_SH_SCI=y
698CONFIG_SERIAL_SH_SCI_NR_UARTS=6
699CONFIG_SERIAL_SH_SCI_CONSOLE=y
700CONFIG_SERIAL_CORE=y
701CONFIG_SERIAL_CORE_CONSOLE=y
702CONFIG_UNIX98_PTYS=y
703# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
704CONFIG_LEGACY_PTYS=y
705CONFIG_LEGACY_PTY_COUNT=256
706# CONFIG_IPMI_HANDLER is not set
707CONFIG_HW_RANDOM=y
708# CONFIG_R3964 is not set
709# CONFIG_RAW_DRIVER is not set
710# CONFIG_TCG_TPM is not set
711CONFIG_I2C=y
712CONFIG_I2C_BOARDINFO=y
713# CONFIG_I2C_CHARDEV is not set
714CONFIG_I2C_HELPER_AUTO=y
715CONFIG_I2C_ALGOPCA=y
716
717#
718# I2C Hardware Bus support
719#
720
721#
722# I2C system bus drivers (mostly embedded / system-on-chip)
723#
724# CONFIG_I2C_GPIO is not set
725# CONFIG_I2C_OCORES is not set
726# CONFIG_I2C_SH_MOBILE is not set
727# CONFIG_I2C_SIMTEC is not set
728
729#
730# External I2C/SMBus adapter drivers
731#
732# CONFIG_I2C_PARPORT_LIGHT is not set
733# CONFIG_I2C_TAOS_EVM is not set
734# CONFIG_I2C_TINY_USB is not set
735
736#
737# Other I2C/SMBus bus drivers
738#
739CONFIG_I2C_PCA_PLATFORM=y
740# CONFIG_I2C_STUB is not set
741
742#
743# Miscellaneous I2C Chip support
744#
745# CONFIG_DS1682 is not set
746# CONFIG_SENSORS_PCF8574 is not set
747# CONFIG_PCF8575 is not set
748# CONFIG_SENSORS_PCA9539 is not set
749# CONFIG_SENSORS_PCF8591 is not set
750# CONFIG_SENSORS_MAX6875 is not set
751# CONFIG_SENSORS_TSL2550 is not set
752# CONFIG_I2C_DEBUG_CORE is not set
753# CONFIG_I2C_DEBUG_ALGO is not set
754# CONFIG_I2C_DEBUG_BUS is not set
755# CONFIG_I2C_DEBUG_CHIP is not set
756# CONFIG_SPI is not set
757CONFIG_ARCH_REQUIRE_GPIOLIB=y
758CONFIG_GPIOLIB=y
759# CONFIG_GPIO_SYSFS is not set
760
761#
762# Memory mapped GPIO expanders:
763#
764
765#
766# I2C GPIO expanders:
767#
768# CONFIG_GPIO_MAX732X is not set
769# CONFIG_GPIO_PCA953X is not set
770# CONFIG_GPIO_PCF857X is not set
771
772#
773# PCI GPIO expanders:
774#
775
776#
777# SPI GPIO expanders:
778#
779# CONFIG_W1 is not set
780# CONFIG_POWER_SUPPLY is not set
781# CONFIG_HWMON is not set
782# CONFIG_THERMAL is not set
783# CONFIG_THERMAL_HWMON is not set
784# CONFIG_WATCHDOG is not set
785CONFIG_SSB_POSSIBLE=y
786
787#
788# Sonics Silicon Backplane
789#
790# CONFIG_SSB is not set
791
792#
793# Multifunction device drivers
794#
795# CONFIG_MFD_CORE is not set
796CONFIG_MFD_SM501=y
797# CONFIG_MFD_SM501_GPIO is not set
798# CONFIG_HTC_PASIC3 is not set
799# CONFIG_TPS65010 is not set
800# CONFIG_TWL4030_CORE is not set
801# CONFIG_MFD_TMIO is not set
802# CONFIG_PMIC_DA903X is not set
803# CONFIG_MFD_WM8400 is not set
804# CONFIG_MFD_WM8350_I2C is not set
805# CONFIG_MFD_PCF50633 is not set
806# CONFIG_REGULATOR is not set
807
808#
809# Multimedia devices
810#
811
812#
813# Multimedia core support
814#
815# CONFIG_VIDEO_DEV is not set
816# CONFIG_DVB_CORE is not set
817# CONFIG_VIDEO_MEDIA is not set
818
819#
820# Multimedia drivers
821#
822# CONFIG_DAB is not set
823
824#
825# Graphics support
826#
827# CONFIG_VGASTATE is not set
828# CONFIG_VIDEO_OUTPUT_CONTROL is not set
829CONFIG_FB=y
830# CONFIG_FIRMWARE_EDID is not set
831# CONFIG_FB_DDC is not set
832# CONFIG_FB_BOOT_VESA_SUPPORT is not set
833CONFIG_FB_CFB_FILLRECT=y
834CONFIG_FB_CFB_COPYAREA=y
835CONFIG_FB_CFB_IMAGEBLIT=y
836# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
837CONFIG_FB_SYS_FILLRECT=m
838CONFIG_FB_SYS_COPYAREA=m
839CONFIG_FB_SYS_IMAGEBLIT=m
840# CONFIG_FB_FOREIGN_ENDIAN is not set
841CONFIG_FB_SYS_FOPS=m
842CONFIG_FB_DEFERRED_IO=y
843# CONFIG_FB_SVGALIB is not set
844# CONFIG_FB_MACMODES is not set
845# CONFIG_FB_BACKLIGHT is not set
846# CONFIG_FB_MODE_HELPERS is not set
847# CONFIG_FB_TILEBLITTING is not set
848
849#
850# Frame buffer hardware drivers
851#
852# CONFIG_FB_S1D13XXX is not set
853CONFIG_FB_SH_MOBILE_LCDC=m
854CONFIG_FB_SM501=y
855# CONFIG_FB_VIRTUAL is not set
856# CONFIG_FB_METRONOME is not set
857# CONFIG_FB_MB862XX is not set
858# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
859
860#
861# Display device support
862#
863# CONFIG_DISPLAY_SUPPORT is not set
864
865#
866# Console display driver support
867#
868CONFIG_DUMMY_CONSOLE=y
869CONFIG_FRAMEBUFFER_CONSOLE=y
870# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
871# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
872# CONFIG_FONTS is not set
873CONFIG_FONT_8x8=y
874CONFIG_FONT_8x16=y
875CONFIG_LOGO=y
876# CONFIG_LOGO_LINUX_MONO is not set
877# CONFIG_LOGO_LINUX_VGA16 is not set
878CONFIG_LOGO_LINUX_CLUT224=y
879# CONFIG_LOGO_SUPERH_MONO is not set
880# CONFIG_LOGO_SUPERH_VGA16 is not set
881# CONFIG_LOGO_SUPERH_CLUT224 is not set
882# CONFIG_SOUND is not set
883CONFIG_HID_SUPPORT=y
884CONFIG_HID=y
885# CONFIG_HID_DEBUG is not set
886# CONFIG_HIDRAW is not set
887
888#
889# USB Input Devices
890#
891CONFIG_USB_HID=y
892# CONFIG_HID_PID is not set
893# CONFIG_USB_HIDDEV is not set
894
895#
896# Special HID drivers
897#
898CONFIG_HID_COMPAT=y
899CONFIG_HID_A4TECH=y
900CONFIG_HID_APPLE=y
901CONFIG_HID_BELKIN=y
902CONFIG_HID_CHERRY=y
903CONFIG_HID_CHICONY=y
904CONFIG_HID_CYPRESS=y
905CONFIG_HID_EZKEY=y
906CONFIG_HID_GYRATION=y
907CONFIG_HID_LOGITECH=y
908# CONFIG_LOGITECH_FF is not set
909# CONFIG_LOGIRUMBLEPAD2_FF is not set
910CONFIG_HID_MICROSOFT=y
911CONFIG_HID_MONTEREY=y
912# CONFIG_HID_NTRIG is not set
913CONFIG_HID_PANTHERLORD=y
914# CONFIG_PANTHERLORD_FF is not set
915CONFIG_HID_PETALYNX=y
916CONFIG_HID_SAMSUNG=y
917CONFIG_HID_SONY=y
918CONFIG_HID_SUNPLUS=y
919# CONFIG_GREENASIA_FF is not set
920# CONFIG_HID_TOPSEED is not set
921CONFIG_THRUSTMASTER_FF=m
922CONFIG_ZEROPLUS_FF=m
923CONFIG_USB_SUPPORT=y
924CONFIG_USB_ARCH_HAS_HCD=y
925# CONFIG_USB_ARCH_HAS_OHCI is not set
926# CONFIG_USB_ARCH_HAS_EHCI is not set
927CONFIG_USB=y
928# CONFIG_USB_DEBUG is not set
929CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
930
931#
932# Miscellaneous USB options
933#
934CONFIG_USB_DEVICEFS=y
935CONFIG_USB_DEVICE_CLASS=y
936# CONFIG_USB_DYNAMIC_MINORS is not set
937# CONFIG_USB_OTG is not set
938# CONFIG_USB_OTG_WHITELIST is not set
939# CONFIG_USB_OTG_BLACKLIST_HUB is not set
940CONFIG_USB_MON=y
941# CONFIG_USB_WUSB is not set
942# CONFIG_USB_WUSB_CBAF is not set
943
944#
945# USB Host Controller Drivers
946#
947# CONFIG_USB_C67X00_HCD is not set
948# CONFIG_USB_OXU210HP_HCD is not set
949# CONFIG_USB_ISP116X_HCD is not set
950# CONFIG_USB_SL811_HCD is not set
951# CONFIG_USB_R8A66597_HCD is not set
952# CONFIG_USB_HWA_HCD is not set
953
954#
955# USB Device Class drivers
956#
957# CONFIG_USB_ACM is not set
958# CONFIG_USB_PRINTER is not set
959# CONFIG_USB_WDM is not set
960# CONFIG_USB_TMC is not set
961
962#
963# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
964#
965
966#
967# see USB_STORAGE Help for more information
968#
969CONFIG_USB_STORAGE=y
970# CONFIG_USB_STORAGE_DEBUG is not set
971# CONFIG_USB_STORAGE_DATAFAB is not set
972# CONFIG_USB_STORAGE_FREECOM is not set
973# CONFIG_USB_STORAGE_ISD200 is not set
974# CONFIG_USB_STORAGE_USBAT is not set
975# CONFIG_USB_STORAGE_SDDR09 is not set
976# CONFIG_USB_STORAGE_SDDR55 is not set
977# CONFIG_USB_STORAGE_JUMPSHOT is not set
978# CONFIG_USB_STORAGE_ALAUDA is not set
979# CONFIG_USB_STORAGE_ONETOUCH is not set
980# CONFIG_USB_STORAGE_KARMA is not set
981# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
982# CONFIG_USB_LIBUSUAL is not set
983
984#
985# USB Imaging devices
986#
987# CONFIG_USB_MDC800 is not set
988# CONFIG_USB_MICROTEK is not set
989
990#
991# USB port drivers
992#
993# CONFIG_USB_SERIAL is not set
994
995#
996# USB Miscellaneous drivers
997#
998# CONFIG_USB_EMI62 is not set
999# CONFIG_USB_EMI26 is not set
1000# CONFIG_USB_ADUTUX is not set
1001# CONFIG_USB_SEVSEG is not set
1002# CONFIG_USB_RIO500 is not set
1003# CONFIG_USB_LEGOTOWER is not set
1004# CONFIG_USB_LCD is not set
1005# CONFIG_USB_BERRY_CHARGE is not set
1006# CONFIG_USB_LED is not set
1007# CONFIG_USB_CYPRESS_CY7C63 is not set
1008# CONFIG_USB_CYTHERM is not set
1009# CONFIG_USB_PHIDGET is not set
1010# CONFIG_USB_IDMOUSE is not set
1011# CONFIG_USB_FTDI_ELAN is not set
1012# CONFIG_USB_APPLEDISPLAY is not set
1013# CONFIG_USB_LD is not set
1014# CONFIG_USB_TRANCEVIBRATOR is not set
1015# CONFIG_USB_IOWARRIOR is not set
1016# CONFIG_USB_TEST is not set
1017# CONFIG_USB_ISIGHTFW is not set
1018# CONFIG_USB_VST is not set
1019# CONFIG_USB_GADGET is not set
1020
1021#
1022# OTG and related infrastructure
1023#
1024# CONFIG_USB_GPIO_VBUS is not set
1025# CONFIG_MMC is not set
1026# CONFIG_MEMSTICK is not set
1027# CONFIG_NEW_LEDS is not set
1028# CONFIG_ACCESSIBILITY is not set
1029# CONFIG_RTC_CLASS is not set
1030# CONFIG_DMADEVICES is not set
1031# CONFIG_UIO is not set
1032# CONFIG_STAGING is not set
1033
1034#
1035# File systems
1036#
1037CONFIG_EXT2_FS=y
1038# CONFIG_EXT2_FS_XATTR is not set
1039# CONFIG_EXT2_FS_XIP is not set
1040CONFIG_EXT3_FS=y
1041CONFIG_EXT3_FS_XATTR=y
1042# CONFIG_EXT3_FS_POSIX_ACL is not set
1043# CONFIG_EXT3_FS_SECURITY is not set
1044# CONFIG_EXT4_FS is not set
1045CONFIG_JBD=y
1046CONFIG_FS_MBCACHE=y
1047# CONFIG_REISERFS_FS is not set
1048# CONFIG_JFS_FS is not set
1049CONFIG_FS_POSIX_ACL=y
1050CONFIG_FILE_LOCKING=y
1051# CONFIG_XFS_FS is not set
1052# CONFIG_OCFS2_FS is not set
1053# CONFIG_BTRFS_FS is not set
1054CONFIG_DNOTIFY=y
1055CONFIG_INOTIFY=y
1056CONFIG_INOTIFY_USER=y
1057# CONFIG_QUOTA is not set
1058# CONFIG_AUTOFS_FS is not set
1059# CONFIG_AUTOFS4_FS is not set
1060# CONFIG_FUSE_FS is not set
1061
1062#
1063# CD-ROM/DVD Filesystems
1064#
1065# CONFIG_ISO9660_FS is not set
1066# CONFIG_UDF_FS is not set
1067
1068#
1069# DOS/FAT/NT Filesystems
1070#
1071CONFIG_FAT_FS=y
1072CONFIG_MSDOS_FS=y
1073CONFIG_VFAT_FS=y
1074CONFIG_FAT_DEFAULT_CODEPAGE=437
1075CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1076CONFIG_NTFS_FS=y
1077# CONFIG_NTFS_DEBUG is not set
1078CONFIG_NTFS_RW=y
1079
1080#
1081# Pseudo filesystems
1082#
1083CONFIG_PROC_FS=y
1084CONFIG_PROC_KCORE=y
1085CONFIG_PROC_SYSCTL=y
1086CONFIG_PROC_PAGE_MONITOR=y
1087CONFIG_SYSFS=y
1088CONFIG_TMPFS=y
1089# CONFIG_TMPFS_POSIX_ACL is not set
1090# CONFIG_HUGETLBFS is not set
1091# CONFIG_HUGETLB_PAGE is not set
1092# CONFIG_CONFIGFS_FS is not set
1093CONFIG_MISC_FILESYSTEMS=y
1094# CONFIG_ADFS_FS is not set
1095# CONFIG_AFFS_FS is not set
1096# CONFIG_HFS_FS is not set
1097# CONFIG_HFSPLUS_FS is not set
1098# CONFIG_BEFS_FS is not set
1099# CONFIG_BFS_FS is not set
1100# CONFIG_EFS_FS is not set
1101# CONFIG_JFFS2_FS is not set
1102# CONFIG_CRAMFS is not set
1103# CONFIG_SQUASHFS is not set
1104# CONFIG_VXFS_FS is not set
1105CONFIG_MINIX_FS=y
1106# CONFIG_OMFS_FS is not set
1107# CONFIG_HPFS_FS is not set
1108# CONFIG_QNX4FS_FS is not set
1109# CONFIG_ROMFS_FS is not set
1110# CONFIG_SYSV_FS is not set
1111# CONFIG_UFS_FS is not set
1112CONFIG_NETWORK_FILESYSTEMS=y
1113CONFIG_NFS_FS=y
1114CONFIG_NFS_V3=y
1115# CONFIG_NFS_V3_ACL is not set
1116CONFIG_NFS_V4=y
1117CONFIG_ROOT_NFS=y
1118CONFIG_NFSD=y
1119CONFIG_NFSD_V3=y
1120# CONFIG_NFSD_V3_ACL is not set
1121CONFIG_NFSD_V4=y
1122CONFIG_LOCKD=y
1123CONFIG_LOCKD_V4=y
1124CONFIG_EXPORTFS=y
1125CONFIG_NFS_COMMON=y
1126CONFIG_SUNRPC=y
1127CONFIG_SUNRPC_GSS=y
1128# CONFIG_SUNRPC_REGISTER_V4 is not set
1129CONFIG_RPCSEC_GSS_KRB5=y
1130# CONFIG_RPCSEC_GSS_SPKM3 is not set
1131# CONFIG_SMB_FS is not set
1132# CONFIG_CIFS is not set
1133# CONFIG_NCP_FS is not set
1134# CONFIG_CODA_FS is not set
1135# CONFIG_AFS_FS is not set
1136
1137#
1138# Partition Types
1139#
1140# CONFIG_PARTITION_ADVANCED is not set
1141CONFIG_MSDOS_PARTITION=y
1142CONFIG_NLS=y
1143CONFIG_NLS_DEFAULT="iso8859-1"
1144CONFIG_NLS_CODEPAGE_437=y
1145# CONFIG_NLS_CODEPAGE_737 is not set
1146# CONFIG_NLS_CODEPAGE_775 is not set
1147# CONFIG_NLS_CODEPAGE_850 is not set
1148# CONFIG_NLS_CODEPAGE_852 is not set
1149# CONFIG_NLS_CODEPAGE_855 is not set
1150# CONFIG_NLS_CODEPAGE_857 is not set
1151# CONFIG_NLS_CODEPAGE_860 is not set
1152# CONFIG_NLS_CODEPAGE_861 is not set
1153# CONFIG_NLS_CODEPAGE_862 is not set
1154# CONFIG_NLS_CODEPAGE_863 is not set
1155# CONFIG_NLS_CODEPAGE_864 is not set
1156# CONFIG_NLS_CODEPAGE_865 is not set
1157# CONFIG_NLS_CODEPAGE_866 is not set
1158# CONFIG_NLS_CODEPAGE_869 is not set
1159# CONFIG_NLS_CODEPAGE_936 is not set
1160# CONFIG_NLS_CODEPAGE_950 is not set
1161CONFIG_NLS_CODEPAGE_932=y
1162# CONFIG_NLS_CODEPAGE_949 is not set
1163# CONFIG_NLS_CODEPAGE_874 is not set
1164# CONFIG_NLS_ISO8859_8 is not set
1165# CONFIG_NLS_CODEPAGE_1250 is not set
1166# CONFIG_NLS_CODEPAGE_1251 is not set
1167# CONFIG_NLS_ASCII is not set
1168CONFIG_NLS_ISO8859_1=y
1169# CONFIG_NLS_ISO8859_2 is not set
1170# CONFIG_NLS_ISO8859_3 is not set
1171# CONFIG_NLS_ISO8859_4 is not set
1172# CONFIG_NLS_ISO8859_5 is not set
1173# CONFIG_NLS_ISO8859_6 is not set
1174# CONFIG_NLS_ISO8859_7 is not set
1175# CONFIG_NLS_ISO8859_9 is not set
1176# CONFIG_NLS_ISO8859_13 is not set
1177# CONFIG_NLS_ISO8859_14 is not set
1178# CONFIG_NLS_ISO8859_15 is not set
1179# CONFIG_NLS_KOI8_R is not set
1180# CONFIG_NLS_KOI8_U is not set
1181# CONFIG_NLS_UTF8 is not set
1182# CONFIG_DLM is not set
1183
1184#
1185# Kernel hacking
1186#
1187CONFIG_TRACE_IRQFLAGS_SUPPORT=y
1188# CONFIG_PRINTK_TIME is not set
1189# CONFIG_ENABLE_WARN_DEPRECATED is not set
1190# CONFIG_ENABLE_MUST_CHECK is not set
1191CONFIG_FRAME_WARN=1024
1192# CONFIG_MAGIC_SYSRQ is not set
1193# CONFIG_UNUSED_SYMBOLS is not set
1194# CONFIG_DEBUG_FS is not set
1195# CONFIG_HEADERS_CHECK is not set
1196# CONFIG_DEBUG_KERNEL is not set
1197# CONFIG_DEBUG_BUGVERBOSE is not set
1198# CONFIG_DEBUG_MEMORY_INIT is not set
1199# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1200# CONFIG_LATENCYTOP is not set
1201CONFIG_SYSCTL_SYSCALL_CHECK=y
1202CONFIG_HAVE_FUNCTION_TRACER=y
1203CONFIG_HAVE_DYNAMIC_FTRACE=y
1204CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1205
1206#
1207# Tracers
1208#
1209# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1210# CONFIG_SAMPLES is not set
1211CONFIG_HAVE_ARCH_KGDB=y
1212# CONFIG_SH_STANDARD_BIOS is not set
1213# CONFIG_EARLY_SCIF_CONSOLE is not set
1214# CONFIG_MORE_COMPILE_OPTIONS is not set
1215
1216#
1217# Security options
1218#
1219# CONFIG_KEYS is not set
1220# CONFIG_SECURITY is not set
1221# CONFIG_SECURITYFS is not set
1222# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1223CONFIG_CRYPTO=y
1224
1225#
1226# Crypto core or helper
1227#
1228# CONFIG_CRYPTO_FIPS is not set
1229CONFIG_CRYPTO_ALGAPI=y
1230CONFIG_CRYPTO_ALGAPI2=y
1231CONFIG_CRYPTO_AEAD2=y
1232CONFIG_CRYPTO_BLKCIPHER=y
1233CONFIG_CRYPTO_BLKCIPHER2=y
1234CONFIG_CRYPTO_HASH=y
1235CONFIG_CRYPTO_HASH2=y
1236CONFIG_CRYPTO_RNG2=y
1237CONFIG_CRYPTO_MANAGER=y
1238CONFIG_CRYPTO_MANAGER2=y
1239# CONFIG_CRYPTO_GF128MUL is not set
1240# CONFIG_CRYPTO_NULL is not set
1241# CONFIG_CRYPTO_CRYPTD is not set
1242# CONFIG_CRYPTO_AUTHENC is not set
1243# CONFIG_CRYPTO_TEST is not set
1244
1245#
1246# Authenticated Encryption with Associated Data
1247#
1248# CONFIG_CRYPTO_CCM is not set
1249# CONFIG_CRYPTO_GCM is not set
1250# CONFIG_CRYPTO_SEQIV is not set
1251
1252#
1253# Block modes
1254#
1255CONFIG_CRYPTO_CBC=y
1256# CONFIG_CRYPTO_CTR is not set
1257# CONFIG_CRYPTO_CTS is not set
1258# CONFIG_CRYPTO_ECB is not set
1259# CONFIG_CRYPTO_LRW is not set
1260# CONFIG_CRYPTO_PCBC is not set
1261# CONFIG_CRYPTO_XTS is not set
1262
1263#
1264# Hash modes
1265#
1266CONFIG_CRYPTO_HMAC=y
1267# CONFIG_CRYPTO_XCBC is not set
1268
1269#
1270# Digest
1271#
1272# CONFIG_CRYPTO_CRC32C is not set
1273# CONFIG_CRYPTO_MD4 is not set
1274CONFIG_CRYPTO_MD5=y
1275# CONFIG_CRYPTO_MICHAEL_MIC is not set
1276# CONFIG_CRYPTO_RMD128 is not set
1277# CONFIG_CRYPTO_RMD160 is not set
1278# CONFIG_CRYPTO_RMD256 is not set
1279# CONFIG_CRYPTO_RMD320 is not set
1280# CONFIG_CRYPTO_SHA1 is not set
1281# CONFIG_CRYPTO_SHA256 is not set
1282# CONFIG_CRYPTO_SHA512 is not set
1283# CONFIG_CRYPTO_TGR192 is not set
1284# CONFIG_CRYPTO_WP512 is not set
1285
1286#
1287# Ciphers
1288#
1289# CONFIG_CRYPTO_AES is not set
1290# CONFIG_CRYPTO_ANUBIS is not set
1291# CONFIG_CRYPTO_ARC4 is not set
1292# CONFIG_CRYPTO_BLOWFISH is not set
1293# CONFIG_CRYPTO_CAMELLIA is not set
1294# CONFIG_CRYPTO_CAST5 is not set
1295# CONFIG_CRYPTO_CAST6 is not set
1296CONFIG_CRYPTO_DES=y
1297# CONFIG_CRYPTO_FCRYPT is not set
1298# CONFIG_CRYPTO_KHAZAD is not set
1299# CONFIG_CRYPTO_SALSA20 is not set
1300# CONFIG_CRYPTO_SEED is not set
1301# CONFIG_CRYPTO_SERPENT is not set
1302# CONFIG_CRYPTO_TEA is not set
1303# CONFIG_CRYPTO_TWOFISH is not set
1304
1305#
1306# Compression
1307#
1308# CONFIG_CRYPTO_DEFLATE is not set
1309# CONFIG_CRYPTO_LZO is not set
1310
1311#
1312# Random Number Generation
1313#
1314# CONFIG_CRYPTO_ANSI_CPRNG is not set
1315# CONFIG_CRYPTO_HW is not set
1316
1317#
1318# Library routines
1319#
1320CONFIG_BITREVERSE=y
1321CONFIG_GENERIC_FIND_LAST_BIT=y
1322# CONFIG_CRC_CCITT is not set
1323# CONFIG_CRC16 is not set
1324# CONFIG_CRC_T10DIF is not set
1325# CONFIG_CRC_ITU_T is not set
1326CONFIG_CRC32=y
1327# CONFIG_CRC7 is not set
1328# CONFIG_LIBCRC32C is not set
1329CONFIG_PLIST=y
1330CONFIG_HAS_IOMEM=y
1331CONFIG_HAS_IOPORT=y
1332CONFIG_HAS_DMA=y
diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig
index 01936368b8b0..f13a05285a9d 100644
--- a/arch/sh/drivers/dma/Kconfig
+++ b/arch/sh/drivers/dma/Kconfig
@@ -9,13 +9,21 @@ config SH_DMA
9 select SH_DMA_API 9 select SH_DMA_API
10 default n 10 default n
11 11
12config SH_DMA_IRQ_MULTI
13 bool
14 depends on SH_DMA
15 default y if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7751 || \
16 CPU_SUBTYPE_SH7750S || CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751R || \
17 CPU_SUBTYPE_SH7091 || CPU_SUBTYPE_SH7763 || CPU_SUBTYPE_SH7764 || \
18 CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
19
12config NR_ONCHIP_DMA_CHANNELS 20config NR_ONCHIP_DMA_CHANNELS
13 int 21 int
14 depends on SH_DMA 22 depends on SH_DMA
15 default "6" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721 23 default "4" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7750S
16 default "8" if CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751R 24 default "8" if CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751R || CPU_SUBTYPE_SH7760
17 default "12" if CPU_SUBTYPE_SH7780 25 default "12" if CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785
18 default "4" 26 default "6"
19 help 27 help
20 This allows you to specify the number of channels that the on-chip 28 This allows you to specify the number of channels that the on-chip
21 DMAC supports. This will be 4 for SH7750/SH7751 and 8 for the 29 DMAC supports. This will be 4 for SH7750/SH7751 and 8 for the
@@ -46,4 +54,28 @@ config SH_DMABRG
46 of the SH7760. 54 of the SH7760.
47 Say Y if you want to use Audio/USB DMA on your SH7760 board. 55 Say Y if you want to use Audio/USB DMA on your SH7760 board.
48 56
57config PVR2_DMA
58 tristate "PowerVR 2 DMAC support"
59 depends on SH_DREAMCAST && SH_DMA
60 help
61 Selecting this will enable support for the PVR2 DMA controller.
62 As this chains off of the on-chip DMAC, that must also be
63 enabled by default.
64
65 This is primarily used by the pvr2fb framebuffer driver for
66 certain optimizations, but is not necessary for functionality.
67
68 If in doubt, say N.
69
70config G2_DMA
71 tristate "G2 Bus DMA support"
72 depends on SH_DREAMCAST
73 select SH_DMA_API
74 help
75 This enables support for the DMA controller for the Dreamcast's
76 G2 bus. Drivers that want this will generally enable this on
77 their own.
78
79 If in doubt, say N.
80
49endmenu 81endmenu
diff --git a/arch/sh/drivers/dma/Makefile b/arch/sh/drivers/dma/Makefile
index ab956adacb47..c6068137b46f 100644
--- a/arch/sh/drivers/dma/Makefile
+++ b/arch/sh/drivers/dma/Makefile
@@ -4,5 +4,6 @@
4 4
5obj-$(CONFIG_SH_DMA_API) += dma-api.o dma-sysfs.o 5obj-$(CONFIG_SH_DMA_API) += dma-api.o dma-sysfs.o
6obj-$(CONFIG_SH_DMA) += dma-sh.o 6obj-$(CONFIG_SH_DMA) += dma-sh.o
7obj-$(CONFIG_SH_DREAMCAST) += dma-pvr2.o dma-g2.o 7obj-$(CONFIG_PVR2_DMA) += dma-pvr2.o
8obj-$(CONFIG_G2_DMA) += dma-g2.o
8obj-$(CONFIG_SH_DMABRG) += dmabrg.o 9obj-$(CONFIG_SH_DMABRG) += dmabrg.o
diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c
index 50887a592dd0..37fb5b8bbc3f 100644
--- a/arch/sh/drivers/dma/dma-sh.c
+++ b/arch/sh/drivers/dma/dma-sh.c
@@ -17,28 +17,16 @@
17#include <mach-dreamcast/mach/dma.h> 17#include <mach-dreamcast/mach/dma.h>
18#include <asm/dma.h> 18#include <asm/dma.h>
19#include <asm/io.h> 19#include <asm/io.h>
20#include "dma-sh.h" 20#include <asm/dma-sh.h>
21 21
22static int dmte_irq_map[] = { 22#if defined(DMAE1_IRQ)
23 DMTE0_IRQ, 23#define NR_DMAE 2
24 DMTE1_IRQ, 24#else
25 DMTE2_IRQ, 25#define NR_DMAE 1
26 DMTE3_IRQ,
27#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
28 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
29 defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
30 defined(CONFIG_CPU_SUBTYPE_SH7760) || \
31 defined(CONFIG_CPU_SUBTYPE_SH7709) || \
32 defined(CONFIG_CPU_SUBTYPE_SH7780)
33 DMTE4_IRQ,
34 DMTE5_IRQ,
35#endif
36#if defined(CONFIG_CPU_SUBTYPE_SH7751R) || \
37 defined(CONFIG_CPU_SUBTYPE_SH7760) || \
38 defined(CONFIG_CPU_SUBTYPE_SH7780)
39 DMTE6_IRQ,
40 DMTE7_IRQ,
41#endif 26#endif
27
28static const char *dmae_name[] = {
29 "DMAC Address Error0", "DMAC Address Error1"
42}; 30};
43 31
44static inline unsigned int get_dmte_irq(unsigned int chan) 32static inline unsigned int get_dmte_irq(unsigned int chan)
@@ -46,7 +34,14 @@ static inline unsigned int get_dmte_irq(unsigned int chan)
46 unsigned int irq = 0; 34 unsigned int irq = 0;
47 if (chan < ARRAY_SIZE(dmte_irq_map)) 35 if (chan < ARRAY_SIZE(dmte_irq_map))
48 irq = dmte_irq_map[chan]; 36 irq = dmte_irq_map[chan];
37
38#if defined(CONFIG_SH_DMA_IRQ_MULTI)
39 if (irq > DMTE6_IRQ)
40 return DMTE6_IRQ;
41 return DMTE0_IRQ;
42#else
49 return irq; 43 return irq;
44#endif
50} 45}
51 46
52/* 47/*
@@ -59,7 +54,7 @@ static inline unsigned int get_dmte_irq(unsigned int chan)
59 */ 54 */
60static inline unsigned int calc_xmit_shift(struct dma_channel *chan) 55static inline unsigned int calc_xmit_shift(struct dma_channel *chan)
61{ 56{
62 u32 chcr = ctrl_inl(CHCR[chan->chan]); 57 u32 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR);
63 58
64 return ts_shift[(chcr & CHCR_TS_MASK)>>CHCR_TS_SHIFT]; 59 return ts_shift[(chcr & CHCR_TS_MASK)>>CHCR_TS_SHIFT];
65} 60}
@@ -75,13 +70,13 @@ static irqreturn_t dma_tei(int irq, void *dev_id)
75 struct dma_channel *chan = dev_id; 70 struct dma_channel *chan = dev_id;
76 u32 chcr; 71 u32 chcr;
77 72
78 chcr = ctrl_inl(CHCR[chan->chan]); 73 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR);
79 74
80 if (!(chcr & CHCR_TE)) 75 if (!(chcr & CHCR_TE))
81 return IRQ_NONE; 76 return IRQ_NONE;
82 77
83 chcr &= ~(CHCR_IE | CHCR_DE); 78 chcr &= ~(CHCR_IE | CHCR_DE);
84 ctrl_outl(chcr, CHCR[chan->chan]); 79 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR));
85 80
86 wake_up(&chan->wait_queue); 81 wake_up(&chan->wait_queue);
87 82
@@ -94,7 +89,12 @@ static int sh_dmac_request_dma(struct dma_channel *chan)
94 return 0; 89 return 0;
95 90
96 return request_irq(get_dmte_irq(chan->chan), dma_tei, 91 return request_irq(get_dmte_irq(chan->chan), dma_tei,
97 IRQF_DISABLED, chan->dev_id, chan); 92#if defined(CONFIG_SH_DMA_IRQ_MULTI)
93 IRQF_SHARED,
94#else
95 IRQF_DISABLED,
96#endif
97 chan->dev_id, chan);
98} 98}
99 99
100static void sh_dmac_free_dma(struct dma_channel *chan) 100static void sh_dmac_free_dma(struct dma_channel *chan)
@@ -115,7 +115,7 @@ sh_dmac_configure_channel(struct dma_channel *chan, unsigned long chcr)
115 chan->flags &= ~DMA_TEI_CAPABLE; 115 chan->flags &= ~DMA_TEI_CAPABLE;
116 } 116 }
117 117
118 ctrl_outl(chcr, CHCR[chan->chan]); 118 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR));
119 119
120 chan->flags |= DMA_CONFIGURED; 120 chan->flags |= DMA_CONFIGURED;
121 return 0; 121 return 0;
@@ -126,13 +126,13 @@ static void sh_dmac_enable_dma(struct dma_channel *chan)
126 int irq; 126 int irq;
127 u32 chcr; 127 u32 chcr;
128 128
129 chcr = ctrl_inl(CHCR[chan->chan]); 129 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR);
130 chcr |= CHCR_DE; 130 chcr |= CHCR_DE;
131 131
132 if (chan->flags & DMA_TEI_CAPABLE) 132 if (chan->flags & DMA_TEI_CAPABLE)
133 chcr |= CHCR_IE; 133 chcr |= CHCR_IE;
134 134
135 ctrl_outl(chcr, CHCR[chan->chan]); 135 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR));
136 136
137 if (chan->flags & DMA_TEI_CAPABLE) { 137 if (chan->flags & DMA_TEI_CAPABLE) {
138 irq = get_dmte_irq(chan->chan); 138 irq = get_dmte_irq(chan->chan);
@@ -150,9 +150,9 @@ static void sh_dmac_disable_dma(struct dma_channel *chan)
150 disable_irq(irq); 150 disable_irq(irq);
151 } 151 }
152 152
153 chcr = ctrl_inl(CHCR[chan->chan]); 153 chcr = ctrl_inl(dma_base_addr[chan->chan] + CHCR);
154 chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE); 154 chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE);
155 ctrl_outl(chcr, CHCR[chan->chan]); 155 ctrl_outl(chcr, (dma_base_addr[chan->chan] + CHCR));
156} 156}
157 157
158static int sh_dmac_xfer_dma(struct dma_channel *chan) 158static int sh_dmac_xfer_dma(struct dma_channel *chan)
@@ -183,12 +183,13 @@ static int sh_dmac_xfer_dma(struct dma_channel *chan)
183 */ 183 */
184 if (chan->sar || (mach_is_dreamcast() && 184 if (chan->sar || (mach_is_dreamcast() &&
185 chan->chan == PVR2_CASCADE_CHAN)) 185 chan->chan == PVR2_CASCADE_CHAN))
186 ctrl_outl(chan->sar, SAR[chan->chan]); 186 ctrl_outl(chan->sar, (dma_base_addr[chan->chan]+SAR));
187 if (chan->dar || (mach_is_dreamcast() && 187 if (chan->dar || (mach_is_dreamcast() &&
188 chan->chan == PVR2_CASCADE_CHAN)) 188 chan->chan == PVR2_CASCADE_CHAN))
189 ctrl_outl(chan->dar, DAR[chan->chan]); 189 ctrl_outl(chan->dar, (dma_base_addr[chan->chan] + DAR));
190 190
191 ctrl_outl(chan->count >> calc_xmit_shift(chan), DMATCR[chan->chan]); 191 ctrl_outl(chan->count >> calc_xmit_shift(chan),
192 (dma_base_addr[chan->chan] + TCR));
192 193
193 sh_dmac_enable_dma(chan); 194 sh_dmac_enable_dma(chan);
194 195
@@ -197,36 +198,26 @@ static int sh_dmac_xfer_dma(struct dma_channel *chan)
197 198
198static int sh_dmac_get_dma_residue(struct dma_channel *chan) 199static int sh_dmac_get_dma_residue(struct dma_channel *chan)
199{ 200{
200 if (!(ctrl_inl(CHCR[chan->chan]) & CHCR_DE)) 201 if (!(ctrl_inl(dma_base_addr[chan->chan] + CHCR) & CHCR_DE))
201 return 0; 202 return 0;
202 203
203 return ctrl_inl(DMATCR[chan->chan]) << calc_xmit_shift(chan); 204 return ctrl_inl(dma_base_addr[chan->chan] + TCR)
205 << calc_xmit_shift(chan);
204} 206}
205 207
206#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 208static inline int dmaor_reset(int no)
207 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
208 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
209 defined(CONFIG_CPU_SUBTYPE_SH7709)
210#define dmaor_read_reg() ctrl_inw(DMAOR)
211#define dmaor_write_reg(data) ctrl_outw(data, DMAOR)
212#else
213#define dmaor_read_reg() ctrl_inl(DMAOR)
214#define dmaor_write_reg(data) ctrl_outl(data, DMAOR)
215#endif
216
217static inline int dmaor_reset(void)
218{ 209{
219 unsigned long dmaor = dmaor_read_reg(); 210 unsigned long dmaor = dmaor_read_reg(no);
220 211
221 /* Try to clear the error flags first, incase they are set */ 212 /* Try to clear the error flags first, incase they are set */
222 dmaor &= ~(DMAOR_NMIF | DMAOR_AE); 213 dmaor &= ~(DMAOR_NMIF | DMAOR_AE);
223 dmaor_write_reg(dmaor); 214 dmaor_write_reg(no, dmaor);
224 215
225 dmaor |= DMAOR_INIT; 216 dmaor |= DMAOR_INIT;
226 dmaor_write_reg(dmaor); 217 dmaor_write_reg(no, dmaor);
227 218
228 /* See if we got an error again */ 219 /* See if we got an error again */
229 if ((dmaor_read_reg() & (DMAOR_AE | DMAOR_NMIF))) { 220 if ((dmaor_read_reg(no) & (DMAOR_AE | DMAOR_NMIF))) {
230 printk(KERN_ERR "dma-sh: Can't initialize DMAOR.\n"); 221 printk(KERN_ERR "dma-sh: Can't initialize DMAOR.\n");
231 return -EINVAL; 222 return -EINVAL;
232 } 223 }
@@ -237,10 +228,33 @@ static inline int dmaor_reset(void)
237#if defined(CONFIG_CPU_SH4) 228#if defined(CONFIG_CPU_SH4)
238static irqreturn_t dma_err(int irq, void *dummy) 229static irqreturn_t dma_err(int irq, void *dummy)
239{ 230{
240 dmaor_reset(); 231#if defined(CONFIG_SH_DMA_IRQ_MULTI)
232 int cnt = 0;
233 switch (irq) {
234#if defined(DMTE6_IRQ) && defined(DMAE1_IRQ)
235 case DMTE6_IRQ:
236 cnt++;
237#endif
238 case DMTE0_IRQ:
239 if (dmaor_read_reg(cnt) & (DMAOR_NMIF | DMAOR_AE)) {
240 disable_irq(irq);
241 /* DMA multi and error IRQ */
242 return IRQ_HANDLED;
243 }
244 default:
245 return IRQ_NONE;
246 }
247#else
248 dmaor_reset(0);
249#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
250 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
251 defined(CONFIG_CPU_SUBTYPE_SH7785)
252 dmaor_reset(1);
253#endif
241 disable_irq(irq); 254 disable_irq(irq);
242 255
243 return IRQ_HANDLED; 256 return IRQ_HANDLED;
257#endif
244} 258}
245#endif 259#endif
246 260
@@ -259,24 +273,59 @@ static struct dma_info sh_dmac_info = {
259 .flags = DMAC_CHANNELS_TEI_CAPABLE, 273 .flags = DMAC_CHANNELS_TEI_CAPABLE,
260}; 274};
261 275
276#ifdef CONFIG_CPU_SH4
277static unsigned int get_dma_error_irq(int n)
278{
279#if defined(CONFIG_SH_DMA_IRQ_MULTI)
280 return (n == 0) ? get_dmte_irq(0) : get_dmte_irq(6);
281#else
282 return (n == 0) ? DMAE0_IRQ :
283#if defined(DMAE1_IRQ)
284 DMAE1_IRQ;
285#else
286 -1;
287#endif
288#endif
289}
290#endif
291
262static int __init sh_dmac_init(void) 292static int __init sh_dmac_init(void)
263{ 293{
264 struct dma_info *info = &sh_dmac_info; 294 struct dma_info *info = &sh_dmac_info;
265 int i; 295 int i;
266 296
267#ifdef CONFIG_CPU_SH4 297#ifdef CONFIG_CPU_SH4
268 i = request_irq(DMAE_IRQ, dma_err, IRQF_DISABLED, "DMAC Address Error", 0); 298 int n;
269 if (unlikely(i < 0)) 299
270 return i; 300 for (n = 0; n < NR_DMAE; n++) {
301 i = request_irq(get_dma_error_irq(n), dma_err,
302#if defined(CONFIG_SH_DMA_IRQ_MULTI)
303 IRQF_SHARED,
304#else
305 IRQF_DISABLED,
271#endif 306#endif
307 dmae_name[n], (void *)dmae_name[n]);
308 if (unlikely(i < 0)) {
309 printk(KERN_ERR "%s request_irq fail\n", dmae_name[n]);
310 return i;
311 }
312 }
313#endif /* CONFIG_CPU_SH4 */
272 314
273 /* 315 /*
274 * Initialize DMAOR, and clean up any error flags that may have 316 * Initialize DMAOR, and clean up any error flags that may have
275 * been set. 317 * been set.
276 */ 318 */
277 i = dmaor_reset(); 319 i = dmaor_reset(0);
320 if (unlikely(i != 0))
321 return i;
322#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
323 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
324 defined(CONFIG_CPU_SUBTYPE_SH7785)
325 i = dmaor_reset(1);
278 if (unlikely(i != 0)) 326 if (unlikely(i != 0))
279 return i; 327 return i;
328#endif
280 329
281 return register_dmac(info); 330 return register_dmac(info);
282} 331}
@@ -284,8 +333,12 @@ static int __init sh_dmac_init(void)
284static void __exit sh_dmac_exit(void) 333static void __exit sh_dmac_exit(void)
285{ 334{
286#ifdef CONFIG_CPU_SH4 335#ifdef CONFIG_CPU_SH4
287 free_irq(DMAE_IRQ, 0); 336 int n;
288#endif 337
338 for (n = 0; n < NR_DMAE; n++) {
339 free_irq(get_dma_error_irq(n), (void *)dmae_name[n]);
340 }
341#endif /* CONFIG_CPU_SH4 */
289 unregister_dmac(&sh_dmac_info); 342 unregister_dmac(&sh_dmac_info);
290} 343}
291 344
diff --git a/arch/sh/drivers/dma/dma-sh.h b/arch/sh/drivers/dma/dma-sh.h
deleted file mode 100644
index 05fecd5428e4..000000000000
--- a/arch/sh/drivers/dma/dma-sh.h
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * arch/sh/drivers/dma/dma-sh.h
3 *
4 * Copyright (C) 2000 Takashi YOSHII
5 * Copyright (C) 2003 Paul Mundt
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#ifndef __DMA_SH_H
12#define __DMA_SH_H
13
14#include <cpu/dma.h>
15
16/* Definitions for the SuperH DMAC */
17#define REQ_L 0x00000000
18#define REQ_E 0x00080000
19#define RACK_H 0x00000000
20#define RACK_L 0x00040000
21#define ACK_R 0x00000000
22#define ACK_W 0x00020000
23#define ACK_H 0x00000000
24#define ACK_L 0x00010000
25#define DM_INC 0x00004000
26#define DM_DEC 0x00008000
27#define SM_INC 0x00001000
28#define SM_DEC 0x00002000
29#define RS_IN 0x00000200
30#define RS_OUT 0x00000300
31#define TS_BLK 0x00000040
32#define TM_BUR 0x00000020
33#define CHCR_DE 0x00000001
34#define CHCR_TE 0x00000002
35#define CHCR_IE 0x00000004
36
37/* DMAOR definitions */
38#define DMAOR_AE 0x00000004
39#define DMAOR_NMIF 0x00000002
40#define DMAOR_DME 0x00000001
41
42/*
43 * Define the default configuration for dual address memory-memory transfer.
44 * The 0x400 value represents auto-request, external->external.
45 */
46#define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_32)
47
48#define MAX_DMAC_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
49
50/*
51 * Subtypes that have fewer channels than this simply need to change
52 * CONFIG_NR_ONCHIP_DMA_CHANNELS. Likewise, subtypes with a larger number
53 * of channels should expand on this.
54 *
55 * For most subtypes we can easily figure these values out with some
56 * basic calculation, unfortunately on other subtypes these are more
57 * scattered, so we just leave it unrolled for simplicity.
58 */
59#define SAR ((unsigned long[]){SH_DMAC_BASE + 0x00, SH_DMAC_BASE + 0x10, \
60 SH_DMAC_BASE + 0x20, SH_DMAC_BASE + 0x30, \
61 SH_DMAC_BASE + 0x50, SH_DMAC_BASE + 0x60})
62#define DAR ((unsigned long[]){SH_DMAC_BASE + 0x04, SH_DMAC_BASE + 0x14, \
63 SH_DMAC_BASE + 0x24, SH_DMAC_BASE + 0x34, \
64 SH_DMAC_BASE + 0x54, SH_DMAC_BASE + 0x64})
65#define DMATCR ((unsigned long[]){SH_DMAC_BASE + 0x08, SH_DMAC_BASE + 0x18, \
66 SH_DMAC_BASE + 0x28, SH_DMAC_BASE + 0x38, \
67 SH_DMAC_BASE + 0x58, SH_DMAC_BASE + 0x68})
68#define CHCR ((unsigned long[]){SH_DMAC_BASE + 0x0c, SH_DMAC_BASE + 0x1c, \
69 SH_DMAC_BASE + 0x2c, SH_DMAC_BASE + 0x3c, \
70 SH_DMAC_BASE + 0x5c, SH_DMAC_BASE + 0x6c})
71
72#define DMAOR (SH_DMAC_BASE + 0x40)
73
74#endif /* __DMA_SH_H */
75
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 078dc44d6b08..773d575a04b9 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -127,8 +127,8 @@ int __init sh7780_pcic_init(struct sh4_pci_address_map *map)
127 pci_write_reg(word, SH4_PCILSR0); 127 pci_write_reg(word, SH4_PCILSR0);
128 pci_write_reg(0x00000001, SH4_PCILSR1); 128 pci_write_reg(0x00000001, SH4_PCILSR1);
129 /* Set the values on window 0 PCI config registers */ 129 /* Set the values on window 0 PCI config registers */
130 word = (CONFIG_MEMORY_SIZE > 0x08000000) ? 0x10000000 : 0x08000000; 130 word = CONFIG_MEMORY_START | (CONFIG_MEMORY_SIZE - 0x01000000);
131 pci_write_reg(word | 0xa0000000, SH4_PCILAR0); 131 pci_write_reg(word, SH4_PCILAR0);
132 pci_write_reg(word, SH7780_PCIMBAR0); 132 pci_write_reg(word, SH7780_PCIMBAR0);
133 /* Set the values on window 1 PCI config registers */ 133 /* Set the values on window 1 PCI config registers */
134 pci_write_reg(0x00000000, SH4_PCILAR1); 134 pci_write_reg(0x00000000, SH4_PCILAR1);
diff --git a/arch/sh/include/asm/addrspace.h b/arch/sh/include/asm/addrspace.h
index 36736c7e93db..80d40813e057 100644
--- a/arch/sh/include/asm/addrspace.h
+++ b/arch/sh/include/asm/addrspace.h
@@ -31,7 +31,7 @@
31/* Returns the physical address of a PnSEG (n=1,2) address */ 31/* Returns the physical address of a PnSEG (n=1,2) address */
32#define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff) 32#define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff)
33 33
34#ifdef CONFIG_29BIT 34#if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED)
35/* 35/*
36 * Map an address to a certain privileged segment 36 * Map an address to a certain privileged segment
37 */ 37 */
@@ -43,7 +43,7 @@
43 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG)) 43 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG))
44#define P4SEGADDR(a) \ 44#define P4SEGADDR(a) \
45 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG)) 45 ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG))
46#endif /* 29BIT */ 46#endif /* 29BIT || PMB_FIXED */
47#endif /* P1SEG */ 47#endif /* P1SEG */
48 48
49/* Check if an address can be reached in 29 bits */ 49/* Check if an address can be reached in 29 bits */
diff --git a/arch/sh/include/asm/atomic-irq.h b/arch/sh/include/asm/atomic-irq.h
index 74f7943cff6f..a0b348068cae 100644
--- a/arch/sh/include/asm/atomic-irq.h
+++ b/arch/sh/include/asm/atomic-irq.h
@@ -11,7 +11,7 @@ static inline void atomic_add(int i, atomic_t *v)
11 unsigned long flags; 11 unsigned long flags;
12 12
13 local_irq_save(flags); 13 local_irq_save(flags);
14 *(long *)v += i; 14 v->counter += i;
15 local_irq_restore(flags); 15 local_irq_restore(flags);
16} 16}
17 17
@@ -20,7 +20,7 @@ static inline void atomic_sub(int i, atomic_t *v)
20 unsigned long flags; 20 unsigned long flags;
21 21
22 local_irq_save(flags); 22 local_irq_save(flags);
23 *(long *)v -= i; 23 v->counter -= i;
24 local_irq_restore(flags); 24 local_irq_restore(flags);
25} 25}
26 26
@@ -29,9 +29,9 @@ static inline int atomic_add_return(int i, atomic_t *v)
29 unsigned long temp, flags; 29 unsigned long temp, flags;
30 30
31 local_irq_save(flags); 31 local_irq_save(flags);
32 temp = *(long *)v; 32 temp = v->counter;
33 temp += i; 33 temp += i;
34 *(long *)v = temp; 34 v->counter = temp;
35 local_irq_restore(flags); 35 local_irq_restore(flags);
36 36
37 return temp; 37 return temp;
@@ -42,9 +42,9 @@ static inline int atomic_sub_return(int i, atomic_t *v)
42 unsigned long temp, flags; 42 unsigned long temp, flags;
43 43
44 local_irq_save(flags); 44 local_irq_save(flags);
45 temp = *(long *)v; 45 temp = v->counter;
46 temp -= i; 46 temp -= i;
47 *(long *)v = temp; 47 v->counter = temp;
48 local_irq_restore(flags); 48 local_irq_restore(flags);
49 49
50 return temp; 50 return temp;
@@ -55,7 +55,7 @@ static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
55 unsigned long flags; 55 unsigned long flags;
56 56
57 local_irq_save(flags); 57 local_irq_save(flags);
58 *(long *)v &= ~mask; 58 v->counter &= ~mask;
59 local_irq_restore(flags); 59 local_irq_restore(flags);
60} 60}
61 61
@@ -64,7 +64,7 @@ static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
64 unsigned long flags; 64 unsigned long flags;
65 65
66 local_irq_save(flags); 66 local_irq_save(flags);
67 *(long *)v |= mask; 67 v->counter |= mask;
68 local_irq_restore(flags); 68 local_irq_restore(flags);
69} 69}
70 70
diff --git a/arch/sh/include/asm/bitops-llsc.h b/arch/sh/include/asm/bitops-llsc.h
index 1d2fc0b010ad..d8328be06191 100644
--- a/arch/sh/include/asm/bitops-llsc.h
+++ b/arch/sh/include/asm/bitops-llsc.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_SH_BITOPS_LLSC_H 1#ifndef __ASM_SH_BITOPS_LLSC_H
2#define __ASM_SH_BITOPS_LLSC_H 2#define __ASM_SH_BITOPS_LLSC_H
3 3
4static inline void set_bit(int nr, volatile void * addr) 4static inline void set_bit(int nr, volatile void *addr)
5{ 5{
6 int mask; 6 int mask;
7 volatile unsigned int *a = addr; 7 volatile unsigned int *a = addr;
@@ -13,16 +13,16 @@ static inline void set_bit(int nr, volatile void * addr)
13 __asm__ __volatile__ ( 13 __asm__ __volatile__ (
14 "1: \n\t" 14 "1: \n\t"
15 "movli.l @%1, %0 ! set_bit \n\t" 15 "movli.l @%1, %0 ! set_bit \n\t"
16 "or %3, %0 \n\t" 16 "or %2, %0 \n\t"
17 "movco.l %0, @%1 \n\t" 17 "movco.l %0, @%1 \n\t"
18 "bf 1b \n\t" 18 "bf 1b \n\t"
19 : "=&z" (tmp), "=r" (a) 19 : "=&z" (tmp)
20 : "1" (a), "r" (mask) 20 : "r" (a), "r" (mask)
21 : "t", "memory" 21 : "t", "memory"
22 ); 22 );
23} 23}
24 24
25static inline void clear_bit(int nr, volatile void * addr) 25static inline void clear_bit(int nr, volatile void *addr)
26{ 26{
27 int mask; 27 int mask;
28 volatile unsigned int *a = addr; 28 volatile unsigned int *a = addr;
@@ -34,16 +34,16 @@ static inline void clear_bit(int nr, volatile void * addr)
34 __asm__ __volatile__ ( 34 __asm__ __volatile__ (
35 "1: \n\t" 35 "1: \n\t"
36 "movli.l @%1, %0 ! clear_bit \n\t" 36 "movli.l @%1, %0 ! clear_bit \n\t"
37 "and %3, %0 \n\t" 37 "and %2, %0 \n\t"
38 "movco.l %0, @%1 \n\t" 38 "movco.l %0, @%1 \n\t"
39 "bf 1b \n\t" 39 "bf 1b \n\t"
40 : "=&z" (tmp), "=r" (a) 40 : "=&z" (tmp)
41 : "1" (a), "r" (~mask) 41 : "r" (a), "r" (~mask)
42 : "t", "memory" 42 : "t", "memory"
43 ); 43 );
44} 44}
45 45
46static inline void change_bit(int nr, volatile void * addr) 46static inline void change_bit(int nr, volatile void *addr)
47{ 47{
48 int mask; 48 int mask;
49 volatile unsigned int *a = addr; 49 volatile unsigned int *a = addr;
@@ -55,16 +55,16 @@ static inline void change_bit(int nr, volatile void * addr)
55 __asm__ __volatile__ ( 55 __asm__ __volatile__ (
56 "1: \n\t" 56 "1: \n\t"
57 "movli.l @%1, %0 ! change_bit \n\t" 57 "movli.l @%1, %0 ! change_bit \n\t"
58 "xor %3, %0 \n\t" 58 "xor %2, %0 \n\t"
59 "movco.l %0, @%1 \n\t" 59 "movco.l %0, @%1 \n\t"
60 "bf 1b \n\t" 60 "bf 1b \n\t"
61 : "=&z" (tmp), "=r" (a) 61 : "=&z" (tmp)
62 : "1" (a), "r" (mask) 62 : "r" (a), "r" (mask)
63 : "t", "memory" 63 : "t", "memory"
64 ); 64 );
65} 65}
66 66
67static inline int test_and_set_bit(int nr, volatile void * addr) 67static inline int test_and_set_bit(int nr, volatile void *addr)
68{ 68{
69 int mask, retval; 69 int mask, retval;
70 volatile unsigned int *a = addr; 70 volatile unsigned int *a = addr;
@@ -75,21 +75,21 @@ static inline int test_and_set_bit(int nr, volatile void * addr)
75 75
76 __asm__ __volatile__ ( 76 __asm__ __volatile__ (
77 "1: \n\t" 77 "1: \n\t"
78 "movli.l @%1, %0 ! test_and_set_bit \n\t" 78 "movli.l @%2, %0 ! test_and_set_bit \n\t"
79 "mov %0, %2 \n\t" 79 "mov %0, %1 \n\t"
80 "or %4, %0 \n\t" 80 "or %3, %0 \n\t"
81 "movco.l %0, @%1 \n\t" 81 "movco.l %0, @%2 \n\t"
82 "bf 1b \n\t" 82 "bf 1b \n\t"
83 "and %4, %2 \n\t" 83 "and %3, %1 \n\t"
84 : "=&z" (tmp), "=r" (a), "=&r" (retval) 84 : "=&z" (tmp), "=&r" (retval)
85 : "1" (a), "r" (mask) 85 : "r" (a), "r" (mask)
86 : "t", "memory" 86 : "t", "memory"
87 ); 87 );
88 88
89 return retval != 0; 89 return retval != 0;
90} 90}
91 91
92static inline int test_and_clear_bit(int nr, volatile void * addr) 92static inline int test_and_clear_bit(int nr, volatile void *addr)
93{ 93{
94 int mask, retval; 94 int mask, retval;
95 volatile unsigned int *a = addr; 95 volatile unsigned int *a = addr;
@@ -100,22 +100,22 @@ static inline int test_and_clear_bit(int nr, volatile void * addr)
100 100
101 __asm__ __volatile__ ( 101 __asm__ __volatile__ (
102 "1: \n\t" 102 "1: \n\t"
103 "movli.l @%1, %0 ! test_and_clear_bit \n\t" 103 "movli.l @%2, %0 ! test_and_clear_bit \n\t"
104 "mov %0, %2 \n\t" 104 "mov %0, %1 \n\t"
105 "and %5, %0 \n\t" 105 "and %4, %0 \n\t"
106 "movco.l %0, @%1 \n\t" 106 "movco.l %0, @%2 \n\t"
107 "bf 1b \n\t" 107 "bf 1b \n\t"
108 "and %4, %2 \n\t" 108 "and %3, %1 \n\t"
109 "synco \n\t" 109 "synco \n\t"
110 : "=&z" (tmp), "=r" (a), "=&r" (retval) 110 : "=&z" (tmp), "=&r" (retval)
111 : "1" (a), "r" (mask), "r" (~mask) 111 : "r" (a), "r" (mask), "r" (~mask)
112 : "t", "memory" 112 : "t", "memory"
113 ); 113 );
114 114
115 return retval != 0; 115 return retval != 0;
116} 116}
117 117
118static inline int test_and_change_bit(int nr, volatile void * addr) 118static inline int test_and_change_bit(int nr, volatile void *addr)
119{ 119{
120 int mask, retval; 120 int mask, retval;
121 volatile unsigned int *a = addr; 121 volatile unsigned int *a = addr;
@@ -126,15 +126,15 @@ static inline int test_and_change_bit(int nr, volatile void * addr)
126 126
127 __asm__ __volatile__ ( 127 __asm__ __volatile__ (
128 "1: \n\t" 128 "1: \n\t"
129 "movli.l @%1, %0 ! test_and_change_bit \n\t" 129 "movli.l @%2, %0 ! test_and_change_bit \n\t"
130 "mov %0, %2 \n\t" 130 "mov %0, %1 \n\t"
131 "xor %4, %0 \n\t" 131 "xor %3, %0 \n\t"
132 "movco.l %0, @%1 \n\t" 132 "movco.l %0, @%2 \n\t"
133 "bf 1b \n\t" 133 "bf 1b \n\t"
134 "and %4, %2 \n\t" 134 "and %3, %1 \n\t"
135 "synco \n\t" 135 "synco \n\t"
136 : "=&z" (tmp), "=r" (a), "=&r" (retval) 136 : "=&z" (tmp), "=&r" (retval)
137 : "1" (a), "r" (mask) 137 : "r" (a), "r" (mask)
138 : "t", "memory" 138 : "t", "memory"
139 ); 139 );
140 140
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h
index f9c88583d90a..2f6c9627bc1f 100644
--- a/arch/sh/include/asm/clock.h
+++ b/arch/sh/include/asm/clock.h
@@ -15,6 +15,7 @@ struct clk_ops {
15 void (*disable)(struct clk *clk); 15 void (*disable)(struct clk *clk);
16 void (*recalc)(struct clk *clk); 16 void (*recalc)(struct clk *clk);
17 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id); 17 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
18 int (*set_parent)(struct clk *clk, struct clk *parent);
18 long (*round_rate)(struct clk *clk, unsigned long rate); 19 long (*round_rate)(struct clk *clk, unsigned long rate);
19}; 20};
20 21
diff --git a/arch/sh/include/asm/cmpxchg-llsc.h b/arch/sh/include/asm/cmpxchg-llsc.h
index aee3bf286581..0fac3da536ca 100644
--- a/arch/sh/include/asm/cmpxchg-llsc.h
+++ b/arch/sh/include/asm/cmpxchg-llsc.h
@@ -8,14 +8,14 @@ static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
8 8
9 __asm__ __volatile__ ( 9 __asm__ __volatile__ (
10 "1: \n\t" 10 "1: \n\t"
11 "movli.l @%1, %0 ! xchg_u32 \n\t" 11 "movli.l @%2, %0 ! xchg_u32 \n\t"
12 "mov %0, %2 \n\t" 12 "mov %0, %1 \n\t"
13 "mov %4, %0 \n\t" 13 "mov %3, %0 \n\t"
14 "movco.l %0, @%1 \n\t" 14 "movco.l %0, @%2 \n\t"
15 "bf 1b \n\t" 15 "bf 1b \n\t"
16 "synco \n\t" 16 "synco \n\t"
17 : "=&z"(tmp), "=r" (m), "=&r" (retval) 17 : "=&z"(tmp), "=&r" (retval)
18 : "1" (m), "r" (val) 18 : "r" (m), "r" (val)
19 : "t", "memory" 19 : "t", "memory"
20 ); 20 );
21 21
@@ -29,14 +29,14 @@ static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
29 29
30 __asm__ __volatile__ ( 30 __asm__ __volatile__ (
31 "1: \n\t" 31 "1: \n\t"
32 "movli.l @%1, %0 ! xchg_u8 \n\t" 32 "movli.l @%2, %0 ! xchg_u8 \n\t"
33 "mov %0, %2 \n\t" 33 "mov %0, %1 \n\t"
34 "mov %4, %0 \n\t" 34 "mov %3, %0 \n\t"
35 "movco.l %0, @%1 \n\t" 35 "movco.l %0, @%2 \n\t"
36 "bf 1b \n\t" 36 "bf 1b \n\t"
37 "synco \n\t" 37 "synco \n\t"
38 : "=&z"(tmp), "=r" (m), "=&r" (retval) 38 : "=&z"(tmp), "=&r" (retval)
39 : "1" (m), "r" (val & 0xff) 39 : "r" (m), "r" (val & 0xff)
40 : "t", "memory" 40 : "t", "memory"
41 ); 41 );
42 42
@@ -51,17 +51,17 @@ __cmpxchg_u32(volatile int *m, unsigned long old, unsigned long new)
51 51
52 __asm__ __volatile__ ( 52 __asm__ __volatile__ (
53 "1: \n\t" 53 "1: \n\t"
54 "movli.l @%1, %0 ! __cmpxchg_u32 \n\t" 54 "movli.l @%2, %0 ! __cmpxchg_u32 \n\t"
55 "mov %0, %2 \n\t" 55 "mov %0, %1 \n\t"
56 "cmp/eq %2, %4 \n\t" 56 "cmp/eq %1, %3 \n\t"
57 "bf 2f \n\t" 57 "bf 2f \n\t"
58 "mov %5, %0 \n\t" 58 "mov %3, %0 \n\t"
59 "2: \n\t" 59 "2: \n\t"
60 "movco.l %0, @%1 \n\t" 60 "movco.l %0, @%2 \n\t"
61 "bf 1b \n\t" 61 "bf 1b \n\t"
62 "synco \n\t" 62 "synco \n\t"
63 : "=&z" (tmp), "=r" (m), "=&r" (retval) 63 : "=&z" (tmp), "=&r" (retval)
64 : "1" (m), "r" (old), "r" (new) 64 : "r" (m), "r" (old), "r" (new)
65 : "t", "memory" 65 : "t", "memory"
66 ); 66 );
67 67
diff --git a/arch/sh/include/asm/cpu-features.h b/arch/sh/include/asm/cpu-features.h
index 86308aa39731..694abe490edb 100644
--- a/arch/sh/include/asm/cpu-features.h
+++ b/arch/sh/include/asm/cpu-features.h
@@ -21,5 +21,6 @@
21#define CPU_HAS_LLSC 0x0040 /* movli.l/movco.l */ 21#define CPU_HAS_LLSC 0x0040 /* movli.l/movco.l */
22#define CPU_HAS_L2_CACHE 0x0080 /* Secondary cache / URAM */ 22#define CPU_HAS_L2_CACHE 0x0080 /* Secondary cache / URAM */
23#define CPU_HAS_OP32 0x0100 /* 32-bit instruction support */ 23#define CPU_HAS_OP32 0x0100 /* 32-bit instruction support */
24#define CPU_HAS_PTEAEX 0x0200 /* PTE ASID Extension support */
24 25
25#endif /* __ASM_SH_CPU_FEATURES_H */ 26#endif /* __ASM_SH_CPU_FEATURES_H */
diff --git a/arch/sh/include/asm/dma-sh.h b/arch/sh/include/asm/dma-sh.h
new file mode 100644
index 000000000000..0c8f8e14622a
--- /dev/null
+++ b/arch/sh/include/asm/dma-sh.h
@@ -0,0 +1,118 @@
1/*
2 * arch/sh/include/asm/dma-sh.h
3 *
4 * Copyright (C) 2000 Takashi YOSHII
5 * Copyright (C) 2003 Paul Mundt
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#ifndef __DMA_SH_H
12#define __DMA_SH_H
13
14#include <asm/dma.h>
15#include <cpu/dma.h>
16
17/* DMAOR contorl: The DMAOR access size is different by CPU.*/
18#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
19 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
20 defined(CONFIG_CPU_SUBTYPE_SH7785)
21#define dmaor_read_reg(n) \
22 (n ? ctrl_inw(SH_DMAC_BASE1 + DMAOR) \
23 : ctrl_inw(SH_DMAC_BASE0 + DMAOR))
24#define dmaor_write_reg(n, data) \
25 (n ? ctrl_outw(data, SH_DMAC_BASE1 + DMAOR) \
26 : ctrl_outw(data, SH_DMAC_BASE0 + DMAOR))
27#else /* Other CPU */
28#define dmaor_read_reg(n) ctrl_inw(SH_DMAC_BASE0 + DMAOR)
29#define dmaor_write_reg(n, data) ctrl_outw(data, SH_DMAC_BASE0 + DMAOR)
30#endif
31
32static int dmte_irq_map[] __maybe_unused = {
33#if (MAX_DMA_CHANNELS >= 4)
34 DMTE0_IRQ,
35 DMTE0_IRQ + 1,
36 DMTE0_IRQ + 2,
37 DMTE0_IRQ + 3,
38#endif
39#if (MAX_DMA_CHANNELS >= 6)
40 DMTE4_IRQ,
41 DMTE4_IRQ + 1,
42#endif
43#if (MAX_DMA_CHANNELS >= 8)
44 DMTE6_IRQ,
45 DMTE6_IRQ + 1,
46#endif
47#if (MAX_DMA_CHANNELS >= 12)
48 DMTE8_IRQ,
49 DMTE9_IRQ,
50 DMTE10_IRQ,
51 DMTE11_IRQ,
52#endif
53};
54
55/* Definitions for the SuperH DMAC */
56#define REQ_L 0x00000000
57#define REQ_E 0x00080000
58#define RACK_H 0x00000000
59#define RACK_L 0x00040000
60#define ACK_R 0x00000000
61#define ACK_W 0x00020000
62#define ACK_H 0x00000000
63#define ACK_L 0x00010000
64#define DM_INC 0x00004000
65#define DM_DEC 0x00008000
66#define SM_INC 0x00001000
67#define SM_DEC 0x00002000
68#define RS_IN 0x00000200
69#define RS_OUT 0x00000300
70#define TS_BLK 0x00000040
71#define TM_BUR 0x00000020
72#define CHCR_DE 0x00000001
73#define CHCR_TE 0x00000002
74#define CHCR_IE 0x00000004
75
76/* DMAOR definitions */
77#define DMAOR_AE 0x00000004
78#define DMAOR_NMIF 0x00000002
79#define DMAOR_DME 0x00000001
80
81/*
82 * Define the default configuration for dual address memory-memory transfer.
83 * The 0x400 value represents auto-request, external->external.
84 */
85#define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_32)
86
87/* DMA base address */
88static u32 dma_base_addr[] __maybe_unused = {
89#if (MAX_DMA_CHANNELS >= 4)
90 SH_DMAC_BASE0 + 0x00, /* channel 0 */
91 SH_DMAC_BASE0 + 0x10,
92 SH_DMAC_BASE0 + 0x20,
93 SH_DMAC_BASE0 + 0x30,
94#endif
95#if (MAX_DMA_CHANNELS >= 6)
96 SH_DMAC_BASE0 + 0x50,
97 SH_DMAC_BASE0 + 0x60,
98#endif
99#if (MAX_DMA_CHANNELS >= 8)
100 SH_DMAC_BASE1 + 0x00,
101 SH_DMAC_BASE1 + 0x10,
102#endif
103#if (MAX_DMA_CHANNELS >= 12)
104 SH_DMAC_BASE1 + 0x20,
105 SH_DMAC_BASE1 + 0x30,
106 SH_DMAC_BASE1 + 0x50,
107 SH_DMAC_BASE1 + 0x60, /* channel 11 */
108#endif
109};
110
111/* DMA register */
112#define SAR 0x00
113#define DAR 0x04
114#define TCR 0x08
115#define CHCR 0x0C
116#define DMAOR 0x40
117
118#endif /* __DMA_SH_H */
diff --git a/arch/sh/include/asm/dma.h b/arch/sh/include/asm/dma.h
index beca7128e2ab..6bd178473878 100644
--- a/arch/sh/include/asm/dma.h
+++ b/arch/sh/include/asm/dma.h
@@ -25,9 +25,9 @@
25#define MAX_DMA_ADDRESS (PAGE_OFFSET+0x10000000) 25#define MAX_DMA_ADDRESS (PAGE_OFFSET+0x10000000)
26 26
27#ifdef CONFIG_NR_DMA_CHANNELS 27#ifdef CONFIG_NR_DMA_CHANNELS
28# define MAX_DMA_CHANNELS (CONFIG_NR_DMA_CHANNELS) 28# define MAX_DMA_CHANNELS (CONFIG_NR_DMA_CHANNELS)
29#else 29#else
30# define MAX_DMA_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS) 30# define MAX_DMA_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
31#endif 31#endif
32 32
33/* 33/*
diff --git a/arch/sh/include/asm/entry-macros.S b/arch/sh/include/asm/entry-macros.S
index 2dab0b8d9454..3a4752a65722 100644
--- a/arch/sh/include/asm/entry-macros.S
+++ b/arch/sh/include/asm/entry-macros.S
@@ -31,3 +31,8 @@
31#endif 31#endif
32 .endm 32 .endm
33 33
34#if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH4)
35# define PREF(x) pref @x
36#else
37# define PREF(x) nop
38#endif
diff --git a/arch/sh/include/asm/gpio.h b/arch/sh/include/asm/gpio.h
index 90673658eb14..61f93da2c62e 100644
--- a/arch/sh/include/asm/gpio.h
+++ b/arch/sh/include/asm/gpio.h
@@ -19,8 +19,42 @@
19#include <cpu/gpio.h> 19#include <cpu/gpio.h>
20#endif 20#endif
21 21
22#define ARCH_NR_GPIOS 512
23#include <asm-generic/gpio.h>
24
25#ifdef CONFIG_GPIOLIB
26
27static inline int gpio_get_value(unsigned gpio)
28{
29 return __gpio_get_value(gpio);
30}
31
32static inline void gpio_set_value(unsigned gpio, int value)
33{
34 __gpio_set_value(gpio, value);
35}
36
37static inline int gpio_cansleep(unsigned gpio)
38{
39 return __gpio_cansleep(gpio);
40}
41
42static inline int gpio_to_irq(unsigned gpio)
43{
44 WARN_ON(1);
45 return -ENOSYS;
46}
47
48static inline int irq_to_gpio(unsigned int irq)
49{
50 WARN_ON(1);
51 return -EINVAL;
52}
53
54#endif /* CONFIG_GPIOLIB */
55
22typedef unsigned short pinmux_enum_t; 56typedef unsigned short pinmux_enum_t;
23typedef unsigned char pinmux_flag_t; 57typedef unsigned short pinmux_flag_t;
24 58
25#define PINMUX_TYPE_NONE 0 59#define PINMUX_TYPE_NONE 0
26#define PINMUX_TYPE_FUNCTION 1 60#define PINMUX_TYPE_FUNCTION 1
@@ -34,6 +68,11 @@ typedef unsigned char pinmux_flag_t;
34#define PINMUX_FLAG_WANT_PULLUP (1 << 3) 68#define PINMUX_FLAG_WANT_PULLUP (1 << 3)
35#define PINMUX_FLAG_WANT_PULLDOWN (1 << 4) 69#define PINMUX_FLAG_WANT_PULLDOWN (1 << 4)
36 70
71#define PINMUX_FLAG_DBIT_SHIFT 5
72#define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT)
73#define PINMUX_FLAG_DREG_SHIFT 10
74#define PINMUX_FLAG_DREG (0x3f << PINMUX_FLAG_DREG_SHIFT)
75
37struct pinmux_gpio { 76struct pinmux_gpio {
38 pinmux_enum_t enum_id; 77 pinmux_enum_t enum_id;
39 pinmux_flag_t flags; 78 pinmux_flag_t flags;
@@ -54,7 +93,7 @@ struct pinmux_cfg_reg {
54 .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) \ 93 .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) \
55 94
56struct pinmux_data_reg { 95struct pinmux_data_reg {
57 unsigned long reg, reg_width; 96 unsigned long reg, reg_width, reg_shadow;
58 pinmux_enum_t *enum_ids; 97 pinmux_enum_t *enum_ids;
59}; 98};
60 99
@@ -89,34 +128,9 @@ struct pinmux_info {
89 unsigned int gpio_data_size; 128 unsigned int gpio_data_size;
90 129
91 unsigned long *gpio_in_use; 130 unsigned long *gpio_in_use;
131 struct gpio_chip chip;
92}; 132};
93 133
94int register_pinmux(struct pinmux_info *pip); 134int register_pinmux(struct pinmux_info *pip);
95 135
96int __gpio_request(unsigned gpio);
97static inline int gpio_request(unsigned gpio, const char *label)
98{
99 return __gpio_request(gpio);
100}
101void gpio_free(unsigned gpio);
102int gpio_direction_input(unsigned gpio);
103int gpio_direction_output(unsigned gpio, int value);
104int gpio_get_value(unsigned gpio);
105void gpio_set_value(unsigned gpio, int value);
106
107/* IRQ modes are unspported */
108static inline int gpio_to_irq(unsigned gpio)
109{
110 WARN_ON(1);
111 return -EINVAL;
112}
113
114static inline int irq_to_gpio(unsigned irq)
115{
116 WARN_ON(1);
117 return -EINVAL;
118}
119
120#include <asm-generic/gpio.h>
121
122#endif /* __ASM_SH_GPIO_H */ 136#endif /* __ASM_SH_GPIO_H */
diff --git a/arch/sh/include/asm/hd64461.h b/arch/sh/include/asm/hd64461.h
index 8c1353baf00f..52b4b6238277 100644
--- a/arch/sh/include/asm/hd64461.h
+++ b/arch/sh/include/asm/hd64461.h
@@ -242,7 +242,6 @@
242#include <asm/io_generic.h> 242#include <asm/io_generic.h>
243 243
244/* arch/sh/cchips/hd6446x/hd64461/setup.c */ 244/* arch/sh/cchips/hd6446x/hd64461/setup.c */
245int hd64461_irq_demux(int irq);
246void hd64461_register_irq_demux(int irq, 245void hd64461_register_irq_demux(int irq,
247 int (*demux) (int irq, void *dev), void *dev); 246 int (*demux) (int irq, void *dev), void *dev);
248void hd64461_unregister_irq_demux(int irq); 247void hd64461_unregister_irq_demux(int irq);
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 61f6dae40534..0454f8d68059 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -238,7 +238,7 @@ extern void onchip_unmap(unsigned long vaddr);
238static inline void __iomem * 238static inline void __iomem *
239__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) 239__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
240{ 240{
241#ifdef CONFIG_SUPERH32 241#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED)
242 unsigned long last_addr = offset + size - 1; 242 unsigned long last_addr = offset + size - 1;
243#endif 243#endif
244 void __iomem *ret; 244 void __iomem *ret;
@@ -247,7 +247,7 @@ __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
247 if (ret) 247 if (ret)
248 return ret; 248 return ret;
249 249
250#ifdef CONFIG_SUPERH32 250#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED)
251 /* 251 /*
252 * For P1 and P2 space this is trivial, as everything is already 252 * For P1 and P2 space this is trivial, as everything is already
253 * mapped. Uncached access for P1 addresses are done through P2. 253 * mapped. Uncached access for P1 addresses are done through P2.
diff --git a/arch/sh/include/asm/kprobes.h b/arch/sh/include/asm/kprobes.h
index 6078d8e551d4..613644a758e8 100644
--- a/arch/sh/include/asm/kprobes.h
+++ b/arch/sh/include/asm/kprobes.h
@@ -16,7 +16,7 @@ typedef u16 kprobe_opcode_t;
16 ? (MAX_STACK_SIZE) \ 16 ? (MAX_STACK_SIZE) \
17 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 17 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
18 18
19#define regs_return_value(regs) ((regs)->regs[0]) 19#define regs_return_value(_regs) ((_regs)->regs[0])
20#define flush_insn_slot(p) do { } while (0) 20#define flush_insn_slot(p) do { } while (0)
21#define kretprobe_blacklist_size 0 21#define kretprobe_blacklist_size 0
22 22
diff --git a/arch/sh/include/asm/mmu_context.h b/arch/sh/include/asm/mmu_context.h
index 5d9157bd474d..2a9c55f1a83f 100644
--- a/arch/sh/include/asm/mmu_context.h
+++ b/arch/sh/include/asm/mmu_context.h
@@ -19,13 +19,18 @@
19 * (a) TLB cache version (or round, cycle whatever expression you like) 19 * (a) TLB cache version (or round, cycle whatever expression you like)
20 * (b) ASID (Address Space IDentifier) 20 * (b) ASID (Address Space IDentifier)
21 */ 21 */
22#ifdef CONFIG_CPU_HAS_PTEAEX
23#define MMU_CONTEXT_ASID_MASK 0x0000ffff
24#else
22#define MMU_CONTEXT_ASID_MASK 0x000000ff 25#define MMU_CONTEXT_ASID_MASK 0x000000ff
23#define MMU_CONTEXT_VERSION_MASK 0xffffff00 26#endif
24#define MMU_CONTEXT_FIRST_VERSION 0x00000100
25#define NO_CONTEXT 0UL
26 27
27/* ASID is 8-bit value, so it can't be 0x100 */ 28#define MMU_CONTEXT_VERSION_MASK (~0UL & ~MMU_CONTEXT_ASID_MASK)
28#define MMU_NO_ASID 0x100 29#define MMU_CONTEXT_FIRST_VERSION (MMU_CONTEXT_ASID_MASK + 1)
30
31/* Impossible ASID value, to differentiate from NO_CONTEXT. */
32#define MMU_NO_ASID MMU_CONTEXT_FIRST_VERSION
33#define NO_CONTEXT 0UL
29 34
30#define asid_cache(cpu) (cpu_data[cpu].asid_cache) 35#define asid_cache(cpu) (cpu_data[cpu].asid_cache)
31 36
diff --git a/arch/sh/include/asm/mmu_context_32.h b/arch/sh/include/asm/mmu_context_32.h
index f4f9aebd68b7..8ef800c549ab 100644
--- a/arch/sh/include/asm/mmu_context_32.h
+++ b/arch/sh/include/asm/mmu_context_32.h
@@ -10,6 +10,17 @@ static inline void destroy_context(struct mm_struct *mm)
10 /* Do nothing */ 10 /* Do nothing */
11} 11}
12 12
13#ifdef CONFIG_CPU_HAS_PTEAEX
14static inline void set_asid(unsigned long asid)
15{
16 __raw_writel(asid, MMU_PTEAEX);
17}
18
19static inline unsigned long get_asid(void)
20{
21 return __raw_readl(MMU_PTEAEX) & MMU_CONTEXT_ASID_MASK;
22}
23#else
13static inline void set_asid(unsigned long asid) 24static inline void set_asid(unsigned long asid)
14{ 25{
15 unsigned long __dummy; 26 unsigned long __dummy;
@@ -33,6 +44,7 @@ static inline unsigned long get_asid(void)
33 asid &= MMU_CONTEXT_ASID_MASK; 44 asid &= MMU_CONTEXT_ASID_MASK;
34 return asid; 45 return asid;
35} 46}
47#endif /* CONFIG_CPU_HAS_PTEAEX */
36 48
37/* MMU_TTB is used for optimizing the fault handling. */ 49/* MMU_TTB is used for optimizing the fault handling. */
38static inline void set_TTB(pgd_t *pgd) 50static inline void set_TTB(pgd_t *pgd)
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
index 5871d78e47e5..9c6d21ec0240 100644
--- a/arch/sh/include/asm/page.h
+++ b/arch/sh/include/asm/page.h
@@ -129,7 +129,12 @@ typedef struct page *pgtable_t;
129 * is not visible (it is part of the PMB mapping) and so needs to be 129 * is not visible (it is part of the PMB mapping) and so needs to be
130 * added or subtracted as required. 130 * added or subtracted as required.
131 */ 131 */
132#ifdef CONFIG_32BIT 132#if defined(CONFIG_PMB_FIXED)
133/* phys = virt - PAGE_OFFSET - (__MEMORY_START & 0xe0000000) */
134#define PMB_OFFSET (PAGE_OFFSET - PXSEG(__MEMORY_START))
135#define __pa(x) ((unsigned long)(x) - PMB_OFFSET)
136#define __va(x) ((void *)((unsigned long)(x) + PMB_OFFSET))
137#elif defined(CONFIG_32BIT)
133#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START) 138#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START)
134#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START)) 139#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START))
135#else 140#else
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 1ef4b24d7619..1fd58b421438 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -31,7 +31,7 @@ enum cpu_type {
31 CPU_SH7760, CPU_SH4_202, CPU_SH4_501, 31 CPU_SH7760, CPU_SH4_202, CPU_SH4_501,
32 32
33 /* SH-4A types */ 33 /* SH-4A types */
34 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, 34 CPU_SH7763, CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SH7786,
35 CPU_SH7723, CPU_SHX3, 35 CPU_SH7723, CPU_SHX3,
36 36
37 /* SH4AL-DSP types */ 37 /* SH4AL-DSP types */
diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h
index d79063c5eb9c..efdd78a53b11 100644
--- a/arch/sh/include/asm/processor_32.h
+++ b/arch/sh/include/asm/processor_32.h
@@ -108,12 +108,12 @@ extern int ubc_usercnt;
108/* 108/*
109 * Do necessary setup to start up a newly executed thread. 109 * Do necessary setup to start up a newly executed thread.
110 */ 110 */
111#define start_thread(regs, new_pc, new_sp) \ 111#define start_thread(_regs, new_pc, new_sp) \
112 set_fs(USER_DS); \ 112 set_fs(USER_DS); \
113 regs->pr = 0; \ 113 _regs->pr = 0; \
114 regs->sr = SR_FD; /* User mode. */ \ 114 _regs->sr = SR_FD; /* User mode. */ \
115 regs->pc = new_pc; \ 115 _regs->pc = new_pc; \
116 regs->regs[15] = new_sp 116 _regs->regs[15] = new_sp
117 117
118/* Forward declaration, a strange C thing */ 118/* Forward declaration, a strange C thing */
119struct task_struct; 119struct task_struct;
@@ -189,10 +189,9 @@ extern unsigned long get_wchan(struct task_struct *p);
189#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) 189#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
190#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[15]) 190#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[15])
191 191
192#define user_stack_pointer(regs) ((regs)->regs[15]) 192#define user_stack_pointer(_regs) ((_regs)->regs[15])
193 193
194#if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH3) || \ 194#if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH4)
195 defined(CONFIG_CPU_SH4)
196#define PREFETCH_STRIDE L1_CACHE_BYTES 195#define PREFETCH_STRIDE L1_CACHE_BYTES
197#define ARCH_HAS_PREFETCH 196#define ARCH_HAS_PREFETCH
198#define ARCH_HAS_PREFETCHW 197#define ARCH_HAS_PREFETCHW
diff --git a/arch/sh/include/asm/processor_64.h b/arch/sh/include/asm/processor_64.h
index 803177fcf086..5727d31b0ccf 100644
--- a/arch/sh/include/asm/processor_64.h
+++ b/arch/sh/include/asm/processor_64.h
@@ -145,13 +145,13 @@ struct thread_struct {
145 */ 145 */
146#define SR_USER (SR_MMU | SR_FD) 146#define SR_USER (SR_MMU | SR_FD)
147 147
148#define start_thread(regs, new_pc, new_sp) \ 148#define start_thread(_regs, new_pc, new_sp) \
149 set_fs(USER_DS); \ 149 set_fs(USER_DS); \
150 regs->sr = SR_USER; /* User mode. */ \ 150 _regs->sr = SR_USER; /* User mode. */ \
151 regs->pc = new_pc - 4; /* Compensate syscall exit */ \ 151 _regs->pc = new_pc - 4; /* Compensate syscall exit */ \
152 regs->pc |= 1; /* Set SHmedia ! */ \ 152 _regs->pc |= 1; /* Set SHmedia ! */ \
153 regs->regs[18] = 0; \ 153 _regs->regs[18] = 0; \
154 regs->regs[15] = new_sp 154 _regs->regs[15] = new_sp
155 155
156/* Forward declaration, a strange C thing */ 156/* Forward declaration, a strange C thing */
157struct task_struct; 157struct task_struct;
@@ -226,7 +226,7 @@ extern unsigned long get_wchan(struct task_struct *p);
226#define KSTK_EIP(tsk) ((tsk)->thread.pc) 226#define KSTK_EIP(tsk) ((tsk)->thread.pc)
227#define KSTK_ESP(tsk) ((tsk)->thread.sp) 227#define KSTK_ESP(tsk) ((tsk)->thread.sp)
228 228
229#define user_stack_pointer(regs) ((regs)->regs[15]) 229#define user_stack_pointer(_regs) ((_regs)->regs[15])
230 230
231#endif /* __ASSEMBLY__ */ 231#endif /* __ASSEMBLY__ */
232#endif /* __ASM_SH_PROCESSOR_64_H */ 232#endif /* __ASM_SH_PROCESSOR_64_H */
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
index 12912ab80c15..81c6568fdb3e 100644
--- a/arch/sh/include/asm/ptrace.h
+++ b/arch/sh/include/asm/ptrace.h
@@ -122,14 +122,12 @@ extern void user_disable_single_step(struct task_struct *);
122#ifdef CONFIG_SH_DSP 122#ifdef CONFIG_SH_DSP
123#define task_pt_regs(task) \ 123#define task_pt_regs(task) \
124 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ 124 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
125 - sizeof(struct pt_dspregs) - sizeof(unsigned long)) - 1) 125 - sizeof(struct pt_dspregs)) - 1)
126#define task_pt_dspregs(task) \ 126#define task_pt_dspregs(task) \
127 ((struct pt_dspregs *) (task_stack_page(task) + THREAD_SIZE \ 127 ((struct pt_dspregs *) (task_stack_page(task) + THREAD_SIZE) - 1)
128 - sizeof(unsigned long)) - 1)
129#else 128#else
130#define task_pt_regs(task) \ 129#define task_pt_regs(task) \
131 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ 130 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1)
132 - sizeof(unsigned long)) - 1)
133#endif 131#endif
134 132
135static inline unsigned long profile_pc(struct pt_regs *regs) 133static inline unsigned long profile_pc(struct pt_regs *regs)
diff --git a/arch/sh/include/asm/sections.h b/arch/sh/include/asm/sections.h
index 8f8f4ad400df..01a4076a3719 100644
--- a/arch/sh/include/asm/sections.h
+++ b/arch/sh/include/asm/sections.h
@@ -3,6 +3,7 @@
3 3
4#include <asm-generic/sections.h> 4#include <asm-generic/sections.h>
5 5
6extern void __nosave_begin, __nosave_end;
6extern long __machvec_start, __machvec_end; 7extern long __machvec_start, __machvec_end;
7extern char __uncached_start, __uncached_end; 8extern char __uncached_start, __uncached_end;
8extern char _ebss[]; 9extern char _ebss[];
diff --git a/arch/sh/include/asm/socket.h b/arch/sh/include/asm/socket.h
index 6d4bf6512959..345653b96826 100644
--- a/arch/sh/include/asm/socket.h
+++ b/arch/sh/include/asm/socket.h
@@ -54,4 +54,7 @@
54 54
55#define SO_MARK 36 55#define SO_MARK 36
56 56
57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
57#endif /* __ASM_SH_SOCKET_H */ 60#endif /* __ASM_SH_SOCKET_H */
diff --git a/arch/sh/include/asm/suspend.h b/arch/sh/include/asm/suspend.h
new file mode 100644
index 000000000000..b1b995370e79
--- /dev/null
+++ b/arch/sh/include/asm/suspend.h
@@ -0,0 +1,22 @@
1#ifndef _ASM_SH_SUSPEND_H
2#define _ASM_SH_SUSPEND_H
3
4#ifndef __ASSEMBLY__
5static inline int arch_prepare_suspend(void) { return 0; }
6
7#include <asm/ptrace.h>
8
9struct swsusp_arch_regs {
10 struct pt_regs user_regs;
11 unsigned long bank1_regs[8];
12};
13#endif
14
15/* flags passed to assembly suspend code */
16#define SUSP_SH_SLEEP (1 << 0) /* Regular sleep mode */
17#define SUSP_SH_STANDBY (1 << 1) /* SH-Mobile Software standby mode */
18#define SUSP_SH_RSTANDBY (1 << 2) /* SH-Mobile R-standby mode */
19#define SUSP_SH_USTANDBY (1 << 3) /* SH-Mobile U-standby mode */
20#define SUSP_SH_SF (1 << 4) /* Enable self-refresh */
21
22#endif /* _ASM_SH_SUSPEND_H */
diff --git a/arch/sh/include/asm/timer.h b/arch/sh/include/asm/timer.h
index a7ca3a195bb5..4c3b66e30af2 100644
--- a/arch/sh/include/asm/timer.h
+++ b/arch/sh/include/asm/timer.h
@@ -9,7 +9,6 @@ struct sys_timer_ops {
9 int (*init)(void); 9 int (*init)(void);
10 int (*start)(void); 10 int (*start)(void);
11 int (*stop)(void); 11 int (*stop)(void);
12 cycle_t (*read)(void);
13#ifndef CONFIG_GENERIC_TIME 12#ifndef CONFIG_GENERIC_TIME
14 unsigned long (*get_offset)(void); 13 unsigned long (*get_offset)(void);
15#endif 14#endif
@@ -39,6 +38,7 @@ struct sys_timer *get_sys_timer(void);
39 38
40/* arch/sh/kernel/time.c */ 39/* arch/sh/kernel/time.c */
41void handle_timer_tick(void); 40void handle_timer_tick(void);
42extern unsigned long sh_hpt_frequency; 41
42extern struct clocksource clocksource_sh;
43 43
44#endif /* __ASM_SH_TIMER_H */ 44#endif /* __ASM_SH_TIMER_H */
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h
index 88ff1ae8a6b8..9c16f737074a 100644
--- a/arch/sh/include/asm/tlb.h
+++ b/arch/sh/include/asm/tlb.h
@@ -6,22 +6,106 @@
6#endif 6#endif
7 7
8#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
9#include <linux/pagemap.h>
10
11#ifdef CONFIG_MMU
12#include <asm/pgalloc.h>
13#include <asm/tlbflush.h>
14
15/*
16 * TLB handling. This allows us to remove pages from the page
17 * tables, and efficiently handle the TLB issues.
18 */
19struct mmu_gather {
20 struct mm_struct *mm;
21 unsigned int fullmm;
22 unsigned long start, end;
23};
9 24
10#define tlb_start_vma(tlb, vma) \ 25DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
11 flush_cache_range(vma, vma->vm_start, vma->vm_end)
12 26
13#define tlb_end_vma(tlb, vma) \ 27static inline void init_tlb_gather(struct mmu_gather *tlb)
14 flush_tlb_range(vma, vma->vm_start, vma->vm_end) 28{
29 tlb->start = TASK_SIZE;
30 tlb->end = 0;
15 31
16#define __tlb_remove_tlb_entry(tlb, pte, address) do { } while (0) 32 if (tlb->fullmm) {
33 tlb->start = 0;
34 tlb->end = TASK_SIZE;
35 }
36}
37
38static inline struct mmu_gather *
39tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
40{
41 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
42
43 tlb->mm = mm;
44 tlb->fullmm = full_mm_flush;
45
46 init_tlb_gather(tlb);
47
48 return tlb;
49}
50
51static inline void
52tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
53{
54 if (tlb->fullmm)
55 flush_tlb_mm(tlb->mm);
56
57 /* keep the page table cache within bounds */
58 check_pgt_cache();
59
60 put_cpu_var(mmu_gathers);
61}
62
63static inline void
64tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long address)
65{
66 if (tlb->start > address)
67 tlb->start = address;
68 if (tlb->end < address + PAGE_SIZE)
69 tlb->end = address + PAGE_SIZE;
70}
17 71
18/* 72/*
19 * Flush whole TLBs for MM 73 * In the case of tlb vma handling, we can optimise these away in the
74 * case where we're doing a full MM flush. When we're doing a munmap,
75 * the vmas are adjusted to only cover the region to be torn down.
20 */ 76 */
21#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) 77static inline void
78tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
79{
80 if (!tlb->fullmm)
81 flush_cache_range(vma, vma->vm_start, vma->vm_end);
82}
83
84static inline void
85tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
86{
87 if (!tlb->fullmm && tlb->end) {
88 flush_tlb_range(vma, tlb->start, tlb->end);
89 init_tlb_gather(tlb);
90 }
91}
92
93#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
94#define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep)
95#define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp)
96#define pud_free_tlb(tlb, pudp) pud_free((tlb)->mm, pudp)
97
98#define tlb_migrate_finish(mm) do { } while (0)
99
100#else /* CONFIG_MMU */
101
102#define tlb_start_vma(tlb, vma) do { } while (0)
103#define tlb_end_vma(tlb, vma) do { } while (0)
104#define __tlb_remove_tlb_entry(tlb, pte, address) do { } while (0)
105#define tlb_flush(tlb) do { } while (0)
22 106
23#include <linux/pagemap.h>
24#include <asm-generic/tlb.h> 107#include <asm-generic/tlb.h>
25 108
109#endif /* CONFIG_MMU */
26#endif /* __ASSEMBLY__ */ 110#endif /* __ASSEMBLY__ */
27#endif /* __ASM_SH_TLB_H */ 111#endif /* __ASM_SH_TLB_H */
diff --git a/arch/sh/include/cpu-sh3/cpu/dma.h b/arch/sh/include/cpu-sh3/cpu/dma.h
index 6813c3220a1d..0ea15f3f2363 100644
--- a/arch/sh/include/cpu-sh3/cpu/dma.h
+++ b/arch/sh/include/cpu-sh3/cpu/dma.h
@@ -1,22 +1,17 @@
1#ifndef __ASM_CPU_SH3_DMA_H 1#ifndef __ASM_CPU_SH3_DMA_H
2#define __ASM_CPU_SH3_DMA_H 2#define __ASM_CPU_SH3_DMA_H
3 3
4
5#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 4#if defined(CONFIG_CPU_SUBTYPE_SH7720) || \
6 defined(CONFIG_CPU_SUBTYPE_SH7721) 5 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
7#define SH_DMAC_BASE 0xa4010020 6 defined(CONFIG_CPU_SUBTYPE_SH7710) || \
8#else 7 defined(CONFIG_CPU_SUBTYPE_SH7712)
9#define SH_DMAC_BASE 0xa4000020 8#define SH_DMAC_BASE0 0xa4010020
9#else /* SH7705/06/07/09 */
10#define SH_DMAC_BASE0 0xa4000020
10#endif 11#endif
11 12
12#if defined(CONFIG_CPU_SUBTYPE_SH7720) || defined(CONFIG_CPU_SUBTYPE_SH7709)
13#define DMTE0_IRQ 48 13#define DMTE0_IRQ 48
14#define DMTE1_IRQ 49
15#define DMTE2_IRQ 50
16#define DMTE3_IRQ 51
17#define DMTE4_IRQ 76 14#define DMTE4_IRQ 76
18#define DMTE5_IRQ 77
19#endif
20 15
21/* Definitions for the SuperH DMAC */ 16/* Definitions for the SuperH DMAC */
22#define TM_BURST 0x00000020 17#define TM_BURST 0x00000020
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
new file mode 100644
index 000000000000..0ed5178fed69
--- /dev/null
+++ b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
@@ -0,0 +1,94 @@
1#ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H
2#define __ASM_SH_CPU_SH4_DMA_SH7780_H
3
4#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \
5 defined(CONFIG_CPU_SUBTYPE_SH7722) || \
6 defined(CONFIG_CPU_SUBTYPE_SH7730)
7#define DMTE0_IRQ 48
8#define DMTE4_IRQ 76
9#define DMAE0_IRQ 78 /* DMA Error IRQ*/
10#define SH_DMAC_BASE0 0xFE008020
11#define SH_DMARS_BASE 0xFE009000
12#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
13 defined(CONFIG_CPU_SUBTYPE_SH7764)
14#define DMTE0_IRQ 34
15#define DMTE4_IRQ 44
16#define DMAE0_IRQ 38
17#define SH_DMAC_BASE0 0xFF608020
18#define SH_DMARS_BASE 0xFF609000
19#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
20#define DMTE0_IRQ 48 /* DMAC0A*/
21#define DMTE4_IRQ 40 /* DMAC0B */
22#define DMTE6_IRQ 42
23#define DMTE8_IRQ 76 /* DMAC1A */
24#define DMTE9_IRQ 77
25#define DMTE10_IRQ 72 /* DMAC1B */
26#define DMTE11_IRQ 73
27#define DMAE0_IRQ 78 /* DMA Error IRQ*/
28#define DMAE1_IRQ 74 /* DMA Error IRQ*/
29#define SH_DMAC_BASE0 0xFE008020
30#define SH_DMAC_BASE1 0xFDC08020
31#define SH_DMARS_BASE 0xFDC09000
32#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
33#define DMTE0_IRQ 34
34#define DMTE4_IRQ 44
35#define DMTE6_IRQ 46
36#define DMTE8_IRQ 92
37#define DMTE9_IRQ 93
38#define DMTE10_IRQ 94
39#define DMTE11_IRQ 95
40#define DMAE0_IRQ 38 /* DMA Error IRQ */
41#define SH_DMAC_BASE0 0xFC808020
42#define SH_DMAC_BASE1 0xFC818020
43#define SH_DMARS_BASE 0xFC809000
44#else /* SH7785 */
45#define DMTE0_IRQ 33
46#define DMTE4_IRQ 37
47#define DMTE6_IRQ 52
48#define DMTE8_IRQ 54
49#define DMTE9_IRQ 55
50#define DMTE10_IRQ 56
51#define DMTE11_IRQ 57
52#define DMAE0_IRQ 39 /* DMA Error IRQ0 */
53#define DMAE1_IRQ 58 /* DMA Error IRQ1 */
54#define SH_DMAC_BASE0 0xFC808020
55#define SH_DMAC_BASE1 0xFCC08020
56#define SH_DMARS_BASE 0xFC809000
57#endif
58
59#define REQ_HE 0x000000C0
60#define REQ_H 0x00000080
61#define REQ_LE 0x00000040
62#define TM_BURST 0x0000020
63#define TS_8 0x00000000
64#define TS_16 0x00000008
65#define TS_32 0x00000010
66#define TS_16BLK 0x00000018
67#define TS_32BLK 0x00100000
68
69/*
70 * The SuperH DMAC supports a number of transmit sizes, we list them here,
71 * with their respective values as they appear in the CHCR registers.
72 *
73 * Defaults to a 64-bit transfer size.
74 */
75enum {
76 XMIT_SZ_8BIT,
77 XMIT_SZ_16BIT,
78 XMIT_SZ_32BIT,
79 XMIT_SZ_128BIT,
80 XMIT_SZ_256BIT,
81};
82
83/*
84 * The DMA count is defined as the number of bytes to transfer.
85 */
86static unsigned int ts_shift[] __maybe_unused = {
87 [XMIT_SZ_8BIT] = 0,
88 [XMIT_SZ_16BIT] = 1,
89 [XMIT_SZ_32BIT] = 2,
90 [XMIT_SZ_128BIT] = 4,
91 [XMIT_SZ_256BIT] = 5,
92};
93
94#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-sh7780.h b/arch/sh/include/cpu-sh4/cpu/dma-sh7780.h
deleted file mode 100644
index 71b426a6e482..000000000000
--- a/arch/sh/include/cpu-sh4/cpu/dma-sh7780.h
+++ /dev/null
@@ -1,39 +0,0 @@
1#ifndef __ASM_SH_CPU_SH4_DMA_SH7780_H
2#define __ASM_SH_CPU_SH4_DMA_SH7780_H
3
4#define REQ_HE 0x000000C0
5#define REQ_H 0x00000080
6#define REQ_LE 0x00000040
7#define TM_BURST 0x0000020
8#define TS_8 0x00000000
9#define TS_16 0x00000008
10#define TS_32 0x00000010
11#define TS_16BLK 0x00000018
12#define TS_32BLK 0x00100000
13
14/*
15 * The SuperH DMAC supports a number of transmit sizes, we list them here,
16 * with their respective values as they appear in the CHCR registers.
17 *
18 * Defaults to a 64-bit transfer size.
19 */
20enum {
21 XMIT_SZ_8BIT,
22 XMIT_SZ_16BIT,
23 XMIT_SZ_32BIT,
24 XMIT_SZ_128BIT,
25 XMIT_SZ_256BIT,
26};
27
28/*
29 * The DMA count is defined as the number of bytes to transfer.
30 */
31static unsigned int ts_shift[] __maybe_unused = {
32 [XMIT_SZ_8BIT] = 0,
33 [XMIT_SZ_16BIT] = 1,
34 [XMIT_SZ_32BIT] = 2,
35 [XMIT_SZ_128BIT] = 4,
36 [XMIT_SZ_256BIT] = 5,
37};
38
39#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */
diff --git a/arch/sh/include/cpu-sh4/cpu/dma.h b/arch/sh/include/cpu-sh4/cpu/dma.h
index 235b7cd1fc9a..bcb30246e85c 100644
--- a/arch/sh/include/cpu-sh4/cpu/dma.h
+++ b/arch/sh/include/cpu-sh4/cpu/dma.h
@@ -1,31 +1,29 @@
1#ifndef __ASM_CPU_SH4_DMA_H 1#ifndef __ASM_CPU_SH4_DMA_H
2#define __ASM_CPU_SH4_DMA_H 2#define __ASM_CPU_SH4_DMA_H
3 3
4#define DMAOR_INIT ( 0x8000 | DMAOR_DME )
5
6/* SH7751/7760/7780 DMA IRQ sources */ 4/* SH7751/7760/7780 DMA IRQ sources */
7#define DMTE0_IRQ 34
8#define DMTE1_IRQ 35
9#define DMTE2_IRQ 36
10#define DMTE3_IRQ 37
11#define DMTE4_IRQ 44
12#define DMTE5_IRQ 45
13#define DMTE6_IRQ 46
14#define DMTE7_IRQ 47
15#define DMAE_IRQ 38
16 5
17#ifdef CONFIG_CPU_SH4A 6#ifdef CONFIG_CPU_SH4A
18#define SH_DMAC_BASE 0xfc808020
19 7
8#define DMAOR_INIT (DMAOR_DME)
20#define CHCR_TS_MASK 0x18 9#define CHCR_TS_MASK 0x18
21#define CHCR_TS_SHIFT 3 10#define CHCR_TS_SHIFT 3
22 11
23#include <cpu/dma-sh7780.h> 12#include <cpu/dma-sh4a.h>
24#else 13#else /* CONFIG_CPU_SH4A */
25#define SH_DMAC_BASE 0xffa00000 14/*
15 * SH7750/SH7751/SH7760
16 */
17#define DMTE0_IRQ 34
18#define DMTE4_IRQ 44
19#define DMTE6_IRQ 46
20#define DMAE0_IRQ 38
26 21
22#define DMAOR_INIT (0x8000|DMAOR_DME)
23#define SH_DMAC_BASE0 0xffa00000
24#define SH_DMAC_BASE1 0xffa00070
27/* Definitions for the SuperH DMAC */ 25/* Definitions for the SuperH DMAC */
28#define TM_BURST 0x0000080 26#define TM_BURST 0x00000080
29#define TS_8 0x00000010 27#define TS_8 0x00000010
30#define TS_16 0x00000020 28#define TS_16 0x00000020
31#define TS_32 0x00000030 29#define TS_32 0x00000030
diff --git a/arch/sh/include/cpu-sh4/cpu/freq.h b/arch/sh/include/cpu-sh4/cpu/freq.h
index c23af81c2e70..749d1c434337 100644
--- a/arch/sh/include/cpu-sh4/cpu/freq.h
+++ b/arch/sh/include/cpu-sh4/cpu/freq.h
@@ -29,6 +29,10 @@
29#define FRQCR0 0xffc80000 29#define FRQCR0 0xffc80000
30#define FRQCR1 0xffc80004 30#define FRQCR1 0xffc80004
31#define FRQMR1 0xffc80014 31#define FRQMR1 0xffc80014
32#elif defined(CONFIG_CPU_SUBTYPE_SH7786)
33#define FRQCR0 0xffc40000
34#define FRQCR1 0xffc40004
35#define FRQMR1 0xffc40014
32#elif defined(CONFIG_CPU_SUBTYPE_SHX3) 36#elif defined(CONFIG_CPU_SUBTYPE_SHX3)
33#define FRQCR 0xffc00014 37#define FRQCR 0xffc00014
34#else 38#else
diff --git a/arch/sh/include/cpu-sh4/cpu/mmu_context.h b/arch/sh/include/cpu-sh4/cpu/mmu_context.h
index 9ea8eb27b18e..3ce7ef6c2978 100644
--- a/arch/sh/include/cpu-sh4/cpu/mmu_context.h
+++ b/arch/sh/include/cpu-sh4/cpu/mmu_context.h
@@ -14,28 +14,35 @@
14#define MMU_PTEL 0xFF000004 /* Page table entry register LOW */ 14#define MMU_PTEL 0xFF000004 /* Page table entry register LOW */
15#define MMU_TTB 0xFF000008 /* Translation table base register */ 15#define MMU_TTB 0xFF000008 /* Translation table base register */
16#define MMU_TEA 0xFF00000C /* TLB Exception Address */ 16#define MMU_TEA 0xFF00000C /* TLB Exception Address */
17#define MMU_PTEA 0xFF000034 /* Page table entry assistance register */ 17#define MMU_PTEA 0xFF000034 /* PTE assistance register */
18#define MMU_PTEAEX 0xFF00007C /* PTE ASID extension register */
18 19
19#define MMUCR 0xFF000010 /* MMU Control Register */ 20#define MMUCR 0xFF000010 /* MMU Control Register */
20 21
21#define MMU_ITLB_ADDRESS_ARRAY 0xF2000000
22#define MMU_UTLB_ADDRESS_ARRAY 0xF6000000 22#define MMU_UTLB_ADDRESS_ARRAY 0xF6000000
23#define MMU_UTLB_ADDRESS_ARRAY2 0xF6800000
23#define MMU_PAGE_ASSOC_BIT 0x80 24#define MMU_PAGE_ASSOC_BIT 0x80
24 25
25#define MMUCR_TI (1<<2) 26#define MMUCR_TI (1<<2)
26 27
27#ifdef CONFIG_X2TLB
28#define MMUCR_ME (1 << 7)
29#else
30#define MMUCR_ME (0)
31#endif
32
33#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40) 28#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40)
34#define MMUCR_SE (1 << 4) 29#define MMUCR_SE (1 << 4)
35#else 30#else
36#define MMUCR_SE (0) 31#define MMUCR_SE (0)
37#endif 32#endif
38 33
34#ifdef CONFIG_CPU_HAS_PTEAEX
35#define MMUCR_AEX (1 << 6)
36#else
37#define MMUCR_AEX (0)
38#endif
39
40#ifdef CONFIG_X2TLB
41#define MMUCR_ME (1 << 7)
42#else
43#define MMUCR_ME (0)
44#endif
45
39#ifdef CONFIG_SH_STORE_QUEUES 46#ifdef CONFIG_SH_STORE_QUEUES
40#define MMUCR_SQMD (1 << 9) 47#define MMUCR_SQMD (1 << 9)
41#else 48#else
@@ -43,17 +50,7 @@
43#endif 50#endif
44 51
45#define MMU_NTLB_ENTRIES 64 52#define MMU_NTLB_ENTRIES 64
46#define MMU_CONTROL_INIT (0x05|MMUCR_SQMD|MMUCR_ME|MMUCR_SE) 53#define MMU_CONTROL_INIT (0x05|MMUCR_SQMD|MMUCR_ME|MMUCR_SE|MMUCR_AEX)
47
48#define MMU_ITLB_DATA_ARRAY 0xF3000000
49#define MMU_UTLB_DATA_ARRAY 0xF7000000
50
51#define MMU_UTLB_ENTRIES 64
52#define MMU_U_ENTRY_SHIFT 8
53#define MMU_UTLB_VALID 0x100
54#define MMU_ITLB_ENTRIES 4
55#define MMU_I_ENTRY_SHIFT 8
56#define MMU_ITLB_VALID 0x100
57 54
58#define TRA 0xff000020 55#define TRA 0xff000020
59#define EXPEVT 0xff000024 56#define EXPEVT 0xff000024
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7786.h b/arch/sh/include/cpu-sh4/cpu/sh7786.h
new file mode 100644
index 000000000000..48688adc0c84
--- /dev/null
+++ b/arch/sh/include/cpu-sh4/cpu/sh7786.h
@@ -0,0 +1,192 @@
1/*
2 * SH7786 Pinmux
3 *
4 * Copyright (C) 2008, 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
6 *
7 * Based on sh7785.h
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 */
13
14#ifndef __CPU_SH7786_H__
15#define __CPU_SH7786_H__
16
17enum {
18 /* PA */
19 GPIO_PA7, GPIO_PA6, GPIO_PA5, GPIO_PA4,
20 GPIO_PA3, GPIO_PA2, GPIO_PA1, GPIO_PA0,
21
22 /* PB */
23 GPIO_PB7, GPIO_PB6, GPIO_PB5, GPIO_PB4,
24 GPIO_PB3, GPIO_PB2, GPIO_PB1, GPIO_PB0,
25
26 /* PC */
27 GPIO_PC7, GPIO_PC6, GPIO_PC5, GPIO_PC4,
28 GPIO_PC3, GPIO_PC2, GPIO_PC1, GPIO_PC0,
29
30 /* PD */
31 GPIO_PD7, GPIO_PD6, GPIO_PD5, GPIO_PD4,
32 GPIO_PD3, GPIO_PD2, GPIO_PD1, GPIO_PD0,
33
34 /* PE */
35 GPIO_PE5, GPIO_PE4, GPIO_PE3, GPIO_PE2,
36 GPIO_PE1, GPIO_PE0,
37
38 /* PF */
39 GPIO_PF7, GPIO_PF6, GPIO_PF5, GPIO_PF4,
40 GPIO_PF3, GPIO_PF2, GPIO_PF1, GPIO_PF0,
41
42 /* PG */
43 GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4,
44 GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0,
45
46 /* PH */
47 GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4,
48 GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0,
49
50 /* PJ */
51 GPIO_PJ7, GPIO_PJ6, GPIO_PJ5, GPIO_PJ4,
52 GPIO_PJ3, GPIO_PJ2, GPIO_PJ1, GPIO_PJ0,
53
54 GPIO_FN_CDE,
55 GPIO_FN_ETH_MAGIC,
56 GPIO_FN_DISP,
57 GPIO_FN_ETH_LINK,
58 GPIO_FN_DR5,
59 GPIO_FN_ETH_TX_ER,
60 GPIO_FN_DR4,
61 GPIO_FN_ETH_TX_EN,
62 GPIO_FN_DR3,
63 GPIO_FN_ETH_TXD3,
64 GPIO_FN_DR2,
65 GPIO_FN_ETH_TXD2,
66 GPIO_FN_DR1,
67 GPIO_FN_ETH_TXD1,
68 GPIO_FN_DR0,
69 GPIO_FN_ETH_TXD0,
70 GPIO_FN_VSYNC,
71 GPIO_FN_HSPI_CLK,
72 GPIO_FN_ODDF,
73 GPIO_FN_HSPI_CS,
74 GPIO_FN_DG5,
75 GPIO_FN_ETH_MDIO,
76 GPIO_FN_DG4,
77 GPIO_FN_ETH_RX_CLK,
78 GPIO_FN_DG3,
79 GPIO_FN_ETH_MDC,
80 GPIO_FN_DG2,
81 GPIO_FN_ETH_COL,
82 GPIO_FN_DG1,
83 GPIO_FN_ETH_TX_CLK,
84 GPIO_FN_DG0,
85 GPIO_FN_ETH_CRS,
86 GPIO_FN_DCLKIN,
87 GPIO_FN_HSPI_RX,
88 GPIO_FN_HSYNC,
89 GPIO_FN_HSPI_TX,
90 GPIO_FN_DB5,
91 GPIO_FN_ETH_RXD3,
92 GPIO_FN_DB4,
93 GPIO_FN_ETH_RXD2,
94 GPIO_FN_DB3,
95 GPIO_FN_ETH_RXD1,
96 GPIO_FN_DB2,
97 GPIO_FN_ETH_RXD0,
98 GPIO_FN_DB1,
99 GPIO_FN_ETH_RX_DV,
100 GPIO_FN_DB0,
101 GPIO_FN_ETH_RX_ER,
102 GPIO_FN_DCLKOUT,
103 GPIO_FN_SCIF1_SLK,
104 GPIO_FN_SCIF1_RXD,
105 GPIO_FN_SCIF1_TXD,
106 GPIO_FN_DACK1,
107 GPIO_FN_BACK,
108 GPIO_FN_FALE,
109 GPIO_FN_DACK0,
110 GPIO_FN_FCLE,
111 GPIO_FN_DREQ1,
112 GPIO_FN_BREQ,
113 GPIO_FN_USB_OVC1,
114 GPIO_FN_DREQ0,
115 GPIO_FN_USB_OVC0,
116 GPIO_FN_USB_PENC1,
117 GPIO_FN_USB_PENC0,
118 GPIO_FN_HAC1_SDOUT,
119 GPIO_FN_SSI1_SDATA,
120 GPIO_FN_SDIF1CMD,
121 GPIO_FN_HAC1_SDIN,
122 GPIO_FN_SSI1_SCK,
123 GPIO_FN_SDIF1CD,
124 GPIO_FN_HAC1_SYNC,
125 GPIO_FN_SSI1_WS,
126 GPIO_FN_SDIF1WP,
127 GPIO_FN_HAC1_BITCLK,
128 GPIO_FN_SSI1_CLK,
129 GPIO_FN_SDIF1CLK,
130 GPIO_FN_HAC0_SDOUT,
131 GPIO_FN_SSI0_SDATA,
132 GPIO_FN_SDIF1D3,
133 GPIO_FN_HAC0_SDIN,
134 GPIO_FN_SSI0_SCK,
135 GPIO_FN_SDIF1D2,
136 GPIO_FN_HAC0_SYNC,
137 GPIO_FN_SSI0_WS,
138 GPIO_FN_SDIF1D1,
139 GPIO_FN_HAC0_BITCLK,
140 GPIO_FN_SSI0_CLK,
141 GPIO_FN_SDIF1D0,
142 GPIO_FN_SCIF3_SCK,
143 GPIO_FN_SSI2_SDATA,
144 GPIO_FN_SCIF3_RXD,
145 GPIO_FN_TCLK,
146 GPIO_FN_SSI2_SCK,
147 GPIO_FN_SCIF3_TXD,
148 GPIO_FN_HAC_RES,
149 GPIO_FN_SSI2_WS,
150 GPIO_FN_DACK3,
151 GPIO_FN_SDIF0CMD,
152 GPIO_FN_DACK2,
153 GPIO_FN_SDIF0CD,
154 GPIO_FN_DREQ3,
155 GPIO_FN_SDIF0WP,
156 GPIO_FN_SCIF0_CTS,
157 GPIO_FN_DREQ2,
158 GPIO_FN_SDIF0CLK,
159 GPIO_FN_SCIF0_RTS,
160 GPIO_FN_IRL7,
161 GPIO_FN_SDIF0D3,
162 GPIO_FN_SCIF0_SCK,
163 GPIO_FN_IRL6,
164 GPIO_FN_SDIF0D2,
165 GPIO_FN_SCIF0_RXD,
166 GPIO_FN_IRL5,
167 GPIO_FN_SDIF0D1,
168 GPIO_FN_SCIF0_TXD,
169 GPIO_FN_IRL4,
170 GPIO_FN_SDIF0D0,
171 GPIO_FN_SCIF5_SCK,
172 GPIO_FN_FRB,
173 GPIO_FN_SCIF5_RXD,
174 GPIO_FN_IOIS16,
175 GPIO_FN_SCIF5_TXD,
176 GPIO_FN_CE2B,
177 GPIO_FN_DRAK3,
178 GPIO_FN_CE2A,
179 GPIO_FN_SCIF4_SCK,
180 GPIO_FN_DRAK2,
181 GPIO_FN_SSI3_WS,
182 GPIO_FN_SCIF4_RXD,
183 GPIO_FN_DRAK1,
184 GPIO_FN_SSI3_SDATA,
185 GPIO_FN_FSTATUS,
186 GPIO_FN_SCIF4_TXD,
187 GPIO_FN_DRAK0,
188 GPIO_FN_SSI3_SCK,
189 GPIO_FN_FSE,
190};
191
192#endif /* __CPU_SH7786_H__ */
diff --git a/arch/sh/include/mach-common/mach/urquell.h b/arch/sh/include/mach-common/mach/urquell.h
new file mode 100644
index 000000000000..14b3e1d01777
--- /dev/null
+++ b/arch/sh/include/mach-common/mach/urquell.h
@@ -0,0 +1,68 @@
1#ifndef __MACH_URQUELL_H
2#define __MACH_URQUELL_H
3
4/*
5 * ------ 0x00000000 ------------------------------------
6 * CS0 | (SW1,SW47) EEPROM, SRAM, NOR FLASH
7 * -----+ 0x04000000 ------------------------------------
8 * CS1 | (SW47) SRAM, SRAM-LAN-PCMCIA, NOR FLASH
9 * -----+ 0x08000000 ------------------------------------
10 * CS2 | DDR3
11 * CS3 |
12 * -----+ 0x10000000 ------------------------------------
13 * CS4 | PCIe
14 * -----+ 0x14000000 ------------------------------------
15 * CS5 | (SW47) LRAM/URAM, SRAM-LAN-PCMCIA
16 * -----+ 0x18000000 ------------------------------------
17 * CS6 | ATA, NAND FLASH
18 * -----+ 0x1c000000 ------------------------------------
19 * CS7 | SH7786 register
20 * -----+------------------------------------------------
21 */
22
23#define NOR_FLASH_ADDR 0x00000000
24#define NOR_FLASH_SIZE 0x04000000
25
26#define CS1_BASE 0x05000000
27#define CS5_BASE 0x15000000
28#define FPGA_BASE CS1_BASE
29
30#define BOARDREG(ofs) (FPGA_BASE + ofs##_OFS)
31#define UBOARDREG(ofs) (0xa0000000 + FPGA_BASE + ofs##_OFS)
32
33#define SRSTR_OFS 0x0000 /* System reset register */
34#define BDMR_OFS 0x0010 /* Board operating mode resister */
35#define IRL0SR_OFS 0x0020 /* IRL0 Status register */
36#define IRL0MSKR_OFS 0x0030 /* IRL0 Mask register */
37#define IRL1SR_OFS 0x0040 /* IRL1 Status register */
38#define IRL1MSKR_OFS 0x0050 /* IRL1 Mask register */
39#define IRL2SR_OFS 0x0060 /* IRL2 Status register */
40#define IRL2MSKR_OFS 0x0070 /* IRL2 Mask register */
41#define IRL3SR_OFS 0x0080 /* IRL3 Status register */
42#define IRL3MSKR_OFS 0x0090 /* IRL3 Mask register */
43#define SOFTINTR_OFS 0x0120 /* Softwear Interrupt register */
44#define SLEDR_OFS 0x0130 /* LED control resister */
45#define MAPSCIFSWR_OFS 0x0140 /* Map/SCIF Switch register */
46#define FPVERR_OFS 0x0150 /* FPGA Version register */
47#define FPDATER_OFS 0x0160 /* FPGA Date register */
48#define FPYEARR_OFS 0x0170 /* FPGA Year register */
49#define TCLKCR_OFS 0x0180 /* TCLK Control register */
50#define DIPSWMR_OFS 0x1000 /* DIPSW monitor register */
51#define FPODR_OFS 0x1010 /* Output port data register */
52#define ATACNR_OFS 0x1020 /* ATA-CN Control/status register */
53#define FPINDR_OFS 0x1030 /* Input port data register */
54#define MDSWMR_OFS 0x1040 /* MODE SW monitor register */
55#define DDR3BUPCR_OFS 0x1050 /* DDR3 Backup control register */
56#define SSICODECCR_OFS 0x1060 /* SSI-CODEC control register */
57#define PCIESLOTSR_OFS 0x1070 /* PCIexpress Slot status register */
58#define ETHERPORTSR_OFS 0x1080 /* EtherPhy Port status register */
59#define LATCHCR_OFS 0x3000 /* Latch control register */
60#define LATCUAR_OFS 0x3010 /* Latch upper address register */
61#define LATCLAR_OFS 0x3012 /* Latch lower address register */
62#define LATCLUDR_OFS 0x3024 /* Latch D31-16 register */
63#define LATCLLDR_OFS 0x3026 /* Latch D15-0 register */
64
65#define CHARLED_OFS 0x2000 /* Character LED */
66
67#endif /* __MACH_URQUELL_H */
68
diff --git a/arch/sh/kernel/Makefile_32 b/arch/sh/kernel/Makefile_32
index 2e1b86e16ab5..82a3a150c00d 100644
--- a/arch/sh/kernel/Makefile_32
+++ b/arch/sh/kernel/Makefile_32
@@ -30,5 +30,6 @@ obj-$(CONFIG_KPROBES) += kprobes.o
30obj-$(CONFIG_GENERIC_GPIO) += gpio.o 30obj-$(CONFIG_GENERIC_GPIO) += gpio.o
31obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 31obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
32obj-$(CONFIG_DUMP_CODE) += disassemble.o 32obj-$(CONFIG_DUMP_CODE) += disassemble.o
33obj-$(CONFIG_HIBERNATION) += swsusp.o
33 34
34EXTRA_CFLAGS += -Werror 35EXTRA_CFLAGS += -Werror
diff --git a/arch/sh/kernel/asm-offsets.c b/arch/sh/kernel/asm-offsets.c
index 57cf0e0680f3..99aceb28ee24 100644
--- a/arch/sh/kernel/asm-offsets.c
+++ b/arch/sh/kernel/asm-offsets.c
@@ -12,8 +12,10 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/kbuild.h> 14#include <linux/kbuild.h>
15#include <linux/suspend.h>
15 16
16#include <asm/thread_info.h> 17#include <asm/thread_info.h>
18#include <asm/suspend.h>
17 19
18int main(void) 20int main(void)
19{ 21{
@@ -25,5 +27,11 @@ int main(void)
25 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); 27 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
26 DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block)); 28 DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block));
27 29
30#ifdef CONFIG_HIBERNATION
31 DEFINE(PBE_ADDRESS, offsetof(struct pbe, address));
32 DEFINE(PBE_ORIG_ADDRESS, offsetof(struct pbe, orig_address));
33 DEFINE(PBE_NEXT, offsetof(struct pbe, next));
34 DEFINE(SWSUSP_ARCH_REGS_SIZE, sizeof(struct swsusp_arch_regs));
35#endif
28 return 0; 36 return 0;
29} 37}
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile
index f471d242774e..2600641a483f 100644
--- a/arch/sh/kernel/cpu/Makefile
+++ b/arch/sh/kernel/cpu/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_CPU_SH5) = sh5/
11# Special cases for family ancestry. 11# Special cases for family ancestry.
12 12
13obj-$(CONFIG_CPU_SH4A) += sh4a/ 13obj-$(CONFIG_CPU_SH4A) += sh4a/
14obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/
14 15
15# Common interfaces. 16# Common interfaces.
16 17
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 7b17137536d6..1dc896483b59 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -20,6 +20,8 @@
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/kref.h> 22#include <linux/kref.h>
23#include <linux/kobject.h>
24#include <linux/sysdev.h>
23#include <linux/seq_file.h> 25#include <linux/seq_file.h>
24#include <linux/err.h> 26#include <linux/err.h>
25#include <linux/platform_device.h> 27#include <linux/platform_device.h>
@@ -239,6 +241,35 @@ void clk_recalc_rate(struct clk *clk)
239} 241}
240EXPORT_SYMBOL_GPL(clk_recalc_rate); 242EXPORT_SYMBOL_GPL(clk_recalc_rate);
241 243
244int clk_set_parent(struct clk *clk, struct clk *parent)
245{
246 int ret = -EINVAL;
247 struct clk *old;
248
249 if (!parent || !clk)
250 return ret;
251
252 old = clk->parent;
253 if (likely(clk->ops && clk->ops->set_parent)) {
254 unsigned long flags;
255 spin_lock_irqsave(&clock_lock, flags);
256 ret = clk->ops->set_parent(clk, parent);
257 spin_unlock_irqrestore(&clock_lock, flags);
258 clk->parent = (ret ? old : parent);
259 }
260
261 if (unlikely(clk->flags & CLK_RATE_PROPAGATES))
262 propagate_rate(clk);
263 return ret;
264}
265EXPORT_SYMBOL_GPL(clk_set_parent);
266
267struct clk *clk_get_parent(struct clk *clk)
268{
269 return clk->parent;
270}
271EXPORT_SYMBOL_GPL(clk_get_parent);
272
242long clk_round_rate(struct clk *clk, unsigned long rate) 273long clk_round_rate(struct clk *clk, unsigned long rate)
243{ 274{
244 if (likely(clk->ops && clk->ops->round_rate)) { 275 if (likely(clk->ops && clk->ops->round_rate)) {
@@ -329,6 +360,70 @@ static int show_clocks(char *buf, char **start, off_t off,
329 return p - buf; 360 return p - buf;
330} 361}
331 362
363#ifdef CONFIG_PM
364static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state)
365{
366 static pm_message_t prev_state;
367 struct clk *clkp;
368
369 switch (state.event) {
370 case PM_EVENT_ON:
371 /* Resumeing from hibernation */
372 if (prev_state.event == PM_EVENT_FREEZE) {
373 list_for_each_entry(clkp, &clock_list, node)
374 if (likely(clkp->ops)) {
375 unsigned long rate = clkp->rate;
376
377 if (likely(clkp->ops->set_parent))
378 clkp->ops->set_parent(clkp,
379 clkp->parent);
380 if (likely(clkp->ops->set_rate))
381 clkp->ops->set_rate(clkp,
382 rate, NO_CHANGE);
383 else if (likely(clkp->ops->recalc))
384 clkp->ops->recalc(clkp);
385 }
386 }
387 break;
388 case PM_EVENT_FREEZE:
389 break;
390 case PM_EVENT_SUSPEND:
391 break;
392 }
393
394 prev_state = state;
395 return 0;
396}
397
398static int clks_sysdev_resume(struct sys_device *dev)
399{
400 return clks_sysdev_suspend(dev, PMSG_ON);
401}
402
403static struct sysdev_class clks_sysdev_class = {
404 .name = "clks",
405};
406
407static struct sysdev_driver clks_sysdev_driver = {
408 .suspend = clks_sysdev_suspend,
409 .resume = clks_sysdev_resume,
410};
411
412static struct sys_device clks_sysdev_dev = {
413 .cls = &clks_sysdev_class,
414};
415
416static int __init clk_sysdev_init(void)
417{
418 sysdev_class_register(&clks_sysdev_class);
419 sysdev_driver_register(&clks_sysdev_class, &clks_sysdev_driver);
420 sysdev_register(&clks_sysdev_dev);
421
422 return 0;
423}
424subsys_initcall(clk_sysdev_init);
425#endif
426
332int __init clk_init(void) 427int __init clk_init(void)
333{ 428{
334 int i, ret = 0; 429 int i, ret = 0;
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index 56e5878e5516..0e32d8e448ca 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -2,6 +2,7 @@
2 * SH7619 Setup 2 * SH7619 Setup
3 * 3 *
4 * Copyright (C) 2006 Yoshinori Sato 4 * Copyright (C) 2006 Yoshinori Sato
5 * Copyright (C) 2009 Paul Mundt
5 * 6 *
6 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
@@ -18,15 +19,10 @@ enum {
18 /* interrupt sources */ 19 /* interrupt sources */
19 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 20 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
20 WDT, EDMAC, CMT0, CMT1, 21 WDT, EDMAC, CMT0, CMT1,
21 SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI, 22 SCIF0, SCIF1, SCIF2,
22 SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI,
23 SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI,
24 HIF_HIFI, HIF_HIFBI, 23 HIF_HIFI, HIF_HIFBI,
25 DMAC0, DMAC1, DMAC2, DMAC3, 24 DMAC0, DMAC1, DMAC2, DMAC3,
26 SIOF, 25 SIOF,
27
28 /* interrupt groups */
29 SCIF0, SCIF1, SCIF2,
30}; 26};
31 27
32static struct intc_vect vectors[] __initdata = { 28static struct intc_vect vectors[] __initdata = {
@@ -36,24 +32,18 @@ static struct intc_vect vectors[] __initdata = {
36 INTC_IRQ(IRQ6, 82), INTC_IRQ(IRQ7, 83), 32 INTC_IRQ(IRQ6, 82), INTC_IRQ(IRQ7, 83),
37 INTC_IRQ(WDT, 84), INTC_IRQ(EDMAC, 85), 33 INTC_IRQ(WDT, 84), INTC_IRQ(EDMAC, 85),
38 INTC_IRQ(CMT0, 86), INTC_IRQ(CMT1, 87), 34 INTC_IRQ(CMT0, 86), INTC_IRQ(CMT1, 87),
39 INTC_IRQ(SCIF0_ERI, 88), INTC_IRQ(SCIF0_RXI, 89), 35 INTC_IRQ(SCIF0, 88), INTC_IRQ(SCIF0, 89),
40 INTC_IRQ(SCIF0_BRI, 90), INTC_IRQ(SCIF0_TXI, 91), 36 INTC_IRQ(SCIF0, 90), INTC_IRQ(SCIF0, 91),
41 INTC_IRQ(SCIF1_ERI, 92), INTC_IRQ(SCIF1_RXI, 93), 37 INTC_IRQ(SCIF1, 92), INTC_IRQ(SCIF1, 93),
42 INTC_IRQ(SCIF1_BRI, 94), INTC_IRQ(SCIF1_TXI, 95), 38 INTC_IRQ(SCIF1, 94), INTC_IRQ(SCIF1, 95),
43 INTC_IRQ(SCIF2_ERI, 96), INTC_IRQ(SCIF2_RXI, 97), 39 INTC_IRQ(SCIF2, 96), INTC_IRQ(SCIF2, 97),
44 INTC_IRQ(SCIF2_BRI, 98), INTC_IRQ(SCIF2_TXI, 99), 40 INTC_IRQ(SCIF2, 98), INTC_IRQ(SCIF2, 99),
45 INTC_IRQ(HIF_HIFI, 100), INTC_IRQ(HIF_HIFBI, 101), 41 INTC_IRQ(HIF_HIFI, 100), INTC_IRQ(HIF_HIFBI, 101),
46 INTC_IRQ(DMAC0, 104), INTC_IRQ(DMAC1, 105), 42 INTC_IRQ(DMAC0, 104), INTC_IRQ(DMAC1, 105),
47 INTC_IRQ(DMAC2, 106), INTC_IRQ(DMAC3, 107), 43 INTC_IRQ(DMAC2, 106), INTC_IRQ(DMAC3, 107),
48 INTC_IRQ(SIOF, 108), 44 INTC_IRQ(SIOF, 108),
49}; 45};
50 46
51static struct intc_group groups[] __initdata = {
52 INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
53 INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
54 INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI),
55};
56
57static struct intc_prio_reg prio_registers[] __initdata = { 47static struct intc_prio_reg prio_registers[] __initdata = {
58 { 0xf8140006, 0, 16, 4, /* IPRA */ { IRQ0, IRQ1, IRQ2, IRQ3 } }, 48 { 0xf8140006, 0, 16, 4, /* IPRA */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
59 { 0xf8140008, 0, 16, 4, /* IPRB */ { IRQ4, IRQ5, IRQ6, IRQ7 } }, 49 { 0xf8140008, 0, 16, 4, /* IPRB */ { IRQ4, IRQ5, IRQ6, IRQ7 } },
@@ -64,7 +54,7 @@ static struct intc_prio_reg prio_registers[] __initdata = {
64 { 0xf8080008, 0, 16, 4, /* IPRG */ { SIOF } }, 54 { 0xf8080008, 0, 16, 4, /* IPRG */ { SIOF } },
65}; 55};
66 56
67static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, groups, 57static DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL,
68 NULL, prio_registers, NULL); 58 NULL, prio_registers, NULL);
69 59
70static struct plat_sci_port sci_platform_data[] = { 60static struct plat_sci_port sci_platform_data[] = {
@@ -72,17 +62,17 @@ static struct plat_sci_port sci_platform_data[] = {
72 .mapbase = 0xf8400000, 62 .mapbase = 0xf8400000,
73 .flags = UPF_BOOT_AUTOCONF, 63 .flags = UPF_BOOT_AUTOCONF,
74 .type = PORT_SCIF, 64 .type = PORT_SCIF,
75 .irqs = { 88, 89, 91, 90}, 65 .irqs = { 88, 88, 88, 88 },
76 }, { 66 }, {
77 .mapbase = 0xf8410000, 67 .mapbase = 0xf8410000,
78 .flags = UPF_BOOT_AUTOCONF, 68 .flags = UPF_BOOT_AUTOCONF,
79 .type = PORT_SCIF, 69 .type = PORT_SCIF,
80 .irqs = { 92, 93, 95, 94}, 70 .irqs = { 92, 92, 92, 92 },
81 }, { 71 }, {
82 .mapbase = 0xf8420000, 72 .mapbase = 0xf8420000,
83 .flags = UPF_BOOT_AUTOCONF, 73 .flags = UPF_BOOT_AUTOCONF,
84 .type = PORT_SCIF, 74 .type = PORT_SCIF,
85 .irqs = { 96, 97, 99, 98}, 75 .irqs = { 96, 96, 96, 96 },
86 }, { 76 }, {
87 .flags = 0, 77 .flags = 0,
88 } 78 }
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
index e611d79fac4c..844293723cfc 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Renesas MX-G (R8A03022BG) Setup 2 * Renesas MX-G (R8A03022BG) Setup
3 * 3 *
4 * Copyright (C) 2008 Paul Mundt 4 * Copyright (C) 2008, 2009 Paul Mundt
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 7 * License. See the file "COPYING" in the main directory of this archive
@@ -20,23 +20,15 @@ enum {
20 IRQ8, IRQ9, IRQ10, IRQ11, IRQ12, IRQ13, IRQ14, IRQ15, 20 IRQ8, IRQ9, IRQ10, IRQ11, IRQ12, IRQ13, IRQ14, IRQ15,
21 21
22 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7, 22 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
23
24 SINT8, SINT7, SINT6, SINT5, SINT4, SINT3, SINT2, SINT1, 23 SINT8, SINT7, SINT6, SINT5, SINT4, SINT3, SINT2, SINT1,
25 24
26 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI, 25 SCIF0, SCIF1,
27 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
28 26
29 MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D, 27 MTU2_GROUP1, MTU2_GROUP2, MTU2_GROUP3, MTU2_GROUP4, MTU2_GROUP5
30 MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F, 28 MTU2_TGI3B, MTU2_TGI3C,
31 MTU2_TGI1A, MTU2_TGI1B, MTU2_TCI1V, MTU2_TCI1U,
32 MTU2_TGI2A, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
33 MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D, MTU2_TCI3V,
34 MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D, MTU2_TCI4V,
35 MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W,
36 29
37 /* interrupt groups */ 30 /* interrupt groups */
38 PINT, SCIF0, SCIF1, 31 PINT,
39 MTU2_GROUP1, MTU2_GROUP2, MTU2_GROUP3, MTU2_GROUP4, MTU2_GROUP5
40}; 32};
41 33
42static struct intc_vect vectors[] __initdata = { 34static struct intc_vect vectors[] __initdata = {
@@ -59,47 +51,36 @@ static struct intc_vect vectors[] __initdata = {
59 INTC_IRQ(SINT4, 98), INTC_IRQ(SINT3, 99), 51 INTC_IRQ(SINT4, 98), INTC_IRQ(SINT3, 99),
60 INTC_IRQ(SINT2, 100), INTC_IRQ(SINT1, 101), 52 INTC_IRQ(SINT2, 100), INTC_IRQ(SINT1, 101),
61 53
62 INTC_IRQ(SCIF0_RXI, 220), INTC_IRQ(SCIF0_TXI, 221), 54 INTC_IRQ(SCIF0, 220), INTC_IRQ(SCIF0, 221),
63 INTC_IRQ(SCIF0_BRI, 222), INTC_IRQ(SCIF0_ERI, 223), 55 INTC_IRQ(SCIF0, 222), INTC_IRQ(SCIF0, 223),
64 INTC_IRQ(SCIF1_RXI, 224), INTC_IRQ(SCIF1_TXI, 225), 56 INTC_IRQ(SCIF1, 224), INTC_IRQ(SCIF1, 225),
65 INTC_IRQ(SCIF1_BRI, 226), INTC_IRQ(SCIF1_ERI, 227), 57 INTC_IRQ(SCIF1, 226), INTC_IRQ(SCIF1, 227),
66 58
67 INTC_IRQ(MTU2_TGI0A, 228), INTC_IRQ(MTU2_TGI0B, 229), 59 INTC_IRQ(MTU2_GROUP1, 228), INTC_IRQ(MTU2_GROUP1, 229),
68 INTC_IRQ(MTU2_TGI0C, 230), INTC_IRQ(MTU2_TGI0D, 231), 60 INTC_IRQ(MTU2_GROUP1, 230), INTC_IRQ(MTU2_GROUP1, 231),
69 INTC_IRQ(MTU2_TCI0V, 232), INTC_IRQ(MTU2_TGI0E, 233), 61 INTC_IRQ(MTU2_GROUP1, 232), INTC_IRQ(MTU2_GROUP1, 233),
70 62
71 INTC_IRQ(MTU2_TGI0F, 234), INTC_IRQ(MTU2_TGI1A, 235), 63 INTC_IRQ(MTU2_GROUP2, 234), INTC_IRQ(MTU2_GROUP2, 235),
72 INTC_IRQ(MTU2_TGI1B, 236), INTC_IRQ(MTU2_TCI1V, 237), 64 INTC_IRQ(MTU2_GROUP2, 236), INTC_IRQ(MTU2_GROUP2, 237),
73 INTC_IRQ(MTU2_TCI1U, 238), INTC_IRQ(MTU2_TGI2A, 239), 65 INTC_IRQ(MTU2_GROUP2, 238), INTC_IRQ(MTU2_GROUP2, 239),
74 66
75 INTC_IRQ(MTU2_TGI2B, 240), INTC_IRQ(MTU2_TCI2V, 241), 67 INTC_IRQ(MTU2_GROUP3, 240), INTC_IRQ(MTU2_GROUP3, 241),
76 INTC_IRQ(MTU2_TCI2U, 242), INTC_IRQ(MTU2_TGI3A, 243), 68 INTC_IRQ(MTU2_GROUP3, 242), INTC_IRQ(MTU2_GROUP3, 243),
77 69
78 INTC_IRQ(MTU2_TGI3B, 244), 70 INTC_IRQ(MTU2_TGI3B, 244),
79 INTC_IRQ(MTU2_TGI3C, 245), 71 INTC_IRQ(MTU2_TGI3C, 245),
80 72
81 INTC_IRQ(MTU2_TGI3D, 246), INTC_IRQ(MTU2_TCI3V, 247), 73 INTC_IRQ(MTU2_GROUP4, 246), INTC_IRQ(MTU2_GROUP4, 247),
82 INTC_IRQ(MTU2_TGI4A, 248), INTC_IRQ(MTU2_TGI4B, 249), 74 INTC_IRQ(MTU2_GROUP4, 248), INTC_IRQ(MTU2_GROUP4, 249),
83 INTC_IRQ(MTU2_TGI4C, 250), INTC_IRQ(MTU2_TGI4D, 251), 75 INTC_IRQ(MTU2_GROUP4, 250), INTC_IRQ(MTU2_GROUP4, 251),
84 76
85 INTC_IRQ(MTU2_TCI4V, 252), INTC_IRQ(MTU2_TGI5U, 253), 77 INTC_IRQ(MTU2_GROUP5, 252), INTC_IRQ(MTU2_GROUP5, 253),
86 INTC_IRQ(MTU2_TGI5V, 254), INTC_IRQ(MTU2_TGI5W, 255), 78 INTC_IRQ(MTU2_GROUP5, 254), INTC_IRQ(MTU2_GROUP5, 255),
87}; 79};
88 80
89static struct intc_group groups[] __initdata = { 81static struct intc_group groups[] __initdata = {
90 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3, 82 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
91 PINT4, PINT5, PINT6, PINT7), 83 PINT4, PINT5, PINT6, PINT7),
92 INTC_GROUP(MTU2_GROUP1, MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D,
93 MTU2_TCI0V, MTU2_TGI0E),
94 INTC_GROUP(MTU2_GROUP2, MTU2_TGI0F, MTU2_TGI1A, MTU2_TGI1B,
95 MTU2_TCI1V, MTU2_TCI1U, MTU2_TGI2A),
96 INTC_GROUP(MTU2_GROUP3, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
97 MTU2_TGI3A),
98 INTC_GROUP(MTU2_GROUP4, MTU2_TGI3D, MTU2_TCI3V, MTU2_TGI4A,
99 MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D),
100 INTC_GROUP(MTU2_GROUP5, MTU2_TCI4V, MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W),
101 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
102 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
103}; 84};
104 85
105static struct intc_prio_reg prio_registers[] __initdata = { 86static struct intc_prio_reg prio_registers[] __initdata = {
@@ -137,7 +118,7 @@ static struct plat_sci_port sci_platform_data[] = {
137 .mapbase = 0xff804000, 118 .mapbase = 0xff804000,
138 .flags = UPF_BOOT_AUTOCONF, 119 .flags = UPF_BOOT_AUTOCONF,
139 .type = PORT_SCIF, 120 .type = PORT_SCIF,
140 .irqs = { 223, 220, 221, 222 }, 121 .irqs = { 220, 220, 220, 220 },
141 }, { 122 }, {
142 .flags = 0, 123 .flags = 0,
143 } 124 }
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
index 0631e421c022..00f42f9e3f5c 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
@@ -2,6 +2,7 @@
2 * SH7201 setup 2 * SH7201 setup
3 * 3 *
4 * Copyright (C) 2008 Peter Griffin pgriffin@mpc-data.co.uk 4 * Copyright (C) 2008 Peter Griffin pgriffin@mpc-data.co.uk
5 * Copyright (C) 2009 Paul Mundt
5 * 6 *
6 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
@@ -18,57 +19,32 @@ enum {
18 /* interrupt sources */ 19 /* interrupt sources */
19 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 20 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
20 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7, 21 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
22
21 ADC_ADI, 23 ADC_ADI,
22 MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D, 24
23 MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F, 25 MTU20_ABCD, MTU20_VEF, MTU21_AB, MTU21_VU, MTU22_AB, MTU22_VU,
24 MTU2_TGI1A, MTU2_TGI1B, MTU2_TCI1V, MTU2_TCI1U, 26 MTU23_ABCD, MTU24_ABCD, MTU25_UVW, MTU2_TCI3V, MTU2_TCI4V,
25 MTU2_TGI2A, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U, 27
26 MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D, MTU2_TCI3V, 28 RTC, WDT,
27 MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D, MTU2_TCI4V, 29
28 MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W, 30 IIC30, IIC31, IIC32,
29 RTC_ARM, RTC_PRD, RTC_CUP,
30 WDT,
31 IIC30_STPI, IIC30_NAKI, IIC30_RXI, IIC30_TXI, IIC30_TEI,
32 IIC31_STPI, IIC31_NAKI, IIC31_RXI, IIC31_TXI, IIC31_TEI,
33 IIC32_STPI, IIC32_NAKI, IIC32_RXI, IIC32_TXI, IIC32_TEI,
34 31
35 DMAC0_DMINT0, DMAC1_DMINT1, 32 DMAC0_DMINT0, DMAC1_DMINT1,
36 DMAC2_DMINT2, DMAC3_DMINT3, 33 DMAC2_DMINT2, DMAC3_DMINT3,
37 34
38 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI, 35 SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7,
39 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
40 SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI,
41 SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI,
42 SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI,
43 SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI,
44 SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI,
45 SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI,
46 36
47 DMAC0_DMINTA, DMAC4_DMINT4, DMAC5_DMINT5, DMAC6_DMINT6, 37 DMAC0_DMINTA, DMAC4_DMINT4, DMAC5_DMINT5, DMAC6_DMINT6,
48 DMAC7_DMINT7, 38 DMAC7_DMINT7,
49 39
50 RCAN0_ERS, RCAN0_OVR, 40 RCAN0, RCAN1,
51 RCAN0_SLE,
52 RCAN0_RM0, RCAN0_RM1,
53
54 RCAN1_ERS, RCAN1_OVR,
55 RCAN1_SLE,
56 RCAN1_RM0, RCAN1_RM1,
57 41
58 SSI0_SSII, SSI1_SSII, 42 SSI0_SSII, SSI1_SSII,
59 43
60 TMR0_CMIA0, TMR0_CMIB0, TMR0_OVI0, 44 TMR0, TMR1,
61 TMR1_CMIA1, TMR1_CMIB1, TMR1_OVI1,
62 45
63 /* interrupt groups */ 46 /* interrupt groups */
64 47 PINT,
65 IRQ, PINT, ADC,
66 MTU20_ABCD, MTU20_VEF, MTU21_AB, MTU21_VU, MTU22_AB, MTU22_VU,
67 MTU23_ABCD, MTU24_ABCD, MTU25_UVW,
68 RTC, IIC30, IIC31, IIC32,
69 SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7,
70 RCAN0, RCAN1, TMR0, TMR1
71
72}; 48};
73 49
74static struct intc_vect vectors[] __initdata = { 50static struct intc_vect vectors[] __initdata = {
@@ -76,6 +52,7 @@ static struct intc_vect vectors[] __initdata = {
76 INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67), 52 INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67),
77 INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69), 53 INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69),
78 INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71), 54 INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71),
55
79 INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81), 56 INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81),
80 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83), 57 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83),
81 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85), 58 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
@@ -83,123 +60,92 @@ static struct intc_vect vectors[] __initdata = {
83 60
84 INTC_IRQ(ADC_ADI, 92), 61 INTC_IRQ(ADC_ADI, 92),
85 62
86 INTC_IRQ(MTU2_TGI0A, 108), INTC_IRQ(MTU2_TGI0B, 109), 63 INTC_IRQ(MTU20_ABCD, 108), INTC_IRQ(MTU20_ABCD, 109),
87 INTC_IRQ(MTU2_TGI0C, 110), INTC_IRQ(MTU2_TGI0D, 111), 64 INTC_IRQ(MTU20_ABCD, 110), INTC_IRQ(MTU20_ABCD, 111),
88 INTC_IRQ(MTU2_TCI0V, 112), 65
89 INTC_IRQ(MTU2_TGI0E, 113), INTC_IRQ(MTU2_TGI0F, 114), 66 INTC_IRQ(MTU20_VEF, 112), INTC_IRQ(MTU20_VEF, 113),
67 INTC_IRQ(MTU20_VEF, 114),
68
69 INTC_IRQ(MTU21_AB, 116), INTC_IRQ(MTU21_AB, 117),
70 INTC_IRQ(MTU21_VU, 120), INTC_IRQ(MTU21_VU, 121),
90 71
91 INTC_IRQ(MTU2_TGI1A, 116), INTC_IRQ(MTU2_TGI1B, 117), 72 INTC_IRQ(MTU22_AB, 124), INTC_IRQ(MTU22_AB, 125),
92 INTC_IRQ(MTU2_TCI1V, 120), INTC_IRQ(MTU2_TCI1U, 121), 73 INTC_IRQ(MTU22_VU, 128), INTC_IRQ(MTU22_VU, 129),
93 74
94 INTC_IRQ(MTU2_TGI2A, 124), INTC_IRQ(MTU2_TGI2B, 125), 75 INTC_IRQ(MTU23_ABCD, 132), INTC_IRQ(MTU23_ABCD, 133),
95 INTC_IRQ(MTU2_TCI2V, 128), INTC_IRQ(MTU2_TCI2U, 129), 76 INTC_IRQ(MTU23_ABCD, 134), INTC_IRQ(MTU23_ABCD, 135),
96 77
97 INTC_IRQ(MTU2_TGI3A, 132), INTC_IRQ(MTU2_TGI3B, 133),
98 INTC_IRQ(MTU2_TGI3C, 134), INTC_IRQ(MTU2_TGI3D, 135),
99 INTC_IRQ(MTU2_TCI3V, 136), 78 INTC_IRQ(MTU2_TCI3V, 136),
100 79
101 INTC_IRQ(MTU2_TGI4A, 140), INTC_IRQ(MTU2_TGI4B, 141), 80 INTC_IRQ(MTU24_ABCD, 140), INTC_IRQ(MTU24_ABCD, 141),
102 INTC_IRQ(MTU2_TGI4C, 142), INTC_IRQ(MTU2_TGI4D, 143), 81 INTC_IRQ(MTU24_ABCD, 142), INTC_IRQ(MTU24_ABCD, 143),
82
103 INTC_IRQ(MTU2_TCI4V, 144), 83 INTC_IRQ(MTU2_TCI4V, 144),
104 84
105 INTC_IRQ(MTU2_TGI5U, 148), INTC_IRQ(MTU2_TGI5V, 149), 85 INTC_IRQ(MTU25_UVW, 148), INTC_IRQ(MTU25_UVW, 149),
106 INTC_IRQ(MTU2_TGI5W, 150), 86 INTC_IRQ(MTU25_UVW, 150),
87
88 INTC_IRQ(RTC, 152), INTC_IRQ(RTC, 153),
89 INTC_IRQ(RTC, 154),
107 90
108 INTC_IRQ(RTC_ARM, 152), INTC_IRQ(RTC_PRD, 153), 91 INTC_IRQ(WDT, 156),
109 INTC_IRQ(RTC_CUP, 154), INTC_IRQ(WDT, 156),
110 92
111 INTC_IRQ(IIC30_STPI, 157), INTC_IRQ(IIC30_NAKI, 158), 93 INTC_IRQ(IIC30, 157), INTC_IRQ(IIC30, 158),
112 INTC_IRQ(IIC30_RXI, 159), INTC_IRQ(IIC30_TXI, 160), 94 INTC_IRQ(IIC30, 159), INTC_IRQ(IIC30, 160),
113 INTC_IRQ(IIC30_TEI, 161), 95 INTC_IRQ(IIC30, 161),
114 96
115 INTC_IRQ(IIC31_STPI, 164), INTC_IRQ(IIC31_NAKI, 165), 97 INTC_IRQ(IIC31, 164), INTC_IRQ(IIC31, 165),
116 INTC_IRQ(IIC31_RXI, 166), INTC_IRQ(IIC31_TXI, 167), 98 INTC_IRQ(IIC31, 166), INTC_IRQ(IIC31, 167),
117 INTC_IRQ(IIC31_TEI, 168), 99 INTC_IRQ(IIC31, 168),
118 100
119 INTC_IRQ(IIC32_STPI, 170), INTC_IRQ(IIC32_NAKI, 171), 101 INTC_IRQ(IIC32, 170), INTC_IRQ(IIC32, 171),
120 INTC_IRQ(IIC32_RXI, 172), INTC_IRQ(IIC32_TXI, 173), 102 INTC_IRQ(IIC32, 172), INTC_IRQ(IIC32, 173),
121 INTC_IRQ(IIC32_TEI, 174), 103 INTC_IRQ(IIC32, 174),
122 104
123 INTC_IRQ(DMAC0_DMINT0, 176), INTC_IRQ(DMAC1_DMINT1, 177), 105 INTC_IRQ(DMAC0_DMINT0, 176), INTC_IRQ(DMAC1_DMINT1, 177),
124 INTC_IRQ(DMAC2_DMINT2, 178), INTC_IRQ(DMAC3_DMINT3, 179), 106 INTC_IRQ(DMAC2_DMINT2, 178), INTC_IRQ(DMAC3_DMINT3, 179),
125 107
126 INTC_IRQ(SCIF0_BRI, 180), INTC_IRQ(SCIF0_ERI, 181), 108 INTC_IRQ(SCIF0, 180), INTC_IRQ(SCIF0, 181),
127 INTC_IRQ(SCIF0_RXI, 182), INTC_IRQ(SCIF0_TXI, 183), 109 INTC_IRQ(SCIF0, 182), INTC_IRQ(SCIF0, 183),
128 INTC_IRQ(SCIF1_BRI, 184), INTC_IRQ(SCIF1_ERI, 185), 110 INTC_IRQ(SCIF1, 184), INTC_IRQ(SCIF1, 185),
129 INTC_IRQ(SCIF1_RXI, 186), INTC_IRQ(SCIF1_TXI, 187), 111 INTC_IRQ(SCIF1, 186), INTC_IRQ(SCIF1, 187),
130 INTC_IRQ(SCIF2_BRI, 188), INTC_IRQ(SCIF2_ERI, 189), 112 INTC_IRQ(SCIF2, 188), INTC_IRQ(SCIF2, 189),
131 INTC_IRQ(SCIF2_RXI, 190), INTC_IRQ(SCIF2_TXI, 191), 113 INTC_IRQ(SCIF2, 190), INTC_IRQ(SCIF2, 191),
132 INTC_IRQ(SCIF3_BRI, 192), INTC_IRQ(SCIF3_ERI, 193), 114 INTC_IRQ(SCIF3, 192), INTC_IRQ(SCIF3, 193),
133 INTC_IRQ(SCIF3_RXI, 194), INTC_IRQ(SCIF3_TXI, 195), 115 INTC_IRQ(SCIF3, 194), INTC_IRQ(SCIF3, 195),
134 INTC_IRQ(SCIF4_BRI, 196), INTC_IRQ(SCIF4_ERI, 197), 116 INTC_IRQ(SCIF4, 196), INTC_IRQ(SCIF4, 197),
135 INTC_IRQ(SCIF4_RXI, 198), INTC_IRQ(SCIF4_TXI, 199), 117 INTC_IRQ(SCIF4, 198), INTC_IRQ(SCIF4, 199),
136 INTC_IRQ(SCIF5_BRI, 200), INTC_IRQ(SCIF5_ERI, 201), 118 INTC_IRQ(SCIF5, 200), INTC_IRQ(SCIF5, 201),
137 INTC_IRQ(SCIF5_RXI, 202), INTC_IRQ(SCIF5_TXI, 203), 119 INTC_IRQ(SCIF5, 202), INTC_IRQ(SCIF5, 203),
138 INTC_IRQ(SCIF6_BRI, 204), INTC_IRQ(SCIF6_ERI, 205), 120 INTC_IRQ(SCIF6, 204), INTC_IRQ(SCIF6, 205),
139 INTC_IRQ(SCIF6_RXI, 206), INTC_IRQ(SCIF6_TXI, 207), 121 INTC_IRQ(SCIF6, 206), INTC_IRQ(SCIF6, 207),
140 INTC_IRQ(SCIF7_BRI, 208), INTC_IRQ(SCIF7_ERI, 209), 122 INTC_IRQ(SCIF7, 208), INTC_IRQ(SCIF7, 209),
141 INTC_IRQ(SCIF7_RXI, 210), INTC_IRQ(SCIF7_TXI, 211), 123 INTC_IRQ(SCIF7, 210), INTC_IRQ(SCIF7, 211),
142 124
143 INTC_IRQ(DMAC0_DMINTA, 212), INTC_IRQ(DMAC4_DMINT4, 216), 125 INTC_IRQ(DMAC0_DMINTA, 212), INTC_IRQ(DMAC4_DMINT4, 216),
144 INTC_IRQ(DMAC5_DMINT5, 217), INTC_IRQ(DMAC6_DMINT6, 218), 126 INTC_IRQ(DMAC5_DMINT5, 217), INTC_IRQ(DMAC6_DMINT6, 218),
145 INTC_IRQ(DMAC7_DMINT7, 219), 127 INTC_IRQ(DMAC7_DMINT7, 219),
146 128
147 INTC_IRQ(RCAN0_ERS, 228), INTC_IRQ(RCAN0_OVR, 229), 129 INTC_IRQ(RCAN0, 228), INTC_IRQ(RCAN0, 229),
148 INTC_IRQ(RCAN0_SLE, 230), 130 INTC_IRQ(RCAN0, 230),
149 INTC_IRQ(RCAN0_RM0, 231), INTC_IRQ(RCAN0_RM1, 232), 131 INTC_IRQ(RCAN0, 231), INTC_IRQ(RCAN0, 232),
150 132
151 INTC_IRQ(RCAN1_ERS, 234), INTC_IRQ(RCAN1_OVR, 235), 133 INTC_IRQ(RCAN1, 234), INTC_IRQ(RCAN1, 235),
152 INTC_IRQ(RCAN1_SLE, 236), 134 INTC_IRQ(RCAN1, 236),
153 INTC_IRQ(RCAN1_RM0, 237), INTC_IRQ(RCAN1_RM1, 238), 135 INTC_IRQ(RCAN1, 237), INTC_IRQ(RCAN1, 238),
154 136
155 INTC_IRQ(SSI0_SSII, 244), INTC_IRQ(SSI1_SSII, 245), 137 INTC_IRQ(SSI0_SSII, 244), INTC_IRQ(SSI1_SSII, 245),
156 138
157 INTC_IRQ(TMR0_CMIA0, 246), INTC_IRQ(TMR0_CMIB0, 247), 139 INTC_IRQ(TMR0, 246), INTC_IRQ(TMR0, 247),
158 INTC_IRQ(TMR0_OVI0, 248), 140 INTC_IRQ(TMR0, 248),
159
160 INTC_IRQ(TMR1_CMIA1, 252), INTC_IRQ(TMR1_CMIB1, 253),
161 INTC_IRQ(TMR1_OVI1, 254),
162 141
142 INTC_IRQ(TMR1, 252), INTC_IRQ(TMR1, 253),
143 INTC_IRQ(TMR1, 254),
163}; 144};
164 145
165static struct intc_group groups[] __initdata = { 146static struct intc_group groups[] __initdata = {
166 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3, 147 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
167 PINT4, PINT5, PINT6, PINT7), 148 PINT4, PINT5, PINT6, PINT7),
168 INTC_GROUP(MTU20_ABCD, MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D),
169 INTC_GROUP(MTU20_VEF, MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F),
170
171 INTC_GROUP(MTU21_AB, MTU2_TGI1A, MTU2_TGI1B),
172 INTC_GROUP(MTU21_VU, MTU2_TCI1V, MTU2_TCI1U),
173 INTC_GROUP(MTU22_AB, MTU2_TGI2A, MTU2_TGI2B),
174 INTC_GROUP(MTU22_VU, MTU2_TCI2V, MTU2_TCI2U),
175 INTC_GROUP(MTU23_ABCD, MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D),
176 INTC_GROUP(MTU24_ABCD, MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D),
177 INTC_GROUP(MTU25_UVW, MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W),
178 INTC_GROUP(RTC, RTC_ARM, RTC_PRD, RTC_CUP ),
179
180 INTC_GROUP(IIC30, IIC30_STPI, IIC30_NAKI, IIC30_RXI, IIC30_TXI,
181 IIC30_TEI),
182 INTC_GROUP(IIC31, IIC31_STPI, IIC31_NAKI, IIC31_RXI, IIC31_TXI,
183 IIC31_TEI),
184 INTC_GROUP(IIC32, IIC32_STPI, IIC32_NAKI, IIC32_RXI, IIC32_TXI,
185 IIC32_TEI),
186
187 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
188 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
189 INTC_GROUP(SCIF2, SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI),
190 INTC_GROUP(SCIF3, SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI),
191 INTC_GROUP(SCIF4, SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI),
192 INTC_GROUP(SCIF5, SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI),
193 INTC_GROUP(SCIF6, SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI),
194 INTC_GROUP(SCIF7, SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI),
195
196 INTC_GROUP(RCAN0, RCAN0_ERS, RCAN0_OVR, RCAN0_RM0, RCAN0_RM1,
197 RCAN0_SLE),
198 INTC_GROUP(RCAN1, RCAN1_ERS, RCAN1_OVR, RCAN1_RM0, RCAN1_RM1,
199 RCAN1_SLE),
200
201 INTC_GROUP(TMR0, TMR0_CMIA0, TMR0_CMIB0, TMR0_OVI0),
202 INTC_GROUP(TMR1, TMR1_CMIA1, TMR1_CMIB1, TMR1_OVI1),
203}; 149};
204 150
205static struct intc_prio_reg prio_registers[] __initdata = { 151static struct intc_prio_reg prio_registers[] __initdata = {
@@ -212,7 +158,7 @@ static struct intc_prio_reg prio_registers[] __initdata = {
212 158
213 { 0xfffe9806, 0, 16, 4, /* IPR09 */ { RTC, WDT, IIC30, 0 } }, 159 { 0xfffe9806, 0, 16, 4, /* IPR09 */ { RTC, WDT, IIC30, 0 } },
214 { 0xfffe9808, 0, 16, 4, /* IPR10 */ { IIC31, IIC32, DMAC0_DMINT0, DMAC1_DMINT1 } }, 160 { 0xfffe9808, 0, 16, 4, /* IPR10 */ { IIC31, IIC32, DMAC0_DMINT0, DMAC1_DMINT1 } },
215 { 0xfffe980a, 0, 16, 4, /* IPR11 */ { DMAC2_DMINT2, DMAC3_DMINT3, SCIF0 , SCIF1 } }, 161 { 0xfffe980a, 0, 16, 4, /* IPR11 */ { DMAC2_DMINT2, DMAC3_DMINT3, SCIF0, SCIF1 } },
216 { 0xfffe980c, 0, 16, 4, /* IPR12 */ { SCIF2, SCIF3, SCIF4, SCIF5 } }, 162 { 0xfffe980c, 0, 16, 4, /* IPR12 */ { SCIF2, SCIF3, SCIF4, SCIF5 } },
217 { 0xfffe980e, 0, 16, 4, /* IPR13 */ { SCIF6, SCIF7, DMAC0_DMINTA, DMAC4_DMINT4 } }, 163 { 0xfffe980e, 0, 16, 4, /* IPR13 */ { SCIF6, SCIF7, DMAC0_DMINTA, DMAC4_DMINT4 } },
218 { 0xfffe9810, 0, 16, 4, /* IPR14 */ { DMAC5_DMINT5, DMAC6_DMINT6, DMAC7_DMINT7, 0 } }, 164 { 0xfffe9810, 0, 16, 4, /* IPR14 */ { DMAC5_DMINT5, DMAC6_DMINT6, DMAC7_DMINT7, 0 } },
@@ -234,42 +180,42 @@ static struct plat_sci_port sci_platform_data[] = {
234 .mapbase = 0xfffe8000, 180 .mapbase = 0xfffe8000,
235 .flags = UPF_BOOT_AUTOCONF, 181 .flags = UPF_BOOT_AUTOCONF,
236 .type = PORT_SCIF, 182 .type = PORT_SCIF,
237 .irqs = { 181, 182, 183, 180} 183 .irqs = { 180, 180, 180, 180 }
238 }, { 184 }, {
239 .mapbase = 0xfffe8800, 185 .mapbase = 0xfffe8800,
240 .flags = UPF_BOOT_AUTOCONF, 186 .flags = UPF_BOOT_AUTOCONF,
241 .type = PORT_SCIF, 187 .type = PORT_SCIF,
242 .irqs = { 185, 186, 187, 184} 188 .irqs = { 184, 184, 184, 184 }
243 }, { 189 }, {
244 .mapbase = 0xfffe9000, 190 .mapbase = 0xfffe9000,
245 .flags = UPF_BOOT_AUTOCONF, 191 .flags = UPF_BOOT_AUTOCONF,
246 .type = PORT_SCIF, 192 .type = PORT_SCIF,
247 .irqs = { 189, 186, 187, 188} 193 .irqs = { 188, 188, 188, 188 }
248 }, { 194 }, {
249 .mapbase = 0xfffe9800, 195 .mapbase = 0xfffe9800,
250 .flags = UPF_BOOT_AUTOCONF, 196 .flags = UPF_BOOT_AUTOCONF,
251 .type = PORT_SCIF, 197 .type = PORT_SCIF,
252 .irqs = { 193, 194, 195, 192} 198 .irqs = { 192, 192, 192, 192 }
253 }, { 199 }, {
254 .mapbase = 0xfffea000, 200 .mapbase = 0xfffea000,
255 .flags = UPF_BOOT_AUTOCONF, 201 .flags = UPF_BOOT_AUTOCONF,
256 .type = PORT_SCIF, 202 .type = PORT_SCIF,
257 .irqs = { 196, 198, 199, 196} 203 .irqs = { 196, 196, 196, 196 }
258 }, { 204 }, {
259 .mapbase = 0xfffea800, 205 .mapbase = 0xfffea800,
260 .flags = UPF_BOOT_AUTOCONF, 206 .flags = UPF_BOOT_AUTOCONF,
261 .type = PORT_SCIF, 207 .type = PORT_SCIF,
262 .irqs = { 201, 202, 203, 200} 208 .irqs = { 200, 200, 200, 200 }
263 }, { 209 }, {
264 .mapbase = 0xfffeb000, 210 .mapbase = 0xfffeb000,
265 .flags = UPF_BOOT_AUTOCONF, 211 .flags = UPF_BOOT_AUTOCONF,
266 .type = PORT_SCIF, 212 .type = PORT_SCIF,
267 .irqs = { 205, 206, 207, 204} 213 .irqs = { 204, 204, 204, 204 }
268 }, { 214 }, {
269 .mapbase = 0xfffeb800, 215 .mapbase = 0xfffeb800,
270 .flags = UPF_BOOT_AUTOCONF, 216 .flags = UPF_BOOT_AUTOCONF,
271 .type = PORT_SCIF, 217 .type = PORT_SCIF,
272 .irqs = { 209, 210, 211, 208} 218 .irqs = { 208, 208, 208, 208 }
273 }, { 219 }, {
274 .flags = 0, 220 .flags = 0,
275 } 221 }
@@ -290,17 +236,7 @@ static struct resource rtc_resources[] = {
290 .flags = IORESOURCE_IO, 236 .flags = IORESOURCE_IO,
291 }, 237 },
292 [1] = { 238 [1] = {
293 /* Period IRQ */ 239 /* Shared Period/Carry/Alarm IRQ */
294 .start = 153,
295 .flags = IORESOURCE_IRQ,
296 },
297 [2] = {
298 /* Carry IRQ */
299 .start = 154,
300 .flags = IORESOURCE_IRQ,
301 },
302 [3] = {
303 /* Alarm IRQ */
304 .start = 152, 240 .start = 152,
305 .flags = IORESOURCE_IRQ, 241 .flags = IORESOURCE_IRQ,
306 }, 242 },
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
index e98dc4450352..820dfb2e8656 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SH7203 and SH7263 Setup 2 * SH7203 and SH7263 Setup
3 * 3 *
4 * Copyright (C) 2007 Paul Mundt 4 * Copyright (C) 2007 - 2009 Paul Mundt
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 7 * License. See the file "COPYING" in the main directory of this archive
@@ -18,50 +18,27 @@ enum {
18 /* interrupt sources */ 18 /* interrupt sources */
19 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 19 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
20 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7, 20 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
21 DMAC0_DEI, DMAC0_HEI, DMAC1_DEI, DMAC1_HEI, 21 DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7,
22 DMAC2_DEI, DMAC2_HEI, DMAC3_DEI, DMAC3_HEI,
23 DMAC4_DEI, DMAC4_HEI, DMAC5_DEI, DMAC5_HEI,
24 DMAC6_DEI, DMAC6_HEI, DMAC7_DEI, DMAC7_HEI,
25 USB, LCDC, CMT0, CMT1, BSC, WDT, 22 USB, LCDC, CMT0, CMT1, BSC, WDT,
26 MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D,
27 MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F,
28 MTU2_TGI1A, MTU2_TGI1B, MTU2_TCI1V, MTU2_TCI1U,
29 MTU2_TGI2A, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
30 MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D, MTU2_TCI3V,
31 MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D, MTU2_TCI4V,
32 ADC_ADI,
33 IIC30_STPI, IIC30_NAKI, IIC30_RXI, IIC30_TXI, IIC30_TEI,
34 IIC31_STPI, IIC31_NAKI, IIC31_RXI, IIC31_TXI, IIC31_TEI,
35 IIC32_STPI, IIC32_NAKI, IIC32_RXI, IIC32_TXI, IIC32_TEI,
36 IIC33_STPI, IIC33_NAKI, IIC33_RXI, IIC33_TXI, IIC33_TEI,
37 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI,
38 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
39 SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI,
40 SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI,
41 SSU0_SSERI, SSU0_SSRXI, SSU0_SSTXI,
42 SSU1_SSERI, SSU1_SSRXI, SSU1_SSTXI,
43 SSI0_SSII, SSI1_SSII, SSI2_SSII, SSI3_SSII,
44 23
45 /* ROM-DEC, SDHI, SRC, and IEB are SH7263 specific */ 24 MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU,
46 ROMDEC_ISY, ROMDEC_IERR, ROMDEC_IARG, ROMDEC_ISEC, ROMDEC_IBUF, 25 MTU3_ABCD, MTU4_ABCD, MTU2_TCI3V, MTU2_TCI4V,
47 ROMDEC_IREADY,
48 26
49 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I, 27 ADC_ADI,
28
29 IIC30, IIC31, IIC32, IIC33,
30 SCIF0, SCIF1, SCIF2, SCIF3,
50 31
51 SDHI3, SDHI0, SDHI1, 32 SSU0, SSU1,
52 33
53 RTC_ARM, RTC_PRD, RTC_CUP, 34 SSI0_SSII, SSI1_SSII, SSI2_SSII, SSI3_SSII,
54 RCAN0_ERS, RCAN0_OVR, RCAN0_RM0, RCAN0_RM1, RCAN0_SLE,
55 RCAN1_ERS, RCAN1_OVR, RCAN1_RM0, RCAN1_RM1, RCAN1_SLE,
56 35
57 SRC_OVF, SRC_ODFI, SRC_IDEI, IEBI, 36 /* ROM-DEC, SDHI, SRC, and IEB are SH7263 specific */
37 ROMDEC, FLCTL, SDHI, RTC, RCAN0, RCAN1,
38 SRC, IEBI,
58 39
59 /* interrupt groups */ 40 /* interrupt groups */
60 PINT, DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7, 41 PINT,
61 MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU,
62 MTU3_ABCD, MTU4_ABCD,
63 IIC30, IIC31, IIC32, IIC33, SCIF0, SCIF1, SCIF2, SCIF3,
64 SSU0, SSU1, ROMDEC, SDHI, FLCTL, RTC, RCAN0, RCAN1, SRC
65}; 42};
66 43
67static struct intc_vect vectors[] __initdata = { 44static struct intc_vect vectors[] __initdata = {
@@ -73,79 +50,80 @@ static struct intc_vect vectors[] __initdata = {
73 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83), 50 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83),
74 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85), 51 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
75 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87), 52 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87),
76 INTC_IRQ(DMAC0_DEI, 108), INTC_IRQ(DMAC0_HEI, 109), 53 INTC_IRQ(DMAC0, 108), INTC_IRQ(DMAC0, 109),
77 INTC_IRQ(DMAC1_DEI, 112), INTC_IRQ(DMAC1_HEI, 113), 54 INTC_IRQ(DMAC1, 112), INTC_IRQ(DMAC1, 113),
78 INTC_IRQ(DMAC2_DEI, 116), INTC_IRQ(DMAC2_HEI, 117), 55 INTC_IRQ(DMAC2, 116), INTC_IRQ(DMAC2, 117),
79 INTC_IRQ(DMAC3_DEI, 120), INTC_IRQ(DMAC3_HEI, 121), 56 INTC_IRQ(DMAC3, 120), INTC_IRQ(DMAC3, 121),
80 INTC_IRQ(DMAC4_DEI, 124), INTC_IRQ(DMAC4_HEI, 125), 57 INTC_IRQ(DMAC4, 124), INTC_IRQ(DMAC4, 125),
81 INTC_IRQ(DMAC5_DEI, 128), INTC_IRQ(DMAC5_HEI, 129), 58 INTC_IRQ(DMAC5, 128), INTC_IRQ(DMAC5, 129),
82 INTC_IRQ(DMAC6_DEI, 132), INTC_IRQ(DMAC6_HEI, 133), 59 INTC_IRQ(DMAC6, 132), INTC_IRQ(DMAC6, 133),
83 INTC_IRQ(DMAC7_DEI, 136), INTC_IRQ(DMAC7_HEI, 137), 60 INTC_IRQ(DMAC7, 136), INTC_IRQ(DMAC7, 137),
84 INTC_IRQ(USB, 140), INTC_IRQ(LCDC, 141), 61 INTC_IRQ(USB, 140), INTC_IRQ(LCDC, 141),
85 INTC_IRQ(CMT0, 142), INTC_IRQ(CMT1, 143), 62 INTC_IRQ(CMT0, 142), INTC_IRQ(CMT1, 143),
86 INTC_IRQ(BSC, 144), INTC_IRQ(WDT, 145), 63 INTC_IRQ(BSC, 144), INTC_IRQ(WDT, 145),
87 INTC_IRQ(MTU2_TGI0A, 146), INTC_IRQ(MTU2_TGI0B, 147), 64 INTC_IRQ(MTU0_ABCD, 146), INTC_IRQ(MTU0_ABCD, 147),
88 INTC_IRQ(MTU2_TGI0C, 148), INTC_IRQ(MTU2_TGI0D, 149), 65 INTC_IRQ(MTU0_ABCD, 148), INTC_IRQ(MTU0_ABCD, 149),
89 INTC_IRQ(MTU2_TCI0V, 150), 66 INTC_IRQ(MTU0_VEF, 150),
90 INTC_IRQ(MTU2_TGI0E, 151), INTC_IRQ(MTU2_TGI0F, 152), 67 INTC_IRQ(MTU0_VEF, 151), INTC_IRQ(MTU0_VEF, 152),
91 INTC_IRQ(MTU2_TGI1A, 153), INTC_IRQ(MTU2_TGI1B, 154), 68 INTC_IRQ(MTU1_AB, 153), INTC_IRQ(MTU1_AB, 154),
92 INTC_IRQ(MTU2_TCI1V, 155), INTC_IRQ(MTU2_TCI1U, 156), 69 INTC_IRQ(MTU1_VU, 155), INTC_IRQ(MTU1_VU, 156),
93 INTC_IRQ(MTU2_TGI2A, 157), INTC_IRQ(MTU2_TGI2B, 158), 70 INTC_IRQ(MTU2_AB, 157), INTC_IRQ(MTU2_AB, 158),
94 INTC_IRQ(MTU2_TCI2V, 159), INTC_IRQ(MTU2_TCI2U, 160), 71 INTC_IRQ(MTU2_VU, 159), INTC_IRQ(MTU2_VU, 160),
95 INTC_IRQ(MTU2_TGI3A, 161), INTC_IRQ(MTU2_TGI3B, 162), 72 INTC_IRQ(MTU3_ABCD, 161), INTC_IRQ(MTU3_ABCD, 162),
96 INTC_IRQ(MTU2_TGI3C, 163), INTC_IRQ(MTU2_TGI3D, 164), 73 INTC_IRQ(MTU3_ABCD, 163), INTC_IRQ(MTU3_ABCD, 164),
97 INTC_IRQ(MTU2_TCI3V, 165), 74 INTC_IRQ(MTU2_TCI3V, 165),
98 INTC_IRQ(MTU2_TGI4A, 166), INTC_IRQ(MTU2_TGI4B, 167), 75 INTC_IRQ(MTU4_ABCD, 166), INTC_IRQ(MTU4_ABCD, 167),
99 INTC_IRQ(MTU2_TGI4C, 168), INTC_IRQ(MTU2_TGI4D, 169), 76 INTC_IRQ(MTU4_ABCD, 168), INTC_IRQ(MTU4_ABCD, 169),
100 INTC_IRQ(MTU2_TCI4V, 170), 77 INTC_IRQ(MTU2_TCI4V, 170),
101 INTC_IRQ(ADC_ADI, 171), 78 INTC_IRQ(ADC_ADI, 171),
102 INTC_IRQ(IIC30_STPI, 172), INTC_IRQ(IIC30_NAKI, 173), 79 INTC_IRQ(IIC30, 172), INTC_IRQ(IIC30, 173),
103 INTC_IRQ(IIC30_RXI, 174), INTC_IRQ(IIC30_TXI, 175), 80 INTC_IRQ(IIC30, 174), INTC_IRQ(IIC30, 175),
104 INTC_IRQ(IIC30_TEI, 176), 81 INTC_IRQ(IIC30, 176),
105 INTC_IRQ(IIC31_STPI, 177), INTC_IRQ(IIC31_NAKI, 178), 82 INTC_IRQ(IIC31, 177), INTC_IRQ(IIC31, 178),
106 INTC_IRQ(IIC31_RXI, 179), INTC_IRQ(IIC31_TXI, 180), 83 INTC_IRQ(IIC31, 179), INTC_IRQ(IIC31, 180),
107 INTC_IRQ(IIC31_TEI, 181), 84 INTC_IRQ(IIC31, 181),
108 INTC_IRQ(IIC32_STPI, 182), INTC_IRQ(IIC32_NAKI, 183), 85 INTC_IRQ(IIC32, 182), INTC_IRQ(IIC32, 183),
109 INTC_IRQ(IIC32_RXI, 184), INTC_IRQ(IIC32_TXI, 185), 86 INTC_IRQ(IIC32, 184), INTC_IRQ(IIC32, 185),
110 INTC_IRQ(IIC32_TEI, 186), 87 INTC_IRQ(IIC32, 186),
111 INTC_IRQ(IIC33_STPI, 187), INTC_IRQ(IIC33_NAKI, 188), 88 INTC_IRQ(IIC33, 187), INTC_IRQ(IIC33, 188),
112 INTC_IRQ(IIC33_RXI, 189), INTC_IRQ(IIC33_TXI, 190), 89 INTC_IRQ(IIC33, 189), INTC_IRQ(IIC33, 190),
113 INTC_IRQ(IIC33_TEI, 191), 90 INTC_IRQ(IIC33, 191),
114 INTC_IRQ(SCIF0_BRI, 192), INTC_IRQ(SCIF0_ERI, 193), 91 INTC_IRQ(SCIF0, 192), INTC_IRQ(SCIF0, 193),
115 INTC_IRQ(SCIF0_RXI, 194), INTC_IRQ(SCIF0_TXI, 195), 92 INTC_IRQ(SCIF0, 194), INTC_IRQ(SCIF0, 195),
116 INTC_IRQ(SCIF1_BRI, 196), INTC_IRQ(SCIF1_ERI, 197), 93 INTC_IRQ(SCIF1, 196), INTC_IRQ(SCIF1, 197),
117 INTC_IRQ(SCIF1_RXI, 198), INTC_IRQ(SCIF1_TXI, 199), 94 INTC_IRQ(SCIF1, 198), INTC_IRQ(SCIF1, 199),
118 INTC_IRQ(SCIF2_BRI, 200), INTC_IRQ(SCIF2_ERI, 201), 95 INTC_IRQ(SCIF2, 200), INTC_IRQ(SCIF2, 201),
119 INTC_IRQ(SCIF2_RXI, 202), INTC_IRQ(SCIF2_TXI, 203), 96 INTC_IRQ(SCIF2, 202), INTC_IRQ(SCIF2, 203),
120 INTC_IRQ(SCIF3_BRI, 204), INTC_IRQ(SCIF3_ERI, 205), 97 INTC_IRQ(SCIF3, 204), INTC_IRQ(SCIF3, 205),
121 INTC_IRQ(SCIF3_RXI, 206), INTC_IRQ(SCIF3_TXI, 207), 98 INTC_IRQ(SCIF3, 206), INTC_IRQ(SCIF3, 207),
122 INTC_IRQ(SSU0_SSERI, 208), INTC_IRQ(SSU0_SSRXI, 209), 99 INTC_IRQ(SSU0, 208), INTC_IRQ(SSU0, 209),
123 INTC_IRQ(SSU0_SSTXI, 210), 100 INTC_IRQ(SSU0, 210),
124 INTC_IRQ(SSU1_SSERI, 211), INTC_IRQ(SSU1_SSRXI, 212), 101 INTC_IRQ(SSU1, 211), INTC_IRQ(SSU1, 212),
125 INTC_IRQ(SSU1_SSTXI, 213), 102 INTC_IRQ(SSU1, 213),
126 INTC_IRQ(SSI0_SSII, 214), INTC_IRQ(SSI1_SSII, 215), 103 INTC_IRQ(SSI0_SSII, 214), INTC_IRQ(SSI1_SSII, 215),
127 INTC_IRQ(SSI2_SSII, 216), INTC_IRQ(SSI3_SSII, 217), 104 INTC_IRQ(SSI2_SSII, 216), INTC_IRQ(SSI3_SSII, 217),
128 INTC_IRQ(FLCTL_FLSTEI, 224), INTC_IRQ(FLCTL_FLTENDI, 225), 105 INTC_IRQ(FLCTL, 224), INTC_IRQ(FLCTL, 225),
129 INTC_IRQ(FLCTL_FLTREQ0I, 226), INTC_IRQ(FLCTL_FLTREQ1I, 227), 106 INTC_IRQ(FLCTL, 226), INTC_IRQ(FLCTL, 227),
130 INTC_IRQ(RTC_ARM, 231), INTC_IRQ(RTC_PRD, 232), 107 INTC_IRQ(RTC, 231), INTC_IRQ(RTC, 232),
131 INTC_IRQ(RTC_CUP, 233), 108 INTC_IRQ(RTC, 233),
132 INTC_IRQ(RCAN0_ERS, 234), INTC_IRQ(RCAN0_OVR, 235), 109 INTC_IRQ(RCAN0, 234), INTC_IRQ(RCAN0, 235),
133 INTC_IRQ(RCAN0_RM0, 236), INTC_IRQ(RCAN0_RM1, 237), 110 INTC_IRQ(RCAN0, 236), INTC_IRQ(RCAN0, 237),
134 INTC_IRQ(RCAN0_SLE, 238), 111 INTC_IRQ(RCAN0, 238),
135 INTC_IRQ(RCAN1_ERS, 239), INTC_IRQ(RCAN1_OVR, 240), 112 INTC_IRQ(RCAN1, 239), INTC_IRQ(RCAN1, 240),
136 INTC_IRQ(RCAN1_RM0, 241), INTC_IRQ(RCAN1_RM1, 242), 113 INTC_IRQ(RCAN1, 241), INTC_IRQ(RCAN1, 242),
137 INTC_IRQ(RCAN1_SLE, 243), 114 INTC_IRQ(RCAN1, 243),
138 115
139 /* SH7263-specific trash */ 116 /* SH7263-specific trash */
140#ifdef CONFIG_CPU_SUBTYPE_SH7263 117#ifdef CONFIG_CPU_SUBTYPE_SH7263
141 INTC_IRQ(ROMDEC_ISY, 218), INTC_IRQ(ROMDEC_IERR, 219), 118 INTC_IRQ(ROMDEC, 218), INTC_IRQ(ROMDEC, 219),
142 INTC_IRQ(ROMDEC_IARG, 220), INTC_IRQ(ROMDEC_ISEC, 221), 119 INTC_IRQ(ROMDEC, 220), INTC_IRQ(ROMDEC, 221),
143 INTC_IRQ(ROMDEC_IBUF, 222), INTC_IRQ(ROMDEC_IREADY, 223), 120 INTC_IRQ(ROMDEC, 222), INTC_IRQ(ROMDEC, 223),
144 121
145 INTC_IRQ(SDHI3, 228), INTC_IRQ(SDHI0, 229), INTC_IRQ(SDHI1, 230), 122 INTC_IRQ(SDHI, 228), INTC_IRQ(SDHI, 229),
123 INTC_IRQ(SDHI, 230),
146 124
147 INTC_IRQ(SRC_OVF, 244), INTC_IRQ(SRC_ODFI, 245), 125 INTC_IRQ(SRC, 244), INTC_IRQ(SRC, 245),
148 INTC_IRQ(SRC_IDEI, 246), 126 INTC_IRQ(SRC, 246),
149 127
150 INTC_IRQ(IEBI, 247), 128 INTC_IRQ(IEBI, 247),
151#endif 129#endif
@@ -154,50 +132,6 @@ static struct intc_vect vectors[] __initdata = {
154static struct intc_group groups[] __initdata = { 132static struct intc_group groups[] __initdata = {
155 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3, 133 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
156 PINT4, PINT5, PINT6, PINT7), 134 PINT4, PINT5, PINT6, PINT7),
157 INTC_GROUP(DMAC0, DMAC0_DEI, DMAC0_HEI),
158 INTC_GROUP(DMAC1, DMAC1_DEI, DMAC1_HEI),
159 INTC_GROUP(DMAC2, DMAC2_DEI, DMAC2_HEI),
160 INTC_GROUP(DMAC3, DMAC3_DEI, DMAC3_HEI),
161 INTC_GROUP(DMAC4, DMAC4_DEI, DMAC4_HEI),
162 INTC_GROUP(DMAC5, DMAC5_DEI, DMAC5_HEI),
163 INTC_GROUP(DMAC6, DMAC6_DEI, DMAC6_HEI),
164 INTC_GROUP(DMAC7, DMAC7_DEI, DMAC7_HEI),
165 INTC_GROUP(MTU0_ABCD, MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D),
166 INTC_GROUP(MTU0_VEF, MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F),
167 INTC_GROUP(MTU1_AB, MTU2_TGI1A, MTU2_TGI1B),
168 INTC_GROUP(MTU1_VU, MTU2_TCI1V, MTU2_TCI1U),
169 INTC_GROUP(MTU2_AB, MTU2_TGI2A, MTU2_TGI2B),
170 INTC_GROUP(MTU2_VU, MTU2_TCI2V, MTU2_TCI2U),
171 INTC_GROUP(MTU3_ABCD, MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D),
172 INTC_GROUP(MTU4_ABCD, MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D),
173 INTC_GROUP(IIC30, IIC30_STPI, IIC30_NAKI, IIC30_RXI, IIC30_TXI,
174 IIC30_TEI),
175 INTC_GROUP(IIC31, IIC31_STPI, IIC31_NAKI, IIC31_RXI, IIC31_TXI,
176 IIC31_TEI),
177 INTC_GROUP(IIC32, IIC32_STPI, IIC32_NAKI, IIC32_RXI, IIC32_TXI,
178 IIC32_TEI),
179 INTC_GROUP(IIC33, IIC33_STPI, IIC33_NAKI, IIC33_RXI, IIC33_TXI,
180 IIC33_TEI),
181 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
182 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
183 INTC_GROUP(SCIF2, SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI),
184 INTC_GROUP(SCIF3, SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI),
185 INTC_GROUP(SSU0, SSU0_SSERI, SSU0_SSRXI, SSU0_SSTXI),
186 INTC_GROUP(SSU1, SSU1_SSERI, SSU1_SSRXI, SSU1_SSTXI),
187 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I,
188 FLCTL_FLTREQ1I),
189 INTC_GROUP(RTC, RTC_ARM, RTC_PRD, RTC_CUP),
190 INTC_GROUP(RCAN0, RCAN0_ERS, RCAN0_OVR, RCAN0_RM0, RCAN0_RM1,
191 RCAN0_SLE),
192 INTC_GROUP(RCAN1, RCAN1_ERS, RCAN1_OVR, RCAN1_RM0, RCAN1_RM1,
193 RCAN1_SLE),
194
195#ifdef CONFIG_CPU_SUBTYPE_SH7263
196 INTC_GROUP(ROMDEC, ROMDEC_ISY, ROMDEC_IERR, ROMDEC_IARG,
197 ROMDEC_ISEC, ROMDEC_IBUF, ROMDEC_IREADY),
198 INTC_GROUP(SDHI, SDHI3, SDHI0, SDHI1),
199 INTC_GROUP(SRC, SRC_OVF, SRC_ODFI, SRC_IDEI),
200#endif
201}; 135};
202 136
203static struct intc_prio_reg prio_registers[] __initdata = { 137static struct intc_prio_reg prio_registers[] __initdata = {
@@ -242,22 +176,22 @@ static struct plat_sci_port sci_platform_data[] = {
242 .mapbase = 0xfffe8000, 176 .mapbase = 0xfffe8000,
243 .flags = UPF_BOOT_AUTOCONF, 177 .flags = UPF_BOOT_AUTOCONF,
244 .type = PORT_SCIF, 178 .type = PORT_SCIF,
245 .irqs = { 193, 194, 195, 192 }, 179 .irqs = { 192, 192, 192, 192 },
246 }, { 180 }, {
247 .mapbase = 0xfffe8800, 181 .mapbase = 0xfffe8800,
248 .flags = UPF_BOOT_AUTOCONF, 182 .flags = UPF_BOOT_AUTOCONF,
249 .type = PORT_SCIF, 183 .type = PORT_SCIF,
250 .irqs = { 197, 198, 199, 196 }, 184 .irqs = { 196, 196, 196, 196 },
251 }, { 185 }, {
252 .mapbase = 0xfffe9000, 186 .mapbase = 0xfffe9000,
253 .flags = UPF_BOOT_AUTOCONF, 187 .flags = UPF_BOOT_AUTOCONF,
254 .type = PORT_SCIF, 188 .type = PORT_SCIF,
255 .irqs = { 201, 202, 203, 200 }, 189 .irqs = { 200, 200, 200, 200 },
256 }, { 190 }, {
257 .mapbase = 0xfffe9800, 191 .mapbase = 0xfffe9800,
258 .flags = UPF_BOOT_AUTOCONF, 192 .flags = UPF_BOOT_AUTOCONF,
259 .type = PORT_SCIF, 193 .type = PORT_SCIF,
260 .irqs = { 205, 206, 207, 204 }, 194 .irqs = { 204, 204, 204, 204 },
261 }, { 195 }, {
262 .flags = 0, 196 .flags = 0,
263 } 197 }
@@ -278,17 +212,7 @@ static struct resource rtc_resources[] = {
278 .flags = IORESOURCE_IO, 212 .flags = IORESOURCE_IO,
279 }, 213 },
280 [1] = { 214 [1] = {
281 /* Period IRQ */ 215 /* Shared Period/Carry/Alarm IRQ */
282 .start = 232,
283 .flags = IORESOURCE_IRQ,
284 },
285 [2] = {
286 /* Carry IRQ */
287 .start = 233,
288 .flags = IORESOURCE_IRQ,
289 },
290 [3] = {
291 /* Alarm IRQ */
292 .start = 231, 216 .start = 231,
293 .flags = IORESOURCE_IRQ, 217 .flags = IORESOURCE_IRQ,
294 }, 218 },
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
index e6d4ec445dd8..c46a8355726d 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
@@ -2,6 +2,7 @@
2 * SH7206 Setup 2 * SH7206 Setup
3 * 3 *
4 * Copyright (C) 2006 Yoshinori Sato 4 * Copyright (C) 2006 Yoshinori Sato
5 * Copyright (C) 2009 Paul Mundt
5 * 6 *
6 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
@@ -19,34 +20,23 @@ enum {
19 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 20 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
20 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7, 21 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
21 ADC_ADI0, ADC_ADI1, 22 ADC_ADI0, ADC_ADI1,
22 DMAC0_DEI, DMAC0_HEI, DMAC1_DEI, DMAC1_HEI, 23
23 DMAC2_DEI, DMAC2_HEI, DMAC3_DEI, DMAC3_HEI, 24 DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7,
24 DMAC4_DEI, DMAC4_HEI, DMAC5_DEI, DMAC5_HEI, 25
25 DMAC6_DEI, DMAC6_HEI, DMAC7_DEI, DMAC7_HEI, 26 MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU,
27 MTU3_ABCD, MTU4_ABCD, MTU5, POE2_12, MTU3S_ABCD, MTU4S_ABCD, MTU5S,
28 IIC3,
29
26 CMT0, CMT1, BSC, WDT, 30 CMT0, CMT1, BSC, WDT,
27 MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D, 31
28 MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F, 32 MTU2_TCI3V, MTU2_TCI4V, MTU2S_TCI3V, MTU2S_TCI4V,
29 MTU2_TGI1A, MTU2_TGI1B, MTU2_TCI1V, MTU2_TCI1U, 33
30 MTU2_TGI2A, MTU2_TGI2B, MTU2_TCI2V, MTU2_TCI2U,
31 MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D, MTU2_TCI3V,
32 MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D, MTU2_TCI4V,
33 MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W,
34 POE2_OEI1, POE2_OEI2,
35 MTU2S_TGI3A, MTU2S_TGI3B, MTU2S_TGI3C, MTU2S_TGI3D, MTU2S_TCI3V,
36 MTU2S_TGI4A, MTU2S_TGI4B, MTU2S_TGI4C, MTU2S_TGI4D, MTU2S_TCI4V,
37 MTU2S_TGI5U, MTU2S_TGI5V, MTU2S_TGI5W,
38 POE2_OEI3, 34 POE2_OEI3,
39 IIC3_STPI, IIC3_NAKI, IIC3_RXI, IIC3_TXI, IIC3_TEI, 35
40 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI, 36 SCIF0, SCIF1, SCIF2, SCIF3,
41 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
42 SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI,
43 SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI,
44 37
45 /* interrupt groups */ 38 /* interrupt groups */
46 PINT, DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7, 39 PINT,
47 MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU,
48 MTU3_ABCD, MTU4_ABCD, MTU5, POE2_12, MTU3S_ABCD, MTU4S_ABCD, MTU5S,
49 IIC3, SCIF0, SCIF1, SCIF2, SCIF3,
50}; 40};
51 41
52static struct intc_vect vectors[] __initdata = { 42static struct intc_vect vectors[] __initdata = {
@@ -59,86 +49,58 @@ static struct intc_vect vectors[] __initdata = {
59 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85), 49 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
60 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87), 50 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87),
61 INTC_IRQ(ADC_ADI0, 92), INTC_IRQ(ADC_ADI1, 96), 51 INTC_IRQ(ADC_ADI0, 92), INTC_IRQ(ADC_ADI1, 96),
62 INTC_IRQ(DMAC0_DEI, 108), INTC_IRQ(DMAC0_HEI, 109), 52 INTC_IRQ(DMAC0, 108), INTC_IRQ(DMAC0, 109),
63 INTC_IRQ(DMAC1_DEI, 112), INTC_IRQ(DMAC1_HEI, 113), 53 INTC_IRQ(DMAC1, 112), INTC_IRQ(DMAC1, 113),
64 INTC_IRQ(DMAC2_DEI, 116), INTC_IRQ(DMAC2_HEI, 117), 54 INTC_IRQ(DMAC2, 116), INTC_IRQ(DMAC2, 117),
65 INTC_IRQ(DMAC3_DEI, 120), INTC_IRQ(DMAC3_HEI, 121), 55 INTC_IRQ(DMAC3, 120), INTC_IRQ(DMAC3, 121),
66 INTC_IRQ(DMAC4_DEI, 124), INTC_IRQ(DMAC4_HEI, 125), 56 INTC_IRQ(DMAC4, 124), INTC_IRQ(DMAC4, 125),
67 INTC_IRQ(DMAC5_DEI, 128), INTC_IRQ(DMAC5_HEI, 129), 57 INTC_IRQ(DMAC5, 128), INTC_IRQ(DMAC5, 129),
68 INTC_IRQ(DMAC6_DEI, 132), INTC_IRQ(DMAC6_HEI, 133), 58 INTC_IRQ(DMAC6, 132), INTC_IRQ(DMAC6, 133),
69 INTC_IRQ(DMAC7_DEI, 136), INTC_IRQ(DMAC7_HEI, 137), 59 INTC_IRQ(DMAC7, 136), INTC_IRQ(DMAC7, 137),
70 INTC_IRQ(CMT0, 140), INTC_IRQ(CMT1, 144), 60 INTC_IRQ(CMT0, 140), INTC_IRQ(CMT1, 144),
71 INTC_IRQ(BSC, 148), INTC_IRQ(WDT, 152), 61 INTC_IRQ(BSC, 148), INTC_IRQ(WDT, 152),
72 INTC_IRQ(MTU2_TGI0A, 156), INTC_IRQ(MTU2_TGI0B, 157), 62 INTC_IRQ(MTU0_ABCD, 156), INTC_IRQ(MTU0_ABCD, 157),
73 INTC_IRQ(MTU2_TGI0C, 158), INTC_IRQ(MTU2_TGI0D, 159), 63 INTC_IRQ(MTU0_ABCD, 158), INTC_IRQ(MTU0_ABCD, 159),
74 INTC_IRQ(MTU2_TCI0V, 160), 64 INTC_IRQ(MTU0_VEF, 160), INTC_IRQ(MTU0_VEF, 161),
75 INTC_IRQ(MTU2_TGI0E, 161), INTC_IRQ(MTU2_TGI0F, 162), 65 INTC_IRQ(MTU0_VEF, 162),
76 INTC_IRQ(MTU2_TGI1A, 164), INTC_IRQ(MTU2_TGI1B, 165), 66 INTC_IRQ(MTU1_AB, 164), INTC_IRQ(MTU1_AB, 165),
77 INTC_IRQ(MTU2_TCI1V, 168), INTC_IRQ(MTU2_TCI1U, 169), 67 INTC_IRQ(MTU1_VU, 168), INTC_IRQ(MTU1_VU, 169),
78 INTC_IRQ(MTU2_TGI2A, 172), INTC_IRQ(MTU2_TGI2B, 173), 68 INTC_IRQ(MTU2_AB, 172), INTC_IRQ(MTU2_AB, 173),
79 INTC_IRQ(MTU2_TCI2V, 176), INTC_IRQ(MTU2_TCI2U, 177), 69 INTC_IRQ(MTU2_VU, 176), INTC_IRQ(MTU2_VU, 177),
80 INTC_IRQ(MTU2_TGI3A, 180), INTC_IRQ(MTU2_TGI3B, 181), 70 INTC_IRQ(MTU3_ABCD, 180), INTC_IRQ(MTU3_ABCD, 181),
81 INTC_IRQ(MTU2_TGI3C, 182), INTC_IRQ(MTU2_TGI3D, 183), 71 INTC_IRQ(MTU3_ABCD, 182), INTC_IRQ(MTU3_ABCD, 183),
82 INTC_IRQ(MTU2_TCI3V, 184), 72 INTC_IRQ(MTU2_TCI3V, 184),
83 INTC_IRQ(MTU2_TGI4A, 188), INTC_IRQ(MTU2_TGI4B, 189), 73 INTC_IRQ(MTU4_ABCD, 188), INTC_IRQ(MTU4_ABCD, 189),
84 INTC_IRQ(MTU2_TGI4C, 190), INTC_IRQ(MTU2_TGI4D, 191), 74 INTC_IRQ(MTU4_ABCD, 190), INTC_IRQ(MTU4_ABCD, 191),
85 INTC_IRQ(MTU2_TCI4V, 192), 75 INTC_IRQ(MTU2_TCI4V, 192),
86 INTC_IRQ(MTU2_TGI5U, 196), INTC_IRQ(MTU2_TGI5V, 197), 76 INTC_IRQ(MTU5, 196), INTC_IRQ(MTU5, 197),
87 INTC_IRQ(MTU2_TGI5W, 198), 77 INTC_IRQ(MTU5, 198),
88 INTC_IRQ(POE2_OEI1, 200), INTC_IRQ(POE2_OEI2, 201), 78 INTC_IRQ(POE2_12, 200), INTC_IRQ(POE2_12, 201),
89 INTC_IRQ(MTU2S_TGI3A, 204), INTC_IRQ(MTU2S_TGI3B, 205), 79 INTC_IRQ(MTU3S_ABCD, 204), INTC_IRQ(MTU3S_ABCD, 205),
90 INTC_IRQ(MTU2S_TGI3C, 206), INTC_IRQ(MTU2S_TGI3D, 207), 80 INTC_IRQ(MTU3S_ABCD, 206), INTC_IRQ(MTU3S_ABCD, 207),
91 INTC_IRQ(MTU2S_TCI3V, 208), 81 INTC_IRQ(MTU2S_TCI3V, 208),
92 INTC_IRQ(MTU2S_TGI4A, 212), INTC_IRQ(MTU2S_TGI4B, 213), 82 INTC_IRQ(MTU4S_ABCD, 212), INTC_IRQ(MTU4S_ABCD, 213),
93 INTC_IRQ(MTU2S_TGI4C, 214), INTC_IRQ(MTU2S_TGI4D, 215), 83 INTC_IRQ(MTU4S_ABCD, 214), INTC_IRQ(MTU4S_ABCD, 215),
94 INTC_IRQ(MTU2S_TCI4V, 216), 84 INTC_IRQ(MTU2S_TCI4V, 216),
95 INTC_IRQ(MTU2S_TGI5U, 220), INTC_IRQ(MTU2S_TGI5V, 221), 85 INTC_IRQ(MTU5S, 220), INTC_IRQ(MTU5S, 221),
96 INTC_IRQ(MTU2S_TGI5W, 222), 86 INTC_IRQ(MTU5S, 222),
97 INTC_IRQ(POE2_OEI3, 224), 87 INTC_IRQ(POE2_OEI3, 224),
98 INTC_IRQ(IIC3_STPI, 228), INTC_IRQ(IIC3_NAKI, 229), 88 INTC_IRQ(IIC3, 228), INTC_IRQ(IIC3, 229),
99 INTC_IRQ(IIC3_RXI, 230), INTC_IRQ(IIC3_TXI, 231), 89 INTC_IRQ(IIC3, 230), INTC_IRQ(IIC3, 231),
100 INTC_IRQ(IIC3_TEI, 232), 90 INTC_IRQ(IIC3, 232),
101 INTC_IRQ(SCIF0_BRI, 240), INTC_IRQ(SCIF0_ERI, 241), 91 INTC_IRQ(SCIF0, 240), INTC_IRQ(SCIF0, 241),
102 INTC_IRQ(SCIF0_RXI, 242), INTC_IRQ(SCIF0_TXI, 243), 92 INTC_IRQ(SCIF0, 242), INTC_IRQ(SCIF0, 243),
103 INTC_IRQ(SCIF1_BRI, 244), INTC_IRQ(SCIF1_ERI, 245), 93 INTC_IRQ(SCIF1, 244), INTC_IRQ(SCIF1, 245),
104 INTC_IRQ(SCIF1_RXI, 246), INTC_IRQ(SCIF1_TXI, 247), 94 INTC_IRQ(SCIF1, 246), INTC_IRQ(SCIF1, 247),
105 INTC_IRQ(SCIF2_BRI, 248), INTC_IRQ(SCIF2_ERI, 249), 95 INTC_IRQ(SCIF2, 248), INTC_IRQ(SCIF2, 249),
106 INTC_IRQ(SCIF2_RXI, 250), INTC_IRQ(SCIF2_TXI, 251), 96 INTC_IRQ(SCIF2, 250), INTC_IRQ(SCIF2, 251),
107 INTC_IRQ(SCIF3_BRI, 252), INTC_IRQ(SCIF3_ERI, 253), 97 INTC_IRQ(SCIF3, 252), INTC_IRQ(SCIF3, 253),
108 INTC_IRQ(SCIF3_RXI, 254), INTC_IRQ(SCIF3_TXI, 255), 98 INTC_IRQ(SCIF3, 254), INTC_IRQ(SCIF3, 255),
109}; 99};
110 100
111static struct intc_group groups[] __initdata = { 101static struct intc_group groups[] __initdata = {
112 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3, 102 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
113 PINT4, PINT5, PINT6, PINT7), 103 PINT4, PINT5, PINT6, PINT7),
114 INTC_GROUP(DMAC0, DMAC0_DEI, DMAC0_HEI),
115 INTC_GROUP(DMAC1, DMAC1_DEI, DMAC1_HEI),
116 INTC_GROUP(DMAC2, DMAC2_DEI, DMAC2_HEI),
117 INTC_GROUP(DMAC3, DMAC3_DEI, DMAC3_HEI),
118 INTC_GROUP(DMAC4, DMAC4_DEI, DMAC4_HEI),
119 INTC_GROUP(DMAC5, DMAC5_DEI, DMAC5_HEI),
120 INTC_GROUP(DMAC6, DMAC6_DEI, DMAC6_HEI),
121 INTC_GROUP(DMAC7, DMAC7_DEI, DMAC7_HEI),
122 INTC_GROUP(MTU0_ABCD, MTU2_TGI0A, MTU2_TGI0B, MTU2_TGI0C, MTU2_TGI0D),
123 INTC_GROUP(MTU0_VEF, MTU2_TCI0V, MTU2_TGI0E, MTU2_TGI0F),
124 INTC_GROUP(MTU1_AB, MTU2_TGI1A, MTU2_TGI1B),
125 INTC_GROUP(MTU1_VU, MTU2_TCI1V, MTU2_TCI1U),
126 INTC_GROUP(MTU2_AB, MTU2_TGI2A, MTU2_TGI2B),
127 INTC_GROUP(MTU2_VU, MTU2_TCI2V, MTU2_TCI2U),
128 INTC_GROUP(MTU3_ABCD, MTU2_TGI3A, MTU2_TGI3B, MTU2_TGI3C, MTU2_TGI3D),
129 INTC_GROUP(MTU4_ABCD, MTU2_TGI4A, MTU2_TGI4B, MTU2_TGI4C, MTU2_TGI4D),
130 INTC_GROUP(MTU5, MTU2_TGI5U, MTU2_TGI5V, MTU2_TGI5W),
131 INTC_GROUP(POE2_12, POE2_OEI1, POE2_OEI2),
132 INTC_GROUP(MTU3S_ABCD, MTU2S_TGI3A, MTU2S_TGI3B,
133 MTU2S_TGI3C, MTU2S_TGI3D),
134 INTC_GROUP(MTU4S_ABCD, MTU2S_TGI4A, MTU2S_TGI4B,
135 MTU2S_TGI4C, MTU2S_TGI4D),
136 INTC_GROUP(MTU5S, MTU2S_TGI5U, MTU2S_TGI5V, MTU2S_TGI5W),
137 INTC_GROUP(IIC3, IIC3_STPI, IIC3_NAKI, IIC3_RXI, IIC3_TXI, IIC3_TEI),
138 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
139 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
140 INTC_GROUP(SCIF2, SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI),
141 INTC_GROUP(SCIF3, SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI),
142}; 104};
143 105
144static struct intc_prio_reg prio_registers[] __initdata = { 106static struct intc_prio_reg prio_registers[] __initdata = {
@@ -174,22 +136,22 @@ static struct plat_sci_port sci_platform_data[] = {
174 .mapbase = 0xfffe8000, 136 .mapbase = 0xfffe8000,
175 .flags = UPF_BOOT_AUTOCONF, 137 .flags = UPF_BOOT_AUTOCONF,
176 .type = PORT_SCIF, 138 .type = PORT_SCIF,
177 .irqs = { 241, 242, 243, 240 }, 139 .irqs = { 240, 240, 240, 240 },
178 }, { 140 }, {
179 .mapbase = 0xfffe8800, 141 .mapbase = 0xfffe8800,
180 .flags = UPF_BOOT_AUTOCONF, 142 .flags = UPF_BOOT_AUTOCONF,
181 .type = PORT_SCIF, 143 .type = PORT_SCIF,
182 .irqs = { 245, 246, 247, 244 }, 144 .irqs = { 244, 244, 244, 244 },
183 }, { 145 }, {
184 .mapbase = 0xfffe9000, 146 .mapbase = 0xfffe9000,
185 .flags = UPF_BOOT_AUTOCONF, 147 .flags = UPF_BOOT_AUTOCONF,
186 .type = PORT_SCIF, 148 .type = PORT_SCIF,
187 .irqs = { 249, 250, 251, 248 }, 149 .irqs = { 248, 248, 248, 248 },
188 }, { 150 }, {
189 .mapbase = 0xfffe9800, 151 .mapbase = 0xfffe9800,
190 .flags = UPF_BOOT_AUTOCONF, 152 .flags = UPF_BOOT_AUTOCONF,
191 .type = PORT_SCIF, 153 .type = PORT_SCIF,
192 .irqs = { 253, 254, 255, 252 }, 154 .irqs = { 252, 252, 252, 252 },
193 }, { 155 }, {
194 .flags = 0, 156 .flags = 0,
195 } 157 }
diff --git a/arch/sh/kernel/cpu/sh3/Makefile b/arch/sh/kernel/cpu/sh3/Makefile
index e07c69e16d9b..ecab274141a8 100644
--- a/arch/sh/kernel/cpu/sh3/Makefile
+++ b/arch/sh/kernel/cpu/sh3/Makefile
@@ -4,6 +4,8 @@
4 4
5obj-y := ex.o probe.o entry.o setup-sh3.o 5obj-y := ex.o probe.o entry.o setup-sh3.o
6 6
7obj-$(CONFIG_HIBERNATION) += swsusp.o
8
7# CPU subtype setup 9# CPU subtype setup
8obj-$(CONFIG_CPU_SUBTYPE_SH7705) += setup-sh7705.o 10obj-$(CONFIG_CPU_SUBTYPE_SH7705) += setup-sh7705.o
9obj-$(CONFIG_CPU_SUBTYPE_SH7706) += setup-sh770x.o 11obj-$(CONFIG_CPU_SUBTYPE_SH7706) += setup-sh770x.o
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index b4106d0c68ec..55da0ff9848d 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -16,6 +16,7 @@
16#include <asm/unistd.h> 16#include <asm/unistd.h>
17#include <cpu/mmu_context.h> 17#include <cpu/mmu_context.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/cache.h>
19 20
20! NOTE: 21! NOTE:
21! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address 22! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address
@@ -187,44 +188,35 @@ call_dae:
187#if defined(CONFIG_SH_STANDARD_BIOS) 188#if defined(CONFIG_SH_STANDARD_BIOS)
188 /* Unwind the stack and jmp to the debug entry */ 189 /* Unwind the stack and jmp to the debug entry */
189ENTRY(sh_bios_handler) 190ENTRY(sh_bios_handler)
190 mov.l @r15+, r0 191 mov.l 1f, r8
191 mov.l @r15+, r1 192 bsr restore_regs
192 mov.l @r15+, r2 193 nop
193 mov.l @r15+, r3 194
194 mov.l @r15+, r4 195 lds k2, pr ! restore pr
195 mov.l @r15+, r5 196 mov k4, r15
196 mov.l @r15+, r6
197 mov.l @r15+, r7
198 stc sr, r8
199 mov.l 1f, r9 ! BL =1, RB=1, IMASK=0x0F
200 or r9, r8
201 ldc r8, sr ! here, change the register bank
202 mov.l @r15+, r8
203 mov.l @r15+, r9
204 mov.l @r15+, r10
205 mov.l @r15+, r11
206 mov.l @r15+, r12
207 mov.l @r15+, r13
208 mov.l @r15+, r14
209 mov.l @r15+, k0
210 ldc.l @r15+, spc
211 lds.l @r15+, pr
212 mov.l @r15+, k1
213 ldc.l @r15+, gbr
214 lds.l @r15+, mach
215 lds.l @r15+, macl
216 mov k0, r15
217 ! 197 !
218 mov.l 2f, k0 198 mov.l 2f, k0
219 mov.l @k0, k0 199 mov.l @k0, k0
220 jmp @k0 200 jmp @k0
221 ldc k1, ssr 201 ldc k3, ssr
222 .align 2 202 .align 2
2231: .long 0x300000f0 2031: .long 0x300000f0
2242: .long gdb_vbr_vector 2042: .long gdb_vbr_vector
225#endif /* CONFIG_SH_STANDARD_BIOS */ 205#endif /* CONFIG_SH_STANDARD_BIOS */
226 206
227restore_all: 207! restore_regs()
208! - restore r0, r1, r2, r3, r4, r5, r6, r7 from the stack
209! - switch bank
210! - restore r8, r9, r10, r11, r12, r13, r14, r15 from the stack
211! - restore spc, pr*, ssr, gbr, mach, macl, skip default tra
212! k2 returns original pr
213! k3 returns original sr
214! k4 returns original stack pointer
215! r8 passes SR bitmask, overwritten with restored data on return
216! r9 trashed
217! BL=0 on entry, on exit BL=1 (depending on r8).
218
219ENTRY(restore_regs)
228 mov.l @r15+, r0 220 mov.l @r15+, r0
229 mov.l @r15+, r1 221 mov.l @r15+, r1
230 mov.l @r15+, r2 222 mov.l @r15+, r2
@@ -234,10 +226,9 @@ restore_all:
234 mov.l @r15+, r6 226 mov.l @r15+, r6
235 mov.l @r15+, r7 227 mov.l @r15+, r7
236 ! 228 !
237 stc sr, r8 229 stc sr, r9
238 mov.l 7f, r9 230 or r8, r9
239 or r9, r8 ! BL =1, RB=1 231 ldc r9, sr
240 ldc r8, sr ! here, change the register bank
241 ! 232 !
242 mov.l @r15+, r8 233 mov.l @r15+, r8
243 mov.l @r15+, r9 234 mov.l @r15+, r9
@@ -248,12 +239,20 @@ restore_all:
248 mov.l @r15+, r14 239 mov.l @r15+, r14
249 mov.l @r15+, k4 ! original stack pointer 240 mov.l @r15+, k4 ! original stack pointer
250 ldc.l @r15+, spc 241 ldc.l @r15+, spc
251 lds.l @r15+, pr 242 mov.l @r15+, k2 ! original PR
252 mov.l @r15+, k3 ! original SR 243 mov.l @r15+, k3 ! original SR
253 ldc.l @r15+, gbr 244 ldc.l @r15+, gbr
254 lds.l @r15+, mach 245 lds.l @r15+, mach
255 lds.l @r15+, macl 246 lds.l @r15+, macl
256 add #4, r15 ! Skip syscall number 247 rts
248 add #4, r15 ! Skip syscall number
249
250restore_all:
251 mov.l 7f, r8
252 bsr restore_regs
253 nop
254
255 lds k2, pr ! restore pr
257 ! 256 !
258#ifdef CONFIG_SH_DSP 257#ifdef CONFIG_SH_DSP
259 mov.l @r15+, k0 ! DSP mode marker 258 mov.l @r15+, k0 ! DSP mode marker
@@ -294,7 +293,7 @@ skip_restore:
294 mov #0xf0, k1 293 mov #0xf0, k1
295 extu.b k1, k1 294 extu.b k1, k1
296 not k1, k1 295 not k1, k1
297 and k1, k2 ! Mask orignal SR value 296 and k1, k2 ! Mask original SR value
298 ! 297 !
299 mov k3, k0 ! Calculate IMASK-bits 298 mov k3, k0 ! Calculate IMASK-bits
300 shlr2 k0 299 shlr2 k0
@@ -313,7 +312,6 @@ skip_restore:
313 mov #0, k1 312 mov #0, k1
314 mov.b k1, @k0 313 mov.b k1, @k0
315#endif 314#endif
316 mov.l @r15+, k2 ! restore EXPEVT
317 mov k4, r15 315 mov k4, r15
318 rte 316 rte
319 nop 317 nop
@@ -336,81 +334,55 @@ skip_restore:
336ENTRY(vbr_base) 334ENTRY(vbr_base)
337 .long 0 335 .long 0
338! 336!
337! 0x100: General exception vector
338!
339 .balign 256,0,256 339 .balign 256,0,256
340general_exception: 340general_exception:
341 mov.l 1f, k2 341#ifndef CONFIG_CPU_SUBTYPE_SHX3
342 mov.l 2f, k3 342 bra handle_exception
343#ifdef CONFIG_CPU_SUBTYPE_SHX3 343 sts pr, k3 ! save original pr value in k3
344 mov.l @k2, k2 344#else
345 mov.l 1f, k4
346 mov.l @k4, k4
345 347
346 ! Is EXPEVT larger than 0x800? 348 ! Is EXPEVT larger than 0x800?
347 mov #0x8, k0 349 mov #0x8, k0
348 shll8 k0 350 shll8 k0
349 cmp/hs k0, k2 351 cmp/hs k0, k4
350 bf 0f 352 bf 0f
351 353
352 ! then add 0x580 (k2 is 0xd80 or 0xda0) 354 ! then add 0x580 (k2 is 0xd80 or 0xda0)
353 mov #0x58, k0 355 mov #0x58, k0
354 shll2 k0 356 shll2 k0
355 shll2 k0 357 shll2 k0
356 add k0, k2 358 add k0, k4
3570: 3590:
358 bra handle_exception 360 ! Setup stack and save DSP context (k0 contains original r15 on return)
361 bsr prepare_stack_save_dsp
359 nop 362 nop
360#else
361 bra handle_exception
362 mov.l @k2, k2
363#endif
364 .align 2
3651: .long EXPEVT
3662: .long ret_from_exception
367!
368!
369 363
370 .balign 1024,0,1024 364 ! Save registers / Switch to bank 0
371tlb_miss: 365 mov k4, k2 ! keep vector in k2
372 mov.l 1f, k2 366 mov.l 1f, k4 ! SR bits to clear in k4
373 mov.l 4f, k3 367 bsr save_regs ! needs original pr value in k3
374 bra handle_exception 368 nop
375 mov.l @k2, k2 369
376! 370 bra handle_exception_special
377 .balign 512,0,512
378interrupt:
379 mov.l 3f, k3
380#if defined(CONFIG_KGDB)
381 mov.l 2f, k2
382 ! Debounce (filter nested NMI)
383 mov.l @k2, k0
384 mov.l 5f, k1
385 cmp/eq k1, k0
386 bf 0f
387 mov.l 6f, k1
388 tas.b @k1
389 bt 0f
390 rte
391 nop 371 nop
392 .align 2
3932: .long INTEVT
3945: .long NMI_VEC
3956: .long in_nmi
3960:
397#endif /* defined(CONFIG_KGDB) */
398 bra handle_exception
399 mov #-1, k2 ! interrupt exception marker
400 372
401 .align 2 373 .align 2
4021: .long EXPEVT 3741: .long EXPEVT
4033: .long ret_from_irq 375#endif
4044: .long ret_from_exception
405 376
406! 377! prepare_stack_save_dsp()
407! 378! - roll back gRB
408 .align 2 379! - switch to kernel stack
409ENTRY(handle_exception) 380! - save DSP
410 ! Using k0, k1 for scratch registers (r0_bank1, r1_bank), 381! k0 returns original sp (after roll back)
411 ! save all registers onto stack. 382! k1 trashed
412 ! 383! k2 trashed
413 384
385prepare_stack_save_dsp:
414#ifdef CONFIG_GUSA 386#ifdef CONFIG_GUSA
415 ! Check for roll back gRB (User and Kernel) 387 ! Check for roll back gRB (User and Kernel)
416 mov r15, k0 388 mov r15, k0
@@ -430,7 +402,7 @@ ENTRY(handle_exception)
4302: mov k1, r15 ! SP = r1 4022: mov k1, r15 ! SP = r1
4311: 4031:
432#endif 404#endif
433 405 ! Switch to kernel stack if needed
434 stc ssr, k0 ! Is it from kernel space? 406 stc ssr, k0 ! Is it from kernel space?
435 shll k0 ! Check MD bit (bit30) by shifting it into... 407 shll k0 ! Check MD bit (bit30) by shifting it into...
436 shll k0 ! ...the T bit 408 shll k0 ! ...the T bit
@@ -443,18 +415,17 @@ ENTRY(handle_exception)
443 add current, k1 415 add current, k1
444 mov k1, r15 ! change to kernel stack 416 mov k1, r15 ! change to kernel stack
445 ! 417 !
4461: mov.l 2f, k1 4181:
447 !
448#ifdef CONFIG_SH_DSP 419#ifdef CONFIG_SH_DSP
449 mov.l r2, @-r15 ! Save r2, we need another reg 420 ! Save DSP context if needed
450 stc sr, k4 421 stc sr, k1
451 mov.l 1f, r2 422 mov #0x10, k2
452 tst r2, k4 ! Check if in DSP mode 423 shll8 k2 ! DSP=1 (0x00001000)
453 mov.l @r15+, r2 ! Restore r2 now 424 tst k2, k1 ! Check if in DSP mode (passed in k2)
454 bt/s skip_save 425 bt/s skip_save
455 mov #0, k4 ! Set marker for no stack frame 426 mov #0, k1 ! Set marker for no stack frame
456 427
457 mov r2, k4 ! Backup r2 (in k4) for later 428 mov k2, k1 ! Save has-frame marker
458 429
459 ! Save DSP registers on stack 430 ! Save DSP registers on stack
460 stc.l mod, @-r15 431 stc.l mod, @-r15
@@ -473,35 +444,74 @@ ENTRY(handle_exception)
473 ! as we're not at all interested in supporting ancient toolchains at 444 ! as we're not at all interested in supporting ancient toolchains at
474 ! this point. -- PFM. 445 ! this point. -- PFM.
475 446
476 mov r15, r2 447 mov r15, k2
477 .word 0xf653 ! movs.l a1, @-r2 448 .word 0xf653 ! movs.l a1, @-r2
478 .word 0xf6f3 ! movs.l a0g, @-r2 449 .word 0xf6f3 ! movs.l a0g, @-r2
479 .word 0xf6d3 ! movs.l a1g, @-r2 450 .word 0xf6d3 ! movs.l a1g, @-r2
480 .word 0xf6c3 ! movs.l m0, @-r2 451 .word 0xf6c3 ! movs.l m0, @-r2
481 .word 0xf6e3 ! movs.l m1, @-r2 452 .word 0xf6e3 ! movs.l m1, @-r2
482 mov r2, r15 453 mov k2, r15
483 454
484 mov k4, r2 ! Restore r2
485 mov.l 1f, k4 ! Force DSP stack frame
486skip_save: 455skip_save:
487 mov.l k4, @-r15 ! Push DSP mode marker onto stack 456 mov.l k1, @-r15 ! Push DSP mode marker onto stack
488#endif 457#endif
489 ! Save the user registers on the stack. 458 rts
490 mov.l k2, @-r15 ! EXPEVT 459 nop
491 460!
492 mov #-1, k4 461! 0x400: Instruction and Data TLB miss exception vector
493 mov.l k4, @-r15 ! set TRA (default: -1) 462!
494 ! 463 .balign 1024,0,1024
464tlb_miss:
465 sts pr, k3 ! save original pr value in k3
466
467handle_exception:
468 mova exception_data, k0
469
470 ! Setup stack and save DSP context (k0 contains original r15 on return)
471 bsr prepare_stack_save_dsp
472 PREF(k0)
473
474 ! Save registers / Switch to bank 0
475 mov.l 5f, k2 ! vector register address
476 mov.l 1f, k4 ! SR bits to clear in k4
477 bsr save_regs ! needs original pr value in k3
478 mov.l @k2, k2 ! read out vector and keep in k2
479
480handle_exception_special:
481 ! Setup return address and jump to exception handler
482 mov.l 7f, r9 ! fetch return address
483 stc r2_bank, r0 ! k2 (vector)
484 mov.l 6f, r10
485 shlr2 r0
486 shlr r0
487 mov.l @(r0, r10), r10
488 jmp @r10
489 lds r9, pr ! put return address in pr
490
491 .align L1_CACHE_SHIFT
492
493! save_regs()
494! - save default tra, macl, mach, gbr, ssr, pr* and spc on the stack
495! - save r15*, r14, r13, r12, r11, r10, r9, r8 on the stack
496! - switch bank
497! - save r7, r6, r5, r4, r3, r2, r1, r0 on the stack
498! k0 contains original stack pointer*
499! k1 trashed
500! k3 passes original pr*
501! k4 passes SR bitmask
502! BL=1 on entry, on exit BL=0.
503
504ENTRY(save_regs)
505 mov #-1, r1
506 mov.l k1, @-r15 ! set TRA (default: -1)
495 sts.l macl, @-r15 507 sts.l macl, @-r15
496 sts.l mach, @-r15 508 sts.l mach, @-r15
497 stc.l gbr, @-r15 509 stc.l gbr, @-r15
498 stc.l ssr, @-r15 510 stc.l ssr, @-r15
499 sts.l pr, @-r15 511 mov.l k3, @-r15 ! original pr in k3
500 stc.l spc, @-r15 512 stc.l spc, @-r15
501 ! 513
502 lds k3, pr ! Set the return address to pr 514 mov.l k0, @-r15 ! original stack pointer in k0
503 !
504 mov.l k0, @-r15 ! save orignal stack
505 mov.l r14, @-r15 515 mov.l r14, @-r15
506 mov.l r13, @-r15 516 mov.l r13, @-r15
507 mov.l r12, @-r15 517 mov.l r12, @-r15
@@ -509,13 +519,23 @@ skip_save:
509 mov.l r10, @-r15 519 mov.l r10, @-r15
510 mov.l r9, @-r15 520 mov.l r9, @-r15
511 mov.l r8, @-r15 521 mov.l r8, @-r15
512 ! 522
513 stc sr, r8 ! Back to normal register bank, and 523 mov.l 0f, k3 ! SR bits to set in k3
514 or k1, r8 ! Block all interrupts 524
515 mov.l 3f, k1 525 ! fall-through
516 and k1, r8 ! ... 526
517 ldc r8, sr ! ...changed here. 527! save_low_regs()
518 ! 528! - modify SR for bank switch
529! - save r7, r6, r5, r4, r3, r2, r1, r0 on the stack
530! k3 passes bits to set in SR
531! k4 passes bits to clear in SR
532
533ENTRY(save_low_regs)
534 stc sr, r8
535 or k3, r8
536 and k4, r8
537 ldc r8, sr
538
519 mov.l r7, @-r15 539 mov.l r7, @-r15
520 mov.l r6, @-r15 540 mov.l r6, @-r15
521 mov.l r5, @-r15 541 mov.l r5, @-r15
@@ -523,52 +543,63 @@ skip_save:
523 mov.l r3, @-r15 543 mov.l r3, @-r15
524 mov.l r2, @-r15 544 mov.l r2, @-r15
525 mov.l r1, @-r15 545 mov.l r1, @-r15
526 mov.l r0, @-r15
527
528 /*
529 * This gets a bit tricky.. in the INTEVT case we don't want to use
530 * the VBR offset as a destination in the jump call table, since all
531 * of the destinations are the same. In this case, (interrupt) sets
532 * a marker in r2 (now r2_bank since SR.RB changed), which we check
533 * to determine the exception type. For all other exceptions, we
534 * forcibly read EXPEVT from memory and fix up the jump address, in
535 * the interrupt exception case we jump to do_IRQ() and defer the
536 * INTEVT read until there. As a bonus, we can also clean up the SR.RB
537 * checks that do_IRQ() was doing..
538 */
539 stc r2_bank, r8
540 cmp/pz r8
541 bf interrupt_exception
542 shlr2 r8
543 shlr r8
544 mov.l 4f, r9
545 add r8, r9
546 mov.l @r9, r9
547 jmp @r9
548 nop
549 rts 546 rts
550 nop 547 mov.l r0, @-r15
551 548
549!
550! 0x600: Interrupt / NMI vector
551!
552 .balign 512,0,512
553ENTRY(handle_interrupt)
554#if defined(CONFIG_KGDB)
555 mov.l 2f, k2
556 ! Debounce (filter nested NMI)
557 mov.l @k2, k0
558 mov.l 9f, k1
559 cmp/eq k1, k0
560 bf 11f
561 mov.l 10f, k1
562 tas.b @k1
563 bt 11f
564 rte
565 nop
552 .align 2 566 .align 2
5531: .long 0x00001000 ! DSP=1 5679: .long NMI_VEC
5542: .long 0x000080f0 ! FD=1, IMASK=15 56810: .long in_nmi
5553: .long 0xcfffffff ! RB=0, BL=0 56911:
5564: .long exception_handling_table 570#endif /* defined(CONFIG_KGDB) */
571 sts pr, k3 ! save original pr value in k3
572 mova exception_data, k0
557 573
558interrupt_exception: 574 ! Setup stack and save DSP context (k0 contains original r15 on return)
559 mov.l 1f, r9 575 bsr prepare_stack_save_dsp
576 PREF(k0)
577
578 ! Save registers / Switch to bank 0
579 mov.l 1f, k4 ! SR bits to clear in k4
580 bsr save_regs ! needs original pr value in k3
581 mov #-1, k2 ! default vector kept in k2
582
583 ! Setup return address and jump to do_IRQ
584 mov.l 4f, r9 ! fetch return address
585 lds r9, pr ! put return address in pr
560 mov.l 2f, r4 586 mov.l 2f, r4
561 mov.l @r4, r4 587 mov.l 3f, r9
588 mov.l @r4, r4 ! pass INTEVT vector as arg0
562 jmp @r9 589 jmp @r9
563 mov r15, r5 590 mov r15, r5 ! pass saved registers as arg1
564 rts
565 nop
566
567 .align 2
5681: .long do_IRQ
5692: .long INTEVT
570 591
571 .align 2
572ENTRY(exception_none) 592ENTRY(exception_none)
573 rts 593 rts
574 nop 594 nop
595
596 .align L1_CACHE_SHIFT
597exception_data:
5980: .long 0x000080f0 ! FD=1, IMASK=15
5991: .long 0xcfffffff ! RB=0, BL=0
6002: .long INTEVT
6013: .long do_IRQ
6024: .long ret_from_irq
6035: .long EXPEVT
6046: .long exception_handling_table
6057: .long ret_from_exception
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
index 6468ae86b944..63b67badd67e 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SH7705 Setup 2 * SH7705 Setup
3 * 3 *
4 * Copyright (C) 2006, 2007 Paul Mundt 4 * Copyright (C) 2006 - 2009 Paul Mundt
5 * Copyright (C) 2007 Nobuhiro Iwamatsu 5 * Copyright (C) 2007 Nobuhiro Iwamatsu
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
@@ -21,51 +21,36 @@ enum {
21 /* interrupt sources */ 21 /* interrupt sources */
22 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, 22 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5,
23 PINT07, PINT815, 23 PINT07, PINT815,
24 DMAC_DEI0, DMAC_DEI1, DMAC_DEI2, DMAC_DEI3, 24
25 SCIF0_ERI, SCIF0_RXI, SCIF0_TXI, 25 DMAC, SCIF0, SCIF2, ADC_ADI, USB,
26 SCIF2_ERI, SCIF2_RXI, SCIF2_TXI, 26
27 ADC_ADI,
28 USB_USI0, USB_USI1,
29 TPU0, TPU1, TPU2, TPU3, 27 TPU0, TPU1, TPU2, TPU3,
30 TMU0, TMU1, TMU2_TUNI, TMU2_TICPI, 28 TMU0, TMU1, TMU2,
31 RTC_ATI, RTC_PRI, RTC_CUI,
32 WDT,
33 REF_RCMI,
34 29
35 /* interrupt groups */ 30 RTC, WDT, REF_RCMI,
36 RTC, TMU2, DMAC, USB, SCIF2, SCIF0,
37}; 31};
38 32
39static struct intc_vect vectors[] __initdata = { 33static struct intc_vect vectors[] __initdata = {
40 /* IRQ0->5 are handled in setup-sh3.c */ 34 /* IRQ0->5 are handled in setup-sh3.c */
41 INTC_VECT(PINT07, 0x700), INTC_VECT(PINT815, 0x720), 35 INTC_VECT(PINT07, 0x700), INTC_VECT(PINT815, 0x720),
42 INTC_VECT(DMAC_DEI0, 0x800), INTC_VECT(DMAC_DEI1, 0x820), 36 INTC_VECT(DMAC, 0x800), INTC_VECT(DMAC, 0x820),
43 INTC_VECT(DMAC_DEI2, 0x840), INTC_VECT(DMAC_DEI3, 0x860), 37 INTC_VECT(DMAC, 0x840), INTC_VECT(DMAC, 0x860),
44 INTC_VECT(SCIF0_ERI, 0x880), INTC_VECT(SCIF0_RXI, 0x8a0), 38 INTC_VECT(SCIF0, 0x880), INTC_VECT(SCIF0, 0x8a0),
45 INTC_VECT(SCIF0_TXI, 0x8e0), 39 INTC_VECT(SCIF0, 0x8e0),
46 INTC_VECT(SCIF2_ERI, 0x900), INTC_VECT(SCIF2_RXI, 0x920), 40 INTC_VECT(SCIF2, 0x900), INTC_VECT(SCIF2, 0x920),
47 INTC_VECT(SCIF2_TXI, 0x960), 41 INTC_VECT(SCIF2, 0x960),
48 INTC_VECT(ADC_ADI, 0x980), 42 INTC_VECT(ADC_ADI, 0x980),
49 INTC_VECT(USB_USI0, 0xa20), INTC_VECT(USB_USI1, 0xa40), 43 INTC_VECT(USB, 0xa20), INTC_VECT(USB, 0xa40),
50 INTC_VECT(TPU0, 0xc00), INTC_VECT(TPU1, 0xc20), 44 INTC_VECT(TPU0, 0xc00), INTC_VECT(TPU1, 0xc20),
51 INTC_VECT(TPU2, 0xc80), INTC_VECT(TPU3, 0xca0), 45 INTC_VECT(TPU2, 0xc80), INTC_VECT(TPU3, 0xca0),
52 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), 46 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
53 INTC_VECT(TMU2_TUNI, 0x440), INTC_VECT(TMU2_TICPI, 0x460), 47 INTC_VECT(TMU2, 0x440), INTC_VECT(TMU2, 0x460),
54 INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), 48 INTC_VECT(RTC, 0x480), INTC_VECT(RTC, 0x4a0),
55 INTC_VECT(RTC_CUI, 0x4c0), 49 INTC_VECT(RTC, 0x4c0),
56 INTC_VECT(WDT, 0x560), 50 INTC_VECT(WDT, 0x560),
57 INTC_VECT(REF_RCMI, 0x580), 51 INTC_VECT(REF_RCMI, 0x580),
58}; 52};
59 53
60static struct intc_group groups[] __initdata = {
61 INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
62 INTC_GROUP(TMU2, TMU2_TUNI, TMU2_TICPI),
63 INTC_GROUP(DMAC, DMAC_DEI0, DMAC_DEI1, DMAC_DEI2, DMAC_DEI3),
64 INTC_GROUP(USB, USB_USI0, USB_USI1),
65 INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
66 INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI),
67};
68
69static struct intc_prio_reg prio_registers[] __initdata = { 54static struct intc_prio_reg prio_registers[] __initdata = {
70 { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, 55 { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } },
71 { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, 0, 0 } }, 56 { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, 0, 0 } },
@@ -78,7 +63,7 @@ static struct intc_prio_reg prio_registers[] __initdata = {
78 63
79}; 64};
80 65
81static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, groups, 66static DECLARE_INTC_DESC(intc_desc, "sh7705", vectors, NULL,
82 NULL, prio_registers, NULL); 67 NULL, prio_registers, NULL);
83 68
84static struct plat_sci_port sci_platform_data[] = { 69static struct plat_sci_port sci_platform_data[] = {
@@ -86,12 +71,12 @@ static struct plat_sci_port sci_platform_data[] = {
86 .mapbase = 0xa4410000, 71 .mapbase = 0xa4410000,
87 .flags = UPF_BOOT_AUTOCONF, 72 .flags = UPF_BOOT_AUTOCONF,
88 .type = PORT_SCIF, 73 .type = PORT_SCIF,
89 .irqs = { 56, 57, 59 }, 74 .irqs = { 56, 56, 56 },
90 }, { 75 }, {
91 .mapbase = 0xa4400000, 76 .mapbase = 0xa4400000,
92 .flags = UPF_BOOT_AUTOCONF, 77 .flags = UPF_BOOT_AUTOCONF,
93 .type = PORT_SCIF, 78 .type = PORT_SCIF,
94 .irqs = { 52, 53, 55 }, 79 .irqs = { 52, 52, 52 },
95 }, { 80 }, {
96 .flags = 0, 81 .flags = 0,
97 } 82 }
@@ -115,14 +100,6 @@ static struct resource rtc_resources[] = {
115 .start = 20, 100 .start = 20,
116 .flags = IORESOURCE_IRQ, 101 .flags = IORESOURCE_IRQ,
117 }, 102 },
118 [2] = {
119 .start = 21,
120 .flags = IORESOURCE_IRQ,
121 },
122 [3] = {
123 .start = 22,
124 .flags = IORESOURCE_IRQ,
125 },
126}; 103};
127 104
128static struct sh_rtc_platform_info rtc_info = { 105static struct sh_rtc_platform_info rtc_info = {
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
index 93c55e2ed952..a74f960b5e79 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
@@ -2,6 +2,7 @@
2 * SH3 Setup code for SH7706, SH7707, SH7708, SH7709 2 * SH3 Setup code for SH7706, SH7707, SH7708, SH7709
3 * 3 *
4 * Copyright (C) 2007 Magnus Damm 4 * Copyright (C) 2007 Magnus Damm
5 * Copyright (C) 2009 Paul Mundt
5 * 6 *
6 * Based on setup-sh7709.c 7 * Based on setup-sh7709.c
7 * 8 *
@@ -24,46 +25,37 @@ enum {
24 /* interrupt sources */ 25 /* interrupt sources */
25 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, 26 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5,
26 PINT07, PINT815, 27 PINT07, PINT815,
27 DMAC_DEI0, DMAC_DEI1, DMAC_DEI2, DMAC_DEI3, 28 DMAC, SCIF0, SCIF2, SCI, ADC_ADI,
28 SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI,
29 SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI,
30 SCI_ERI, SCI_RXI, SCI_TXI, SCI_TEI,
31 ADC_ADI,
32 LCDC, PCC0, PCC1, 29 LCDC, PCC0, PCC1,
33 TMU0, TMU1, TMU2_TUNI, TMU2_TICPI, 30 TMU0, TMU1, TMU2,
34 RTC_ATI, RTC_PRI, RTC_CUI, 31 RTC, WDT, REF,
35 WDT,
36 REF_RCMI, REF_ROVI,
37
38 /* interrupt groups */
39 RTC, REF, TMU2, DMAC, SCI, SCIF2, SCIF0,
40}; 32};
41 33
42static struct intc_vect vectors[] __initdata = { 34static struct intc_vect vectors[] __initdata = {
43 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), 35 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
44 INTC_VECT(TMU2_TUNI, 0x440), INTC_VECT(TMU2_TICPI, 0x460), 36 INTC_VECT(TMU2, 0x440), INTC_VECT(TMU2, 0x460),
45 INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), 37 INTC_VECT(RTC, 0x480), INTC_VECT(RTC, 0x4a0),
46 INTC_VECT(RTC_CUI, 0x4c0), 38 INTC_VECT(RTC, 0x4c0),
47 INTC_VECT(SCI_ERI, 0x4e0), INTC_VECT(SCI_RXI, 0x500), 39 INTC_VECT(SCI, 0x4e0), INTC_VECT(SCI, 0x500),
48 INTC_VECT(SCI_TXI, 0x520), INTC_VECT(SCI_TEI, 0x540), 40 INTC_VECT(SCI, 0x520), INTC_VECT(SCI, 0x540),
49 INTC_VECT(WDT, 0x560), 41 INTC_VECT(WDT, 0x560),
50 INTC_VECT(REF_RCMI, 0x580), 42 INTC_VECT(REF, 0x580),
51 INTC_VECT(REF_ROVI, 0x5a0), 43 INTC_VECT(REF, 0x5a0),
52#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 44#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
53 defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 45 defined(CONFIG_CPU_SUBTYPE_SH7707) || \
54 defined(CONFIG_CPU_SUBTYPE_SH7709) 46 defined(CONFIG_CPU_SUBTYPE_SH7709)
55 /* IRQ0->5 are handled in setup-sh3.c */ 47 /* IRQ0->5 are handled in setup-sh3.c */
56 INTC_VECT(DMAC_DEI0, 0x800), INTC_VECT(DMAC_DEI1, 0x820), 48 INTC_VECT(DMAC, 0x800), INTC_VECT(DMAC, 0x820),
57 INTC_VECT(DMAC_DEI2, 0x840), INTC_VECT(DMAC_DEI3, 0x860), 49 INTC_VECT(DMAC, 0x840), INTC_VECT(DMAC, 0x860),
58 INTC_VECT(ADC_ADI, 0x980), 50 INTC_VECT(ADC_ADI, 0x980),
59 INTC_VECT(SCIF2_ERI, 0x900), INTC_VECT(SCIF2_RXI, 0x920), 51 INTC_VECT(SCIF2, 0x900), INTC_VECT(SCIF2, 0x920),
60 INTC_VECT(SCIF2_BRI, 0x940), INTC_VECT(SCIF2_TXI, 0x960), 52 INTC_VECT(SCIF2, 0x940), INTC_VECT(SCIF2, 0x960),
61#endif 53#endif
62#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 54#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
63 defined(CONFIG_CPU_SUBTYPE_SH7709) 55 defined(CONFIG_CPU_SUBTYPE_SH7709)
64 INTC_VECT(PINT07, 0x700), INTC_VECT(PINT815, 0x720), 56 INTC_VECT(PINT07, 0x700), INTC_VECT(PINT815, 0x720),
65 INTC_VECT(SCIF0_ERI, 0x880), INTC_VECT(SCIF0_RXI, 0x8a0), 57 INTC_VECT(SCIF0, 0x880), INTC_VECT(SCIF0, 0x8a0),
66 INTC_VECT(SCIF0_BRI, 0x8c0), INTC_VECT(SCIF0_TXI, 0x8e0), 58 INTC_VECT(SCIF0, 0x8c0), INTC_VECT(SCIF0, 0x8e0),
67#endif 59#endif
68#if defined(CONFIG_CPU_SUBTYPE_SH7707) 60#if defined(CONFIG_CPU_SUBTYPE_SH7707)
69 INTC_VECT(LCDC, 0x9a0), 61 INTC_VECT(LCDC, 0x9a0),
@@ -71,16 +63,6 @@ static struct intc_vect vectors[] __initdata = {
71#endif 63#endif
72}; 64};
73 65
74static struct intc_group groups[] __initdata = {
75 INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
76 INTC_GROUP(TMU2, TMU2_TUNI, TMU2_TICPI),
77 INTC_GROUP(REF, REF_RCMI, REF_ROVI),
78 INTC_GROUP(DMAC, DMAC_DEI0, DMAC_DEI1, DMAC_DEI2, DMAC_DEI3),
79 INTC_GROUP(SCI, SCI_ERI, SCI_RXI, SCI_TXI, SCI_TEI),
80 INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
81 INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI),
82};
83
84static struct intc_prio_reg prio_registers[] __initdata = { 66static struct intc_prio_reg prio_registers[] __initdata = {
85 { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, 67 { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } },
86 { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, SCI, 0 } }, 68 { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, SCI, 0 } },
@@ -101,7 +83,7 @@ static struct intc_prio_reg prio_registers[] __initdata = {
101#endif 83#endif
102}; 84};
103 85
104static DECLARE_INTC_DESC(intc_desc, "sh770x", vectors, groups, 86static DECLARE_INTC_DESC(intc_desc, "sh770x", vectors, NULL,
105 NULL, prio_registers, NULL); 87 NULL, prio_registers, NULL);
106 88
107static struct resource rtc_resources[] = { 89static struct resource rtc_resources[] = {
@@ -111,14 +93,6 @@ static struct resource rtc_resources[] = {
111 .flags = IORESOURCE_IO, 93 .flags = IORESOURCE_IO,
112 }, 94 },
113 [1] = { 95 [1] = {
114 .start = 21,
115 .flags = IORESOURCE_IRQ,
116 },
117 [2] = {
118 .start = 22,
119 .flags = IORESOURCE_IRQ,
120 },
121 [3] = {
122 .start = 20, 96 .start = 20,
123 .flags = IORESOURCE_IRQ, 97 .flags = IORESOURCE_IRQ,
124 }, 98 },
@@ -136,7 +110,7 @@ static struct plat_sci_port sci_platform_data[] = {
136 .mapbase = 0xfffffe80, 110 .mapbase = 0xfffffe80,
137 .flags = UPF_BOOT_AUTOCONF, 111 .flags = UPF_BOOT_AUTOCONF,
138 .type = PORT_SCI, 112 .type = PORT_SCI,
139 .irqs = { 23, 24, 25, 0 }, 113 .irqs = { 23, 23, 23, 0 },
140 }, 114 },
141#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 115#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
142 defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 116 defined(CONFIG_CPU_SUBTYPE_SH7707) || \
@@ -145,7 +119,7 @@ static struct plat_sci_port sci_platform_data[] = {
145 .mapbase = 0xa4000150, 119 .mapbase = 0xa4000150,
146 .flags = UPF_BOOT_AUTOCONF, 120 .flags = UPF_BOOT_AUTOCONF,
147 .type = PORT_SCIF, 121 .type = PORT_SCIF,
148 .irqs = { 56, 57, 59, 58 }, 122 .irqs = { 56, 56, 56, 56 },
149 }, 123 },
150#endif 124#endif
151#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ 125#if defined(CONFIG_CPU_SUBTYPE_SH7707) || \
@@ -154,7 +128,7 @@ static struct plat_sci_port sci_platform_data[] = {
154 .mapbase = 0xa4000140, 128 .mapbase = 0xa4000140,
155 .flags = UPF_BOOT_AUTOCONF, 129 .flags = UPF_BOOT_AUTOCONF,
156 .type = PORT_IRDA, 130 .type = PORT_IRDA,
157 .irqs = { 52, 53, 55, 54 }, 131 .irqs = { 52, 52, 52, 52 },
158 }, 132 },
159#endif 133#endif
160 { 134 {
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
index 77eee481de47..335098b66e2f 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SH3 Setup code for SH7710, SH7712 2 * SH3 Setup code for SH7710, SH7712
3 * 3 *
4 * Copyright (C) 2006, 2007 Paul Mundt 4 * Copyright (C) 2006 - 2009 Paul Mundt
5 * Copyright (C) 2007 Nobuhiro Iwamatsu 5 * Copyright (C) 2007 Nobuhiro Iwamatsu
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
@@ -20,59 +20,40 @@ enum {
20 20
21 /* interrupt sources */ 21 /* interrupt sources */
22 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, 22 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5,
23 DMAC_DEI0, DMAC_DEI1, DMAC_DEI2, DMAC_DEI3, 23 DMAC1, SCIF0, SCIF1, DMAC2, IPSEC,
24 SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI,
25 SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI,
26 DMAC_DEI4, DMAC_DEI5,
27 IPSEC,
28 EDMAC0, EDMAC1, EDMAC2, 24 EDMAC0, EDMAC1, EDMAC2,
29 SIOF0_ERI, SIOF0_TXI, SIOF0_RXI, SIOF0_CCI, 25 SIOF0, SIOF1,
30 SIOF1_ERI, SIOF1_TXI, SIOF1_RXI, SIOF1_CCI,
31 TMU0, TMU1, TMU2,
32 RTC_ATI, RTC_PRI, RTC_CUI,
33 WDT,
34 REF,
35 26
36 /* interrupt groups */ 27 TMU0, TMU1, TMU2,
37 RTC, DMAC1, SCIF0, SCIF1, DMAC2, SIOF0, SIOF1, 28 RTC, WDT, REF,
38}; 29};
39 30
40static struct intc_vect vectors[] __initdata = { 31static struct intc_vect vectors[] __initdata = {
41 /* IRQ0->5 are handled in setup-sh3.c */ 32 /* IRQ0->5 are handled in setup-sh3.c */
42 INTC_VECT(DMAC_DEI0, 0x800), INTC_VECT(DMAC_DEI1, 0x820), 33 INTC_VECT(DMAC1, 0x800), INTC_VECT(DMAC1, 0x820),
43 INTC_VECT(DMAC_DEI2, 0x840), INTC_VECT(DMAC_DEI3, 0x860), 34 INTC_VECT(DMAC1, 0x840), INTC_VECT(DMAC1, 0x860),
44 INTC_VECT(SCIF0_ERI, 0x880), INTC_VECT(SCIF0_RXI, 0x8a0), 35 INTC_VECT(SCIF0, 0x880), INTC_VECT(SCIF0, 0x8a0),
45 INTC_VECT(SCIF0_BRI, 0x8c0), INTC_VECT(SCIF0_TXI, 0x8e0), 36 INTC_VECT(SCIF0, 0x8c0), INTC_VECT(SCIF0, 0x8e0),
46 INTC_VECT(SCIF1_ERI, 0x900), INTC_VECT(SCIF1_RXI, 0x920), 37 INTC_VECT(SCIF1, 0x900), INTC_VECT(SCIF1, 0x920),
47 INTC_VECT(SCIF1_BRI, 0x940), INTC_VECT(SCIF1_TXI, 0x960), 38 INTC_VECT(SCIF1, 0x940), INTC_VECT(SCIF1, 0x960),
48 INTC_VECT(DMAC_DEI4, 0xb80), INTC_VECT(DMAC_DEI5, 0xba0), 39 INTC_VECT(DMAC2, 0xb80), INTC_VECT(DMAC2, 0xba0),
49#ifdef CONFIG_CPU_SUBTYPE_SH7710 40#ifdef CONFIG_CPU_SUBTYPE_SH7710
50 INTC_VECT(IPSEC, 0xbe0), 41 INTC_VECT(IPSEC, 0xbe0),
51#endif 42#endif
52 INTC_VECT(EDMAC0, 0xc00), INTC_VECT(EDMAC1, 0xc20), 43 INTC_VECT(EDMAC0, 0xc00), INTC_VECT(EDMAC1, 0xc20),
53 INTC_VECT(EDMAC2, 0xc40), 44 INTC_VECT(EDMAC2, 0xc40),
54 INTC_VECT(SIOF0_ERI, 0xe00), INTC_VECT(SIOF0_TXI, 0xe20), 45 INTC_VECT(SIOF0, 0xe00), INTC_VECT(SIOF0, 0xe20),
55 INTC_VECT(SIOF0_RXI, 0xe40), INTC_VECT(SIOF0_CCI, 0xe60), 46 INTC_VECT(SIOF0, 0xe40), INTC_VECT(SIOF0, 0xe60),
56 INTC_VECT(SIOF1_ERI, 0xe80), INTC_VECT(SIOF1_TXI, 0xea0), 47 INTC_VECT(SIOF1, 0xe80), INTC_VECT(SIOF1, 0xea0),
57 INTC_VECT(SIOF1_RXI, 0xec0), INTC_VECT(SIOF1_CCI, 0xee0), 48 INTC_VECT(SIOF1, 0xec0), INTC_VECT(SIOF1, 0xee0),
58 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), 49 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
59 INTC_VECT(TMU2, 0x440), 50 INTC_VECT(TMU2, 0x440),
60 INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), 51 INTC_VECT(RTC, 0x480), INTC_VECT(RTC, 0x4a0),
61 INTC_VECT(RTC_CUI, 0x4c0), 52 INTC_VECT(RTC, 0x4c0),
62 INTC_VECT(WDT, 0x560), 53 INTC_VECT(WDT, 0x560),
63 INTC_VECT(REF, 0x580), 54 INTC_VECT(REF, 0x580),
64}; 55};
65 56
66static struct intc_group groups[] __initdata = {
67 INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
68 INTC_GROUP(DMAC1, DMAC_DEI0, DMAC_DEI1, DMAC_DEI2, DMAC_DEI3),
69 INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
70 INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
71 INTC_GROUP(DMAC2, DMAC_DEI4, DMAC_DEI5),
72 INTC_GROUP(SIOF0, SIOF0_ERI, SIOF0_TXI, SIOF0_RXI, SIOF0_CCI),
73 INTC_GROUP(SIOF1, SIOF1_ERI, SIOF1_TXI, SIOF1_RXI, SIOF1_CCI),
74};
75
76static struct intc_prio_reg prio_registers[] __initdata = { 57static struct intc_prio_reg prio_registers[] __initdata = {
77 { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, 58 { 0xfffffee2, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } },
78 { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, 0, 0 } }, 59 { 0xfffffee4, 0, 16, 4, /* IPRB */ { WDT, REF, 0, 0 } },
@@ -85,7 +66,7 @@ static struct intc_prio_reg prio_registers[] __initdata = {
85 { 0xa4080006, 0, 16, 4, /* IPRI */ { 0, 0, SIOF1 } }, 66 { 0xa4080006, 0, 16, 4, /* IPRI */ { 0, 0, SIOF1 } },
86}; 67};
87 68
88static DECLARE_INTC_DESC(intc_desc, "sh7710", vectors, groups, 69static DECLARE_INTC_DESC(intc_desc, "sh7710", vectors, NULL,
89 NULL, prio_registers, NULL); 70 NULL, prio_registers, NULL);
90 71
91static struct resource rtc_resources[] = { 72static struct resource rtc_resources[] = {
@@ -98,14 +79,6 @@ static struct resource rtc_resources[] = {
98 .start = 20, 79 .start = 20,
99 .flags = IORESOURCE_IRQ, 80 .flags = IORESOURCE_IRQ,
100 }, 81 },
101 [2] = {
102 .start = 21,
103 .flags = IORESOURCE_IRQ,
104 },
105 [3] = {
106 .start = 22,
107 .flags = IORESOURCE_IRQ,
108 },
109}; 82};
110 83
111static struct sh_rtc_platform_info rtc_info = { 84static struct sh_rtc_platform_info rtc_info = {
@@ -127,12 +100,12 @@ static struct plat_sci_port sci_platform_data[] = {
127 .mapbase = 0xa4400000, 100 .mapbase = 0xa4400000,
128 .flags = UPF_BOOT_AUTOCONF, 101 .flags = UPF_BOOT_AUTOCONF,
129 .type = PORT_SCIF, 102 .type = PORT_SCIF,
130 .irqs = { 52, 53, 55, 54 }, 103 .irqs = { 52, 52, 52, 52 },
131 }, { 104 }, {
132 .mapbase = 0xa4410000, 105 .mapbase = 0xa4410000,
133 .flags = UPF_BOOT_AUTOCONF, 106 .flags = UPF_BOOT_AUTOCONF,
134 .type = PORT_SCIF, 107 .type = PORT_SCIF,
135 .irqs = { 56, 57, 59, 58 }, 108 .irqs = { 56, 56, 56, 56 },
136 }, { 109 }, {
137 110
138 .flags = 0, 111 .flags = 0,
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
index f807a21b066c..003874a2fd2a 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
@@ -2,6 +2,7 @@
2 * SH7720 Setup 2 * SH7720 Setup
3 * 3 *
4 * Copyright (C) 2007 Markus Brunner, Mark Jonas 4 * Copyright (C) 2007 Markus Brunner, Mark Jonas
5 * Copyright (C) 2009 Paul Mundt
5 * 6 *
6 * Based on arch/sh/kernel/cpu/sh4/setup-sh7750.c: 7 * Based on arch/sh/kernel/cpu/sh4/setup-sh7750.c:
7 * 8 *
@@ -26,17 +27,7 @@ static struct resource rtc_resources[] = {
26 .flags = IORESOURCE_IO, 27 .flags = IORESOURCE_IO,
27 }, 28 },
28 [1] = { 29 [1] = {
29 /* Period IRQ */ 30 /* Shared Period/Carry/Alarm IRQ */
30 .start = 21,
31 .flags = IORESOURCE_IRQ,
32 },
33 [2] = {
34 /* Carry IRQ */
35 .start = 22,
36 .flags = IORESOURCE_IRQ,
37 },
38 [3] = {
39 /* Alarm IRQ */
40 .start = 20, 31 .start = 20,
41 .flags = IORESOURCE_IRQ, 32 .flags = IORESOURCE_IRQ,
42 }, 33 },
@@ -150,62 +141,49 @@ enum {
150 UNUSED = 0, 141 UNUSED = 0,
151 142
152 /* interrupt sources */ 143 /* interrupt sources */
153 TMU0, TMU1, TMU2, RTC_ATI, RTC_PRI, RTC_CUI, 144 TMU0, TMU1, TMU2, RTC,
154 WDT, REF_RCMI, SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEND, 145 WDT, REF_RCMI, SIM,
155 IRQ0, IRQ1, IRQ2, IRQ3, 146 IRQ0, IRQ1, IRQ2, IRQ3,
156 USBF_SPD, TMU_SUNI, IRQ5, IRQ4, 147 USBF_SPD, TMU_SUNI, IRQ5, IRQ4,
157 DMAC1_DEI0, DMAC1_DEI1, DMAC1_DEI2, DMAC1_DEI3, LCDC, SSL, 148 DMAC1, LCDC, SSL,
158 ADC, DMAC2_DEI4, DMAC2_DEI5, USBFI0, USBFI1, CMT, 149 ADC, DMAC2, USBFI, CMT,
159 SCIF0, SCIF1, 150 SCIF0, SCIF1,
160 PINT07, PINT815, TPU0, TPU1, TPU2, TPU3, IIC, 151 PINT07, PINT815, TPU, IIC,
161 SIOF0, SIOF1, MMCI0, MMCI1, MMCI2, MMCI3, PCC, 152 SIOF0, SIOF1, MMC, PCC,
162 USBHI, AFEIF, 153 USBHI, AFEIF,
163 H_UDI, 154 H_UDI,
164 /* interrupt groups */
165 TMU, RTC, SIM, DMAC1, USBFI, DMAC2, USB, TPU, MMC,
166}; 155};
167 156
168static struct intc_vect vectors[] __initdata = { 157static struct intc_vect vectors[] __initdata = {
169 /* IRQ0->5 are handled in setup-sh3.c */ 158 /* IRQ0->5 are handled in setup-sh3.c */
170 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), 159 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
171 INTC_VECT(TMU2, 0x440), INTC_VECT(RTC_ATI, 0x480), 160 INTC_VECT(TMU2, 0x440), INTC_VECT(RTC, 0x480),
172 INTC_VECT(RTC_PRI, 0x4a0), INTC_VECT(RTC_CUI, 0x4c0), 161 INTC_VECT(RTC, 0x4a0), INTC_VECT(RTC, 0x4c0),
173 INTC_VECT(SIM_ERI, 0x4e0), INTC_VECT(SIM_RXI, 0x500), 162 INTC_VECT(SIM, 0x4e0), INTC_VECT(SIM, 0x500),
174 INTC_VECT(SIM_TXI, 0x520), INTC_VECT(SIM_TEND, 0x540), 163 INTC_VECT(SIM, 0x520), INTC_VECT(SIM, 0x540),
175 INTC_VECT(WDT, 0x560), INTC_VECT(REF_RCMI, 0x580), 164 INTC_VECT(WDT, 0x560), INTC_VECT(REF_RCMI, 0x580),
176 /* H_UDI cannot be masked */ INTC_VECT(TMU_SUNI, 0x6c0), 165 /* H_UDI cannot be masked */ INTC_VECT(TMU_SUNI, 0x6c0),
177 INTC_VECT(USBF_SPD, 0x6e0), INTC_VECT(DMAC1_DEI0, 0x800), 166 INTC_VECT(USBF_SPD, 0x6e0), INTC_VECT(DMAC1, 0x800),
178 INTC_VECT(DMAC1_DEI1, 0x820), INTC_VECT(DMAC1_DEI2, 0x840), 167 INTC_VECT(DMAC1, 0x820), INTC_VECT(DMAC1, 0x840),
179 INTC_VECT(DMAC1_DEI3, 0x860), INTC_VECT(LCDC, 0x900), 168 INTC_VECT(DMAC1, 0x860), INTC_VECT(LCDC, 0x900),
180#if defined(CONFIG_CPU_SUBTYPE_SH7720) 169#if defined(CONFIG_CPU_SUBTYPE_SH7720)
181 INTC_VECT(SSL, 0x980), 170 INTC_VECT(SSL, 0x980),
182#endif 171#endif
183 INTC_VECT(USBFI0, 0xa20), INTC_VECT(USBFI1, 0xa40), 172 INTC_VECT(USBFI, 0xa20), INTC_VECT(USBFI, 0xa40),
184 INTC_VECT(USBHI, 0xa60), 173 INTC_VECT(USBHI, 0xa60),
185 INTC_VECT(DMAC2_DEI4, 0xb80), INTC_VECT(DMAC2_DEI5, 0xba0), 174 INTC_VECT(DMAC2, 0xb80), INTC_VECT(DMAC2, 0xba0),
186 INTC_VECT(ADC, 0xbe0), INTC_VECT(SCIF0, 0xc00), 175 INTC_VECT(ADC, 0xbe0), INTC_VECT(SCIF0, 0xc00),
187 INTC_VECT(SCIF1, 0xc20), INTC_VECT(PINT07, 0xc80), 176 INTC_VECT(SCIF1, 0xc20), INTC_VECT(PINT07, 0xc80),
188 INTC_VECT(PINT815, 0xca0), INTC_VECT(SIOF0, 0xd00), 177 INTC_VECT(PINT815, 0xca0), INTC_VECT(SIOF0, 0xd00),
189 INTC_VECT(SIOF1, 0xd20), INTC_VECT(TPU0, 0xd80), 178 INTC_VECT(SIOF1, 0xd20), INTC_VECT(TPU, 0xd80),
190 INTC_VECT(TPU1, 0xda0), INTC_VECT(TPU2, 0xdc0), 179 INTC_VECT(TPU, 0xda0), INTC_VECT(TPU, 0xdc0),
191 INTC_VECT(TPU3, 0xde0), INTC_VECT(IIC, 0xe00), 180 INTC_VECT(TPU, 0xde0), INTC_VECT(IIC, 0xe00),
192 INTC_VECT(MMCI0, 0xe80), INTC_VECT(MMCI1, 0xea0), 181 INTC_VECT(MMC, 0xe80), INTC_VECT(MMC, 0xea0),
193 INTC_VECT(MMCI2, 0xec0), INTC_VECT(MMCI3, 0xee0), 182 INTC_VECT(MMC, 0xec0), INTC_VECT(MMC, 0xee0),
194 INTC_VECT(CMT, 0xf00), INTC_VECT(PCC, 0xf60), 183 INTC_VECT(CMT, 0xf00), INTC_VECT(PCC, 0xf60),
195 INTC_VECT(AFEIF, 0xfe0), 184 INTC_VECT(AFEIF, 0xfe0),
196}; 185};
197 186
198static struct intc_group groups[] __initdata = {
199 INTC_GROUP(TMU, TMU0, TMU1, TMU2),
200 INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
201 INTC_GROUP(SIM, SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEND),
202 INTC_GROUP(DMAC1, DMAC1_DEI0, DMAC1_DEI1, DMAC1_DEI2, DMAC1_DEI3),
203 INTC_GROUP(USBFI, USBFI0, USBFI1),
204 INTC_GROUP(DMAC2, DMAC2_DEI4, DMAC2_DEI5),
205 INTC_GROUP(TPU, TPU0, TPU1, TPU2, TPU3),
206 INTC_GROUP(MMC, MMCI0, MMCI1, MMCI2, MMCI3),
207};
208
209static struct intc_prio_reg prio_registers[] __initdata = { 187static struct intc_prio_reg prio_registers[] __initdata = {
210 { 0xA414FEE2UL, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, 188 { 0xA414FEE2UL, 0, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } },
211 { 0xA414FEE4UL, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, SIM, 0 } }, 189 { 0xA414FEE4UL, 0, 16, 4, /* IPRB */ { WDT, REF_RCMI, SIM, 0 } },
@@ -219,7 +197,7 @@ static struct intc_prio_reg prio_registers[] __initdata = {
219 { 0xA4080008UL, 0, 16, 4, /* IPRJ */ { 0, USBHI, 0, AFEIF } }, 197 { 0xA4080008UL, 0, 16, 4, /* IPRJ */ { 0, USBHI, 0, AFEIF } },
220}; 198};
221 199
222static DECLARE_INTC_DESC(intc_desc, "sh7720", vectors, groups, 200static DECLARE_INTC_DESC(intc_desc, "sh7720", vectors, NULL,
223 NULL, prio_registers, NULL); 201 NULL, prio_registers, NULL);
224 202
225void __init plat_irq_setup(void) 203void __init plat_irq_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/swsusp.S b/arch/sh/kernel/cpu/sh3/swsusp.S
new file mode 100644
index 000000000000..01145426a2b8
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh3/swsusp.S
@@ -0,0 +1,147 @@
1/*
2 * arch/sh/kernel/cpu/sh3/swsusp.S
3 *
4 * Copyright (C) 2009 Magnus Damm
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/sys.h>
11#include <linux/errno.h>
12#include <linux/linkage.h>
13#include <asm/asm-offsets.h>
14#include <asm/page.h>
15
16#define k0 r0
17#define k1 r1
18#define k2 r2
19#define k3 r3
20#define k4 r4
21
22! swsusp_arch_resume()
23! - copy restore_pblist pages
24! - restore registers from swsusp_arch_regs_cpu0
25
26ENTRY(swsusp_arch_resume)
27 mov.l 1f, r15
28 mov.l 2f, r4
29 mov.l @r4, r4
30
31swsusp_copy_loop:
32 mov r4, r0
33 cmp/eq #0, r0
34 bt swsusp_restore_regs
35
36 mov.l @(PBE_ADDRESS, r4), r2
37 mov.l @(PBE_ORIG_ADDRESS, r4), r5
38
39 mov #(PAGE_SIZE >> 10), r3
40 shll8 r3
41 shlr2 r3 /* PAGE_SIZE / 16 */
42swsusp_copy_page:
43 dt r3
44 mov.l @r2+,r1 /* 16n+0 */
45 mov.l r1,@r5
46 add #4,r5
47 mov.l @r2+,r1 /* 16n+4 */
48 mov.l r1,@r5
49 add #4,r5
50 mov.l @r2+,r1 /* 16n+8 */
51 mov.l r1,@r5
52 add #4,r5
53 mov.l @r2+,r1 /* 16n+12 */
54 mov.l r1,@r5
55 bf/s swsusp_copy_page
56 add #4,r5
57
58 bra swsusp_copy_loop
59 mov.l @(PBE_NEXT, r4), r4
60
61swsusp_restore_regs:
62 ! BL=0: R7->R0 is bank0
63 mov.l 3f, r8
64 mov.l 4f, r5
65 jsr @r5
66 nop
67
68 ! BL=1: R7->R0 is bank1
69 lds k2, pr
70 ldc k3, ssr
71
72 mov.l @r15+, r0
73 mov.l @r15+, r1
74 mov.l @r15+, r2
75 mov.l @r15+, r3
76 mov.l @r15+, r4
77 mov.l @r15+, r5
78 mov.l @r15+, r6
79 mov.l @r15+, r7
80
81 rte
82 nop
83 ! BL=0: R7->R0 is bank0
84
85 .align 2
861: .long swsusp_arch_regs_cpu0
872: .long restore_pblist
883: .long 0x20000000 ! RB=1
894: .long restore_regs
90
91! swsusp_arch_suspend()
92! - prepare pc for resume, return from function without swsusp_save on resume
93! - save registers in swsusp_arch_regs_cpu0
94! - call swsusp_save write suspend image
95
96ENTRY(swsusp_arch_suspend)
97 sts pr, r0 ! save pr in r0
98 mov r15, r2 ! save sp in r2
99 mov r8, r5 ! save r8 in r5
100 stc sr, r1
101 ldc r1, ssr ! save sr in ssr
102 mov.l 1f, r1
103 ldc r1, spc ! setup pc value for resuming
104 mov.l 5f, r15 ! use swsusp_arch_regs_cpu0 as stack
105 mov.l 6f, r3
106 add r3, r15 ! save from top of structure
107
108 ! BL=0: R7->R0 is bank0
109 mov.l 2f, r3 ! get new SR value for bank1
110 mov #0, r4
111 mov.l 7f, r1
112 jsr @r1 ! switch to bank1 and save bank1 r7->r0
113 not r4, r4
114
115 ! BL=1: R7->R0 is bank1
116 stc r2_bank, k0 ! fetch old sp from r2_bank0
117 mov.l 3f, k4 ! SR bits to clear in k4
118 mov.l 8f, k1
119 jsr @k1 ! switch to bank0 and save all regs
120 stc r0_bank, k3 ! fetch old pr from r0_bank0
121
122 ! BL=0: R7->R0 is bank0
123 mov r2, r15 ! restore old sp
124 mov r5, r8 ! restore old r8
125 stc ssr, r1
126 ldc r1, sr ! restore old sr
127 lds r0, pr ! restore old pr
128 mov.l 4f, r0
129 jmp @r0
130 nop
131
132swsusp_call_save:
133 mov r2, r15 ! restore old sp
134 mov r5, r8 ! restore old r8
135 lds r0, pr ! restore old pr
136 rts
137 mov #0, r0
138
139 .align 2
1401: .long swsusp_call_save
1412: .long 0x20000000 ! RB=1
1423: .long 0xdfffffff ! RB=0
1434: .long swsusp_save
1445: .long swsusp_arch_regs_cpu0
1456: .long SWSUSP_ARCH_REGS_SIZE
1467: .long save_low_regs
1478: .long save_regs
diff --git a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile
index d608557c7a3f..203b18347b83 100644
--- a/arch/sh/kernel/cpu/sh4/Makefile
+++ b/arch/sh/kernel/cpu/sh4/Makefile
@@ -5,6 +5,7 @@
5obj-y := probe.o common.o 5obj-y := probe.o common.o
6common-y += $(addprefix ../sh3/, entry.o ex.o) 6common-y += $(addprefix ../sh3/, entry.o ex.o)
7 7
8obj-$(CONFIG_HIBERNATION) += $(addprefix ../sh3/, swsusp.o)
8obj-$(CONFIG_SH_FPU) += fpu.o softfloat.o 9obj-$(CONFIG_SH_FPU) += fpu.o softfloat.o
9obj-$(CONFIG_SH_STORE_QUEUES) += sq.o 10obj-$(CONFIG_SH_STORE_QUEUES) += sq.o
10 11
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c
index 2e42572b1b11..3d3a3c4425a9 100644
--- a/arch/sh/kernel/cpu/sh4/probe.c
+++ b/arch/sh/kernel/cpu/sh4/probe.c
@@ -129,6 +129,13 @@ int __init detect_cpu_and_cache_system(void)
129 boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER | 129 boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER |
130 CPU_HAS_LLSC; 130 CPU_HAS_LLSC;
131 break; 131 break;
132 case 0x4004:
133 boot_cpu_data.type = CPU_SH7786;
134 boot_cpu_data.icache.ways = 4;
135 boot_cpu_data.dcache.ways = 4;
136 boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER |
137 CPU_HAS_LLSC | CPU_HAS_PTEAEX;
138 break;
132 case 0x3008: 139 case 0x3008:
133 boot_cpu_data.icache.ways = 4; 140 boot_cpu_data.icache.ways = 4;
134 boot_cpu_data.dcache.ways = 4; 141 boot_cpu_data.dcache.ways = 4;
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index ec884039b914..a1c80d909cd6 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -21,17 +21,7 @@ static struct resource rtc_resources[] = {
21 .flags = IORESOURCE_IO, 21 .flags = IORESOURCE_IO,
22 }, 22 },
23 [1] = { 23 [1] = {
24 /* Period IRQ */ 24 /* Shared Period/Carry/Alarm IRQ */
25 .start = 21,
26 .flags = IORESOURCE_IRQ,
27 },
28 [2] = {
29 /* Carry IRQ */
30 .start = 22,
31 .flags = IORESOURCE_IRQ,
32 },
33 [3] = {
34 /* Alarm IRQ */
35 .start = 20, 25 .start = 20,
36 .flags = IORESOURCE_IRQ, 26 .flags = IORESOURCE_IRQ,
37 }, 27 },
@@ -50,13 +40,13 @@ static struct plat_sci_port sci_platform_data[] = {
50 .mapbase = 0xffe00000, 40 .mapbase = 0xffe00000,
51 .flags = UPF_BOOT_AUTOCONF, 41 .flags = UPF_BOOT_AUTOCONF,
52 .type = PORT_SCI, 42 .type = PORT_SCI,
53 .irqs = { 23, 24, 25, 0 }, 43 .irqs = { 23, 23, 23, 0 },
54 }, { 44 }, {
55#endif 45#endif
56 .mapbase = 0xffe80000, 46 .mapbase = 0xffe80000,
57 .flags = UPF_BOOT_AUTOCONF, 47 .flags = UPF_BOOT_AUTOCONF,
58 .type = PORT_SCIF, 48 .type = PORT_SCIF,
59 .irqs = { 40, 41, 43, 42 }, 49 .irqs = { 40, 40, 40, 40 },
60 }, { 50 }, {
61 .flags = 0, 51 .flags = 0,
62 } 52 }
@@ -87,43 +77,27 @@ enum {
87 77
88 /* interrupt sources */ 78 /* interrupt sources */
89 IRL0, IRL1, IRL2, IRL3, /* only IRLM mode supported */ 79 IRL0, IRL1, IRL2, IRL3, /* only IRLM mode supported */
90 HUDI, GPIOI, 80 HUDI, GPIOI, DMAC,
91 DMAC_DMTE0, DMAC_DMTE1, DMAC_DMTE2, DMAC_DMTE3,
92 DMAC_DMTE4, DMAC_DMTE5, DMAC_DMTE6, DMAC_DMTE7,
93 DMAC_DMAE,
94 PCIC0_PCISERR, PCIC1_PCIERR, PCIC1_PCIPWDWN, PCIC1_PCIPWON, 81 PCIC0_PCISERR, PCIC1_PCIERR, PCIC1_PCIPWDWN, PCIC1_PCIPWON,
95 PCIC1_PCIDMA0, PCIC1_PCIDMA1, PCIC1_PCIDMA2, PCIC1_PCIDMA3, 82 PCIC1_PCIDMA0, PCIC1_PCIDMA1, PCIC1_PCIDMA2, PCIC1_PCIDMA3,
96 TMU3, TMU4, TMU0, TMU1, TMU2_TUNI, TMU2_TICPI, 83 TMU3, TMU4, TMU0, TMU1, TMU2, RTC, SCI1, SCIF, WDT, REF,
97 RTC_ATI, RTC_PRI, RTC_CUI,
98 SCI1_ERI, SCI1_RXI, SCI1_TXI, SCI1_TEI,
99 SCIF_ERI, SCIF_RXI, SCIF_BRI, SCIF_TXI,
100 WDT,
101 REF_RCMI, REF_ROVI,
102 84
103 /* interrupt groups */ 85 /* interrupt groups */
104 DMAC, PCIC1, TMU2, RTC, SCI1, SCIF, REF, 86 PCIC1,
105}; 87};
106 88
107static struct intc_vect vectors[] __initdata = { 89static struct intc_vect vectors[] __initdata = {
108 INTC_VECT(HUDI, 0x600), INTC_VECT(GPIOI, 0x620), 90 INTC_VECT(HUDI, 0x600), INTC_VECT(GPIOI, 0x620),
109 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), 91 INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420),
110 INTC_VECT(TMU2_TUNI, 0x440), INTC_VECT(TMU2_TICPI, 0x460), 92 INTC_VECT(TMU2, 0x440), INTC_VECT(TMU2, 0x460),
111 INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), 93 INTC_VECT(RTC, 0x480), INTC_VECT(RTC, 0x4a0),
112 INTC_VECT(RTC_CUI, 0x4c0), 94 INTC_VECT(RTC, 0x4c0),
113 INTC_VECT(SCI1_ERI, 0x4e0), INTC_VECT(SCI1_RXI, 0x500), 95 INTC_VECT(SCI1, 0x4e0), INTC_VECT(SCI1, 0x500),
114 INTC_VECT(SCI1_TXI, 0x520), INTC_VECT(SCI1_TEI, 0x540), 96 INTC_VECT(SCI1, 0x520), INTC_VECT(SCI1, 0x540),
115 INTC_VECT(SCIF_ERI, 0x700), INTC_VECT(SCIF_RXI, 0x720), 97 INTC_VECT(SCIF, 0x700), INTC_VECT(SCIF, 0x720),
116 INTC_VECT(SCIF_BRI, 0x740), INTC_VECT(SCIF_TXI, 0x760), 98 INTC_VECT(SCIF, 0x740), INTC_VECT(SCIF, 0x760),
117 INTC_VECT(WDT, 0x560), 99 INTC_VECT(WDT, 0x560),
118 INTC_VECT(REF_RCMI, 0x580), INTC_VECT(REF_ROVI, 0x5a0), 100 INTC_VECT(REF, 0x580), INTC_VECT(REF, 0x5a0),
119};
120
121static struct intc_group groups[] __initdata = {
122 INTC_GROUP(TMU2, TMU2_TUNI, TMU2_TICPI),
123 INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
124 INTC_GROUP(SCI1, SCI1_ERI, SCI1_RXI, SCI1_TXI, SCI1_TEI),
125 INTC_GROUP(SCIF, SCIF_ERI, SCIF_RXI, SCIF_BRI, SCIF_TXI),
126 INTC_GROUP(REF, REF_RCMI, REF_ROVI),
127}; 101};
128 102
129static struct intc_prio_reg prio_registers[] __initdata = { 103static struct intc_prio_reg prio_registers[] __initdata = {
@@ -136,7 +110,7 @@ static struct intc_prio_reg prio_registers[] __initdata = {
136 PCIC1, PCIC0_PCISERR } }, 110 PCIC1, PCIC0_PCISERR } },
137}; 111};
138 112
139static DECLARE_INTC_DESC(intc_desc, "sh7750", vectors, groups, 113static DECLARE_INTC_DESC(intc_desc, "sh7750", vectors, NULL,
140 NULL, prio_registers, NULL); 114 NULL, prio_registers, NULL);
141 115
142/* SH7750, SH7750S, SH7751 and SH7091 all have 4-channel DMA controllers */ 116/* SH7750, SH7750S, SH7751 and SH7091 all have 4-channel DMA controllers */
@@ -145,39 +119,28 @@ static DECLARE_INTC_DESC(intc_desc, "sh7750", vectors, groups,
145 defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 119 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
146 defined(CONFIG_CPU_SUBTYPE_SH7091) 120 defined(CONFIG_CPU_SUBTYPE_SH7091)
147static struct intc_vect vectors_dma4[] __initdata = { 121static struct intc_vect vectors_dma4[] __initdata = {
148 INTC_VECT(DMAC_DMTE0, 0x640), INTC_VECT(DMAC_DMTE1, 0x660), 122 INTC_VECT(DMAC, 0x640), INTC_VECT(DMAC, 0x660),
149 INTC_VECT(DMAC_DMTE2, 0x680), INTC_VECT(DMAC_DMTE3, 0x6a0), 123 INTC_VECT(DMAC, 0x680), INTC_VECT(DMAC, 0x6a0),
150 INTC_VECT(DMAC_DMAE, 0x6c0), 124 INTC_VECT(DMAC, 0x6c0),
151};
152
153static struct intc_group groups_dma4[] __initdata = {
154 INTC_GROUP(DMAC, DMAC_DMTE0, DMAC_DMTE1, DMAC_DMTE2,
155 DMAC_DMTE3, DMAC_DMAE),
156}; 125};
157 126
158static DECLARE_INTC_DESC(intc_desc_dma4, "sh7750_dma4", 127static DECLARE_INTC_DESC(intc_desc_dma4, "sh7750_dma4",
159 vectors_dma4, groups_dma4, 128 vectors_dma4, NULL,
160 NULL, prio_registers, NULL); 129 NULL, prio_registers, NULL);
161#endif 130#endif
162 131
163/* SH7750R and SH7751R both have 8-channel DMA controllers */ 132/* SH7750R and SH7751R both have 8-channel DMA controllers */
164#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || defined(CONFIG_CPU_SUBTYPE_SH7751R) 133#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || defined(CONFIG_CPU_SUBTYPE_SH7751R)
165static struct intc_vect vectors_dma8[] __initdata = { 134static struct intc_vect vectors_dma8[] __initdata = {
166 INTC_VECT(DMAC_DMTE0, 0x640), INTC_VECT(DMAC_DMTE1, 0x660), 135 INTC_VECT(DMAC, 0x640), INTC_VECT(DMAC, 0x660),
167 INTC_VECT(DMAC_DMTE2, 0x680), INTC_VECT(DMAC_DMTE3, 0x6a0), 136 INTC_VECT(DMAC, 0x680), INTC_VECT(DMAC, 0x6a0),
168 INTC_VECT(DMAC_DMTE4, 0x780), INTC_VECT(DMAC_DMTE5, 0x7a0), 137 INTC_VECT(DMAC, 0x780), INTC_VECT(DMAC, 0x7a0),
169 INTC_VECT(DMAC_DMTE6, 0x7c0), INTC_VECT(DMAC_DMTE7, 0x7e0), 138 INTC_VECT(DMAC, 0x7c0), INTC_VECT(DMAC, 0x7e0),
170 INTC_VECT(DMAC_DMAE, 0x6c0), 139 INTC_VECT(DMAC, 0x6c0),
171};
172
173static struct intc_group groups_dma8[] __initdata = {
174 INTC_GROUP(DMAC, DMAC_DMTE0, DMAC_DMTE1, DMAC_DMTE2,
175 DMAC_DMTE3, DMAC_DMTE4, DMAC_DMTE5,
176 DMAC_DMTE6, DMAC_DMTE7, DMAC_DMAE),
177}; 140};
178 141
179static DECLARE_INTC_DESC(intc_desc_dma8, "sh7750_dma8", 142static DECLARE_INTC_DESC(intc_desc_dma8, "sh7750_dma8",
180 vectors_dma8, groups_dma8, 143 vectors_dma8, NULL,
181 NULL, prio_registers, NULL); 144 NULL, prio_registers, NULL);
182#endif 145#endif
183 146
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile
index 8e344ec5847e..1a92361feeb9 100644
--- a/arch/sh/kernel/cpu/sh4a/Makefile
+++ b/arch/sh/kernel/cpu/sh4a/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7763) += setup-sh7763.o
7obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o 7obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o
8obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o 8obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o
9obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o 9obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o
10obj-$(CONFIG_CPU_SUBTYPE_SH7786) += setup-sh7786.o
10obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o 11obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o
11obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o 12obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o
12obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o 13obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o
@@ -21,6 +22,7 @@ clock-$(CONFIG_CPU_SUBTYPE_SH7763) := clock-sh7763.o
21clock-$(CONFIG_CPU_SUBTYPE_SH7770) := clock-sh7770.o 22clock-$(CONFIG_CPU_SUBTYPE_SH7770) := clock-sh7770.o
22clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o 23clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o
23clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o 24clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o
25clock-$(CONFIG_CPU_SUBTYPE_SH7786) := clock-sh7786.o
24clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7722.o 26clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7722.o
25clock-$(CONFIG_CPU_SUBTYPE_SH7722) := clock-sh7722.o 27clock-$(CONFIG_CPU_SUBTYPE_SH7722) := clock-sh7722.o
26clock-$(CONFIG_CPU_SUBTYPE_SH7723) := clock-sh7722.o 28clock-$(CONFIG_CPU_SUBTYPE_SH7723) := clock-sh7722.o
@@ -31,6 +33,7 @@ clock-$(CONFIG_CPU_SUBTYPE_SHX3) := clock-shx3.o
31pinmux-$(CONFIG_CPU_SUBTYPE_SH7722) := pinmux-sh7722.o 33pinmux-$(CONFIG_CPU_SUBTYPE_SH7722) := pinmux-sh7722.o
32pinmux-$(CONFIG_CPU_SUBTYPE_SH7723) := pinmux-sh7723.o 34pinmux-$(CONFIG_CPU_SUBTYPE_SH7723) := pinmux-sh7723.o
33pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o 35pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o
36pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o
34 37
35obj-y += $(clock-y) 38obj-y += $(clock-y)
36obj-$(CONFIG_SMP) += $(smp-y) 39obj-$(CONFIG_SMP) += $(smp-y)
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
new file mode 100644
index 000000000000..f84a9c134471
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -0,0 +1,148 @@
1/*
2 * arch/sh/kernel/cpu/sh4a/clock-sh7786.c
3 *
4 * SH7786 support for the clock framework
5 *
6 * Copyright (C) 2008, 2009 Renesas Solutions Corp.
7 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
8 *
9 * Based on SH7785
10 * Copyright (C) 2007 Paul Mundt
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file "COPYING" in the main directory of this archive
14 * for more details.
15 */
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <asm/clock.h>
19#include <asm/freq.h>
20#include <asm/io.h>
21
22static int ifc_divisors[] = { 1, 2, 4, 1 };
23static int sfc_divisors[] = { 1, 1, 4, 1 };
24static int bfc_divisors[] = { 1, 1, 1, 1, 1, 12, 16, 1,
25 24, 32, 1, 1, 1, 1, 1, 1 };
26static int mfc_divisors[] = { 1, 1, 4, 1 };
27static int pfc_divisors[] = { 1, 1, 1, 1, 1, 1, 16, 1,
28 24, 32, 1, 48, 1, 1, 1, 1 };
29
30static void master_clk_init(struct clk *clk)
31{
32 clk->rate *= pfc_divisors[ctrl_inl(FRQMR1) & 0x000f];
33}
34
35static struct clk_ops sh7786_master_clk_ops = {
36 .init = master_clk_init,
37};
38
39static void module_clk_recalc(struct clk *clk)
40{
41 int idx = (ctrl_inl(FRQMR1) & 0x000f);
42 clk->rate = clk->parent->rate / pfc_divisors[idx];
43}
44
45static struct clk_ops sh7786_module_clk_ops = {
46 .recalc = module_clk_recalc,
47};
48
49static void bus_clk_recalc(struct clk *clk)
50{
51 int idx = ((ctrl_inl(FRQMR1) >> 16) & 0x000f);
52 clk->rate = clk->parent->rate / bfc_divisors[idx];
53}
54
55static struct clk_ops sh7786_bus_clk_ops = {
56 .recalc = bus_clk_recalc,
57};
58
59static void cpu_clk_recalc(struct clk *clk)
60{
61 int idx = ((ctrl_inl(FRQMR1) >> 28) & 0x0003);
62 clk->rate = clk->parent->rate / ifc_divisors[idx];
63}
64
65static struct clk_ops sh7786_cpu_clk_ops = {
66 .recalc = cpu_clk_recalc,
67};
68
69static struct clk_ops *sh7786_clk_ops[] = {
70 &sh7786_master_clk_ops,
71 &sh7786_module_clk_ops,
72 &sh7786_bus_clk_ops,
73 &sh7786_cpu_clk_ops,
74};
75
76void __init arch_init_clk_ops(struct clk_ops **ops, int idx)
77{
78 if (idx < ARRAY_SIZE(sh7786_clk_ops))
79 *ops = sh7786_clk_ops[idx];
80}
81
82static void shyway_clk_recalc(struct clk *clk)
83{
84 int idx = ((ctrl_inl(FRQMR1) >> 20) & 0x0003);
85 clk->rate = clk->parent->rate / sfc_divisors[idx];
86}
87
88static struct clk_ops sh7786_shyway_clk_ops = {
89 .recalc = shyway_clk_recalc,
90};
91
92static struct clk sh7786_shyway_clk = {
93 .name = "shyway_clk",
94 .flags = CLK_ALWAYS_ENABLED,
95 .ops = &sh7786_shyway_clk_ops,
96};
97
98static void ddr_clk_recalc(struct clk *clk)
99{
100 int idx = ((ctrl_inl(FRQMR1) >> 12) & 0x0003);
101 clk->rate = clk->parent->rate / mfc_divisors[idx];
102}
103
104static struct clk_ops sh7786_ddr_clk_ops = {
105 .recalc = ddr_clk_recalc,
106};
107
108static struct clk sh7786_ddr_clk = {
109 .name = "ddr_clk",
110 .flags = CLK_ALWAYS_ENABLED,
111 .ops = &sh7786_ddr_clk_ops,
112};
113
114/*
115 * Additional SH7786-specific on-chip clocks that aren't already part of the
116 * clock framework
117 */
118static struct clk *sh7786_onchip_clocks[] = {
119 &sh7786_shyway_clk,
120 &sh7786_ddr_clk,
121};
122
123static int __init sh7786_clk_init(void)
124{
125 struct clk *clk = clk_get(NULL, "master_clk");
126 int i;
127
128 for (i = 0; i < ARRAY_SIZE(sh7786_onchip_clocks); i++) {
129 struct clk *clkp = sh7786_onchip_clocks[i];
130
131 clkp->parent = clk;
132 clk_register(clkp);
133 clk_enable(clkp);
134 }
135
136 /*
137 * Now that we have the rest of the clocks registered, we need to
138 * force the parent clock to propagate so that these clocks will
139 * automatically figure out their rate. We cheat by handing the
140 * parent clock its current rate and forcing child propagation.
141 */
142 clk_set_rate(clk, clk_get_rate(clk));
143
144 clk_put(clk);
145
146 return 0;
147}
148arch_initcall(sh7786_clk_init);
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c
new file mode 100644
index 000000000000..373b3447bfdf
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c
@@ -0,0 +1,950 @@
1/*
2 * SH7786 Pinmux
3 *
4 * Copyright (C) 2008, 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
6 *
7 * Based on SH7785 pinmux
8 *
9 * Copyright (C) 2008 Magnus Damm
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 */
15
16#include <linux/init.h>
17#include <linux/kernel.h>
18#include <linux/gpio.h>
19#include <cpu/sh7786.h>
20
21enum {
22 PINMUX_RESERVED = 0,
23
24 PINMUX_DATA_BEGIN,
25 PA7_DATA, PA6_DATA, PA5_DATA, PA4_DATA,
26 PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA,
27 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
28 PB3_DATA, PB2_DATA, PB1_DATA, PB0_DATA,
29 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
30 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA,
31 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
32 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA,
33 PE7_DATA, PE6_DATA,
34 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
35 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA,
36 PG7_DATA, PG6_DATA, PG5_DATA,
37 PH7_DATA, PH6_DATA, PH5_DATA, PH4_DATA,
38 PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA,
39 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
40 PJ3_DATA, PJ2_DATA, PJ1_DATA,
41 PINMUX_DATA_END,
42
43 PINMUX_INPUT_BEGIN,
44 PA7_IN, PA6_IN, PA5_IN, PA4_IN,
45 PA3_IN, PA2_IN, PA1_IN, PA0_IN,
46 PB7_IN, PB6_IN, PB5_IN, PB4_IN,
47 PB3_IN, PB2_IN, PB1_IN, PB0_IN,
48 PC7_IN, PC6_IN, PC5_IN, PC4_IN,
49 PC3_IN, PC2_IN, PC1_IN, PC0_IN,
50 PD7_IN, PD6_IN, PD5_IN, PD4_IN,
51 PD3_IN, PD2_IN, PD1_IN, PD0_IN,
52 PE7_IN, PE6_IN,
53 PF7_IN, PF6_IN, PF5_IN, PF4_IN,
54 PF3_IN, PF2_IN, PF1_IN, PF0_IN,
55 PG7_IN, PG6_IN, PG5_IN,
56 PH7_IN, PH6_IN, PH5_IN, PH4_IN,
57 PH3_IN, PH2_IN, PH1_IN, PH0_IN,
58 PJ7_IN, PJ6_IN, PJ5_IN, PJ4_IN,
59 PJ3_IN, PJ2_IN, PJ1_IN,
60 PINMUX_INPUT_END,
61
62 PINMUX_INPUT_PULLUP_BEGIN,
63 PA7_IN_PU, PA6_IN_PU, PA5_IN_PU, PA4_IN_PU,
64 PA3_IN_PU, PA2_IN_PU, PA1_IN_PU, PA0_IN_PU,
65 PB7_IN_PU, PB6_IN_PU, PB5_IN_PU, PB4_IN_PU,
66 PB3_IN_PU, PB2_IN_PU, PB1_IN_PU, PB0_IN_PU,
67 PC7_IN_PU, PC6_IN_PU, PC5_IN_PU, PC4_IN_PU,
68 PC3_IN_PU, PC2_IN_PU, PC1_IN_PU, PC0_IN_PU,
69 PD7_IN_PU, PD6_IN_PU, PD5_IN_PU, PD4_IN_PU,
70 PD3_IN_PU, PD2_IN_PU, PD1_IN_PU, PD0_IN_PU,
71 PE7_IN_PU, PE6_IN_PU,
72 PF7_IN_PU, PF6_IN_PU, PF5_IN_PU, PF4_IN_PU,
73 PF3_IN_PU, PF2_IN_PU, PF1_IN_PU, PF0_IN_PU,
74 PG7_IN_PU, PG6_IN_PU, PG5_IN_PU,
75 PH7_IN_PU, PH6_IN_PU, PH5_IN_PU, PH4_IN_PU,
76 PH3_IN_PU, PH2_IN_PU, PH1_IN_PU, PH0_IN_PU,
77 PJ7_IN_PU, PJ6_IN_PU, PJ5_IN_PU, PJ4_IN_PU,
78 PJ3_IN_PU, PJ2_IN_PU, PJ1_IN_PU,
79 PINMUX_INPUT_PULLUP_END,
80
81 PINMUX_OUTPUT_BEGIN,
82 PA7_OUT, PA6_OUT, PA5_OUT, PA4_OUT,
83 PA3_OUT, PA2_OUT, PA1_OUT, PA0_OUT,
84 PB7_OUT, PB6_OUT, PB5_OUT, PB4_OUT,
85 PB3_OUT, PB2_OUT, PB1_OUT, PB0_OUT,
86 PC7_OUT, PC6_OUT, PC5_OUT, PC4_OUT,
87 PC3_OUT, PC2_OUT, PC1_OUT, PC0_OUT,
88 PD7_OUT, PD6_OUT, PD5_OUT, PD4_OUT,
89 PD3_OUT, PD2_OUT, PD1_OUT, PD0_OUT,
90 PE7_OUT, PE6_OUT,
91 PF7_OUT, PF6_OUT, PF5_OUT, PF4_OUT,
92 PF3_OUT, PF2_OUT, PF1_OUT, PF0_OUT,
93 PG7_OUT, PG6_OUT, PG5_OUT,
94 PH7_OUT, PH6_OUT, PH5_OUT, PH4_OUT,
95 PH3_OUT, PH2_OUT, PH1_OUT, PH0_OUT,
96 PJ7_OUT, PJ6_OUT, PJ5_OUT, PJ4_OUT,
97 PJ3_OUT, PJ2_OUT, PJ1_OUT,
98 PINMUX_OUTPUT_END,
99
100 PINMUX_FUNCTION_BEGIN,
101 PA7_FN, PA6_FN, PA5_FN, PA4_FN,
102 PA3_FN, PA2_FN, PA1_FN, PA0_FN,
103 PB7_FN, PB6_FN, PB5_FN, PB4_FN,
104 PB3_FN, PB2_FN, PB1_FN, PB0_FN,
105 PC7_FN, PC6_FN, PC5_FN, PC4_FN,
106 PC3_FN, PC2_FN, PC1_FN, PC0_FN,
107 PD7_FN, PD6_FN, PD5_FN, PD4_FN,
108 PD3_FN, PD2_FN, PD1_FN, PD0_FN,
109 PE7_FN, PE6_FN,
110 PF7_FN, PF6_FN, PF5_FN, PF4_FN,
111 PF3_FN, PF2_FN, PF1_FN, PF0_FN,
112 PG7_FN, PG6_FN, PG5_FN,
113 PH7_FN, PH6_FN, PH5_FN, PH4_FN,
114 PH3_FN, PH2_FN, PH1_FN, PH0_FN,
115 PJ7_FN, PJ6_FN, PJ5_FN, PJ4_FN,
116 PJ3_FN, PJ2_FN, PJ1_FN,
117 P1MSEL14_0, P1MSEL14_1,
118 P1MSEL13_0, P1MSEL13_1,
119 P1MSEL12_0, P1MSEL12_1,
120 P1MSEL11_0, P1MSEL11_1,
121 P1MSEL10_0, P1MSEL10_1,
122 P1MSEL9_0, P1MSEL9_1,
123 P1MSEL8_0, P1MSEL8_1,
124 P1MSEL7_0, P1MSEL7_1,
125 P1MSEL6_0, P1MSEL6_1,
126 P1MSEL5_0, P1MSEL5_1,
127 P1MSEL4_0, P1MSEL4_1,
128 P1MSEL3_0, P1MSEL3_1,
129 P1MSEL2_0, P1MSEL2_1,
130 P1MSEL1_0, P1MSEL1_1,
131 P1MSEL0_0, P1MSEL0_1,
132
133 P2MSEL15_0, P2MSEL15_1,
134 P2MSEL14_0, P2MSEL14_1,
135 P2MSEL13_0, P2MSEL13_1,
136 P2MSEL12_0, P2MSEL12_1,
137 P2MSEL11_0, P2MSEL11_1,
138 P2MSEL10_0, P2MSEL10_1,
139 P2MSEL9_0, P2MSEL9_1,
140 P2MSEL8_0, P2MSEL8_1,
141 P2MSEL7_0, P2MSEL7_1,
142 P2MSEL6_0, P2MSEL6_1,
143 P2MSEL5_0, P2MSEL5_1,
144 P2MSEL4_0, P2MSEL4_1,
145 P2MSEL3_0, P2MSEL3_1,
146 P2MSEL2_0, P2MSEL2_1,
147 P2MSEL1_0, P2MSEL1_1,
148 P2MSEL0_0, P2MSEL0_1,
149 PINMUX_FUNCTION_END,
150
151 PINMUX_MARK_BEGIN,
152 CDE_MARK,
153 ETH_MAGIC_MARK,
154 DISP_MARK,
155 ETH_LINK_MARK,
156 DR5_MARK,
157 ETH_TX_ER_MARK,
158 DR4_MARK,
159 ETH_TX_EN_MARK,
160 DR3_MARK,
161 ETH_TXD3_MARK,
162 DR2_MARK,
163 ETH_TXD2_MARK,
164 DR1_MARK,
165 ETH_TXD1_MARK,
166 DR0_MARK,
167 ETH_TXD0_MARK,
168
169 VSYNC_MARK,
170 HSPI_CLK_MARK,
171 ODDF_MARK,
172 HSPI_CS_MARK,
173 DG5_MARK,
174 ETH_MDIO_MARK,
175 DG4_MARK,
176 ETH_RX_CLK_MARK,
177 DG3_MARK,
178 ETH_MDC_MARK,
179 DG2_MARK,
180 ETH_COL_MARK,
181 DG1_MARK,
182 ETH_TX_CLK_MARK,
183 DG0_MARK,
184 ETH_CRS_MARK,
185
186 DCLKIN_MARK,
187 HSPI_RX_MARK,
188 HSYNC_MARK,
189 HSPI_TX_MARK,
190 DB5_MARK,
191 ETH_RXD3_MARK,
192 DB4_MARK,
193 ETH_RXD2_MARK,
194 DB3_MARK,
195 ETH_RXD1_MARK,
196 DB2_MARK,
197 ETH_RXD0_MARK,
198 DB1_MARK,
199 ETH_RX_DV_MARK,
200 DB0_MARK,
201 ETH_RX_ER_MARK,
202
203 DCLKOUT_MARK,
204 SCIF1_SLK_MARK,
205 SCIF1_RXD_MARK,
206 SCIF1_TXD_MARK,
207 DACK1_MARK,
208 BACK_MARK,
209 FALE_MARK,
210 DACK0_MARK,
211 FCLE_MARK,
212 DREQ1_MARK,
213 BREQ_MARK,
214 USB_OVC1_MARK,
215 DREQ0_MARK,
216 USB_OVC0_MARK,
217
218 USB_PENC1_MARK,
219 USB_PENC0_MARK,
220
221 HAC1_SDOUT_MARK,
222 SSI1_SDATA_MARK,
223 SDIF1CMD_MARK,
224 HAC1_SDIN_MARK,
225 SSI1_SCK_MARK,
226 SDIF1CD_MARK,
227 HAC1_SYNC_MARK,
228 SSI1_WS_MARK,
229 SDIF1WP_MARK,
230 HAC1_BITCLK_MARK,
231 SSI1_CLK_MARK,
232 SDIF1CLK_MARK,
233 HAC0_SDOUT_MARK,
234 SSI0_SDATA_MARK,
235 SDIF1D3_MARK,
236 HAC0_SDIN_MARK,
237 SSI0_SCK_MARK,
238 SDIF1D2_MARK,
239 HAC0_SYNC_MARK,
240 SSI0_WS_MARK,
241 SDIF1D1_MARK,
242 HAC0_BITCLK_MARK,
243 SSI0_CLK_MARK,
244 SDIF1D0_MARK,
245
246 SCIF3_SCK_MARK,
247 SSI2_SDATA_MARK,
248 SCIF3_RXD_MARK,
249 TCLK_MARK,
250 SSI2_SCK_MARK,
251 SCIF3_TXD_MARK,
252 HAC_RES_MARK,
253 SSI2_WS_MARK,
254
255 DACK3_MARK,
256 SDIF0CMD_MARK,
257 DACK2_MARK,
258 SDIF0CD_MARK,
259 DREQ3_MARK,
260 SDIF0WP_MARK,
261 SCIF0_CTS_MARK,
262 DREQ2_MARK,
263 SDIF0CLK_MARK,
264 SCIF0_RTS_MARK,
265 IRL7_MARK,
266 SDIF0D3_MARK,
267 SCIF0_SCK_MARK,
268 IRL6_MARK,
269 SDIF0D2_MARK,
270 SCIF0_RXD_MARK,
271 IRL5_MARK,
272 SDIF0D1_MARK,
273 SCIF0_TXD_MARK,
274 IRL4_MARK,
275 SDIF0D0_MARK,
276
277 SCIF5_SCK_MARK,
278 FRB_MARK,
279 SCIF5_RXD_MARK,
280 IOIS16_MARK,
281 SCIF5_TXD_MARK,
282 CE2B_MARK,
283 DRAK3_MARK,
284 CE2A_MARK,
285 SCIF4_SCK_MARK,
286 DRAK2_MARK,
287 SSI3_WS_MARK,
288 SCIF4_RXD_MARK,
289 DRAK1_MARK,
290 SSI3_SDATA_MARK,
291 FSTATUS_MARK,
292 SCIF4_TXD_MARK,
293 DRAK0_MARK,
294 SSI3_SCK_MARK,
295 FSE_MARK,
296 PINMUX_MARK_END,
297};
298
299static pinmux_enum_t pinmux_data[] = {
300
301 /* PA GPIO */
302 PINMUX_DATA(PA7_DATA, PA7_IN, PA7_OUT, PA7_IN_PU),
303 PINMUX_DATA(PA6_DATA, PA6_IN, PA6_OUT, PA6_IN_PU),
304 PINMUX_DATA(PA5_DATA, PA5_IN, PA5_OUT, PA5_IN_PU),
305 PINMUX_DATA(PA4_DATA, PA4_IN, PA4_OUT, PA4_IN_PU),
306 PINMUX_DATA(PA3_DATA, PA3_IN, PA3_OUT, PA3_IN_PU),
307 PINMUX_DATA(PA2_DATA, PA2_IN, PA2_OUT, PA2_IN_PU),
308 PINMUX_DATA(PA1_DATA, PA1_IN, PA1_OUT, PA1_IN_PU),
309 PINMUX_DATA(PA0_DATA, PA0_IN, PA0_OUT, PA0_IN_PU),
310
311 /* PB GPIO */
312 PINMUX_DATA(PB7_DATA, PB7_IN, PB7_OUT, PB7_IN_PU),
313 PINMUX_DATA(PB6_DATA, PB6_IN, PB6_OUT, PB6_IN_PU),
314 PINMUX_DATA(PB5_DATA, PB5_IN, PB5_OUT, PB5_IN_PU),
315 PINMUX_DATA(PB4_DATA, PB4_IN, PB4_OUT, PB4_IN_PU),
316 PINMUX_DATA(PB3_DATA, PB3_IN, PB3_OUT, PB3_IN_PU),
317 PINMUX_DATA(PB2_DATA, PB2_IN, PB2_OUT, PB2_IN_PU),
318 PINMUX_DATA(PB1_DATA, PB1_IN, PB1_OUT, PB1_IN_PU),
319 PINMUX_DATA(PB0_DATA, PB0_IN, PB0_OUT, PB0_IN_PU),
320
321 /* PC GPIO */
322 PINMUX_DATA(PC7_DATA, PC7_IN, PC7_OUT, PC7_IN_PU),
323 PINMUX_DATA(PC6_DATA, PC6_IN, PC6_OUT, PC6_IN_PU),
324 PINMUX_DATA(PC5_DATA, PC5_IN, PC5_OUT, PC5_IN_PU),
325 PINMUX_DATA(PC4_DATA, PC4_IN, PC4_OUT, PC4_IN_PU),
326 PINMUX_DATA(PC3_DATA, PC3_IN, PC3_OUT, PC3_IN_PU),
327 PINMUX_DATA(PC2_DATA, PC2_IN, PC2_OUT, PC2_IN_PU),
328 PINMUX_DATA(PC1_DATA, PC1_IN, PC1_OUT, PC1_IN_PU),
329 PINMUX_DATA(PC0_DATA, PC0_IN, PC0_OUT, PC0_IN_PU),
330
331 /* PD GPIO */
332 PINMUX_DATA(PD7_DATA, PD7_IN, PD7_OUT, PD7_IN_PU),
333 PINMUX_DATA(PD6_DATA, PD6_IN, PD6_OUT, PD6_IN_PU),
334 PINMUX_DATA(PD5_DATA, PD5_IN, PD5_OUT, PD5_IN_PU),
335 PINMUX_DATA(PD4_DATA, PD4_IN, PD4_OUT, PD4_IN_PU),
336 PINMUX_DATA(PD3_DATA, PD3_IN, PD3_OUT, PD3_IN_PU),
337 PINMUX_DATA(PD2_DATA, PD2_IN, PD2_OUT, PD2_IN_PU),
338 PINMUX_DATA(PD1_DATA, PD1_IN, PD1_OUT, PD1_IN_PU),
339 PINMUX_DATA(PD0_DATA, PD0_IN, PD0_OUT, PD0_IN_PU),
340
341 /* PE GPIO */
342 PINMUX_DATA(PE7_DATA, PE7_IN, PE7_OUT, PE7_IN_PU),
343 PINMUX_DATA(PE6_DATA, PE6_IN, PE6_OUT, PE6_IN_PU),
344
345 /* PF GPIO */
346 PINMUX_DATA(PF7_DATA, PF7_IN, PF7_OUT, PF7_IN_PU),
347 PINMUX_DATA(PF6_DATA, PF6_IN, PF6_OUT, PF6_IN_PU),
348 PINMUX_DATA(PF5_DATA, PF5_IN, PF5_OUT, PF5_IN_PU),
349 PINMUX_DATA(PF4_DATA, PF4_IN, PF4_OUT, PF4_IN_PU),
350 PINMUX_DATA(PF3_DATA, PF3_IN, PF3_OUT, PF3_IN_PU),
351 PINMUX_DATA(PF2_DATA, PF2_IN, PF2_OUT, PF2_IN_PU),
352 PINMUX_DATA(PF1_DATA, PF1_IN, PF1_OUT, PF1_IN_PU),
353 PINMUX_DATA(PF0_DATA, PF0_IN, PF0_OUT, PF0_IN_PU),
354
355 /* PG GPIO */
356 PINMUX_DATA(PG7_DATA, PG7_IN, PG7_OUT, PG7_IN_PU),
357 PINMUX_DATA(PG6_DATA, PG6_IN, PG6_OUT, PG6_IN_PU),
358 PINMUX_DATA(PG5_DATA, PG5_IN, PG5_OUT, PG5_IN_PU),
359
360 /* PH GPIO */
361 PINMUX_DATA(PH7_DATA, PH7_IN, PH7_OUT, PH7_IN_PU),
362 PINMUX_DATA(PH6_DATA, PH6_IN, PH6_OUT, PH6_IN_PU),
363 PINMUX_DATA(PH5_DATA, PH5_IN, PH5_OUT, PH5_IN_PU),
364 PINMUX_DATA(PH4_DATA, PH4_IN, PH4_OUT, PH4_IN_PU),
365 PINMUX_DATA(PH3_DATA, PH3_IN, PH3_OUT, PH3_IN_PU),
366 PINMUX_DATA(PH2_DATA, PH2_IN, PH2_OUT, PH2_IN_PU),
367 PINMUX_DATA(PH1_DATA, PH1_IN, PH1_OUT, PH1_IN_PU),
368 PINMUX_DATA(PH0_DATA, PH0_IN, PH0_OUT, PH0_IN_PU),
369
370 /* PJ GPIO */
371 PINMUX_DATA(PJ7_DATA, PJ7_IN, PJ7_OUT, PJ7_IN_PU),
372 PINMUX_DATA(PJ6_DATA, PJ6_IN, PJ6_OUT, PJ6_IN_PU),
373 PINMUX_DATA(PJ5_DATA, PJ5_IN, PJ5_OUT, PJ5_IN_PU),
374 PINMUX_DATA(PJ4_DATA, PJ4_IN, PJ4_OUT, PJ4_IN_PU),
375 PINMUX_DATA(PJ3_DATA, PJ3_IN, PJ3_OUT, PJ3_IN_PU),
376 PINMUX_DATA(PJ2_DATA, PJ2_IN, PJ2_OUT, PJ2_IN_PU),
377 PINMUX_DATA(PJ1_DATA, PJ1_IN, PJ1_OUT, PJ1_IN_PU),
378
379 /* PA FN */
380 PINMUX_MARK_BEGIN,
381 PINMUX_DATA(CDE_MARK, P1MSEL2_0, PA7_FN),
382 PINMUX_DATA(DISP_MARK, P1MSEL2_0, PA6_FN),
383 PINMUX_DATA(DR5_MARK, P1MSEL2_0, PA5_FN),
384 PINMUX_DATA(DR4_MARK, P1MSEL2_0, PA4_FN),
385 PINMUX_DATA(DR3_MARK, P1MSEL2_0, PA3_FN),
386 PINMUX_DATA(DR2_MARK, P1MSEL2_0, PA2_FN),
387 PINMUX_DATA(DR1_MARK, P1MSEL2_0, PA1_FN),
388 PINMUX_DATA(DR0_MARK, P1MSEL2_0, PA0_FN),
389 PINMUX_DATA(ETH_MAGIC_MARK, P1MSEL2_1, PA7_FN),
390 PINMUX_DATA(ETH_LINK_MARK, P1MSEL2_1, PA6_FN),
391 PINMUX_DATA(ETH_TX_ER_MARK, P1MSEL2_1, PA5_FN),
392 PINMUX_DATA(ETH_TX_EN_MARK, P1MSEL2_1, PA4_FN),
393 PINMUX_DATA(ETH_TXD3_MARK, P1MSEL2_1, PA3_FN),
394 PINMUX_DATA(ETH_TXD2_MARK, P1MSEL2_1, PA2_FN),
395 PINMUX_DATA(ETH_TXD1_MARK, P1MSEL2_1, PA1_FN),
396 PINMUX_DATA(ETH_TXD0_MARK, P1MSEL2_1, PA0_FN),
397
398 /* PB FN */
399 PINMUX_DATA(VSYNC_MARK, P1MSEL3_0, PB7_FN),
400 PINMUX_DATA(ODDF_MARK, P1MSEL3_0, PB6_FN),
401 PINMUX_DATA(DG5_MARK, P1MSEL2_0, PB5_FN),
402 PINMUX_DATA(DG4_MARK, P1MSEL2_0, PB4_FN),
403 PINMUX_DATA(DG3_MARK, P1MSEL2_0, PB3_FN),
404 PINMUX_DATA(DG2_MARK, P1MSEL2_0, PB2_FN),
405 PINMUX_DATA(DG1_MARK, P1MSEL2_0, PB1_FN),
406 PINMUX_DATA(DG0_MARK, P1MSEL2_0, PB0_FN),
407 PINMUX_DATA(HSPI_CLK_MARK, P1MSEL3_1, PB7_FN),
408 PINMUX_DATA(HSPI_CS_MARK, P1MSEL3_1, PB6_FN),
409 PINMUX_DATA(ETH_MDIO_MARK, P1MSEL2_1, PB5_FN),
410 PINMUX_DATA(ETH_RX_CLK_MARK, P1MSEL2_1, PB4_FN),
411 PINMUX_DATA(ETH_MDC_MARK, P1MSEL2_1, PB3_FN),
412 PINMUX_DATA(ETH_COL_MARK, P1MSEL2_1, PB2_FN),
413 PINMUX_DATA(ETH_TX_CLK_MARK, P1MSEL2_1, PB1_FN),
414 PINMUX_DATA(ETH_CRS_MARK, P1MSEL2_1, PB0_FN),
415
416 /* PC FN */
417 PINMUX_DATA(DCLKIN_MARK, P1MSEL3_0, PC7_FN),
418 PINMUX_DATA(HSYNC_MARK, P1MSEL3_0, PC6_FN),
419 PINMUX_DATA(DB5_MARK, P1MSEL2_0, PC5_FN),
420 PINMUX_DATA(DB4_MARK, P1MSEL2_0, PC4_FN),
421 PINMUX_DATA(DB3_MARK, P1MSEL2_0, PC3_FN),
422 PINMUX_DATA(DB2_MARK, P1MSEL2_0, PC2_FN),
423 PINMUX_DATA(DB1_MARK, P1MSEL2_0, PC1_FN),
424 PINMUX_DATA(DB0_MARK, P1MSEL2_0, PC0_FN),
425
426 PINMUX_DATA(HSPI_RX_MARK, P1MSEL3_1, PC7_FN),
427 PINMUX_DATA(HSPI_TX_MARK, P1MSEL3_1, PC6_FN),
428 PINMUX_DATA(ETH_RXD3_MARK, P1MSEL2_1, PC5_FN),
429 PINMUX_DATA(ETH_RXD2_MARK, P1MSEL2_1, PC4_FN),
430 PINMUX_DATA(ETH_RXD1_MARK, P1MSEL2_1, PC3_FN),
431 PINMUX_DATA(ETH_RXD0_MARK, P1MSEL2_1, PC2_FN),
432 PINMUX_DATA(ETH_RX_DV_MARK, P1MSEL2_1, PC1_FN),
433 PINMUX_DATA(ETH_RX_ER_MARK, P1MSEL2_1, PC0_FN),
434
435 /* PD FN */
436 PINMUX_DATA(DCLKOUT_MARK, PD7_FN),
437 PINMUX_DATA(SCIF1_SLK_MARK, PD6_FN),
438 PINMUX_DATA(SCIF1_RXD_MARK, PD5_FN),
439 PINMUX_DATA(SCIF1_TXD_MARK, PD4_FN),
440 PINMUX_DATA(DACK1_MARK, P1MSEL13_1, P1MSEL12_0, PD3_FN),
441 PINMUX_DATA(BACK_MARK, P1MSEL13_0, P1MSEL12_1, PD3_FN),
442 PINMUX_DATA(FALE_MARK, P1MSEL13_0, P1MSEL12_0, PD3_FN),
443 PINMUX_DATA(DACK0_MARK, P1MSEL14_1, PD2_FN),
444 PINMUX_DATA(FCLE_MARK, P1MSEL14_0, PD2_FN),
445 PINMUX_DATA(DREQ1_MARK, P1MSEL10_0, P1MSEL9_1, PD1_FN),
446 PINMUX_DATA(BREQ_MARK, P1MSEL10_1, P1MSEL9_0, PD1_FN),
447 PINMUX_DATA(USB_OVC1_MARK, P1MSEL10_0, P1MSEL9_0, PD1_FN),
448 PINMUX_DATA(DREQ0_MARK, P1MSEL11_1, PD0_FN),
449 PINMUX_DATA(USB_OVC0_MARK, P1MSEL11_0, PD0_FN),
450
451 /* PE FN */
452 PINMUX_DATA(USB_PENC1_MARK, PE7_FN),
453 PINMUX_DATA(USB_PENC0_MARK, PE6_FN),
454
455 /* PF FN */
456 PINMUX_DATA(HAC1_SDOUT_MARK, P2MSEL15_0, P2MSEL14_0, PF7_FN),
457 PINMUX_DATA(HAC1_SDIN_MARK, P2MSEL15_0, P2MSEL14_0, PF6_FN),
458 PINMUX_DATA(HAC1_SYNC_MARK, P2MSEL15_0, P2MSEL14_0, PF5_FN),
459 PINMUX_DATA(HAC1_BITCLK_MARK, P2MSEL15_0, P2MSEL14_0, PF4_FN),
460 PINMUX_DATA(HAC0_SDOUT_MARK, P2MSEL13_0, P2MSEL12_0, PF3_FN),
461 PINMUX_DATA(HAC0_SDIN_MARK, P2MSEL13_0, P2MSEL12_0, PF2_FN),
462 PINMUX_DATA(HAC0_SYNC_MARK, P2MSEL13_0, P2MSEL12_0, PF1_FN),
463 PINMUX_DATA(HAC0_BITCLK_MARK, P2MSEL13_0, P2MSEL12_0, PF0_FN),
464 PINMUX_DATA(SSI1_SDATA_MARK, P2MSEL15_0, P2MSEL14_1, PF7_FN),
465 PINMUX_DATA(SSI1_SCK_MARK, P2MSEL15_0, P2MSEL14_1, PF6_FN),
466 PINMUX_DATA(SSI1_WS_MARK, P2MSEL15_0, P2MSEL14_1, PF5_FN),
467 PINMUX_DATA(SSI1_CLK_MARK, P2MSEL15_0, P2MSEL14_1, PF4_FN),
468 PINMUX_DATA(SSI0_SDATA_MARK, P2MSEL13_0, P2MSEL12_1, PF3_FN),
469 PINMUX_DATA(SSI0_SCK_MARK, P2MSEL13_0, P2MSEL12_1, PF2_FN),
470 PINMUX_DATA(SSI0_WS_MARK, P2MSEL13_0, P2MSEL12_1, PF1_FN),
471 PINMUX_DATA(SSI0_CLK_MARK, P2MSEL13_0, P2MSEL12_1, PF0_FN),
472 PINMUX_DATA(SDIF1CMD_MARK, P2MSEL15_1, P2MSEL14_0, PF7_FN),
473 PINMUX_DATA(SDIF1CD_MARK, P2MSEL15_1, P2MSEL14_0, PF6_FN),
474 PINMUX_DATA(SDIF1WP_MARK, P2MSEL15_1, P2MSEL14_0, PF5_FN),
475 PINMUX_DATA(SDIF1CLK_MARK, P2MSEL15_1, P2MSEL14_0, PF4_FN),
476 PINMUX_DATA(SDIF1D3_MARK, P2MSEL13_1, P2MSEL12_0, PF3_FN),
477 PINMUX_DATA(SDIF1D2_MARK, P2MSEL13_1, P2MSEL12_0, PF2_FN),
478 PINMUX_DATA(SDIF1D1_MARK, P2MSEL13_1, P2MSEL12_0, PF1_FN),
479 PINMUX_DATA(SDIF1D0_MARK, P2MSEL13_1, P2MSEL12_0, PF0_FN),
480
481 /* PG FN */
482 PINMUX_DATA(SCIF3_SCK_MARK, P1MSEL8_0, PG7_FN),
483 PINMUX_DATA(SSI2_SDATA_MARK, P1MSEL8_1, PG7_FN),
484 PINMUX_DATA(SCIF3_RXD_MARK, P1MSEL7_0, P1MSEL6_0, PG6_FN),
485 PINMUX_DATA(SSI2_SCK_MARK, P1MSEL7_1, P1MSEL6_0, PG6_FN),
486 PINMUX_DATA(TCLK_MARK, P1MSEL7_0, P1MSEL6_1, PG6_FN),
487 PINMUX_DATA(SCIF3_TXD_MARK, P1MSEL5_0, P1MSEL4_0, PG5_FN),
488 PINMUX_DATA(SSI2_WS_MARK, P1MSEL5_1, P1MSEL4_0, PG5_FN),
489 PINMUX_DATA(HAC_RES_MARK, P1MSEL5_0, P1MSEL4_1, PG5_FN),
490
491 /* PH FN */
492 PINMUX_DATA(DACK3_MARK, P2MSEL4_0, PH7_FN),
493 PINMUX_DATA(SDIF0CMD_MARK, P2MSEL4_1, PH7_FN),
494 PINMUX_DATA(DACK2_MARK, P2MSEL4_0, PH6_FN),
495 PINMUX_DATA(SDIF0CD_MARK, P2MSEL4_1, PH6_FN),
496 PINMUX_DATA(DREQ3_MARK, P2MSEL4_0, PH5_FN),
497 PINMUX_DATA(SDIF0WP_MARK, P2MSEL4_1, PH5_FN),
498 PINMUX_DATA(DREQ2_MARK, P2MSEL3_0, P2MSEL2_1, PH4_FN),
499 PINMUX_DATA(SDIF0CLK_MARK, P2MSEL3_1, P2MSEL2_0, PH4_FN),
500 PINMUX_DATA(SCIF0_CTS_MARK, P2MSEL3_0, P2MSEL2_0, PH4_FN),
501 PINMUX_DATA(SDIF0D3_MARK, P2MSEL1_1, P2MSEL0_0, PH3_FN),
502 PINMUX_DATA(SCIF0_RTS_MARK, P2MSEL1_0, P2MSEL0_0, PH3_FN),
503 PINMUX_DATA(IRL7_MARK, P2MSEL1_0, P2MSEL0_1, PH3_FN),
504 PINMUX_DATA(SDIF0D2_MARK, P2MSEL1_1, P2MSEL0_0, PH2_FN),
505 PINMUX_DATA(SCIF0_SCK_MARK, P2MSEL1_0, P2MSEL0_0, PH2_FN),
506 PINMUX_DATA(IRL6_MARK, P2MSEL1_0, P2MSEL0_1, PH2_FN),
507 PINMUX_DATA(SDIF0D1_MARK, P2MSEL1_1, P2MSEL0_0, PH1_FN),
508 PINMUX_DATA(SCIF0_RXD_MARK, P2MSEL1_0, P2MSEL0_0, PH1_FN),
509 PINMUX_DATA(IRL5_MARK, P2MSEL1_0, P2MSEL0_1, PH1_FN),
510 PINMUX_DATA(SDIF0D0_MARK, P2MSEL1_1, P2MSEL0_0, PH0_FN),
511 PINMUX_DATA(SCIF0_TXD_MARK, P2MSEL1_0, P2MSEL0_0, PH0_FN),
512 PINMUX_DATA(IRL4_MARK, P2MSEL1_0, P2MSEL0_1, PH0_FN),
513
514 /* PJ FN */
515 PINMUX_DATA(SCIF5_SCK_MARK, P2MSEL11_1, PJ7_FN),
516 PINMUX_DATA(FRB_MARK, P2MSEL11_0, PJ7_FN),
517 PINMUX_DATA(SCIF5_RXD_MARK, P2MSEL10_0, PJ6_FN),
518 PINMUX_DATA(IOIS16_MARK, P2MSEL10_1, PJ6_FN),
519 PINMUX_DATA(SCIF5_TXD_MARK, P2MSEL10_0, PJ5_FN),
520 PINMUX_DATA(CE2B_MARK, P2MSEL10_1, PJ5_FN),
521 PINMUX_DATA(DRAK3_MARK, P2MSEL7_0, PJ4_FN),
522 PINMUX_DATA(CE2A_MARK, P2MSEL7_1, PJ4_FN),
523 PINMUX_DATA(SCIF4_SCK_MARK, P2MSEL9_0, P2MSEL8_0, PJ3_FN),
524 PINMUX_DATA(DRAK2_MARK, P2MSEL9_0, P2MSEL8_1, PJ3_FN),
525 PINMUX_DATA(SSI3_WS_MARK, P2MSEL9_1, P2MSEL8_0, PJ3_FN),
526 PINMUX_DATA(SCIF4_RXD_MARK, P2MSEL6_1, P2MSEL5_0, PJ2_FN),
527 PINMUX_DATA(DRAK1_MARK, P2MSEL6_0, P2MSEL5_1, PJ2_FN),
528 PINMUX_DATA(FSTATUS_MARK, P2MSEL6_0, P2MSEL5_0, PJ2_FN),
529 PINMUX_DATA(SSI3_SDATA_MARK, P2MSEL6_1, P2MSEL5_1, PJ2_FN),
530 PINMUX_DATA(SCIF4_TXD_MARK, P2MSEL6_1, P2MSEL5_0, PJ1_FN),
531 PINMUX_DATA(DRAK0_MARK, P2MSEL6_0, P2MSEL5_1, PJ1_FN),
532 PINMUX_DATA(FSE_MARK, P2MSEL6_0, P2MSEL5_0, PJ1_FN),
533 PINMUX_DATA(SSI3_SCK_MARK, P2MSEL6_1, P2MSEL5_1, PJ1_FN),
534};
535
536static struct pinmux_gpio pinmux_gpios[] = {
537 /* PA */
538 PINMUX_GPIO(GPIO_PA7, PA7_DATA),
539 PINMUX_GPIO(GPIO_PA6, PA6_DATA),
540 PINMUX_GPIO(GPIO_PA5, PA5_DATA),
541 PINMUX_GPIO(GPIO_PA4, PA4_DATA),
542 PINMUX_GPIO(GPIO_PA3, PA3_DATA),
543 PINMUX_GPIO(GPIO_PA2, PA2_DATA),
544 PINMUX_GPIO(GPIO_PA1, PA1_DATA),
545 PINMUX_GPIO(GPIO_PA0, PA0_DATA),
546
547 /* PB */
548 PINMUX_GPIO(GPIO_PB7, PB7_DATA),
549 PINMUX_GPIO(GPIO_PB6, PB6_DATA),
550 PINMUX_GPIO(GPIO_PB5, PB5_DATA),
551 PINMUX_GPIO(GPIO_PB4, PB4_DATA),
552 PINMUX_GPIO(GPIO_PB3, PB3_DATA),
553 PINMUX_GPIO(GPIO_PB2, PB2_DATA),
554 PINMUX_GPIO(GPIO_PB1, PB1_DATA),
555 PINMUX_GPIO(GPIO_PB0, PB0_DATA),
556
557 /* PC */
558 PINMUX_GPIO(GPIO_PC7, PC7_DATA),
559 PINMUX_GPIO(GPIO_PC6, PC6_DATA),
560 PINMUX_GPIO(GPIO_PC5, PC5_DATA),
561 PINMUX_GPIO(GPIO_PC4, PC4_DATA),
562 PINMUX_GPIO(GPIO_PC3, PC3_DATA),
563 PINMUX_GPIO(GPIO_PC2, PC2_DATA),
564 PINMUX_GPIO(GPIO_PC1, PC1_DATA),
565 PINMUX_GPIO(GPIO_PC0, PC0_DATA),
566
567 /* PD */
568 PINMUX_GPIO(GPIO_PD7, PD7_DATA),
569 PINMUX_GPIO(GPIO_PD6, PD6_DATA),
570 PINMUX_GPIO(GPIO_PD5, PD5_DATA),
571 PINMUX_GPIO(GPIO_PD4, PD4_DATA),
572 PINMUX_GPIO(GPIO_PD3, PD3_DATA),
573 PINMUX_GPIO(GPIO_PD2, PD2_DATA),
574 PINMUX_GPIO(GPIO_PD1, PD1_DATA),
575 PINMUX_GPIO(GPIO_PD0, PD0_DATA),
576
577 /* PE */
578 PINMUX_GPIO(GPIO_PE5, PE7_DATA),
579 PINMUX_GPIO(GPIO_PE4, PE6_DATA),
580
581 /* PF */
582 PINMUX_GPIO(GPIO_PF7, PF7_DATA),
583 PINMUX_GPIO(GPIO_PF6, PF6_DATA),
584 PINMUX_GPIO(GPIO_PF5, PF5_DATA),
585 PINMUX_GPIO(GPIO_PF4, PF4_DATA),
586 PINMUX_GPIO(GPIO_PF3, PF3_DATA),
587 PINMUX_GPIO(GPIO_PF2, PF2_DATA),
588 PINMUX_GPIO(GPIO_PF1, PF1_DATA),
589 PINMUX_GPIO(GPIO_PF0, PF0_DATA),
590
591 /* PG */
592 PINMUX_GPIO(GPIO_PG7, PG7_DATA),
593 PINMUX_GPIO(GPIO_PG6, PG6_DATA),
594 PINMUX_GPIO(GPIO_PG5, PG5_DATA),
595
596 /* PH */
597 PINMUX_GPIO(GPIO_PH7, PH7_DATA),
598 PINMUX_GPIO(GPIO_PH6, PH6_DATA),
599 PINMUX_GPIO(GPIO_PH5, PH5_DATA),
600 PINMUX_GPIO(GPIO_PH4, PH4_DATA),
601 PINMUX_GPIO(GPIO_PH3, PH3_DATA),
602 PINMUX_GPIO(GPIO_PH2, PH2_DATA),
603 PINMUX_GPIO(GPIO_PH1, PH1_DATA),
604 PINMUX_GPIO(GPIO_PH0, PH0_DATA),
605
606 /* PJ */
607 PINMUX_GPIO(GPIO_PJ7, PJ7_DATA),
608 PINMUX_GPIO(GPIO_PJ6, PJ6_DATA),
609 PINMUX_GPIO(GPIO_PJ5, PJ5_DATA),
610 PINMUX_GPIO(GPIO_PJ4, PJ4_DATA),
611 PINMUX_GPIO(GPIO_PJ3, PJ3_DATA),
612 PINMUX_GPIO(GPIO_PJ2, PJ2_DATA),
613 PINMUX_GPIO(GPIO_PJ1, PJ1_DATA),
614
615 /* FN */
616 PINMUX_GPIO(GPIO_FN_CDE, CDE_MARK),
617 PINMUX_GPIO(GPIO_FN_ETH_MAGIC, ETH_MAGIC_MARK),
618 PINMUX_GPIO(GPIO_FN_DISP, DISP_MARK),
619 PINMUX_GPIO(GPIO_FN_ETH_LINK, ETH_LINK_MARK),
620 PINMUX_GPIO(GPIO_FN_DR5, DR5_MARK),
621 PINMUX_GPIO(GPIO_FN_ETH_TX_ER, ETH_TX_ER_MARK),
622 PINMUX_GPIO(GPIO_FN_DR4, DR4_MARK),
623 PINMUX_GPIO(GPIO_FN_ETH_TX_EN, ETH_TX_EN_MARK),
624 PINMUX_GPIO(GPIO_FN_DR3, DR3_MARK),
625 PINMUX_GPIO(GPIO_FN_ETH_TXD3, ETH_TXD3_MARK),
626 PINMUX_GPIO(GPIO_FN_DR2, DR2_MARK),
627 PINMUX_GPIO(GPIO_FN_ETH_TXD2, ETH_TXD2_MARK),
628 PINMUX_GPIO(GPIO_FN_DR1, DR1_MARK),
629 PINMUX_GPIO(GPIO_FN_ETH_TXD1, ETH_TXD1_MARK),
630 PINMUX_GPIO(GPIO_FN_DR0, DR0_MARK),
631 PINMUX_GPIO(GPIO_FN_ETH_TXD0, ETH_TXD0_MARK),
632 PINMUX_GPIO(GPIO_FN_VSYNC, VSYNC_MARK),
633 PINMUX_GPIO(GPIO_FN_HSPI_CLK, HSPI_CLK_MARK),
634 PINMUX_GPIO(GPIO_FN_ODDF, ODDF_MARK),
635 PINMUX_GPIO(GPIO_FN_HSPI_CS, HSPI_CS_MARK),
636 PINMUX_GPIO(GPIO_FN_DG5, DG5_MARK),
637 PINMUX_GPIO(GPIO_FN_ETH_MDIO, ETH_MDIO_MARK),
638 PINMUX_GPIO(GPIO_FN_DG4, DG4_MARK),
639 PINMUX_GPIO(GPIO_FN_ETH_RX_CLK, ETH_RX_CLK_MARK),
640 PINMUX_GPIO(GPIO_FN_DG3, DG3_MARK),
641 PINMUX_GPIO(GPIO_FN_ETH_MDC, ETH_MDC_MARK),
642 PINMUX_GPIO(GPIO_FN_DG2, DG2_MARK),
643 PINMUX_GPIO(GPIO_FN_ETH_COL, ETH_COL_MARK),
644 PINMUX_GPIO(GPIO_FN_DG1, DG1_MARK),
645 PINMUX_GPIO(GPIO_FN_ETH_TX_CLK, ETH_TX_CLK_MARK),
646 PINMUX_GPIO(GPIO_FN_DG0, DG0_MARK),
647 PINMUX_GPIO(GPIO_FN_ETH_CRS, ETH_CRS_MARK),
648 PINMUX_GPIO(GPIO_FN_DCLKIN, DCLKIN_MARK),
649 PINMUX_GPIO(GPIO_FN_HSPI_RX, HSPI_RX_MARK),
650 PINMUX_GPIO(GPIO_FN_HSYNC, HSYNC_MARK),
651 PINMUX_GPIO(GPIO_FN_HSPI_TX, HSPI_TX_MARK),
652 PINMUX_GPIO(GPIO_FN_DB5, DB5_MARK),
653 PINMUX_GPIO(GPIO_FN_ETH_RXD3, ETH_RXD3_MARK),
654 PINMUX_GPIO(GPIO_FN_DB4, DB4_MARK),
655 PINMUX_GPIO(GPIO_FN_ETH_RXD2, ETH_RXD2_MARK),
656 PINMUX_GPIO(GPIO_FN_DB3, DB3_MARK),
657 PINMUX_GPIO(GPIO_FN_ETH_RXD1, ETH_RXD1_MARK),
658 PINMUX_GPIO(GPIO_FN_DB2, DB2_MARK),
659 PINMUX_GPIO(GPIO_FN_ETH_RXD0, ETH_RXD0_MARK),
660 PINMUX_GPIO(GPIO_FN_DB1, DB1_MARK),
661 PINMUX_GPIO(GPIO_FN_ETH_RX_DV, ETH_RX_DV_MARK),
662 PINMUX_GPIO(GPIO_FN_DB0, DB0_MARK),
663 PINMUX_GPIO(GPIO_FN_ETH_RX_ER, ETH_RX_ER_MARK),
664 PINMUX_GPIO(GPIO_FN_DCLKOUT, DCLKOUT_MARK),
665 PINMUX_GPIO(GPIO_FN_SCIF1_SLK, SCIF1_SLK_MARK),
666 PINMUX_GPIO(GPIO_FN_SCIF1_RXD, SCIF1_RXD_MARK),
667 PINMUX_GPIO(GPIO_FN_SCIF1_TXD, SCIF1_TXD_MARK),
668 PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK),
669 PINMUX_GPIO(GPIO_FN_BACK, BACK_MARK),
670 PINMUX_GPIO(GPIO_FN_FALE, FALE_MARK),
671 PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK),
672 PINMUX_GPIO(GPIO_FN_FCLE, FCLE_MARK),
673 PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK),
674 PINMUX_GPIO(GPIO_FN_BREQ, BREQ_MARK),
675 PINMUX_GPIO(GPIO_FN_USB_OVC1, USB_OVC1_MARK),
676 PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK),
677 PINMUX_GPIO(GPIO_FN_USB_OVC0, USB_OVC0_MARK),
678 PINMUX_GPIO(GPIO_FN_USB_PENC1, USB_PENC1_MARK),
679 PINMUX_GPIO(GPIO_FN_USB_PENC0, USB_PENC0_MARK),
680 PINMUX_GPIO(GPIO_FN_HAC1_SDOUT, HAC1_SDOUT_MARK),
681 PINMUX_GPIO(GPIO_FN_SSI1_SDATA, SSI1_SDATA_MARK),
682 PINMUX_GPIO(GPIO_FN_SDIF1CMD, SDIF1CMD_MARK),
683 PINMUX_GPIO(GPIO_FN_HAC1_SDIN, HAC1_SDIN_MARK),
684 PINMUX_GPIO(GPIO_FN_SSI1_SCK, SSI1_SCK_MARK),
685 PINMUX_GPIO(GPIO_FN_SDIF1CD, SDIF1CD_MARK),
686 PINMUX_GPIO(GPIO_FN_HAC1_SYNC, HAC1_SYNC_MARK),
687 PINMUX_GPIO(GPIO_FN_SSI1_WS, SSI1_WS_MARK),
688 PINMUX_GPIO(GPIO_FN_SDIF1WP, SDIF1WP_MARK),
689 PINMUX_GPIO(GPIO_FN_HAC1_BITCLK, HAC1_BITCLK_MARK),
690 PINMUX_GPIO(GPIO_FN_SSI1_CLK, SSI1_CLK_MARK),
691 PINMUX_GPIO(GPIO_FN_SDIF1CLK, SDIF1CLK_MARK),
692 PINMUX_GPIO(GPIO_FN_HAC0_SDOUT, HAC0_SDOUT_MARK),
693 PINMUX_GPIO(GPIO_FN_SSI0_SDATA, SSI0_SDATA_MARK),
694 PINMUX_GPIO(GPIO_FN_SDIF1D3, SDIF1D3_MARK),
695 PINMUX_GPIO(GPIO_FN_HAC0_SDIN, HAC0_SDIN_MARK),
696 PINMUX_GPIO(GPIO_FN_SSI0_SCK, SSI0_SCK_MARK),
697 PINMUX_GPIO(GPIO_FN_SDIF1D2, SDIF1D2_MARK),
698 PINMUX_GPIO(GPIO_FN_HAC0_SYNC, HAC0_SYNC_MARK),
699 PINMUX_GPIO(GPIO_FN_SSI0_WS, SSI0_WS_MARK),
700 PINMUX_GPIO(GPIO_FN_SDIF1D1, SDIF1D1_MARK),
701 PINMUX_GPIO(GPIO_FN_HAC0_BITCLK, HAC0_BITCLK_MARK),
702 PINMUX_GPIO(GPIO_FN_SSI0_CLK, SSI0_CLK_MARK),
703 PINMUX_GPIO(GPIO_FN_SDIF1D0, SDIF1D0_MARK),
704 PINMUX_GPIO(GPIO_FN_SCIF3_SCK, SCIF3_SCK_MARK),
705 PINMUX_GPIO(GPIO_FN_SSI2_SDATA, SSI2_SDATA_MARK),
706 PINMUX_GPIO(GPIO_FN_SCIF3_RXD, SCIF3_RXD_MARK),
707 PINMUX_GPIO(GPIO_FN_TCLK, TCLK_MARK),
708 PINMUX_GPIO(GPIO_FN_SSI2_SCK, SSI2_SCK_MARK),
709 PINMUX_GPIO(GPIO_FN_SCIF3_TXD, SCIF3_TXD_MARK),
710 PINMUX_GPIO(GPIO_FN_HAC_RES, HAC_RES_MARK),
711 PINMUX_GPIO(GPIO_FN_SSI2_WS, SSI2_WS_MARK),
712 PINMUX_GPIO(GPIO_FN_DACK3, DACK3_MARK),
713 PINMUX_GPIO(GPIO_FN_SDIF0CMD, SDIF0CMD_MARK),
714 PINMUX_GPIO(GPIO_FN_DACK2, DACK2_MARK),
715 PINMUX_GPIO(GPIO_FN_SDIF0CD, SDIF0CD_MARK),
716 PINMUX_GPIO(GPIO_FN_DREQ3, DREQ3_MARK),
717 PINMUX_GPIO(GPIO_FN_SDIF0WP, SDIF0WP_MARK),
718 PINMUX_GPIO(GPIO_FN_SCIF0_CTS, SCIF0_CTS_MARK),
719 PINMUX_GPIO(GPIO_FN_DREQ2, DREQ2_MARK),
720 PINMUX_GPIO(GPIO_FN_SDIF0CLK, SDIF0CLK_MARK),
721 PINMUX_GPIO(GPIO_FN_SCIF0_RTS, SCIF0_RTS_MARK),
722 PINMUX_GPIO(GPIO_FN_IRL7, IRL7_MARK),
723 PINMUX_GPIO(GPIO_FN_SDIF0D3, SDIF0D3_MARK),
724 PINMUX_GPIO(GPIO_FN_SCIF0_SCK, SCIF0_SCK_MARK),
725 PINMUX_GPIO(GPIO_FN_IRL6, IRL6_MARK),
726 PINMUX_GPIO(GPIO_FN_SDIF0D2, SDIF0D2_MARK),
727 PINMUX_GPIO(GPIO_FN_SCIF0_RXD, SCIF0_RXD_MARK),
728 PINMUX_GPIO(GPIO_FN_IRL5, IRL5_MARK),
729 PINMUX_GPIO(GPIO_FN_SDIF0D1, SDIF0D1_MARK),
730 PINMUX_GPIO(GPIO_FN_SCIF0_TXD, SCIF0_TXD_MARK),
731 PINMUX_GPIO(GPIO_FN_IRL4, IRL4_MARK),
732 PINMUX_GPIO(GPIO_FN_SDIF0D0, SDIF0D0_MARK),
733 PINMUX_GPIO(GPIO_FN_SCIF5_SCK, SCIF5_SCK_MARK),
734 PINMUX_GPIO(GPIO_FN_FRB, FRB_MARK),
735 PINMUX_GPIO(GPIO_FN_SCIF5_RXD, SCIF5_RXD_MARK),
736 PINMUX_GPIO(GPIO_FN_IOIS16, IOIS16_MARK),
737 PINMUX_GPIO(GPIO_FN_SCIF5_TXD, SCIF5_TXD_MARK),
738 PINMUX_GPIO(GPIO_FN_CE2B, CE2B_MARK),
739 PINMUX_GPIO(GPIO_FN_DRAK3, DRAK3_MARK),
740 PINMUX_GPIO(GPIO_FN_CE2A, CE2A_MARK),
741 PINMUX_GPIO(GPIO_FN_SCIF4_SCK, SCIF4_SCK_MARK),
742 PINMUX_GPIO(GPIO_FN_DRAK2, DRAK2_MARK),
743 PINMUX_GPIO(GPIO_FN_SSI3_WS, SSI3_WS_MARK),
744 PINMUX_GPIO(GPIO_FN_SCIF4_RXD, SCIF4_RXD_MARK),
745 PINMUX_GPIO(GPIO_FN_DRAK1, DRAK1_MARK),
746 PINMUX_GPIO(GPIO_FN_SSI3_SDATA, SSI3_SDATA_MARK),
747 PINMUX_GPIO(GPIO_FN_FSTATUS, FSTATUS_MARK),
748 PINMUX_GPIO(GPIO_FN_SCIF4_TXD, SCIF4_TXD_MARK),
749 PINMUX_GPIO(GPIO_FN_DRAK0, DRAK0_MARK),
750 PINMUX_GPIO(GPIO_FN_SSI3_SCK, SSI3_SCK_MARK),
751 PINMUX_GPIO(GPIO_FN_FSE, FSE_MARK),
752};
753
754static struct pinmux_cfg_reg pinmux_config_regs[] = {
755 { PINMUX_CFG_REG("PACR", 0xffcc0000, 16, 2) {
756 PA7_FN, PA7_OUT, PA7_IN, PA7_IN_PU,
757 PA6_FN, PA6_OUT, PA6_IN, PA6_IN_PU,
758 PA5_FN, PA5_OUT, PA5_IN, PA5_IN_PU,
759 PA4_FN, PA4_OUT, PA4_IN, PA4_IN_PU,
760 PA3_FN, PA3_OUT, PA3_IN, PA3_IN_PU,
761 PA2_FN, PA2_OUT, PA2_IN, PA2_IN_PU,
762 PA1_FN, PA1_OUT, PA1_IN, PA1_IN_PU,
763 PA0_FN, PA0_OUT, PA0_IN, PA0_IN_PU }
764 },
765 { PINMUX_CFG_REG("PBCR", 0xffcc0002, 16, 2) {
766 PB7_FN, PB7_OUT, PB7_IN, PB7_IN_PU,
767 PB6_FN, PB6_OUT, PB6_IN, PB6_IN_PU,
768 PB5_FN, PB5_OUT, PB5_IN, PB5_IN_PU,
769 PB4_FN, PB4_OUT, PB4_IN, PB4_IN_PU,
770 PB3_FN, PB3_OUT, PB3_IN, PB3_IN_PU,
771 PB2_FN, PB2_OUT, PB2_IN, PB2_IN_PU,
772 PB1_FN, PB1_OUT, PB1_IN, PB1_IN_PU,
773 PB0_FN, PB0_OUT, PB0_IN, PB0_IN_PU }
774 },
775 { PINMUX_CFG_REG("PCCR", 0xffcc0004, 16, 2) {
776 PC7_FN, PC7_OUT, PC7_IN, PC7_IN_PU,
777 PC6_FN, PC6_OUT, PC6_IN, PC6_IN_PU,
778 PC5_FN, PC5_OUT, PC5_IN, PC5_IN_PU,
779 PC4_FN, PC4_OUT, PC4_IN, PC4_IN_PU,
780 PC3_FN, PC3_OUT, PC3_IN, PC3_IN_PU,
781 PC2_FN, PC2_OUT, PC2_IN, PC2_IN_PU,
782 PC1_FN, PC1_OUT, PC1_IN, PC1_IN_PU,
783 PC0_FN, PC0_OUT, PC0_IN, PC0_IN_PU }
784 },
785 { PINMUX_CFG_REG("PDCR", 0xffcc0006, 16, 2) {
786 PD7_FN, PD7_OUT, PD7_IN, PD7_IN_PU,
787 PD6_FN, PD6_OUT, PD6_IN, PD6_IN_PU,
788 PD5_FN, PD5_OUT, PD5_IN, PD5_IN_PU,
789 PD4_FN, PD4_OUT, PD4_IN, PD4_IN_PU,
790 PD3_FN, PD3_OUT, PD3_IN, PD3_IN_PU,
791 PD2_FN, PD2_OUT, PD2_IN, PD2_IN_PU,
792 PD1_FN, PD1_OUT, PD1_IN, PD1_IN_PU,
793 PD0_FN, PD0_OUT, PD0_IN, PD0_IN_PU }
794 },
795 { PINMUX_CFG_REG("PECR", 0xffcc0008, 16, 2) {
796 PE7_FN, PE7_OUT, PE7_IN, PE7_IN_PU,
797 PE6_FN, PE6_OUT, PE6_IN, PE6_IN_PU,
798 0, 0, 0, 0,
799 0, 0, 0, 0,
800 0, 0, 0, 0,
801 0, 0, 0, 0,
802 0, 0, 0, 0,
803 0, 0, 0, 0, }
804 },
805 { PINMUX_CFG_REG("PFCR", 0xffcc000a, 16, 2) {
806 PF7_FN, PF7_OUT, PF7_IN, PF7_IN_PU,
807 PF6_FN, PF6_OUT, PF6_IN, PF6_IN_PU,
808 PF5_FN, PF5_OUT, PF5_IN, PF5_IN_PU,
809 PF4_FN, PF4_OUT, PF4_IN, PF4_IN_PU,
810 PF3_FN, PF3_OUT, PF3_IN, PF3_IN_PU,
811 PF2_FN, PF2_OUT, PF2_IN, PF2_IN_PU,
812 PF1_FN, PF1_OUT, PF1_IN, PF1_IN_PU,
813 PF0_FN, PF0_OUT, PF0_IN, PF0_IN_PU }
814 },
815 { PINMUX_CFG_REG("PGCR", 0xffcc000c, 16, 2) {
816 PG7_FN, PG7_OUT, PG7_IN, PG7_IN_PU,
817 PG6_FN, PG6_OUT, PG6_IN, PG6_IN_PU,
818 PG5_FN, PG5_OUT, PG5_IN, PG5_IN_PU,
819 0, 0, 0, 0,
820 0, 0, 0, 0,
821 0, 0, 0, 0,
822 0, 0, 0, 0,
823 0, 0, 0, 0, }
824 },
825 { PINMUX_CFG_REG("PHCR", 0xffcc000e, 16, 2) {
826 PH7_FN, PH7_OUT, PH7_IN, PH7_IN_PU,
827 PH6_FN, PH6_OUT, PH6_IN, PH6_IN_PU,
828 PH5_FN, PH5_OUT, PH5_IN, PH5_IN_PU,
829 PH4_FN, PH4_OUT, PH4_IN, PH4_IN_PU,
830 PH3_FN, PH3_OUT, PH3_IN, PH3_IN_PU,
831 PH2_FN, PH2_OUT, PH2_IN, PH2_IN_PU,
832 PH1_FN, PH1_OUT, PH1_IN, PH1_IN_PU,
833 PH0_FN, PH0_OUT, PH0_IN, PH0_IN_PU }
834 },
835 { PINMUX_CFG_REG("PJCR", 0xffcc0010, 16, 2) {
836 PJ7_FN, PJ7_OUT, PJ7_IN, PJ7_IN_PU,
837 PJ6_FN, PJ6_OUT, PJ6_IN, PJ6_IN_PU,
838 PJ5_FN, PJ5_OUT, PJ5_IN, PJ5_IN_PU,
839 PJ4_FN, PJ4_OUT, PJ4_IN, PJ4_IN_PU,
840 PJ3_FN, PJ3_OUT, PJ3_IN, PJ3_IN_PU,
841 PJ2_FN, PJ2_OUT, PJ2_IN, PJ2_IN_PU,
842 PJ1_FN, PJ1_OUT, PJ1_IN, PJ1_IN_PU,
843 0, 0, 0, 0, }
844 },
845 { PINMUX_CFG_REG("P1MSELR", 0xffcc0080, 16, 1) {
846 0, 0,
847 P1MSEL14_0, P1MSEL14_1,
848 P1MSEL13_0, P1MSEL13_1,
849 P1MSEL12_0, P1MSEL12_1,
850 P1MSEL11_0, P1MSEL11_1,
851 P1MSEL10_0, P1MSEL10_1,
852 P1MSEL9_0, P1MSEL9_1,
853 P1MSEL8_0, P1MSEL8_1,
854 P1MSEL7_0, P1MSEL7_1,
855 P1MSEL6_0, P1MSEL6_1,
856 P1MSEL5_0, P1MSEL5_1,
857 P1MSEL4_0, P1MSEL4_1,
858 P1MSEL3_0, P1MSEL3_1,
859 P1MSEL2_0, P1MSEL2_1,
860 P1MSEL1_0, P1MSEL1_1,
861 P1MSEL0_0, P1MSEL0_1 }
862 },
863 { PINMUX_CFG_REG("P2MSELR", 0xffcc0082, 16, 1) {
864 P2MSEL15_0, P2MSEL15_1,
865 P2MSEL14_0, P2MSEL14_1,
866 P2MSEL13_0, P2MSEL13_1,
867 P2MSEL12_0, P2MSEL12_1,
868 P2MSEL11_0, P2MSEL11_1,
869 P2MSEL10_0, P2MSEL10_1,
870 P2MSEL9_0, P2MSEL9_1,
871 P2MSEL8_0, P2MSEL8_1,
872 P2MSEL7_0, P2MSEL7_1,
873 P2MSEL6_0, P2MSEL6_1,
874 P2MSEL5_0, P2MSEL5_1,
875 P2MSEL4_0, P2MSEL4_1,
876 P2MSEL3_0, P2MSEL3_1,
877 P2MSEL2_0, P2MSEL2_1,
878 P2MSEL1_0, P2MSEL1_1,
879 P2MSEL0_0, P2MSEL0_1 }
880 },
881 {}
882};
883
884static struct pinmux_data_reg pinmux_data_regs[] = {
885 { PINMUX_DATA_REG("PADR", 0xffcc0020, 8) {
886 PA7_DATA, PA6_DATA, PA5_DATA, PA4_DATA,
887 PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA }
888 },
889 { PINMUX_DATA_REG("PBDR", 0xffcc0022, 8) {
890 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
891 PB3_DATA, PB2_DATA, PB1_DATA, PB0_DATA }
892 },
893 { PINMUX_DATA_REG("PCDR", 0xffcc0024, 8) {
894 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
895 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA }
896 },
897 { PINMUX_DATA_REG("PDDR", 0xffcc0026, 8) {
898 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
899 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA }
900 },
901 { PINMUX_DATA_REG("PEDR", 0xffcc0028, 8) {
902 PE7_DATA, PE6_DATA,
903 0, 0, 0, 0, 0, 0 }
904 },
905 { PINMUX_DATA_REG("PFDR", 0xffcc002a, 8) {
906 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
907 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA }
908 },
909 { PINMUX_DATA_REG("PGDR", 0xffcc002c, 8) {
910 PG7_DATA, PG6_DATA, PG5_DATA, 0,
911 0, 0, 0, 0 }
912 },
913 { PINMUX_DATA_REG("PHDR", 0xffcc002e, 8) {
914 PH7_DATA, PH6_DATA, PH5_DATA, PH4_DATA,
915 PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA }
916 },
917 { PINMUX_DATA_REG("PJDR", 0xffcc0030, 8) {
918 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
919 PJ3_DATA, PJ2_DATA, PJ1_DATA, 0 }
920 },
921 { },
922};
923
924static struct pinmux_info sh7786_pinmux_info = {
925 .name = "sh7786_pfc",
926 .reserved_id = PINMUX_RESERVED,
927 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
928 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
929 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
930 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
931 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
932 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
933
934 .first_gpio = GPIO_PA7,
935 .last_gpio = GPIO_FN_FSE,
936
937 .gpios = pinmux_gpios,
938 .cfg_regs = pinmux_config_regs,
939 .data_regs = pinmux_data_regs,
940
941 .gpio_data = pinmux_data,
942 .gpio_data_size = ARRAY_SIZE(pinmux_data),
943};
944
945static int __init plat_pinmux_setup(void)
946{
947 return register_pinmux(&sh7786_pinmux_info);
948}
949
950arch_initcall(plat_pinmux_setup);
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
index 4ff4dc64520c..c1549382c87c 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
@@ -12,6 +12,7 @@
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/uio_driver.h> 14#include <linux/uio_driver.h>
15#include <linux/sh_cmt.h>
15#include <asm/clock.h> 16#include <asm/clock.h>
16 17
17static struct resource iic0_resources[] = { 18static struct resource iic0_resources[] = {
@@ -140,6 +141,38 @@ static struct platform_device jpu_device = {
140 .num_resources = ARRAY_SIZE(jpu_resources), 141 .num_resources = ARRAY_SIZE(jpu_resources),
141}; 142};
142 143
144static struct sh_cmt_config cmt_platform_data = {
145 .name = "CMT",
146 .channel_offset = 0x60,
147 .timer_bit = 5,
148 .clk = "cmt0",
149 .clockevent_rating = 125,
150 .clocksource_rating = 200,
151};
152
153static struct resource cmt_resources[] = {
154 [0] = {
155 .name = "CMT",
156 .start = 0x044a0060,
157 .end = 0x044a006b,
158 .flags = IORESOURCE_MEM,
159 },
160 [1] = {
161 .start = 104,
162 .flags = IORESOURCE_IRQ,
163 },
164};
165
166static struct platform_device cmt_device = {
167 .name = "sh_cmt",
168 .id = 0,
169 .dev = {
170 .platform_data = &cmt_platform_data,
171 },
172 .resource = cmt_resources,
173 .num_resources = ARRAY_SIZE(cmt_resources),
174};
175
143static struct plat_sci_port sci_platform_data[] = { 176static struct plat_sci_port sci_platform_data[] = {
144 { 177 {
145 .mapbase = 0xffe00000, 178 .mapbase = 0xffe00000,
@@ -175,6 +208,7 @@ static struct platform_device sci_device = {
175}; 208};
176 209
177static struct platform_device *sh7343_devices[] __initdata = { 210static struct platform_device *sh7343_devices[] __initdata = {
211 &cmt_device,
178 &iic0_device, 212 &iic0_device,
179 &iic1_device, 213 &iic1_device,
180 &sci_device, 214 &sci_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
index 839ae97a7fd2..93ecf8ed5c6c 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
@@ -14,6 +14,7 @@
14#include <linux/serial.h> 14#include <linux/serial.h>
15#include <linux/serial_sci.h> 15#include <linux/serial_sci.h>
16#include <linux/uio_driver.h> 16#include <linux/uio_driver.h>
17#include <linux/sh_cmt.h>
17#include <asm/clock.h> 18#include <asm/clock.h>
18 19
19static struct resource iic_resources[] = { 20static struct resource iic_resources[] = {
@@ -147,6 +148,38 @@ static struct platform_device veu1_device = {
147 .num_resources = ARRAY_SIZE(veu1_resources), 148 .num_resources = ARRAY_SIZE(veu1_resources),
148}; 149};
149 150
151static struct sh_cmt_config cmt_platform_data = {
152 .name = "CMT",
153 .channel_offset = 0x60,
154 .timer_bit = 5,
155 .clk = "cmt0",
156 .clockevent_rating = 125,
157 .clocksource_rating = 200,
158};
159
160static struct resource cmt_resources[] = {
161 [0] = {
162 .name = "CMT",
163 .start = 0x044a0060,
164 .end = 0x044a006b,
165 .flags = IORESOURCE_MEM,
166 },
167 [1] = {
168 .start = 104,
169 .flags = IORESOURCE_IRQ,
170 },
171};
172
173static struct platform_device cmt_device = {
174 .name = "sh_cmt",
175 .id = 0,
176 .dev = {
177 .platform_data = &cmt_platform_data,
178 },
179 .resource = cmt_resources,
180 .num_resources = ARRAY_SIZE(cmt_resources),
181};
182
150static struct plat_sci_port sci_platform_data[] = { 183static struct plat_sci_port sci_platform_data[] = {
151 { 184 {
152 .mapbase = 0xffe00000, 185 .mapbase = 0xffe00000,
@@ -167,6 +200,7 @@ static struct platform_device sci_device = {
167}; 200};
168 201
169static struct platform_device *sh7366_devices[] __initdata = { 202static struct platform_device *sh7366_devices[] __initdata = {
203 &cmt_device,
170 &iic_device, 204 &iic_device,
171 &sci_device, 205 &sci_device,
172 &usb_host_device, 206 &usb_host_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 5146afc156e0..0e5d204bc792 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -13,6 +13,7 @@
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/uio_driver.h> 15#include <linux/uio_driver.h>
16#include <linux/sh_cmt.h>
16#include <asm/clock.h> 17#include <asm/clock.h>
17#include <asm/mmzone.h> 18#include <asm/mmzone.h>
18 19
@@ -176,6 +177,38 @@ static struct platform_device jpu_device = {
176 .num_resources = ARRAY_SIZE(jpu_resources), 177 .num_resources = ARRAY_SIZE(jpu_resources),
177}; 178};
178 179
180static struct sh_cmt_config cmt_platform_data = {
181 .name = "CMT",
182 .channel_offset = 0x60,
183 .timer_bit = 5,
184 .clk = "cmt0",
185 .clockevent_rating = 125,
186 .clocksource_rating = 200,
187};
188
189static struct resource cmt_resources[] = {
190 [0] = {
191 .name = "CMT",
192 .start = 0x044a0060,
193 .end = 0x044a006b,
194 .flags = IORESOURCE_MEM,
195 },
196 [1] = {
197 .start = 104,
198 .flags = IORESOURCE_IRQ,
199 },
200};
201
202static struct platform_device cmt_device = {
203 .name = "sh_cmt",
204 .id = 0,
205 .dev = {
206 .platform_data = &cmt_platform_data,
207 },
208 .resource = cmt_resources,
209 .num_resources = ARRAY_SIZE(cmt_resources),
210};
211
179static struct plat_sci_port sci_platform_data[] = { 212static struct plat_sci_port sci_platform_data[] = {
180 { 213 {
181 .mapbase = 0xffe00000, 214 .mapbase = 0xffe00000,
@@ -209,6 +242,7 @@ static struct platform_device sci_device = {
209}; 242};
210 243
211static struct platform_device *sh7722_devices[] __initdata = { 244static struct platform_device *sh7722_devices[] __initdata = {
245 &cmt_device,
212 &rtc_device, 246 &rtc_device,
213 &usbf_device, 247 &usbf_device,
214 &iic_device, 248 &iic_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 849770d780ae..5338dacbcfba 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -13,6 +13,7 @@
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/serial_sci.h> 14#include <linux/serial_sci.h>
15#include <linux/uio_driver.h> 15#include <linux/uio_driver.h>
16#include <linux/sh_cmt.h>
16#include <asm/clock.h> 17#include <asm/clock.h>
17#include <asm/mmzone.h> 18#include <asm/mmzone.h>
18 19
@@ -100,6 +101,38 @@ static struct platform_device veu1_device = {
100 .num_resources = ARRAY_SIZE(veu1_resources), 101 .num_resources = ARRAY_SIZE(veu1_resources),
101}; 102};
102 103
104static struct sh_cmt_config cmt_platform_data = {
105 .name = "CMT",
106 .channel_offset = 0x60,
107 .timer_bit = 5,
108 .clk = "cmt0",
109 .clockevent_rating = 125,
110 .clocksource_rating = 200,
111};
112
113static struct resource cmt_resources[] = {
114 [0] = {
115 .name = "CMT",
116 .start = 0x044a0060,
117 .end = 0x044a006b,
118 .flags = IORESOURCE_MEM,
119 },
120 [1] = {
121 .start = 104,
122 .flags = IORESOURCE_IRQ,
123 },
124};
125
126static struct platform_device cmt_device = {
127 .name = "sh_cmt",
128 .id = 0,
129 .dev = {
130 .platform_data = &cmt_platform_data,
131 },
132 .resource = cmt_resources,
133 .num_resources = ARRAY_SIZE(cmt_resources),
134};
135
103static struct plat_sci_port sci_platform_data[] = { 136static struct plat_sci_port sci_platform_data[] = {
104 { 137 {
105 .mapbase = 0xffe00000, 138 .mapbase = 0xffe00000,
@@ -221,6 +254,7 @@ static struct platform_device iic_device = {
221}; 254};
222 255
223static struct platform_device *sh7723_devices[] __initdata = { 256static struct platform_device *sh7723_devices[] __initdata = {
257 &cmt_device,
224 &sci_device, 258 &sci_device,
225 &rtc_device, 259 &rtc_device,
226 &iic_device, 260 &iic_device,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 3c5b629887a8..bdf0f61ae1ed 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2006 Paul Mundt 4 * Copyright (C) 2006 Paul Mundt
5 * Copyright (C) 2007 Yoshihiro Shimoda 5 * Copyright (C) 2007 Yoshihiro Shimoda
6 * Copyright (C) 2008 Nobuhiro Iwamatsu 6 * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -22,18 +22,8 @@ static struct resource rtc_resources[] = {
22 .flags = IORESOURCE_IO, 22 .flags = IORESOURCE_IO,
23 }, 23 },
24 [1] = { 24 [1] = {
25 /* Period IRQ */ 25 /* Shared Period/Carry/Alarm IRQ */
26 .start = 21, 26 .start = 20,
27 .flags = IORESOURCE_IRQ,
28 },
29 [2] = {
30 /* Carry IRQ */
31 .start = 22,
32 .flags = IORESOURCE_IRQ,
33 },
34 [3] = {
35 /* Alarm IRQ */
36 .start = 20,
37 .flags = IORESOURCE_IRQ, 27 .flags = IORESOURCE_IRQ,
38 }, 28 },
39}; 29};
@@ -50,17 +40,17 @@ static struct plat_sci_port sci_platform_data[] = {
50 .mapbase = 0xffe00000, 40 .mapbase = 0xffe00000,
51 .flags = UPF_BOOT_AUTOCONF, 41 .flags = UPF_BOOT_AUTOCONF,
52 .type = PORT_SCIF, 42 .type = PORT_SCIF,
53 .irqs = { 40, 41, 43, 42 }, 43 .irqs = { 40, 40, 40, 40 },
54 }, { 44 }, {
55 .mapbase = 0xffe08000, 45 .mapbase = 0xffe08000,
56 .flags = UPF_BOOT_AUTOCONF, 46 .flags = UPF_BOOT_AUTOCONF,
57 .type = PORT_SCIF, 47 .type = PORT_SCIF,
58 .irqs = { 76, 77, 79, 78 }, 48 .irqs = { 76, 76, 76, 76 },
59 }, { 49 }, {
60 .mapbase = 0xffe10000, 50 .mapbase = 0xffe10000,
61 .flags = UPF_BOOT_AUTOCONF, 51 .flags = UPF_BOOT_AUTOCONF,
62 .type = PORT_SCIF, 52 .type = PORT_SCIF,
63 .irqs = { 104, 105, 107, 106 }, 53 .irqs = { 104, 104, 104, 104 },
64 }, { 54 }, {
65 .flags = 0, 55 .flags = 0,
66 } 56 }
@@ -148,93 +138,65 @@ enum {
148 IRL_HHLL, IRL_HHLH, IRL_HHHL, 138 IRL_HHLL, IRL_HHLH, IRL_HHHL,
149 139
150 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 140 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
151 RTC_ATI, RTC_PRI, RTC_CUI, 141 RTC, WDT, TMU0, TMU1, TMU2, TMU2_TICPI,
152 WDT, TMU0, TMU1, TMU2, TMU2_TICPI, 142 HUDI, LCDC, DMAC, SCIF0, IIC0, IIC1, CMT, GETHER, HAC,
153 HUDI, LCDC, 143 PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD, PCIC5,
154 DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, DMAC0_DMINT3, DMAC0_DMAE, 144 STIF0, STIF1, SCIF1, SIOF0, SIOF1, SIOF2,
155 SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI, 145 USBH, USBF, TPU, PCC, MMCIF, SIM,
156 DMAC0_DMINT4, DMAC0_DMINT5,
157 IIC0, IIC1,
158 CMT,
159 GEINT0, GEINT1, GEINT2,
160 HAC,
161 PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD,
162 PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0,
163 STIF0, STIF1,
164 SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI,
165 SIOF0, SIOF1, SIOF2,
166 USBH, USBFI0, USBFI1,
167 TPU, PCC,
168 MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY,
169 SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEND,
170 TMU3, TMU4, TMU5, ADC, SSI0, SSI1, SSI2, SSI3, 146 TMU3, TMU4, TMU5, ADC, SSI0, SSI1, SSI2, SSI3,
171 SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI, 147 SCIF2, GPIO,
172 GPIO_CH0, GPIO_CH1, GPIO_CH2, GPIO_CH3,
173 148
174 /* interrupt groups */ 149 /* interrupt groups */
175 150
176 TMU012, TMU345, RTC, DMAC, SCIF0, GETHER, PCIC5, 151 TMU012, TMU345,
177 SCIF1, USBF, MMCIF, SIM, SCIF2, GPIO,
178}; 152};
179 153
180static struct intc_vect vectors[] __initdata = { 154static struct intc_vect vectors[] __initdata = {
181 INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), 155 INTC_VECT(RTC, 0x480), INTC_VECT(RTC, 0x4a0),
182 INTC_VECT(RTC_CUI, 0x4c0), 156 INTC_VECT(RTC, 0x4c0),
183 INTC_VECT(WDT, 0x560), INTC_VECT(TMU0, 0x580), 157 INTC_VECT(WDT, 0x560), INTC_VECT(TMU0, 0x580),
184 INTC_VECT(TMU1, 0x5a0), INTC_VECT(TMU2, 0x5c0), 158 INTC_VECT(TMU1, 0x5a0), INTC_VECT(TMU2, 0x5c0),
185 INTC_VECT(TMU2_TICPI, 0x5e0), INTC_VECT(HUDI, 0x600), 159 INTC_VECT(TMU2_TICPI, 0x5e0), INTC_VECT(HUDI, 0x600),
186 INTC_VECT(LCDC, 0x620), 160 INTC_VECT(LCDC, 0x620),
187 INTC_VECT(DMAC0_DMINT0, 0x640), INTC_VECT(DMAC0_DMINT1, 0x660), 161 INTC_VECT(DMAC, 0x640), INTC_VECT(DMAC, 0x660),
188 INTC_VECT(DMAC0_DMINT2, 0x680), INTC_VECT(DMAC0_DMINT3, 0x6a0), 162 INTC_VECT(DMAC, 0x680), INTC_VECT(DMAC, 0x6a0),
189 INTC_VECT(DMAC0_DMAE, 0x6c0), 163 INTC_VECT(DMAC, 0x6c0),
190 INTC_VECT(SCIF0_ERI, 0x700), INTC_VECT(SCIF0_RXI, 0x720), 164 INTC_VECT(SCIF0, 0x700), INTC_VECT(SCIF0, 0x720),
191 INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760), 165 INTC_VECT(SCIF0, 0x740), INTC_VECT(SCIF0, 0x760),
192 INTC_VECT(DMAC0_DMINT4, 0x780), INTC_VECT(DMAC0_DMINT5, 0x7a0), 166 INTC_VECT(DMAC, 0x780), INTC_VECT(DMAC, 0x7a0),
193 INTC_VECT(IIC0, 0x8A0), INTC_VECT(IIC1, 0x8C0), 167 INTC_VECT(IIC0, 0x8A0), INTC_VECT(IIC1, 0x8C0),
194 INTC_VECT(CMT, 0x900), INTC_VECT(GEINT0, 0x920), 168 INTC_VECT(CMT, 0x900), INTC_VECT(GETHER, 0x920),
195 INTC_VECT(GEINT1, 0x940), INTC_VECT(GEINT2, 0x960), 169 INTC_VECT(GETHER, 0x940), INTC_VECT(GETHER, 0x960),
196 INTC_VECT(HAC, 0x980), 170 INTC_VECT(HAC, 0x980),
197 INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20), 171 INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20),
198 INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60), 172 INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60),
199 INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIERR, 0xaa0), 173 INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIC5, 0xaa0),
200 INTC_VECT(PCIPWD3, 0xac0), INTC_VECT(PCIPWD2, 0xae0), 174 INTC_VECT(PCIC5, 0xac0), INTC_VECT(PCIC5, 0xae0),
201 INTC_VECT(PCIPWD1, 0xb00), INTC_VECT(PCIPWD0, 0xb20), 175 INTC_VECT(PCIC5, 0xb00), INTC_VECT(PCIC5, 0xb20),
202 INTC_VECT(STIF0, 0xb40), INTC_VECT(STIF1, 0xb60), 176 INTC_VECT(STIF0, 0xb40), INTC_VECT(STIF1, 0xb60),
203 INTC_VECT(SCIF1_ERI, 0xb80), INTC_VECT(SCIF1_RXI, 0xba0), 177 INTC_VECT(SCIF1, 0xb80), INTC_VECT(SCIF1, 0xba0),
204 INTC_VECT(SCIF1_BRI, 0xbc0), INTC_VECT(SCIF1_TXI, 0xbe0), 178 INTC_VECT(SCIF1, 0xbc0), INTC_VECT(SCIF1, 0xbe0),
205 INTC_VECT(SIOF0, 0xc00), INTC_VECT(SIOF1, 0xc20), 179 INTC_VECT(SIOF0, 0xc00), INTC_VECT(SIOF1, 0xc20),
206 INTC_VECT(USBH, 0xc60), INTC_VECT(USBFI0, 0xc80), 180 INTC_VECT(USBH, 0xc60), INTC_VECT(USBF, 0xc80),
207 INTC_VECT(USBFI1, 0xca0), 181 INTC_VECT(USBF, 0xca0),
208 INTC_VECT(TPU, 0xcc0), INTC_VECT(PCC, 0xce0), 182 INTC_VECT(TPU, 0xcc0), INTC_VECT(PCC, 0xce0),
209 INTC_VECT(MMCIF_FSTAT, 0xd00), INTC_VECT(MMCIF_TRAN, 0xd20), 183 INTC_VECT(MMCIF, 0xd00), INTC_VECT(MMCIF, 0xd20),
210 INTC_VECT(MMCIF_ERR, 0xd40), INTC_VECT(MMCIF_FRDY, 0xd60), 184 INTC_VECT(MMCIF, 0xd40), INTC_VECT(MMCIF, 0xd60),
211 INTC_VECT(SIM_ERI, 0xd80), INTC_VECT(SIM_RXI, 0xda0), 185 INTC_VECT(SIM, 0xd80), INTC_VECT(SIM, 0xda0),
212 INTC_VECT(SIM_TXI, 0xdc0), INTC_VECT(SIM_TEND, 0xde0), 186 INTC_VECT(SIM, 0xdc0), INTC_VECT(SIM, 0xde0),
213 INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20), 187 INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20),
214 INTC_VECT(TMU5, 0xe40), INTC_VECT(ADC, 0xe60), 188 INTC_VECT(TMU5, 0xe40), INTC_VECT(ADC, 0xe60),
215 INTC_VECT(SSI0, 0xe80), INTC_VECT(SSI1, 0xea0), 189 INTC_VECT(SSI0, 0xe80), INTC_VECT(SSI1, 0xea0),
216 INTC_VECT(SSI2, 0xec0), INTC_VECT(SSI3, 0xee0), 190 INTC_VECT(SSI2, 0xec0), INTC_VECT(SSI3, 0xee0),
217 INTC_VECT(SCIF2_ERI, 0xf00), INTC_VECT(SCIF2_RXI, 0xf20), 191 INTC_VECT(SCIF2, 0xf00), INTC_VECT(SCIF2, 0xf20),
218 INTC_VECT(SCIF2_BRI, 0xf40), INTC_VECT(SCIF2_TXI, 0xf60), 192 INTC_VECT(SCIF2, 0xf40), INTC_VECT(SCIF2, 0xf60),
219 INTC_VECT(GPIO_CH0, 0xf80), INTC_VECT(GPIO_CH1, 0xfa0), 193 INTC_VECT(GPIO, 0xf80), INTC_VECT(GPIO, 0xfa0),
220 INTC_VECT(GPIO_CH2, 0xfc0), INTC_VECT(GPIO_CH3, 0xfe0), 194 INTC_VECT(GPIO, 0xfc0), INTC_VECT(GPIO, 0xfe0),
221}; 195};
222 196
223static struct intc_group groups[] __initdata = { 197static struct intc_group groups[] __initdata = {
224 INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI), 198 INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI),
225 INTC_GROUP(TMU345, TMU3, TMU4, TMU5), 199 INTC_GROUP(TMU345, TMU3, TMU4, TMU5),
226 INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
227 INTC_GROUP(DMAC, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2,
228 DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE),
229 INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
230 INTC_GROUP(GETHER, GEINT0, GEINT1, GEINT2),
231 INTC_GROUP(PCIC5, PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0),
232 INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
233 INTC_GROUP(USBF, USBFI0, USBFI1),
234 INTC_GROUP(MMCIF, MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY),
235 INTC_GROUP(SIM, SIM_ERI, SIM_RXI, SIM_TXI, SIM_TEND),
236 INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI),
237 INTC_GROUP(GPIO, GPIO_CH0, GPIO_CH1, GPIO_CH2, GPIO_CH3),
238}; 200};
239 201
240static struct intc_mask_reg mask_registers[] __initdata = { 202static struct intc_mask_reg mask_registers[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index fb8200cc7440..6f7227cd65bf 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -20,17 +20,7 @@ static struct resource rtc_resources[] = {
20 .flags = IORESOURCE_IO, 20 .flags = IORESOURCE_IO,
21 }, 21 },
22 [1] = { 22 [1] = {
23 /* Period IRQ */ 23 /* Shared Period/Carry/Alarm IRQ */
24 .start = 21,
25 .flags = IORESOURCE_IRQ,
26 },
27 [2] = {
28 /* Carry IRQ */
29 .start = 22,
30 .flags = IORESOURCE_IRQ,
31 },
32 [3] = {
33 /* Alarm IRQ */
34 .start = 20, 24 .start = 20,
35 .flags = IORESOURCE_IRQ, 25 .flags = IORESOURCE_IRQ,
36 }, 26 },
@@ -48,12 +38,12 @@ static struct plat_sci_port sci_platform_data[] = {
48 .mapbase = 0xffe00000, 38 .mapbase = 0xffe00000,
49 .flags = UPF_BOOT_AUTOCONF, 39 .flags = UPF_BOOT_AUTOCONF,
50 .type = PORT_SCIF, 40 .type = PORT_SCIF,
51 .irqs = { 40, 41, 43, 42 }, 41 .irqs = { 40, 40, 40, 40 },
52 }, { 42 }, {
53 .mapbase = 0xffe10000, 43 .mapbase = 0xffe10000,
54 .flags = UPF_BOOT_AUTOCONF, 44 .flags = UPF_BOOT_AUTOCONF,
55 .type = PORT_SCIF, 45 .type = PORT_SCIF,
56 .irqs = { 76, 77, 79, 78 }, 46 .irqs = { 76, 76, 76, 76 },
57 }, { 47 }, {
58 .flags = 0, 48 .flags = 0,
59 } 49 }
@@ -90,82 +80,55 @@ enum {
90 IRL_HHLL, IRL_HHLH, IRL_HHHL, 80 IRL_HHLL, IRL_HHLH, IRL_HHHL,
91 81
92 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 82 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
93 RTC_ATI, RTC_PRI, RTC_CUI, 83 RTC, WDT, TMU0, TMU1, TMU2, TMU2_TICPI,
94 WDT, 84 HUDI, DMAC0, SCIF0, DMAC1, CMT, HAC,
95 TMU0, TMU1, TMU2, TMU2_TICPI, 85 PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD, PCIC5,
96 HUDI, 86 SCIF1, SIOF, HSPI, MMCIF, TMU3, TMU4, TMU5, SSI, FLCTL, GPIO,
97 DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, DMAC0_DMINT3, DMAC0_DMAE,
98 SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI,
99 DMAC0_DMINT4, DMAC0_DMINT5, DMAC1_DMINT6, DMAC1_DMINT7,
100 CMT, HAC,
101 PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD,
102 PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0,
103 SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI,
104 SIOF, HSPI,
105 MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY,
106 DMAC1_DMINT8, DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11,
107 TMU3, TMU4, TMU5,
108 SSI,
109 FLCTL_FLSTE, FLCTL_FLEND, FLCTL_FLTRQ0, FLCTL_FLTRQ1,
110 GPIOI0, GPIOI1, GPIOI2, GPIOI3,
111 87
112 /* interrupt groups */ 88 /* interrupt groups */
113 89
114 RTC, TMU012, DMAC0, SCIF0, DMAC45, DMAC1, 90 TMU012, TMU345,
115 PCIC5, SCIF1, MMCIF, TMU345, FLCTL, GPIO,
116}; 91};
117 92
118static struct intc_vect vectors[] __initdata = { 93static struct intc_vect vectors[] __initdata = {
119 INTC_VECT(RTC_ATI, 0x480), INTC_VECT(RTC_PRI, 0x4a0), 94 INTC_VECT(RTC, 0x480), INTC_VECT(RTC, 0x4a0),
120 INTC_VECT(RTC_CUI, 0x4c0), 95 INTC_VECT(RTC, 0x4c0),
121 INTC_VECT(WDT, 0x560), 96 INTC_VECT(WDT, 0x560),
122 INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0), 97 INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0),
123 INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0), 98 INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0),
124 INTC_VECT(HUDI, 0x600), 99 INTC_VECT(HUDI, 0x600),
125 INTC_VECT(DMAC0_DMINT0, 0x640), INTC_VECT(DMAC0_DMINT1, 0x660), 100 INTC_VECT(DMAC0, 0x640), INTC_VECT(DMAC0, 0x660),
126 INTC_VECT(DMAC0_DMINT2, 0x680), INTC_VECT(DMAC0_DMINT3, 0x6a0), 101 INTC_VECT(DMAC0, 0x680), INTC_VECT(DMAC0, 0x6a0),
127 INTC_VECT(DMAC0_DMAE, 0x6c0), 102 INTC_VECT(DMAC0, 0x6c0),
128 INTC_VECT(SCIF0_ERI, 0x700), INTC_VECT(SCIF0_RXI, 0x720), 103 INTC_VECT(SCIF0, 0x700), INTC_VECT(SCIF0, 0x720),
129 INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760), 104 INTC_VECT(SCIF0, 0x740), INTC_VECT(SCIF0, 0x760),
130 INTC_VECT(DMAC0_DMINT4, 0x780), INTC_VECT(DMAC0_DMINT5, 0x7a0), 105 INTC_VECT(DMAC0, 0x780), INTC_VECT(DMAC0, 0x7a0),
131 INTC_VECT(DMAC1_DMINT6, 0x7c0), INTC_VECT(DMAC1_DMINT7, 0x7e0), 106 INTC_VECT(DMAC1, 0x7c0), INTC_VECT(DMAC1, 0x7e0),
132 INTC_VECT(CMT, 0x900), INTC_VECT(HAC, 0x980), 107 INTC_VECT(CMT, 0x900), INTC_VECT(HAC, 0x980),
133 INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20), 108 INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20),
134 INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60), 109 INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60),
135 INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIERR, 0xaa0), 110 INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIC5, 0xaa0),
136 INTC_VECT(PCIPWD3, 0xac0), INTC_VECT(PCIPWD2, 0xae0), 111 INTC_VECT(PCIC5, 0xac0), INTC_VECT(PCIC5, 0xae0),
137 INTC_VECT(PCIPWD1, 0xb00), INTC_VECT(PCIPWD0, 0xb20), 112 INTC_VECT(PCIC5, 0xb00), INTC_VECT(PCIC5, 0xb20),
138 INTC_VECT(SCIF1_ERI, 0xb80), INTC_VECT(SCIF1_RXI, 0xba0), 113 INTC_VECT(SCIF1, 0xb80), INTC_VECT(SCIF1, 0xba0),
139 INTC_VECT(SCIF1_BRI, 0xbc0), INTC_VECT(SCIF1_TXI, 0xbe0), 114 INTC_VECT(SCIF1, 0xbc0), INTC_VECT(SCIF1, 0xbe0),
140 INTC_VECT(SIOF, 0xc00), INTC_VECT(HSPI, 0xc80), 115 INTC_VECT(SIOF, 0xc00), INTC_VECT(HSPI, 0xc80),
141 INTC_VECT(MMCIF_FSTAT, 0xd00), INTC_VECT(MMCIF_TRAN, 0xd20), 116 INTC_VECT(MMCIF, 0xd00), INTC_VECT(MMCIF, 0xd20),
142 INTC_VECT(MMCIF_ERR, 0xd40), INTC_VECT(MMCIF_FRDY, 0xd60), 117 INTC_VECT(MMCIF, 0xd40), INTC_VECT(MMCIF, 0xd60),
143 INTC_VECT(DMAC1_DMINT8, 0xd80), INTC_VECT(DMAC1_DMINT9, 0xda0), 118 INTC_VECT(DMAC1, 0xd80), INTC_VECT(DMAC1, 0xda0),
144 INTC_VECT(DMAC1_DMINT10, 0xdc0), INTC_VECT(DMAC1_DMINT11, 0xde0), 119 INTC_VECT(DMAC1, 0xdc0), INTC_VECT(DMAC1, 0xde0),
145 INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20), 120 INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20),
146 INTC_VECT(TMU5, 0xe40), 121 INTC_VECT(TMU5, 0xe40),
147 INTC_VECT(SSI, 0xe80), 122 INTC_VECT(SSI, 0xe80),
148 INTC_VECT(FLCTL_FLSTE, 0xf00), INTC_VECT(FLCTL_FLEND, 0xf20), 123 INTC_VECT(FLCTL, 0xf00), INTC_VECT(FLCTL, 0xf20),
149 INTC_VECT(FLCTL_FLTRQ0, 0xf40), INTC_VECT(FLCTL_FLTRQ1, 0xf60), 124 INTC_VECT(FLCTL, 0xf40), INTC_VECT(FLCTL, 0xf60),
150 INTC_VECT(GPIOI0, 0xf80), INTC_VECT(GPIOI1, 0xfa0), 125 INTC_VECT(GPIO, 0xf80), INTC_VECT(GPIO, 0xfa0),
151 INTC_VECT(GPIOI2, 0xfc0), INTC_VECT(GPIOI3, 0xfe0), 126 INTC_VECT(GPIO, 0xfc0), INTC_VECT(GPIO, 0xfe0),
152}; 127};
153 128
154static struct intc_group groups[] __initdata = { 129static struct intc_group groups[] __initdata = {
155 INTC_GROUP(RTC, RTC_ATI, RTC_PRI, RTC_CUI),
156 INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI), 130 INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI),
157 INTC_GROUP(DMAC0, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2,
158 DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE),
159 INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
160 INTC_GROUP(DMAC1, DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8,
161 DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11),
162 INTC_GROUP(PCIC5, PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0),
163 INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
164 INTC_GROUP(MMCIF, MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY),
165 INTC_GROUP(TMU345, TMU3, TMU4, TMU5), 131 INTC_GROUP(TMU345, TMU3, TMU4, TMU5),
166 INTC_GROUP(FLCTL, FLCTL_FLSTE, FLCTL_FLEND,
167 FLCTL_FLTRQ0, FLCTL_FLTRQ1),
168 INTC_GROUP(GPIO, GPIOI0, GPIOI1, GPIOI2, GPIOI3),
169}; 132};
170 133
171static struct intc_mask_reg mask_registers[] __initdata = { 134static struct intc_mask_reg mask_registers[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 30baa63b24c8..d80802a49dbd 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -20,18 +20,13 @@ static struct plat_sci_port sci_platform_data[] = {
20 .mapbase = 0xffea0000, 20 .mapbase = 0xffea0000,
21 .flags = UPF_BOOT_AUTOCONF, 21 .flags = UPF_BOOT_AUTOCONF,
22 .type = PORT_SCIF, 22 .type = PORT_SCIF,
23 .irqs = { 40, 41, 43, 42 }, 23 .irqs = { 40, 40, 40, 40 },
24 }, { 24 }, {
25 .mapbase = 0xffeb0000, 25 .mapbase = 0xffeb0000,
26 .flags = UPF_BOOT_AUTOCONF, 26 .flags = UPF_BOOT_AUTOCONF,
27 .type = PORT_SCIF, 27 .type = PORT_SCIF,
28 .irqs = { 44, 45, 47, 46 }, 28 .irqs = { 44, 44, 44, 44 },
29 }, 29 }, {
30
31 /*
32 * The rest of these all have multiplexed IRQs
33 */
34 {
35 .mapbase = 0xffec0000, 30 .mapbase = 0xffec0000,
36 .flags = UPF_BOOT_AUTOCONF, 31 .flags = UPF_BOOT_AUTOCONF,
37 .type = PORT_SCIF, 32 .type = PORT_SCIF,
@@ -91,33 +86,19 @@ enum {
91 IRL4_HHLL, IRL4_HHLH, IRL4_HHHL, 86 IRL4_HHLL, IRL4_HHLH, IRL4_HHHL,
92 87
93 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 88 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
94 WDT, 89 WDT, TMU0, TMU1, TMU2, TMU2_TICPI,
95 TMU0, TMU1, TMU2, TMU2_TICPI, 90 HUDI, DMAC0, SCIF0, SCIF1, DMAC1, HSPI,
96 HUDI,
97 DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, DMAC0_DMINT3,
98 DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE,
99 SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI,
100 SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI,
101 DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, DMAC1_DMINT9,
102 DMAC1_DMINT10, DMAC1_DMINT11, DMAC1_DMAE,
103 HSPI,
104 SCIF2, SCIF3, SCIF4, SCIF5, 91 SCIF2, SCIF3, SCIF4, SCIF5,
105 PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD, 92 PCISERR, PCIINTA, PCIINTB, PCIINTC, PCIINTD, PCIC5,
106 PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0, 93 SIOF, MMCIF, DU, GDTA,
107 SIOF,
108 MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY,
109 DU,
110 GDTA_GACLI, GDTA_GAMCI, GDTA_GAERI,
111 TMU3, TMU4, TMU5, 94 TMU3, TMU4, TMU5,
112 SSI0, SSI1, 95 SSI0, SSI1,
113 HAC0, HAC1, 96 HAC0, HAC1,
114 FLCTL_FLSTE, FLCTL_FLEND, FLCTL_FLTRQ0, FLCTL_FLTRQ1, 97 FLCTL, GPIO,
115 GPIOI0, GPIOI1, GPIOI2, GPIOI3,
116 98
117 /* interrupt groups */ 99 /* interrupt groups */
118 100
119 TMU012, DMAC0, SCIF0, SCIF1, DMAC1, 101 TMU012, TMU345
120 PCIC5, MMCIF, GDTA, TMU345, FLCTL, GPIO
121}; 102};
122 103
123static struct intc_vect vectors[] __initdata = { 104static struct intc_vect vectors[] __initdata = {
@@ -125,57 +106,45 @@ static struct intc_vect vectors[] __initdata = {
125 INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0), 106 INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0),
126 INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0), 107 INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0),
127 INTC_VECT(HUDI, 0x600), 108 INTC_VECT(HUDI, 0x600),
128 INTC_VECT(DMAC0_DMINT0, 0x620), INTC_VECT(DMAC0_DMINT1, 0x640), 109 INTC_VECT(DMAC0, 0x620), INTC_VECT(DMAC0, 0x640),
129 INTC_VECT(DMAC0_DMINT2, 0x660), INTC_VECT(DMAC0_DMINT3, 0x680), 110 INTC_VECT(DMAC0, 0x660), INTC_VECT(DMAC0, 0x680),
130 INTC_VECT(DMAC0_DMINT4, 0x6a0), INTC_VECT(DMAC0_DMINT5, 0x6c0), 111 INTC_VECT(DMAC0, 0x6a0), INTC_VECT(DMAC0, 0x6c0),
131 INTC_VECT(DMAC0_DMAE, 0x6e0), 112 INTC_VECT(DMAC0, 0x6e0),
132 INTC_VECT(SCIF0_ERI, 0x700), INTC_VECT(SCIF0_RXI, 0x720), 113 INTC_VECT(SCIF0, 0x700), INTC_VECT(SCIF0, 0x720),
133 INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760), 114 INTC_VECT(SCIF0, 0x740), INTC_VECT(SCIF0, 0x760),
134 INTC_VECT(SCIF1_ERI, 0x780), INTC_VECT(SCIF1_RXI, 0x7a0), 115 INTC_VECT(SCIF1, 0x780), INTC_VECT(SCIF1, 0x7a0),
135 INTC_VECT(SCIF1_BRI, 0x7c0), INTC_VECT(SCIF1_TXI, 0x7e0), 116 INTC_VECT(SCIF1, 0x7c0), INTC_VECT(SCIF1, 0x7e0),
136 INTC_VECT(DMAC1_DMINT6, 0x880), INTC_VECT(DMAC1_DMINT7, 0x8a0), 117 INTC_VECT(DMAC1, 0x880), INTC_VECT(DMAC1, 0x8a0),
137 INTC_VECT(DMAC1_DMINT8, 0x8c0), INTC_VECT(DMAC1_DMINT9, 0x8e0), 118 INTC_VECT(DMAC1, 0x8c0), INTC_VECT(DMAC1, 0x8e0),
138 INTC_VECT(DMAC1_DMINT10, 0x900), INTC_VECT(DMAC1_DMINT11, 0x920), 119 INTC_VECT(DMAC1, 0x900), INTC_VECT(DMAC1, 0x920),
139 INTC_VECT(DMAC1_DMAE, 0x940), 120 INTC_VECT(DMAC1, 0x940),
140 INTC_VECT(HSPI, 0x960), 121 INTC_VECT(HSPI, 0x960),
141 INTC_VECT(SCIF2, 0x980), INTC_VECT(SCIF3, 0x9a0), 122 INTC_VECT(SCIF2, 0x980), INTC_VECT(SCIF3, 0x9a0),
142 INTC_VECT(SCIF4, 0x9c0), INTC_VECT(SCIF5, 0x9e0), 123 INTC_VECT(SCIF4, 0x9c0), INTC_VECT(SCIF5, 0x9e0),
143 INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20), 124 INTC_VECT(PCISERR, 0xa00), INTC_VECT(PCIINTA, 0xa20),
144 INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60), 125 INTC_VECT(PCIINTB, 0xa40), INTC_VECT(PCIINTC, 0xa60),
145 INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIERR, 0xaa0), 126 INTC_VECT(PCIINTD, 0xa80), INTC_VECT(PCIC5, 0xaa0),
146 INTC_VECT(PCIPWD3, 0xac0), INTC_VECT(PCIPWD2, 0xae0), 127 INTC_VECT(PCIC5, 0xac0), INTC_VECT(PCIC5, 0xae0),
147 INTC_VECT(PCIPWD1, 0xb00), INTC_VECT(PCIPWD0, 0xb20), 128 INTC_VECT(PCIC5, 0xb00), INTC_VECT(PCIC5, 0xb20),
148 INTC_VECT(SIOF, 0xc00), 129 INTC_VECT(SIOF, 0xc00),
149 INTC_VECT(MMCIF_FSTAT, 0xd00), INTC_VECT(MMCIF_TRAN, 0xd20), 130 INTC_VECT(MMCIF, 0xd00), INTC_VECT(MMCIF, 0xd20),
150 INTC_VECT(MMCIF_ERR, 0xd40), INTC_VECT(MMCIF_FRDY, 0xd60), 131 INTC_VECT(MMCIF, 0xd40), INTC_VECT(MMCIF, 0xd60),
151 INTC_VECT(DU, 0xd80), 132 INTC_VECT(DU, 0xd80),
152 INTC_VECT(GDTA_GACLI, 0xda0), INTC_VECT(GDTA_GAMCI, 0xdc0), 133 INTC_VECT(GDTA, 0xda0), INTC_VECT(GDTA, 0xdc0),
153 INTC_VECT(GDTA_GAERI, 0xde0), 134 INTC_VECT(GDTA, 0xde0),
154 INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20), 135 INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20),
155 INTC_VECT(TMU5, 0xe40), 136 INTC_VECT(TMU5, 0xe40),
156 INTC_VECT(SSI0, 0xe80), INTC_VECT(SSI1, 0xea0), 137 INTC_VECT(SSI0, 0xe80), INTC_VECT(SSI1, 0xea0),
157 INTC_VECT(HAC0, 0xec0), INTC_VECT(HAC1, 0xee0), 138 INTC_VECT(HAC0, 0xec0), INTC_VECT(HAC1, 0xee0),
158 INTC_VECT(FLCTL_FLSTE, 0xf00), INTC_VECT(FLCTL_FLEND, 0xf20), 139 INTC_VECT(FLCTL, 0xf00), INTC_VECT(FLCTL, 0xf20),
159 INTC_VECT(FLCTL_FLTRQ0, 0xf40), INTC_VECT(FLCTL_FLTRQ1, 0xf60), 140 INTC_VECT(FLCTL, 0xf40), INTC_VECT(FLCTL, 0xf60),
160 INTC_VECT(GPIOI0, 0xf80), INTC_VECT(GPIOI1, 0xfa0), 141 INTC_VECT(GPIO, 0xf80), INTC_VECT(GPIO, 0xfa0),
161 INTC_VECT(GPIOI2, 0xfc0), INTC_VECT(GPIOI3, 0xfe0), 142 INTC_VECT(GPIO, 0xfc0), INTC_VECT(GPIO, 0xfe0),
162}; 143};
163 144
164static struct intc_group groups[] __initdata = { 145static struct intc_group groups[] __initdata = {
165 INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI), 146 INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI),
166 INTC_GROUP(DMAC0, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2,
167 DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE),
168 INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI),
169 INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI),
170 INTC_GROUP(DMAC1, DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8,
171 DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11, DMAC1_DMAE),
172 INTC_GROUP(PCIC5, PCIERR, PCIPWD3, PCIPWD2, PCIPWD1, PCIPWD0),
173 INTC_GROUP(MMCIF, MMCIF_FSTAT, MMCIF_TRAN, MMCIF_ERR, MMCIF_FRDY),
174 INTC_GROUP(GDTA, GDTA_GACLI, GDTA_GAMCI, GDTA_GAERI),
175 INTC_GROUP(TMU345, TMU3, TMU4, TMU5), 147 INTC_GROUP(TMU345, TMU3, TMU4, TMU5),
176 INTC_GROUP(FLCTL, FLCTL_FLSTE, FLCTL_FLEND,
177 FLCTL_FLTRQ0, FLCTL_FLTRQ1),
178 INTC_GROUP(GPIO, GPIOI0, GPIOI1, GPIOI2, GPIOI3),
179}; 148};
180 149
181static struct intc_mask_reg mask_registers[] __initdata = { 150static struct intc_mask_reg mask_registers[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
new file mode 100644
index 000000000000..5a47e1cf442e
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -0,0 +1,490 @@
1/*
2 * SH7786 Setup
3 *
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
6 *
7 * Based on SH7785 Setup
8 *
9 * Copyright (C) 2007 Paul Mundt
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 */
15#include <linux/platform_device.h>
16#include <linux/init.h>
17#include <linux/serial.h>
18#include <linux/serial_sci.h>
19#include <linux/io.h>
20#include <linux/mm.h>
21#include <linux/dma-mapping.h>
22#include <asm/mmzone.h>
23
24static struct plat_sci_port sci_platform_data[] = {
25 {
26 .mapbase = 0xffea0000,
27 .flags = UPF_BOOT_AUTOCONF,
28 .type = PORT_SCIF,
29 .irqs = { 40, 41, 43, 42 },
30 },
31 /*
32 * The rest of these all have multiplexed IRQs
33 */
34 {
35 .mapbase = 0xffeb0000,
36 .flags = UPF_BOOT_AUTOCONF,
37 .type = PORT_SCIF,
38 .irqs = { 44, 44, 44, 44 },
39 }, {
40 .mapbase = 0xffec0000,
41 .flags = UPF_BOOT_AUTOCONF,
42 .type = PORT_SCIF,
43 .irqs = { 50, 50, 50, 50 },
44 }, {
45 .mapbase = 0xffed0000,
46 .flags = UPF_BOOT_AUTOCONF,
47 .type = PORT_SCIF,
48 .irqs = { 51, 51, 51, 51 },
49 }, {
50 .mapbase = 0xffee0000,
51 .flags = UPF_BOOT_AUTOCONF,
52 .type = PORT_SCIF,
53 .irqs = { 52, 52, 52, 52 },
54 }, {
55 .mapbase = 0xffef0000,
56 .flags = UPF_BOOT_AUTOCONF,
57 .type = PORT_SCIF,
58 .irqs = { 53, 53, 53, 53 },
59 }, {
60 .flags = 0,
61 }
62};
63
64static struct platform_device sci_device = {
65 .name = "sh-sci",
66 .id = -1,
67 .dev = {
68 .platform_data = sci_platform_data,
69 },
70};
71
72static struct resource usb_ohci_resources[] = {
73 [0] = {
74 .start = 0xffe70400,
75 .end = 0xffe704ff,
76 .flags = IORESOURCE_MEM,
77 },
78 [1] = {
79 .start = 77,
80 .end = 77,
81 .flags = IORESOURCE_IRQ,
82 },
83};
84
85static u64 usb_ohci_dma_mask = DMA_BIT_MASK(32);
86static struct platform_device usb_ohci_device = {
87 .name = "sh_ohci",
88 .id = -1,
89 .dev = {
90 .dma_mask = &usb_ohci_dma_mask,
91 .coherent_dma_mask = DMA_BIT_MASK(32),
92 },
93 .num_resources = ARRAY_SIZE(usb_ohci_resources),
94 .resource = usb_ohci_resources,
95};
96
97static struct platform_device *sh7786_devices[] __initdata = {
98 &sci_device,
99 &usb_ohci_device,
100};
101
102
103/*
104 * Please call this function if your platform board
105 * use external clock for USB
106 * */
107#define USBCTL0 0xffe70858
108#define CLOCK_MODE_MASK 0xffffff7f
109#define EXT_CLOCK_MODE 0x00000080
110void __init sh7786_usb_use_exclock(void)
111{
112 u32 val = __raw_readl(USBCTL0) & CLOCK_MODE_MASK;
113 __raw_writel(val | EXT_CLOCK_MODE, USBCTL0);
114}
115
116#define USBINITREG1 0xffe70094
117#define USBINITREG2 0xffe7009c
118#define USBINITVAL1 0x00ff0040
119#define USBINITVAL2 0x00000001
120
121#define USBPCTL1 0xffe70804
122#define USBST 0xffe70808
123#define PHY_ENB 0x00000001
124#define PLL_ENB 0x00000002
125#define PHY_RST 0x00000004
126#define ACT_PLL_STATUS 0xc0000000
127static void __init sh7786_usb_setup(void)
128{
129 int i = 1000000;
130
131 /*
132 * USB initial settings
133 *
134 * The following settings are necessary
135 * for using the USB modules.
136 *
137 * see "USB Inital Settings" for detail
138 */
139 __raw_writel(USBINITVAL1, USBINITREG1);
140 __raw_writel(USBINITVAL2, USBINITREG2);
141
142 /*
143 * Set the PHY and PLL enable bit
144 */
145 __raw_writel(PHY_ENB | PLL_ENB, USBPCTL1);
146 while (i-- &&
147 ((__raw_readl(USBST) & ACT_PLL_STATUS) != ACT_PLL_STATUS))
148 cpu_relax();
149
150 if (i) {
151 /* Set the PHY RST bit */
152 __raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
153 printk(KERN_INFO "sh7786 usb setup done\n");
154 }
155}
156
157static int __init sh7786_devices_setup(void)
158{
159 sh7786_usb_setup();
160 return platform_add_devices(sh7786_devices,
161 ARRAY_SIZE(sh7786_devices));
162}
163device_initcall(sh7786_devices_setup);
164
165enum {
166 UNUSED = 0,
167
168 /* interrupt sources */
169
170 IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
171 IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
172 IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
173 IRL0_HHLL, IRL0_HHLH, IRL0_HHHL,
174
175 IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,
176 IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,
177 IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,
178 IRL4_HHLL, IRL4_HHLH, IRL4_HHHL,
179
180 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
181 WDT,
182 TMU0_0, TMU0_1, TMU0_2, TMU0_3,
183 TMU1_0, TMU1_1, TMU1_2,
184 DMAC0_0, DMAC0_1, DMAC0_2, DMAC0_3, DMAC0_4, DMAC0_5, DMAC0_6,
185 HUDI1, HUDI0,
186 DMAC1_0, DMAC1_1, DMAC1_2, DMAC1_3,
187 HPB_0, HPB_1, HPB_2,
188 SCIF0_0, SCIF0_1, SCIF0_2, SCIF0_3,
189 SCIF1,
190 TMU2, TMU3,
191 SCIF2, SCIF3, SCIF4, SCIF5,
192 Eth_0, Eth_1,
193 PCIeC0_0, PCIeC0_1, PCIeC0_2,
194 PCIeC1_0, PCIeC1_1, PCIeC1_2,
195 USB,
196 I2C0, I2C1,
197 DU,
198 SSI0, SSI1, SSI2, SSI3,
199 PCIeC2_0, PCIeC2_1, PCIeC2_2,
200 HAC0, HAC1,
201 FLCTL,
202 HSPI,
203 GPIO0, GPIO1,
204 Thermal,
205 INTC0, INTC1, INTC2, INTC3, INTC4, INTC5, INTC6, INTC7,
206
207 /* interrupt groups */
208};
209
210static struct intc_vect vectors[] __initdata = {
211 INTC_VECT(WDT, 0x3e0),
212 INTC_VECT(TMU0_0, 0x400), INTC_VECT(TMU0_1, 0x420),
213 INTC_VECT(TMU0_2, 0x440), INTC_VECT(TMU0_3, 0x460),
214 INTC_VECT(TMU1_0, 0x480), INTC_VECT(TMU1_1, 0x4a0),
215 INTC_VECT(TMU1_2, 0x4c0),
216 INTC_VECT(DMAC0_0, 0x500), INTC_VECT(DMAC0_1, 0x520),
217 INTC_VECT(DMAC0_2, 0x540), INTC_VECT(DMAC0_3, 0x560),
218 INTC_VECT(DMAC0_4, 0x580), INTC_VECT(DMAC0_5, 0x5a0),
219 INTC_VECT(DMAC0_6, 0x5c0),
220 INTC_VECT(HUDI1, 0x5e0), INTC_VECT(HUDI0, 0x600),
221 INTC_VECT(DMAC1_0, 0x620), INTC_VECT(DMAC1_1, 0x640),
222 INTC_VECT(DMAC1_2, 0x660), INTC_VECT(DMAC1_3, 0x680),
223 INTC_VECT(HPB_0, 0x6a0), INTC_VECT(HPB_1, 0x6c0),
224 INTC_VECT(HPB_2, 0x6e0),
225 INTC_VECT(SCIF0_0, 0x700), INTC_VECT(SCIF0_1, 0x720),
226 INTC_VECT(SCIF0_2, 0x740), INTC_VECT(SCIF0_3, 0x760),
227 INTC_VECT(SCIF1, 0x780),
228 INTC_VECT(TMU2, 0x7a0), INTC_VECT(TMU3, 0x7c0),
229 INTC_VECT(SCIF2, 0x840), INTC_VECT(SCIF3, 0x860),
230 INTC_VECT(SCIF4, 0x880), INTC_VECT(SCIF5, 0x8a0),
231 INTC_VECT(Eth_0, 0x8c0), INTC_VECT(Eth_1, 0x8e0),
232 INTC_VECT(PCIeC0_0, 0xae0), INTC_VECT(PCIeC0_1, 0xb00),
233 INTC_VECT(PCIeC0_2, 0xb20),
234 INTC_VECT(PCIeC1_0, 0xb40), INTC_VECT(PCIeC1_1, 0xb60),
235 INTC_VECT(PCIeC1_2, 0xb80),
236 INTC_VECT(USB, 0xba0),
237 INTC_VECT(I2C0, 0xcc0), INTC_VECT(I2C1, 0xce0),
238 INTC_VECT(DU, 0xd00),
239 INTC_VECT(SSI0, 0xd20), INTC_VECT(SSI1, 0xd40),
240 INTC_VECT(SSI2, 0xd60), INTC_VECT(SSI3, 0xd80),
241 INTC_VECT(PCIeC2_0, 0xda0), INTC_VECT(PCIeC2_1, 0xdc0),
242 INTC_VECT(PCIeC2_2, 0xde0),
243 INTC_VECT(HAC0, 0xe00), INTC_VECT(HAC1, 0xe20),
244 INTC_VECT(FLCTL, 0xe40),
245 INTC_VECT(HSPI, 0xe80),
246 INTC_VECT(GPIO0, 0xea0), INTC_VECT(GPIO1, 0xec0),
247 INTC_VECT(Thermal, 0xee0),
248};
249
250/* FIXME: Main CPU support only now */
251#if 1 /* Main CPU */
252#define CnINTMSK0 0xfe410030
253#define CnINTMSK1 0xfe410040
254#define CnINTMSKCLR0 0xfe410050
255#define CnINTMSKCLR1 0xfe410060
256#define CnINT2MSKR0 0xfe410a20
257#define CnINT2MSKR1 0xfe410a24
258#define CnINT2MSKR2 0xfe410a28
259#define CnINT2MSKR3 0xfe410a2c
260#define CnINT2MSKCR0 0xfe410a30
261#define CnINT2MSKCR1 0xfe410a34
262#define CnINT2MSKCR2 0xfe410a38
263#define CnINT2MSKCR3 0xfe410a3c
264#else /* Sub CPU */
265#define CnINTMSK0 0xfe410034
266#define CnINTMSK1 0xfe410044
267#define CnINTMSKCLR0 0xfe410054
268#define CnINTMSKCLR1 0xfe410064
269#define CnINT2MSKR0 0xfe410b20
270#define CnINT2MSKR1 0xfe410b24
271#define CnINT2MSKR2 0xfe410b28
272#define CnINT2MSKR3 0xfe410b2c
273#define CnINT2MSKCR0 0xfe410b30
274#define CnINT2MSKCR1 0xfe410b34
275#define CnINT2MSKCR2 0xfe410b38
276#define CnINT2MSKCR3 0xfe410b3c
277#endif
278
279#define INTMSK2 0xfe410068
280#define INTMSKCLR2 0xfe41006c
281
282static struct intc_mask_reg mask_registers[] __initdata = {
283 { CnINTMSK0, CnINTMSKCLR0, 32,
284 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
285 { INTMSK2, INTMSKCLR2, 32,
286 { IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
287 IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
288 IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
289 IRL0_HHLL, IRL0_HHLH, IRL0_HHHL, 0,
290 IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,
291 IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,
292 IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,
293 IRL4_HHLL, IRL4_HHLH, IRL4_HHHL, 0, } },
294 { CnINT2MSKR0, CnINT2MSKCR0 , 32,
295 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, WDT } },
297 { CnINT2MSKR1, CnINT2MSKCR1, 32,
298 { TMU0_0, TMU0_1, TMU0_2, TMU0_3, TMU1_0, TMU1_1, TMU1_2, 0,
299 DMAC0_0, DMAC0_1, DMAC0_2, DMAC0_3, DMAC0_4, DMAC0_5, DMAC0_6,
300 HUDI1, HUDI0,
301 DMAC1_0, DMAC1_1, DMAC1_2, DMAC1_3,
302 HPB_0, HPB_1, HPB_2,
303 SCIF0_0, SCIF0_1, SCIF0_2, SCIF0_3,
304 SCIF1,
305 TMU2, TMU3, 0, } },
306 { CnINT2MSKR2, CnINT2MSKCR2, 32,
307 { 0, 0, SCIF2, SCIF3, SCIF4, SCIF5,
308 Eth_0, Eth_1,
309 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
310 PCIeC0_0, PCIeC0_1, PCIeC0_2,
311 PCIeC1_0, PCIeC1_1, PCIeC1_2,
312 USB, 0, 0 } },
313 { CnINT2MSKR3, CnINT2MSKCR3, 32,
314 { 0, 0, 0, 0, 0, 0,
315 I2C0, I2C1,
316 DU, SSI0, SSI1, SSI2, SSI3,
317 PCIeC2_0, PCIeC2_1, PCIeC2_2,
318 HAC0, HAC1,
319 FLCTL, 0,
320 HSPI, GPIO0, GPIO1, Thermal,
321 0, 0, 0, 0, 0, 0, 0, 0 } },
322};
323
324static struct intc_prio_reg prio_registers[] __initdata = {
325 { 0xfe410010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3,
326 IRQ4, IRQ5, IRQ6, IRQ7 } },
327 { 0xfe410800, 0, 32, 8, /* INT2PRI0 */ { 0, 0, 0, WDT } },
328 { 0xfe410804, 0, 32, 8, /* INT2PRI1 */ { TMU0_0, TMU0_1,
329 TMU0_2, TMU0_3 } },
330 { 0xfe410808, 0, 32, 8, /* INT2PRI2 */ { TMU1_0, TMU1_1,
331 TMU1_2, 0 } },
332 { 0xfe41080c, 0, 32, 8, /* INT2PRI3 */ { DMAC0_0, DMAC0_1,
333 DMAC0_2, DMAC0_3 } },
334 { 0xfe410810, 0, 32, 8, /* INT2PRI4 */ { DMAC0_4, DMAC0_5,
335 DMAC0_6, HUDI1 } },
336 { 0xfe410814, 0, 32, 8, /* INT2PRI5 */ { HUDI0, DMAC1_0,
337 DMAC1_1, DMAC1_2 } },
338 { 0xfe410818, 0, 32, 8, /* INT2PRI6 */ { DMAC1_3, HPB_0,
339 HPB_1, HPB_2 } },
340 { 0xfe41081c, 0, 32, 8, /* INT2PRI7 */ { SCIF0_0, SCIF0_1,
341 SCIF0_2, SCIF0_3 } },
342 { 0xfe410820, 0, 32, 8, /* INT2PRI8 */ { SCIF1, TMU2, TMU3, 0 } },
343 { 0xfe410824, 0, 32, 8, /* INT2PRI9 */ { 0, 0, SCIF2, SCIF3 } },
344 { 0xfe410828, 0, 32, 8, /* INT2PRI10 */ { SCIF4, SCIF5,
345 Eth_0, Eth_1 } },
346 { 0xfe41082c, 0, 32, 8, /* INT2PRI11 */ { 0, 0, 0, 0 } },
347 { 0xfe410830, 0, 32, 8, /* INT2PRI12 */ { 0, 0, 0, 0 } },
348 { 0xfe410834, 0, 32, 8, /* INT2PRI13 */ { 0, 0, 0, 0 } },
349 { 0xfe410838, 0, 32, 8, /* INT2PRI14 */ { 0, 0, 0, PCIeC0_0 } },
350 { 0xfe41083c, 0, 32, 8, /* INT2PRI15 */ { PCIeC0_1, PCIeC0_2,
351 PCIeC1_0, PCIeC1_1 } },
352 { 0xfe410840, 0, 32, 8, /* INT2PRI16 */ { PCIeC1_2, USB, 0, 0 } },
353 { 0xfe410844, 0, 32, 8, /* INT2PRI17 */ { 0, 0, 0, 0 } },
354 { 0xfe410848, 0, 32, 8, /* INT2PRI18 */ { 0, 0, I2C0, I2C1 } },
355 { 0xfe41084c, 0, 32, 8, /* INT2PRI19 */ { DU, SSI0, SSI1, SSI2 } },
356 { 0xfe410850, 0, 32, 8, /* INT2PRI20 */ { SSI3, PCIeC2_0,
357 PCIeC2_1, PCIeC2_2 } },
358 { 0xfe410854, 0, 32, 8, /* INT2PRI21 */ { HAC0, HAC1, FLCTL, 0 } },
359 { 0xfe410858, 0, 32, 8, /* INT2PRI22 */ { HSPI, GPIO0,
360 GPIO1, Thermal } },
361 { 0xfe41085c, 0, 32, 8, /* INT2PRI23 */ { 0, 0, 0, 0 } },
362 { 0xfe410860, 0, 32, 8, /* INT2PRI24 */ { 0, 0, 0, 0 } },
363};
364
365static DECLARE_INTC_DESC(intc_desc, "sh7786", vectors, NULL,
366 mask_registers, prio_registers, NULL);
367
368/* Support for external interrupt pins in IRQ mode */
369
370static struct intc_vect vectors_irq0123[] __initdata = {
371 INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240),
372 INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0),
373};
374
375static struct intc_vect vectors_irq4567[] __initdata = {
376 INTC_VECT(IRQ4, 0x300), INTC_VECT(IRQ5, 0x340),
377 INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0),
378};
379
380static struct intc_sense_reg sense_registers[] __initdata = {
381 { 0xfe41001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3,
382 IRQ4, IRQ5, IRQ6, IRQ7 } },
383};
384
385static struct intc_mask_reg ack_registers[] __initdata = {
386 { 0xfe410024, 0, 32, /* INTREQ */
387 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
388};
389
390static DECLARE_INTC_DESC_ACK(intc_desc_irq0123, "sh7786-irq0123",
391 vectors_irq0123, NULL, mask_registers,
392 prio_registers, sense_registers, ack_registers);
393
394static DECLARE_INTC_DESC_ACK(intc_desc_irq4567, "sh7786-irq4567",
395 vectors_irq4567, NULL, mask_registers,
396 prio_registers, sense_registers, ack_registers);
397
398/* External interrupt pins in IRL mode */
399
400static struct intc_vect vectors_irl0123[] __initdata = {
401 INTC_VECT(IRL0_LLLL, 0x200), INTC_VECT(IRL0_LLLH, 0x220),
402 INTC_VECT(IRL0_LLHL, 0x240), INTC_VECT(IRL0_LLHH, 0x260),
403 INTC_VECT(IRL0_LHLL, 0x280), INTC_VECT(IRL0_LHLH, 0x2a0),
404 INTC_VECT(IRL0_LHHL, 0x2c0), INTC_VECT(IRL0_LHHH, 0x2e0),
405 INTC_VECT(IRL0_HLLL, 0x300), INTC_VECT(IRL0_HLLH, 0x320),
406 INTC_VECT(IRL0_HLHL, 0x340), INTC_VECT(IRL0_HLHH, 0x360),
407 INTC_VECT(IRL0_HHLL, 0x380), INTC_VECT(IRL0_HHLH, 0x3a0),
408 INTC_VECT(IRL0_HHHL, 0x3c0),
409};
410
411static struct intc_vect vectors_irl4567[] __initdata = {
412 INTC_VECT(IRL4_LLLL, 0x900), INTC_VECT(IRL4_LLLH, 0x920),
413 INTC_VECT(IRL4_LLHL, 0x940), INTC_VECT(IRL4_LLHH, 0x960),
414 INTC_VECT(IRL4_LHLL, 0x980), INTC_VECT(IRL4_LHLH, 0x9a0),
415 INTC_VECT(IRL4_LHHL, 0x9c0), INTC_VECT(IRL4_LHHH, 0x9e0),
416 INTC_VECT(IRL4_HLLL, 0xa00), INTC_VECT(IRL4_HLLH, 0xa20),
417 INTC_VECT(IRL4_HLHL, 0xa40), INTC_VECT(IRL4_HLHH, 0xa60),
418 INTC_VECT(IRL4_HHLL, 0xa80), INTC_VECT(IRL4_HHLH, 0xaa0),
419 INTC_VECT(IRL4_HHHL, 0xac0),
420};
421
422static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7786-irl0123", vectors_irl0123,
423 NULL, mask_registers, NULL, NULL);
424
425static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7786-irl4567", vectors_irl4567,
426 NULL, mask_registers, NULL, NULL);
427
428#define INTC_ICR0 0xfe410000
429#define INTC_INTMSK0 CnINTMSK0
430#define INTC_INTMSK1 CnINTMSK1
431#define INTC_INTMSK2 INTMSK2
432#define INTC_INTMSKCLR1 CnINTMSKCLR1
433#define INTC_INTMSKCLR2 INTMSKCLR2
434
435void __init plat_irq_setup(void)
436{
437 /* disable IRQ3-0 + IRQ7-4 */
438 ctrl_outl(0xff000000, INTC_INTMSK0);
439
440 /* disable IRL3-0 + IRL7-4 */
441 ctrl_outl(0xc0000000, INTC_INTMSK1);
442 ctrl_outl(0xfffefffe, INTC_INTMSK2);
443
444 /* select IRL mode for IRL3-0 + IRL7-4 */
445 ctrl_outl(ctrl_inl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
446
447 register_intc_controller(&intc_desc);
448}
449
450void __init plat_irq_setup_pins(int mode)
451{
452 switch (mode) {
453 case IRQ_MODE_IRQ7654:
454 /* select IRQ mode for IRL7-4 */
455 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00400000, INTC_ICR0);
456 register_intc_controller(&intc_desc_irq4567);
457 break;
458 case IRQ_MODE_IRQ3210:
459 /* select IRQ mode for IRL3-0 */
460 ctrl_outl(ctrl_inl(INTC_ICR0) | 0x00800000, INTC_ICR0);
461 register_intc_controller(&intc_desc_irq0123);
462 break;
463 case IRQ_MODE_IRL7654:
464 /* enable IRL7-4 but don't provide any masking */
465 ctrl_outl(0x40000000, INTC_INTMSKCLR1);
466 ctrl_outl(0x0000fffe, INTC_INTMSKCLR2);
467 break;
468 case IRQ_MODE_IRL3210:
469 /* enable IRL0-3 but don't provide any masking */
470 ctrl_outl(0x80000000, INTC_INTMSKCLR1);
471 ctrl_outl(0xfffe0000, INTC_INTMSKCLR2);
472 break;
473 case IRQ_MODE_IRL7654_MASK:
474 /* enable IRL7-4 and mask using cpu intc controller */
475 ctrl_outl(0x40000000, INTC_INTMSKCLR1);
476 register_intc_controller(&intc_desc_irl4567);
477 break;
478 case IRQ_MODE_IRL3210_MASK:
479 /* enable IRL0-3 and mask using cpu intc controller */
480 ctrl_outl(0x80000000, INTC_INTMSKCLR1);
481 register_intc_controller(&intc_desc_irl0123);
482 break;
483 default:
484 BUG();
485 }
486}
487
488void __init plat_mem_setup(void)
489{
490}
diff --git a/arch/sh/kernel/cpu/shmobile/Makefile b/arch/sh/kernel/cpu/shmobile/Makefile
new file mode 100644
index 000000000000..08bfa7c7db29
--- /dev/null
+++ b/arch/sh/kernel/cpu/shmobile/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for the Linux/SuperH SH-Mobile backends.
3#
4
5# Power Management & Sleep mode
6obj-$(CONFIG_PM) += pm.o sleep.o
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c
new file mode 100644
index 000000000000..8c067adf6830
--- /dev/null
+++ b/arch/sh/kernel/cpu/shmobile/pm.c
@@ -0,0 +1,92 @@
1/*
2 * arch/sh/kernel/cpu/sh4a/pm-sh_mobile.c
3 *
4 * Power management support code for SuperH Mobile
5 *
6 * Copyright (C) 2009 Magnus Damm
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/suspend.h>
16#include <asm/suspend.h>
17#include <asm/uaccess.h>
18
19/*
20 * Sleep modes available on SuperH Mobile:
21 *
22 * Sleep mode is just plain "sleep" instruction
23 * Sleep Self-Refresh mode is above plus RAM put in Self-Refresh
24 * Standby Self-Refresh mode is above plus stopped clocks
25 */
26#define SUSP_MODE_SLEEP (SUSP_SH_SLEEP)
27#define SUSP_MODE_SLEEP_SF (SUSP_SH_SLEEP | SUSP_SH_SF)
28#define SUSP_MODE_STANDBY_SF (SUSP_SH_STANDBY | SUSP_SH_SF)
29
30/*
31 * The following modes are not there yet:
32 *
33 * R-standby mode is unsupported, but will be added in the future
34 * U-standby mode is low priority since it needs bootloader hacks
35 *
36 * All modes should be tied in with cpuidle. But before that can
37 * happen we need to keep track of enabled hardware blocks so we
38 * can avoid entering sleep modes that stop clocks to hardware
39 * blocks that are in use even though the cpu core is idle.
40 */
41
42extern const unsigned char sh_mobile_standby[];
43extern const unsigned int sh_mobile_standby_size;
44
45static void sh_mobile_call_standby(unsigned long mode)
46{
47 extern void *vbr_base;
48 void *onchip_mem = (void *)0xe5200000; /* ILRAM */
49 void (*standby_onchip_mem)(unsigned long) = onchip_mem;
50
51 /* Note: Wake up from sleep may generate exceptions!
52 * Setup VBR to point to on-chip ram if self-refresh is
53 * going to be used.
54 */
55 if (mode & SUSP_SH_SF)
56 asm volatile("ldc %0, vbr" : : "r" (onchip_mem) : "memory");
57
58 /* Copy the assembly snippet to the otherwise ununsed ILRAM */
59 memcpy(onchip_mem, sh_mobile_standby, sh_mobile_standby_size);
60 wmb();
61 ctrl_barrier();
62
63 /* Let assembly snippet in on-chip memory handle the rest */
64 standby_onchip_mem(mode);
65
66 /* Put VBR back in System RAM again */
67 if (mode & SUSP_SH_SF)
68 asm volatile("ldc %0, vbr" : : "r" (&vbr_base) : "memory");
69}
70
71static int sh_pm_enter(suspend_state_t state)
72{
73 local_irq_disable();
74 set_bl_bit();
75 sh_mobile_call_standby(SUSP_MODE_STANDBY_SF);
76 local_irq_disable();
77 clear_bl_bit();
78 return 0;
79}
80
81static struct platform_suspend_ops sh_pm_ops = {
82 .enter = sh_pm_enter,
83 .valid = suspend_valid_only_mem,
84};
85
86static int __init sh_pm_init(void)
87{
88 suspend_set_ops(&sh_pm_ops);
89 return 0;
90}
91
92late_initcall(sh_pm_init);
diff --git a/arch/sh/kernel/cpu/shmobile/sleep.S b/arch/sh/kernel/cpu/shmobile/sleep.S
new file mode 100644
index 000000000000..5d888ef53d82
--- /dev/null
+++ b/arch/sh/kernel/cpu/shmobile/sleep.S
@@ -0,0 +1,125 @@
1/*
2 * arch/sh/kernel/cpu/sh4a/sleep-sh_mobile.S
3 *
4 * Sleep mode and Standby modes support for SuperH Mobile
5 *
6 * Copyright (C) 2009 Magnus Damm
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/sys.h>
14#include <linux/errno.h>
15#include <linux/linkage.h>
16#include <asm/asm-offsets.h>
17#include <asm/suspend.h>
18
19/* manage self-refresh and enter standby mode.
20 * this code will be copied to on-chip memory and executed from there.
21 */
22
23 .balign 4096,0,4096
24ENTRY(sh_mobile_standby)
25 mov r4, r0
26
27 tst #SUSP_SH_SF, r0
28 bt skip_set_sf
29
30 /* SDRAM: disable power down and put in self-refresh mode */
31 mov.l 1f, r4
32 mov.l 2f, r1
33 mov.l @r4, r2
34 or r1, r2
35 mov.l 3f, r3
36 and r3, r2
37 mov.l r2, @r4
38
39skip_set_sf:
40 tst #SUSP_SH_SLEEP, r0
41 bt test_standby
42
43 /* set mode to "sleep mode" */
44 bra do_sleep
45 mov #0x00, r1
46
47test_standby:
48 tst #SUSP_SH_STANDBY, r0
49 bt test_rstandby
50
51 /* set mode to "software standby mode" */
52 bra do_sleep
53 mov #0x80, r1
54
55test_rstandby:
56 tst #SUSP_SH_RSTANDBY, r0
57 bt test_ustandby
58
59 /* set mode to "r-standby mode" */
60 bra do_sleep
61 mov #0x20, r1
62
63test_ustandby:
64 tst #SUSP_SH_USTANDBY, r0
65 bt done_sleep
66
67 /* set mode to "u-standby mode" */
68 mov #0x10, r1
69
70 /* fall-through */
71
72do_sleep:
73 /* setup and enter selected standby mode */
74 mov.l 5f, r4
75 mov.l r1, @r4
76 sleep
77
78done_sleep:
79 /* reset standby mode to sleep mode */
80 mov.l 5f, r4
81 mov #0x00, r1
82 mov.l r1, @r4
83
84 tst #SUSP_SH_SF, r0
85 bt skip_restore_sf
86
87 /* SDRAM: set auto-refresh mode */
88 mov.l 1f, r4
89 mov.l @r4, r2
90 mov.l 4f, r3
91 and r3, r2
92 mov.l r2, @r4
93 mov.l 6f, r4
94 mov.l 7f, r1
95 mov.l 8f, r2
96 mov.l @r4, r3
97 mov #-1, r4
98 add r4, r3
99 or r2, r3
100 mov.l r3, @r1
101skip_restore_sf:
102 rts
103 nop
104
105 .balign 4
1061: .long 0xfe400008 /* SDCR0 */
1072: .long 0x00000400
1083: .long 0xffff7fff
1094: .long 0xfffffbff
1105: .long 0xa4150020 /* STBCR */
1116: .long 0xfe40001c /* RTCOR */
1127: .long 0xfe400018 /* RTCNT */
1138: .long 0xa55a0000
114
115/* interrupt vector @ 0x600 */
116 .balign 0x400,0,0x400
117 .long 0xdeadbeef
118 .balign 0x200,0,0x200
119 /* sh7722 will end up here in sleep mode */
120 rte
121 nop
122sh_mobile_standby_end:
123
124ENTRY(sh_mobile_standby_size)
125 .long sh_mobile_standby_end - sh_mobile_standby
diff --git a/arch/sh/kernel/gpio.c b/arch/sh/kernel/gpio.c
index d37165361034..d22e5af699f9 100644
--- a/arch/sh/kernel/gpio.c
+++ b/arch/sh/kernel/gpio.c
@@ -19,36 +19,75 @@
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21 21
22static struct pinmux_info *registered_gpio; 22static int enum_in_range(pinmux_enum_t enum_id, struct pinmux_range *r)
23{
24 if (enum_id < r->begin)
25 return 0;
23 26
24static struct pinmux_info *gpio_controller(unsigned gpio) 27 if (enum_id > r->end)
28 return 0;
29
30 return 1;
31}
32
33static unsigned long gpio_read_raw_reg(unsigned long reg,
34 unsigned long reg_width)
25{ 35{
26 if (!registered_gpio) 36 switch (reg_width) {
27 return NULL; 37 case 8:
38 return ctrl_inb(reg);
39 case 16:
40 return ctrl_inw(reg);
41 case 32:
42 return ctrl_inl(reg);
43 }
28 44
29 if (gpio < registered_gpio->first_gpio) 45 BUG();
30 return NULL; 46 return 0;
47}
31 48
32 if (gpio > registered_gpio->last_gpio) 49static void gpio_write_raw_reg(unsigned long reg,
33 return NULL; 50 unsigned long reg_width,
51 unsigned long data)
52{
53 switch (reg_width) {
54 case 8:
55 ctrl_outb(data, reg);
56 return;
57 case 16:
58 ctrl_outw(data, reg);
59 return;
60 case 32:
61 ctrl_outl(data, reg);
62 return;
63 }
34 64
35 return registered_gpio; 65 BUG();
36} 66}
37 67
38static int enum_in_range(pinmux_enum_t enum_id, struct pinmux_range *r) 68static void gpio_write_bit(struct pinmux_data_reg *dr,
69 unsigned long in_pos, unsigned long value)
39{ 70{
40 if (enum_id < r->begin) 71 unsigned long pos;
41 return 0;
42 72
43 if (enum_id > r->end) 73 pos = dr->reg_width - (in_pos + 1);
44 return 0;
45 74
46 return 1; 75#ifdef DEBUG
76 pr_info("write_bit addr = %lx, value = %ld, pos = %ld, "
77 "r_width = %ld\n",
78 dr->reg, !!value, pos, dr->reg_width);
79#endif
80
81 if (value)
82 set_bit(pos, &dr->reg_shadow);
83 else
84 clear_bit(pos, &dr->reg_shadow);
85
86 gpio_write_raw_reg(dr->reg, dr->reg_width, dr->reg_shadow);
47} 87}
48 88
49static int read_write_reg(unsigned long reg, unsigned long reg_width, 89static int gpio_read_reg(unsigned long reg, unsigned long reg_width,
50 unsigned long field_width, unsigned long in_pos, 90 unsigned long field_width, unsigned long in_pos)
51 unsigned long value, int do_write)
52{ 91{
53 unsigned long data, mask, pos; 92 unsigned long data, mask, pos;
54 93
@@ -57,52 +96,53 @@ static int read_write_reg(unsigned long reg, unsigned long reg_width,
57 pos = reg_width - ((in_pos + 1) * field_width); 96 pos = reg_width - ((in_pos + 1) * field_width);
58 97
59#ifdef DEBUG 98#ifdef DEBUG
60 pr_info("%s, addr = %lx, value = %ld, pos = %ld, " 99 pr_info("read_reg: addr = %lx, pos = %ld, "
61 "r_width = %ld, f_width = %ld\n", 100 "r_width = %ld, f_width = %ld\n",
62 do_write ? "write" : "read", reg, value, pos, 101 reg, pos, reg_width, field_width);
63 reg_width, field_width);
64#endif 102#endif
65 103
66 switch (reg_width) { 104 data = gpio_read_raw_reg(reg, reg_width);
67 case 8: 105 return (data >> pos) & mask;
68 data = ctrl_inb(reg); 106}
69 break;
70 case 16:
71 data = ctrl_inw(reg);
72 break;
73 case 32:
74 data = ctrl_inl(reg);
75 break;
76 }
77 107
78 if (!do_write) 108static void gpio_write_reg(unsigned long reg, unsigned long reg_width,
79 return (data >> pos) & mask; 109 unsigned long field_width, unsigned long in_pos,
110 unsigned long value)
111{
112 unsigned long mask, pos;
80 113
81 data &= ~(mask << pos); 114 mask = (1 << field_width) - 1;
82 data |= value << pos; 115 pos = reg_width - ((in_pos + 1) * field_width);
116
117#ifdef DEBUG
118 pr_info("write_reg addr = %lx, value = %ld, pos = %ld, "
119 "r_width = %ld, f_width = %ld\n",
120 reg, value, pos, reg_width, field_width);
121#endif
122
123 mask = ~(mask << pos);
124 value = value << pos;
83 125
84 switch (reg_width) { 126 switch (reg_width) {
85 case 8: 127 case 8:
86 ctrl_outb(data, reg); 128 ctrl_outb((ctrl_inb(reg) & mask) | value, reg);
87 break; 129 break;
88 case 16: 130 case 16:
89 ctrl_outw(data, reg); 131 ctrl_outw((ctrl_inw(reg) & mask) | value, reg);
90 break; 132 break;
91 case 32: 133 case 32:
92 ctrl_outl(data, reg); 134 ctrl_outl((ctrl_inl(reg) & mask) | value, reg);
93 break; 135 break;
94 } 136 }
95 return 0;
96} 137}
97 138
98static int get_data_reg(struct pinmux_info *gpioc, unsigned gpio, 139static int setup_data_reg(struct pinmux_info *gpioc, unsigned gpio)
99 struct pinmux_data_reg **drp, int *bitp)
100{ 140{
101 pinmux_enum_t enum_id = gpioc->gpios[gpio].enum_id; 141 struct pinmux_gpio *gpiop = &gpioc->gpios[gpio];
102 struct pinmux_data_reg *data_reg; 142 struct pinmux_data_reg *data_reg;
103 int k, n; 143 int k, n;
104 144
105 if (!enum_in_range(enum_id, &gpioc->data)) 145 if (!enum_in_range(gpiop->enum_id, &gpioc->data))
106 return -1; 146 return -1;
107 147
108 k = 0; 148 k = 0;
@@ -113,19 +153,58 @@ static int get_data_reg(struct pinmux_info *gpioc, unsigned gpio,
113 break; 153 break;
114 154
115 for (n = 0; n < data_reg->reg_width; n++) { 155 for (n = 0; n < data_reg->reg_width; n++) {
116 if (data_reg->enum_ids[n] == enum_id) { 156 if (data_reg->enum_ids[n] == gpiop->enum_id) {
117 *drp = data_reg; 157 gpiop->flags &= ~PINMUX_FLAG_DREG;
118 *bitp = n; 158 gpiop->flags |= (k << PINMUX_FLAG_DREG_SHIFT);
159 gpiop->flags &= ~PINMUX_FLAG_DBIT;
160 gpiop->flags |= (n << PINMUX_FLAG_DBIT_SHIFT);
119 return 0; 161 return 0;
120
121 } 162 }
122 } 163 }
123 k++; 164 k++;
124 } 165 }
125 166
167 BUG();
168
126 return -1; 169 return -1;
127} 170}
128 171
172static void setup_data_regs(struct pinmux_info *gpioc)
173{
174 struct pinmux_data_reg *drp;
175 int k;
176
177 for (k = gpioc->first_gpio; k <= gpioc->last_gpio; k++)
178 setup_data_reg(gpioc, k);
179
180 k = 0;
181 while (1) {
182 drp = gpioc->data_regs + k;
183
184 if (!drp->reg_width)
185 break;
186
187 drp->reg_shadow = gpio_read_raw_reg(drp->reg, drp->reg_width);
188 k++;
189 }
190}
191
192static int get_data_reg(struct pinmux_info *gpioc, unsigned gpio,
193 struct pinmux_data_reg **drp, int *bitp)
194{
195 struct pinmux_gpio *gpiop = &gpioc->gpios[gpio];
196 int k, n;
197
198 if (!enum_in_range(gpiop->enum_id, &gpioc->data))
199 return -1;
200
201 k = (gpiop->flags & PINMUX_FLAG_DREG) >> PINMUX_FLAG_DREG_SHIFT;
202 n = (gpiop->flags & PINMUX_FLAG_DBIT) >> PINMUX_FLAG_DBIT_SHIFT;
203 *drp = gpioc->data_regs + k;
204 *bitp = n;
205 return 0;
206}
207
129static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id, 208static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id,
130 struct pinmux_cfg_reg **crp, int *indexp, 209 struct pinmux_cfg_reg **crp, int *indexp,
131 unsigned long **cntp) 210 unsigned long **cntp)
@@ -187,9 +266,9 @@ static int get_gpio_enum_id(struct pinmux_info *gpioc, unsigned gpio,
187 return -1; 266 return -1;
188} 267}
189 268
190static int write_config_reg(struct pinmux_info *gpioc, 269static void write_config_reg(struct pinmux_info *gpioc,
191 struct pinmux_cfg_reg *crp, 270 struct pinmux_cfg_reg *crp,
192 int index) 271 int index)
193{ 272{
194 unsigned long ncomb, pos, value; 273 unsigned long ncomb, pos, value;
195 274
@@ -197,8 +276,7 @@ static int write_config_reg(struct pinmux_info *gpioc,
197 pos = index / ncomb; 276 pos = index / ncomb;
198 value = index % ncomb; 277 value = index % ncomb;
199 278
200 return read_write_reg(crp->reg, crp->reg_width, 279 gpio_write_reg(crp->reg, crp->reg_width, crp->field_width, pos, value);
201 crp->field_width, pos, value, 1);
202} 280}
203 281
204static int check_config_reg(struct pinmux_info *gpioc, 282static int check_config_reg(struct pinmux_info *gpioc,
@@ -211,8 +289,8 @@ static int check_config_reg(struct pinmux_info *gpioc,
211 pos = index / ncomb; 289 pos = index / ncomb;
212 value = index % ncomb; 290 value = index % ncomb;
213 291
214 if (read_write_reg(crp->reg, crp->reg_width, 292 if (gpio_read_reg(crp->reg, crp->reg_width,
215 crp->field_width, pos, 0, 0) == value) 293 crp->field_width, pos) == value)
216 return 0; 294 return 0;
217 295
218 return -1; 296 return -1;
@@ -220,8 +298,8 @@ static int check_config_reg(struct pinmux_info *gpioc,
220 298
221enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE }; 299enum { GPIO_CFG_DRYRUN, GPIO_CFG_REQ, GPIO_CFG_FREE };
222 300
223int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio, 301static int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
224 int pinmux_type, int cfg_mode) 302 int pinmux_type, int cfg_mode)
225{ 303{
226 struct pinmux_cfg_reg *cr = NULL; 304 struct pinmux_cfg_reg *cr = NULL;
227 pinmux_enum_t enum_id; 305 pinmux_enum_t enum_id;
@@ -287,8 +365,7 @@ int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
287 break; 365 break;
288 366
289 case GPIO_CFG_REQ: 367 case GPIO_CFG_REQ:
290 if (write_config_reg(gpioc, cr, index) != 0) 368 write_config_reg(gpioc, cr, index);
291 goto out_err;
292 *cntp = *cntp + 1; 369 *cntp = *cntp + 1;
293 break; 370 break;
294 371
@@ -305,9 +382,14 @@ int pinmux_config_gpio(struct pinmux_info *gpioc, unsigned gpio,
305 382
306static DEFINE_SPINLOCK(gpio_lock); 383static DEFINE_SPINLOCK(gpio_lock);
307 384
308int __gpio_request(unsigned gpio) 385static struct pinmux_info *chip_to_pinmux(struct gpio_chip *chip)
309{ 386{
310 struct pinmux_info *gpioc = gpio_controller(gpio); 387 return container_of(chip, struct pinmux_info, chip);
388}
389
390static int sh_gpio_request(struct gpio_chip *chip, unsigned offset)
391{
392 struct pinmux_info *gpioc = chip_to_pinmux(chip);
311 struct pinmux_data_reg *dummy; 393 struct pinmux_data_reg *dummy;
312 unsigned long flags; 394 unsigned long flags;
313 int i, ret, pinmux_type; 395 int i, ret, pinmux_type;
@@ -319,29 +401,30 @@ int __gpio_request(unsigned gpio)
319 401
320 spin_lock_irqsave(&gpio_lock, flags); 402 spin_lock_irqsave(&gpio_lock, flags);
321 403
322 if ((gpioc->gpios[gpio].flags & PINMUX_FLAG_TYPE) != PINMUX_TYPE_NONE) 404 if ((gpioc->gpios[offset].flags & PINMUX_FLAG_TYPE) != PINMUX_TYPE_NONE)
323 goto err_unlock; 405 goto err_unlock;
324 406
325 /* setup pin function here if no data is associated with pin */ 407 /* setup pin function here if no data is associated with pin */
326 408
327 if (get_data_reg(gpioc, gpio, &dummy, &i) != 0) 409 if (get_data_reg(gpioc, offset, &dummy, &i) != 0)
328 pinmux_type = PINMUX_TYPE_FUNCTION; 410 pinmux_type = PINMUX_TYPE_FUNCTION;
329 else 411 else
330 pinmux_type = PINMUX_TYPE_GPIO; 412 pinmux_type = PINMUX_TYPE_GPIO;
331 413
332 if (pinmux_type == PINMUX_TYPE_FUNCTION) { 414 if (pinmux_type == PINMUX_TYPE_FUNCTION) {
333 if (pinmux_config_gpio(gpioc, gpio, 415 if (pinmux_config_gpio(gpioc, offset,
334 pinmux_type, 416 pinmux_type,
335 GPIO_CFG_DRYRUN) != 0) 417 GPIO_CFG_DRYRUN) != 0)
336 goto err_unlock; 418 goto err_unlock;
337 419
338 if (pinmux_config_gpio(gpioc, gpio, 420 if (pinmux_config_gpio(gpioc, offset,
339 pinmux_type, 421 pinmux_type,
340 GPIO_CFG_REQ) != 0) 422 GPIO_CFG_REQ) != 0)
341 BUG(); 423 BUG();
342 } 424 }
343 425
344 gpioc->gpios[gpio].flags = pinmux_type; 426 gpioc->gpios[offset].flags &= ~PINMUX_FLAG_TYPE;
427 gpioc->gpios[offset].flags |= pinmux_type;
345 428
346 ret = 0; 429 ret = 0;
347 err_unlock: 430 err_unlock:
@@ -349,11 +432,10 @@ int __gpio_request(unsigned gpio)
349 err_out: 432 err_out:
350 return ret; 433 return ret;
351} 434}
352EXPORT_SYMBOL(__gpio_request);
353 435
354void gpio_free(unsigned gpio) 436static void sh_gpio_free(struct gpio_chip *chip, unsigned offset)
355{ 437{
356 struct pinmux_info *gpioc = gpio_controller(gpio); 438 struct pinmux_info *gpioc = chip_to_pinmux(chip);
357 unsigned long flags; 439 unsigned long flags;
358 int pinmux_type; 440 int pinmux_type;
359 441
@@ -362,20 +444,23 @@ void gpio_free(unsigned gpio)
362 444
363 spin_lock_irqsave(&gpio_lock, flags); 445 spin_lock_irqsave(&gpio_lock, flags);
364 446
365 pinmux_type = gpioc->gpios[gpio].flags & PINMUX_FLAG_TYPE; 447 pinmux_type = gpioc->gpios[offset].flags & PINMUX_FLAG_TYPE;
366 pinmux_config_gpio(gpioc, gpio, pinmux_type, GPIO_CFG_FREE); 448 pinmux_config_gpio(gpioc, offset, pinmux_type, GPIO_CFG_FREE);
367 gpioc->gpios[gpio].flags = PINMUX_TYPE_NONE; 449 gpioc->gpios[offset].flags &= ~PINMUX_FLAG_TYPE;
450 gpioc->gpios[offset].flags |= PINMUX_TYPE_NONE;
368 451
369 spin_unlock_irqrestore(&gpio_lock, flags); 452 spin_unlock_irqrestore(&gpio_lock, flags);
370} 453}
371EXPORT_SYMBOL(gpio_free);
372 454
373static int pinmux_direction(struct pinmux_info *gpioc, 455static int pinmux_direction(struct pinmux_info *gpioc,
374 unsigned gpio, int new_pinmux_type) 456 unsigned gpio, int new_pinmux_type)
375{ 457{
376 int ret, pinmux_type; 458 int pinmux_type;
459 int ret = -EINVAL;
460
461 if (!gpioc)
462 goto err_out;
377 463
378 ret = -EINVAL;
379 pinmux_type = gpioc->gpios[gpio].flags & PINMUX_FLAG_TYPE; 464 pinmux_type = gpioc->gpios[gpio].flags & PINMUX_FLAG_TYPE;
380 465
381 switch (pinmux_type) { 466 switch (pinmux_type) {
@@ -401,102 +486,99 @@ static int pinmux_direction(struct pinmux_info *gpioc,
401 GPIO_CFG_REQ) != 0) 486 GPIO_CFG_REQ) != 0)
402 BUG(); 487 BUG();
403 488
404 gpioc->gpios[gpio].flags = new_pinmux_type; 489 gpioc->gpios[gpio].flags &= ~PINMUX_FLAG_TYPE;
490 gpioc->gpios[gpio].flags |= new_pinmux_type;
405 491
406 ret = 0; 492 ret = 0;
407 err_out: 493 err_out:
408 return ret; 494 return ret;
409} 495}
410 496
411int gpio_direction_input(unsigned gpio) 497static int sh_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
412{ 498{
413 struct pinmux_info *gpioc = gpio_controller(gpio); 499 struct pinmux_info *gpioc = chip_to_pinmux(chip);
414 unsigned long flags; 500 unsigned long flags;
415 int ret = -EINVAL; 501 int ret;
416
417 if (!gpioc)
418 goto err_out;
419 502
420 spin_lock_irqsave(&gpio_lock, flags); 503 spin_lock_irqsave(&gpio_lock, flags);
421 ret = pinmux_direction(gpioc, gpio, PINMUX_TYPE_INPUT); 504 ret = pinmux_direction(gpioc, offset, PINMUX_TYPE_INPUT);
422 spin_unlock_irqrestore(&gpio_lock, flags); 505 spin_unlock_irqrestore(&gpio_lock, flags);
423 err_out: 506
424 return ret; 507 return ret;
425} 508}
426EXPORT_SYMBOL(gpio_direction_input);
427 509
428static int __gpio_get_set_value(struct pinmux_info *gpioc, 510static void sh_gpio_set_value(struct pinmux_info *gpioc,
429 unsigned gpio, int value, 511 unsigned gpio, int value)
430 int do_write)
431{ 512{
432 struct pinmux_data_reg *dr = NULL; 513 struct pinmux_data_reg *dr = NULL;
433 int bit = 0; 514 int bit = 0;
434 515
435 if (get_data_reg(gpioc, gpio, &dr, &bit) != 0) 516 if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0)
436 BUG(); 517 BUG();
437 else 518 else
438 value = read_write_reg(dr->reg, dr->reg_width, 519 gpio_write_bit(dr, bit, value);
439 1, bit, !!value, do_write);
440
441 return value;
442} 520}
443 521
444int gpio_direction_output(unsigned gpio, int value) 522static int sh_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
523 int value)
445{ 524{
446 struct pinmux_info *gpioc = gpio_controller(gpio); 525 struct pinmux_info *gpioc = chip_to_pinmux(chip);
447 unsigned long flags; 526 unsigned long flags;
448 int ret = -EINVAL; 527 int ret;
449
450 if (!gpioc)
451 goto err_out;
452 528
529 sh_gpio_set_value(gpioc, offset, value);
453 spin_lock_irqsave(&gpio_lock, flags); 530 spin_lock_irqsave(&gpio_lock, flags);
454 __gpio_get_set_value(gpioc, gpio, value, 1); 531 ret = pinmux_direction(gpioc, offset, PINMUX_TYPE_OUTPUT);
455 ret = pinmux_direction(gpioc, gpio, PINMUX_TYPE_OUTPUT);
456 spin_unlock_irqrestore(&gpio_lock, flags); 532 spin_unlock_irqrestore(&gpio_lock, flags);
457 err_out: 533
458 return ret; 534 return ret;
459} 535}
460EXPORT_SYMBOL(gpio_direction_output);
461 536
462int gpio_get_value(unsigned gpio) 537static int sh_gpio_get_value(struct pinmux_info *gpioc, unsigned gpio)
463{ 538{
464 struct pinmux_info *gpioc = gpio_controller(gpio); 539 struct pinmux_data_reg *dr = NULL;
465 unsigned long flags; 540 int bit = 0;
466 int value = 0;
467 541
468 if (!gpioc) 542 if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0) {
469 BUG(); 543 BUG();
470 else { 544 return 0;
471 spin_lock_irqsave(&gpio_lock, flags);
472 value = __gpio_get_set_value(gpioc, gpio, 0, 0);
473 spin_unlock_irqrestore(&gpio_lock, flags);
474 } 545 }
475 546
476 return value; 547 return gpio_read_reg(dr->reg, dr->reg_width, 1, bit);
477} 548}
478EXPORT_SYMBOL(gpio_get_value);
479 549
480void gpio_set_value(unsigned gpio, int value) 550static int sh_gpio_get(struct gpio_chip *chip, unsigned offset)
481{ 551{
482 struct pinmux_info *gpioc = gpio_controller(gpio); 552 return sh_gpio_get_value(chip_to_pinmux(chip), offset);
483 unsigned long flags; 553}
484 554
485 if (!gpioc) 555static void sh_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
486 BUG(); 556{
487 else { 557 sh_gpio_set_value(chip_to_pinmux(chip), offset, value);
488 spin_lock_irqsave(&gpio_lock, flags);
489 __gpio_get_set_value(gpioc, gpio, value, 1);
490 spin_unlock_irqrestore(&gpio_lock, flags);
491 }
492} 558}
493EXPORT_SYMBOL(gpio_set_value);
494 559
495int register_pinmux(struct pinmux_info *pip) 560int register_pinmux(struct pinmux_info *pip)
496{ 561{
497 registered_gpio = pip; 562 struct gpio_chip *chip = &pip->chip;
498 pr_info("pinmux: %s handling gpio %d -> %d\n", 563
564 pr_info("sh pinmux: %s handling gpio %d -> %d\n",
499 pip->name, pip->first_gpio, pip->last_gpio); 565 pip->name, pip->first_gpio, pip->last_gpio);
500 566
501 return 0; 567 setup_data_regs(pip);
568
569 chip->request = sh_gpio_request;
570 chip->free = sh_gpio_free;
571 chip->direction_input = sh_gpio_direction_input;
572 chip->get = sh_gpio_get;
573 chip->direction_output = sh_gpio_direction_output;
574 chip->set = sh_gpio_set;
575
576 WARN_ON(pip->first_gpio != 0); /* needs testing */
577
578 chip->label = pip->name;
579 chip->owner = THIS_MODULE;
580 chip->base = pip->first_gpio;
581 chip->ngpio = (pip->last_gpio - pip->first_gpio) + 1;
582
583 return gpiochip_add(chip);
502} 584}
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 64b7690c664c..3f1372eb0091 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -51,7 +51,7 @@ int show_interrupts(struct seq_file *p, void *v)
51 goto unlock; 51 goto unlock;
52 seq_printf(p, "%3d: ",i); 52 seq_printf(p, "%3d: ",i);
53 for_each_online_cpu(j) 53 for_each_online_cpu(j)
54 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 54 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
55 seq_printf(p, " %14s", irq_desc[i].chip->name); 55 seq_printf(p, " %14s", irq_desc[i].chip->name);
56 seq_printf(p, "-%-8s", irq_desc[i].name); 56 seq_printf(p, "-%-8s", irq_desc[i].name);
57 seq_printf(p, " %s", action->name); 57 seq_printf(p, " %s", action->name);
@@ -106,7 +106,7 @@ asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs)
106 } 106 }
107#endif 107#endif
108 108
109 irq = irq_demux(evt2irq(irq)); 109 irq = irq_demux(intc_evt2irq(irq));
110 110
111#ifdef CONFIG_IRQSTACKS 111#ifdef CONFIG_IRQSTACKS
112 curctx = (union irq_ctx *)current_thread_info(); 112 curctx = (union irq_ctx *)current_thread_info();
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c
index 94df56b0d1f6..7ea2704ea033 100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
@@ -14,21 +14,22 @@
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/reboot.h> 15#include <linux/reboot.h>
16#include <linux/numa.h> 16#include <linux/numa.h>
17#include <linux/ftrace.h>
18#include <linux/suspend.h>
17#include <asm/pgtable.h> 19#include <asm/pgtable.h>
18#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
19#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
20#include <asm/io.h> 22#include <asm/io.h>
21#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
22 24
23typedef NORET_TYPE void (*relocate_new_kernel_t)( 25typedef void (*relocate_new_kernel_t)(unsigned long indirection_page,
24 unsigned long indirection_page, 26 unsigned long reboot_code_buffer,
25 unsigned long reboot_code_buffer, 27 unsigned long start_address);
26 unsigned long start_address,
27 unsigned long vbr_reg) ATTRIB_NORET;
28 28
29extern const unsigned char relocate_new_kernel[]; 29extern const unsigned char relocate_new_kernel[];
30extern const unsigned int relocate_new_kernel_size; 30extern const unsigned int relocate_new_kernel_size;
31extern void *gdb_vbr_vector; 31extern void *gdb_vbr_vector;
32extern void *vbr_base;
32 33
33void machine_shutdown(void) 34void machine_shutdown(void)
34{ 35{
@@ -45,6 +46,12 @@ void machine_crash_shutdown(struct pt_regs *regs)
45 */ 46 */
46int machine_kexec_prepare(struct kimage *image) 47int machine_kexec_prepare(struct kimage *image)
47{ 48{
49 /* older versions of kexec-tools are passing
50 * the zImage entry point as a virtual address.
51 */
52 if (image->start != PHYSADDR(image->start))
53 return -EINVAL; /* upgrade your kexec-tools */
54
48 return 0; 55 return 0;
49} 56}
50 57
@@ -73,17 +80,33 @@ static void kexec_info(struct kimage *image)
73 */ 80 */
74void machine_kexec(struct kimage *image) 81void machine_kexec(struct kimage *image)
75{ 82{
76
77 unsigned long page_list; 83 unsigned long page_list;
78 unsigned long reboot_code_buffer; 84 unsigned long reboot_code_buffer;
79 unsigned long vbr_reg;
80 relocate_new_kernel_t rnk; 85 relocate_new_kernel_t rnk;
86 unsigned long entry;
87 unsigned long *ptr;
88 int save_ftrace_enabled;
89
90 /*
91 * Nicked from the mips version of machine_kexec():
92 * The generic kexec code builds a page list with physical
93 * addresses. Use phys_to_virt() to convert them to virtual.
94 */
95 for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE);
96 ptr = (entry & IND_INDIRECTION) ?
97 phys_to_virt(entry & PAGE_MASK) : ptr + 1) {
98 if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
99 *ptr & IND_DESTINATION)
100 *ptr = (unsigned long) phys_to_virt(*ptr);
101 }
81 102
82#if defined(CONFIG_SH_STANDARD_BIOS) 103#ifdef CONFIG_KEXEC_JUMP
83 vbr_reg = ((unsigned long )gdb_vbr_vector) - 0x100; 104 if (image->preserve_context)
84#else 105 save_processor_state();
85 vbr_reg = 0x80000000; // dummy
86#endif 106#endif
107
108 save_ftrace_enabled = __ftrace_enabled_save();
109
87 /* Interrupts aren't acceptable while we reboot */ 110 /* Interrupts aren't acceptable while we reboot */
88 local_irq_disable(); 111 local_irq_disable();
89 112
@@ -97,12 +120,37 @@ void machine_kexec(struct kimage *image)
97 memcpy((void *)reboot_code_buffer, relocate_new_kernel, 120 memcpy((void *)reboot_code_buffer, relocate_new_kernel,
98 relocate_new_kernel_size); 121 relocate_new_kernel_size);
99 122
100 kexec_info(image); 123 kexec_info(image);
101 flush_cache_all(); 124 flush_cache_all();
102 125
126#if defined(CONFIG_SH_STANDARD_BIOS)
127 asm volatile("ldc %0, vbr" :
128 : "r" (((unsigned long) gdb_vbr_vector) - 0x100)
129 : "memory");
130#endif
131
103 /* now call it */ 132 /* now call it */
104 rnk = (relocate_new_kernel_t) reboot_code_buffer; 133 rnk = (relocate_new_kernel_t) reboot_code_buffer;
105 (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start), vbr_reg); 134 (*rnk)(page_list, reboot_code_buffer,
135 (unsigned long)phys_to_virt(image->start));
136
137#ifdef CONFIG_KEXEC_JUMP
138 asm volatile("ldc %0, vbr" : : "r" (&vbr_base) : "memory");
139
140 if (image->preserve_context)
141 restore_processor_state();
142
143 /* Convert page list back to physical addresses, what a mess. */
144 for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE);
145 ptr = (*ptr & IND_INDIRECTION) ?
146 phys_to_virt(*ptr & PAGE_MASK) : ptr + 1) {
147 if (*ptr & IND_SOURCE || *ptr & IND_INDIRECTION ||
148 *ptr & IND_DESTINATION)
149 *ptr = virt_to_phys(*ptr);
150 }
151#endif
152
153 __ftrace_enabled_restore(save_ftrace_enabled);
106} 154}
107 155
108void arch_crash_save_vmcoreinfo(void) 156void arch_crash_save_vmcoreinfo(void)
diff --git a/arch/sh/kernel/relocate_kernel.S b/arch/sh/kernel/relocate_kernel.S
index c66cb3209db5..fcc9934fb97b 100644
--- a/arch/sh/kernel/relocate_kernel.S
+++ b/arch/sh/kernel/relocate_kernel.S
@@ -4,6 +4,8 @@
4 * 4 *
5 * LANDISK/sh4 is supported. Maybe, SH archtecture works well. 5 * LANDISK/sh4 is supported. Maybe, SH archtecture works well.
6 * 6 *
7 * 2009-03-18 Magnus Damm - Added Kexec Jump support
8 *
7 * This source code is licensed under the GNU General Public License, 9 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details. 10 * Version 2. See the file COPYING for more details.
9 */ 11 */
@@ -16,23 +18,141 @@ relocate_new_kernel:
16 /* r4 = indirection_page */ 18 /* r4 = indirection_page */
17 /* r5 = reboot_code_buffer */ 19 /* r5 = reboot_code_buffer */
18 /* r6 = start_address */ 20 /* r6 = start_address */
19 /* r7 = vbr_reg */
20 21
21 mov.l 10f,r8 /* PAGE_SIZE */ 22 mov.l 10f, r0 /* PAGE_SIZE */
22 mov.l 11f,r9 /* P2SEG */ 23 add r5, r0 /* setup new stack at end of control page */
24
25 /* save r15->r8 to new stack */
26 mov.l r15, @-r0
27 mov r0, r15
28 mov.l r14, @-r15
29 mov.l r13, @-r15
30 mov.l r12, @-r15
31 mov.l r11, @-r15
32 mov.l r10, @-r15
33 mov.l r9, @-r15
34 mov.l r8, @-r15
35
36 /* save other random registers */
37 sts.l macl, @-r15
38 sts.l mach, @-r15
39 stc.l gbr, @-r15
40 stc.l ssr, @-r15
41 stc.l sr, @-r15
42 sts.l pr, @-r15
43 stc.l spc, @-r15
44
45 /* switch to bank1 and save r7->r0 */
46 mov.l 12f, r9
47 stc sr, r8
48 or r9, r8
49 ldc r8, sr
50 mov.l r7, @-r15
51 mov.l r6, @-r15
52 mov.l r5, @-r15
53 mov.l r4, @-r15
54 mov.l r3, @-r15
55 mov.l r2, @-r15
56 mov.l r1, @-r15
57 mov.l r0, @-r15
58
59 /* switch to bank0 and save r7->r0 */
60 mov.l 12f, r9
61 not r9, r9
62 stc sr, r8
63 and r9, r8
64 ldc r8, sr
65 mov.l r7, @-r15
66 mov.l r6, @-r15
67 mov.l r5, @-r15
68 mov.l r4, @-r15
69 mov.l r3, @-r15
70 mov.l r2, @-r15
71 mov.l r1, @-r15
72 mov.l r0, @-r15
73
74 mov.l r4, @-r15 /* save indirection page again */
75
76 bsr swap_pages /* swap pages before jumping to new kernel */
77 nop
78
79 mova 11f, r0
80 mov.l r15, @r0 /* save pointer to stack */
81
82 jsr @r6 /* hand over control to new kernel */
83 nop
84
85 mov.l 11f, r15 /* get pointer to stack */
86 mov.l @r15+, r4 /* restore r4 to get indirection page */
23 87
24 /* stack setting */ 88 bsr swap_pages /* swap pages back to previous state */
25 add r8,r5 89 nop
26 mov r5,r15
27 90
91 /* make sure bank0 is active and restore r0->r7 */
92 mov.l 12f, r9
93 not r9, r9
94 stc sr, r8
95 and r9, r8
96 ldc r8, sr
97 mov.l @r15+, r0
98 mov.l @r15+, r1
99 mov.l @r15+, r2
100 mov.l @r15+, r3
101 mov.l @r15+, r4
102 mov.l @r15+, r5
103 mov.l @r15+, r6
104 mov.l @r15+, r7
105
106 /* switch to bank1 and restore r0->r7 */
107 mov.l 12f, r9
108 stc sr, r8
109 or r9, r8
110 ldc r8, sr
111 mov.l @r15+, r0
112 mov.l @r15+, r1
113 mov.l @r15+, r2
114 mov.l @r15+, r3
115 mov.l @r15+, r4
116 mov.l @r15+, r5
117 mov.l @r15+, r6
118 mov.l @r15+, r7
119
120 /* switch back to bank0 */
121 mov.l 12f, r9
122 not r9, r9
123 stc sr, r8
124 and r9, r8
125 ldc r8, sr
126
127 /* restore other random registers */
128 ldc.l @r15+, spc
129 lds.l @r15+, pr
130 ldc.l @r15+, sr
131 ldc.l @r15+, ssr
132 ldc.l @r15+, gbr
133 lds.l @r15+, mach
134 lds.l @r15+, macl
135
136 /* restore r8->r15 */
137 mov.l @r15+, r8
138 mov.l @r15+, r9
139 mov.l @r15+, r10
140 mov.l @r15+, r11
141 mov.l @r15+, r12
142 mov.l @r15+, r13
143 mov.l @r15+, r14
144 mov.l @r15+, r15
145 rts
146 nop
147
148swap_pages:
28 bra 1f 149 bra 1f
29 mov r4,r0 /* cmd = indirection_page */ 150 mov r4,r0 /* cmd = indirection_page */
300: 1510:
31 mov.l @r4+,r0 /* cmd = *ind++ */ 152 mov.l @r4+,r0 /* cmd = *ind++ */
32 153
331: /* addr = (cmd | P2SEG) & 0xfffffff0 */ 1541: /* addr = cmd & 0xfffffff0 */
34 mov r0,r2 155 mov r0,r2
35 or r9,r2
36 mov #-16,r1 156 mov #-16,r1
37 and r1,r2 157 and r1,r2
38 158
@@ -40,57 +160,70 @@ relocate_new_kernel:
40 tst #1,r0 160 tst #1,r0
41 bt 2f 161 bt 2f
42 bra 0b 162 bra 0b
43 mov r2,r5 163 mov r2,r5
44 164
452: /* else if(cmd & IND_INDIRECTION) ind = addr */ 1652: /* else if(cmd & IND_INDIRECTION) ind = addr */
46 tst #2,r0 166 tst #2,r0
47 bt 3f 167 bt 3f
48 bra 0b 168 bra 0b
49 mov r2,r4 169 mov r2,r4
50 170
513: /* else if(cmd & IND_DONE) goto 6 */ 1713: /* else if(cmd & IND_DONE) return */
52 tst #4,r0 172 tst #4,r0
53 bt 4f 173 bt 4f
54 bra 6f 174 rts
55 nop 175 nop
56 176
574: /* else if(cmd & IND_SOURCE) memcpy(dst,addr,PAGE_SIZE) */ 1774: /* else if(cmd & IND_SOURCE) memcpy(dst,addr,PAGE_SIZE) */
58 tst #8,r0 178 tst #8,r0
59 bt 0b 179 bt 0b
60 180
61 mov r8,r3 181 mov.l 10f,r3 /* PAGE_SIZE */
62 shlr2 r3 182 shlr2 r3
63 shlr2 r3 183 shlr2 r3
645: 1845:
65 dt r3 185 dt r3
66 mov.l @r2+,r1 /* 16n+0 */ 186
67 mov.l r1,@r5 187 /* regular kexec just overwrites the destination page
68 add #4,r5 188 * with the contents of the source page.
69 mov.l @r2+,r1 /* 16n+4 */ 189 * for the kexec jump case we need to swap the contents
70 mov.l r1,@r5 190 * of the pages.
71 add #4,r5 191 * to keep it simple swap the contents for both cases.
72 mov.l @r2+,r1 /* 16n+8 */ 192 */
73 mov.l r1,@r5 193 mov.l @(0, r2), r8
74 add #4,r5 194 mov.l @(0, r5), r1
75 mov.l @r2+,r1 /* 16n+12 */ 195 mov.l r8, @(0, r5)
76 mov.l r1,@r5 196 mov.l r1, @(0, r2)
77 add #4,r5 197
198 mov.l @(4, r2), r8
199 mov.l @(4, r5), r1
200 mov.l r8, @(4, r5)
201 mov.l r1, @(4, r2)
202
203 mov.l @(8, r2), r8
204 mov.l @(8, r5), r1
205 mov.l r8, @(8, r5)
206 mov.l r1, @(8, r2)
207
208 mov.l @(12, r2), r8
209 mov.l @(12, r5), r1
210 mov.l r8, @(12, r5)
211 mov.l r1, @(12, r2)
212
213 add #16,r5
214 add #16,r2
78 bf 5b 215 bf 5b
79 216
80 bra 0b 217 bra 0b
81 nop 218 nop
826:
83#ifdef CONFIG_SH_STANDARD_BIOS
84 ldc r7, vbr
85#endif
86 jmp @r6
87 nop
88 219
89 .align 2 220 .align 2
9010: 22110:
91 .long PAGE_SIZE 222 .long PAGE_SIZE
9211: 22311:
93 .long P2SEG 224 .long 0
22512:
226 .long 0x20000000 ! RB=1
94 227
95relocate_new_kernel_end: 228relocate_new_kernel_end:
96 229
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 370d2cfa34eb..24c60251f680 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -432,6 +432,7 @@ static const char *cpu_name[] = {
432 [CPU_SH7763] = "SH7763", [CPU_SH7770] = "SH7770", 432 [CPU_SH7763] = "SH7763", [CPU_SH7770] = "SH7770",
433 [CPU_SH7780] = "SH7780", [CPU_SH7781] = "SH7781", 433 [CPU_SH7780] = "SH7780", [CPU_SH7781] = "SH7781",
434 [CPU_SH7343] = "SH7343", [CPU_SH7785] = "SH7785", 434 [CPU_SH7343] = "SH7343", [CPU_SH7785] = "SH7785",
435 [CPU_SH7786] = "SH7786",
435 [CPU_SH7722] = "SH7722", [CPU_SHX3] = "SH-X3", 436 [CPU_SH7722] = "SH7722", [CPU_SHX3] = "SH-X3",
436 [CPU_SH5_101] = "SH5-101", [CPU_SH5_103] = "SH5-103", 437 [CPU_SH5_101] = "SH5-101", [CPU_SH5_103] = "SH5-103",
437 [CPU_MXG] = "MX-G", [CPU_SH7723] = "SH7723", 438 [CPU_MXG] = "MX-G", [CPU_SH7723] = "SH7723",
@@ -448,7 +449,7 @@ EXPORT_SYMBOL(get_cpu_subtype);
448/* Symbolic CPU flags, keep in sync with asm/cpu-features.h */ 449/* Symbolic CPU flags, keep in sync with asm/cpu-features.h */
449static const char *cpu_flags[] = { 450static const char *cpu_flags[] = {
450 "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", 451 "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr",
451 "ptea", "llsc", "l2", "op32", NULL 452 "ptea", "llsc", "l2", "op32", "pteaex", NULL
452}; 453};
453 454
454static void show_cpuflags(struct seq_file *m, struct sh_cpuinfo *c) 455static void show_cpuflags(struct seq_file *m, struct sh_cpuinfo *c)
diff --git a/arch/sh/kernel/swsusp.c b/arch/sh/kernel/swsusp.c
new file mode 100644
index 000000000000..12b64a0f2f01
--- /dev/null
+++ b/arch/sh/kernel/swsusp.c
@@ -0,0 +1,38 @@
1/*
2 * swsusp.c - SuperH hibernation support
3 *
4 * Copyright (C) 2009 Magnus Damm
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/mm.h>
12#include <linux/sched.h>
13#include <linux/suspend.h>
14#include <asm/suspend.h>
15#include <asm/sections.h>
16#include <asm/tlbflush.h>
17#include <asm/page.h>
18#include <asm/fpu.h>
19
20struct swsusp_arch_regs swsusp_arch_regs_cpu0;
21
22int pfn_is_nosave(unsigned long pfn)
23{
24 unsigned long begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
25 unsigned long end_pfn = PAGE_ALIGN(__pa(&__nosave_end)) >> PAGE_SHIFT;
26
27 return (pfn >= begin_pfn) && (pfn < end_pfn);
28}
29
30void save_processor_state(void)
31{
32 init_fpu(current);
33}
34
35void restore_processor_state(void)
36{
37 local_flush_tlb_all();
38}
diff --git a/arch/sh/kernel/time_32.c b/arch/sh/kernel/time_32.c
index 8457f83242c5..c34e1e0f9b02 100644
--- a/arch/sh/kernel/time_32.c
+++ b/arch/sh/kernel/time_32.c
@@ -41,14 +41,6 @@ static int null_rtc_set_time(const time_t secs)
41 return 0; 41 return 0;
42} 42}
43 43
44/*
45 * Null high precision timer functions for systems lacking one.
46 */
47static cycle_t null_hpt_read(void)
48{
49 return 0;
50}
51
52void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; 44void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time;
53int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; 45int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time;
54 46
@@ -112,7 +104,6 @@ int do_settimeofday(struct timespec *tv)
112EXPORT_SYMBOL(do_settimeofday); 104EXPORT_SYMBOL(do_settimeofday);
113#endif /* !CONFIG_GENERIC_TIME */ 105#endif /* !CONFIG_GENERIC_TIME */
114 106
115#ifndef CONFIG_GENERIC_CLOCKEVENTS
116/* last time the RTC clock got updated */ 107/* last time the RTC clock got updated */
117static long last_rtc_update; 108static long last_rtc_update;
118 109
@@ -156,7 +147,6 @@ void handle_timer_tick(void)
156 update_process_times(user_mode(get_irq_regs())); 147 update_process_times(user_mode(get_irq_regs()));
157#endif 148#endif
158} 149}
159#endif /* !CONFIG_GENERIC_CLOCKEVENTS */
160 150
161#ifdef CONFIG_PM 151#ifdef CONFIG_PM
162int timer_suspend(struct sys_device *dev, pm_message_t state) 152int timer_suspend(struct sys_device *dev, pm_message_t state)
@@ -189,7 +179,12 @@ static struct sysdev_class timer_sysclass = {
189 179
190static int __init timer_init_sysfs(void) 180static int __init timer_init_sysfs(void)
191{ 181{
192 int ret = sysdev_class_register(&timer_sysclass); 182 int ret;
183
184 if (!sys_timer)
185 return 0;
186
187 ret = sysdev_class_register(&timer_sysclass);
193 if (ret != 0) 188 if (ret != 0)
194 return ret; 189 return ret;
195 190
@@ -200,42 +195,21 @@ device_initcall(timer_init_sysfs);
200 195
201void (*board_time_init)(void); 196void (*board_time_init)(void);
202 197
203/* 198struct clocksource clocksource_sh = {
204 * Shamelessly based on the MIPS and Sparc64 work.
205 */
206static unsigned long timer_ticks_per_nsec_quotient __read_mostly;
207unsigned long sh_hpt_frequency = 0;
208
209#define NSEC_PER_CYC_SHIFT 10
210
211static struct clocksource clocksource_sh = {
212 .name = "SuperH", 199 .name = "SuperH",
213 .rating = 200,
214 .mask = CLOCKSOURCE_MASK(32),
215 .read = null_hpt_read,
216 .shift = 16,
217 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
218}; 200};
219 201
220static void __init init_sh_clocksource(void)
221{
222 if (!sh_hpt_frequency || clocksource_sh.read == null_hpt_read)
223 return;
224
225 clocksource_sh.mult = clocksource_hz2mult(sh_hpt_frequency,
226 clocksource_sh.shift);
227
228 timer_ticks_per_nsec_quotient =
229 clocksource_hz2mult(sh_hpt_frequency, NSEC_PER_CYC_SHIFT);
230
231 clocksource_register(&clocksource_sh);
232}
233
234#ifdef CONFIG_GENERIC_TIME 202#ifdef CONFIG_GENERIC_TIME
235unsigned long long sched_clock(void) 203unsigned long long sched_clock(void)
236{ 204{
237 unsigned long long ticks = clocksource_sh.read(); 205 unsigned long long cycles;
238 return (ticks * timer_ticks_per_nsec_quotient) >> NSEC_PER_CYC_SHIFT; 206
207 /* jiffies based sched_clock if no clocksource is installed */
208 if (!clocksource_sh.rating)
209 return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
210
211 cycles = clocksource_sh.read();
212 return cyc2ns(&clocksource_sh, cycles);
239} 213}
240#endif 214#endif
241 215
@@ -259,17 +233,8 @@ void __init time_init(void)
259 * initialized for us. 233 * initialized for us.
260 */ 234 */
261 sys_timer = get_sys_timer(); 235 sys_timer = get_sys_timer();
262 printk(KERN_INFO "Using %s for system timer\n", sys_timer->name); 236 if (unlikely(!sys_timer))
263 237 panic("System timer missing.\n");
264
265 if (sys_timer->ops->read)
266 clocksource_sh.read = sys_timer->ops->read;
267
268 init_sh_clocksource();
269
270 if (sh_hpt_frequency)
271 printk("Using %lu.%03lu MHz high precision timer.\n",
272 ((sh_hpt_frequency + 500) / 1000) / 1000,
273 ((sh_hpt_frequency + 500) / 1000) % 1000);
274 238
239 printk(KERN_INFO "Using %s for system timer\n", sys_timer->name);
275} 240}
diff --git a/arch/sh/kernel/timers/timer-mtu2.c b/arch/sh/kernel/timers/timer-mtu2.c
index c3d237e1d566..9a77ae86b403 100644
--- a/arch/sh/kernel/timers/timer-mtu2.c
+++ b/arch/sh/kernel/timers/timer-mtu2.c
@@ -35,7 +35,8 @@
35#define MTU2_TSR_1 0xfffe4385 35#define MTU2_TSR_1 0xfffe4385
36#define MTU2_TCNT_1 0xfffe4386 /* 16-bit counter */ 36#define MTU2_TCNT_1 0xfffe4386 /* 16-bit counter */
37 37
38#if defined(CONFIG_CPU_SUBTYPE_SH7201) 38#if defined(CONFIG_CPU_SUBTYPE_SH7201) || \
39 defined(CONFIG_CPU_SUBTYPE_SH7203)
39#define MTU2_TGRA_1 0xfffe4388 40#define MTU2_TGRA_1 0xfffe4388
40#else 41#else
41#define MTU2_TGRA_1 0xfffe438a 42#define MTU2_TGRA_1 0xfffe438a
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c
index 0db3f9510336..10b5a6f17cc0 100644
--- a/arch/sh/kernel/timers/timer-tmu.c
+++ b/arch/sh/kernel/timers/timer-tmu.c
@@ -146,7 +146,14 @@ static irqreturn_t tmu_timer_interrupt(int irq, void *dummy)
146 _tmu_clear_status(TMU0); 146 _tmu_clear_status(TMU0);
147 _tmu_set_irq(TMU0,tmu0_clockevent.mode != CLOCK_EVT_MODE_ONESHOT); 147 _tmu_set_irq(TMU0,tmu0_clockevent.mode != CLOCK_EVT_MODE_ONESHOT);
148 148
149 evt->event_handler(evt); 149 switch (tmu0_clockevent.mode) {
150 case CLOCK_EVT_MODE_ONESHOT:
151 case CLOCK_EVT_MODE_PERIODIC:
152 evt->event_handler(evt);
153 break;
154 default:
155 break;
156 }
150 157
151 return IRQ_HANDLED; 158 return IRQ_HANDLED;
152} 159}
@@ -237,6 +244,7 @@ static int tmu_timer_init(void)
237 !defined(CONFIG_CPU_SUBTYPE_SH7721) && \ 244 !defined(CONFIG_CPU_SUBTYPE_SH7721) && \
238 !defined(CONFIG_CPU_SUBTYPE_SH7760) && \ 245 !defined(CONFIG_CPU_SUBTYPE_SH7760) && \
239 !defined(CONFIG_CPU_SUBTYPE_SH7785) && \ 246 !defined(CONFIG_CPU_SUBTYPE_SH7785) && \
247 !defined(CONFIG_CPU_SUBTYPE_SH7786) && \
240 !defined(CONFIG_CPU_SUBTYPE_SHX3) 248 !defined(CONFIG_CPU_SUBTYPE_SHX3)
241 ctrl_outb(TMU_TOCR_INIT, TMU_TOCR); 249 ctrl_outb(TMU_TOCR_INIT, TMU_TOCR);
242#endif 250#endif
@@ -254,7 +262,14 @@ static int tmu_timer_init(void)
254 262
255 _tmu_start(TMU1); 263 _tmu_start(TMU1);
256 264
257 sh_hpt_frequency = clk_get_rate(&tmu1_clk); 265 clocksource_sh.rating = 200;
266 clocksource_sh.mask = CLOCKSOURCE_MASK(32);
267 clocksource_sh.read = tmu_timer_read;
268 clocksource_sh.shift = 10;
269 clocksource_sh.mult = clocksource_hz2mult(clk_get_rate(&tmu1_clk),
270 clocksource_sh.shift);
271 clocksource_sh.flags = CLOCK_SOURCE_IS_CONTINUOUS;
272 clocksource_register(&clocksource_sh);
258 273
259 tmu0_clockevent.mult = div_sc(frequency, NSEC_PER_SEC, 274 tmu0_clockevent.mult = div_sc(frequency, NSEC_PER_SEC,
260 tmu0_clockevent.shift); 275 tmu0_clockevent.shift);
@@ -264,6 +279,7 @@ static int tmu_timer_init(void)
264 clockevent_delta2ns(1, &tmu0_clockevent); 279 clockevent_delta2ns(1, &tmu0_clockevent);
265 280
266 tmu0_clockevent.cpumask = cpumask_of(0); 281 tmu0_clockevent.cpumask = cpumask_of(0);
282 tmu0_clockevent.rating = 100;
267 283
268 clockevents_register_device(&tmu0_clockevent); 284 clockevents_register_device(&tmu0_clockevent);
269 285
@@ -274,7 +290,6 @@ static struct sys_timer_ops tmu_timer_ops = {
274 .init = tmu_timer_init, 290 .init = tmu_timer_init,
275 .start = tmu_timer_start, 291 .start = tmu_timer_start,
276 .stop = tmu_timer_stop, 292 .stop = tmu_timer_stop,
277 .read = tmu_timer_read,
278}; 293};
279 294
280struct sys_timer tmu_timer = { 295struct sys_timer tmu_timer = {
diff --git a/arch/sh/kernel/vmlinux_32.lds.S b/arch/sh/kernel/vmlinux_32.lds.S
index 7b4b82bd1156..d0b2a715cd14 100644
--- a/arch/sh/kernel/vmlinux_32.lds.S
+++ b/arch/sh/kernel/vmlinux_32.lds.S
@@ -15,7 +15,10 @@ OUTPUT_ARCH(sh)
15ENTRY(_start) 15ENTRY(_start)
16SECTIONS 16SECTIONS
17{ 17{
18#ifdef CONFIG_32BIT 18#ifdef CONFIG_PMB_FIXED
19 . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) +
20 CONFIG_ZERO_PAGE_OFFSET;
21#elif defined(CONFIG_32BIT)
19 . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET; 22 . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
20#else 23#else
21 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET; 24 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index 555ec9714b9e..10c24356d2d5 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -57,7 +57,7 @@ config 32BIT
57 bool 57 bool
58 default y if CPU_SH5 58 default y if CPU_SH5
59 59
60config PMB 60config PMB_ENABLE
61 bool "Support 32-bit physical addressing through PMB" 61 bool "Support 32-bit physical addressing through PMB"
62 depends on MMU && EXPERIMENTAL && (CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785) 62 depends on MMU && EXPERIMENTAL && (CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785)
63 select 32BIT 63 select 32BIT
@@ -67,6 +67,33 @@ config PMB
67 32-bits through the SH-4A PMB. If this is not set, legacy 67 32-bits through the SH-4A PMB. If this is not set, legacy
68 29-bit physical addressing will be used. 68 29-bit physical addressing will be used.
69 69
70choice
71 prompt "PMB handling type"
72 depends on PMB_ENABLE
73 default PMB_FIXED
74
75config PMB
76 bool "PMB"
77 depends on MMU && EXPERIMENTAL && (CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785)
78 select 32BIT
79 help
80 If you say Y here, physical addressing will be extended to
81 32-bits through the SH-4A PMB. If this is not set, legacy
82 29-bit physical addressing will be used.
83
84config PMB_FIXED
85 bool "fixed PMB"
86 depends on MMU && EXPERIMENTAL && (CPU_SUBTYPE_SH7780 || \
87 CPU_SUBTYPE_SH7785)
88 select 32BIT
89 help
90 If this option is enabled, fixed PMB mappings are inherited
91 from the boot loader, and the kernel does not attempt dynamic
92 management. This is the closest to legacy 29-bit physical mode,
93 and allows systems to support up to 512MiB of system memory.
94
95endchoice
96
70config X2TLB 97config X2TLB
71 bool "Enable extended TLB mode" 98 bool "Enable extended TLB mode"
72 depends on (CPU_SHX2 || CPU_SHX3) && MMU && EXPERIMENTAL 99 depends on (CPU_SHX2 || CPU_SHX3) && MMU && EXPERIMENTAL
diff --git a/arch/sh/mm/Makefile_32 b/arch/sh/mm/Makefile_32
index cb2f3f299591..986a1e055834 100644
--- a/arch/sh/mm/Makefile_32
+++ b/arch/sh/mm/Makefile_32
@@ -25,8 +25,10 @@ obj-$(CONFIG_CPU_SH4) += cache-debugfs.o
25endif 25endif
26 26
27ifdef CONFIG_MMU 27ifdef CONFIG_MMU
28obj-$(CONFIG_CPU_SH3) += tlb-sh3.o 28tlb-$(CONFIG_CPU_SH3) := tlb-sh3.o
29obj-$(CONFIG_CPU_SH4) += tlb-sh4.o 29tlb-$(CONFIG_CPU_SH4) := tlb-sh4.o
30tlb-$(CONFIG_CPU_HAS_PTEAEX) := tlb-pteaex.o
31obj-y += $(tlb-y)
30ifndef CONFIG_CACHE_OFF 32ifndef CONFIG_CACHE_OFF
31obj-$(CONFIG_CPU_SH4) += pg-sh4.o 33obj-$(CONFIG_CPU_SH4) += pg-sh4.o
32obj-$(CONFIG_SH7705_CACHE_32KB) += pg-sh7705.o 34obj-$(CONFIG_SH7705_CACHE_32KB) += pg-sh7705.o
@@ -35,6 +37,7 @@ endif
35 37
36obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 38obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
37obj-$(CONFIG_PMB) += pmb.o 39obj-$(CONFIG_PMB) += pmb.o
40obj-$(CONFIG_PMB_FIXED) += pmb-fixed.o
38obj-$(CONFIG_NUMA) += numa.o 41obj-$(CONFIG_NUMA) += numa.o
39 42
40EXTRA_CFLAGS += -Werror 43EXTRA_CFLAGS += -Werror
diff --git a/arch/sh/mm/asids-debugfs.c b/arch/sh/mm/asids-debugfs.c
index 8e912a15e94f..cd8c3bf39b5a 100644
--- a/arch/sh/mm/asids-debugfs.c
+++ b/arch/sh/mm/asids-debugfs.c
@@ -37,10 +37,8 @@ static int asids_seq_show(struct seq_file *file, void *iter)
37 continue; 37 continue;
38 38
39 if (p->mm) 39 if (p->mm)
40 seq_printf(file, "%5d : %02lx\n", pid, 40 seq_printf(file, "%5d : %04lx\n", pid,
41 cpu_asid(smp_processor_id(), p->mm)); 41 cpu_asid(smp_processor_id(), p->mm));
42 else
43 seq_printf(file, "%5d : (none)\n", pid);
44 } 42 }
45 43
46 read_unlock(&tasklist_lock); 44 read_unlock(&tasklist_lock);
diff --git a/arch/sh/mm/ioremap_32.c b/arch/sh/mm/ioremap_32.c
index 32946fba123e..60cc486d2c2c 100644
--- a/arch/sh/mm/ioremap_32.c
+++ b/arch/sh/mm/ioremap_32.c
@@ -59,11 +59,13 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
59 if (is_pci_memaddr(phys_addr) && is_pci_memaddr(last_addr)) 59 if (is_pci_memaddr(phys_addr) && is_pci_memaddr(last_addr))
60 return (void __iomem *)phys_addr; 60 return (void __iomem *)phys_addr;
61 61
62#if !defined(CONFIG_PMB_FIXED)
62 /* 63 /*
63 * Don't allow anybody to remap normal RAM that we're using.. 64 * Don't allow anybody to remap normal RAM that we're using..
64 */ 65 */
65 if (phys_addr < virt_to_phys(high_memory)) 66 if (phys_addr < virt_to_phys(high_memory))
66 return NULL; 67 return NULL;
68#endif
67 69
68 /* 70 /*
69 * Mappings have to be page-aligned 71 * Mappings have to be page-aligned
@@ -81,7 +83,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
81 area->phys_addr = phys_addr; 83 area->phys_addr = phys_addr;
82 orig_addr = addr = (unsigned long)area->addr; 84 orig_addr = addr = (unsigned long)area->addr;
83 85
84#ifdef CONFIG_32BIT 86#ifdef CONFIG_PMB
85 /* 87 /*
86 * First try to remap through the PMB once a valid VMA has been 88 * First try to remap through the PMB once a valid VMA has been
87 * established. Smaller allocations (or the rest of the size 89 * established. Smaller allocations (or the rest of the size
@@ -119,10 +121,10 @@ void __iounmap(void __iomem *addr)
119 unsigned long seg = PXSEG(vaddr); 121 unsigned long seg = PXSEG(vaddr);
120 struct vm_struct *p; 122 struct vm_struct *p;
121 123
122 if (seg < P3SEG || seg >= P3_ADDR_MAX || is_pci_memaddr(vaddr)) 124 if (seg < P3SEG || vaddr >= P3_ADDR_MAX || is_pci_memaddr(vaddr))
123 return; 125 return;
124 126
125#ifdef CONFIG_32BIT 127#ifdef CONFIG_PMB
126 /* 128 /*
127 * Purge any PMB entries that may have been established for this 129 * Purge any PMB entries that may have been established for this
128 * mapping, then proceed with conventional VMA teardown. 130 * mapping, then proceed with conventional VMA teardown.
diff --git a/arch/sh/mm/pmb-fixed.c b/arch/sh/mm/pmb-fixed.c
new file mode 100644
index 000000000000..43c8eac4d8a1
--- /dev/null
+++ b/arch/sh/mm/pmb-fixed.c
@@ -0,0 +1,45 @@
1/*
2 * arch/sh/mm/fixed_pmb.c
3 *
4 * Copyright (C) 2009 Renesas Solutions Corp.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/init.h>
11#include <linux/mm.h>
12#include <linux/io.h>
13#include <asm/mmu.h>
14#include <asm/mmu_context.h>
15
16static int __uses_jump_to_uncached fixed_pmb_init(void)
17{
18 int i;
19 unsigned long addr, data;
20
21 jump_to_uncached();
22
23 for (i = 0; i < PMB_ENTRY_MAX; i++) {
24 addr = PMB_DATA + (i << PMB_E_SHIFT);
25 data = ctrl_inl(addr);
26 if (!(data & PMB_V))
27 continue;
28
29 if (data & PMB_C) {
30#if defined(CONFIG_CACHE_WRITETHROUGH)
31 data |= PMB_WT;
32#elif defined(CONFIG_CACHE_WRITEBACK)
33 data &= ~PMB_WT;
34#else
35 data &= ~(PMB_C | PMB_WT);
36#endif
37 }
38 ctrl_outl(data, addr);
39 }
40
41 back_to_cached();
42
43 return 0;
44}
45arch_initcall(fixed_pmb_init);
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 84241676265e..b1a714a92b14 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -15,6 +15,8 @@
15 */ 15 */
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/sysdev.h>
19#include <linux/cpu.h>
18#include <linux/module.h> 20#include <linux/module.h>
19#include <linux/slab.h> 21#include <linux/slab.h>
20#include <linux/bitops.h> 22#include <linux/bitops.h>
@@ -402,3 +404,39 @@ static int __init pmb_debugfs_init(void)
402 return 0; 404 return 0;
403} 405}
404postcore_initcall(pmb_debugfs_init); 406postcore_initcall(pmb_debugfs_init);
407
408#ifdef CONFIG_PM
409static int pmb_sysdev_suspend(struct sys_device *dev, pm_message_t state)
410{
411 static pm_message_t prev_state;
412
413 /* Restore the PMB after a resume from hibernation */
414 if (state.event == PM_EVENT_ON &&
415 prev_state.event == PM_EVENT_FREEZE) {
416 struct pmb_entry *pmbe;
417 spin_lock_irq(&pmb_list_lock);
418 for (pmbe = pmb_list; pmbe; pmbe = pmbe->next)
419 set_pmb_entry(pmbe);
420 spin_unlock_irq(&pmb_list_lock);
421 }
422 prev_state = state;
423 return 0;
424}
425
426static int pmb_sysdev_resume(struct sys_device *dev)
427{
428 return pmb_sysdev_suspend(dev, PMSG_ON);
429}
430
431static struct sysdev_driver pmb_sysdev_driver = {
432 .suspend = pmb_sysdev_suspend,
433 .resume = pmb_sysdev_resume,
434};
435
436static int __init pmb_sysdev_init(void)
437{
438 return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver);
439}
440
441subsys_initcall(pmb_sysdev_init);
442#endif
diff --git a/arch/sh/mm/tlb-pteaex.c b/arch/sh/mm/tlb-pteaex.c
new file mode 100644
index 000000000000..2aab3ea934d7
--- /dev/null
+++ b/arch/sh/mm/tlb-pteaex.c
@@ -0,0 +1,96 @@
1/*
2 * arch/sh/mm/tlb-pteaex.c
3 *
4 * TLB operations for SH-X3 CPUs featuring PTE ASID Extensions.
5 *
6 * Copyright (C) 2009 Paul Mundt
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/kernel.h>
13#include <linux/mm.h>
14#include <linux/io.h>
15#include <asm/system.h>
16#include <asm/mmu_context.h>
17#include <asm/cacheflush.h>
18
19void update_mmu_cache(struct vm_area_struct * vma,
20 unsigned long address, pte_t pte)
21{
22 unsigned long flags;
23 unsigned long pteval;
24 unsigned long vpn;
25
26 /* Ptrace may call this routine. */
27 if (vma && current->active_mm != vma->vm_mm)
28 return;
29
30#ifndef CONFIG_CACHE_OFF
31 {
32 unsigned long pfn = pte_pfn(pte);
33
34 if (pfn_valid(pfn)) {
35 struct page *page = pfn_to_page(pfn);
36
37 if (!test_bit(PG_mapped, &page->flags)) {
38 unsigned long phys = pte_val(pte) & PTE_PHYS_MASK;
39 __flush_wback_region((void *)P1SEGADDR(phys),
40 PAGE_SIZE);
41 __set_bit(PG_mapped, &page->flags);
42 }
43 }
44 }
45#endif
46
47 local_irq_save(flags);
48
49 /* Set PTEH register */
50 vpn = address & MMU_VPN_MASK;
51 __raw_writel(vpn, MMU_PTEH);
52
53 /* Set PTEAEX */
54 __raw_writel(get_asid(), MMU_PTEAEX);
55
56 pteval = pte.pte_low;
57
58 /* Set PTEA register */
59#ifdef CONFIG_X2TLB
60 /*
61 * For the extended mode TLB this is trivial, only the ESZ and
62 * EPR bits need to be written out to PTEA, with the remainder of
63 * the protection bits (with the exception of the compat-mode SZ
64 * and PR bits, which are cleared) being written out in PTEL.
65 */
66 __raw_writel(pte.pte_high, MMU_PTEA);
67#endif
68
69 /* Set PTEL register */
70 pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */
71#ifdef CONFIG_CACHE_WRITETHROUGH
72 pteval |= _PAGE_WT;
73#endif
74 /* conveniently, we want all the software flags to be 0 anyway */
75 __raw_writel(pteval, MMU_PTEL);
76
77 /* Load the TLB */
78 asm volatile("ldtlb": /* no output */ : /* no input */ : "memory");
79 local_irq_restore(flags);
80}
81
82/*
83 * While SH-X2 extended TLB mode splits out the memory-mapped I/UTLB
84 * data arrays, SH-X3 cores with PTEAEX split out the memory-mapped
85 * address arrays. In compat mode the second array is inaccessible, while
86 * in extended mode, the legacy 8-bit ASID field in address array 1 has
87 * undefined behaviour.
88 */
89void __uses_jump_to_uncached local_flush_tlb_one(unsigned long asid,
90 unsigned long page)
91{
92 jump_to_uncached();
93 __raw_writel(page, MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT);
94 __raw_writel(asid, MMU_UTLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT);
95 back_to_cached();
96}
diff --git a/arch/sh/oprofile/common.c b/arch/sh/oprofile/common.c
index 1d97d64cb95f..1b9d4304b3bf 100644
--- a/arch/sh/oprofile/common.c
+++ b/arch/sh/oprofile/common.c
@@ -107,6 +107,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
107 case CPU_SH7780: 107 case CPU_SH7780:
108 case CPU_SH7781: 108 case CPU_SH7781:
109 case CPU_SH7785: 109 case CPU_SH7785:
110 case CPU_SH7786:
110 case CPU_SH7723: 111 case CPU_SH7723:
111 case CPU_SHX3: 112 case CPU_SHX3:
112 lmodel = &op_model_sh4a_ops; 113 lmodel = &op_model_sh4a_ops;
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
index 284b7e867496..8477b5d884fd 100644
--- a/arch/sh/tools/mach-types
+++ b/arch/sh/tools/mach-types
@@ -52,3 +52,6 @@ RSK7203 SH_RSK7203
52AP325RXA SH_AP325RXA 52AP325RXA SH_AP325RXA
53SH7763RDP SH_SH7763RDP 53SH7763RDP SH_SH7763RDP
54SH7785LCR SH_SH7785LCR 54SH7785LCR SH_SH7785LCR
55URQUELL SH_URQUELL
56ESPT SH_ESPT
57POLARIS SH_POLARIS
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h
index bf50d0c2d583..982a12f959f4 100644
--- a/arch/sparc/include/asm/socket.h
+++ b/arch/sparc/include/asm/socket.h
@@ -50,6 +50,9 @@
50 50
51#define SO_MARK 0x0022 51#define SO_MARK 0x0022
52 52
53#define SO_TIMESTAMPING 0x0023
54#define SCM_TIMESTAMPING SO_TIMESTAMPING
55
53/* Security levels - as per NRL IPv6 - don't actually do anything */ 56/* Security levels - as per NRL IPv6 - don't actually do anything */
54#define SO_SECURITY_AUTHENTICATION 0x5001 57#define SO_SECURITY_AUTHENTICATION 0x5001
55#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002 58#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
diff --git a/arch/sparc/include/asm/tlb_64.h b/arch/sparc/include/asm/tlb_64.h
index ec81cdedef2c..ee38e731bfa6 100644
--- a/arch/sparc/include/asm/tlb_64.h
+++ b/arch/sparc/include/asm/tlb_64.h
@@ -57,6 +57,8 @@ static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned i
57 57
58static inline void tlb_flush_mmu(struct mmu_gather *mp) 58static inline void tlb_flush_mmu(struct mmu_gather *mp)
59{ 59{
60 if (!mp->fullmm)
61 flush_tlb_pending();
60 if (mp->need_flush) { 62 if (mp->need_flush) {
61 free_pages_and_swap_cache(mp->pages, mp->pages_nr); 63 free_pages_and_swap_cache(mp->pages, mp->pages_nr);
62 mp->pages_nr = 0; 64 mp->pages_nr = 0;
@@ -78,8 +80,6 @@ static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, un
78 80
79 if (mp->fullmm) 81 if (mp->fullmm)
80 mp->fullmm = 0; 82 mp->fullmm = 0;
81 else
82 flush_tlb_pending();
83 83
84 /* keep the page table cache within bounds */ 84 /* keep the page table cache within bounds */
85 check_pgt_cache(); 85 check_pgt_cache();
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index 1c378d8e90c5..d0d6a515499a 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -185,7 +185,7 @@ int show_interrupts(struct seq_file *p, void *v)
185 seq_printf(p, "%10u ", kstat_irqs(i)); 185 seq_printf(p, "%10u ", kstat_irqs(i));
186#else 186#else
187 for_each_online_cpu(j) 187 for_each_online_cpu(j)
188 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 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->typename);
191 seq_printf(p, " %s", action->name); 191 seq_printf(p, " %s", action->name);
@@ -252,9 +252,10 @@ struct irq_handler_data {
252#ifdef CONFIG_SMP 252#ifdef CONFIG_SMP
253static int irq_choose_cpu(unsigned int virt_irq) 253static int irq_choose_cpu(unsigned int virt_irq)
254{ 254{
255 cpumask_t mask = irq_desc[virt_irq].affinity; 255 cpumask_t mask;
256 int cpuid; 256 int cpuid;
257 257
258 cpumask_copy(&mask, irq_desc[virt_irq].affinity);
258 if (cpus_equal(mask, CPU_MASK_ALL)) { 259 if (cpus_equal(mask, CPU_MASK_ALL)) {
259 static int irq_rover; 260 static int irq_rover;
260 static DEFINE_SPINLOCK(irq_rover_lock); 261 static DEFINE_SPINLOCK(irq_rover_lock);
@@ -805,7 +806,7 @@ void fixup_irqs(void)
805 !(irq_desc[irq].status & IRQ_PER_CPU)) { 806 !(irq_desc[irq].status & IRQ_PER_CPU)) {
806 if (irq_desc[irq].chip->set_affinity) 807 if (irq_desc[irq].chip->set_affinity)
807 irq_desc[irq].chip->set_affinity(irq, 808 irq_desc[irq].chip->set_affinity(irq,
808 &irq_desc[irq].affinity); 809 irq_desc[irq].affinity);
809 } 810 }
810 spin_unlock_irqrestore(&irq_desc[irq].lock, flags); 811 spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
811 } 812 }
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 6cd1a5b65067..79457f682b5a 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1031,7 +1031,7 @@ void smp_fetch_global_regs(void)
1031 * If the address space is non-shared (ie. mm->count == 1) we avoid 1031 * If the address space is non-shared (ie. mm->count == 1) we avoid
1032 * cross calls when we want to flush the currently running process's 1032 * cross calls when we want to flush the currently running process's
1033 * tlb state. This is done by clearing all cpu bits except the current 1033 * tlb state. This is done by clearing all cpu bits except the current
1034 * processor's in current->active_mm->cpu_vm_mask and performing the 1034 * processor's in current->mm->cpu_vm_mask and performing the
1035 * flush locally only. This will force any subsequent cpus which run 1035 * flush locally only. This will force any subsequent cpus which run
1036 * this task to flush the context from the local tlb if the process 1036 * this task to flush the context from the local tlb if the process
1037 * migrates to another cpu (again). 1037 * migrates to another cpu (again).
@@ -1074,7 +1074,7 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long
1074 u32 ctx = CTX_HWBITS(mm->context); 1074 u32 ctx = CTX_HWBITS(mm->context);
1075 int cpu = get_cpu(); 1075 int cpu = get_cpu();
1076 1076
1077 if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1) 1077 if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
1078 mm->cpu_vm_mask = cpumask_of_cpu(cpu); 1078 mm->cpu_vm_mask = cpumask_of_cpu(cpu);
1079 else 1079 else
1080 smp_cross_call_masked(&xcall_flush_tlb_pending, 1080 smp_cross_call_masked(&xcall_flush_tlb_pending,
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index f93c42a2b522..a8000b1cda74 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -51,7 +51,7 @@ sys_call_table32:
51/*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64 51/*150*/ .word sys_nis_syscall, sys_inotify_init, sys_inotify_add_watch, sys_poll, sys_getdents64
52 .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount 52 .word compat_sys_fcntl64, sys_inotify_rm_watch, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount
53/*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall 53/*160*/ .word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall
54 .word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr 54 .word sys_quotactl, sys_set_tid_address, compat_sys_mount, compat_sys_ustat, sys32_setxattr
55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents 55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents
56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr 56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr
57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall 57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 2db3c2229b95..db310aa00183 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -729,7 +729,7 @@ void timer_interrupt(int irq, struct pt_regs *regs)
729 729
730 irq_enter(); 730 irq_enter();
731 731
732 kstat_this_cpu.irqs[0]++; 732 kstat_incr_irqs_this_cpu(0, irq_to_desc(0));
733 733
734 if (unlikely(!evt->event_handler)) { 734 if (unlikely(!evt->event_handler)) {
735 printk(KERN_WARNING 735 printk(KERN_WARNING
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index fde510b664d3..434224e2229f 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -86,7 +86,7 @@ static int uml_net_rx(struct net_device *dev)
86 drop_skb->dev = dev; 86 drop_skb->dev = dev;
87 /* Read a packet into drop_skb and don't do anything with it. */ 87 /* Read a packet into drop_skb and don't do anything with it. */
88 (*lp->read)(lp->fd, drop_skb, lp); 88 (*lp->read)(lp->fd, drop_skb, lp);
89 lp->stats.rx_dropped++; 89 dev->stats.rx_dropped++;
90 return 0; 90 return 0;
91 } 91 }
92 92
@@ -99,8 +99,8 @@ static int uml_net_rx(struct net_device *dev)
99 skb_trim(skb, pkt_len); 99 skb_trim(skb, pkt_len);
100 skb->protocol = (*lp->protocol)(skb); 100 skb->protocol = (*lp->protocol)(skb);
101 101
102 lp->stats.rx_bytes += skb->len; 102 dev->stats.rx_bytes += skb->len;
103 lp->stats.rx_packets++; 103 dev->stats.rx_packets++;
104 netif_rx(skb); 104 netif_rx(skb);
105 return pkt_len; 105 return pkt_len;
106 } 106 }
@@ -224,8 +224,8 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
224 len = (*lp->write)(lp->fd, skb, lp); 224 len = (*lp->write)(lp->fd, skb, lp);
225 225
226 if (len == skb->len) { 226 if (len == skb->len) {
227 lp->stats.tx_packets++; 227 dev->stats.tx_packets++;
228 lp->stats.tx_bytes += skb->len; 228 dev->stats.tx_bytes += skb->len;
229 dev->trans_start = jiffies; 229 dev->trans_start = jiffies;
230 netif_start_queue(dev); 230 netif_start_queue(dev);
231 231
@@ -234,7 +234,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
234 } 234 }
235 else if (len == 0) { 235 else if (len == 0) {
236 netif_start_queue(dev); 236 netif_start_queue(dev);
237 lp->stats.tx_dropped++; 237 dev->stats.tx_dropped++;
238 } 238 }
239 else { 239 else {
240 netif_start_queue(dev); 240 netif_start_queue(dev);
@@ -248,12 +248,6 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
248 return 0; 248 return 0;
249} 249}
250 250
251static struct net_device_stats *uml_net_get_stats(struct net_device *dev)
252{
253 struct uml_net_private *lp = netdev_priv(dev);
254 return &lp->stats;
255}
256
257static void uml_net_set_multicast_list(struct net_device *dev) 251static void uml_net_set_multicast_list(struct net_device *dev)
258{ 252{
259 return; 253 return;
@@ -377,6 +371,18 @@ static void net_device_release(struct device *dev)
377 free_netdev(netdev); 371 free_netdev(netdev);
378} 372}
379 373
374static const struct net_device_ops uml_netdev_ops = {
375 .ndo_open = uml_net_open,
376 .ndo_stop = uml_net_close,
377 .ndo_start_xmit = uml_net_start_xmit,
378 .ndo_set_multicast_list = uml_net_set_multicast_list,
379 .ndo_tx_timeout = uml_net_tx_timeout,
380 .ndo_set_mac_address = uml_net_set_mac,
381 .ndo_change_mtu = uml_net_change_mtu,
382 .ndo_set_mac_address = eth_mac_addr,
383 .ndo_validate_addr = eth_validate_addr,
384};
385
380/* 386/*
381 * Ensures that platform_driver_register is called only once by 387 * Ensures that platform_driver_register is called only once by
382 * eth_configure. Will be set in an initcall. 388 * eth_configure. Will be set in an initcall.
@@ -473,14 +479,7 @@ static void eth_configure(int n, void *init, char *mac,
473 479
474 set_ether_mac(dev, device->mac); 480 set_ether_mac(dev, device->mac);
475 dev->mtu = transport->user->mtu; 481 dev->mtu = transport->user->mtu;
476 dev->open = uml_net_open; 482 dev->netdev_ops = &uml_netdev_ops;
477 dev->hard_start_xmit = uml_net_start_xmit;
478 dev->stop = uml_net_close;
479 dev->get_stats = uml_net_get_stats;
480 dev->set_multicast_list = uml_net_set_multicast_list;
481 dev->tx_timeout = uml_net_tx_timeout;
482 dev->set_mac_address = uml_net_set_mac;
483 dev->change_mtu = uml_net_change_mtu;
484 dev->ethtool_ops = &uml_net_ethtool_ops; 483 dev->ethtool_ops = &uml_net_ethtool_ops;
485 dev->watchdog_timeo = (HZ >> 1); 484 dev->watchdog_timeo = (HZ >> 1);
486 dev->irq = UM_ETH_IRQ; 485 dev->irq = UM_ETH_IRQ;
diff --git a/arch/um/include/shared/net_kern.h b/arch/um/include/shared/net_kern.h
index d843c7924a7c..5c367f22595b 100644
--- a/arch/um/include/shared/net_kern.h
+++ b/arch/um/include/shared/net_kern.h
@@ -26,7 +26,7 @@ struct uml_net_private {
26 spinlock_t lock; 26 spinlock_t lock;
27 struct net_device *dev; 27 struct net_device *dev;
28 struct timer_list tl; 28 struct timer_list tl;
29 struct net_device_stats stats; 29
30 struct work_struct work; 30 struct work_struct work;
31 int fd; 31 int fd;
32 unsigned char mac[ETH_ALEN]; 32 unsigned char mac[ETH_ALEN];
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 3d7aad09b171..336b61569072 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -42,7 +42,7 @@ int show_interrupts(struct seq_file *p, void *v)
42 seq_printf(p, "%10u ", kstat_irqs(i)); 42 seq_printf(p, "%10u ", kstat_irqs(i));
43#else 43#else
44 for_each_online_cpu(j) 44 for_each_online_cpu(j)
45 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 45 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
46#endif 46#endif
47 seq_printf(p, " %14s", irq_desc[i].chip->typename); 47 seq_printf(p, " %14s", irq_desc[i].chip->typename);
48 seq_printf(p, " %s", action->name); 48 seq_printf(p, " %s", action->name);
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index bc2fbadff9f9..06c02c00d7d9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -5,7 +5,7 @@ mainmenu "Linux Kernel Configuration for x86"
5config 64BIT 5config 64BIT
6 bool "64-bit kernel" if ARCH = "x86" 6 bool "64-bit kernel" if ARCH = "x86"
7 default ARCH = "x86_64" 7 default ARCH = "x86_64"
8 help 8 ---help---
9 Say yes to build a 64-bit kernel - formerly known as x86_64 9 Say yes to build a 64-bit kernel - formerly known as x86_64
10 Say no to build a 32-bit kernel - formerly known as i386 10 Say no to build a 32-bit kernel - formerly known as i386
11 11
@@ -34,12 +34,15 @@ config X86
34 select HAVE_FUNCTION_TRACER 34 select HAVE_FUNCTION_TRACER
35 select HAVE_FUNCTION_GRAPH_TRACER 35 select HAVE_FUNCTION_GRAPH_TRACER
36 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 36 select HAVE_FUNCTION_TRACE_MCOUNT_TEST
37 select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) 37 select HAVE_KVM
38 select HAVE_ARCH_KGDB if !X86_VOYAGER 38 select HAVE_ARCH_KGDB
39 select HAVE_ARCH_TRACEHOOK 39 select HAVE_ARCH_TRACEHOOK
40 select HAVE_GENERIC_DMA_COHERENT if X86_32 40 select HAVE_GENERIC_DMA_COHERENT if X86_32
41 select HAVE_EFFICIENT_UNALIGNED_ACCESS 41 select HAVE_EFFICIENT_UNALIGNED_ACCESS
42 select USER_STACKTRACE_SUPPORT 42 select USER_STACKTRACE_SUPPORT
43 select HAVE_KERNEL_GZIP
44 select HAVE_KERNEL_BZIP2
45 select HAVE_KERNEL_LZMA
43 46
44config ARCH_DEFCONFIG 47config ARCH_DEFCONFIG
45 string 48 string
@@ -133,18 +136,19 @@ config ARCH_HAS_CACHE_LINE_SIZE
133 def_bool y 136 def_bool y
134 137
135config HAVE_SETUP_PER_CPU_AREA 138config HAVE_SETUP_PER_CPU_AREA
136 def_bool X86_64_SMP || (X86_SMP && !X86_VOYAGER) 139 def_bool y
140
141config HAVE_DYNAMIC_PER_CPU_AREA
142 def_bool y
137 143
138config HAVE_CPUMASK_OF_CPU_MAP 144config HAVE_CPUMASK_OF_CPU_MAP
139 def_bool X86_64_SMP 145 def_bool X86_64_SMP
140 146
141config ARCH_HIBERNATION_POSSIBLE 147config ARCH_HIBERNATION_POSSIBLE
142 def_bool y 148 def_bool y
143 depends on !SMP || !X86_VOYAGER
144 149
145config ARCH_SUSPEND_POSSIBLE 150config ARCH_SUSPEND_POSSIBLE
146 def_bool y 151 def_bool y
147 depends on !X86_VOYAGER
148 152
149config ZONE_DMA32 153config ZONE_DMA32
150 bool 154 bool
@@ -165,6 +169,9 @@ config GENERIC_HARDIRQS
165 bool 169 bool
166 default y 170 default y
167 171
172config GENERIC_HARDIRQS_NO__DO_IRQ
173 def_bool y
174
168config GENERIC_IRQ_PROBE 175config GENERIC_IRQ_PROBE
169 bool 176 bool
170 default y 177 default y
@@ -174,11 +181,6 @@ config GENERIC_PENDING_IRQ
174 depends on GENERIC_HARDIRQS && SMP 181 depends on GENERIC_HARDIRQS && SMP
175 default y 182 default y
176 183
177config X86_SMP
178 bool
179 depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)
180 default y
181
182config USE_GENERIC_SMP_HELPERS 184config USE_GENERIC_SMP_HELPERS
183 def_bool y 185 def_bool y
184 depends on SMP 186 depends on SMP
@@ -194,19 +196,17 @@ config X86_64_SMP
194config X86_HT 196config X86_HT
195 bool 197 bool
196 depends on SMP 198 depends on SMP
197 depends on (X86_32 && !X86_VOYAGER) || X86_64
198 default y
199
200config X86_BIOS_REBOOT
201 bool
202 depends on !X86_VOYAGER
203 default y 199 default y
204 200
205config X86_TRAMPOLINE 201config X86_TRAMPOLINE
206 bool 202 bool
207 depends on X86_SMP || (X86_VOYAGER && SMP) || (64BIT && ACPI_SLEEP) 203 depends on SMP || (64BIT && ACPI_SLEEP)
208 default y 204 default y
209 205
206config X86_32_LAZY_GS
207 def_bool y
208 depends on X86_32 && !CC_STACKPROTECTOR
209
210config KTIME_SCALAR 210config KTIME_SCALAR
211 def_bool X86_32 211 def_bool X86_32
212source "init/Kconfig" 212source "init/Kconfig"
@@ -244,14 +244,24 @@ config SMP
244 244
245 If you don't know what to do here, say N. 245 If you don't know what to do here, say N.
246 246
247config X86_HAS_BOOT_CPU_ID 247config X86_X2APIC
248 def_bool y 248 bool "Support x2apic"
249 depends on X86_VOYAGER 249 depends on X86_LOCAL_APIC && X86_64
250 ---help---
251 This enables x2apic support on CPUs that have this feature.
252
253 This allows 32-bit apic IDs (so it can support very large systems),
254 and accesses the local apic via MSRs not via mmio.
255
256 ( On certain CPU models you may need to enable INTR_REMAP too,
257 to get functional x2apic mode. )
258
259 If you don't know what to do here, say N.
250 260
251config SPARSE_IRQ 261config SPARSE_IRQ
252 bool "Support sparse irq numbering" 262 bool "Support sparse irq numbering"
253 depends on PCI_MSI || HT_IRQ 263 depends on PCI_MSI || HT_IRQ
254 help 264 ---help---
255 This enables support for sparse irqs. This is useful for distro 265 This enables support for sparse irqs. This is useful for distro
256 kernels that want to define a high CONFIG_NR_CPUS value but still 266 kernels that want to define a high CONFIG_NR_CPUS value but still
257 want to have low kernel memory footprint on smaller machines. 267 want to have low kernel memory footprint on smaller machines.
@@ -265,114 +275,140 @@ config NUMA_MIGRATE_IRQ_DESC
265 bool "Move irq desc when changing irq smp_affinity" 275 bool "Move irq desc when changing irq smp_affinity"
266 depends on SPARSE_IRQ && NUMA 276 depends on SPARSE_IRQ && NUMA
267 default n 277 default n
268 help 278 ---help---
269 This enables moving irq_desc to cpu/node that irq will use handled. 279 This enables moving irq_desc to cpu/node that irq will use handled.
270 280
271 If you don't know what to do here, say N. 281 If you don't know what to do here, say N.
272 282
273config X86_FIND_SMP_CONFIG
274 def_bool y
275 depends on X86_MPPARSE || X86_VOYAGER
276
277config X86_MPPARSE 283config X86_MPPARSE
278 bool "Enable MPS table" if ACPI 284 bool "Enable MPS table" if ACPI
279 default y 285 default y
280 depends on X86_LOCAL_APIC 286 depends on X86_LOCAL_APIC
281 help 287 ---help---
282 For old smp systems that do not have proper acpi support. Newer systems 288 For old smp systems that do not have proper acpi support. Newer systems
283 (esp with 64bit cpus) with acpi support, MADT and DSDT will override it 289 (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
284 290
285choice 291config X86_BIGSMP
286 prompt "Subarchitecture Type" 292 bool "Support for big SMP systems with more than 8 CPUs"
287 default X86_PC 293 depends on X86_32 && SMP
294 ---help---
295 This option is needed for the systems that have more than 8 CPUs
288 296
289config X86_PC 297if X86_32
290 bool "PC-compatible" 298config X86_EXTENDED_PLATFORM
291 help 299 bool "Support for extended (non-PC) x86 platforms"
292 Choose this option if your computer is a standard PC or compatible. 300 default y
301 ---help---
302 If you disable this option then the kernel will only support
303 standard PC platforms. (which covers the vast majority of
304 systems out there.)
305
306 If you enable this option then you'll be able to select support
307 for the following (non-PC) 32 bit x86 platforms:
308 AMD Elan
309 NUMAQ (IBM/Sequent)
310 RDC R-321x SoC
311 SGI 320/540 (Visual Workstation)
312 Summit/EXA (IBM x440)
313 Unisys ES7000 IA32 series
314
315 If you have one of these systems, or if you want to build a
316 generic distribution kernel, say Y here - otherwise say N.
317endif
318
319if X86_64
320config X86_EXTENDED_PLATFORM
321 bool "Support for extended (non-PC) x86 platforms"
322 default y
323 ---help---
324 If you disable this option then the kernel will only support
325 standard PC platforms. (which covers the vast majority of
326 systems out there.)
327
328 If you enable this option then you'll be able to select support
329 for the following (non-PC) 64 bit x86 platforms:
330 ScaleMP vSMP
331 SGI Ultraviolet
332
333 If you have one of these systems, or if you want to build a
334 generic distribution kernel, say Y here - otherwise say N.
335endif
336# This is an alphabetically sorted list of 64 bit extended platforms
337# Please maintain the alphabetic order if and when there are additions
338
339config X86_VSMP
340 bool "ScaleMP vSMP"
341 select PARAVIRT
342 depends on X86_64 && PCI
343 depends on X86_EXTENDED_PLATFORM
344 ---help---
345 Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is
346 supposed to run on these EM64T-based machines. Only choose this option
347 if you have one of these machines.
348
349config X86_UV
350 bool "SGI Ultraviolet"
351 depends on X86_64
352 depends on X86_EXTENDED_PLATFORM
353 select X86_X2APIC
354 ---help---
355 This option is needed in order to support SGI Ultraviolet systems.
356 If you don't have one of these, you should say N here.
357
358# Following is an alphabetically sorted list of 32 bit extended platforms
359# Please maintain the alphabetic order if and when there are additions
293 360
294config X86_ELAN 361config X86_ELAN
295 bool "AMD Elan" 362 bool "AMD Elan"
296 depends on X86_32 363 depends on X86_32
297 help 364 depends on X86_EXTENDED_PLATFORM
365 ---help---
298 Select this for an AMD Elan processor. 366 Select this for an AMD Elan processor.
299 367
300 Do not use this option for K6/Athlon/Opteron processors! 368 Do not use this option for K6/Athlon/Opteron processors!
301 369
302 If unsure, choose "PC-compatible" instead. 370 If unsure, choose "PC-compatible" instead.
303 371
304config X86_VOYAGER 372config X86_RDC321X
305 bool "Voyager (NCR)" 373 bool "RDC R-321x SoC"
306 depends on X86_32 && (SMP || BROKEN) && !PCI
307 help
308 Voyager is an MCA-based 32-way capable SMP architecture proprietary
309 to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
310
311 *** WARNING ***
312
313 If you do not specifically know you have a Voyager based machine,
314 say N here, otherwise the kernel you build will not be bootable.
315
316config X86_GENERICARCH
317 bool "Generic architecture"
318 depends on X86_32 374 depends on X86_32
319 help 375 depends on X86_EXTENDED_PLATFORM
320 This option compiles in the NUMAQ, Summit, bigsmp, ES7000, default 376 select M486
377 select X86_REBOOTFIXUPS
378 ---help---
379 This option is needed for RDC R-321x system-on-chip, also known
380 as R-8610-(G).
381 If you don't have one of these chips, you should say N here.
382
383config X86_32_NON_STANDARD
384 bool "Support non-standard 32-bit SMP architectures"
385 depends on X86_32 && SMP
386 depends on X86_EXTENDED_PLATFORM
387 ---help---
388 This option compiles in the NUMAQ, Summit, bigsmp, ES7000, default
321 subarchitectures. It is intended for a generic binary kernel. 389 subarchitectures. It is intended for a generic binary kernel.
322 if you select them all, kernel will probe it one by one. and will 390 if you select them all, kernel will probe it one by one. and will
323 fallback to default. 391 fallback to default.
324 392
325if X86_GENERICARCH 393# Alphabetically sorted list of Non standard 32 bit platforms
326 394
327config X86_NUMAQ 395config X86_NUMAQ
328 bool "NUMAQ (IBM/Sequent)" 396 bool "NUMAQ (IBM/Sequent)"
329 depends on SMP && X86_32 && PCI && X86_MPPARSE 397 depends on X86_32_NON_STANDARD
330 select NUMA 398 select NUMA
331 help 399 select X86_MPPARSE
400 ---help---
332 This option is used for getting Linux to run on a NUMAQ (IBM/Sequent) 401 This option is used for getting Linux to run on a NUMAQ (IBM/Sequent)
333 NUMA multiquad box. This changes the way that processors are 402 NUMA multiquad box. This changes the way that processors are
334 bootstrapped, and uses Clustered Logical APIC addressing mode instead 403 bootstrapped, and uses Clustered Logical APIC addressing mode instead
335 of Flat Logical. You will need a new lynxer.elf file to flash your 404 of Flat Logical. You will need a new lynxer.elf file to flash your
336 firmware with - send email to <Martin.Bligh@us.ibm.com>. 405 firmware with - send email to <Martin.Bligh@us.ibm.com>.
337 406
338config X86_SUMMIT
339 bool "Summit/EXA (IBM x440)"
340 depends on X86_32 && SMP
341 help
342 This option is needed for IBM systems that use the Summit/EXA chipset.
343 In particular, it is needed for the x440.
344
345config X86_ES7000
346 bool "Support for Unisys ES7000 IA32 series"
347 depends on X86_32 && SMP
348 help
349 Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
350 supposed to run on an IA32-based Unisys ES7000 system.
351
352config X86_BIGSMP
353 bool "Support for big SMP systems with more than 8 CPUs"
354 depends on X86_32 && SMP
355 help
356 This option is needed for the systems that have more than 8 CPUs
357 and if the system is not of any sub-arch type above.
358
359endif
360
361config X86_VSMP
362 bool "Support for ScaleMP vSMP"
363 select PARAVIRT
364 depends on X86_64 && PCI
365 help
366 Support for ScaleMP vSMP systems. Say 'Y' here if this kernel is
367 supposed to run on these EM64T-based machines. Only choose this option
368 if you have one of these machines.
369
370endchoice
371
372config X86_VISWS 407config X86_VISWS
373 bool "SGI 320/540 (Visual Workstation)" 408 bool "SGI 320/540 (Visual Workstation)"
374 depends on X86_32 && PCI && !X86_VOYAGER && X86_MPPARSE && PCI_GODIRECT 409 depends on X86_32 && PCI && X86_MPPARSE && PCI_GODIRECT
375 help 410 depends on X86_32_NON_STANDARD
411 ---help---
376 The SGI Visual Workstation series is an IA32-based workstation 412 The SGI Visual Workstation series is an IA32-based workstation
377 based on SGI systems chips with some legacy PC hardware attached. 413 based on SGI systems chips with some legacy PC hardware attached.
378 414
@@ -381,21 +417,25 @@ config X86_VISWS
381 A kernel compiled for the Visual Workstation will run on general 417 A kernel compiled for the Visual Workstation will run on general
382 PCs as well. See <file:Documentation/sgi-visws.txt> for details. 418 PCs as well. See <file:Documentation/sgi-visws.txt> for details.
383 419
384config X86_RDC321X 420config X86_SUMMIT
385 bool "RDC R-321x SoC" 421 bool "Summit/EXA (IBM x440)"
386 depends on X86_32 422 depends on X86_32_NON_STANDARD
387 select M486 423 ---help---
388 select X86_REBOOTFIXUPS 424 This option is needed for IBM systems that use the Summit/EXA chipset.
389 help 425 In particular, it is needed for the x440.
390 This option is needed for RDC R-321x system-on-chip, also known 426
391 as R-8610-(G). 427config X86_ES7000
392 If you don't have one of these chips, you should say N here. 428 bool "Unisys ES7000 IA32 series"
429 depends on X86_32_NON_STANDARD && X86_BIGSMP
430 ---help---
431 Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
432 supposed to run on an IA32-based Unisys ES7000 system.
393 433
394config SCHED_OMIT_FRAME_POINTER 434config SCHED_OMIT_FRAME_POINTER
395 def_bool y 435 def_bool y
396 prompt "Single-depth WCHAN output" 436 prompt "Single-depth WCHAN output"
397 depends on X86 437 depends on X86
398 help 438 ---help---
399 Calculate simpler /proc/<PID>/wchan values. If this option 439 Calculate simpler /proc/<PID>/wchan values. If this option
400 is disabled then wchan values will recurse back to the 440 is disabled then wchan values will recurse back to the
401 caller function. This provides more accurate wchan values, 441 caller function. This provides more accurate wchan values,
@@ -405,7 +445,7 @@ config SCHED_OMIT_FRAME_POINTER
405 445
406menuconfig PARAVIRT_GUEST 446menuconfig PARAVIRT_GUEST
407 bool "Paravirtualized guest support" 447 bool "Paravirtualized guest support"
408 help 448 ---help---
409 Say Y here to get to see options related to running Linux under 449 Say Y here to get to see options related to running Linux under
410 various hypervisors. This option alone does not add any kernel code. 450 various hypervisors. This option alone does not add any kernel code.
411 451
@@ -419,8 +459,7 @@ config VMI
419 bool "VMI Guest support" 459 bool "VMI Guest support"
420 select PARAVIRT 460 select PARAVIRT
421 depends on X86_32 461 depends on X86_32
422 depends on !X86_VOYAGER 462 ---help---
423 help
424 VMI provides a paravirtualized interface to the VMware ESX server 463 VMI provides a paravirtualized interface to the VMware ESX server
425 (it could be used by other hypervisors in theory too, but is not 464 (it could be used by other hypervisors in theory too, but is not
426 at the moment), by linking the kernel to a GPL-ed ROM module 465 at the moment), by linking the kernel to a GPL-ed ROM module
@@ -430,8 +469,7 @@ config KVM_CLOCK
430 bool "KVM paravirtualized clock" 469 bool "KVM paravirtualized clock"
431 select PARAVIRT 470 select PARAVIRT
432 select PARAVIRT_CLOCK 471 select PARAVIRT_CLOCK
433 depends on !X86_VOYAGER 472 ---help---
434 help
435 Turning on this option will allow you to run a paravirtualized clock 473 Turning on this option will allow you to run a paravirtualized clock
436 when running over the KVM hypervisor. Instead of relying on a PIT 474 when running over the KVM hypervisor. Instead of relying on a PIT
437 (or probably other) emulation by the underlying device model, the host 475 (or probably other) emulation by the underlying device model, the host
@@ -441,17 +479,15 @@ config KVM_CLOCK
441config KVM_GUEST 479config KVM_GUEST
442 bool "KVM Guest support" 480 bool "KVM Guest support"
443 select PARAVIRT 481 select PARAVIRT
444 depends on !X86_VOYAGER 482 ---help---
445 help 483 This option enables various optimizations for running under the KVM
446 This option enables various optimizations for running under the KVM 484 hypervisor.
447 hypervisor.
448 485
449source "arch/x86/lguest/Kconfig" 486source "arch/x86/lguest/Kconfig"
450 487
451config PARAVIRT 488config PARAVIRT
452 bool "Enable paravirtualization code" 489 bool "Enable paravirtualization code"
453 depends on !X86_VOYAGER 490 ---help---
454 help
455 This changes the kernel so it can modify itself when it is run 491 This changes the kernel so it can modify itself when it is run
456 under a hypervisor, potentially improving performance significantly 492 under a hypervisor, potentially improving performance significantly
457 over full virtualization. However, when run without a hypervisor 493 over full virtualization. However, when run without a hypervisor
@@ -464,51 +500,51 @@ config PARAVIRT_CLOCK
464endif 500endif
465 501
466config PARAVIRT_DEBUG 502config PARAVIRT_DEBUG
467 bool "paravirt-ops debugging" 503 bool "paravirt-ops debugging"
468 depends on PARAVIRT && DEBUG_KERNEL 504 depends on PARAVIRT && DEBUG_KERNEL
469 help 505 ---help---
470 Enable to debug paravirt_ops internals. Specifically, BUG if 506 Enable to debug paravirt_ops internals. Specifically, BUG if
471 a paravirt_op is missing when it is called. 507 a paravirt_op is missing when it is called.
472 508
473config MEMTEST 509config MEMTEST
474 bool "Memtest" 510 bool "Memtest"
475 help 511 ---help---
476 This option adds a kernel parameter 'memtest', which allows memtest 512 This option adds a kernel parameter 'memtest', which allows memtest
477 to be set. 513 to be set.
478 memtest=0, mean disabled; -- default 514 memtest=0, mean disabled; -- default
479 memtest=1, mean do 1 test pattern; 515 memtest=1, mean do 1 test pattern;
480 ... 516 ...
481 memtest=4, mean do 4 test patterns. 517 memtest=4, mean do 4 test patterns.
482 If you are unsure how to answer this question, answer N. 518 If you are unsure how to answer this question, answer N.
483 519
484config X86_SUMMIT_NUMA 520config X86_SUMMIT_NUMA
485 def_bool y 521 def_bool y
486 depends on X86_32 && NUMA && X86_GENERICARCH 522 depends on X86_32 && NUMA && X86_32_NON_STANDARD
487 523
488config X86_CYCLONE_TIMER 524config X86_CYCLONE_TIMER
489 def_bool y 525 def_bool y
490 depends on X86_GENERICARCH 526 depends on X86_32_NON_STANDARD
491 527
492source "arch/x86/Kconfig.cpu" 528source "arch/x86/Kconfig.cpu"
493 529
494config HPET_TIMER 530config HPET_TIMER
495 def_bool X86_64 531 def_bool X86_64
496 prompt "HPET Timer Support" if X86_32 532 prompt "HPET Timer Support" if X86_32
497 help 533 ---help---
498 Use the IA-PC HPET (High Precision Event Timer) to manage 534 Use the IA-PC HPET (High Precision Event Timer) to manage
499 time in preference to the PIT and RTC, if a HPET is 535 time in preference to the PIT and RTC, if a HPET is
500 present. 536 present.
501 HPET is the next generation timer replacing legacy 8254s. 537 HPET is the next generation timer replacing legacy 8254s.
502 The HPET provides a stable time base on SMP 538 The HPET provides a stable time base on SMP
503 systems, unlike the TSC, but it is more expensive to access, 539 systems, unlike the TSC, but it is more expensive to access,
504 as it is off-chip. You can find the HPET spec at 540 as it is off-chip. You can find the HPET spec at
505 <http://www.intel.com/hardwaredesign/hpetspec_1.pdf>. 541 <http://www.intel.com/hardwaredesign/hpetspec_1.pdf>.
506 542
507 You can safely choose Y here. However, HPET will only be 543 You can safely choose Y here. However, HPET will only be
508 activated if the platform and the BIOS support this feature. 544 activated if the platform and the BIOS support this feature.
509 Otherwise the 8254 will be used for timing services. 545 Otherwise the 8254 will be used for timing services.
510 546
511 Choose N to continue using the legacy 8254 timer. 547 Choose N to continue using the legacy 8254 timer.
512 548
513config HPET_EMULATE_RTC 549config HPET_EMULATE_RTC
514 def_bool y 550 def_bool y
@@ -519,7 +555,7 @@ config HPET_EMULATE_RTC
519config DMI 555config DMI
520 default y 556 default y
521 bool "Enable DMI scanning" if EMBEDDED 557 bool "Enable DMI scanning" if EMBEDDED
522 help 558 ---help---
523 Enabled scanning of DMI to identify machine quirks. Say Y 559 Enabled scanning of DMI to identify machine quirks. Say Y
524 here unless you have verified that your setup is not 560 here unless you have verified that your setup is not
525 affected by entries in the DMI blacklist. Required by PNP 561 affected by entries in the DMI blacklist. Required by PNP
@@ -531,7 +567,7 @@ config GART_IOMMU
531 select SWIOTLB 567 select SWIOTLB
532 select AGP 568 select AGP
533 depends on X86_64 && PCI 569 depends on X86_64 && PCI
534 help 570 ---help---
535 Support for full DMA access of devices with 32bit memory access only 571 Support for full DMA access of devices with 32bit memory access only
536 on systems with more than 3GB. This is usually needed for USB, 572 on systems with more than 3GB. This is usually needed for USB,
537 sound, many IDE/SATA chipsets and some other devices. 573 sound, many IDE/SATA chipsets and some other devices.
@@ -546,7 +582,7 @@ config CALGARY_IOMMU
546 bool "IBM Calgary IOMMU support" 582 bool "IBM Calgary IOMMU support"
547 select SWIOTLB 583 select SWIOTLB
548 depends on X86_64 && PCI && EXPERIMENTAL 584 depends on X86_64 && PCI && EXPERIMENTAL
549 help 585 ---help---
550 Support for hardware IOMMUs in IBM's xSeries x366 and x460 586 Support for hardware IOMMUs in IBM's xSeries x366 and x460
551 systems. Needed to run systems with more than 3GB of memory 587 systems. Needed to run systems with more than 3GB of memory
552 properly with 32-bit PCI devices that do not support DAC 588 properly with 32-bit PCI devices that do not support DAC
@@ -564,7 +600,7 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
564 def_bool y 600 def_bool y
565 prompt "Should Calgary be enabled by default?" 601 prompt "Should Calgary be enabled by default?"
566 depends on CALGARY_IOMMU 602 depends on CALGARY_IOMMU
567 help 603 ---help---
568 Should Calgary be enabled by default? if you choose 'y', Calgary 604 Should Calgary be enabled by default? if you choose 'y', Calgary
569 will be used (if it exists). If you choose 'n', Calgary will not be 605 will be used (if it exists). If you choose 'n', Calgary will not be
570 used even if it exists. If you choose 'n' and would like to use 606 used even if it exists. If you choose 'n' and would like to use
@@ -576,7 +612,7 @@ config AMD_IOMMU
576 select SWIOTLB 612 select SWIOTLB
577 select PCI_MSI 613 select PCI_MSI
578 depends on X86_64 && PCI && ACPI 614 depends on X86_64 && PCI && ACPI
579 help 615 ---help---
580 With this option you can enable support for AMD IOMMU hardware in 616 With this option you can enable support for AMD IOMMU hardware in
581 your system. An IOMMU is a hardware component which provides 617 your system. An IOMMU is a hardware component which provides
582 remapping of DMA memory accesses from devices. With an AMD IOMMU you 618 remapping of DMA memory accesses from devices. With an AMD IOMMU you
@@ -591,7 +627,7 @@ config AMD_IOMMU_STATS
591 bool "Export AMD IOMMU statistics to debugfs" 627 bool "Export AMD IOMMU statistics to debugfs"
592 depends on AMD_IOMMU 628 depends on AMD_IOMMU
593 select DEBUG_FS 629 select DEBUG_FS
594 help 630 ---help---
595 This option enables code in the AMD IOMMU driver to collect various 631 This option enables code in the AMD IOMMU driver to collect various
596 statistics about whats happening in the driver and exports that 632 statistics about whats happening in the driver and exports that
597 information to userspace via debugfs. 633 information to userspace via debugfs.
@@ -600,7 +636,7 @@ config AMD_IOMMU_STATS
600# need this always selected by IOMMU for the VIA workaround 636# need this always selected by IOMMU for the VIA workaround
601config SWIOTLB 637config SWIOTLB
602 def_bool y if X86_64 638 def_bool y if X86_64
603 help 639 ---help---
604 Support for software bounce buffers used on x86-64 systems 640 Support for software bounce buffers used on x86-64 systems
605 which don't have a hardware IOMMU (e.g. the current generation 641 which don't have a hardware IOMMU (e.g. the current generation
606 of Intel's x86-64 CPUs). Using this PCI devices which can only 642 of Intel's x86-64 CPUs). Using this PCI devices which can only
@@ -618,7 +654,7 @@ config MAXSMP
618 depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL 654 depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL
619 select CPUMASK_OFFSTACK 655 select CPUMASK_OFFSTACK
620 default n 656 default n
621 help 657 ---help---
622 Configure maximum number of CPUS and NUMA Nodes for this architecture. 658 Configure maximum number of CPUS and NUMA Nodes for this architecture.
623 If unsure, say N. 659 If unsure, say N.
624 660
@@ -629,7 +665,7 @@ config NR_CPUS
629 default "4096" if MAXSMP 665 default "4096" if MAXSMP
630 default "32" if SMP && (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000) 666 default "32" if SMP && (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000)
631 default "8" if SMP 667 default "8" if SMP
632 help 668 ---help---
633 This allows you to specify the maximum number of CPUs which this 669 This allows you to specify the maximum number of CPUs which this
634 kernel will support. The maximum supported value is 512 and the 670 kernel will support. The maximum supported value is 512 and the
635 minimum value which makes sense is 2. 671 minimum value which makes sense is 2.
@@ -640,7 +676,7 @@ config NR_CPUS
640config SCHED_SMT 676config SCHED_SMT
641 bool "SMT (Hyperthreading) scheduler support" 677 bool "SMT (Hyperthreading) scheduler support"
642 depends on X86_HT 678 depends on X86_HT
643 help 679 ---help---
644 SMT scheduler support improves the CPU scheduler's decision making 680 SMT scheduler support improves the CPU scheduler's decision making
645 when dealing with Intel Pentium 4 chips with HyperThreading at a 681 when dealing with Intel Pentium 4 chips with HyperThreading at a
646 cost of slightly increased overhead in some places. If unsure say 682 cost of slightly increased overhead in some places. If unsure say
@@ -650,7 +686,7 @@ config SCHED_MC
650 def_bool y 686 def_bool y
651 prompt "Multi-core scheduler support" 687 prompt "Multi-core scheduler support"
652 depends on X86_HT 688 depends on X86_HT
653 help 689 ---help---
654 Multi-core scheduler support improves the CPU scheduler's decision 690 Multi-core scheduler support improves the CPU scheduler's decision
655 making when dealing with multi-core CPU chips at a cost of slightly 691 making when dealing with multi-core CPU chips at a cost of slightly
656 increased overhead in some places. If unsure say N here. 692 increased overhead in some places. If unsure say N here.
@@ -659,8 +695,8 @@ source "kernel/Kconfig.preempt"
659 695
660config X86_UP_APIC 696config X86_UP_APIC
661 bool "Local APIC support on uniprocessors" 697 bool "Local APIC support on uniprocessors"
662 depends on X86_32 && !SMP && !(X86_VOYAGER || X86_GENERICARCH) 698 depends on X86_32 && !SMP && !X86_32_NON_STANDARD
663 help 699 ---help---
664 A local APIC (Advanced Programmable Interrupt Controller) is an 700 A local APIC (Advanced Programmable Interrupt Controller) is an
665 integrated interrupt controller in the CPU. If you have a single-CPU 701 integrated interrupt controller in the CPU. If you have a single-CPU
666 system which has a processor with a local APIC, you can say Y here to 702 system which has a processor with a local APIC, you can say Y here to
@@ -673,7 +709,7 @@ config X86_UP_APIC
673config X86_UP_IOAPIC 709config X86_UP_IOAPIC
674 bool "IO-APIC support on uniprocessors" 710 bool "IO-APIC support on uniprocessors"
675 depends on X86_UP_APIC 711 depends on X86_UP_APIC
676 help 712 ---help---
677 An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an 713 An IO-APIC (I/O Advanced Programmable Interrupt Controller) is an
678 SMP-capable replacement for PC-style interrupt controllers. Most 714 SMP-capable replacement for PC-style interrupt controllers. Most
679 SMP systems and many recent uniprocessor systems have one. 715 SMP systems and many recent uniprocessor systems have one.
@@ -684,11 +720,11 @@ config X86_UP_IOAPIC
684 720
685config X86_LOCAL_APIC 721config X86_LOCAL_APIC
686 def_bool y 722 def_bool y
687 depends on X86_64 || (X86_32 && (X86_UP_APIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH)) 723 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
688 724
689config X86_IO_APIC 725config X86_IO_APIC
690 def_bool y 726 def_bool y
691 depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH)) 727 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
692 728
693config X86_VISWS_APIC 729config X86_VISWS_APIC
694 def_bool y 730 def_bool y
@@ -698,7 +734,7 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
698 bool "Reroute for broken boot IRQs" 734 bool "Reroute for broken boot IRQs"
699 default n 735 default n
700 depends on X86_IO_APIC 736 depends on X86_IO_APIC
701 help 737 ---help---
702 This option enables a workaround that fixes a source of 738 This option enables a workaround that fixes a source of
703 spurious interrupts. This is recommended when threaded 739 spurious interrupts. This is recommended when threaded
704 interrupt handling is used on systems where the generation of 740 interrupt handling is used on systems where the generation of
@@ -720,7 +756,6 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
720 756
721config X86_MCE 757config X86_MCE
722 bool "Machine Check Exception" 758 bool "Machine Check Exception"
723 depends on !X86_VOYAGER
724 ---help--- 759 ---help---
725 Machine Check Exception support allows the processor to notify the 760 Machine Check Exception support allows the processor to notify the
726 kernel if it detects a problem (e.g. overheating, component failure). 761 kernel if it detects a problem (e.g. overheating, component failure).
@@ -739,7 +774,7 @@ config X86_MCE_INTEL
739 def_bool y 774 def_bool y
740 prompt "Intel MCE features" 775 prompt "Intel MCE features"
741 depends on X86_64 && X86_MCE && X86_LOCAL_APIC 776 depends on X86_64 && X86_MCE && X86_LOCAL_APIC
742 help 777 ---help---
743 Additional support for intel specific MCE features such as 778 Additional support for intel specific MCE features such as
744 the thermal monitor. 779 the thermal monitor.
745 780
@@ -747,14 +782,14 @@ config X86_MCE_AMD
747 def_bool y 782 def_bool y
748 prompt "AMD MCE features" 783 prompt "AMD MCE features"
749 depends on X86_64 && X86_MCE && X86_LOCAL_APIC 784 depends on X86_64 && X86_MCE && X86_LOCAL_APIC
750 help 785 ---help---
751 Additional support for AMD specific MCE features such as 786 Additional support for AMD specific MCE features such as
752 the DRAM Error Threshold. 787 the DRAM Error Threshold.
753 788
754config X86_MCE_NONFATAL 789config X86_MCE_NONFATAL
755 tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4" 790 tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
756 depends on X86_32 && X86_MCE 791 depends on X86_32 && X86_MCE
757 help 792 ---help---
758 Enabling this feature starts a timer that triggers every 5 seconds which 793 Enabling this feature starts a timer that triggers every 5 seconds which
759 will look at the machine check registers to see if anything happened. 794 will look at the machine check registers to see if anything happened.
760 Non-fatal problems automatically get corrected (but still logged). 795 Non-fatal problems automatically get corrected (but still logged).
@@ -767,7 +802,7 @@ config X86_MCE_NONFATAL
767config X86_MCE_P4THERMAL 802config X86_MCE_P4THERMAL
768 bool "check for P4 thermal throttling interrupt." 803 bool "check for P4 thermal throttling interrupt."
769 depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP) 804 depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP)
770 help 805 ---help---
771 Enabling this feature will cause a message to be printed when the P4 806 Enabling this feature will cause a message to be printed when the P4
772 enters thermal throttling. 807 enters thermal throttling.
773 808
@@ -775,11 +810,11 @@ config VM86
775 bool "Enable VM86 support" if EMBEDDED 810 bool "Enable VM86 support" if EMBEDDED
776 default y 811 default y
777 depends on X86_32 812 depends on X86_32
778 help 813 ---help---
779 This option is required by programs like DOSEMU to run 16-bit legacy 814 This option is required by programs like DOSEMU to run 16-bit legacy
780 code on X86 processors. It also may be needed by software like 815 code on X86 processors. It also may be needed by software like
781 XFree86 to initialize some video cards via BIOS. Disabling this 816 XFree86 to initialize some video cards via BIOS. Disabling this
782 option saves about 6k. 817 option saves about 6k.
783 818
784config TOSHIBA 819config TOSHIBA
785 tristate "Toshiba Laptop support" 820 tristate "Toshiba Laptop support"
@@ -853,33 +888,33 @@ config MICROCODE
853 module will be called microcode. 888 module will be called microcode.
854 889
855config MICROCODE_INTEL 890config MICROCODE_INTEL
856 bool "Intel microcode patch loading support" 891 bool "Intel microcode patch loading support"
857 depends on MICROCODE 892 depends on MICROCODE
858 default MICROCODE 893 default MICROCODE
859 select FW_LOADER 894 select FW_LOADER
860 --help--- 895 ---help---
861 This options enables microcode patch loading support for Intel 896 This options enables microcode patch loading support for Intel
862 processors. 897 processors.
863 898
864 For latest news and information on obtaining all the required 899 For latest news and information on obtaining all the required
865 Intel ingredients for this driver, check: 900 Intel ingredients for this driver, check:
866 <http://www.urbanmyth.org/microcode/>. 901 <http://www.urbanmyth.org/microcode/>.
867 902
868config MICROCODE_AMD 903config MICROCODE_AMD
869 bool "AMD microcode patch loading support" 904 bool "AMD microcode patch loading support"
870 depends on MICROCODE 905 depends on MICROCODE
871 select FW_LOADER 906 select FW_LOADER
872 --help--- 907 ---help---
873 If you select this option, microcode patch loading support for AMD 908 If you select this option, microcode patch loading support for AMD
874 processors will be enabled. 909 processors will be enabled.
875 910
876 config MICROCODE_OLD_INTERFACE 911config MICROCODE_OLD_INTERFACE
877 def_bool y 912 def_bool y
878 depends on MICROCODE 913 depends on MICROCODE
879 914
880config X86_MSR 915config X86_MSR
881 tristate "/dev/cpu/*/msr - Model-specific register support" 916 tristate "/dev/cpu/*/msr - Model-specific register support"
882 help 917 ---help---
883 This device gives privileged processes access to the x86 918 This device gives privileged processes access to the x86
884 Model-Specific Registers (MSRs). It is a character device with 919 Model-Specific Registers (MSRs). It is a character device with
885 major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr. 920 major 202 and minors 0 to 31 for /dev/cpu/0/msr to /dev/cpu/31/msr.
@@ -888,7 +923,7 @@ config X86_MSR
888 923
889config X86_CPUID 924config X86_CPUID
890 tristate "/dev/cpu/*/cpuid - CPU information support" 925 tristate "/dev/cpu/*/cpuid - CPU information support"
891 help 926 ---help---
892 This device gives processes access to the x86 CPUID instruction to 927 This device gives processes access to the x86 CPUID instruction to
893 be executed on a specific processor. It is a character device 928 be executed on a specific processor. It is a character device
894 with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to 929 with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
@@ -940,7 +975,7 @@ config NOHIGHMEM
940config HIGHMEM4G 975config HIGHMEM4G
941 bool "4GB" 976 bool "4GB"
942 depends on !X86_NUMAQ 977 depends on !X86_NUMAQ
943 help 978 ---help---
944 Select this if you have a 32-bit processor and between 1 and 4 979 Select this if you have a 32-bit processor and between 1 and 4
945 gigabytes of physical RAM. 980 gigabytes of physical RAM.
946 981
@@ -948,7 +983,7 @@ config HIGHMEM64G
948 bool "64GB" 983 bool "64GB"
949 depends on !M386 && !M486 984 depends on !M386 && !M486
950 select X86_PAE 985 select X86_PAE
951 help 986 ---help---
952 Select this if you have a 32-bit processor and more than 4 987 Select this if you have a 32-bit processor and more than 4
953 gigabytes of physical RAM. 988 gigabytes of physical RAM.
954 989
@@ -959,7 +994,7 @@ choice
959 prompt "Memory split" if EMBEDDED 994 prompt "Memory split" if EMBEDDED
960 default VMSPLIT_3G 995 default VMSPLIT_3G
961 depends on X86_32 996 depends on X86_32
962 help 997 ---help---
963 Select the desired split between kernel and user memory. 998 Select the desired split between kernel and user memory.
964 999
965 If the address range available to the kernel is less than the 1000 If the address range available to the kernel is less than the
@@ -1005,20 +1040,20 @@ config HIGHMEM
1005config X86_PAE 1040config X86_PAE
1006 bool "PAE (Physical Address Extension) Support" 1041 bool "PAE (Physical Address Extension) Support"
1007 depends on X86_32 && !HIGHMEM4G 1042 depends on X86_32 && !HIGHMEM4G
1008 help 1043 ---help---
1009 PAE is required for NX support, and furthermore enables 1044 PAE is required for NX support, and furthermore enables
1010 larger swapspace support for non-overcommit purposes. It 1045 larger swapspace support for non-overcommit purposes. It
1011 has the cost of more pagetable lookup overhead, and also 1046 has the cost of more pagetable lookup overhead, and also
1012 consumes more pagetable space per process. 1047 consumes more pagetable space per process.
1013 1048
1014config ARCH_PHYS_ADDR_T_64BIT 1049config ARCH_PHYS_ADDR_T_64BIT
1015 def_bool X86_64 || X86_PAE 1050 def_bool X86_64 || X86_PAE
1016 1051
1017config DIRECT_GBPAGES 1052config DIRECT_GBPAGES
1018 bool "Enable 1GB pages for kernel pagetables" if EMBEDDED 1053 bool "Enable 1GB pages for kernel pagetables" if EMBEDDED
1019 default y 1054 default y
1020 depends on X86_64 1055 depends on X86_64
1021 help 1056 ---help---
1022 Allow the kernel linear mapping to use 1GB pages on CPUs that 1057 Allow the kernel linear mapping to use 1GB pages on CPUs that
1023 support it. This can improve the kernel's performance a tiny bit by 1058 support it. This can improve the kernel's performance a tiny bit by
1024 reducing TLB pressure. If in doubt, say "Y". 1059 reducing TLB pressure. If in doubt, say "Y".
@@ -1028,9 +1063,8 @@ config NUMA
1028 bool "Numa Memory Allocation and Scheduler Support" 1063 bool "Numa Memory Allocation and Scheduler Support"
1029 depends on SMP 1064 depends on SMP
1030 depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && EXPERIMENTAL) 1065 depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI) && EXPERIMENTAL)
1031 default n if X86_PC
1032 default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP) 1066 default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP)
1033 help 1067 ---help---
1034 Enable NUMA (Non Uniform Memory Access) support. 1068 Enable NUMA (Non Uniform Memory Access) support.
1035 1069
1036 The kernel will try to allocate memory used by a CPU on the 1070 The kernel will try to allocate memory used by a CPU on the
@@ -1053,19 +1087,19 @@ config K8_NUMA
1053 def_bool y 1087 def_bool y
1054 prompt "Old style AMD Opteron NUMA detection" 1088 prompt "Old style AMD Opteron NUMA detection"
1055 depends on X86_64 && NUMA && PCI 1089 depends on X86_64 && NUMA && PCI
1056 help 1090 ---help---
1057 Enable K8 NUMA node topology detection. You should say Y here if 1091 Enable K8 NUMA node topology detection. You should say Y here if
1058 you have a multi processor AMD K8 system. This uses an old 1092 you have a multi processor AMD K8 system. This uses an old
1059 method to read the NUMA configuration directly from the builtin 1093 method to read the NUMA configuration directly from the builtin
1060 Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA 1094 Northbridge of Opteron. It is recommended to use X86_64_ACPI_NUMA
1061 instead, which also takes priority if both are compiled in. 1095 instead, which also takes priority if both are compiled in.
1062 1096
1063config X86_64_ACPI_NUMA 1097config X86_64_ACPI_NUMA
1064 def_bool y 1098 def_bool y
1065 prompt "ACPI NUMA detection" 1099 prompt "ACPI NUMA detection"
1066 depends on X86_64 && NUMA && ACPI && PCI 1100 depends on X86_64 && NUMA && ACPI && PCI
1067 select ACPI_NUMA 1101 select ACPI_NUMA
1068 help 1102 ---help---
1069 Enable ACPI SRAT based node topology detection. 1103 Enable ACPI SRAT based node topology detection.
1070 1104
1071# Some NUMA nodes have memory ranges that span 1105# Some NUMA nodes have memory ranges that span
@@ -1080,7 +1114,7 @@ config NODES_SPAN_OTHER_NODES
1080config NUMA_EMU 1114config NUMA_EMU
1081 bool "NUMA emulation" 1115 bool "NUMA emulation"
1082 depends on X86_64 && NUMA 1116 depends on X86_64 && NUMA
1083 help 1117 ---help---
1084 Enable NUMA emulation. A flat machine will be split 1118 Enable NUMA emulation. A flat machine will be split
1085 into virtual nodes when booted with "numa=fake=N", where N is the 1119 into virtual nodes when booted with "numa=fake=N", where N is the
1086 number of nodes. This is only useful for debugging. 1120 number of nodes. This is only useful for debugging.
@@ -1093,11 +1127,11 @@ config NODES_SHIFT
1093 default "4" if X86_NUMAQ 1127 default "4" if X86_NUMAQ
1094 default "3" 1128 default "3"
1095 depends on NEED_MULTIPLE_NODES 1129 depends on NEED_MULTIPLE_NODES
1096 help 1130 ---help---
1097 Specify the maximum number of NUMA Nodes available on the target 1131 Specify the maximum number of NUMA Nodes available on the target
1098 system. Increases memory reserved to accomodate various tables. 1132 system. Increases memory reserved to accomodate various tables.
1099 1133
1100config HAVE_ARCH_BOOTMEM_NODE 1134config HAVE_ARCH_BOOTMEM
1101 def_bool y 1135 def_bool y
1102 depends on X86_32 && NUMA 1136 depends on X86_32 && NUMA
1103 1137
@@ -1131,7 +1165,7 @@ config ARCH_SPARSEMEM_DEFAULT
1131 1165
1132config ARCH_SPARSEMEM_ENABLE 1166config ARCH_SPARSEMEM_ENABLE
1133 def_bool y 1167 def_bool y
1134 depends on X86_64 || NUMA || (EXPERIMENTAL && X86_PC) || X86_GENERICARCH 1168 depends on X86_64 || NUMA || (EXPERIMENTAL && X86_32) || X86_32_NON_STANDARD
1135 select SPARSEMEM_STATIC if X86_32 1169 select SPARSEMEM_STATIC if X86_32
1136 select SPARSEMEM_VMEMMAP_ENABLE if X86_64 1170 select SPARSEMEM_VMEMMAP_ENABLE if X86_64
1137 1171
@@ -1148,61 +1182,61 @@ source "mm/Kconfig"
1148config HIGHPTE 1182config HIGHPTE
1149 bool "Allocate 3rd-level pagetables from highmem" 1183 bool "Allocate 3rd-level pagetables from highmem"
1150 depends on X86_32 && (HIGHMEM4G || HIGHMEM64G) 1184 depends on X86_32 && (HIGHMEM4G || HIGHMEM64G)
1151 help 1185 ---help---
1152 The VM uses one page table entry for each page of physical memory. 1186 The VM uses one page table entry for each page of physical memory.
1153 For systems with a lot of RAM, this can be wasteful of precious 1187 For systems with a lot of RAM, this can be wasteful of precious
1154 low memory. Setting this option will put user-space page table 1188 low memory. Setting this option will put user-space page table
1155 entries in high memory. 1189 entries in high memory.
1156 1190
1157config X86_CHECK_BIOS_CORRUPTION 1191config X86_CHECK_BIOS_CORRUPTION
1158 bool "Check for low memory corruption" 1192 bool "Check for low memory corruption"
1159 help 1193 ---help---
1160 Periodically check for memory corruption in low memory, which 1194 Periodically check for memory corruption in low memory, which
1161 is suspected to be caused by BIOS. Even when enabled in the 1195 is suspected to be caused by BIOS. Even when enabled in the
1162 configuration, it is disabled at runtime. Enable it by 1196 configuration, it is disabled at runtime. Enable it by
1163 setting "memory_corruption_check=1" on the kernel command 1197 setting "memory_corruption_check=1" on the kernel command
1164 line. By default it scans the low 64k of memory every 60 1198 line. By default it scans the low 64k of memory every 60
1165 seconds; see the memory_corruption_check_size and 1199 seconds; see the memory_corruption_check_size and
1166 memory_corruption_check_period parameters in 1200 memory_corruption_check_period parameters in
1167 Documentation/kernel-parameters.txt to adjust this. 1201 Documentation/kernel-parameters.txt to adjust this.
1168 1202
1169 When enabled with the default parameters, this option has 1203 When enabled with the default parameters, this option has
1170 almost no overhead, as it reserves a relatively small amount 1204 almost no overhead, as it reserves a relatively small amount
1171 of memory and scans it infrequently. It both detects corruption 1205 of memory and scans it infrequently. It both detects corruption
1172 and prevents it from affecting the running system. 1206 and prevents it from affecting the running system.
1173 1207
1174 It is, however, intended as a diagnostic tool; if repeatable 1208 It is, however, intended as a diagnostic tool; if repeatable
1175 BIOS-originated corruption always affects the same memory, 1209 BIOS-originated corruption always affects the same memory,
1176 you can use memmap= to prevent the kernel from using that 1210 you can use memmap= to prevent the kernel from using that
1177 memory. 1211 memory.
1178 1212
1179config X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK 1213config X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK
1180 bool "Set the default setting of memory_corruption_check" 1214 bool "Set the default setting of memory_corruption_check"
1181 depends on X86_CHECK_BIOS_CORRUPTION 1215 depends on X86_CHECK_BIOS_CORRUPTION
1182 default y 1216 default y
1183 help 1217 ---help---
1184 Set whether the default state of memory_corruption_check is 1218 Set whether the default state of memory_corruption_check is
1185 on or off. 1219 on or off.
1186 1220
1187config X86_RESERVE_LOW_64K 1221config X86_RESERVE_LOW_64K
1188 bool "Reserve low 64K of RAM on AMI/Phoenix BIOSen" 1222 bool "Reserve low 64K of RAM on AMI/Phoenix BIOSen"
1189 default y 1223 default y
1190 help 1224 ---help---
1191 Reserve the first 64K of physical RAM on BIOSes that are known 1225 Reserve the first 64K of physical RAM on BIOSes that are known
1192 to potentially corrupt that memory range. A numbers of BIOSes are 1226 to potentially corrupt that memory range. A numbers of BIOSes are
1193 known to utilize this area during suspend/resume, so it must not 1227 known to utilize this area during suspend/resume, so it must not
1194 be used by the kernel. 1228 be used by the kernel.
1195 1229
1196 Set this to N if you are absolutely sure that you trust the BIOS 1230 Set this to N if you are absolutely sure that you trust the BIOS
1197 to get all its memory reservations and usages right. 1231 to get all its memory reservations and usages right.
1198 1232
1199 If you have doubts about the BIOS (e.g. suspend/resume does not 1233 If you have doubts about the BIOS (e.g. suspend/resume does not
1200 work or there's kernel crashes after certain hardware hotplug 1234 work or there's kernel crashes after certain hardware hotplug
1201 events) and it's not AMI or Phoenix, then you might want to enable 1235 events) and it's not AMI or Phoenix, then you might want to enable
1202 X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check typical 1236 X86_CHECK_BIOS_CORRUPTION=y to allow the kernel to check typical
1203 corruption patterns. 1237 corruption patterns.
1204 1238
1205 Say Y if unsure. 1239 Say Y if unsure.
1206 1240
1207config MATH_EMULATION 1241config MATH_EMULATION
1208 bool 1242 bool
@@ -1268,7 +1302,7 @@ config MTRR_SANITIZER
1268 def_bool y 1302 def_bool y
1269 prompt "MTRR cleanup support" 1303 prompt "MTRR cleanup support"
1270 depends on MTRR 1304 depends on MTRR
1271 help 1305 ---help---
1272 Convert MTRR layout from continuous to discrete, so X drivers can 1306 Convert MTRR layout from continuous to discrete, so X drivers can
1273 add writeback entries. 1307 add writeback entries.
1274 1308
@@ -1283,7 +1317,7 @@ config MTRR_SANITIZER_ENABLE_DEFAULT
1283 range 0 1 1317 range 0 1
1284 default "0" 1318 default "0"
1285 depends on MTRR_SANITIZER 1319 depends on MTRR_SANITIZER
1286 help 1320 ---help---
1287 Enable mtrr cleanup default value 1321 Enable mtrr cleanup default value
1288 1322
1289config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT 1323config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
@@ -1291,7 +1325,7 @@ config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
1291 range 0 7 1325 range 0 7
1292 default "1" 1326 default "1"
1293 depends on MTRR_SANITIZER 1327 depends on MTRR_SANITIZER
1294 help 1328 ---help---
1295 mtrr cleanup spare entries default, it can be changed via 1329 mtrr cleanup spare entries default, it can be changed via
1296 mtrr_spare_reg_nr=N on the kernel command line. 1330 mtrr_spare_reg_nr=N on the kernel command line.
1297 1331
@@ -1299,7 +1333,7 @@ config X86_PAT
1299 bool 1333 bool
1300 prompt "x86 PAT support" 1334 prompt "x86 PAT support"
1301 depends on MTRR 1335 depends on MTRR
1302 help 1336 ---help---
1303 Use PAT attributes to setup page level cache control. 1337 Use PAT attributes to setup page level cache control.
1304 1338
1305 PATs are the modern equivalents of MTRRs and are much more 1339 PATs are the modern equivalents of MTRRs and are much more
@@ -1314,20 +1348,20 @@ config EFI
1314 bool "EFI runtime service support" 1348 bool "EFI runtime service support"
1315 depends on ACPI 1349 depends on ACPI
1316 ---help--- 1350 ---help---
1317 This enables the kernel to use EFI runtime services that are 1351 This enables the kernel to use EFI runtime services that are
1318 available (such as the EFI variable services). 1352 available (such as the EFI variable services).
1319 1353
1320 This option is only useful on systems that have EFI firmware. 1354 This option is only useful on systems that have EFI firmware.
1321 In addition, you should use the latest ELILO loader available 1355 In addition, you should use the latest ELILO loader available
1322 at <http://elilo.sourceforge.net> in order to take advantage 1356 at <http://elilo.sourceforge.net> in order to take advantage
1323 of EFI runtime services. However, even with this option, the 1357 of EFI runtime services. However, even with this option, the
1324 resultant kernel should continue to boot on existing non-EFI 1358 resultant kernel should continue to boot on existing non-EFI
1325 platforms. 1359 platforms.
1326 1360
1327config SECCOMP 1361config SECCOMP
1328 def_bool y 1362 def_bool y
1329 prompt "Enable seccomp to safely compute untrusted bytecode" 1363 prompt "Enable seccomp to safely compute untrusted bytecode"
1330 help 1364 ---help---
1331 This kernel feature is useful for number crunching applications 1365 This kernel feature is useful for number crunching applications
1332 that may need to compute untrusted bytecode during their 1366 that may need to compute untrusted bytecode during their
1333 execution. By using pipes or other transports made available to 1367 execution. By using pipes or other transports made available to
@@ -1340,13 +1374,16 @@ config SECCOMP
1340 1374
1341 If unsure, say Y. Only embedded should say N here. 1375 If unsure, say Y. Only embedded should say N here.
1342 1376
1377config CC_STACKPROTECTOR_ALL
1378 bool
1379
1343config CC_STACKPROTECTOR 1380config CC_STACKPROTECTOR
1344 bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)" 1381 bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
1345 depends on X86_64 && EXPERIMENTAL && BROKEN 1382 select CC_STACKPROTECTOR_ALL
1346 help 1383 ---help---
1347 This option turns on the -fstack-protector GCC feature. This 1384 This option turns on the -fstack-protector GCC feature. This
1348 feature puts, at the beginning of critical functions, a canary 1385 feature puts, at the beginning of functions, a canary value on
1349 value on the stack just before the return address, and validates 1386 the stack just before the return address, and validates
1350 the value just before actually returning. Stack based buffer 1387 the value just before actually returning. Stack based buffer
1351 overflows (that need to overwrite this return address) now also 1388 overflows (that need to overwrite this return address) now also
1352 overwrite the canary, which gets detected and the attack is then 1389 overwrite the canary, which gets detected and the attack is then
@@ -1354,22 +1391,14 @@ config CC_STACKPROTECTOR
1354 1391
1355 This feature requires gcc version 4.2 or above, or a distribution 1392 This feature requires gcc version 4.2 or above, or a distribution
1356 gcc with the feature backported. Older versions are automatically 1393 gcc with the feature backported. Older versions are automatically
1357 detected and for those versions, this configuration option is ignored. 1394 detected and for those versions, this configuration option is
1358 1395 ignored. (and a warning is printed during bootup)
1359config CC_STACKPROTECTOR_ALL
1360 bool "Use stack-protector for all functions"
1361 depends on CC_STACKPROTECTOR
1362 help
1363 Normally, GCC only inserts the canary value protection for
1364 functions that use large-ish on-stack buffers. By enabling
1365 this option, GCC will be asked to do this for ALL functions.
1366 1396
1367source kernel/Kconfig.hz 1397source kernel/Kconfig.hz
1368 1398
1369config KEXEC 1399config KEXEC
1370 bool "kexec system call" 1400 bool "kexec system call"
1371 depends on X86_BIOS_REBOOT 1401 ---help---
1372 help
1373 kexec is a system call that implements the ability to shutdown your 1402 kexec is a system call that implements the ability to shutdown your
1374 current kernel, and to start another kernel. It is like a reboot 1403 current kernel, and to start another kernel. It is like a reboot
1375 but it is independent of the system firmware. And like a reboot 1404 but it is independent of the system firmware. And like a reboot
@@ -1386,7 +1415,7 @@ config KEXEC
1386config CRASH_DUMP 1415config CRASH_DUMP
1387 bool "kernel crash dumps" 1416 bool "kernel crash dumps"
1388 depends on X86_64 || (X86_32 && HIGHMEM) 1417 depends on X86_64 || (X86_32 && HIGHMEM)
1389 help 1418 ---help---
1390 Generate crash dump after being started by kexec. 1419 Generate crash dump after being started by kexec.
1391 This should be normally only set in special crash dump kernels 1420 This should be normally only set in special crash dump kernels
1392 which are loaded in the main kernel with kexec-tools into 1421 which are loaded in the main kernel with kexec-tools into
@@ -1401,7 +1430,7 @@ config KEXEC_JUMP
1401 bool "kexec jump (EXPERIMENTAL)" 1430 bool "kexec jump (EXPERIMENTAL)"
1402 depends on EXPERIMENTAL 1431 depends on EXPERIMENTAL
1403 depends on KEXEC && HIBERNATION && X86_32 1432 depends on KEXEC && HIBERNATION && X86_32
1404 help 1433 ---help---
1405 Jump between original kernel and kexeced kernel and invoke 1434 Jump between original kernel and kexeced kernel and invoke
1406 code in physical address mode via KEXEC 1435 code in physical address mode via KEXEC
1407 1436
@@ -1410,7 +1439,7 @@ config PHYSICAL_START
1410 default "0x1000000" if X86_NUMAQ 1439 default "0x1000000" if X86_NUMAQ
1411 default "0x200000" if X86_64 1440 default "0x200000" if X86_64
1412 default "0x100000" 1441 default "0x100000"
1413 help 1442 ---help---
1414 This gives the physical address where the kernel is loaded. 1443 This gives the physical address where the kernel is loaded.
1415 1444
1416 If kernel is a not relocatable (CONFIG_RELOCATABLE=n) then 1445 If kernel is a not relocatable (CONFIG_RELOCATABLE=n) then
@@ -1451,7 +1480,7 @@ config PHYSICAL_START
1451config RELOCATABLE 1480config RELOCATABLE
1452 bool "Build a relocatable kernel (EXPERIMENTAL)" 1481 bool "Build a relocatable kernel (EXPERIMENTAL)"
1453 depends on EXPERIMENTAL 1482 depends on EXPERIMENTAL
1454 help 1483 ---help---
1455 This builds a kernel image that retains relocation information 1484 This builds a kernel image that retains relocation information
1456 so it can be loaded someplace besides the default 1MB. 1485 so it can be loaded someplace besides the default 1MB.
1457 The relocations tend to make the kernel binary about 10% larger, 1486 The relocations tend to make the kernel binary about 10% larger,
@@ -1471,7 +1500,7 @@ config PHYSICAL_ALIGN
1471 default "0x100000" if X86_32 1500 default "0x100000" if X86_32
1472 default "0x200000" if X86_64 1501 default "0x200000" if X86_64
1473 range 0x2000 0x400000 1502 range 0x2000 0x400000
1474 help 1503 ---help---
1475 This value puts the alignment restrictions on physical address 1504 This value puts the alignment restrictions on physical address
1476 where kernel is loaded and run from. Kernel is compiled for an 1505 where kernel is loaded and run from. Kernel is compiled for an
1477 address which meets above alignment restriction. 1506 address which meets above alignment restriction.
@@ -1492,7 +1521,7 @@ config PHYSICAL_ALIGN
1492 1521
1493config HOTPLUG_CPU 1522config HOTPLUG_CPU
1494 bool "Support for hot-pluggable CPUs" 1523 bool "Support for hot-pluggable CPUs"
1495 depends on SMP && HOTPLUG && !X86_VOYAGER 1524 depends on SMP && HOTPLUG
1496 ---help--- 1525 ---help---
1497 Say Y here to allow turning CPUs off and on. CPUs can be 1526 Say Y here to allow turning CPUs off and on. CPUs can be
1498 controlled through /sys/devices/system/cpu. 1527 controlled through /sys/devices/system/cpu.
@@ -1504,7 +1533,7 @@ config COMPAT_VDSO
1504 def_bool y 1533 def_bool y
1505 prompt "Compat VDSO support" 1534 prompt "Compat VDSO support"
1506 depends on X86_32 || IA32_EMULATION 1535 depends on X86_32 || IA32_EMULATION
1507 help 1536 ---help---
1508 Map the 32-bit VDSO to the predictable old-style address too. 1537 Map the 32-bit VDSO to the predictable old-style address too.
1509 ---help--- 1538 ---help---
1510 Say N here if you are running a sufficiently recent glibc 1539 Say N here if you are running a sufficiently recent glibc
@@ -1516,7 +1545,7 @@ config COMPAT_VDSO
1516config CMDLINE_BOOL 1545config CMDLINE_BOOL
1517 bool "Built-in kernel command line" 1546 bool "Built-in kernel command line"
1518 default n 1547 default n
1519 help 1548 ---help---
1520 Allow for specifying boot arguments to the kernel at 1549 Allow for specifying boot arguments to the kernel at
1521 build time. On some systems (e.g. embedded ones), it is 1550 build time. On some systems (e.g. embedded ones), it is
1522 necessary or convenient to provide some or all of the 1551 necessary or convenient to provide some or all of the
@@ -1534,7 +1563,7 @@ config CMDLINE
1534 string "Built-in kernel command string" 1563 string "Built-in kernel command string"
1535 depends on CMDLINE_BOOL 1564 depends on CMDLINE_BOOL
1536 default "" 1565 default ""
1537 help 1566 ---help---
1538 Enter arguments here that should be compiled into the kernel 1567 Enter arguments here that should be compiled into the kernel
1539 image and used at boot time. If the boot loader provides a 1568 image and used at boot time. If the boot loader provides a
1540 command line at boot time, it is appended to this string to 1569 command line at boot time, it is appended to this string to
@@ -1551,7 +1580,7 @@ config CMDLINE_OVERRIDE
1551 bool "Built-in command line overrides boot loader arguments" 1580 bool "Built-in command line overrides boot loader arguments"
1552 default n 1581 default n
1553 depends on CMDLINE_BOOL 1582 depends on CMDLINE_BOOL
1554 help 1583 ---help---
1555 Set this option to 'Y' to have the kernel ignore the boot loader 1584 Set this option to 'Y' to have the kernel ignore the boot loader
1556 command line, and use ONLY the built-in command line. 1585 command line, and use ONLY the built-in command line.
1557 1586
@@ -1573,7 +1602,6 @@ config HAVE_ARCH_EARLY_PFN_TO_NID
1573 depends on NUMA 1602 depends on NUMA
1574 1603
1575menu "Power management and ACPI options" 1604menu "Power management and ACPI options"
1576 depends on !X86_VOYAGER
1577 1605
1578config ARCH_HIBERNATION_HEADER 1606config ARCH_HIBERNATION_HEADER
1579 def_bool y 1607 def_bool y
@@ -1651,7 +1679,7 @@ if APM
1651 1679
1652config APM_IGNORE_USER_SUSPEND 1680config APM_IGNORE_USER_SUSPEND
1653 bool "Ignore USER SUSPEND" 1681 bool "Ignore USER SUSPEND"
1654 help 1682 ---help---
1655 This option will ignore USER SUSPEND requests. On machines with a 1683 This option will ignore USER SUSPEND requests. On machines with a
1656 compliant APM BIOS, you want to say N. However, on the NEC Versa M 1684 compliant APM BIOS, you want to say N. However, on the NEC Versa M
1657 series notebooks, it is necessary to say Y because of a BIOS bug. 1685 series notebooks, it is necessary to say Y because of a BIOS bug.
@@ -1675,7 +1703,7 @@ config APM_DO_ENABLE
1675 1703
1676config APM_CPU_IDLE 1704config APM_CPU_IDLE
1677 bool "Make CPU Idle calls when idle" 1705 bool "Make CPU Idle calls when idle"
1678 help 1706 ---help---
1679 Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop. 1707 Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop.
1680 On some machines, this can activate improved power savings, such as 1708 On some machines, this can activate improved power savings, such as
1681 a slowed CPU clock rate, when the machine is idle. These idle calls 1709 a slowed CPU clock rate, when the machine is idle. These idle calls
@@ -1686,7 +1714,7 @@ config APM_CPU_IDLE
1686 1714
1687config APM_DISPLAY_BLANK 1715config APM_DISPLAY_BLANK
1688 bool "Enable console blanking using APM" 1716 bool "Enable console blanking using APM"
1689 help 1717 ---help---
1690 Enable console blanking using the APM. Some laptops can use this to 1718 Enable console blanking using the APM. Some laptops can use this to
1691 turn off the LCD backlight when the screen blanker of the Linux 1719 turn off the LCD backlight when the screen blanker of the Linux
1692 virtual console blanks the screen. Note that this is only used by 1720 virtual console blanks the screen. Note that this is only used by
@@ -1699,7 +1727,7 @@ config APM_DISPLAY_BLANK
1699 1727
1700config APM_ALLOW_INTS 1728config APM_ALLOW_INTS
1701 bool "Allow interrupts during APM BIOS calls" 1729 bool "Allow interrupts during APM BIOS calls"
1702 help 1730 ---help---
1703 Normally we disable external interrupts while we are making calls to 1731 Normally we disable external interrupts while we are making calls to
1704 the APM BIOS as a measure to lessen the effects of a badly behaving 1732 the APM BIOS as a measure to lessen the effects of a badly behaving
1705 BIOS implementation. The BIOS should reenable interrupts if it 1733 BIOS implementation. The BIOS should reenable interrupts if it
@@ -1724,7 +1752,7 @@ config PCI
1724 bool "PCI support" 1752 bool "PCI support"
1725 default y 1753 default y
1726 select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC) 1754 select ARCH_SUPPORTS_MSI if (X86_LOCAL_APIC && X86_IO_APIC)
1727 help 1755 ---help---
1728 Find out whether you have a PCI motherboard. PCI is the name of a 1756 Find out whether you have a PCI motherboard. PCI is the name of a
1729 bus system, i.e. the way the CPU talks to the other stuff inside 1757 bus system, i.e. the way the CPU talks to the other stuff inside
1730 your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or 1758 your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
@@ -1795,7 +1823,7 @@ config PCI_MMCONFIG
1795config DMAR 1823config DMAR
1796 bool "Support for DMA Remapping Devices (EXPERIMENTAL)" 1824 bool "Support for DMA Remapping Devices (EXPERIMENTAL)"
1797 depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL 1825 depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL
1798 help 1826 ---help---
1799 DMA remapping (DMAR) devices support enables independent address 1827 DMA remapping (DMAR) devices support enables independent address
1800 translations for Direct Memory Access (DMA) from devices. 1828 translations for Direct Memory Access (DMA) from devices.
1801 These DMA remapping devices are reported via ACPI tables 1829 These DMA remapping devices are reported via ACPI tables
@@ -1817,29 +1845,30 @@ config DMAR_GFX_WA
1817 def_bool y 1845 def_bool y
1818 prompt "Support for Graphics workaround" 1846 prompt "Support for Graphics workaround"
1819 depends on DMAR 1847 depends on DMAR
1820 help 1848 ---help---
1821 Current Graphics drivers tend to use physical address 1849 Current Graphics drivers tend to use physical address
1822 for DMA and avoid using DMA APIs. Setting this config 1850 for DMA and avoid using DMA APIs. Setting this config
1823 option permits the IOMMU driver to set a unity map for 1851 option permits the IOMMU driver to set a unity map for
1824 all the OS-visible memory. Hence the driver can continue 1852 all the OS-visible memory. Hence the driver can continue
1825 to use physical addresses for DMA. 1853 to use physical addresses for DMA.
1826 1854
1827config DMAR_FLOPPY_WA 1855config DMAR_FLOPPY_WA
1828 def_bool y 1856 def_bool y
1829 depends on DMAR 1857 depends on DMAR
1830 help 1858 ---help---
1831 Floppy disk drivers are know to bypass DMA API calls 1859 Floppy disk drivers are know to bypass DMA API calls
1832 thereby failing to work when IOMMU is enabled. This 1860 thereby failing to work when IOMMU is enabled. This
1833 workaround will setup a 1:1 mapping for the first 1861 workaround will setup a 1:1 mapping for the first
1834 16M to make floppy (an ISA device) work. 1862 16M to make floppy (an ISA device) work.
1835 1863
1836config INTR_REMAP 1864config INTR_REMAP
1837 bool "Support for Interrupt Remapping (EXPERIMENTAL)" 1865 bool "Support for Interrupt Remapping (EXPERIMENTAL)"
1838 depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI && EXPERIMENTAL 1866 depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI && EXPERIMENTAL
1839 help 1867 select X86_X2APIC
1840 Supports Interrupt remapping for IO-APIC and MSI devices. 1868 ---help---
1841 To use x2apic mode in the CPU's which support x2APIC enhancements or 1869 Supports Interrupt remapping for IO-APIC and MSI devices.
1842 to support platforms with CPU's having > 8 bit APIC ID, say Y. 1870 To use x2apic mode in the CPU's which support x2APIC enhancements or
1871 to support platforms with CPU's having > 8 bit APIC ID, say Y.
1843 1872
1844source "drivers/pci/pcie/Kconfig" 1873source "drivers/pci/pcie/Kconfig"
1845 1874
@@ -1853,8 +1882,7 @@ if X86_32
1853 1882
1854config ISA 1883config ISA
1855 bool "ISA support" 1884 bool "ISA support"
1856 depends on !X86_VOYAGER 1885 ---help---
1857 help
1858 Find out whether you have ISA slots on your motherboard. ISA is the 1886 Find out whether you have ISA slots on your motherboard. ISA is the
1859 name of a bus system, i.e. the way the CPU talks to the other stuff 1887 name of a bus system, i.e. the way the CPU talks to the other stuff
1860 inside your box. Other bus systems are PCI, EISA, MicroChannel 1888 inside your box. Other bus systems are PCI, EISA, MicroChannel
@@ -1880,9 +1908,8 @@ config EISA
1880source "drivers/eisa/Kconfig" 1908source "drivers/eisa/Kconfig"
1881 1909
1882config MCA 1910config MCA
1883 bool "MCA support" if !X86_VOYAGER 1911 bool "MCA support"
1884 default y if X86_VOYAGER 1912 ---help---
1885 help
1886 MicroChannel Architecture is found in some IBM PS/2 machines and 1913 MicroChannel Architecture is found in some IBM PS/2 machines and
1887 laptops. It is a bus system similar to PCI or ISA. See 1914 laptops. It is a bus system similar to PCI or ISA. See
1888 <file:Documentation/mca.txt> (and especially the web page given 1915 <file:Documentation/mca.txt> (and especially the web page given
@@ -1892,8 +1919,7 @@ source "drivers/mca/Kconfig"
1892 1919
1893config SCx200 1920config SCx200
1894 tristate "NatSemi SCx200 support" 1921 tristate "NatSemi SCx200 support"
1895 depends on !X86_VOYAGER 1922 ---help---
1896 help
1897 This provides basic support for National Semiconductor's 1923 This provides basic support for National Semiconductor's
1898 (now AMD's) Geode processors. The driver probes for the 1924 (now AMD's) Geode processors. The driver probes for the
1899 PCI-IDs of several on-chip devices, so its a good dependency 1925 PCI-IDs of several on-chip devices, so its a good dependency
@@ -1905,7 +1931,7 @@ config SCx200HR_TIMER
1905 tristate "NatSemi SCx200 27MHz High-Resolution Timer Support" 1931 tristate "NatSemi SCx200 27MHz High-Resolution Timer Support"
1906 depends on SCx200 && GENERIC_TIME 1932 depends on SCx200 && GENERIC_TIME
1907 default y 1933 default y
1908 help 1934 ---help---
1909 This driver provides a clocksource built upon the on-chip 1935 This driver provides a clocksource built upon the on-chip
1910 27MHz high-resolution timer. Its also a workaround for 1936 27MHz high-resolution timer. Its also a workaround for
1911 NSC Geode SC-1100's buggy TSC, which loses time when the 1937 NSC Geode SC-1100's buggy TSC, which loses time when the
@@ -1916,7 +1942,7 @@ config GEODE_MFGPT_TIMER
1916 def_bool y 1942 def_bool y
1917 prompt "Geode Multi-Function General Purpose Timer (MFGPT) events" 1943 prompt "Geode Multi-Function General Purpose Timer (MFGPT) events"
1918 depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS 1944 depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS
1919 help 1945 ---help---
1920 This driver provides a clock event source based on the MFGPT 1946 This driver provides a clock event source based on the MFGPT
1921 timer(s) in the CS5535 and CS5536 companion chip for the geode. 1947 timer(s) in the CS5535 and CS5536 companion chip for the geode.
1922 MFGPTs have a better resolution and max interval than the 1948 MFGPTs have a better resolution and max interval than the
@@ -1925,7 +1951,7 @@ config GEODE_MFGPT_TIMER
1925config OLPC 1951config OLPC
1926 bool "One Laptop Per Child support" 1952 bool "One Laptop Per Child support"
1927 default n 1953 default n
1928 help 1954 ---help---
1929 Add support for detecting the unique features of the OLPC 1955 Add support for detecting the unique features of the OLPC
1930 XO hardware. 1956 XO hardware.
1931 1957
@@ -1950,16 +1976,16 @@ config IA32_EMULATION
1950 bool "IA32 Emulation" 1976 bool "IA32 Emulation"
1951 depends on X86_64 1977 depends on X86_64
1952 select COMPAT_BINFMT_ELF 1978 select COMPAT_BINFMT_ELF
1953 help 1979 ---help---
1954 Include code to run 32-bit programs under a 64-bit kernel. You should 1980 Include code to run 32-bit programs under a 64-bit kernel. You should
1955 likely turn this on, unless you're 100% sure that you don't have any 1981 likely turn this on, unless you're 100% sure that you don't have any
1956 32-bit programs left. 1982 32-bit programs left.
1957 1983
1958config IA32_AOUT 1984config IA32_AOUT
1959 tristate "IA32 a.out support" 1985 tristate "IA32 a.out support"
1960 depends on IA32_EMULATION 1986 depends on IA32_EMULATION
1961 help 1987 ---help---
1962 Support old a.out binaries in the 32bit emulation. 1988 Support old a.out binaries in the 32bit emulation.
1963 1989
1964config COMPAT 1990config COMPAT
1965 def_bool y 1991 def_bool y
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index c98d52e82966..a95eaf0e582a 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -50,7 +50,7 @@ config M386
50config M486 50config M486
51 bool "486" 51 bool "486"
52 depends on X86_32 52 depends on X86_32
53 help 53 ---help---
54 Select this for a 486 series processor, either Intel or one of the 54 Select this for a 486 series processor, either Intel or one of the
55 compatible processors from AMD, Cyrix, IBM, or Intel. Includes DX, 55 compatible processors from AMD, Cyrix, IBM, or Intel. Includes DX,
56 DX2, and DX4 variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or 56 DX2, and DX4 variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or
@@ -59,7 +59,7 @@ config M486
59config M586 59config M586
60 bool "586/K5/5x86/6x86/6x86MX" 60 bool "586/K5/5x86/6x86/6x86MX"
61 depends on X86_32 61 depends on X86_32
62 help 62 ---help---
63 Select this for an 586 or 686 series processor such as the AMD K5, 63 Select this for an 586 or 686 series processor such as the AMD K5,
64 the Cyrix 5x86, 6x86 and 6x86MX. This choice does not 64 the Cyrix 5x86, 6x86 and 6x86MX. This choice does not
65 assume the RDTSC (Read Time Stamp Counter) instruction. 65 assume the RDTSC (Read Time Stamp Counter) instruction.
@@ -67,21 +67,21 @@ config M586
67config M586TSC 67config M586TSC
68 bool "Pentium-Classic" 68 bool "Pentium-Classic"
69 depends on X86_32 69 depends on X86_32
70 help 70 ---help---
71 Select this for a Pentium Classic processor with the RDTSC (Read 71 Select this for a Pentium Classic processor with the RDTSC (Read
72 Time Stamp Counter) instruction for benchmarking. 72 Time Stamp Counter) instruction for benchmarking.
73 73
74config M586MMX 74config M586MMX
75 bool "Pentium-MMX" 75 bool "Pentium-MMX"
76 depends on X86_32 76 depends on X86_32
77 help 77 ---help---
78 Select this for a Pentium with the MMX graphics/multimedia 78 Select this for a Pentium with the MMX graphics/multimedia
79 extended instructions. 79 extended instructions.
80 80
81config M686 81config M686
82 bool "Pentium-Pro" 82 bool "Pentium-Pro"
83 depends on X86_32 83 depends on X86_32
84 help 84 ---help---
85 Select this for Intel Pentium Pro chips. This enables the use of 85 Select this for Intel Pentium Pro chips. This enables the use of
86 Pentium Pro extended instructions, and disables the init-time guard 86 Pentium Pro extended instructions, and disables the init-time guard
87 against the f00f bug found in earlier Pentiums. 87 against the f00f bug found in earlier Pentiums.
@@ -89,7 +89,7 @@ config M686
89config MPENTIUMII 89config MPENTIUMII
90 bool "Pentium-II/Celeron(pre-Coppermine)" 90 bool "Pentium-II/Celeron(pre-Coppermine)"
91 depends on X86_32 91 depends on X86_32
92 help 92 ---help---
93 Select this for Intel chips based on the Pentium-II and 93 Select this for Intel chips based on the Pentium-II and
94 pre-Coppermine Celeron core. This option enables an unaligned 94 pre-Coppermine Celeron core. This option enables an unaligned
95 copy optimization, compiles the kernel with optimization flags 95 copy optimization, compiles the kernel with optimization flags
@@ -99,7 +99,7 @@ config MPENTIUMII
99config MPENTIUMIII 99config MPENTIUMIII
100 bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon" 100 bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
101 depends on X86_32 101 depends on X86_32
102 help 102 ---help---
103 Select this for Intel chips based on the Pentium-III and 103 Select this for Intel chips based on the Pentium-III and
104 Celeron-Coppermine core. This option enables use of some 104 Celeron-Coppermine core. This option enables use of some
105 extended prefetch instructions in addition to the Pentium II 105 extended prefetch instructions in addition to the Pentium II
@@ -108,14 +108,14 @@ config MPENTIUMIII
108config MPENTIUMM 108config MPENTIUMM
109 bool "Pentium M" 109 bool "Pentium M"
110 depends on X86_32 110 depends on X86_32
111 help 111 ---help---
112 Select this for Intel Pentium M (not Pentium-4 M) 112 Select this for Intel Pentium M (not Pentium-4 M)
113 notebook chips. 113 notebook chips.
114 114
115config MPENTIUM4 115config MPENTIUM4
116 bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon" 116 bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon"
117 depends on X86_32 117 depends on X86_32
118 help 118 ---help---
119 Select this for Intel Pentium 4 chips. This includes the 119 Select this for Intel Pentium 4 chips. This includes the
120 Pentium 4, Pentium D, P4-based Celeron and Xeon, and 120 Pentium 4, Pentium D, P4-based Celeron and Xeon, and
121 Pentium-4 M (not Pentium M) chips. This option enables compile 121 Pentium-4 M (not Pentium M) chips. This option enables compile
@@ -151,7 +151,7 @@ config MPENTIUM4
151config MK6 151config MK6
152 bool "K6/K6-II/K6-III" 152 bool "K6/K6-II/K6-III"
153 depends on X86_32 153 depends on X86_32
154 help 154 ---help---
155 Select this for an AMD K6-family processor. Enables use of 155 Select this for an AMD K6-family processor. Enables use of
156 some extended instructions, and passes appropriate optimization 156 some extended instructions, and passes appropriate optimization
157 flags to GCC. 157 flags to GCC.
@@ -159,14 +159,14 @@ config MK6
159config MK7 159config MK7
160 bool "Athlon/Duron/K7" 160 bool "Athlon/Duron/K7"
161 depends on X86_32 161 depends on X86_32
162 help 162 ---help---
163 Select this for an AMD Athlon K7-family processor. Enables use of 163 Select this for an AMD Athlon K7-family processor. Enables use of
164 some extended instructions, and passes appropriate optimization 164 some extended instructions, and passes appropriate optimization
165 flags to GCC. 165 flags to GCC.
166 166
167config MK8 167config MK8
168 bool "Opteron/Athlon64/Hammer/K8" 168 bool "Opteron/Athlon64/Hammer/K8"
169 help 169 ---help---
170 Select this for an AMD Opteron or Athlon64 Hammer-family processor. 170 Select this for an AMD Opteron or Athlon64 Hammer-family processor.
171 Enables use of some extended instructions, and passes appropriate 171 Enables use of some extended instructions, and passes appropriate
172 optimization flags to GCC. 172 optimization flags to GCC.
@@ -174,7 +174,7 @@ config MK8
174config MCRUSOE 174config MCRUSOE
175 bool "Crusoe" 175 bool "Crusoe"
176 depends on X86_32 176 depends on X86_32
177 help 177 ---help---
178 Select this for a Transmeta Crusoe processor. Treats the processor 178 Select this for a Transmeta Crusoe processor. Treats the processor
179 like a 586 with TSC, and sets some GCC optimization flags (like a 179 like a 586 with TSC, and sets some GCC optimization flags (like a
180 Pentium Pro with no alignment requirements). 180 Pentium Pro with no alignment requirements).
@@ -182,13 +182,13 @@ config MCRUSOE
182config MEFFICEON 182config MEFFICEON
183 bool "Efficeon" 183 bool "Efficeon"
184 depends on X86_32 184 depends on X86_32
185 help 185 ---help---
186 Select this for a Transmeta Efficeon processor. 186 Select this for a Transmeta Efficeon processor.
187 187
188config MWINCHIPC6 188config MWINCHIPC6
189 bool "Winchip-C6" 189 bool "Winchip-C6"
190 depends on X86_32 190 depends on X86_32
191 help 191 ---help---
192 Select this for an IDT Winchip C6 chip. Linux and GCC 192 Select this for an IDT Winchip C6 chip. Linux and GCC
193 treat this chip as a 586TSC with some extended instructions 193 treat this chip as a 586TSC with some extended instructions
194 and alignment requirements. 194 and alignment requirements.
@@ -196,7 +196,7 @@ config MWINCHIPC6
196config MWINCHIP3D 196config MWINCHIP3D
197 bool "Winchip-2/Winchip-2A/Winchip-3" 197 bool "Winchip-2/Winchip-2A/Winchip-3"
198 depends on X86_32 198 depends on X86_32
199 help 199 ---help---
200 Select this for an IDT Winchip-2, 2A or 3. Linux and GCC 200 Select this for an IDT Winchip-2, 2A or 3. Linux and GCC
201 treat this chip as a 586TSC with some extended instructions 201 treat this chip as a 586TSC with some extended instructions
202 and alignment requirements. Also enable out of order memory 202 and alignment requirements. Also enable out of order memory
@@ -206,19 +206,19 @@ config MWINCHIP3D
206config MGEODEGX1 206config MGEODEGX1
207 bool "GeodeGX1" 207 bool "GeodeGX1"
208 depends on X86_32 208 depends on X86_32
209 help 209 ---help---
210 Select this for a Geode GX1 (Cyrix MediaGX) chip. 210 Select this for a Geode GX1 (Cyrix MediaGX) chip.
211 211
212config MGEODE_LX 212config MGEODE_LX
213 bool "Geode GX/LX" 213 bool "Geode GX/LX"
214 depends on X86_32 214 depends on X86_32
215 help 215 ---help---
216 Select this for AMD Geode GX and LX processors. 216 Select this for AMD Geode GX and LX processors.
217 217
218config MCYRIXIII 218config MCYRIXIII
219 bool "CyrixIII/VIA-C3" 219 bool "CyrixIII/VIA-C3"
220 depends on X86_32 220 depends on X86_32
221 help 221 ---help---
222 Select this for a Cyrix III or C3 chip. Presently Linux and GCC 222 Select this for a Cyrix III or C3 chip. Presently Linux and GCC
223 treat this chip as a generic 586. Whilst the CPU is 686 class, 223 treat this chip as a generic 586. Whilst the CPU is 686 class,
224 it lacks the cmov extension which gcc assumes is present when 224 it lacks the cmov extension which gcc assumes is present when
@@ -230,7 +230,7 @@ config MCYRIXIII
230config MVIAC3_2 230config MVIAC3_2
231 bool "VIA C3-2 (Nehemiah)" 231 bool "VIA C3-2 (Nehemiah)"
232 depends on X86_32 232 depends on X86_32
233 help 233 ---help---
234 Select this for a VIA C3 "Nehemiah". Selecting this enables usage 234 Select this for a VIA C3 "Nehemiah". Selecting this enables usage
235 of SSE and tells gcc to treat the CPU as a 686. 235 of SSE and tells gcc to treat the CPU as a 686.
236 Note, this kernel will not boot on older (pre model 9) C3s. 236 Note, this kernel will not boot on older (pre model 9) C3s.
@@ -238,14 +238,14 @@ config MVIAC3_2
238config MVIAC7 238config MVIAC7
239 bool "VIA C7" 239 bool "VIA C7"
240 depends on X86_32 240 depends on X86_32
241 help 241 ---help---
242 Select this for a VIA C7. Selecting this uses the correct cache 242 Select this for a VIA C7. Selecting this uses the correct cache
243 shift and tells gcc to treat the CPU as a 686. 243 shift and tells gcc to treat the CPU as a 686.
244 244
245config MPSC 245config MPSC
246 bool "Intel P4 / older Netburst based Xeon" 246 bool "Intel P4 / older Netburst based Xeon"
247 depends on X86_64 247 depends on X86_64
248 help 248 ---help---
249 Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey 249 Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey
250 Xeon CPUs with Intel 64bit which is compatible with x86-64. 250 Xeon CPUs with Intel 64bit which is compatible with x86-64.
251 Note that the latest Xeons (Xeon 51xx and 53xx) are not based on the 251 Note that the latest Xeons (Xeon 51xx and 53xx) are not based on the
@@ -255,7 +255,7 @@ config MPSC
255 255
256config MCORE2 256config MCORE2
257 bool "Core 2/newer Xeon" 257 bool "Core 2/newer Xeon"
258 help 258 ---help---
259 259
260 Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 260 Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
261 53xx) CPUs. You can distinguish newer from older Xeons by the CPU 261 53xx) CPUs. You can distinguish newer from older Xeons by the CPU
@@ -265,7 +265,7 @@ config MCORE2
265config GENERIC_CPU 265config GENERIC_CPU
266 bool "Generic-x86-64" 266 bool "Generic-x86-64"
267 depends on X86_64 267 depends on X86_64
268 help 268 ---help---
269 Generic x86-64 CPU. 269 Generic x86-64 CPU.
270 Run equally well on all x86-64 CPUs. 270 Run equally well on all x86-64 CPUs.
271 271
@@ -274,7 +274,7 @@ endchoice
274config X86_GENERIC 274config X86_GENERIC
275 bool "Generic x86 support" 275 bool "Generic x86 support"
276 depends on X86_32 276 depends on X86_32
277 help 277 ---help---
278 Instead of just including optimizations for the selected 278 Instead of just including optimizations for the selected
279 x86 variant (e.g. PII, Crusoe or Athlon), include some more 279 x86 variant (e.g. PII, Crusoe or Athlon), include some more
280 generic optimizations as well. This will make the kernel 280 generic optimizations as well. This will make the kernel
@@ -294,25 +294,23 @@ config X86_CPU
294# Define implied options from the CPU selection here 294# Define implied options from the CPU selection here
295config X86_L1_CACHE_BYTES 295config X86_L1_CACHE_BYTES
296 int 296 int
297 default "128" if GENERIC_CPU || MPSC 297 default "128" if MPSC
298 default "64" if MK8 || MCORE2 298 default "64" if GENERIC_CPU || MK8 || MCORE2 || X86_32
299 depends on X86_64
300 299
301config X86_INTERNODE_CACHE_BYTES 300config X86_INTERNODE_CACHE_BYTES
302 int 301 int
303 default "4096" if X86_VSMP 302 default "4096" if X86_VSMP
304 default X86_L1_CACHE_BYTES if !X86_VSMP 303 default X86_L1_CACHE_BYTES if !X86_VSMP
305 depends on X86_64
306 304
307config X86_CMPXCHG 305config X86_CMPXCHG
308 def_bool X86_64 || (X86_32 && !M386) 306 def_bool X86_64 || (X86_32 && !M386)
309 307
310config X86_L1_CACHE_SHIFT 308config X86_L1_CACHE_SHIFT
311 int 309 int
312 default "7" if MPENTIUM4 || X86_GENERIC || GENERIC_CPU || MPSC 310 default "7" if MPENTIUM4 || MPSC
313 default "4" if X86_ELAN || M486 || M386 || MGEODEGX1 311 default "4" if X86_ELAN || M486 || M386 || MGEODEGX1
314 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX 312 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
315 default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MVIAC7 313 default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MVIAC7 || X86_GENERIC || GENERIC_CPU
316 314
317config X86_XADD 315config X86_XADD
318 def_bool y 316 def_bool y
@@ -321,7 +319,7 @@ config X86_XADD
321config X86_PPRO_FENCE 319config X86_PPRO_FENCE
322 bool "PentiumPro memory ordering errata workaround" 320 bool "PentiumPro memory ordering errata workaround"
323 depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1 321 depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1
324 help 322 ---help---
325 Old PentiumPro multiprocessor systems had errata that could cause 323 Old PentiumPro multiprocessor systems had errata that could cause
326 memory operations to violate the x86 ordering standard in rare cases. 324 memory operations to violate the x86 ordering standard in rare cases.
327 Enabling this option will attempt to work around some (but not all) 325 Enabling this option will attempt to work around some (but not all)
@@ -414,14 +412,14 @@ config X86_DEBUGCTLMSR
414 412
415menuconfig PROCESSOR_SELECT 413menuconfig PROCESSOR_SELECT
416 bool "Supported processor vendors" if EMBEDDED 414 bool "Supported processor vendors" if EMBEDDED
417 help 415 ---help---
418 This lets you choose what x86 vendor support code your kernel 416 This lets you choose what x86 vendor support code your kernel
419 will include. 417 will include.
420 418
421config CPU_SUP_INTEL 419config CPU_SUP_INTEL
422 default y 420 default y
423 bool "Support Intel processors" if PROCESSOR_SELECT 421 bool "Support Intel processors" if PROCESSOR_SELECT
424 help 422 ---help---
425 This enables detection, tunings and quirks for Intel processors 423 This enables detection, tunings and quirks for Intel processors
426 424
427 You need this enabled if you want your kernel to run on an 425 You need this enabled if you want your kernel to run on an
@@ -435,7 +433,7 @@ config CPU_SUP_CYRIX_32
435 default y 433 default y
436 bool "Support Cyrix processors" if PROCESSOR_SELECT 434 bool "Support Cyrix processors" if PROCESSOR_SELECT
437 depends on !64BIT 435 depends on !64BIT
438 help 436 ---help---
439 This enables detection, tunings and quirks for Cyrix processors 437 This enables detection, tunings and quirks for Cyrix processors
440 438
441 You need this enabled if you want your kernel to run on a 439 You need this enabled if you want your kernel to run on a
@@ -448,7 +446,7 @@ config CPU_SUP_CYRIX_32
448config CPU_SUP_AMD 446config CPU_SUP_AMD
449 default y 447 default y
450 bool "Support AMD processors" if PROCESSOR_SELECT 448 bool "Support AMD processors" if PROCESSOR_SELECT
451 help 449 ---help---
452 This enables detection, tunings and quirks for AMD processors 450 This enables detection, tunings and quirks for AMD processors
453 451
454 You need this enabled if you want your kernel to run on an 452 You need this enabled if you want your kernel to run on an
@@ -462,7 +460,7 @@ config CPU_SUP_CENTAUR_32
462 default y 460 default y
463 bool "Support Centaur processors" if PROCESSOR_SELECT 461 bool "Support Centaur processors" if PROCESSOR_SELECT
464 depends on !64BIT 462 depends on !64BIT
465 help 463 ---help---
466 This enables detection, tunings and quirks for Centaur processors 464 This enables detection, tunings and quirks for Centaur processors
467 465
468 You need this enabled if you want your kernel to run on a 466 You need this enabled if you want your kernel to run on a
@@ -476,7 +474,7 @@ config CPU_SUP_CENTAUR_64
476 default y 474 default y
477 bool "Support Centaur processors" if PROCESSOR_SELECT 475 bool "Support Centaur processors" if PROCESSOR_SELECT
478 depends on 64BIT 476 depends on 64BIT
479 help 477 ---help---
480 This enables detection, tunings and quirks for Centaur processors 478 This enables detection, tunings and quirks for Centaur processors
481 479
482 You need this enabled if you want your kernel to run on a 480 You need this enabled if you want your kernel to run on a
@@ -490,7 +488,7 @@ config CPU_SUP_TRANSMETA_32
490 default y 488 default y
491 bool "Support Transmeta processors" if PROCESSOR_SELECT 489 bool "Support Transmeta processors" if PROCESSOR_SELECT
492 depends on !64BIT 490 depends on !64BIT
493 help 491 ---help---
494 This enables detection, tunings and quirks for Transmeta processors 492 This enables detection, tunings and quirks for Transmeta processors
495 493
496 You need this enabled if you want your kernel to run on a 494 You need this enabled if you want your kernel to run on a
@@ -504,7 +502,7 @@ config CPU_SUP_UMC_32
504 default y 502 default y
505 bool "Support UMC processors" if PROCESSOR_SELECT 503 bool "Support UMC processors" if PROCESSOR_SELECT
506 depends on !64BIT 504 depends on !64BIT
507 help 505 ---help---
508 This enables detection, tunings and quirks for UMC processors 506 This enables detection, tunings and quirks for UMC processors
509 507
510 You need this enabled if you want your kernel to run on a 508 You need this enabled if you want your kernel to run on a
@@ -523,7 +521,7 @@ config X86_PTRACE_BTS
523 bool "Branch Trace Store" 521 bool "Branch Trace Store"
524 default y 522 default y
525 depends on X86_DEBUGCTLMSR 523 depends on X86_DEBUGCTLMSR
526 help 524 ---help---
527 This adds a ptrace interface to the hardware's branch trace store. 525 This adds a ptrace interface to the hardware's branch trace store.
528 526
529 Debuggers may use it to collect an execution trace of the debugged 527 Debuggers may use it to collect an execution trace of the debugged
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index e1983fa025d2..fdb45df608b6 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -7,7 +7,7 @@ source "lib/Kconfig.debug"
7 7
8config STRICT_DEVMEM 8config STRICT_DEVMEM
9 bool "Filter access to /dev/mem" 9 bool "Filter access to /dev/mem"
10 help 10 ---help---
11 If this option is disabled, you allow userspace (root) access to all 11 If this option is disabled, you allow userspace (root) access to all
12 of memory, including kernel and userspace memory. Accidental 12 of memory, including kernel and userspace memory. Accidental
13 access to this is obviously disastrous, but specific access can 13 access to this is obviously disastrous, but specific access can
@@ -25,7 +25,7 @@ config STRICT_DEVMEM
25config X86_VERBOSE_BOOTUP 25config X86_VERBOSE_BOOTUP
26 bool "Enable verbose x86 bootup info messages" 26 bool "Enable verbose x86 bootup info messages"
27 default y 27 default y
28 help 28 ---help---
29 Enables the informational output from the decompression stage 29 Enables the informational output from the decompression stage
30 (e.g. bzImage) of the boot. If you disable this you will still 30 (e.g. bzImage) of the boot. If you disable this you will still
31 see errors. Disable this if you want silent bootup. 31 see errors. Disable this if you want silent bootup.
@@ -33,7 +33,7 @@ config X86_VERBOSE_BOOTUP
33config EARLY_PRINTK 33config EARLY_PRINTK
34 bool "Early printk" if EMBEDDED 34 bool "Early printk" if EMBEDDED
35 default y 35 default y
36 help 36 ---help---
37 Write kernel log output directly into the VGA buffer or to a serial 37 Write kernel log output directly into the VGA buffer or to a serial
38 port. 38 port.
39 39
@@ -47,7 +47,7 @@ config EARLY_PRINTK_DBGP
47 bool "Early printk via EHCI debug port" 47 bool "Early printk via EHCI debug port"
48 default n 48 default n
49 depends on EARLY_PRINTK && PCI 49 depends on EARLY_PRINTK && PCI
50 help 50 ---help---
51 Write kernel log output directly into the EHCI debug port. 51 Write kernel log output directly into the EHCI debug port.
52 52
53 This is useful for kernel debugging when your machine crashes very 53 This is useful for kernel debugging when your machine crashes very
@@ -59,14 +59,14 @@ config EARLY_PRINTK_DBGP
59config DEBUG_STACKOVERFLOW 59config DEBUG_STACKOVERFLOW
60 bool "Check for stack overflows" 60 bool "Check for stack overflows"
61 depends on DEBUG_KERNEL 61 depends on DEBUG_KERNEL
62 help 62 ---help---
63 This option will cause messages to be printed if free stack space 63 This option will cause messages to be printed if free stack space
64 drops below a certain limit. 64 drops below a certain limit.
65 65
66config DEBUG_STACK_USAGE 66config DEBUG_STACK_USAGE
67 bool "Stack utilization instrumentation" 67 bool "Stack utilization instrumentation"
68 depends on DEBUG_KERNEL 68 depends on DEBUG_KERNEL
69 help 69 ---help---
70 Enables the display of the minimum amount of free stack which each 70 Enables the display of the minimum amount of free stack which each
71 task has ever had available in the sysrq-T and sysrq-P debug output. 71 task has ever had available in the sysrq-T and sysrq-P debug output.
72 72
@@ -75,7 +75,7 @@ config DEBUG_STACK_USAGE
75config DEBUG_PAGEALLOC 75config DEBUG_PAGEALLOC
76 bool "Debug page memory allocations" 76 bool "Debug page memory allocations"
77 depends on DEBUG_KERNEL 77 depends on DEBUG_KERNEL
78 help 78 ---help---
79 Unmap pages from the kernel linear mapping after free_pages(). 79 Unmap pages from the kernel linear mapping after free_pages().
80 This results in a large slowdown, but helps to find certain types 80 This results in a large slowdown, but helps to find certain types
81 of memory corruptions. 81 of memory corruptions.
@@ -83,9 +83,9 @@ config DEBUG_PAGEALLOC
83config DEBUG_PER_CPU_MAPS 83config DEBUG_PER_CPU_MAPS
84 bool "Debug access to per_cpu maps" 84 bool "Debug access to per_cpu maps"
85 depends on DEBUG_KERNEL 85 depends on DEBUG_KERNEL
86 depends on X86_SMP 86 depends on SMP
87 default n 87 default n
88 help 88 ---help---
89 Say Y to verify that the per_cpu map being accessed has 89 Say Y to verify that the per_cpu map being accessed has
90 been setup. Adds a fair amount of code to kernel memory 90 been setup. Adds a fair amount of code to kernel memory
91 and decreases performance. 91 and decreases performance.
@@ -96,7 +96,7 @@ config X86_PTDUMP
96 bool "Export kernel pagetable layout to userspace via debugfs" 96 bool "Export kernel pagetable layout to userspace via debugfs"
97 depends on DEBUG_KERNEL 97 depends on DEBUG_KERNEL
98 select DEBUG_FS 98 select DEBUG_FS
99 help 99 ---help---
100 Say Y here if you want to show the kernel pagetable layout in a 100 Say Y here if you want to show the kernel pagetable layout in a
101 debugfs file. This information is only useful for kernel developers 101 debugfs file. This information is only useful for kernel developers
102 who are working in architecture specific areas of the kernel. 102 who are working in architecture specific areas of the kernel.
@@ -108,7 +108,7 @@ config DEBUG_RODATA
108 bool "Write protect kernel read-only data structures" 108 bool "Write protect kernel read-only data structures"
109 default y 109 default y
110 depends on DEBUG_KERNEL 110 depends on DEBUG_KERNEL
111 help 111 ---help---
112 Mark the kernel read-only data as write-protected in the pagetables, 112 Mark the kernel read-only data as write-protected in the pagetables,
113 in order to catch accidental (and incorrect) writes to such const 113 in order to catch accidental (and incorrect) writes to such const
114 data. This is recommended so that we can catch kernel bugs sooner. 114 data. This is recommended so that we can catch kernel bugs sooner.
@@ -117,7 +117,8 @@ config DEBUG_RODATA
117config DEBUG_RODATA_TEST 117config DEBUG_RODATA_TEST
118 bool "Testcase for the DEBUG_RODATA feature" 118 bool "Testcase for the DEBUG_RODATA feature"
119 depends on DEBUG_RODATA 119 depends on DEBUG_RODATA
120 help 120 default y
121 ---help---
121 This option enables a testcase for the DEBUG_RODATA 122 This option enables a testcase for the DEBUG_RODATA
122 feature as well as for the change_page_attr() infrastructure. 123 feature as well as for the change_page_attr() infrastructure.
123 If in doubt, say "N" 124 If in doubt, say "N"
@@ -125,7 +126,7 @@ config DEBUG_RODATA_TEST
125config DEBUG_NX_TEST 126config DEBUG_NX_TEST
126 tristate "Testcase for the NX non-executable stack feature" 127 tristate "Testcase for the NX non-executable stack feature"
127 depends on DEBUG_KERNEL && m 128 depends on DEBUG_KERNEL && m
128 help 129 ---help---
129 This option enables a testcase for the CPU NX capability 130 This option enables a testcase for the CPU NX capability
130 and the software setup of this feature. 131 and the software setup of this feature.
131 If in doubt, say "N" 132 If in doubt, say "N"
@@ -133,7 +134,7 @@ config DEBUG_NX_TEST
133config 4KSTACKS 134config 4KSTACKS
134 bool "Use 4Kb for kernel stacks instead of 8Kb" 135 bool "Use 4Kb for kernel stacks instead of 8Kb"
135 depends on X86_32 136 depends on X86_32
136 help 137 ---help---
137 If you say Y here the kernel will use a 4Kb stacksize for the 138 If you say Y here the kernel will use a 4Kb stacksize for the
138 kernel stack attached to each process/thread. This facilitates 139 kernel stack attached to each process/thread. This facilitates
139 running more threads on a system and also reduces the pressure 140 running more threads on a system and also reduces the pressure
@@ -144,7 +145,7 @@ config DOUBLEFAULT
144 default y 145 default y
145 bool "Enable doublefault exception handler" if EMBEDDED 146 bool "Enable doublefault exception handler" if EMBEDDED
146 depends on X86_32 147 depends on X86_32
147 help 148 ---help---
148 This option allows trapping of rare doublefault exceptions that 149 This option allows trapping of rare doublefault exceptions that
149 would otherwise cause a system to silently reboot. Disabling this 150 would otherwise cause a system to silently reboot. Disabling this
150 option saves about 4k and might cause you much additional grey 151 option saves about 4k and might cause you much additional grey
@@ -154,7 +155,7 @@ config IOMMU_DEBUG
154 bool "Enable IOMMU debugging" 155 bool "Enable IOMMU debugging"
155 depends on GART_IOMMU && DEBUG_KERNEL 156 depends on GART_IOMMU && DEBUG_KERNEL
156 depends on X86_64 157 depends on X86_64
157 help 158 ---help---
158 Force the IOMMU to on even when you have less than 4GB of 159 Force the IOMMU to on even when you have less than 4GB of
159 memory and add debugging code. On overflow always panic. And 160 memory and add debugging code. On overflow always panic. And
160 allow to enable IOMMU leak tracing. Can be disabled at boot 161 allow to enable IOMMU leak tracing. Can be disabled at boot
@@ -170,7 +171,7 @@ config IOMMU_LEAK
170 bool "IOMMU leak tracing" 171 bool "IOMMU leak tracing"
171 depends on DEBUG_KERNEL 172 depends on DEBUG_KERNEL
172 depends on IOMMU_DEBUG 173 depends on IOMMU_DEBUG
173 help 174 ---help---
174 Add a simple leak tracer to the IOMMU code. This is useful when you 175 Add a simple leak tracer to the IOMMU code. This is useful when you
175 are debugging a buggy device driver that leaks IOMMU mappings. 176 are debugging a buggy device driver that leaks IOMMU mappings.
176 177
@@ -203,25 +204,25 @@ choice
203 204
204config IO_DELAY_0X80 205config IO_DELAY_0X80
205 bool "port 0x80 based port-IO delay [recommended]" 206 bool "port 0x80 based port-IO delay [recommended]"
206 help 207 ---help---
207 This is the traditional Linux IO delay used for in/out_p. 208 This is the traditional Linux IO delay used for in/out_p.
208 It is the most tested hence safest selection here. 209 It is the most tested hence safest selection here.
209 210
210config IO_DELAY_0XED 211config IO_DELAY_0XED
211 bool "port 0xed based port-IO delay" 212 bool "port 0xed based port-IO delay"
212 help 213 ---help---
213 Use port 0xed as the IO delay. This frees up port 0x80 which is 214 Use port 0xed as the IO delay. This frees up port 0x80 which is
214 often used as a hardware-debug port. 215 often used as a hardware-debug port.
215 216
216config IO_DELAY_UDELAY 217config IO_DELAY_UDELAY
217 bool "udelay based port-IO delay" 218 bool "udelay based port-IO delay"
218 help 219 ---help---
219 Use udelay(2) as the IO delay method. This provides the delay 220 Use udelay(2) as the IO delay method. This provides the delay
220 while not having any side-effect on the IO port space. 221 while not having any side-effect on the IO port space.
221 222
222config IO_DELAY_NONE 223config IO_DELAY_NONE
223 bool "no port-IO delay" 224 bool "no port-IO delay"
224 help 225 ---help---
225 No port-IO delay. Will break on old boxes that require port-IO 226 No port-IO delay. Will break on old boxes that require port-IO
226 delay for certain operations. Should work on most new machines. 227 delay for certain operations. Should work on most new machines.
227 228
@@ -255,18 +256,18 @@ config DEBUG_BOOT_PARAMS
255 bool "Debug boot parameters" 256 bool "Debug boot parameters"
256 depends on DEBUG_KERNEL 257 depends on DEBUG_KERNEL
257 depends on DEBUG_FS 258 depends on DEBUG_FS
258 help 259 ---help---
259 This option will cause struct boot_params to be exported via debugfs. 260 This option will cause struct boot_params to be exported via debugfs.
260 261
261config CPA_DEBUG 262config CPA_DEBUG
262 bool "CPA self-test code" 263 bool "CPA self-test code"
263 depends on DEBUG_KERNEL 264 depends on DEBUG_KERNEL
264 help 265 ---help---
265 Do change_page_attr() self-tests every 30 seconds. 266 Do change_page_attr() self-tests every 30 seconds.
266 267
267config OPTIMIZE_INLINING 268config OPTIMIZE_INLINING
268 bool "Allow gcc to uninline functions marked 'inline'" 269 bool "Allow gcc to uninline functions marked 'inline'"
269 help 270 ---help---
270 This option determines if the kernel forces gcc to inline the functions 271 This option determines if the kernel forces gcc to inline the functions
271 developers have marked 'inline'. Doing so takes away freedom from gcc to 272 developers have marked 'inline'. Doing so takes away freedom from gcc to
272 do what it thinks is best, which is desirable for the gcc 3.x series of 273 do what it thinks is best, which is desirable for the gcc 3.x series of
@@ -279,4 +280,3 @@ config OPTIMIZE_INLINING
279 If unsure, say N. 280 If unsure, say N.
280 281
281endmenu 282endmenu
282
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index d1a47adb5aec..1836191839ee 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -70,14 +70,17 @@ else
70 # this works around some issues with generating unwind tables in older gccs 70 # this works around some issues with generating unwind tables in older gccs
71 # newer gccs do it by default 71 # newer gccs do it by default
72 KBUILD_CFLAGS += -maccumulate-outgoing-args 72 KBUILD_CFLAGS += -maccumulate-outgoing-args
73endif
73 74
74 stackp := $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh 75ifdef CONFIG_CC_STACKPROTECTOR
75 stackp-$(CONFIG_CC_STACKPROTECTOR) := $(shell $(stackp) \ 76 cc_has_sp := $(srctree)/scripts/gcc-x86_$(BITS)-has-stack-protector.sh
76 "$(CC)" -fstack-protector ) 77 ifeq ($(shell $(CONFIG_SHELL) $(cc_has_sp) $(CC)),y)
77 stackp-$(CONFIG_CC_STACKPROTECTOR_ALL) += $(shell $(stackp) \ 78 stackp-y := -fstack-protector
78 "$(CC)" -fstack-protector-all ) 79 stackp-$(CONFIG_CC_STACKPROTECTOR_ALL) += -fstack-protector-all
79 80 KBUILD_CFLAGS += $(stackp-y)
80 KBUILD_CFLAGS += $(stackp-y) 81 else
82 $(warning stack protector enabled but no compiler support)
83 endif
81endif 84endif
82 85
83# Stackpointer is addressed different for 32 bit and 64 bit x86 86# Stackpointer is addressed different for 32 bit and 64 bit x86
@@ -102,29 +105,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
102# prevent gcc from generating any FP code by mistake 105# prevent gcc from generating any FP code by mistake
103KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) 106KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
104 107
105###
106# Sub architecture support
107# fcore-y is linked before mcore-y files.
108
109# Default subarch .c files
110mcore-y := arch/x86/mach-default/
111
112# Voyager subarch support
113mflags-$(CONFIG_X86_VOYAGER) := -Iarch/x86/include/asm/mach-voyager
114mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/
115
116# generic subarchitecture
117mflags-$(CONFIG_X86_GENERICARCH):= -Iarch/x86/include/asm/mach-generic
118fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/
119mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default/
120
121# default subarch .h files
122mflags-y += -Iarch/x86/include/asm/mach-default
123
124# 64 bit does not support subarch support - clear sub arch variables
125fcore-$(CONFIG_X86_64) :=
126mcore-$(CONFIG_X86_64) :=
127
128KBUILD_CFLAGS += $(mflags-y) 108KBUILD_CFLAGS += $(mflags-y)
129KBUILD_AFLAGS += $(mflags-y) 109KBUILD_AFLAGS += $(mflags-y)
130 110
@@ -150,9 +130,6 @@ core-$(CONFIG_LGUEST_GUEST) += arch/x86/lguest/
150core-y += arch/x86/kernel/ 130core-y += arch/x86/kernel/
151core-y += arch/x86/mm/ 131core-y += arch/x86/mm/
152 132
153# Remaining sub architecture files
154core-y += $(mcore-y)
155
156core-y += arch/x86/crypto/ 133core-y += arch/x86/crypto/
157core-y += arch/x86/vdso/ 134core-y += arch/x86/vdso/
158core-$(CONFIG_IA32_EMULATION) += arch/x86/ia32/ 135core-$(CONFIG_IA32_EMULATION) += arch/x86/ia32/
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index cd48c7210016..c70eff69a1fb 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -32,7 +32,6 @@ setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
32setup-y += header.o main.o mca.o memory.o pm.o pmjump.o 32setup-y += header.o main.o mca.o memory.o pm.o pmjump.o
33setup-y += printf.o string.o tty.o video.o video-mode.o version.o 33setup-y += printf.o string.o tty.o video.o video-mode.o version.o
34setup-$(CONFIG_X86_APM_BOOT) += apm.o 34setup-$(CONFIG_X86_APM_BOOT) += apm.o
35setup-$(CONFIG_X86_VOYAGER) += voyager.o
36 35
37# The link order of the video-*.o modules can matter. In particular, 36# The link order of the video-*.o modules can matter. In particular,
38# video-vga.o *must* be listed first, followed by video-vesa.o. 37# video-vga.o *must* be listed first, followed by video-vesa.o.
diff --git a/arch/x86/boot/a20.c b/arch/x86/boot/a20.c
index 4063d630deff..7c19ce8c2442 100644
--- a/arch/x86/boot/a20.c
+++ b/arch/x86/boot/a20.c
@@ -2,6 +2,7 @@
2 * 2 *
3 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007-2008 rPath, Inc. - All Rights Reserved 4 * Copyright 2007-2008 rPath, Inc. - All Rights Reserved
5 * Copyright 2009 Intel Corporation
5 * 6 *
6 * This file is part of the Linux kernel, and is made available under 7 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2. 8 * the terms of the GNU General Public License version 2.
@@ -15,16 +16,23 @@
15#include "boot.h" 16#include "boot.h"
16 17
17#define MAX_8042_LOOPS 100000 18#define MAX_8042_LOOPS 100000
19#define MAX_8042_FF 32
18 20
19static int empty_8042(void) 21static int empty_8042(void)
20{ 22{
21 u8 status; 23 u8 status;
22 int loops = MAX_8042_LOOPS; 24 int loops = MAX_8042_LOOPS;
25 int ffs = MAX_8042_FF;
23 26
24 while (loops--) { 27 while (loops--) {
25 io_delay(); 28 io_delay();
26 29
27 status = inb(0x64); 30 status = inb(0x64);
31 if (status == 0xff) {
32 /* FF is a plausible, but very unlikely status */
33 if (!--ffs)
34 return -1; /* Assume no KBC present */
35 }
28 if (status & 1) { 36 if (status & 1) {
29 /* Read and discard input data */ 37 /* Read and discard input data */
30 io_delay(); 38 io_delay();
@@ -118,44 +126,37 @@ static void enable_a20_fast(void)
118 126
119int enable_a20(void) 127int enable_a20(void)
120{ 128{
121#if defined(CONFIG_X86_ELAN)
122 /* Elan croaks if we try to touch the KBC */
123 enable_a20_fast();
124 while (!a20_test_long())
125 ;
126 return 0;
127#elif defined(CONFIG_X86_VOYAGER)
128 /* On Voyager, a20_test() is unsafe? */
129 enable_a20_kbc();
130 return 0;
131#else
132 int loops = A20_ENABLE_LOOPS; 129 int loops = A20_ENABLE_LOOPS;
133 while (loops--) { 130 int kbc_err;
134 /* First, check to see if A20 is already enabled 131
135 (legacy free, etc.) */ 132 while (loops--) {
136 if (a20_test_short()) 133 /* First, check to see if A20 is already enabled
137 return 0; 134 (legacy free, etc.) */
138 135 if (a20_test_short())
139 /* Next, try the BIOS (INT 0x15, AX=0x2401) */ 136 return 0;
140 enable_a20_bios(); 137
141 if (a20_test_short()) 138 /* Next, try the BIOS (INT 0x15, AX=0x2401) */
142 return 0; 139 enable_a20_bios();
143 140 if (a20_test_short())
144 /* Try enabling A20 through the keyboard controller */ 141 return 0;
145 empty_8042(); 142
146 if (a20_test_short()) 143 /* Try enabling A20 through the keyboard controller */
147 return 0; /* BIOS worked, but with delayed reaction */ 144 kbc_err = empty_8042();
148 145
149 enable_a20_kbc(); 146 if (a20_test_short())
150 if (a20_test_long()) 147 return 0; /* BIOS worked, but with delayed reaction */
151 return 0; 148
152 149 if (!kbc_err) {
153 /* Finally, try enabling the "fast A20 gate" */ 150 enable_a20_kbc();
154 enable_a20_fast(); 151 if (a20_test_long())
155 if (a20_test_long()) 152 return 0;
156 return 0; 153 }
157 } 154
158 155 /* Finally, try enabling the "fast A20 gate" */
159 return -1; 156 enable_a20_fast();
160#endif 157 if (a20_test_long())
158 return 0;
159 }
160
161 return -1;
161} 162}
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index cc0ef13fba7a..7b2692e897e5 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -302,9 +302,6 @@ void probe_cards(int unsafe);
302/* video-vesa.c */ 302/* video-vesa.c */
303void vesa_store_edid(void); 303void vesa_store_edid(void);
304 304
305/* voyager.c */
306int query_voyager(void);
307
308#endif /* __ASSEMBLY__ */ 305#endif /* __ASSEMBLY__ */
309 306
310#endif /* BOOT_BOOT_H */ 307#endif /* BOOT_BOOT_H */
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 1771c804e02f..3ca4c194b8e5 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -4,7 +4,7 @@
4# create a compressed vmlinux image from the original vmlinux 4# create a compressed vmlinux image from the original vmlinux
5# 5#
6 6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz head_$(BITS).o misc.o piggy.o 7targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o
8 8
9KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 9KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
10KBUILD_CFLAGS += -fno-strict-aliasing -fPIC 10KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
@@ -47,18 +47,35 @@ ifeq ($(CONFIG_X86_32),y)
47ifdef CONFIG_RELOCATABLE 47ifdef CONFIG_RELOCATABLE
48$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE 48$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
49 $(call if_changed,gzip) 49 $(call if_changed,gzip)
50$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin.all FORCE
51 $(call if_changed,bzip2)
52$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin.all FORCE
53 $(call if_changed,lzma)
50else 54else
51$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 55$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
52 $(call if_changed,gzip) 56 $(call if_changed,gzip)
57$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
58 $(call if_changed,bzip2)
59$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
60 $(call if_changed,lzma)
53endif 61endif
54LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T 62LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
55 63
56else 64else
65
57$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 66$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
58 $(call if_changed,gzip) 67 $(call if_changed,gzip)
68$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
69 $(call if_changed,bzip2)
70$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
71 $(call if_changed,lzma)
59 72
60LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T 73LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
61endif 74endif
62 75
63$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE 76suffix_$(CONFIG_KERNEL_GZIP) = gz
77suffix_$(CONFIG_KERNEL_BZIP2) = bz2
78suffix_$(CONFIG_KERNEL_LZMA) = lzma
79
80$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
64 $(call if_changed,ld) 81 $(call if_changed,ld)
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 29c5fbf08392..3a8a866fb2e2 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -25,14 +25,12 @@
25 25
26#include <linux/linkage.h> 26#include <linux/linkage.h>
27#include <asm/segment.h> 27#include <asm/segment.h>
28#include <asm/page.h> 28#include <asm/page_types.h>
29#include <asm/boot.h> 29#include <asm/boot.h>
30#include <asm/asm-offsets.h> 30#include <asm/asm-offsets.h>
31 31
32.section ".text.head","ax",@progbits 32.section ".text.head","ax",@progbits
33 .globl startup_32 33ENTRY(startup_32)
34
35startup_32:
36 cld 34 cld
37 /* test KEEP_SEGMENTS flag to see if the bootloader is asking 35 /* test KEEP_SEGMENTS flag to see if the bootloader is asking
38 * us to not reload segments */ 36 * us to not reload segments */
@@ -113,6 +111,8 @@ startup_32:
113 */ 111 */
114 leal relocated(%ebx), %eax 112 leal relocated(%ebx), %eax
115 jmp *%eax 113 jmp *%eax
114ENDPROC(startup_32)
115
116.section ".text" 116.section ".text"
117relocated: 117relocated:
118 118
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 1d5dff4123e1..ed4a82948002 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -26,8 +26,8 @@
26 26
27#include <linux/linkage.h> 27#include <linux/linkage.h>
28#include <asm/segment.h> 28#include <asm/segment.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable_types.h>
30#include <asm/page.h> 30#include <asm/page_types.h>
31#include <asm/boot.h> 31#include <asm/boot.h>
32#include <asm/msr.h> 32#include <asm/msr.h>
33#include <asm/processor-flags.h> 33#include <asm/processor-flags.h>
@@ -35,9 +35,7 @@
35 35
36.section ".text.head" 36.section ".text.head"
37 .code32 37 .code32
38 .globl startup_32 38ENTRY(startup_32)
39
40startup_32:
41 cld 39 cld
42 /* test KEEP_SEGMENTS flag to see if the bootloader is asking 40 /* test KEEP_SEGMENTS flag to see if the bootloader is asking
43 * us to not reload segments */ 41 * us to not reload segments */
@@ -176,6 +174,7 @@ startup_32:
176 174
177 /* Jump from 32bit compatibility mode into 64bit mode. */ 175 /* Jump from 32bit compatibility mode into 64bit mode. */
178 lret 176 lret
177ENDPROC(startup_32)
179 178
180no_longmode: 179no_longmode:
181 /* This isn't an x86-64 CPU so hang */ 180 /* This isn't an x86-64 CPU so hang */
@@ -295,7 +294,6 @@ relocated:
295 call decompress_kernel 294 call decompress_kernel
296 popq %rsi 295 popq %rsi
297 296
298
299/* 297/*
300 * Jump to the decompressed kernel. 298 * Jump to the decompressed kernel.
301 */ 299 */
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index da062216948a..e45be73684ff 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -116,71 +116,13 @@
116/* 116/*
117 * gzip declarations 117 * gzip declarations
118 */ 118 */
119
120#define OF(args) args
121#define STATIC static 119#define STATIC static
122 120
123#undef memset 121#undef memset
124#undef memcpy 122#undef memcpy
125#define memzero(s, n) memset((s), 0, (n)) 123#define memzero(s, n) memset((s), 0, (n))
126 124
127typedef unsigned char uch;
128typedef unsigned short ush;
129typedef unsigned long ulg;
130
131/*
132 * Window size must be at least 32k, and a power of two.
133 * We don't actually have a window just a huge output buffer,
134 * so we report a 2G window size, as that should always be
135 * larger than our output buffer:
136 */
137#define WSIZE 0x80000000
138
139/* Input buffer: */
140static unsigned char *inbuf;
141
142/* Sliding window buffer (and final output buffer): */
143static unsigned char *window;
144
145/* Valid bytes in inbuf: */
146static unsigned insize;
147
148/* Index of next byte to be processed in inbuf: */
149static unsigned inptr;
150
151/* Bytes in output buffer: */
152static unsigned outcnt;
153
154/* gzip flag byte */
155#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
156#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gz file */
157#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
158#define ORIG_NAM 0x08 /* bit 3 set: original file name present */
159#define COMMENT 0x10 /* bit 4 set: file comment present */
160#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
161#define RESERVED 0xC0 /* bit 6, 7: reserved */
162
163#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
164
165/* Diagnostic functions */
166#ifdef DEBUG
167# define Assert(cond, msg) do { if (!(cond)) error(msg); } while (0)
168# define Trace(x) do { fprintf x; } while (0)
169# define Tracev(x) do { if (verbose) fprintf x ; } while (0)
170# define Tracevv(x) do { if (verbose > 1) fprintf x ; } while (0)
171# define Tracec(c, x) do { if (verbose && (c)) fprintf x ; } while (0)
172# define Tracecv(c, x) do { if (verbose > 1 && (c)) fprintf x ; } while (0)
173#else
174# define Assert(cond, msg)
175# define Trace(x)
176# define Tracev(x)
177# define Tracevv(x)
178# define Tracec(c, x)
179# define Tracecv(c, x)
180#endif
181 125
182static int fill_inbuf(void);
183static void flush_window(void);
184static void error(char *m); 126static void error(char *m);
185 127
186/* 128/*
@@ -189,13 +131,8 @@ static void error(char *m);
189static struct boot_params *real_mode; /* Pointer to real-mode data */ 131static struct boot_params *real_mode; /* Pointer to real-mode data */
190static int quiet; 132static int quiet;
191 133
192extern unsigned char input_data[];
193extern int input_len;
194
195static long bytes_out;
196
197static void *memset(void *s, int c, unsigned n); 134static void *memset(void *s, int c, unsigned n);
198static void *memcpy(void *dest, const void *src, unsigned n); 135void *memcpy(void *dest, const void *src, unsigned n);
199 136
200static void __putstr(int, const char *); 137static void __putstr(int, const char *);
201#define putstr(__x) __putstr(0, __x) 138#define putstr(__x) __putstr(0, __x)
@@ -213,7 +150,17 @@ static char *vidmem;
213static int vidport; 150static int vidport;
214static int lines, cols; 151static int lines, cols;
215 152
216#include "../../../../lib/inflate.c" 153#ifdef CONFIG_KERNEL_GZIP
154#include "../../../../lib/decompress_inflate.c"
155#endif
156
157#ifdef CONFIG_KERNEL_BZIP2
158#include "../../../../lib/decompress_bunzip2.c"
159#endif
160
161#ifdef CONFIG_KERNEL_LZMA
162#include "../../../../lib/decompress_unlzma.c"
163#endif
217 164
218static void scroll(void) 165static void scroll(void)
219{ 166{
@@ -282,7 +229,7 @@ static void *memset(void *s, int c, unsigned n)
282 return s; 229 return s;
283} 230}
284 231
285static void *memcpy(void *dest, const void *src, unsigned n) 232void *memcpy(void *dest, const void *src, unsigned n)
286{ 233{
287 int i; 234 int i;
288 const char *s = src; 235 const char *s = src;
@@ -293,38 +240,6 @@ static void *memcpy(void *dest, const void *src, unsigned n)
293 return dest; 240 return dest;
294} 241}
295 242
296/* ===========================================================================
297 * Fill the input buffer. This is called only when the buffer is empty
298 * and at least one byte is really needed.
299 */
300static int fill_inbuf(void)
301{
302 error("ran out of input data");
303 return 0;
304}
305
306/* ===========================================================================
307 * Write the output window window[0..outcnt-1] and update crc and bytes_out.
308 * (Used for the decompressed data only.)
309 */
310static void flush_window(void)
311{
312 /* With my window equal to my output buffer
313 * I only need to compute the crc here.
314 */
315 unsigned long c = crc; /* temporary variable */
316 unsigned n;
317 unsigned char *in, ch;
318
319 in = window;
320 for (n = 0; n < outcnt; n++) {
321 ch = *in++;
322 c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
323 }
324 crc = c;
325 bytes_out += (unsigned long)outcnt;
326 outcnt = 0;
327}
328 243
329static void error(char *x) 244static void error(char *x)
330{ 245{
@@ -407,12 +322,8 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
407 lines = real_mode->screen_info.orig_video_lines; 322 lines = real_mode->screen_info.orig_video_lines;
408 cols = real_mode->screen_info.orig_video_cols; 323 cols = real_mode->screen_info.orig_video_cols;
409 324
410 window = output; /* Output buffer (Normally at 1M) */
411 free_mem_ptr = heap; /* Heap */ 325 free_mem_ptr = heap; /* Heap */
412 free_mem_end_ptr = heap + BOOT_HEAP_SIZE; 326 free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
413 inbuf = input_data; /* Input buffer */
414 insize = input_len;
415 inptr = 0;
416 327
417#ifdef CONFIG_X86_64 328#ifdef CONFIG_X86_64
418 if ((unsigned long)output & (__KERNEL_ALIGN - 1)) 329 if ((unsigned long)output & (__KERNEL_ALIGN - 1))
@@ -430,10 +341,9 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
430#endif 341#endif
431#endif 342#endif
432 343
433 makecrc();
434 if (!quiet) 344 if (!quiet)
435 putstr("\nDecompressing Linux... "); 345 putstr("\nDecompressing Linux... ");
436 gunzip(); 346 decompress(input_data, input_len, NULL, NULL, output, NULL, error);
437 parse_elf(output); 347 parse_elf(output);
438 if (!quiet) 348 if (!quiet)
439 putstr("done.\nBooting the kernel.\n"); 349 putstr("done.\nBooting the kernel.\n");
diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S
index ef50c84e8b4b..11f272c6f5e9 100644
--- a/arch/x86/boot/copy.S
+++ b/arch/x86/boot/copy.S
@@ -8,6 +8,8 @@
8 * 8 *
9 * ----------------------------------------------------------------------- */ 9 * ----------------------------------------------------------------------- */
10 10
11#include <linux/linkage.h>
12
11/* 13/*
12 * Memory copy routines 14 * Memory copy routines
13 */ 15 */
@@ -15,9 +17,7 @@
15 .code16gcc 17 .code16gcc
16 .text 18 .text
17 19
18 .globl memcpy 20GLOBAL(memcpy)
19 .type memcpy, @function
20memcpy:
21 pushw %si 21 pushw %si
22 pushw %di 22 pushw %di
23 movw %ax, %di 23 movw %ax, %di
@@ -31,11 +31,9 @@ memcpy:
31 popw %di 31 popw %di
32 popw %si 32 popw %si
33 ret 33 ret
34 .size memcpy, .-memcpy 34ENDPROC(memcpy)
35 35
36 .globl memset 36GLOBAL(memset)
37 .type memset, @function
38memset:
39 pushw %di 37 pushw %di
40 movw %ax, %di 38 movw %ax, %di
41 movzbl %dl, %eax 39 movzbl %dl, %eax
@@ -48,52 +46,42 @@ memset:
48 rep; stosb 46 rep; stosb
49 popw %di 47 popw %di
50 ret 48 ret
51 .size memset, .-memset 49ENDPROC(memset)
52 50
53 .globl copy_from_fs 51GLOBAL(copy_from_fs)
54 .type copy_from_fs, @function
55copy_from_fs:
56 pushw %ds 52 pushw %ds
57 pushw %fs 53 pushw %fs
58 popw %ds 54 popw %ds
59 call memcpy 55 call memcpy
60 popw %ds 56 popw %ds
61 ret 57 ret
62 .size copy_from_fs, .-copy_from_fs 58ENDPROC(copy_from_fs)
63 59
64 .globl copy_to_fs 60GLOBAL(copy_to_fs)
65 .type copy_to_fs, @function
66copy_to_fs:
67 pushw %es 61 pushw %es
68 pushw %fs 62 pushw %fs
69 popw %es 63 popw %es
70 call memcpy 64 call memcpy
71 popw %es 65 popw %es
72 ret 66 ret
73 .size copy_to_fs, .-copy_to_fs 67ENDPROC(copy_to_fs)
74 68
75#if 0 /* Not currently used, but can be enabled as needed */ 69#if 0 /* Not currently used, but can be enabled as needed */
76 70GLOBAL(copy_from_gs)
77 .globl copy_from_gs
78 .type copy_from_gs, @function
79copy_from_gs:
80 pushw %ds 71 pushw %ds
81 pushw %gs 72 pushw %gs
82 popw %ds 73 popw %ds
83 call memcpy 74 call memcpy
84 popw %ds 75 popw %ds
85 ret 76 ret
86 .size copy_from_gs, .-copy_from_gs 77ENDPROC(copy_from_gs)
87 .globl copy_to_gs
88 78
89 .type copy_to_gs, @function 79GLOBAL(copy_to_gs)
90copy_to_gs:
91 pushw %es 80 pushw %es
92 pushw %gs 81 pushw %gs
93 popw %es 82 popw %es
94 call memcpy 83 call memcpy
95 popw %es 84 popw %es
96 ret 85 ret
97 .size copy_to_gs, .-copy_to_gs 86ENDPROC(copy_to_gs)
98
99#endif 87#endif
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index b993062e9a5f..7ccff4884a23 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -19,7 +19,7 @@
19#include <linux/utsrelease.h> 19#include <linux/utsrelease.h>
20#include <asm/boot.h> 20#include <asm/boot.h>
21#include <asm/e820.h> 21#include <asm/e820.h>
22#include <asm/page.h> 22#include <asm/page_types.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24#include "boot.h" 24#include "boot.h"
25#include "offsets.h" 25#include "offsets.h"
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
index 197421db1af1..58f0415d3ae0 100644
--- a/arch/x86/boot/main.c
+++ b/arch/x86/boot/main.c
@@ -149,11 +149,6 @@ void main(void)
149 /* Query MCA information */ 149 /* Query MCA information */
150 query_mca(); 150 query_mca();
151 151
152 /* Voyager */
153#ifdef CONFIG_X86_VOYAGER
154 query_voyager();
155#endif
156
157 /* Query Intel SpeedStep (IST) information */ 152 /* Query Intel SpeedStep (IST) information */
158 query_ist(); 153 query_ist();
159 154
diff --git a/arch/x86/boot/pmjump.S b/arch/x86/boot/pmjump.S
index 141b6e20ed31..019c17a75851 100644
--- a/arch/x86/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
@@ -15,18 +15,15 @@
15#include <asm/boot.h> 15#include <asm/boot.h>
16#include <asm/processor-flags.h> 16#include <asm/processor-flags.h>
17#include <asm/segment.h> 17#include <asm/segment.h>
18#include <linux/linkage.h>
18 19
19 .text 20 .text
20
21 .globl protected_mode_jump
22 .type protected_mode_jump, @function
23
24 .code16 21 .code16
25 22
26/* 23/*
27 * void protected_mode_jump(u32 entrypoint, u32 bootparams); 24 * void protected_mode_jump(u32 entrypoint, u32 bootparams);
28 */ 25 */
29protected_mode_jump: 26GLOBAL(protected_mode_jump)
30 movl %edx, %esi # Pointer to boot_params table 27 movl %edx, %esi # Pointer to boot_params table
31 28
32 xorl %ebx, %ebx 29 xorl %ebx, %ebx
@@ -47,12 +44,10 @@ protected_mode_jump:
47 .byte 0x66, 0xea # ljmpl opcode 44 .byte 0x66, 0xea # ljmpl opcode
482: .long in_pm32 # offset 452: .long in_pm32 # offset
49 .word __BOOT_CS # segment 46 .word __BOOT_CS # segment
50 47ENDPROC(protected_mode_jump)
51 .size protected_mode_jump, .-protected_mode_jump
52 48
53 .code32 49 .code32
54 .type in_pm32, @function 50GLOBAL(in_pm32)
55in_pm32:
56 # Set up data segments for flat 32-bit mode 51 # Set up data segments for flat 32-bit mode
57 movl %ecx, %ds 52 movl %ecx, %ds
58 movl %ecx, %es 53 movl %ecx, %es
@@ -78,5 +73,4 @@ in_pm32:
78 lldt %cx 73 lldt %cx
79 74
80 jmpl *%eax # Jump to the 32-bit entrypoint 75 jmpl *%eax # Jump to the 32-bit entrypoint
81 76ENDPROC(in_pm32)
82 .size in_pm32, .-in_pm32
diff --git a/arch/x86/boot/voyager.c b/arch/x86/boot/voyager.c
deleted file mode 100644
index 433909d61e5c..000000000000
--- a/arch/x86/boot/voyager.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/* -*- linux-c -*- ------------------------------------------------------- *
2 *
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007 rPath, Inc. - All Rights Reserved
5 *
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
8 *
9 * ----------------------------------------------------------------------- */
10
11/*
12 * Get the Voyager config information
13 */
14
15#include "boot.h"
16
17int query_voyager(void)
18{
19 u8 err;
20 u16 es, di;
21 /* Abuse the apm_bios_info area for this */
22 u8 *data_ptr = (u8 *)&boot_params.apm_bios_info;
23
24 data_ptr[0] = 0xff; /* Flag on config not found(?) */
25
26 asm("pushw %%es ; "
27 "int $0x15 ; "
28 "setc %0 ; "
29 "movw %%es, %1 ; "
30 "popw %%es"
31 : "=q" (err), "=r" (es), "=D" (di)
32 : "a" (0xffc0));
33
34 if (err)
35 return -1; /* Not Voyager */
36
37 set_fs(es);
38 copy_from_fs(data_ptr, di, 7); /* Table is 7 bytes apparently */
39 return 0;
40}
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index edba00d98ac3..235b81d0f6f2 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_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.27-rc5 3# Linux kernel version: 2.6.29-rc4
4# Wed Sep 3 17:23:09 2008 4# Tue Feb 24 15:50:58 2009
5# 5#
6# CONFIG_64BIT is not set 6# CONFIG_64BIT is not set
7CONFIG_X86_32=y 7CONFIG_X86_32=y
8# CONFIG_X86_64 is not set 8# CONFIG_X86_64 is not set
9CONFIG_X86=y 9CONFIG_X86=y
10CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" 10CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
11# CONFIG_GENERIC_LOCKBREAK is not set
12CONFIG_GENERIC_TIME=y 11CONFIG_GENERIC_TIME=y
13CONFIG_GENERIC_CMOS_UPDATE=y 12CONFIG_GENERIC_CMOS_UPDATE=y
14CONFIG_CLOCKSOURCE_WATCHDOG=y 13CONFIG_CLOCKSOURCE_WATCHDOG=y
@@ -24,16 +23,14 @@ CONFIG_GENERIC_ISA_DMA=y
24CONFIG_GENERIC_IOMAP=y 23CONFIG_GENERIC_IOMAP=y
25CONFIG_GENERIC_BUG=y 24CONFIG_GENERIC_BUG=y
26CONFIG_GENERIC_HWEIGHT=y 25CONFIG_GENERIC_HWEIGHT=y
27# CONFIG_GENERIC_GPIO is not set
28CONFIG_ARCH_MAY_HAVE_PC_FDC=y 26CONFIG_ARCH_MAY_HAVE_PC_FDC=y
29# CONFIG_RWSEM_GENERIC_SPINLOCK is not set 27# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
30CONFIG_RWSEM_XCHGADD_ALGORITHM=y 28CONFIG_RWSEM_XCHGADD_ALGORITHM=y
31# CONFIG_ARCH_HAS_ILOG2_U32 is not set
32# CONFIG_ARCH_HAS_ILOG2_U64 is not set
33CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y 29CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
34CONFIG_GENERIC_CALIBRATE_DELAY=y 30CONFIG_GENERIC_CALIBRATE_DELAY=y
35# CONFIG_GENERIC_TIME_VSYSCALL is not set 31# CONFIG_GENERIC_TIME_VSYSCALL is not set
36CONFIG_ARCH_HAS_CPU_RELAX=y 32CONFIG_ARCH_HAS_CPU_RELAX=y
33CONFIG_ARCH_HAS_DEFAULT_IDLE=y
37CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y 34CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
38CONFIG_HAVE_SETUP_PER_CPU_AREA=y 35CONFIG_HAVE_SETUP_PER_CPU_AREA=y
39# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set 36# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
@@ -42,12 +39,12 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
42# CONFIG_ZONE_DMA32 is not set 39# CONFIG_ZONE_DMA32 is not set
43CONFIG_ARCH_POPULATES_NODE_MAP=y 40CONFIG_ARCH_POPULATES_NODE_MAP=y
44# CONFIG_AUDIT_ARCH is not set 41# CONFIG_AUDIT_ARCH is not set
45CONFIG_ARCH_SUPPORTS_AOUT=y
46CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y 42CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
47CONFIG_GENERIC_HARDIRQS=y 43CONFIG_GENERIC_HARDIRQS=y
48CONFIG_GENERIC_IRQ_PROBE=y 44CONFIG_GENERIC_IRQ_PROBE=y
49CONFIG_GENERIC_PENDING_IRQ=y 45CONFIG_GENERIC_PENDING_IRQ=y
50CONFIG_X86_SMP=y 46CONFIG_X86_SMP=y
47CONFIG_USE_GENERIC_SMP_HELPERS=y
51CONFIG_X86_32_SMP=y 48CONFIG_X86_32_SMP=y
52CONFIG_X86_HT=y 49CONFIG_X86_HT=y
53CONFIG_X86_BIOS_REBOOT=y 50CONFIG_X86_BIOS_REBOOT=y
@@ -76,30 +73,44 @@ CONFIG_TASK_IO_ACCOUNTING=y
76CONFIG_AUDIT=y 73CONFIG_AUDIT=y
77CONFIG_AUDITSYSCALL=y 74CONFIG_AUDITSYSCALL=y
78CONFIG_AUDIT_TREE=y 75CONFIG_AUDIT_TREE=y
76
77#
78# RCU Subsystem
79#
80# CONFIG_CLASSIC_RCU is not set
81CONFIG_TREE_RCU=y
82# CONFIG_PREEMPT_RCU is not set
83# CONFIG_RCU_TRACE is not set
84CONFIG_RCU_FANOUT=32
85# CONFIG_RCU_FANOUT_EXACT is not set
86# CONFIG_TREE_RCU_TRACE is not set
87# CONFIG_PREEMPT_RCU_TRACE is not set
79# CONFIG_IKCONFIG is not set 88# CONFIG_IKCONFIG is not set
80CONFIG_LOG_BUF_SHIFT=18 89CONFIG_LOG_BUF_SHIFT=18
81CONFIG_CGROUPS=y
82# CONFIG_CGROUP_DEBUG is not set
83CONFIG_CGROUP_NS=y
84# CONFIG_CGROUP_DEVICE is not set
85CONFIG_CPUSETS=y
86CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y 90CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
87CONFIG_GROUP_SCHED=y 91CONFIG_GROUP_SCHED=y
88CONFIG_FAIR_GROUP_SCHED=y 92CONFIG_FAIR_GROUP_SCHED=y
89# CONFIG_RT_GROUP_SCHED is not set 93# CONFIG_RT_GROUP_SCHED is not set
90# CONFIG_USER_SCHED is not set 94# CONFIG_USER_SCHED is not set
91CONFIG_CGROUP_SCHED=y 95CONFIG_CGROUP_SCHED=y
96CONFIG_CGROUPS=y
97# CONFIG_CGROUP_DEBUG is not set
98CONFIG_CGROUP_NS=y
99CONFIG_CGROUP_FREEZER=y
100# CONFIG_CGROUP_DEVICE is not set
101CONFIG_CPUSETS=y
102CONFIG_PROC_PID_CPUSET=y
92CONFIG_CGROUP_CPUACCT=y 103CONFIG_CGROUP_CPUACCT=y
93CONFIG_RESOURCE_COUNTERS=y 104CONFIG_RESOURCE_COUNTERS=y
94# CONFIG_CGROUP_MEM_RES_CTLR is not set 105# CONFIG_CGROUP_MEM_RES_CTLR is not set
95# CONFIG_SYSFS_DEPRECATED_V2 is not set 106# CONFIG_SYSFS_DEPRECATED_V2 is not set
96CONFIG_PROC_PID_CPUSET=y
97CONFIG_RELAY=y 107CONFIG_RELAY=y
98CONFIG_NAMESPACES=y 108CONFIG_NAMESPACES=y
99CONFIG_UTS_NS=y 109CONFIG_UTS_NS=y
100CONFIG_IPC_NS=y 110CONFIG_IPC_NS=y
101CONFIG_USER_NS=y 111CONFIG_USER_NS=y
102CONFIG_PID_NS=y 112CONFIG_PID_NS=y
113CONFIG_NET_NS=y
103CONFIG_BLK_DEV_INITRD=y 114CONFIG_BLK_DEV_INITRD=y
104CONFIG_INITRAMFS_SOURCE="" 115CONFIG_INITRAMFS_SOURCE=""
105CONFIG_CC_OPTIMIZE_FOR_SIZE=y 116CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -124,12 +135,15 @@ CONFIG_SIGNALFD=y
124CONFIG_TIMERFD=y 135CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 136CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 137CONFIG_SHMEM=y
138CONFIG_AIO=y
127CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
140CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 141CONFIG_SLUB_DEBUG=y
129# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
130CONFIG_SLUB=y 143CONFIG_SLUB=y
131# CONFIG_SLOB is not set 144# CONFIG_SLOB is not set
132CONFIG_PROFILING=y 145CONFIG_PROFILING=y
146CONFIG_TRACEPOINTS=y
133CONFIG_MARKERS=y 147CONFIG_MARKERS=y
134# CONFIG_OPROFILE is not set 148# CONFIG_OPROFILE is not set
135CONFIG_HAVE_OPROFILE=y 149CONFIG_HAVE_OPROFILE=y
@@ -139,15 +153,10 @@ CONFIG_KRETPROBES=y
139CONFIG_HAVE_IOREMAP_PROT=y 153CONFIG_HAVE_IOREMAP_PROT=y
140CONFIG_HAVE_KPROBES=y 154CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
142# CONFIG_HAVE_ARCH_TRACEHOOK is not set 156CONFIG_HAVE_ARCH_TRACEHOOK=y
143# CONFIG_HAVE_DMA_ATTRS is not set
144CONFIG_USE_GENERIC_SMP_HELPERS=y
145# CONFIG_HAVE_CLK is not set
146CONFIG_PROC_PAGE_MONITOR=y
147CONFIG_HAVE_GENERIC_DMA_COHERENT=y 157CONFIG_HAVE_GENERIC_DMA_COHERENT=y
148CONFIG_SLABINFO=y 158CONFIG_SLABINFO=y
149CONFIG_RT_MUTEXES=y 159CONFIG_RT_MUTEXES=y
150# CONFIG_TINY_SHMEM is not set
151CONFIG_BASE_SMALL=0 160CONFIG_BASE_SMALL=0
152CONFIG_MODULES=y 161CONFIG_MODULES=y
153# CONFIG_MODULE_FORCE_LOAD is not set 162# CONFIG_MODULE_FORCE_LOAD is not set
@@ -155,12 +164,10 @@ CONFIG_MODULE_UNLOAD=y
155CONFIG_MODULE_FORCE_UNLOAD=y 164CONFIG_MODULE_FORCE_UNLOAD=y
156# CONFIG_MODVERSIONS is not set 165# CONFIG_MODVERSIONS is not set
157# CONFIG_MODULE_SRCVERSION_ALL is not set 166# CONFIG_MODULE_SRCVERSION_ALL is not set
158CONFIG_KMOD=y
159CONFIG_STOP_MACHINE=y 167CONFIG_STOP_MACHINE=y
160CONFIG_BLOCK=y 168CONFIG_BLOCK=y
161# CONFIG_LBD is not set 169# CONFIG_LBD is not set
162CONFIG_BLK_DEV_IO_TRACE=y 170CONFIG_BLK_DEV_IO_TRACE=y
163# CONFIG_LSF is not set
164CONFIG_BLK_DEV_BSG=y 171CONFIG_BLK_DEV_BSG=y
165# CONFIG_BLK_DEV_INTEGRITY is not set 172# CONFIG_BLK_DEV_INTEGRITY is not set
166 173
@@ -176,7 +183,7 @@ CONFIG_IOSCHED_CFQ=y
176CONFIG_DEFAULT_CFQ=y 183CONFIG_DEFAULT_CFQ=y
177# CONFIG_DEFAULT_NOOP is not set 184# CONFIG_DEFAULT_NOOP is not set
178CONFIG_DEFAULT_IOSCHED="cfq" 185CONFIG_DEFAULT_IOSCHED="cfq"
179CONFIG_CLASSIC_RCU=y 186CONFIG_FREEZER=y
180 187
181# 188#
182# Processor type and features 189# Processor type and features
@@ -186,15 +193,14 @@ CONFIG_NO_HZ=y
186CONFIG_HIGH_RES_TIMERS=y 193CONFIG_HIGH_RES_TIMERS=y
187CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 194CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
188CONFIG_SMP=y 195CONFIG_SMP=y
196CONFIG_SPARSE_IRQ=y
189CONFIG_X86_FIND_SMP_CONFIG=y 197CONFIG_X86_FIND_SMP_CONFIG=y
190CONFIG_X86_MPPARSE=y 198CONFIG_X86_MPPARSE=y
191CONFIG_X86_PC=y
192# CONFIG_X86_ELAN is not set 199# CONFIG_X86_ELAN is not set
193# CONFIG_X86_VOYAGER is not set
194# CONFIG_X86_GENERICARCH is not set 200# CONFIG_X86_GENERICARCH is not set
195# CONFIG_X86_VSMP is not set 201# CONFIG_X86_VSMP is not set
196# CONFIG_X86_RDC321X is not set 202# CONFIG_X86_RDC321X is not set
197CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 203CONFIG_SCHED_OMIT_FRAME_POINTER=y
198# CONFIG_PARAVIRT_GUEST is not set 204# CONFIG_PARAVIRT_GUEST is not set
199# CONFIG_MEMTEST is not set 205# CONFIG_MEMTEST is not set
200# CONFIG_M386 is not set 206# CONFIG_M386 is not set
@@ -238,10 +244,19 @@ CONFIG_X86_TSC=y
238CONFIG_X86_CMOV=y 244CONFIG_X86_CMOV=y
239CONFIG_X86_MINIMUM_CPU_FAMILY=4 245CONFIG_X86_MINIMUM_CPU_FAMILY=4
240CONFIG_X86_DEBUGCTLMSR=y 246CONFIG_X86_DEBUGCTLMSR=y
247CONFIG_CPU_SUP_INTEL=y
248CONFIG_CPU_SUP_CYRIX_32=y
249CONFIG_CPU_SUP_AMD=y
250CONFIG_CPU_SUP_CENTAUR_32=y
251CONFIG_CPU_SUP_TRANSMETA_32=y
252CONFIG_CPU_SUP_UMC_32=y
253CONFIG_X86_DS=y
254CONFIG_X86_PTRACE_BTS=y
241CONFIG_HPET_TIMER=y 255CONFIG_HPET_TIMER=y
242CONFIG_HPET_EMULATE_RTC=y 256CONFIG_HPET_EMULATE_RTC=y
243CONFIG_DMI=y 257CONFIG_DMI=y
244# CONFIG_IOMMU_HELPER is not set 258# CONFIG_IOMMU_HELPER is not set
259# CONFIG_IOMMU_API is not set
245CONFIG_NR_CPUS=64 260CONFIG_NR_CPUS=64
246CONFIG_SCHED_SMT=y 261CONFIG_SCHED_SMT=y
247CONFIG_SCHED_MC=y 262CONFIG_SCHED_MC=y
@@ -250,12 +265,17 @@ CONFIG_PREEMPT_VOLUNTARY=y
250# CONFIG_PREEMPT is not set 265# CONFIG_PREEMPT is not set
251CONFIG_X86_LOCAL_APIC=y 266CONFIG_X86_LOCAL_APIC=y
252CONFIG_X86_IO_APIC=y 267CONFIG_X86_IO_APIC=y
253# CONFIG_X86_MCE is not set 268CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
269CONFIG_X86_MCE=y
270CONFIG_X86_MCE_NONFATAL=y
271CONFIG_X86_MCE_P4THERMAL=y
254CONFIG_VM86=y 272CONFIG_VM86=y
255# CONFIG_TOSHIBA is not set 273# CONFIG_TOSHIBA is not set
256# CONFIG_I8K is not set 274# CONFIG_I8K is not set
257CONFIG_X86_REBOOTFIXUPS=y 275CONFIG_X86_REBOOTFIXUPS=y
258CONFIG_MICROCODE=y 276CONFIG_MICROCODE=y
277CONFIG_MICROCODE_INTEL=y
278CONFIG_MICROCODE_AMD=y
259CONFIG_MICROCODE_OLD_INTERFACE=y 279CONFIG_MICROCODE_OLD_INTERFACE=y
260CONFIG_X86_MSR=y 280CONFIG_X86_MSR=y
261CONFIG_X86_CPUID=y 281CONFIG_X86_CPUID=y
@@ -264,6 +284,7 @@ CONFIG_HIGHMEM4G=y
264# CONFIG_HIGHMEM64G is not set 284# CONFIG_HIGHMEM64G is not set
265CONFIG_PAGE_OFFSET=0xC0000000 285CONFIG_PAGE_OFFSET=0xC0000000
266CONFIG_HIGHMEM=y 286CONFIG_HIGHMEM=y
287# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
267CONFIG_ARCH_FLATMEM_ENABLE=y 288CONFIG_ARCH_FLATMEM_ENABLE=y
268CONFIG_ARCH_SPARSEMEM_ENABLE=y 289CONFIG_ARCH_SPARSEMEM_ENABLE=y
269CONFIG_ARCH_SELECT_MEMORY_MODEL=y 290CONFIG_ARCH_SELECT_MEMORY_MODEL=y
@@ -274,14 +295,17 @@ CONFIG_FLATMEM_MANUAL=y
274CONFIG_FLATMEM=y 295CONFIG_FLATMEM=y
275CONFIG_FLAT_NODE_MEM_MAP=y 296CONFIG_FLAT_NODE_MEM_MAP=y
276CONFIG_SPARSEMEM_STATIC=y 297CONFIG_SPARSEMEM_STATIC=y
277# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
278CONFIG_PAGEFLAGS_EXTENDED=y 298CONFIG_PAGEFLAGS_EXTENDED=y
279CONFIG_SPLIT_PTLOCK_CPUS=4 299CONFIG_SPLIT_PTLOCK_CPUS=4
280CONFIG_RESOURCES_64BIT=y 300# CONFIG_PHYS_ADDR_T_64BIT is not set
281CONFIG_ZONE_DMA_FLAG=1 301CONFIG_ZONE_DMA_FLAG=1
282CONFIG_BOUNCE=y 302CONFIG_BOUNCE=y
283CONFIG_VIRT_TO_BUS=y 303CONFIG_VIRT_TO_BUS=y
304CONFIG_UNEVICTABLE_LRU=y
284CONFIG_HIGHPTE=y 305CONFIG_HIGHPTE=y
306CONFIG_X86_CHECK_BIOS_CORRUPTION=y
307CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
308CONFIG_X86_RESERVE_LOW_64K=y
285# CONFIG_MATH_EMULATION is not set 309# CONFIG_MATH_EMULATION is not set
286CONFIG_MTRR=y 310CONFIG_MTRR=y
287# CONFIG_MTRR_SANITIZER is not set 311# CONFIG_MTRR_SANITIZER is not set
@@ -302,10 +326,11 @@ CONFIG_PHYSICAL_START=0x1000000
302CONFIG_PHYSICAL_ALIGN=0x200000 326CONFIG_PHYSICAL_ALIGN=0x200000
303CONFIG_HOTPLUG_CPU=y 327CONFIG_HOTPLUG_CPU=y
304# CONFIG_COMPAT_VDSO is not set 328# CONFIG_COMPAT_VDSO is not set
329# CONFIG_CMDLINE_BOOL is not set
305CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 330CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
306 331
307# 332#
308# Power management options 333# Power management and ACPI options
309# 334#
310CONFIG_PM=y 335CONFIG_PM=y
311CONFIG_PM_DEBUG=y 336CONFIG_PM_DEBUG=y
@@ -331,19 +356,13 @@ CONFIG_ACPI_BATTERY=y
331CONFIG_ACPI_BUTTON=y 356CONFIG_ACPI_BUTTON=y
332CONFIG_ACPI_FAN=y 357CONFIG_ACPI_FAN=y
333CONFIG_ACPI_DOCK=y 358CONFIG_ACPI_DOCK=y
334# CONFIG_ACPI_BAY is not set
335CONFIG_ACPI_PROCESSOR=y 359CONFIG_ACPI_PROCESSOR=y
336CONFIG_ACPI_HOTPLUG_CPU=y 360CONFIG_ACPI_HOTPLUG_CPU=y
337CONFIG_ACPI_THERMAL=y 361CONFIG_ACPI_THERMAL=y
338# CONFIG_ACPI_WMI is not set
339# CONFIG_ACPI_ASUS is not set
340# CONFIG_ACPI_TOSHIBA is not set
341# CONFIG_ACPI_CUSTOM_DSDT is not set 362# CONFIG_ACPI_CUSTOM_DSDT is not set
342CONFIG_ACPI_BLACKLIST_YEAR=0 363CONFIG_ACPI_BLACKLIST_YEAR=0
343# CONFIG_ACPI_DEBUG is not set 364# CONFIG_ACPI_DEBUG is not set
344CONFIG_ACPI_EC=y
345# CONFIG_ACPI_PCI_SLOT is not set 365# CONFIG_ACPI_PCI_SLOT is not set
346CONFIG_ACPI_POWER=y
347CONFIG_ACPI_SYSTEM=y 366CONFIG_ACPI_SYSTEM=y
348CONFIG_X86_PM_TIMER=y 367CONFIG_X86_PM_TIMER=y
349CONFIG_ACPI_CONTAINER=y 368CONFIG_ACPI_CONTAINER=y
@@ -388,7 +407,6 @@ CONFIG_X86_ACPI_CPUFREQ=y
388# 407#
389# shared options 408# shared options
390# 409#
391# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
392# CONFIG_X86_SPEEDSTEP_LIB is not set 410# CONFIG_X86_SPEEDSTEP_LIB is not set
393CONFIG_CPU_IDLE=y 411CONFIG_CPU_IDLE=y
394CONFIG_CPU_IDLE_GOV_LADDER=y 412CONFIG_CPU_IDLE_GOV_LADDER=y
@@ -415,6 +433,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
415CONFIG_PCI_MSI=y 433CONFIG_PCI_MSI=y
416# CONFIG_PCI_LEGACY is not set 434# CONFIG_PCI_LEGACY is not set
417# CONFIG_PCI_DEBUG is not set 435# CONFIG_PCI_DEBUG is not set
436# CONFIG_PCI_STUB is not set
418CONFIG_HT_IRQ=y 437CONFIG_HT_IRQ=y
419CONFIG_ISA_DMA_API=y 438CONFIG_ISA_DMA_API=y
420# CONFIG_ISA is not set 439# CONFIG_ISA is not set
@@ -452,13 +471,17 @@ CONFIG_HOTPLUG_PCI=y
452# Executable file formats / Emulations 471# Executable file formats / Emulations
453# 472#
454CONFIG_BINFMT_ELF=y 473CONFIG_BINFMT_ELF=y
474CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
475CONFIG_HAVE_AOUT=y
455# CONFIG_BINFMT_AOUT is not set 476# CONFIG_BINFMT_AOUT is not set
456CONFIG_BINFMT_MISC=y 477CONFIG_BINFMT_MISC=y
478CONFIG_HAVE_ATOMIC_IOMAP=y
457CONFIG_NET=y 479CONFIG_NET=y
458 480
459# 481#
460# Networking options 482# Networking options
461# 483#
484CONFIG_COMPAT_NET_DEV_OPS=y
462CONFIG_PACKET=y 485CONFIG_PACKET=y
463CONFIG_PACKET_MMAP=y 486CONFIG_PACKET_MMAP=y
464CONFIG_UNIX=y 487CONFIG_UNIX=y
@@ -519,7 +542,6 @@ CONFIG_DEFAULT_CUBIC=y
519# CONFIG_DEFAULT_RENO is not set 542# CONFIG_DEFAULT_RENO is not set
520CONFIG_DEFAULT_TCP_CONG="cubic" 543CONFIG_DEFAULT_TCP_CONG="cubic"
521CONFIG_TCP_MD5SIG=y 544CONFIG_TCP_MD5SIG=y
522# CONFIG_IP_VS is not set
523CONFIG_IPV6=y 545CONFIG_IPV6=y
524# CONFIG_IPV6_PRIVACY is not set 546# CONFIG_IPV6_PRIVACY is not set
525# CONFIG_IPV6_ROUTER_PREF is not set 547# CONFIG_IPV6_ROUTER_PREF is not set
@@ -557,19 +579,21 @@ CONFIG_NF_CONNTRACK_IRC=y
557CONFIG_NF_CONNTRACK_SIP=y 579CONFIG_NF_CONNTRACK_SIP=y
558CONFIG_NF_CT_NETLINK=y 580CONFIG_NF_CT_NETLINK=y
559CONFIG_NETFILTER_XTABLES=y 581CONFIG_NETFILTER_XTABLES=y
582CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
560CONFIG_NETFILTER_XT_TARGET_MARK=y 583CONFIG_NETFILTER_XT_TARGET_MARK=y
561CONFIG_NETFILTER_XT_TARGET_NFLOG=y 584CONFIG_NETFILTER_XT_TARGET_NFLOG=y
562CONFIG_NETFILTER_XT_TARGET_SECMARK=y 585CONFIG_NETFILTER_XT_TARGET_SECMARK=y
563CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
564CONFIG_NETFILTER_XT_TARGET_TCPMSS=y 586CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
565CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y 587CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
566CONFIG_NETFILTER_XT_MATCH_MARK=y 588CONFIG_NETFILTER_XT_MATCH_MARK=y
567CONFIG_NETFILTER_XT_MATCH_POLICY=y 589CONFIG_NETFILTER_XT_MATCH_POLICY=y
568CONFIG_NETFILTER_XT_MATCH_STATE=y 590CONFIG_NETFILTER_XT_MATCH_STATE=y
591# CONFIG_IP_VS is not set
569 592
570# 593#
571# IP: Netfilter Configuration 594# IP: Netfilter Configuration
572# 595#
596CONFIG_NF_DEFRAG_IPV4=y
573CONFIG_NF_CONNTRACK_IPV4=y 597CONFIG_NF_CONNTRACK_IPV4=y
574CONFIG_NF_CONNTRACK_PROC_COMPAT=y 598CONFIG_NF_CONNTRACK_PROC_COMPAT=y
575CONFIG_IP_NF_IPTABLES=y 599CONFIG_IP_NF_IPTABLES=y
@@ -595,8 +619,8 @@ CONFIG_IP_NF_MANGLE=y
595CONFIG_NF_CONNTRACK_IPV6=y 619CONFIG_NF_CONNTRACK_IPV6=y
596CONFIG_IP6_NF_IPTABLES=y 620CONFIG_IP6_NF_IPTABLES=y
597CONFIG_IP6_NF_MATCH_IPV6HEADER=y 621CONFIG_IP6_NF_MATCH_IPV6HEADER=y
598CONFIG_IP6_NF_FILTER=y
599CONFIG_IP6_NF_TARGET_LOG=y 622CONFIG_IP6_NF_TARGET_LOG=y
623CONFIG_IP6_NF_FILTER=y
600CONFIG_IP6_NF_TARGET_REJECT=y 624CONFIG_IP6_NF_TARGET_REJECT=y
601CONFIG_IP6_NF_MANGLE=y 625CONFIG_IP6_NF_MANGLE=y
602# CONFIG_IP_DCCP is not set 626# CONFIG_IP_DCCP is not set
@@ -604,6 +628,7 @@ CONFIG_IP6_NF_MANGLE=y
604# CONFIG_TIPC is not set 628# CONFIG_TIPC is not set
605# CONFIG_ATM is not set 629# CONFIG_ATM is not set
606# CONFIG_BRIDGE is not set 630# CONFIG_BRIDGE is not set
631# CONFIG_NET_DSA is not set
607# CONFIG_VLAN_8021Q is not set 632# CONFIG_VLAN_8021Q is not set
608# CONFIG_DECNET is not set 633# CONFIG_DECNET is not set
609CONFIG_LLC=y 634CONFIG_LLC=y
@@ -623,6 +648,7 @@ CONFIG_NET_SCHED=y
623# CONFIG_NET_SCH_HTB is not set 648# CONFIG_NET_SCH_HTB is not set
624# CONFIG_NET_SCH_HFSC is not set 649# CONFIG_NET_SCH_HFSC is not set
625# CONFIG_NET_SCH_PRIO is not set 650# CONFIG_NET_SCH_PRIO is not set
651# CONFIG_NET_SCH_MULTIQ is not set
626# CONFIG_NET_SCH_RED is not set 652# CONFIG_NET_SCH_RED is not set
627# CONFIG_NET_SCH_SFQ is not set 653# CONFIG_NET_SCH_SFQ is not set
628# CONFIG_NET_SCH_TEQL is not set 654# CONFIG_NET_SCH_TEQL is not set
@@ -630,6 +656,7 @@ CONFIG_NET_SCHED=y
630# CONFIG_NET_SCH_GRED is not set 656# CONFIG_NET_SCH_GRED is not set
631# CONFIG_NET_SCH_DSMARK is not set 657# CONFIG_NET_SCH_DSMARK is not set
632# CONFIG_NET_SCH_NETEM is not set 658# CONFIG_NET_SCH_NETEM is not set
659# CONFIG_NET_SCH_DRR is not set
633# CONFIG_NET_SCH_INGRESS is not set 660# CONFIG_NET_SCH_INGRESS is not set
634 661
635# 662#
@@ -644,6 +671,7 @@ CONFIG_NET_CLS=y
644# CONFIG_NET_CLS_RSVP is not set 671# CONFIG_NET_CLS_RSVP is not set
645# CONFIG_NET_CLS_RSVP6 is not set 672# CONFIG_NET_CLS_RSVP6 is not set
646# CONFIG_NET_CLS_FLOW is not set 673# CONFIG_NET_CLS_FLOW is not set
674# CONFIG_NET_CLS_CGROUP is not set
647CONFIG_NET_EMATCH=y 675CONFIG_NET_EMATCH=y
648CONFIG_NET_EMATCH_STACK=32 676CONFIG_NET_EMATCH_STACK=32
649# CONFIG_NET_EMATCH_CMP is not set 677# CONFIG_NET_EMATCH_CMP is not set
@@ -659,7 +687,9 @@ CONFIG_NET_CLS_ACT=y
659# CONFIG_NET_ACT_NAT is not set 687# CONFIG_NET_ACT_NAT is not set
660# CONFIG_NET_ACT_PEDIT is not set 688# CONFIG_NET_ACT_PEDIT is not set
661# CONFIG_NET_ACT_SIMP is not set 689# CONFIG_NET_ACT_SIMP is not set
690# CONFIG_NET_ACT_SKBEDIT is not set
662CONFIG_NET_SCH_FIFO=y 691CONFIG_NET_SCH_FIFO=y
692# CONFIG_DCB is not set
663 693
664# 694#
665# Network testing 695# Network testing
@@ -676,29 +706,33 @@ CONFIG_HAMRADIO=y
676# CONFIG_IRDA is not set 706# CONFIG_IRDA is not set
677# CONFIG_BT is not set 707# CONFIG_BT is not set
678# CONFIG_AF_RXRPC is not set 708# CONFIG_AF_RXRPC is not set
709# CONFIG_PHONET is not set
679CONFIG_FIB_RULES=y 710CONFIG_FIB_RULES=y
680 711CONFIG_WIRELESS=y
681#
682# Wireless
683#
684CONFIG_CFG80211=y 712CONFIG_CFG80211=y
713# CONFIG_CFG80211_REG_DEBUG is not set
685CONFIG_NL80211=y 714CONFIG_NL80211=y
715CONFIG_WIRELESS_OLD_REGULATORY=y
686CONFIG_WIRELESS_EXT=y 716CONFIG_WIRELESS_EXT=y
687CONFIG_WIRELESS_EXT_SYSFS=y 717CONFIG_WIRELESS_EXT_SYSFS=y
718# CONFIG_LIB80211 is not set
688CONFIG_MAC80211=y 719CONFIG_MAC80211=y
689 720
690# 721#
691# Rate control algorithm selection 722# Rate control algorithm selection
692# 723#
693CONFIG_MAC80211_RC_PID=y 724CONFIG_MAC80211_RC_MINSTREL=y
694CONFIG_MAC80211_RC_DEFAULT_PID=y 725# CONFIG_MAC80211_RC_DEFAULT_PID is not set
695CONFIG_MAC80211_RC_DEFAULT="pid" 726CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
727CONFIG_MAC80211_RC_DEFAULT="minstrel"
696# CONFIG_MAC80211_MESH is not set 728# CONFIG_MAC80211_MESH is not set
697CONFIG_MAC80211_LEDS=y 729CONFIG_MAC80211_LEDS=y
698# CONFIG_MAC80211_DEBUGFS is not set 730# CONFIG_MAC80211_DEBUGFS is not set
699# CONFIG_MAC80211_DEBUG_MENU is not set 731# CONFIG_MAC80211_DEBUG_MENU is not set
700# CONFIG_IEEE80211 is not set 732# CONFIG_WIMAX is not set
701# CONFIG_RFKILL is not set 733CONFIG_RFKILL=y
734# CONFIG_RFKILL_INPUT is not set
735CONFIG_RFKILL_LEDS=y
702# CONFIG_NET_9P is not set 736# CONFIG_NET_9P is not set
703 737
704# 738#
@@ -722,7 +756,7 @@ CONFIG_PROC_EVENTS=y
722# CONFIG_MTD is not set 756# CONFIG_MTD is not set
723# CONFIG_PARPORT is not set 757# CONFIG_PARPORT is not set
724CONFIG_PNP=y 758CONFIG_PNP=y
725# CONFIG_PNP_DEBUG is not set 759CONFIG_PNP_DEBUG_MESSAGES=y
726 760
727# 761#
728# Protocols 762# Protocols
@@ -750,20 +784,19 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
750CONFIG_MISC_DEVICES=y 784CONFIG_MISC_DEVICES=y
751# CONFIG_IBM_ASM is not set 785# CONFIG_IBM_ASM is not set
752# CONFIG_PHANTOM is not set 786# CONFIG_PHANTOM is not set
753# CONFIG_EEPROM_93CX6 is not set
754# CONFIG_SGI_IOC4 is not set 787# CONFIG_SGI_IOC4 is not set
755# CONFIG_TIFM_CORE is not set 788# CONFIG_TIFM_CORE is not set
756# CONFIG_ACER_WMI is not set 789# CONFIG_ICS932S401 is not set
757# CONFIG_ASUS_LAPTOP is not set
758# CONFIG_FUJITSU_LAPTOP is not set
759# CONFIG_TC1100_WMI is not set
760# CONFIG_MSI_LAPTOP is not set
761# CONFIG_COMPAL_LAPTOP is not set
762# CONFIG_SONY_LAPTOP is not set
763# CONFIG_THINKPAD_ACPI is not set
764# CONFIG_INTEL_MENLOW is not set
765# CONFIG_ENCLOSURE_SERVICES is not set 790# CONFIG_ENCLOSURE_SERVICES is not set
766# CONFIG_HP_ILO is not set 791# CONFIG_HP_ILO is not set
792# CONFIG_C2PORT is not set
793
794#
795# EEPROM support
796#
797# CONFIG_EEPROM_AT24 is not set
798# CONFIG_EEPROM_LEGACY is not set
799# CONFIG_EEPROM_93CX6 is not set
767CONFIG_HAVE_IDE=y 800CONFIG_HAVE_IDE=y
768# CONFIG_IDE is not set 801# CONFIG_IDE is not set
769 802
@@ -802,7 +835,7 @@ CONFIG_SCSI_WAIT_SCAN=m
802# 835#
803CONFIG_SCSI_SPI_ATTRS=y 836CONFIG_SCSI_SPI_ATTRS=y
804# CONFIG_SCSI_FC_ATTRS is not set 837# CONFIG_SCSI_FC_ATTRS is not set
805CONFIG_SCSI_ISCSI_ATTRS=y 838# CONFIG_SCSI_ISCSI_ATTRS is not set
806# CONFIG_SCSI_SAS_ATTRS is not set 839# CONFIG_SCSI_SAS_ATTRS is not set
807# CONFIG_SCSI_SAS_LIBSAS is not set 840# CONFIG_SCSI_SAS_LIBSAS is not set
808# CONFIG_SCSI_SRP_ATTRS is not set 841# CONFIG_SCSI_SRP_ATTRS is not set
@@ -875,6 +908,7 @@ CONFIG_PATA_OLDPIIX=y
875CONFIG_PATA_SCH=y 908CONFIG_PATA_SCH=y
876CONFIG_MD=y 909CONFIG_MD=y
877CONFIG_BLK_DEV_MD=y 910CONFIG_BLK_DEV_MD=y
911CONFIG_MD_AUTODETECT=y
878# CONFIG_MD_LINEAR is not set 912# CONFIG_MD_LINEAR is not set
879# CONFIG_MD_RAID0 is not set 913# CONFIG_MD_RAID0 is not set
880# CONFIG_MD_RAID1 is not set 914# CONFIG_MD_RAID1 is not set
@@ -930,6 +964,9 @@ CONFIG_PHYLIB=y
930# CONFIG_BROADCOM_PHY is not set 964# CONFIG_BROADCOM_PHY is not set
931# CONFIG_ICPLUS_PHY is not set 965# CONFIG_ICPLUS_PHY is not set
932# CONFIG_REALTEK_PHY is not set 966# CONFIG_REALTEK_PHY is not set
967# CONFIG_NATIONAL_PHY is not set
968# CONFIG_STE10XP is not set
969# CONFIG_LSI_ET1011C_PHY is not set
933# CONFIG_FIXED_PHY is not set 970# CONFIG_FIXED_PHY is not set
934# CONFIG_MDIO_BITBANG is not set 971# CONFIG_MDIO_BITBANG is not set
935CONFIG_NET_ETHERNET=y 972CONFIG_NET_ETHERNET=y
@@ -953,6 +990,9 @@ CONFIG_NET_TULIP=y
953# CONFIG_IBM_NEW_EMAC_RGMII is not set 990# CONFIG_IBM_NEW_EMAC_RGMII is not set
954# CONFIG_IBM_NEW_EMAC_TAH is not set 991# CONFIG_IBM_NEW_EMAC_TAH is not set
955# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 992# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
993# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
994# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
995# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
956CONFIG_NET_PCI=y 996CONFIG_NET_PCI=y
957# CONFIG_PCNET32 is not set 997# CONFIG_PCNET32 is not set
958# CONFIG_AMD8111_ETH is not set 998# CONFIG_AMD8111_ETH is not set
@@ -960,7 +1000,6 @@ CONFIG_NET_PCI=y
960# CONFIG_B44 is not set 1000# CONFIG_B44 is not set
961CONFIG_FORCEDETH=y 1001CONFIG_FORCEDETH=y
962# CONFIG_FORCEDETH_NAPI is not set 1002# CONFIG_FORCEDETH_NAPI is not set
963# CONFIG_EEPRO100 is not set
964CONFIG_E100=y 1003CONFIG_E100=y
965# CONFIG_FEALNX is not set 1004# CONFIG_FEALNX is not set
966# CONFIG_NATSEMI is not set 1005# CONFIG_NATSEMI is not set
@@ -974,15 +1013,16 @@ CONFIG_8139TOO=y
974# CONFIG_R6040 is not set 1013# CONFIG_R6040 is not set
975# CONFIG_SIS900 is not set 1014# CONFIG_SIS900 is not set
976# CONFIG_EPIC100 is not set 1015# CONFIG_EPIC100 is not set
1016# CONFIG_SMSC9420 is not set
977# CONFIG_SUNDANCE is not set 1017# CONFIG_SUNDANCE is not set
978# CONFIG_TLAN is not set 1018# CONFIG_TLAN is not set
979# CONFIG_VIA_RHINE is not set 1019# CONFIG_VIA_RHINE is not set
980# CONFIG_SC92031 is not set 1020# CONFIG_SC92031 is not set
1021# CONFIG_ATL2 is not set
981CONFIG_NETDEV_1000=y 1022CONFIG_NETDEV_1000=y
982# CONFIG_ACENIC is not set 1023# CONFIG_ACENIC is not set
983# CONFIG_DL2K is not set 1024# CONFIG_DL2K is not set
984CONFIG_E1000=y 1025CONFIG_E1000=y
985# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
986CONFIG_E1000E=y 1026CONFIG_E1000E=y
987# CONFIG_IP1000 is not set 1027# CONFIG_IP1000 is not set
988# CONFIG_IGB is not set 1028# CONFIG_IGB is not set
@@ -1000,18 +1040,23 @@ CONFIG_BNX2=y
1000# CONFIG_QLA3XXX is not set 1040# CONFIG_QLA3XXX is not set
1001# CONFIG_ATL1 is not set 1041# CONFIG_ATL1 is not set
1002# CONFIG_ATL1E is not set 1042# CONFIG_ATL1E is not set
1043# CONFIG_JME is not set
1003CONFIG_NETDEV_10000=y 1044CONFIG_NETDEV_10000=y
1004# CONFIG_CHELSIO_T1 is not set 1045# CONFIG_CHELSIO_T1 is not set
1046CONFIG_CHELSIO_T3_DEPENDS=y
1005# CONFIG_CHELSIO_T3 is not set 1047# CONFIG_CHELSIO_T3 is not set
1048# CONFIG_ENIC is not set
1006# CONFIG_IXGBE is not set 1049# CONFIG_IXGBE is not set
1007# CONFIG_IXGB is not set 1050# CONFIG_IXGB is not set
1008# CONFIG_S2IO is not set 1051# CONFIG_S2IO is not set
1009# CONFIG_MYRI10GE is not set 1052# CONFIG_MYRI10GE is not set
1010# CONFIG_NETXEN_NIC is not set 1053# CONFIG_NETXEN_NIC is not set
1011# CONFIG_NIU is not set 1054# CONFIG_NIU is not set
1055# CONFIG_MLX4_EN is not set
1012# CONFIG_MLX4_CORE is not set 1056# CONFIG_MLX4_CORE is not set
1013# CONFIG_TEHUTI is not set 1057# CONFIG_TEHUTI is not set
1014# CONFIG_BNX2X is not set 1058# CONFIG_BNX2X is not set
1059# CONFIG_QLGE is not set
1015# CONFIG_SFC is not set 1060# CONFIG_SFC is not set
1016CONFIG_TR=y 1061CONFIG_TR=y
1017# CONFIG_IBMOL is not set 1062# CONFIG_IBMOL is not set
@@ -1025,9 +1070,8 @@ CONFIG_TR=y
1025# CONFIG_WLAN_PRE80211 is not set 1070# CONFIG_WLAN_PRE80211 is not set
1026CONFIG_WLAN_80211=y 1071CONFIG_WLAN_80211=y
1027# CONFIG_PCMCIA_RAYCS is not set 1072# CONFIG_PCMCIA_RAYCS is not set
1028# CONFIG_IPW2100 is not set
1029# CONFIG_IPW2200 is not set
1030# CONFIG_LIBERTAS is not set 1073# CONFIG_LIBERTAS is not set
1074# CONFIG_LIBERTAS_THINFIRM is not set
1031# CONFIG_AIRO is not set 1075# CONFIG_AIRO is not set
1032# CONFIG_HERMES is not set 1076# CONFIG_HERMES is not set
1033# CONFIG_ATMEL is not set 1077# CONFIG_ATMEL is not set
@@ -1044,6 +1088,8 @@ CONFIG_WLAN_80211=y
1044CONFIG_ATH5K=y 1088CONFIG_ATH5K=y
1045# CONFIG_ATH5K_DEBUG is not set 1089# CONFIG_ATH5K_DEBUG is not set
1046# CONFIG_ATH9K is not set 1090# CONFIG_ATH9K is not set
1091# CONFIG_IPW2100 is not set
1092# CONFIG_IPW2200 is not set
1047# CONFIG_IWLCORE is not set 1093# CONFIG_IWLCORE is not set
1048# CONFIG_IWLWIFI_LEDS is not set 1094# CONFIG_IWLWIFI_LEDS is not set
1049# CONFIG_IWLAGN is not set 1095# CONFIG_IWLAGN is not set
@@ -1055,6 +1101,10 @@ CONFIG_ATH5K=y
1055# CONFIG_RT2X00 is not set 1101# CONFIG_RT2X00 is not set
1056 1102
1057# 1103#
1104# Enable WiMAX (Networking options) to see the WiMAX drivers
1105#
1106
1107#
1058# USB Network Adapters 1108# USB Network Adapters
1059# 1109#
1060# CONFIG_USB_CATC is not set 1110# CONFIG_USB_CATC is not set
@@ -1062,6 +1112,7 @@ CONFIG_ATH5K=y
1062# CONFIG_USB_PEGASUS is not set 1112# CONFIG_USB_PEGASUS is not set
1063# CONFIG_USB_RTL8150 is not set 1113# CONFIG_USB_RTL8150 is not set
1064# CONFIG_USB_USBNET is not set 1114# CONFIG_USB_USBNET is not set
1115# CONFIG_USB_HSO is not set
1065CONFIG_NET_PCMCIA=y 1116CONFIG_NET_PCMCIA=y
1066# CONFIG_PCMCIA_3C589 is not set 1117# CONFIG_PCMCIA_3C589 is not set
1067# CONFIG_PCMCIA_3C574 is not set 1118# CONFIG_PCMCIA_3C574 is not set
@@ -1123,6 +1174,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
1123CONFIG_MOUSE_PS2_SYNAPTICS=y 1174CONFIG_MOUSE_PS2_SYNAPTICS=y
1124CONFIG_MOUSE_PS2_LIFEBOOK=y 1175CONFIG_MOUSE_PS2_LIFEBOOK=y
1125CONFIG_MOUSE_PS2_TRACKPOINT=y 1176CONFIG_MOUSE_PS2_TRACKPOINT=y
1177# CONFIG_MOUSE_PS2_ELANTECH is not set
1126# CONFIG_MOUSE_PS2_TOUCHKIT is not set 1178# CONFIG_MOUSE_PS2_TOUCHKIT is not set
1127# CONFIG_MOUSE_SERIAL is not set 1179# CONFIG_MOUSE_SERIAL is not set
1128# CONFIG_MOUSE_APPLETOUCH is not set 1180# CONFIG_MOUSE_APPLETOUCH is not set
@@ -1160,15 +1212,16 @@ CONFIG_INPUT_TOUCHSCREEN=y
1160# CONFIG_TOUCHSCREEN_FUJITSU is not set 1212# CONFIG_TOUCHSCREEN_FUJITSU is not set
1161# CONFIG_TOUCHSCREEN_GUNZE is not set 1213# CONFIG_TOUCHSCREEN_GUNZE is not set
1162# CONFIG_TOUCHSCREEN_ELO is not set 1214# CONFIG_TOUCHSCREEN_ELO is not set
1215# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
1163# CONFIG_TOUCHSCREEN_MTOUCH is not set 1216# CONFIG_TOUCHSCREEN_MTOUCH is not set
1164# CONFIG_TOUCHSCREEN_INEXIO is not set 1217# CONFIG_TOUCHSCREEN_INEXIO is not set
1165# CONFIG_TOUCHSCREEN_MK712 is not set 1218# CONFIG_TOUCHSCREEN_MK712 is not set
1166# CONFIG_TOUCHSCREEN_PENMOUNT is not set 1219# CONFIG_TOUCHSCREEN_PENMOUNT is not set
1167# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 1220# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
1168# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 1221# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
1169# CONFIG_TOUCHSCREEN_UCB1400 is not set
1170# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 1222# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
1171# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 1223# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
1224# CONFIG_TOUCHSCREEN_TSC2007 is not set
1172CONFIG_INPUT_MISC=y 1225CONFIG_INPUT_MISC=y
1173# CONFIG_INPUT_PCSPKR is not set 1226# CONFIG_INPUT_PCSPKR is not set
1174# CONFIG_INPUT_APANEL is not set 1227# CONFIG_INPUT_APANEL is not set
@@ -1179,6 +1232,7 @@ CONFIG_INPUT_MISC=y
1179# CONFIG_INPUT_KEYSPAN_REMOTE is not set 1232# CONFIG_INPUT_KEYSPAN_REMOTE is not set
1180# CONFIG_INPUT_POWERMATE is not set 1233# CONFIG_INPUT_POWERMATE is not set
1181# CONFIG_INPUT_YEALINK is not set 1234# CONFIG_INPUT_YEALINK is not set
1235# CONFIG_INPUT_CM109 is not set
1182# CONFIG_INPUT_UINPUT is not set 1236# CONFIG_INPUT_UINPUT is not set
1183 1237
1184# 1238#
@@ -1245,6 +1299,7 @@ CONFIG_SERIAL_CORE=y
1245CONFIG_SERIAL_CORE_CONSOLE=y 1299CONFIG_SERIAL_CORE_CONSOLE=y
1246# CONFIG_SERIAL_JSM is not set 1300# CONFIG_SERIAL_JSM is not set
1247CONFIG_UNIX98_PTYS=y 1301CONFIG_UNIX98_PTYS=y
1302# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
1248# CONFIG_LEGACY_PTYS is not set 1303# CONFIG_LEGACY_PTYS is not set
1249# CONFIG_IPMI_HANDLER is not set 1304# CONFIG_IPMI_HANDLER is not set
1250CONFIG_HW_RANDOM=y 1305CONFIG_HW_RANDOM=y
@@ -1279,6 +1334,7 @@ CONFIG_I2C=y
1279CONFIG_I2C_BOARDINFO=y 1334CONFIG_I2C_BOARDINFO=y
1280# CONFIG_I2C_CHARDEV is not set 1335# CONFIG_I2C_CHARDEV is not set
1281CONFIG_I2C_HELPER_AUTO=y 1336CONFIG_I2C_HELPER_AUTO=y
1337CONFIG_I2C_ALGOBIT=y
1282 1338
1283# 1339#
1284# I2C Hardware Bus support 1340# I2C Hardware Bus support
@@ -1331,8 +1387,6 @@ CONFIG_I2C_I801=y
1331# Miscellaneous I2C Chip support 1387# Miscellaneous I2C Chip support
1332# 1388#
1333# CONFIG_DS1682 is not set 1389# CONFIG_DS1682 is not set
1334# CONFIG_EEPROM_AT24 is not set
1335# CONFIG_EEPROM_LEGACY is not set
1336# CONFIG_SENSORS_PCF8574 is not set 1390# CONFIG_SENSORS_PCF8574 is not set
1337# CONFIG_PCF8575 is not set 1391# CONFIG_PCF8575 is not set
1338# CONFIG_SENSORS_PCA9539 is not set 1392# CONFIG_SENSORS_PCA9539 is not set
@@ -1351,8 +1405,78 @@ CONFIG_POWER_SUPPLY=y
1351# CONFIG_POWER_SUPPLY_DEBUG is not set 1405# CONFIG_POWER_SUPPLY_DEBUG is not set
1352# CONFIG_PDA_POWER is not set 1406# CONFIG_PDA_POWER is not set
1353# CONFIG_BATTERY_DS2760 is not set 1407# CONFIG_BATTERY_DS2760 is not set
1354# CONFIG_HWMON is not set 1408# CONFIG_BATTERY_BQ27x00 is not set
1409CONFIG_HWMON=y
1410# CONFIG_HWMON_VID is not set
1411# CONFIG_SENSORS_ABITUGURU is not set
1412# CONFIG_SENSORS_ABITUGURU3 is not set
1413# CONFIG_SENSORS_AD7414 is not set
1414# CONFIG_SENSORS_AD7418 is not set
1415# CONFIG_SENSORS_ADM1021 is not set
1416# CONFIG_SENSORS_ADM1025 is not set
1417# CONFIG_SENSORS_ADM1026 is not set
1418# CONFIG_SENSORS_ADM1029 is not set
1419# CONFIG_SENSORS_ADM1031 is not set
1420# CONFIG_SENSORS_ADM9240 is not set
1421# CONFIG_SENSORS_ADT7462 is not set
1422# CONFIG_SENSORS_ADT7470 is not set
1423# CONFIG_SENSORS_ADT7473 is not set
1424# CONFIG_SENSORS_ADT7475 is not set
1425# CONFIG_SENSORS_K8TEMP is not set
1426# CONFIG_SENSORS_ASB100 is not set
1427# CONFIG_SENSORS_ATXP1 is not set
1428# CONFIG_SENSORS_DS1621 is not set
1429# CONFIG_SENSORS_I5K_AMB is not set
1430# CONFIG_SENSORS_F71805F is not set
1431# CONFIG_SENSORS_F71882FG is not set
1432# CONFIG_SENSORS_F75375S is not set
1433# CONFIG_SENSORS_FSCHER is not set
1434# CONFIG_SENSORS_FSCPOS is not set
1435# CONFIG_SENSORS_FSCHMD is not set
1436# CONFIG_SENSORS_GL518SM is not set
1437# CONFIG_SENSORS_GL520SM is not set
1438# CONFIG_SENSORS_CORETEMP is not set
1439# CONFIG_SENSORS_IT87 is not set
1440# CONFIG_SENSORS_LM63 is not set
1441# CONFIG_SENSORS_LM75 is not set
1442# CONFIG_SENSORS_LM77 is not set
1443# CONFIG_SENSORS_LM78 is not set
1444# CONFIG_SENSORS_LM80 is not set
1445# CONFIG_SENSORS_LM83 is not set
1446# CONFIG_SENSORS_LM85 is not set
1447# CONFIG_SENSORS_LM87 is not set
1448# CONFIG_SENSORS_LM90 is not set
1449# CONFIG_SENSORS_LM92 is not set
1450# CONFIG_SENSORS_LM93 is not set
1451# CONFIG_SENSORS_LTC4245 is not set
1452# CONFIG_SENSORS_MAX1619 is not set
1453# CONFIG_SENSORS_MAX6650 is not set
1454# CONFIG_SENSORS_PC87360 is not set
1455# CONFIG_SENSORS_PC87427 is not set
1456# CONFIG_SENSORS_SIS5595 is not set
1457# CONFIG_SENSORS_DME1737 is not set
1458# CONFIG_SENSORS_SMSC47M1 is not set
1459# CONFIG_SENSORS_SMSC47M192 is not set
1460# CONFIG_SENSORS_SMSC47B397 is not set
1461# CONFIG_SENSORS_ADS7828 is not set
1462# CONFIG_SENSORS_THMC50 is not set
1463# CONFIG_SENSORS_VIA686A is not set
1464# CONFIG_SENSORS_VT1211 is not set
1465# CONFIG_SENSORS_VT8231 is not set
1466# CONFIG_SENSORS_W83781D is not set
1467# CONFIG_SENSORS_W83791D is not set
1468# CONFIG_SENSORS_W83792D is not set
1469# CONFIG_SENSORS_W83793 is not set
1470# CONFIG_SENSORS_W83L785TS is not set
1471# CONFIG_SENSORS_W83L786NG is not set
1472# CONFIG_SENSORS_W83627HF is not set
1473# CONFIG_SENSORS_W83627EHF is not set
1474# CONFIG_SENSORS_HDAPS is not set
1475# CONFIG_SENSORS_LIS3LV02D is not set
1476# CONFIG_SENSORS_APPLESMC is not set
1477# CONFIG_HWMON_DEBUG_CHIP is not set
1355CONFIG_THERMAL=y 1478CONFIG_THERMAL=y
1479# CONFIG_THERMAL_HWMON is not set
1356CONFIG_WATCHDOG=y 1480CONFIG_WATCHDOG=y
1357# CONFIG_WATCHDOG_NOWAYOUT is not set 1481# CONFIG_WATCHDOG_NOWAYOUT is not set
1358 1482
@@ -1372,6 +1496,7 @@ CONFIG_WATCHDOG=y
1372# CONFIG_I6300ESB_WDT is not set 1496# CONFIG_I6300ESB_WDT is not set
1373# CONFIG_ITCO_WDT is not set 1497# CONFIG_ITCO_WDT is not set
1374# CONFIG_IT8712F_WDT is not set 1498# CONFIG_IT8712F_WDT is not set
1499# CONFIG_IT87_WDT is not set
1375# CONFIG_HP_WATCHDOG is not set 1500# CONFIG_HP_WATCHDOG is not set
1376# CONFIG_SC1200_WDT is not set 1501# CONFIG_SC1200_WDT is not set
1377# CONFIG_PC87413_WDT is not set 1502# CONFIG_PC87413_WDT is not set
@@ -1379,9 +1504,11 @@ CONFIG_WATCHDOG=y
1379# CONFIG_SBC8360_WDT is not set 1504# CONFIG_SBC8360_WDT is not set
1380# CONFIG_SBC7240_WDT is not set 1505# CONFIG_SBC7240_WDT is not set
1381# CONFIG_CPU5_WDT is not set 1506# CONFIG_CPU5_WDT is not set
1507# CONFIG_SMSC_SCH311X_WDT is not set
1382# CONFIG_SMSC37B787_WDT is not set 1508# CONFIG_SMSC37B787_WDT is not set
1383# CONFIG_W83627HF_WDT is not set 1509# CONFIG_W83627HF_WDT is not set
1384# CONFIG_W83697HF_WDT is not set 1510# CONFIG_W83697HF_WDT is not set
1511# CONFIG_W83697UG_WDT is not set
1385# CONFIG_W83877F_WDT is not set 1512# CONFIG_W83877F_WDT is not set
1386# CONFIG_W83977F_WDT is not set 1513# CONFIG_W83977F_WDT is not set
1387# CONFIG_MACHZ_WDT is not set 1514# CONFIG_MACHZ_WDT is not set
@@ -1397,11 +1524,11 @@ CONFIG_WATCHDOG=y
1397# USB-based Watchdog Cards 1524# USB-based Watchdog Cards
1398# 1525#
1399# CONFIG_USBPCWATCHDOG is not set 1526# CONFIG_USBPCWATCHDOG is not set
1527CONFIG_SSB_POSSIBLE=y
1400 1528
1401# 1529#
1402# Sonics Silicon Backplane 1530# Sonics Silicon Backplane
1403# 1531#
1404CONFIG_SSB_POSSIBLE=y
1405# CONFIG_SSB is not set 1532# CONFIG_SSB is not set
1406 1533
1407# 1534#
@@ -1410,7 +1537,13 @@ CONFIG_SSB_POSSIBLE=y
1410# CONFIG_MFD_CORE is not set 1537# CONFIG_MFD_CORE is not set
1411# CONFIG_MFD_SM501 is not set 1538# CONFIG_MFD_SM501 is not set
1412# CONFIG_HTC_PASIC3 is not set 1539# CONFIG_HTC_PASIC3 is not set
1540# CONFIG_TWL4030_CORE is not set
1413# CONFIG_MFD_TMIO is not set 1541# CONFIG_MFD_TMIO is not set
1542# CONFIG_PMIC_DA903X is not set
1543# CONFIG_MFD_WM8400 is not set
1544# CONFIG_MFD_WM8350_I2C is not set
1545# CONFIG_MFD_PCF50633 is not set
1546# CONFIG_REGULATOR is not set
1414 1547
1415# 1548#
1416# Multimedia devices 1549# Multimedia devices
@@ -1450,6 +1583,7 @@ CONFIG_DRM=y
1450# CONFIG_DRM_I810 is not set 1583# CONFIG_DRM_I810 is not set
1451# CONFIG_DRM_I830 is not set 1584# CONFIG_DRM_I830 is not set
1452CONFIG_DRM_I915=y 1585CONFIG_DRM_I915=y
1586# CONFIG_DRM_I915_KMS is not set
1453# CONFIG_DRM_MGA is not set 1587# CONFIG_DRM_MGA is not set
1454# CONFIG_DRM_SIS is not set 1588# CONFIG_DRM_SIS is not set
1455# CONFIG_DRM_VIA is not set 1589# CONFIG_DRM_VIA is not set
@@ -1459,6 +1593,7 @@ CONFIG_DRM_I915=y
1459CONFIG_FB=y 1593CONFIG_FB=y
1460# CONFIG_FIRMWARE_EDID is not set 1594# CONFIG_FIRMWARE_EDID is not set
1461# CONFIG_FB_DDC is not set 1595# CONFIG_FB_DDC is not set
1596# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1462CONFIG_FB_CFB_FILLRECT=y 1597CONFIG_FB_CFB_FILLRECT=y
1463CONFIG_FB_CFB_COPYAREA=y 1598CONFIG_FB_CFB_COPYAREA=y
1464CONFIG_FB_CFB_IMAGEBLIT=y 1599CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1487,7 +1622,6 @@ CONFIG_FB_TILEBLITTING=y
1487# CONFIG_FB_UVESA is not set 1622# CONFIG_FB_UVESA is not set
1488# CONFIG_FB_VESA is not set 1623# CONFIG_FB_VESA is not set
1489CONFIG_FB_EFI=y 1624CONFIG_FB_EFI=y
1490# CONFIG_FB_IMAC is not set
1491# CONFIG_FB_N411 is not set 1625# CONFIG_FB_N411 is not set
1492# CONFIG_FB_HGA is not set 1626# CONFIG_FB_HGA is not set
1493# CONFIG_FB_S1D13XXX is not set 1627# CONFIG_FB_S1D13XXX is not set
@@ -1503,6 +1637,7 @@ CONFIG_FB_EFI=y
1503# CONFIG_FB_S3 is not set 1637# CONFIG_FB_S3 is not set
1504# CONFIG_FB_SAVAGE is not set 1638# CONFIG_FB_SAVAGE is not set
1505# CONFIG_FB_SIS is not set 1639# CONFIG_FB_SIS is not set
1640# CONFIG_FB_VIA is not set
1506# CONFIG_FB_NEOMAGIC is not set 1641# CONFIG_FB_NEOMAGIC is not set
1507# CONFIG_FB_KYRO is not set 1642# CONFIG_FB_KYRO is not set
1508# CONFIG_FB_3DFX is not set 1643# CONFIG_FB_3DFX is not set
@@ -1515,12 +1650,15 @@ CONFIG_FB_EFI=y
1515# CONFIG_FB_CARMINE is not set 1650# CONFIG_FB_CARMINE is not set
1516# CONFIG_FB_GEODE is not set 1651# CONFIG_FB_GEODE is not set
1517# CONFIG_FB_VIRTUAL is not set 1652# CONFIG_FB_VIRTUAL is not set
1653# CONFIG_FB_METRONOME is not set
1654# CONFIG_FB_MB862XX is not set
1518CONFIG_BACKLIGHT_LCD_SUPPORT=y 1655CONFIG_BACKLIGHT_LCD_SUPPORT=y
1519# CONFIG_LCD_CLASS_DEVICE is not set 1656# CONFIG_LCD_CLASS_DEVICE is not set
1520CONFIG_BACKLIGHT_CLASS_DEVICE=y 1657CONFIG_BACKLIGHT_CLASS_DEVICE=y
1521# CONFIG_BACKLIGHT_CORGI is not set 1658CONFIG_BACKLIGHT_GENERIC=y
1522# CONFIG_BACKLIGHT_PROGEAR is not set 1659# CONFIG_BACKLIGHT_PROGEAR is not set
1523# CONFIG_BACKLIGHT_MBP_NVIDIA is not set 1660# CONFIG_BACKLIGHT_MBP_NVIDIA is not set
1661# CONFIG_BACKLIGHT_SAHARA is not set
1524 1662
1525# 1663#
1526# Display device support 1664# Display device support
@@ -1540,10 +1678,12 @@ CONFIG_LOGO=y
1540# CONFIG_LOGO_LINUX_VGA16 is not set 1678# CONFIG_LOGO_LINUX_VGA16 is not set
1541CONFIG_LOGO_LINUX_CLUT224=y 1679CONFIG_LOGO_LINUX_CLUT224=y
1542CONFIG_SOUND=y 1680CONFIG_SOUND=y
1681CONFIG_SOUND_OSS_CORE=y
1543CONFIG_SND=y 1682CONFIG_SND=y
1544CONFIG_SND_TIMER=y 1683CONFIG_SND_TIMER=y
1545CONFIG_SND_PCM=y 1684CONFIG_SND_PCM=y
1546CONFIG_SND_HWDEP=y 1685CONFIG_SND_HWDEP=y
1686CONFIG_SND_JACK=y
1547CONFIG_SND_SEQUENCER=y 1687CONFIG_SND_SEQUENCER=y
1548CONFIG_SND_SEQ_DUMMY=y 1688CONFIG_SND_SEQ_DUMMY=y
1549CONFIG_SND_OSSEMUL=y 1689CONFIG_SND_OSSEMUL=y
@@ -1551,6 +1691,8 @@ CONFIG_SND_MIXER_OSS=y
1551CONFIG_SND_PCM_OSS=y 1691CONFIG_SND_PCM_OSS=y
1552CONFIG_SND_PCM_OSS_PLUGINS=y 1692CONFIG_SND_PCM_OSS_PLUGINS=y
1553CONFIG_SND_SEQUENCER_OSS=y 1693CONFIG_SND_SEQUENCER_OSS=y
1694CONFIG_SND_HRTIMER=y
1695CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
1554CONFIG_SND_DYNAMIC_MINORS=y 1696CONFIG_SND_DYNAMIC_MINORS=y
1555CONFIG_SND_SUPPORT_OLD_API=y 1697CONFIG_SND_SUPPORT_OLD_API=y
1556CONFIG_SND_VERBOSE_PROCFS=y 1698CONFIG_SND_VERBOSE_PROCFS=y
@@ -1605,11 +1747,16 @@ CONFIG_SND_PCI=y
1605# CONFIG_SND_FM801 is not set 1747# CONFIG_SND_FM801 is not set
1606CONFIG_SND_HDA_INTEL=y 1748CONFIG_SND_HDA_INTEL=y
1607CONFIG_SND_HDA_HWDEP=y 1749CONFIG_SND_HDA_HWDEP=y
1750# CONFIG_SND_HDA_RECONFIG is not set
1751# CONFIG_SND_HDA_INPUT_BEEP is not set
1608CONFIG_SND_HDA_CODEC_REALTEK=y 1752CONFIG_SND_HDA_CODEC_REALTEK=y
1609CONFIG_SND_HDA_CODEC_ANALOG=y 1753CONFIG_SND_HDA_CODEC_ANALOG=y
1610CONFIG_SND_HDA_CODEC_SIGMATEL=y 1754CONFIG_SND_HDA_CODEC_SIGMATEL=y
1611CONFIG_SND_HDA_CODEC_VIA=y 1755CONFIG_SND_HDA_CODEC_VIA=y
1612CONFIG_SND_HDA_CODEC_ATIHDMI=y 1756CONFIG_SND_HDA_CODEC_ATIHDMI=y
1757CONFIG_SND_HDA_CODEC_NVHDMI=y
1758CONFIG_SND_HDA_CODEC_INTELHDMI=y
1759CONFIG_SND_HDA_ELD=y
1613CONFIG_SND_HDA_CODEC_CONEXANT=y 1760CONFIG_SND_HDA_CODEC_CONEXANT=y
1614CONFIG_SND_HDA_CODEC_CMEDIA=y 1761CONFIG_SND_HDA_CODEC_CMEDIA=y
1615CONFIG_SND_HDA_CODEC_SI3054=y 1762CONFIG_SND_HDA_CODEC_SI3054=y
@@ -1643,6 +1790,7 @@ CONFIG_SND_USB=y
1643# CONFIG_SND_USB_AUDIO is not set 1790# CONFIG_SND_USB_AUDIO is not set
1644# CONFIG_SND_USB_USX2Y is not set 1791# CONFIG_SND_USB_USX2Y is not set
1645# CONFIG_SND_USB_CAIAQ is not set 1792# CONFIG_SND_USB_CAIAQ is not set
1793# CONFIG_SND_USB_US122L is not set
1646CONFIG_SND_PCMCIA=y 1794CONFIG_SND_PCMCIA=y
1647# CONFIG_SND_VXPOCKET is not set 1795# CONFIG_SND_VXPOCKET is not set
1648# CONFIG_SND_PDAUDIOCF is not set 1796# CONFIG_SND_PDAUDIOCF is not set
@@ -1657,15 +1805,37 @@ CONFIG_HIDRAW=y
1657# USB Input Devices 1805# USB Input Devices
1658# 1806#
1659CONFIG_USB_HID=y 1807CONFIG_USB_HID=y
1660CONFIG_USB_HIDINPUT_POWERBOOK=y
1661CONFIG_HID_FF=y
1662CONFIG_HID_PID=y 1808CONFIG_HID_PID=y
1809CONFIG_USB_HIDDEV=y
1810
1811#
1812# Special HID drivers
1813#
1814CONFIG_HID_COMPAT=y
1815CONFIG_HID_A4TECH=y
1816CONFIG_HID_APPLE=y
1817CONFIG_HID_BELKIN=y
1818CONFIG_HID_CHERRY=y
1819CONFIG_HID_CHICONY=y
1820CONFIG_HID_CYPRESS=y
1821CONFIG_HID_EZKEY=y
1822CONFIG_HID_GYRATION=y
1823CONFIG_HID_LOGITECH=y
1663CONFIG_LOGITECH_FF=y 1824CONFIG_LOGITECH_FF=y
1664# CONFIG_LOGIRUMBLEPAD2_FF is not set 1825# CONFIG_LOGIRUMBLEPAD2_FF is not set
1826CONFIG_HID_MICROSOFT=y
1827CONFIG_HID_MONTEREY=y
1828CONFIG_HID_NTRIG=y
1829CONFIG_HID_PANTHERLORD=y
1665CONFIG_PANTHERLORD_FF=y 1830CONFIG_PANTHERLORD_FF=y
1831CONFIG_HID_PETALYNX=y
1832CONFIG_HID_SAMSUNG=y
1833CONFIG_HID_SONY=y
1834CONFIG_HID_SUNPLUS=y
1835# CONFIG_GREENASIA_FF is not set
1836CONFIG_HID_TOPSEED=y
1666CONFIG_THRUSTMASTER_FF=y 1837CONFIG_THRUSTMASTER_FF=y
1667CONFIG_ZEROPLUS_FF=y 1838CONFIG_ZEROPLUS_FF=y
1668CONFIG_USB_HIDDEV=y
1669CONFIG_USB_SUPPORT=y 1839CONFIG_USB_SUPPORT=y
1670CONFIG_USB_ARCH_HAS_HCD=y 1840CONFIG_USB_ARCH_HAS_HCD=y
1671CONFIG_USB_ARCH_HAS_OHCI=y 1841CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1683,6 +1853,8 @@ CONFIG_USB_DEVICEFS=y
1683CONFIG_USB_SUSPEND=y 1853CONFIG_USB_SUSPEND=y
1684# CONFIG_USB_OTG is not set 1854# CONFIG_USB_OTG is not set
1685CONFIG_USB_MON=y 1855CONFIG_USB_MON=y
1856# CONFIG_USB_WUSB is not set
1857# CONFIG_USB_WUSB_CBAF is not set
1686 1858
1687# 1859#
1688# USB Host Controller Drivers 1860# USB Host Controller Drivers
@@ -1691,6 +1863,7 @@ CONFIG_USB_MON=y
1691CONFIG_USB_EHCI_HCD=y 1863CONFIG_USB_EHCI_HCD=y
1692# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1864# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1693# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1865# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1866# CONFIG_USB_OXU210HP_HCD is not set
1694# CONFIG_USB_ISP116X_HCD is not set 1867# CONFIG_USB_ISP116X_HCD is not set
1695# CONFIG_USB_ISP1760_HCD is not set 1868# CONFIG_USB_ISP1760_HCD is not set
1696CONFIG_USB_OHCI_HCD=y 1869CONFIG_USB_OHCI_HCD=y
@@ -1700,6 +1873,8 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1700CONFIG_USB_UHCI_HCD=y 1873CONFIG_USB_UHCI_HCD=y
1701# CONFIG_USB_SL811_HCD is not set 1874# CONFIG_USB_SL811_HCD is not set
1702# CONFIG_USB_R8A66597_HCD is not set 1875# CONFIG_USB_R8A66597_HCD is not set
1876# CONFIG_USB_WHCI_HCD is not set
1877# CONFIG_USB_HWA_HCD is not set
1703 1878
1704# 1879#
1705# USB Device Class drivers 1880# USB Device Class drivers
@@ -1707,20 +1882,20 @@ CONFIG_USB_UHCI_HCD=y
1707# CONFIG_USB_ACM is not set 1882# CONFIG_USB_ACM is not set
1708CONFIG_USB_PRINTER=y 1883CONFIG_USB_PRINTER=y
1709# CONFIG_USB_WDM is not set 1884# CONFIG_USB_WDM is not set
1885# CONFIG_USB_TMC is not set
1710 1886
1711# 1887#
1712# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1888# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1713# 1889#
1714 1890
1715# 1891#
1716# may also be needed; see USB_STORAGE Help for more information 1892# see USB_STORAGE Help for more information
1717# 1893#
1718CONFIG_USB_STORAGE=y 1894CONFIG_USB_STORAGE=y
1719# CONFIG_USB_STORAGE_DEBUG is not set 1895# CONFIG_USB_STORAGE_DEBUG is not set
1720# CONFIG_USB_STORAGE_DATAFAB is not set 1896# CONFIG_USB_STORAGE_DATAFAB is not set
1721# CONFIG_USB_STORAGE_FREECOM is not set 1897# CONFIG_USB_STORAGE_FREECOM is not set
1722# CONFIG_USB_STORAGE_ISD200 is not set 1898# CONFIG_USB_STORAGE_ISD200 is not set
1723# CONFIG_USB_STORAGE_DPCM is not set
1724# CONFIG_USB_STORAGE_USBAT is not set 1899# CONFIG_USB_STORAGE_USBAT is not set
1725# CONFIG_USB_STORAGE_SDDR09 is not set 1900# CONFIG_USB_STORAGE_SDDR09 is not set
1726# CONFIG_USB_STORAGE_SDDR55 is not set 1901# CONFIG_USB_STORAGE_SDDR55 is not set
@@ -1728,7 +1903,6 @@ CONFIG_USB_STORAGE=y
1728# CONFIG_USB_STORAGE_ALAUDA is not set 1903# CONFIG_USB_STORAGE_ALAUDA is not set
1729# CONFIG_USB_STORAGE_ONETOUCH is not set 1904# CONFIG_USB_STORAGE_ONETOUCH is not set
1730# CONFIG_USB_STORAGE_KARMA is not set 1905# CONFIG_USB_STORAGE_KARMA is not set
1731# CONFIG_USB_STORAGE_SIERRA is not set
1732# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set 1906# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1733CONFIG_USB_LIBUSUAL=y 1907CONFIG_USB_LIBUSUAL=y
1734 1908
@@ -1749,6 +1923,7 @@ CONFIG_USB_LIBUSUAL=y
1749# CONFIG_USB_EMI62 is not set 1923# CONFIG_USB_EMI62 is not set
1750# CONFIG_USB_EMI26 is not set 1924# CONFIG_USB_EMI26 is not set
1751# CONFIG_USB_ADUTUX is not set 1925# CONFIG_USB_ADUTUX is not set
1926# CONFIG_USB_SEVSEG is not set
1752# CONFIG_USB_RIO500 is not set 1927# CONFIG_USB_RIO500 is not set
1753# CONFIG_USB_LEGOTOWER is not set 1928# CONFIG_USB_LEGOTOWER is not set
1754# CONFIG_USB_LCD is not set 1929# CONFIG_USB_LCD is not set
@@ -1766,7 +1941,13 @@ CONFIG_USB_LIBUSUAL=y
1766# CONFIG_USB_IOWARRIOR is not set 1941# CONFIG_USB_IOWARRIOR is not set
1767# CONFIG_USB_TEST is not set 1942# CONFIG_USB_TEST is not set
1768# CONFIG_USB_ISIGHTFW is not set 1943# CONFIG_USB_ISIGHTFW is not set
1944# CONFIG_USB_VST is not set
1769# CONFIG_USB_GADGET is not set 1945# CONFIG_USB_GADGET is not set
1946
1947#
1948# OTG and related infrastructure
1949#
1950# CONFIG_UWB is not set
1770# CONFIG_MMC is not set 1951# CONFIG_MMC is not set
1771# CONFIG_MEMSTICK is not set 1952# CONFIG_MEMSTICK is not set
1772CONFIG_NEW_LEDS=y 1953CONFIG_NEW_LEDS=y
@@ -1775,6 +1956,7 @@ CONFIG_LEDS_CLASS=y
1775# 1956#
1776# LED drivers 1957# LED drivers
1777# 1958#
1959# CONFIG_LEDS_ALIX2 is not set
1778# CONFIG_LEDS_PCA9532 is not set 1960# CONFIG_LEDS_PCA9532 is not set
1779# CONFIG_LEDS_CLEVO_MAIL is not set 1961# CONFIG_LEDS_CLEVO_MAIL is not set
1780# CONFIG_LEDS_PCA955X is not set 1962# CONFIG_LEDS_PCA955X is not set
@@ -1785,6 +1967,7 @@ CONFIG_LEDS_CLASS=y
1785CONFIG_LEDS_TRIGGERS=y 1967CONFIG_LEDS_TRIGGERS=y
1786# CONFIG_LEDS_TRIGGER_TIMER is not set 1968# CONFIG_LEDS_TRIGGER_TIMER is not set
1787# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set 1969# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1970# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1788# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set 1971# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1789# CONFIG_ACCESSIBILITY is not set 1972# CONFIG_ACCESSIBILITY is not set
1790# CONFIG_INFINIBAND is not set 1973# CONFIG_INFINIBAND is not set
@@ -1824,6 +2007,7 @@ CONFIG_RTC_INTF_DEV=y
1824# CONFIG_RTC_DRV_M41T80 is not set 2007# CONFIG_RTC_DRV_M41T80 is not set
1825# CONFIG_RTC_DRV_S35390A is not set 2008# CONFIG_RTC_DRV_S35390A is not set
1826# CONFIG_RTC_DRV_FM3130 is not set 2009# CONFIG_RTC_DRV_FM3130 is not set
2010# CONFIG_RTC_DRV_RX8581 is not set
1827 2011
1828# 2012#
1829# SPI RTC drivers 2013# SPI RTC drivers
@@ -1833,12 +2017,15 @@ CONFIG_RTC_INTF_DEV=y
1833# Platform RTC drivers 2017# Platform RTC drivers
1834# 2018#
1835CONFIG_RTC_DRV_CMOS=y 2019CONFIG_RTC_DRV_CMOS=y
2020# CONFIG_RTC_DRV_DS1286 is not set
1836# CONFIG_RTC_DRV_DS1511 is not set 2021# CONFIG_RTC_DRV_DS1511 is not set
1837# CONFIG_RTC_DRV_DS1553 is not set 2022# CONFIG_RTC_DRV_DS1553 is not set
1838# CONFIG_RTC_DRV_DS1742 is not set 2023# CONFIG_RTC_DRV_DS1742 is not set
1839# CONFIG_RTC_DRV_STK17TA8 is not set 2024# CONFIG_RTC_DRV_STK17TA8 is not set
1840# CONFIG_RTC_DRV_M48T86 is not set 2025# CONFIG_RTC_DRV_M48T86 is not set
2026# CONFIG_RTC_DRV_M48T35 is not set
1841# CONFIG_RTC_DRV_M48T59 is not set 2027# CONFIG_RTC_DRV_M48T59 is not set
2028# CONFIG_RTC_DRV_BQ4802 is not set
1842# CONFIG_RTC_DRV_V3020 is not set 2029# CONFIG_RTC_DRV_V3020 is not set
1843 2030
1844# 2031#
@@ -1851,6 +2038,22 @@ CONFIG_DMADEVICES=y
1851# 2038#
1852# CONFIG_INTEL_IOATDMA is not set 2039# CONFIG_INTEL_IOATDMA is not set
1853# CONFIG_UIO is not set 2040# CONFIG_UIO is not set
2041# CONFIG_STAGING is not set
2042CONFIG_X86_PLATFORM_DEVICES=y
2043# CONFIG_ACER_WMI is not set
2044# CONFIG_ASUS_LAPTOP is not set
2045# CONFIG_FUJITSU_LAPTOP is not set
2046# CONFIG_TC1100_WMI is not set
2047# CONFIG_MSI_LAPTOP is not set
2048# CONFIG_PANASONIC_LAPTOP is not set
2049# CONFIG_COMPAL_LAPTOP is not set
2050# CONFIG_SONY_LAPTOP is not set
2051# CONFIG_THINKPAD_ACPI is not set
2052# CONFIG_INTEL_MENLOW is not set
2053CONFIG_EEEPC_LAPTOP=y
2054# CONFIG_ACPI_WMI is not set
2055# CONFIG_ACPI_ASUS is not set
2056# CONFIG_ACPI_TOSHIBA is not set
1854 2057
1855# 2058#
1856# Firmware Drivers 2059# Firmware Drivers
@@ -1861,8 +2064,7 @@ CONFIG_EFI_VARS=y
1861# CONFIG_DELL_RBU is not set 2064# CONFIG_DELL_RBU is not set
1862# CONFIG_DCDBAS is not set 2065# CONFIG_DCDBAS is not set
1863CONFIG_DMIID=y 2066CONFIG_DMIID=y
1864CONFIG_ISCSI_IBFT_FIND=y 2067# CONFIG_ISCSI_IBFT_FIND is not set
1865CONFIG_ISCSI_IBFT=y
1866 2068
1867# 2069#
1868# File systems 2070# File systems
@@ -1872,21 +2074,24 @@ CONFIG_EXT3_FS=y
1872CONFIG_EXT3_FS_XATTR=y 2074CONFIG_EXT3_FS_XATTR=y
1873CONFIG_EXT3_FS_POSIX_ACL=y 2075CONFIG_EXT3_FS_POSIX_ACL=y
1874CONFIG_EXT3_FS_SECURITY=y 2076CONFIG_EXT3_FS_SECURITY=y
1875# CONFIG_EXT4DEV_FS is not set 2077# CONFIG_EXT4_FS is not set
1876CONFIG_JBD=y 2078CONFIG_JBD=y
1877# CONFIG_JBD_DEBUG is not set 2079# CONFIG_JBD_DEBUG is not set
1878CONFIG_FS_MBCACHE=y 2080CONFIG_FS_MBCACHE=y
1879# CONFIG_REISERFS_FS is not set 2081# CONFIG_REISERFS_FS is not set
1880# CONFIG_JFS_FS is not set 2082# CONFIG_JFS_FS is not set
1881CONFIG_FS_POSIX_ACL=y 2083CONFIG_FS_POSIX_ACL=y
2084CONFIG_FILE_LOCKING=y
1882# CONFIG_XFS_FS is not set 2085# CONFIG_XFS_FS is not set
1883# CONFIG_OCFS2_FS is not set 2086# CONFIG_OCFS2_FS is not set
2087# CONFIG_BTRFS_FS is not set
1884CONFIG_DNOTIFY=y 2088CONFIG_DNOTIFY=y
1885CONFIG_INOTIFY=y 2089CONFIG_INOTIFY=y
1886CONFIG_INOTIFY_USER=y 2090CONFIG_INOTIFY_USER=y
1887CONFIG_QUOTA=y 2091CONFIG_QUOTA=y
1888CONFIG_QUOTA_NETLINK_INTERFACE=y 2092CONFIG_QUOTA_NETLINK_INTERFACE=y
1889# CONFIG_PRINT_QUOTA_WARNING is not set 2093# CONFIG_PRINT_QUOTA_WARNING is not set
2094CONFIG_QUOTA_TREE=y
1890# CONFIG_QFMT_V1 is not set 2095# CONFIG_QFMT_V1 is not set
1891CONFIG_QFMT_V2=y 2096CONFIG_QFMT_V2=y
1892CONFIG_QUOTACTL=y 2097CONFIG_QUOTACTL=y
@@ -1920,16 +2125,14 @@ CONFIG_PROC_FS=y
1920CONFIG_PROC_KCORE=y 2125CONFIG_PROC_KCORE=y
1921CONFIG_PROC_VMCORE=y 2126CONFIG_PROC_VMCORE=y
1922CONFIG_PROC_SYSCTL=y 2127CONFIG_PROC_SYSCTL=y
2128CONFIG_PROC_PAGE_MONITOR=y
1923CONFIG_SYSFS=y 2129CONFIG_SYSFS=y
1924CONFIG_TMPFS=y 2130CONFIG_TMPFS=y
1925CONFIG_TMPFS_POSIX_ACL=y 2131CONFIG_TMPFS_POSIX_ACL=y
1926CONFIG_HUGETLBFS=y 2132CONFIG_HUGETLBFS=y
1927CONFIG_HUGETLB_PAGE=y 2133CONFIG_HUGETLB_PAGE=y
1928# CONFIG_CONFIGFS_FS is not set 2134# CONFIG_CONFIGFS_FS is not set
1929 2135CONFIG_MISC_FILESYSTEMS=y
1930#
1931# Miscellaneous filesystems
1932#
1933# CONFIG_ADFS_FS is not set 2136# CONFIG_ADFS_FS is not set
1934# CONFIG_AFFS_FS is not set 2137# CONFIG_AFFS_FS is not set
1935# CONFIG_ECRYPT_FS is not set 2138# CONFIG_ECRYPT_FS is not set
@@ -1939,6 +2142,7 @@ CONFIG_HUGETLB_PAGE=y
1939# CONFIG_BFS_FS is not set 2142# CONFIG_BFS_FS is not set
1940# CONFIG_EFS_FS is not set 2143# CONFIG_EFS_FS is not set
1941# CONFIG_CRAMFS is not set 2144# CONFIG_CRAMFS is not set
2145# CONFIG_SQUASHFS is not set
1942# CONFIG_VXFS_FS is not set 2146# CONFIG_VXFS_FS is not set
1943# CONFIG_MINIX_FS is not set 2147# CONFIG_MINIX_FS is not set
1944# CONFIG_OMFS_FS is not set 2148# CONFIG_OMFS_FS is not set
@@ -1960,6 +2164,7 @@ CONFIG_NFS_ACL_SUPPORT=y
1960CONFIG_NFS_COMMON=y 2164CONFIG_NFS_COMMON=y
1961CONFIG_SUNRPC=y 2165CONFIG_SUNRPC=y
1962CONFIG_SUNRPC_GSS=y 2166CONFIG_SUNRPC_GSS=y
2167# CONFIG_SUNRPC_REGISTER_V4 is not set
1963CONFIG_RPCSEC_GSS_KRB5=y 2168CONFIG_RPCSEC_GSS_KRB5=y
1964# CONFIG_RPCSEC_GSS_SPKM3 is not set 2169# CONFIG_RPCSEC_GSS_SPKM3 is not set
1965# CONFIG_SMB_FS is not set 2170# CONFIG_SMB_FS is not set
@@ -2036,7 +2241,7 @@ CONFIG_NLS_UTF8=y
2036# 2241#
2037CONFIG_TRACE_IRQFLAGS_SUPPORT=y 2242CONFIG_TRACE_IRQFLAGS_SUPPORT=y
2038CONFIG_PRINTK_TIME=y 2243CONFIG_PRINTK_TIME=y
2039CONFIG_ENABLE_WARN_DEPRECATED=y 2244# CONFIG_ENABLE_WARN_DEPRECATED is not set
2040CONFIG_ENABLE_MUST_CHECK=y 2245CONFIG_ENABLE_MUST_CHECK=y
2041CONFIG_FRAME_WARN=2048 2246CONFIG_FRAME_WARN=2048
2042CONFIG_MAGIC_SYSRQ=y 2247CONFIG_MAGIC_SYSRQ=y
@@ -2066,33 +2271,54 @@ CONFIG_TIMER_STATS=y
2066CONFIG_DEBUG_BUGVERBOSE=y 2271CONFIG_DEBUG_BUGVERBOSE=y
2067# CONFIG_DEBUG_INFO is not set 2272# CONFIG_DEBUG_INFO is not set
2068# CONFIG_DEBUG_VM is not set 2273# CONFIG_DEBUG_VM is not set
2274# CONFIG_DEBUG_VIRTUAL is not set
2069# CONFIG_DEBUG_WRITECOUNT is not set 2275# CONFIG_DEBUG_WRITECOUNT is not set
2070CONFIG_DEBUG_MEMORY_INIT=y 2276CONFIG_DEBUG_MEMORY_INIT=y
2071# CONFIG_DEBUG_LIST is not set 2277# CONFIG_DEBUG_LIST is not set
2072# CONFIG_DEBUG_SG is not set 2278# CONFIG_DEBUG_SG is not set
2279# CONFIG_DEBUG_NOTIFIERS is not set
2280CONFIG_ARCH_WANT_FRAME_POINTERS=y
2073CONFIG_FRAME_POINTER=y 2281CONFIG_FRAME_POINTER=y
2074# CONFIG_BOOT_PRINTK_DELAY is not set 2282# CONFIG_BOOT_PRINTK_DELAY is not set
2075# CONFIG_RCU_TORTURE_TEST is not set 2283# CONFIG_RCU_TORTURE_TEST is not set
2284# CONFIG_RCU_CPU_STALL_DETECTOR is not set
2076# CONFIG_KPROBES_SANITY_TEST is not set 2285# CONFIG_KPROBES_SANITY_TEST is not set
2077# CONFIG_BACKTRACE_SELF_TEST is not set 2286# CONFIG_BACKTRACE_SELF_TEST is not set
2287# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
2078# CONFIG_LKDTM is not set 2288# CONFIG_LKDTM is not set
2079# CONFIG_FAULT_INJECTION is not set 2289# CONFIG_FAULT_INJECTION is not set
2080# CONFIG_LATENCYTOP is not set 2290# CONFIG_LATENCYTOP is not set
2081CONFIG_SYSCTL_SYSCALL_CHECK=y 2291CONFIG_SYSCTL_SYSCALL_CHECK=y
2082CONFIG_HAVE_FTRACE=y 2292CONFIG_USER_STACKTRACE_SUPPORT=y
2293CONFIG_HAVE_FUNCTION_TRACER=y
2294CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
2295CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
2083CONFIG_HAVE_DYNAMIC_FTRACE=y 2296CONFIG_HAVE_DYNAMIC_FTRACE=y
2084# CONFIG_FTRACE is not set 2297CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
2298CONFIG_HAVE_HW_BRANCH_TRACER=y
2299
2300#
2301# Tracers
2302#
2303# CONFIG_FUNCTION_TRACER is not set
2085# CONFIG_IRQSOFF_TRACER is not set 2304# CONFIG_IRQSOFF_TRACER is not set
2086# CONFIG_SYSPROF_TRACER is not set 2305# CONFIG_SYSPROF_TRACER is not set
2087# CONFIG_SCHED_TRACER is not set 2306# CONFIG_SCHED_TRACER is not set
2088# CONFIG_CONTEXT_SWITCH_TRACER is not set 2307# CONFIG_CONTEXT_SWITCH_TRACER is not set
2308# CONFIG_BOOT_TRACER is not set
2309# CONFIG_TRACE_BRANCH_PROFILING is not set
2310# CONFIG_POWER_TRACER is not set
2311# CONFIG_STACK_TRACER is not set
2312# CONFIG_HW_BRANCH_TRACER is not set
2089CONFIG_PROVIDE_OHCI1394_DMA_INIT=y 2313CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
2314# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
2090# CONFIG_SAMPLES is not set 2315# CONFIG_SAMPLES is not set
2091CONFIG_HAVE_ARCH_KGDB=y 2316CONFIG_HAVE_ARCH_KGDB=y
2092# CONFIG_KGDB is not set 2317# CONFIG_KGDB is not set
2093# CONFIG_STRICT_DEVMEM is not set 2318# CONFIG_STRICT_DEVMEM is not set
2094CONFIG_X86_VERBOSE_BOOTUP=y 2319CONFIG_X86_VERBOSE_BOOTUP=y
2095CONFIG_EARLY_PRINTK=y 2320CONFIG_EARLY_PRINTK=y
2321CONFIG_EARLY_PRINTK_DBGP=y
2096CONFIG_DEBUG_STACKOVERFLOW=y 2322CONFIG_DEBUG_STACKOVERFLOW=y
2097CONFIG_DEBUG_STACK_USAGE=y 2323CONFIG_DEBUG_STACK_USAGE=y
2098# CONFIG_DEBUG_PAGEALLOC is not set 2324# CONFIG_DEBUG_PAGEALLOC is not set
@@ -2123,8 +2349,10 @@ CONFIG_OPTIMIZE_INLINING=y
2123CONFIG_KEYS=y 2349CONFIG_KEYS=y
2124CONFIG_KEYS_DEBUG_PROC_KEYS=y 2350CONFIG_KEYS_DEBUG_PROC_KEYS=y
2125CONFIG_SECURITY=y 2351CONFIG_SECURITY=y
2352# CONFIG_SECURITYFS is not set
2126CONFIG_SECURITY_NETWORK=y 2353CONFIG_SECURITY_NETWORK=y
2127# CONFIG_SECURITY_NETWORK_XFRM is not set 2354# CONFIG_SECURITY_NETWORK_XFRM is not set
2355# CONFIG_SECURITY_PATH is not set
2128CONFIG_SECURITY_FILE_CAPABILITIES=y 2356CONFIG_SECURITY_FILE_CAPABILITIES=y
2129# CONFIG_SECURITY_ROOTPLUG is not set 2357# CONFIG_SECURITY_ROOTPLUG is not set
2130CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=65536 2358CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=65536
@@ -2135,7 +2363,6 @@ CONFIG_SECURITY_SELINUX_DISABLE=y
2135CONFIG_SECURITY_SELINUX_DEVELOP=y 2363CONFIG_SECURITY_SELINUX_DEVELOP=y
2136CONFIG_SECURITY_SELINUX_AVC_STATS=y 2364CONFIG_SECURITY_SELINUX_AVC_STATS=y
2137CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 2365CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
2138# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
2139# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set 2366# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
2140# CONFIG_SECURITY_SMACK is not set 2367# CONFIG_SECURITY_SMACK is not set
2141CONFIG_CRYPTO=y 2368CONFIG_CRYPTO=y
@@ -2143,11 +2370,18 @@ CONFIG_CRYPTO=y
2143# 2370#
2144# Crypto core or helper 2371# Crypto core or helper
2145# 2372#
2373# CONFIG_CRYPTO_FIPS is not set
2146CONFIG_CRYPTO_ALGAPI=y 2374CONFIG_CRYPTO_ALGAPI=y
2375CONFIG_CRYPTO_ALGAPI2=y
2147CONFIG_CRYPTO_AEAD=y 2376CONFIG_CRYPTO_AEAD=y
2377CONFIG_CRYPTO_AEAD2=y
2148CONFIG_CRYPTO_BLKCIPHER=y 2378CONFIG_CRYPTO_BLKCIPHER=y
2379CONFIG_CRYPTO_BLKCIPHER2=y
2149CONFIG_CRYPTO_HASH=y 2380CONFIG_CRYPTO_HASH=y
2381CONFIG_CRYPTO_HASH2=y
2382CONFIG_CRYPTO_RNG2=y
2150CONFIG_CRYPTO_MANAGER=y 2383CONFIG_CRYPTO_MANAGER=y
2384CONFIG_CRYPTO_MANAGER2=y
2151# CONFIG_CRYPTO_GF128MUL is not set 2385# CONFIG_CRYPTO_GF128MUL is not set
2152# CONFIG_CRYPTO_NULL is not set 2386# CONFIG_CRYPTO_NULL is not set
2153# CONFIG_CRYPTO_CRYPTD is not set 2387# CONFIG_CRYPTO_CRYPTD is not set
@@ -2182,6 +2416,7 @@ CONFIG_CRYPTO_HMAC=y
2182# Digest 2416# Digest
2183# 2417#
2184# CONFIG_CRYPTO_CRC32C is not set 2418# CONFIG_CRYPTO_CRC32C is not set
2419# CONFIG_CRYPTO_CRC32C_INTEL is not set
2185# CONFIG_CRYPTO_MD4 is not set 2420# CONFIG_CRYPTO_MD4 is not set
2186CONFIG_CRYPTO_MD5=y 2421CONFIG_CRYPTO_MD5=y
2187# CONFIG_CRYPTO_MICHAEL_MIC is not set 2422# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -2222,6 +2457,11 @@ CONFIG_CRYPTO_DES=y
2222# 2457#
2223# CONFIG_CRYPTO_DEFLATE is not set 2458# CONFIG_CRYPTO_DEFLATE is not set
2224# CONFIG_CRYPTO_LZO is not set 2459# CONFIG_CRYPTO_LZO is not set
2460
2461#
2462# Random Number Generation
2463#
2464# CONFIG_CRYPTO_ANSI_CPRNG is not set
2225CONFIG_CRYPTO_HW=y 2465CONFIG_CRYPTO_HW=y
2226# CONFIG_CRYPTO_DEV_PADLOCK is not set 2466# CONFIG_CRYPTO_DEV_PADLOCK is not set
2227# CONFIG_CRYPTO_DEV_GEODE is not set 2467# CONFIG_CRYPTO_DEV_GEODE is not set
@@ -2239,6 +2479,7 @@ CONFIG_VIRTUALIZATION=y
2239CONFIG_BITREVERSE=y 2479CONFIG_BITREVERSE=y
2240CONFIG_GENERIC_FIND_FIRST_BIT=y 2480CONFIG_GENERIC_FIND_FIRST_BIT=y
2241CONFIG_GENERIC_FIND_NEXT_BIT=y 2481CONFIG_GENERIC_FIND_NEXT_BIT=y
2482CONFIG_GENERIC_FIND_LAST_BIT=y
2242# CONFIG_CRC_CCITT is not set 2483# CONFIG_CRC_CCITT is not set
2243# CONFIG_CRC16 is not set 2484# CONFIG_CRC16 is not set
2244CONFIG_CRC_T10DIF=y 2485CONFIG_CRC_T10DIF=y
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 322dd2748fc9..9fe5d212ab4c 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_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.27-rc5 3# Linux kernel version: 2.6.29-rc4
4# Wed Sep 3 17:13:39 2008 4# Tue Feb 24 15:44:16 2009
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7# CONFIG_X86_32 is not set 7# CONFIG_X86_32 is not set
8CONFIG_X86_64=y 8CONFIG_X86_64=y
9CONFIG_X86=y 9CONFIG_X86=y
10CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" 10CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
11# CONFIG_GENERIC_LOCKBREAK is not set
12CONFIG_GENERIC_TIME=y 11CONFIG_GENERIC_TIME=y
13CONFIG_GENERIC_CMOS_UPDATE=y 12CONFIG_GENERIC_CMOS_UPDATE=y
14CONFIG_CLOCKSOURCE_WATCHDOG=y 13CONFIG_CLOCKSOURCE_WATCHDOG=y
@@ -23,17 +22,16 @@ CONFIG_ZONE_DMA=y
23CONFIG_GENERIC_ISA_DMA=y 22CONFIG_GENERIC_ISA_DMA=y
24CONFIG_GENERIC_IOMAP=y 23CONFIG_GENERIC_IOMAP=y
25CONFIG_GENERIC_BUG=y 24CONFIG_GENERIC_BUG=y
25CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
26CONFIG_GENERIC_HWEIGHT=y 26CONFIG_GENERIC_HWEIGHT=y
27# CONFIG_GENERIC_GPIO is not set
28CONFIG_ARCH_MAY_HAVE_PC_FDC=y 27CONFIG_ARCH_MAY_HAVE_PC_FDC=y
29CONFIG_RWSEM_GENERIC_SPINLOCK=y 28CONFIG_RWSEM_GENERIC_SPINLOCK=y
30# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 29# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
31# CONFIG_ARCH_HAS_ILOG2_U32 is not set
32# CONFIG_ARCH_HAS_ILOG2_U64 is not set
33CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y 30CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
34CONFIG_GENERIC_CALIBRATE_DELAY=y 31CONFIG_GENERIC_CALIBRATE_DELAY=y
35CONFIG_GENERIC_TIME_VSYSCALL=y 32CONFIG_GENERIC_TIME_VSYSCALL=y
36CONFIG_ARCH_HAS_CPU_RELAX=y 33CONFIG_ARCH_HAS_CPU_RELAX=y
34CONFIG_ARCH_HAS_DEFAULT_IDLE=y
37CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y 35CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
38CONFIG_HAVE_SETUP_PER_CPU_AREA=y 36CONFIG_HAVE_SETUP_PER_CPU_AREA=y
39CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y 37CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
@@ -42,12 +40,12 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
42CONFIG_ZONE_DMA32=y 40CONFIG_ZONE_DMA32=y
43CONFIG_ARCH_POPULATES_NODE_MAP=y 41CONFIG_ARCH_POPULATES_NODE_MAP=y
44CONFIG_AUDIT_ARCH=y 42CONFIG_AUDIT_ARCH=y
45CONFIG_ARCH_SUPPORTS_AOUT=y
46CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y 43CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
47CONFIG_GENERIC_HARDIRQS=y 44CONFIG_GENERIC_HARDIRQS=y
48CONFIG_GENERIC_IRQ_PROBE=y 45CONFIG_GENERIC_IRQ_PROBE=y
49CONFIG_GENERIC_PENDING_IRQ=y 46CONFIG_GENERIC_PENDING_IRQ=y
50CONFIG_X86_SMP=y 47CONFIG_X86_SMP=y
48CONFIG_USE_GENERIC_SMP_HELPERS=y
51CONFIG_X86_64_SMP=y 49CONFIG_X86_64_SMP=y
52CONFIG_X86_HT=y 50CONFIG_X86_HT=y
53CONFIG_X86_BIOS_REBOOT=y 51CONFIG_X86_BIOS_REBOOT=y
@@ -76,30 +74,44 @@ CONFIG_TASK_IO_ACCOUNTING=y
76CONFIG_AUDIT=y 74CONFIG_AUDIT=y
77CONFIG_AUDITSYSCALL=y 75CONFIG_AUDITSYSCALL=y
78CONFIG_AUDIT_TREE=y 76CONFIG_AUDIT_TREE=y
77
78#
79# RCU Subsystem
80#
81# CONFIG_CLASSIC_RCU is not set
82CONFIG_TREE_RCU=y
83# CONFIG_PREEMPT_RCU is not set
84# CONFIG_RCU_TRACE is not set
85CONFIG_RCU_FANOUT=64
86# CONFIG_RCU_FANOUT_EXACT is not set
87# CONFIG_TREE_RCU_TRACE is not set
88# CONFIG_PREEMPT_RCU_TRACE is not set
79# CONFIG_IKCONFIG is not set 89# CONFIG_IKCONFIG is not set
80CONFIG_LOG_BUF_SHIFT=18 90CONFIG_LOG_BUF_SHIFT=18
81CONFIG_CGROUPS=y
82# CONFIG_CGROUP_DEBUG is not set
83CONFIG_CGROUP_NS=y
84# CONFIG_CGROUP_DEVICE is not set
85CONFIG_CPUSETS=y
86CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y 91CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
87CONFIG_GROUP_SCHED=y 92CONFIG_GROUP_SCHED=y
88CONFIG_FAIR_GROUP_SCHED=y 93CONFIG_FAIR_GROUP_SCHED=y
89# CONFIG_RT_GROUP_SCHED is not set 94# CONFIG_RT_GROUP_SCHED is not set
90# CONFIG_USER_SCHED is not set 95# CONFIG_USER_SCHED is not set
91CONFIG_CGROUP_SCHED=y 96CONFIG_CGROUP_SCHED=y
97CONFIG_CGROUPS=y
98# CONFIG_CGROUP_DEBUG is not set
99CONFIG_CGROUP_NS=y
100CONFIG_CGROUP_FREEZER=y
101# CONFIG_CGROUP_DEVICE is not set
102CONFIG_CPUSETS=y
103CONFIG_PROC_PID_CPUSET=y
92CONFIG_CGROUP_CPUACCT=y 104CONFIG_CGROUP_CPUACCT=y
93CONFIG_RESOURCE_COUNTERS=y 105CONFIG_RESOURCE_COUNTERS=y
94# CONFIG_CGROUP_MEM_RES_CTLR is not set 106# CONFIG_CGROUP_MEM_RES_CTLR is not set
95# CONFIG_SYSFS_DEPRECATED_V2 is not set 107# CONFIG_SYSFS_DEPRECATED_V2 is not set
96CONFIG_PROC_PID_CPUSET=y
97CONFIG_RELAY=y 108CONFIG_RELAY=y
98CONFIG_NAMESPACES=y 109CONFIG_NAMESPACES=y
99CONFIG_UTS_NS=y 110CONFIG_UTS_NS=y
100CONFIG_IPC_NS=y 111CONFIG_IPC_NS=y
101CONFIG_USER_NS=y 112CONFIG_USER_NS=y
102CONFIG_PID_NS=y 113CONFIG_PID_NS=y
114CONFIG_NET_NS=y
103CONFIG_BLK_DEV_INITRD=y 115CONFIG_BLK_DEV_INITRD=y
104CONFIG_INITRAMFS_SOURCE="" 116CONFIG_INITRAMFS_SOURCE=""
105CONFIG_CC_OPTIMIZE_FOR_SIZE=y 117CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -124,12 +136,15 @@ CONFIG_SIGNALFD=y
124CONFIG_TIMERFD=y 136CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 137CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 138CONFIG_SHMEM=y
139CONFIG_AIO=y
127CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
141CONFIG_PCI_QUIRKS=y
128CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
129# CONFIG_SLAB is not set 143# CONFIG_SLAB is not set
130CONFIG_SLUB=y 144CONFIG_SLUB=y
131# CONFIG_SLOB is not set 145# CONFIG_SLOB is not set
132CONFIG_PROFILING=y 146CONFIG_PROFILING=y
147CONFIG_TRACEPOINTS=y
133CONFIG_MARKERS=y 148CONFIG_MARKERS=y
134# CONFIG_OPROFILE is not set 149# CONFIG_OPROFILE is not set
135CONFIG_HAVE_OPROFILE=y 150CONFIG_HAVE_OPROFILE=y
@@ -139,15 +154,10 @@ CONFIG_KRETPROBES=y
139CONFIG_HAVE_IOREMAP_PROT=y 154CONFIG_HAVE_IOREMAP_PROT=y
140CONFIG_HAVE_KPROBES=y 155CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 156CONFIG_HAVE_KRETPROBES=y
142# CONFIG_HAVE_ARCH_TRACEHOOK is not set 157CONFIG_HAVE_ARCH_TRACEHOOK=y
143# CONFIG_HAVE_DMA_ATTRS is not set
144CONFIG_USE_GENERIC_SMP_HELPERS=y
145# CONFIG_HAVE_CLK is not set
146CONFIG_PROC_PAGE_MONITOR=y
147# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 158# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
148CONFIG_SLABINFO=y 159CONFIG_SLABINFO=y
149CONFIG_RT_MUTEXES=y 160CONFIG_RT_MUTEXES=y
150# CONFIG_TINY_SHMEM is not set
151CONFIG_BASE_SMALL=0 161CONFIG_BASE_SMALL=0
152CONFIG_MODULES=y 162CONFIG_MODULES=y
153# CONFIG_MODULE_FORCE_LOAD is not set 163# CONFIG_MODULE_FORCE_LOAD is not set
@@ -155,7 +165,6 @@ CONFIG_MODULE_UNLOAD=y
155CONFIG_MODULE_FORCE_UNLOAD=y 165CONFIG_MODULE_FORCE_UNLOAD=y
156# CONFIG_MODVERSIONS is not set 166# CONFIG_MODVERSIONS is not set
157# CONFIG_MODULE_SRCVERSION_ALL is not set 167# CONFIG_MODULE_SRCVERSION_ALL is not set
158CONFIG_KMOD=y
159CONFIG_STOP_MACHINE=y 168CONFIG_STOP_MACHINE=y
160CONFIG_BLOCK=y 169CONFIG_BLOCK=y
161CONFIG_BLK_DEV_IO_TRACE=y 170CONFIG_BLK_DEV_IO_TRACE=y
@@ -175,7 +184,7 @@ CONFIG_IOSCHED_CFQ=y
175CONFIG_DEFAULT_CFQ=y 184CONFIG_DEFAULT_CFQ=y
176# CONFIG_DEFAULT_NOOP is not set 185# CONFIG_DEFAULT_NOOP is not set
177CONFIG_DEFAULT_IOSCHED="cfq" 186CONFIG_DEFAULT_IOSCHED="cfq"
178CONFIG_CLASSIC_RCU=y 187CONFIG_FREEZER=y
179 188
180# 189#
181# Processor type and features 190# Processor type and features
@@ -185,13 +194,14 @@ CONFIG_NO_HZ=y
185CONFIG_HIGH_RES_TIMERS=y 194CONFIG_HIGH_RES_TIMERS=y
186CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 195CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
187CONFIG_SMP=y 196CONFIG_SMP=y
197CONFIG_SPARSE_IRQ=y
198# CONFIG_NUMA_MIGRATE_IRQ_DESC is not set
188CONFIG_X86_FIND_SMP_CONFIG=y 199CONFIG_X86_FIND_SMP_CONFIG=y
189CONFIG_X86_MPPARSE=y 200CONFIG_X86_MPPARSE=y
190CONFIG_X86_PC=y
191# CONFIG_X86_ELAN is not set 201# CONFIG_X86_ELAN is not set
192# CONFIG_X86_VOYAGER is not set
193# CONFIG_X86_GENERICARCH is not set 202# CONFIG_X86_GENERICARCH is not set
194# CONFIG_X86_VSMP is not set 203# CONFIG_X86_VSMP is not set
204CONFIG_SCHED_OMIT_FRAME_POINTER=y
195# CONFIG_PARAVIRT_GUEST is not set 205# CONFIG_PARAVIRT_GUEST is not set
196# CONFIG_MEMTEST is not set 206# CONFIG_MEMTEST is not set
197# CONFIG_M386 is not set 207# CONFIG_M386 is not set
@@ -230,6 +240,11 @@ CONFIG_X86_CMPXCHG64=y
230CONFIG_X86_CMOV=y 240CONFIG_X86_CMOV=y
231CONFIG_X86_MINIMUM_CPU_FAMILY=64 241CONFIG_X86_MINIMUM_CPU_FAMILY=64
232CONFIG_X86_DEBUGCTLMSR=y 242CONFIG_X86_DEBUGCTLMSR=y
243CONFIG_CPU_SUP_INTEL=y
244CONFIG_CPU_SUP_AMD=y
245CONFIG_CPU_SUP_CENTAUR_64=y
246CONFIG_X86_DS=y
247CONFIG_X86_PTRACE_BTS=y
233CONFIG_HPET_TIMER=y 248CONFIG_HPET_TIMER=y
234CONFIG_HPET_EMULATE_RTC=y 249CONFIG_HPET_EMULATE_RTC=y
235CONFIG_DMI=y 250CONFIG_DMI=y
@@ -237,8 +252,11 @@ CONFIG_GART_IOMMU=y
237CONFIG_CALGARY_IOMMU=y 252CONFIG_CALGARY_IOMMU=y
238CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y 253CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
239CONFIG_AMD_IOMMU=y 254CONFIG_AMD_IOMMU=y
255CONFIG_AMD_IOMMU_STATS=y
240CONFIG_SWIOTLB=y 256CONFIG_SWIOTLB=y
241CONFIG_IOMMU_HELPER=y 257CONFIG_IOMMU_HELPER=y
258CONFIG_IOMMU_API=y
259# CONFIG_MAXSMP is not set
242CONFIG_NR_CPUS=64 260CONFIG_NR_CPUS=64
243CONFIG_SCHED_SMT=y 261CONFIG_SCHED_SMT=y
244CONFIG_SCHED_MC=y 262CONFIG_SCHED_MC=y
@@ -247,12 +265,19 @@ CONFIG_PREEMPT_VOLUNTARY=y
247# CONFIG_PREEMPT is not set 265# CONFIG_PREEMPT is not set
248CONFIG_X86_LOCAL_APIC=y 266CONFIG_X86_LOCAL_APIC=y
249CONFIG_X86_IO_APIC=y 267CONFIG_X86_IO_APIC=y
250# CONFIG_X86_MCE is not set 268CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
269CONFIG_X86_MCE=y
270CONFIG_X86_MCE_INTEL=y
271CONFIG_X86_MCE_AMD=y
251# CONFIG_I8K is not set 272# CONFIG_I8K is not set
252CONFIG_MICROCODE=y 273CONFIG_MICROCODE=y
274CONFIG_MICROCODE_INTEL=y
275CONFIG_MICROCODE_AMD=y
253CONFIG_MICROCODE_OLD_INTERFACE=y 276CONFIG_MICROCODE_OLD_INTERFACE=y
254CONFIG_X86_MSR=y 277CONFIG_X86_MSR=y
255CONFIG_X86_CPUID=y 278CONFIG_X86_CPUID=y
279CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
280CONFIG_DIRECT_GBPAGES=y
256CONFIG_NUMA=y 281CONFIG_NUMA=y
257CONFIG_K8_NUMA=y 282CONFIG_K8_NUMA=y
258CONFIG_X86_64_ACPI_NUMA=y 283CONFIG_X86_64_ACPI_NUMA=y
@@ -269,7 +294,6 @@ CONFIG_SPARSEMEM_MANUAL=y
269CONFIG_SPARSEMEM=y 294CONFIG_SPARSEMEM=y
270CONFIG_NEED_MULTIPLE_NODES=y 295CONFIG_NEED_MULTIPLE_NODES=y
271CONFIG_HAVE_MEMORY_PRESENT=y 296CONFIG_HAVE_MEMORY_PRESENT=y
272# CONFIG_SPARSEMEM_STATIC is not set
273CONFIG_SPARSEMEM_EXTREME=y 297CONFIG_SPARSEMEM_EXTREME=y
274CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y 298CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
275CONFIG_SPARSEMEM_VMEMMAP=y 299CONFIG_SPARSEMEM_VMEMMAP=y
@@ -280,10 +304,14 @@ CONFIG_SPARSEMEM_VMEMMAP=y
280CONFIG_PAGEFLAGS_EXTENDED=y 304CONFIG_PAGEFLAGS_EXTENDED=y
281CONFIG_SPLIT_PTLOCK_CPUS=4 305CONFIG_SPLIT_PTLOCK_CPUS=4
282CONFIG_MIGRATION=y 306CONFIG_MIGRATION=y
283CONFIG_RESOURCES_64BIT=y 307CONFIG_PHYS_ADDR_T_64BIT=y
284CONFIG_ZONE_DMA_FLAG=1 308CONFIG_ZONE_DMA_FLAG=1
285CONFIG_BOUNCE=y 309CONFIG_BOUNCE=y
286CONFIG_VIRT_TO_BUS=y 310CONFIG_VIRT_TO_BUS=y
311CONFIG_UNEVICTABLE_LRU=y
312CONFIG_X86_CHECK_BIOS_CORRUPTION=y
313CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
314CONFIG_X86_RESERVE_LOW_64K=y
287CONFIG_MTRR=y 315CONFIG_MTRR=y
288# CONFIG_MTRR_SANITIZER is not set 316# CONFIG_MTRR_SANITIZER is not set
289CONFIG_X86_PAT=y 317CONFIG_X86_PAT=y
@@ -302,11 +330,12 @@ CONFIG_PHYSICAL_START=0x1000000
302CONFIG_PHYSICAL_ALIGN=0x200000 330CONFIG_PHYSICAL_ALIGN=0x200000
303CONFIG_HOTPLUG_CPU=y 331CONFIG_HOTPLUG_CPU=y
304# CONFIG_COMPAT_VDSO is not set 332# CONFIG_COMPAT_VDSO is not set
333# CONFIG_CMDLINE_BOOL is not set
305CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 334CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
306CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y 335CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
307 336
308# 337#
309# Power management options 338# Power management and ACPI options
310# 339#
311CONFIG_ARCH_HIBERNATION_HEADER=y 340CONFIG_ARCH_HIBERNATION_HEADER=y
312CONFIG_PM=y 341CONFIG_PM=y
@@ -333,20 +362,14 @@ CONFIG_ACPI_BATTERY=y
333CONFIG_ACPI_BUTTON=y 362CONFIG_ACPI_BUTTON=y
334CONFIG_ACPI_FAN=y 363CONFIG_ACPI_FAN=y
335CONFIG_ACPI_DOCK=y 364CONFIG_ACPI_DOCK=y
336# CONFIG_ACPI_BAY is not set
337CONFIG_ACPI_PROCESSOR=y 365CONFIG_ACPI_PROCESSOR=y
338CONFIG_ACPI_HOTPLUG_CPU=y 366CONFIG_ACPI_HOTPLUG_CPU=y
339CONFIG_ACPI_THERMAL=y 367CONFIG_ACPI_THERMAL=y
340CONFIG_ACPI_NUMA=y 368CONFIG_ACPI_NUMA=y
341# CONFIG_ACPI_WMI is not set
342# CONFIG_ACPI_ASUS is not set
343# CONFIG_ACPI_TOSHIBA is not set
344# CONFIG_ACPI_CUSTOM_DSDT is not set 369# CONFIG_ACPI_CUSTOM_DSDT is not set
345CONFIG_ACPI_BLACKLIST_YEAR=0 370CONFIG_ACPI_BLACKLIST_YEAR=0
346# CONFIG_ACPI_DEBUG is not set 371# CONFIG_ACPI_DEBUG is not set
347CONFIG_ACPI_EC=y
348# CONFIG_ACPI_PCI_SLOT is not set 372# CONFIG_ACPI_PCI_SLOT is not set
349CONFIG_ACPI_POWER=y
350CONFIG_ACPI_SYSTEM=y 373CONFIG_ACPI_SYSTEM=y
351CONFIG_X86_PM_TIMER=y 374CONFIG_X86_PM_TIMER=y
352CONFIG_ACPI_CONTAINER=y 375CONFIG_ACPI_CONTAINER=y
@@ -381,13 +404,17 @@ CONFIG_X86_ACPI_CPUFREQ=y
381# 404#
382# shared options 405# shared options
383# 406#
384# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
385# CONFIG_X86_SPEEDSTEP_LIB is not set 407# CONFIG_X86_SPEEDSTEP_LIB is not set
386CONFIG_CPU_IDLE=y 408CONFIG_CPU_IDLE=y
387CONFIG_CPU_IDLE_GOV_LADDER=y 409CONFIG_CPU_IDLE_GOV_LADDER=y
388CONFIG_CPU_IDLE_GOV_MENU=y 410CONFIG_CPU_IDLE_GOV_MENU=y
389 411
390# 412#
413# Memory power savings
414#
415# CONFIG_I7300_IDLE is not set
416
417#
391# Bus options (PCI etc.) 418# Bus options (PCI etc.)
392# 419#
393CONFIG_PCI=y 420CONFIG_PCI=y
@@ -395,8 +422,10 @@ CONFIG_PCI_DIRECT=y
395CONFIG_PCI_MMCONFIG=y 422CONFIG_PCI_MMCONFIG=y
396CONFIG_PCI_DOMAINS=y 423CONFIG_PCI_DOMAINS=y
397CONFIG_DMAR=y 424CONFIG_DMAR=y
425# CONFIG_DMAR_DEFAULT_ON is not set
398CONFIG_DMAR_GFX_WA=y 426CONFIG_DMAR_GFX_WA=y
399CONFIG_DMAR_FLOPPY_WA=y 427CONFIG_DMAR_FLOPPY_WA=y
428# CONFIG_INTR_REMAP is not set
400CONFIG_PCIEPORTBUS=y 429CONFIG_PCIEPORTBUS=y
401# CONFIG_HOTPLUG_PCI_PCIE is not set 430# CONFIG_HOTPLUG_PCI_PCIE is not set
402CONFIG_PCIEAER=y 431CONFIG_PCIEAER=y
@@ -405,6 +434,7 @@ CONFIG_ARCH_SUPPORTS_MSI=y
405CONFIG_PCI_MSI=y 434CONFIG_PCI_MSI=y
406# CONFIG_PCI_LEGACY is not set 435# CONFIG_PCI_LEGACY is not set
407# CONFIG_PCI_DEBUG is not set 436# CONFIG_PCI_DEBUG is not set
437# CONFIG_PCI_STUB is not set
408CONFIG_HT_IRQ=y 438CONFIG_HT_IRQ=y
409CONFIG_ISA_DMA_API=y 439CONFIG_ISA_DMA_API=y
410CONFIG_K8_NB=y 440CONFIG_K8_NB=y
@@ -438,6 +468,8 @@ CONFIG_HOTPLUG_PCI=y
438# 468#
439CONFIG_BINFMT_ELF=y 469CONFIG_BINFMT_ELF=y
440CONFIG_COMPAT_BINFMT_ELF=y 470CONFIG_COMPAT_BINFMT_ELF=y
471CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
472# CONFIG_HAVE_AOUT is not set
441CONFIG_BINFMT_MISC=y 473CONFIG_BINFMT_MISC=y
442CONFIG_IA32_EMULATION=y 474CONFIG_IA32_EMULATION=y
443# CONFIG_IA32_AOUT is not set 475# CONFIG_IA32_AOUT is not set
@@ -449,6 +481,7 @@ CONFIG_NET=y
449# 481#
450# Networking options 482# Networking options
451# 483#
484CONFIG_COMPAT_NET_DEV_OPS=y
452CONFIG_PACKET=y 485CONFIG_PACKET=y
453CONFIG_PACKET_MMAP=y 486CONFIG_PACKET_MMAP=y
454CONFIG_UNIX=y 487CONFIG_UNIX=y
@@ -509,7 +542,6 @@ CONFIG_DEFAULT_CUBIC=y
509# CONFIG_DEFAULT_RENO is not set 542# CONFIG_DEFAULT_RENO is not set
510CONFIG_DEFAULT_TCP_CONG="cubic" 543CONFIG_DEFAULT_TCP_CONG="cubic"
511CONFIG_TCP_MD5SIG=y 544CONFIG_TCP_MD5SIG=y
512# CONFIG_IP_VS is not set
513CONFIG_IPV6=y 545CONFIG_IPV6=y
514# CONFIG_IPV6_PRIVACY is not set 546# CONFIG_IPV6_PRIVACY is not set
515# CONFIG_IPV6_ROUTER_PREF is not set 547# CONFIG_IPV6_ROUTER_PREF is not set
@@ -547,19 +579,21 @@ CONFIG_NF_CONNTRACK_IRC=y
547CONFIG_NF_CONNTRACK_SIP=y 579CONFIG_NF_CONNTRACK_SIP=y
548CONFIG_NF_CT_NETLINK=y 580CONFIG_NF_CT_NETLINK=y
549CONFIG_NETFILTER_XTABLES=y 581CONFIG_NETFILTER_XTABLES=y
582CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
550CONFIG_NETFILTER_XT_TARGET_MARK=y 583CONFIG_NETFILTER_XT_TARGET_MARK=y
551CONFIG_NETFILTER_XT_TARGET_NFLOG=y 584CONFIG_NETFILTER_XT_TARGET_NFLOG=y
552CONFIG_NETFILTER_XT_TARGET_SECMARK=y 585CONFIG_NETFILTER_XT_TARGET_SECMARK=y
553CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
554CONFIG_NETFILTER_XT_TARGET_TCPMSS=y 586CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
555CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y 587CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
556CONFIG_NETFILTER_XT_MATCH_MARK=y 588CONFIG_NETFILTER_XT_MATCH_MARK=y
557CONFIG_NETFILTER_XT_MATCH_POLICY=y 589CONFIG_NETFILTER_XT_MATCH_POLICY=y
558CONFIG_NETFILTER_XT_MATCH_STATE=y 590CONFIG_NETFILTER_XT_MATCH_STATE=y
591# CONFIG_IP_VS is not set
559 592
560# 593#
561# IP: Netfilter Configuration 594# IP: Netfilter Configuration
562# 595#
596CONFIG_NF_DEFRAG_IPV4=y
563CONFIG_NF_CONNTRACK_IPV4=y 597CONFIG_NF_CONNTRACK_IPV4=y
564CONFIG_NF_CONNTRACK_PROC_COMPAT=y 598CONFIG_NF_CONNTRACK_PROC_COMPAT=y
565CONFIG_IP_NF_IPTABLES=y 599CONFIG_IP_NF_IPTABLES=y
@@ -585,8 +619,8 @@ CONFIG_IP_NF_MANGLE=y
585CONFIG_NF_CONNTRACK_IPV6=y 619CONFIG_NF_CONNTRACK_IPV6=y
586CONFIG_IP6_NF_IPTABLES=y 620CONFIG_IP6_NF_IPTABLES=y
587CONFIG_IP6_NF_MATCH_IPV6HEADER=y 621CONFIG_IP6_NF_MATCH_IPV6HEADER=y
588CONFIG_IP6_NF_FILTER=y
589CONFIG_IP6_NF_TARGET_LOG=y 622CONFIG_IP6_NF_TARGET_LOG=y
623CONFIG_IP6_NF_FILTER=y
590CONFIG_IP6_NF_TARGET_REJECT=y 624CONFIG_IP6_NF_TARGET_REJECT=y
591CONFIG_IP6_NF_MANGLE=y 625CONFIG_IP6_NF_MANGLE=y
592# CONFIG_IP_DCCP is not set 626# CONFIG_IP_DCCP is not set
@@ -594,6 +628,7 @@ CONFIG_IP6_NF_MANGLE=y
594# CONFIG_TIPC is not set 628# CONFIG_TIPC is not set
595# CONFIG_ATM is not set 629# CONFIG_ATM is not set
596# CONFIG_BRIDGE is not set 630# CONFIG_BRIDGE is not set
631# CONFIG_NET_DSA is not set
597# CONFIG_VLAN_8021Q is not set 632# CONFIG_VLAN_8021Q is not set
598# CONFIG_DECNET is not set 633# CONFIG_DECNET is not set
599CONFIG_LLC=y 634CONFIG_LLC=y
@@ -613,6 +648,7 @@ CONFIG_NET_SCHED=y
613# CONFIG_NET_SCH_HTB is not set 648# CONFIG_NET_SCH_HTB is not set
614# CONFIG_NET_SCH_HFSC is not set 649# CONFIG_NET_SCH_HFSC is not set
615# CONFIG_NET_SCH_PRIO is not set 650# CONFIG_NET_SCH_PRIO is not set
651# CONFIG_NET_SCH_MULTIQ is not set
616# CONFIG_NET_SCH_RED is not set 652# CONFIG_NET_SCH_RED is not set
617# CONFIG_NET_SCH_SFQ is not set 653# CONFIG_NET_SCH_SFQ is not set
618# CONFIG_NET_SCH_TEQL is not set 654# CONFIG_NET_SCH_TEQL is not set
@@ -620,6 +656,7 @@ CONFIG_NET_SCHED=y
620# CONFIG_NET_SCH_GRED is not set 656# CONFIG_NET_SCH_GRED is not set
621# CONFIG_NET_SCH_DSMARK is not set 657# CONFIG_NET_SCH_DSMARK is not set
622# CONFIG_NET_SCH_NETEM is not set 658# CONFIG_NET_SCH_NETEM is not set
659# CONFIG_NET_SCH_DRR is not set
623# CONFIG_NET_SCH_INGRESS is not set 660# CONFIG_NET_SCH_INGRESS is not set
624 661
625# 662#
@@ -634,6 +671,7 @@ CONFIG_NET_CLS=y
634# CONFIG_NET_CLS_RSVP is not set 671# CONFIG_NET_CLS_RSVP is not set
635# CONFIG_NET_CLS_RSVP6 is not set 672# CONFIG_NET_CLS_RSVP6 is not set
636# CONFIG_NET_CLS_FLOW is not set 673# CONFIG_NET_CLS_FLOW is not set
674# CONFIG_NET_CLS_CGROUP is not set
637CONFIG_NET_EMATCH=y 675CONFIG_NET_EMATCH=y
638CONFIG_NET_EMATCH_STACK=32 676CONFIG_NET_EMATCH_STACK=32
639# CONFIG_NET_EMATCH_CMP is not set 677# CONFIG_NET_EMATCH_CMP is not set
@@ -649,7 +687,9 @@ CONFIG_NET_CLS_ACT=y
649# CONFIG_NET_ACT_NAT is not set 687# CONFIG_NET_ACT_NAT is not set
650# CONFIG_NET_ACT_PEDIT is not set 688# CONFIG_NET_ACT_PEDIT is not set
651# CONFIG_NET_ACT_SIMP is not set 689# CONFIG_NET_ACT_SIMP is not set
690# CONFIG_NET_ACT_SKBEDIT is not set
652CONFIG_NET_SCH_FIFO=y 691CONFIG_NET_SCH_FIFO=y
692# CONFIG_DCB is not set
653 693
654# 694#
655# Network testing 695# Network testing
@@ -666,29 +706,33 @@ CONFIG_HAMRADIO=y
666# CONFIG_IRDA is not set 706# CONFIG_IRDA is not set
667# CONFIG_BT is not set 707# CONFIG_BT is not set
668# CONFIG_AF_RXRPC is not set 708# CONFIG_AF_RXRPC is not set
709# CONFIG_PHONET is not set
669CONFIG_FIB_RULES=y 710CONFIG_FIB_RULES=y
670 711CONFIG_WIRELESS=y
671#
672# Wireless
673#
674CONFIG_CFG80211=y 712CONFIG_CFG80211=y
713# CONFIG_CFG80211_REG_DEBUG is not set
675CONFIG_NL80211=y 714CONFIG_NL80211=y
715CONFIG_WIRELESS_OLD_REGULATORY=y
676CONFIG_WIRELESS_EXT=y 716CONFIG_WIRELESS_EXT=y
677CONFIG_WIRELESS_EXT_SYSFS=y 717CONFIG_WIRELESS_EXT_SYSFS=y
718# CONFIG_LIB80211 is not set
678CONFIG_MAC80211=y 719CONFIG_MAC80211=y
679 720
680# 721#
681# Rate control algorithm selection 722# Rate control algorithm selection
682# 723#
683CONFIG_MAC80211_RC_PID=y 724CONFIG_MAC80211_RC_MINSTREL=y
684CONFIG_MAC80211_RC_DEFAULT_PID=y 725# CONFIG_MAC80211_RC_DEFAULT_PID is not set
685CONFIG_MAC80211_RC_DEFAULT="pid" 726CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
727CONFIG_MAC80211_RC_DEFAULT="minstrel"
686# CONFIG_MAC80211_MESH is not set 728# CONFIG_MAC80211_MESH is not set
687CONFIG_MAC80211_LEDS=y 729CONFIG_MAC80211_LEDS=y
688# CONFIG_MAC80211_DEBUGFS is not set 730# CONFIG_MAC80211_DEBUGFS is not set
689# CONFIG_MAC80211_DEBUG_MENU is not set 731# CONFIG_MAC80211_DEBUG_MENU is not set
690# CONFIG_IEEE80211 is not set 732# CONFIG_WIMAX is not set
691# CONFIG_RFKILL is not set 733CONFIG_RFKILL=y
734# CONFIG_RFKILL_INPUT is not set
735CONFIG_RFKILL_LEDS=y
692# CONFIG_NET_9P is not set 736# CONFIG_NET_9P is not set
693 737
694# 738#
@@ -712,7 +756,7 @@ CONFIG_PROC_EVENTS=y
712# CONFIG_MTD is not set 756# CONFIG_MTD is not set
713# CONFIG_PARPORT is not set 757# CONFIG_PARPORT is not set
714CONFIG_PNP=y 758CONFIG_PNP=y
715# CONFIG_PNP_DEBUG is not set 759CONFIG_PNP_DEBUG_MESSAGES=y
716 760
717# 761#
718# Protocols 762# Protocols
@@ -740,21 +784,21 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
740CONFIG_MISC_DEVICES=y 784CONFIG_MISC_DEVICES=y
741# CONFIG_IBM_ASM is not set 785# CONFIG_IBM_ASM is not set
742# CONFIG_PHANTOM is not set 786# CONFIG_PHANTOM is not set
743# CONFIG_EEPROM_93CX6 is not set
744# CONFIG_SGI_IOC4 is not set 787# CONFIG_SGI_IOC4 is not set
745# CONFIG_TIFM_CORE is not set 788# CONFIG_TIFM_CORE is not set
746# CONFIG_ACER_WMI is not set 789# CONFIG_ICS932S401 is not set
747# CONFIG_ASUS_LAPTOP is not set
748# CONFIG_FUJITSU_LAPTOP is not set
749# CONFIG_MSI_LAPTOP is not set
750# CONFIG_COMPAL_LAPTOP is not set
751# CONFIG_SONY_LAPTOP is not set
752# CONFIG_THINKPAD_ACPI is not set
753# CONFIG_INTEL_MENLOW is not set
754# CONFIG_ENCLOSURE_SERVICES is not set 790# CONFIG_ENCLOSURE_SERVICES is not set
755# CONFIG_SGI_XP is not set 791# CONFIG_SGI_XP is not set
756# CONFIG_HP_ILO is not set 792# CONFIG_HP_ILO is not set
757# CONFIG_SGI_GRU is not set 793# CONFIG_SGI_GRU is not set
794# CONFIG_C2PORT is not set
795
796#
797# EEPROM support
798#
799# CONFIG_EEPROM_AT24 is not set
800# CONFIG_EEPROM_LEGACY is not set
801# CONFIG_EEPROM_93CX6 is not set
758CONFIG_HAVE_IDE=y 802CONFIG_HAVE_IDE=y
759# CONFIG_IDE is not set 803# CONFIG_IDE is not set
760 804
@@ -793,7 +837,7 @@ CONFIG_SCSI_WAIT_SCAN=m
793# 837#
794CONFIG_SCSI_SPI_ATTRS=y 838CONFIG_SCSI_SPI_ATTRS=y
795# CONFIG_SCSI_FC_ATTRS is not set 839# CONFIG_SCSI_FC_ATTRS is not set
796CONFIG_SCSI_ISCSI_ATTRS=y 840# CONFIG_SCSI_ISCSI_ATTRS is not set
797# CONFIG_SCSI_SAS_ATTRS is not set 841# CONFIG_SCSI_SAS_ATTRS is not set
798# CONFIG_SCSI_SAS_LIBSAS is not set 842# CONFIG_SCSI_SAS_LIBSAS is not set
799# CONFIG_SCSI_SRP_ATTRS is not set 843# CONFIG_SCSI_SRP_ATTRS is not set
@@ -864,6 +908,7 @@ CONFIG_PATA_OLDPIIX=y
864CONFIG_PATA_SCH=y 908CONFIG_PATA_SCH=y
865CONFIG_MD=y 909CONFIG_MD=y
866CONFIG_BLK_DEV_MD=y 910CONFIG_BLK_DEV_MD=y
911CONFIG_MD_AUTODETECT=y
867# CONFIG_MD_LINEAR is not set 912# CONFIG_MD_LINEAR is not set
868# CONFIG_MD_RAID0 is not set 913# CONFIG_MD_RAID0 is not set
869# CONFIG_MD_RAID1 is not set 914# CONFIG_MD_RAID1 is not set
@@ -919,6 +964,9 @@ CONFIG_PHYLIB=y
919# CONFIG_BROADCOM_PHY is not set 964# CONFIG_BROADCOM_PHY is not set
920# CONFIG_ICPLUS_PHY is not set 965# CONFIG_ICPLUS_PHY is not set
921# CONFIG_REALTEK_PHY is not set 966# CONFIG_REALTEK_PHY is not set
967# CONFIG_NATIONAL_PHY is not set
968# CONFIG_STE10XP is not set
969# CONFIG_LSI_ET1011C_PHY is not set
922# CONFIG_FIXED_PHY is not set 970# CONFIG_FIXED_PHY is not set
923# CONFIG_MDIO_BITBANG is not set 971# CONFIG_MDIO_BITBANG is not set
924CONFIG_NET_ETHERNET=y 972CONFIG_NET_ETHERNET=y
@@ -942,6 +990,9 @@ CONFIG_NET_TULIP=y
942# CONFIG_IBM_NEW_EMAC_RGMII is not set 990# CONFIG_IBM_NEW_EMAC_RGMII is not set
943# CONFIG_IBM_NEW_EMAC_TAH is not set 991# CONFIG_IBM_NEW_EMAC_TAH is not set
944# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 992# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
993# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
994# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
995# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
945CONFIG_NET_PCI=y 996CONFIG_NET_PCI=y
946# CONFIG_PCNET32 is not set 997# CONFIG_PCNET32 is not set
947# CONFIG_AMD8111_ETH is not set 998# CONFIG_AMD8111_ETH is not set
@@ -949,7 +1000,6 @@ CONFIG_NET_PCI=y
949# CONFIG_B44 is not set 1000# CONFIG_B44 is not set
950CONFIG_FORCEDETH=y 1001CONFIG_FORCEDETH=y
951# CONFIG_FORCEDETH_NAPI is not set 1002# CONFIG_FORCEDETH_NAPI is not set
952# CONFIG_EEPRO100 is not set
953CONFIG_E100=y 1003CONFIG_E100=y
954# CONFIG_FEALNX is not set 1004# CONFIG_FEALNX is not set
955# CONFIG_NATSEMI is not set 1005# CONFIG_NATSEMI is not set
@@ -963,15 +1013,16 @@ CONFIG_8139TOO_PIO=y
963# CONFIG_R6040 is not set 1013# CONFIG_R6040 is not set
964# CONFIG_SIS900 is not set 1014# CONFIG_SIS900 is not set
965# CONFIG_EPIC100 is not set 1015# CONFIG_EPIC100 is not set
1016# CONFIG_SMSC9420 is not set
966# CONFIG_SUNDANCE is not set 1017# CONFIG_SUNDANCE is not set
967# CONFIG_TLAN is not set 1018# CONFIG_TLAN is not set
968# CONFIG_VIA_RHINE is not set 1019# CONFIG_VIA_RHINE is not set
969# CONFIG_SC92031 is not set 1020# CONFIG_SC92031 is not set
1021# CONFIG_ATL2 is not set
970CONFIG_NETDEV_1000=y 1022CONFIG_NETDEV_1000=y
971# CONFIG_ACENIC is not set 1023# CONFIG_ACENIC is not set
972# CONFIG_DL2K is not set 1024# CONFIG_DL2K is not set
973CONFIG_E1000=y 1025CONFIG_E1000=y
974# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
975# CONFIG_E1000E is not set 1026# CONFIG_E1000E is not set
976# CONFIG_IP1000 is not set 1027# CONFIG_IP1000 is not set
977# CONFIG_IGB is not set 1028# CONFIG_IGB is not set
@@ -989,18 +1040,23 @@ CONFIG_TIGON3=y
989# CONFIG_QLA3XXX is not set 1040# CONFIG_QLA3XXX is not set
990# CONFIG_ATL1 is not set 1041# CONFIG_ATL1 is not set
991# CONFIG_ATL1E is not set 1042# CONFIG_ATL1E is not set
1043# CONFIG_JME is not set
992CONFIG_NETDEV_10000=y 1044CONFIG_NETDEV_10000=y
993# CONFIG_CHELSIO_T1 is not set 1045# CONFIG_CHELSIO_T1 is not set
1046CONFIG_CHELSIO_T3_DEPENDS=y
994# CONFIG_CHELSIO_T3 is not set 1047# CONFIG_CHELSIO_T3 is not set
1048# CONFIG_ENIC is not set
995# CONFIG_IXGBE is not set 1049# CONFIG_IXGBE is not set
996# CONFIG_IXGB is not set 1050# CONFIG_IXGB is not set
997# CONFIG_S2IO is not set 1051# CONFIG_S2IO is not set
998# CONFIG_MYRI10GE is not set 1052# CONFIG_MYRI10GE is not set
999# CONFIG_NETXEN_NIC is not set 1053# CONFIG_NETXEN_NIC is not set
1000# CONFIG_NIU is not set 1054# CONFIG_NIU is not set
1055# CONFIG_MLX4_EN is not set
1001# CONFIG_MLX4_CORE is not set 1056# CONFIG_MLX4_CORE is not set
1002# CONFIG_TEHUTI is not set 1057# CONFIG_TEHUTI is not set
1003# CONFIG_BNX2X is not set 1058# CONFIG_BNX2X is not set
1059# CONFIG_QLGE is not set
1004# CONFIG_SFC is not set 1060# CONFIG_SFC is not set
1005CONFIG_TR=y 1061CONFIG_TR=y
1006# CONFIG_IBMOL is not set 1062# CONFIG_IBMOL is not set
@@ -1013,9 +1069,8 @@ CONFIG_TR=y
1013# CONFIG_WLAN_PRE80211 is not set 1069# CONFIG_WLAN_PRE80211 is not set
1014CONFIG_WLAN_80211=y 1070CONFIG_WLAN_80211=y
1015# CONFIG_PCMCIA_RAYCS is not set 1071# CONFIG_PCMCIA_RAYCS is not set
1016# CONFIG_IPW2100 is not set
1017# CONFIG_IPW2200 is not set
1018# CONFIG_LIBERTAS is not set 1072# CONFIG_LIBERTAS is not set
1073# CONFIG_LIBERTAS_THINFIRM is not set
1019# CONFIG_AIRO is not set 1074# CONFIG_AIRO is not set
1020# CONFIG_HERMES is not set 1075# CONFIG_HERMES is not set
1021# CONFIG_ATMEL is not set 1076# CONFIG_ATMEL is not set
@@ -1032,6 +1087,8 @@ CONFIG_WLAN_80211=y
1032CONFIG_ATH5K=y 1087CONFIG_ATH5K=y
1033# CONFIG_ATH5K_DEBUG is not set 1088# CONFIG_ATH5K_DEBUG is not set
1034# CONFIG_ATH9K is not set 1089# CONFIG_ATH9K is not set
1090# CONFIG_IPW2100 is not set
1091# CONFIG_IPW2200 is not set
1035# CONFIG_IWLCORE is not set 1092# CONFIG_IWLCORE is not set
1036# CONFIG_IWLWIFI_LEDS is not set 1093# CONFIG_IWLWIFI_LEDS is not set
1037# CONFIG_IWLAGN is not set 1094# CONFIG_IWLAGN is not set
@@ -1043,6 +1100,10 @@ CONFIG_ATH5K=y
1043# CONFIG_RT2X00 is not set 1100# CONFIG_RT2X00 is not set
1044 1101
1045# 1102#
1103# Enable WiMAX (Networking options) to see the WiMAX drivers
1104#
1105
1106#
1046# USB Network Adapters 1107# USB Network Adapters
1047# 1108#
1048# CONFIG_USB_CATC is not set 1109# CONFIG_USB_CATC is not set
@@ -1050,6 +1111,7 @@ CONFIG_ATH5K=y
1050# CONFIG_USB_PEGASUS is not set 1111# CONFIG_USB_PEGASUS is not set
1051# CONFIG_USB_RTL8150 is not set 1112# CONFIG_USB_RTL8150 is not set
1052# CONFIG_USB_USBNET is not set 1113# CONFIG_USB_USBNET is not set
1114# CONFIG_USB_HSO is not set
1053CONFIG_NET_PCMCIA=y 1115CONFIG_NET_PCMCIA=y
1054# CONFIG_PCMCIA_3C589 is not set 1116# CONFIG_PCMCIA_3C589 is not set
1055# CONFIG_PCMCIA_3C574 is not set 1117# CONFIG_PCMCIA_3C574 is not set
@@ -1059,6 +1121,7 @@ CONFIG_NET_PCMCIA=y
1059# CONFIG_PCMCIA_SMC91C92 is not set 1121# CONFIG_PCMCIA_SMC91C92 is not set
1060# CONFIG_PCMCIA_XIRC2PS is not set 1122# CONFIG_PCMCIA_XIRC2PS is not set
1061# CONFIG_PCMCIA_AXNET is not set 1123# CONFIG_PCMCIA_AXNET is not set
1124# CONFIG_PCMCIA_IBMTR is not set
1062# CONFIG_WAN is not set 1125# CONFIG_WAN is not set
1063CONFIG_FDDI=y 1126CONFIG_FDDI=y
1064# CONFIG_DEFXX is not set 1127# CONFIG_DEFXX is not set
@@ -1110,6 +1173,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
1110CONFIG_MOUSE_PS2_SYNAPTICS=y 1173CONFIG_MOUSE_PS2_SYNAPTICS=y
1111CONFIG_MOUSE_PS2_LIFEBOOK=y 1174CONFIG_MOUSE_PS2_LIFEBOOK=y
1112CONFIG_MOUSE_PS2_TRACKPOINT=y 1175CONFIG_MOUSE_PS2_TRACKPOINT=y
1176# CONFIG_MOUSE_PS2_ELANTECH is not set
1113# CONFIG_MOUSE_PS2_TOUCHKIT is not set 1177# CONFIG_MOUSE_PS2_TOUCHKIT is not set
1114# CONFIG_MOUSE_SERIAL is not set 1178# CONFIG_MOUSE_SERIAL is not set
1115# CONFIG_MOUSE_APPLETOUCH is not set 1179# CONFIG_MOUSE_APPLETOUCH is not set
@@ -1147,15 +1211,16 @@ CONFIG_INPUT_TOUCHSCREEN=y
1147# CONFIG_TOUCHSCREEN_FUJITSU is not set 1211# CONFIG_TOUCHSCREEN_FUJITSU is not set
1148# CONFIG_TOUCHSCREEN_GUNZE is not set 1212# CONFIG_TOUCHSCREEN_GUNZE is not set
1149# CONFIG_TOUCHSCREEN_ELO is not set 1213# CONFIG_TOUCHSCREEN_ELO is not set
1214# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
1150# CONFIG_TOUCHSCREEN_MTOUCH is not set 1215# CONFIG_TOUCHSCREEN_MTOUCH is not set
1151# CONFIG_TOUCHSCREEN_INEXIO is not set 1216# CONFIG_TOUCHSCREEN_INEXIO is not set
1152# CONFIG_TOUCHSCREEN_MK712 is not set 1217# CONFIG_TOUCHSCREEN_MK712 is not set
1153# CONFIG_TOUCHSCREEN_PENMOUNT is not set 1218# CONFIG_TOUCHSCREEN_PENMOUNT is not set
1154# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 1219# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
1155# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 1220# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
1156# CONFIG_TOUCHSCREEN_UCB1400 is not set
1157# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 1221# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
1158# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 1222# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
1223# CONFIG_TOUCHSCREEN_TSC2007 is not set
1159CONFIG_INPUT_MISC=y 1224CONFIG_INPUT_MISC=y
1160# CONFIG_INPUT_PCSPKR is not set 1225# CONFIG_INPUT_PCSPKR is not set
1161# CONFIG_INPUT_APANEL is not set 1226# CONFIG_INPUT_APANEL is not set
@@ -1165,6 +1230,7 @@ CONFIG_INPUT_MISC=y
1165# CONFIG_INPUT_KEYSPAN_REMOTE is not set 1230# CONFIG_INPUT_KEYSPAN_REMOTE is not set
1166# CONFIG_INPUT_POWERMATE is not set 1231# CONFIG_INPUT_POWERMATE is not set
1167# CONFIG_INPUT_YEALINK is not set 1232# CONFIG_INPUT_YEALINK is not set
1233# CONFIG_INPUT_CM109 is not set
1168# CONFIG_INPUT_UINPUT is not set 1234# CONFIG_INPUT_UINPUT is not set
1169 1235
1170# 1236#
@@ -1231,6 +1297,7 @@ CONFIG_SERIAL_CORE=y
1231CONFIG_SERIAL_CORE_CONSOLE=y 1297CONFIG_SERIAL_CORE_CONSOLE=y
1232# CONFIG_SERIAL_JSM is not set 1298# CONFIG_SERIAL_JSM is not set
1233CONFIG_UNIX98_PTYS=y 1299CONFIG_UNIX98_PTYS=y
1300# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
1234# CONFIG_LEGACY_PTYS is not set 1301# CONFIG_LEGACY_PTYS is not set
1235# CONFIG_IPMI_HANDLER is not set 1302# CONFIG_IPMI_HANDLER is not set
1236CONFIG_HW_RANDOM=y 1303CONFIG_HW_RANDOM=y
@@ -1260,6 +1327,7 @@ CONFIG_I2C=y
1260CONFIG_I2C_BOARDINFO=y 1327CONFIG_I2C_BOARDINFO=y
1261# CONFIG_I2C_CHARDEV is not set 1328# CONFIG_I2C_CHARDEV is not set
1262CONFIG_I2C_HELPER_AUTO=y 1329CONFIG_I2C_HELPER_AUTO=y
1330CONFIG_I2C_ALGOBIT=y
1263 1331
1264# 1332#
1265# I2C Hardware Bus support 1333# I2C Hardware Bus support
@@ -1311,8 +1379,6 @@ CONFIG_I2C_I801=y
1311# Miscellaneous I2C Chip support 1379# Miscellaneous I2C Chip support
1312# 1380#
1313# CONFIG_DS1682 is not set 1381# CONFIG_DS1682 is not set
1314# CONFIG_EEPROM_AT24 is not set
1315# CONFIG_EEPROM_LEGACY is not set
1316# CONFIG_SENSORS_PCF8574 is not set 1382# CONFIG_SENSORS_PCF8574 is not set
1317# CONFIG_PCF8575 is not set 1383# CONFIG_PCF8575 is not set
1318# CONFIG_SENSORS_PCA9539 is not set 1384# CONFIG_SENSORS_PCA9539 is not set
@@ -1331,8 +1397,78 @@ CONFIG_POWER_SUPPLY=y
1331# CONFIG_POWER_SUPPLY_DEBUG is not set 1397# CONFIG_POWER_SUPPLY_DEBUG is not set
1332# CONFIG_PDA_POWER is not set 1398# CONFIG_PDA_POWER is not set
1333# CONFIG_BATTERY_DS2760 is not set 1399# CONFIG_BATTERY_DS2760 is not set
1334# CONFIG_HWMON is not set 1400# CONFIG_BATTERY_BQ27x00 is not set
1401CONFIG_HWMON=y
1402# CONFIG_HWMON_VID is not set
1403# CONFIG_SENSORS_ABITUGURU is not set
1404# CONFIG_SENSORS_ABITUGURU3 is not set
1405# CONFIG_SENSORS_AD7414 is not set
1406# CONFIG_SENSORS_AD7418 is not set
1407# CONFIG_SENSORS_ADM1021 is not set
1408# CONFIG_SENSORS_ADM1025 is not set
1409# CONFIG_SENSORS_ADM1026 is not set
1410# CONFIG_SENSORS_ADM1029 is not set
1411# CONFIG_SENSORS_ADM1031 is not set
1412# CONFIG_SENSORS_ADM9240 is not set
1413# CONFIG_SENSORS_ADT7462 is not set
1414# CONFIG_SENSORS_ADT7470 is not set
1415# CONFIG_SENSORS_ADT7473 is not set
1416# CONFIG_SENSORS_ADT7475 is not set
1417# CONFIG_SENSORS_K8TEMP is not set
1418# CONFIG_SENSORS_ASB100 is not set
1419# CONFIG_SENSORS_ATXP1 is not set
1420# CONFIG_SENSORS_DS1621 is not set
1421# CONFIG_SENSORS_I5K_AMB is not set
1422# CONFIG_SENSORS_F71805F is not set
1423# CONFIG_SENSORS_F71882FG is not set
1424# CONFIG_SENSORS_F75375S is not set
1425# CONFIG_SENSORS_FSCHER is not set
1426# CONFIG_SENSORS_FSCPOS is not set
1427# CONFIG_SENSORS_FSCHMD is not set
1428# CONFIG_SENSORS_GL518SM is not set
1429# CONFIG_SENSORS_GL520SM is not set
1430# CONFIG_SENSORS_CORETEMP is not set
1431# CONFIG_SENSORS_IT87 is not set
1432# CONFIG_SENSORS_LM63 is not set
1433# CONFIG_SENSORS_LM75 is not set
1434# CONFIG_SENSORS_LM77 is not set
1435# CONFIG_SENSORS_LM78 is not set
1436# CONFIG_SENSORS_LM80 is not set
1437# CONFIG_SENSORS_LM83 is not set
1438# CONFIG_SENSORS_LM85 is not set
1439# CONFIG_SENSORS_LM87 is not set
1440# CONFIG_SENSORS_LM90 is not set
1441# CONFIG_SENSORS_LM92 is not set
1442# CONFIG_SENSORS_LM93 is not set
1443# CONFIG_SENSORS_LTC4245 is not set
1444# CONFIG_SENSORS_MAX1619 is not set
1445# CONFIG_SENSORS_MAX6650 is not set
1446# CONFIG_SENSORS_PC87360 is not set
1447# CONFIG_SENSORS_PC87427 is not set
1448# CONFIG_SENSORS_SIS5595 is not set
1449# CONFIG_SENSORS_DME1737 is not set
1450# CONFIG_SENSORS_SMSC47M1 is not set
1451# CONFIG_SENSORS_SMSC47M192 is not set
1452# CONFIG_SENSORS_SMSC47B397 is not set
1453# CONFIG_SENSORS_ADS7828 is not set
1454# CONFIG_SENSORS_THMC50 is not set
1455# CONFIG_SENSORS_VIA686A is not set
1456# CONFIG_SENSORS_VT1211 is not set
1457# CONFIG_SENSORS_VT8231 is not set
1458# CONFIG_SENSORS_W83781D is not set
1459# CONFIG_SENSORS_W83791D is not set
1460# CONFIG_SENSORS_W83792D is not set
1461# CONFIG_SENSORS_W83793 is not set
1462# CONFIG_SENSORS_W83L785TS is not set
1463# CONFIG_SENSORS_W83L786NG is not set
1464# CONFIG_SENSORS_W83627HF is not set
1465# CONFIG_SENSORS_W83627EHF is not set
1466# CONFIG_SENSORS_HDAPS is not set
1467# CONFIG_SENSORS_LIS3LV02D is not set
1468# CONFIG_SENSORS_APPLESMC is not set
1469# CONFIG_HWMON_DEBUG_CHIP is not set
1335CONFIG_THERMAL=y 1470CONFIG_THERMAL=y
1471# CONFIG_THERMAL_HWMON is not set
1336CONFIG_WATCHDOG=y 1472CONFIG_WATCHDOG=y
1337# CONFIG_WATCHDOG_NOWAYOUT is not set 1473# CONFIG_WATCHDOG_NOWAYOUT is not set
1338 1474
@@ -1352,15 +1488,18 @@ CONFIG_WATCHDOG=y
1352# CONFIG_I6300ESB_WDT is not set 1488# CONFIG_I6300ESB_WDT is not set
1353# CONFIG_ITCO_WDT is not set 1489# CONFIG_ITCO_WDT is not set
1354# CONFIG_IT8712F_WDT is not set 1490# CONFIG_IT8712F_WDT is not set
1491# CONFIG_IT87_WDT is not set
1355# CONFIG_HP_WATCHDOG is not set 1492# CONFIG_HP_WATCHDOG is not set
1356# CONFIG_SC1200_WDT is not set 1493# CONFIG_SC1200_WDT is not set
1357# CONFIG_PC87413_WDT is not set 1494# CONFIG_PC87413_WDT is not set
1358# CONFIG_60XX_WDT is not set 1495# CONFIG_60XX_WDT is not set
1359# CONFIG_SBC8360_WDT is not set 1496# CONFIG_SBC8360_WDT is not set
1360# CONFIG_CPU5_WDT is not set 1497# CONFIG_CPU5_WDT is not set
1498# CONFIG_SMSC_SCH311X_WDT is not set
1361# CONFIG_SMSC37B787_WDT is not set 1499# CONFIG_SMSC37B787_WDT is not set
1362# CONFIG_W83627HF_WDT is not set 1500# CONFIG_W83627HF_WDT is not set
1363# CONFIG_W83697HF_WDT is not set 1501# CONFIG_W83697HF_WDT is not set
1502# CONFIG_W83697UG_WDT is not set
1364# CONFIG_W83877F_WDT is not set 1503# CONFIG_W83877F_WDT is not set
1365# CONFIG_W83977F_WDT is not set 1504# CONFIG_W83977F_WDT is not set
1366# CONFIG_MACHZ_WDT is not set 1505# CONFIG_MACHZ_WDT is not set
@@ -1376,11 +1515,11 @@ CONFIG_WATCHDOG=y
1376# USB-based Watchdog Cards 1515# USB-based Watchdog Cards
1377# 1516#
1378# CONFIG_USBPCWATCHDOG is not set 1517# CONFIG_USBPCWATCHDOG is not set
1518CONFIG_SSB_POSSIBLE=y
1379 1519
1380# 1520#
1381# Sonics Silicon Backplane 1521# Sonics Silicon Backplane
1382# 1522#
1383CONFIG_SSB_POSSIBLE=y
1384# CONFIG_SSB is not set 1523# CONFIG_SSB is not set
1385 1524
1386# 1525#
@@ -1389,7 +1528,13 @@ CONFIG_SSB_POSSIBLE=y
1389# CONFIG_MFD_CORE is not set 1528# CONFIG_MFD_CORE is not set
1390# CONFIG_MFD_SM501 is not set 1529# CONFIG_MFD_SM501 is not set
1391# CONFIG_HTC_PASIC3 is not set 1530# CONFIG_HTC_PASIC3 is not set
1531# CONFIG_TWL4030_CORE is not set
1392# CONFIG_MFD_TMIO is not set 1532# CONFIG_MFD_TMIO is not set
1533# CONFIG_PMIC_DA903X is not set
1534# CONFIG_MFD_WM8400 is not set
1535# CONFIG_MFD_WM8350_I2C is not set
1536# CONFIG_MFD_PCF50633 is not set
1537# CONFIG_REGULATOR is not set
1393 1538
1394# 1539#
1395# Multimedia devices 1540# Multimedia devices
@@ -1423,6 +1568,7 @@ CONFIG_DRM=y
1423# CONFIG_DRM_I810 is not set 1568# CONFIG_DRM_I810 is not set
1424# CONFIG_DRM_I830 is not set 1569# CONFIG_DRM_I830 is not set
1425CONFIG_DRM_I915=y 1570CONFIG_DRM_I915=y
1571CONFIG_DRM_I915_KMS=y
1426# CONFIG_DRM_MGA is not set 1572# CONFIG_DRM_MGA is not set
1427# CONFIG_DRM_SIS is not set 1573# CONFIG_DRM_SIS is not set
1428# CONFIG_DRM_VIA is not set 1574# CONFIG_DRM_VIA is not set
@@ -1432,6 +1578,7 @@ CONFIG_DRM_I915=y
1432CONFIG_FB=y 1578CONFIG_FB=y
1433# CONFIG_FIRMWARE_EDID is not set 1579# CONFIG_FIRMWARE_EDID is not set
1434# CONFIG_FB_DDC is not set 1580# CONFIG_FB_DDC is not set
1581# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1435CONFIG_FB_CFB_FILLRECT=y 1582CONFIG_FB_CFB_FILLRECT=y
1436CONFIG_FB_CFB_COPYAREA=y 1583CONFIG_FB_CFB_COPYAREA=y
1437CONFIG_FB_CFB_IMAGEBLIT=y 1584CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1460,7 +1607,6 @@ CONFIG_FB_TILEBLITTING=y
1460# CONFIG_FB_UVESA is not set 1607# CONFIG_FB_UVESA is not set
1461# CONFIG_FB_VESA is not set 1608# CONFIG_FB_VESA is not set
1462CONFIG_FB_EFI=y 1609CONFIG_FB_EFI=y
1463# CONFIG_FB_IMAC is not set
1464# CONFIG_FB_N411 is not set 1610# CONFIG_FB_N411 is not set
1465# CONFIG_FB_HGA is not set 1611# CONFIG_FB_HGA is not set
1466# CONFIG_FB_S1D13XXX is not set 1612# CONFIG_FB_S1D13XXX is not set
@@ -1475,6 +1621,7 @@ CONFIG_FB_EFI=y
1475# CONFIG_FB_S3 is not set 1621# CONFIG_FB_S3 is not set
1476# CONFIG_FB_SAVAGE is not set 1622# CONFIG_FB_SAVAGE is not set
1477# CONFIG_FB_SIS is not set 1623# CONFIG_FB_SIS is not set
1624# CONFIG_FB_VIA is not set
1478# CONFIG_FB_NEOMAGIC is not set 1625# CONFIG_FB_NEOMAGIC is not set
1479# CONFIG_FB_KYRO is not set 1626# CONFIG_FB_KYRO is not set
1480# CONFIG_FB_3DFX is not set 1627# CONFIG_FB_3DFX is not set
@@ -1486,12 +1633,15 @@ CONFIG_FB_EFI=y
1486# CONFIG_FB_CARMINE is not set 1633# CONFIG_FB_CARMINE is not set
1487# CONFIG_FB_GEODE is not set 1634# CONFIG_FB_GEODE is not set
1488# CONFIG_FB_VIRTUAL is not set 1635# CONFIG_FB_VIRTUAL is not set
1636# CONFIG_FB_METRONOME is not set
1637# CONFIG_FB_MB862XX is not set
1489CONFIG_BACKLIGHT_LCD_SUPPORT=y 1638CONFIG_BACKLIGHT_LCD_SUPPORT=y
1490# CONFIG_LCD_CLASS_DEVICE is not set 1639# CONFIG_LCD_CLASS_DEVICE is not set
1491CONFIG_BACKLIGHT_CLASS_DEVICE=y 1640CONFIG_BACKLIGHT_CLASS_DEVICE=y
1492# CONFIG_BACKLIGHT_CORGI is not set 1641CONFIG_BACKLIGHT_GENERIC=y
1493# CONFIG_BACKLIGHT_PROGEAR is not set 1642# CONFIG_BACKLIGHT_PROGEAR is not set
1494# CONFIG_BACKLIGHT_MBP_NVIDIA is not set 1643# CONFIG_BACKLIGHT_MBP_NVIDIA is not set
1644# CONFIG_BACKLIGHT_SAHARA is not set
1495 1645
1496# 1646#
1497# Display device support 1647# Display device support
@@ -1511,10 +1661,12 @@ CONFIG_LOGO=y
1511# CONFIG_LOGO_LINUX_VGA16 is not set 1661# CONFIG_LOGO_LINUX_VGA16 is not set
1512CONFIG_LOGO_LINUX_CLUT224=y 1662CONFIG_LOGO_LINUX_CLUT224=y
1513CONFIG_SOUND=y 1663CONFIG_SOUND=y
1664CONFIG_SOUND_OSS_CORE=y
1514CONFIG_SND=y 1665CONFIG_SND=y
1515CONFIG_SND_TIMER=y 1666CONFIG_SND_TIMER=y
1516CONFIG_SND_PCM=y 1667CONFIG_SND_PCM=y
1517CONFIG_SND_HWDEP=y 1668CONFIG_SND_HWDEP=y
1669CONFIG_SND_JACK=y
1518CONFIG_SND_SEQUENCER=y 1670CONFIG_SND_SEQUENCER=y
1519CONFIG_SND_SEQ_DUMMY=y 1671CONFIG_SND_SEQ_DUMMY=y
1520CONFIG_SND_OSSEMUL=y 1672CONFIG_SND_OSSEMUL=y
@@ -1522,6 +1674,8 @@ CONFIG_SND_MIXER_OSS=y
1522CONFIG_SND_PCM_OSS=y 1674CONFIG_SND_PCM_OSS=y
1523CONFIG_SND_PCM_OSS_PLUGINS=y 1675CONFIG_SND_PCM_OSS_PLUGINS=y
1524CONFIG_SND_SEQUENCER_OSS=y 1676CONFIG_SND_SEQUENCER_OSS=y
1677CONFIG_SND_HRTIMER=y
1678CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
1525CONFIG_SND_DYNAMIC_MINORS=y 1679CONFIG_SND_DYNAMIC_MINORS=y
1526CONFIG_SND_SUPPORT_OLD_API=y 1680CONFIG_SND_SUPPORT_OLD_API=y
1527CONFIG_SND_VERBOSE_PROCFS=y 1681CONFIG_SND_VERBOSE_PROCFS=y
@@ -1575,11 +1729,16 @@ CONFIG_SND_PCI=y
1575# CONFIG_SND_FM801 is not set 1729# CONFIG_SND_FM801 is not set
1576CONFIG_SND_HDA_INTEL=y 1730CONFIG_SND_HDA_INTEL=y
1577CONFIG_SND_HDA_HWDEP=y 1731CONFIG_SND_HDA_HWDEP=y
1732# CONFIG_SND_HDA_RECONFIG is not set
1733# CONFIG_SND_HDA_INPUT_BEEP is not set
1578CONFIG_SND_HDA_CODEC_REALTEK=y 1734CONFIG_SND_HDA_CODEC_REALTEK=y
1579CONFIG_SND_HDA_CODEC_ANALOG=y 1735CONFIG_SND_HDA_CODEC_ANALOG=y
1580CONFIG_SND_HDA_CODEC_SIGMATEL=y 1736CONFIG_SND_HDA_CODEC_SIGMATEL=y
1581CONFIG_SND_HDA_CODEC_VIA=y 1737CONFIG_SND_HDA_CODEC_VIA=y
1582CONFIG_SND_HDA_CODEC_ATIHDMI=y 1738CONFIG_SND_HDA_CODEC_ATIHDMI=y
1739CONFIG_SND_HDA_CODEC_NVHDMI=y
1740CONFIG_SND_HDA_CODEC_INTELHDMI=y
1741CONFIG_SND_HDA_ELD=y
1583CONFIG_SND_HDA_CODEC_CONEXANT=y 1742CONFIG_SND_HDA_CODEC_CONEXANT=y
1584CONFIG_SND_HDA_CODEC_CMEDIA=y 1743CONFIG_SND_HDA_CODEC_CMEDIA=y
1585CONFIG_SND_HDA_CODEC_SI3054=y 1744CONFIG_SND_HDA_CODEC_SI3054=y
@@ -1612,6 +1771,7 @@ CONFIG_SND_USB=y
1612# CONFIG_SND_USB_AUDIO is not set 1771# CONFIG_SND_USB_AUDIO is not set
1613# CONFIG_SND_USB_USX2Y is not set 1772# CONFIG_SND_USB_USX2Y is not set
1614# CONFIG_SND_USB_CAIAQ is not set 1773# CONFIG_SND_USB_CAIAQ is not set
1774# CONFIG_SND_USB_US122L is not set
1615CONFIG_SND_PCMCIA=y 1775CONFIG_SND_PCMCIA=y
1616# CONFIG_SND_VXPOCKET is not set 1776# CONFIG_SND_VXPOCKET is not set
1617# CONFIG_SND_PDAUDIOCF is not set 1777# CONFIG_SND_PDAUDIOCF is not set
@@ -1626,15 +1786,37 @@ CONFIG_HIDRAW=y
1626# USB Input Devices 1786# USB Input Devices
1627# 1787#
1628CONFIG_USB_HID=y 1788CONFIG_USB_HID=y
1629CONFIG_USB_HIDINPUT_POWERBOOK=y
1630CONFIG_HID_FF=y
1631CONFIG_HID_PID=y 1789CONFIG_HID_PID=y
1790CONFIG_USB_HIDDEV=y
1791
1792#
1793# Special HID drivers
1794#
1795CONFIG_HID_COMPAT=y
1796CONFIG_HID_A4TECH=y
1797CONFIG_HID_APPLE=y
1798CONFIG_HID_BELKIN=y
1799CONFIG_HID_CHERRY=y
1800CONFIG_HID_CHICONY=y
1801CONFIG_HID_CYPRESS=y
1802CONFIG_HID_EZKEY=y
1803CONFIG_HID_GYRATION=y
1804CONFIG_HID_LOGITECH=y
1632CONFIG_LOGITECH_FF=y 1805CONFIG_LOGITECH_FF=y
1633# CONFIG_LOGIRUMBLEPAD2_FF is not set 1806# CONFIG_LOGIRUMBLEPAD2_FF is not set
1807CONFIG_HID_MICROSOFT=y
1808CONFIG_HID_MONTEREY=y
1809CONFIG_HID_NTRIG=y
1810CONFIG_HID_PANTHERLORD=y
1634CONFIG_PANTHERLORD_FF=y 1811CONFIG_PANTHERLORD_FF=y
1812CONFIG_HID_PETALYNX=y
1813CONFIG_HID_SAMSUNG=y
1814CONFIG_HID_SONY=y
1815CONFIG_HID_SUNPLUS=y
1816# CONFIG_GREENASIA_FF is not set
1817CONFIG_HID_TOPSEED=y
1635CONFIG_THRUSTMASTER_FF=y 1818CONFIG_THRUSTMASTER_FF=y
1636CONFIG_ZEROPLUS_FF=y 1819CONFIG_ZEROPLUS_FF=y
1637CONFIG_USB_HIDDEV=y
1638CONFIG_USB_SUPPORT=y 1820CONFIG_USB_SUPPORT=y
1639CONFIG_USB_ARCH_HAS_HCD=y 1821CONFIG_USB_ARCH_HAS_HCD=y
1640CONFIG_USB_ARCH_HAS_OHCI=y 1822CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1652,6 +1834,8 @@ CONFIG_USB_DEVICEFS=y
1652CONFIG_USB_SUSPEND=y 1834CONFIG_USB_SUSPEND=y
1653# CONFIG_USB_OTG is not set 1835# CONFIG_USB_OTG is not set
1654CONFIG_USB_MON=y 1836CONFIG_USB_MON=y
1837# CONFIG_USB_WUSB is not set
1838# CONFIG_USB_WUSB_CBAF is not set
1655 1839
1656# 1840#
1657# USB Host Controller Drivers 1841# USB Host Controller Drivers
@@ -1660,6 +1844,7 @@ CONFIG_USB_MON=y
1660CONFIG_USB_EHCI_HCD=y 1844CONFIG_USB_EHCI_HCD=y
1661# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1845# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1662# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1846# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1847# CONFIG_USB_OXU210HP_HCD is not set
1663# CONFIG_USB_ISP116X_HCD is not set 1848# CONFIG_USB_ISP116X_HCD is not set
1664# CONFIG_USB_ISP1760_HCD is not set 1849# CONFIG_USB_ISP1760_HCD is not set
1665CONFIG_USB_OHCI_HCD=y 1850CONFIG_USB_OHCI_HCD=y
@@ -1669,6 +1854,8 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1669CONFIG_USB_UHCI_HCD=y 1854CONFIG_USB_UHCI_HCD=y
1670# CONFIG_USB_SL811_HCD is not set 1855# CONFIG_USB_SL811_HCD is not set
1671# CONFIG_USB_R8A66597_HCD is not set 1856# CONFIG_USB_R8A66597_HCD is not set
1857# CONFIG_USB_WHCI_HCD is not set
1858# CONFIG_USB_HWA_HCD is not set
1672 1859
1673# 1860#
1674# USB Device Class drivers 1861# USB Device Class drivers
@@ -1676,20 +1863,20 @@ CONFIG_USB_UHCI_HCD=y
1676# CONFIG_USB_ACM is not set 1863# CONFIG_USB_ACM is not set
1677CONFIG_USB_PRINTER=y 1864CONFIG_USB_PRINTER=y
1678# CONFIG_USB_WDM is not set 1865# CONFIG_USB_WDM is not set
1866# CONFIG_USB_TMC is not set
1679 1867
1680# 1868#
1681# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1869# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1682# 1870#
1683 1871
1684# 1872#
1685# may also be needed; see USB_STORAGE Help for more information 1873# see USB_STORAGE Help for more information
1686# 1874#
1687CONFIG_USB_STORAGE=y 1875CONFIG_USB_STORAGE=y
1688# CONFIG_USB_STORAGE_DEBUG is not set 1876# CONFIG_USB_STORAGE_DEBUG is not set
1689# CONFIG_USB_STORAGE_DATAFAB is not set 1877# CONFIG_USB_STORAGE_DATAFAB is not set
1690# CONFIG_USB_STORAGE_FREECOM is not set 1878# CONFIG_USB_STORAGE_FREECOM is not set
1691# CONFIG_USB_STORAGE_ISD200 is not set 1879# CONFIG_USB_STORAGE_ISD200 is not set
1692# CONFIG_USB_STORAGE_DPCM is not set
1693# CONFIG_USB_STORAGE_USBAT is not set 1880# CONFIG_USB_STORAGE_USBAT is not set
1694# CONFIG_USB_STORAGE_SDDR09 is not set 1881# CONFIG_USB_STORAGE_SDDR09 is not set
1695# CONFIG_USB_STORAGE_SDDR55 is not set 1882# CONFIG_USB_STORAGE_SDDR55 is not set
@@ -1697,7 +1884,6 @@ CONFIG_USB_STORAGE=y
1697# CONFIG_USB_STORAGE_ALAUDA is not set 1884# CONFIG_USB_STORAGE_ALAUDA is not set
1698# CONFIG_USB_STORAGE_ONETOUCH is not set 1885# CONFIG_USB_STORAGE_ONETOUCH is not set
1699# CONFIG_USB_STORAGE_KARMA is not set 1886# CONFIG_USB_STORAGE_KARMA is not set
1700# CONFIG_USB_STORAGE_SIERRA is not set
1701# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set 1887# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1702CONFIG_USB_LIBUSUAL=y 1888CONFIG_USB_LIBUSUAL=y
1703 1889
@@ -1718,6 +1904,7 @@ CONFIG_USB_LIBUSUAL=y
1718# CONFIG_USB_EMI62 is not set 1904# CONFIG_USB_EMI62 is not set
1719# CONFIG_USB_EMI26 is not set 1905# CONFIG_USB_EMI26 is not set
1720# CONFIG_USB_ADUTUX is not set 1906# CONFIG_USB_ADUTUX is not set
1907# CONFIG_USB_SEVSEG is not set
1721# CONFIG_USB_RIO500 is not set 1908# CONFIG_USB_RIO500 is not set
1722# CONFIG_USB_LEGOTOWER is not set 1909# CONFIG_USB_LEGOTOWER is not set
1723# CONFIG_USB_LCD is not set 1910# CONFIG_USB_LCD is not set
@@ -1735,7 +1922,13 @@ CONFIG_USB_LIBUSUAL=y
1735# CONFIG_USB_IOWARRIOR is not set 1922# CONFIG_USB_IOWARRIOR is not set
1736# CONFIG_USB_TEST is not set 1923# CONFIG_USB_TEST is not set
1737# CONFIG_USB_ISIGHTFW is not set 1924# CONFIG_USB_ISIGHTFW is not set
1925# CONFIG_USB_VST is not set
1738# CONFIG_USB_GADGET is not set 1926# CONFIG_USB_GADGET is not set
1927
1928#
1929# OTG and related infrastructure
1930#
1931# CONFIG_UWB is not set
1739# CONFIG_MMC is not set 1932# CONFIG_MMC is not set
1740# CONFIG_MEMSTICK is not set 1933# CONFIG_MEMSTICK is not set
1741CONFIG_NEW_LEDS=y 1934CONFIG_NEW_LEDS=y
@@ -1744,6 +1937,7 @@ CONFIG_LEDS_CLASS=y
1744# 1937#
1745# LED drivers 1938# LED drivers
1746# 1939#
1940# CONFIG_LEDS_ALIX2 is not set
1747# CONFIG_LEDS_PCA9532 is not set 1941# CONFIG_LEDS_PCA9532 is not set
1748# CONFIG_LEDS_CLEVO_MAIL is not set 1942# CONFIG_LEDS_CLEVO_MAIL is not set
1749# CONFIG_LEDS_PCA955X is not set 1943# CONFIG_LEDS_PCA955X is not set
@@ -1754,6 +1948,7 @@ CONFIG_LEDS_CLASS=y
1754CONFIG_LEDS_TRIGGERS=y 1948CONFIG_LEDS_TRIGGERS=y
1755# CONFIG_LEDS_TRIGGER_TIMER is not set 1949# CONFIG_LEDS_TRIGGER_TIMER is not set
1756# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set 1950# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1951# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1757# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set 1952# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1758# CONFIG_ACCESSIBILITY is not set 1953# CONFIG_ACCESSIBILITY is not set
1759# CONFIG_INFINIBAND is not set 1954# CONFIG_INFINIBAND is not set
@@ -1793,6 +1988,7 @@ CONFIG_RTC_INTF_DEV=y
1793# CONFIG_RTC_DRV_M41T80 is not set 1988# CONFIG_RTC_DRV_M41T80 is not set
1794# CONFIG_RTC_DRV_S35390A is not set 1989# CONFIG_RTC_DRV_S35390A is not set
1795# CONFIG_RTC_DRV_FM3130 is not set 1990# CONFIG_RTC_DRV_FM3130 is not set
1991# CONFIG_RTC_DRV_RX8581 is not set
1796 1992
1797# 1993#
1798# SPI RTC drivers 1994# SPI RTC drivers
@@ -1802,12 +1998,15 @@ CONFIG_RTC_INTF_DEV=y
1802# Platform RTC drivers 1998# Platform RTC drivers
1803# 1999#
1804CONFIG_RTC_DRV_CMOS=y 2000CONFIG_RTC_DRV_CMOS=y
2001# CONFIG_RTC_DRV_DS1286 is not set
1805# CONFIG_RTC_DRV_DS1511 is not set 2002# CONFIG_RTC_DRV_DS1511 is not set
1806# CONFIG_RTC_DRV_DS1553 is not set 2003# CONFIG_RTC_DRV_DS1553 is not set
1807# CONFIG_RTC_DRV_DS1742 is not set 2004# CONFIG_RTC_DRV_DS1742 is not set
1808# CONFIG_RTC_DRV_STK17TA8 is not set 2005# CONFIG_RTC_DRV_STK17TA8 is not set
1809# CONFIG_RTC_DRV_M48T86 is not set 2006# CONFIG_RTC_DRV_M48T86 is not set
2007# CONFIG_RTC_DRV_M48T35 is not set
1810# CONFIG_RTC_DRV_M48T59 is not set 2008# CONFIG_RTC_DRV_M48T59 is not set
2009# CONFIG_RTC_DRV_BQ4802 is not set
1811# CONFIG_RTC_DRV_V3020 is not set 2010# CONFIG_RTC_DRV_V3020 is not set
1812 2011
1813# 2012#
@@ -1820,6 +2019,21 @@ CONFIG_DMADEVICES=y
1820# 2019#
1821# CONFIG_INTEL_IOATDMA is not set 2020# CONFIG_INTEL_IOATDMA is not set
1822# CONFIG_UIO is not set 2021# CONFIG_UIO is not set
2022# CONFIG_STAGING is not set
2023CONFIG_X86_PLATFORM_DEVICES=y
2024# CONFIG_ACER_WMI is not set
2025# CONFIG_ASUS_LAPTOP is not set
2026# CONFIG_FUJITSU_LAPTOP is not set
2027# CONFIG_MSI_LAPTOP is not set
2028# CONFIG_PANASONIC_LAPTOP is not set
2029# CONFIG_COMPAL_LAPTOP is not set
2030# CONFIG_SONY_LAPTOP is not set
2031# CONFIG_THINKPAD_ACPI is not set
2032# CONFIG_INTEL_MENLOW is not set
2033CONFIG_EEEPC_LAPTOP=y
2034# CONFIG_ACPI_WMI is not set
2035# CONFIG_ACPI_ASUS is not set
2036# CONFIG_ACPI_TOSHIBA is not set
1823 2037
1824# 2038#
1825# Firmware Drivers 2039# Firmware Drivers
@@ -1830,8 +2044,7 @@ CONFIG_EFI_VARS=y
1830# CONFIG_DELL_RBU is not set 2044# CONFIG_DELL_RBU is not set
1831# CONFIG_DCDBAS is not set 2045# CONFIG_DCDBAS is not set
1832CONFIG_DMIID=y 2046CONFIG_DMIID=y
1833CONFIG_ISCSI_IBFT_FIND=y 2047# CONFIG_ISCSI_IBFT_FIND is not set
1834CONFIG_ISCSI_IBFT=y
1835 2048
1836# 2049#
1837# File systems 2050# File systems
@@ -1841,22 +2054,25 @@ CONFIG_EXT3_FS=y
1841CONFIG_EXT3_FS_XATTR=y 2054CONFIG_EXT3_FS_XATTR=y
1842CONFIG_EXT3_FS_POSIX_ACL=y 2055CONFIG_EXT3_FS_POSIX_ACL=y
1843CONFIG_EXT3_FS_SECURITY=y 2056CONFIG_EXT3_FS_SECURITY=y
1844# CONFIG_EXT4DEV_FS is not set 2057# CONFIG_EXT4_FS is not set
1845CONFIG_JBD=y 2058CONFIG_JBD=y
1846# CONFIG_JBD_DEBUG is not set 2059# CONFIG_JBD_DEBUG is not set
1847CONFIG_FS_MBCACHE=y 2060CONFIG_FS_MBCACHE=y
1848# CONFIG_REISERFS_FS is not set 2061# CONFIG_REISERFS_FS is not set
1849# CONFIG_JFS_FS is not set 2062# CONFIG_JFS_FS is not set
1850CONFIG_FS_POSIX_ACL=y 2063CONFIG_FS_POSIX_ACL=y
2064CONFIG_FILE_LOCKING=y
1851# CONFIG_XFS_FS is not set 2065# CONFIG_XFS_FS is not set
1852# CONFIG_GFS2_FS is not set 2066# CONFIG_GFS2_FS is not set
1853# CONFIG_OCFS2_FS is not set 2067# CONFIG_OCFS2_FS is not set
2068# CONFIG_BTRFS_FS is not set
1854CONFIG_DNOTIFY=y 2069CONFIG_DNOTIFY=y
1855CONFIG_INOTIFY=y 2070CONFIG_INOTIFY=y
1856CONFIG_INOTIFY_USER=y 2071CONFIG_INOTIFY_USER=y
1857CONFIG_QUOTA=y 2072CONFIG_QUOTA=y
1858CONFIG_QUOTA_NETLINK_INTERFACE=y 2073CONFIG_QUOTA_NETLINK_INTERFACE=y
1859# CONFIG_PRINT_QUOTA_WARNING is not set 2074# CONFIG_PRINT_QUOTA_WARNING is not set
2075CONFIG_QUOTA_TREE=y
1860# CONFIG_QFMT_V1 is not set 2076# CONFIG_QFMT_V1 is not set
1861CONFIG_QFMT_V2=y 2077CONFIG_QFMT_V2=y
1862CONFIG_QUOTACTL=y 2078CONFIG_QUOTACTL=y
@@ -1890,16 +2106,14 @@ CONFIG_PROC_FS=y
1890CONFIG_PROC_KCORE=y 2106CONFIG_PROC_KCORE=y
1891CONFIG_PROC_VMCORE=y 2107CONFIG_PROC_VMCORE=y
1892CONFIG_PROC_SYSCTL=y 2108CONFIG_PROC_SYSCTL=y
2109CONFIG_PROC_PAGE_MONITOR=y
1893CONFIG_SYSFS=y 2110CONFIG_SYSFS=y
1894CONFIG_TMPFS=y 2111CONFIG_TMPFS=y
1895CONFIG_TMPFS_POSIX_ACL=y 2112CONFIG_TMPFS_POSIX_ACL=y
1896CONFIG_HUGETLBFS=y 2113CONFIG_HUGETLBFS=y
1897CONFIG_HUGETLB_PAGE=y 2114CONFIG_HUGETLB_PAGE=y
1898# CONFIG_CONFIGFS_FS is not set 2115# CONFIG_CONFIGFS_FS is not set
1899 2116CONFIG_MISC_FILESYSTEMS=y
1900#
1901# Miscellaneous filesystems
1902#
1903# CONFIG_ADFS_FS is not set 2117# CONFIG_ADFS_FS is not set
1904# CONFIG_AFFS_FS is not set 2118# CONFIG_AFFS_FS is not set
1905# CONFIG_ECRYPT_FS is not set 2119# CONFIG_ECRYPT_FS is not set
@@ -1909,6 +2123,7 @@ CONFIG_HUGETLB_PAGE=y
1909# CONFIG_BFS_FS is not set 2123# CONFIG_BFS_FS is not set
1910# CONFIG_EFS_FS is not set 2124# CONFIG_EFS_FS is not set
1911# CONFIG_CRAMFS is not set 2125# CONFIG_CRAMFS is not set
2126# CONFIG_SQUASHFS is not set
1912# CONFIG_VXFS_FS is not set 2127# CONFIG_VXFS_FS is not set
1913# CONFIG_MINIX_FS is not set 2128# CONFIG_MINIX_FS is not set
1914# CONFIG_OMFS_FS is not set 2129# CONFIG_OMFS_FS is not set
@@ -1930,6 +2145,7 @@ CONFIG_NFS_ACL_SUPPORT=y
1930CONFIG_NFS_COMMON=y 2145CONFIG_NFS_COMMON=y
1931CONFIG_SUNRPC=y 2146CONFIG_SUNRPC=y
1932CONFIG_SUNRPC_GSS=y 2147CONFIG_SUNRPC_GSS=y
2148# CONFIG_SUNRPC_REGISTER_V4 is not set
1933CONFIG_RPCSEC_GSS_KRB5=y 2149CONFIG_RPCSEC_GSS_KRB5=y
1934# CONFIG_RPCSEC_GSS_SPKM3 is not set 2150# CONFIG_RPCSEC_GSS_SPKM3 is not set
1935# CONFIG_SMB_FS is not set 2151# CONFIG_SMB_FS is not set
@@ -2006,7 +2222,7 @@ CONFIG_NLS_UTF8=y
2006# 2222#
2007CONFIG_TRACE_IRQFLAGS_SUPPORT=y 2223CONFIG_TRACE_IRQFLAGS_SUPPORT=y
2008CONFIG_PRINTK_TIME=y 2224CONFIG_PRINTK_TIME=y
2009CONFIG_ENABLE_WARN_DEPRECATED=y 2225# CONFIG_ENABLE_WARN_DEPRECATED is not set
2010CONFIG_ENABLE_MUST_CHECK=y 2226CONFIG_ENABLE_MUST_CHECK=y
2011CONFIG_FRAME_WARN=2048 2227CONFIG_FRAME_WARN=2048
2012CONFIG_MAGIC_SYSRQ=y 2228CONFIG_MAGIC_SYSRQ=y
@@ -2035,40 +2251,60 @@ CONFIG_TIMER_STATS=y
2035CONFIG_DEBUG_BUGVERBOSE=y 2251CONFIG_DEBUG_BUGVERBOSE=y
2036# CONFIG_DEBUG_INFO is not set 2252# CONFIG_DEBUG_INFO is not set
2037# CONFIG_DEBUG_VM is not set 2253# CONFIG_DEBUG_VM is not set
2254# CONFIG_DEBUG_VIRTUAL is not set
2038# CONFIG_DEBUG_WRITECOUNT is not set 2255# CONFIG_DEBUG_WRITECOUNT is not set
2039CONFIG_DEBUG_MEMORY_INIT=y 2256CONFIG_DEBUG_MEMORY_INIT=y
2040# CONFIG_DEBUG_LIST is not set 2257# CONFIG_DEBUG_LIST is not set
2041# CONFIG_DEBUG_SG is not set 2258# CONFIG_DEBUG_SG is not set
2259# CONFIG_DEBUG_NOTIFIERS is not set
2260CONFIG_ARCH_WANT_FRAME_POINTERS=y
2042CONFIG_FRAME_POINTER=y 2261CONFIG_FRAME_POINTER=y
2043# CONFIG_BOOT_PRINTK_DELAY is not set 2262# CONFIG_BOOT_PRINTK_DELAY is not set
2044# CONFIG_RCU_TORTURE_TEST is not set 2263# CONFIG_RCU_TORTURE_TEST is not set
2264# CONFIG_RCU_CPU_STALL_DETECTOR is not set
2045# CONFIG_KPROBES_SANITY_TEST is not set 2265# CONFIG_KPROBES_SANITY_TEST is not set
2046# CONFIG_BACKTRACE_SELF_TEST is not set 2266# CONFIG_BACKTRACE_SELF_TEST is not set
2267# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
2047# CONFIG_LKDTM is not set 2268# CONFIG_LKDTM is not set
2048# CONFIG_FAULT_INJECTION is not set 2269# CONFIG_FAULT_INJECTION is not set
2049# CONFIG_LATENCYTOP is not set 2270# CONFIG_LATENCYTOP is not set
2050CONFIG_SYSCTL_SYSCALL_CHECK=y 2271CONFIG_SYSCTL_SYSCALL_CHECK=y
2051CONFIG_HAVE_FTRACE=y 2272CONFIG_USER_STACKTRACE_SUPPORT=y
2273CONFIG_HAVE_FUNCTION_TRACER=y
2274CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
2275CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
2052CONFIG_HAVE_DYNAMIC_FTRACE=y 2276CONFIG_HAVE_DYNAMIC_FTRACE=y
2053# CONFIG_FTRACE is not set 2277CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
2278CONFIG_HAVE_HW_BRANCH_TRACER=y
2279
2280#
2281# Tracers
2282#
2283# CONFIG_FUNCTION_TRACER is not set
2054# CONFIG_IRQSOFF_TRACER is not set 2284# CONFIG_IRQSOFF_TRACER is not set
2055# CONFIG_SYSPROF_TRACER is not set 2285# CONFIG_SYSPROF_TRACER is not set
2056# CONFIG_SCHED_TRACER is not set 2286# CONFIG_SCHED_TRACER is not set
2057# CONFIG_CONTEXT_SWITCH_TRACER is not set 2287# CONFIG_CONTEXT_SWITCH_TRACER is not set
2288# CONFIG_BOOT_TRACER is not set
2289# CONFIG_TRACE_BRANCH_PROFILING is not set
2290# CONFIG_POWER_TRACER is not set
2291# CONFIG_STACK_TRACER is not set
2292# CONFIG_HW_BRANCH_TRACER is not set
2058CONFIG_PROVIDE_OHCI1394_DMA_INIT=y 2293CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
2294# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
2059# CONFIG_SAMPLES is not set 2295# CONFIG_SAMPLES is not set
2060CONFIG_HAVE_ARCH_KGDB=y 2296CONFIG_HAVE_ARCH_KGDB=y
2061# CONFIG_KGDB is not set 2297# CONFIG_KGDB is not set
2062# CONFIG_STRICT_DEVMEM is not set 2298# CONFIG_STRICT_DEVMEM is not set
2063CONFIG_X86_VERBOSE_BOOTUP=y 2299CONFIG_X86_VERBOSE_BOOTUP=y
2064CONFIG_EARLY_PRINTK=y 2300CONFIG_EARLY_PRINTK=y
2301CONFIG_EARLY_PRINTK_DBGP=y
2065CONFIG_DEBUG_STACKOVERFLOW=y 2302CONFIG_DEBUG_STACKOVERFLOW=y
2066CONFIG_DEBUG_STACK_USAGE=y 2303CONFIG_DEBUG_STACK_USAGE=y
2067# CONFIG_DEBUG_PAGEALLOC is not set 2304# CONFIG_DEBUG_PAGEALLOC is not set
2068# CONFIG_DEBUG_PER_CPU_MAPS is not set 2305# CONFIG_DEBUG_PER_CPU_MAPS is not set
2069# CONFIG_X86_PTDUMP is not set 2306# CONFIG_X86_PTDUMP is not set
2070CONFIG_DEBUG_RODATA=y 2307CONFIG_DEBUG_RODATA=y
2071# CONFIG_DIRECT_GBPAGES is not set
2072# CONFIG_DEBUG_RODATA_TEST is not set 2308# CONFIG_DEBUG_RODATA_TEST is not set
2073CONFIG_DEBUG_NX_TEST=m 2309CONFIG_DEBUG_NX_TEST=m
2074# CONFIG_IOMMU_DEBUG is not set 2310# CONFIG_IOMMU_DEBUG is not set
@@ -2092,8 +2328,10 @@ CONFIG_OPTIMIZE_INLINING=y
2092CONFIG_KEYS=y 2328CONFIG_KEYS=y
2093CONFIG_KEYS_DEBUG_PROC_KEYS=y 2329CONFIG_KEYS_DEBUG_PROC_KEYS=y
2094CONFIG_SECURITY=y 2330CONFIG_SECURITY=y
2331# CONFIG_SECURITYFS is not set
2095CONFIG_SECURITY_NETWORK=y 2332CONFIG_SECURITY_NETWORK=y
2096# CONFIG_SECURITY_NETWORK_XFRM is not set 2333# CONFIG_SECURITY_NETWORK_XFRM is not set
2334# CONFIG_SECURITY_PATH is not set
2097CONFIG_SECURITY_FILE_CAPABILITIES=y 2335CONFIG_SECURITY_FILE_CAPABILITIES=y
2098# CONFIG_SECURITY_ROOTPLUG is not set 2336# CONFIG_SECURITY_ROOTPLUG is not set
2099CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=65536 2337CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=65536
@@ -2104,7 +2342,6 @@ CONFIG_SECURITY_SELINUX_DISABLE=y
2104CONFIG_SECURITY_SELINUX_DEVELOP=y 2342CONFIG_SECURITY_SELINUX_DEVELOP=y
2105CONFIG_SECURITY_SELINUX_AVC_STATS=y 2343CONFIG_SECURITY_SELINUX_AVC_STATS=y
2106CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 2344CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
2107# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
2108# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set 2345# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
2109# CONFIG_SECURITY_SMACK is not set 2346# CONFIG_SECURITY_SMACK is not set
2110CONFIG_CRYPTO=y 2347CONFIG_CRYPTO=y
@@ -2112,11 +2349,18 @@ CONFIG_CRYPTO=y
2112# 2349#
2113# Crypto core or helper 2350# Crypto core or helper
2114# 2351#
2352# CONFIG_CRYPTO_FIPS is not set
2115CONFIG_CRYPTO_ALGAPI=y 2353CONFIG_CRYPTO_ALGAPI=y
2354CONFIG_CRYPTO_ALGAPI2=y
2116CONFIG_CRYPTO_AEAD=y 2355CONFIG_CRYPTO_AEAD=y
2356CONFIG_CRYPTO_AEAD2=y
2117CONFIG_CRYPTO_BLKCIPHER=y 2357CONFIG_CRYPTO_BLKCIPHER=y
2358CONFIG_CRYPTO_BLKCIPHER2=y
2118CONFIG_CRYPTO_HASH=y 2359CONFIG_CRYPTO_HASH=y
2360CONFIG_CRYPTO_HASH2=y
2361CONFIG_CRYPTO_RNG2=y
2119CONFIG_CRYPTO_MANAGER=y 2362CONFIG_CRYPTO_MANAGER=y
2363CONFIG_CRYPTO_MANAGER2=y
2120# CONFIG_CRYPTO_GF128MUL is not set 2364# CONFIG_CRYPTO_GF128MUL is not set
2121# CONFIG_CRYPTO_NULL is not set 2365# CONFIG_CRYPTO_NULL is not set
2122# CONFIG_CRYPTO_CRYPTD is not set 2366# CONFIG_CRYPTO_CRYPTD is not set
@@ -2151,6 +2395,7 @@ CONFIG_CRYPTO_HMAC=y
2151# Digest 2395# Digest
2152# 2396#
2153# CONFIG_CRYPTO_CRC32C is not set 2397# CONFIG_CRYPTO_CRC32C is not set
2398# CONFIG_CRYPTO_CRC32C_INTEL is not set
2154# CONFIG_CRYPTO_MD4 is not set 2399# CONFIG_CRYPTO_MD4 is not set
2155CONFIG_CRYPTO_MD5=y 2400CONFIG_CRYPTO_MD5=y
2156# CONFIG_CRYPTO_MICHAEL_MIC is not set 2401# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -2191,6 +2436,11 @@ CONFIG_CRYPTO_DES=y
2191# 2436#
2192# CONFIG_CRYPTO_DEFLATE is not set 2437# CONFIG_CRYPTO_DEFLATE is not set
2193# CONFIG_CRYPTO_LZO is not set 2438# CONFIG_CRYPTO_LZO is not set
2439
2440#
2441# Random Number Generation
2442#
2443# CONFIG_CRYPTO_ANSI_CPRNG is not set
2194CONFIG_CRYPTO_HW=y 2444CONFIG_CRYPTO_HW=y
2195# CONFIG_CRYPTO_DEV_HIFN_795X is not set 2445# CONFIG_CRYPTO_DEV_HIFN_795X is not set
2196CONFIG_HAVE_KVM=y 2446CONFIG_HAVE_KVM=y
@@ -2205,6 +2455,7 @@ CONFIG_VIRTUALIZATION=y
2205CONFIG_BITREVERSE=y 2455CONFIG_BITREVERSE=y
2206CONFIG_GENERIC_FIND_FIRST_BIT=y 2456CONFIG_GENERIC_FIND_FIRST_BIT=y
2207CONFIG_GENERIC_FIND_NEXT_BIT=y 2457CONFIG_GENERIC_FIND_NEXT_BIT=y
2458CONFIG_GENERIC_FIND_LAST_BIT=y
2208# CONFIG_CRC_CCITT is not set 2459# CONFIG_CRC_CCITT is not set
2209# CONFIG_CRC16 is not set 2460# CONFIG_CRC16 is not set
2210CONFIG_CRC_T10DIF=y 2461CONFIG_CRC_T10DIF=y
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 903de4aa5094..ebe7deedd5b4 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o
9obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o 9obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o
10obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o 10obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
11obj-$(CONFIG_CRYPTO_SALSA20_X86_64) += salsa20-x86_64.o 11obj-$(CONFIG_CRYPTO_SALSA20_X86_64) += salsa20-x86_64.o
12obj-$(CONFIG_CRYPTO_AES_NI_INTEL) += aesni-intel.o
12 13
13obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o 14obj-$(CONFIG_CRYPTO_CRC32C_INTEL) += crc32c-intel.o
14 15
@@ -19,3 +20,5 @@ salsa20-i586-y := salsa20-i586-asm_32.o salsa20_glue.o
19aes-x86_64-y := aes-x86_64-asm_64.o aes_glue.o 20aes-x86_64-y := aes-x86_64-asm_64.o aes_glue.o
20twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o 21twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_glue.o
21salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o 22salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o
23
24aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o
diff --git a/arch/x86/crypto/aes-i586-asm_32.S b/arch/x86/crypto/aes-i586-asm_32.S
index e41b147f4509..b949ec2f9af4 100644
--- a/arch/x86/crypto/aes-i586-asm_32.S
+++ b/arch/x86/crypto/aes-i586-asm_32.S
@@ -41,14 +41,14 @@
41#define tlen 1024 // length of each of 4 'xor' arrays (256 32-bit words) 41#define tlen 1024 // length of each of 4 'xor' arrays (256 32-bit words)
42 42
43/* offsets to parameters with one register pushed onto stack */ 43/* offsets to parameters with one register pushed onto stack */
44#define tfm 8 44#define ctx 8
45#define out_blk 12 45#define out_blk 12
46#define in_blk 16 46#define in_blk 16
47 47
48/* offsets in crypto_tfm structure */ 48/* offsets in crypto_aes_ctx structure */
49#define klen (crypto_tfm_ctx_offset + 0) 49#define klen (480)
50#define ekey (crypto_tfm_ctx_offset + 4) 50#define ekey (0)
51#define dkey (crypto_tfm_ctx_offset + 244) 51#define dkey (240)
52 52
53// register mapping for encrypt and decrypt subroutines 53// register mapping for encrypt and decrypt subroutines
54 54
@@ -217,7 +217,7 @@
217 do_col (table, r5,r0,r1,r4, r2,r3); /* idx=r5 */ 217 do_col (table, r5,r0,r1,r4, r2,r3); /* idx=r5 */
218 218
219// AES (Rijndael) Encryption Subroutine 219// AES (Rijndael) Encryption Subroutine
220/* void aes_enc_blk(struct crypto_tfm *tfm, u8 *out_blk, const u8 *in_blk) */ 220/* void aes_enc_blk(struct crypto_aes_ctx *ctx, u8 *out_blk, const u8 *in_blk) */
221 221
222.global aes_enc_blk 222.global aes_enc_blk
223 223
@@ -228,7 +228,7 @@
228 228
229aes_enc_blk: 229aes_enc_blk:
230 push %ebp 230 push %ebp
231 mov tfm(%esp),%ebp 231 mov ctx(%esp),%ebp
232 232
233// CAUTION: the order and the values used in these assigns 233// CAUTION: the order and the values used in these assigns
234// rely on the register mappings 234// rely on the register mappings
@@ -292,7 +292,7 @@ aes_enc_blk:
292 ret 292 ret
293 293
294// AES (Rijndael) Decryption Subroutine 294// AES (Rijndael) Decryption Subroutine
295/* void aes_dec_blk(struct crypto_tfm *tfm, u8 *out_blk, const u8 *in_blk) */ 295/* void aes_dec_blk(struct crypto_aes_ctx *ctx, u8 *out_blk, const u8 *in_blk) */
296 296
297.global aes_dec_blk 297.global aes_dec_blk
298 298
@@ -303,7 +303,7 @@ aes_enc_blk:
303 303
304aes_dec_blk: 304aes_dec_blk:
305 push %ebp 305 push %ebp
306 mov tfm(%esp),%ebp 306 mov ctx(%esp),%ebp
307 307
308// CAUTION: the order and the values used in these assigns 308// CAUTION: the order and the values used in these assigns
309// rely on the register mappings 309// rely on the register mappings
diff --git a/arch/x86/crypto/aes-x86_64-asm_64.S b/arch/x86/crypto/aes-x86_64-asm_64.S
index a120f526c3df..5b577d5a059b 100644
--- a/arch/x86/crypto/aes-x86_64-asm_64.S
+++ b/arch/x86/crypto/aes-x86_64-asm_64.S
@@ -17,8 +17,6 @@
17 17
18#include <asm/asm-offsets.h> 18#include <asm/asm-offsets.h>
19 19
20#define BASE crypto_tfm_ctx_offset
21
22#define R1 %rax 20#define R1 %rax
23#define R1E %eax 21#define R1E %eax
24#define R1X %ax 22#define R1X %ax
@@ -56,13 +54,13 @@
56 .align 8; \ 54 .align 8; \
57FUNC: movq r1,r2; \ 55FUNC: movq r1,r2; \
58 movq r3,r4; \ 56 movq r3,r4; \
59 leaq BASE+KEY+48+4(r8),r9; \ 57 leaq KEY+48(r8),r9; \
60 movq r10,r11; \ 58 movq r10,r11; \
61 movl (r7),r5 ## E; \ 59 movl (r7),r5 ## E; \
62 movl 4(r7),r1 ## E; \ 60 movl 4(r7),r1 ## E; \
63 movl 8(r7),r6 ## E; \ 61 movl 8(r7),r6 ## E; \
64 movl 12(r7),r7 ## E; \ 62 movl 12(r7),r7 ## E; \
65 movl BASE+0(r8),r10 ## E; \ 63 movl 480(r8),r10 ## E; \
66 xorl -48(r9),r5 ## E; \ 64 xorl -48(r9),r5 ## E; \
67 xorl -44(r9),r1 ## E; \ 65 xorl -44(r9),r1 ## E; \
68 xorl -40(r9),r6 ## E; \ 66 xorl -40(r9),r6 ## E; \
diff --git a/arch/x86/crypto/aes_glue.c b/arch/x86/crypto/aes_glue.c
index 71f457827116..49ae9fe32b22 100644
--- a/arch/x86/crypto/aes_glue.c
+++ b/arch/x86/crypto/aes_glue.c
@@ -5,17 +5,29 @@
5 5
6#include <crypto/aes.h> 6#include <crypto/aes.h>
7 7
8asmlinkage void aes_enc_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in); 8asmlinkage void aes_enc_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in);
9asmlinkage void aes_dec_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in); 9asmlinkage void aes_dec_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in);
10
11void crypto_aes_encrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
12{
13 aes_enc_blk(ctx, dst, src);
14}
15EXPORT_SYMBOL_GPL(crypto_aes_encrypt_x86);
16
17void crypto_aes_decrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
18{
19 aes_dec_blk(ctx, dst, src);
20}
21EXPORT_SYMBOL_GPL(crypto_aes_decrypt_x86);
10 22
11static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) 23static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
12{ 24{
13 aes_enc_blk(tfm, dst, src); 25 aes_enc_blk(crypto_tfm_ctx(tfm), dst, src);
14} 26}
15 27
16static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) 28static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
17{ 29{
18 aes_dec_blk(tfm, dst, src); 30 aes_dec_blk(crypto_tfm_ctx(tfm), dst, src);
19} 31}
20 32
21static struct crypto_alg aes_alg = { 33static struct crypto_alg aes_alg = {
diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S
new file mode 100644
index 000000000000..caba99601703
--- /dev/null
+++ b/arch/x86/crypto/aesni-intel_asm.S
@@ -0,0 +1,896 @@
1/*
2 * Implement AES algorithm in Intel AES-NI instructions.
3 *
4 * The white paper of AES-NI instructions can be downloaded from:
5 * http://softwarecommunity.intel.com/isn/downloads/intelavx/AES-Instructions-Set_WP.pdf
6 *
7 * Copyright (C) 2008, Intel Corp.
8 * Author: Huang Ying <ying.huang@intel.com>
9 * Vinodh Gopal <vinodh.gopal@intel.com>
10 * Kahraman Akdemir
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
18#include <linux/linkage.h>
19
20.text
21
22#define STATE1 %xmm0
23#define STATE2 %xmm4
24#define STATE3 %xmm5
25#define STATE4 %xmm6
26#define STATE STATE1
27#define IN1 %xmm1
28#define IN2 %xmm7
29#define IN3 %xmm8
30#define IN4 %xmm9
31#define IN IN1
32#define KEY %xmm2
33#define IV %xmm3
34
35#define KEYP %rdi
36#define OUTP %rsi
37#define INP %rdx
38#define LEN %rcx
39#define IVP %r8
40#define KLEN %r9d
41#define T1 %r10
42#define TKEYP T1
43#define T2 %r11
44
45_key_expansion_128:
46_key_expansion_256a:
47 pshufd $0b11111111, %xmm1, %xmm1
48 shufps $0b00010000, %xmm0, %xmm4
49 pxor %xmm4, %xmm0
50 shufps $0b10001100, %xmm0, %xmm4
51 pxor %xmm4, %xmm0
52 pxor %xmm1, %xmm0
53 movaps %xmm0, (%rcx)
54 add $0x10, %rcx
55 ret
56
57_key_expansion_192a:
58 pshufd $0b01010101, %xmm1, %xmm1
59 shufps $0b00010000, %xmm0, %xmm4
60 pxor %xmm4, %xmm0
61 shufps $0b10001100, %xmm0, %xmm4
62 pxor %xmm4, %xmm0
63 pxor %xmm1, %xmm0
64
65 movaps %xmm2, %xmm5
66 movaps %xmm2, %xmm6
67 pslldq $4, %xmm5
68 pshufd $0b11111111, %xmm0, %xmm3
69 pxor %xmm3, %xmm2
70 pxor %xmm5, %xmm2
71
72 movaps %xmm0, %xmm1
73 shufps $0b01000100, %xmm0, %xmm6
74 movaps %xmm6, (%rcx)
75 shufps $0b01001110, %xmm2, %xmm1
76 movaps %xmm1, 16(%rcx)
77 add $0x20, %rcx
78 ret
79
80_key_expansion_192b:
81 pshufd $0b01010101, %xmm1, %xmm1
82 shufps $0b00010000, %xmm0, %xmm4
83 pxor %xmm4, %xmm0
84 shufps $0b10001100, %xmm0, %xmm4
85 pxor %xmm4, %xmm0
86 pxor %xmm1, %xmm0
87
88 movaps %xmm2, %xmm5
89 pslldq $4, %xmm5
90 pshufd $0b11111111, %xmm0, %xmm3
91 pxor %xmm3, %xmm2
92 pxor %xmm5, %xmm2
93
94 movaps %xmm0, (%rcx)
95 add $0x10, %rcx
96 ret
97
98_key_expansion_256b:
99 pshufd $0b10101010, %xmm1, %xmm1
100 shufps $0b00010000, %xmm2, %xmm4
101 pxor %xmm4, %xmm2
102 shufps $0b10001100, %xmm2, %xmm4
103 pxor %xmm4, %xmm2
104 pxor %xmm1, %xmm2
105 movaps %xmm2, (%rcx)
106 add $0x10, %rcx
107 ret
108
109/*
110 * int aesni_set_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
111 * unsigned int key_len)
112 */
113ENTRY(aesni_set_key)
114 movups (%rsi), %xmm0 # user key (first 16 bytes)
115 movaps %xmm0, (%rdi)
116 lea 0x10(%rdi), %rcx # key addr
117 movl %edx, 480(%rdi)
118 pxor %xmm4, %xmm4 # xmm4 is assumed 0 in _key_expansion_x
119 cmp $24, %dl
120 jb .Lenc_key128
121 je .Lenc_key192
122 movups 0x10(%rsi), %xmm2 # other user key
123 movaps %xmm2, (%rcx)
124 add $0x10, %rcx
125 # aeskeygenassist $0x1, %xmm2, %xmm1 # round 1
126 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x01
127 call _key_expansion_256a
128 # aeskeygenassist $0x1, %xmm0, %xmm1
129 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x01
130 call _key_expansion_256b
131 # aeskeygenassist $0x2, %xmm2, %xmm1 # round 2
132 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x02
133 call _key_expansion_256a
134 # aeskeygenassist $0x2, %xmm0, %xmm1
135 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x02
136 call _key_expansion_256b
137 # aeskeygenassist $0x4, %xmm2, %xmm1 # round 3
138 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x04
139 call _key_expansion_256a
140 # aeskeygenassist $0x4, %xmm0, %xmm1
141 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x04
142 call _key_expansion_256b
143 # aeskeygenassist $0x8, %xmm2, %xmm1 # round 4
144 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x08
145 call _key_expansion_256a
146 # aeskeygenassist $0x8, %xmm0, %xmm1
147 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x08
148 call _key_expansion_256b
149 # aeskeygenassist $0x10, %xmm2, %xmm1 # round 5
150 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x10
151 call _key_expansion_256a
152 # aeskeygenassist $0x10, %xmm0, %xmm1
153 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x10
154 call _key_expansion_256b
155 # aeskeygenassist $0x20, %xmm2, %xmm1 # round 6
156 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x20
157 call _key_expansion_256a
158 # aeskeygenassist $0x20, %xmm0, %xmm1
159 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x20
160 call _key_expansion_256b
161 # aeskeygenassist $0x40, %xmm2, %xmm1 # round 7
162 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x40
163 call _key_expansion_256a
164 jmp .Ldec_key
165.Lenc_key192:
166 movq 0x10(%rsi), %xmm2 # other user key
167 # aeskeygenassist $0x1, %xmm2, %xmm1 # round 1
168 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x01
169 call _key_expansion_192a
170 # aeskeygenassist $0x2, %xmm2, %xmm1 # round 2
171 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x02
172 call _key_expansion_192b
173 # aeskeygenassist $0x4, %xmm2, %xmm1 # round 3
174 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x04
175 call _key_expansion_192a
176 # aeskeygenassist $0x8, %xmm2, %xmm1 # round 4
177 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x08
178 call _key_expansion_192b
179 # aeskeygenassist $0x10, %xmm2, %xmm1 # round 5
180 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x10
181 call _key_expansion_192a
182 # aeskeygenassist $0x20, %xmm2, %xmm1 # round 6
183 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x20
184 call _key_expansion_192b
185 # aeskeygenassist $0x40, %xmm2, %xmm1 # round 7
186 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x40
187 call _key_expansion_192a
188 # aeskeygenassist $0x80, %xmm2, %xmm1 # round 8
189 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xca, 0x80
190 call _key_expansion_192b
191 jmp .Ldec_key
192.Lenc_key128:
193 # aeskeygenassist $0x1, %xmm0, %xmm1 # round 1
194 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x01
195 call _key_expansion_128
196 # aeskeygenassist $0x2, %xmm0, %xmm1 # round 2
197 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x02
198 call _key_expansion_128
199 # aeskeygenassist $0x4, %xmm0, %xmm1 # round 3
200 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x04
201 call _key_expansion_128
202 # aeskeygenassist $0x8, %xmm0, %xmm1 # round 4
203 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x08
204 call _key_expansion_128
205 # aeskeygenassist $0x10, %xmm0, %xmm1 # round 5
206 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x10
207 call _key_expansion_128
208 # aeskeygenassist $0x20, %xmm0, %xmm1 # round 6
209 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x20
210 call _key_expansion_128
211 # aeskeygenassist $0x40, %xmm0, %xmm1 # round 7
212 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x40
213 call _key_expansion_128
214 # aeskeygenassist $0x80, %xmm0, %xmm1 # round 8
215 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x80
216 call _key_expansion_128
217 # aeskeygenassist $0x1b, %xmm0, %xmm1 # round 9
218 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x1b
219 call _key_expansion_128
220 # aeskeygenassist $0x36, %xmm0, %xmm1 # round 10
221 .byte 0x66, 0x0f, 0x3a, 0xdf, 0xc8, 0x36
222 call _key_expansion_128
223.Ldec_key:
224 sub $0x10, %rcx
225 movaps (%rdi), %xmm0
226 movaps (%rcx), %xmm1
227 movaps %xmm0, 240(%rcx)
228 movaps %xmm1, 240(%rdi)
229 add $0x10, %rdi
230 lea 240-16(%rcx), %rsi
231.align 4
232.Ldec_key_loop:
233 movaps (%rdi), %xmm0
234 # aesimc %xmm0, %xmm1
235 .byte 0x66, 0x0f, 0x38, 0xdb, 0xc8
236 movaps %xmm1, (%rsi)
237 add $0x10, %rdi
238 sub $0x10, %rsi
239 cmp %rcx, %rdi
240 jb .Ldec_key_loop
241 xor %rax, %rax
242 ret
243
244/*
245 * void aesni_enc(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
246 */
247ENTRY(aesni_enc)
248 movl 480(KEYP), KLEN # key length
249 movups (INP), STATE # input
250 call _aesni_enc1
251 movups STATE, (OUTP) # output
252 ret
253
254/*
255 * _aesni_enc1: internal ABI
256 * input:
257 * KEYP: key struct pointer
258 * KLEN: round count
259 * STATE: initial state (input)
260 * output:
261 * STATE: finial state (output)
262 * changed:
263 * KEY
264 * TKEYP (T1)
265 */
266_aesni_enc1:
267 movaps (KEYP), KEY # key
268 mov KEYP, TKEYP
269 pxor KEY, STATE # round 0
270 add $0x30, TKEYP
271 cmp $24, KLEN
272 jb .Lenc128
273 lea 0x20(TKEYP), TKEYP
274 je .Lenc192
275 add $0x20, TKEYP
276 movaps -0x60(TKEYP), KEY
277 # aesenc KEY, STATE
278 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
279 movaps -0x50(TKEYP), KEY
280 # aesenc KEY, STATE
281 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
282.align 4
283.Lenc192:
284 movaps -0x40(TKEYP), KEY
285 # aesenc KEY, STATE
286 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
287 movaps -0x30(TKEYP), KEY
288 # aesenc KEY, STATE
289 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
290.align 4
291.Lenc128:
292 movaps -0x20(TKEYP), KEY
293 # aesenc KEY, STATE
294 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
295 movaps -0x10(TKEYP), KEY
296 # aesenc KEY, STATE
297 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
298 movaps (TKEYP), KEY
299 # aesenc KEY, STATE
300 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
301 movaps 0x10(TKEYP), KEY
302 # aesenc KEY, STATE
303 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
304 movaps 0x20(TKEYP), KEY
305 # aesenc KEY, STATE
306 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
307 movaps 0x30(TKEYP), KEY
308 # aesenc KEY, STATE
309 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
310 movaps 0x40(TKEYP), KEY
311 # aesenc KEY, STATE
312 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
313 movaps 0x50(TKEYP), KEY
314 # aesenc KEY, STATE
315 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
316 movaps 0x60(TKEYP), KEY
317 # aesenc KEY, STATE
318 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
319 movaps 0x70(TKEYP), KEY
320 # aesenclast KEY, STATE # last round
321 .byte 0x66, 0x0f, 0x38, 0xdd, 0xc2
322 ret
323
324/*
325 * _aesni_enc4: internal ABI
326 * input:
327 * KEYP: key struct pointer
328 * KLEN: round count
329 * STATE1: initial state (input)
330 * STATE2
331 * STATE3
332 * STATE4
333 * output:
334 * STATE1: finial state (output)
335 * STATE2
336 * STATE3
337 * STATE4
338 * changed:
339 * KEY
340 * TKEYP (T1)
341 */
342_aesni_enc4:
343 movaps (KEYP), KEY # key
344 mov KEYP, TKEYP
345 pxor KEY, STATE1 # round 0
346 pxor KEY, STATE2
347 pxor KEY, STATE3
348 pxor KEY, STATE4
349 add $0x30, TKEYP
350 cmp $24, KLEN
351 jb .L4enc128
352 lea 0x20(TKEYP), TKEYP
353 je .L4enc192
354 add $0x20, TKEYP
355 movaps -0x60(TKEYP), KEY
356 # aesenc KEY, STATE1
357 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
358 # aesenc KEY, STATE2
359 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
365 # aesenc KEY, STATE1
366 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
367 # aesenc KEY, STATE2
368 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
374.L4enc192:
375 movaps -0x40(TKEYP), KEY
376 # aesenc KEY, STATE1
377 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
378 # aesenc KEY, STATE2
379 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
385 # aesenc KEY, STATE1
386 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
387 # aesenc KEY, STATE2
388 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
394.L4enc128:
395 movaps -0x20(TKEYP), KEY
396 # aesenc KEY, STATE1
397 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
398 # aesenc KEY, STATE2
399 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
405 # aesenc KEY, STATE1
406 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
407 # aesenc KEY, STATE2
408 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
414 # aesenc KEY, STATE1
415 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
416 # aesenc KEY, STATE2
417 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
423 # aesenc KEY, STATE1
424 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
425 # aesenc KEY, STATE2
426 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
432 # aesenc KEY, STATE1
433 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
434 # aesenc KEY, STATE2
435 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
441 # aesenc KEY, STATE1
442 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
443 # aesenc KEY, STATE2
444 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
450 # aesenc KEY, STATE1
451 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
452 # aesenc KEY, STATE2
453 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
459 # aesenc KEY, STATE1
460 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
461 # aesenc KEY, STATE2
462 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
468 # aesenc KEY, STATE1
469 .byte 0x66, 0x0f, 0x38, 0xdc, 0xc2
470 # aesenc KEY, STATE2
471 .byte 0x66, 0x0f, 0x38, 0xdc, 0xe2
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
477 # aesenclast KEY, STATE1 # last round
478 .byte 0x66, 0x0f, 0x38, 0xdd, 0xc2
479 # aesenclast KEY, STATE2
480 .byte 0x66, 0x0f, 0x38, 0xdd, 0xe2
481 # aesenclast KEY, STATE3
482 .byte 0x66, 0x0f, 0x38, 0xdd, 0xea
483 # aesenclast KEY, STATE4
484 .byte 0x66, 0x0f, 0x38, 0xdd, 0xf2
485 ret
486
487/*
488 * void aesni_dec (struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src)
489 */
490ENTRY(aesni_dec)
491 mov 480(KEYP), KLEN # key length
492 add $240, KEYP
493 movups (INP), STATE # input
494 call _aesni_dec1
495 movups STATE, (OUTP) #output
496 ret
497
498/*
499 * _aesni_dec1: internal ABI
500 * input:
501 * KEYP: key struct pointer
502 * KLEN: key length
503 * STATE: initial state (input)
504 * output:
505 * STATE: finial state (output)
506 * changed:
507 * KEY
508 * TKEYP (T1)
509 */
510_aesni_dec1:
511 movaps (KEYP), KEY # key
512 mov KEYP, TKEYP
513 pxor KEY, STATE # round 0
514 add $0x30, TKEYP
515 cmp $24, KLEN
516 jb .Ldec128
517 lea 0x20(TKEYP), TKEYP
518 je .Ldec192
519 add $0x20, TKEYP
520 movaps -0x60(TKEYP), KEY
521 # aesdec KEY, STATE
522 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
523 movaps -0x50(TKEYP), KEY
524 # aesdec KEY, STATE
525 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
526.align 4
527.Ldec192:
528 movaps -0x40(TKEYP), KEY
529 # aesdec KEY, STATE
530 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
531 movaps -0x30(TKEYP), KEY
532 # aesdec KEY, STATE
533 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
534.align 4
535.Ldec128:
536 movaps -0x20(TKEYP), KEY
537 # aesdec KEY, STATE
538 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
539 movaps -0x10(TKEYP), KEY
540 # aesdec KEY, STATE
541 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
542 movaps (TKEYP), KEY
543 # aesdec KEY, STATE
544 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
545 movaps 0x10(TKEYP), KEY
546 # aesdec KEY, STATE
547 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
548 movaps 0x20(TKEYP), KEY
549 # aesdec KEY, STATE
550 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
551 movaps 0x30(TKEYP), KEY
552 # aesdec KEY, STATE
553 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
554 movaps 0x40(TKEYP), KEY
555 # aesdec KEY, STATE
556 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
557 movaps 0x50(TKEYP), KEY
558 # aesdec KEY, STATE
559 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
560 movaps 0x60(TKEYP), KEY
561 # aesdec KEY, STATE
562 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
563 movaps 0x70(TKEYP), KEY
564 # aesdeclast KEY, STATE # last round
565 .byte 0x66, 0x0f, 0x38, 0xdf, 0xc2
566 ret
567
568/*
569 * _aesni_dec4: internal ABI
570 * input:
571 * KEYP: key struct pointer
572 * KLEN: key length
573 * STATE1: initial state (input)
574 * STATE2
575 * STATE3
576 * STATE4
577 * output:
578 * STATE1: finial state (output)
579 * STATE2
580 * STATE3
581 * STATE4
582 * changed:
583 * KEY
584 * TKEYP (T1)
585 */
586_aesni_dec4:
587 movaps (KEYP), KEY # key
588 mov KEYP, TKEYP
589 pxor KEY, STATE1 # round 0
590 pxor KEY, STATE2
591 pxor KEY, STATE3
592 pxor KEY, STATE4
593 add $0x30, TKEYP
594 cmp $24, KLEN
595 jb .L4dec128
596 lea 0x20(TKEYP), TKEYP
597 je .L4dec192
598 add $0x20, TKEYP
599 movaps -0x60(TKEYP), KEY
600 # aesdec KEY, STATE1
601 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
602 # aesdec KEY, STATE2
603 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
609 # aesdec KEY, STATE1
610 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
611 # aesdec KEY, STATE2
612 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
618.L4dec192:
619 movaps -0x40(TKEYP), KEY
620 # aesdec KEY, STATE1
621 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
622 # aesdec KEY, STATE2
623 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
629 # aesdec KEY, STATE1
630 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
631 # aesdec KEY, STATE2
632 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
638.L4dec128:
639 movaps -0x20(TKEYP), KEY
640 # aesdec KEY, STATE1
641 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
642 # aesdec KEY, STATE2
643 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
649 # aesdec KEY, STATE1
650 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
651 # aesdec KEY, STATE2
652 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
658 # aesdec KEY, STATE1
659 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
660 # aesdec KEY, STATE2
661 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
667 # aesdec KEY, STATE1
668 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
669 # aesdec KEY, STATE2
670 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
676 # aesdec KEY, STATE1
677 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
678 # aesdec KEY, STATE2
679 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
685 # aesdec KEY, STATE1
686 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
687 # aesdec KEY, STATE2
688 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
694 # aesdec KEY, STATE1
695 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
696 # aesdec KEY, STATE2
697 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
703 # aesdec KEY, STATE1
704 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
705 # aesdec KEY, STATE2
706 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
712 # aesdec KEY, STATE1
713 .byte 0x66, 0x0f, 0x38, 0xde, 0xc2
714 # aesdec KEY, STATE2
715 .byte 0x66, 0x0f, 0x38, 0xde, 0xe2
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
721 # aesdeclast KEY, STATE1 # last round
722 .byte 0x66, 0x0f, 0x38, 0xdf, 0xc2
723 # aesdeclast KEY, STATE2
724 .byte 0x66, 0x0f, 0x38, 0xdf, 0xe2
725 # aesdeclast KEY, STATE3
726 .byte 0x66, 0x0f, 0x38, 0xdf, 0xea
727 # aesdeclast KEY, STATE4
728 .byte 0x66, 0x0f, 0x38, 0xdf, 0xf2
729 ret
730
731/*
732 * void aesni_ecb_enc(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
733 * size_t len)
734 */
735ENTRY(aesni_ecb_enc)
736 test LEN, LEN # check length
737 jz .Lecb_enc_ret
738 mov 480(KEYP), KLEN
739 cmp $16, LEN
740 jb .Lecb_enc_ret
741 cmp $64, LEN
742 jb .Lecb_enc_loop1
743.align 4
744.Lecb_enc_loop4:
745 movups (INP), STATE1
746 movups 0x10(INP), STATE2
747 movups 0x20(INP), STATE3
748 movups 0x30(INP), STATE4
749 call _aesni_enc4
750 movups STATE1, (OUTP)
751 movups STATE2, 0x10(OUTP)
752 movups STATE3, 0x20(OUTP)
753 movups STATE4, 0x30(OUTP)
754 sub $64, LEN
755 add $64, INP
756 add $64, OUTP
757 cmp $64, LEN
758 jge .Lecb_enc_loop4
759 cmp $16, LEN
760 jb .Lecb_enc_ret
761.align 4
762.Lecb_enc_loop1:
763 movups (INP), STATE1
764 call _aesni_enc1
765 movups STATE1, (OUTP)
766 sub $16, LEN
767 add $16, INP
768 add $16, OUTP
769 cmp $16, LEN
770 jge .Lecb_enc_loop1
771.Lecb_enc_ret:
772 ret
773
774/*
775 * void aesni_ecb_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
776 * size_t len);
777 */
778ENTRY(aesni_ecb_dec)
779 test LEN, LEN
780 jz .Lecb_dec_ret
781 mov 480(KEYP), KLEN
782 add $240, KEYP
783 cmp $16, LEN
784 jb .Lecb_dec_ret
785 cmp $64, LEN
786 jb .Lecb_dec_loop1
787.align 4
788.Lecb_dec_loop4:
789 movups (INP), STATE1
790 movups 0x10(INP), STATE2
791 movups 0x20(INP), STATE3
792 movups 0x30(INP), STATE4
793 call _aesni_dec4
794 movups STATE1, (OUTP)
795 movups STATE2, 0x10(OUTP)
796 movups STATE3, 0x20(OUTP)
797 movups STATE4, 0x30(OUTP)
798 sub $64, LEN
799 add $64, INP
800 add $64, OUTP
801 cmp $64, LEN
802 jge .Lecb_dec_loop4
803 cmp $16, LEN
804 jb .Lecb_dec_ret
805.align 4
806.Lecb_dec_loop1:
807 movups (INP), STATE1
808 call _aesni_dec1
809 movups STATE1, (OUTP)
810 sub $16, LEN
811 add $16, INP
812 add $16, OUTP
813 cmp $16, LEN
814 jge .Lecb_dec_loop1
815.Lecb_dec_ret:
816 ret
817
818/*
819 * void aesni_cbc_enc(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
820 * size_t len, u8 *iv)
821 */
822ENTRY(aesni_cbc_enc)
823 cmp $16, LEN
824 jb .Lcbc_enc_ret
825 mov 480(KEYP), KLEN
826 movups (IVP), STATE # load iv as initial state
827.align 4
828.Lcbc_enc_loop:
829 movups (INP), IN # load input
830 pxor IN, STATE
831 call _aesni_enc1
832 movups STATE, (OUTP) # store output
833 sub $16, LEN
834 add $16, INP
835 add $16, OUTP
836 cmp $16, LEN
837 jge .Lcbc_enc_loop
838 movups STATE, (IVP)
839.Lcbc_enc_ret:
840 ret
841
842/*
843 * void aesni_cbc_dec(struct crypto_aes_ctx *ctx, const u8 *dst, u8 *src,
844 * size_t len, u8 *iv)
845 */
846ENTRY(aesni_cbc_dec)
847 cmp $16, LEN
848 jb .Lcbc_dec_ret
849 mov 480(KEYP), KLEN
850 add $240, KEYP
851 movups (IVP), IV
852 cmp $64, LEN
853 jb .Lcbc_dec_loop1
854.align 4
855.Lcbc_dec_loop4:
856 movups (INP), IN1
857 movaps IN1, STATE1
858 movups 0x10(INP), IN2
859 movaps IN2, STATE2
860 movups 0x20(INP), IN3
861 movaps IN3, STATE3
862 movups 0x30(INP), IN4
863 movaps IN4, STATE4
864 call _aesni_dec4
865 pxor IV, STATE1
866 pxor IN1, STATE2
867 pxor IN2, STATE3
868 pxor IN3, STATE4
869 movaps IN4, IV
870 movups STATE1, (OUTP)
871 movups STATE2, 0x10(OUTP)
872 movups STATE3, 0x20(OUTP)
873 movups STATE4, 0x30(OUTP)
874 sub $64, LEN
875 add $64, INP
876 add $64, OUTP
877 cmp $64, LEN
878 jge .Lcbc_dec_loop4
879 cmp $16, LEN
880 jb .Lcbc_dec_ret
881.align 4
882.Lcbc_dec_loop1:
883 movups (INP), IN
884 movaps IN, STATE
885 call _aesni_dec1
886 pxor IV, STATE
887 movups STATE, (OUTP)
888 movaps IN, IV
889 sub $16, LEN
890 add $16, INP
891 add $16, OUTP
892 cmp $16, LEN
893 jge .Lcbc_dec_loop1
894 movups IV, (IVP)
895.Lcbc_dec_ret:
896 ret
diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c
new file mode 100644
index 000000000000..02af0af65497
--- /dev/null
+++ b/arch/x86/crypto/aesni-intel_glue.c
@@ -0,0 +1,461 @@
1/*
2 * Support for Intel AES-NI instructions. This file contains glue
3 * code, the real AES implementation is in intel-aes_asm.S.
4 *
5 * Copyright (C) 2008, Intel Corp.
6 * Author: Huang Ying <ying.huang@intel.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
14#include <linux/hardirq.h>
15#include <linux/types.h>
16#include <linux/crypto.h>
17#include <linux/err.h>
18#include <crypto/algapi.h>
19#include <crypto/aes.h>
20#include <crypto/cryptd.h>
21#include <asm/i387.h>
22#include <asm/aes.h>
23
24struct async_aes_ctx {
25 struct cryptd_ablkcipher *cryptd_tfm;
26};
27
28#define AESNI_ALIGN 16
29#define AES_BLOCK_MASK (~(AES_BLOCK_SIZE-1))
30
31asmlinkage int aesni_set_key(struct crypto_aes_ctx *ctx, const u8 *in_key,
32 unsigned int key_len);
33asmlinkage void aesni_enc(struct crypto_aes_ctx *ctx, u8 *out,
34 const u8 *in);
35asmlinkage void aesni_dec(struct crypto_aes_ctx *ctx, u8 *out,
36 const u8 *in);
37asmlinkage void aesni_ecb_enc(struct crypto_aes_ctx *ctx, u8 *out,
38 const u8 *in, unsigned int len);
39asmlinkage void aesni_ecb_dec(struct crypto_aes_ctx *ctx, u8 *out,
40 const u8 *in, unsigned int len);
41asmlinkage void aesni_cbc_enc(struct crypto_aes_ctx *ctx, u8 *out,
42 const u8 *in, unsigned int len, u8 *iv);
43asmlinkage void aesni_cbc_dec(struct crypto_aes_ctx *ctx, u8 *out,
44 const u8 *in, unsigned int len, u8 *iv);
45
46static inline int kernel_fpu_using(void)
47{
48 if (in_interrupt() && !(read_cr0() & X86_CR0_TS))
49 return 1;
50 return 0;
51}
52
53static inline struct crypto_aes_ctx *aes_ctx(void *raw_ctx)
54{
55 unsigned long addr = (unsigned long)raw_ctx;
56 unsigned long align = AESNI_ALIGN;
57
58 if (align <= crypto_tfm_ctx_alignment())
59 align = 1;
60 return (struct crypto_aes_ctx *)ALIGN(addr, align);
61}
62
63static int aes_set_key_common(struct crypto_tfm *tfm, void *raw_ctx,
64 const u8 *in_key, unsigned int key_len)
65{
66 struct crypto_aes_ctx *ctx = aes_ctx(raw_ctx);
67 u32 *flags = &tfm->crt_flags;
68 int err;
69
70 if (key_len != AES_KEYSIZE_128 && key_len != AES_KEYSIZE_192 &&
71 key_len != AES_KEYSIZE_256) {
72 *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
73 return -EINVAL;
74 }
75
76 if (kernel_fpu_using())
77 err = crypto_aes_expand_key(ctx, in_key, key_len);
78 else {
79 kernel_fpu_begin();
80 err = aesni_set_key(ctx, in_key, key_len);
81 kernel_fpu_end();
82 }
83
84 return err;
85}
86
87static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
88 unsigned int key_len)
89{
90 return aes_set_key_common(tfm, crypto_tfm_ctx(tfm), in_key, key_len);
91}
92
93static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
94{
95 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
96
97 if (kernel_fpu_using())
98 crypto_aes_encrypt_x86(ctx, dst, src);
99 else {
100 kernel_fpu_begin();
101 aesni_enc(ctx, dst, src);
102 kernel_fpu_end();
103 }
104}
105
106static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
107{
108 struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm));
109
110 if (kernel_fpu_using())
111 crypto_aes_decrypt_x86(ctx, dst, src);
112 else {
113 kernel_fpu_begin();
114 aesni_dec(ctx, dst, src);
115 kernel_fpu_end();
116 }
117}
118
119static struct crypto_alg aesni_alg = {
120 .cra_name = "aes",
121 .cra_driver_name = "aes-aesni",
122 .cra_priority = 300,
123 .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
124 .cra_blocksize = AES_BLOCK_SIZE,
125 .cra_ctxsize = sizeof(struct crypto_aes_ctx)+AESNI_ALIGN-1,
126 .cra_alignmask = 0,
127 .cra_module = THIS_MODULE,
128 .cra_list = LIST_HEAD_INIT(aesni_alg.cra_list),
129 .cra_u = {
130 .cipher = {
131 .cia_min_keysize = AES_MIN_KEY_SIZE,
132 .cia_max_keysize = AES_MAX_KEY_SIZE,
133 .cia_setkey = aes_set_key,
134 .cia_encrypt = aes_encrypt,
135 .cia_decrypt = aes_decrypt
136 }
137 }
138};
139
140static int ecb_encrypt(struct blkcipher_desc *desc,
141 struct scatterlist *dst, struct scatterlist *src,
142 unsigned int nbytes)
143{
144 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
145 struct blkcipher_walk walk;
146 int err;
147
148 blkcipher_walk_init(&walk, dst, src, nbytes);
149 err = blkcipher_walk_virt(desc, &walk);
150
151 kernel_fpu_begin();
152 while ((nbytes = walk.nbytes)) {
153 aesni_ecb_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr,
154 nbytes & AES_BLOCK_MASK);
155 nbytes &= AES_BLOCK_SIZE - 1;
156 err = blkcipher_walk_done(desc, &walk, nbytes);
157 }
158 kernel_fpu_end();
159
160 return err;
161}
162
163static int ecb_decrypt(struct blkcipher_desc *desc,
164 struct scatterlist *dst, struct scatterlist *src,
165 unsigned int nbytes)
166{
167 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
168 struct blkcipher_walk walk;
169 int err;
170
171 blkcipher_walk_init(&walk, dst, src, nbytes);
172 err = blkcipher_walk_virt(desc, &walk);
173
174 kernel_fpu_begin();
175 while ((nbytes = walk.nbytes)) {
176 aesni_ecb_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr,
177 nbytes & AES_BLOCK_MASK);
178 nbytes &= AES_BLOCK_SIZE - 1;
179 err = blkcipher_walk_done(desc, &walk, nbytes);
180 }
181 kernel_fpu_end();
182
183 return err;
184}
185
186static struct crypto_alg blk_ecb_alg = {
187 .cra_name = "__ecb-aes-aesni",
188 .cra_driver_name = "__driver-ecb-aes-aesni",
189 .cra_priority = 0,
190 .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
191 .cra_blocksize = AES_BLOCK_SIZE,
192 .cra_ctxsize = sizeof(struct crypto_aes_ctx)+AESNI_ALIGN-1,
193 .cra_alignmask = 0,
194 .cra_type = &crypto_blkcipher_type,
195 .cra_module = THIS_MODULE,
196 .cra_list = LIST_HEAD_INIT(blk_ecb_alg.cra_list),
197 .cra_u = {
198 .blkcipher = {
199 .min_keysize = AES_MIN_KEY_SIZE,
200 .max_keysize = AES_MAX_KEY_SIZE,
201 .setkey = aes_set_key,
202 .encrypt = ecb_encrypt,
203 .decrypt = ecb_decrypt,
204 },
205 },
206};
207
208static int cbc_encrypt(struct blkcipher_desc *desc,
209 struct scatterlist *dst, struct scatterlist *src,
210 unsigned int nbytes)
211{
212 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
213 struct blkcipher_walk walk;
214 int err;
215
216 blkcipher_walk_init(&walk, dst, src, nbytes);
217 err = blkcipher_walk_virt(desc, &walk);
218
219 kernel_fpu_begin();
220 while ((nbytes = walk.nbytes)) {
221 aesni_cbc_enc(ctx, walk.dst.virt.addr, walk.src.virt.addr,
222 nbytes & AES_BLOCK_MASK, walk.iv);
223 nbytes &= AES_BLOCK_SIZE - 1;
224 err = blkcipher_walk_done(desc, &walk, nbytes);
225 }
226 kernel_fpu_end();
227
228 return err;
229}
230
231static int cbc_decrypt(struct blkcipher_desc *desc,
232 struct scatterlist *dst, struct scatterlist *src,
233 unsigned int nbytes)
234{
235 struct crypto_aes_ctx *ctx = aes_ctx(crypto_blkcipher_ctx(desc->tfm));
236 struct blkcipher_walk walk;
237 int err;
238
239 blkcipher_walk_init(&walk, dst, src, nbytes);
240 err = blkcipher_walk_virt(desc, &walk);
241
242 kernel_fpu_begin();
243 while ((nbytes = walk.nbytes)) {
244 aesni_cbc_dec(ctx, walk.dst.virt.addr, walk.src.virt.addr,
245 nbytes & AES_BLOCK_MASK, walk.iv);
246 nbytes &= AES_BLOCK_SIZE - 1;
247 err = blkcipher_walk_done(desc, &walk, nbytes);
248 }
249 kernel_fpu_end();
250
251 return err;
252}
253
254static struct crypto_alg blk_cbc_alg = {
255 .cra_name = "__cbc-aes-aesni",
256 .cra_driver_name = "__driver-cbc-aes-aesni",
257 .cra_priority = 0,
258 .cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
259 .cra_blocksize = AES_BLOCK_SIZE,
260 .cra_ctxsize = sizeof(struct crypto_aes_ctx)+AESNI_ALIGN-1,
261 .cra_alignmask = 0,
262 .cra_type = &crypto_blkcipher_type,
263 .cra_module = THIS_MODULE,
264 .cra_list = LIST_HEAD_INIT(blk_cbc_alg.cra_list),
265 .cra_u = {
266 .blkcipher = {
267 .min_keysize = AES_MIN_KEY_SIZE,
268 .max_keysize = AES_MAX_KEY_SIZE,
269 .setkey = aes_set_key,
270 .encrypt = cbc_encrypt,
271 .decrypt = cbc_decrypt,
272 },
273 },
274};
275
276static int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key,
277 unsigned int key_len)
278{
279 struct async_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm);
280
281 return crypto_ablkcipher_setkey(&ctx->cryptd_tfm->base, key, key_len);
282}
283
284static int ablk_encrypt(struct ablkcipher_request *req)
285{
286 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
287 struct async_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm);
288
289 if (kernel_fpu_using()) {
290 struct ablkcipher_request *cryptd_req =
291 ablkcipher_request_ctx(req);
292 memcpy(cryptd_req, req, sizeof(*req));
293 ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
294 return crypto_ablkcipher_encrypt(cryptd_req);
295 } else {
296 struct blkcipher_desc desc;
297 desc.tfm = cryptd_ablkcipher_child(ctx->cryptd_tfm);
298 desc.info = req->info;
299 desc.flags = 0;
300 return crypto_blkcipher_crt(desc.tfm)->encrypt(
301 &desc, req->dst, req->src, req->nbytes);
302 }
303}
304
305static int ablk_decrypt(struct ablkcipher_request *req)
306{
307 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req);
308 struct async_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm);
309
310 if (kernel_fpu_using()) {
311 struct ablkcipher_request *cryptd_req =
312 ablkcipher_request_ctx(req);
313 memcpy(cryptd_req, req, sizeof(*req));
314 ablkcipher_request_set_tfm(cryptd_req, &ctx->cryptd_tfm->base);
315 return crypto_ablkcipher_decrypt(cryptd_req);
316 } else {
317 struct blkcipher_desc desc;
318 desc.tfm = cryptd_ablkcipher_child(ctx->cryptd_tfm);
319 desc.info = req->info;
320 desc.flags = 0;
321 return crypto_blkcipher_crt(desc.tfm)->decrypt(
322 &desc, req->dst, req->src, req->nbytes);
323 }
324}
325
326static void ablk_exit(struct crypto_tfm *tfm)
327{
328 struct async_aes_ctx *ctx = crypto_tfm_ctx(tfm);
329
330 cryptd_free_ablkcipher(ctx->cryptd_tfm);
331}
332
333static void ablk_init_common(struct crypto_tfm *tfm,
334 struct cryptd_ablkcipher *cryptd_tfm)
335{
336 struct async_aes_ctx *ctx = crypto_tfm_ctx(tfm);
337
338 ctx->cryptd_tfm = cryptd_tfm;
339 tfm->crt_ablkcipher.reqsize = sizeof(struct ablkcipher_request) +
340 crypto_ablkcipher_reqsize(&cryptd_tfm->base);
341}
342
343static int ablk_ecb_init(struct crypto_tfm *tfm)
344{
345 struct cryptd_ablkcipher *cryptd_tfm;
346
347 cryptd_tfm = cryptd_alloc_ablkcipher("__driver-ecb-aes-aesni", 0, 0);
348 if (IS_ERR(cryptd_tfm))
349 return PTR_ERR(cryptd_tfm);
350 ablk_init_common(tfm, cryptd_tfm);
351 return 0;
352}
353
354static struct crypto_alg ablk_ecb_alg = {
355 .cra_name = "ecb(aes)",
356 .cra_driver_name = "ecb-aes-aesni",
357 .cra_priority = 400,
358 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
359 .cra_blocksize = AES_BLOCK_SIZE,
360 .cra_ctxsize = sizeof(struct async_aes_ctx),
361 .cra_alignmask = 0,
362 .cra_type = &crypto_ablkcipher_type,
363 .cra_module = THIS_MODULE,
364 .cra_list = LIST_HEAD_INIT(ablk_ecb_alg.cra_list),
365 .cra_init = ablk_ecb_init,
366 .cra_exit = ablk_exit,
367 .cra_u = {
368 .ablkcipher = {
369 .min_keysize = AES_MIN_KEY_SIZE,
370 .max_keysize = AES_MAX_KEY_SIZE,
371 .setkey = ablk_set_key,
372 .encrypt = ablk_encrypt,
373 .decrypt = ablk_decrypt,
374 },
375 },
376};
377
378static int ablk_cbc_init(struct crypto_tfm *tfm)
379{
380 struct cryptd_ablkcipher *cryptd_tfm;
381
382 cryptd_tfm = cryptd_alloc_ablkcipher("__driver-cbc-aes-aesni", 0, 0);
383 if (IS_ERR(cryptd_tfm))
384 return PTR_ERR(cryptd_tfm);
385 ablk_init_common(tfm, cryptd_tfm);
386 return 0;
387}
388
389static struct crypto_alg ablk_cbc_alg = {
390 .cra_name = "cbc(aes)",
391 .cra_driver_name = "cbc-aes-aesni",
392 .cra_priority = 400,
393 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC,
394 .cra_blocksize = AES_BLOCK_SIZE,
395 .cra_ctxsize = sizeof(struct async_aes_ctx),
396 .cra_alignmask = 0,
397 .cra_type = &crypto_ablkcipher_type,
398 .cra_module = THIS_MODULE,
399 .cra_list = LIST_HEAD_INIT(ablk_cbc_alg.cra_list),
400 .cra_init = ablk_cbc_init,
401 .cra_exit = ablk_exit,
402 .cra_u = {
403 .ablkcipher = {
404 .min_keysize = AES_MIN_KEY_SIZE,
405 .max_keysize = AES_MAX_KEY_SIZE,
406 .ivsize = AES_BLOCK_SIZE,
407 .setkey = ablk_set_key,
408 .encrypt = ablk_encrypt,
409 .decrypt = ablk_decrypt,
410 },
411 },
412};
413
414static int __init aesni_init(void)
415{
416 int err;
417
418 if (!cpu_has_aes) {
419 printk(KERN_ERR "Intel AES-NI instructions are not detected.\n");
420 return -ENODEV;
421 }
422 if ((err = crypto_register_alg(&aesni_alg)))
423 goto aes_err;
424 if ((err = crypto_register_alg(&blk_ecb_alg)))
425 goto blk_ecb_err;
426 if ((err = crypto_register_alg(&blk_cbc_alg)))
427 goto blk_cbc_err;
428 if ((err = crypto_register_alg(&ablk_ecb_alg)))
429 goto ablk_ecb_err;
430 if ((err = crypto_register_alg(&ablk_cbc_alg)))
431 goto ablk_cbc_err;
432
433 return err;
434
435ablk_cbc_err:
436 crypto_unregister_alg(&ablk_ecb_alg);
437ablk_ecb_err:
438 crypto_unregister_alg(&blk_cbc_alg);
439blk_cbc_err:
440 crypto_unregister_alg(&blk_ecb_alg);
441blk_ecb_err:
442 crypto_unregister_alg(&aesni_alg);
443aes_err:
444 return err;
445}
446
447static void __exit aesni_exit(void)
448{
449 crypto_unregister_alg(&ablk_cbc_alg);
450 crypto_unregister_alg(&ablk_ecb_alg);
451 crypto_unregister_alg(&blk_cbc_alg);
452 crypto_unregister_alg(&blk_ecb_alg);
453 crypto_unregister_alg(&aesni_alg);
454}
455
456module_init(aesni_init);
457module_exit(aesni_exit);
458
459MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm, Intel AES-NI instructions optimized");
460MODULE_LICENSE("GPL");
461MODULE_ALIAS("aes");
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 9dabd00e9805..588a7aa937e1 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -33,8 +33,6 @@
33#include <asm/sigframe.h> 33#include <asm/sigframe.h>
34#include <asm/sys_ia32.h> 34#include <asm/sys_ia32.h>
35 35
36#define DEBUG_SIG 0
37
38#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 36#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
39 37
40#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ 38#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \
@@ -46,78 +44,83 @@ void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
46 44
47int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) 45int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
48{ 46{
49 int err; 47 int err = 0;
50 48
51 if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t))) 49 if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t)))
52 return -EFAULT; 50 return -EFAULT;
53 51
54 /* If you change siginfo_t structure, please make sure that 52 put_user_try {
55 this code is fixed accordingly. 53 /* If you change siginfo_t structure, please make sure that
56 It should never copy any pad contained in the structure 54 this code is fixed accordingly.
57 to avoid security leaks, but must copy the generic 55 It should never copy any pad contained in the structure
58 3 ints plus the relevant union member. */ 56 to avoid security leaks, but must copy the generic
59 err = __put_user(from->si_signo, &to->si_signo); 57 3 ints plus the relevant union member. */
60 err |= __put_user(from->si_errno, &to->si_errno); 58 put_user_ex(from->si_signo, &to->si_signo);
61 err |= __put_user((short)from->si_code, &to->si_code); 59 put_user_ex(from->si_errno, &to->si_errno);
62 60 put_user_ex((short)from->si_code, &to->si_code);
63 if (from->si_code < 0) { 61
64 err |= __put_user(from->si_pid, &to->si_pid); 62 if (from->si_code < 0) {
65 err |= __put_user(from->si_uid, &to->si_uid); 63 put_user_ex(from->si_pid, &to->si_pid);
66 err |= __put_user(ptr_to_compat(from->si_ptr), &to->si_ptr); 64 put_user_ex(from->si_uid, &to->si_uid);
67 } else { 65 put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr);
68 /* 66 } else {
69 * First 32bits of unions are always present: 67 /*
70 * si_pid === si_band === si_tid === si_addr(LS half) 68 * First 32bits of unions are always present:
71 */ 69 * si_pid === si_band === si_tid === si_addr(LS half)
72 err |= __put_user(from->_sifields._pad[0], 70 */
73 &to->_sifields._pad[0]); 71 put_user_ex(from->_sifields._pad[0],
74 switch (from->si_code >> 16) { 72 &to->_sifields._pad[0]);
75 case __SI_FAULT >> 16: 73 switch (from->si_code >> 16) {
76 break; 74 case __SI_FAULT >> 16:
77 case __SI_CHLD >> 16: 75 break;
78 err |= __put_user(from->si_utime, &to->si_utime); 76 case __SI_CHLD >> 16:
79 err |= __put_user(from->si_stime, &to->si_stime); 77 put_user_ex(from->si_utime, &to->si_utime);
80 err |= __put_user(from->si_status, &to->si_status); 78 put_user_ex(from->si_stime, &to->si_stime);
81 /* FALL THROUGH */ 79 put_user_ex(from->si_status, &to->si_status);
82 default: 80 /* FALL THROUGH */
83 case __SI_KILL >> 16: 81 default:
84 err |= __put_user(from->si_uid, &to->si_uid); 82 case __SI_KILL >> 16:
85 break; 83 put_user_ex(from->si_uid, &to->si_uid);
86 case __SI_POLL >> 16: 84 break;
87 err |= __put_user(from->si_fd, &to->si_fd); 85 case __SI_POLL >> 16:
88 break; 86 put_user_ex(from->si_fd, &to->si_fd);
89 case __SI_TIMER >> 16: 87 break;
90 err |= __put_user(from->si_overrun, &to->si_overrun); 88 case __SI_TIMER >> 16:
91 err |= __put_user(ptr_to_compat(from->si_ptr), 89 put_user_ex(from->si_overrun, &to->si_overrun);
92 &to->si_ptr); 90 put_user_ex(ptr_to_compat(from->si_ptr),
93 break; 91 &to->si_ptr);
94 /* This is not generated by the kernel as of now. */ 92 break;
95 case __SI_RT >> 16: 93 /* This is not generated by the kernel as of now. */
96 case __SI_MESGQ >> 16: 94 case __SI_RT >> 16:
97 err |= __put_user(from->si_uid, &to->si_uid); 95 case __SI_MESGQ >> 16:
98 err |= __put_user(from->si_int, &to->si_int); 96 put_user_ex(from->si_uid, &to->si_uid);
99 break; 97 put_user_ex(from->si_int, &to->si_int);
98 break;
99 }
100 } 100 }
101 } 101 } put_user_catch(err);
102
102 return err; 103 return err;
103} 104}
104 105
105int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) 106int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
106{ 107{
107 int err; 108 int err = 0;
108 u32 ptr32; 109 u32 ptr32;
109 110
110 if (!access_ok(VERIFY_READ, from, sizeof(compat_siginfo_t))) 111 if (!access_ok(VERIFY_READ, from, sizeof(compat_siginfo_t)))
111 return -EFAULT; 112 return -EFAULT;
112 113
113 err = __get_user(to->si_signo, &from->si_signo); 114 get_user_try {
114 err |= __get_user(to->si_errno, &from->si_errno); 115 get_user_ex(to->si_signo, &from->si_signo);
115 err |= __get_user(to->si_code, &from->si_code); 116 get_user_ex(to->si_errno, &from->si_errno);
117 get_user_ex(to->si_code, &from->si_code);
116 118
117 err |= __get_user(to->si_pid, &from->si_pid); 119 get_user_ex(to->si_pid, &from->si_pid);
118 err |= __get_user(to->si_uid, &from->si_uid); 120 get_user_ex(to->si_uid, &from->si_uid);
119 err |= __get_user(ptr32, &from->si_ptr); 121 get_user_ex(ptr32, &from->si_ptr);
120 to->si_ptr = compat_ptr(ptr32); 122 to->si_ptr = compat_ptr(ptr32);
123 } get_user_catch(err);
121 124
122 return err; 125 return err;
123} 126}
@@ -142,17 +145,23 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
142 struct pt_regs *regs) 145 struct pt_regs *regs)
143{ 146{
144 stack_t uss, uoss; 147 stack_t uss, uoss;
145 int ret; 148 int ret, err = 0;
146 mm_segment_t seg; 149 mm_segment_t seg;
147 150
148 if (uss_ptr) { 151 if (uss_ptr) {
149 u32 ptr; 152 u32 ptr;
150 153
151 memset(&uss, 0, sizeof(stack_t)); 154 memset(&uss, 0, sizeof(stack_t));
152 if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t)) || 155 if (!access_ok(VERIFY_READ, uss_ptr, sizeof(stack_ia32_t)))
153 __get_user(ptr, &uss_ptr->ss_sp) || 156 return -EFAULT;
154 __get_user(uss.ss_flags, &uss_ptr->ss_flags) || 157
155 __get_user(uss.ss_size, &uss_ptr->ss_size)) 158 get_user_try {
159 get_user_ex(ptr, &uss_ptr->ss_sp);
160 get_user_ex(uss.ss_flags, &uss_ptr->ss_flags);
161 get_user_ex(uss.ss_size, &uss_ptr->ss_size);
162 } get_user_catch(err);
163
164 if (err)
156 return -EFAULT; 165 return -EFAULT;
157 uss.ss_sp = compat_ptr(ptr); 166 uss.ss_sp = compat_ptr(ptr);
158 } 167 }
@@ -161,10 +170,16 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
161 ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp); 170 ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp);
162 set_fs(seg); 171 set_fs(seg);
163 if (ret >= 0 && uoss_ptr) { 172 if (ret >= 0 && uoss_ptr) {
164 if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)) || 173 if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
165 __put_user(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp) || 174 return -EFAULT;
166 __put_user(uoss.ss_flags, &uoss_ptr->ss_flags) || 175
167 __put_user(uoss.ss_size, &uoss_ptr->ss_size)) 176 put_user_try {
177 put_user_ex(ptr_to_compat(uoss.ss_sp), &uoss_ptr->ss_sp);
178 put_user_ex(uoss.ss_flags, &uoss_ptr->ss_flags);
179 put_user_ex(uoss.ss_size, &uoss_ptr->ss_size);
180 } put_user_catch(err);
181
182 if (err)
168 ret = -EFAULT; 183 ret = -EFAULT;
169 } 184 }
170 return ret; 185 return ret;
@@ -173,75 +188,78 @@ asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
173/* 188/*
174 * Do a signal return; undo the signal stack. 189 * Do a signal return; undo the signal stack.
175 */ 190 */
191#define loadsegment_gs(v) load_gs_index(v)
192#define loadsegment_fs(v) loadsegment(fs, v)
193#define loadsegment_ds(v) loadsegment(ds, v)
194#define loadsegment_es(v) loadsegment(es, v)
195
196#define get_user_seg(seg) ({ unsigned int v; savesegment(seg, v); v; })
197#define set_user_seg(seg, v) loadsegment_##seg(v)
198
176#define COPY(x) { \ 199#define COPY(x) { \
177 err |= __get_user(regs->x, &sc->x); \ 200 get_user_ex(regs->x, &sc->x); \
178} 201}
179 202
180#define COPY_SEG_CPL3(seg) { \ 203#define GET_SEG(seg) ({ \
181 unsigned short tmp; \ 204 unsigned short tmp; \
182 err |= __get_user(tmp, &sc->seg); \ 205 get_user_ex(tmp, &sc->seg); \
183 regs->seg = tmp | 3; \ 206 tmp; \
184} 207})
208
209#define COPY_SEG_CPL3(seg) do { \
210 regs->seg = GET_SEG(seg) | 3; \
211} while (0)
185 212
186#define RELOAD_SEG(seg) { \ 213#define RELOAD_SEG(seg) { \
187 unsigned int cur, pre; \ 214 unsigned int pre = GET_SEG(seg); \
188 err |= __get_user(pre, &sc->seg); \ 215 unsigned int cur = get_user_seg(seg); \
189 savesegment(seg, cur); \
190 pre |= 3; \ 216 pre |= 3; \
191 if (pre != cur) \ 217 if (pre != cur) \
192 loadsegment(seg, pre); \ 218 set_user_seg(seg, pre); \
193} 219}
194 220
195static int ia32_restore_sigcontext(struct pt_regs *regs, 221static int ia32_restore_sigcontext(struct pt_regs *regs,
196 struct sigcontext_ia32 __user *sc, 222 struct sigcontext_ia32 __user *sc,
197 unsigned int *pax) 223 unsigned int *pax)
198{ 224{
199 unsigned int tmpflags, gs, oldgs, err = 0; 225 unsigned int tmpflags, err = 0;
200 void __user *buf; 226 void __user *buf;
201 u32 tmp; 227 u32 tmp;
202 228
203 /* Always make any pending restarted system calls return -EINTR */ 229 /* Always make any pending restarted system calls return -EINTR */
204 current_thread_info()->restart_block.fn = do_no_restart_syscall; 230 current_thread_info()->restart_block.fn = do_no_restart_syscall;
205 231
206#if DEBUG_SIG 232 get_user_try {
207 printk(KERN_DEBUG "SIG restore_sigcontext: " 233 /*
208 "sc=%p err(%x) eip(%x) cs(%x) flg(%x)\n", 234 * Reload fs and gs if they have changed in the signal
209 sc, sc->err, sc->ip, sc->cs, sc->flags); 235 * handler. This does not handle long fs/gs base changes in
210#endif 236 * the handler, but does not clobber them at least in the
211 237 * normal case.
212 /* 238 */
213 * Reload fs and gs if they have changed in the signal 239 RELOAD_SEG(gs);
214 * handler. This does not handle long fs/gs base changes in 240 RELOAD_SEG(fs);
215 * the handler, but does not clobber them at least in the 241 RELOAD_SEG(ds);
216 * normal case. 242 RELOAD_SEG(es);
217 */ 243
218 err |= __get_user(gs, &sc->gs); 244 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
219 gs |= 3; 245 COPY(dx); COPY(cx); COPY(ip);
220 savesegment(gs, oldgs); 246 /* Don't touch extended registers */
221 if (gs != oldgs) 247
222 load_gs_index(gs); 248 COPY_SEG_CPL3(cs);
223 249 COPY_SEG_CPL3(ss);
224 RELOAD_SEG(fs); 250
225 RELOAD_SEG(ds); 251 get_user_ex(tmpflags, &sc->flags);
226 RELOAD_SEG(es); 252 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
227 253 /* disable syscall checks */
228 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); 254 regs->orig_ax = -1;
229 COPY(dx); COPY(cx); COPY(ip); 255
230 /* Don't touch extended registers */ 256 get_user_ex(tmp, &sc->fpstate);
231 257 buf = compat_ptr(tmp);
232 COPY_SEG_CPL3(cs); 258 err |= restore_i387_xstate_ia32(buf);
233 COPY_SEG_CPL3(ss); 259
234 260 get_user_ex(*pax, &sc->ax);
235 err |= __get_user(tmpflags, &sc->flags); 261 } get_user_catch(err);
236 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); 262
237 /* disable syscall checks */
238 regs->orig_ax = -1;
239
240 err |= __get_user(tmp, &sc->fpstate);
241 buf = compat_ptr(tmp);
242 err |= restore_i387_xstate_ia32(buf);
243
244 err |= __get_user(*pax, &sc->ax);
245 return err; 263 return err;
246} 264}
247 265
@@ -317,38 +335,36 @@ static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc,
317 void __user *fpstate, 335 void __user *fpstate,
318 struct pt_regs *regs, unsigned int mask) 336 struct pt_regs *regs, unsigned int mask)
319{ 337{
320 int tmp, err = 0; 338 int err = 0;
321 339
322 savesegment(gs, tmp); 340 put_user_try {
323 err |= __put_user(tmp, (unsigned int __user *)&sc->gs); 341 put_user_ex(get_user_seg(gs), (unsigned int __user *)&sc->gs);
324 savesegment(fs, tmp); 342 put_user_ex(get_user_seg(fs), (unsigned int __user *)&sc->fs);
325 err |= __put_user(tmp, (unsigned int __user *)&sc->fs); 343 put_user_ex(get_user_seg(ds), (unsigned int __user *)&sc->ds);
326 savesegment(ds, tmp); 344 put_user_ex(get_user_seg(es), (unsigned int __user *)&sc->es);
327 err |= __put_user(tmp, (unsigned int __user *)&sc->ds); 345
328 savesegment(es, tmp); 346 put_user_ex(regs->di, &sc->di);
329 err |= __put_user(tmp, (unsigned int __user *)&sc->es); 347 put_user_ex(regs->si, &sc->si);
330 348 put_user_ex(regs->bp, &sc->bp);
331 err |= __put_user(regs->di, &sc->di); 349 put_user_ex(regs->sp, &sc->sp);
332 err |= __put_user(regs->si, &sc->si); 350 put_user_ex(regs->bx, &sc->bx);
333 err |= __put_user(regs->bp, &sc->bp); 351 put_user_ex(regs->dx, &sc->dx);
334 err |= __put_user(regs->sp, &sc->sp); 352 put_user_ex(regs->cx, &sc->cx);
335 err |= __put_user(regs->bx, &sc->bx); 353 put_user_ex(regs->ax, &sc->ax);
336 err |= __put_user(regs->dx, &sc->dx); 354 put_user_ex(current->thread.trap_no, &sc->trapno);
337 err |= __put_user(regs->cx, &sc->cx); 355 put_user_ex(current->thread.error_code, &sc->err);
338 err |= __put_user(regs->ax, &sc->ax); 356 put_user_ex(regs->ip, &sc->ip);
339 err |= __put_user(current->thread.trap_no, &sc->trapno); 357 put_user_ex(regs->cs, (unsigned int __user *)&sc->cs);
340 err |= __put_user(current->thread.error_code, &sc->err); 358 put_user_ex(regs->flags, &sc->flags);
341 err |= __put_user(regs->ip, &sc->ip); 359 put_user_ex(regs->sp, &sc->sp_at_signal);
342 err |= __put_user(regs->cs, (unsigned int __user *)&sc->cs); 360 put_user_ex(regs->ss, (unsigned int __user *)&sc->ss);
343 err |= __put_user(regs->flags, &sc->flags); 361
344 err |= __put_user(regs->sp, &sc->sp_at_signal); 362 put_user_ex(ptr_to_compat(fpstate), &sc->fpstate);
345 err |= __put_user(regs->ss, (unsigned int __user *)&sc->ss); 363
346 364 /* non-iBCS2 extensions.. */
347 err |= __put_user(ptr_to_compat(fpstate), &sc->fpstate); 365 put_user_ex(mask, &sc->oldmask);
348 366 put_user_ex(current->thread.cr2, &sc->cr2);
349 /* non-iBCS2 extensions.. */ 367 } put_user_catch(err);
350 err |= __put_user(mask, &sc->oldmask);
351 err |= __put_user(current->thread.cr2, &sc->cr2);
352 368
353 return err; 369 return err;
354} 370}
@@ -437,13 +453,17 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
437 else 453 else
438 restorer = &frame->retcode; 454 restorer = &frame->retcode;
439 } 455 }
440 err |= __put_user(ptr_to_compat(restorer), &frame->pretcode);
441 456
442 /* 457 put_user_try {
443 * These are actually not used anymore, but left because some 458 put_user_ex(ptr_to_compat(restorer), &frame->pretcode);
444 * gdb versions depend on them as a marker. 459
445 */ 460 /*
446 err |= __put_user(*((u64 *)&code), (u64 *)frame->retcode); 461 * These are actually not used anymore, but left because some
462 * gdb versions depend on them as a marker.
463 */
464 put_user_ex(*((u64 *)&code), (u64 *)frame->retcode);
465 } put_user_catch(err);
466
447 if (err) 467 if (err)
448 return -EFAULT; 468 return -EFAULT;
449 469
@@ -462,11 +482,6 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
462 regs->cs = __USER32_CS; 482 regs->cs = __USER32_CS;
463 regs->ss = __USER32_DS; 483 regs->ss = __USER32_DS;
464 484
465#if DEBUG_SIG
466 printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n",
467 current->comm, current->pid, frame, regs->ip, frame->pretcode);
468#endif
469
470 return 0; 485 return 0;
471} 486}
472 487
@@ -496,41 +511,40 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
496 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 511 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
497 return -EFAULT; 512 return -EFAULT;
498 513
499 err |= __put_user(sig, &frame->sig); 514 put_user_try {
500 err |= __put_user(ptr_to_compat(&frame->info), &frame->pinfo); 515 put_user_ex(sig, &frame->sig);
501 err |= __put_user(ptr_to_compat(&frame->uc), &frame->puc); 516 put_user_ex(ptr_to_compat(&frame->info), &frame->pinfo);
502 err |= copy_siginfo_to_user32(&frame->info, info); 517 put_user_ex(ptr_to_compat(&frame->uc), &frame->puc);
503 if (err) 518 err |= copy_siginfo_to_user32(&frame->info, info);
504 return -EFAULT;
505 519
506 /* Create the ucontext. */ 520 /* Create the ucontext. */
507 if (cpu_has_xsave) 521 if (cpu_has_xsave)
508 err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags); 522 put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
509 else 523 else
510 err |= __put_user(0, &frame->uc.uc_flags); 524 put_user_ex(0, &frame->uc.uc_flags);
511 err |= __put_user(0, &frame->uc.uc_link); 525 put_user_ex(0, &frame->uc.uc_link);
512 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 526 put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
513 err |= __put_user(sas_ss_flags(regs->sp), 527 put_user_ex(sas_ss_flags(regs->sp),
514 &frame->uc.uc_stack.ss_flags); 528 &frame->uc.uc_stack.ss_flags);
515 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); 529 put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
516 err |= ia32_setup_sigcontext(&frame->uc.uc_mcontext, fpstate, 530 err |= ia32_setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
517 regs, set->sig[0]); 531 regs, set->sig[0]);
518 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 532 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
519 if (err) 533
520 return -EFAULT; 534 if (ka->sa.sa_flags & SA_RESTORER)
535 restorer = ka->sa.sa_restorer;
536 else
537 restorer = VDSO32_SYMBOL(current->mm->context.vdso,
538 rt_sigreturn);
539 put_user_ex(ptr_to_compat(restorer), &frame->pretcode);
540
541 /*
542 * Not actually used anymore, but left because some gdb
543 * versions need it.
544 */
545 put_user_ex(*((u64 *)&code), (u64 *)frame->retcode);
546 } put_user_catch(err);
521 547
522 if (ka->sa.sa_flags & SA_RESTORER)
523 restorer = ka->sa.sa_restorer;
524 else
525 restorer = VDSO32_SYMBOL(current->mm->context.vdso,
526 rt_sigreturn);
527 err |= __put_user(ptr_to_compat(restorer), &frame->pretcode);
528
529 /*
530 * Not actually used anymore, but left because some gdb
531 * versions need it.
532 */
533 err |= __put_user(*((u64 *)&code), (u64 *)frame->retcode);
534 if (err) 548 if (err)
535 return -EFAULT; 549 return -EFAULT;
536 550
@@ -549,10 +563,5 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
549 regs->cs = __USER32_CS; 563 regs->cs = __USER32_CS;
550 regs->ss = __USER32_DS; 564 regs->ss = __USER32_DS;
551 565
552#if DEBUG_SIG
553 printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n",
554 current->comm, current->pid, frame, regs->ip, frame->pretcode);
555#endif
556
557 return 0; 566 return 0;
558} 567}
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 5a0d76dc56a4..db0c803170ab 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -112,8 +112,8 @@ ENTRY(ia32_sysenter_target)
112 CFI_DEF_CFA rsp,0 112 CFI_DEF_CFA rsp,0
113 CFI_REGISTER rsp,rbp 113 CFI_REGISTER rsp,rbp
114 SWAPGS_UNSAFE_STACK 114 SWAPGS_UNSAFE_STACK
115 movq %gs:pda_kernelstack, %rsp 115 movq PER_CPU_VAR(kernel_stack), %rsp
116 addq $(PDA_STACKOFFSET),%rsp 116 addq $(KERNEL_STACK_OFFSET),%rsp
117 /* 117 /*
118 * No need to follow this irqs on/off section: the syscall 118 * No need to follow this irqs on/off section: the syscall
119 * disabled irqs, here we enable it straight after entry: 119 * disabled irqs, here we enable it straight after entry:
@@ -273,13 +273,13 @@ ENDPROC(ia32_sysenter_target)
273ENTRY(ia32_cstar_target) 273ENTRY(ia32_cstar_target)
274 CFI_STARTPROC32 simple 274 CFI_STARTPROC32 simple
275 CFI_SIGNAL_FRAME 275 CFI_SIGNAL_FRAME
276 CFI_DEF_CFA rsp,PDA_STACKOFFSET 276 CFI_DEF_CFA rsp,KERNEL_STACK_OFFSET
277 CFI_REGISTER rip,rcx 277 CFI_REGISTER rip,rcx
278 /*CFI_REGISTER rflags,r11*/ 278 /*CFI_REGISTER rflags,r11*/
279 SWAPGS_UNSAFE_STACK 279 SWAPGS_UNSAFE_STACK
280 movl %esp,%r8d 280 movl %esp,%r8d
281 CFI_REGISTER rsp,r8 281 CFI_REGISTER rsp,r8
282 movq %gs:pda_kernelstack,%rsp 282 movq PER_CPU_VAR(kernel_stack),%rsp
283 /* 283 /*
284 * No need to follow this irqs on/off section: the syscall 284 * No need to follow this irqs on/off section: the syscall
285 * disabled irqs and here we enable it straight after entry: 285 * disabled irqs and here we enable it straight after entry:
@@ -557,7 +557,7 @@ ia32_sys_call_table:
557 .quad sys32_olduname 557 .quad sys32_olduname
558 .quad sys_umask /* 60 */ 558 .quad sys_umask /* 60 */
559 .quad sys_chroot 559 .quad sys_chroot
560 .quad sys32_ustat 560 .quad compat_sys_ustat
561 .quad sys_dup2 561 .quad sys_dup2
562 .quad sys_getppid 562 .quad sys_getppid
563 .quad sys_getpgrp /* 65 */ 563 .quad sys_getpgrp /* 65 */
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 6c0d7f6231af..efac92fd1efb 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -638,28 +638,6 @@ long sys32_uname(struct old_utsname __user *name)
638 return err ? -EFAULT : 0; 638 return err ? -EFAULT : 0;
639} 639}
640 640
641long sys32_ustat(unsigned dev, struct ustat32 __user *u32p)
642{
643 struct ustat u;
644 mm_segment_t seg;
645 int ret;
646
647 seg = get_fs();
648 set_fs(KERNEL_DS);
649 ret = sys_ustat(dev, (struct ustat __user *)&u);
650 set_fs(seg);
651 if (ret < 0)
652 return ret;
653
654 if (!access_ok(VERIFY_WRITE, u32p, sizeof(struct ustat32)) ||
655 __put_user((__u32) u.f_tfree, &u32p->f_tfree) ||
656 __put_user((__u32) u.f_tinode, &u32p->f_tfree) ||
657 __copy_to_user(&u32p->f_fname, u.f_fname, sizeof(u.f_fname)) ||
658 __copy_to_user(&u32p->f_fpack, u.f_fpack, sizeof(u.f_fpack)))
659 ret = -EFAULT;
660 return ret;
661}
662
663asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, 641asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
664 compat_uptr_t __user *envp, struct pt_regs *regs) 642 compat_uptr_t __user *envp, struct pt_regs *regs)
665{ 643{
diff --git a/arch/x86/include/asm/a.out-core.h b/arch/x86/include/asm/a.out-core.h
index 3c601f8224be..bb70e397aa84 100644
--- a/arch/x86/include/asm/a.out-core.h
+++ b/arch/x86/include/asm/a.out-core.h
@@ -55,7 +55,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
55 dump->regs.ds = (u16)regs->ds; 55 dump->regs.ds = (u16)regs->ds;
56 dump->regs.es = (u16)regs->es; 56 dump->regs.es = (u16)regs->es;
57 dump->regs.fs = (u16)regs->fs; 57 dump->regs.fs = (u16)regs->fs;
58 savesegment(gs, dump->regs.gs); 58 dump->regs.gs = get_user_gs(regs);
59 dump->regs.orig_ax = regs->orig_ax; 59 dump->regs.orig_ax = regs->orig_ax;
60 dump->regs.ip = regs->ip; 60 dump->regs.ip = regs->ip;
61 dump->regs.cs = (u16)regs->cs; 61 dump->regs.cs = (u16)regs->cs;
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 9830681446ad..4518dc500903 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -102,9 +102,6 @@ static inline void disable_acpi(void)
102 acpi_noirq = 1; 102 acpi_noirq = 1;
103} 103}
104 104
105/* Fixmap pages to reserve for ACPI boot-time tables (see fixmap.h) */
106#define FIX_ACPI_PAGES 4
107
108extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); 105extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
109 106
110static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 107static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
diff --git a/arch/x86/include/asm/aes.h b/arch/x86/include/asm/aes.h
new file mode 100644
index 000000000000..80545a1cbe39
--- /dev/null
+++ b/arch/x86/include/asm/aes.h
@@ -0,0 +1,11 @@
1#ifndef ASM_X86_AES_H
2#define ASM_X86_AES_H
3
4#include <linux/crypto.h>
5#include <crypto/aes.h>
6
7void crypto_aes_encrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst,
8 const u8 *src);
9void crypto_aes_decrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst,
10 const u8 *src);
11#endif
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index ab1d51a8855e..4ef949c1972e 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -1,15 +1,18 @@
1#ifndef _ASM_X86_APIC_H 1#ifndef _ASM_X86_APIC_H
2#define _ASM_X86_APIC_H 2#define _ASM_X86_APIC_H
3 3
4#include <linux/pm.h> 4#include <linux/cpumask.h>
5#include <linux/delay.h> 5#include <linux/delay.h>
6#include <linux/pm.h>
6 7
7#include <asm/alternative.h> 8#include <asm/alternative.h>
8#include <asm/fixmap.h> 9#include <asm/cpufeature.h>
9#include <asm/apicdef.h>
10#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/apicdef.h>
12#include <asm/atomic.h>
13#include <asm/fixmap.h>
14#include <asm/mpspec.h>
11#include <asm/system.h> 15#include <asm/system.h>
12#include <asm/cpufeature.h>
13#include <asm/msr.h> 16#include <asm/msr.h>
14 17
15#define ARCH_APICTIMER_STOPS_ON_C3 1 18#define ARCH_APICTIMER_STOPS_ON_C3 1
@@ -33,7 +36,13 @@
33 } while (0) 36 } while (0)
34 37
35 38
39#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
36extern void generic_apic_probe(void); 40extern void generic_apic_probe(void);
41#else
42static inline void generic_apic_probe(void)
43{
44}
45#endif
37 46
38#ifdef CONFIG_X86_LOCAL_APIC 47#ifdef CONFIG_X86_LOCAL_APIC
39 48
@@ -41,6 +50,21 @@ extern unsigned int apic_verbosity;
41extern int local_apic_timer_c2_ok; 50extern int local_apic_timer_c2_ok;
42 51
43extern int disable_apic; 52extern int disable_apic;
53
54#ifdef CONFIG_SMP
55extern void __inquire_remote_apic(int apicid);
56#else /* CONFIG_SMP */
57static inline void __inquire_remote_apic(int apicid)
58{
59}
60#endif /* CONFIG_SMP */
61
62static inline void default_inquire_remote_apic(int apicid)
63{
64 if (apic_verbosity >= APIC_DEBUG)
65 __inquire_remote_apic(apicid);
66}
67
44/* 68/*
45 * Basic functions accessing APICs. 69 * Basic functions accessing APICs.
46 */ 70 */
@@ -51,7 +75,14 @@ extern int disable_apic;
51#define setup_secondary_clock setup_secondary_APIC_clock 75#define setup_secondary_clock setup_secondary_APIC_clock
52#endif 76#endif
53 77
78#ifdef CONFIG_X86_VSMP
54extern int is_vsmp_box(void); 79extern int is_vsmp_box(void);
80#else
81static inline int is_vsmp_box(void)
82{
83 return 0;
84}
85#endif
55extern void xapic_wait_icr_idle(void); 86extern void xapic_wait_icr_idle(void);
56extern u32 safe_xapic_wait_icr_idle(void); 87extern u32 safe_xapic_wait_icr_idle(void);
57extern void xapic_icr_write(u32, u32); 88extern void xapic_icr_write(u32, u32);
@@ -71,6 +102,12 @@ static inline u32 native_apic_mem_read(u32 reg)
71 return *((volatile u32 *)(APIC_BASE + reg)); 102 return *((volatile u32 *)(APIC_BASE + reg));
72} 103}
73 104
105extern void native_apic_wait_icr_idle(void);
106extern u32 native_safe_apic_wait_icr_idle(void);
107extern void native_apic_icr_write(u32 low, u32 id);
108extern u64 native_apic_icr_read(void);
109
110#ifdef CONFIG_X86_X2APIC
74static inline void native_apic_msr_write(u32 reg, u32 v) 111static inline void native_apic_msr_write(u32 reg, u32 v)
75{ 112{
76 if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || 113 if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
@@ -91,8 +128,32 @@ static inline u32 native_apic_msr_read(u32 reg)
91 return low; 128 return low;
92} 129}
93 130
94#ifndef CONFIG_X86_32 131static inline void native_x2apic_wait_icr_idle(void)
95extern int x2apic; 132{
133 /* no need to wait for icr idle in x2apic */
134 return;
135}
136
137static inline u32 native_safe_x2apic_wait_icr_idle(void)
138{
139 /* no need to wait for icr idle in x2apic */
140 return 0;
141}
142
143static inline void native_x2apic_icr_write(u32 low, u32 id)
144{
145 wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low);
146}
147
148static inline u64 native_x2apic_icr_read(void)
149{
150 unsigned long val;
151
152 rdmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), val);
153 return val;
154}
155
156extern int x2apic, x2apic_phys;
96extern void check_x2apic(void); 157extern void check_x2apic(void);
97extern void enable_x2apic(void); 158extern void enable_x2apic(void);
98extern void enable_IR_x2apic(void); 159extern void enable_IR_x2apic(void);
@@ -110,30 +171,24 @@ static inline int x2apic_enabled(void)
110 return 0; 171 return 0;
111} 172}
112#else 173#else
113#define x2apic_enabled() 0 174static inline void check_x2apic(void)
175{
176}
177static inline void enable_x2apic(void)
178{
179}
180static inline void enable_IR_x2apic(void)
181{
182}
183static inline int x2apic_enabled(void)
184{
185 return 0;
186}
114#endif 187#endif
115 188
116struct apic_ops {
117 u32 (*read)(u32 reg);
118 void (*write)(u32 reg, u32 v);
119 u64 (*icr_read)(void);
120 void (*icr_write)(u32 low, u32 high);
121 void (*wait_icr_idle)(void);
122 u32 (*safe_wait_icr_idle)(void);
123};
124
125extern struct apic_ops *apic_ops;
126
127#define apic_read (apic_ops->read)
128#define apic_write (apic_ops->write)
129#define apic_icr_read (apic_ops->icr_read)
130#define apic_icr_write (apic_ops->icr_write)
131#define apic_wait_icr_idle (apic_ops->wait_icr_idle)
132#define safe_apic_wait_icr_idle (apic_ops->safe_wait_icr_idle)
133
134extern int get_physical_broadcast(void); 189extern int get_physical_broadcast(void);
135 190
136#ifdef CONFIG_X86_64 191#ifdef CONFIG_X86_X2APIC
137static inline void ack_x2APIC_irq(void) 192static inline void ack_x2APIC_irq(void)
138{ 193{
139 /* Docs say use 0 for future compatibility */ 194 /* Docs say use 0 for future compatibility */
@@ -141,18 +196,6 @@ static inline void ack_x2APIC_irq(void)
141} 196}
142#endif 197#endif
143 198
144
145static inline void ack_APIC_irq(void)
146{
147 /*
148 * ack_APIC_irq() actually gets compiled as a single instruction
149 * ... yummie.
150 */
151
152 /* Docs say use 0 for future compatibility */
153 apic_write(APIC_EOI, 0);
154}
155
156extern int lapic_get_maxlvt(void); 199extern int lapic_get_maxlvt(void);
157extern void clear_local_APIC(void); 200extern void clear_local_APIC(void);
158extern void connect_bsp_APIC(void); 201extern void connect_bsp_APIC(void);
@@ -196,4 +239,327 @@ static inline void disable_local_APIC(void) { }
196 239
197#endif /* !CONFIG_X86_LOCAL_APIC */ 240#endif /* !CONFIG_X86_LOCAL_APIC */
198 241
242#ifdef CONFIG_X86_64
243#define SET_APIC_ID(x) (apic->set_apic_id(x))
244#else
245
246#endif
247
248/*
249 * Copyright 2004 James Cleverdon, IBM.
250 * Subject to the GNU Public License, v.2
251 *
252 * Generic APIC sub-arch data struct.
253 *
254 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
255 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
256 * James Cleverdon.
257 */
258struct apic {
259 char *name;
260
261 int (*probe)(void);
262 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
263 int (*apic_id_registered)(void);
264
265 u32 irq_delivery_mode;
266 u32 irq_dest_mode;
267
268 const struct cpumask *(*target_cpus)(void);
269
270 int disable_esr;
271
272 int dest_logical;
273 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
274 unsigned long (*check_apicid_present)(int apicid);
275
276 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
277 void (*init_apic_ldr)(void);
278
279 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
280
281 void (*setup_apic_routing)(void);
282 int (*multi_timer_check)(int apic, int irq);
283 int (*apicid_to_node)(int logical_apicid);
284 int (*cpu_to_logical_apicid)(int cpu);
285 int (*cpu_present_to_apicid)(int mps_cpu);
286 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
287 void (*setup_portio_remap)(void);
288 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
289 void (*enable_apic_mode)(void);
290 int (*phys_pkg_id)(int cpuid_apic, int index_msb);
291
292 /*
293 * When one of the next two hooks returns 1 the apic
294 * is switched to this. Essentially they are additional
295 * probe functions:
296 */
297 int (*mps_oem_check)(struct mpc_table *mpc, char *oem, char *productid);
298
299 unsigned int (*get_apic_id)(unsigned long x);
300 unsigned long (*set_apic_id)(unsigned int id);
301 unsigned long apic_id_mask;
302
303 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
304 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
305 const struct cpumask *andmask);
306
307 /* ipi */
308 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
309 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
310 int vector);
311 void (*send_IPI_allbutself)(int vector);
312 void (*send_IPI_all)(int vector);
313 void (*send_IPI_self)(int vector);
314
315 /* wakeup_secondary_cpu */
316 int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip);
317
318 int trampoline_phys_low;
319 int trampoline_phys_high;
320
321 void (*wait_for_init_deassert)(atomic_t *deassert);
322 void (*smp_callin_clear_local_apic)(void);
323 void (*inquire_remote_apic)(int apicid);
324
325 /* apic ops */
326 u32 (*read)(u32 reg);
327 void (*write)(u32 reg, u32 v);
328 u64 (*icr_read)(void);
329 void (*icr_write)(u32 low, u32 high);
330 void (*wait_icr_idle)(void);
331 u32 (*safe_wait_icr_idle)(void);
332};
333
334/*
335 * Pointer to the local APIC driver in use on this system (there's
336 * always just one such driver in use - the kernel decides via an
337 * early probing process which one it picks - and then sticks to it):
338 */
339extern struct apic *apic;
340
341/*
342 * APIC functionality to boot other CPUs - only used on SMP:
343 */
344#ifdef CONFIG_SMP
345extern atomic_t init_deasserted;
346extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip);
347#endif
348
349static inline u32 apic_read(u32 reg)
350{
351 return apic->read(reg);
352}
353
354static inline void apic_write(u32 reg, u32 val)
355{
356 apic->write(reg, val);
357}
358
359static inline u64 apic_icr_read(void)
360{
361 return apic->icr_read();
362}
363
364static inline void apic_icr_write(u32 low, u32 high)
365{
366 apic->icr_write(low, high);
367}
368
369static inline void apic_wait_icr_idle(void)
370{
371 apic->wait_icr_idle();
372}
373
374static inline u32 safe_apic_wait_icr_idle(void)
375{
376 return apic->safe_wait_icr_idle();
377}
378
379
380static inline void ack_APIC_irq(void)
381{
382 /*
383 * ack_APIC_irq() actually gets compiled as a single instruction
384 * ... yummie.
385 */
386
387 /* Docs say use 0 for future compatibility */
388 apic_write(APIC_EOI, 0);
389}
390
391static inline unsigned default_get_apic_id(unsigned long x)
392{
393 unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
394
395 if (APIC_XAPIC(ver))
396 return (x >> 24) & 0xFF;
397 else
398 return (x >> 24) & 0x0F;
399}
400
401/*
402 * Warm reset vector default position:
403 */
404#define DEFAULT_TRAMPOLINE_PHYS_LOW 0x467
405#define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469
406
407#ifdef CONFIG_X86_64
408extern struct apic apic_flat;
409extern struct apic apic_physflat;
410extern struct apic apic_x2apic_cluster;
411extern struct apic apic_x2apic_phys;
412extern int default_acpi_madt_oem_check(char *, char *);
413
414extern void apic_send_IPI_self(int vector);
415
416extern struct apic apic_x2apic_uv_x;
417DECLARE_PER_CPU(int, x2apic_extra_bits);
418
419extern int default_cpu_present_to_apicid(int mps_cpu);
420extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
421#endif
422
423static inline void default_wait_for_init_deassert(atomic_t *deassert)
424{
425 while (!atomic_read(deassert))
426 cpu_relax();
427 return;
428}
429
430extern void generic_bigsmp_probe(void);
431
432
433#ifdef CONFIG_X86_LOCAL_APIC
434
435#include <asm/smp.h>
436
437#define APIC_DFR_VALUE (APIC_DFR_FLAT)
438
439static inline const struct cpumask *default_target_cpus(void)
440{
441#ifdef CONFIG_SMP
442 return cpu_online_mask;
443#else
444 return cpumask_of(0);
445#endif
446}
447
448DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
449
450
451static inline unsigned int read_apic_id(void)
452{
453 unsigned int reg;
454
455 reg = apic_read(APIC_ID);
456
457 return apic->get_apic_id(reg);
458}
459
460extern void default_setup_apic_routing(void);
461
462#ifdef CONFIG_X86_32
463/*
464 * Set up the logical destination ID.
465 *
466 * Intel recommends to set DFR, LDR and TPR before enabling
467 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
468 * document number 292116). So here it goes...
469 */
470extern void default_init_apic_ldr(void);
471
472static inline int default_apic_id_registered(void)
473{
474 return physid_isset(read_apic_id(), phys_cpu_present_map);
475}
476
477static inline unsigned int
478default_cpu_mask_to_apicid(const struct cpumask *cpumask)
479{
480 return cpumask_bits(cpumask)[0];
481}
482
483static inline unsigned int
484default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
485 const struct cpumask *andmask)
486{
487 unsigned long mask1 = cpumask_bits(cpumask)[0];
488 unsigned long mask2 = cpumask_bits(andmask)[0];
489 unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
490
491 return (unsigned int)(mask1 & mask2 & mask3);
492}
493
494static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
495{
496 return cpuid_apic >> index_msb;
497}
498
499extern int default_apicid_to_node(int logical_apicid);
500
501#endif
502
503static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
504{
505 return physid_isset(apicid, bitmap);
506}
507
508static inline unsigned long default_check_apicid_present(int bit)
509{
510 return physid_isset(bit, phys_cpu_present_map);
511}
512
513static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map)
514{
515 return phys_map;
516}
517
518/* Mapping from cpu number to logical apicid */
519static inline int default_cpu_to_logical_apicid(int cpu)
520{
521 return 1 << cpu;
522}
523
524static inline int __default_cpu_present_to_apicid(int mps_cpu)
525{
526 if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
527 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
528 else
529 return BAD_APICID;
530}
531
532static inline int
533__default_check_phys_apicid_present(int boot_cpu_physical_apicid)
534{
535 return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
536}
537
538#ifdef CONFIG_X86_32
539static inline int default_cpu_present_to_apicid(int mps_cpu)
540{
541 return __default_cpu_present_to_apicid(mps_cpu);
542}
543
544static inline int
545default_check_phys_apicid_present(int boot_cpu_physical_apicid)
546{
547 return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
548}
549#else
550extern int default_cpu_present_to_apicid(int mps_cpu);
551extern int default_check_phys_apicid_present(int boot_cpu_physical_apicid);
552#endif
553
554static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
555{
556 return physid_mask_of_physid(phys_apicid);
557}
558
559#endif /* CONFIG_X86_LOCAL_APIC */
560
561#ifdef CONFIG_X86_32
562extern u8 cpu_2_logical_apicid[NR_CPUS];
563#endif
564
199#endif /* _ASM_X86_APIC_H */ 565#endif /* _ASM_X86_APIC_H */
diff --git a/arch/x86/include/asm/apicnum.h b/arch/x86/include/asm/apicnum.h
new file mode 100644
index 000000000000..82f613c607ce
--- /dev/null
+++ b/arch/x86/include/asm/apicnum.h
@@ -0,0 +1,12 @@
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/mach-default/apm.h b/arch/x86/include/asm/apm.h
index 20370c6db74b..20370c6db74b 100644
--- a/arch/x86/include/asm/mach-default/apm.h
+++ b/arch/x86/include/asm/apm.h
diff --git a/arch/x86/include/asm/arch_hooks.h b/arch/x86/include/asm/arch_hooks.h
deleted file mode 100644
index cbd4957838a6..000000000000
--- a/arch/x86/include/asm/arch_hooks.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef _ASM_X86_ARCH_HOOKS_H
2#define _ASM_X86_ARCH_HOOKS_H
3
4#include <linux/interrupt.h>
5
6/*
7 * linux/include/asm/arch_hooks.h
8 *
9 * define the architecture specific hooks
10 */
11
12/* these aren't arch hooks, they are generic routines
13 * that can be used by the hooks */
14extern void init_ISA_irqs(void);
15extern irqreturn_t timer_interrupt(int irq, void *dev_id);
16
17/* these are the defined hooks */
18extern void intr_init_hook(void);
19extern void pre_intr_init_hook(void);
20extern void pre_setup_arch_hook(void);
21extern void trap_init_hook(void);
22extern void pre_time_init_hook(void);
23extern void time_init_hook(void);
24extern void mca_nmi_hook(void);
25
26#endif /* _ASM_X86_ARCH_HOOKS_H */
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
deleted file mode 100644
index d8dd9f537911..000000000000
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ /dev/null
@@ -1,155 +0,0 @@
1#ifndef __ASM_MACH_APIC_H
2#define __ASM_MACH_APIC_H
3
4#define xapic_phys_to_log_apicid(cpu) (per_cpu(x86_bios_cpu_apicid, cpu))
5#define esr_disable (1)
6
7static inline int apic_id_registered(void)
8{
9 return (1);
10}
11
12static inline const cpumask_t *target_cpus(void)
13{
14#ifdef CONFIG_SMP
15 return &cpu_online_map;
16#else
17 return &cpumask_of_cpu(0);
18#endif
19}
20
21#undef APIC_DEST_LOGICAL
22#define APIC_DEST_LOGICAL 0
23#define APIC_DFR_VALUE (APIC_DFR_FLAT)
24#define INT_DELIVERY_MODE (dest_Fixed)
25#define INT_DEST_MODE (0) /* phys delivery to target proc */
26#define NO_BALANCE_IRQ (0)
27
28static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
29{
30 return (0);
31}
32
33static inline unsigned long check_apicid_present(int bit)
34{
35 return (1);
36}
37
38static inline unsigned long calculate_ldr(int cpu)
39{
40 unsigned long val, id;
41 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
42 id = xapic_phys_to_log_apicid(cpu);
43 val |= SET_APIC_LOGICAL_ID(id);
44 return val;
45}
46
47/*
48 * Set up the logical destination ID.
49 *
50 * Intel recommends to set DFR, LDR and TPR before enabling
51 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
52 * document number 292116). So here it goes...
53 */
54static inline void init_apic_ldr(void)
55{
56 unsigned long val;
57 int cpu = smp_processor_id();
58
59 apic_write(APIC_DFR, APIC_DFR_VALUE);
60 val = calculate_ldr(cpu);
61 apic_write(APIC_LDR, val);
62}
63
64static inline void setup_apic_routing(void)
65{
66 printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
67 "Physflat", nr_ioapics);
68}
69
70static inline int multi_timer_check(int apic, int irq)
71{
72 return (0);
73}
74
75static inline int apicid_to_node(int logical_apicid)
76{
77 return apicid_2_node[hard_smp_processor_id()];
78}
79
80static inline int cpu_present_to_apicid(int mps_cpu)
81{
82 if (mps_cpu < nr_cpu_ids)
83 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
84
85 return BAD_APICID;
86}
87
88static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
89{
90 return physid_mask_of_physid(phys_apicid);
91}
92
93extern u8 cpu_2_logical_apicid[];
94/* Mapping from cpu number to logical apicid */
95static inline int cpu_to_logical_apicid(int cpu)
96{
97 if (cpu >= nr_cpu_ids)
98 return BAD_APICID;
99 return cpu_physical_id(cpu);
100}
101
102static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
103{
104 /* For clustered we don't have a good way to do this yet - hack */
105 return physids_promote(0xFFL);
106}
107
108static inline void setup_portio_remap(void)
109{
110}
111
112static inline void enable_apic_mode(void)
113{
114}
115
116static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
117{
118 return (1);
119}
120
121/* As we are using single CPU as destination, pick only one CPU here */
122static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
123{
124 int cpu;
125 int apicid;
126
127 cpu = first_cpu(*cpumask);
128 apicid = cpu_to_logical_apicid(cpu);
129 return apicid;
130}
131
132static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
133 const struct cpumask *andmask)
134{
135 int cpu;
136
137 /*
138 * We're using fixed IRQ delivery, can only return one phys APIC ID.
139 * May as well be the first.
140 */
141 for_each_cpu_and(cpu, cpumask, andmask)
142 if (cpumask_test_cpu(cpu, cpu_online_mask))
143 break;
144 if (cpu < nr_cpu_ids)
145 return cpu_to_logical_apicid(cpu);
146
147 return BAD_APICID;
148}
149
150static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
151{
152 return cpuid_apic >> index_msb;
153}
154
155#endif /* __ASM_MACH_APIC_H */
diff --git a/arch/x86/include/asm/bigsmp/apicdef.h b/arch/x86/include/asm/bigsmp/apicdef.h
deleted file mode 100644
index 392c3f5ef2fe..000000000000
--- a/arch/x86/include/asm/bigsmp/apicdef.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ASM_MACH_APICDEF_H
2#define __ASM_MACH_APICDEF_H
3
4#define APIC_ID_MASK (0xFF<<24)
5
6static inline unsigned get_apic_id(unsigned long x)
7{
8 return (((x)>>24)&0xFF);
9}
10
11#define GET_APIC_ID(x) get_apic_id(x)
12
13#endif
diff --git a/arch/x86/include/asm/bigsmp/ipi.h b/arch/x86/include/asm/bigsmp/ipi.h
deleted file mode 100644
index 27fcd01b3ae6..000000000000
--- a/arch/x86/include/asm/bigsmp/ipi.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H
3
4void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
6
7static inline void send_IPI_mask(const struct cpumask *mask, int vector)
8{
9 send_IPI_mask_sequence(mask, vector);
10}
11
12static inline void send_IPI_allbutself(int vector)
13{
14 send_IPI_mask_allbutself(cpu_online_mask, vector);
15}
16
17static inline void send_IPI_all(int vector)
18{
19 send_IPI_mask(cpu_online_mask, vector);
20}
21
22#endif /* __ASM_MACH_IPI_H */
diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
index dd61616cb73d..6526cf08b0e4 100644
--- a/arch/x86/include/asm/boot.h
+++ b/arch/x86/include/asm/boot.h
@@ -10,17 +10,31 @@
10#define EXTENDED_VGA 0xfffe /* 80x50 mode */ 10#define EXTENDED_VGA 0xfffe /* 80x50 mode */
11#define ASK_VGA 0xfffd /* ask for it at bootup */ 11#define ASK_VGA 0xfffd /* ask for it at bootup */
12 12
13#ifdef __KERNEL__
14
13/* Physical address where kernel should be loaded. */ 15/* Physical address where kernel should be loaded. */
14#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \ 16#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
15 + (CONFIG_PHYSICAL_ALIGN - 1)) \ 17 + (CONFIG_PHYSICAL_ALIGN - 1)) \
16 & ~(CONFIG_PHYSICAL_ALIGN - 1)) 18 & ~(CONFIG_PHYSICAL_ALIGN - 1))
17 19
20#ifdef CONFIG_KERNEL_BZIP2
21#define BOOT_HEAP_SIZE 0x400000
22#else /* !CONFIG_KERNEL_BZIP2 */
23
18#ifdef CONFIG_X86_64 24#ifdef CONFIG_X86_64
19#define BOOT_HEAP_SIZE 0x7000 25#define BOOT_HEAP_SIZE 0x7000
20#define BOOT_STACK_SIZE 0x4000
21#else 26#else
22#define BOOT_HEAP_SIZE 0x4000 27#define BOOT_HEAP_SIZE 0x4000
28#endif
29
30#endif /* !CONFIG_KERNEL_BZIP2 */
31
32#ifdef CONFIG_X86_64
33#define BOOT_STACK_SIZE 0x4000
34#else
23#define BOOT_STACK_SIZE 0x1000 35#define BOOT_STACK_SIZE 0x1000
24#endif 36#endif
25 37
38#endif /* __KERNEL__ */
39
26#endif /* _ASM_X86_BOOT_H */ 40#endif /* _ASM_X86_BOOT_H */
diff --git a/arch/x86/include/asm/cacheflush.h b/arch/x86/include/asm/cacheflush.h
index 2f8466540fb5..5b301b7ff5f4 100644
--- a/arch/x86/include/asm/cacheflush.h
+++ b/arch/x86/include/asm/cacheflush.h
@@ -5,24 +5,43 @@
5#include <linux/mm.h> 5#include <linux/mm.h>
6 6
7/* Caches aren't brain-dead on the intel. */ 7/* Caches aren't brain-dead on the intel. */
8#define flush_cache_all() do { } while (0) 8static inline void flush_cache_all(void) { }
9#define flush_cache_mm(mm) do { } while (0) 9static inline void flush_cache_mm(struct mm_struct *mm) { }
10#define flush_cache_dup_mm(mm) do { } while (0) 10static inline void flush_cache_dup_mm(struct mm_struct *mm) { }
11#define flush_cache_range(vma, start, end) do { } while (0) 11static inline void flush_cache_range(struct vm_area_struct *vma,
12#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 12 unsigned long start, unsigned long end) { }
13#define flush_dcache_page(page) do { } while (0) 13static inline void flush_cache_page(struct vm_area_struct *vma,
14#define flush_dcache_mmap_lock(mapping) do { } while (0) 14 unsigned long vmaddr, unsigned long pfn) { }
15#define flush_dcache_mmap_unlock(mapping) do { } while (0) 15static inline void flush_dcache_page(struct page *page) { }
16#define flush_icache_range(start, end) do { } while (0) 16static inline void flush_dcache_mmap_lock(struct address_space *mapping) { }
17#define flush_icache_page(vma, pg) do { } while (0) 17static inline void flush_dcache_mmap_unlock(struct address_space *mapping) { }
18#define flush_icache_user_range(vma, pg, adr, len) do { } while (0) 18static inline void flush_icache_range(unsigned long start,
19#define flush_cache_vmap(start, end) do { } while (0) 19 unsigned long end) { }
20#define flush_cache_vunmap(start, end) do { } while (0) 20static inline void flush_icache_page(struct vm_area_struct *vma,
21 struct page *page) { }
22static inline void flush_icache_user_range(struct vm_area_struct *vma,
23 struct page *page,
24 unsigned long addr,
25 unsigned long len) { }
26static inline void flush_cache_vmap(unsigned long start, unsigned long end) { }
27static inline void flush_cache_vunmap(unsigned long start,
28 unsigned long end) { }
21 29
22#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 30static inline void copy_to_user_page(struct vm_area_struct *vma,
23 memcpy((dst), (src), (len)) 31 struct page *page, unsigned long vaddr,
24#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 32 void *dst, const void *src,
25 memcpy((dst), (src), (len)) 33 unsigned long len)
34{
35 memcpy(dst, src, len);
36}
37
38static inline void copy_from_user_page(struct vm_area_struct *vma,
39 struct page *page, unsigned long vaddr,
40 void *dst, const void *src,
41 unsigned long len)
42{
43 memcpy(dst, src, len);
44}
26 45
27#define PG_non_WB PG_arch_1 46#define PG_non_WB PG_arch_1
28PAGEFLAG(NonWB, non_WB) 47PAGEFLAG(NonWB, non_WB)
diff --git a/arch/x86/include/asm/calling.h b/arch/x86/include/asm/calling.h
index 2bc162e0ec6e..0e63c9a2a8d0 100644
--- a/arch/x86/include/asm/calling.h
+++ b/arch/x86/include/asm/calling.h
@@ -1,5 +1,55 @@
1/* 1/*
2 * Some macros to handle stack frames in assembly. 2
3 x86 function call convention, 64-bit:
4 -------------------------------------
5 arguments | callee-saved | extra caller-saved | return
6 [callee-clobbered] | | [callee-clobbered] |
7 ---------------------------------------------------------------------------
8 rdi rsi rdx rcx r8-9 | rbx rbp [*] r12-15 | r10-11 | rax, rdx [**]
9
10 ( rsp is obviously invariant across normal function calls. (gcc can 'merge'
11 functions when it sees tail-call optimization possibilities) rflags is
12 clobbered. Leftover arguments are passed over the stack frame.)
13
14 [*] In the frame-pointers case rbp is fixed to the stack frame.
15
16 [**] for struct return values wider than 64 bits the return convention is a
17 bit more complex: up to 128 bits width we return small structures
18 straight in rax, rdx. For structures larger than that (3 words or
19 larger) the caller puts a pointer to an on-stack return struct
20 [allocated in the caller's stack frame] into the first argument - i.e.
21 into rdi. All other arguments shift up by one in this case.
22 Fortunately this case is rare in the kernel.
23
24For 32-bit we have the following conventions - kernel is built with
25-mregparm=3 and -freg-struct-return:
26
27 x86 function calling convention, 32-bit:
28 ----------------------------------------
29 arguments | callee-saved | extra caller-saved | return
30 [callee-clobbered] | | [callee-clobbered] |
31 -------------------------------------------------------------------------
32 eax edx ecx | ebx edi esi ebp [*] | <none> | eax, edx [**]
33
34 ( here too esp is obviously invariant across normal function calls. eflags
35 is clobbered. Leftover arguments are passed over the stack frame. )
36
37 [*] In the frame-pointers case ebp is fixed to the stack frame.
38
39 [**] We build with -freg-struct-return, which on 32-bit means similar
40 semantics as on 64-bit: edx can be used for a second return value
41 (i.e. covering integer and structure sizes up to 64 bits) - after that
42 it gets more complex and more expensive: 3-word or larger struct returns
43 get done in the caller's frame and the pointer to the return struct goes
44 into regparm0, i.e. eax - the other arguments shift up and the
45 function's register parameters degenerate to regparm=2 in essence.
46
47*/
48
49
50/*
51 * 64-bit system call stack frame layout defines and helpers,
52 * for assembly code:
3 */ 53 */
4 54
5#define R15 0 55#define R15 0
@@ -9,7 +59,7 @@
9#define RBP 32 59#define RBP 32
10#define RBX 40 60#define RBX 40
11 61
12/* arguments: interrupts/non tracing syscalls only save upto here*/ 62/* arguments: interrupts/non tracing syscalls only save up to here: */
13#define R11 48 63#define R11 48
14#define R10 56 64#define R10 56
15#define R9 64 65#define R9 64
@@ -22,7 +72,7 @@
22#define ORIG_RAX 120 /* + error_code */ 72#define ORIG_RAX 120 /* + error_code */
23/* end of arguments */ 73/* end of arguments */
24 74
25/* cpu exception frame or undefined in case of fast syscall. */ 75/* cpu exception frame or undefined in case of fast syscall: */
26#define RIP 128 76#define RIP 128
27#define CS 136 77#define CS 136
28#define EFLAGS 144 78#define EFLAGS 144
diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index bae482df6039..b185091bf19c 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -7,6 +7,20 @@
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9 9
10#ifdef CONFIG_SMP
11
12extern void prefill_possible_map(void);
13
14#else /* CONFIG_SMP */
15
16static inline void prefill_possible_map(void) {}
17
18#define cpu_physical_id(cpu) boot_cpu_physical_apicid
19#define safe_smp_processor_id() 0
20#define stack_smp_processor_id() 0
21
22#endif /* CONFIG_SMP */
23
10struct x86_cpu { 24struct x86_cpu {
11 struct cpu cpu; 25 struct cpu cpu;
12}; 26};
@@ -17,4 +31,7 @@ extern void arch_unregister_cpu(int);
17#endif 31#endif
18 32
19DECLARE_PER_CPU(int, cpu_state); 33DECLARE_PER_CPU(int, cpu_state);
34
35extern unsigned int boot_cpu_id;
36
20#endif /* _ASM_X86_CPU_H */ 37#endif /* _ASM_X86_CPU_H */
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 7301e60dc4a8..0beba0d1468d 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -213,6 +213,7 @@ extern const char * const x86_power_flags[32];
213#define cpu_has_xmm boot_cpu_has(X86_FEATURE_XMM) 213#define cpu_has_xmm boot_cpu_has(X86_FEATURE_XMM)
214#define cpu_has_xmm2 boot_cpu_has(X86_FEATURE_XMM2) 214#define cpu_has_xmm2 boot_cpu_has(X86_FEATURE_XMM2)
215#define cpu_has_xmm3 boot_cpu_has(X86_FEATURE_XMM3) 215#define cpu_has_xmm3 boot_cpu_has(X86_FEATURE_XMM3)
216#define cpu_has_aes boot_cpu_has(X86_FEATURE_AES)
216#define cpu_has_ht boot_cpu_has(X86_FEATURE_HT) 217#define cpu_has_ht boot_cpu_has(X86_FEATURE_HT)
217#define cpu_has_mp boot_cpu_has(X86_FEATURE_MP) 218#define cpu_has_mp boot_cpu_has(X86_FEATURE_MP)
218#define cpu_has_nx boot_cpu_has(X86_FEATURE_NX) 219#define cpu_has_nx boot_cpu_has(X86_FEATURE_NX)
diff --git a/arch/x86/include/asm/cpumask.h b/arch/x86/include/asm/cpumask.h
new file mode 100644
index 000000000000..a7f3c75f8ad7
--- /dev/null
+++ b/arch/x86/include/asm/cpumask.h
@@ -0,0 +1,32 @@
1#ifndef _ASM_X86_CPUMASK_H
2#define _ASM_X86_CPUMASK_H
3#ifndef __ASSEMBLY__
4#include <linux/cpumask.h>
5
6#ifdef CONFIG_X86_64
7
8extern cpumask_var_t cpu_callin_mask;
9extern cpumask_var_t cpu_callout_mask;
10extern cpumask_var_t cpu_initialized_mask;
11extern cpumask_var_t cpu_sibling_setup_mask;
12
13extern void setup_cpu_local_masks(void);
14
15#else /* CONFIG_X86_32 */
16
17extern cpumask_t cpu_callin_map;
18extern cpumask_t cpu_callout_map;
19extern cpumask_t cpu_initialized;
20extern cpumask_t cpu_sibling_setup_map;
21
22#define cpu_callin_mask ((struct cpumask *)&cpu_callin_map)
23#define cpu_callout_mask ((struct cpumask *)&cpu_callout_map)
24#define cpu_initialized_mask ((struct cpumask *)&cpu_initialized)
25#define cpu_sibling_setup_mask ((struct cpumask *)&cpu_sibling_setup_map)
26
27static inline void setup_cpu_local_masks(void) { }
28
29#endif /* CONFIG_X86_32 */
30
31#endif /* __ASSEMBLY__ */
32#endif /* _ASM_X86_CPUMASK_H */
diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h
index 0930b4f8d672..c68c361697e1 100644
--- a/arch/x86/include/asm/current.h
+++ b/arch/x86/include/asm/current.h
@@ -1,39 +1,21 @@
1#ifndef _ASM_X86_CURRENT_H 1#ifndef _ASM_X86_CURRENT_H
2#define _ASM_X86_CURRENT_H 2#define _ASM_X86_CURRENT_H
3 3
4#ifdef CONFIG_X86_32
5#include <linux/compiler.h> 4#include <linux/compiler.h>
6#include <asm/percpu.h> 5#include <asm/percpu.h>
7 6
7#ifndef __ASSEMBLY__
8struct task_struct; 8struct task_struct;
9 9
10DECLARE_PER_CPU(struct task_struct *, current_task); 10DECLARE_PER_CPU(struct task_struct *, current_task);
11static __always_inline struct task_struct *get_current(void)
12{
13 return x86_read_percpu(current_task);
14}
15
16#else /* X86_32 */
17
18#ifndef __ASSEMBLY__
19#include <asm/pda.h>
20
21struct task_struct;
22 11
23static __always_inline struct task_struct *get_current(void) 12static __always_inline struct task_struct *get_current(void)
24{ 13{
25 return read_pda(pcurrent); 14 return percpu_read(current_task);
26} 15}
27 16
28#else /* __ASSEMBLY__ */ 17#define current get_current()
29
30#include <asm/asm-offsets.h>
31#define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
32 18
33#endif /* __ASSEMBLY__ */ 19#endif /* __ASSEMBLY__ */
34 20
35#endif /* X86_32 */
36
37#define current get_current()
38
39#endif /* _ASM_X86_CURRENT_H */ 21#endif /* _ASM_X86_CURRENT_H */
diff --git a/arch/x86/include/asm/mach-default/do_timer.h b/arch/x86/include/asm/do_timer.h
index 23ecda0b28a0..23ecda0b28a0 100644
--- a/arch/x86/include/asm/mach-default/do_timer.h
+++ b/arch/x86/include/asm/do_timer.h
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index f51a3ddde01a..83c1bc8d2e8a 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -112,7 +112,7 @@ extern unsigned int vdso_enabled;
112 * now struct_user_regs, they are different) 112 * now struct_user_regs, they are different)
113 */ 113 */
114 114
115#define ELF_CORE_COPY_REGS(pr_reg, regs) \ 115#define ELF_CORE_COPY_REGS_COMMON(pr_reg, regs) \
116do { \ 116do { \
117 pr_reg[0] = regs->bx; \ 117 pr_reg[0] = regs->bx; \
118 pr_reg[1] = regs->cx; \ 118 pr_reg[1] = regs->cx; \
@@ -124,7 +124,6 @@ do { \
124 pr_reg[7] = regs->ds & 0xffff; \ 124 pr_reg[7] = regs->ds & 0xffff; \
125 pr_reg[8] = regs->es & 0xffff; \ 125 pr_reg[8] = regs->es & 0xffff; \
126 pr_reg[9] = regs->fs & 0xffff; \ 126 pr_reg[9] = regs->fs & 0xffff; \
127 savesegment(gs, pr_reg[10]); \
128 pr_reg[11] = regs->orig_ax; \ 127 pr_reg[11] = regs->orig_ax; \
129 pr_reg[12] = regs->ip; \ 128 pr_reg[12] = regs->ip; \
130 pr_reg[13] = regs->cs & 0xffff; \ 129 pr_reg[13] = regs->cs & 0xffff; \
@@ -133,6 +132,18 @@ do { \
133 pr_reg[16] = regs->ss & 0xffff; \ 132 pr_reg[16] = regs->ss & 0xffff; \
134} while (0); 133} while (0);
135 134
135#define ELF_CORE_COPY_REGS(pr_reg, regs) \
136do { \
137 ELF_CORE_COPY_REGS_COMMON(pr_reg, regs);\
138 pr_reg[10] = get_user_gs(regs); \
139} while (0);
140
141#define ELF_CORE_COPY_KERNEL_REGS(pr_reg, regs) \
142do { \
143 ELF_CORE_COPY_REGS_COMMON(pr_reg, regs);\
144 savesegment(gs, pr_reg[10]); \
145} while (0);
146
136#define ELF_PLATFORM (utsname()->machine) 147#define ELF_PLATFORM (utsname()->machine)
137#define set_personality_64bit() do { } while (0) 148#define set_personality_64bit() do { } while (0)
138 149
diff --git a/arch/x86/include/asm/mach-default/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index 6b1add8e31dd..854d538ae857 100644
--- a/arch/x86/include/asm/mach-default/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -9,12 +9,28 @@
9 * is no hardware IRQ pin equivalent for them, they are triggered 9 * is no hardware IRQ pin equivalent for them, they are triggered
10 * through the ICC by us (IPIs) 10 * through the ICC by us (IPIs)
11 */ 11 */
12#ifdef CONFIG_X86_SMP 12#ifdef CONFIG_SMP
13BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) 13BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR)
14BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR)
15BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) 14BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
16BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) 15BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
17BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR) 16BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
17
18BUILD_INTERRUPT3(invalidate_interrupt0,INVALIDATE_TLB_VECTOR_START+0,
19 smp_invalidate_interrupt)
20BUILD_INTERRUPT3(invalidate_interrupt1,INVALIDATE_TLB_VECTOR_START+1,
21 smp_invalidate_interrupt)
22BUILD_INTERRUPT3(invalidate_interrupt2,INVALIDATE_TLB_VECTOR_START+2,
23 smp_invalidate_interrupt)
24BUILD_INTERRUPT3(invalidate_interrupt3,INVALIDATE_TLB_VECTOR_START+3,
25 smp_invalidate_interrupt)
26BUILD_INTERRUPT3(invalidate_interrupt4,INVALIDATE_TLB_VECTOR_START+4,
27 smp_invalidate_interrupt)
28BUILD_INTERRUPT3(invalidate_interrupt5,INVALIDATE_TLB_VECTOR_START+5,
29 smp_invalidate_interrupt)
30BUILD_INTERRUPT3(invalidate_interrupt6,INVALIDATE_TLB_VECTOR_START+6,
31 smp_invalidate_interrupt)
32BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7,
33 smp_invalidate_interrupt)
18#endif 34#endif
19 35
20/* 36/*
@@ -25,10 +41,15 @@ BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
25 * a much simpler SMP time architecture: 41 * a much simpler SMP time architecture:
26 */ 42 */
27#ifdef CONFIG_X86_LOCAL_APIC 43#ifdef CONFIG_X86_LOCAL_APIC
44
28BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR) 45BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR)
29BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) 46BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
30BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) 47BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
31 48
49#ifdef CONFIG_PERF_COUNTERS
50BUILD_INTERRUPT(perf_counter_interrupt, LOCAL_PERF_VECTOR)
51#endif
52
32#ifdef CONFIG_X86_MCE_P4THERMAL 53#ifdef CONFIG_X86_MCE_P4THERMAL
33BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR) 54BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
34#endif 55#endif
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
deleted file mode 100644
index c58b9cc74465..000000000000
--- a/arch/x86/include/asm/es7000/apic.h
+++ /dev/null
@@ -1,242 +0,0 @@
1#ifndef __ASM_ES7000_APIC_H
2#define __ASM_ES7000_APIC_H
3
4#include <linux/gfp.h>
5
6#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
7#define esr_disable (1)
8
9static inline int apic_id_registered(void)
10{
11 return (1);
12}
13
14static inline const cpumask_t *target_cpus_cluster(void)
15{
16 return &CPU_MASK_ALL;
17}
18
19static inline const cpumask_t *target_cpus(void)
20{
21 return &cpumask_of_cpu(smp_processor_id());
22}
23
24#define APIC_DFR_VALUE_CLUSTER (APIC_DFR_CLUSTER)
25#define INT_DELIVERY_MODE_CLUSTER (dest_LowestPrio)
26#define INT_DEST_MODE_CLUSTER (1) /* logical delivery broadcast to all procs */
27#define NO_BALANCE_IRQ_CLUSTER (1)
28
29#define APIC_DFR_VALUE (APIC_DFR_FLAT)
30#define INT_DELIVERY_MODE (dest_Fixed)
31#define INT_DEST_MODE (0) /* phys delivery to target procs */
32#define NO_BALANCE_IRQ (0)
33#undef APIC_DEST_LOGICAL
34#define APIC_DEST_LOGICAL 0x0
35
36static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
37{
38 return 0;
39}
40static inline unsigned long check_apicid_present(int bit)
41{
42 return physid_isset(bit, phys_cpu_present_map);
43}
44
45#define apicid_cluster(apicid) (apicid & 0xF0)
46
47static inline unsigned long calculate_ldr(int cpu)
48{
49 unsigned long id;
50 id = xapic_phys_to_log_apicid(cpu);
51 return (SET_APIC_LOGICAL_ID(id));
52}
53
54/*
55 * Set up the logical destination ID.
56 *
57 * Intel recommends to set DFR, LdR and TPR before enabling
58 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
59 * document number 292116). So here it goes...
60 */
61static inline void init_apic_ldr_cluster(void)
62{
63 unsigned long val;
64 int cpu = smp_processor_id();
65
66 apic_write(APIC_DFR, APIC_DFR_VALUE_CLUSTER);
67 val = calculate_ldr(cpu);
68 apic_write(APIC_LDR, val);
69}
70
71static inline void init_apic_ldr(void)
72{
73 unsigned long val;
74 int cpu = smp_processor_id();
75
76 apic_write(APIC_DFR, APIC_DFR_VALUE);
77 val = calculate_ldr(cpu);
78 apic_write(APIC_LDR, val);
79}
80
81extern int apic_version [MAX_APICS];
82static inline void setup_apic_routing(void)
83{
84 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
85 printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
86 (apic_version[apic] == 0x14) ?
87 "Physical Cluster" : "Logical Cluster",
88 nr_ioapics, cpus_addr(*target_cpus())[0]);
89}
90
91static inline int multi_timer_check(int apic, int irq)
92{
93 return 0;
94}
95
96static inline int apicid_to_node(int logical_apicid)
97{
98 return 0;
99}
100
101
102static inline int cpu_present_to_apicid(int mps_cpu)
103{
104 if (!mps_cpu)
105 return boot_cpu_physical_apicid;
106 else if (mps_cpu < nr_cpu_ids)
107 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
108 else
109 return BAD_APICID;
110}
111
112static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
113{
114 static int id = 0;
115 physid_mask_t mask;
116 mask = physid_mask_of_physid(id);
117 ++id;
118 return mask;
119}
120
121extern u8 cpu_2_logical_apicid[];
122/* Mapping from cpu number to logical apicid */
123static inline int cpu_to_logical_apicid(int cpu)
124{
125#ifdef CONFIG_SMP
126 if (cpu >= nr_cpu_ids)
127 return BAD_APICID;
128 return (int)cpu_2_logical_apicid[cpu];
129#else
130 return logical_smp_processor_id();
131#endif
132}
133
134static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
135{
136 /* For clustered we don't have a good way to do this yet - hack */
137 return physids_promote(0xff);
138}
139
140
141static inline void setup_portio_remap(void)
142{
143}
144
145extern unsigned int boot_cpu_physical_apicid;
146static inline int check_phys_apicid_present(int cpu_physical_apicid)
147{
148 boot_cpu_physical_apicid = read_apic_id();
149 return (1);
150}
151
152static inline unsigned int
153cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
154{
155 int num_bits_set;
156 int cpus_found = 0;
157 int cpu;
158 int apicid;
159
160 num_bits_set = cpumask_weight(cpumask);
161 /* Return id to all */
162 if (num_bits_set == nr_cpu_ids)
163 return 0xFF;
164 /*
165 * The cpus in the mask must all be on the apic cluster. If are not
166 * on the same apicid cluster return default value of TARGET_CPUS.
167 */
168 cpu = cpumask_first(cpumask);
169 apicid = cpu_to_logical_apicid(cpu);
170 while (cpus_found < num_bits_set) {
171 if (cpumask_test_cpu(cpu, cpumask)) {
172 int new_apicid = cpu_to_logical_apicid(cpu);
173 if (apicid_cluster(apicid) !=
174 apicid_cluster(new_apicid)){
175 printk ("%s: Not a valid mask!\n", __func__);
176 return 0xFF;
177 }
178 apicid = new_apicid;
179 cpus_found++;
180 }
181 cpu++;
182 }
183 return apicid;
184}
185
186static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
187{
188 int num_bits_set;
189 int cpus_found = 0;
190 int cpu;
191 int apicid;
192
193 num_bits_set = cpus_weight(*cpumask);
194 /* Return id to all */
195 if (num_bits_set == nr_cpu_ids)
196 return cpu_to_logical_apicid(0);
197 /*
198 * The cpus in the mask must all be on the apic cluster. If are not
199 * on the same apicid cluster return default value of TARGET_CPUS.
200 */
201 cpu = first_cpu(*cpumask);
202 apicid = cpu_to_logical_apicid(cpu);
203 while (cpus_found < num_bits_set) {
204 if (cpu_isset(cpu, *cpumask)) {
205 int new_apicid = cpu_to_logical_apicid(cpu);
206 if (apicid_cluster(apicid) !=
207 apicid_cluster(new_apicid)){
208 printk ("%s: Not a valid mask!\n", __func__);
209 return cpu_to_logical_apicid(0);
210 }
211 apicid = new_apicid;
212 cpus_found++;
213 }
214 cpu++;
215 }
216 return apicid;
217}
218
219
220static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
221 const struct cpumask *andmask)
222{
223 int apicid = cpu_to_logical_apicid(0);
224 cpumask_var_t cpumask;
225
226 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
227 return apicid;
228
229 cpumask_and(cpumask, inmask, andmask);
230 cpumask_and(cpumask, cpumask, cpu_online_mask);
231 apicid = cpu_mask_to_apicid(cpumask);
232
233 free_cpumask_var(cpumask);
234 return apicid;
235}
236
237static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
238{
239 return cpuid_apic >> index_msb;
240}
241
242#endif /* __ASM_ES7000_APIC_H */
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h
deleted file mode 100644
index 8b234a3cb851..000000000000
--- a/arch/x86/include/asm/es7000/apicdef.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ASM_ES7000_APICDEF_H
2#define __ASM_ES7000_APICDEF_H
3
4#define APIC_ID_MASK (0xFF<<24)
5
6static inline unsigned get_apic_id(unsigned long x)
7{
8 return (((x)>>24)&0xFF);
9}
10
11#define GET_APIC_ID(x) get_apic_id(x)
12
13#endif
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
deleted file mode 100644
index 7e8ed24d4b8a..000000000000
--- a/arch/x86/include/asm/es7000/ipi.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef __ASM_ES7000_IPI_H
2#define __ASM_ES7000_IPI_H
3
4void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
6
7static inline void send_IPI_mask(const struct cpumask *mask, int vector)
8{
9 send_IPI_mask_sequence(mask, vector);
10}
11
12static inline void send_IPI_allbutself(int vector)
13{
14 send_IPI_mask_allbutself(cpu_online_mask, vector);
15}
16
17static inline void send_IPI_all(int vector)
18{
19 send_IPI_mask(cpu_online_mask, vector);
20}
21
22#endif /* __ASM_ES7000_IPI_H */
diff --git a/arch/x86/include/asm/es7000/mpparse.h b/arch/x86/include/asm/es7000/mpparse.h
deleted file mode 100644
index c1629b090ec2..000000000000
--- a/arch/x86/include/asm/es7000/mpparse.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef __ASM_ES7000_MPPARSE_H
2#define __ASM_ES7000_MPPARSE_H
3
4#include <linux/acpi.h>
5
6extern int parse_unisys_oem (char *oemptr);
7extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
8extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr);
9extern void setup_unisys(void);
10
11#ifndef CONFIG_X86_GENERICARCH
12extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
13extern int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid);
14#endif
15
16#ifdef CONFIG_ACPI
17
18static inline int es7000_check_dsdt(void)
19{
20 struct acpi_table_header header;
21
22 if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
23 !strncmp(header.oem_id, "UNISYS", 6))
24 return 1;
25 return 0;
26}
27#endif
28
29#endif /* __ASM_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/es7000/wakecpu.h b/arch/x86/include/asm/es7000/wakecpu.h
deleted file mode 100644
index 78f0daaee436..000000000000
--- a/arch/x86/include/asm/es7000/wakecpu.h
+++ /dev/null
@@ -1,37 +0,0 @@
1#ifndef __ASM_ES7000_WAKECPU_H
2#define __ASM_ES7000_WAKECPU_H
3
4#define TRAMPOLINE_PHYS_LOW 0x467
5#define TRAMPOLINE_PHYS_HIGH 0x469
6
7static inline void wait_for_init_deassert(atomic_t *deassert)
8{
9#ifndef CONFIG_ES7000_CLUSTERED_APIC
10 while (!atomic_read(deassert))
11 cpu_relax();
12#endif
13 return;
14}
15
16/* Nothing to do for most platforms, since cleared by the INIT cycle */
17static inline void smp_callin_clear_local_apic(void)
18{
19}
20
21static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
22{
23}
24
25static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
26{
27}
28
29extern void __inquire_remote_apic(int apicid);
30
31static inline void inquire_remote_apic(int apicid)
32{
33 if (apic_verbosity >= APIC_DEBUG)
34 __inquire_remote_apic(apicid);
35}
36
37#endif /* __ASM_MACH_WAKECPU_H */
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 23696d44a0af..63a79c77d220 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -1,11 +1,145 @@
1/*
2 * fixmap.h: compile-time virtual memory allocation
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1998 Ingo Molnar
9 *
10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11 * x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009
12 */
13
1#ifndef _ASM_X86_FIXMAP_H 14#ifndef _ASM_X86_FIXMAP_H
2#define _ASM_X86_FIXMAP_H 15#define _ASM_X86_FIXMAP_H
3 16
17#ifndef __ASSEMBLY__
18#include <linux/kernel.h>
19#include <asm/acpi.h>
20#include <asm/apicdef.h>
21#include <asm/page.h>
22#ifdef CONFIG_X86_32
23#include <linux/threads.h>
24#include <asm/kmap_types.h>
25#else
26#include <asm/vsyscall.h>
27#endif
28
29/*
30 * We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall
31 * uses fixmaps that relies on FIXADDR_TOP for proper address calculation.
32 * Because of this, FIXADDR_TOP x86 integration was left as later work.
33 */
34#ifdef CONFIG_X86_32
35/* used by vmalloc.c, vsyscall.lds.S.
36 *
37 * Leave one empty page between vmalloc'ed areas and
38 * the start of the fixmap.
39 */
40extern unsigned long __FIXADDR_TOP;
41#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
42
43#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO)
44#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1)
45#else
46#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
47
48/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
49#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
50#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
51#endif
52
53
54/*
55 * Here we define all the compile-time 'special' virtual
56 * addresses. The point is to have a constant address at
57 * compile time, but to set the physical address only
58 * in the boot process.
59 * for x86_32: We allocate these special addresses
60 * from the end of virtual memory (0xfffff000) backwards.
61 * Also this lets us do fail-safe vmalloc(), we
62 * can guarantee that these special addresses and
63 * vmalloc()-ed addresses never overlap.
64 *
65 * These 'compile-time allocated' memory buffers are
66 * fixed-size 4k pages (or larger if used with an increment
67 * higher than 1). Use set_fixmap(idx,phys) to associate
68 * physical memory with fixmap indices.
69 *
70 * TLB entries of such buffers will not be flushed across
71 * task switches.
72 */
73enum fixed_addresses {
4#ifdef CONFIG_X86_32 74#ifdef CONFIG_X86_32
5# include "fixmap_32.h" 75 FIX_HOLE,
76 FIX_VDSO,
6#else 77#else
7# include "fixmap_64.h" 78 VSYSCALL_LAST_PAGE,
79 VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE
80 + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
81 VSYSCALL_HPET,
8#endif 82#endif
83 FIX_DBGP_BASE,
84 FIX_EARLYCON_MEM_BASE,
85#ifdef CONFIG_X86_LOCAL_APIC
86 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
87#endif
88#ifdef CONFIG_X86_IO_APIC
89 FIX_IO_APIC_BASE_0,
90 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
91#endif
92#ifdef CONFIG_X86_VISWS_APIC
93 FIX_CO_CPU, /* Cobalt timer */
94 FIX_CO_APIC, /* Cobalt APIC Redirection Table */
95 FIX_LI_PCIA, /* Lithium PCI Bridge A */
96 FIX_LI_PCIB, /* Lithium PCI Bridge B */
97#endif
98#ifdef CONFIG_X86_F00F_BUG
99 FIX_F00F_IDT, /* Virtual mapping for IDT */
100#endif
101#ifdef CONFIG_X86_CYCLONE_TIMER
102 FIX_CYCLONE_TIMER, /*cyclone timer register*/
103#endif
104#ifdef CONFIG_X86_32
105 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
106 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
107#ifdef CONFIG_PCI_MMCONFIG
108 FIX_PCIE_MCFG,
109#endif
110#endif
111#ifdef CONFIG_PARAVIRT
112 FIX_PARAVIRT_BOOTMAP,
113#endif
114 __end_of_permanent_fixed_addresses,
115#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
116 FIX_OHCI1394_BASE,
117#endif
118 /*
119 * 256 temporary boot-time mappings, used by early_ioremap(),
120 * before ioremap() is functional.
121 *
122 * We round it up to the next 256 pages boundary so that we
123 * can have a single pgd entry and a single pte table:
124 */
125#define NR_FIX_BTMAPS 64
126#define FIX_BTMAPS_SLOTS 4
127 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
128 (__end_of_permanent_fixed_addresses & 255),
129 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
130#ifdef CONFIG_X86_32
131 FIX_WP_TEST,
132#endif
133 __end_of_fixed_addresses
134};
135
136
137extern void reserve_top_address(unsigned long reserve);
138
139#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
140#define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
141#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
142#define FIXADDR_BOOT_START (FIXADDR_TOP - FIXADDR_BOOT_SIZE)
9 143
10extern int fixmaps_set; 144extern int fixmaps_set;
11 145
@@ -69,4 +203,5 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)
69 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); 203 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
70 return __virt_to_fix(vaddr); 204 return __virt_to_fix(vaddr);
71} 205}
206#endif /* !__ASSEMBLY__ */
72#endif /* _ASM_X86_FIXMAP_H */ 207#endif /* _ASM_X86_FIXMAP_H */
diff --git a/arch/x86/include/asm/fixmap_32.h b/arch/x86/include/asm/fixmap_32.h
deleted file mode 100644
index c7115c1d7217..000000000000
--- a/arch/x86/include/asm/fixmap_32.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/*
2 * fixmap.h: compile-time virtual memory allocation
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1998 Ingo Molnar
9 *
10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11 */
12
13#ifndef _ASM_X86_FIXMAP_32_H
14#define _ASM_X86_FIXMAP_32_H
15
16
17/* used by vmalloc.c, vsyscall.lds.S.
18 *
19 * Leave one empty page between vmalloc'ed areas and
20 * the start of the fixmap.
21 */
22extern unsigned long __FIXADDR_TOP;
23#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO)
24#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1)
25
26#ifndef __ASSEMBLY__
27#include <linux/kernel.h>
28#include <asm/acpi.h>
29#include <asm/apicdef.h>
30#include <asm/page.h>
31#include <linux/threads.h>
32#include <asm/kmap_types.h>
33
34/*
35 * Here we define all the compile-time 'special' virtual
36 * addresses. The point is to have a constant address at
37 * compile time, but to set the physical address only
38 * in the boot process. We allocate these special addresses
39 * from the end of virtual memory (0xfffff000) backwards.
40 * Also this lets us do fail-safe vmalloc(), we
41 * can guarantee that these special addresses and
42 * vmalloc()-ed addresses never overlap.
43 *
44 * these 'compile-time allocated' memory buffers are
45 * fixed-size 4k pages. (or larger if used with an increment
46 * highger than 1) use fixmap_set(idx,phys) to associate
47 * physical memory with fixmap indices.
48 *
49 * TLB entries of such buffers will not be flushed across
50 * task switches.
51 */
52enum fixed_addresses {
53 FIX_HOLE,
54 FIX_VDSO,
55 FIX_DBGP_BASE,
56 FIX_EARLYCON_MEM_BASE,
57#ifdef CONFIG_X86_LOCAL_APIC
58 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
59#endif
60#ifdef CONFIG_X86_IO_APIC
61 FIX_IO_APIC_BASE_0,
62 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1,
63#endif
64#ifdef CONFIG_X86_VISWS_APIC
65 FIX_CO_CPU, /* Cobalt timer */
66 FIX_CO_APIC, /* Cobalt APIC Redirection Table */
67 FIX_LI_PCIA, /* Lithium PCI Bridge A */
68 FIX_LI_PCIB, /* Lithium PCI Bridge B */
69#endif
70#ifdef CONFIG_X86_F00F_BUG
71 FIX_F00F_IDT, /* Virtual mapping for IDT */
72#endif
73#ifdef CONFIG_X86_CYCLONE_TIMER
74 FIX_CYCLONE_TIMER, /*cyclone timer register*/
75#endif
76 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
77 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
78#ifdef CONFIG_PCI_MMCONFIG
79 FIX_PCIE_MCFG,
80#endif
81#ifdef CONFIG_PARAVIRT
82 FIX_PARAVIRT_BOOTMAP,
83#endif
84 __end_of_permanent_fixed_addresses,
85 /*
86 * 256 temporary boot-time mappings, used by early_ioremap(),
87 * before ioremap() is functional.
88 *
89 * We round it up to the next 256 pages boundary so that we
90 * can have a single pgd entry and a single pte table:
91 */
92#define NR_FIX_BTMAPS 64
93#define FIX_BTMAPS_SLOTS 4
94 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
95 (__end_of_permanent_fixed_addresses & 255),
96 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
97 FIX_WP_TEST,
98#ifdef CONFIG_ACPI
99 FIX_ACPI_BEGIN,
100 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
101#endif
102#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
103 FIX_OHCI1394_BASE,
104#endif
105 __end_of_fixed_addresses
106};
107
108extern void reserve_top_address(unsigned long reserve);
109
110
111#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
112
113#define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
114#define __FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
115#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
116#define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE)
117
118#endif /* !__ASSEMBLY__ */
119#endif /* _ASM_X86_FIXMAP_32_H */
diff --git a/arch/x86/include/asm/fixmap_64.h b/arch/x86/include/asm/fixmap_64.h
deleted file mode 100644
index 8be740977db8..000000000000
--- a/arch/x86/include/asm/fixmap_64.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * fixmap.h: compile-time virtual memory allocation
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1998 Ingo Molnar
9 */
10
11#ifndef _ASM_X86_FIXMAP_64_H
12#define _ASM_X86_FIXMAP_64_H
13
14#include <linux/kernel.h>
15#include <asm/acpi.h>
16#include <asm/apicdef.h>
17#include <asm/page.h>
18#include <asm/vsyscall.h>
19
20/*
21 * Here we define all the compile-time 'special' virtual
22 * addresses. The point is to have a constant address at
23 * compile time, but to set the physical address only
24 * in the boot process.
25 *
26 * These 'compile-time allocated' memory buffers are
27 * fixed-size 4k pages (or larger if used with an increment
28 * higher than 1). Use set_fixmap(idx,phys) to associate
29 * physical memory with fixmap indices.
30 *
31 * TLB entries of such buffers will not be flushed across
32 * task switches.
33 */
34
35enum fixed_addresses {
36 VSYSCALL_LAST_PAGE,
37 VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE
38 + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1,
39 VSYSCALL_HPET,
40 FIX_DBGP_BASE,
41 FIX_EARLYCON_MEM_BASE,
42 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
43 FIX_IO_APIC_BASE_0,
44 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
45#ifdef CONFIG_PARAVIRT
46 FIX_PARAVIRT_BOOTMAP,
47#endif
48 __end_of_permanent_fixed_addresses,
49#ifdef CONFIG_ACPI
50 FIX_ACPI_BEGIN,
51 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
52#endif
53#ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT
54 FIX_OHCI1394_BASE,
55#endif
56 /*
57 * 256 temporary boot-time mappings, used by early_ioremap(),
58 * before ioremap() is functional.
59 *
60 * We round it up to the next 256 pages boundary so that we
61 * can have a single pgd entry and a single pte table:
62 */
63#define NR_FIX_BTMAPS 64
64#define FIX_BTMAPS_SLOTS 4
65 FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 -
66 (__end_of_permanent_fixed_addresses & 255),
67 FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1,
68 __end_of_fixed_addresses
69};
70
71#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
72#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
73#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
74
75/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
76#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
77#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
78
79#endif /* _ASM_X86_FIXMAP_64_H */
diff --git a/arch/x86/include/asm/genapic.h b/arch/x86/include/asm/genapic.h
index d48bee663a6f..4b8b98fa7f25 100644
--- a/arch/x86/include/asm/genapic.h
+++ b/arch/x86/include/asm/genapic.h
@@ -1,5 +1 @@
1#ifdef CONFIG_X86_32 #include <asm/apic.h>
2# include "genapic_32.h"
3#else
4# include "genapic_64.h"
5#endif
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h
deleted file mode 100644
index 2c05b737ee22..000000000000
--- a/arch/x86/include/asm/genapic_32.h
+++ /dev/null
@@ -1,148 +0,0 @@
1#ifndef _ASM_X86_GENAPIC_32_H
2#define _ASM_X86_GENAPIC_32_H
3
4#include <asm/mpspec.h>
5#include <asm/atomic.h>
6
7/*
8 * Generic APIC driver interface.
9 *
10 * An straight forward mapping of the APIC related parts of the
11 * x86 subarchitecture interface to a dynamic object.
12 *
13 * This is used by the "generic" x86 subarchitecture.
14 *
15 * Copyright 2003 Andi Kleen, SuSE Labs.
16 */
17
18struct mpc_bus;
19struct mpc_table;
20struct mpc_cpu;
21
22struct genapic {
23 char *name;
24 int (*probe)(void);
25
26 int (*apic_id_registered)(void);
27 const struct cpumask *(*target_cpus)(void);
28 int int_delivery_mode;
29 int int_dest_mode;
30 int ESR_DISABLE;
31 int apic_destination_logical;
32 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
33 unsigned long (*check_apicid_present)(int apicid);
34 int no_balance_irq;
35 int no_ioapic_check;
36 void (*init_apic_ldr)(void);
37 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
38
39 void (*setup_apic_routing)(void);
40 int (*multi_timer_check)(int apic, int irq);
41 int (*apicid_to_node)(int logical_apicid);
42 int (*cpu_to_logical_apicid)(int cpu);
43 int (*cpu_present_to_apicid)(int mps_cpu);
44 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
45 void (*setup_portio_remap)(void);
46 int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
47 void (*enable_apic_mode)(void);
48 u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
49
50 /* mpparse */
51 /* When one of the next two hooks returns 1 the genapic
52 is switched to this. Essentially they are additional probe
53 functions. */
54 int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
55 char *productid);
56 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
57
58 unsigned (*get_apic_id)(unsigned long x);
59 unsigned long apic_id_mask;
60 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
61 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
62 const struct cpumask *andmask);
63 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
64
65#ifdef CONFIG_SMP
66 /* ipi */
67 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
68 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
69 int vector);
70 void (*send_IPI_allbutself)(int vector);
71 void (*send_IPI_all)(int vector);
72#endif
73 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
74 int trampoline_phys_low;
75 int trampoline_phys_high;
76 void (*wait_for_init_deassert)(atomic_t *deassert);
77 void (*smp_callin_clear_local_apic)(void);
78 void (*store_NMI_vector)(unsigned short *high, unsigned short *low);
79 void (*restore_NMI_vector)(unsigned short *high, unsigned short *low);
80 void (*inquire_remote_apic)(int apicid);
81};
82
83#define APICFUNC(x) .x = x,
84
85/* More functions could be probably marked IPIFUNC and save some space
86 in UP GENERICARCH kernels, but I don't have the nerve right now
87 to untangle this mess. -AK */
88#ifdef CONFIG_SMP
89#define IPIFUNC(x) APICFUNC(x)
90#else
91#define IPIFUNC(x)
92#endif
93
94#define APIC_INIT(aname, aprobe) \
95{ \
96 .name = aname, \
97 .probe = aprobe, \
98 .int_delivery_mode = INT_DELIVERY_MODE, \
99 .int_dest_mode = INT_DEST_MODE, \
100 .no_balance_irq = NO_BALANCE_IRQ, \
101 .ESR_DISABLE = esr_disable, \
102 .apic_destination_logical = APIC_DEST_LOGICAL, \
103 APICFUNC(apic_id_registered) \
104 APICFUNC(target_cpus) \
105 APICFUNC(check_apicid_used) \
106 APICFUNC(check_apicid_present) \
107 APICFUNC(init_apic_ldr) \
108 APICFUNC(ioapic_phys_id_map) \
109 APICFUNC(setup_apic_routing) \
110 APICFUNC(multi_timer_check) \
111 APICFUNC(apicid_to_node) \
112 APICFUNC(cpu_to_logical_apicid) \
113 APICFUNC(cpu_present_to_apicid) \
114 APICFUNC(apicid_to_cpu_present) \
115 APICFUNC(setup_portio_remap) \
116 APICFUNC(check_phys_apicid_present) \
117 APICFUNC(mps_oem_check) \
118 APICFUNC(get_apic_id) \
119 .apic_id_mask = APIC_ID_MASK, \
120 APICFUNC(cpu_mask_to_apicid) \
121 APICFUNC(cpu_mask_to_apicid_and) \
122 APICFUNC(vector_allocation_domain) \
123 APICFUNC(acpi_madt_oem_check) \
124 IPIFUNC(send_IPI_mask) \
125 IPIFUNC(send_IPI_allbutself) \
126 IPIFUNC(send_IPI_all) \
127 APICFUNC(enable_apic_mode) \
128 APICFUNC(phys_pkg_id) \
129 .trampoline_phys_low = TRAMPOLINE_PHYS_LOW, \
130 .trampoline_phys_high = TRAMPOLINE_PHYS_HIGH, \
131 APICFUNC(wait_for_init_deassert) \
132 APICFUNC(smp_callin_clear_local_apic) \
133 APICFUNC(store_NMI_vector) \
134 APICFUNC(restore_NMI_vector) \
135 APICFUNC(inquire_remote_apic) \
136}
137
138extern struct genapic *genapic;
139extern void es7000_update_genapic_to_cluster(void);
140
141enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
142#define get_uv_system_type() UV_NONE
143#define is_uv_system() 0
144#define uv_wakeup_secondary(a, b) 1
145#define uv_system_init() do {} while (0)
146
147
148#endif /* _ASM_X86_GENAPIC_32_H */
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h
deleted file mode 100644
index adf32fb56aa6..000000000000
--- a/arch/x86/include/asm/genapic_64.h
+++ /dev/null
@@ -1,66 +0,0 @@
1#ifndef _ASM_X86_GENAPIC_64_H
2#define _ASM_X86_GENAPIC_64_H
3
4#include <linux/cpumask.h>
5
6/*
7 * Copyright 2004 James Cleverdon, IBM.
8 * Subject to the GNU Public License, v.2
9 *
10 * Generic APIC sub-arch data struct.
11 *
12 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
13 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
14 * James Cleverdon.
15 */
16
17struct genapic {
18 char *name;
19 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
20 u32 int_delivery_mode;
21 u32 int_dest_mode;
22 int (*apic_id_registered)(void);
23 const struct cpumask *(*target_cpus)(void);
24 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
25 void (*init_apic_ldr)(void);
26 /* ipi */
27 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
28 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
29 int vector);
30 void (*send_IPI_allbutself)(int vector);
31 void (*send_IPI_all)(int vector);
32 void (*send_IPI_self)(int vector);
33 /* */
34 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
35 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
36 const struct cpumask *andmask);
37 unsigned int (*phys_pkg_id)(int index_msb);
38 unsigned int (*get_apic_id)(unsigned long x);
39 unsigned long (*set_apic_id)(unsigned int id);
40 unsigned long apic_id_mask;
41 /* wakeup_secondary_cpu */
42 int (*wakeup_cpu)(int apicid, unsigned long start_eip);
43};
44
45extern struct genapic *genapic;
46
47extern struct genapic apic_flat;
48extern struct genapic apic_physflat;
49extern struct genapic apic_x2apic_cluster;
50extern struct genapic apic_x2apic_phys;
51extern int acpi_madt_oem_check(char *, char *);
52
53extern void apic_send_IPI_self(int vector);
54enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
55extern enum uv_system_type get_uv_system_type(void);
56extern int is_uv_system(void);
57
58extern struct genapic apic_x2apic_uv_x;
59DECLARE_PER_CPU(int, x2apic_extra_bits);
60extern void uv_cpu_init(void);
61extern void uv_system_init(void);
62extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip);
63
64extern void setup_apic_routing(void);
65
66#endif /* _ASM_X86_GENAPIC_64_H */
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index 000787df66e6..176f058e7159 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -1,11 +1,52 @@
1#ifdef CONFIG_X86_32 1#ifndef _ASM_X86_HARDIRQ_H
2# include "hardirq_32.h" 2#define _ASM_X86_HARDIRQ_H
3#else 3
4# include "hardirq_64.h" 4#include <linux/threads.h>
5#include <linux/irq.h>
6
7typedef struct {
8 unsigned int __softirq_pending;
9 unsigned int __nmi_count; /* arch dependent */
10 unsigned int irq0_irqs;
11#ifdef CONFIG_X86_LOCAL_APIC
12 unsigned int apic_timer_irqs; /* arch dependent */
13 unsigned int irq_spurious_count;
14#endif
15#ifdef CONFIG_SMP
16 unsigned int irq_resched_count;
17 unsigned int irq_call_count;
18 unsigned int irq_tlb_count;
19#endif
20#ifdef CONFIG_X86_MCE
21 unsigned int irq_thermal_count;
22# ifdef CONFIG_X86_64
23 unsigned int irq_threshold_count;
24# endif
5#endif 25#endif
26} ____cacheline_aligned irq_cpustat_t;
27
28DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
29
30/* We can have at most NR_VECTORS irqs routed to a cpu at a time */
31#define MAX_HARDIRQS_PER_CPU NR_VECTORS
32
33#define __ARCH_IRQ_STAT
34
35#define inc_irq_stat(member) percpu_add(irq_stat.member, 1)
36
37#define local_softirq_pending() percpu_read(irq_stat.__softirq_pending)
38
39#define __ARCH_SET_SOFTIRQ_PENDING
40
41#define set_softirq_pending(x) percpu_write(irq_stat.__softirq_pending, (x))
42#define or_softirq_pending(x) percpu_or(irq_stat.__softirq_pending, (x))
43
44extern void ack_bad_irq(unsigned int irq);
6 45
7extern u64 arch_irq_stat_cpu(unsigned int cpu); 46extern u64 arch_irq_stat_cpu(unsigned int cpu);
8#define arch_irq_stat_cpu arch_irq_stat_cpu 47#define arch_irq_stat_cpu arch_irq_stat_cpu
9 48
10extern u64 arch_irq_stat(void); 49extern u64 arch_irq_stat(void);
11#define arch_irq_stat arch_irq_stat 50#define arch_irq_stat arch_irq_stat
51
52#endif /* _ASM_X86_HARDIRQ_H */
diff --git a/arch/x86/include/asm/hardirq_32.h b/arch/x86/include/asm/hardirq_32.h
deleted file mode 100644
index cf7954d1405f..000000000000
--- a/arch/x86/include/asm/hardirq_32.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef _ASM_X86_HARDIRQ_32_H
2#define _ASM_X86_HARDIRQ_32_H
3
4#include <linux/threads.h>
5#include <linux/irq.h>
6
7typedef struct {
8 unsigned int __softirq_pending;
9 unsigned long idle_timestamp;
10 unsigned int __nmi_count; /* arch dependent */
11 unsigned int apic_timer_irqs; /* arch dependent */
12 unsigned int irq0_irqs;
13 unsigned int irq_resched_count;
14 unsigned int irq_call_count;
15 unsigned int irq_tlb_count;
16 unsigned int irq_thermal_count;
17 unsigned int irq_spurious_count;
18} ____cacheline_aligned irq_cpustat_t;
19
20DECLARE_PER_CPU(irq_cpustat_t, irq_stat);
21
22#define __ARCH_IRQ_STAT
23#define __IRQ_STAT(cpu, member) (per_cpu(irq_stat, cpu).member)
24
25#define inc_irq_stat(member) (__get_cpu_var(irq_stat).member++)
26
27void ack_bad_irq(unsigned int irq);
28#include <linux/irq_cpustat.h>
29
30#endif /* _ASM_X86_HARDIRQ_32_H */
diff --git a/arch/x86/include/asm/hardirq_64.h b/arch/x86/include/asm/hardirq_64.h
deleted file mode 100644
index b5a6b5d56704..000000000000
--- a/arch/x86/include/asm/hardirq_64.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef _ASM_X86_HARDIRQ_64_H
2#define _ASM_X86_HARDIRQ_64_H
3
4#include <linux/threads.h>
5#include <linux/irq.h>
6#include <asm/pda.h>
7#include <asm/apic.h>
8
9/* We can have at most NR_VECTORS irqs routed to a cpu at a time */
10#define MAX_HARDIRQS_PER_CPU NR_VECTORS
11
12#define __ARCH_IRQ_STAT 1
13
14#define inc_irq_stat(member) add_pda(member, 1)
15
16#define local_softirq_pending() read_pda(__softirq_pending)
17
18#define __ARCH_SET_SOFTIRQ_PENDING 1
19
20#define set_softirq_pending(x) write_pda(__softirq_pending, (x))
21#define or_softirq_pending(x) or_pda(__softirq_pending, (x))
22
23extern void ack_bad_irq(unsigned int irq);
24
25#endif /* _ASM_X86_HARDIRQ_64_H */
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 8de644b6b959..370e1c83bb49 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -25,8 +25,6 @@
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <asm/sections.h> 26#include <asm/sections.h>
27 27
28#define platform_legacy_irq(irq) ((irq) < 16)
29
30/* Interrupt handlers registered during init_IRQ */ 28/* Interrupt handlers registered during init_IRQ */
31extern void apic_timer_interrupt(void); 29extern void apic_timer_interrupt(void);
32extern void error_interrupt(void); 30extern void error_interrupt(void);
@@ -58,7 +56,7 @@ extern void make_8259A_irq(unsigned int irq);
58extern void init_8259A(int aeoi); 56extern void init_8259A(int aeoi);
59 57
60/* IOAPIC */ 58/* IOAPIC */
61#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) 59#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs))
62extern unsigned long io_apic_irqs; 60extern unsigned long io_apic_irqs;
63 61
64extern void init_VISWS_APIC_irqs(void); 62extern void init_VISWS_APIC_irqs(void);
@@ -67,15 +65,7 @@ extern void disable_IO_APIC(void);
67extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); 65extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
68extern void setup_ioapic_dest(void); 66extern void setup_ioapic_dest(void);
69 67
70#ifdef CONFIG_X86_64
71extern void enable_IO_APIC(void); 68extern void enable_IO_APIC(void);
72#endif
73
74/* IPI functions */
75#ifdef CONFIG_X86_32
76extern void send_IPI_self(int vector);
77#endif
78extern void send_IPI(int dest, int vector);
79 69
80/* Statistics */ 70/* Statistics */
81extern atomic_t irq_err_count; 71extern atomic_t irq_err_count;
@@ -84,21 +74,11 @@ extern atomic_t irq_mis_count;
84/* EISA */ 74/* EISA */
85extern void eisa_set_level_irq(unsigned int irq); 75extern void eisa_set_level_irq(unsigned int irq);
86 76
87/* Voyager functions */
88extern asmlinkage void vic_cpi_interrupt(void);
89extern asmlinkage void vic_sys_interrupt(void);
90extern asmlinkage void vic_cmn_interrupt(void);
91extern asmlinkage void qic_timer_interrupt(void);
92extern asmlinkage void qic_invalidate_interrupt(void);
93extern asmlinkage void qic_reschedule_interrupt(void);
94extern asmlinkage void qic_enable_irq_interrupt(void);
95extern asmlinkage void qic_call_function_interrupt(void);
96
97/* SMP */ 77/* SMP */
98extern void smp_apic_timer_interrupt(struct pt_regs *); 78extern void smp_apic_timer_interrupt(struct pt_regs *);
99extern void smp_spurious_interrupt(struct pt_regs *); 79extern void smp_spurious_interrupt(struct pt_regs *);
100extern void smp_error_interrupt(struct pt_regs *); 80extern void smp_error_interrupt(struct pt_regs *);
101#ifdef CONFIG_X86_SMP 81#ifdef CONFIG_SMP
102extern void smp_reschedule_interrupt(struct pt_regs *); 82extern void smp_reschedule_interrupt(struct pt_regs *);
103extern void smp_call_function_interrupt(struct pt_regs *); 83extern void smp_call_function_interrupt(struct pt_regs *);
104extern void smp_call_function_single_interrupt(struct pt_regs *); 84extern void smp_call_function_single_interrupt(struct pt_regs *);
diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h
index 58d7091eeb1f..1a99e6c092af 100644
--- a/arch/x86/include/asm/i8259.h
+++ b/arch/x86/include/asm/i8259.h
@@ -60,4 +60,8 @@ extern struct irq_chip i8259A_chip;
60extern void mask_8259A(void); 60extern void mask_8259A(void);
61extern void unmask_8259A(void); 61extern void unmask_8259A(void);
62 62
63#ifdef CONFIG_X86_32
64extern void init_ISA_irqs(void);
65#endif
66
63#endif /* _ASM_X86_I8259_H */ 67#endif /* _ASM_X86_I8259_H */
diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h
index 50ca486fd88c..1f7e62517284 100644
--- a/arch/x86/include/asm/ia32.h
+++ b/arch/x86/include/asm/ia32.h
@@ -129,13 +129,6 @@ typedef struct compat_siginfo {
129 } _sifields; 129 } _sifields;
130} compat_siginfo_t; 130} compat_siginfo_t;
131 131
132struct ustat32 {
133 __u32 f_tfree;
134 compat_ino_t f_tinode;
135 char f_fname[6];
136 char f_fpack[6];
137};
138
139#define IA32_STACK_TOP IA32_PAGE_OFFSET 132#define IA32_STACK_TOP IA32_PAGE_OFFSET
140 133
141#ifdef __KERNEL__ 134#ifdef __KERNEL__
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 1dbbdf4be9b4..e5383e3d2f8c 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -5,6 +5,7 @@
5 5
6#include <linux/compiler.h> 6#include <linux/compiler.h>
7#include <asm-generic/int-ll64.h> 7#include <asm-generic/int-ll64.h>
8#include <asm/page.h>
8 9
9#define build_mmio_read(name, size, type, reg, barrier) \ 10#define build_mmio_read(name, size, type, reg, barrier) \
10static inline type name(const volatile void __iomem *addr) \ 11static inline type name(const volatile void __iomem *addr) \
@@ -80,6 +81,98 @@ static inline void writeq(__u64 val, volatile void __iomem *addr)
80#define readq readq 81#define readq readq
81#define writeq writeq 82#define writeq writeq
82 83
84/**
85 * virt_to_phys - map virtual addresses to physical
86 * @address: address to remap
87 *
88 * The returned physical address is the physical (CPU) mapping for
89 * the memory address given. It is only valid to use this function on
90 * addresses directly mapped or allocated via kmalloc.
91 *
92 * This function does not give bus mappings for DMA transfers. In
93 * almost all conceivable cases a device driver should not be using
94 * this function
95 */
96
97static inline phys_addr_t virt_to_phys(volatile void *address)
98{
99 return __pa(address);
100}
101
102/**
103 * phys_to_virt - map physical address to virtual
104 * @address: address to remap
105 *
106 * The returned virtual address is a current CPU mapping for
107 * the memory address given. It is only valid to use this function on
108 * addresses that have a kernel mapping
109 *
110 * This function does not handle bus mappings for DMA transfers. In
111 * almost all conceivable cases a device driver should not be using
112 * this function
113 */
114
115static inline void *phys_to_virt(phys_addr_t address)
116{
117 return __va(address);
118}
119
120/*
121 * Change "struct page" to physical address.
122 */
123#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
124
125/*
126 * ISA I/O bus memory addresses are 1:1 with the physical address.
127 * However, we truncate the address to unsigned int to avoid undesirable
128 * promitions in legacy drivers.
129 */
130static inline unsigned int isa_virt_to_bus(volatile void *address)
131{
132 return (unsigned int)virt_to_phys(address);
133}
134#define isa_page_to_bus(page) ((unsigned int)page_to_phys(page))
135#define isa_bus_to_virt phys_to_virt
136
137/*
138 * However PCI ones are not necessarily 1:1 and therefore these interfaces
139 * are forbidden in portable PCI drivers.
140 *
141 * Allow them on x86 for legacy drivers, though.
142 */
143#define virt_to_bus virt_to_phys
144#define bus_to_virt phys_to_virt
145
146/**
147 * ioremap - map bus memory into CPU space
148 * @offset: bus address of the memory
149 * @size: size of the resource to map
150 *
151 * ioremap performs a platform specific sequence of operations to
152 * make bus memory CPU accessible via the readb/readw/readl/writeb/
153 * writew/writel functions and the other mmio helpers. The returned
154 * address is not guaranteed to be usable directly as a virtual
155 * address.
156 *
157 * If the area you are trying to map is a PCI BAR you should have a
158 * look at pci_iomap().
159 */
160extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
161extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
162extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
163 unsigned long prot_val);
164
165/*
166 * The default ioremap() behavior is non-cached:
167 */
168static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
169{
170 return ioremap_nocache(offset, size);
171}
172
173extern void iounmap(volatile void __iomem *addr);
174
175
83#ifdef CONFIG_X86_32 176#ifdef CONFIG_X86_32
84# include "io_32.h" 177# include "io_32.h"
85#else 178#else
@@ -91,7 +184,7 @@ extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr);
91 184
92extern int ioremap_change_attr(unsigned long vaddr, unsigned long size, 185extern int ioremap_change_attr(unsigned long vaddr, unsigned long size,
93 unsigned long prot_val); 186 unsigned long prot_val);
94extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size); 187extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size);
95 188
96/* 189/*
97 * early_ioremap() and early_iounmap() are for temporary early boot-time 190 * early_ioremap() and early_iounmap() are for temporary early boot-time
@@ -103,7 +196,7 @@ extern void early_ioremap_reset(void);
103extern void __iomem *early_ioremap(unsigned long offset, unsigned long size); 196extern void __iomem *early_ioremap(unsigned long offset, unsigned long size);
104extern void __iomem *early_memremap(unsigned long offset, unsigned long size); 197extern void __iomem *early_memremap(unsigned long offset, unsigned long size);
105extern void early_iounmap(void __iomem *addr, unsigned long size); 198extern void early_iounmap(void __iomem *addr, unsigned long size);
106extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
107 199
200#define IO_SPACE_LIMIT 0xffff
108 201
109#endif /* _ASM_X86_IO_H */ 202#endif /* _ASM_X86_IO_H */
diff --git a/arch/x86/include/asm/io_32.h b/arch/x86/include/asm/io_32.h
index d8e242e1b396..a299900f5920 100644
--- a/arch/x86/include/asm/io_32.h
+++ b/arch/x86/include/asm/io_32.h
@@ -37,8 +37,6 @@
37 * - Arnaldo Carvalho de Melo <acme@conectiva.com.br> 37 * - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
38 */ 38 */
39 39
40#define IO_SPACE_LIMIT 0xffff
41
42#define XQUAD_PORTIO_BASE 0xfe400000 40#define XQUAD_PORTIO_BASE 0xfe400000
43#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */ 41#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
44 42
@@ -53,92 +51,6 @@
53 */ 51 */
54#define xlate_dev_kmem_ptr(p) p 52#define xlate_dev_kmem_ptr(p) p
55 53
56/**
57 * virt_to_phys - map virtual addresses to physical
58 * @address: address to remap
59 *
60 * The returned physical address is the physical (CPU) mapping for
61 * the memory address given. It is only valid to use this function on
62 * addresses directly mapped or allocated via kmalloc.
63 *
64 * This function does not give bus mappings for DMA transfers. In
65 * almost all conceivable cases a device driver should not be using
66 * this function
67 */
68
69static inline unsigned long virt_to_phys(volatile void *address)
70{
71 return __pa(address);
72}
73
74/**
75 * phys_to_virt - map physical address to virtual
76 * @address: address to remap
77 *
78 * The returned virtual address is a current CPU mapping for
79 * the memory address given. It is only valid to use this function on
80 * addresses that have a kernel mapping
81 *
82 * This function does not handle bus mappings for DMA transfers. In
83 * almost all conceivable cases a device driver should not be using
84 * this function
85 */
86
87static inline void *phys_to_virt(unsigned long address)
88{
89 return __va(address);
90}
91
92/*
93 * Change "struct page" to physical address.
94 */
95#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
96
97/**
98 * ioremap - map bus memory into CPU space
99 * @offset: bus address of the memory
100 * @size: size of the resource to map
101 *
102 * ioremap performs a platform specific sequence of operations to
103 * make bus memory CPU accessible via the readb/readw/readl/writeb/
104 * writew/writel functions and the other mmio helpers. The returned
105 * address is not guaranteed to be usable directly as a virtual
106 * address.
107 *
108 * If the area you are trying to map is a PCI BAR you should have a
109 * look at pci_iomap().
110 */
111extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
112extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
113extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
114 unsigned long prot_val);
115
116/*
117 * The default ioremap() behavior is non-cached:
118 */
119static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
120{
121 return ioremap_nocache(offset, size);
122}
123
124extern void iounmap(volatile void __iomem *addr);
125
126/*
127 * ISA I/O bus memory addresses are 1:1 with the physical address.
128 */
129#define isa_virt_to_bus virt_to_phys
130#define isa_page_to_bus page_to_phys
131#define isa_bus_to_virt phys_to_virt
132
133/*
134 * However PCI ones are not necessarily 1:1 and therefore these interfaces
135 * are forbidden in portable PCI drivers.
136 *
137 * Allow them on x86 for legacy drivers, though.
138 */
139#define virt_to_bus virt_to_phys
140#define bus_to_virt phys_to_virt
141
142static inline void 54static inline void
143memset_io(volatile void __iomem *addr, unsigned char val, int count) 55memset_io(volatile void __iomem *addr, unsigned char val, int count)
144{ 56{
diff --git a/arch/x86/include/asm/io_64.h b/arch/x86/include/asm/io_64.h
index 563c16270ba6..244067893af4 100644
--- a/arch/x86/include/asm/io_64.h
+++ b/arch/x86/include/asm/io_64.h
@@ -136,73 +136,12 @@ __OUTS(b)
136__OUTS(w) 136__OUTS(w)
137__OUTS(l) 137__OUTS(l)
138 138
139#define IO_SPACE_LIMIT 0xffff
140
141#if defined(__KERNEL__) && defined(__x86_64__) 139#if defined(__KERNEL__) && defined(__x86_64__)
142 140
143#include <linux/vmalloc.h> 141#include <linux/vmalloc.h>
144 142
145#ifndef __i386__
146/*
147 * Change virtual addresses to physical addresses and vv.
148 * These are pretty trivial
149 */
150static inline unsigned long virt_to_phys(volatile void *address)
151{
152 return __pa(address);
153}
154
155static inline void *phys_to_virt(unsigned long address)
156{
157 return __va(address);
158}
159#endif
160
161/*
162 * Change "struct page" to physical address.
163 */
164#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
165
166#include <asm-generic/iomap.h> 143#include <asm-generic/iomap.h>
167 144
168/*
169 * This one maps high address device memory and turns off caching for that area.
170 * it's useful if some control registers are in such an area and write combining
171 * or read caching is not desirable:
172 */
173extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
174extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
175extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
176 unsigned long prot_val);
177
178/*
179 * The default ioremap() behavior is non-cached:
180 */
181static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
182{
183 return ioremap_nocache(offset, size);
184}
185
186extern void iounmap(volatile void __iomem *addr);
187
188extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
189
190/*
191 * ISA I/O bus memory addresses are 1:1 with the physical address.
192 */
193#define isa_virt_to_bus virt_to_phys
194#define isa_page_to_bus page_to_phys
195#define isa_bus_to_virt phys_to_virt
196
197/*
198 * However PCI ones are not necessarily 1:1 and therefore these interfaces
199 * are forbidden in portable PCI drivers.
200 *
201 * Allow them on x86 for legacy drivers, though.
202 */
203#define virt_to_bus virt_to_phys
204#define bus_to_virt phys_to_virt
205
206void __memcpy_fromio(void *, unsigned long, unsigned); 145void __memcpy_fromio(void *, unsigned long, unsigned);
207void __memcpy_toio(unsigned long, const void *, unsigned); 146void __memcpy_toio(unsigned long, const void *, unsigned);
208 147
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index 7a1f44ac1f17..59cb4a1317b7 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -114,38 +114,16 @@ struct IR_IO_APIC_route_entry {
114extern int nr_ioapics; 114extern int nr_ioapics;
115extern int nr_ioapic_registers[MAX_IO_APICS]; 115extern int nr_ioapic_registers[MAX_IO_APICS];
116 116
117/*
118 * MP-BIOS irq configuration table structures:
119 */
120
121#define MP_MAX_IOAPIC_PIN 127 117#define MP_MAX_IOAPIC_PIN 127
122 118
123struct mp_config_ioapic {
124 unsigned long mp_apicaddr;
125 unsigned int mp_apicid;
126 unsigned char mp_type;
127 unsigned char mp_apicver;
128 unsigned char mp_flags;
129};
130
131struct mp_config_intsrc {
132 unsigned int mp_dstapic;
133 unsigned char mp_type;
134 unsigned char mp_irqtype;
135 unsigned short mp_irqflag;
136 unsigned char mp_srcbus;
137 unsigned char mp_srcbusirq;
138 unsigned char mp_dstirq;
139};
140
141/* I/O APIC entries */ 119/* I/O APIC entries */
142extern struct mp_config_ioapic mp_ioapics[MAX_IO_APICS]; 120extern struct mpc_ioapic mp_ioapics[MAX_IO_APICS];
143 121
144/* # of MP IRQ source entries */ 122/* # of MP IRQ source entries */
145extern int mp_irq_entries; 123extern int mp_irq_entries;
146 124
147/* MP IRQ source entries */ 125/* MP IRQ source entries */
148extern struct mp_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; 126extern struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES];
149 127
150/* non-0 if default (table-less) MP configuration */ 128/* non-0 if default (table-less) MP configuration */
151extern int mpc_default_type; 129extern int mpc_default_type;
@@ -165,15 +143,6 @@ extern int noioapicreroute;
165/* 1 if the timer IRQ uses the '8259A Virtual Wire' mode */ 143/* 1 if the timer IRQ uses the '8259A Virtual Wire' mode */
166extern int timer_through_8259; 144extern int timer_through_8259;
167 145
168static inline void disable_ioapic_setup(void)
169{
170#ifdef CONFIG_PCI
171 noioapicquirk = 1;
172 noioapicreroute = -1;
173#endif
174 skip_ioapic_setup = 1;
175}
176
177/* 146/*
178 * If we use the IO-APIC for IRQ routing, disable automatic 147 * If we use the IO-APIC for IRQ routing, disable automatic
179 * assignment of PCI IRQ's. 148 * assignment of PCI IRQ's.
@@ -200,6 +169,12 @@ extern void reinit_intr_remapped_IO_APIC(int);
200 169
201extern void probe_nr_irqs_gsi(void); 170extern void probe_nr_irqs_gsi(void);
202 171
172extern int setup_ioapic_entry(int apic, int irq,
173 struct IO_APIC_route_entry *entry,
174 unsigned int destination, int trigger,
175 int polarity, int vector);
176extern void ioapic_write_entry(int apic, int pin,
177 struct IO_APIC_route_entry e);
203#else /* !CONFIG_X86_IO_APIC */ 178#else /* !CONFIG_X86_IO_APIC */
204#define io_apic_assign_pci_irqs 0 179#define io_apic_assign_pci_irqs 0
205static const int timer_through_8259 = 0; 180static const int timer_through_8259 = 0;
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h
index c745a306f7d3..0b7228268a63 100644
--- a/arch/x86/include/asm/ipi.h
+++ b/arch/x86/include/asm/ipi.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_X86_IPI_H 1#ifndef _ASM_X86_IPI_H
2#define _ASM_X86_IPI_H 2#define _ASM_X86_IPI_H
3 3
4#ifdef CONFIG_X86_LOCAL_APIC
5
4/* 6/*
5 * Copyright 2004 James Cleverdon, IBM. 7 * Copyright 2004 James Cleverdon, IBM.
6 * Subject to the GNU Public License, v.2 8 * Subject to the GNU Public License, v.2
@@ -55,8 +57,8 @@ static inline void __xapic_wait_icr_idle(void)
55 cpu_relax(); 57 cpu_relax();
56} 58}
57 59
58static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, 60static inline void
59 unsigned int dest) 61__default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
60{ 62{
61 /* 63 /*
62 * Subtle. In the case of the 'never do double writes' workaround 64 * Subtle. In the case of the 'never do double writes' workaround
@@ -87,8 +89,8 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
87 * This is used to send an IPI with no shorthand notation (the destination is 89 * This is used to send an IPI with no shorthand notation (the destination is
88 * specified in bits 56 to 63 of the ICR). 90 * specified in bits 56 to 63 of the ICR).
89 */ 91 */
90static inline void __send_IPI_dest_field(unsigned int mask, int vector, 92static inline void
91 unsigned int dest) 93 __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest)
92{ 94{
93 unsigned long cfg; 95 unsigned long cfg;
94 96
@@ -117,41 +119,44 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,
117 native_apic_mem_write(APIC_ICR, cfg); 119 native_apic_mem_write(APIC_ICR, cfg);
118} 120}
119 121
120static inline void send_IPI_mask_sequence(const struct cpumask *mask, 122extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask,
121 int vector) 123 int vector);
122{ 124extern void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
123 unsigned long flags; 125 int vector);
124 unsigned long query_cpu; 126extern void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
127 int vector);
128extern void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask,
129 int vector);
125 130
126 /* 131/* Avoid include hell */
127 * Hack. The clustered APIC addressing mode doesn't allow us to send 132#define NMI_VECTOR 0x02
128 * to an arbitrary mask, so I do a unicast to each CPU instead. 133
129 * - mbligh 134extern int no_broadcast;
130 */ 135
131 local_irq_save(flags); 136static inline void __default_local_send_IPI_allbutself(int vector)
132 for_each_cpu(query_cpu, mask) { 137{
133 __send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu), 138 if (no_broadcast || vector == NMI_VECTOR)
134 vector, APIC_DEST_PHYSICAL); 139 apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
135 } 140 else
136 local_irq_restore(flags); 141 __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical);
137} 142}
138 143
139static inline void send_IPI_mask_allbutself(const struct cpumask *mask, 144static inline void __default_local_send_IPI_all(int vector)
140 int vector)
141{ 145{
142 unsigned long flags; 146 if (no_broadcast || vector == NMI_VECTOR)
143 unsigned int query_cpu; 147 apic->send_IPI_mask(cpu_online_mask, vector);
144 unsigned int this_cpu = smp_processor_id(); 148 else
145 149 __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical);
146 /* See Hack comment above */
147
148 local_irq_save(flags);
149 for_each_cpu(query_cpu, mask)
150 if (query_cpu != this_cpu)
151 __send_IPI_dest_field(
152 per_cpu(x86_cpu_to_apicid, query_cpu),
153 vector, APIC_DEST_PHYSICAL);
154 local_irq_restore(flags);
155} 150}
156 151
152#ifdef CONFIG_X86_32
153extern void default_send_IPI_mask_logical(const struct cpumask *mask,
154 int vector);
155extern void default_send_IPI_allbutself(int vector);
156extern void default_send_IPI_all(int vector);
157extern void default_send_IPI_self(int vector);
158#endif
159
160#endif
161
157#endif /* _ASM_X86_IPI_H */ 162#endif /* _ASM_X86_IPI_H */
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 592688ed04d3..107eb2196691 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -36,9 +36,11 @@ static inline int irq_canonicalize(int irq)
36extern void fixup_irqs(void); 36extern void fixup_irqs(void);
37#endif 37#endif
38 38
39extern unsigned int do_IRQ(struct pt_regs *regs);
40extern void init_IRQ(void); 39extern void init_IRQ(void);
41extern void native_init_IRQ(void); 40extern void native_init_IRQ(void);
41extern bool handle_irq(unsigned irq, struct pt_regs *regs);
42
43extern unsigned int do_IRQ(struct pt_regs *regs);
42 44
43/* Interrupt vector management */ 45/* Interrupt vector management */
44extern DECLARE_BITMAP(used_vectors, NR_VECTORS); 46extern DECLARE_BITMAP(used_vectors, NR_VECTORS);
diff --git a/arch/x86/include/asm/irq_regs.h b/arch/x86/include/asm/irq_regs.h
index 89c898ab298b..77843225b7ea 100644
--- a/arch/x86/include/asm/irq_regs.h
+++ b/arch/x86/include/asm/irq_regs.h
@@ -1,5 +1,31 @@
1#ifdef CONFIG_X86_32 1/*
2# include "irq_regs_32.h" 2 * Per-cpu current frame pointer - the location of the last exception frame on
3#else 3 * the stack, stored in the per-cpu area.
4# include "irq_regs_64.h" 4 *
5#endif 5 * Jeremy Fitzhardinge <jeremy@goop.org>
6 */
7#ifndef _ASM_X86_IRQ_REGS_H
8#define _ASM_X86_IRQ_REGS_H
9
10#include <asm/percpu.h>
11
12#define ARCH_HAS_OWN_IRQ_REGS
13
14DECLARE_PER_CPU(struct pt_regs *, irq_regs);
15
16static inline struct pt_regs *get_irq_regs(void)
17{
18 return percpu_read(irq_regs);
19}
20
21static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
22{
23 struct pt_regs *old_regs;
24
25 old_regs = get_irq_regs();
26 percpu_write(irq_regs, new_regs);
27
28 return old_regs;
29}
30
31#endif /* _ASM_X86_IRQ_REGS_32_H */
diff --git a/arch/x86/include/asm/irq_regs_32.h b/arch/x86/include/asm/irq_regs_32.h
deleted file mode 100644
index 86afd7473457..000000000000
--- a/arch/x86/include/asm/irq_regs_32.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Per-cpu current frame pointer - the location of the last exception frame on
3 * the stack, stored in the per-cpu area.
4 *
5 * Jeremy Fitzhardinge <jeremy@goop.org>
6 */
7#ifndef _ASM_X86_IRQ_REGS_32_H
8#define _ASM_X86_IRQ_REGS_32_H
9
10#include <asm/percpu.h>
11
12#define ARCH_HAS_OWN_IRQ_REGS
13
14DECLARE_PER_CPU(struct pt_regs *, irq_regs);
15
16static inline struct pt_regs *get_irq_regs(void)
17{
18 return x86_read_percpu(irq_regs);
19}
20
21static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs)
22{
23 struct pt_regs *old_regs;
24
25 old_regs = get_irq_regs();
26 x86_write_percpu(irq_regs, new_regs);
27
28 return old_regs;
29}
30
31#endif /* _ASM_X86_IRQ_REGS_32_H */
diff --git a/arch/x86/include/asm/irq_regs_64.h b/arch/x86/include/asm/irq_regs_64.h
deleted file mode 100644
index 3dd9c0b70270..000000000000
--- a/arch/x86/include/asm/irq_regs_64.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/irq_regs.h>
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index f7ff65032b9d..8a285f356f8a 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -1,47 +1,69 @@
1#ifndef _ASM_X86_IRQ_VECTORS_H 1#ifndef _ASM_X86_IRQ_VECTORS_H
2#define _ASM_X86_IRQ_VECTORS_H 2#define _ASM_X86_IRQ_VECTORS_H
3 3
4#include <linux/threads.h> 4/*
5 * Linux IRQ vector layout.
6 *
7 * There are 256 IDT entries (per CPU - each entry is 8 bytes) which can
8 * be defined by Linux. They are used as a jump table by the CPU when a
9 * given vector is triggered - by a CPU-external, CPU-internal or
10 * software-triggered event.
11 *
12 * Linux sets the kernel code address each entry jumps to early during
13 * bootup, and never changes them. This is the general layout of the
14 * IDT entries:
15 *
16 * Vectors 0 ... 31 : system traps and exceptions - hardcoded events
17 * Vectors 32 ... 127 : device interrupts
18 * Vector 128 : legacy int80 syscall interface
19 * Vectors 129 ... 237 : device interrupts
20 * Vectors 238 ... 255 : special interrupts
21 *
22 * 64-bit x86 has per CPU IDT tables, 32-bit has one shared IDT table.
23 *
24 * This file enumerates the exact layout of them:
25 */
5 26
6#define NMI_VECTOR 0x02 27#define NMI_VECTOR 0x02
7 28
8/* 29/*
9 * IDT vectors usable for external interrupt sources start 30 * IDT vectors usable for external interrupt sources start
10 * at 0x20: 31 * at 0x20:
11 */ 32 */
12#define FIRST_EXTERNAL_VECTOR 0x20 33#define FIRST_EXTERNAL_VECTOR 0x20
13 34
14#ifdef CONFIG_X86_32 35#ifdef CONFIG_X86_32
15# define SYSCALL_VECTOR 0x80 36# define SYSCALL_VECTOR 0x80
16#else 37#else
17# define IA32_SYSCALL_VECTOR 0x80 38# define IA32_SYSCALL_VECTOR 0x80
18#endif 39#endif
19 40
20/* 41/*
21 * Reserve the lowest usable priority level 0x20 - 0x2f for triggering 42 * Reserve the lowest usable priority level 0x20 - 0x2f for triggering
22 * cleanup after irq migration. 43 * cleanup after irq migration.
23 */ 44 */
24#define IRQ_MOVE_CLEANUP_VECTOR FIRST_EXTERNAL_VECTOR 45#define IRQ_MOVE_CLEANUP_VECTOR FIRST_EXTERNAL_VECTOR
25 46
26/* 47/*
27 * Vectors 0x30-0x3f are used for ISA interrupts. 48 * Vectors 0x30-0x3f are used for ISA interrupts.
28 */ 49 */
29#define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR + 0x10) 50#define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR + 0x10)
30#define IRQ1_VECTOR (IRQ0_VECTOR + 1) 51
31#define IRQ2_VECTOR (IRQ0_VECTOR + 2) 52#define IRQ1_VECTOR (IRQ0_VECTOR + 1)
32#define IRQ3_VECTOR (IRQ0_VECTOR + 3) 53#define IRQ2_VECTOR (IRQ0_VECTOR + 2)
33#define IRQ4_VECTOR (IRQ0_VECTOR + 4) 54#define IRQ3_VECTOR (IRQ0_VECTOR + 3)
34#define IRQ5_VECTOR (IRQ0_VECTOR + 5) 55#define IRQ4_VECTOR (IRQ0_VECTOR + 4)
35#define IRQ6_VECTOR (IRQ0_VECTOR + 6) 56#define IRQ5_VECTOR (IRQ0_VECTOR + 5)
36#define IRQ7_VECTOR (IRQ0_VECTOR + 7) 57#define IRQ6_VECTOR (IRQ0_VECTOR + 6)
37#define IRQ8_VECTOR (IRQ0_VECTOR + 8) 58#define IRQ7_VECTOR (IRQ0_VECTOR + 7)
38#define IRQ9_VECTOR (IRQ0_VECTOR + 9) 59#define IRQ8_VECTOR (IRQ0_VECTOR + 8)
39#define IRQ10_VECTOR (IRQ0_VECTOR + 10) 60#define IRQ9_VECTOR (IRQ0_VECTOR + 9)
40#define IRQ11_VECTOR (IRQ0_VECTOR + 11) 61#define IRQ10_VECTOR (IRQ0_VECTOR + 10)
41#define IRQ12_VECTOR (IRQ0_VECTOR + 12) 62#define IRQ11_VECTOR (IRQ0_VECTOR + 11)
42#define IRQ13_VECTOR (IRQ0_VECTOR + 13) 63#define IRQ12_VECTOR (IRQ0_VECTOR + 12)
43#define IRQ14_VECTOR (IRQ0_VECTOR + 14) 64#define IRQ13_VECTOR (IRQ0_VECTOR + 13)
44#define IRQ15_VECTOR (IRQ0_VECTOR + 15) 65#define IRQ14_VECTOR (IRQ0_VECTOR + 14)
66#define IRQ15_VECTOR (IRQ0_VECTOR + 15)
45 67
46/* 68/*
47 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff 69 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
@@ -49,119 +71,98 @@
49 * some of the following vectors are 'rare', they are merged 71 * some of the following vectors are 'rare', they are merged
50 * into a single vector (CALL_FUNCTION_VECTOR) to save vector space. 72 * into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
51 * TLB, reschedule and local APIC vectors are performance-critical. 73 * TLB, reschedule and local APIC vectors are performance-critical.
52 *
53 * Vectors 0xf0-0xfa are free (reserved for future Linux use).
54 */ 74 */
55#ifdef CONFIG_X86_32
56
57# define SPURIOUS_APIC_VECTOR 0xff
58# define ERROR_APIC_VECTOR 0xfe
59# define INVALIDATE_TLB_VECTOR 0xfd
60# define RESCHEDULE_VECTOR 0xfc
61# define CALL_FUNCTION_VECTOR 0xfb
62# define CALL_FUNCTION_SINGLE_VECTOR 0xfa
63# define THERMAL_APIC_VECTOR 0xf0
64
65#else
66 75
67#define SPURIOUS_APIC_VECTOR 0xff 76#define SPURIOUS_APIC_VECTOR 0xff
77/*
78 * Sanity check
79 */
80#if ((SPURIOUS_APIC_VECTOR & 0x0F) != 0x0F)
81# error SPURIOUS_APIC_VECTOR definition error
82#endif
83
68#define ERROR_APIC_VECTOR 0xfe 84#define ERROR_APIC_VECTOR 0xfe
69#define RESCHEDULE_VECTOR 0xfd 85#define RESCHEDULE_VECTOR 0xfd
70#define CALL_FUNCTION_VECTOR 0xfc 86#define CALL_FUNCTION_VECTOR 0xfc
71#define CALL_FUNCTION_SINGLE_VECTOR 0xfb 87#define CALL_FUNCTION_SINGLE_VECTOR 0xfb
72#define THERMAL_APIC_VECTOR 0xfa 88#define THERMAL_APIC_VECTOR 0xfa
73#define THRESHOLD_APIC_VECTOR 0xf9
74#define UV_BAU_MESSAGE 0xf8
75#define INVALIDATE_TLB_VECTOR_END 0xf7
76#define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */
77
78#define NUM_INVALIDATE_TLB_VECTORS 8
79 89
90#ifdef CONFIG_X86_32
91/* 0xf8 - 0xf9 : free */
92#else
93# define THRESHOLD_APIC_VECTOR 0xf9
94# define UV_BAU_MESSAGE 0xf8
80#endif 95#endif
81 96
97/* f0-f7 used for spreading out TLB flushes: */
98#define INVALIDATE_TLB_VECTOR_END 0xf7
99#define INVALIDATE_TLB_VECTOR_START 0xf0
100#define NUM_INVALIDATE_TLB_VECTORS 8
101
82/* 102/*
83 * Local APIC timer IRQ vector is on a different priority level, 103 * Local APIC timer IRQ vector is on a different priority level,
84 * to work around the 'lost local interrupt if more than 2 IRQ 104 * to work around the 'lost local interrupt if more than 2 IRQ
85 * sources per level' errata. 105 * sources per level' errata.
86 */ 106 */
87#define LOCAL_TIMER_VECTOR 0xef 107#define LOCAL_TIMER_VECTOR 0xef
108
109/*
110 * Performance monitoring interrupt vector:
111 */
112#define LOCAL_PERF_VECTOR 0xee
88 113
89/* 114/*
90 * First APIC vector available to drivers: (vectors 0x30-0xee) we 115 * First APIC vector available to drivers: (vectors 0x30-0xee) we
91 * start at 0x31(0x41) to spread out vectors evenly between priority 116 * start at 0x31(0x41) to spread out vectors evenly between priority
92 * levels. (0x80 is the syscall vector) 117 * levels. (0x80 is the syscall vector)
93 */ 118 */
94#define FIRST_DEVICE_VECTOR (IRQ15_VECTOR + 2) 119#define FIRST_DEVICE_VECTOR (IRQ15_VECTOR + 2)
95
96#define NR_VECTORS 256
97 120
98#define FPU_IRQ 13 121#define NR_VECTORS 256
99 122
100#define FIRST_VM86_IRQ 3 123#define FPU_IRQ 13
101#define LAST_VM86_IRQ 15
102#define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15)
103 124
104#define NR_IRQS_LEGACY 16 125#define FIRST_VM86_IRQ 3
126#define LAST_VM86_IRQ 15
105 127
106#if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_X86_VOYAGER) 128#ifndef __ASSEMBLY__
107 129static inline int invalid_vm86_irq(int irq)
108#ifndef CONFIG_SPARSE_IRQ 130{
109# if NR_CPUS < MAX_IO_APICS 131 return irq < FIRST_VM86_IRQ || irq > LAST_VM86_IRQ;
110# define NR_IRQS (NR_VECTORS + (32 * NR_CPUS)) 132}
111# else
112# define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
113# endif
114#else
115# if (8 * NR_CPUS) > (32 * MAX_IO_APICS)
116# define NR_IRQS (NR_VECTORS + (8 * NR_CPUS))
117# else
118# define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
119# endif
120#endif 133#endif
121 134
122#elif defined(CONFIG_X86_VOYAGER) 135/*
123 136 * Size the maximum number of interrupts.
124# define NR_IRQS 224 137 *
138 * If the irq_desc[] array has a sparse layout, we can size things
139 * generously - it scales up linearly with the maximum number of CPUs,
140 * and the maximum number of IO-APICs, whichever is higher.
141 *
142 * In other cases we size more conservatively, to not create too large
143 * static arrays.
144 */
125 145
126#else /* IO_APIC || VOYAGER */ 146#define NR_IRQS_LEGACY 16
127 147
128# define NR_IRQS 16 148#define CPU_VECTOR_LIMIT ( 8 * NR_CPUS )
149#define IO_APIC_VECTOR_LIMIT ( 32 * MAX_IO_APICS )
129 150
151#ifdef CONFIG_X86_IO_APIC
152# ifdef CONFIG_SPARSE_IRQ
153# define NR_IRQS \
154 (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ? \
155 (NR_VECTORS + CPU_VECTOR_LIMIT) : \
156 (NR_VECTORS + IO_APIC_VECTOR_LIMIT))
157# else
158# if NR_CPUS < MAX_IO_APICS
159# define NR_IRQS (NR_VECTORS + 4*CPU_VECTOR_LIMIT)
160# else
161# define NR_IRQS (NR_VECTORS + IO_APIC_VECTOR_LIMIT)
162# endif
163# endif
164#else /* !CONFIG_X86_IO_APIC: */
165# define NR_IRQS NR_IRQS_LEGACY
130#endif 166#endif
131 167
132/* Voyager specific defines */
133/* These define the CPIs we use in linux */
134#define VIC_CPI_LEVEL0 0
135#define VIC_CPI_LEVEL1 1
136/* now the fake CPIs */
137#define VIC_TIMER_CPI 2
138#define VIC_INVALIDATE_CPI 3
139#define VIC_RESCHEDULE_CPI 4
140#define VIC_ENABLE_IRQ_CPI 5
141#define VIC_CALL_FUNCTION_CPI 6
142#define VIC_CALL_FUNCTION_SINGLE_CPI 7
143
144/* Now the QIC CPIs: Since we don't need the two initial levels,
145 * these are 2 less than the VIC CPIs */
146#define QIC_CPI_OFFSET 1
147#define QIC_TIMER_CPI (VIC_TIMER_CPI - QIC_CPI_OFFSET)
148#define QIC_INVALIDATE_CPI (VIC_INVALIDATE_CPI - QIC_CPI_OFFSET)
149#define QIC_RESCHEDULE_CPI (VIC_RESCHEDULE_CPI - QIC_CPI_OFFSET)
150#define QIC_ENABLE_IRQ_CPI (VIC_ENABLE_IRQ_CPI - QIC_CPI_OFFSET)
151#define QIC_CALL_FUNCTION_CPI (VIC_CALL_FUNCTION_CPI - QIC_CPI_OFFSET)
152#define QIC_CALL_FUNCTION_SINGLE_CPI (VIC_CALL_FUNCTION_SINGLE_CPI - QIC_CPI_OFFSET)
153
154#define VIC_START_FAKE_CPI VIC_TIMER_CPI
155#define VIC_END_FAKE_CPI VIC_CALL_FUNCTION_SINGLE_CPI
156
157/* this is the SYS_INT CPI. */
158#define VIC_SYS_INT 8
159#define VIC_CMN_INT 15
160
161/* This is the boot CPI for alternate processors. It gets overwritten
162 * by the above once the system has activated all available processors */
163#define VIC_CPU_BOOT_CPI VIC_CPI_LEVEL0
164#define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8)
165
166
167#endif /* _ASM_X86_IRQ_VECTORS_H */ 168#endif /* _ASM_X86_IRQ_VECTORS_H */
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
index c61d8b2ab8b9..0ceb6d19ed30 100644
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -9,23 +9,8 @@
9# define PAGES_NR 4 9# define PAGES_NR 4
10#else 10#else
11# define PA_CONTROL_PAGE 0 11# define PA_CONTROL_PAGE 0
12# define VA_CONTROL_PAGE 1 12# define PA_TABLE_PAGE 1
13# define PA_PGD 2 13# define PAGES_NR 2
14# define VA_PGD 3
15# define PA_PUD_0 4
16# define VA_PUD_0 5
17# define PA_PMD_0 6
18# define VA_PMD_0 7
19# define PA_PTE_0 8
20# define VA_PTE_0 9
21# define PA_PUD_1 10
22# define VA_PUD_1 11
23# define PA_PMD_1 12
24# define VA_PMD_1 13
25# define PA_PTE_1 14
26# define VA_PTE_1 15
27# define PA_TABLE_PAGE 16
28# define PAGES_NR 17
29#endif 14#endif
30 15
31#ifdef CONFIG_X86_32 16#ifdef CONFIG_X86_32
@@ -157,9 +142,9 @@ relocate_kernel(unsigned long indirection_page,
157 unsigned long start_address) ATTRIB_NORET; 142 unsigned long start_address) ATTRIB_NORET;
158#endif 143#endif
159 144
160#ifdef CONFIG_X86_32
161#define ARCH_HAS_KIMAGE_ARCH 145#define ARCH_HAS_KIMAGE_ARCH
162 146
147#ifdef CONFIG_X86_32
163struct kimage_arch { 148struct kimage_arch {
164 pgd_t *pgd; 149 pgd_t *pgd;
165#ifdef CONFIG_X86_PAE 150#ifdef CONFIG_X86_PAE
@@ -169,6 +154,12 @@ struct kimage_arch {
169 pte_t *pte0; 154 pte_t *pte0;
170 pte_t *pte1; 155 pte_t *pte1;
171}; 156};
157#else
158struct kimage_arch {
159 pud_t *pud;
160 pmd_t *pmd;
161 pte_t *pte;
162};
172#endif 163#endif
173 164
174#endif /* __ASSEMBLY__ */ 165#endif /* __ASSEMBLY__ */
diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h
index 886c9402ec45..dc3f6cf11704 100644
--- a/arch/x86/include/asm/kvm.h
+++ b/arch/x86/include/asm/kvm.h
@@ -15,6 +15,7 @@
15#define __KVM_HAVE_DEVICE_ASSIGNMENT 15#define __KVM_HAVE_DEVICE_ASSIGNMENT
16#define __KVM_HAVE_MSI 16#define __KVM_HAVE_MSI
17#define __KVM_HAVE_USER_NMI 17#define __KVM_HAVE_USER_NMI
18#define __KVM_HAVE_GUEST_DEBUG
18 19
19/* Architectural interrupt line count. */ 20/* Architectural interrupt line count. */
20#define KVM_NR_INTERRUPTS 256 21#define KVM_NR_INTERRUPTS 256
@@ -212,7 +213,30 @@ struct kvm_pit_channel_state {
212 __s64 count_load_time; 213 __s64 count_load_time;
213}; 214};
214 215
216struct kvm_debug_exit_arch {
217 __u32 exception;
218 __u32 pad;
219 __u64 pc;
220 __u64 dr6;
221 __u64 dr7;
222};
223
224#define KVM_GUESTDBG_USE_SW_BP 0x00010000
225#define KVM_GUESTDBG_USE_HW_BP 0x00020000
226#define KVM_GUESTDBG_INJECT_DB 0x00040000
227#define KVM_GUESTDBG_INJECT_BP 0x00080000
228
229/* for KVM_SET_GUEST_DEBUG */
230struct kvm_guest_debug_arch {
231 __u64 debugreg[8];
232};
233
215struct kvm_pit_state { 234struct kvm_pit_state {
216 struct kvm_pit_channel_state channels[3]; 235 struct kvm_pit_channel_state channels[3];
217}; 236};
237
238struct kvm_reinject_control {
239 __u8 pit_reinject;
240 __u8 reserved[31];
241};
218#endif /* _ASM_X86_KVM_H */ 242#endif /* _ASM_X86_KVM_H */
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 730843d1d2fb..f0faf58044ff 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -22,6 +22,7 @@
22#include <asm/pvclock-abi.h> 22#include <asm/pvclock-abi.h>
23#include <asm/desc.h> 23#include <asm/desc.h>
24#include <asm/mtrr.h> 24#include <asm/mtrr.h>
25#include <asm/msr-index.h>
25 26
26#define KVM_MAX_VCPUS 16 27#define KVM_MAX_VCPUS 16
27#define KVM_MEMORY_SLOTS 32 28#define KVM_MEMORY_SLOTS 32
@@ -134,11 +135,18 @@ enum {
134 135
135#define KVM_NR_MEM_OBJS 40 136#define KVM_NR_MEM_OBJS 40
136 137
137struct kvm_guest_debug { 138#define KVM_NR_DB_REGS 4
138 int enabled; 139
139 unsigned long bp[4]; 140#define DR6_BD (1 << 13)
140 int singlestep; 141#define DR6_BS (1 << 14)
141}; 142#define DR6_FIXED_1 0xffff0ff0
143#define DR6_VOLATILE 0x0000e00f
144
145#define DR7_BP_EN_MASK 0x000000ff
146#define DR7_GE (1 << 9)
147#define DR7_GD (1 << 13)
148#define DR7_FIXED_1 0x00000400
149#define DR7_VOLATILE 0xffff23ff
142 150
143/* 151/*
144 * We don't want allocation failures within the mmu code, so we preallocate 152 * We don't want allocation failures within the mmu code, so we preallocate
@@ -162,7 +170,8 @@ struct kvm_pte_chain {
162 * bits 0:3 - total guest paging levels (2-4, or zero for real mode) 170 * bits 0:3 - total guest paging levels (2-4, or zero for real mode)
163 * bits 4:7 - page table level for this shadow (1-4) 171 * bits 4:7 - page table level for this shadow (1-4)
164 * bits 8:9 - page table quadrant for 2-level guests 172 * bits 8:9 - page table quadrant for 2-level guests
165 * bit 16 - "metaphysical" - gfn is not a real page (huge page/real mode) 173 * bit 16 - direct mapping of virtual to physical mapping at gfn
174 * used for real mode and two-dimensional paging
166 * bits 17:19 - common access permissions for all ptes in this shadow page 175 * bits 17:19 - common access permissions for all ptes in this shadow page
167 */ 176 */
168union kvm_mmu_page_role { 177union kvm_mmu_page_role {
@@ -172,9 +181,10 @@ union kvm_mmu_page_role {
172 unsigned level:4; 181 unsigned level:4;
173 unsigned quadrant:2; 182 unsigned quadrant:2;
174 unsigned pad_for_nice_hex_output:6; 183 unsigned pad_for_nice_hex_output:6;
175 unsigned metaphysical:1; 184 unsigned direct:1;
176 unsigned access:3; 185 unsigned access:3;
177 unsigned invalid:1; 186 unsigned invalid:1;
187 unsigned cr4_pge:1;
178 }; 188 };
179}; 189};
180 190
@@ -218,6 +228,18 @@ struct kvm_pv_mmu_op_buffer {
218 char buf[512] __aligned(sizeof(long)); 228 char buf[512] __aligned(sizeof(long));
219}; 229};
220 230
231struct kvm_pio_request {
232 unsigned long count;
233 int cur_count;
234 gva_t guest_gva;
235 int in;
236 int port;
237 int size;
238 int string;
239 int down;
240 int rep;
241};
242
221/* 243/*
222 * x86 supports 3 paging modes (4-level 64-bit, 3-level 64-bit, and 2-level 244 * x86 supports 3 paging modes (4-level 64-bit, 3-level 64-bit, and 2-level
223 * 32-bit). The kvm_mmu structure abstracts the details of the current mmu 245 * 32-bit). The kvm_mmu structure abstracts the details of the current mmu
@@ -236,6 +258,7 @@ struct kvm_mmu {
236 hpa_t root_hpa; 258 hpa_t root_hpa;
237 int root_level; 259 int root_level;
238 int shadow_root_level; 260 int shadow_root_level;
261 union kvm_mmu_page_role base_role;
239 262
240 u64 *pae_root; 263 u64 *pae_root;
241}; 264};
@@ -258,6 +281,7 @@ struct kvm_vcpu_arch {
258 unsigned long cr3; 281 unsigned long cr3;
259 unsigned long cr4; 282 unsigned long cr4;
260 unsigned long cr8; 283 unsigned long cr8;
284 u32 hflags;
261 u64 pdptrs[4]; /* pae */ 285 u64 pdptrs[4]; /* pae */
262 u64 shadow_efer; 286 u64 shadow_efer;
263 u64 apic_base; 287 u64 apic_base;
@@ -338,6 +362,15 @@ struct kvm_vcpu_arch {
338 362
339 struct mtrr_state_type mtrr_state; 363 struct mtrr_state_type mtrr_state;
340 u32 pat; 364 u32 pat;
365
366 int switch_db_regs;
367 unsigned long host_db[KVM_NR_DB_REGS];
368 unsigned long host_dr6;
369 unsigned long host_dr7;
370 unsigned long db[KVM_NR_DB_REGS];
371 unsigned long dr6;
372 unsigned long dr7;
373 unsigned long eff_db[KVM_NR_DB_REGS];
341}; 374};
342 375
343struct kvm_mem_alias { 376struct kvm_mem_alias {
@@ -378,6 +411,7 @@ struct kvm_arch{
378 411
379 unsigned long irq_sources_bitmap; 412 unsigned long irq_sources_bitmap;
380 unsigned long irq_states[KVM_IOAPIC_NUM_PINS]; 413 unsigned long irq_states[KVM_IOAPIC_NUM_PINS];
414 u64 vm_init_tsc;
381}; 415};
382 416
383struct kvm_vm_stat { 417struct kvm_vm_stat {
@@ -446,8 +480,7 @@ struct kvm_x86_ops {
446 void (*vcpu_put)(struct kvm_vcpu *vcpu); 480 void (*vcpu_put)(struct kvm_vcpu *vcpu);
447 481
448 int (*set_guest_debug)(struct kvm_vcpu *vcpu, 482 int (*set_guest_debug)(struct kvm_vcpu *vcpu,
449 struct kvm_debug_guest *dbg); 483 struct kvm_guest_debug *dbg);
450 void (*guest_debug_pre)(struct kvm_vcpu *vcpu);
451 int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata); 484 int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata);
452 int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); 485 int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data);
453 u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg); 486 u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg);
@@ -583,16 +616,12 @@ void kvm_queue_exception_e(struct kvm_vcpu *vcpu, unsigned nr, u32 error_code);
583void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2, 616void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long cr2,
584 u32 error_code); 617 u32 error_code);
585 618
586void kvm_pic_set_irq(void *opaque, int irq, int level); 619int kvm_pic_set_irq(void *opaque, int irq, int level);
587 620
588void kvm_inject_nmi(struct kvm_vcpu *vcpu); 621void kvm_inject_nmi(struct kvm_vcpu *vcpu);
589 622
590void fx_init(struct kvm_vcpu *vcpu); 623void fx_init(struct kvm_vcpu *vcpu);
591 624
592int emulator_read_std(unsigned long addr,
593 void *val,
594 unsigned int bytes,
595 struct kvm_vcpu *vcpu);
596int emulator_write_emulated(unsigned long addr, 625int emulator_write_emulated(unsigned long addr,
597 const void *val, 626 const void *val,
598 unsigned int bytes, 627 unsigned int bytes,
@@ -737,6 +766,10 @@ enum {
737 TASK_SWITCH_GATE = 3, 766 TASK_SWITCH_GATE = 3,
738}; 767};
739 768
769#define HF_GIF_MASK (1 << 0)
770#define HF_HIF_MASK (1 << 1)
771#define HF_VINTR_MASK (1 << 2)
772
740/* 773/*
741 * Hardware virtualization extension instructions may fault if a 774 * Hardware virtualization extension instructions may fault if a
742 * reboot turns off virtualization while processes are running. 775 * reboot turns off virtualization while processes are running.
diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
index 5d98d0b68ffc..9320e2a8a26a 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/arch/x86/include/asm/linkage.h
@@ -52,70 +52,14 @@
52 52
53#endif 53#endif
54 54
55#define GLOBAL(name) \
56 .globl name; \
57 name:
58
55#ifdef CONFIG_X86_ALIGNMENT_16 59#ifdef CONFIG_X86_ALIGNMENT_16
56#define __ALIGN .align 16,0x90 60#define __ALIGN .align 16,0x90
57#define __ALIGN_STR ".align 16,0x90" 61#define __ALIGN_STR ".align 16,0x90"
58#endif 62#endif
59 63
60/*
61 * to check ENTRY_X86/END_X86 and
62 * KPROBE_ENTRY_X86/KPROBE_END_X86
63 * unbalanced-missed-mixed appearance
64 */
65#define __set_entry_x86 .set ENTRY_X86_IN, 0
66#define __unset_entry_x86 .set ENTRY_X86_IN, 1
67#define __set_kprobe_x86 .set KPROBE_X86_IN, 0
68#define __unset_kprobe_x86 .set KPROBE_X86_IN, 1
69
70#define __macro_err_x86 .error "ENTRY_X86/KPROBE_X86 unbalanced,missed,mixed"
71
72#define __check_entry_x86 \
73 .ifdef ENTRY_X86_IN; \
74 .ifeq ENTRY_X86_IN; \
75 __macro_err_x86; \
76 .abort; \
77 .endif; \
78 .endif
79
80#define __check_kprobe_x86 \
81 .ifdef KPROBE_X86_IN; \
82 .ifeq KPROBE_X86_IN; \
83 __macro_err_x86; \
84 .abort; \
85 .endif; \
86 .endif
87
88#define __check_entry_kprobe_x86 \
89 __check_entry_x86; \
90 __check_kprobe_x86
91
92#define ENTRY_KPROBE_FINAL_X86 __check_entry_kprobe_x86
93
94#define ENTRY_X86(name) \
95 __check_entry_kprobe_x86; \
96 __set_entry_x86; \
97 .globl name; \
98 __ALIGN; \
99 name:
100
101#define END_X86(name) \
102 __unset_entry_x86; \
103 __check_entry_kprobe_x86; \
104 .size name, .-name
105
106#define KPROBE_ENTRY_X86(name) \
107 __check_entry_kprobe_x86; \
108 __set_kprobe_x86; \
109 .pushsection .kprobes.text, "ax"; \
110 .globl name; \
111 __ALIGN; \
112 name:
113
114#define KPROBE_END_X86(name) \
115 __unset_kprobe_x86; \
116 __check_entry_kprobe_x86; \
117 .size name, .-name; \
118 .popsection
119
120#endif /* _ASM_X86_LINKAGE_H */ 64#endif /* _ASM_X86_LINKAGE_H */
121 65
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
deleted file mode 100644
index cc09cbbee27e..000000000000
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ /dev/null
@@ -1,168 +0,0 @@
1#ifndef _ASM_X86_MACH_DEFAULT_MACH_APIC_H
2#define _ASM_X86_MACH_DEFAULT_MACH_APIC_H
3
4#ifdef CONFIG_X86_LOCAL_APIC
5
6#include <mach_apicdef.h>
7#include <asm/smp.h>
8
9#define APIC_DFR_VALUE (APIC_DFR_FLAT)
10
11static inline const struct cpumask *target_cpus(void)
12{
13#ifdef CONFIG_SMP
14 return cpu_online_mask;
15#else
16 return cpumask_of(0);
17#endif
18}
19
20#define NO_BALANCE_IRQ (0)
21#define esr_disable (0)
22
23#ifdef CONFIG_X86_64
24#include <asm/genapic.h>
25#define INT_DELIVERY_MODE (genapic->int_delivery_mode)
26#define INT_DEST_MODE (genapic->int_dest_mode)
27#define TARGET_CPUS (genapic->target_cpus())
28#define apic_id_registered (genapic->apic_id_registered)
29#define init_apic_ldr (genapic->init_apic_ldr)
30#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
31#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and)
32#define phys_pkg_id (genapic->phys_pkg_id)
33#define vector_allocation_domain (genapic->vector_allocation_domain)
34#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID)))
35#define send_IPI_self (genapic->send_IPI_self)
36#define wakeup_secondary_cpu (genapic->wakeup_cpu)
37extern void setup_apic_routing(void);
38#else
39#define INT_DELIVERY_MODE dest_LowestPrio
40#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
41#define TARGET_CPUS (target_cpus())
42#define wakeup_secondary_cpu wakeup_secondary_cpu_via_init
43/*
44 * Set up the logical destination ID.
45 *
46 * Intel recommends to set DFR, LDR and TPR before enabling
47 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
48 * document number 292116). So here it goes...
49 */
50static inline void init_apic_ldr(void)
51{
52 unsigned long val;
53
54 apic_write(APIC_DFR, APIC_DFR_VALUE);
55 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
56 val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
57 apic_write(APIC_LDR, val);
58}
59
60static inline int apic_id_registered(void)
61{
62 return physid_isset(read_apic_id(), phys_cpu_present_map);
63}
64
65static inline unsigned int cpu_mask_to_apicid(const struct cpumask *cpumask)
66{
67 return cpumask_bits(cpumask)[0];
68}
69
70static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
71 const struct cpumask *andmask)
72{
73 unsigned long mask1 = cpumask_bits(cpumask)[0];
74 unsigned long mask2 = cpumask_bits(andmask)[0];
75 unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
76
77 return (unsigned int)(mask1 & mask2 & mask3);
78}
79
80static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
81{
82 return cpuid_apic >> index_msb;
83}
84
85static inline void setup_apic_routing(void)
86{
87#ifdef CONFIG_X86_IO_APIC
88 printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
89 "Flat", nr_ioapics);
90#endif
91}
92
93static inline int apicid_to_node(int logical_apicid)
94{
95#ifdef CONFIG_SMP
96 return apicid_2_node[hard_smp_processor_id()];
97#else
98 return 0;
99#endif
100}
101
102static inline void vector_allocation_domain(int cpu, struct cpumask *retmask)
103{
104 /* Careful. Some cpus do not strictly honor the set of cpus
105 * specified in the interrupt destination when using lowest
106 * priority interrupt delivery mode.
107 *
108 * In particular there was a hyperthreading cpu observed to
109 * deliver interrupts to the wrong hyperthread when only one
110 * hyperthread was specified in the interrupt desitination.
111 */
112 *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
113}
114#endif
115
116static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
117{
118 return physid_isset(apicid, bitmap);
119}
120
121static inline unsigned long check_apicid_present(int bit)
122{
123 return physid_isset(bit, phys_cpu_present_map);
124}
125
126static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
127{
128 return phys_map;
129}
130
131static inline int multi_timer_check(int apic, int irq)
132{
133 return 0;
134}
135
136/* Mapping from cpu number to logical apicid */
137static inline int cpu_to_logical_apicid(int cpu)
138{
139 return 1 << cpu;
140}
141
142static inline int cpu_present_to_apicid(int mps_cpu)
143{
144 if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
145 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
146 else
147 return BAD_APICID;
148}
149
150static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
151{
152 return physid_mask_of_physid(phys_apicid);
153}
154
155static inline void setup_portio_remap(void)
156{
157}
158
159static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
160{
161 return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
162}
163
164static inline void enable_apic_mode(void)
165{
166}
167#endif /* CONFIG_X86_LOCAL_APIC */
168#endif /* _ASM_X86_MACH_DEFAULT_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h
deleted file mode 100644
index 53179936d6c6..000000000000
--- a/arch/x86/include/asm/mach-default/mach_apicdef.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H
2#define _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H
3
4#include <asm/apic.h>
5
6#ifdef CONFIG_X86_64
7#define APIC_ID_MASK (genapic->apic_id_mask)
8#define GET_APIC_ID(x) (genapic->get_apic_id(x))
9#define SET_APIC_ID(x) (genapic->set_apic_id(x))
10#else
11#define APIC_ID_MASK (0xF<<24)
12static inline unsigned get_apic_id(unsigned long x)
13{
14 unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
15 if (APIC_XAPIC(ver))
16 return (((x)>>24)&0xFF);
17 else
18 return (((x)>>24)&0xF);
19}
20
21#define GET_APIC_ID(x) get_apic_id(x)
22#endif
23
24#endif /* _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H */
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
deleted file mode 100644
index 191312d155da..000000000000
--- a/arch/x86/include/asm/mach-default/mach_ipi.h
+++ /dev/null
@@ -1,64 +0,0 @@
1#ifndef _ASM_X86_MACH_DEFAULT_MACH_IPI_H
2#define _ASM_X86_MACH_DEFAULT_MACH_IPI_H
3
4/* Avoid include hell */
5#define NMI_VECTOR 0x02
6
7void send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
8void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
9void __send_IPI_shortcut(unsigned int shortcut, int vector);
10
11extern int no_broadcast;
12
13#ifdef CONFIG_X86_64
14#include <asm/genapic.h>
15#define send_IPI_mask (genapic->send_IPI_mask)
16#define send_IPI_mask_allbutself (genapic->send_IPI_mask_allbutself)
17#else
18static inline void send_IPI_mask(const struct cpumask *mask, int vector)
19{
20 send_IPI_mask_bitmask(mask, vector);
21}
22void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
23#endif
24
25static inline void __local_send_IPI_allbutself(int vector)
26{
27 if (no_broadcast || vector == NMI_VECTOR)
28 send_IPI_mask_allbutself(cpu_online_mask, vector);
29 else
30 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
31}
32
33static inline void __local_send_IPI_all(int vector)
34{
35 if (no_broadcast || vector == NMI_VECTOR)
36 send_IPI_mask(cpu_online_mask, vector);
37 else
38 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
39}
40
41#ifdef CONFIG_X86_64
42#define send_IPI_allbutself (genapic->send_IPI_allbutself)
43#define send_IPI_all (genapic->send_IPI_all)
44#else
45static inline void send_IPI_allbutself(int vector)
46{
47 /*
48 * if there are no other CPUs in the system then we get an APIC send
49 * error if we try to broadcast, thus avoid sending IPIs in this case.
50 */
51 if (!(num_online_cpus() > 1))
52 return;
53
54 __local_send_IPI_allbutself(vector);
55 return;
56}
57
58static inline void send_IPI_all(int vector)
59{
60 __local_send_IPI_all(vector);
61}
62#endif
63
64#endif /* _ASM_X86_MACH_DEFAULT_MACH_IPI_H */
diff --git a/arch/x86/include/asm/mach-default/mach_mpparse.h b/arch/x86/include/asm/mach-default/mach_mpparse.h
deleted file mode 100644
index c70a263d68cd..000000000000
--- a/arch/x86/include/asm/mach-default/mach_mpparse.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
2#define _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
3
4static inline int
5mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
6{
7 return 0;
8}
9
10/* Hook from generic ACPI tables.c */
11static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
12{
13 return 0;
14}
15
16
17#endif /* _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/mach-default/mach_mpspec.h b/arch/x86/include/asm/mach-default/mach_mpspec.h
deleted file mode 100644
index e85ede686be8..000000000000
--- a/arch/x86/include/asm/mach-default/mach_mpspec.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H
2#define _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H
3
4#define MAX_IRQ_SOURCES 256
5
6#if CONFIG_BASE_SMALL == 0
7#define MAX_MP_BUSSES 256
8#else
9#define MAX_MP_BUSSES 32
10#endif
11
12#endif /* _ASM_X86_MACH_DEFAULT_MACH_MPSPEC_H */
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
deleted file mode 100644
index 89897a6a65b9..000000000000
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ /dev/null
@@ -1,41 +0,0 @@
1#ifndef _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H
2#define _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H
3
4#define TRAMPOLINE_PHYS_LOW (0x467)
5#define TRAMPOLINE_PHYS_HIGH (0x469)
6
7static inline void wait_for_init_deassert(atomic_t *deassert)
8{
9 while (!atomic_read(deassert))
10 cpu_relax();
11 return;
12}
13
14/* Nothing to do for most platforms, since cleared by the INIT cycle */
15static inline void smp_callin_clear_local_apic(void)
16{
17}
18
19static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
20{
21}
22
23static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
24{
25}
26
27#ifdef CONFIG_SMP
28extern void __inquire_remote_apic(int apicid);
29#else /* CONFIG_SMP */
30static inline void __inquire_remote_apic(int apicid)
31{
32}
33#endif /* CONFIG_SMP */
34
35static inline void inquire_remote_apic(int apicid)
36{
37 if (apic_verbosity >= APIC_DEBUG)
38 __inquire_remote_apic(apicid);
39}
40
41#endif /* _ASM_X86_MACH_DEFAULT_MACH_WAKECPU_H */
diff --git a/arch/x86/include/asm/mach-generic/gpio.h b/arch/x86/include/asm/mach-generic/gpio.h
deleted file mode 100644
index 995c45efdb33..000000000000
--- a/arch/x86/include/asm/mach-generic/gpio.h
+++ /dev/null
@@ -1,15 +0,0 @@
1#ifndef _ASM_X86_MACH_GENERIC_GPIO_H
2#define _ASM_X86_MACH_GENERIC_GPIO_H
3
4int gpio_request(unsigned gpio, const char *label);
5void gpio_free(unsigned gpio);
6int gpio_direction_input(unsigned gpio);
7int gpio_direction_output(unsigned gpio, int value);
8int gpio_get_value(unsigned gpio);
9void gpio_set_value(unsigned gpio, int value);
10int gpio_to_irq(unsigned gpio);
11int irq_to_gpio(unsigned irq);
12
13#include <asm-generic/gpio.h> /* cansleep wrappers */
14
15#endif /* _ASM_X86_MACH_GENERIC_GPIO_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
deleted file mode 100644
index 48553e958ad5..000000000000
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ /dev/null
@@ -1,35 +0,0 @@
1#ifndef _ASM_X86_MACH_GENERIC_MACH_APIC_H
2#define _ASM_X86_MACH_GENERIC_MACH_APIC_H
3
4#include <asm/genapic.h>
5
6#define esr_disable (genapic->ESR_DISABLE)
7#define NO_BALANCE_IRQ (genapic->no_balance_irq)
8#define INT_DELIVERY_MODE (genapic->int_delivery_mode)
9#define INT_DEST_MODE (genapic->int_dest_mode)
10#undef APIC_DEST_LOGICAL
11#define APIC_DEST_LOGICAL (genapic->apic_destination_logical)
12#define TARGET_CPUS (genapic->target_cpus())
13#define apic_id_registered (genapic->apic_id_registered)
14#define init_apic_ldr (genapic->init_apic_ldr)
15#define ioapic_phys_id_map (genapic->ioapic_phys_id_map)
16#define setup_apic_routing (genapic->setup_apic_routing)
17#define multi_timer_check (genapic->multi_timer_check)
18#define apicid_to_node (genapic->apicid_to_node)
19#define cpu_to_logical_apicid (genapic->cpu_to_logical_apicid)
20#define cpu_present_to_apicid (genapic->cpu_present_to_apicid)
21#define apicid_to_cpu_present (genapic->apicid_to_cpu_present)
22#define setup_portio_remap (genapic->setup_portio_remap)
23#define check_apicid_present (genapic->check_apicid_present)
24#define check_phys_apicid_present (genapic->check_phys_apicid_present)
25#define check_apicid_used (genapic->check_apicid_used)
26#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
27#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and)
28#define vector_allocation_domain (genapic->vector_allocation_domain)
29#define enable_apic_mode (genapic->enable_apic_mode)
30#define phys_pkg_id (genapic->phys_pkg_id)
31#define wakeup_secondary_cpu (genapic->wakeup_cpu)
32
33extern void generic_bigsmp_probe(void);
34
35#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_apicdef.h b/arch/x86/include/asm/mach-generic/mach_apicdef.h
deleted file mode 100644
index 68041f3802f4..000000000000
--- a/arch/x86/include/asm/mach-generic/mach_apicdef.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef _ASM_X86_MACH_GENERIC_MACH_APICDEF_H
2#define _ASM_X86_MACH_GENERIC_MACH_APICDEF_H
3
4#ifndef APIC_DEFINITION
5#include <asm/genapic.h>
6
7#define GET_APIC_ID (genapic->get_apic_id)
8#define APIC_ID_MASK (genapic->apic_id_mask)
9#endif
10
11#endif /* _ASM_X86_MACH_GENERIC_MACH_APICDEF_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_ipi.h b/arch/x86/include/asm/mach-generic/mach_ipi.h
deleted file mode 100644
index ffd637e3c3d9..000000000000
--- a/arch/x86/include/asm/mach-generic/mach_ipi.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _ASM_X86_MACH_GENERIC_MACH_IPI_H
2#define _ASM_X86_MACH_GENERIC_MACH_IPI_H
3
4#include <asm/genapic.h>
5
6#define send_IPI_mask (genapic->send_IPI_mask)
7#define send_IPI_allbutself (genapic->send_IPI_allbutself)
8#define send_IPI_all (genapic->send_IPI_all)
9
10#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_mpparse.h b/arch/x86/include/asm/mach-generic/mach_mpparse.h
deleted file mode 100644
index 9444ab8dca94..000000000000
--- a/arch/x86/include/asm/mach-generic/mach_mpparse.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H
2#define _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H
3
4
5extern int mps_oem_check(struct mpc_table *, char *, char *);
6
7extern int acpi_madt_oem_check(char *, char *);
8
9#endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_mpspec.h b/arch/x86/include/asm/mach-generic/mach_mpspec.h
deleted file mode 100644
index 3bc407226578..000000000000
--- a/arch/x86/include/asm/mach-generic/mach_mpspec.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H
2#define _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H
3
4#define MAX_IRQ_SOURCES 256
5
6/* Summit or generic (i.e. installer) kernels need lots of bus entries. */
7/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
8#define MAX_MP_BUSSES 260
9
10extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
11
12#endif /* _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_wakecpu.h b/arch/x86/include/asm/mach-generic/mach_wakecpu.h
deleted file mode 100644
index 1ab16b168c8a..000000000000
--- a/arch/x86/include/asm/mach-generic/mach_wakecpu.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
2#define _ASM_X86_MACH_GENERIC_MACH_WAKECPU_H
3
4#define TRAMPOLINE_PHYS_LOW (genapic->trampoline_phys_low)
5#define TRAMPOLINE_PHYS_HIGH (genapic->trampoline_phys_high)
6#define wait_for_init_deassert (genapic->wait_for_init_deassert)
7#define smp_callin_clear_local_apic (genapic->smp_callin_clear_local_apic)
8#define store_NMI_vector (genapic->store_NMI_vector)
9#define restore_NMI_vector (genapic->restore_NMI_vector)
10#define inquire_remote_apic (genapic->inquire_remote_apic)
11
12#endif /* _ASM_X86_MACH_GENERIC_MACH_APIC_H */
diff --git a/arch/x86/include/asm/mach-rdc321x/gpio.h b/arch/x86/include/asm/mach-rdc321x/gpio.h
deleted file mode 100644
index c210ab5788b0..000000000000
--- a/arch/x86/include/asm/mach-rdc321x/gpio.h
+++ /dev/null
@@ -1,60 +0,0 @@
1#ifndef _ASM_X86_MACH_RDC321X_GPIO_H
2#define _ASM_X86_MACH_RDC321X_GPIO_H
3
4#include <linux/kernel.h>
5
6extern int rdc_gpio_get_value(unsigned gpio);
7extern void rdc_gpio_set_value(unsigned gpio, int value);
8extern int rdc_gpio_direction_input(unsigned gpio);
9extern int rdc_gpio_direction_output(unsigned gpio, int value);
10extern int rdc_gpio_request(unsigned gpio, const char *label);
11extern void rdc_gpio_free(unsigned gpio);
12extern void __init rdc321x_gpio_setup(void);
13
14/* Wrappers for the arch-neutral GPIO API */
15
16static inline int gpio_request(unsigned gpio, const char *label)
17{
18 return rdc_gpio_request(gpio, label);
19}
20
21static inline void gpio_free(unsigned gpio)
22{
23 might_sleep();
24 rdc_gpio_free(gpio);
25}
26
27static inline int gpio_direction_input(unsigned gpio)
28{
29 return rdc_gpio_direction_input(gpio);
30}
31
32static inline int gpio_direction_output(unsigned gpio, int value)
33{
34 return rdc_gpio_direction_output(gpio, value);
35}
36
37static inline int gpio_get_value(unsigned gpio)
38{
39 return rdc_gpio_get_value(gpio);
40}
41
42static inline void gpio_set_value(unsigned gpio, int value)
43{
44 rdc_gpio_set_value(gpio, value);
45}
46
47static inline int gpio_to_irq(unsigned gpio)
48{
49 return gpio;
50}
51
52static inline int irq_to_gpio(unsigned irq)
53{
54 return irq;
55}
56
57/* For cansleep */
58#include <asm-generic/gpio.h>
59
60#endif /* _ASM_X86_MACH_RDC321X_GPIO_H */
diff --git a/arch/x86/include/asm/mach-voyager/do_timer.h b/arch/x86/include/asm/mach-voyager/do_timer.h
deleted file mode 100644
index 9e5a459fd15b..000000000000
--- a/arch/x86/include/asm/mach-voyager/do_timer.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* defines for inline arch setup functions */
2#include <linux/clockchips.h>
3
4#include <asm/voyager.h>
5#include <asm/i8253.h>
6
7/**
8 * do_timer_interrupt_hook - hook into timer tick
9 *
10 * Call the pit clock event handler. see asm/i8253.h
11 **/
12static inline void do_timer_interrupt_hook(void)
13{
14 global_clock_event->event_handler(global_clock_event);
15 voyager_timer_interrupt();
16}
17
diff --git a/arch/x86/include/asm/mach-voyager/entry_arch.h b/arch/x86/include/asm/mach-voyager/entry_arch.h
deleted file mode 100644
index ae52624b5937..000000000000
--- a/arch/x86/include/asm/mach-voyager/entry_arch.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/* -*- mode: c; c-basic-offset: 8 -*- */
2
3/* Copyright (C) 2002
4 *
5 * Author: James.Bottomley@HansenPartnership.com
6 *
7 * linux/arch/i386/voyager/entry_arch.h
8 *
9 * This file builds the VIC and QIC CPI gates
10 */
11
12/* initialise the voyager interrupt gates
13 *
14 * This uses the macros in irq.h to set up assembly jump gates. The
15 * calls are then redirected to the same routine with smp_ prefixed */
16BUILD_INTERRUPT(vic_sys_interrupt, VIC_SYS_INT)
17BUILD_INTERRUPT(vic_cmn_interrupt, VIC_CMN_INT)
18BUILD_INTERRUPT(vic_cpi_interrupt, VIC_CPI_LEVEL0);
19
20/* do all the QIC interrupts */
21BUILD_INTERRUPT(qic_timer_interrupt, QIC_TIMER_CPI);
22BUILD_INTERRUPT(qic_invalidate_interrupt, QIC_INVALIDATE_CPI);
23BUILD_INTERRUPT(qic_reschedule_interrupt, QIC_RESCHEDULE_CPI);
24BUILD_INTERRUPT(qic_enable_irq_interrupt, QIC_ENABLE_IRQ_CPI);
25BUILD_INTERRUPT(qic_call_function_interrupt, QIC_CALL_FUNCTION_CPI);
26BUILD_INTERRUPT(qic_call_function_single_interrupt, QIC_CALL_FUNCTION_SINGLE_CPI);
diff --git a/arch/x86/include/asm/mach-voyager/setup_arch.h b/arch/x86/include/asm/mach-voyager/setup_arch.h
deleted file mode 100644
index 71729ca05cd7..000000000000
--- a/arch/x86/include/asm/mach-voyager/setup_arch.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#include <asm/voyager.h>
2#include <asm/setup.h>
3#define VOYAGER_BIOS_INFO ((struct voyager_bios_info *) \
4 (&boot_params.apm_bios_info))
5
6/* Hook to call BIOS initialisation function */
7
8/* for voyager, pass the voyager BIOS/SUS info area to the detection
9 * routines */
10
11#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO);
12
diff --git a/arch/x86/include/asm/mach-default/mach_timer.h b/arch/x86/include/asm/mach_timer.h
index 853728519ae9..853728519ae9 100644
--- a/arch/x86/include/asm/mach-default/mach_timer.h
+++ b/arch/x86/include/asm/mach_timer.h
diff --git a/arch/x86/include/asm/mach-default/mach_traps.h b/arch/x86/include/asm/mach_traps.h
index f7920601e472..f7920601e472 100644
--- a/arch/x86/include/asm/mach-default/mach_traps.h
+++ b/arch/x86/include/asm/mach_traps.h
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index 8aeeb3fd73db..f923203dc39a 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -21,11 +21,54 @@ static inline void paravirt_activate_mm(struct mm_struct *prev,
21int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 21int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
22void destroy_context(struct mm_struct *mm); 22void destroy_context(struct mm_struct *mm);
23 23
24#ifdef CONFIG_X86_32 24
25# include "mmu_context_32.h" 25static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
26#else 26{
27# include "mmu_context_64.h" 27#ifdef CONFIG_SMP
28 if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK)
29 percpu_write(cpu_tlbstate.state, TLBSTATE_LAZY);
30#endif
31}
32
33static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
34 struct task_struct *tsk)
35{
36 unsigned cpu = smp_processor_id();
37
38 if (likely(prev != next)) {
39 /* stop flush ipis for the previous mm */
40 cpu_clear(cpu, prev->cpu_vm_mask);
41#ifdef CONFIG_SMP
42 percpu_write(cpu_tlbstate.state, TLBSTATE_OK);
43 percpu_write(cpu_tlbstate.active_mm, next);
28#endif 44#endif
45 cpu_set(cpu, next->cpu_vm_mask);
46
47 /* Re-load page tables */
48 load_cr3(next->pgd);
49
50 /*
51 * load the LDT, if the LDT is different:
52 */
53 if (unlikely(prev->context.ldt != next->context.ldt))
54 load_LDT_nolock(&next->context);
55 }
56#ifdef CONFIG_SMP
57 else {
58 percpu_write(cpu_tlbstate.state, TLBSTATE_OK);
59 BUG_ON(percpu_read(cpu_tlbstate.active_mm) != next);
60
61 if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
62 /* We were in lazy tlb mode and leave_mm disabled
63 * tlb flush IPI delivery. We must reload CR3
64 * to make sure to use no freed page tables.
65 */
66 load_cr3(next->pgd);
67 load_LDT_nolock(&next->context);
68 }
69 }
70#endif
71}
29 72
30#define activate_mm(prev, next) \ 73#define activate_mm(prev, next) \
31do { \ 74do { \
@@ -33,5 +76,17 @@ do { \
33 switch_mm((prev), (next), NULL); \ 76 switch_mm((prev), (next), NULL); \
34} while (0); 77} while (0);
35 78
79#ifdef CONFIG_X86_32
80#define deactivate_mm(tsk, mm) \
81do { \
82 lazy_load_gs(0); \
83} while (0)
84#else
85#define deactivate_mm(tsk, mm) \
86do { \
87 load_gs_index(0); \
88 loadsegment(fs, 0); \
89} while (0)
90#endif
36 91
37#endif /* _ASM_X86_MMU_CONTEXT_H */ 92#endif /* _ASM_X86_MMU_CONTEXT_H */
diff --git a/arch/x86/include/asm/mmu_context_32.h b/arch/x86/include/asm/mmu_context_32.h
deleted file mode 100644
index 7e98ce1d2c0e..000000000000
--- a/arch/x86/include/asm/mmu_context_32.h
+++ /dev/null
@@ -1,55 +0,0 @@
1#ifndef _ASM_X86_MMU_CONTEXT_32_H
2#define _ASM_X86_MMU_CONTEXT_32_H
3
4static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
5{
6#ifdef CONFIG_SMP
7 if (x86_read_percpu(cpu_tlbstate.state) == TLBSTATE_OK)
8 x86_write_percpu(cpu_tlbstate.state, TLBSTATE_LAZY);
9#endif
10}
11
12static inline void switch_mm(struct mm_struct *prev,
13 struct mm_struct *next,
14 struct task_struct *tsk)
15{
16 int cpu = smp_processor_id();
17
18 if (likely(prev != next)) {
19 /* stop flush ipis for the previous mm */
20 cpu_clear(cpu, prev->cpu_vm_mask);
21#ifdef CONFIG_SMP
22 x86_write_percpu(cpu_tlbstate.state, TLBSTATE_OK);
23 x86_write_percpu(cpu_tlbstate.active_mm, next);
24#endif
25 cpu_set(cpu, next->cpu_vm_mask);
26
27 /* Re-load page tables */
28 load_cr3(next->pgd);
29
30 /*
31 * load the LDT, if the LDT is different:
32 */
33 if (unlikely(prev->context.ldt != next->context.ldt))
34 load_LDT_nolock(&next->context);
35 }
36#ifdef CONFIG_SMP
37 else {
38 x86_write_percpu(cpu_tlbstate.state, TLBSTATE_OK);
39 BUG_ON(x86_read_percpu(cpu_tlbstate.active_mm) != next);
40
41 if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
42 /* We were in lazy tlb mode and leave_mm disabled
43 * tlb flush IPI delivery. We must reload %cr3.
44 */
45 load_cr3(next->pgd);
46 load_LDT_nolock(&next->context);
47 }
48 }
49#endif
50}
51
52#define deactivate_mm(tsk, mm) \
53 asm("movl %0,%%gs": :"r" (0));
54
55#endif /* _ASM_X86_MMU_CONTEXT_32_H */
diff --git a/arch/x86/include/asm/mmu_context_64.h b/arch/x86/include/asm/mmu_context_64.h
deleted file mode 100644
index 677d36e9540a..000000000000
--- a/arch/x86/include/asm/mmu_context_64.h
+++ /dev/null
@@ -1,54 +0,0 @@
1#ifndef _ASM_X86_MMU_CONTEXT_64_H
2#define _ASM_X86_MMU_CONTEXT_64_H
3
4#include <asm/pda.h>
5
6static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
7{
8#ifdef CONFIG_SMP
9 if (read_pda(mmu_state) == TLBSTATE_OK)
10 write_pda(mmu_state, TLBSTATE_LAZY);
11#endif
12}
13
14static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
15 struct task_struct *tsk)
16{
17 unsigned cpu = smp_processor_id();
18 if (likely(prev != next)) {
19 /* stop flush ipis for the previous mm */
20 cpu_clear(cpu, prev->cpu_vm_mask);
21#ifdef CONFIG_SMP
22 write_pda(mmu_state, TLBSTATE_OK);
23 write_pda(active_mm, next);
24#endif
25 cpu_set(cpu, next->cpu_vm_mask);
26 load_cr3(next->pgd);
27
28 if (unlikely(next->context.ldt != prev->context.ldt))
29 load_LDT_nolock(&next->context);
30 }
31#ifdef CONFIG_SMP
32 else {
33 write_pda(mmu_state, TLBSTATE_OK);
34 if (read_pda(active_mm) != next)
35 BUG();
36 if (!cpu_test_and_set(cpu, next->cpu_vm_mask)) {
37 /* We were in lazy tlb mode and leave_mm disabled
38 * tlb flush IPI delivery. We must reload CR3
39 * to make sure to use no freed page tables.
40 */
41 load_cr3(next->pgd);
42 load_LDT_nolock(&next->context);
43 }
44 }
45#endif
46}
47
48#define deactivate_mm(tsk, mm) \
49do { \
50 load_gs_index(0); \
51 asm volatile("movl %0,%%fs"::"r"(0)); \
52} while (0)
53
54#endif /* _ASM_X86_MMU_CONTEXT_64_H */
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h
index 105fb90a0635..ede6998bd92c 100644
--- a/arch/x86/include/asm/mmzone_32.h
+++ b/arch/x86/include/asm/mmzone_32.h
@@ -91,46 +91,9 @@ static inline int pfn_valid(int pfn)
91#endif /* CONFIG_DISCONTIGMEM */ 91#endif /* CONFIG_DISCONTIGMEM */
92 92
93#ifdef CONFIG_NEED_MULTIPLE_NODES 93#ifdef CONFIG_NEED_MULTIPLE_NODES
94 94/* always use node 0 for bootmem on this numa platform */
95/* 95#define bootmem_arch_preferred_node(__bdata, size, align, goal, limit) \
96 * Following are macros that are specific to this numa platform. 96 (NODE_DATA(0)->bdata)
97 */
98#define reserve_bootmem(addr, size, flags) \
99 reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags))
100#define alloc_bootmem(x) \
101 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
102#define alloc_bootmem_nopanic(x) \
103 __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), SMP_CACHE_BYTES, \
104 __pa(MAX_DMA_ADDRESS))
105#define alloc_bootmem_low(x) \
106 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0)
107#define alloc_bootmem_pages(x) \
108 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
109#define alloc_bootmem_pages_nopanic(x) \
110 __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), PAGE_SIZE, \
111 __pa(MAX_DMA_ADDRESS))
112#define alloc_bootmem_low_pages(x) \
113 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
114#define alloc_bootmem_node(pgdat, x) \
115({ \
116 struct pglist_data __maybe_unused \
117 *__alloc_bootmem_node__pgdat = (pgdat); \
118 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, \
119 __pa(MAX_DMA_ADDRESS)); \
120})
121#define alloc_bootmem_pages_node(pgdat, x) \
122({ \
123 struct pglist_data __maybe_unused \
124 *__alloc_bootmem_node__pgdat = (pgdat); \
125 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, \
126 __pa(MAX_DMA_ADDRESS)); \
127})
128#define alloc_bootmem_low_pages_node(pgdat, x) \
129({ \
130 struct pglist_data __maybe_unused \
131 *__alloc_bootmem_node__pgdat = (pgdat); \
132 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0); \
133})
134#endif /* CONFIG_NEED_MULTIPLE_NODES */ 97#endif /* CONFIG_NEED_MULTIPLE_NODES */
135 98
136#endif /* _ASM_X86_MMZONE_32_H */ 99#endif /* _ASM_X86_MMZONE_32_H */
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index bd22f2a3713f..642fc7fc8cdc 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -9,7 +9,18 @@ extern int apic_version[MAX_APICS];
9extern int pic_mode; 9extern int pic_mode;
10 10
11#ifdef CONFIG_X86_32 11#ifdef CONFIG_X86_32
12#include <mach_mpspec.h> 12
13/*
14 * Summit or generic (i.e. installer) kernels need lots of bus entries.
15 * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
16 */
17#if CONFIG_BASE_SMALL == 0
18# define MAX_MP_BUSSES 260
19#else
20# define MAX_MP_BUSSES 32
21#endif
22
23#define MAX_IRQ_SOURCES 256
13 24
14extern unsigned int def_to_bigsmp; 25extern unsigned int def_to_bigsmp;
15extern u8 apicid_2_node[]; 26extern u8 apicid_2_node[];
@@ -20,15 +31,15 @@ extern int mp_bus_id_to_local[MAX_MP_BUSSES];
20extern int quad_local_to_mp_bus_id [NR_CPUS/4][4]; 31extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
21#endif 32#endif
22 33
23#define MAX_APICID 256 34#define MAX_APICID 256
24 35
25#else 36#else /* CONFIG_X86_64: */
26 37
27#define MAX_MP_BUSSES 256 38#define MAX_MP_BUSSES 256
28/* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */ 39/* Each PCI slot may be a combo card with its own bus. 4 IRQ pins per slot. */
29#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4) 40#define MAX_IRQ_SOURCES (MAX_MP_BUSSES * 4)
30 41
31#endif 42#endif /* CONFIG_X86_64 */
32 43
33extern void early_find_smp_config(void); 44extern void early_find_smp_config(void);
34extern void early_get_smp_config(void); 45extern void early_get_smp_config(void);
@@ -45,11 +56,13 @@ extern int smp_found_config;
45extern int mpc_default_type; 56extern int mpc_default_type;
46extern unsigned long mp_lapic_addr; 57extern unsigned long mp_lapic_addr;
47 58
48extern void find_smp_config(void);
49extern void get_smp_config(void); 59extern void get_smp_config(void);
60
50#ifdef CONFIG_X86_MPPARSE 61#ifdef CONFIG_X86_MPPARSE
62extern void find_smp_config(void);
51extern void early_reserve_e820_mpc_new(void); 63extern void early_reserve_e820_mpc_new(void);
52#else 64#else
65static inline void find_smp_config(void) { }
53static inline void early_reserve_e820_mpc_new(void) { } 66static inline void early_reserve_e820_mpc_new(void) { }
54#endif 67#endif
55 68
@@ -64,6 +77,8 @@ extern int acpi_probe_gsi(void);
64#ifdef CONFIG_X86_IO_APIC 77#ifdef CONFIG_X86_IO_APIC
65extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, 78extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
66 u32 gsi, int triggering, int polarity); 79 u32 gsi, int triggering, int polarity);
80extern int mp_find_ioapic(int gsi);
81extern int mp_find_ioapic_pin(int ioapic, int gsi);
67#else 82#else
68static inline int 83static inline int
69mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, 84mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
@@ -148,4 +163,8 @@ static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map)
148 163
149extern physid_mask_t phys_cpu_present_map; 164extern physid_mask_t phys_cpu_present_map;
150 165
166extern int generic_mps_oem_check(struct mpc_table *, char *, char *);
167
168extern int default_acpi_madt_oem_check(char *, char *);
169
151#endif /* _ASM_X86_MPSPEC_H */ 170#endif /* _ASM_X86_MPSPEC_H */
diff --git a/arch/x86/include/asm/mpspec_def.h b/arch/x86/include/asm/mpspec_def.h
index 59568bc4767f..4a7f96d7c188 100644
--- a/arch/x86/include/asm/mpspec_def.h
+++ b/arch/x86/include/asm/mpspec_def.h
@@ -24,17 +24,18 @@
24# endif 24# endif
25#endif 25#endif
26 26
27struct intel_mp_floating { 27/* Intel MP Floating Pointer Structure */
28 char mpf_signature[4]; /* "_MP_" */ 28struct mpf_intel {
29 unsigned int mpf_physptr; /* Configuration table address */ 29 char signature[4]; /* "_MP_" */
30 unsigned char mpf_length; /* Our length (paragraphs) */ 30 unsigned int physptr; /* Configuration table address */
31 unsigned char mpf_specification;/* Specification version */ 31 unsigned char length; /* Our length (paragraphs) */
32 unsigned char mpf_checksum; /* Checksum (makes sum 0) */ 32 unsigned char specification; /* Specification version */
33 unsigned char mpf_feature1; /* Standard or configuration ? */ 33 unsigned char checksum; /* Checksum (makes sum 0) */
34 unsigned char mpf_feature2; /* Bit7 set for IMCR|PIC */ 34 unsigned char feature1; /* Standard or configuration ? */
35 unsigned char mpf_feature3; /* Unused (0) */ 35 unsigned char feature2; /* Bit7 set for IMCR|PIC */
36 unsigned char mpf_feature4; /* Unused (0) */ 36 unsigned char feature3; /* Unused (0) */
37 unsigned char mpf_feature5; /* Unused (0) */ 37 unsigned char feature4; /* Unused (0) */
38 unsigned char feature5; /* Unused (0) */
38}; 39};
39 40
40#define MPC_SIGNATURE "PCMP" 41#define MPC_SIGNATURE "PCMP"
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 358acc59ae04..f4e505f286bc 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -18,11 +18,15 @@
18#define _EFER_LME 8 /* Long mode enable */ 18#define _EFER_LME 8 /* Long mode enable */
19#define _EFER_LMA 10 /* Long mode active (read-only) */ 19#define _EFER_LMA 10 /* Long mode active (read-only) */
20#define _EFER_NX 11 /* No execute enable */ 20#define _EFER_NX 11 /* No execute enable */
21#define _EFER_SVME 12 /* Enable virtualization */
22#define _EFER_FFXSR 14 /* Enable Fast FXSAVE/FXRSTOR */
21 23
22#define EFER_SCE (1<<_EFER_SCE) 24#define EFER_SCE (1<<_EFER_SCE)
23#define EFER_LME (1<<_EFER_LME) 25#define EFER_LME (1<<_EFER_LME)
24#define EFER_LMA (1<<_EFER_LMA) 26#define EFER_LMA (1<<_EFER_LMA)
25#define EFER_NX (1<<_EFER_NX) 27#define EFER_NX (1<<_EFER_NX)
28#define EFER_SVME (1<<_EFER_SVME)
29#define EFER_FFXSR (1<<_EFER_FFXSR)
26 30
27/* Intel MSRs. Some also available on other CPUs */ 31/* Intel MSRs. Some also available on other CPUs */
28#define MSR_IA32_PERFCTR0 0x000000c1 32#define MSR_IA32_PERFCTR0 0x000000c1
@@ -360,4 +364,9 @@
360#define MSR_IA32_VMX_PROCBASED_CTLS2 0x0000048b 364#define MSR_IA32_VMX_PROCBASED_CTLS2 0x0000048b
361#define MSR_IA32_VMX_EPT_VPID_CAP 0x0000048c 365#define MSR_IA32_VMX_EPT_VPID_CAP 0x0000048c
362 366
367/* AMD-V MSRs */
368
369#define MSR_VM_CR 0xc0010114
370#define MSR_VM_HSAVE_PA 0xc0010117
371
363#endif /* _ASM_X86_MSR_INDEX_H */ 372#endif /* _ASM_X86_MSR_INDEX_H */
diff --git a/arch/x86/include/asm/numa_32.h b/arch/x86/include/asm/numa_32.h
index e9f5db796244..a37229011b56 100644
--- a/arch/x86/include/asm/numa_32.h
+++ b/arch/x86/include/asm/numa_32.h
@@ -4,8 +4,12 @@
4extern int pxm_to_nid(int pxm); 4extern int pxm_to_nid(int pxm);
5extern void numa_remove_cpu(int cpu); 5extern void numa_remove_cpu(int cpu);
6 6
7#ifdef CONFIG_NUMA 7#ifdef CONFIG_HIGHMEM
8extern void set_highmem_pages_init(void); 8extern void set_highmem_pages_init(void);
9#else
10static inline void set_highmem_pages_init(void)
11{
12}
9#endif 13#endif
10 14
11#endif /* _ASM_X86_NUMA_32_H */ 15#endif /* _ASM_X86_NUMA_32_H */
diff --git a/arch/x86/include/asm/numaq.h b/arch/x86/include/asm/numaq.h
index 1e8bd30b4c16..9f0a5f5d29ec 100644
--- a/arch/x86/include/asm/numaq.h
+++ b/arch/x86/include/asm/numaq.h
@@ -31,6 +31,8 @@
31extern int found_numaq; 31extern int found_numaq;
32extern int get_memcfg_numaq(void); 32extern int get_memcfg_numaq(void);
33 33
34extern void *xquad_portio;
35
34/* 36/*
35 * SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the 37 * SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the
36 */ 38 */
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
deleted file mode 100644
index bf37bc49bd8e..000000000000
--- a/arch/x86/include/asm/numaq/apic.h
+++ /dev/null
@@ -1,142 +0,0 @@
1#ifndef __ASM_NUMAQ_APIC_H
2#define __ASM_NUMAQ_APIC_H
3
4#include <asm/io.h>
5#include <linux/mmzone.h>
6#include <linux/nodemask.h>
7
8#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
9
10static inline const cpumask_t *target_cpus(void)
11{
12 return &CPU_MASK_ALL;
13}
14
15#define NO_BALANCE_IRQ (1)
16#define esr_disable (1)
17
18#define INT_DELIVERY_MODE dest_LowestPrio
19#define INT_DEST_MODE 0 /* physical delivery on LOCAL quad */
20
21static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
22{
23 return physid_isset(apicid, bitmap);
24}
25static inline unsigned long check_apicid_present(int bit)
26{
27 return physid_isset(bit, phys_cpu_present_map);
28}
29#define apicid_cluster(apicid) (apicid & 0xF0)
30
31static inline int apic_id_registered(void)
32{
33 return 1;
34}
35
36static inline void init_apic_ldr(void)
37{
38 /* Already done in NUMA-Q firmware */
39}
40
41static inline void setup_apic_routing(void)
42{
43 printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
44 "NUMA-Q", nr_ioapics);
45}
46
47/*
48 * Skip adding the timer int on secondary nodes, which causes
49 * a small but painful rift in the time-space continuum.
50 */
51static inline int multi_timer_check(int apic, int irq)
52{
53 return apic != 0 && irq == 0;
54}
55
56static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
57{
58 /* We don't have a good way to do this yet - hack */
59 return physids_promote(0xFUL);
60}
61
62/* Mapping from cpu number to logical apicid */
63extern u8 cpu_2_logical_apicid[];
64static inline int cpu_to_logical_apicid(int cpu)
65{
66 if (cpu >= nr_cpu_ids)
67 return BAD_APICID;
68 return (int)cpu_2_logical_apicid[cpu];
69}
70
71/*
72 * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
73 * cpu to APIC ID relation to properly interact with the intelligent
74 * mode of the cluster controller.
75 */
76static inline int cpu_present_to_apicid(int mps_cpu)
77{
78 if (mps_cpu < 60)
79 return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
80 else
81 return BAD_APICID;
82}
83
84static inline int apicid_to_node(int logical_apicid)
85{
86 return logical_apicid >> 4;
87}
88
89static inline physid_mask_t apicid_to_cpu_present(int logical_apicid)
90{
91 int node = apicid_to_node(logical_apicid);
92 int cpu = __ffs(logical_apicid & 0xf);
93
94 return physid_mask_of_physid(cpu + 4*node);
95}
96
97extern void *xquad_portio;
98
99static inline void setup_portio_remap(void)
100{
101 int num_quads = num_online_nodes();
102
103 if (num_quads <= 1)
104 return;
105
106 printk("Remapping cross-quad port I/O for %d quads\n", num_quads);
107 xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
108 printk("xquad_portio vaddr 0x%08lx, len %08lx\n",
109 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
110}
111
112static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
113{
114 return (1);
115}
116
117static inline void enable_apic_mode(void)
118{
119}
120
121/*
122 * We use physical apicids here, not logical, so just return the default
123 * physical broadcast to stop people from breaking us
124 */
125static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
126{
127 return (int) 0xF;
128}
129
130static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
131 const struct cpumask *andmask)
132{
133 return (int) 0xF;
134}
135
136/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
137static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
138{
139 return cpuid_apic >> index_msb;
140}
141
142#endif /* __ASM_NUMAQ_APIC_H */
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h
deleted file mode 100644
index e012a46cc22a..000000000000
--- a/arch/x86/include/asm/numaq/apicdef.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef __ASM_NUMAQ_APICDEF_H
2#define __ASM_NUMAQ_APICDEF_H
3
4
5#define APIC_ID_MASK (0xF<<24)
6
7static inline unsigned get_apic_id(unsigned long x)
8{
9 return (((x)>>24)&0x0F);
10}
11
12#define GET_APIC_ID(x) get_apic_id(x)
13
14#endif
diff --git a/arch/x86/include/asm/numaq/ipi.h b/arch/x86/include/asm/numaq/ipi.h
deleted file mode 100644
index a8374c652778..000000000000
--- a/arch/x86/include/asm/numaq/ipi.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef __ASM_NUMAQ_IPI_H
2#define __ASM_NUMAQ_IPI_H
3
4void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
6
7static inline void send_IPI_mask(const struct cpumask *mask, int vector)
8{
9 send_IPI_mask_sequence(mask, vector);
10}
11
12static inline void send_IPI_allbutself(int vector)
13{
14 send_IPI_mask_allbutself(cpu_online_mask, vector);
15}
16
17static inline void send_IPI_all(int vector)
18{
19 send_IPI_mask(cpu_online_mask, vector);
20}
21
22#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/arch/x86/include/asm/numaq/mpparse.h b/arch/x86/include/asm/numaq/mpparse.h
deleted file mode 100644
index a2eeefcd1cc7..000000000000
--- a/arch/x86/include/asm/numaq/mpparse.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_NUMAQ_MPPARSE_H
2#define __ASM_NUMAQ_MPPARSE_H
3
4extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
5
6#endif /* __ASM_NUMAQ_MPPARSE_H */
diff --git a/arch/x86/include/asm/numaq/wakecpu.h b/arch/x86/include/asm/numaq/wakecpu.h
deleted file mode 100644
index 6f499df8eddb..000000000000
--- a/arch/x86/include/asm/numaq/wakecpu.h
+++ /dev/null
@@ -1,45 +0,0 @@
1#ifndef __ASM_NUMAQ_WAKECPU_H
2#define __ASM_NUMAQ_WAKECPU_H
3
4/* This file copes with machines that wakeup secondary CPUs by NMIs */
5
6#define TRAMPOLINE_PHYS_LOW (0x8)
7#define TRAMPOLINE_PHYS_HIGH (0xa)
8
9/* We don't do anything here because we use NMI's to boot instead */
10static inline void wait_for_init_deassert(atomic_t *deassert)
11{
12}
13
14/*
15 * Because we use NMIs rather than the INIT-STARTUP sequence to
16 * bootstrap the CPUs, the APIC may be in a weird state. Kick it.
17 */
18static inline void smp_callin_clear_local_apic(void)
19{
20 clear_local_APIC();
21}
22
23static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
24{
25 printk("Storing NMI vector\n");
26 *high =
27 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH));
28 *low =
29 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW));
30}
31
32static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
33{
34 printk("Restoring NMI vector\n");
35 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) =
36 *high;
37 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) =
38 *low;
39}
40
41static inline void inquire_remote_apic(int apicid)
42{
43}
44
45#endif /* __ASM_NUMAQ_WAKECPU_H */
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 776579119a00..89ed9d70b0aa 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -1,42 +1,11 @@
1#ifndef _ASM_X86_PAGE_H 1#ifndef _ASM_X86_PAGE_H
2#define _ASM_X86_PAGE_H 2#define _ASM_X86_PAGE_H
3 3
4#include <linux/const.h> 4#include <linux/types.h>
5
6/* PAGE_SHIFT determines the page size */
7#define PAGE_SHIFT 12
8#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
9#define PAGE_MASK (~(PAGE_SIZE-1))
10 5
11#ifdef __KERNEL__ 6#ifdef __KERNEL__
12 7
13#define __PHYSICAL_MASK ((phys_addr_t)(1ULL << __PHYSICAL_MASK_SHIFT) - 1) 8#include <asm/page_types.h>
14#define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1)
15
16/* Cast PAGE_MASK to a signed type so that it is sign-extended if
17 virtual addresses are 32-bits but physical addresses are larger
18 (ie, 32-bit PAE). */
19#define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK)
20
21/* PTE_PFN_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */
22#define PTE_PFN_MASK ((pteval_t)PHYSICAL_PAGE_MASK)
23
24/* PTE_FLAGS_MASK extracts the flags from a (pte|pmd|pud|pgd)val_t */
25#define PTE_FLAGS_MASK (~PTE_PFN_MASK)
26
27#define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT)
28#define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1))
29
30#define HPAGE_SHIFT PMD_SHIFT
31#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
32#define HPAGE_MASK (~(HPAGE_SIZE - 1))
33#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
34
35#define HUGE_MAX_HSTATE 2
36
37#ifndef __ASSEMBLY__
38#include <linux/types.h>
39#endif
40 9
41#ifdef CONFIG_X86_64 10#ifdef CONFIG_X86_64
42#include <asm/page_64.h> 11#include <asm/page_64.h>
@@ -44,38 +13,18 @@
44#include <asm/page_32.h> 13#include <asm/page_32.h>
45#endif /* CONFIG_X86_64 */ 14#endif /* CONFIG_X86_64 */
46 15
47#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
48
49#define VM_DATA_DEFAULT_FLAGS \
50 (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
51 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
52
53
54#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
55 17
56typedef struct { pgdval_t pgd; } pgd_t;
57typedef struct { pgprotval_t pgprot; } pgprot_t;
58
59extern int page_is_ram(unsigned long pagenr);
60extern int devmem_is_allowed(unsigned long pagenr);
61extern void map_devmem(unsigned long pfn, unsigned long size,
62 pgprot_t vma_prot);
63extern void unmap_devmem(unsigned long pfn, unsigned long size,
64 pgprot_t vma_prot);
65
66extern unsigned long max_low_pfn_mapped;
67extern unsigned long max_pfn_mapped;
68
69struct page; 18struct page;
70 19
71static inline void clear_user_page(void *page, unsigned long vaddr, 20static inline void clear_user_page(void *page, unsigned long vaddr,
72 struct page *pg) 21 struct page *pg)
73{ 22{
74 clear_page(page); 23 clear_page(page);
75} 24}
76 25
77static inline void copy_user_page(void *to, void *from, unsigned long vaddr, 26static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
78 struct page *topage) 27 struct page *topage)
79{ 28{
80 copy_page(to, from); 29 copy_page(to, from);
81} 30}
@@ -84,99 +33,6 @@ static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
84 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) 33 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
85#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 34#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
86 35
87static inline pgd_t native_make_pgd(pgdval_t val)
88{
89 return (pgd_t) { val };
90}
91
92static inline pgdval_t native_pgd_val(pgd_t pgd)
93{
94 return pgd.pgd;
95}
96
97#if PAGETABLE_LEVELS >= 3
98#if PAGETABLE_LEVELS == 4
99typedef struct { pudval_t pud; } pud_t;
100
101static inline pud_t native_make_pud(pmdval_t val)
102{
103 return (pud_t) { val };
104}
105
106static inline pudval_t native_pud_val(pud_t pud)
107{
108 return pud.pud;
109}
110#else /* PAGETABLE_LEVELS == 3 */
111#include <asm-generic/pgtable-nopud.h>
112
113static inline pudval_t native_pud_val(pud_t pud)
114{
115 return native_pgd_val(pud.pgd);
116}
117#endif /* PAGETABLE_LEVELS == 4 */
118
119typedef struct { pmdval_t pmd; } pmd_t;
120
121static inline pmd_t native_make_pmd(pmdval_t val)
122{
123 return (pmd_t) { val };
124}
125
126static inline pmdval_t native_pmd_val(pmd_t pmd)
127{
128 return pmd.pmd;
129}
130#else /* PAGETABLE_LEVELS == 2 */
131#include <asm-generic/pgtable-nopmd.h>
132
133static inline pmdval_t native_pmd_val(pmd_t pmd)
134{
135 return native_pgd_val(pmd.pud.pgd);
136}
137#endif /* PAGETABLE_LEVELS >= 3 */
138
139static inline pte_t native_make_pte(pteval_t val)
140{
141 return (pte_t) { .pte = val };
142}
143
144static inline pteval_t native_pte_val(pte_t pte)
145{
146 return pte.pte;
147}
148
149static inline pteval_t native_pte_flags(pte_t pte)
150{
151 return native_pte_val(pte) & PTE_FLAGS_MASK;
152}
153
154#define pgprot_val(x) ((x).pgprot)
155#define __pgprot(x) ((pgprot_t) { (x) } )
156
157#ifdef CONFIG_PARAVIRT
158#include <asm/paravirt.h>
159#else /* !CONFIG_PARAVIRT */
160
161#define pgd_val(x) native_pgd_val(x)
162#define __pgd(x) native_make_pgd(x)
163
164#ifndef __PAGETABLE_PUD_FOLDED
165#define pud_val(x) native_pud_val(x)
166#define __pud(x) native_make_pud(x)
167#endif
168
169#ifndef __PAGETABLE_PMD_FOLDED
170#define pmd_val(x) native_pmd_val(x)
171#define __pmd(x) native_make_pmd(x)
172#endif
173
174#define pte_val(x) native_pte_val(x)
175#define pte_flags(x) native_pte_flags(x)
176#define __pte(x) native_make_pte(x)
177
178#endif /* CONFIG_PARAVIRT */
179
180#define __pa(x) __phys_addr((unsigned long)(x)) 36#define __pa(x) __phys_addr((unsigned long)(x))
181#define __pa_nodebug(x) __phys_addr_nodebug((unsigned long)(x)) 37#define __pa_nodebug(x) __phys_addr_nodebug((unsigned long)(x))
182/* __pa_symbol should be used for C visible symbols. 38/* __pa_symbol should be used for C visible symbols.
diff --git a/arch/x86/include/asm/page_32.h b/arch/x86/include/asm/page_32.h
index bcde0d7b4325..da4e762406f7 100644
--- a/arch/x86/include/asm/page_32.h
+++ b/arch/x86/include/asm/page_32.h
@@ -1,82 +1,14 @@
1#ifndef _ASM_X86_PAGE_32_H 1#ifndef _ASM_X86_PAGE_32_H
2#define _ASM_X86_PAGE_32_H 2#define _ASM_X86_PAGE_32_H
3 3
4/* 4#include <asm/page_32_types.h>
5 * This handles the memory map.
6 *
7 * A __PAGE_OFFSET of 0xC0000000 means that the kernel has
8 * a virtual address space of one gigabyte, which limits the
9 * amount of physical memory you can use to about 950MB.
10 *
11 * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
12 * and CONFIG_HIGHMEM64G options in the kernel configuration.
13 */
14#define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
15
16#ifdef CONFIG_4KSTACKS
17#define THREAD_ORDER 0
18#else
19#define THREAD_ORDER 1
20#endif
21#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
22
23#define STACKFAULT_STACK 0
24#define DOUBLEFAULT_STACK 1
25#define NMI_STACK 0
26#define DEBUG_STACK 0
27#define MCE_STACK 0
28#define N_EXCEPTION_STACKS 1
29
30#ifdef CONFIG_X86_PAE
31/* 44=32+12, the limit we can fit into an unsigned long pfn */
32#define __PHYSICAL_MASK_SHIFT 44
33#define __VIRTUAL_MASK_SHIFT 32
34#define PAGETABLE_LEVELS 3
35
36#ifndef __ASSEMBLY__
37typedef u64 pteval_t;
38typedef u64 pmdval_t;
39typedef u64 pudval_t;
40typedef u64 pgdval_t;
41typedef u64 pgprotval_t;
42
43typedef union {
44 struct {
45 unsigned long pte_low, pte_high;
46 };
47 pteval_t pte;
48} pte_t;
49#endif /* __ASSEMBLY__
50 */
51#else /* !CONFIG_X86_PAE */
52#define __PHYSICAL_MASK_SHIFT 32
53#define __VIRTUAL_MASK_SHIFT 32
54#define PAGETABLE_LEVELS 2
55
56#ifndef __ASSEMBLY__
57typedef unsigned long pteval_t;
58typedef unsigned long pmdval_t;
59typedef unsigned long pudval_t;
60typedef unsigned long pgdval_t;
61typedef unsigned long pgprotval_t;
62
63typedef union {
64 pteval_t pte;
65 pteval_t pte_low;
66} pte_t;
67
68#endif /* __ASSEMBLY__ */
69#endif /* CONFIG_X86_PAE */
70 5
71#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
72typedef struct page *pgtable_t;
73#endif
74 7
75#ifdef CONFIG_HUGETLB_PAGE 8#ifdef CONFIG_HUGETLB_PAGE
76#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA 9#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
77#endif 10#endif
78 11
79#ifndef __ASSEMBLY__
80#define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET) 12#define __phys_addr_nodebug(x) ((x) - PAGE_OFFSET)
81#ifdef CONFIG_DEBUG_VIRTUAL 13#ifdef CONFIG_DEBUG_VIRTUAL
82extern unsigned long __phys_addr(unsigned long); 14extern unsigned long __phys_addr(unsigned long);
@@ -89,23 +21,6 @@ extern unsigned long __phys_addr(unsigned long);
89#define pfn_valid(pfn) ((pfn) < max_mapnr) 21#define pfn_valid(pfn) ((pfn) < max_mapnr)
90#endif /* CONFIG_FLATMEM */ 22#endif /* CONFIG_FLATMEM */
91 23
92extern int nx_enabled;
93
94/*
95 * This much address space is reserved for vmalloc() and iomap()
96 * as well as fixmap mappings.
97 */
98extern unsigned int __VMALLOC_RESERVE;
99extern int sysctl_legacy_va_layout;
100
101extern void find_low_pfn_range(void);
102extern unsigned long init_memory_mapping(unsigned long start,
103 unsigned long end);
104extern void initmem_init(unsigned long, unsigned long);
105extern void free_initmem(void);
106extern void setup_bootmem_allocator(void);
107
108
109#ifdef CONFIG_X86_USE_3DNOW 24#ifdef CONFIG_X86_USE_3DNOW
110#include <asm/mmx.h> 25#include <asm/mmx.h>
111 26
diff --git a/arch/x86/include/asm/page_32_types.h b/arch/x86/include/asm/page_32_types.h
new file mode 100644
index 000000000000..f1e4a79a6e41
--- /dev/null
+++ b/arch/x86/include/asm/page_32_types.h
@@ -0,0 +1,60 @@
1#ifndef _ASM_X86_PAGE_32_DEFS_H
2#define _ASM_X86_PAGE_32_DEFS_H
3
4#include <linux/const.h>
5
6/*
7 * This handles the memory map.
8 *
9 * A __PAGE_OFFSET of 0xC0000000 means that the kernel has
10 * a virtual address space of one gigabyte, which limits the
11 * amount of physical memory you can use to about 950MB.
12 *
13 * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
14 * and CONFIG_HIGHMEM64G options in the kernel configuration.
15 */
16#define __PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET, UL)
17
18#ifdef CONFIG_4KSTACKS
19#define THREAD_ORDER 0
20#else
21#define THREAD_ORDER 1
22#endif
23#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
24
25#define STACKFAULT_STACK 0
26#define DOUBLEFAULT_STACK 1
27#define NMI_STACK 0
28#define DEBUG_STACK 0
29#define MCE_STACK 0
30#define N_EXCEPTION_STACKS 1
31
32#ifdef CONFIG_X86_PAE
33/* 44=32+12, the limit we can fit into an unsigned long pfn */
34#define __PHYSICAL_MASK_SHIFT 44
35#define __VIRTUAL_MASK_SHIFT 32
36
37#else /* !CONFIG_X86_PAE */
38#define __PHYSICAL_MASK_SHIFT 32
39#define __VIRTUAL_MASK_SHIFT 32
40#endif /* CONFIG_X86_PAE */
41
42#ifndef __ASSEMBLY__
43
44/*
45 * This much address space is reserved for vmalloc() and iomap()
46 * as well as fixmap mappings.
47 */
48extern unsigned int __VMALLOC_RESERVE;
49extern int sysctl_legacy_va_layout;
50
51extern void find_low_pfn_range(void);
52extern unsigned long init_memory_mapping(unsigned long start,
53 unsigned long end);
54extern void initmem_init(unsigned long, unsigned long);
55extern void free_initmem(void);
56extern void setup_bootmem_allocator(void);
57
58#endif /* !__ASSEMBLY__ */
59
60#endif /* _ASM_X86_PAGE_32_DEFS_H */
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
index 5ebca29f44f0..072694ed81a5 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -1,105 +1,6 @@
1#ifndef _ASM_X86_PAGE_64_H 1#ifndef _ASM_X86_PAGE_64_H
2#define _ASM_X86_PAGE_64_H 2#define _ASM_X86_PAGE_64_H
3 3
4#define PAGETABLE_LEVELS 4 4#include <asm/page_64_types.h>
5
6#define THREAD_ORDER 1
7#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
8#define CURRENT_MASK (~(THREAD_SIZE - 1))
9
10#define EXCEPTION_STACK_ORDER 0
11#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
12
13#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
14#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
15
16#define IRQSTACK_ORDER 2
17#define IRQSTACKSIZE (PAGE_SIZE << IRQSTACK_ORDER)
18
19#define STACKFAULT_STACK 1
20#define DOUBLEFAULT_STACK 2
21#define NMI_STACK 3
22#define DEBUG_STACK 4
23#define MCE_STACK 5
24#define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
25
26#define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)
27#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))
28
29/*
30 * Set __PAGE_OFFSET to the most negative possible address +
31 * PGDIR_SIZE*16 (pgd slot 272). The gap is to allow a space for a
32 * hypervisor to fit. Choosing 16 slots here is arbitrary, but it's
33 * what Xen requires.
34 */
35#define __PAGE_OFFSET _AC(0xffff880000000000, UL)
36
37#define __PHYSICAL_START CONFIG_PHYSICAL_START
38#define __KERNEL_ALIGN 0x200000
39
40/*
41 * Make sure kernel is aligned to 2MB address. Catching it at compile
42 * time is better. Change your config file and compile the kernel
43 * for a 2MB aligned address (CONFIG_PHYSICAL_START)
44 */
45#if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
46#error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
47#endif
48
49#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
50#define __START_KERNEL_map _AC(0xffffffff80000000, UL)
51
52/* See Documentation/x86_64/mm.txt for a description of the memory map. */
53#define __PHYSICAL_MASK_SHIFT 46
54#define __VIRTUAL_MASK_SHIFT 48
55
56/*
57 * Kernel image size is limited to 512 MB (see level2_kernel_pgt in
58 * arch/x86/kernel/head_64.S), and it is mapped here:
59 */
60#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)
61#define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL)
62
63#ifndef __ASSEMBLY__
64void clear_page(void *page);
65void copy_page(void *to, void *from);
66
67/* duplicated to the one in bootmem.h */
68extern unsigned long max_pfn;
69extern unsigned long phys_base;
70
71extern unsigned long __phys_addr(unsigned long);
72#define __phys_reloc_hide(x) (x)
73
74/*
75 * These are used to make use of C type-checking..
76 */
77typedef unsigned long pteval_t;
78typedef unsigned long pmdval_t;
79typedef unsigned long pudval_t;
80typedef unsigned long pgdval_t;
81typedef unsigned long pgprotval_t;
82
83typedef struct page *pgtable_t;
84
85typedef struct { pteval_t pte; } pte_t;
86
87#define vmemmap ((struct page *)VMEMMAP_START)
88
89extern unsigned long init_memory_mapping(unsigned long start,
90 unsigned long end);
91
92extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
93extern void free_initmem(void);
94
95extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
96extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
97
98#endif /* !__ASSEMBLY__ */
99
100#ifdef CONFIG_FLATMEM
101#define pfn_valid(pfn) ((pfn) < max_pfn)
102#endif
103
104 5
105#endif /* _ASM_X86_PAGE_64_H */ 6#endif /* _ASM_X86_PAGE_64_H */
diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
new file mode 100644
index 000000000000..d38c91b70248
--- /dev/null
+++ b/arch/x86/include/asm/page_64_types.h
@@ -0,0 +1,89 @@
1#ifndef _ASM_X86_PAGE_64_DEFS_H
2#define _ASM_X86_PAGE_64_DEFS_H
3
4#define THREAD_ORDER 1
5#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
6#define CURRENT_MASK (~(THREAD_SIZE - 1))
7
8#define EXCEPTION_STACK_ORDER 0
9#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)
10
11#define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1)
12#define DEBUG_STKSZ (PAGE_SIZE << DEBUG_STACK_ORDER)
13
14#define IRQ_STACK_ORDER 2
15#define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER)
16
17#define STACKFAULT_STACK 1
18#define DOUBLEFAULT_STACK 2
19#define NMI_STACK 3
20#define DEBUG_STACK 4
21#define MCE_STACK 5
22#define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
23
24#define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)
25#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))
26
27/*
28 * Set __PAGE_OFFSET to the most negative possible address +
29 * PGDIR_SIZE*16 (pgd slot 272). The gap is to allow a space for a
30 * hypervisor to fit. Choosing 16 slots here is arbitrary, but it's
31 * what Xen requires.
32 */
33#define __PAGE_OFFSET _AC(0xffff880000000000, UL)
34
35#define __PHYSICAL_START CONFIG_PHYSICAL_START
36#define __KERNEL_ALIGN 0x200000
37
38/*
39 * Make sure kernel is aligned to 2MB address. Catching it at compile
40 * time is better. Change your config file and compile the kernel
41 * for a 2MB aligned address (CONFIG_PHYSICAL_START)
42 */
43#if (CONFIG_PHYSICAL_START % __KERNEL_ALIGN) != 0
44#error "CONFIG_PHYSICAL_START must be a multiple of 2MB"
45#endif
46
47#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
48#define __START_KERNEL_map _AC(0xffffffff80000000, UL)
49
50/* See Documentation/x86_64/mm.txt for a description of the memory map. */
51#define __PHYSICAL_MASK_SHIFT 46
52#define __VIRTUAL_MASK_SHIFT 48
53
54/*
55 * Kernel image size is limited to 512 MB (see level2_kernel_pgt in
56 * arch/x86/kernel/head_64.S), and it is mapped here:
57 */
58#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)
59#define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL)
60
61#ifndef __ASSEMBLY__
62void clear_page(void *page);
63void copy_page(void *to, void *from);
64
65/* duplicated to the one in bootmem.h */
66extern unsigned long max_pfn;
67extern unsigned long phys_base;
68
69extern unsigned long __phys_addr(unsigned long);
70#define __phys_reloc_hide(x) (x)
71
72#define vmemmap ((struct page *)VMEMMAP_START)
73
74extern unsigned long init_memory_mapping(unsigned long start,
75 unsigned long end);
76
77extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
78extern void free_initmem(void);
79
80extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
81extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
82
83#endif /* !__ASSEMBLY__ */
84
85#ifdef CONFIG_FLATMEM
86#define pfn_valid(pfn) ((pfn) < max_pfn)
87#endif
88
89#endif /* _ASM_X86_PAGE_64_DEFS_H */
diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h
new file mode 100644
index 000000000000..2d625da6603c
--- /dev/null
+++ b/arch/x86/include/asm/page_types.h
@@ -0,0 +1,57 @@
1#ifndef _ASM_X86_PAGE_DEFS_H
2#define _ASM_X86_PAGE_DEFS_H
3
4#include <linux/const.h>
5
6/* PAGE_SHIFT determines the page size */
7#define PAGE_SHIFT 12
8#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
9#define PAGE_MASK (~(PAGE_SIZE-1))
10
11#define __PHYSICAL_MASK ((phys_addr_t)(1ULL << __PHYSICAL_MASK_SHIFT) - 1)
12#define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1)
13
14/* Cast PAGE_MASK to a signed type so that it is sign-extended if
15 virtual addresses are 32-bits but physical addresses are larger
16 (ie, 32-bit PAE). */
17#define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK)
18
19#define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT)
20#define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1))
21
22#define HPAGE_SHIFT PMD_SHIFT
23#define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
24#define HPAGE_MASK (~(HPAGE_SIZE - 1))
25#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
26
27#define HUGE_MAX_HSTATE 2
28
29#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
30
31#define VM_DATA_DEFAULT_FLAGS \
32 (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
33 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
34
35#ifdef CONFIG_X86_64
36#include <asm/page_64_types.h>
37#else
38#include <asm/page_32_types.h>
39#endif /* CONFIG_X86_64 */
40
41#ifndef __ASSEMBLY__
42
43struct pgprot;
44
45extern int page_is_ram(unsigned long pagenr);
46extern int devmem_is_allowed(unsigned long pagenr);
47extern void map_devmem(unsigned long pfn, unsigned long size,
48 struct pgprot vma_prot);
49extern void unmap_devmem(unsigned long pfn, unsigned long size,
50 struct pgprot vma_prot);
51
52extern unsigned long max_low_pfn_mapped;
53extern unsigned long max_pfn_mapped;
54
55#endif /* !__ASSEMBLY__ */
56
57#endif /* _ASM_X86_PAGE_DEFS_H */
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index e299287e8e33..0617d5cc9712 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -4,7 +4,7 @@
4 * para-virtualization: those hooks are defined here. */ 4 * para-virtualization: those hooks are defined here. */
5 5
6#ifdef CONFIG_PARAVIRT 6#ifdef CONFIG_PARAVIRT
7#include <asm/page.h> 7#include <asm/pgtable_types.h>
8#include <asm/asm.h> 8#include <asm/asm.h>
9 9
10/* Bitmask of what can be clobbered: usually at least eax. */ 10/* Bitmask of what can be clobbered: usually at least eax. */
@@ -12,21 +12,38 @@
12#define CLBR_EAX (1 << 0) 12#define CLBR_EAX (1 << 0)
13#define CLBR_ECX (1 << 1) 13#define CLBR_ECX (1 << 1)
14#define CLBR_EDX (1 << 2) 14#define CLBR_EDX (1 << 2)
15#define CLBR_EDI (1 << 3)
15 16
16#ifdef CONFIG_X86_64 17#ifdef CONFIG_X86_32
17#define CLBR_RSI (1 << 3) 18/* CLBR_ANY should match all regs platform has. For i386, that's just it */
18#define CLBR_RDI (1 << 4) 19#define CLBR_ANY ((1 << 4) - 1)
20
21#define CLBR_ARG_REGS (CLBR_EAX | CLBR_EDX | CLBR_ECX)
22#define CLBR_RET_REG (CLBR_EAX | CLBR_EDX)
23#define CLBR_SCRATCH (0)
24#else
25#define CLBR_RAX CLBR_EAX
26#define CLBR_RCX CLBR_ECX
27#define CLBR_RDX CLBR_EDX
28#define CLBR_RDI CLBR_EDI
29#define CLBR_RSI (1 << 4)
19#define CLBR_R8 (1 << 5) 30#define CLBR_R8 (1 << 5)
20#define CLBR_R9 (1 << 6) 31#define CLBR_R9 (1 << 6)
21#define CLBR_R10 (1 << 7) 32#define CLBR_R10 (1 << 7)
22#define CLBR_R11 (1 << 8) 33#define CLBR_R11 (1 << 8)
34
23#define CLBR_ANY ((1 << 9) - 1) 35#define CLBR_ANY ((1 << 9) - 1)
36
37#define CLBR_ARG_REGS (CLBR_RDI | CLBR_RSI | CLBR_RDX | \
38 CLBR_RCX | CLBR_R8 | CLBR_R9)
39#define CLBR_RET_REG (CLBR_RAX)
40#define CLBR_SCRATCH (CLBR_R10 | CLBR_R11)
41
24#include <asm/desc_defs.h> 42#include <asm/desc_defs.h>
25#else
26/* CLBR_ANY should match all regs platform has. For i386, that's just it */
27#define CLBR_ANY ((1 << 3) - 1)
28#endif /* X86_64 */ 43#endif /* X86_64 */
29 44
45#define CLBR_CALLEE_SAVE ((CLBR_ARG_REGS | CLBR_SCRATCH) & ~CLBR_RET_REG)
46
30#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
31#include <linux/types.h> 48#include <linux/types.h>
32#include <linux/cpumask.h> 49#include <linux/cpumask.h>
@@ -40,6 +57,14 @@ struct tss_struct;
40struct mm_struct; 57struct mm_struct;
41struct desc_struct; 58struct desc_struct;
42 59
60/*
61 * Wrapper type for pointers to code which uses the non-standard
62 * calling convention. See PV_CALL_SAVE_REGS_THUNK below.
63 */
64struct paravirt_callee_save {
65 void *func;
66};
67
43/* general info */ 68/* general info */
44struct pv_info { 69struct pv_info {
45 unsigned int kernel_rpl; 70 unsigned int kernel_rpl;
@@ -189,11 +214,15 @@ struct pv_irq_ops {
189 * expected to use X86_EFLAGS_IF; all other bits 214 * expected to use X86_EFLAGS_IF; all other bits
190 * returned from save_fl are undefined, and may be ignored by 215 * returned from save_fl are undefined, and may be ignored by
191 * restore_fl. 216 * restore_fl.
217 *
218 * NOTE: These functions callers expect the callee to preserve
219 * more registers than the standard C calling convention.
192 */ 220 */
193 unsigned long (*save_fl)(void); 221 struct paravirt_callee_save save_fl;
194 void (*restore_fl)(unsigned long); 222 struct paravirt_callee_save restore_fl;
195 void (*irq_disable)(void); 223 struct paravirt_callee_save irq_disable;
196 void (*irq_enable)(void); 224 struct paravirt_callee_save irq_enable;
225
197 void (*safe_halt)(void); 226 void (*safe_halt)(void);
198 void (*halt)(void); 227 void (*halt)(void);
199 228
@@ -244,7 +273,8 @@ struct pv_mmu_ops {
244 void (*flush_tlb_user)(void); 273 void (*flush_tlb_user)(void);
245 void (*flush_tlb_kernel)(void); 274 void (*flush_tlb_kernel)(void);
246 void (*flush_tlb_single)(unsigned long addr); 275 void (*flush_tlb_single)(unsigned long addr);
247 void (*flush_tlb_others)(const cpumask_t *cpus, struct mm_struct *mm, 276 void (*flush_tlb_others)(const struct cpumask *cpus,
277 struct mm_struct *mm,
248 unsigned long va); 278 unsigned long va);
249 279
250 /* Hooks for allocating and freeing a pagetable top-level */ 280 /* Hooks for allocating and freeing a pagetable top-level */
@@ -278,12 +308,11 @@ struct pv_mmu_ops {
278 void (*ptep_modify_prot_commit)(struct mm_struct *mm, unsigned long addr, 308 void (*ptep_modify_prot_commit)(struct mm_struct *mm, unsigned long addr,
279 pte_t *ptep, pte_t pte); 309 pte_t *ptep, pte_t pte);
280 310
281 pteval_t (*pte_val)(pte_t); 311 struct paravirt_callee_save pte_val;
282 pteval_t (*pte_flags)(pte_t); 312 struct paravirt_callee_save make_pte;
283 pte_t (*make_pte)(pteval_t pte);
284 313
285 pgdval_t (*pgd_val)(pgd_t); 314 struct paravirt_callee_save pgd_val;
286 pgd_t (*make_pgd)(pgdval_t pgd); 315 struct paravirt_callee_save make_pgd;
287 316
288#if PAGETABLE_LEVELS >= 3 317#if PAGETABLE_LEVELS >= 3
289#ifdef CONFIG_X86_PAE 318#ifdef CONFIG_X86_PAE
@@ -298,12 +327,12 @@ struct pv_mmu_ops {
298 327
299 void (*set_pud)(pud_t *pudp, pud_t pudval); 328 void (*set_pud)(pud_t *pudp, pud_t pudval);
300 329
301 pmdval_t (*pmd_val)(pmd_t); 330 struct paravirt_callee_save pmd_val;
302 pmd_t (*make_pmd)(pmdval_t pmd); 331 struct paravirt_callee_save make_pmd;
303 332
304#if PAGETABLE_LEVELS == 4 333#if PAGETABLE_LEVELS == 4
305 pudval_t (*pud_val)(pud_t); 334 struct paravirt_callee_save pud_val;
306 pud_t (*make_pud)(pudval_t pud); 335 struct paravirt_callee_save make_pud;
307 336
308 void (*set_pgd)(pgd_t *pudp, pgd_t pgdval); 337 void (*set_pgd)(pgd_t *pudp, pgd_t pgdval);
309#endif /* PAGETABLE_LEVELS == 4 */ 338#endif /* PAGETABLE_LEVELS == 4 */
@@ -388,6 +417,8 @@ extern struct pv_lock_ops pv_lock_ops;
388 asm("start_" #ops "_" #name ": " code "; end_" #ops "_" #name ":") 417 asm("start_" #ops "_" #name ": " code "; end_" #ops "_" #name ":")
389 418
390unsigned paravirt_patch_nop(void); 419unsigned paravirt_patch_nop(void);
420unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len);
421unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len);
391unsigned paravirt_patch_ignore(unsigned len); 422unsigned paravirt_patch_ignore(unsigned len);
392unsigned paravirt_patch_call(void *insnbuf, 423unsigned paravirt_patch_call(void *insnbuf,
393 const void *target, u16 tgt_clobbers, 424 const void *target, u16 tgt_clobbers,
@@ -479,25 +510,45 @@ int paravirt_disable_iospace(void);
479 * makes sure the incoming and outgoing types are always correct. 510 * makes sure the incoming and outgoing types are always correct.
480 */ 511 */
481#ifdef CONFIG_X86_32 512#ifdef CONFIG_X86_32
482#define PVOP_VCALL_ARGS unsigned long __eax, __edx, __ecx 513#define PVOP_VCALL_ARGS \
514 unsigned long __eax = __eax, __edx = __edx, __ecx = __ecx
483#define PVOP_CALL_ARGS PVOP_VCALL_ARGS 515#define PVOP_CALL_ARGS PVOP_VCALL_ARGS
516
517#define PVOP_CALL_ARG1(x) "a" ((unsigned long)(x))
518#define PVOP_CALL_ARG2(x) "d" ((unsigned long)(x))
519#define PVOP_CALL_ARG3(x) "c" ((unsigned long)(x))
520
484#define PVOP_VCALL_CLOBBERS "=a" (__eax), "=d" (__edx), \ 521#define PVOP_VCALL_CLOBBERS "=a" (__eax), "=d" (__edx), \
485 "=c" (__ecx) 522 "=c" (__ecx)
486#define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS 523#define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS
524
525#define PVOP_VCALLEE_CLOBBERS "=a" (__eax), "=d" (__edx)
526#define PVOP_CALLEE_CLOBBERS PVOP_VCALLEE_CLOBBERS
527
487#define EXTRA_CLOBBERS 528#define EXTRA_CLOBBERS
488#define VEXTRA_CLOBBERS 529#define VEXTRA_CLOBBERS
489#else 530#else /* CONFIG_X86_64 */
490#define PVOP_VCALL_ARGS unsigned long __edi, __esi, __edx, __ecx 531#define PVOP_VCALL_ARGS \
532 unsigned long __edi = __edi, __esi = __esi, \
533 __edx = __edx, __ecx = __ecx
491#define PVOP_CALL_ARGS PVOP_VCALL_ARGS, __eax 534#define PVOP_CALL_ARGS PVOP_VCALL_ARGS, __eax
535
536#define PVOP_CALL_ARG1(x) "D" ((unsigned long)(x))
537#define PVOP_CALL_ARG2(x) "S" ((unsigned long)(x))
538#define PVOP_CALL_ARG3(x) "d" ((unsigned long)(x))
539#define PVOP_CALL_ARG4(x) "c" ((unsigned long)(x))
540
492#define PVOP_VCALL_CLOBBERS "=D" (__edi), \ 541#define PVOP_VCALL_CLOBBERS "=D" (__edi), \
493 "=S" (__esi), "=d" (__edx), \ 542 "=S" (__esi), "=d" (__edx), \
494 "=c" (__ecx) 543 "=c" (__ecx)
495
496#define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS, "=a" (__eax) 544#define PVOP_CALL_CLOBBERS PVOP_VCALL_CLOBBERS, "=a" (__eax)
497 545
546#define PVOP_VCALLEE_CLOBBERS "=a" (__eax)
547#define PVOP_CALLEE_CLOBBERS PVOP_VCALLEE_CLOBBERS
548
498#define EXTRA_CLOBBERS , "r8", "r9", "r10", "r11" 549#define EXTRA_CLOBBERS , "r8", "r9", "r10", "r11"
499#define VEXTRA_CLOBBERS , "rax", "r8", "r9", "r10", "r11" 550#define VEXTRA_CLOBBERS , "rax", "r8", "r9", "r10", "r11"
500#endif 551#endif /* CONFIG_X86_32 */
501 552
502#ifdef CONFIG_PARAVIRT_DEBUG 553#ifdef CONFIG_PARAVIRT_DEBUG
503#define PVOP_TEST_NULL(op) BUG_ON(op == NULL) 554#define PVOP_TEST_NULL(op) BUG_ON(op == NULL)
@@ -505,10 +556,11 @@ int paravirt_disable_iospace(void);
505#define PVOP_TEST_NULL(op) ((void)op) 556#define PVOP_TEST_NULL(op) ((void)op)
506#endif 557#endif
507 558
508#define __PVOP_CALL(rettype, op, pre, post, ...) \ 559#define ____PVOP_CALL(rettype, op, clbr, call_clbr, extra_clbr, \
560 pre, post, ...) \
509 ({ \ 561 ({ \
510 rettype __ret; \ 562 rettype __ret; \
511 PVOP_CALL_ARGS; \ 563 PVOP_CALL_ARGS; \
512 PVOP_TEST_NULL(op); \ 564 PVOP_TEST_NULL(op); \
513 /* This is 32-bit specific, but is okay in 64-bit */ \ 565 /* This is 32-bit specific, but is okay in 64-bit */ \
514 /* since this condition will never hold */ \ 566 /* since this condition will never hold */ \
@@ -516,70 +568,113 @@ int paravirt_disable_iospace(void);
516 asm volatile(pre \ 568 asm volatile(pre \
517 paravirt_alt(PARAVIRT_CALL) \ 569 paravirt_alt(PARAVIRT_CALL) \
518 post \ 570 post \
519 : PVOP_CALL_CLOBBERS \ 571 : call_clbr \
520 : paravirt_type(op), \ 572 : paravirt_type(op), \
521 paravirt_clobber(CLBR_ANY), \ 573 paravirt_clobber(clbr), \
522 ##__VA_ARGS__ \ 574 ##__VA_ARGS__ \
523 : "memory", "cc" EXTRA_CLOBBERS); \ 575 : "memory", "cc" extra_clbr); \
524 __ret = (rettype)((((u64)__edx) << 32) | __eax); \ 576 __ret = (rettype)((((u64)__edx) << 32) | __eax); \
525 } else { \ 577 } else { \
526 asm volatile(pre \ 578 asm volatile(pre \
527 paravirt_alt(PARAVIRT_CALL) \ 579 paravirt_alt(PARAVIRT_CALL) \
528 post \ 580 post \
529 : PVOP_CALL_CLOBBERS \ 581 : call_clbr \
530 : paravirt_type(op), \ 582 : paravirt_type(op), \
531 paravirt_clobber(CLBR_ANY), \ 583 paravirt_clobber(clbr), \
532 ##__VA_ARGS__ \ 584 ##__VA_ARGS__ \
533 : "memory", "cc" EXTRA_CLOBBERS); \ 585 : "memory", "cc" extra_clbr); \
534 __ret = (rettype)__eax; \ 586 __ret = (rettype)__eax; \
535 } \ 587 } \
536 __ret; \ 588 __ret; \
537 }) 589 })
538#define __PVOP_VCALL(op, pre, post, ...) \ 590
591#define __PVOP_CALL(rettype, op, pre, post, ...) \
592 ____PVOP_CALL(rettype, op, CLBR_ANY, PVOP_CALL_CLOBBERS, \
593 EXTRA_CLOBBERS, pre, post, ##__VA_ARGS__)
594
595#define __PVOP_CALLEESAVE(rettype, op, pre, post, ...) \
596 ____PVOP_CALL(rettype, op.func, CLBR_RET_REG, \
597 PVOP_CALLEE_CLOBBERS, , \
598 pre, post, ##__VA_ARGS__)
599
600
601#define ____PVOP_VCALL(op, clbr, call_clbr, extra_clbr, pre, post, ...) \
539 ({ \ 602 ({ \
540 PVOP_VCALL_ARGS; \ 603 PVOP_VCALL_ARGS; \
541 PVOP_TEST_NULL(op); \ 604 PVOP_TEST_NULL(op); \
542 asm volatile(pre \ 605 asm volatile(pre \
543 paravirt_alt(PARAVIRT_CALL) \ 606 paravirt_alt(PARAVIRT_CALL) \
544 post \ 607 post \
545 : PVOP_VCALL_CLOBBERS \ 608 : call_clbr \
546 : paravirt_type(op), \ 609 : paravirt_type(op), \
547 paravirt_clobber(CLBR_ANY), \ 610 paravirt_clobber(clbr), \
548 ##__VA_ARGS__ \ 611 ##__VA_ARGS__ \
549 : "memory", "cc" VEXTRA_CLOBBERS); \ 612 : "memory", "cc" extra_clbr); \
550 }) 613 })
551 614
615#define __PVOP_VCALL(op, pre, post, ...) \
616 ____PVOP_VCALL(op, CLBR_ANY, PVOP_VCALL_CLOBBERS, \
617 VEXTRA_CLOBBERS, \
618 pre, post, ##__VA_ARGS__)
619
620#define __PVOP_VCALLEESAVE(rettype, op, pre, post, ...) \
621 ____PVOP_CALL(rettype, op.func, CLBR_RET_REG, \
622 PVOP_VCALLEE_CLOBBERS, , \
623 pre, post, ##__VA_ARGS__)
624
625
626
552#define PVOP_CALL0(rettype, op) \ 627#define PVOP_CALL0(rettype, op) \
553 __PVOP_CALL(rettype, op, "", "") 628 __PVOP_CALL(rettype, op, "", "")
554#define PVOP_VCALL0(op) \ 629#define PVOP_VCALL0(op) \
555 __PVOP_VCALL(op, "", "") 630 __PVOP_VCALL(op, "", "")
556 631
632#define PVOP_CALLEE0(rettype, op) \
633 __PVOP_CALLEESAVE(rettype, op, "", "")
634#define PVOP_VCALLEE0(op) \
635 __PVOP_VCALLEESAVE(op, "", "")
636
637
557#define PVOP_CALL1(rettype, op, arg1) \ 638#define PVOP_CALL1(rettype, op, arg1) \
558 __PVOP_CALL(rettype, op, "", "", "0" ((unsigned long)(arg1))) 639 __PVOP_CALL(rettype, op, "", "", PVOP_CALL_ARG1(arg1))
559#define PVOP_VCALL1(op, arg1) \ 640#define PVOP_VCALL1(op, arg1) \
560 __PVOP_VCALL(op, "", "", "0" ((unsigned long)(arg1))) 641 __PVOP_VCALL(op, "", "", PVOP_CALL_ARG1(arg1))
642
643#define PVOP_CALLEE1(rettype, op, arg1) \
644 __PVOP_CALLEESAVE(rettype, op, "", "", PVOP_CALL_ARG1(arg1))
645#define PVOP_VCALLEE1(op, arg1) \
646 __PVOP_VCALLEESAVE(op, "", "", PVOP_CALL_ARG1(arg1))
647
561 648
562#define PVOP_CALL2(rettype, op, arg1, arg2) \ 649#define PVOP_CALL2(rettype, op, arg1, arg2) \
563 __PVOP_CALL(rettype, op, "", "", "0" ((unsigned long)(arg1)), \ 650 __PVOP_CALL(rettype, op, "", "", PVOP_CALL_ARG1(arg1), \
564 "1" ((unsigned long)(arg2))) 651 PVOP_CALL_ARG2(arg2))
565#define PVOP_VCALL2(op, arg1, arg2) \ 652#define PVOP_VCALL2(op, arg1, arg2) \
566 __PVOP_VCALL(op, "", "", "0" ((unsigned long)(arg1)), \ 653 __PVOP_VCALL(op, "", "", PVOP_CALL_ARG1(arg1), \
567 "1" ((unsigned long)(arg2))) 654 PVOP_CALL_ARG2(arg2))
655
656#define PVOP_CALLEE2(rettype, op, arg1, arg2) \
657 __PVOP_CALLEESAVE(rettype, op, "", "", PVOP_CALL_ARG1(arg1), \
658 PVOP_CALL_ARG2(arg2))
659#define PVOP_VCALLEE2(op, arg1, arg2) \
660 __PVOP_VCALLEESAVE(op, "", "", PVOP_CALL_ARG1(arg1), \
661 PVOP_CALL_ARG2(arg2))
662
568 663
569#define PVOP_CALL3(rettype, op, arg1, arg2, arg3) \ 664#define PVOP_CALL3(rettype, op, arg1, arg2, arg3) \
570 __PVOP_CALL(rettype, op, "", "", "0" ((unsigned long)(arg1)), \ 665 __PVOP_CALL(rettype, op, "", "", PVOP_CALL_ARG1(arg1), \
571 "1"((unsigned long)(arg2)), "2"((unsigned long)(arg3))) 666 PVOP_CALL_ARG2(arg2), PVOP_CALL_ARG3(arg3))
572#define PVOP_VCALL3(op, arg1, arg2, arg3) \ 667#define PVOP_VCALL3(op, arg1, arg2, arg3) \
573 __PVOP_VCALL(op, "", "", "0" ((unsigned long)(arg1)), \ 668 __PVOP_VCALL(op, "", "", PVOP_CALL_ARG1(arg1), \
574 "1"((unsigned long)(arg2)), "2"((unsigned long)(arg3))) 669 PVOP_CALL_ARG2(arg2), PVOP_CALL_ARG3(arg3))
575 670
576/* This is the only difference in x86_64. We can make it much simpler */ 671/* This is the only difference in x86_64. We can make it much simpler */
577#ifdef CONFIG_X86_32 672#ifdef CONFIG_X86_32
578#define PVOP_CALL4(rettype, op, arg1, arg2, arg3, arg4) \ 673#define PVOP_CALL4(rettype, op, arg1, arg2, arg3, arg4) \
579 __PVOP_CALL(rettype, op, \ 674 __PVOP_CALL(rettype, op, \
580 "push %[_arg4];", "lea 4(%%esp),%%esp;", \ 675 "push %[_arg4];", "lea 4(%%esp),%%esp;", \
581 "0" ((u32)(arg1)), "1" ((u32)(arg2)), \ 676 PVOP_CALL_ARG1(arg1), PVOP_CALL_ARG2(arg2), \
582 "2" ((u32)(arg3)), [_arg4] "mr" ((u32)(arg4))) 677 PVOP_CALL_ARG3(arg3), [_arg4] "mr" ((u32)(arg4)))
583#define PVOP_VCALL4(op, arg1, arg2, arg3, arg4) \ 678#define PVOP_VCALL4(op, arg1, arg2, arg3, arg4) \
584 __PVOP_VCALL(op, \ 679 __PVOP_VCALL(op, \
585 "push %[_arg4];", "lea 4(%%esp),%%esp;", \ 680 "push %[_arg4];", "lea 4(%%esp),%%esp;", \
@@ -587,13 +682,13 @@ int paravirt_disable_iospace(void);
587 "2" ((u32)(arg3)), [_arg4] "mr" ((u32)(arg4))) 682 "2" ((u32)(arg3)), [_arg4] "mr" ((u32)(arg4)))
588#else 683#else
589#define PVOP_CALL4(rettype, op, arg1, arg2, arg3, arg4) \ 684#define PVOP_CALL4(rettype, op, arg1, arg2, arg3, arg4) \
590 __PVOP_CALL(rettype, op, "", "", "0" ((unsigned long)(arg1)), \ 685 __PVOP_CALL(rettype, op, "", "", \
591 "1"((unsigned long)(arg2)), "2"((unsigned long)(arg3)), \ 686 PVOP_CALL_ARG1(arg1), PVOP_CALL_ARG2(arg2), \
592 "3"((unsigned long)(arg4))) 687 PVOP_CALL_ARG3(arg3), PVOP_CALL_ARG4(arg4))
593#define PVOP_VCALL4(op, arg1, arg2, arg3, arg4) \ 688#define PVOP_VCALL4(op, arg1, arg2, arg3, arg4) \
594 __PVOP_VCALL(op, "", "", "0" ((unsigned long)(arg1)), \ 689 __PVOP_VCALL(op, "", "", \
595 "1"((unsigned long)(arg2)), "2"((unsigned long)(arg3)), \ 690 PVOP_CALL_ARG1(arg1), PVOP_CALL_ARG2(arg2), \
596 "3"((unsigned long)(arg4))) 691 PVOP_CALL_ARG3(arg3), PVOP_CALL_ARG4(arg4))
597#endif 692#endif
598 693
599static inline int paravirt_enabled(void) 694static inline int paravirt_enabled(void)
@@ -984,10 +1079,11 @@ static inline void __flush_tlb_single(unsigned long addr)
984 PVOP_VCALL1(pv_mmu_ops.flush_tlb_single, addr); 1079 PVOP_VCALL1(pv_mmu_ops.flush_tlb_single, addr);
985} 1080}
986 1081
987static inline void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, 1082static inline void flush_tlb_others(const struct cpumask *cpumask,
1083 struct mm_struct *mm,
988 unsigned long va) 1084 unsigned long va)
989{ 1085{
990 PVOP_VCALL3(pv_mmu_ops.flush_tlb_others, &cpumask, mm, va); 1086 PVOP_VCALL3(pv_mmu_ops.flush_tlb_others, cpumask, mm, va);
991} 1087}
992 1088
993static inline int paravirt_pgd_alloc(struct mm_struct *mm) 1089static inline int paravirt_pgd_alloc(struct mm_struct *mm)
@@ -1059,13 +1155,13 @@ static inline pte_t __pte(pteval_t val)
1059 pteval_t ret; 1155 pteval_t ret;
1060 1156
1061 if (sizeof(pteval_t) > sizeof(long)) 1157 if (sizeof(pteval_t) > sizeof(long))
1062 ret = PVOP_CALL2(pteval_t, 1158 ret = PVOP_CALLEE2(pteval_t,
1063 pv_mmu_ops.make_pte, 1159 pv_mmu_ops.make_pte,
1064 val, (u64)val >> 32); 1160 val, (u64)val >> 32);
1065 else 1161 else
1066 ret = PVOP_CALL1(pteval_t, 1162 ret = PVOP_CALLEE1(pteval_t,
1067 pv_mmu_ops.make_pte, 1163 pv_mmu_ops.make_pte,
1068 val); 1164 val);
1069 1165
1070 return (pte_t) { .pte = ret }; 1166 return (pte_t) { .pte = ret };
1071} 1167}
@@ -1075,29 +1171,12 @@ static inline pteval_t pte_val(pte_t pte)
1075 pteval_t ret; 1171 pteval_t ret;
1076 1172
1077 if (sizeof(pteval_t) > sizeof(long)) 1173 if (sizeof(pteval_t) > sizeof(long))
1078 ret = PVOP_CALL2(pteval_t, pv_mmu_ops.pte_val, 1174 ret = PVOP_CALLEE2(pteval_t, pv_mmu_ops.pte_val,
1079 pte.pte, (u64)pte.pte >> 32); 1175 pte.pte, (u64)pte.pte >> 32);
1080 else
1081 ret = PVOP_CALL1(pteval_t, pv_mmu_ops.pte_val,
1082 pte.pte);
1083
1084 return ret;
1085}
1086
1087static inline pteval_t pte_flags(pte_t pte)
1088{
1089 pteval_t ret;
1090
1091 if (sizeof(pteval_t) > sizeof(long))
1092 ret = PVOP_CALL2(pteval_t, pv_mmu_ops.pte_flags,
1093 pte.pte, (u64)pte.pte >> 32);
1094 else 1176 else
1095 ret = PVOP_CALL1(pteval_t, pv_mmu_ops.pte_flags, 1177 ret = PVOP_CALLEE1(pteval_t, pv_mmu_ops.pte_val,
1096 pte.pte); 1178 pte.pte);
1097 1179
1098#ifdef CONFIG_PARAVIRT_DEBUG
1099 BUG_ON(ret & PTE_PFN_MASK);
1100#endif
1101 return ret; 1180 return ret;
1102} 1181}
1103 1182
@@ -1106,11 +1185,11 @@ static inline pgd_t __pgd(pgdval_t val)
1106 pgdval_t ret; 1185 pgdval_t ret;
1107 1186
1108 if (sizeof(pgdval_t) > sizeof(long)) 1187 if (sizeof(pgdval_t) > sizeof(long))
1109 ret = PVOP_CALL2(pgdval_t, pv_mmu_ops.make_pgd, 1188 ret = PVOP_CALLEE2(pgdval_t, pv_mmu_ops.make_pgd,
1110 val, (u64)val >> 32); 1189 val, (u64)val >> 32);
1111 else 1190 else
1112 ret = PVOP_CALL1(pgdval_t, pv_mmu_ops.make_pgd, 1191 ret = PVOP_CALLEE1(pgdval_t, pv_mmu_ops.make_pgd,
1113 val); 1192 val);
1114 1193
1115 return (pgd_t) { ret }; 1194 return (pgd_t) { ret };
1116} 1195}
@@ -1120,11 +1199,11 @@ static inline pgdval_t pgd_val(pgd_t pgd)
1120 pgdval_t ret; 1199 pgdval_t ret;
1121 1200
1122 if (sizeof(pgdval_t) > sizeof(long)) 1201 if (sizeof(pgdval_t) > sizeof(long))
1123 ret = PVOP_CALL2(pgdval_t, pv_mmu_ops.pgd_val, 1202 ret = PVOP_CALLEE2(pgdval_t, pv_mmu_ops.pgd_val,
1124 pgd.pgd, (u64)pgd.pgd >> 32); 1203 pgd.pgd, (u64)pgd.pgd >> 32);
1125 else 1204 else
1126 ret = PVOP_CALL1(pgdval_t, pv_mmu_ops.pgd_val, 1205 ret = PVOP_CALLEE1(pgdval_t, pv_mmu_ops.pgd_val,
1127 pgd.pgd); 1206 pgd.pgd);
1128 1207
1129 return ret; 1208 return ret;
1130} 1209}
@@ -1188,11 +1267,11 @@ static inline pmd_t __pmd(pmdval_t val)
1188 pmdval_t ret; 1267 pmdval_t ret;
1189 1268
1190 if (sizeof(pmdval_t) > sizeof(long)) 1269 if (sizeof(pmdval_t) > sizeof(long))
1191 ret = PVOP_CALL2(pmdval_t, pv_mmu_ops.make_pmd, 1270 ret = PVOP_CALLEE2(pmdval_t, pv_mmu_ops.make_pmd,
1192 val, (u64)val >> 32); 1271 val, (u64)val >> 32);
1193 else 1272 else
1194 ret = PVOP_CALL1(pmdval_t, pv_mmu_ops.make_pmd, 1273 ret = PVOP_CALLEE1(pmdval_t, pv_mmu_ops.make_pmd,
1195 val); 1274 val);
1196 1275
1197 return (pmd_t) { ret }; 1276 return (pmd_t) { ret };
1198} 1277}
@@ -1202,11 +1281,11 @@ static inline pmdval_t pmd_val(pmd_t pmd)
1202 pmdval_t ret; 1281 pmdval_t ret;
1203 1282
1204 if (sizeof(pmdval_t) > sizeof(long)) 1283 if (sizeof(pmdval_t) > sizeof(long))
1205 ret = PVOP_CALL2(pmdval_t, pv_mmu_ops.pmd_val, 1284 ret = PVOP_CALLEE2(pmdval_t, pv_mmu_ops.pmd_val,
1206 pmd.pmd, (u64)pmd.pmd >> 32); 1285 pmd.pmd, (u64)pmd.pmd >> 32);
1207 else 1286 else
1208 ret = PVOP_CALL1(pmdval_t, pv_mmu_ops.pmd_val, 1287 ret = PVOP_CALLEE1(pmdval_t, pv_mmu_ops.pmd_val,
1209 pmd.pmd); 1288 pmd.pmd);
1210 1289
1211 return ret; 1290 return ret;
1212} 1291}
@@ -1228,11 +1307,11 @@ static inline pud_t __pud(pudval_t val)
1228 pudval_t ret; 1307 pudval_t ret;
1229 1308
1230 if (sizeof(pudval_t) > sizeof(long)) 1309 if (sizeof(pudval_t) > sizeof(long))
1231 ret = PVOP_CALL2(pudval_t, pv_mmu_ops.make_pud, 1310 ret = PVOP_CALLEE2(pudval_t, pv_mmu_ops.make_pud,
1232 val, (u64)val >> 32); 1311 val, (u64)val >> 32);
1233 else 1312 else
1234 ret = PVOP_CALL1(pudval_t, pv_mmu_ops.make_pud, 1313 ret = PVOP_CALLEE1(pudval_t, pv_mmu_ops.make_pud,
1235 val); 1314 val);
1236 1315
1237 return (pud_t) { ret }; 1316 return (pud_t) { ret };
1238} 1317}
@@ -1242,11 +1321,11 @@ static inline pudval_t pud_val(pud_t pud)
1242 pudval_t ret; 1321 pudval_t ret;
1243 1322
1244 if (sizeof(pudval_t) > sizeof(long)) 1323 if (sizeof(pudval_t) > sizeof(long))
1245 ret = PVOP_CALL2(pudval_t, pv_mmu_ops.pud_val, 1324 ret = PVOP_CALLEE2(pudval_t, pv_mmu_ops.pud_val,
1246 pud.pud, (u64)pud.pud >> 32); 1325 pud.pud, (u64)pud.pud >> 32);
1247 else 1326 else
1248 ret = PVOP_CALL1(pudval_t, pv_mmu_ops.pud_val, 1327 ret = PVOP_CALLEE1(pudval_t, pv_mmu_ops.pud_val,
1249 pud.pud); 1328 pud.pud);
1250 1329
1251 return ret; 1330 return ret;
1252} 1331}
@@ -1374,9 +1453,10 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
1374} 1453}
1375 1454
1376void _paravirt_nop(void); 1455void _paravirt_nop(void);
1377#define paravirt_nop ((void *)_paravirt_nop) 1456u32 _paravirt_ident_32(u32);
1457u64 _paravirt_ident_64(u64);
1378 1458
1379void paravirt_use_bytelocks(void); 1459#define paravirt_nop ((void *)_paravirt_nop)
1380 1460
1381#ifdef CONFIG_SMP 1461#ifdef CONFIG_SMP
1382 1462
@@ -1426,12 +1506,37 @@ extern struct paravirt_patch_site __parainstructions[],
1426 __parainstructions_end[]; 1506 __parainstructions_end[];
1427 1507
1428#ifdef CONFIG_X86_32 1508#ifdef CONFIG_X86_32
1429#define PV_SAVE_REGS "pushl %%ecx; pushl %%edx;" 1509#define PV_SAVE_REGS "pushl %ecx; pushl %edx;"
1430#define PV_RESTORE_REGS "popl %%edx; popl %%ecx" 1510#define PV_RESTORE_REGS "popl %edx; popl %ecx;"
1511
1512/* save and restore all caller-save registers, except return value */
1513#define PV_SAVE_ALL_CALLER_REGS "pushl %ecx;"
1514#define PV_RESTORE_ALL_CALLER_REGS "popl %ecx;"
1515
1431#define PV_FLAGS_ARG "0" 1516#define PV_FLAGS_ARG "0"
1432#define PV_EXTRA_CLOBBERS 1517#define PV_EXTRA_CLOBBERS
1433#define PV_VEXTRA_CLOBBERS 1518#define PV_VEXTRA_CLOBBERS
1434#else 1519#else
1520/* save and restore all caller-save registers, except return value */
1521#define PV_SAVE_ALL_CALLER_REGS \
1522 "push %rcx;" \
1523 "push %rdx;" \
1524 "push %rsi;" \
1525 "push %rdi;" \
1526 "push %r8;" \
1527 "push %r9;" \
1528 "push %r10;" \
1529 "push %r11;"
1530#define PV_RESTORE_ALL_CALLER_REGS \
1531 "pop %r11;" \
1532 "pop %r10;" \
1533 "pop %r9;" \
1534 "pop %r8;" \
1535 "pop %rdi;" \
1536 "pop %rsi;" \
1537 "pop %rdx;" \
1538 "pop %rcx;"
1539
1435/* We save some registers, but all of them, that's too much. We clobber all 1540/* We save some registers, but all of them, that's too much. We clobber all
1436 * caller saved registers but the argument parameter */ 1541 * caller saved registers but the argument parameter */
1437#define PV_SAVE_REGS "pushq %%rdi;" 1542#define PV_SAVE_REGS "pushq %%rdi;"
@@ -1441,52 +1546,76 @@ extern struct paravirt_patch_site __parainstructions[],
1441#define PV_FLAGS_ARG "D" 1546#define PV_FLAGS_ARG "D"
1442#endif 1547#endif
1443 1548
1549/*
1550 * Generate a thunk around a function which saves all caller-save
1551 * registers except for the return value. This allows C functions to
1552 * be called from assembler code where fewer than normal registers are
1553 * available. It may also help code generation around calls from C
1554 * code if the common case doesn't use many registers.
1555 *
1556 * When a callee is wrapped in a thunk, the caller can assume that all
1557 * arg regs and all scratch registers are preserved across the
1558 * call. The return value in rax/eax will not be saved, even for void
1559 * functions.
1560 */
1561#define PV_CALLEE_SAVE_REGS_THUNK(func) \
1562 extern typeof(func) __raw_callee_save_##func; \
1563 static void *__##func##__ __used = func; \
1564 \
1565 asm(".pushsection .text;" \
1566 "__raw_callee_save_" #func ": " \
1567 PV_SAVE_ALL_CALLER_REGS \
1568 "call " #func ";" \
1569 PV_RESTORE_ALL_CALLER_REGS \
1570 "ret;" \
1571 ".popsection")
1572
1573/* Get a reference to a callee-save function */
1574#define PV_CALLEE_SAVE(func) \
1575 ((struct paravirt_callee_save) { __raw_callee_save_##func })
1576
1577/* Promise that "func" already uses the right calling convention */
1578#define __PV_IS_CALLEE_SAVE(func) \
1579 ((struct paravirt_callee_save) { func })
1580
1444static inline unsigned long __raw_local_save_flags(void) 1581static inline unsigned long __raw_local_save_flags(void)
1445{ 1582{
1446 unsigned long f; 1583 unsigned long f;
1447 1584
1448 asm volatile(paravirt_alt(PV_SAVE_REGS 1585 asm volatile(paravirt_alt(PARAVIRT_CALL)
1449 PARAVIRT_CALL
1450 PV_RESTORE_REGS)
1451 : "=a"(f) 1586 : "=a"(f)
1452 : paravirt_type(pv_irq_ops.save_fl), 1587 : paravirt_type(pv_irq_ops.save_fl),
1453 paravirt_clobber(CLBR_EAX) 1588 paravirt_clobber(CLBR_EAX)
1454 : "memory", "cc" PV_VEXTRA_CLOBBERS); 1589 : "memory", "cc");
1455 return f; 1590 return f;
1456} 1591}
1457 1592
1458static inline void raw_local_irq_restore(unsigned long f) 1593static inline void raw_local_irq_restore(unsigned long f)
1459{ 1594{
1460 asm volatile(paravirt_alt(PV_SAVE_REGS 1595 asm volatile(paravirt_alt(PARAVIRT_CALL)
1461 PARAVIRT_CALL
1462 PV_RESTORE_REGS)
1463 : "=a"(f) 1596 : "=a"(f)
1464 : PV_FLAGS_ARG(f), 1597 : PV_FLAGS_ARG(f),
1465 paravirt_type(pv_irq_ops.restore_fl), 1598 paravirt_type(pv_irq_ops.restore_fl),
1466 paravirt_clobber(CLBR_EAX) 1599 paravirt_clobber(CLBR_EAX)
1467 : "memory", "cc" PV_EXTRA_CLOBBERS); 1600 : "memory", "cc");
1468} 1601}
1469 1602
1470static inline void raw_local_irq_disable(void) 1603static inline void raw_local_irq_disable(void)
1471{ 1604{
1472 asm volatile(paravirt_alt(PV_SAVE_REGS 1605 asm volatile(paravirt_alt(PARAVIRT_CALL)
1473 PARAVIRT_CALL
1474 PV_RESTORE_REGS)
1475 : 1606 :
1476 : paravirt_type(pv_irq_ops.irq_disable), 1607 : paravirt_type(pv_irq_ops.irq_disable),
1477 paravirt_clobber(CLBR_EAX) 1608 paravirt_clobber(CLBR_EAX)
1478 : "memory", "eax", "cc" PV_EXTRA_CLOBBERS); 1609 : "memory", "eax", "cc");
1479} 1610}
1480 1611
1481static inline void raw_local_irq_enable(void) 1612static inline void raw_local_irq_enable(void)
1482{ 1613{
1483 asm volatile(paravirt_alt(PV_SAVE_REGS 1614 asm volatile(paravirt_alt(PARAVIRT_CALL)
1484 PARAVIRT_CALL
1485 PV_RESTORE_REGS)
1486 : 1615 :
1487 : paravirt_type(pv_irq_ops.irq_enable), 1616 : paravirt_type(pv_irq_ops.irq_enable),
1488 paravirt_clobber(CLBR_EAX) 1617 paravirt_clobber(CLBR_EAX)
1489 : "memory", "eax", "cc" PV_EXTRA_CLOBBERS); 1618 : "memory", "eax", "cc");
1490} 1619}
1491 1620
1492static inline unsigned long __raw_local_irq_save(void) 1621static inline unsigned long __raw_local_irq_save(void)
@@ -1529,33 +1658,49 @@ static inline unsigned long __raw_local_irq_save(void)
1529 .popsection 1658 .popsection
1530 1659
1531 1660
1661#define COND_PUSH(set, mask, reg) \
1662 .if ((~(set)) & mask); push %reg; .endif
1663#define COND_POP(set, mask, reg) \
1664 .if ((~(set)) & mask); pop %reg; .endif
1665
1532#ifdef CONFIG_X86_64 1666#ifdef CONFIG_X86_64
1533#define PV_SAVE_REGS \ 1667
1534 push %rax; \ 1668#define PV_SAVE_REGS(set) \
1535 push %rcx; \ 1669 COND_PUSH(set, CLBR_RAX, rax); \
1536 push %rdx; \ 1670 COND_PUSH(set, CLBR_RCX, rcx); \
1537 push %rsi; \ 1671 COND_PUSH(set, CLBR_RDX, rdx); \
1538 push %rdi; \ 1672 COND_PUSH(set, CLBR_RSI, rsi); \
1539 push %r8; \ 1673 COND_PUSH(set, CLBR_RDI, rdi); \
1540 push %r9; \ 1674 COND_PUSH(set, CLBR_R8, r8); \
1541 push %r10; \ 1675 COND_PUSH(set, CLBR_R9, r9); \
1542 push %r11 1676 COND_PUSH(set, CLBR_R10, r10); \
1543#define PV_RESTORE_REGS \ 1677 COND_PUSH(set, CLBR_R11, r11)
1544 pop %r11; \ 1678#define PV_RESTORE_REGS(set) \
1545 pop %r10; \ 1679 COND_POP(set, CLBR_R11, r11); \
1546 pop %r9; \ 1680 COND_POP(set, CLBR_R10, r10); \
1547 pop %r8; \ 1681 COND_POP(set, CLBR_R9, r9); \
1548 pop %rdi; \ 1682 COND_POP(set, CLBR_R8, r8); \
1549 pop %rsi; \ 1683 COND_POP(set, CLBR_RDI, rdi); \
1550 pop %rdx; \ 1684 COND_POP(set, CLBR_RSI, rsi); \
1551 pop %rcx; \ 1685 COND_POP(set, CLBR_RDX, rdx); \
1552 pop %rax 1686 COND_POP(set, CLBR_RCX, rcx); \
1687 COND_POP(set, CLBR_RAX, rax)
1688
1553#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 8) 1689#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 8)
1554#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8) 1690#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8)
1555#define PARA_INDIRECT(addr) *addr(%rip) 1691#define PARA_INDIRECT(addr) *addr(%rip)
1556#else 1692#else
1557#define PV_SAVE_REGS pushl %eax; pushl %edi; pushl %ecx; pushl %edx 1693#define PV_SAVE_REGS(set) \
1558#define PV_RESTORE_REGS popl %edx; popl %ecx; popl %edi; popl %eax 1694 COND_PUSH(set, CLBR_EAX, eax); \
1695 COND_PUSH(set, CLBR_EDI, edi); \
1696 COND_PUSH(set, CLBR_ECX, ecx); \
1697 COND_PUSH(set, CLBR_EDX, edx)
1698#define PV_RESTORE_REGS(set) \
1699 COND_POP(set, CLBR_EDX, edx); \
1700 COND_POP(set, CLBR_ECX, ecx); \
1701 COND_POP(set, CLBR_EDI, edi); \
1702 COND_POP(set, CLBR_EAX, eax)
1703
1559#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4) 1704#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4)
1560#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4) 1705#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4)
1561#define PARA_INDIRECT(addr) *%cs:addr 1706#define PARA_INDIRECT(addr) *%cs:addr
@@ -1567,15 +1712,15 @@ static inline unsigned long __raw_local_irq_save(void)
1567 1712
1568#define DISABLE_INTERRUPTS(clobbers) \ 1713#define DISABLE_INTERRUPTS(clobbers) \
1569 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_disable), clobbers, \ 1714 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_disable), clobbers, \
1570 PV_SAVE_REGS; \ 1715 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
1571 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_disable); \ 1716 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_disable); \
1572 PV_RESTORE_REGS;) \ 1717 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
1573 1718
1574#define ENABLE_INTERRUPTS(clobbers) \ 1719#define ENABLE_INTERRUPTS(clobbers) \
1575 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_enable), clobbers, \ 1720 PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_enable), clobbers, \
1576 PV_SAVE_REGS; \ 1721 PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
1577 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_enable); \ 1722 call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_enable); \
1578 PV_RESTORE_REGS;) 1723 PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
1579 1724
1580#define USERGS_SYSRET32 \ 1725#define USERGS_SYSRET32 \
1581 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_usergs_sysret32), \ 1726 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_usergs_sysret32), \
@@ -1605,11 +1750,15 @@ static inline unsigned long __raw_local_irq_save(void)
1605 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \ 1750 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \
1606 swapgs) 1751 swapgs)
1607 1752
1753/*
1754 * Note: swapgs is very special, and in practise is either going to be
1755 * implemented with a single "swapgs" instruction or something very
1756 * special. Either way, we don't need to save any registers for
1757 * it.
1758 */
1608#define SWAPGS \ 1759#define SWAPGS \
1609 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \ 1760 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \
1610 PV_SAVE_REGS; \ 1761 call PARA_INDIRECT(pv_cpu_ops+PV_CPU_swapgs) \
1611 call PARA_INDIRECT(pv_cpu_ops+PV_CPU_swapgs); \
1612 PV_RESTORE_REGS \
1613 ) 1762 )
1614 1763
1615#define GET_CR2_INTO_RCX \ 1764#define GET_CR2_INTO_RCX \
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h
index b8493b3b9890..b0e70056838e 100644
--- a/arch/x86/include/asm/pat.h
+++ b/arch/x86/include/asm/pat.h
@@ -5,10 +5,8 @@
5 5
6#ifdef CONFIG_X86_PAT 6#ifdef CONFIG_X86_PAT
7extern int pat_enabled; 7extern int pat_enabled;
8extern void validate_pat_support(struct cpuinfo_x86 *c);
9#else 8#else
10static const int pat_enabled; 9static const int pat_enabled;
11static inline void validate_pat_support(struct cpuinfo_x86 *c) { }
12#endif 10#endif
13 11
14extern void pat_init(void); 12extern void pat_init(void);
@@ -17,6 +15,7 @@ extern int reserve_memtype(u64 start, u64 end,
17 unsigned long req_type, unsigned long *ret_type); 15 unsigned long req_type, unsigned long *ret_type);
18extern int free_memtype(u64 start, u64 end); 16extern int free_memtype(u64 start, u64 end);
19 17
20extern void pat_disable(char *reason); 18extern int kernel_map_sync_memtype(u64 base, unsigned long size,
19 unsigned long flag);
21 20
22#endif /* _ASM_X86_PAT_H */ 21#endif /* _ASM_X86_PAT_H */
diff --git a/arch/x86/include/asm/mach-default/pci-functions.h b/arch/x86/include/asm/pci-functions.h
index ed0bab427354..ed0bab427354 100644
--- a/arch/x86/include/asm/mach-default/pci-functions.h
+++ b/arch/x86/include/asm/pci-functions.h
diff --git a/arch/x86/include/asm/pda.h b/arch/x86/include/asm/pda.h
deleted file mode 100644
index 2fbfff88df37..000000000000
--- a/arch/x86/include/asm/pda.h
+++ /dev/null
@@ -1,137 +0,0 @@
1#ifndef _ASM_X86_PDA_H
2#define _ASM_X86_PDA_H
3
4#ifndef __ASSEMBLY__
5#include <linux/stddef.h>
6#include <linux/types.h>
7#include <linux/cache.h>
8#include <asm/page.h>
9
10/* Per processor datastructure. %gs points to it while the kernel runs */
11struct x8664_pda {
12 struct task_struct *pcurrent; /* 0 Current process */
13 unsigned long data_offset; /* 8 Per cpu data offset from linker
14 address */
15 unsigned long kernelstack; /* 16 top of kernel stack for current */
16 unsigned long oldrsp; /* 24 user rsp for system call */
17 int irqcount; /* 32 Irq nesting counter. Starts -1 */
18 unsigned int cpunumber; /* 36 Logical CPU number */
19#ifdef CONFIG_CC_STACKPROTECTOR
20 unsigned long stack_canary; /* 40 stack canary value */
21 /* gcc-ABI: this canary MUST be at
22 offset 40!!! */
23#endif
24 char *irqstackptr;
25 short nodenumber; /* number of current node (32k max) */
26 short in_bootmem; /* pda lives in bootmem */
27 unsigned int __softirq_pending;
28 unsigned int __nmi_count; /* number of NMI on this CPUs */
29 short mmu_state;
30 short isidle;
31 struct mm_struct *active_mm;
32 unsigned apic_timer_irqs;
33 unsigned irq0_irqs;
34 unsigned irq_resched_count;
35 unsigned irq_call_count;
36 unsigned irq_tlb_count;
37 unsigned irq_thermal_count;
38 unsigned irq_threshold_count;
39 unsigned irq_spurious_count;
40} ____cacheline_aligned_in_smp;
41
42extern struct x8664_pda **_cpu_pda;
43extern void pda_init(int);
44
45#define cpu_pda(i) (_cpu_pda[i])
46
47/*
48 * There is no fast way to get the base address of the PDA, all the accesses
49 * have to mention %fs/%gs. So it needs to be done this Torvaldian way.
50 */
51extern void __bad_pda_field(void) __attribute__((noreturn));
52
53/*
54 * proxy_pda doesn't actually exist, but tell gcc it is accessed for
55 * all PDA accesses so it gets read/write dependencies right.
56 */
57extern struct x8664_pda _proxy_pda;
58
59#define pda_offset(field) offsetof(struct x8664_pda, field)
60
61#define pda_to_op(op, field, val) \
62do { \
63 typedef typeof(_proxy_pda.field) T__; \
64 if (0) { T__ tmp__; tmp__ = (val); } /* type checking */ \
65 switch (sizeof(_proxy_pda.field)) { \
66 case 2: \
67 asm(op "w %1,%%gs:%c2" : \
68 "+m" (_proxy_pda.field) : \
69 "ri" ((T__)val), \
70 "i"(pda_offset(field))); \
71 break; \
72 case 4: \
73 asm(op "l %1,%%gs:%c2" : \
74 "+m" (_proxy_pda.field) : \
75 "ri" ((T__)val), \
76 "i" (pda_offset(field))); \
77 break; \
78 case 8: \
79 asm(op "q %1,%%gs:%c2": \
80 "+m" (_proxy_pda.field) : \
81 "ri" ((T__)val), \
82 "i"(pda_offset(field))); \
83 break; \
84 default: \
85 __bad_pda_field(); \
86 } \
87} while (0)
88
89#define pda_from_op(op, field) \
90({ \
91 typeof(_proxy_pda.field) ret__; \
92 switch (sizeof(_proxy_pda.field)) { \
93 case 2: \
94 asm(op "w %%gs:%c1,%0" : \
95 "=r" (ret__) : \
96 "i" (pda_offset(field)), \
97 "m" (_proxy_pda.field)); \
98 break; \
99 case 4: \
100 asm(op "l %%gs:%c1,%0": \
101 "=r" (ret__): \
102 "i" (pda_offset(field)), \
103 "m" (_proxy_pda.field)); \
104 break; \
105 case 8: \
106 asm(op "q %%gs:%c1,%0": \
107 "=r" (ret__) : \
108 "i" (pda_offset(field)), \
109 "m" (_proxy_pda.field)); \
110 break; \
111 default: \
112 __bad_pda_field(); \
113 } \
114 ret__; \
115})
116
117#define read_pda(field) pda_from_op("mov", field)
118#define write_pda(field, val) pda_to_op("mov", field, val)
119#define add_pda(field, val) pda_to_op("add", field, val)
120#define sub_pda(field, val) pda_to_op("sub", field, val)
121#define or_pda(field, val) pda_to_op("or", field, val)
122
123/* This is not atomic against other CPUs -- CPU preemption needs to be off */
124#define test_and_clear_bit_pda(bit, field) \
125({ \
126 int old__; \
127 asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" \
128 : "=r" (old__), "+m" (_proxy_pda.field) \
129 : "dIr" (bit), "i" (pda_offset(field)) : "memory");\
130 old__; \
131})
132
133#endif
134
135#define PDA_STACKOFFSET (5*8)
136
137#endif /* _ASM_X86_PDA_H */
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index ece72053ba63..aee103b26d01 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -2,53 +2,12 @@
2#define _ASM_X86_PERCPU_H 2#define _ASM_X86_PERCPU_H
3 3
4#ifdef CONFIG_X86_64 4#ifdef CONFIG_X86_64
5#include <linux/compiler.h> 5#define __percpu_seg gs
6 6#define __percpu_mov_op movq
7/* Same as asm-generic/percpu.h, except that we store the per cpu offset 7#else
8 in the PDA. Longer term the PDA and every per cpu variable 8#define __percpu_seg fs
9 should be just put into a single section and referenced directly 9#define __percpu_mov_op movl
10 from %gs */
11
12#ifdef CONFIG_SMP
13#include <asm/pda.h>
14
15#define __per_cpu_offset(cpu) (cpu_pda(cpu)->data_offset)
16#define __my_cpu_offset read_pda(data_offset)
17
18#define per_cpu_offset(x) (__per_cpu_offset(x))
19
20#endif 10#endif
21#include <asm-generic/percpu.h>
22
23DECLARE_PER_CPU(struct x8664_pda, pda);
24
25/*
26 * These are supposed to be implemented as a single instruction which
27 * operates on the per-cpu data base segment. x86-64 doesn't have
28 * that yet, so this is a fairly inefficient workaround for the
29 * meantime. The single instruction is atomic with respect to
30 * preemption and interrupts, so we need to explicitly disable
31 * interrupts here to achieve the same effect. However, because it
32 * can be used from within interrupt-disable/enable, we can't actually
33 * disable interrupts; disabling preemption is enough.
34 */
35#define x86_read_percpu(var) \
36 ({ \
37 typeof(per_cpu_var(var)) __tmp; \
38 preempt_disable(); \
39 __tmp = __get_cpu_var(var); \
40 preempt_enable(); \
41 __tmp; \
42 })
43
44#define x86_write_percpu(var, val) \
45 do { \
46 preempt_disable(); \
47 __get_cpu_var(var) = (val); \
48 preempt_enable(); \
49 } while(0)
50
51#else /* CONFIG_X86_64 */
52 11
53#ifdef __ASSEMBLY__ 12#ifdef __ASSEMBLY__
54 13
@@ -65,47 +24,48 @@ DECLARE_PER_CPU(struct x8664_pda, pda);
65 * PER_CPU(cpu_gdt_descr, %ebx) 24 * PER_CPU(cpu_gdt_descr, %ebx)
66 */ 25 */
67#ifdef CONFIG_SMP 26#ifdef CONFIG_SMP
68#define PER_CPU(var, reg) \ 27#define PER_CPU(var, reg) \
69 movl %fs:per_cpu__##this_cpu_off, reg; \ 28 __percpu_mov_op %__percpu_seg:per_cpu__this_cpu_off, reg; \
70 lea per_cpu__##var(reg), reg 29 lea per_cpu__##var(reg), reg
71#define PER_CPU_VAR(var) %fs:per_cpu__##var 30#define PER_CPU_VAR(var) %__percpu_seg:per_cpu__##var
72#else /* ! SMP */ 31#else /* ! SMP */
73#define PER_CPU(var, reg) \ 32#define PER_CPU(var, reg) \
74 movl $per_cpu__##var, reg 33 __percpu_mov_op $per_cpu__##var, reg
75#define PER_CPU_VAR(var) per_cpu__##var 34#define PER_CPU_VAR(var) per_cpu__##var
76#endif /* SMP */ 35#endif /* SMP */
77 36
37#ifdef CONFIG_X86_64_SMP
38#define INIT_PER_CPU_VAR(var) init_per_cpu__##var
39#else
40#define INIT_PER_CPU_VAR(var) per_cpu__##var
41#endif
42
78#else /* ...!ASSEMBLY */ 43#else /* ...!ASSEMBLY */
79 44
45#include <linux/stringify.h>
46
47#ifdef CONFIG_SMP
48#define __percpu_arg(x) "%%"__stringify(__percpu_seg)":%P" #x
49#define __my_cpu_offset percpu_read(this_cpu_off)
50#else
51#define __percpu_arg(x) "%" #x
52#endif
53
80/* 54/*
81 * PER_CPU finds an address of a per-cpu variable. 55 * Initialized pointers to per-cpu variables needed for the boot
56 * processor need to use these macros to get the proper address
57 * offset from __per_cpu_load on SMP.
82 * 58 *
83 * Args: 59 * There also must be an entry in vmlinux_64.lds.S
84 * var - variable name
85 * cpu - 32bit register containing the current CPU number
86 *
87 * The resulting address is stored in the "cpu" argument.
88 *
89 * Example:
90 * PER_CPU(cpu_gdt_descr, %ebx)
91 */ 60 */
92#ifdef CONFIG_SMP 61#define DECLARE_INIT_PER_CPU(var) \
93 62 extern typeof(per_cpu_var(var)) init_per_cpu_var(var)
94#define __my_cpu_offset x86_read_percpu(this_cpu_off)
95
96/* fs segment starts at (positive) offset == __per_cpu_offset[cpu] */
97#define __percpu_seg "%%fs:"
98
99#else /* !SMP */
100
101#define __percpu_seg ""
102
103#endif /* SMP */
104
105#include <asm-generic/percpu.h>
106 63
107/* We can use this directly for local CPU (faster). */ 64#ifdef CONFIG_X86_64_SMP
108DECLARE_PER_CPU(unsigned long, this_cpu_off); 65#define init_per_cpu_var(var) init_per_cpu__##var
66#else
67#define init_per_cpu_var(var) per_cpu_var(var)
68#endif
109 69
110/* For arch-specific code, we can use direct single-insn ops (they 70/* For arch-specific code, we can use direct single-insn ops (they
111 * don't give an lvalue though). */ 71 * don't give an lvalue though). */
@@ -120,20 +80,25 @@ do { \
120 } \ 80 } \
121 switch (sizeof(var)) { \ 81 switch (sizeof(var)) { \
122 case 1: \ 82 case 1: \
123 asm(op "b %1,"__percpu_seg"%0" \ 83 asm(op "b %1,"__percpu_arg(0) \
124 : "+m" (var) \ 84 : "+m" (var) \
125 : "ri" ((T__)val)); \ 85 : "ri" ((T__)val)); \
126 break; \ 86 break; \
127 case 2: \ 87 case 2: \
128 asm(op "w %1,"__percpu_seg"%0" \ 88 asm(op "w %1,"__percpu_arg(0) \
129 : "+m" (var) \ 89 : "+m" (var) \
130 : "ri" ((T__)val)); \ 90 : "ri" ((T__)val)); \
131 break; \ 91 break; \
132 case 4: \ 92 case 4: \
133 asm(op "l %1,"__percpu_seg"%0" \ 93 asm(op "l %1,"__percpu_arg(0) \
134 : "+m" (var) \ 94 : "+m" (var) \
135 : "ri" ((T__)val)); \ 95 : "ri" ((T__)val)); \
136 break; \ 96 break; \
97 case 8: \
98 asm(op "q %1,"__percpu_arg(0) \
99 : "+m" (var) \
100 : "re" ((T__)val)); \
101 break; \
137 default: __bad_percpu_size(); \ 102 default: __bad_percpu_size(); \
138 } \ 103 } \
139} while (0) 104} while (0)
@@ -143,17 +108,22 @@ do { \
143 typeof(var) ret__; \ 108 typeof(var) ret__; \
144 switch (sizeof(var)) { \ 109 switch (sizeof(var)) { \
145 case 1: \ 110 case 1: \
146 asm(op "b "__percpu_seg"%1,%0" \ 111 asm(op "b "__percpu_arg(1)",%0" \
147 : "=r" (ret__) \ 112 : "=r" (ret__) \
148 : "m" (var)); \ 113 : "m" (var)); \
149 break; \ 114 break; \
150 case 2: \ 115 case 2: \
151 asm(op "w "__percpu_seg"%1,%0" \ 116 asm(op "w "__percpu_arg(1)",%0" \
152 : "=r" (ret__) \ 117 : "=r" (ret__) \
153 : "m" (var)); \ 118 : "m" (var)); \
154 break; \ 119 break; \
155 case 4: \ 120 case 4: \
156 asm(op "l "__percpu_seg"%1,%0" \ 121 asm(op "l "__percpu_arg(1)",%0" \
122 : "=r" (ret__) \
123 : "m" (var)); \
124 break; \
125 case 8: \
126 asm(op "q "__percpu_arg(1)",%0" \
157 : "=r" (ret__) \ 127 : "=r" (ret__) \
158 : "m" (var)); \ 128 : "m" (var)); \
159 break; \ 129 break; \
@@ -162,13 +132,30 @@ do { \
162 ret__; \ 132 ret__; \
163}) 133})
164 134
165#define x86_read_percpu(var) percpu_from_op("mov", per_cpu__##var) 135#define percpu_read(var) percpu_from_op("mov", per_cpu__##var)
166#define x86_write_percpu(var, val) percpu_to_op("mov", per_cpu__##var, val) 136#define percpu_write(var, val) percpu_to_op("mov", per_cpu__##var, val)
167#define x86_add_percpu(var, val) percpu_to_op("add", per_cpu__##var, val) 137#define percpu_add(var, val) percpu_to_op("add", per_cpu__##var, val)
168#define x86_sub_percpu(var, val) percpu_to_op("sub", per_cpu__##var, val) 138#define percpu_sub(var, val) percpu_to_op("sub", per_cpu__##var, val)
169#define x86_or_percpu(var, val) percpu_to_op("or", per_cpu__##var, val) 139#define percpu_and(var, val) percpu_to_op("and", per_cpu__##var, val)
140#define percpu_or(var, val) percpu_to_op("or", per_cpu__##var, val)
141#define percpu_xor(var, val) percpu_to_op("xor", per_cpu__##var, val)
142
143/* This is not atomic against other CPUs -- CPU preemption needs to be off */
144#define x86_test_and_clear_bit_percpu(bit, var) \
145({ \
146 int old__; \
147 asm volatile("btr %2,"__percpu_arg(1)"\n\tsbbl %0,%0" \
148 : "=r" (old__), "+m" (per_cpu__##var) \
149 : "dIr" (bit)); \
150 old__; \
151})
152
153#include <asm-generic/percpu.h>
154
155/* We can use this directly for local CPU (faster). */
156DECLARE_PER_CPU(unsigned long, this_cpu_off);
157
170#endif /* !__ASSEMBLY__ */ 158#endif /* !__ASSEMBLY__ */
171#endif /* !CONFIG_X86_64 */
172 159
173#ifdef CONFIG_SMP 160#ifdef CONFIG_SMP
174 161
@@ -195,9 +182,9 @@ do { \
195#define early_per_cpu_ptr(_name) (_name##_early_ptr) 182#define early_per_cpu_ptr(_name) (_name##_early_ptr)
196#define early_per_cpu_map(_name, _idx) (_name##_early_map[_idx]) 183#define early_per_cpu_map(_name, _idx) (_name##_early_map[_idx])
197#define early_per_cpu(_name, _cpu) \ 184#define early_per_cpu(_name, _cpu) \
198 (early_per_cpu_ptr(_name) ? \ 185 *(early_per_cpu_ptr(_name) ? \
199 early_per_cpu_ptr(_name)[_cpu] : \ 186 &early_per_cpu_ptr(_name)[_cpu] : \
200 per_cpu(_name, _cpu)) 187 &per_cpu(_name, _cpu))
201 188
202#else /* !CONFIG_SMP */ 189#else /* !CONFIG_SMP */
203#define DEFINE_EARLY_PER_CPU(_type, _name, _initvalue) \ 190#define DEFINE_EARLY_PER_CPU(_type, _name, _initvalue) \
diff --git a/arch/x86/include/asm/pgtable-2level.h b/arch/x86/include/asm/pgtable-2level.h
index e0d199fe1d83..c1774ac9da7a 100644
--- a/arch/x86/include/asm/pgtable-2level.h
+++ b/arch/x86/include/asm/pgtable-2level.h
@@ -53,8 +53,6 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp)
53#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) 53#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
54#endif 54#endif
55 55
56#define pte_none(x) (!(x).pte_low)
57
58/* 56/*
59 * Bits _PAGE_BIT_PRESENT, _PAGE_BIT_FILE and _PAGE_BIT_PROTNONE are taken, 57 * Bits _PAGE_BIT_PRESENT, _PAGE_BIT_FILE and _PAGE_BIT_PROTNONE are taken,
60 * split up the 29 bits of offset into this range: 58 * split up the 29 bits of offset into this range:
diff --git a/arch/x86/include/asm/pgtable-2level-defs.h b/arch/x86/include/asm/pgtable-2level_types.h
index d77db8990eaa..daacc23e3fb9 100644
--- a/arch/x86/include/asm/pgtable-2level-defs.h
+++ b/arch/x86/include/asm/pgtable-2level_types.h
@@ -1,7 +1,23 @@
1#ifndef _ASM_X86_PGTABLE_2LEVEL_DEFS_H 1#ifndef _ASM_X86_PGTABLE_2LEVEL_DEFS_H
2#define _ASM_X86_PGTABLE_2LEVEL_DEFS_H 2#define _ASM_X86_PGTABLE_2LEVEL_DEFS_H
3 3
4#ifndef __ASSEMBLY__
5#include <linux/types.h>
6
7typedef unsigned long pteval_t;
8typedef unsigned long pmdval_t;
9typedef unsigned long pudval_t;
10typedef unsigned long pgdval_t;
11typedef unsigned long pgprotval_t;
12
13typedef union {
14 pteval_t pte;
15 pteval_t pte_low;
16} pte_t;
17#endif /* !__ASSEMBLY__ */
18
4#define SHARED_KERNEL_PMD 0 19#define SHARED_KERNEL_PMD 0
20#define PAGETABLE_LEVELS 2
5 21
6/* 22/*
7 * traditional i386 two-level paging structure: 23 * traditional i386 two-level paging structure:
@@ -10,6 +26,7 @@
10#define PGDIR_SHIFT 22 26#define PGDIR_SHIFT 22
11#define PTRS_PER_PGD 1024 27#define PTRS_PER_PGD 1024
12 28
29
13/* 30/*
14 * the i386 is two-level, so we don't really have any 31 * the i386 is two-level, so we don't really have any
15 * PMD directory physically. 32 * PMD directory physically.
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h
index 447da43cddb3..3f13cdf61156 100644
--- a/arch/x86/include/asm/pgtable-3level.h
+++ b/arch/x86/include/asm/pgtable-3level.h
@@ -18,21 +18,6 @@
18 printk("%s:%d: bad pgd %p(%016Lx).\n", \ 18 printk("%s:%d: bad pgd %p(%016Lx).\n", \
19 __FILE__, __LINE__, &(e), pgd_val(e)) 19 __FILE__, __LINE__, &(e), pgd_val(e))
20 20
21static inline int pud_none(pud_t pud)
22{
23 return pud_val(pud) == 0;
24}
25
26static inline int pud_bad(pud_t pud)
27{
28 return (pud_val(pud) & ~(PTE_PFN_MASK | _KERNPG_TABLE | _PAGE_USER)) != 0;
29}
30
31static inline int pud_present(pud_t pud)
32{
33 return pud_val(pud) & _PAGE_PRESENT;
34}
35
36/* Rules for using set_pte: the pte being assigned *must* be 21/* Rules for using set_pte: the pte being assigned *must* be
37 * either not present or in a state where the hardware will 22 * either not present or in a state where the hardware will
38 * not attempt to update the pte. In places where this is 23 * not attempt to update the pte. In places where this is
@@ -120,15 +105,6 @@ static inline void pud_clear(pud_t *pudp)
120 write_cr3(pgd); 105 write_cr3(pgd);
121} 106}
122 107
123#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
124
125#define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK))
126
127
128/* Find an entry in the second-level page table.. */
129#define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \
130 pmd_index(address))
131
132#ifdef CONFIG_SMP 108#ifdef CONFIG_SMP
133static inline pte_t native_ptep_get_and_clear(pte_t *ptep) 109static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
134{ 110{
@@ -145,17 +121,6 @@ static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
145#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp) 121#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
146#endif 122#endif
147 123
148#define __HAVE_ARCH_PTE_SAME
149static inline int pte_same(pte_t a, pte_t b)
150{
151 return a.pte_low == b.pte_low && a.pte_high == b.pte_high;
152}
153
154static inline int pte_none(pte_t pte)
155{
156 return !pte.pte_low && !pte.pte_high;
157}
158
159/* 124/*
160 * Bits 0, 6 and 7 are taken in the low part of the pte, 125 * Bits 0, 6 and 7 are taken in the low part of the pte,
161 * put the 32 bits of offset into the high part. 126 * put the 32 bits of offset into the high part.
diff --git a/arch/x86/include/asm/pgtable-3level-defs.h b/arch/x86/include/asm/pgtable-3level_types.h
index 62561367653c..1bd5876c8649 100644
--- a/arch/x86/include/asm/pgtable-3level-defs.h
+++ b/arch/x86/include/asm/pgtable-3level_types.h
@@ -1,12 +1,31 @@
1#ifndef _ASM_X86_PGTABLE_3LEVEL_DEFS_H 1#ifndef _ASM_X86_PGTABLE_3LEVEL_DEFS_H
2#define _ASM_X86_PGTABLE_3LEVEL_DEFS_H 2#define _ASM_X86_PGTABLE_3LEVEL_DEFS_H
3 3
4#ifndef __ASSEMBLY__
5#include <linux/types.h>
6
7typedef u64 pteval_t;
8typedef u64 pmdval_t;
9typedef u64 pudval_t;
10typedef u64 pgdval_t;
11typedef u64 pgprotval_t;
12
13typedef union {
14 struct {
15 unsigned long pte_low, pte_high;
16 };
17 pteval_t pte;
18} pte_t;
19#endif /* !__ASSEMBLY__ */
20
4#ifdef CONFIG_PARAVIRT 21#ifdef CONFIG_PARAVIRT
5#define SHARED_KERNEL_PMD (pv_info.shared_kernel_pmd) 22#define SHARED_KERNEL_PMD (pv_info.shared_kernel_pmd)
6#else 23#else
7#define SHARED_KERNEL_PMD 1 24#define SHARED_KERNEL_PMD 1
8#endif 25#endif
9 26
27#define PAGETABLE_LEVELS 3
28
10/* 29/*
11 * PGDIR_SHIFT determines what a top-level page table entry can map 30 * PGDIR_SHIFT determines what a top-level page table entry can map
12 */ 31 */
@@ -25,4 +44,5 @@
25 */ 44 */
26#define PTRS_PER_PTE 512 45#define PTRS_PER_PTE 512
27 46
47
28#endif /* _ASM_X86_PGTABLE_3LEVEL_DEFS_H */ 48#endif /* _ASM_X86_PGTABLE_3LEVEL_DEFS_H */
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 4f5af8447d54..d0812e155f1d 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1,164 +1,9 @@
1#ifndef _ASM_X86_PGTABLE_H 1#ifndef _ASM_X86_PGTABLE_H
2#define _ASM_X86_PGTABLE_H 2#define _ASM_X86_PGTABLE_H
3 3
4#define FIRST_USER_ADDRESS 0 4#include <asm/page.h>
5
6#define _PAGE_BIT_PRESENT 0 /* is present */
7#define _PAGE_BIT_RW 1 /* writeable */
8#define _PAGE_BIT_USER 2 /* userspace addressable */
9#define _PAGE_BIT_PWT 3 /* page write through */
10#define _PAGE_BIT_PCD 4 /* page cache disabled */
11#define _PAGE_BIT_ACCESSED 5 /* was accessed (raised by CPU) */
12#define _PAGE_BIT_DIRTY 6 /* was written to (raised by CPU) */
13#define _PAGE_BIT_PSE 7 /* 4 MB (or 2MB) page */
14#define _PAGE_BIT_PAT 7 /* on 4KB pages */
15#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */
16#define _PAGE_BIT_UNUSED1 9 /* available for programmer */
17#define _PAGE_BIT_IOMAP 10 /* flag used to indicate IO mapping */
18#define _PAGE_BIT_UNUSED3 11
19#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */
20#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1
21#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1
22#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */
23
24/* If _PAGE_BIT_PRESENT is clear, we use these: */
25/* - if the user mapped it with PROT_NONE; pte_present gives true */
26#define _PAGE_BIT_PROTNONE _PAGE_BIT_GLOBAL
27/* - set: nonlinear file mapping, saved PTE; unset:swap */
28#define _PAGE_BIT_FILE _PAGE_BIT_DIRTY
29
30#define _PAGE_PRESENT (_AT(pteval_t, 1) << _PAGE_BIT_PRESENT)
31#define _PAGE_RW (_AT(pteval_t, 1) << _PAGE_BIT_RW)
32#define _PAGE_USER (_AT(pteval_t, 1) << _PAGE_BIT_USER)
33#define _PAGE_PWT (_AT(pteval_t, 1) << _PAGE_BIT_PWT)
34#define _PAGE_PCD (_AT(pteval_t, 1) << _PAGE_BIT_PCD)
35#define _PAGE_ACCESSED (_AT(pteval_t, 1) << _PAGE_BIT_ACCESSED)
36#define _PAGE_DIRTY (_AT(pteval_t, 1) << _PAGE_BIT_DIRTY)
37#define _PAGE_PSE (_AT(pteval_t, 1) << _PAGE_BIT_PSE)
38#define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL)
39#define _PAGE_UNUSED1 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED1)
40#define _PAGE_IOMAP (_AT(pteval_t, 1) << _PAGE_BIT_IOMAP)
41#define _PAGE_UNUSED3 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED3)
42#define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT)
43#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
44#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
45#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
46#define __HAVE_ARCH_PTE_SPECIAL
47
48#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
49#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
50#else
51#define _PAGE_NX (_AT(pteval_t, 0))
52#endif
53 5
54#define _PAGE_FILE (_AT(pteval_t, 1) << _PAGE_BIT_FILE) 6#include <asm/pgtable_types.h>
55#define _PAGE_PROTNONE (_AT(pteval_t, 1) << _PAGE_BIT_PROTNONE)
56
57#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \
58 _PAGE_ACCESSED | _PAGE_DIRTY)
59#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \
60 _PAGE_DIRTY)
61
62/* Set of bits not changed in pte_modify */
63#define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \
64 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY)
65
66#define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT)
67#define _PAGE_CACHE_WB (0)
68#define _PAGE_CACHE_WC (_PAGE_PWT)
69#define _PAGE_CACHE_UC_MINUS (_PAGE_PCD)
70#define _PAGE_CACHE_UC (_PAGE_PCD | _PAGE_PWT)
71
72#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
73#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \
74 _PAGE_ACCESSED | _PAGE_NX)
75
76#define PAGE_SHARED_EXEC __pgprot(_PAGE_PRESENT | _PAGE_RW | \
77 _PAGE_USER | _PAGE_ACCESSED)
78#define PAGE_COPY_NOEXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
79 _PAGE_ACCESSED | _PAGE_NX)
80#define PAGE_COPY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
81 _PAGE_ACCESSED)
82#define PAGE_COPY PAGE_COPY_NOEXEC
83#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | \
84 _PAGE_ACCESSED | _PAGE_NX)
85#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
86 _PAGE_ACCESSED)
87
88#define __PAGE_KERNEL_EXEC \
89 (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
90#define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX)
91
92#define __PAGE_KERNEL_RO (__PAGE_KERNEL & ~_PAGE_RW)
93#define __PAGE_KERNEL_RX (__PAGE_KERNEL_EXEC & ~_PAGE_RW)
94#define __PAGE_KERNEL_EXEC_NOCACHE (__PAGE_KERNEL_EXEC | _PAGE_PCD | _PAGE_PWT)
95#define __PAGE_KERNEL_WC (__PAGE_KERNEL | _PAGE_CACHE_WC)
96#define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT)
97#define __PAGE_KERNEL_UC_MINUS (__PAGE_KERNEL | _PAGE_PCD)
98#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RX | _PAGE_USER)
99#define __PAGE_KERNEL_VSYSCALL_NOCACHE (__PAGE_KERNEL_VSYSCALL | _PAGE_PCD | _PAGE_PWT)
100#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
101#define __PAGE_KERNEL_LARGE_NOCACHE (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE)
102#define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
103
104#define __PAGE_KERNEL_IO (__PAGE_KERNEL | _PAGE_IOMAP)
105#define __PAGE_KERNEL_IO_NOCACHE (__PAGE_KERNEL_NOCACHE | _PAGE_IOMAP)
106#define __PAGE_KERNEL_IO_UC_MINUS (__PAGE_KERNEL_UC_MINUS | _PAGE_IOMAP)
107#define __PAGE_KERNEL_IO_WC (__PAGE_KERNEL_WC | _PAGE_IOMAP)
108
109#define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
110#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
111#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
112#define PAGE_KERNEL_RX __pgprot(__PAGE_KERNEL_RX)
113#define PAGE_KERNEL_WC __pgprot(__PAGE_KERNEL_WC)
114#define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE)
115#define PAGE_KERNEL_UC_MINUS __pgprot(__PAGE_KERNEL_UC_MINUS)
116#define PAGE_KERNEL_EXEC_NOCACHE __pgprot(__PAGE_KERNEL_EXEC_NOCACHE)
117#define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE)
118#define PAGE_KERNEL_LARGE_NOCACHE __pgprot(__PAGE_KERNEL_LARGE_NOCACHE)
119#define PAGE_KERNEL_LARGE_EXEC __pgprot(__PAGE_KERNEL_LARGE_EXEC)
120#define PAGE_KERNEL_VSYSCALL __pgprot(__PAGE_KERNEL_VSYSCALL)
121#define PAGE_KERNEL_VSYSCALL_NOCACHE __pgprot(__PAGE_KERNEL_VSYSCALL_NOCACHE)
122
123#define PAGE_KERNEL_IO __pgprot(__PAGE_KERNEL_IO)
124#define PAGE_KERNEL_IO_NOCACHE __pgprot(__PAGE_KERNEL_IO_NOCACHE)
125#define PAGE_KERNEL_IO_UC_MINUS __pgprot(__PAGE_KERNEL_IO_UC_MINUS)
126#define PAGE_KERNEL_IO_WC __pgprot(__PAGE_KERNEL_IO_WC)
127
128/* xwr */
129#define __P000 PAGE_NONE
130#define __P001 PAGE_READONLY
131#define __P010 PAGE_COPY
132#define __P011 PAGE_COPY
133#define __P100 PAGE_READONLY_EXEC
134#define __P101 PAGE_READONLY_EXEC
135#define __P110 PAGE_COPY_EXEC
136#define __P111 PAGE_COPY_EXEC
137
138#define __S000 PAGE_NONE
139#define __S001 PAGE_READONLY
140#define __S010 PAGE_SHARED
141#define __S011 PAGE_SHARED
142#define __S100 PAGE_READONLY_EXEC
143#define __S101 PAGE_READONLY_EXEC
144#define __S110 PAGE_SHARED_EXEC
145#define __S111 PAGE_SHARED_EXEC
146
147/*
148 * early identity mapping pte attrib macros.
149 */
150#ifdef CONFIG_X86_64
151#define __PAGE_KERNEL_IDENT_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
152#else
153/*
154 * For PDE_IDENT_ATTR include USER bit. As the PDE and PTE protection
155 * bits are combined, this will alow user to access the high address mapped
156 * VDSO in the presence of CONFIG_COMPAT_VDSO
157 */
158#define PTE_IDENT_ATTR 0x003 /* PRESENT+RW */
159#define PDE_IDENT_ATTR 0x067 /* PRESENT+RW+USER+DIRTY+ACCESSED */
160#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
161#endif
162 7
163/* 8/*
164 * Macro to mark a page protection value as UC- 9 * Macro to mark a page protection value as UC-
@@ -170,9 +15,6 @@
170 15
171#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
172 17
173#define pgprot_writecombine pgprot_writecombine
174extern pgprot_t pgprot_writecombine(pgprot_t prot);
175
176/* 18/*
177 * ZERO_PAGE is a global shared page that is always zero: used 19 * ZERO_PAGE is a global shared page that is always zero: used
178 * for zero-mapped memory areas etc.. 20 * for zero-mapped memory areas etc..
@@ -183,6 +25,66 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
183extern spinlock_t pgd_lock; 25extern spinlock_t pgd_lock;
184extern struct list_head pgd_list; 26extern struct list_head pgd_list;
185 27
28#ifdef CONFIG_PARAVIRT
29#include <asm/paravirt.h>
30#else /* !CONFIG_PARAVIRT */
31#define set_pte(ptep, pte) native_set_pte(ptep, pte)
32#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)
33
34#define set_pte_present(mm, addr, ptep, pte) \
35 native_set_pte_present(mm, addr, ptep, pte)
36#define set_pte_atomic(ptep, pte) \
37 native_set_pte_atomic(ptep, pte)
38
39#define set_pmd(pmdp, pmd) native_set_pmd(pmdp, pmd)
40
41#ifndef __PAGETABLE_PUD_FOLDED
42#define set_pgd(pgdp, pgd) native_set_pgd(pgdp, pgd)
43#define pgd_clear(pgd) native_pgd_clear(pgd)
44#endif
45
46#ifndef set_pud
47# define set_pud(pudp, pud) native_set_pud(pudp, pud)
48#endif
49
50#ifndef __PAGETABLE_PMD_FOLDED
51#define pud_clear(pud) native_pud_clear(pud)
52#endif
53
54#define pte_clear(mm, addr, ptep) native_pte_clear(mm, addr, ptep)
55#define pmd_clear(pmd) native_pmd_clear(pmd)
56
57#define pte_update(mm, addr, ptep) do { } while (0)
58#define pte_update_defer(mm, addr, ptep) do { } while (0)
59
60static inline void __init paravirt_pagetable_setup_start(pgd_t *base)
61{
62 native_pagetable_setup_start(base);
63}
64
65static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
66{
67 native_pagetable_setup_done(base);
68}
69
70#define pgd_val(x) native_pgd_val(x)
71#define __pgd(x) native_make_pgd(x)
72
73#ifndef __PAGETABLE_PUD_FOLDED
74#define pud_val(x) native_pud_val(x)
75#define __pud(x) native_make_pud(x)
76#endif
77
78#ifndef __PAGETABLE_PMD_FOLDED
79#define pmd_val(x) native_pmd_val(x)
80#define __pmd(x) native_make_pmd(x)
81#endif
82
83#define pte_val(x) native_pte_val(x)
84#define __pte(x) native_make_pte(x)
85
86#endif /* CONFIG_PARAVIRT */
87
186/* 88/*
187 * The following only work if pte_present() is true. 89 * The following only work if pte_present() is true.
188 * Undefined behaviour if not.. 90 * Undefined behaviour if not..
@@ -236,72 +138,84 @@ static inline unsigned long pte_pfn(pte_t pte)
236 138
237static inline int pmd_large(pmd_t pte) 139static inline int pmd_large(pmd_t pte)
238{ 140{
239 return (pmd_val(pte) & (_PAGE_PSE | _PAGE_PRESENT)) == 141 return (pmd_flags(pte) & (_PAGE_PSE | _PAGE_PRESENT)) ==
240 (_PAGE_PSE | _PAGE_PRESENT); 142 (_PAGE_PSE | _PAGE_PRESENT);
241} 143}
242 144
145static inline pte_t pte_set_flags(pte_t pte, pteval_t set)
146{
147 pteval_t v = native_pte_val(pte);
148
149 return native_make_pte(v | set);
150}
151
152static inline pte_t pte_clear_flags(pte_t pte, pteval_t clear)
153{
154 pteval_t v = native_pte_val(pte);
155
156 return native_make_pte(v & ~clear);
157}
158
243static inline pte_t pte_mkclean(pte_t pte) 159static inline pte_t pte_mkclean(pte_t pte)
244{ 160{
245 return __pte(pte_val(pte) & ~_PAGE_DIRTY); 161 return pte_clear_flags(pte, _PAGE_DIRTY);
246} 162}
247 163
248static inline pte_t pte_mkold(pte_t pte) 164static inline pte_t pte_mkold(pte_t pte)
249{ 165{
250 return __pte(pte_val(pte) & ~_PAGE_ACCESSED); 166 return pte_clear_flags(pte, _PAGE_ACCESSED);
251} 167}
252 168
253static inline pte_t pte_wrprotect(pte_t pte) 169static inline pte_t pte_wrprotect(pte_t pte)
254{ 170{
255 return __pte(pte_val(pte) & ~_PAGE_RW); 171 return pte_clear_flags(pte, _PAGE_RW);
256} 172}
257 173
258static inline pte_t pte_mkexec(pte_t pte) 174static inline pte_t pte_mkexec(pte_t pte)
259{ 175{
260 return __pte(pte_val(pte) & ~_PAGE_NX); 176 return pte_clear_flags(pte, _PAGE_NX);
261} 177}
262 178
263static inline pte_t pte_mkdirty(pte_t pte) 179static inline pte_t pte_mkdirty(pte_t pte)
264{ 180{
265 return __pte(pte_val(pte) | _PAGE_DIRTY); 181 return pte_set_flags(pte, _PAGE_DIRTY);
266} 182}
267 183
268static inline pte_t pte_mkyoung(pte_t pte) 184static inline pte_t pte_mkyoung(pte_t pte)
269{ 185{
270 return __pte(pte_val(pte) | _PAGE_ACCESSED); 186 return pte_set_flags(pte, _PAGE_ACCESSED);
271} 187}
272 188
273static inline pte_t pte_mkwrite(pte_t pte) 189static inline pte_t pte_mkwrite(pte_t pte)
274{ 190{
275 return __pte(pte_val(pte) | _PAGE_RW); 191 return pte_set_flags(pte, _PAGE_RW);
276} 192}
277 193
278static inline pte_t pte_mkhuge(pte_t pte) 194static inline pte_t pte_mkhuge(pte_t pte)
279{ 195{
280 return __pte(pte_val(pte) | _PAGE_PSE); 196 return pte_set_flags(pte, _PAGE_PSE);
281} 197}
282 198
283static inline pte_t pte_clrhuge(pte_t pte) 199static inline pte_t pte_clrhuge(pte_t pte)
284{ 200{
285 return __pte(pte_val(pte) & ~_PAGE_PSE); 201 return pte_clear_flags(pte, _PAGE_PSE);
286} 202}
287 203
288static inline pte_t pte_mkglobal(pte_t pte) 204static inline pte_t pte_mkglobal(pte_t pte)
289{ 205{
290 return __pte(pte_val(pte) | _PAGE_GLOBAL); 206 return pte_set_flags(pte, _PAGE_GLOBAL);
291} 207}
292 208
293static inline pte_t pte_clrglobal(pte_t pte) 209static inline pte_t pte_clrglobal(pte_t pte)
294{ 210{
295 return __pte(pte_val(pte) & ~_PAGE_GLOBAL); 211 return pte_clear_flags(pte, _PAGE_GLOBAL);
296} 212}
297 213
298static inline pte_t pte_mkspecial(pte_t pte) 214static inline pte_t pte_mkspecial(pte_t pte)
299{ 215{
300 return __pte(pte_val(pte) | _PAGE_SPECIAL); 216 return pte_set_flags(pte, _PAGE_SPECIAL);
301} 217}
302 218
303extern pteval_t __supported_pte_mask;
304
305/* 219/*
306 * Mask out unsupported bits in a present pgprot. Non-present pgprots 220 * Mask out unsupported bits in a present pgprot. Non-present pgprots
307 * can use those bits for other purposes, so leave them be. 221 * can use those bits for other purposes, so leave them be.
@@ -374,82 +288,197 @@ static inline int is_new_memtype_allowed(unsigned long flags,
374 return 1; 288 return 1;
375} 289}
376 290
377#ifndef __ASSEMBLY__ 291pmd_t *populate_extra_pmd(unsigned long vaddr);
378/* Indicate that x86 has its own track and untrack pfn vma functions */ 292pte_t *populate_extra_pte(unsigned long vaddr);
379#define __HAVE_PFNMAP_TRACKING 293#endif /* __ASSEMBLY__ */
380
381#define __HAVE_PHYS_MEM_ACCESS_PROT
382struct file;
383pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
384 unsigned long size, pgprot_t vma_prot);
385int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
386 unsigned long size, pgprot_t *vma_prot);
387#endif
388
389/* Install a pte for a particular vaddr in kernel space. */
390void set_pte_vaddr(unsigned long vaddr, pte_t pte);
391 294
392#ifdef CONFIG_X86_32 295#ifdef CONFIG_X86_32
393extern void native_pagetable_setup_start(pgd_t *base); 296# include "pgtable_32.h"
394extern void native_pagetable_setup_done(pgd_t *base);
395#else 297#else
396static inline void native_pagetable_setup_start(pgd_t *base) {} 298# include "pgtable_64.h"
397static inline void native_pagetable_setup_done(pgd_t *base) {}
398#endif 299#endif
399 300
400struct seq_file; 301#ifndef __ASSEMBLY__
401extern void arch_report_meminfo(struct seq_file *m); 302#include <linux/mm_types.h>
402 303
403#ifdef CONFIG_PARAVIRT 304static inline int pte_none(pte_t pte)
404#include <asm/paravirt.h> 305{
405#else /* !CONFIG_PARAVIRT */ 306 return !pte.pte;
406#define set_pte(ptep, pte) native_set_pte(ptep, pte) 307}
407#define set_pte_at(mm, addr, ptep, pte) native_set_pte_at(mm, addr, ptep, pte)
408 308
409#define set_pte_present(mm, addr, ptep, pte) \ 309#define __HAVE_ARCH_PTE_SAME
410 native_set_pte_present(mm, addr, ptep, pte) 310static inline int pte_same(pte_t a, pte_t b)
411#define set_pte_atomic(ptep, pte) \ 311{
412 native_set_pte_atomic(ptep, pte) 312 return a.pte == b.pte;
313}
413 314
414#define set_pmd(pmdp, pmd) native_set_pmd(pmdp, pmd) 315static inline int pte_present(pte_t a)
316{
317 return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE);
318}
415 319
416#ifndef __PAGETABLE_PUD_FOLDED 320static inline int pmd_present(pmd_t pmd)
417#define set_pgd(pgdp, pgd) native_set_pgd(pgdp, pgd) 321{
418#define pgd_clear(pgd) native_pgd_clear(pgd) 322 return pmd_flags(pmd) & _PAGE_PRESENT;
419#endif 323}
420 324
421#ifndef set_pud 325static inline int pmd_none(pmd_t pmd)
422# define set_pud(pudp, pud) native_set_pud(pudp, pud) 326{
423#endif 327 /* Only check low word on 32-bit platforms, since it might be
328 out of sync with upper half. */
329 return (unsigned long)native_pmd_val(pmd) == 0;
330}
424 331
425#ifndef __PAGETABLE_PMD_FOLDED 332static inline unsigned long pmd_page_vaddr(pmd_t pmd)
426#define pud_clear(pud) native_pud_clear(pud) 333{
427#endif 334 return (unsigned long)__va(pmd_val(pmd) & PTE_PFN_MASK);
335}
428 336
429#define pte_clear(mm, addr, ptep) native_pte_clear(mm, addr, ptep) 337/*
430#define pmd_clear(pmd) native_pmd_clear(pmd) 338 * Currently stuck as a macro due to indirect forward reference to
339 * linux/mmzone.h's __section_mem_map_addr() definition:
340 */
341#define pmd_page(pmd) pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
431 342
432#define pte_update(mm, addr, ptep) do { } while (0) 343/*
433#define pte_update_defer(mm, addr, ptep) do { } while (0) 344 * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
345 *
346 * this macro returns the index of the entry in the pmd page which would
347 * control the given virtual address
348 */
349static inline unsigned pmd_index(unsigned long address)
350{
351 return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
352}
434 353
435static inline void __init paravirt_pagetable_setup_start(pgd_t *base) 354/*
355 * Conversion functions: convert a page and protection to a page entry,
356 * and a page entry and page directory to the page they refer to.
357 *
358 * (Currently stuck as a macro because of indirect forward reference
359 * to linux/mm.h:page_to_nid())
360 */
361#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
362
363/*
364 * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
365 *
366 * this function returns the index of the entry in the pte page which would
367 * control the given virtual address
368 */
369static inline unsigned pte_index(unsigned long address)
436{ 370{
437 native_pagetable_setup_start(base); 371 return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
438} 372}
439 373
440static inline void __init paravirt_pagetable_setup_done(pgd_t *base) 374static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address)
441{ 375{
442 native_pagetable_setup_done(base); 376 return (pte_t *)pmd_page_vaddr(*pmd) + pte_index(address);
443} 377}
444#endif /* CONFIG_PARAVIRT */
445 378
446#endif /* __ASSEMBLY__ */ 379static inline int pmd_bad(pmd_t pmd)
380{
381 return (pmd_flags(pmd) & ~_PAGE_USER) != _KERNPG_TABLE;
382}
447 383
448#ifdef CONFIG_X86_32 384static inline unsigned long pages_to_mb(unsigned long npg)
449# include "pgtable_32.h" 385{
386 return npg >> (20 - PAGE_SHIFT);
387}
388
389#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
390 remap_pfn_range(vma, vaddr, pfn, size, prot)
391
392#if PAGETABLE_LEVELS > 2
393static inline int pud_none(pud_t pud)
394{
395 return native_pud_val(pud) == 0;
396}
397
398static inline int pud_present(pud_t pud)
399{
400 return pud_flags(pud) & _PAGE_PRESENT;
401}
402
403static inline unsigned long pud_page_vaddr(pud_t pud)
404{
405 return (unsigned long)__va((unsigned long)pud_val(pud) & PTE_PFN_MASK);
406}
407
408/*
409 * Currently stuck as a macro due to indirect forward reference to
410 * linux/mmzone.h's __section_mem_map_addr() definition:
411 */
412#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
413
414/* Find an entry in the second-level page table.. */
415static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
416{
417 return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
418}
419
420static inline unsigned long pmd_pfn(pmd_t pmd)
421{
422 return (pmd_val(pmd) & PTE_PFN_MASK) >> PAGE_SHIFT;
423}
424
425static inline int pud_large(pud_t pud)
426{
427 return (pud_val(pud) & (_PAGE_PSE | _PAGE_PRESENT)) ==
428 (_PAGE_PSE | _PAGE_PRESENT);
429}
430
431static inline int pud_bad(pud_t pud)
432{
433 return (pud_flags(pud) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
434}
450#else 435#else
451# include "pgtable_64.h" 436static inline int pud_large(pud_t pud)
452#endif 437{
438 return 0;
439}
440#endif /* PAGETABLE_LEVELS > 2 */
441
442#if PAGETABLE_LEVELS > 3
443static inline int pgd_present(pgd_t pgd)
444{
445 return pgd_flags(pgd) & _PAGE_PRESENT;
446}
447
448static inline unsigned long pgd_page_vaddr(pgd_t pgd)
449{
450 return (unsigned long)__va((unsigned long)pgd_val(pgd) & PTE_PFN_MASK);
451}
452
453/*
454 * Currently stuck as a macro due to indirect forward reference to
455 * linux/mmzone.h's __section_mem_map_addr() definition:
456 */
457#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)
458
459/* to find an entry in a page-table-directory. */
460static inline unsigned pud_index(unsigned long address)
461{
462 return (address >> PUD_SHIFT) & (PTRS_PER_PUD - 1);
463}
464
465static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
466{
467 return (pud_t *)pgd_page_vaddr(*pgd) + pud_index(address);
468}
469
470static inline int pgd_bad(pgd_t pgd)
471{
472 return (pgd_flags(pgd) & ~_PAGE_USER) != _KERNPG_TABLE;
473}
474
475static inline int pgd_none(pgd_t pgd)
476{
477 return !native_pgd_val(pgd);
478}
479#endif /* PAGETABLE_LEVELS > 3 */
480
481#endif /* __ASSEMBLY__ */
453 482
454/* 483/*
455 * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD] 484 * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
@@ -476,28 +505,6 @@ static inline void __init paravirt_pagetable_setup_done(pgd_t *base)
476 505
477#ifndef __ASSEMBLY__ 506#ifndef __ASSEMBLY__
478 507
479enum {
480 PG_LEVEL_NONE,
481 PG_LEVEL_4K,
482 PG_LEVEL_2M,
483 PG_LEVEL_1G,
484 PG_LEVEL_NUM
485};
486
487#ifdef CONFIG_PROC_FS
488extern void update_page_count(int level, unsigned long pages);
489#else
490static inline void update_page_count(int level, unsigned long pages) { }
491#endif
492
493/*
494 * Helper function that returns the kernel pagetable entry controlling
495 * the virtual address 'address'. NULL means no pagetable entry present.
496 * NOTE: the return type is pte_t but if the pmd is PSE then we return it
497 * as a pte too.
498 */
499extern pte_t *lookup_address(unsigned long address, unsigned int *level);
500
501/* local pte updates need not use xchg for locking */ 508/* local pte updates need not use xchg for locking */
502static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep) 509static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
503{ 510{
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h
index 72b020deb46b..97612fc7632f 100644
--- a/arch/x86/include/asm/pgtable_32.h
+++ b/arch/x86/include/asm/pgtable_32.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_X86_PGTABLE_32_H 1#ifndef _ASM_X86_PGTABLE_32_H
2#define _ASM_X86_PGTABLE_32_H 2#define _ASM_X86_PGTABLE_32_H
3 3
4#include <asm/pgtable_32_types.h>
4 5
5/* 6/*
6 * The Linux memory management assumes a three-level page table setup. On 7 * The Linux memory management assumes a three-level page table setup. On
@@ -33,47 +34,6 @@ void paging_init(void);
33 34
34extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); 35extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
35 36
36/*
37 * The Linux x86 paging architecture is 'compile-time dual-mode', it
38 * implements both the traditional 2-level x86 page tables and the
39 * newer 3-level PAE-mode page tables.
40 */
41#ifdef CONFIG_X86_PAE
42# include <asm/pgtable-3level-defs.h>
43# define PMD_SIZE (1UL << PMD_SHIFT)
44# define PMD_MASK (~(PMD_SIZE - 1))
45#else
46# include <asm/pgtable-2level-defs.h>
47#endif
48
49#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
50#define PGDIR_MASK (~(PGDIR_SIZE - 1))
51
52/* Just any arbitrary offset to the start of the vmalloc VM area: the
53 * current 8MB value just means that there will be a 8MB "hole" after the
54 * physical memory until the kernel virtual memory starts. That means that
55 * any out-of-bounds memory accesses will hopefully be caught.
56 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
57 * area for the same reason. ;)
58 */
59#define VMALLOC_OFFSET (8 * 1024 * 1024)
60#define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET)
61#ifdef CONFIG_X86_PAE
62#define LAST_PKMAP 512
63#else
64#define LAST_PKMAP 1024
65#endif
66
67#define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE * (LAST_PKMAP + 1)) \
68 & PMD_MASK)
69
70#ifdef CONFIG_HIGHMEM
71# define VMALLOC_END (PKMAP_BASE - 2 * PAGE_SIZE)
72#else
73# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE)
74#endif
75
76#define MAXMEM (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE)
77 37
78/* 38/*
79 * Define this if things work differently on an i386 and an i486: 39 * Define this if things work differently on an i386 and an i486:
@@ -85,55 +45,12 @@ extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t);
85/* The boot page tables (all created as a single array) */ 45/* The boot page tables (all created as a single array) */
86extern unsigned long pg0[]; 46extern unsigned long pg0[];
87 47
88#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
89
90/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
91#define pmd_none(x) (!(unsigned long)pmd_val((x)))
92#define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)
93#define pmd_bad(x) ((pmd_val(x) & (PTE_FLAGS_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
94
95#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
96
97#ifdef CONFIG_X86_PAE 48#ifdef CONFIG_X86_PAE
98# include <asm/pgtable-3level.h> 49# include <asm/pgtable-3level.h>
99#else 50#else
100# include <asm/pgtable-2level.h> 51# include <asm/pgtable-2level.h>
101#endif 52#endif
102 53
103/*
104 * Conversion functions: convert a page and protection to a page entry,
105 * and a page entry and page directory to the page they refer to.
106 */
107#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
108
109
110static inline int pud_large(pud_t pud) { return 0; }
111
112/*
113 * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
114 *
115 * this macro returns the index of the entry in the pmd page which would
116 * control the given virtual address
117 */
118#define pmd_index(address) \
119 (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
120
121/*
122 * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
123 *
124 * this macro returns the index of the entry in the pte page which would
125 * control the given virtual address
126 */
127#define pte_index(address) \
128 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
129#define pte_offset_kernel(dir, address) \
130 ((pte_t *)pmd_page_vaddr(*(dir)) + pte_index((address)))
131
132#define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT))
133
134#define pmd_page_vaddr(pmd) \
135 ((unsigned long)__va(pmd_val((pmd)) & PTE_PFN_MASK))
136
137#if defined(CONFIG_HIGHPTE) 54#if defined(CONFIG_HIGHPTE)
138#define pte_offset_map(dir, address) \ 55#define pte_offset_map(dir, address) \
139 ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \ 56 ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)), KM_PTE0) + \
@@ -176,7 +93,4 @@ do { \
176#define kern_addr_valid(kaddr) (0) 93#define kern_addr_valid(kaddr) (0)
177#endif 94#endif
178 95
179#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
180 remap_pfn_range(vma, vaddr, pfn, size, prot)
181
182#endif /* _ASM_X86_PGTABLE_32_H */ 96#endif /* _ASM_X86_PGTABLE_32_H */
diff --git a/arch/x86/include/asm/pgtable_32_types.h b/arch/x86/include/asm/pgtable_32_types.h
new file mode 100644
index 000000000000..bd8df3b2fe04
--- /dev/null
+++ b/arch/x86/include/asm/pgtable_32_types.h
@@ -0,0 +1,46 @@
1#ifndef _ASM_X86_PGTABLE_32_DEFS_H
2#define _ASM_X86_PGTABLE_32_DEFS_H
3
4/*
5 * The Linux x86 paging architecture is 'compile-time dual-mode', it
6 * implements both the traditional 2-level x86 page tables and the
7 * newer 3-level PAE-mode page tables.
8 */
9#ifdef CONFIG_X86_PAE
10# include <asm/pgtable-3level_types.h>
11# define PMD_SIZE (1UL << PMD_SHIFT)
12# define PMD_MASK (~(PMD_SIZE - 1))
13#else
14# include <asm/pgtable-2level_types.h>
15#endif
16
17#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
18#define PGDIR_MASK (~(PGDIR_SIZE - 1))
19
20/* Just any arbitrary offset to the start of the vmalloc VM area: the
21 * current 8MB value just means that there will be a 8MB "hole" after the
22 * physical memory until the kernel virtual memory starts. That means that
23 * any out-of-bounds memory accesses will hopefully be caught.
24 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
25 * area for the same reason. ;)
26 */
27#define VMALLOC_OFFSET (8 * 1024 * 1024)
28#define VMALLOC_START ((unsigned long)high_memory + VMALLOC_OFFSET)
29#ifdef CONFIG_X86_PAE
30#define LAST_PKMAP 512
31#else
32#define LAST_PKMAP 1024
33#endif
34
35#define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE * (LAST_PKMAP + 1)) \
36 & PMD_MASK)
37
38#ifdef CONFIG_HIGHMEM
39# define VMALLOC_END (PKMAP_BASE - 2 * PAGE_SIZE)
40#else
41# define VMALLOC_END (FIXADDR_START - 2 * PAGE_SIZE)
42#endif
43
44#define MAXMEM (VMALLOC_END - PAGE_OFFSET - __VMALLOC_RESERVE)
45
46#endif /* _ASM_X86_PGTABLE_32_DEFS_H */
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index ba09289accaa..6b87bc6d5018 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -2,6 +2,8 @@
2#define _ASM_X86_PGTABLE_64_H 2#define _ASM_X86_PGTABLE_64_H
3 3
4#include <linux/const.h> 4#include <linux/const.h>
5#include <asm/pgtable_64_types.h>
6
5#ifndef __ASSEMBLY__ 7#ifndef __ASSEMBLY__
6 8
7/* 9/*
@@ -11,7 +13,6 @@
11#include <asm/processor.h> 13#include <asm/processor.h>
12#include <linux/bitops.h> 14#include <linux/bitops.h>
13#include <linux/threads.h> 15#include <linux/threads.h>
14#include <asm/pda.h>
15 16
16extern pud_t level3_kernel_pgt[512]; 17extern pud_t level3_kernel_pgt[512];
17extern pud_t level3_ident_pgt[512]; 18extern pud_t level3_ident_pgt[512];
@@ -26,32 +27,6 @@ extern void paging_init(void);
26 27
27#endif /* !__ASSEMBLY__ */ 28#endif /* !__ASSEMBLY__ */
28 29
29#define SHARED_KERNEL_PMD 0
30
31/*
32 * PGDIR_SHIFT determines what a top-level page table entry can map
33 */
34#define PGDIR_SHIFT 39
35#define PTRS_PER_PGD 512
36
37/*
38 * 3rd level page
39 */
40#define PUD_SHIFT 30
41#define PTRS_PER_PUD 512
42
43/*
44 * PMD_SHIFT determines the size of the area a middle-level
45 * page table can map
46 */
47#define PMD_SHIFT 21
48#define PTRS_PER_PMD 512
49
50/*
51 * entries per page directory level
52 */
53#define PTRS_PER_PTE 512
54
55#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
56 31
57#define pte_ERROR(e) \ 32#define pte_ERROR(e) \
@@ -67,9 +42,6 @@ extern void paging_init(void);
67 printk("%s:%d: bad pgd %p(%016lx).\n", \ 42 printk("%s:%d: bad pgd %p(%016lx).\n", \
68 __FILE__, __LINE__, &(e), pgd_val(e)) 43 __FILE__, __LINE__, &(e), pgd_val(e))
69 44
70#define pgd_none(x) (!pgd_val(x))
71#define pud_none(x) (!pud_val(x))
72
73struct mm_struct; 45struct mm_struct;
74 46
75void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte); 47void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte);
@@ -134,48 +106,6 @@ static inline void native_pgd_clear(pgd_t *pgd)
134 native_set_pgd(pgd, native_make_pgd(0)); 106 native_set_pgd(pgd, native_make_pgd(0));
135} 107}
136 108
137#define pte_same(a, b) ((a).pte == (b).pte)
138
139#endif /* !__ASSEMBLY__ */
140
141#define PMD_SIZE (_AC(1, UL) << PMD_SHIFT)
142#define PMD_MASK (~(PMD_SIZE - 1))
143#define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
144#define PUD_MASK (~(PUD_SIZE - 1))
145#define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT)
146#define PGDIR_MASK (~(PGDIR_SIZE - 1))
147
148
149#define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL)
150#define VMALLOC_START _AC(0xffffc20000000000, UL)
151#define VMALLOC_END _AC(0xffffe1ffffffffff, UL)
152#define VMEMMAP_START _AC(0xffffe20000000000, UL)
153#define MODULES_VADDR _AC(0xffffffffa0000000, UL)
154#define MODULES_END _AC(0xffffffffff000000, UL)
155#define MODULES_LEN (MODULES_END - MODULES_VADDR)
156
157#ifndef __ASSEMBLY__
158
159static inline int pgd_bad(pgd_t pgd)
160{
161 return (pgd_val(pgd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
162}
163
164static inline int pud_bad(pud_t pud)
165{
166 return (pud_val(pud) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
167}
168
169static inline int pmd_bad(pmd_t pmd)
170{
171 return (pmd_val(pmd) & ~(PTE_PFN_MASK | _PAGE_USER)) != _KERNPG_TABLE;
172}
173
174#define pte_none(x) (!pte_val((x)))
175#define pte_present(x) (pte_val((x)) & (_PAGE_PRESENT | _PAGE_PROTNONE))
176
177#define pages_to_mb(x) ((x) >> (20 - PAGE_SHIFT)) /* FIXME: is this right? */
178
179/* 109/*
180 * Conversion functions: convert a page and protection to a page entry, 110 * Conversion functions: convert a page and protection to a page entry,
181 * and a page entry and page directory to the page they refer to. 111 * and a page entry and page directory to the page they refer to.
@@ -184,41 +114,12 @@ static inline int pmd_bad(pmd_t pmd)
184/* 114/*
185 * Level 4 access. 115 * Level 4 access.
186 */ 116 */
187#define pgd_page_vaddr(pgd) \
188 ((unsigned long)__va((unsigned long)pgd_val((pgd)) & PTE_PFN_MASK))
189#define pgd_page(pgd) (pfn_to_page(pgd_val((pgd)) >> PAGE_SHIFT))
190#define pgd_present(pgd) (pgd_val(pgd) & _PAGE_PRESENT)
191static inline int pgd_large(pgd_t pgd) { return 0; } 117static inline int pgd_large(pgd_t pgd) { return 0; }
192#define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE) 118#define mk_kernel_pgd(address) __pgd((address) | _KERNPG_TABLE)
193 119
194/* PUD - Level3 access */ 120/* PUD - Level3 access */
195/* to find an entry in a page-table-directory. */
196#define pud_page_vaddr(pud) \
197 ((unsigned long)__va(pud_val((pud)) & PHYSICAL_PAGE_MASK))
198#define pud_page(pud) (pfn_to_page(pud_val((pud)) >> PAGE_SHIFT))
199#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
200#define pud_offset(pgd, address) \
201 ((pud_t *)pgd_page_vaddr(*(pgd)) + pud_index((address)))
202#define pud_present(pud) (pud_val((pud)) & _PAGE_PRESENT)
203
204static inline int pud_large(pud_t pte)
205{
206 return (pud_val(pte) & (_PAGE_PSE | _PAGE_PRESENT)) ==
207 (_PAGE_PSE | _PAGE_PRESENT);
208}
209 121
210/* PMD - Level 2 access */ 122/* PMD - Level 2 access */
211#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val((pmd)) & PTE_PFN_MASK))
212#define pmd_page(pmd) (pfn_to_page(pmd_val((pmd)) >> PAGE_SHIFT))
213
214#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
215#define pmd_offset(dir, address) ((pmd_t *)pud_page_vaddr(*(dir)) + \
216 pmd_index(address))
217#define pmd_none(x) (!pmd_val((x)))
218#define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)
219#define pfn_pmd(nr, prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val((prot))))
220#define pmd_pfn(x) ((pmd_val((x)) & __PHYSICAL_MASK) >> PAGE_SHIFT)
221
222#define pte_to_pgoff(pte) ((pte_val((pte)) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT) 123#define pte_to_pgoff(pte) ((pte_val((pte)) & PHYSICAL_PAGE_MASK) >> PAGE_SHIFT)
223#define pgoff_to_pte(off) ((pte_t) { .pte = ((off) << PAGE_SHIFT) | \ 124#define pgoff_to_pte(off) ((pte_t) { .pte = ((off) << PAGE_SHIFT) | \
224 _PAGE_FILE }) 125 _PAGE_FILE })
@@ -226,13 +127,6 @@ static inline int pud_large(pud_t pte)
226 127
227/* PTE - Level 1 access. */ 128/* PTE - Level 1 access. */
228 129
229/* page, protection -> pte */
230#define mk_pte(page, pgprot) pfn_pte(page_to_pfn((page)), (pgprot))
231
232#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
233#define pte_offset_kernel(dir, address) ((pte_t *) pmd_page_vaddr(*(dir)) + \
234 pte_index((address)))
235
236/* x86-64 always has all page tables mapped. */ 130/* x86-64 always has all page tables mapped. */
237#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address)) 131#define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
238#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address)) 132#define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
@@ -266,9 +160,6 @@ extern int direct_gbpages;
266extern int kern_addr_valid(unsigned long addr); 160extern int kern_addr_valid(unsigned long addr);
267extern void cleanup_highmap(void); 161extern void cleanup_highmap(void);
268 162
269#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
270 remap_pfn_range(vma, vaddr, pfn, size, prot)
271
272#define HAVE_ARCH_UNMAPPED_AREA 163#define HAVE_ARCH_UNMAPPED_AREA
273#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN 164#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
274 165
diff --git a/arch/x86/include/asm/pgtable_64_types.h b/arch/x86/include/asm/pgtable_64_types.h
new file mode 100644
index 000000000000..fbf42b8e0383
--- /dev/null
+++ b/arch/x86/include/asm/pgtable_64_types.h
@@ -0,0 +1,63 @@
1#ifndef _ASM_X86_PGTABLE_64_DEFS_H
2#define _ASM_X86_PGTABLE_64_DEFS_H
3
4#ifndef __ASSEMBLY__
5#include <linux/types.h>
6
7/*
8 * These are used to make use of C type-checking..
9 */
10typedef unsigned long pteval_t;
11typedef unsigned long pmdval_t;
12typedef unsigned long pudval_t;
13typedef unsigned long pgdval_t;
14typedef unsigned long pgprotval_t;
15
16typedef struct { pteval_t pte; } pte_t;
17
18#endif /* !__ASSEMBLY__ */
19
20#define SHARED_KERNEL_PMD 0
21#define PAGETABLE_LEVELS 4
22
23/*
24 * PGDIR_SHIFT determines what a top-level page table entry can map
25 */
26#define PGDIR_SHIFT 39
27#define PTRS_PER_PGD 512
28
29/*
30 * 3rd level page
31 */
32#define PUD_SHIFT 30
33#define PTRS_PER_PUD 512
34
35/*
36 * PMD_SHIFT determines the size of the area a middle-level
37 * page table can map
38 */
39#define PMD_SHIFT 21
40#define PTRS_PER_PMD 512
41
42/*
43 * entries per page directory level
44 */
45#define PTRS_PER_PTE 512
46
47#define PMD_SIZE (_AC(1, UL) << PMD_SHIFT)
48#define PMD_MASK (~(PMD_SIZE - 1))
49#define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
50#define PUD_MASK (~(PUD_SIZE - 1))
51#define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT)
52#define PGDIR_MASK (~(PGDIR_SIZE - 1))
53
54
55#define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL)
56#define VMALLOC_START _AC(0xffffc20000000000, UL)
57#define VMALLOC_END _AC(0xffffe1ffffffffff, UL)
58#define VMEMMAP_START _AC(0xffffe20000000000, UL)
59#define MODULES_VADDR _AC(0xffffffffa0000000, UL)
60#define MODULES_END _AC(0xffffffffff000000, UL)
61#define MODULES_LEN (MODULES_END - MODULES_VADDR)
62
63#endif /* _ASM_X86_PGTABLE_64_DEFS_H */
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
new file mode 100644
index 000000000000..4d258ad76a0f
--- /dev/null
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -0,0 +1,328 @@
1#ifndef _ASM_X86_PGTABLE_DEFS_H
2#define _ASM_X86_PGTABLE_DEFS_H
3
4#include <linux/const.h>
5#include <asm/page_types.h>
6
7#define FIRST_USER_ADDRESS 0
8
9#define _PAGE_BIT_PRESENT 0 /* is present */
10#define _PAGE_BIT_RW 1 /* writeable */
11#define _PAGE_BIT_USER 2 /* userspace addressable */
12#define _PAGE_BIT_PWT 3 /* page write through */
13#define _PAGE_BIT_PCD 4 /* page cache disabled */
14#define _PAGE_BIT_ACCESSED 5 /* was accessed (raised by CPU) */
15#define _PAGE_BIT_DIRTY 6 /* was written to (raised by CPU) */
16#define _PAGE_BIT_PSE 7 /* 4 MB (or 2MB) page */
17#define _PAGE_BIT_PAT 7 /* on 4KB pages */
18#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */
19#define _PAGE_BIT_UNUSED1 9 /* available for programmer */
20#define _PAGE_BIT_IOMAP 10 /* flag used to indicate IO mapping */
21#define _PAGE_BIT_UNUSED3 11
22#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */
23#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1
24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1
25#define _PAGE_BIT_NX 63 /* No execute: only valid after cpuid check */
26
27/* If _PAGE_BIT_PRESENT is clear, we use these: */
28/* - if the user mapped it with PROT_NONE; pte_present gives true */
29#define _PAGE_BIT_PROTNONE _PAGE_BIT_GLOBAL
30/* - set: nonlinear file mapping, saved PTE; unset:swap */
31#define _PAGE_BIT_FILE _PAGE_BIT_DIRTY
32
33#define _PAGE_PRESENT (_AT(pteval_t, 1) << _PAGE_BIT_PRESENT)
34#define _PAGE_RW (_AT(pteval_t, 1) << _PAGE_BIT_RW)
35#define _PAGE_USER (_AT(pteval_t, 1) << _PAGE_BIT_USER)
36#define _PAGE_PWT (_AT(pteval_t, 1) << _PAGE_BIT_PWT)
37#define _PAGE_PCD (_AT(pteval_t, 1) << _PAGE_BIT_PCD)
38#define _PAGE_ACCESSED (_AT(pteval_t, 1) << _PAGE_BIT_ACCESSED)
39#define _PAGE_DIRTY (_AT(pteval_t, 1) << _PAGE_BIT_DIRTY)
40#define _PAGE_PSE (_AT(pteval_t, 1) << _PAGE_BIT_PSE)
41#define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL)
42#define _PAGE_UNUSED1 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED1)
43#define _PAGE_IOMAP (_AT(pteval_t, 1) << _PAGE_BIT_IOMAP)
44#define _PAGE_UNUSED3 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED3)
45#define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT)
46#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
47#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
48#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
49#define __HAVE_ARCH_PTE_SPECIAL
50
51#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
52#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
53#else
54#define _PAGE_NX (_AT(pteval_t, 0))
55#endif
56
57#define _PAGE_FILE (_AT(pteval_t, 1) << _PAGE_BIT_FILE)
58#define _PAGE_PROTNONE (_AT(pteval_t, 1) << _PAGE_BIT_PROTNONE)
59
60#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \
61 _PAGE_ACCESSED | _PAGE_DIRTY)
62#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \
63 _PAGE_DIRTY)
64
65/* Set of bits not changed in pte_modify */
66#define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \
67 _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY)
68
69#define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT)
70#define _PAGE_CACHE_WB (0)
71#define _PAGE_CACHE_WC (_PAGE_PWT)
72#define _PAGE_CACHE_UC_MINUS (_PAGE_PCD)
73#define _PAGE_CACHE_UC (_PAGE_PCD | _PAGE_PWT)
74
75#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
76#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | \
77 _PAGE_ACCESSED | _PAGE_NX)
78
79#define PAGE_SHARED_EXEC __pgprot(_PAGE_PRESENT | _PAGE_RW | \
80 _PAGE_USER | _PAGE_ACCESSED)
81#define PAGE_COPY_NOEXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
82 _PAGE_ACCESSED | _PAGE_NX)
83#define PAGE_COPY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
84 _PAGE_ACCESSED)
85#define PAGE_COPY PAGE_COPY_NOEXEC
86#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | \
87 _PAGE_ACCESSED | _PAGE_NX)
88#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | \
89 _PAGE_ACCESSED)
90
91#define __PAGE_KERNEL_EXEC \
92 (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
93#define __PAGE_KERNEL (__PAGE_KERNEL_EXEC | _PAGE_NX)
94
95#define __PAGE_KERNEL_RO (__PAGE_KERNEL & ~_PAGE_RW)
96#define __PAGE_KERNEL_RX (__PAGE_KERNEL_EXEC & ~_PAGE_RW)
97#define __PAGE_KERNEL_EXEC_NOCACHE (__PAGE_KERNEL_EXEC | _PAGE_PCD | _PAGE_PWT)
98#define __PAGE_KERNEL_WC (__PAGE_KERNEL | _PAGE_CACHE_WC)
99#define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT)
100#define __PAGE_KERNEL_UC_MINUS (__PAGE_KERNEL | _PAGE_PCD)
101#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RX | _PAGE_USER)
102#define __PAGE_KERNEL_VSYSCALL_NOCACHE (__PAGE_KERNEL_VSYSCALL | _PAGE_PCD | _PAGE_PWT)
103#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
104#define __PAGE_KERNEL_LARGE_NOCACHE (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE)
105#define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
106
107#define __PAGE_KERNEL_IO (__PAGE_KERNEL | _PAGE_IOMAP)
108#define __PAGE_KERNEL_IO_NOCACHE (__PAGE_KERNEL_NOCACHE | _PAGE_IOMAP)
109#define __PAGE_KERNEL_IO_UC_MINUS (__PAGE_KERNEL_UC_MINUS | _PAGE_IOMAP)
110#define __PAGE_KERNEL_IO_WC (__PAGE_KERNEL_WC | _PAGE_IOMAP)
111
112#define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
113#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
114#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
115#define PAGE_KERNEL_RX __pgprot(__PAGE_KERNEL_RX)
116#define PAGE_KERNEL_WC __pgprot(__PAGE_KERNEL_WC)
117#define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE)
118#define PAGE_KERNEL_UC_MINUS __pgprot(__PAGE_KERNEL_UC_MINUS)
119#define PAGE_KERNEL_EXEC_NOCACHE __pgprot(__PAGE_KERNEL_EXEC_NOCACHE)
120#define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE)
121#define PAGE_KERNEL_LARGE_NOCACHE __pgprot(__PAGE_KERNEL_LARGE_NOCACHE)
122#define PAGE_KERNEL_LARGE_EXEC __pgprot(__PAGE_KERNEL_LARGE_EXEC)
123#define PAGE_KERNEL_VSYSCALL __pgprot(__PAGE_KERNEL_VSYSCALL)
124#define PAGE_KERNEL_VSYSCALL_NOCACHE __pgprot(__PAGE_KERNEL_VSYSCALL_NOCACHE)
125
126#define PAGE_KERNEL_IO __pgprot(__PAGE_KERNEL_IO)
127#define PAGE_KERNEL_IO_NOCACHE __pgprot(__PAGE_KERNEL_IO_NOCACHE)
128#define PAGE_KERNEL_IO_UC_MINUS __pgprot(__PAGE_KERNEL_IO_UC_MINUS)
129#define PAGE_KERNEL_IO_WC __pgprot(__PAGE_KERNEL_IO_WC)
130
131/* xwr */
132#define __P000 PAGE_NONE
133#define __P001 PAGE_READONLY
134#define __P010 PAGE_COPY
135#define __P011 PAGE_COPY
136#define __P100 PAGE_READONLY_EXEC
137#define __P101 PAGE_READONLY_EXEC
138#define __P110 PAGE_COPY_EXEC
139#define __P111 PAGE_COPY_EXEC
140
141#define __S000 PAGE_NONE
142#define __S001 PAGE_READONLY
143#define __S010 PAGE_SHARED
144#define __S011 PAGE_SHARED
145#define __S100 PAGE_READONLY_EXEC
146#define __S101 PAGE_READONLY_EXEC
147#define __S110 PAGE_SHARED_EXEC
148#define __S111 PAGE_SHARED_EXEC
149
150/*
151 * early identity mapping pte attrib macros.
152 */
153#ifdef CONFIG_X86_64
154#define __PAGE_KERNEL_IDENT_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
155#else
156/*
157 * For PDE_IDENT_ATTR include USER bit. As the PDE and PTE protection
158 * bits are combined, this will alow user to access the high address mapped
159 * VDSO in the presence of CONFIG_COMPAT_VDSO
160 */
161#define PTE_IDENT_ATTR 0x003 /* PRESENT+RW */
162#define PDE_IDENT_ATTR 0x067 /* PRESENT+RW+USER+DIRTY+ACCESSED */
163#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
164#endif
165
166#ifdef CONFIG_X86_32
167# include "pgtable_32_types.h"
168#else
169# include "pgtable_64_types.h"
170#endif
171
172#ifndef __ASSEMBLY__
173
174#include <linux/types.h>
175
176/* PTE_PFN_MASK extracts the PFN from a (pte|pmd|pud|pgd)val_t */
177#define PTE_PFN_MASK ((pteval_t)PHYSICAL_PAGE_MASK)
178
179/* PTE_FLAGS_MASK extracts the flags from a (pte|pmd|pud|pgd)val_t */
180#define PTE_FLAGS_MASK (~PTE_PFN_MASK)
181
182typedef struct pgprot { pgprotval_t pgprot; } pgprot_t;
183
184typedef struct { pgdval_t pgd; } pgd_t;
185
186static inline pgd_t native_make_pgd(pgdval_t val)
187{
188 return (pgd_t) { val };
189}
190
191static inline pgdval_t native_pgd_val(pgd_t pgd)
192{
193 return pgd.pgd;
194}
195
196static inline pgdval_t pgd_flags(pgd_t pgd)
197{
198 return native_pgd_val(pgd) & PTE_FLAGS_MASK;
199}
200
201#if PAGETABLE_LEVELS > 3
202typedef struct { pudval_t pud; } pud_t;
203
204static inline pud_t native_make_pud(pmdval_t val)
205{
206 return (pud_t) { val };
207}
208
209static inline pudval_t native_pud_val(pud_t pud)
210{
211 return pud.pud;
212}
213#else
214#include <asm-generic/pgtable-nopud.h>
215
216static inline pudval_t native_pud_val(pud_t pud)
217{
218 return native_pgd_val(pud.pgd);
219}
220#endif
221
222#if PAGETABLE_LEVELS > 2
223typedef struct { pmdval_t pmd; } pmd_t;
224
225static inline pmd_t native_make_pmd(pmdval_t val)
226{
227 return (pmd_t) { val };
228}
229
230static inline pmdval_t native_pmd_val(pmd_t pmd)
231{
232 return pmd.pmd;
233}
234#else
235#include <asm-generic/pgtable-nopmd.h>
236
237static inline pmdval_t native_pmd_val(pmd_t pmd)
238{
239 return native_pgd_val(pmd.pud.pgd);
240}
241#endif
242
243static inline pudval_t pud_flags(pud_t pud)
244{
245 return native_pud_val(pud) & PTE_FLAGS_MASK;
246}
247
248static inline pmdval_t pmd_flags(pmd_t pmd)
249{
250 return native_pmd_val(pmd) & PTE_FLAGS_MASK;
251}
252
253static inline pte_t native_make_pte(pteval_t val)
254{
255 return (pte_t) { .pte = val };
256}
257
258static inline pteval_t native_pte_val(pte_t pte)
259{
260 return pte.pte;
261}
262
263static inline pteval_t pte_flags(pte_t pte)
264{
265 return native_pte_val(pte) & PTE_FLAGS_MASK;
266}
267
268#define pgprot_val(x) ((x).pgprot)
269#define __pgprot(x) ((pgprot_t) { (x) } )
270
271
272typedef struct page *pgtable_t;
273
274extern pteval_t __supported_pte_mask;
275extern int nx_enabled;
276
277#define pgprot_writecombine pgprot_writecombine
278extern pgprot_t pgprot_writecombine(pgprot_t prot);
279
280/* Indicate that x86 has its own track and untrack pfn vma functions */
281#define __HAVE_PFNMAP_TRACKING
282
283#define __HAVE_PHYS_MEM_ACCESS_PROT
284struct file;
285pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
286 unsigned long size, pgprot_t vma_prot);
287int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
288 unsigned long size, pgprot_t *vma_prot);
289
290/* Install a pte for a particular vaddr in kernel space. */
291void set_pte_vaddr(unsigned long vaddr, pte_t pte);
292
293#ifdef CONFIG_X86_32
294extern void native_pagetable_setup_start(pgd_t *base);
295extern void native_pagetable_setup_done(pgd_t *base);
296#else
297static inline void native_pagetable_setup_start(pgd_t *base) {}
298static inline void native_pagetable_setup_done(pgd_t *base) {}
299#endif
300
301struct seq_file;
302extern void arch_report_meminfo(struct seq_file *m);
303
304enum {
305 PG_LEVEL_NONE,
306 PG_LEVEL_4K,
307 PG_LEVEL_2M,
308 PG_LEVEL_1G,
309 PG_LEVEL_NUM
310};
311
312#ifdef CONFIG_PROC_FS
313extern void update_page_count(int level, unsigned long pages);
314#else
315static inline void update_page_count(int level, unsigned long pages) { }
316#endif
317
318/*
319 * Helper function that returns the kernel pagetable entry controlling
320 * the virtual address 'address'. NULL means no pagetable entry present.
321 * NOTE: the return type is pte_t but if the pmd is PSE then we return it
322 * as a pte too.
323 */
324extern pte_t *lookup_address(unsigned long address, unsigned int *level);
325
326#endif /* !__ASSEMBLY__ */
327
328#endif /* _ASM_X86_PGTABLE_DEFS_H */
diff --git a/arch/x86/include/asm/prctl.h b/arch/x86/include/asm/prctl.h
index a8894647dd9a..3ac5032fae09 100644
--- a/arch/x86/include/asm/prctl.h
+++ b/arch/x86/include/asm/prctl.h
@@ -6,8 +6,4 @@
6#define ARCH_GET_FS 0x1003 6#define ARCH_GET_FS 0x1003
7#define ARCH_GET_GS 0x1004 7#define ARCH_GET_GS 0x1004
8 8
9#ifdef CONFIG_X86_64
10extern long sys_arch_prctl(int, unsigned long);
11#endif /* CONFIG_X86_64 */
12
13#endif /* _ASM_X86_PRCTL_H */ 9#endif /* _ASM_X86_PRCTL_H */
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 3bfd5235a9eb..76139506c3e4 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -16,6 +16,7 @@ struct mm_struct;
16#include <asm/cpufeature.h> 16#include <asm/cpufeature.h>
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/pgtable_types.h>
19#include <asm/percpu.h> 20#include <asm/percpu.h>
20#include <asm/msr.h> 21#include <asm/msr.h>
21#include <asm/desc_defs.h> 22#include <asm/desc_defs.h>
@@ -73,7 +74,7 @@ struct cpuinfo_x86 {
73 char pad0; 74 char pad0;
74#else 75#else
75 /* Number of 4K pages in DTLB/ITLB combined(in pages): */ 76 /* Number of 4K pages in DTLB/ITLB combined(in pages): */
76 int x86_tlbsize; 77 int x86_tlbsize;
77 __u8 x86_virt_bits; 78 __u8 x86_virt_bits;
78 __u8 x86_phys_bits; 79 __u8 x86_phys_bits;
79#endif 80#endif
@@ -247,7 +248,6 @@ struct x86_hw_tss {
247#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) 248#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
248#define IO_BITMAP_OFFSET offsetof(struct tss_struct, io_bitmap) 249#define IO_BITMAP_OFFSET offsetof(struct tss_struct, io_bitmap)
249#define INVALID_IO_BITMAP_OFFSET 0x8000 250#define INVALID_IO_BITMAP_OFFSET 0x8000
250#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000
251 251
252struct tss_struct { 252struct tss_struct {
253 /* 253 /*
@@ -262,11 +262,6 @@ struct tss_struct {
262 * be within the limit. 262 * be within the limit.
263 */ 263 */
264 unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; 264 unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
265 /*
266 * Cache the current maximum and the last task that used the bitmap:
267 */
268 unsigned long io_bitmap_max;
269 struct thread_struct *io_bitmap_owner;
270 265
271 /* 266 /*
272 * .. and then another 0x100 bytes for the emergency kernel stack: 267 * .. and then another 0x100 bytes for the emergency kernel stack:
@@ -378,9 +373,30 @@ union thread_xstate {
378 373
379#ifdef CONFIG_X86_64 374#ifdef CONFIG_X86_64
380DECLARE_PER_CPU(struct orig_ist, orig_ist); 375DECLARE_PER_CPU(struct orig_ist, orig_ist);
376
377union irq_stack_union {
378 char irq_stack[IRQ_STACK_SIZE];
379 /*
380 * GCC hardcodes the stack canary as %gs:40. Since the
381 * irq_stack is the object at %gs:0, we reserve the bottom
382 * 48 bytes of the irq stack for the canary.
383 */
384 struct {
385 char gs_base[40];
386 unsigned long stack_canary;
387 };
388};
389
390DECLARE_PER_CPU(union irq_stack_union, irq_stack_union);
391DECLARE_INIT_PER_CPU(irq_stack_union);
392
393DECLARE_PER_CPU(char *, irq_stack_ptr);
394#else /* X86_64 */
395#ifdef CONFIG_CC_STACKPROTECTOR
396DECLARE_PER_CPU(unsigned long, stack_canary);
381#endif 397#endif
398#endif /* X86_64 */
382 399
383extern void print_cpu_info(struct cpuinfo_x86 *);
384extern unsigned int xstate_size; 400extern unsigned int xstate_size;
385extern void free_thread_xstate(struct task_struct *); 401extern void free_thread_xstate(struct task_struct *);
386extern struct kmem_cache *task_xstate_cachep; 402extern struct kmem_cache *task_xstate_cachep;
@@ -752,9 +768,9 @@ extern int sysenter_setup(void);
752extern struct desc_ptr early_gdt_descr; 768extern struct desc_ptr early_gdt_descr;
753 769
754extern void cpu_set_gdt(int); 770extern void cpu_set_gdt(int);
755extern void switch_to_new_gdt(void); 771extern void switch_to_new_gdt(int);
772extern void load_percpu_segment(int);
756extern void cpu_init(void); 773extern void cpu_init(void);
757extern void init_gdt(int cpu);
758 774
759static inline unsigned long get_debugctlmsr(void) 775static inline unsigned long get_debugctlmsr(void)
760{ 776{
@@ -839,6 +855,7 @@ static inline void spin_lock_prefetch(const void *x)
839 * User space process size: 3GB (default). 855 * User space process size: 3GB (default).
840 */ 856 */
841#define TASK_SIZE PAGE_OFFSET 857#define TASK_SIZE PAGE_OFFSET
858#define TASK_SIZE_MAX TASK_SIZE
842#define STACK_TOP TASK_SIZE 859#define STACK_TOP TASK_SIZE
843#define STACK_TOP_MAX STACK_TOP 860#define STACK_TOP_MAX STACK_TOP
844 861
@@ -898,7 +915,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
898/* 915/*
899 * User space process size. 47bits minus one guard page. 916 * User space process size. 47bits minus one guard page.
900 */ 917 */
901#define TASK_SIZE64 ((1UL << 47) - PAGE_SIZE) 918#define TASK_SIZE_MAX ((1UL << 47) - PAGE_SIZE)
902 919
903/* This decides where the kernel will search for a free chunk of vm 920/* This decides where the kernel will search for a free chunk of vm
904 * space during mmap's. 921 * space during mmap's.
@@ -907,12 +924,12 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
907 0xc0000000 : 0xFFFFe000) 924 0xc0000000 : 0xFFFFe000)
908 925
909#define TASK_SIZE (test_thread_flag(TIF_IA32) ? \ 926#define TASK_SIZE (test_thread_flag(TIF_IA32) ? \
910 IA32_PAGE_OFFSET : TASK_SIZE64) 927 IA32_PAGE_OFFSET : TASK_SIZE_MAX)
911#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \ 928#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \
912 IA32_PAGE_OFFSET : TASK_SIZE64) 929 IA32_PAGE_OFFSET : TASK_SIZE_MAX)
913 930
914#define STACK_TOP TASK_SIZE 931#define STACK_TOP TASK_SIZE
915#define STACK_TOP_MAX TASK_SIZE64 932#define STACK_TOP_MAX TASK_SIZE_MAX
916 933
917#define INIT_THREAD { \ 934#define INIT_THREAD { \
918 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 935 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index d6a22f92ba77..49fb3ecf3bb3 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -18,11 +18,7 @@ extern void syscall32_cpu_init(void);
18 18
19extern void check_efer(void); 19extern void check_efer(void);
20 20
21#ifdef CONFIG_X86_BIOS_REBOOT
22extern int reboot_force; 21extern int reboot_force;
23#else
24static const int reboot_force = 0;
25#endif
26 22
27long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); 23long do_arch_prctl(struct task_struct *task, int code, unsigned long addr);
28 24
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 6d34d954c228..e304b66abeea 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -28,7 +28,7 @@ struct pt_regs {
28 int xds; 28 int xds;
29 int xes; 29 int xes;
30 int xfs; 30 int xfs;
31 /* int gs; */ 31 int xgs;
32 long orig_eax; 32 long orig_eax;
33 long eip; 33 long eip;
34 int xcs; 34 int xcs;
@@ -50,7 +50,7 @@ struct pt_regs {
50 unsigned long ds; 50 unsigned long ds;
51 unsigned long es; 51 unsigned long es;
52 unsigned long fs; 52 unsigned long fs;
53 /* int gs; */ 53 unsigned long gs;
54 unsigned long orig_ax; 54 unsigned long orig_ax;
55 unsigned long ip; 55 unsigned long ip;
56 unsigned long cs; 56 unsigned long cs;
diff --git a/arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h b/arch/x86/include/asm/rdc321x_defs.h
index c8e9c8bed3d0..c8e9c8bed3d0 100644
--- a/arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h
+++ b/arch/x86/include/asm/rdc321x_defs.h
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index 1dc1b51ac623..14e0ed86a6f9 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -61,7 +61,7 @@
61 * 61 *
62 * 26 - ESPFIX small SS 62 * 26 - ESPFIX small SS
63 * 27 - per-cpu [ offset to per-cpu data area ] 63 * 27 - per-cpu [ offset to per-cpu data area ]
64 * 28 - unused 64 * 28 - stack_canary-20 [ for stack protector ]
65 * 29 - unused 65 * 29 - unused
66 * 30 - unused 66 * 30 - unused
67 * 31 - TSS for double fault handler 67 * 31 - TSS for double fault handler
@@ -95,6 +95,13 @@
95#define __KERNEL_PERCPU 0 95#define __KERNEL_PERCPU 0
96#endif 96#endif
97 97
98#define GDT_ENTRY_STACK_CANARY (GDT_ENTRY_KERNEL_BASE + 16)
99#ifdef CONFIG_CC_STACKPROTECTOR
100#define __KERNEL_STACK_CANARY (GDT_ENTRY_STACK_CANARY * 8)
101#else
102#define __KERNEL_STACK_CANARY 0
103#endif
104
98#define GDT_ENTRY_DOUBLEFAULT_TSS 31 105#define GDT_ENTRY_DOUBLEFAULT_TSS 31
99 106
100/* 107/*
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index ebe858cdc8a3..05c6f6b11fd5 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -1,33 +1,19 @@
1#ifndef _ASM_X86_SETUP_H 1#ifndef _ASM_X86_SETUP_H
2#define _ASM_X86_SETUP_H 2#define _ASM_X86_SETUP_H
3 3
4#ifdef __KERNEL__
5
4#define COMMAND_LINE_SIZE 2048 6#define COMMAND_LINE_SIZE 2048
5 7
6#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
7 9
8/* Interrupt control for vSMPowered x86_64 systems */
9void vsmp_init(void);
10
11
12void setup_bios_corruption_check(void);
13
14
15#ifdef CONFIG_X86_VISWS
16extern void visws_early_detect(void);
17extern int is_visws_box(void);
18#else
19static inline void visws_early_detect(void) { }
20static inline int is_visws_box(void) { return 0; }
21#endif
22
23extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip);
24extern int wakeup_secondary_cpu_via_init(int apicid, unsigned long start_eip);
25/* 10/*
26 * Any setup quirks to be performed? 11 * Any setup quirks to be performed?
27 */ 12 */
28struct mpc_cpu; 13struct mpc_cpu;
29struct mpc_bus; 14struct mpc_bus;
30struct mpc_oemtable; 15struct mpc_oemtable;
16
31struct x86_quirks { 17struct x86_quirks {
32 int (*arch_pre_time_init)(void); 18 int (*arch_pre_time_init)(void);
33 int (*arch_time_init)(void); 19 int (*arch_time_init)(void);
@@ -43,20 +29,19 @@ struct x86_quirks {
43 void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name); 29 void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
44 void (*mpc_oem_pci_bus)(struct mpc_bus *m); 30 void (*mpc_oem_pci_bus)(struct mpc_bus *m);
45 void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable, 31 void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable,
46 unsigned short oemsize); 32 unsigned short oemsize);
47 int (*setup_ioapic_ids)(void); 33 int (*setup_ioapic_ids)(void);
48 int (*update_genapic)(void);
49}; 34};
50 35
51extern struct x86_quirks *x86_quirks; 36extern void x86_quirk_pre_intr_init(void);
52extern unsigned long saved_video_mode; 37extern void x86_quirk_intr_init(void);
53 38
54#ifndef CONFIG_PARAVIRT 39extern void x86_quirk_trap_init(void);
55#define paravirt_post_allocator_init() do {} while (0)
56#endif
57#endif /* __ASSEMBLY__ */
58 40
59#ifdef __KERNEL__ 41extern void x86_quirk_pre_time_init(void);
42extern void x86_quirk_time_init(void);
43
44#endif /* __ASSEMBLY__ */
60 45
61#ifdef __i386__ 46#ifdef __i386__
62 47
@@ -78,6 +63,30 @@ extern unsigned long saved_video_mode;
78#ifndef __ASSEMBLY__ 63#ifndef __ASSEMBLY__
79#include <asm/bootparam.h> 64#include <asm/bootparam.h>
80 65
66/* Interrupt control for vSMPowered x86_64 systems */
67#ifdef CONFIG_X86_VSMP
68void vsmp_init(void);
69#else
70static inline void vsmp_init(void) { }
71#endif
72
73void setup_bios_corruption_check(void);
74
75#ifdef CONFIG_X86_VISWS
76extern void visws_early_detect(void);
77extern int is_visws_box(void);
78#else
79static inline void visws_early_detect(void) { }
80static inline int is_visws_box(void) { return 0; }
81#endif
82
83extern struct x86_quirks *x86_quirks;
84extern unsigned long saved_video_mode;
85
86#ifndef CONFIG_PARAVIRT
87#define paravirt_post_allocator_init() do {} while (0)
88#endif
89
81#ifndef _SETUP 90#ifndef _SETUP
82 91
83/* 92/*
@@ -100,7 +109,6 @@ extern unsigned long init_pg_tables_start;
100extern unsigned long init_pg_tables_end; 109extern unsigned long init_pg_tables_end;
101 110
102#else 111#else
103void __init x86_64_init_pda(void);
104void __init x86_64_start_kernel(char *real_mode); 112void __init x86_64_start_kernel(char *real_mode);
105void __init x86_64_start_reservations(char *real_mode_data); 113void __init x86_64_start_reservations(char *real_mode_data);
106 114
diff --git a/arch/x86/include/asm/mach-default/setup_arch.h b/arch/x86/include/asm/setup_arch.h
index 38846208b548..38846208b548 100644
--- a/arch/x86/include/asm/mach-default/setup_arch.h
+++ b/arch/x86/include/asm/setup_arch.h
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 19953df61c52..47d0e21f2b9e 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -15,34 +15,8 @@
15# include <asm/io_apic.h> 15# include <asm/io_apic.h>
16# endif 16# endif
17#endif 17#endif
18#include <asm/pda.h>
19#include <asm/thread_info.h> 18#include <asm/thread_info.h>
20 19#include <asm/cpumask.h>
21#ifdef CONFIG_X86_64
22
23extern cpumask_var_t cpu_callin_mask;
24extern cpumask_var_t cpu_callout_mask;
25extern cpumask_var_t cpu_initialized_mask;
26extern cpumask_var_t cpu_sibling_setup_mask;
27
28#else /* CONFIG_X86_32 */
29
30extern cpumask_t cpu_callin_map;
31extern cpumask_t cpu_callout_map;
32extern cpumask_t cpu_initialized;
33extern cpumask_t cpu_sibling_setup_map;
34
35#define cpu_callin_mask ((struct cpumask *)&cpu_callin_map)
36#define cpu_callout_mask ((struct cpumask *)&cpu_callout_map)
37#define cpu_initialized_mask ((struct cpumask *)&cpu_initialized)
38#define cpu_sibling_setup_mask ((struct cpumask *)&cpu_sibling_setup_map)
39
40#endif /* CONFIG_X86_32 */
41
42extern void (*mtrr_hook)(void);
43extern void zap_low_mappings(void);
44
45extern int __cpuinit get_local_pda(int cpu);
46 20
47extern int smp_num_siblings; 21extern int smp_num_siblings;
48extern unsigned int num_processors; 22extern unsigned int num_processors;
@@ -50,9 +24,7 @@ extern unsigned int num_processors;
50DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 24DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
51DECLARE_PER_CPU(cpumask_t, cpu_core_map); 25DECLARE_PER_CPU(cpumask_t, cpu_core_map);
52DECLARE_PER_CPU(u16, cpu_llc_id); 26DECLARE_PER_CPU(u16, cpu_llc_id);
53#ifdef CONFIG_X86_32
54DECLARE_PER_CPU(int, cpu_number); 27DECLARE_PER_CPU(int, cpu_number);
55#endif
56 28
57static inline struct cpumask *cpu_sibling_mask(int cpu) 29static inline struct cpumask *cpu_sibling_mask(int cpu)
58{ 30{
@@ -167,8 +139,6 @@ void play_dead_common(void);
167void native_send_call_func_ipi(const struct cpumask *mask); 139void native_send_call_func_ipi(const struct cpumask *mask);
168void native_send_call_func_single_ipi(int cpu); 140void native_send_call_func_single_ipi(int cpu);
169 141
170extern void prefill_possible_map(void);
171
172void smp_store_cpu_info(int id); 142void smp_store_cpu_info(int id);
173#define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu) 143#define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu)
174 144
@@ -177,10 +147,6 @@ static inline int num_booting_cpus(void)
177{ 147{
178 return cpumask_weight(cpu_callout_mask); 148 return cpumask_weight(cpu_callout_mask);
179} 149}
180#else
181static inline void prefill_possible_map(void)
182{
183}
184#endif /* CONFIG_SMP */ 150#endif /* CONFIG_SMP */
185 151
186extern unsigned disabled_cpus __cpuinitdata; 152extern unsigned disabled_cpus __cpuinitdata;
@@ -191,11 +157,11 @@ extern unsigned disabled_cpus __cpuinitdata;
191 * from the initial startup. We map APIC_BASE very early in page_setup(), 157 * from the initial startup. We map APIC_BASE very early in page_setup(),
192 * so this is correct in the x86 case. 158 * so this is correct in the x86 case.
193 */ 159 */
194#define raw_smp_processor_id() (x86_read_percpu(cpu_number)) 160#define raw_smp_processor_id() (percpu_read(cpu_number))
195extern int safe_smp_processor_id(void); 161extern int safe_smp_processor_id(void);
196 162
197#elif defined(CONFIG_X86_64_SMP) 163#elif defined(CONFIG_X86_64_SMP)
198#define raw_smp_processor_id() read_pda(cpunumber) 164#define raw_smp_processor_id() (percpu_read(cpu_number))
199 165
200#define stack_smp_processor_id() \ 166#define stack_smp_processor_id() \
201({ \ 167({ \
@@ -205,10 +171,6 @@ extern int safe_smp_processor_id(void);
205}) 171})
206#define safe_smp_processor_id() smp_processor_id() 172#define safe_smp_processor_id() smp_processor_id()
207 173
208#else /* !CONFIG_X86_32_SMP && !CONFIG_X86_64_SMP */
209#define cpu_physical_id(cpu) boot_cpu_physical_apicid
210#define safe_smp_processor_id() 0
211#define stack_smp_processor_id() 0
212#endif 174#endif
213 175
214#ifdef CONFIG_X86_LOCAL_APIC 176#ifdef CONFIG_X86_LOCAL_APIC
@@ -220,28 +182,9 @@ static inline int logical_smp_processor_id(void)
220 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); 182 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
221} 183}
222 184
223#include <mach_apicdef.h>
224static inline unsigned int read_apic_id(void)
225{
226 unsigned int reg;
227
228 reg = *(u32 *)(APIC_BASE + APIC_ID);
229
230 return GET_APIC_ID(reg);
231}
232#endif 185#endif
233 186
234
235# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
236extern int hard_smp_processor_id(void); 187extern int hard_smp_processor_id(void);
237# else
238#include <mach_apicdef.h>
239static inline int hard_smp_processor_id(void)
240{
241 /* we don't want to mark this access volatile - bad code generation */
242 return read_apic_id();
243}
244# endif /* APIC_DEFINITION */
245 188
246#else /* CONFIG_X86_LOCAL_APIC */ 189#else /* CONFIG_X86_LOCAL_APIC */
247 190
@@ -251,11 +194,5 @@ static inline int hard_smp_processor_id(void)
251 194
252#endif /* CONFIG_X86_LOCAL_APIC */ 195#endif /* CONFIG_X86_LOCAL_APIC */
253 196
254#ifdef CONFIG_X86_HAS_BOOT_CPU_ID
255extern unsigned char boot_cpu_id;
256#else
257#define boot_cpu_id 0
258#endif
259
260#endif /* __ASSEMBLY__ */ 197#endif /* __ASSEMBLY__ */
261#endif /* _ASM_X86_SMP_H */ 198#endif /* _ASM_X86_SMP_H */
diff --git a/arch/x86/include/asm/mach-default/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
index 23bf52103b89..1def60114906 100644
--- a/arch/x86/include/asm/mach-default/smpboot_hooks.h
+++ b/arch/x86/include/asm/smpboot_hooks.h
@@ -13,10 +13,10 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
13 CMOS_WRITE(0xa, 0xf); 13 CMOS_WRITE(0xa, 0xf);
14 local_flush_tlb(); 14 local_flush_tlb();
15 pr_debug("1.\n"); 15 pr_debug("1.\n");
16 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) = 16 *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) =
17 start_eip >> 4; 17 start_eip >> 4;
18 pr_debug("2.\n"); 18 pr_debug("2.\n");
19 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 19 *((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) =
20 start_eip & 0xf; 20 start_eip & 0xf;
21 pr_debug("3.\n"); 21 pr_debug("3.\n");
22} 22}
@@ -34,7 +34,7 @@ static inline void smpboot_restore_warm_reset_vector(void)
34 */ 34 */
35 CMOS_WRITE(0, 0xf); 35 CMOS_WRITE(0, 0xf);
36 36
37 *((volatile long *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) = 0; 37 *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0;
38} 38}
39 39
40static inline void __init smpboot_setup_io_apic(void) 40static inline void __init smpboot_setup_io_apic(void)
diff --git a/arch/x86/include/asm/socket.h b/arch/x86/include/asm/socket.h
index 8ab9cc8b2ecc..ca8bf2cd0ba9 100644
--- a/arch/x86/include/asm/socket.h
+++ b/arch/x86/include/asm/socket.h
@@ -54,4 +54,7 @@
54 54
55#define SO_MARK 36 55#define SO_MARK 36
56 56
57#define SO_TIMESTAMPING 37
58#define SCM_TIMESTAMPING SO_TIMESTAMPING
59
57#endif /* _ASM_X86_SOCKET_H */ 60#endif /* _ASM_X86_SOCKET_H */
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index 8247e94ac6b1..3a5696656680 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -172,70 +172,8 @@ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
172 return (((tmp >> TICKET_SHIFT) - tmp) & ((1 << TICKET_SHIFT) - 1)) > 1; 172 return (((tmp >> TICKET_SHIFT) - tmp) & ((1 << TICKET_SHIFT) - 1)) > 1;
173} 173}
174 174
175#ifdef CONFIG_PARAVIRT 175#ifndef CONFIG_PARAVIRT
176/*
177 * Define virtualization-friendly old-style lock byte lock, for use in
178 * pv_lock_ops if desired.
179 *
180 * This differs from the pre-2.6.24 spinlock by always using xchgb
181 * rather than decb to take the lock; this allows it to use a
182 * zero-initialized lock structure. It also maintains a 1-byte
183 * contention counter, so that we can implement
184 * __byte_spin_is_contended.
185 */
186struct __byte_spinlock {
187 s8 lock;
188 s8 spinners;
189};
190
191static inline int __byte_spin_is_locked(raw_spinlock_t *lock)
192{
193 struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
194 return bl->lock != 0;
195}
196
197static inline int __byte_spin_is_contended(raw_spinlock_t *lock)
198{
199 struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
200 return bl->spinners != 0;
201}
202
203static inline void __byte_spin_lock(raw_spinlock_t *lock)
204{
205 struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
206 s8 val = 1;
207
208 asm("1: xchgb %1, %0\n"
209 " test %1,%1\n"
210 " jz 3f\n"
211 " " LOCK_PREFIX "incb %2\n"
212 "2: rep;nop\n"
213 " cmpb $1, %0\n"
214 " je 2b\n"
215 " " LOCK_PREFIX "decb %2\n"
216 " jmp 1b\n"
217 "3:"
218 : "+m" (bl->lock), "+q" (val), "+m" (bl->spinners): : "memory");
219}
220
221static inline int __byte_spin_trylock(raw_spinlock_t *lock)
222{
223 struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
224 u8 old = 1;
225
226 asm("xchgb %1,%0"
227 : "+m" (bl->lock), "+q" (old) : : "memory");
228 176
229 return old == 0;
230}
231
232static inline void __byte_spin_unlock(raw_spinlock_t *lock)
233{
234 struct __byte_spinlock *bl = (struct __byte_spinlock *)lock;
235 smp_wmb();
236 bl->lock = 0;
237}
238#else /* !CONFIG_PARAVIRT */
239static inline int __raw_spin_is_locked(raw_spinlock_t *lock) 177static inline int __raw_spin_is_locked(raw_spinlock_t *lock)
240{ 178{
241 return __ticket_spin_is_locked(lock); 179 return __ticket_spin_is_locked(lock);
@@ -268,7 +206,7 @@ static __always_inline void __raw_spin_lock_flags(raw_spinlock_t *lock,
268 __raw_spin_lock(lock); 206 __raw_spin_lock(lock);
269} 207}
270 208
271#endif /* CONFIG_PARAVIRT */ 209#endif
272 210
273static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock) 211static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock)
274{ 212{
@@ -330,8 +268,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *lock)
330{ 268{
331 atomic_t *count = (atomic_t *)lock; 269 atomic_t *count = (atomic_t *)lock;
332 270
333 atomic_dec(count); 271 if (atomic_dec_return(count) >= 0)
334 if (atomic_read(count) >= 0)
335 return 1; 272 return 1;
336 atomic_inc(count); 273 atomic_inc(count);
337 return 0; 274 return 0;
diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h
new file mode 100644
index 000000000000..c2d742c6e15f
--- /dev/null
+++ b/arch/x86/include/asm/stackprotector.h
@@ -0,0 +1,124 @@
1/*
2 * GCC stack protector support.
3 *
4 * Stack protector works by putting predefined pattern at the start of
5 * the stack frame and verifying that it hasn't been overwritten when
6 * returning from the function. The pattern is called stack canary
7 * and unfortunately gcc requires it to be at a fixed offset from %gs.
8 * On x86_64, the offset is 40 bytes and on x86_32 20 bytes. x86_64
9 * and x86_32 use segment registers differently and thus handles this
10 * requirement differently.
11 *
12 * On x86_64, %gs is shared by percpu area and stack canary. All
13 * percpu symbols are zero based and %gs points to the base of percpu
14 * area. The first occupant of the percpu area is always
15 * irq_stack_union which contains stack_canary at offset 40. Userland
16 * %gs is always saved and restored on kernel entry and exit using
17 * swapgs, so stack protector doesn't add any complexity there.
18 *
19 * On x86_32, it's slightly more complicated. As in x86_64, %gs is
20 * used for userland TLS. Unfortunately, some processors are much
21 * slower at loading segment registers with different value when
22 * entering and leaving the kernel, so the kernel uses %fs for percpu
23 * area and manages %gs lazily so that %gs is switched only when
24 * necessary, usually during task switch.
25 *
26 * As gcc requires the stack canary at %gs:20, %gs can't be managed
27 * lazily if stack protector is enabled, so the kernel saves and
28 * restores userland %gs on kernel entry and exit. This behavior is
29 * controlled by CONFIG_X86_32_LAZY_GS and accessors are defined in
30 * system.h to hide the details.
31 */
32
33#ifndef _ASM_STACKPROTECTOR_H
34#define _ASM_STACKPROTECTOR_H 1
35
36#ifdef CONFIG_CC_STACKPROTECTOR
37
38#include <asm/tsc.h>
39#include <asm/processor.h>
40#include <asm/percpu.h>
41#include <asm/system.h>
42#include <asm/desc.h>
43#include <linux/random.h>
44
45/*
46 * 24 byte read-only segment initializer for stack canary. Linker
47 * can't handle the address bit shifting. Address will be set in
48 * head_32 for boot CPU and setup_per_cpu_areas() for others.
49 */
50#define GDT_STACK_CANARY_INIT \
51 [GDT_ENTRY_STACK_CANARY] = { { { 0x00000018, 0x00409000 } } },
52
53/*
54 * Initialize the stackprotector canary value.
55 *
56 * NOTE: this must only be called from functions that never return,
57 * and it must always be inlined.
58 */
59static __always_inline void boot_init_stack_canary(void)
60{
61 u64 canary;
62 u64 tsc;
63
64#ifdef CONFIG_X86_64
65 BUILD_BUG_ON(offsetof(union irq_stack_union, stack_canary) != 40);
66#endif
67 /*
68 * We both use the random pool and the current TSC as a source
69 * of randomness. The TSC only matters for very early init,
70 * there it already has some randomness on most systems. Later
71 * on during the bootup the random pool has true entropy too.
72 */
73 get_random_bytes(&canary, sizeof(canary));
74 tsc = __native_read_tsc();
75 canary += tsc + (tsc << 32UL);
76
77 current->stack_canary = canary;
78#ifdef CONFIG_X86_64
79 percpu_write(irq_stack_union.stack_canary, canary);
80#else
81 percpu_write(stack_canary, canary);
82#endif
83}
84
85static inline void setup_stack_canary_segment(int cpu)
86{
87#ifdef CONFIG_X86_32
88 unsigned long canary = (unsigned long)&per_cpu(stack_canary, cpu) - 20;
89 struct desc_struct *gdt_table = get_cpu_gdt_table(cpu);
90 struct desc_struct desc;
91
92 desc = gdt_table[GDT_ENTRY_STACK_CANARY];
93 desc.base0 = canary & 0xffff;
94 desc.base1 = (canary >> 16) & 0xff;
95 desc.base2 = (canary >> 24) & 0xff;
96 write_gdt_entry(gdt_table, GDT_ENTRY_STACK_CANARY, &desc, DESCTYPE_S);
97#endif
98}
99
100static inline void load_stack_canary_segment(void)
101{
102#ifdef CONFIG_X86_32
103 asm("mov %0, %%gs" : : "r" (__KERNEL_STACK_CANARY) : "memory");
104#endif
105}
106
107#else /* CC_STACKPROTECTOR */
108
109#define GDT_STACK_CANARY_INIT
110
111/* dummy boot_init_stack_canary() is defined in linux/stackprotector.h */
112
113static inline void setup_stack_canary_segment(int cpu)
114{ }
115
116static inline void load_stack_canary_segment(void)
117{
118#ifdef CONFIG_X86_32
119 asm volatile ("mov %0, %%gs" : : "r" (0));
120#endif
121}
122
123#endif /* CC_STACKPROTECTOR */
124#endif /* _ASM_STACKPROTECTOR_H */
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
deleted file mode 100644
index 93d2c8667cfe..000000000000
--- a/arch/x86/include/asm/summit/apic.h
+++ /dev/null
@@ -1,202 +0,0 @@
1#ifndef __ASM_SUMMIT_APIC_H
2#define __ASM_SUMMIT_APIC_H
3
4#include <asm/smp.h>
5#include <linux/gfp.h>
6
7#define esr_disable (1)
8#define NO_BALANCE_IRQ (0)
9
10/* In clustered mode, the high nibble of APIC ID is a cluster number.
11 * The low nibble is a 4-bit bitmap. */
12#define XAPIC_DEST_CPUS_SHIFT 4
13#define XAPIC_DEST_CPUS_MASK ((1u << XAPIC_DEST_CPUS_SHIFT) - 1)
14#define XAPIC_DEST_CLUSTER_MASK (XAPIC_DEST_CPUS_MASK << XAPIC_DEST_CPUS_SHIFT)
15
16#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
17
18static inline const cpumask_t *target_cpus(void)
19{
20 /* CPU_MASK_ALL (0xff) has undefined behaviour with
21 * dest_LowestPrio mode logical clustered apic interrupt routing
22 * Just start on cpu 0. IRQ balancing will spread load
23 */
24 return &cpumask_of_cpu(0);
25}
26
27#define INT_DELIVERY_MODE (dest_LowestPrio)
28#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
29
30static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
31{
32 return 0;
33}
34
35/* we don't use the phys_cpu_present_map to indicate apicid presence */
36static inline unsigned long check_apicid_present(int bit)
37{
38 return 1;
39}
40
41#define apicid_cluster(apicid) ((apicid) & XAPIC_DEST_CLUSTER_MASK)
42
43extern u8 cpu_2_logical_apicid[];
44
45static inline void init_apic_ldr(void)
46{
47 unsigned long val, id;
48 int count = 0;
49 u8 my_id = (u8)hard_smp_processor_id();
50 u8 my_cluster = (u8)apicid_cluster(my_id);
51#ifdef CONFIG_SMP
52 u8 lid;
53 int i;
54
55 /* Create logical APIC IDs by counting CPUs already in cluster. */
56 for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
57 lid = cpu_2_logical_apicid[i];
58 if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
59 ++count;
60 }
61#endif
62 /* We only have a 4 wide bitmap in cluster mode. If a deranged
63 * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
64 BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
65 id = my_cluster | (1UL << count);
66 apic_write(APIC_DFR, APIC_DFR_VALUE);
67 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
68 val |= SET_APIC_LOGICAL_ID(id);
69 apic_write(APIC_LDR, val);
70}
71
72static inline int multi_timer_check(int apic, int irq)
73{
74 return 0;
75}
76
77static inline int apic_id_registered(void)
78{
79 return 1;
80}
81
82static inline void setup_apic_routing(void)
83{
84 printk("Enabling APIC mode: Summit. Using %d I/O APICs\n",
85 nr_ioapics);
86}
87
88static inline int apicid_to_node(int logical_apicid)
89{
90#ifdef CONFIG_SMP
91 return apicid_2_node[hard_smp_processor_id()];
92#else
93 return 0;
94#endif
95}
96
97/* Mapping from cpu number to logical apicid */
98static inline int cpu_to_logical_apicid(int cpu)
99{
100#ifdef CONFIG_SMP
101 if (cpu >= nr_cpu_ids)
102 return BAD_APICID;
103 return (int)cpu_2_logical_apicid[cpu];
104#else
105 return logical_smp_processor_id();
106#endif
107}
108
109static inline int cpu_present_to_apicid(int mps_cpu)
110{
111 if (mps_cpu < nr_cpu_ids)
112 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
113 else
114 return BAD_APICID;
115}
116
117static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_id_map)
118{
119 /* For clustered we don't have a good way to do this yet - hack */
120 return physids_promote(0x0F);
121}
122
123static inline physid_mask_t apicid_to_cpu_present(int apicid)
124{
125 return physid_mask_of_physid(0);
126}
127
128static inline void setup_portio_remap(void)
129{
130}
131
132static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
133{
134 return 1;
135}
136
137static inline void enable_apic_mode(void)
138{
139}
140
141static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
142{
143 int num_bits_set;
144 int cpus_found = 0;
145 int cpu;
146 int apicid;
147
148 num_bits_set = cpus_weight(*cpumask);
149 /* Return id to all */
150 if (num_bits_set >= nr_cpu_ids)
151 return (int) 0xFF;
152 /*
153 * The cpus in the mask must all be on the apic cluster. If are not
154 * on the same apicid cluster return default value of TARGET_CPUS.
155 */
156 cpu = first_cpu(*cpumask);
157 apicid = cpu_to_logical_apicid(cpu);
158 while (cpus_found < num_bits_set) {
159 if (cpu_isset(cpu, *cpumask)) {
160 int new_apicid = cpu_to_logical_apicid(cpu);
161 if (apicid_cluster(apicid) !=
162 apicid_cluster(new_apicid)){
163 printk ("%s: Not a valid mask!\n", __func__);
164 return 0xFF;
165 }
166 apicid = apicid | new_apicid;
167 cpus_found++;
168 }
169 cpu++;
170 }
171 return apicid;
172}
173
174static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
175 const struct cpumask *andmask)
176{
177 int apicid = cpu_to_logical_apicid(0);
178 cpumask_var_t cpumask;
179
180 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
181 return apicid;
182
183 cpumask_and(cpumask, inmask, andmask);
184 cpumask_and(cpumask, cpumask, cpu_online_mask);
185 apicid = cpu_mask_to_apicid(cpumask);
186
187 free_cpumask_var(cpumask);
188 return apicid;
189}
190
191/* cpuid returns the value latched in the HW at reset, not the APIC ID
192 * register's value. For any box whose BIOS changes APIC IDs, like
193 * clustered APIC systems, we must use hard_smp_processor_id.
194 *
195 * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
196 */
197static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
198{
199 return hard_smp_processor_id() >> index_msb;
200}
201
202#endif /* __ASM_SUMMIT_APIC_H */
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h
deleted file mode 100644
index f3fbca1f61c1..000000000000
--- a/arch/x86/include/asm/summit/apicdef.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ASM_SUMMIT_APICDEF_H
2#define __ASM_SUMMIT_APICDEF_H
3
4#define APIC_ID_MASK (0xFF<<24)
5
6static inline unsigned get_apic_id(unsigned long x)
7{
8 return (x>>24)&0xFF;
9}
10
11#define GET_APIC_ID(x) get_apic_id(x)
12
13#endif
diff --git a/arch/x86/include/asm/summit/ipi.h b/arch/x86/include/asm/summit/ipi.h
deleted file mode 100644
index a8a2c24f50cc..000000000000
--- a/arch/x86/include/asm/summit/ipi.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#ifndef __ASM_SUMMIT_IPI_H
2#define __ASM_SUMMIT_IPI_H
3
4void send_IPI_mask_sequence(const cpumask_t *mask, int vector);
5void send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
6
7static inline void send_IPI_mask(const cpumask_t *mask, int vector)
8{
9 send_IPI_mask_sequence(mask, vector);
10}
11
12static inline void send_IPI_allbutself(int vector)
13{
14 cpumask_t mask = cpu_online_map;
15 cpu_clear(smp_processor_id(), mask);
16
17 if (!cpus_empty(mask))
18 send_IPI_mask(&mask, vector);
19}
20
21static inline void send_IPI_all(int vector)
22{
23 send_IPI_mask(&cpu_online_map, vector);
24}
25
26#endif /* __ASM_SUMMIT_IPI_H */
diff --git a/arch/x86/include/asm/summit/mpparse.h b/arch/x86/include/asm/summit/mpparse.h
deleted file mode 100644
index 380e86c02363..000000000000
--- a/arch/x86/include/asm/summit/mpparse.h
+++ /dev/null
@@ -1,109 +0,0 @@
1#ifndef __ASM_SUMMIT_MPPARSE_H
2#define __ASM_SUMMIT_MPPARSE_H
3
4#include <asm/tsc.h>
5
6extern int use_cyclone;
7
8#ifdef CONFIG_X86_SUMMIT_NUMA
9extern void setup_summit(void);
10#else
11#define setup_summit() {}
12#endif
13
14static inline int mps_oem_check(struct mpc_table *mpc, char *oem,
15 char *productid)
16{
17 if (!strncmp(oem, "IBM ENSW", 8) &&
18 (!strncmp(productid, "VIGIL SMP", 9)
19 || !strncmp(productid, "EXA", 3)
20 || !strncmp(productid, "RUTHLESS SMP", 12))){
21 mark_tsc_unstable("Summit based system");
22 use_cyclone = 1; /*enable cyclone-timer*/
23 setup_summit();
24 return 1;
25 }
26 return 0;
27}
28
29/* Hook from generic ACPI tables.c */
30static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
31{
32 if (!strncmp(oem_id, "IBM", 3) &&
33 (!strncmp(oem_table_id, "SERVIGIL", 8)
34 || !strncmp(oem_table_id, "EXA", 3))){
35 mark_tsc_unstable("Summit based system");
36 use_cyclone = 1; /*enable cyclone-timer*/
37 setup_summit();
38 return 1;
39 }
40 return 0;
41}
42
43struct rio_table_hdr {
44 unsigned char version; /* Version number of this data structure */
45 /* Version 3 adds chassis_num & WP_index */
46 unsigned char num_scal_dev; /* # of Scalability devices (Twisters for Vigil) */
47 unsigned char num_rio_dev; /* # of RIO I/O devices (Cyclones and Winnipegs) */
48} __attribute__((packed));
49
50struct scal_detail {
51 unsigned char node_id; /* Scalability Node ID */
52 unsigned long CBAR; /* Address of 1MB register space */
53 unsigned char port0node; /* Node ID port connected to: 0xFF=None */
54 unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
55 unsigned char port1node; /* Node ID port connected to: 0xFF = None */
56 unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
57 unsigned char port2node; /* Node ID port connected to: 0xFF = None */
58 unsigned char port2port; /* Port num port connected to: 0,1,2, or 0xFF=None */
59 unsigned char chassis_num; /* 1 based Chassis number (1 = boot node) */
60} __attribute__((packed));
61
62struct rio_detail {
63 unsigned char node_id; /* RIO Node ID */
64 unsigned long BBAR; /* Address of 1MB register space */
65 unsigned char type; /* Type of device */
66 unsigned char owner_id; /* For WPEG: Node ID of Cyclone that owns this WPEG*/
67 /* For CYC: Node ID of Twister that owns this CYC */
68 unsigned char port0node; /* Node ID port connected to: 0xFF=None */
69 unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
70 unsigned char port1node; /* Node ID port connected to: 0xFF=None */
71 unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
72 unsigned char first_slot; /* For WPEG: Lowest slot number below this WPEG */
73 /* For CYC: 0 */
74 unsigned char status; /* For WPEG: Bit 0 = 1 : the XAPIC is used */
75 /* = 0 : the XAPIC is not used, ie:*/
76 /* ints fwded to another XAPIC */
77 /* Bits1:7 Reserved */
78 /* For CYC: Bits0:7 Reserved */
79 unsigned char WP_index; /* For WPEG: WPEG instance index - lower ones have */
80 /* lower slot numbers/PCI bus numbers */
81 /* For CYC: No meaning */
82 unsigned char chassis_num; /* 1 based Chassis number */
83 /* For LookOut WPEGs this field indicates the */
84 /* Expansion Chassis #, enumerated from Boot */
85 /* Node WPEG external port, then Boot Node CYC */
86 /* external port, then Next Vigil chassis WPEG */
87 /* external port, etc. */
88 /* Shared Lookouts have only 1 chassis number (the */
89 /* first one assigned) */
90} __attribute__((packed));
91
92
93typedef enum {
94 CompatTwister = 0, /* Compatibility Twister */
95 AltTwister = 1, /* Alternate Twister of internal 8-way */
96 CompatCyclone = 2, /* Compatibility Cyclone */
97 AltCyclone = 3, /* Alternate Cyclone of internal 8-way */
98 CompatWPEG = 4, /* Compatibility WPEG */
99 AltWPEG = 5, /* Second Planar WPEG */
100 LookOutAWPEG = 6, /* LookOut WPEG */
101 LookOutBWPEG = 7, /* LookOut WPEG */
102} node_type;
103
104static inline int is_WPEG(struct rio_detail *rio){
105 return (rio->type == CompatWPEG || rio->type == AltWPEG ||
106 rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
107}
108
109#endif /* __ASM_SUMMIT_MPPARSE_H */
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index 1b8afa78e869..82ada75f3ebf 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -174,10 +174,6 @@ struct __attribute__ ((__packed__)) vmcb {
174#define SVM_CPUID_FEATURE_SHIFT 2 174#define SVM_CPUID_FEATURE_SHIFT 2
175#define SVM_CPUID_FUNC 0x8000000a 175#define SVM_CPUID_FUNC 0x8000000a
176 176
177#define MSR_EFER_SVME_MASK (1ULL << 12)
178#define MSR_VM_CR 0xc0010114
179#define MSR_VM_HSAVE_PA 0xc0010117ULL
180
181#define SVM_VM_CR_SVM_DISABLE 4 177#define SVM_VM_CR_SVM_DISABLE 4
182 178
183#define SVM_SELECTOR_S_SHIFT 4 179#define SVM_SELECTOR_S_SHIFT 4
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index ffb08be2a530..72a6dcd1299b 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -70,8 +70,6 @@ struct old_utsname;
70asmlinkage long sys32_olduname(struct oldold_utsname __user *); 70asmlinkage long sys32_olduname(struct oldold_utsname __user *);
71long sys32_uname(struct old_utsname __user *); 71long sys32_uname(struct old_utsname __user *);
72 72
73long sys32_ustat(unsigned, struct ustat32 __user *);
74
75asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *, 73asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *,
76 compat_uptr_t __user *, struct pt_regs *); 74 compat_uptr_t __user *, struct pt_regs *);
77asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *); 75asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *);
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index c0b0bda754ee..7043408f6904 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -29,21 +29,21 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *);
29/* X86_32 only */ 29/* X86_32 only */
30#ifdef CONFIG_X86_32 30#ifdef CONFIG_X86_32
31/* kernel/process_32.c */ 31/* kernel/process_32.c */
32asmlinkage int sys_fork(struct pt_regs); 32int sys_fork(struct pt_regs *);
33asmlinkage int sys_clone(struct pt_regs); 33int sys_clone(struct pt_regs *);
34asmlinkage int sys_vfork(struct pt_regs); 34int sys_vfork(struct pt_regs *);
35asmlinkage int sys_execve(struct pt_regs); 35int sys_execve(struct pt_regs *);
36 36
37/* kernel/signal_32.c */ 37/* kernel/signal_32.c */
38asmlinkage int sys_sigsuspend(int, int, old_sigset_t); 38asmlinkage int sys_sigsuspend(int, int, old_sigset_t);
39asmlinkage int sys_sigaction(int, const struct old_sigaction __user *, 39asmlinkage int sys_sigaction(int, const struct old_sigaction __user *,
40 struct old_sigaction __user *); 40 struct old_sigaction __user *);
41asmlinkage int sys_sigaltstack(unsigned long); 41int sys_sigaltstack(struct pt_regs *);
42asmlinkage unsigned long sys_sigreturn(unsigned long); 42unsigned long sys_sigreturn(struct pt_regs *);
43asmlinkage int sys_rt_sigreturn(unsigned long); 43long sys_rt_sigreturn(struct pt_regs *);
44 44
45/* kernel/ioport.c */ 45/* kernel/ioport.c */
46asmlinkage long sys_iopl(unsigned long); 46long sys_iopl(struct pt_regs *);
47 47
48/* kernel/sys_i386_32.c */ 48/* kernel/sys_i386_32.c */
49asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long, 49asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long,
@@ -59,8 +59,8 @@ struct oldold_utsname;
59asmlinkage int sys_olduname(struct oldold_utsname __user *); 59asmlinkage int sys_olduname(struct oldold_utsname __user *);
60 60
61/* kernel/vm86_32.c */ 61/* kernel/vm86_32.c */
62asmlinkage int sys_vm86old(struct pt_regs); 62int sys_vm86old(struct pt_regs *);
63asmlinkage int sys_vm86(struct pt_regs); 63int sys_vm86(struct pt_regs *);
64 64
65#else /* CONFIG_X86_32 */ 65#else /* CONFIG_X86_32 */
66 66
@@ -74,6 +74,7 @@ asmlinkage long sys_vfork(struct pt_regs *);
74asmlinkage long sys_execve(char __user *, char __user * __user *, 74asmlinkage long sys_execve(char __user *, char __user * __user *,
75 char __user * __user *, 75 char __user * __user *,
76 struct pt_regs *); 76 struct pt_regs *);
77long sys_arch_prctl(int, unsigned long);
77 78
78/* kernel/ioport.c */ 79/* kernel/ioport.c */
79asmlinkage long sys_iopl(unsigned int, struct pt_regs *); 80asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
@@ -81,7 +82,7 @@ asmlinkage long sys_iopl(unsigned int, struct pt_regs *);
81/* kernel/signal_64.c */ 82/* kernel/signal_64.c */
82asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *, 83asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *,
83 struct pt_regs *); 84 struct pt_regs *);
84asmlinkage long sys_rt_sigreturn(struct pt_regs *); 85long sys_rt_sigreturn(struct pt_regs *);
85 86
86/* kernel/sys_x86_64.c */ 87/* kernel/sys_x86_64.c */
87asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long, 88asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long,
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index 8e626ea33a1a..643c59b4bc6e 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -20,9 +20,26 @@
20struct task_struct; /* one of the stranger aspects of C forward declarations */ 20struct task_struct; /* one of the stranger aspects of C forward declarations */
21struct task_struct *__switch_to(struct task_struct *prev, 21struct task_struct *__switch_to(struct task_struct *prev,
22 struct task_struct *next); 22 struct task_struct *next);
23struct tss_struct;
24void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
25 struct tss_struct *tss);
23 26
24#ifdef CONFIG_X86_32 27#ifdef CONFIG_X86_32
25 28
29#ifdef CONFIG_CC_STACKPROTECTOR
30#define __switch_canary \
31 "movl %P[task_canary](%[next]), %%ebx\n\t" \
32 "movl %%ebx, "__percpu_arg([stack_canary])"\n\t"
33#define __switch_canary_oparam \
34 , [stack_canary] "=m" (per_cpu_var(stack_canary))
35#define __switch_canary_iparam \
36 , [task_canary] "i" (offsetof(struct task_struct, stack_canary))
37#else /* CC_STACKPROTECTOR */
38#define __switch_canary
39#define __switch_canary_oparam
40#define __switch_canary_iparam
41#endif /* CC_STACKPROTECTOR */
42
26/* 43/*
27 * Saving eflags is important. It switches not only IOPL between tasks, 44 * Saving eflags is important. It switches not only IOPL between tasks,
28 * it also protects other tasks from NT leaking through sysenter etc. 45 * it also protects other tasks from NT leaking through sysenter etc.
@@ -44,6 +61,7 @@ do { \
44 "movl %[next_sp],%%esp\n\t" /* restore ESP */ \ 61 "movl %[next_sp],%%esp\n\t" /* restore ESP */ \
45 "movl $1f,%[prev_ip]\n\t" /* save EIP */ \ 62 "movl $1f,%[prev_ip]\n\t" /* save EIP */ \
46 "pushl %[next_ip]\n\t" /* restore EIP */ \ 63 "pushl %[next_ip]\n\t" /* restore EIP */ \
64 __switch_canary \
47 "jmp __switch_to\n" /* regparm call */ \ 65 "jmp __switch_to\n" /* regparm call */ \
48 "1:\t" \ 66 "1:\t" \
49 "popl %%ebp\n\t" /* restore EBP */ \ 67 "popl %%ebp\n\t" /* restore EBP */ \
@@ -58,6 +76,8 @@ do { \
58 "=b" (ebx), "=c" (ecx), "=d" (edx), \ 76 "=b" (ebx), "=c" (ecx), "=d" (edx), \
59 "=S" (esi), "=D" (edi) \ 77 "=S" (esi), "=D" (edi) \
60 \ 78 \
79 __switch_canary_oparam \
80 \
61 /* input parameters: */ \ 81 /* input parameters: */ \
62 : [next_sp] "m" (next->thread.sp), \ 82 : [next_sp] "m" (next->thread.sp), \
63 [next_ip] "m" (next->thread.ip), \ 83 [next_ip] "m" (next->thread.ip), \
@@ -66,6 +86,8 @@ do { \
66 [prev] "a" (prev), \ 86 [prev] "a" (prev), \
67 [next] "d" (next) \ 87 [next] "d" (next) \
68 \ 88 \
89 __switch_canary_iparam \
90 \
69 : /* reloaded segment registers */ \ 91 : /* reloaded segment registers */ \
70 "memory"); \ 92 "memory"); \
71} while (0) 93} while (0)
@@ -86,27 +108,44 @@ do { \
86 , "rcx", "rbx", "rdx", "r8", "r9", "r10", "r11", \ 108 , "rcx", "rbx", "rdx", "r8", "r9", "r10", "r11", \
87 "r12", "r13", "r14", "r15" 109 "r12", "r13", "r14", "r15"
88 110
111#ifdef CONFIG_CC_STACKPROTECTOR
112#define __switch_canary \
113 "movq %P[task_canary](%%rsi),%%r8\n\t" \
114 "movq %%r8,"__percpu_arg([gs_canary])"\n\t"
115#define __switch_canary_oparam \
116 , [gs_canary] "=m" (per_cpu_var(irq_stack_union.stack_canary))
117#define __switch_canary_iparam \
118 , [task_canary] "i" (offsetof(struct task_struct, stack_canary))
119#else /* CC_STACKPROTECTOR */
120#define __switch_canary
121#define __switch_canary_oparam
122#define __switch_canary_iparam
123#endif /* CC_STACKPROTECTOR */
124
89/* Save restore flags to clear handle leaking NT */ 125/* Save restore flags to clear handle leaking NT */
90#define switch_to(prev, next, last) \ 126#define switch_to(prev, next, last) \
91 asm volatile(SAVE_CONTEXT \ 127 asm volatile(SAVE_CONTEXT \
92 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \ 128 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
93 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \ 129 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
94 "call __switch_to\n\t" \ 130 "call __switch_to\n\t" \
95 ".globl thread_return\n" \ 131 ".globl thread_return\n" \
96 "thread_return:\n\t" \ 132 "thread_return:\n\t" \
97 "movq %%gs:%P[pda_pcurrent],%%rsi\n\t" \ 133 "movq "__percpu_arg([current_task])",%%rsi\n\t" \
134 __switch_canary \
98 "movq %P[thread_info](%%rsi),%%r8\n\t" \ 135 "movq %P[thread_info](%%rsi),%%r8\n\t" \
99 LOCK_PREFIX "btr %[tif_fork],%P[ti_flags](%%r8)\n\t" \
100 "movq %%rax,%%rdi\n\t" \ 136 "movq %%rax,%%rdi\n\t" \
101 "jc ret_from_fork\n\t" \ 137 "testl %[_tif_fork],%P[ti_flags](%%r8)\n\t" \
138 "jnz ret_from_fork\n\t" \
102 RESTORE_CONTEXT \ 139 RESTORE_CONTEXT \
103 : "=a" (last) \ 140 : "=a" (last) \
141 __switch_canary_oparam \
104 : [next] "S" (next), [prev] "D" (prev), \ 142 : [next] "S" (next), [prev] "D" (prev), \
105 [threadrsp] "i" (offsetof(struct task_struct, thread.sp)), \ 143 [threadrsp] "i" (offsetof(struct task_struct, thread.sp)), \
106 [ti_flags] "i" (offsetof(struct thread_info, flags)), \ 144 [ti_flags] "i" (offsetof(struct thread_info, flags)), \
107 [tif_fork] "i" (TIF_FORK), \ 145 [_tif_fork] "i" (_TIF_FORK), \
108 [thread_info] "i" (offsetof(struct task_struct, stack)), \ 146 [thread_info] "i" (offsetof(struct task_struct, stack)), \
109 [pda_pcurrent] "i" (offsetof(struct x8664_pda, pcurrent)) \ 147 [current_task] "m" (per_cpu_var(current_task)) \
148 __switch_canary_iparam \
110 : "memory", "cc" __EXTRA_CLOBBER) 149 : "memory", "cc" __EXTRA_CLOBBER)
111#endif 150#endif
112 151
@@ -165,6 +204,25 @@ extern void native_load_gs_index(unsigned);
165#define savesegment(seg, value) \ 204#define savesegment(seg, value) \
166 asm("mov %%" #seg ",%0":"=r" (value) : : "memory") 205 asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
167 206
207/*
208 * x86_32 user gs accessors.
209 */
210#ifdef CONFIG_X86_32
211#ifdef CONFIG_X86_32_LAZY_GS
212#define get_user_gs(regs) (u16)({unsigned long v; savesegment(gs, v); v;})
213#define set_user_gs(regs, v) loadsegment(gs, (unsigned long)(v))
214#define task_user_gs(tsk) ((tsk)->thread.gs)
215#define lazy_save_gs(v) savesegment(gs, (v))
216#define lazy_load_gs(v) loadsegment(gs, (v))
217#else /* X86_32_LAZY_GS */
218#define get_user_gs(regs) (u16)((regs)->gs)
219#define set_user_gs(regs, v) do { (regs)->gs = (v); } while (0)
220#define task_user_gs(tsk) (task_pt_regs(tsk)->gs)
221#define lazy_save_gs(v) do { } while (0)
222#define lazy_load_gs(v) do { } while (0)
223#endif /* X86_32_LAZY_GS */
224#endif /* X86_32 */
225
168static inline unsigned long get_limit(unsigned long segment) 226static inline unsigned long get_limit(unsigned long segment)
169{ 227{
170 unsigned long __limit; 228 unsigned long __limit;
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 98789647baa9..df9d5f78385e 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -40,6 +40,7 @@ struct thread_info {
40 */ 40 */
41 __u8 supervisor_stack[0]; 41 __u8 supervisor_stack[0];
42#endif 42#endif
43 int uaccess_err;
43}; 44};
44 45
45#define INIT_THREAD_INFO(tsk) \ 46#define INIT_THREAD_INFO(tsk) \
@@ -194,25 +195,21 @@ static inline struct thread_info *current_thread_info(void)
194 195
195#else /* X86_32 */ 196#else /* X86_32 */
196 197
197#include <asm/pda.h> 198#include <asm/percpu.h>
199#define KERNEL_STACK_OFFSET (5*8)
198 200
199/* 201/*
200 * macros/functions for gaining access to the thread information structure 202 * macros/functions for gaining access to the thread information structure
201 * preempt_count needs to be 1 initially, until the scheduler is functional. 203 * preempt_count needs to be 1 initially, until the scheduler is functional.
202 */ 204 */
203#ifndef __ASSEMBLY__ 205#ifndef __ASSEMBLY__
204static inline struct thread_info *current_thread_info(void) 206DECLARE_PER_CPU(unsigned long, kernel_stack);
205{
206 struct thread_info *ti;
207 ti = (void *)(read_pda(kernelstack) + PDA_STACKOFFSET - THREAD_SIZE);
208 return ti;
209}
210 207
211/* do not use in interrupt context */ 208static inline struct thread_info *current_thread_info(void)
212static inline struct thread_info *stack_thread_info(void)
213{ 209{
214 struct thread_info *ti; 210 struct thread_info *ti;
215 asm("andq %%rsp,%0; " : "=r" (ti) : "0" (~(THREAD_SIZE - 1))); 211 ti = (void *)(percpu_read(kernel_stack) +
212 KERNEL_STACK_OFFSET - THREAD_SIZE);
216 return ti; 213 return ti;
217} 214}
218 215
@@ -220,8 +217,8 @@ static inline struct thread_info *stack_thread_info(void)
220 217
221/* how to get the thread information struct from ASM */ 218/* how to get the thread information struct from ASM */
222#define GET_THREAD_INFO(reg) \ 219#define GET_THREAD_INFO(reg) \
223 movq %gs:pda_kernelstack,reg ; \ 220 movq PER_CPU_VAR(kernel_stack),reg ; \
224 subq $(THREAD_SIZE-PDA_STACKOFFSET),reg 221 subq $(THREAD_SIZE-KERNEL_STACK_OFFSET),reg
225 222
226#endif 223#endif
227 224
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index 2bb6a835c453..a81195eaa2b3 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -3,6 +3,7 @@
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/pm.h> 4#include <linux/pm.h>
5#include <linux/percpu.h> 5#include <linux/percpu.h>
6#include <linux/interrupt.h>
6 7
7#define TICK_SIZE (tick_nsec / 1000) 8#define TICK_SIZE (tick_nsec / 1000)
8 9
@@ -12,6 +13,7 @@ unsigned long native_calibrate_tsc(void);
12#ifdef CONFIG_X86_32 13#ifdef CONFIG_X86_32
13extern int timer_ack; 14extern int timer_ack;
14extern int recalibrate_cpu_khz(void); 15extern int recalibrate_cpu_khz(void);
16extern irqreturn_t timer_interrupt(int irq, void *dev_id);
15#endif /* CONFIG_X86_32 */ 17#endif /* CONFIG_X86_32 */
16 18
17extern int no_timer_check; 19extern int no_timer_check;
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index 0e7bbb549116..d3539f998f88 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -113,7 +113,7 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,
113 __flush_tlb(); 113 __flush_tlb();
114} 114}
115 115
116static inline void native_flush_tlb_others(const cpumask_t *cpumask, 116static inline void native_flush_tlb_others(const struct cpumask *cpumask,
117 struct mm_struct *mm, 117 struct mm_struct *mm,
118 unsigned long va) 118 unsigned long va)
119{ 119{
@@ -142,31 +142,28 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,
142 flush_tlb_mm(vma->vm_mm); 142 flush_tlb_mm(vma->vm_mm);
143} 143}
144 144
145void native_flush_tlb_others(const cpumask_t *cpumask, struct mm_struct *mm, 145void native_flush_tlb_others(const struct cpumask *cpumask,
146 unsigned long va); 146 struct mm_struct *mm, unsigned long va);
147 147
148#define TLBSTATE_OK 1 148#define TLBSTATE_OK 1
149#define TLBSTATE_LAZY 2 149#define TLBSTATE_LAZY 2
150 150
151#ifdef CONFIG_X86_32
152struct tlb_state { 151struct tlb_state {
153 struct mm_struct *active_mm; 152 struct mm_struct *active_mm;
154 int state; 153 int state;
155 char __cacheline_padding[L1_CACHE_BYTES-8];
156}; 154};
157DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate); 155DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate);
158 156
159void reset_lazy_tlbstate(void);
160#else
161static inline void reset_lazy_tlbstate(void) 157static inline void reset_lazy_tlbstate(void)
162{ 158{
159 percpu_write(cpu_tlbstate.state, 0);
160 percpu_write(cpu_tlbstate.active_mm, &init_mm);
163} 161}
164#endif
165 162
166#endif /* SMP */ 163#endif /* SMP */
167 164
168#ifndef CONFIG_PARAVIRT 165#ifndef CONFIG_PARAVIRT
169#define flush_tlb_others(mask, mm, va) native_flush_tlb_others(&mask, mm, va) 166#define flush_tlb_others(mask, mm, va) native_flush_tlb_others(mask, mm, va)
170#endif 167#endif
171 168
172static inline void flush_tlb_kernel_range(unsigned long start, 169static inline void flush_tlb_kernel_range(unsigned long start,
@@ -175,4 +172,6 @@ static inline void flush_tlb_kernel_range(unsigned long start,
175 flush_tlb_all(); 172 flush_tlb_all();
176} 173}
177 174
175extern void zap_low_mappings(void);
176
178#endif /* _ASM_X86_TLBFLUSH_H */ 177#endif /* _ASM_X86_TLBFLUSH_H */
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 4e2f2e0aab27..77cfb2cfb386 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -74,6 +74,8 @@ static inline const struct cpumask *cpumask_of_node(int node)
74 return &node_to_cpumask_map[node]; 74 return &node_to_cpumask_map[node];
75} 75}
76 76
77static inline void setup_node_to_cpumask_map(void) { }
78
77#else /* CONFIG_X86_64 */ 79#else /* CONFIG_X86_64 */
78 80
79/* Mappings between node number and cpus on that node. */ 81/* Mappings between node number and cpus on that node. */
@@ -83,7 +85,8 @@ extern cpumask_t *node_to_cpumask_map;
83DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map); 85DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);
84 86
85/* Returns the number of the current Node. */ 87/* Returns the number of the current Node. */
86#define numa_node_id() read_pda(nodenumber) 88DECLARE_PER_CPU(int, node_number);
89#define numa_node_id() percpu_read(node_number)
87 90
88#ifdef CONFIG_DEBUG_PER_CPU_MAPS 91#ifdef CONFIG_DEBUG_PER_CPU_MAPS
89extern int cpu_to_node(int cpu); 92extern int cpu_to_node(int cpu);
@@ -102,10 +105,7 @@ static inline int cpu_to_node(int cpu)
102/* Same function but used if called before per_cpu areas are setup */ 105/* Same function but used if called before per_cpu areas are setup */
103static inline int early_cpu_to_node(int cpu) 106static inline int early_cpu_to_node(int cpu)
104{ 107{
105 if (early_per_cpu_ptr(x86_cpu_to_node_map)) 108 return early_per_cpu(x86_cpu_to_node_map, cpu);
106 return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
107
108 return per_cpu(x86_cpu_to_node_map, cpu);
109} 109}
110 110
111/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ 111/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
@@ -122,6 +122,8 @@ static inline cpumask_t node_to_cpumask(int node)
122 122
123#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ 123#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
124 124
125extern void setup_node_to_cpumask_map(void);
126
125/* 127/*
126 * Replace default node_to_cpumask_ptr with optimized version 128 * Replace default node_to_cpumask_ptr with optimized version
127 * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)" 129 * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
@@ -192,9 +194,20 @@ extern int __node_distance(int, int);
192 194
193#else /* !CONFIG_NUMA */ 195#else /* !CONFIG_NUMA */
194 196
195#define numa_node_id() 0 197static inline int numa_node_id(void)
196#define cpu_to_node(cpu) 0 198{
197#define early_cpu_to_node(cpu) 0 199 return 0;
200}
201
202static inline int cpu_to_node(int cpu)
203{
204 return 0;
205}
206
207static inline int early_cpu_to_node(int cpu)
208{
209 return 0;
210}
198 211
199static inline const cpumask_t *cpumask_of_node(int node) 212static inline const cpumask_t *cpumask_of_node(int node)
200{ 213{
@@ -209,6 +222,8 @@ static inline int node_to_first_cpu(int node)
209 return first_cpu(cpu_online_map); 222 return first_cpu(cpu_online_map);
210} 223}
211 224
225static inline void setup_node_to_cpumask_map(void) { }
226
212/* 227/*
213 * Replace default node_to_cpumask_ptr with optimized version 228 * Replace default node_to_cpumask_ptr with optimized version
214 * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)" 229 * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
diff --git a/arch/x86/include/asm/trampoline.h b/arch/x86/include/asm/trampoline.h
index 780ba0ab94f9..90f06c25221d 100644
--- a/arch/x86/include/asm/trampoline.h
+++ b/arch/x86/include/asm/trampoline.h
@@ -13,6 +13,7 @@ extern unsigned char *trampoline_base;
13 13
14extern unsigned long init_rsp; 14extern unsigned long init_rsp;
15extern unsigned long initial_code; 15extern unsigned long initial_code;
16extern unsigned long initial_gs;
16 17
17#define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE) 18#define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE)
18#define TRAMPOLINE_BASE 0x6000 19#define TRAMPOLINE_BASE 0x6000
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index cf3bb053da0b..0d5342515b86 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -41,7 +41,7 @@ dotraplinkage void do_int3(struct pt_regs *, long);
41dotraplinkage void do_overflow(struct pt_regs *, long); 41dotraplinkage void do_overflow(struct pt_regs *, long);
42dotraplinkage void do_bounds(struct pt_regs *, long); 42dotraplinkage void do_bounds(struct pt_regs *, long);
43dotraplinkage void do_invalid_op(struct pt_regs *, long); 43dotraplinkage void do_invalid_op(struct pt_regs *, long);
44dotraplinkage void do_device_not_available(struct pt_regs); 44dotraplinkage void do_device_not_available(struct pt_regs *, long);
45dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long); 45dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long);
46dotraplinkage void do_invalid_TSS(struct pt_regs *, long); 46dotraplinkage void do_invalid_TSS(struct pt_regs *, long);
47dotraplinkage void do_segment_not_present(struct pt_regs *, long); 47dotraplinkage void do_segment_not_present(struct pt_regs *, long);
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 4340055b7559..b685ece89d5c 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -121,7 +121,7 @@ extern int __get_user_bad(void);
121 121
122#define __get_user_x(size, ret, x, ptr) \ 122#define __get_user_x(size, ret, x, ptr) \
123 asm volatile("call __get_user_" #size \ 123 asm volatile("call __get_user_" #size \
124 : "=a" (ret),"=d" (x) \ 124 : "=a" (ret), "=d" (x) \
125 : "0" (ptr)) \ 125 : "0" (ptr)) \
126 126
127/* Careful: we have to cast the result to the type of the pointer 127/* Careful: we have to cast the result to the type of the pointer
@@ -181,12 +181,12 @@ extern int __get_user_bad(void);
181 181
182#define __put_user_x(size, x, ptr, __ret_pu) \ 182#define __put_user_x(size, x, ptr, __ret_pu) \
183 asm volatile("call __put_user_" #size : "=a" (__ret_pu) \ 183 asm volatile("call __put_user_" #size : "=a" (__ret_pu) \
184 :"0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") 184 : "0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
185 185
186 186
187 187
188#ifdef CONFIG_X86_32 188#ifdef CONFIG_X86_32
189#define __put_user_u64(x, addr, err) \ 189#define __put_user_asm_u64(x, addr, err, errret) \
190 asm volatile("1: movl %%eax,0(%2)\n" \ 190 asm volatile("1: movl %%eax,0(%2)\n" \
191 "2: movl %%edx,4(%2)\n" \ 191 "2: movl %%edx,4(%2)\n" \
192 "3:\n" \ 192 "3:\n" \
@@ -197,14 +197,24 @@ extern int __get_user_bad(void);
197 _ASM_EXTABLE(1b, 4b) \ 197 _ASM_EXTABLE(1b, 4b) \
198 _ASM_EXTABLE(2b, 4b) \ 198 _ASM_EXTABLE(2b, 4b) \
199 : "=r" (err) \ 199 : "=r" (err) \
200 : "A" (x), "r" (addr), "i" (-EFAULT), "0" (err)) 200 : "A" (x), "r" (addr), "i" (errret), "0" (err))
201
202#define __put_user_asm_ex_u64(x, addr) \
203 asm volatile("1: movl %%eax,0(%1)\n" \
204 "2: movl %%edx,4(%1)\n" \
205 "3:\n" \
206 _ASM_EXTABLE(1b, 2b - 1b) \
207 _ASM_EXTABLE(2b, 3b - 2b) \
208 : : "A" (x), "r" (addr))
201 209
202#define __put_user_x8(x, ptr, __ret_pu) \ 210#define __put_user_x8(x, ptr, __ret_pu) \
203 asm volatile("call __put_user_8" : "=a" (__ret_pu) \ 211 asm volatile("call __put_user_8" : "=a" (__ret_pu) \
204 : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx") 212 : "A" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")
205#else 213#else
206#define __put_user_u64(x, ptr, retval) \ 214#define __put_user_asm_u64(x, ptr, retval, errret) \
207 __put_user_asm(x, ptr, retval, "q", "", "Zr", -EFAULT) 215 __put_user_asm(x, ptr, retval, "q", "", "Zr", errret)
216#define __put_user_asm_ex_u64(x, addr) \
217 __put_user_asm_ex(x, addr, "q", "", "Zr")
208#define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu) 218#define __put_user_x8(x, ptr, __ret_pu) __put_user_x(8, x, ptr, __ret_pu)
209#endif 219#endif
210 220
@@ -276,10 +286,32 @@ do { \
276 __put_user_asm(x, ptr, retval, "w", "w", "ir", errret); \ 286 __put_user_asm(x, ptr, retval, "w", "w", "ir", errret); \
277 break; \ 287 break; \
278 case 4: \ 288 case 4: \
279 __put_user_asm(x, ptr, retval, "l", "k", "ir", errret);\ 289 __put_user_asm(x, ptr, retval, "l", "k", "ir", errret); \
280 break; \ 290 break; \
281 case 8: \ 291 case 8: \
282 __put_user_u64((__typeof__(*ptr))(x), ptr, retval); \ 292 __put_user_asm_u64((__typeof__(*ptr))(x), ptr, retval, \
293 errret); \
294 break; \
295 default: \
296 __put_user_bad(); \
297 } \
298} while (0)
299
300#define __put_user_size_ex(x, ptr, size) \
301do { \
302 __chk_user_ptr(ptr); \
303 switch (size) { \
304 case 1: \
305 __put_user_asm_ex(x, ptr, "b", "b", "iq"); \
306 break; \
307 case 2: \
308 __put_user_asm_ex(x, ptr, "w", "w", "ir"); \
309 break; \
310 case 4: \
311 __put_user_asm_ex(x, ptr, "l", "k", "ir"); \
312 break; \
313 case 8: \
314 __put_user_asm_ex_u64((__typeof__(*ptr))(x), ptr); \
283 break; \ 315 break; \
284 default: \ 316 default: \
285 __put_user_bad(); \ 317 __put_user_bad(); \
@@ -311,9 +343,12 @@ do { \
311 343
312#ifdef CONFIG_X86_32 344#ifdef CONFIG_X86_32
313#define __get_user_asm_u64(x, ptr, retval, errret) (x) = __get_user_bad() 345#define __get_user_asm_u64(x, ptr, retval, errret) (x) = __get_user_bad()
346#define __get_user_asm_ex_u64(x, ptr) (x) = __get_user_bad()
314#else 347#else
315#define __get_user_asm_u64(x, ptr, retval, errret) \ 348#define __get_user_asm_u64(x, ptr, retval, errret) \
316 __get_user_asm(x, ptr, retval, "q", "", "=r", errret) 349 __get_user_asm(x, ptr, retval, "q", "", "=r", errret)
350#define __get_user_asm_ex_u64(x, ptr) \
351 __get_user_asm_ex(x, ptr, "q", "", "=r")
317#endif 352#endif
318 353
319#define __get_user_size(x, ptr, size, retval, errret) \ 354#define __get_user_size(x, ptr, size, retval, errret) \
@@ -350,6 +385,33 @@ do { \
350 : "=r" (err), ltype(x) \ 385 : "=r" (err), ltype(x) \
351 : "m" (__m(addr)), "i" (errret), "0" (err)) 386 : "m" (__m(addr)), "i" (errret), "0" (err))
352 387
388#define __get_user_size_ex(x, ptr, size) \
389do { \
390 __chk_user_ptr(ptr); \
391 switch (size) { \
392 case 1: \
393 __get_user_asm_ex(x, ptr, "b", "b", "=q"); \
394 break; \
395 case 2: \
396 __get_user_asm_ex(x, ptr, "w", "w", "=r"); \
397 break; \
398 case 4: \
399 __get_user_asm_ex(x, ptr, "l", "k", "=r"); \
400 break; \
401 case 8: \
402 __get_user_asm_ex_u64(x, ptr); \
403 break; \
404 default: \
405 (x) = __get_user_bad(); \
406 } \
407} while (0)
408
409#define __get_user_asm_ex(x, addr, itype, rtype, ltype) \
410 asm volatile("1: mov"itype" %1,%"rtype"0\n" \
411 "2:\n" \
412 _ASM_EXTABLE(1b, 2b - 1b) \
413 : ltype(x) : "m" (__m(addr)))
414
353#define __put_user_nocheck(x, ptr, size) \ 415#define __put_user_nocheck(x, ptr, size) \
354({ \ 416({ \
355 int __pu_err; \ 417 int __pu_err; \
@@ -385,6 +447,26 @@ struct __large_struct { unsigned long buf[100]; };
385 _ASM_EXTABLE(1b, 3b) \ 447 _ASM_EXTABLE(1b, 3b) \
386 : "=r"(err) \ 448 : "=r"(err) \
387 : ltype(x), "m" (__m(addr)), "i" (errret), "0" (err)) 449 : ltype(x), "m" (__m(addr)), "i" (errret), "0" (err))
450
451#define __put_user_asm_ex(x, addr, itype, rtype, ltype) \
452 asm volatile("1: mov"itype" %"rtype"0,%1\n" \
453 "2:\n" \
454 _ASM_EXTABLE(1b, 2b - 1b) \
455 : : ltype(x), "m" (__m(addr)))
456
457/*
458 * uaccess_try and catch
459 */
460#define uaccess_try do { \
461 int prev_err = current_thread_info()->uaccess_err; \
462 current_thread_info()->uaccess_err = 0; \
463 barrier();
464
465#define uaccess_catch(err) \
466 (err) |= current_thread_info()->uaccess_err; \
467 current_thread_info()->uaccess_err = prev_err; \
468} while (0)
469
388/** 470/**
389 * __get_user: - Get a simple variable from user space, with less checking. 471 * __get_user: - Get a simple variable from user space, with less checking.
390 * @x: Variable to store result. 472 * @x: Variable to store result.
@@ -408,6 +490,7 @@ struct __large_struct { unsigned long buf[100]; };
408 490
409#define __get_user(x, ptr) \ 491#define __get_user(x, ptr) \
410 __get_user_nocheck((x), (ptr), sizeof(*(ptr))) 492 __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
493
411/** 494/**
412 * __put_user: - Write a simple value into user space, with less checking. 495 * __put_user: - Write a simple value into user space, with less checking.
413 * @x: Value to copy to user space. 496 * @x: Value to copy to user space.
@@ -435,6 +518,45 @@ struct __large_struct { unsigned long buf[100]; };
435#define __put_user_unaligned __put_user 518#define __put_user_unaligned __put_user
436 519
437/* 520/*
521 * {get|put}_user_try and catch
522 *
523 * get_user_try {
524 * get_user_ex(...);
525 * } get_user_catch(err)
526 */
527#define get_user_try uaccess_try
528#define get_user_catch(err) uaccess_catch(err)
529
530#define get_user_ex(x, ptr) do { \
531 unsigned long __gue_val; \
532 __get_user_size_ex((__gue_val), (ptr), (sizeof(*(ptr)))); \
533 (x) = (__force __typeof__(*(ptr)))__gue_val; \
534} while (0)
535
536#ifdef CONFIG_X86_WP_WORKS_OK
537
538#define put_user_try uaccess_try
539#define put_user_catch(err) uaccess_catch(err)
540
541#define put_user_ex(x, ptr) \
542 __put_user_size_ex((__typeof__(*(ptr)))(x), (ptr), sizeof(*(ptr)))
543
544#else /* !CONFIG_X86_WP_WORKS_OK */
545
546#define put_user_try do { \
547 int __uaccess_err = 0;
548
549#define put_user_catch(err) \
550 (err) |= __uaccess_err; \
551} while (0)
552
553#define put_user_ex(x, ptr) do { \
554 __uaccess_err |= __put_user(x, ptr); \
555} while (0)
556
557#endif /* CONFIG_X86_WP_WORKS_OK */
558
559/*
438 * movsl can be slow when source and dest are not both 8-byte aligned 560 * movsl can be slow when source and dest are not both 8-byte aligned
439 */ 561 */
440#ifdef CONFIG_X86_INTEL_USERCOPY 562#ifdef CONFIG_X86_INTEL_USERCOPY
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index 84210c479fca..8cc687326eb8 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -188,16 +188,16 @@ __copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
188extern long __copy_user_nocache(void *dst, const void __user *src, 188extern long __copy_user_nocache(void *dst, const void __user *src,
189 unsigned size, int zerorest); 189 unsigned size, int zerorest);
190 190
191static inline int __copy_from_user_nocache(void *dst, const void __user *src, 191static inline int
192 unsigned size) 192__copy_from_user_nocache(void *dst, const void __user *src, unsigned size)
193{ 193{
194 might_sleep(); 194 might_sleep();
195 return __copy_user_nocache(dst, src, size, 1); 195 return __copy_user_nocache(dst, src, size, 1);
196} 196}
197 197
198static inline int __copy_from_user_inatomic_nocache(void *dst, 198static inline int
199 const void __user *src, 199__copy_from_user_inatomic_nocache(void *dst, const void __user *src,
200 unsigned size) 200 unsigned size)
201{ 201{
202 return __copy_user_nocache(dst, src, size, 0); 202 return __copy_user_nocache(dst, src, size, 0);
203} 203}
diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h
new file mode 100644
index 000000000000..c0a01b5d985b
--- /dev/null
+++ b/arch/x86/include/asm/uv/uv.h
@@ -0,0 +1,33 @@
1#ifndef _ASM_X86_UV_UV_H
2#define _ASM_X86_UV_UV_H
3
4enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC};
5
6struct cpumask;
7struct mm_struct;
8
9#ifdef CONFIG_X86_UV
10
11extern enum uv_system_type get_uv_system_type(void);
12extern int is_uv_system(void);
13extern void uv_cpu_init(void);
14extern void uv_system_init(void);
15extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
16 struct mm_struct *mm,
17 unsigned long va,
18 unsigned int cpu);
19
20#else /* X86_UV */
21
22static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; }
23static inline int is_uv_system(void) { return 0; }
24static inline void uv_cpu_init(void) { }
25static inline void uv_system_init(void) { }
26static inline const struct cpumask *
27uv_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm,
28 unsigned long va, unsigned int cpu)
29{ return cpumask; }
30
31#endif /* X86_UV */
32
33#endif /* _ASM_X86_UV_UV_H */
diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h
index 50423c7b56b2..9b0e61bf7a88 100644
--- a/arch/x86/include/asm/uv/uv_bau.h
+++ b/arch/x86/include/asm/uv/uv_bau.h
@@ -325,7 +325,6 @@ static inline void bau_cpubits_clear(struct bau_local_cpumask *dstp, int nbits)
325#define cpubit_isset(cpu, bau_local_cpumask) \ 325#define cpubit_isset(cpu, bau_local_cpumask) \
326 test_bit((cpu), (bau_local_cpumask).bits) 326 test_bit((cpu), (bau_local_cpumask).bits)
327 327
328extern int uv_flush_tlb_others(cpumask_t *, struct mm_struct *, unsigned long);
329extern void uv_bau_message_intr1(void); 328extern void uv_bau_message_intr1(void);
330extern void uv_bau_timeout_intr1(void); 329extern void uv_bau_timeout_intr1(void);
331 330
diff --git a/arch/x86/include/asm/vic.h b/arch/x86/include/asm/vic.h
deleted file mode 100644
index 53100f353612..000000000000
--- a/arch/x86/include/asm/vic.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/* Copyright (C) 1999,2001
2 *
3 * Author: J.E.J.Bottomley@HansenPartnership.com
4 *
5 * Standard include definitions for the NCR Voyager Interrupt Controller */
6
7/* The eight CPI vectors. To activate a CPI, you write a bit mask
8 * corresponding to the processor set to be interrupted into the
9 * relevant register. That set of CPUs will then be interrupted with
10 * the CPI */
11static const int VIC_CPI_Registers[] =
12 {0xFC00, 0xFC01, 0xFC08, 0xFC09,
13 0xFC10, 0xFC11, 0xFC18, 0xFC19 };
14
15#define VIC_PROC_WHO_AM_I 0xfc29
16# define QUAD_IDENTIFIER 0xC0
17# define EIGHT_SLOT_IDENTIFIER 0xE0
18#define QIC_EXTENDED_PROCESSOR_SELECT 0xFC72
19#define VIC_CPI_BASE_REGISTER 0xFC41
20#define VIC_PROCESSOR_ID 0xFC21
21# define VIC_CPU_MASQUERADE_ENABLE 0x8
22
23#define VIC_CLAIM_REGISTER_0 0xFC38
24#define VIC_CLAIM_REGISTER_1 0xFC39
25#define VIC_REDIRECT_REGISTER_0 0xFC60
26#define VIC_REDIRECT_REGISTER_1 0xFC61
27#define VIC_PRIORITY_REGISTER 0xFC20
28
29#define VIC_PRIMARY_MC_BASE 0xFC48
30#define VIC_SECONDARY_MC_BASE 0xFC49
31
32#define QIC_PROCESSOR_ID 0xFC71
33# define QIC_CPUID_ENABLE 0x08
34
35#define QIC_VIC_CPI_BASE_REGISTER 0xFC79
36#define QIC_CPI_BASE_REGISTER 0xFC7A
37
38#define QIC_MASK_REGISTER0 0xFC80
39/* NOTE: these are masked high, enabled low */
40# define QIC_PERF_TIMER 0x01
41# define QIC_LPE 0x02
42# define QIC_SYS_INT 0x04
43# define QIC_CMN_INT 0x08
44/* at the moment, just enable CMN_INT, disable SYS_INT */
45# define QIC_DEFAULT_MASK0 (~(QIC_CMN_INT /* | VIC_SYS_INT */))
46#define QIC_MASK_REGISTER1 0xFC81
47# define QIC_BOOT_CPI_MASK 0xFE
48/* Enable CPI's 1-6 inclusive */
49# define QIC_CPI_ENABLE 0x81
50
51#define QIC_INTERRUPT_CLEAR0 0xFC8A
52#define QIC_INTERRUPT_CLEAR1 0xFC8B
53
54/* this is where we place the CPI vectors */
55#define VIC_DEFAULT_CPI_BASE 0xC0
56/* this is where we place the QIC CPI vectors */
57#define QIC_DEFAULT_CPI_BASE 0xD0
58
59#define VIC_BOOT_INTERRUPT_MASK 0xfe
60
61extern void smp_vic_timer_interrupt(void);
diff --git a/arch/x86/include/asm/virtext.h b/arch/x86/include/asm/virtext.h
index 593636275238..e0f9aa16358b 100644
--- a/arch/x86/include/asm/virtext.h
+++ b/arch/x86/include/asm/virtext.h
@@ -118,7 +118,7 @@ static inline void cpu_svm_disable(void)
118 118
119 wrmsrl(MSR_VM_HSAVE_PA, 0); 119 wrmsrl(MSR_VM_HSAVE_PA, 0);
120 rdmsrl(MSR_EFER, efer); 120 rdmsrl(MSR_EFER, efer);
121 wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); 121 wrmsrl(MSR_EFER, efer & ~EFER_SVME);
122} 122}
123 123
124/** Makes sure SVM is disabled, if it is supported on the CPU 124/** Makes sure SVM is disabled, if it is supported on the CPU
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index d0238e6151d8..498f944010b9 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -270,8 +270,9 @@ enum vmcs_field {
270 270
271#define INTR_TYPE_EXT_INTR (0 << 8) /* external interrupt */ 271#define INTR_TYPE_EXT_INTR (0 << 8) /* external interrupt */
272#define INTR_TYPE_NMI_INTR (2 << 8) /* NMI */ 272#define INTR_TYPE_NMI_INTR (2 << 8) /* NMI */
273#define INTR_TYPE_EXCEPTION (3 << 8) /* processor exception */ 273#define INTR_TYPE_HARD_EXCEPTION (3 << 8) /* processor exception */
274#define INTR_TYPE_SOFT_INTR (4 << 8) /* software interrupt */ 274#define INTR_TYPE_SOFT_INTR (4 << 8) /* software interrupt */
275#define INTR_TYPE_SOFT_EXCEPTION (6 << 8) /* software exception */
275 276
276/* GUEST_INTERRUPTIBILITY_INFO flags. */ 277/* GUEST_INTERRUPTIBILITY_INFO flags. */
277#define GUEST_INTR_STATE_STI 0x00000001 278#define GUEST_INTR_STATE_STI 0x00000001
@@ -311,7 +312,7 @@ enum vmcs_field {
311#define DEBUG_REG_ACCESS_TYPE 0x10 /* 4, direction of access */ 312#define DEBUG_REG_ACCESS_TYPE 0x10 /* 4, direction of access */
312#define TYPE_MOV_TO_DR (0 << 4) 313#define TYPE_MOV_TO_DR (0 << 4)
313#define TYPE_MOV_FROM_DR (1 << 4) 314#define TYPE_MOV_FROM_DR (1 << 4)
314#define DEBUG_REG_ACCESS_REG 0xf00 /* 11:8, general purpose reg. */ 315#define DEBUG_REG_ACCESS_REG(eq) (((eq) >> 8) & 0xf) /* 11:8, general purpose reg. */
315 316
316 317
317/* segment AR */ 318/* segment AR */
diff --git a/arch/x86/include/asm/voyager.h b/arch/x86/include/asm/voyager.h
deleted file mode 100644
index b3e647307625..000000000000
--- a/arch/x86/include/asm/voyager.h
+++ /dev/null
@@ -1,529 +0,0 @@
1/* Copyright (C) 1999,2001
2 *
3 * Author: J.E.J.Bottomley@HansenPartnership.com
4 *
5 * Standard include definitions for the NCR Voyager system */
6
7#undef VOYAGER_DEBUG
8#undef VOYAGER_CAT_DEBUG
9
10#ifdef VOYAGER_DEBUG
11#define VDEBUG(x) printk x
12#else
13#define VDEBUG(x)
14#endif
15
16/* There are three levels of voyager machine: 3,4 and 5. The rule is
17 * if it's less than 3435 it's a Level 3 except for a 3360 which is
18 * a level 4. A 3435 or above is a Level 5 */
19#define VOYAGER_LEVEL5_AND_ABOVE 0x3435
20#define VOYAGER_LEVEL4 0x3360
21
22/* The L4 DINO ASIC */
23#define VOYAGER_DINO 0x43
24
25/* voyager ports in standard I/O space */
26#define VOYAGER_MC_SETUP 0x96
27
28
29#define VOYAGER_CAT_CONFIG_PORT 0x97
30# define VOYAGER_CAT_DESELECT 0xff
31#define VOYAGER_SSPB_RELOCATION_PORT 0x98
32
33/* Valid CAT controller commands */
34/* start instruction register cycle */
35#define VOYAGER_CAT_IRCYC 0x01
36/* start data register cycle */
37#define VOYAGER_CAT_DRCYC 0x02
38/* move to execute state */
39#define VOYAGER_CAT_RUN 0x0F
40/* end operation */
41#define VOYAGER_CAT_END 0x80
42/* hold in idle state */
43#define VOYAGER_CAT_HOLD 0x90
44/* single step an "intest" vector */
45#define VOYAGER_CAT_STEP 0xE0
46/* return cat controller to CLEMSON mode */
47#define VOYAGER_CAT_CLEMSON 0xFF
48
49/* the default cat command header */
50#define VOYAGER_CAT_HEADER 0x7F
51
52/* the range of possible CAT module ids in the system */
53#define VOYAGER_MIN_MODULE 0x10
54#define VOYAGER_MAX_MODULE 0x1f
55
56/* The voyager registers per asic */
57#define VOYAGER_ASIC_ID_REG 0x00
58#define VOYAGER_ASIC_TYPE_REG 0x01
59/* the sub address registers can be made auto incrementing on reads */
60#define VOYAGER_AUTO_INC_REG 0x02
61# define VOYAGER_AUTO_INC 0x04
62# define VOYAGER_NO_AUTO_INC 0xfb
63#define VOYAGER_SUBADDRDATA 0x03
64#define VOYAGER_SCANPATH 0x05
65# define VOYAGER_CONNECT_ASIC 0x01
66# define VOYAGER_DISCONNECT_ASIC 0xfe
67#define VOYAGER_SUBADDRLO 0x06
68#define VOYAGER_SUBADDRHI 0x07
69#define VOYAGER_SUBMODSELECT 0x08
70#define VOYAGER_SUBMODPRESENT 0x09
71
72#define VOYAGER_SUBADDR_LO 0xff
73#define VOYAGER_SUBADDR_HI 0xffff
74
75/* the maximum size of a scan path -- used to form instructions */
76#define VOYAGER_MAX_SCAN_PATH 0x100
77/* the biggest possible register size (in bytes) */
78#define VOYAGER_MAX_REG_SIZE 4
79
80/* Total number of possible modules (including submodules) */
81#define VOYAGER_MAX_MODULES 16
82/* Largest number of asics per module */
83#define VOYAGER_MAX_ASICS_PER_MODULE 7
84
85/* the CAT asic of each module is always the first one */
86#define VOYAGER_CAT_ID 0
87#define VOYAGER_PSI 0x1a
88
89/* voyager instruction operations and registers */
90#define VOYAGER_READ_CONFIG 0x1
91#define VOYAGER_WRITE_CONFIG 0x2
92#define VOYAGER_BYPASS 0xff
93
94typedef struct voyager_asic {
95 __u8 asic_addr; /* ASIC address; Level 4 */
96 __u8 asic_type; /* ASIC type */
97 __u8 asic_id; /* ASIC id */
98 __u8 jtag_id[4]; /* JTAG id */
99 __u8 asic_location; /* Location within scan path; start w/ 0 */
100 __u8 bit_location; /* Location within bit stream; start w/ 0 */
101 __u8 ireg_length; /* Instruction register length */
102 __u16 subaddr; /* Amount of sub address space */
103 struct voyager_asic *next; /* Next asic in linked list */
104} voyager_asic_t;
105
106typedef struct voyager_module {
107 __u8 module_addr; /* Module address */
108 __u8 scan_path_connected; /* Scan path connected */
109 __u16 ee_size; /* Size of the EEPROM */
110 __u16 num_asics; /* Number of Asics */
111 __u16 inst_bits; /* Instruction bits in the scan path */
112 __u16 largest_reg; /* Largest register in the scan path */
113 __u16 smallest_reg; /* Smallest register in the scan path */
114 voyager_asic_t *asic; /* First ASIC in scan path (CAT_I) */
115 struct voyager_module *submodule; /* Submodule pointer */
116 struct voyager_module *next; /* Next module in linked list */
117} voyager_module_t;
118
119typedef struct voyager_eeprom_hdr {
120 __u8 module_id[4];
121 __u8 version_id;
122 __u8 config_id;
123 __u16 boundry_id; /* boundary scan id */
124 __u16 ee_size; /* size of EEPROM */
125 __u8 assembly[11]; /* assembly # */
126 __u8 assembly_rev; /* assembly rev */
127 __u8 tracer[4]; /* tracer number */
128 __u16 assembly_cksum; /* asm checksum */
129 __u16 power_consump; /* pwr requirements */
130 __u16 num_asics; /* number of asics */
131 __u16 bist_time; /* min. bist time */
132 __u16 err_log_offset; /* error log offset */
133 __u16 scan_path_offset;/* scan path offset */
134 __u16 cct_offset;
135 __u16 log_length; /* length of err log */
136 __u16 xsum_end; /* offset to end of
137 checksum */
138 __u8 reserved[4];
139 __u8 sflag; /* starting sentinal */
140 __u8 part_number[13]; /* prom part number */
141 __u8 version[10]; /* version number */
142 __u8 signature[8];
143 __u16 eeprom_chksum;
144 __u32 data_stamp_offset;
145 __u8 eflag ; /* ending sentinal */
146} __attribute__((packed)) voyager_eprom_hdr_t;
147
148
149
150#define VOYAGER_EPROM_SIZE_OFFSET \
151 ((__u16)(&(((voyager_eprom_hdr_t *)0)->ee_size)))
152#define VOYAGER_XSUM_END_OFFSET 0x2a
153
154/* the following three definitions are for internal table layouts
155 * in the module EPROMs. We really only care about the IDs and
156 * offsets */
157typedef struct voyager_sp_table {
158 __u8 asic_id;
159 __u8 bypass_flag;
160 __u16 asic_data_offset;
161 __u16 config_data_offset;
162} __attribute__((packed)) voyager_sp_table_t;
163
164typedef struct voyager_jtag_table {
165 __u8 icode[4];
166 __u8 runbist[4];
167 __u8 intest[4];
168 __u8 samp_preld[4];
169 __u8 ireg_len;
170} __attribute__((packed)) voyager_jtt_t;
171
172typedef struct voyager_asic_data_table {
173 __u8 jtag_id[4];
174 __u16 length_bsr;
175 __u16 length_bist_reg;
176 __u32 bist_clk;
177 __u16 subaddr_bits;
178 __u16 seed_bits;
179 __u16 sig_bits;
180 __u16 jtag_offset;
181} __attribute__((packed)) voyager_at_t;
182
183/* Voyager Interrupt Controller (VIC) registers */
184
185/* Base to add to Cross Processor Interrupts (CPIs) when triggering
186 * the CPU IRQ line */
187/* register defines for the WCBICs (one per processor) */
188#define VOYAGER_WCBIC0 0x41 /* bus A node P1 processor 0 */
189#define VOYAGER_WCBIC1 0x49 /* bus A node P1 processor 1 */
190#define VOYAGER_WCBIC2 0x51 /* bus A node P2 processor 0 */
191#define VOYAGER_WCBIC3 0x59 /* bus A node P2 processor 1 */
192#define VOYAGER_WCBIC4 0x61 /* bus B node P1 processor 0 */
193#define VOYAGER_WCBIC5 0x69 /* bus B node P1 processor 1 */
194#define VOYAGER_WCBIC6 0x71 /* bus B node P2 processor 0 */
195#define VOYAGER_WCBIC7 0x79 /* bus B node P2 processor 1 */
196
197
198/* top of memory registers */
199#define VOYAGER_WCBIC_TOM_L 0x4
200#define VOYAGER_WCBIC_TOM_H 0x5
201
202/* register defines for Voyager Memory Contol (VMC)
203 * these are present on L4 machines only */
204#define VOYAGER_VMC1 0x81
205#define VOYAGER_VMC2 0x91
206#define VOYAGER_VMC3 0xa1
207#define VOYAGER_VMC4 0xb1
208
209/* VMC Ports */
210#define VOYAGER_VMC_MEMORY_SETUP 0x9
211# define VMC_Interleaving 0x01
212# define VMC_4Way 0x02
213# define VMC_EvenCacheLines 0x04
214# define VMC_HighLine 0x08
215# define VMC_Start0_Enable 0x20
216# define VMC_Start1_Enable 0x40
217# define VMC_Vremap 0x80
218#define VOYAGER_VMC_BANK_DENSITY 0xa
219# define VMC_BANK_EMPTY 0
220# define VMC_BANK_4MB 1
221# define VMC_BANK_16MB 2
222# define VMC_BANK_64MB 3
223# define VMC_BANK0_MASK 0x03
224# define VMC_BANK1_MASK 0x0C
225# define VMC_BANK2_MASK 0x30
226# define VMC_BANK3_MASK 0xC0
227
228/* Magellan Memory Controller (MMC) defines - present on L5 */
229#define VOYAGER_MMC_ASIC_ID 1
230/* the two memory modules corresponding to memory cards in the system */
231#define VOYAGER_MMC_MEMORY0_MODULE 0x14
232#define VOYAGER_MMC_MEMORY1_MODULE 0x15
233/* the Magellan Memory Address (MMA) defines */
234#define VOYAGER_MMA_ASIC_ID 2
235
236/* Submodule number for the Quad Baseboard */
237#define VOYAGER_QUAD_BASEBOARD 1
238
239/* ASIC defines for the Quad Baseboard */
240#define VOYAGER_QUAD_QDATA0 1
241#define VOYAGER_QUAD_QDATA1 2
242#define VOYAGER_QUAD_QABC 3
243
244/* Useful areas in extended CMOS */
245#define VOYAGER_PROCESSOR_PRESENT_MASK 0x88a
246#define VOYAGER_MEMORY_CLICKMAP 0xa23
247#define VOYAGER_DUMP_LOCATION 0xb1a
248
249/* SUS In Control bit - used to tell SUS that we don't need to be
250 * babysat anymore */
251#define VOYAGER_SUS_IN_CONTROL_PORT 0x3ff
252# define VOYAGER_IN_CONTROL_FLAG 0x80
253
254/* Voyager PSI defines */
255#define VOYAGER_PSI_STATUS_REG 0x08
256# define PSI_DC_FAIL 0x01
257# define PSI_MON 0x02
258# define PSI_FAULT 0x04
259# define PSI_ALARM 0x08
260# define PSI_CURRENT 0x10
261# define PSI_DVM 0x20
262# define PSI_PSCFAULT 0x40
263# define PSI_STAT_CHG 0x80
264
265#define VOYAGER_PSI_SUPPLY_REG 0x8000
266 /* read */
267# define PSI_FAIL_DC 0x01
268# define PSI_FAIL_AC 0x02
269# define PSI_MON_INT 0x04
270# define PSI_SWITCH_OFF 0x08
271# define PSI_HX_OFF 0x10
272# define PSI_SECURITY 0x20
273# define PSI_CMOS_BATT_LOW 0x40
274# define PSI_CMOS_BATT_FAIL 0x80
275 /* write */
276# define PSI_CLR_SWITCH_OFF 0x13
277# define PSI_CLR_HX_OFF 0x14
278# define PSI_CLR_CMOS_BATT_FAIL 0x17
279
280#define VOYAGER_PSI_MASK 0x8001
281# define PSI_MASK_MASK 0x10
282
283#define VOYAGER_PSI_AC_FAIL_REG 0x8004
284#define AC_FAIL_STAT_CHANGE 0x80
285
286#define VOYAGER_PSI_GENERAL_REG 0x8007
287 /* read */
288# define PSI_SWITCH_ON 0x01
289# define PSI_SWITCH_ENABLED 0x02
290# define PSI_ALARM_ENABLED 0x08
291# define PSI_SECURE_ENABLED 0x10
292# define PSI_COLD_RESET 0x20
293# define PSI_COLD_START 0x80
294 /* write */
295# define PSI_POWER_DOWN 0x10
296# define PSI_SWITCH_DISABLE 0x01
297# define PSI_SWITCH_ENABLE 0x11
298# define PSI_CLEAR 0x12
299# define PSI_ALARM_DISABLE 0x03
300# define PSI_ALARM_ENABLE 0x13
301# define PSI_CLEAR_COLD_RESET 0x05
302# define PSI_SET_COLD_RESET 0x15
303# define PSI_CLEAR_COLD_START 0x07
304# define PSI_SET_COLD_START 0x17
305
306
307
308struct voyager_bios_info {
309 __u8 len;
310 __u8 major;
311 __u8 minor;
312 __u8 debug;
313 __u8 num_classes;
314 __u8 class_1;
315 __u8 class_2;
316};
317
318/* The following structures and definitions are for the Kernel/SUS
319 * interface these are needed to find out how SUS initialised any Quad
320 * boards in the system */
321
322#define NUMBER_OF_MC_BUSSES 2
323#define SLOTS_PER_MC_BUS 8
324#define MAX_CPUS 16 /* 16 way CPU system */
325#define MAX_PROCESSOR_BOARDS 4 /* 4 processor slot system */
326#define MAX_CACHE_LEVELS 4 /* # of cache levels supported */
327#define MAX_SHARED_CPUS 4 /* # of CPUs that can share a LARC */
328#define NUMBER_OF_POS_REGS 8
329
330typedef struct {
331 __u8 MC_Slot;
332 __u8 POS_Values[NUMBER_OF_POS_REGS];
333} __attribute__((packed)) MC_SlotInformation_t;
334
335struct QuadDescription {
336 __u8 Type; /* for type 0 (DYADIC or MONADIC) all fields
337 * will be zero except for slot */
338 __u8 StructureVersion;
339 __u32 CPI_BaseAddress;
340 __u32 LARC_BankSize;
341 __u32 LocalMemoryStateBits;
342 __u8 Slot; /* Processor slots 1 - 4 */
343} __attribute__((packed));
344
345struct ProcBoardInfo {
346 __u8 Type;
347 __u8 StructureVersion;
348 __u8 NumberOfBoards;
349 struct QuadDescription QuadData[MAX_PROCESSOR_BOARDS];
350} __attribute__((packed));
351
352struct CacheDescription {
353 __u8 Level;
354 __u32 TotalSize;
355 __u16 LineSize;
356 __u8 Associativity;
357 __u8 CacheType;
358 __u8 WriteType;
359 __u8 Number_CPUs_SharedBy;
360 __u8 Shared_CPUs_Hardware_IDs[MAX_SHARED_CPUS];
361
362} __attribute__((packed));
363
364struct CPU_Description {
365 __u8 CPU_HardwareId;
366 char *FRU_String;
367 __u8 NumberOfCacheLevels;
368 struct CacheDescription CacheLevelData[MAX_CACHE_LEVELS];
369} __attribute__((packed));
370
371struct CPU_Info {
372 __u8 Type;
373 __u8 StructureVersion;
374 __u8 NumberOf_CPUs;
375 struct CPU_Description CPU_Data[MAX_CPUS];
376} __attribute__((packed));
377
378
379/*
380 * This structure will be used by SUS and the OS.
381 * The assumption about this structure is that no blank space is
382 * packed in it by our friend the compiler.
383 */
384typedef struct {
385 __u8 Mailbox_SUS; /* Written to by SUS to give
386 commands/response to the OS */
387 __u8 Mailbox_OS; /* Written to by the OS to give
388 commands/response to SUS */
389 __u8 SUS_MailboxVersion; /* Tells the OS which iteration of the
390 interface SUS supports */
391 __u8 OS_MailboxVersion; /* Tells SUS which iteration of the
392 interface the OS supports */
393 __u32 OS_Flags; /* Flags set by the OS as info for
394 SUS */
395 __u32 SUS_Flags; /* Flags set by SUS as info
396 for the OS */
397 __u32 WatchDogPeriod; /* Watchdog period (in seconds) which
398 the DP uses to see if the OS
399 is dead */
400 __u32 WatchDogCount; /* Updated by the OS on every tic. */
401 __u32 MemoryFor_SUS_ErrorLog; /* Flat 32 bit address which tells SUS
402 where to stuff the SUS error log
403 on a dump */
404 MC_SlotInformation_t MC_SlotInfo[NUMBER_OF_MC_BUSSES*SLOTS_PER_MC_BUS];
405 /* Storage for MCA POS data */
406 /* All new SECOND_PASS_INTERFACE fields added from this point */
407 struct ProcBoardInfo *BoardData;
408 struct CPU_Info *CPU_Data;
409 /* All new fields must be added from this point */
410} Voyager_KernelSUS_Mbox_t;
411
412/* structure for finding the right memory address to send a QIC CPI to */
413struct voyager_qic_cpi {
414 /* Each cache line (32 bytes) can trigger a cpi. The cpi
415 * read/write may occur anywhere in the cache line---pick the
416 * middle to be safe */
417 struct {
418 __u32 pad1[3];
419 __u32 cpi;
420 __u32 pad2[4];
421 } qic_cpi[8];
422};
423
424struct voyager_status {
425 __u32 power_fail:1;
426 __u32 switch_off:1;
427 __u32 request_from_kernel:1;
428};
429
430struct voyager_psi_regs {
431 __u8 cat_id;
432 __u8 cat_dev;
433 __u8 cat_control;
434 __u8 subaddr;
435 __u8 dummy4;
436 __u8 checkbit;
437 __u8 subaddr_low;
438 __u8 subaddr_high;
439 __u8 intstatus;
440 __u8 stat1;
441 __u8 stat3;
442 __u8 fault;
443 __u8 tms;
444 __u8 gen;
445 __u8 sysconf;
446 __u8 dummy15;
447};
448
449struct voyager_psi_subregs {
450 __u8 supply;
451 __u8 mask;
452 __u8 present;
453 __u8 DCfail;
454 __u8 ACfail;
455 __u8 fail;
456 __u8 UPSfail;
457 __u8 genstatus;
458};
459
460struct voyager_psi {
461 struct voyager_psi_regs regs;
462 struct voyager_psi_subregs subregs;
463};
464
465struct voyager_SUS {
466#define VOYAGER_DUMP_BUTTON_NMI 0x1
467#define VOYAGER_SUS_VALID 0x2
468#define VOYAGER_SYSINT_COMPLETE 0x3
469 __u8 SUS_mbox;
470#define VOYAGER_NO_COMMAND 0x0
471#define VOYAGER_IGNORE_DUMP 0x1
472#define VOYAGER_DO_DUMP 0x2
473#define VOYAGER_SYSINT_HANDSHAKE 0x3
474#define VOYAGER_DO_MEM_DUMP 0x4
475#define VOYAGER_SYSINT_WAS_RECOVERED 0x5
476 __u8 kernel_mbox;
477#define VOYAGER_MAILBOX_VERSION 0x10
478 __u8 SUS_version;
479 __u8 kernel_version;
480#define VOYAGER_OS_HAS_SYSINT 0x1
481#define VOYAGER_OS_IN_PROGRESS 0x2
482#define VOYAGER_UPDATING_WDPERIOD 0x4
483 __u32 kernel_flags;
484#define VOYAGER_SUS_BOOTING 0x1
485#define VOYAGER_SUS_IN_PROGRESS 0x2
486 __u32 SUS_flags;
487 __u32 watchdog_period;
488 __u32 watchdog_count;
489 __u32 SUS_errorlog;
490 /* lots of system configuration stuff under here */
491};
492
493/* Variables exported by voyager_smp */
494extern __u32 voyager_extended_vic_processors;
495extern __u32 voyager_allowed_boot_processors;
496extern __u32 voyager_quad_processors;
497extern struct voyager_qic_cpi *voyager_quad_cpi_addr[NR_CPUS];
498extern struct voyager_SUS *voyager_SUS;
499
500/* variables exported always */
501extern struct task_struct *voyager_thread;
502extern int voyager_level;
503extern struct voyager_status voyager_status;
504
505/* functions exported by the voyager and voyager_smp modules */
506extern int voyager_cat_readb(__u8 module, __u8 asic, int reg);
507extern void voyager_cat_init(void);
508extern void voyager_detect(struct voyager_bios_info *);
509extern void voyager_trap_init(void);
510extern void voyager_setup_irqs(void);
511extern int voyager_memory_detect(int region, __u32 *addr, __u32 *length);
512extern void voyager_smp_intr_init(void);
513extern __u8 voyager_extended_cmos_read(__u16 cmos_address);
514extern void voyager_smp_dump(void);
515extern void voyager_timer_interrupt(void);
516extern void smp_local_timer_interrupt(void);
517extern void voyager_power_off(void);
518extern void smp_voyager_power_off(void *dummy);
519extern void voyager_restart(void);
520extern void voyager_cat_power_off(void);
521extern void voyager_cat_do_common_interrupt(void);
522extern void voyager_handle_nmi(void);
523extern void voyager_smp_intr_init(void);
524/* Commands for the following are */
525#define VOYAGER_PSI_READ 0
526#define VOYAGER_PSI_WRITE 1
527#define VOYAGER_PSI_SUBREAD 2
528#define VOYAGER_PSI_SUBWRITE 3
529extern void voyager_cat_psi(__u8, __u16, __u8 *);
diff --git a/arch/x86/include/asm/xen/events.h b/arch/x86/include/asm/xen/events.h
index 19144184983a..1df35417c412 100644
--- a/arch/x86/include/asm/xen/events.h
+++ b/arch/x86/include/asm/xen/events.h
@@ -15,10 +15,4 @@ static inline int xen_irqs_disabled(struct pt_regs *regs)
15 return raw_irqs_disabled_flags(regs->flags); 15 return raw_irqs_disabled_flags(regs->flags);
16} 16}
17 17
18static inline void xen_do_IRQ(int irq, struct pt_regs *regs)
19{
20 regs->orig_ax = ~irq;
21 do_IRQ(regs);
22}
23
24#endif /* _ASM_X86_XEN_EVENTS_H */ 18#endif /* _ASM_X86_XEN_EVENTS_H */
diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h
index 81fbd735aec4..d5b7e90c0edf 100644
--- a/arch/x86/include/asm/xen/hypervisor.h
+++ b/arch/x86/include/asm/xen/hypervisor.h
@@ -38,22 +38,30 @@ extern struct shared_info *HYPERVISOR_shared_info;
38extern struct start_info *xen_start_info; 38extern struct start_info *xen_start_info;
39 39
40enum xen_domain_type { 40enum xen_domain_type {
41 XEN_NATIVE, 41 XEN_NATIVE, /* running on bare hardware */
42 XEN_PV_DOMAIN, 42 XEN_PV_DOMAIN, /* running in a PV domain */
43 XEN_HVM_DOMAIN, 43 XEN_HVM_DOMAIN, /* running in a Xen hvm domain */
44}; 44};
45 45
46extern enum xen_domain_type xen_domain_type;
47
48#ifdef CONFIG_XEN 46#ifdef CONFIG_XEN
49#define xen_domain() (xen_domain_type != XEN_NATIVE) 47extern enum xen_domain_type xen_domain_type;
50#else 48#else
51#define xen_domain() (0) 49#define xen_domain_type XEN_NATIVE
52#endif 50#endif
53 51
54#define xen_pv_domain() (xen_domain() && xen_domain_type == XEN_PV_DOMAIN) 52#define xen_domain() (xen_domain_type != XEN_NATIVE)
55#define xen_hvm_domain() (xen_domain() && xen_domain_type == XEN_HVM_DOMAIN) 53#define xen_pv_domain() (xen_domain() && \
54 xen_domain_type == XEN_PV_DOMAIN)
55#define xen_hvm_domain() (xen_domain() && \
56 xen_domain_type == XEN_HVM_DOMAIN)
57
58#ifdef CONFIG_XEN_DOM0
59#include <xen/interface/xen.h>
56 60
57#define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags & SIF_INITDOMAIN) 61#define xen_initial_domain() (xen_pv_domain() && \
62 xen_start_info->flags & SIF_INITDOMAIN)
63#else /* !CONFIG_XEN_DOM0 */
64#define xen_initial_domain() (0)
65#endif /* CONFIG_XEN_DOM0 */
58 66
59#endif /* _ASM_X86_XEN_HYPERVISOR_H */ 67#endif /* _ASM_X86_XEN_HYPERVISOR_H */
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index 4bd990ee43df..1a918dde46b5 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -164,6 +164,7 @@ static inline pte_t __pte_ma(pteval_t x)
164 164
165 165
166xmaddr_t arbitrary_virt_to_machine(void *address); 166xmaddr_t arbitrary_virt_to_machine(void *address);
167unsigned long arbitrary_virt_to_mfn(void *vaddr);
167void make_lowmem_page_readonly(void *vaddr); 168void make_lowmem_page_readonly(void *vaddr);
168void make_lowmem_page_readwrite(void *vaddr); 169void make_lowmem_page_readwrite(void *vaddr);
169 170
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index d364df03c1d6..95f216bbfaf1 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -23,11 +23,12 @@ nostackp := $(call cc-option, -fno-stack-protector)
23CFLAGS_vsyscall_64.o := $(PROFILING) -g0 $(nostackp) 23CFLAGS_vsyscall_64.o := $(PROFILING) -g0 $(nostackp)
24CFLAGS_hpet.o := $(nostackp) 24CFLAGS_hpet.o := $(nostackp)
25CFLAGS_tsc.o := $(nostackp) 25CFLAGS_tsc.o := $(nostackp)
26CFLAGS_paravirt.o := $(nostackp)
26 27
27obj-y := process_$(BITS).o signal.o entry_$(BITS).o 28obj-y := process_$(BITS).o signal.o entry_$(BITS).o
28obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o 29obj-y += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
29obj-y += time_$(BITS).o ioport.o ldt.o dumpstack.o 30obj-y += time_$(BITS).o ioport.o ldt.o dumpstack.o
30obj-y += setup.o i8259.o irqinit_$(BITS).o setup_percpu.o 31obj-y += setup.o i8259.o irqinit_$(BITS).o
31obj-$(CONFIG_X86_VISWS) += visws_quirks.o 32obj-$(CONFIG_X86_VISWS) += visws_quirks.o
32obj-$(CONFIG_X86_32) += probe_roms_32.o 33obj-$(CONFIG_X86_32) += probe_roms_32.o
33obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o 34obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o
@@ -49,31 +50,27 @@ obj-y += step.o
49obj-$(CONFIG_STACKTRACE) += stacktrace.o 50obj-$(CONFIG_STACKTRACE) += stacktrace.o
50obj-y += cpu/ 51obj-y += cpu/
51obj-y += acpi/ 52obj-y += acpi/
52obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o 53obj-y += reboot.o
53obj-$(CONFIG_MCA) += mca_32.o 54obj-$(CONFIG_MCA) += mca_32.o
54obj-$(CONFIG_X86_MSR) += msr.o 55obj-$(CONFIG_X86_MSR) += msr.o
55obj-$(CONFIG_X86_CPUID) += cpuid.o 56obj-$(CONFIG_X86_CPUID) += cpuid.o
56obj-$(CONFIG_PCI) += early-quirks.o 57obj-$(CONFIG_PCI) += early-quirks.o
57apm-y := apm_32.o 58apm-y := apm_32.o
58obj-$(CONFIG_APM) += apm.o 59obj-$(CONFIG_APM) += apm.o
59obj-$(CONFIG_X86_SMP) += smp.o 60obj-$(CONFIG_SMP) += smp.o
60obj-$(CONFIG_X86_SMP) += smpboot.o tsc_sync.o ipi.o tlb_$(BITS).o 61obj-$(CONFIG_SMP) += smpboot.o tsc_sync.o
61obj-$(CONFIG_X86_32_SMP) += smpcommon.o 62obj-$(CONFIG_SMP) += setup_percpu.o
62obj-$(CONFIG_X86_64_SMP) += tsc_sync.o smpcommon.o 63obj-$(CONFIG_X86_64_SMP) += tsc_sync.o
63obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_$(BITS).o 64obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_$(BITS).o
64obj-$(CONFIG_X86_MPPARSE) += mpparse.o 65obj-$(CONFIG_X86_MPPARSE) += mpparse.o
65obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o 66obj-y += apic/
66obj-$(CONFIG_X86_IO_APIC) += io_apic.o
67obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o 67obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o
68obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 68obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
69obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o 69obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
70obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o 70obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o
71obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o 71obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o
72obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o 72obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
73obj-$(CONFIG_X86_NUMAQ) += numaq_32.o 73obj-$(CONFIG_X86_VSMP) += vsmp_64.o
74obj-$(CONFIG_X86_ES7000) += es7000_32.o
75obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o
76obj-y += vsmp_64.o
77obj-$(CONFIG_KPROBES) += kprobes.o 74obj-$(CONFIG_KPROBES) += kprobes.o
78obj-$(CONFIG_MODULES) += module_$(BITS).o 75obj-$(CONFIG_MODULES) += module_$(BITS).o
79obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o 76obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o
@@ -114,16 +111,13 @@ obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o # NB rename without _64
114### 111###
115# 64 bit specific files 112# 64 bit specific files
116ifeq ($(CONFIG_X86_64),y) 113ifeq ($(CONFIG_X86_64),y)
117 obj-y += genapic_64.o genapic_flat_64.o genx2apic_uv_x.o tlb_uv.o 114 obj-$(CONFIG_X86_UV) += tlb_uv.o bios_uv.o uv_irq.o uv_sysfs.o
118 obj-y += bios_uv.o uv_irq.o uv_sysfs.o 115 obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o
119 obj-y += genx2apic_cluster.o 116 obj-$(CONFIG_AUDIT) += audit_64.o
120 obj-y += genx2apic_phys.o 117
121 obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o 118 obj-$(CONFIG_GART_IOMMU) += pci-gart_64.o aperture_64.o
122 obj-$(CONFIG_AUDIT) += audit_64.o 119 obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o
123 120 obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o
124 obj-$(CONFIG_GART_IOMMU) += pci-gart_64.o aperture_64.o 121
125 obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o 122 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
126 obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o
127
128 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
129endif 123endif
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 7678f10c4568..a18eb7ce2236 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -37,15 +37,10 @@
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/io_apic.h> 38#include <asm/io_apic.h>
39#include <asm/apic.h> 39#include <asm/apic.h>
40#include <asm/genapic.h>
41#include <asm/io.h> 40#include <asm/io.h>
42#include <asm/mpspec.h> 41#include <asm/mpspec.h>
43#include <asm/smp.h> 42#include <asm/smp.h>
44 43
45#ifdef CONFIG_X86_LOCAL_APIC
46# include <mach_apic.h>
47#endif
48
49static int __initdata acpi_force = 0; 44static int __initdata acpi_force = 0;
50u32 acpi_rsdt_forced; 45u32 acpi_rsdt_forced;
51#ifdef CONFIG_ACPI 46#ifdef CONFIG_ACPI
@@ -56,16 +51,7 @@ int acpi_disabled = 1;
56EXPORT_SYMBOL(acpi_disabled); 51EXPORT_SYMBOL(acpi_disabled);
57 52
58#ifdef CONFIG_X86_64 53#ifdef CONFIG_X86_64
59 54# include <asm/proto.h>
60#include <asm/proto.h>
61
62#else /* X86 */
63
64#ifdef CONFIG_X86_LOCAL_APIC
65#include <mach_apic.h>
66#include <mach_mpparse.h>
67#endif /* CONFIG_X86_LOCAL_APIC */
68
69#endif /* X86 */ 55#endif /* X86 */
70 56
71#define BAD_MADT_ENTRY(entry, end) ( \ 57#define BAD_MADT_ENTRY(entry, end) ( \
@@ -121,35 +107,18 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC;
121 */ 107 */
122char *__init __acpi_map_table(unsigned long phys, unsigned long size) 108char *__init __acpi_map_table(unsigned long phys, unsigned long size)
123{ 109{
124 unsigned long base, offset, mapped_size;
125 int idx;
126 110
127 if (!phys || !size) 111 if (!phys || !size)
128 return NULL; 112 return NULL;
129 113
130 if (phys+size <= (max_low_pfn_mapped << PAGE_SHIFT)) 114 return early_ioremap(phys, size);
131 return __va(phys); 115}
132 116void __init __acpi_unmap_table(char *map, unsigned long size)
133 offset = phys & (PAGE_SIZE - 1); 117{
134 mapped_size = PAGE_SIZE - offset; 118 if (!map || !size)
135 clear_fixmap(FIX_ACPI_END); 119 return;
136 set_fixmap(FIX_ACPI_END, phys);
137 base = fix_to_virt(FIX_ACPI_END);
138
139 /*
140 * Most cases can be covered by the below.
141 */
142 idx = FIX_ACPI_END;
143 while (mapped_size < size) {
144 if (--idx < FIX_ACPI_BEGIN)
145 return NULL; /* cannot handle this */
146 phys += PAGE_SIZE;
147 clear_fixmap(idx);
148 set_fixmap(idx, phys);
149 mapped_size += PAGE_SIZE;
150 }
151 120
152 return ((unsigned char *)base + offset); 121 early_iounmap(map, size);
153} 122}
154 123
155#ifdef CONFIG_PCI_MMCONFIG 124#ifdef CONFIG_PCI_MMCONFIG
@@ -239,7 +208,8 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
239 madt->address); 208 madt->address);
240 } 209 }
241 210
242 acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); 211 default_acpi_madt_oem_check(madt->header.oem_id,
212 madt->header.oem_table_id);
243 213
244 return 0; 214 return 0;
245} 215}
@@ -884,7 +854,7 @@ static struct {
884 DECLARE_BITMAP(pin_programmed, MP_MAX_IOAPIC_PIN + 1); 854 DECLARE_BITMAP(pin_programmed, MP_MAX_IOAPIC_PIN + 1);
885} mp_ioapic_routing[MAX_IO_APICS]; 855} mp_ioapic_routing[MAX_IO_APICS];
886 856
887static int mp_find_ioapic(int gsi) 857int mp_find_ioapic(int gsi)
888{ 858{
889 int i = 0; 859 int i = 0;
890 860
@@ -899,6 +869,16 @@ static int mp_find_ioapic(int gsi)
899 return -1; 869 return -1;
900} 870}
901 871
872int mp_find_ioapic_pin(int ioapic, int gsi)
873{
874 if (WARN_ON(ioapic == -1))
875 return -1;
876 if (WARN_ON(gsi > mp_ioapic_routing[ioapic].gsi_end))
877 return -1;
878
879 return gsi - mp_ioapic_routing[ioapic].gsi_base;
880}
881
902static u8 __init uniq_ioapic_id(u8 id) 882static u8 __init uniq_ioapic_id(u8 id)
903{ 883{
904#ifdef CONFIG_X86_32 884#ifdef CONFIG_X86_32
@@ -912,8 +892,8 @@ static u8 __init uniq_ioapic_id(u8 id)
912 DECLARE_BITMAP(used, 256); 892 DECLARE_BITMAP(used, 256);
913 bitmap_zero(used, 256); 893 bitmap_zero(used, 256);
914 for (i = 0; i < nr_ioapics; i++) { 894 for (i = 0; i < nr_ioapics; i++) {
915 struct mp_config_ioapic *ia = &mp_ioapics[i]; 895 struct mpc_ioapic *ia = &mp_ioapics[i];
916 __set_bit(ia->mp_apicid, used); 896 __set_bit(ia->apicid, used);
917 } 897 }
918 if (!test_bit(id, used)) 898 if (!test_bit(id, used))
919 return id; 899 return id;
@@ -945,29 +925,29 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
945 925
946 idx = nr_ioapics; 926 idx = nr_ioapics;
947 927
948 mp_ioapics[idx].mp_type = MP_IOAPIC; 928 mp_ioapics[idx].type = MP_IOAPIC;
949 mp_ioapics[idx].mp_flags = MPC_APIC_USABLE; 929 mp_ioapics[idx].flags = MPC_APIC_USABLE;
950 mp_ioapics[idx].mp_apicaddr = address; 930 mp_ioapics[idx].apicaddr = address;
951 931
952 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); 932 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
953 mp_ioapics[idx].mp_apicid = uniq_ioapic_id(id); 933 mp_ioapics[idx].apicid = uniq_ioapic_id(id);
954#ifdef CONFIG_X86_32 934#ifdef CONFIG_X86_32
955 mp_ioapics[idx].mp_apicver = io_apic_get_version(idx); 935 mp_ioapics[idx].apicver = io_apic_get_version(idx);
956#else 936#else
957 mp_ioapics[idx].mp_apicver = 0; 937 mp_ioapics[idx].apicver = 0;
958#endif 938#endif
959 /* 939 /*
960 * Build basic GSI lookup table to facilitate gsi->io_apic lookups 940 * Build basic GSI lookup table to facilitate gsi->io_apic lookups
961 * and to prevent reprogramming of IOAPIC pins (PCI GSIs). 941 * and to prevent reprogramming of IOAPIC pins (PCI GSIs).
962 */ 942 */
963 mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].mp_apicid; 943 mp_ioapic_routing[idx].apic_id = mp_ioapics[idx].apicid;
964 mp_ioapic_routing[idx].gsi_base = gsi_base; 944 mp_ioapic_routing[idx].gsi_base = gsi_base;
965 mp_ioapic_routing[idx].gsi_end = gsi_base + 945 mp_ioapic_routing[idx].gsi_end = gsi_base +
966 io_apic_get_redir_entries(idx); 946 io_apic_get_redir_entries(idx);
967 947
968 printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%lx, " 948 printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, "
969 "GSI %d-%d\n", idx, mp_ioapics[idx].mp_apicid, 949 "GSI %d-%d\n", idx, mp_ioapics[idx].apicid,
970 mp_ioapics[idx].mp_apicver, mp_ioapics[idx].mp_apicaddr, 950 mp_ioapics[idx].apicver, mp_ioapics[idx].apicaddr,
971 mp_ioapic_routing[idx].gsi_base, mp_ioapic_routing[idx].gsi_end); 951 mp_ioapic_routing[idx].gsi_base, mp_ioapic_routing[idx].gsi_end);
972 952
973 nr_ioapics++; 953 nr_ioapics++;
@@ -996,19 +976,19 @@ int __init acpi_probe_gsi(void)
996 return max_gsi + 1; 976 return max_gsi + 1;
997} 977}
998 978
999static void assign_to_mp_irq(struct mp_config_intsrc *m, 979static void assign_to_mp_irq(struct mpc_intsrc *m,
1000 struct mp_config_intsrc *mp_irq) 980 struct mpc_intsrc *mp_irq)
1001{ 981{
1002 memcpy(mp_irq, m, sizeof(struct mp_config_intsrc)); 982 memcpy(mp_irq, m, sizeof(struct mpc_intsrc));
1003} 983}
1004 984
1005static int mp_irq_cmp(struct mp_config_intsrc *mp_irq, 985static int mp_irq_cmp(struct mpc_intsrc *mp_irq,
1006 struct mp_config_intsrc *m) 986 struct mpc_intsrc *m)
1007{ 987{
1008 return memcmp(mp_irq, m, sizeof(struct mp_config_intsrc)); 988 return memcmp(mp_irq, m, sizeof(struct mpc_intsrc));
1009} 989}
1010 990
1011static void save_mp_irq(struct mp_config_intsrc *m) 991static void save_mp_irq(struct mpc_intsrc *m)
1012{ 992{
1013 int i; 993 int i;
1014 994
@@ -1026,7 +1006,7 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
1026{ 1006{
1027 int ioapic; 1007 int ioapic;
1028 int pin; 1008 int pin;
1029 struct mp_config_intsrc mp_irq; 1009 struct mpc_intsrc mp_irq;
1030 1010
1031 /* 1011 /*
1032 * Convert 'gsi' to 'ioapic.pin'. 1012 * Convert 'gsi' to 'ioapic.pin'.
@@ -1034,7 +1014,7 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
1034 ioapic = mp_find_ioapic(gsi); 1014 ioapic = mp_find_ioapic(gsi);
1035 if (ioapic < 0) 1015 if (ioapic < 0)
1036 return; 1016 return;
1037 pin = gsi - mp_ioapic_routing[ioapic].gsi_base; 1017 pin = mp_find_ioapic_pin(ioapic, gsi);
1038 1018
1039 /* 1019 /*
1040 * TBD: This check is for faulty timer entries, where the override 1020 * TBD: This check is for faulty timer entries, where the override
@@ -1044,13 +1024,13 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
1044 if ((bus_irq == 0) && (trigger == 3)) 1024 if ((bus_irq == 0) && (trigger == 3))
1045 trigger = 1; 1025 trigger = 1;
1046 1026
1047 mp_irq.mp_type = MP_INTSRC; 1027 mp_irq.type = MP_INTSRC;
1048 mp_irq.mp_irqtype = mp_INT; 1028 mp_irq.irqtype = mp_INT;
1049 mp_irq.mp_irqflag = (trigger << 2) | polarity; 1029 mp_irq.irqflag = (trigger << 2) | polarity;
1050 mp_irq.mp_srcbus = MP_ISA_BUS; 1030 mp_irq.srcbus = MP_ISA_BUS;
1051 mp_irq.mp_srcbusirq = bus_irq; /* IRQ */ 1031 mp_irq.srcbusirq = bus_irq; /* IRQ */
1052 mp_irq.mp_dstapic = mp_ioapics[ioapic].mp_apicid; /* APIC ID */ 1032 mp_irq.dstapic = mp_ioapics[ioapic].apicid; /* APIC ID */
1053 mp_irq.mp_dstirq = pin; /* INTIN# */ 1033 mp_irq.dstirq = pin; /* INTIN# */
1054 1034
1055 save_mp_irq(&mp_irq); 1035 save_mp_irq(&mp_irq);
1056} 1036}
@@ -1060,7 +1040,7 @@ void __init mp_config_acpi_legacy_irqs(void)
1060 int i; 1040 int i;
1061 int ioapic; 1041 int ioapic;
1062 unsigned int dstapic; 1042 unsigned int dstapic;
1063 struct mp_config_intsrc mp_irq; 1043 struct mpc_intsrc mp_irq;
1064 1044
1065#if defined (CONFIG_MCA) || defined (CONFIG_EISA) 1045#if defined (CONFIG_MCA) || defined (CONFIG_EISA)
1066 /* 1046 /*
@@ -1085,7 +1065,7 @@ void __init mp_config_acpi_legacy_irqs(void)
1085 ioapic = mp_find_ioapic(0); 1065 ioapic = mp_find_ioapic(0);
1086 if (ioapic < 0) 1066 if (ioapic < 0)
1087 return; 1067 return;
1088 dstapic = mp_ioapics[ioapic].mp_apicid; 1068 dstapic = mp_ioapics[ioapic].apicid;
1089 1069
1090 /* 1070 /*
1091 * Use the default configuration for the IRQs 0-15. Unless 1071 * Use the default configuration for the IRQs 0-15. Unless
@@ -1095,16 +1075,14 @@ void __init mp_config_acpi_legacy_irqs(void)
1095 int idx; 1075 int idx;
1096 1076
1097 for (idx = 0; idx < mp_irq_entries; idx++) { 1077 for (idx = 0; idx < mp_irq_entries; idx++) {
1098 struct mp_config_intsrc *irq = mp_irqs + idx; 1078 struct mpc_intsrc *irq = mp_irqs + idx;
1099 1079
1100 /* Do we already have a mapping for this ISA IRQ? */ 1080 /* Do we already have a mapping for this ISA IRQ? */
1101 if (irq->mp_srcbus == MP_ISA_BUS 1081 if (irq->srcbus == MP_ISA_BUS && irq->srcbusirq == i)
1102 && irq->mp_srcbusirq == i)
1103 break; 1082 break;
1104 1083
1105 /* Do we already have a mapping for this IOAPIC pin */ 1084 /* Do we already have a mapping for this IOAPIC pin */
1106 if (irq->mp_dstapic == dstapic && 1085 if (irq->dstapic == dstapic && irq->dstirq == i)
1107 irq->mp_dstirq == i)
1108 break; 1086 break;
1109 } 1087 }
1110 1088
@@ -1113,13 +1091,13 @@ void __init mp_config_acpi_legacy_irqs(void)
1113 continue; /* IRQ already used */ 1091 continue; /* IRQ already used */
1114 } 1092 }
1115 1093
1116 mp_irq.mp_type = MP_INTSRC; 1094 mp_irq.type = MP_INTSRC;
1117 mp_irq.mp_irqflag = 0; /* Conforming */ 1095 mp_irq.irqflag = 0; /* Conforming */
1118 mp_irq.mp_srcbus = MP_ISA_BUS; 1096 mp_irq.srcbus = MP_ISA_BUS;
1119 mp_irq.mp_dstapic = dstapic; 1097 mp_irq.dstapic = dstapic;
1120 mp_irq.mp_irqtype = mp_INT; 1098 mp_irq.irqtype = mp_INT;
1121 mp_irq.mp_srcbusirq = i; /* Identity mapped */ 1099 mp_irq.srcbusirq = i; /* Identity mapped */
1122 mp_irq.mp_dstirq = i; 1100 mp_irq.dstirq = i;
1123 1101
1124 save_mp_irq(&mp_irq); 1102 save_mp_irq(&mp_irq);
1125 } 1103 }
@@ -1156,7 +1134,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity)
1156 return gsi; 1134 return gsi;
1157 } 1135 }
1158 1136
1159 ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base; 1137 ioapic_pin = mp_find_ioapic_pin(ioapic, gsi);
1160 1138
1161#ifdef CONFIG_X86_32 1139#ifdef CONFIG_X86_32
1162 if (ioapic_renumber_irq) 1140 if (ioapic_renumber_irq)
@@ -1230,22 +1208,22 @@ int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
1230 u32 gsi, int triggering, int polarity) 1208 u32 gsi, int triggering, int polarity)
1231{ 1209{
1232#ifdef CONFIG_X86_MPPARSE 1210#ifdef CONFIG_X86_MPPARSE
1233 struct mp_config_intsrc mp_irq; 1211 struct mpc_intsrc mp_irq;
1234 int ioapic; 1212 int ioapic;
1235 1213
1236 if (!acpi_ioapic) 1214 if (!acpi_ioapic)
1237 return 0; 1215 return 0;
1238 1216
1239 /* print the entry should happen on mptable identically */ 1217 /* print the entry should happen on mptable identically */
1240 mp_irq.mp_type = MP_INTSRC; 1218 mp_irq.type = MP_INTSRC;
1241 mp_irq.mp_irqtype = mp_INT; 1219 mp_irq.irqtype = mp_INT;
1242 mp_irq.mp_irqflag = (triggering == ACPI_EDGE_SENSITIVE ? 4 : 0x0c) | 1220 mp_irq.irqflag = (triggering == ACPI_EDGE_SENSITIVE ? 4 : 0x0c) |
1243 (polarity == ACPI_ACTIVE_HIGH ? 1 : 3); 1221 (polarity == ACPI_ACTIVE_HIGH ? 1 : 3);
1244 mp_irq.mp_srcbus = number; 1222 mp_irq.srcbus = number;
1245 mp_irq.mp_srcbusirq = (((devfn >> 3) & 0x1f) << 2) | ((pin - 1) & 3); 1223 mp_irq.srcbusirq = (((devfn >> 3) & 0x1f) << 2) | ((pin - 1) & 3);
1246 ioapic = mp_find_ioapic(gsi); 1224 ioapic = mp_find_ioapic(gsi);
1247 mp_irq.mp_dstapic = mp_ioapic_routing[ioapic].apic_id; 1225 mp_irq.dstapic = mp_ioapic_routing[ioapic].apic_id;
1248 mp_irq.mp_dstirq = gsi - mp_ioapic_routing[ioapic].gsi_base; 1226 mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi);
1249 1227
1250 save_mp_irq(&mp_irq); 1228 save_mp_irq(&mp_irq);
1251#endif 1229#endif
@@ -1372,7 +1350,7 @@ static void __init acpi_process_madt(void)
1372 if (!error) { 1350 if (!error) {
1373 acpi_lapic = 1; 1351 acpi_lapic = 1;
1374 1352
1375#ifdef CONFIG_X86_GENERICARCH 1353#ifdef CONFIG_X86_BIGSMP
1376 generic_bigsmp_probe(); 1354 generic_bigsmp_probe();
1377#endif 1355#endif
1378 /* 1356 /*
@@ -1384,9 +1362,8 @@ static void __init acpi_process_madt(void)
1384 acpi_ioapic = 1; 1362 acpi_ioapic = 1;
1385 1363
1386 smp_found_config = 1; 1364 smp_found_config = 1;
1387#ifdef CONFIG_X86_32 1365 if (apic->setup_apic_routing)
1388 setup_apic_routing(); 1366 apic->setup_apic_routing();
1389#endif
1390 } 1367 }
1391 } 1368 }
1392 if (error == -EINVAL) { 1369 if (error == -EINVAL) {
diff --git a/arch/x86/kernel/acpi/realmode/wakeup.S b/arch/x86/kernel/acpi/realmode/wakeup.S
index 3355973b12ac..580b4e296010 100644
--- a/arch/x86/kernel/acpi/realmode/wakeup.S
+++ b/arch/x86/kernel/acpi/realmode/wakeup.S
@@ -3,8 +3,8 @@
3 */ 3 */
4#include <asm/segment.h> 4#include <asm/segment.h>
5#include <asm/msr-index.h> 5#include <asm/msr-index.h>
6#include <asm/page.h> 6#include <asm/page_types.h>
7#include <asm/pgtable.h> 7#include <asm/pgtable_types.h>
8#include <asm/processor-flags.h> 8#include <asm/processor-flags.h>
9 9
10 .code16 10 .code16
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index a60c1f3bcb87..7c243a2c5115 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -101,6 +101,7 @@ int acpi_save_state_mem(void)
101 stack_start.sp = temp_stack + sizeof(temp_stack); 101 stack_start.sp = temp_stack + sizeof(temp_stack);
102 early_gdt_descr.address = 102 early_gdt_descr.address =
103 (unsigned long)get_cpu_gdt_table(smp_processor_id()); 103 (unsigned long)get_cpu_gdt_table(smp_processor_id());
104 initial_gs = per_cpu_offset(smp_processor_id());
104#endif 105#endif
105 initial_code = (unsigned long)wakeup_long64; 106 initial_code = (unsigned long)wakeup_long64;
106 saved_magic = 0x123456789abcdef0; 107 saved_magic = 0x123456789abcdef0;
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index a12e6a9fb659..8ded418b0593 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -1,7 +1,7 @@
1 .section .text.page_aligned 1 .section .text.page_aligned
2#include <linux/linkage.h> 2#include <linux/linkage.h>
3#include <asm/segment.h> 3#include <asm/segment.h>
4#include <asm/page.h> 4#include <asm/page_types.h>
5 5
6# Copyright 2003, 2008 Pavel Machek <pavel@suse.cz>, distribute under GPLv2 6# Copyright 2003, 2008 Pavel Machek <pavel@suse.cz>, distribute under GPLv2
7 7
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index 96258d9dc974..8ea5164cbd04 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -1,8 +1,8 @@
1.text 1.text
2#include <linux/linkage.h> 2#include <linux/linkage.h>
3#include <asm/segment.h> 3#include <asm/segment.h>
4#include <asm/pgtable.h> 4#include <asm/pgtable_types.h>
5#include <asm/page.h> 5#include <asm/page_types.h>
6#include <asm/msr.h> 6#include <asm/msr.h>
7#include <asm/asm-offsets.h> 7#include <asm/asm-offsets.h>
8 8
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index a84ac7b570e6..6907b8e85d52 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -498,12 +498,12 @@ void *text_poke_early(void *addr, const void *opcode, size_t len)
498 */ 498 */
499void *__kprobes text_poke(void *addr, const void *opcode, size_t len) 499void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
500{ 500{
501 unsigned long flags;
502 char *vaddr; 501 char *vaddr;
503 int nr_pages = 2; 502 int nr_pages = 2;
504 struct page *pages[2]; 503 struct page *pages[2];
505 int i; 504 int i;
506 505
506 might_sleep();
507 if (!core_kernel_text((unsigned long)addr)) { 507 if (!core_kernel_text((unsigned long)addr)) {
508 pages[0] = vmalloc_to_page(addr); 508 pages[0] = vmalloc_to_page(addr);
509 pages[1] = vmalloc_to_page(addr + PAGE_SIZE); 509 pages[1] = vmalloc_to_page(addr + PAGE_SIZE);
@@ -517,9 +517,9 @@ void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
517 nr_pages = 1; 517 nr_pages = 1;
518 vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL); 518 vaddr = vmap(pages, nr_pages, VM_MAP, PAGE_KERNEL);
519 BUG_ON(!vaddr); 519 BUG_ON(!vaddr);
520 local_irq_save(flags); 520 local_irq_disable();
521 memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len); 521 memcpy(&vaddr[(unsigned long)addr & ~PAGE_MASK], opcode, len);
522 local_irq_restore(flags); 522 local_irq_enable();
523 vunmap(vaddr); 523 vunmap(vaddr);
524 sync_core(); 524 sync_core();
525 /* Could also do a CLFLUSH here to speed up CPU recovery; but 525 /* Could also do a CLFLUSH here to speed up CPU recovery; but
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile
new file mode 100644
index 000000000000..da7b7b9f8bd8
--- /dev/null
+++ b/arch/x86/kernel/apic/Makefile
@@ -0,0 +1,19 @@
1#
2# Makefile for local APIC drivers and for the IO-APIC code
3#
4
5obj-$(CONFIG_X86_LOCAL_APIC) += apic.o probe_$(BITS).o ipi.o nmi.o
6obj-$(CONFIG_X86_IO_APIC) += io_apic.o
7obj-$(CONFIG_SMP) += ipi.o
8
9ifeq ($(CONFIG_X86_64),y)
10obj-y += apic_flat_64.o
11obj-$(CONFIG_X86_X2APIC) += x2apic_cluster.o
12obj-$(CONFIG_X86_X2APIC) += x2apic_phys.o
13obj-$(CONFIG_X86_UV) += x2apic_uv_x.o
14endif
15
16obj-$(CONFIG_X86_BIGSMP) += bigsmp_32.o
17obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
18obj-$(CONFIG_X86_ES7000) += es7000_32.o
19obj-$(CONFIG_X86_SUMMIT) += summit_32.o
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic/apic.c
index 570f36e44e59..f9cecdfd05c5 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Local APIC handling, local APIC timers 2 * Local APIC handling, local APIC timers
3 * 3 *
4 * (c) 1999, 2000 Ingo Molnar <mingo@redhat.com> 4 * (c) 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com>
5 * 5 *
6 * Fixes 6 * Fixes
7 * Maciej W. Rozycki : Bits for genuine 82489DX APICs; 7 * Maciej W. Rozycki : Bits for genuine 82489DX APICs;
@@ -14,51 +14,69 @@
14 * Mikael Pettersson : PM converted to driver model. 14 * Mikael Pettersson : PM converted to driver model.
15 */ 15 */
16 16
17#include <linux/init.h>
18
19#include <linux/mm.h>
20#include <linux/delay.h>
21#include <linux/bootmem.h>
22#include <linux/interrupt.h>
23#include <linux/mc146818rtc.h>
24#include <linux/kernel_stat.h> 17#include <linux/kernel_stat.h>
25#include <linux/sysdev.h> 18#include <linux/mc146818rtc.h>
26#include <linux/ioport.h>
27#include <linux/cpu.h>
28#include <linux/clockchips.h>
29#include <linux/acpi_pmtmr.h> 19#include <linux/acpi_pmtmr.h>
20#include <linux/clockchips.h>
21#include <linux/interrupt.h>
22#include <linux/bootmem.h>
23#include <linux/ftrace.h>
24#include <linux/ioport.h>
30#include <linux/module.h> 25#include <linux/module.h>
31#include <linux/dmi.h> 26#include <linux/sysdev.h>
27#include <linux/delay.h>
28#include <linux/timex.h>
32#include <linux/dmar.h> 29#include <linux/dmar.h>
33#include <linux/ftrace.h> 30#include <linux/init.h>
34#include <linux/smp.h> 31#include <linux/cpu.h>
32#include <linux/dmi.h>
35#include <linux/nmi.h> 33#include <linux/nmi.h>
36#include <linux/timex.h> 34#include <linux/smp.h>
35#include <linux/mm.h>
37 36
37#include <asm/pgalloc.h>
38#include <asm/atomic.h> 38#include <asm/atomic.h>
39#include <asm/mtrr.h>
40#include <asm/mpspec.h> 39#include <asm/mpspec.h>
41#include <asm/desc.h>
42#include <asm/arch_hooks.h>
43#include <asm/hpet.h>
44#include <asm/pgalloc.h>
45#include <asm/i8253.h> 40#include <asm/i8253.h>
46#include <asm/idle.h> 41#include <asm/i8259.h>
47#include <asm/proto.h> 42#include <asm/proto.h>
48#include <asm/apic.h> 43#include <asm/apic.h>
49#include <asm/i8259.h> 44#include <asm/desc.h>
45#include <asm/hpet.h>
46#include <asm/idle.h>
47#include <asm/mtrr.h>
50#include <asm/smp.h> 48#include <asm/smp.h>
51 49
52#include <mach_apic.h> 50unsigned int num_processors;
53#include <mach_apicdef.h> 51
54#include <mach_ipi.h> 52unsigned disabled_cpus __cpuinitdata;
53
54/* Processor that is doing the boot up */
55unsigned int boot_cpu_physical_apicid = -1U;
55 56
56/* 57/*
57 * Sanity check 58 * The highest APIC ID seen during enumeration.
59 *
60 * This determines the messaging protocol we can use: if all APIC IDs
61 * are in the 0 ... 7 range, then we can use logical addressing which
62 * has some performance advantages (better broadcasting).
63 *
64 * If there's an APIC ID above 8, we use physical addressing.
58 */ 65 */
59#if ((SPURIOUS_APIC_VECTOR & 0x0F) != 0x0F) 66unsigned int max_physical_apicid;
60# error SPURIOUS_APIC_VECTOR definition error 67
61#endif 68/*
69 * Bitmask of physically existing CPUs:
70 */
71physid_mask_t phys_cpu_present_map;
72
73/*
74 * Map cpu index to physical APIC ID
75 */
76DEFINE_EARLY_PER_CPU(u16, x86_cpu_to_apicid, BAD_APICID);
77DEFINE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid, BAD_APICID);
78EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_apicid);
79EXPORT_EARLY_PER_CPU_SYMBOL(x86_bios_cpu_apicid);
62 80
63#ifdef CONFIG_X86_32 81#ifdef CONFIG_X86_32
64/* 82/*
@@ -92,11 +110,7 @@ static __init int setup_apicpmtimer(char *s)
92__setup("apicpmtimer", setup_apicpmtimer); 110__setup("apicpmtimer", setup_apicpmtimer);
93#endif 111#endif
94 112
95#ifdef CONFIG_X86_64 113#ifdef CONFIG_X86_X2APIC
96#define HAVE_X2APIC
97#endif
98
99#ifdef HAVE_X2APIC
100int x2apic; 114int x2apic;
101/* x2apic enabled before OS handover */ 115/* x2apic enabled before OS handover */
102static int x2apic_preenabled; 116static int x2apic_preenabled;
@@ -194,18 +208,13 @@ static int modern_apic(void)
194 return lapic_get_version() >= 0x14; 208 return lapic_get_version() >= 0x14;
195} 209}
196 210
197/* 211void native_apic_wait_icr_idle(void)
198 * Paravirt kernels also might be using these below ops. So we still
199 * use generic apic_read()/apic_write(), which might be pointing to different
200 * ops in PARAVIRT case.
201 */
202void xapic_wait_icr_idle(void)
203{ 212{
204 while (apic_read(APIC_ICR) & APIC_ICR_BUSY) 213 while (apic_read(APIC_ICR) & APIC_ICR_BUSY)
205 cpu_relax(); 214 cpu_relax();
206} 215}
207 216
208u32 safe_xapic_wait_icr_idle(void) 217u32 native_safe_apic_wait_icr_idle(void)
209{ 218{
210 u32 send_status; 219 u32 send_status;
211 int timeout; 220 int timeout;
@@ -221,13 +230,13 @@ u32 safe_xapic_wait_icr_idle(void)
221 return send_status; 230 return send_status;
222} 231}
223 232
224void xapic_icr_write(u32 low, u32 id) 233void native_apic_icr_write(u32 low, u32 id)
225{ 234{
226 apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(id)); 235 apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(id));
227 apic_write(APIC_ICR, low); 236 apic_write(APIC_ICR, low);
228} 237}
229 238
230static u64 xapic_icr_read(void) 239u64 native_apic_icr_read(void)
231{ 240{
232 u32 icr1, icr2; 241 u32 icr1, icr2;
233 242
@@ -237,54 +246,6 @@ static u64 xapic_icr_read(void)
237 return icr1 | ((u64)icr2 << 32); 246 return icr1 | ((u64)icr2 << 32);
238} 247}
239 248
240static struct apic_ops xapic_ops = {
241 .read = native_apic_mem_read,
242 .write = native_apic_mem_write,
243 .icr_read = xapic_icr_read,
244 .icr_write = xapic_icr_write,
245 .wait_icr_idle = xapic_wait_icr_idle,
246 .safe_wait_icr_idle = safe_xapic_wait_icr_idle,
247};
248
249struct apic_ops __read_mostly *apic_ops = &xapic_ops;
250EXPORT_SYMBOL_GPL(apic_ops);
251
252#ifdef HAVE_X2APIC
253static void x2apic_wait_icr_idle(void)
254{
255 /* no need to wait for icr idle in x2apic */
256 return;
257}
258
259static u32 safe_x2apic_wait_icr_idle(void)
260{
261 /* no need to wait for icr idle in x2apic */
262 return 0;
263}
264
265void x2apic_icr_write(u32 low, u32 id)
266{
267 wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low);
268}
269
270static u64 x2apic_icr_read(void)
271{
272 unsigned long val;
273
274 rdmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), val);
275 return val;
276}
277
278static struct apic_ops x2apic_ops = {
279 .read = native_apic_msr_read,
280 .write = native_apic_msr_write,
281 .icr_read = x2apic_icr_read,
282 .icr_write = x2apic_icr_write,
283 .wait_icr_idle = x2apic_wait_icr_idle,
284 .safe_wait_icr_idle = safe_x2apic_wait_icr_idle,
285};
286#endif
287
288/** 249/**
289 * enable_NMI_through_LVT0 - enable NMI through local vector table 0 250 * enable_NMI_through_LVT0 - enable NMI through local vector table 0
290 */ 251 */
@@ -457,7 +418,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
457static void lapic_timer_broadcast(const struct cpumask *mask) 418static void lapic_timer_broadcast(const struct cpumask *mask)
458{ 419{
459#ifdef CONFIG_SMP 420#ifdef CONFIG_SMP
460 send_IPI_mask(mask, LOCAL_TIMER_VECTOR); 421 apic->send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
461#endif 422#endif
462} 423}
463 424
@@ -535,7 +496,8 @@ static void __init lapic_cal_handler(struct clock_event_device *dev)
535 } 496 }
536} 497}
537 498
538static int __init calibrate_by_pmtimer(long deltapm, long *delta) 499static int __init
500calibrate_by_pmtimer(long deltapm, long *delta, long *deltatsc)
539{ 501{
540 const long pm_100ms = PMTMR_TICKS_PER_SEC / 10; 502 const long pm_100ms = PMTMR_TICKS_PER_SEC / 10;
541 const long pm_thresh = pm_100ms / 100; 503 const long pm_thresh = pm_100ms / 100;
@@ -546,7 +508,7 @@ static int __init calibrate_by_pmtimer(long deltapm, long *delta)
546 return -1; 508 return -1;
547#endif 509#endif
548 510
549 apic_printk(APIC_VERBOSE, "... PM timer delta = %ld\n", deltapm); 511 apic_printk(APIC_VERBOSE, "... PM-Timer delta = %ld\n", deltapm);
550 512
551 /* Check, if the PM timer is available */ 513 /* Check, if the PM timer is available */
552 if (!deltapm) 514 if (!deltapm)
@@ -556,19 +518,30 @@ static int __init calibrate_by_pmtimer(long deltapm, long *delta)
556 518
557 if (deltapm > (pm_100ms - pm_thresh) && 519 if (deltapm > (pm_100ms - pm_thresh) &&
558 deltapm < (pm_100ms + pm_thresh)) { 520 deltapm < (pm_100ms + pm_thresh)) {
559 apic_printk(APIC_VERBOSE, "... PM timer result ok\n"); 521 apic_printk(APIC_VERBOSE, "... PM-Timer result ok\n");
560 } else { 522 return 0;
561 res = (((u64)deltapm) * mult) >> 22; 523 }
562 do_div(res, 1000000); 524
563 pr_warning("APIC calibration not consistent " 525 res = (((u64)deltapm) * mult) >> 22;
564 "with PM Timer: %ldms instead of 100ms\n", 526 do_div(res, 1000000);
565 (long)res); 527 pr_warning("APIC calibration not consistent "
566 /* Correct the lapic counter value */ 528 "with PM-Timer: %ldms instead of 100ms\n",(long)res);
567 res = (((u64)(*delta)) * pm_100ms); 529
530 /* Correct the lapic counter value */
531 res = (((u64)(*delta)) * pm_100ms);
532 do_div(res, deltapm);
533 pr_info("APIC delta adjusted to PM-Timer: "
534 "%lu (%ld)\n", (unsigned long)res, *delta);
535 *delta = (long)res;
536
537 /* Correct the tsc counter value */
538 if (cpu_has_tsc) {
539 res = (((u64)(*deltatsc)) * pm_100ms);
568 do_div(res, deltapm); 540 do_div(res, deltapm);
569 pr_info("APIC delta adjusted to PM-Timer: " 541 apic_printk(APIC_VERBOSE, "TSC delta adjusted to "
570 "%lu (%ld)\n", (unsigned long)res, *delta); 542 "PM-Timer: %lu (%ld) \n",
571 *delta = (long)res; 543 (unsigned long)res, *deltatsc);
544 *deltatsc = (long)res;
572 } 545 }
573 546
574 return 0; 547 return 0;
@@ -579,7 +552,7 @@ static int __init calibrate_APIC_clock(void)
579 struct clock_event_device *levt = &__get_cpu_var(lapic_events); 552 struct clock_event_device *levt = &__get_cpu_var(lapic_events);
580 void (*real_handler)(struct clock_event_device *dev); 553 void (*real_handler)(struct clock_event_device *dev);
581 unsigned long deltaj; 554 unsigned long deltaj;
582 long delta; 555 long delta, deltatsc;
583 int pm_referenced = 0; 556 int pm_referenced = 0;
584 557
585 local_irq_disable(); 558 local_irq_disable();
@@ -609,9 +582,11 @@ static int __init calibrate_APIC_clock(void)
609 delta = lapic_cal_t1 - lapic_cal_t2; 582 delta = lapic_cal_t1 - lapic_cal_t2;
610 apic_printk(APIC_VERBOSE, "... lapic delta = %ld\n", delta); 583 apic_printk(APIC_VERBOSE, "... lapic delta = %ld\n", delta);
611 584
585 deltatsc = (long)(lapic_cal_tsc2 - lapic_cal_tsc1);
586
612 /* we trust the PM based calibration if possible */ 587 /* we trust the PM based calibration if possible */
613 pm_referenced = !calibrate_by_pmtimer(lapic_cal_pm2 - lapic_cal_pm1, 588 pm_referenced = !calibrate_by_pmtimer(lapic_cal_pm2 - lapic_cal_pm1,
614 &delta); 589 &delta, &deltatsc);
615 590
616 /* Calculate the scaled math multiplication factor */ 591 /* Calculate the scaled math multiplication factor */
617 lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS, 592 lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS,
@@ -629,11 +604,10 @@ static int __init calibrate_APIC_clock(void)
629 calibration_result); 604 calibration_result);
630 605
631 if (cpu_has_tsc) { 606 if (cpu_has_tsc) {
632 delta = (long)(lapic_cal_tsc2 - lapic_cal_tsc1);
633 apic_printk(APIC_VERBOSE, "..... CPU clock speed is " 607 apic_printk(APIC_VERBOSE, "..... CPU clock speed is "
634 "%ld.%04ld MHz.\n", 608 "%ld.%04ld MHz.\n",
635 (delta / LAPIC_CAL_LOOPS) / (1000000 / HZ), 609 (deltatsc / LAPIC_CAL_LOOPS) / (1000000 / HZ),
636 (delta / LAPIC_CAL_LOOPS) % (1000000 / HZ)); 610 (deltatsc / LAPIC_CAL_LOOPS) % (1000000 / HZ));
637 } 611 }
638 612
639 apic_printk(APIC_VERBOSE, "..... host bus clock speed is " 613 apic_printk(APIC_VERBOSE, "..... host bus clock speed is "
@@ -991,11 +965,11 @@ int __init verify_local_APIC(void)
991 */ 965 */
992 reg0 = apic_read(APIC_ID); 966 reg0 = apic_read(APIC_ID);
993 apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg0); 967 apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg0);
994 apic_write(APIC_ID, reg0 ^ APIC_ID_MASK); 968 apic_write(APIC_ID, reg0 ^ apic->apic_id_mask);
995 reg1 = apic_read(APIC_ID); 969 reg1 = apic_read(APIC_ID);
996 apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg1); 970 apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg1);
997 apic_write(APIC_ID, reg0); 971 apic_write(APIC_ID, reg0);
998 if (reg1 != (reg0 ^ APIC_ID_MASK)) 972 if (reg1 != (reg0 ^ apic->apic_id_mask))
999 return 0; 973 return 0;
1000 974
1001 /* 975 /*
@@ -1089,7 +1063,7 @@ static void __cpuinit lapic_setup_esr(void)
1089 return; 1063 return;
1090 } 1064 }
1091 1065
1092 if (esr_disable) { 1066 if (apic->disable_esr) {
1093 /* 1067 /*
1094 * Something untraceable is creating bad interrupts on 1068 * Something untraceable is creating bad interrupts on
1095 * secondary quads ... for the moment, just leave the 1069 * secondary quads ... for the moment, just leave the
@@ -1130,9 +1104,14 @@ void __cpuinit setup_local_APIC(void)
1130 unsigned int value; 1104 unsigned int value;
1131 int i, j; 1105 int i, j;
1132 1106
1107 if (disable_apic) {
1108 arch_disable_smp_support();
1109 return;
1110 }
1111
1133#ifdef CONFIG_X86_32 1112#ifdef CONFIG_X86_32
1134 /* Pound the ESR really hard over the head with a big hammer - mbligh */ 1113 /* Pound the ESR really hard over the head with a big hammer - mbligh */
1135 if (lapic_is_integrated() && esr_disable) { 1114 if (lapic_is_integrated() && apic->disable_esr) {
1136 apic_write(APIC_ESR, 0); 1115 apic_write(APIC_ESR, 0);
1137 apic_write(APIC_ESR, 0); 1116 apic_write(APIC_ESR, 0);
1138 apic_write(APIC_ESR, 0); 1117 apic_write(APIC_ESR, 0);
@@ -1146,7 +1125,7 @@ void __cpuinit setup_local_APIC(void)
1146 * Double-check whether this APIC is really registered. 1125 * Double-check whether this APIC is really registered.
1147 * This is meaningless in clustered apic mode, so we skip it. 1126 * This is meaningless in clustered apic mode, so we skip it.
1148 */ 1127 */
1149 if (!apic_id_registered()) 1128 if (!apic->apic_id_registered())
1150 BUG(); 1129 BUG();
1151 1130
1152 /* 1131 /*
@@ -1154,7 +1133,7 @@ void __cpuinit setup_local_APIC(void)
1154 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel 1133 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
1155 * document number 292116). So here it goes... 1134 * document number 292116). So here it goes...
1156 */ 1135 */
1157 init_apic_ldr(); 1136 apic->init_apic_ldr();
1158 1137
1159 /* 1138 /*
1160 * Set Task Priority to 'accept all'. We never change this 1139 * Set Task Priority to 'accept all'. We never change this
@@ -1282,17 +1261,12 @@ void __cpuinit end_local_APIC_setup(void)
1282 apic_pm_activate(); 1261 apic_pm_activate();
1283} 1262}
1284 1263
1285#ifdef HAVE_X2APIC 1264#ifdef CONFIG_X86_X2APIC
1286void check_x2apic(void) 1265void check_x2apic(void)
1287{ 1266{
1288 int msr, msr2; 1267 if (x2apic_enabled()) {
1289
1290 rdmsr(MSR_IA32_APICBASE, msr, msr2);
1291
1292 if (msr & X2APIC_ENABLE) {
1293 pr_info("x2apic enabled by BIOS, switching to x2apic ops\n"); 1268 pr_info("x2apic enabled by BIOS, switching to x2apic ops\n");
1294 x2apic_preenabled = x2apic = 1; 1269 x2apic_preenabled = x2apic = 1;
1295 apic_ops = &x2apic_ops;
1296 } 1270 }
1297} 1271}
1298 1272
@@ -1300,6 +1274,9 @@ void enable_x2apic(void)
1300{ 1274{
1301 int msr, msr2; 1275 int msr, msr2;
1302 1276
1277 if (!x2apic)
1278 return;
1279
1303 rdmsr(MSR_IA32_APICBASE, msr, msr2); 1280 rdmsr(MSR_IA32_APICBASE, msr, msr2);
1304 if (!(msr & X2APIC_ENABLE)) { 1281 if (!(msr & X2APIC_ENABLE)) {
1305 pr_info("Enabling x2apic\n"); 1282 pr_info("Enabling x2apic\n");
@@ -1363,7 +1340,6 @@ void __init enable_IR_x2apic(void)
1363 1340
1364 if (!x2apic) { 1341 if (!x2apic) {
1365 x2apic = 1; 1342 x2apic = 1;
1366 apic_ops = &x2apic_ops;
1367 enable_x2apic(); 1343 enable_x2apic();
1368 } 1344 }
1369 1345
@@ -1401,7 +1377,7 @@ end:
1401 1377
1402 return; 1378 return;
1403} 1379}
1404#endif /* HAVE_X2APIC */ 1380#endif /* CONFIG_X86_X2APIC */
1405 1381
1406#ifdef CONFIG_X86_64 1382#ifdef CONFIG_X86_64
1407/* 1383/*
@@ -1532,7 +1508,7 @@ void __init early_init_lapic_mapping(void)
1532 */ 1508 */
1533void __init init_apic_mappings(void) 1509void __init init_apic_mappings(void)
1534{ 1510{
1535#ifdef HAVE_X2APIC 1511#ifdef CONFIG_X86_X2APIC
1536 if (x2apic) { 1512 if (x2apic) {
1537 boot_cpu_physical_apicid = read_apic_id(); 1513 boot_cpu_physical_apicid = read_apic_id();
1538 return; 1514 return;
@@ -1570,11 +1546,11 @@ int apic_version[MAX_APICS];
1570 1546
1571int __init APIC_init_uniprocessor(void) 1547int __init APIC_init_uniprocessor(void)
1572{ 1548{
1573#ifdef CONFIG_X86_64
1574 if (disable_apic) { 1549 if (disable_apic) {
1575 pr_info("Apic disabled\n"); 1550 pr_info("Apic disabled\n");
1576 return -1; 1551 return -1;
1577 } 1552 }
1553#ifdef CONFIG_X86_64
1578 if (!cpu_has_apic) { 1554 if (!cpu_has_apic) {
1579 disable_apic = 1; 1555 disable_apic = 1;
1580 pr_info("Apic disabled by BIOS\n"); 1556 pr_info("Apic disabled by BIOS\n");
@@ -1596,11 +1572,9 @@ int __init APIC_init_uniprocessor(void)
1596 } 1572 }
1597#endif 1573#endif
1598 1574
1599#ifdef HAVE_X2APIC
1600 enable_IR_x2apic(); 1575 enable_IR_x2apic();
1601#endif
1602#ifdef CONFIG_X86_64 1576#ifdef CONFIG_X86_64
1603 setup_apic_routing(); 1577 default_setup_apic_routing();
1604#endif 1578#endif
1605 1579
1606 verify_local_APIC(); 1580 verify_local_APIC();
@@ -1621,35 +1595,31 @@ int __init APIC_init_uniprocessor(void)
1621 physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); 1595 physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map);
1622 setup_local_APIC(); 1596 setup_local_APIC();
1623 1597
1624#ifdef CONFIG_X86_64 1598#ifdef CONFIG_X86_IO_APIC
1625 /* 1599 /*
1626 * Now enable IO-APICs, actually call clear_IO_APIC 1600 * Now enable IO-APICs, actually call clear_IO_APIC
1627 * We need clear_IO_APIC before enabling vector on BP 1601 * We need clear_IO_APIC before enabling error vector
1628 */ 1602 */
1629 if (!skip_ioapic_setup && nr_ioapics) 1603 if (!skip_ioapic_setup && nr_ioapics)
1630 enable_IO_APIC(); 1604 enable_IO_APIC();
1631#endif 1605#endif
1632 1606
1633#ifdef CONFIG_X86_IO_APIC
1634 if (!smp_found_config || skip_ioapic_setup || !nr_ioapics)
1635#endif
1636 localise_nmi_watchdog();
1637 end_local_APIC_setup(); 1607 end_local_APIC_setup();
1638 1608
1639#ifdef CONFIG_X86_IO_APIC 1609#ifdef CONFIG_X86_IO_APIC
1640 if (smp_found_config && !skip_ioapic_setup && nr_ioapics) 1610 if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
1641 setup_IO_APIC(); 1611 setup_IO_APIC();
1642# ifdef CONFIG_X86_64 1612 else {
1643 else
1644 nr_ioapics = 0; 1613 nr_ioapics = 0;
1645# endif 1614 localise_nmi_watchdog();
1615 }
1616#else
1617 localise_nmi_watchdog();
1646#endif 1618#endif
1647 1619
1620 setup_boot_clock();
1648#ifdef CONFIG_X86_64 1621#ifdef CONFIG_X86_64
1649 setup_boot_APIC_clock();
1650 check_nmi_watchdog(); 1622 check_nmi_watchdog();
1651#else
1652 setup_boot_clock();
1653#endif 1623#endif
1654 1624
1655 return 0; 1625 return 0;
@@ -1738,7 +1708,8 @@ void __init connect_bsp_APIC(void)
1738 outb(0x01, 0x23); 1708 outb(0x01, 0x23);
1739 } 1709 }
1740#endif 1710#endif
1741 enable_apic_mode(); 1711 if (apic->enable_apic_mode)
1712 apic->enable_apic_mode();
1742} 1713}
1743 1714
1744/** 1715/**
@@ -1876,29 +1847,39 @@ void __cpuinit generic_processor_info(int apicid, int version)
1876 } 1847 }
1877#endif 1848#endif
1878 1849
1879#if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64) 1850#if defined(CONFIG_SMP) || defined(CONFIG_X86_64)
1880 /* are we being called early in kernel startup? */ 1851 early_per_cpu(x86_cpu_to_apicid, cpu) = apicid;
1881 if (early_per_cpu_ptr(x86_cpu_to_apicid)) { 1852 early_per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
1882 u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid);
1883 u16 *bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
1884
1885 cpu_to_apicid[cpu] = apicid;
1886 bios_cpu_apicid[cpu] = apicid;
1887 } else {
1888 per_cpu(x86_cpu_to_apicid, cpu) = apicid;
1889 per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
1890 }
1891#endif 1853#endif
1892 1854
1893 set_cpu_possible(cpu, true); 1855 set_cpu_possible(cpu, true);
1894 set_cpu_present(cpu, true); 1856 set_cpu_present(cpu, true);
1895} 1857}
1896 1858
1897#ifdef CONFIG_X86_64
1898int hard_smp_processor_id(void) 1859int hard_smp_processor_id(void)
1899{ 1860{
1900 return read_apic_id(); 1861 return read_apic_id();
1901} 1862}
1863
1864void default_init_apic_ldr(void)
1865{
1866 unsigned long val;
1867
1868 apic_write(APIC_DFR, APIC_DFR_VALUE);
1869 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
1870 val |= SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
1871 apic_write(APIC_LDR, val);
1872}
1873
1874#ifdef CONFIG_X86_32
1875int default_apicid_to_node(int logical_apicid)
1876{
1877#ifdef CONFIG_SMP
1878 return apicid_2_node[hard_smp_processor_id()];
1879#else
1880 return 0;
1881#endif
1882}
1902#endif 1883#endif
1903 1884
1904/* 1885/*
@@ -1976,7 +1957,7 @@ static int lapic_resume(struct sys_device *dev)
1976 1957
1977 local_irq_save(flags); 1958 local_irq_save(flags);
1978 1959
1979#ifdef HAVE_X2APIC 1960#ifdef CONFIG_X86_X2APIC
1980 if (x2apic) 1961 if (x2apic)
1981 enable_x2apic(); 1962 enable_x2apic();
1982 else 1963 else
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index 34185488e4fb..f933822dba18 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -17,9 +17,8 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/hardirq.h> 18#include <linux/hardirq.h>
19#include <asm/smp.h> 19#include <asm/smp.h>
20#include <asm/apic.h>
20#include <asm/ipi.h> 21#include <asm/ipi.h>
21#include <asm/genapic.h>
22#include <mach_apicdef.h>
23 22
24#ifdef CONFIG_ACPI 23#ifdef CONFIG_ACPI
25#include <acpi/acpi_bus.h> 24#include <acpi/acpi_bus.h>
@@ -74,7 +73,7 @@ static inline void _flat_send_IPI_mask(unsigned long mask, int vector)
74 unsigned long flags; 73 unsigned long flags;
75 74
76 local_irq_save(flags); 75 local_irq_save(flags);
77 __send_IPI_dest_field(mask, vector, APIC_DEST_LOGICAL); 76 __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
78 local_irq_restore(flags); 77 local_irq_restore(flags);
79} 78}
80 79
@@ -85,14 +84,15 @@ static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector)
85 _flat_send_IPI_mask(mask, vector); 84 _flat_send_IPI_mask(mask, vector);
86} 85}
87 86
88static void flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, 87static void
89 int vector) 88 flat_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector)
90{ 89{
91 unsigned long mask = cpumask_bits(cpumask)[0]; 90 unsigned long mask = cpumask_bits(cpumask)[0];
92 int cpu = smp_processor_id(); 91 int cpu = smp_processor_id();
93 92
94 if (cpu < BITS_PER_LONG) 93 if (cpu < BITS_PER_LONG)
95 clear_bit(cpu, &mask); 94 clear_bit(cpu, &mask);
95
96 _flat_send_IPI_mask(mask, vector); 96 _flat_send_IPI_mask(mask, vector);
97} 97}
98 98
@@ -114,23 +114,27 @@ static void flat_send_IPI_allbutself(int vector)
114 _flat_send_IPI_mask(mask, vector); 114 _flat_send_IPI_mask(mask, vector);
115 } 115 }
116 } else if (num_online_cpus() > 1) { 116 } else if (num_online_cpus() > 1) {
117 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL); 117 __default_send_IPI_shortcut(APIC_DEST_ALLBUT,
118 vector, apic->dest_logical);
118 } 119 }
119} 120}
120 121
121static void flat_send_IPI_all(int vector) 122static void flat_send_IPI_all(int vector)
122{ 123{
123 if (vector == NMI_VECTOR) 124 if (vector == NMI_VECTOR) {
124 flat_send_IPI_mask(cpu_online_mask, vector); 125 flat_send_IPI_mask(cpu_online_mask, vector);
125 else 126 } else {
126 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); 127 __default_send_IPI_shortcut(APIC_DEST_ALLINC,
128 vector, apic->dest_logical);
129 }
127} 130}
128 131
129static unsigned int get_apic_id(unsigned long x) 132static unsigned int flat_get_apic_id(unsigned long x)
130{ 133{
131 unsigned int id; 134 unsigned int id;
132 135
133 id = (((x)>>24) & 0xFFu); 136 id = (((x)>>24) & 0xFFu);
137
134 return id; 138 return id;
135} 139}
136 140
@@ -146,7 +150,7 @@ static unsigned int read_xapic_id(void)
146{ 150{
147 unsigned int id; 151 unsigned int id;
148 152
149 id = get_apic_id(apic_read(APIC_ID)); 153 id = flat_get_apic_id(apic_read(APIC_ID));
150 return id; 154 return id;
151} 155}
152 156
@@ -169,31 +173,67 @@ static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
169 return mask1 & mask2; 173 return mask1 & mask2;
170} 174}
171 175
172static unsigned int phys_pkg_id(int index_msb) 176static int flat_phys_pkg_id(int initial_apic_id, int index_msb)
173{ 177{
174 return hard_smp_processor_id() >> index_msb; 178 return hard_smp_processor_id() >> index_msb;
175} 179}
176 180
177struct genapic apic_flat = { 181struct apic apic_flat = {
178 .name = "flat", 182 .name = "flat",
179 .acpi_madt_oem_check = flat_acpi_madt_oem_check, 183 .probe = NULL,
180 .int_delivery_mode = dest_LowestPrio, 184 .acpi_madt_oem_check = flat_acpi_madt_oem_check,
181 .int_dest_mode = (APIC_DEST_LOGICAL != 0), 185 .apic_id_registered = flat_apic_id_registered,
182 .target_cpus = flat_target_cpus, 186
183 .vector_allocation_domain = flat_vector_allocation_domain, 187 .irq_delivery_mode = dest_LowestPrio,
184 .apic_id_registered = flat_apic_id_registered, 188 .irq_dest_mode = 1, /* logical */
185 .init_apic_ldr = flat_init_apic_ldr, 189
186 .send_IPI_all = flat_send_IPI_all, 190 .target_cpus = flat_target_cpus,
187 .send_IPI_allbutself = flat_send_IPI_allbutself, 191 .disable_esr = 0,
188 .send_IPI_mask = flat_send_IPI_mask, 192 .dest_logical = APIC_DEST_LOGICAL,
189 .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, 193 .check_apicid_used = NULL,
190 .send_IPI_self = apic_send_IPI_self, 194 .check_apicid_present = NULL,
191 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, 195
192 .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and, 196 .vector_allocation_domain = flat_vector_allocation_domain,
193 .phys_pkg_id = phys_pkg_id, 197 .init_apic_ldr = flat_init_apic_ldr,
194 .get_apic_id = get_apic_id, 198
195 .set_apic_id = set_apic_id, 199 .ioapic_phys_id_map = NULL,
196 .apic_id_mask = (0xFFu<<24), 200 .setup_apic_routing = NULL,
201 .multi_timer_check = NULL,
202 .apicid_to_node = NULL,
203 .cpu_to_logical_apicid = NULL,
204 .cpu_present_to_apicid = default_cpu_present_to_apicid,
205 .apicid_to_cpu_present = NULL,
206 .setup_portio_remap = NULL,
207 .check_phys_apicid_present = default_check_phys_apicid_present,
208 .enable_apic_mode = NULL,
209 .phys_pkg_id = flat_phys_pkg_id,
210 .mps_oem_check = NULL,
211
212 .get_apic_id = flat_get_apic_id,
213 .set_apic_id = set_apic_id,
214 .apic_id_mask = 0xFFu << 24,
215
216 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
217 .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and,
218
219 .send_IPI_mask = flat_send_IPI_mask,
220 .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself,
221 .send_IPI_allbutself = flat_send_IPI_allbutself,
222 .send_IPI_all = flat_send_IPI_all,
223 .send_IPI_self = apic_send_IPI_self,
224
225 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
226 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
227 .wait_for_init_deassert = NULL,
228 .smp_callin_clear_local_apic = NULL,
229 .inquire_remote_apic = NULL,
230
231 .read = native_apic_mem_read,
232 .write = native_apic_mem_write,
233 .icr_read = native_apic_icr_read,
234 .icr_write = native_apic_icr_write,
235 .wait_icr_idle = native_apic_wait_icr_idle,
236 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
197}; 237};
198 238
199/* 239/*
@@ -232,18 +272,18 @@ static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask)
232 272
233static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector) 273static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector)
234{ 274{
235 send_IPI_mask_sequence(cpumask, vector); 275 default_send_IPI_mask_sequence_phys(cpumask, vector);
236} 276}
237 277
238static void physflat_send_IPI_mask_allbutself(const struct cpumask *cpumask, 278static void physflat_send_IPI_mask_allbutself(const struct cpumask *cpumask,
239 int vector) 279 int vector)
240{ 280{
241 send_IPI_mask_allbutself(cpumask, vector); 281 default_send_IPI_mask_allbutself_phys(cpumask, vector);
242} 282}
243 283
244static void physflat_send_IPI_allbutself(int vector) 284static void physflat_send_IPI_allbutself(int vector)
245{ 285{
246 send_IPI_mask_allbutself(cpu_online_mask, vector); 286 default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
247} 287}
248 288
249static void physflat_send_IPI_all(int vector) 289static void physflat_send_IPI_all(int vector)
@@ -276,32 +316,72 @@ physflat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
276 * We're using fixed IRQ delivery, can only return one phys APIC ID. 316 * We're using fixed IRQ delivery, can only return one phys APIC ID.
277 * May as well be the first. 317 * May as well be the first.
278 */ 318 */
279 for_each_cpu_and(cpu, cpumask, andmask) 319 for_each_cpu_and(cpu, cpumask, andmask) {
280 if (cpumask_test_cpu(cpu, cpu_online_mask)) 320 if (cpumask_test_cpu(cpu, cpu_online_mask))
281 break; 321 break;
322 }
282 if (cpu < nr_cpu_ids) 323 if (cpu < nr_cpu_ids)
283 return per_cpu(x86_cpu_to_apicid, cpu); 324 return per_cpu(x86_cpu_to_apicid, cpu);
325
284 return BAD_APICID; 326 return BAD_APICID;
285} 327}
286 328
287struct genapic apic_physflat = { 329struct apic apic_physflat = {
288 .name = "physical flat", 330
289 .acpi_madt_oem_check = physflat_acpi_madt_oem_check, 331 .name = "physical flat",
290 .int_delivery_mode = dest_Fixed, 332 .probe = NULL,
291 .int_dest_mode = (APIC_DEST_PHYSICAL != 0), 333 .acpi_madt_oem_check = physflat_acpi_madt_oem_check,
292 .target_cpus = physflat_target_cpus, 334 .apic_id_registered = flat_apic_id_registered,
293 .vector_allocation_domain = physflat_vector_allocation_domain, 335
294 .apic_id_registered = flat_apic_id_registered, 336 .irq_delivery_mode = dest_Fixed,
295 .init_apic_ldr = flat_init_apic_ldr,/*not needed, but shouldn't hurt*/ 337 .irq_dest_mode = 0, /* physical */
296 .send_IPI_all = physflat_send_IPI_all, 338
297 .send_IPI_allbutself = physflat_send_IPI_allbutself, 339 .target_cpus = physflat_target_cpus,
298 .send_IPI_mask = physflat_send_IPI_mask, 340 .disable_esr = 0,
299 .send_IPI_mask_allbutself = physflat_send_IPI_mask_allbutself, 341 .dest_logical = 0,
300 .send_IPI_self = apic_send_IPI_self, 342 .check_apicid_used = NULL,
301 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, 343 .check_apicid_present = NULL,
302 .cpu_mask_to_apicid_and = physflat_cpu_mask_to_apicid_and, 344
303 .phys_pkg_id = phys_pkg_id, 345 .vector_allocation_domain = physflat_vector_allocation_domain,
304 .get_apic_id = get_apic_id, 346 /* not needed, but shouldn't hurt: */
305 .set_apic_id = set_apic_id, 347 .init_apic_ldr = flat_init_apic_ldr,
306 .apic_id_mask = (0xFFu<<24), 348
349 .ioapic_phys_id_map = NULL,
350 .setup_apic_routing = NULL,
351 .multi_timer_check = NULL,
352 .apicid_to_node = NULL,
353 .cpu_to_logical_apicid = NULL,
354 .cpu_present_to_apicid = default_cpu_present_to_apicid,
355 .apicid_to_cpu_present = NULL,
356 .setup_portio_remap = NULL,
357 .check_phys_apicid_present = default_check_phys_apicid_present,
358 .enable_apic_mode = NULL,
359 .phys_pkg_id = flat_phys_pkg_id,
360 .mps_oem_check = NULL,
361
362 .get_apic_id = flat_get_apic_id,
363 .set_apic_id = set_apic_id,
364 .apic_id_mask = 0xFFu << 24,
365
366 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid,
367 .cpu_mask_to_apicid_and = physflat_cpu_mask_to_apicid_and,
368
369 .send_IPI_mask = physflat_send_IPI_mask,
370 .send_IPI_mask_allbutself = physflat_send_IPI_mask_allbutself,
371 .send_IPI_allbutself = physflat_send_IPI_allbutself,
372 .send_IPI_all = physflat_send_IPI_all,
373 .send_IPI_self = apic_send_IPI_self,
374
375 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
376 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
377 .wait_for_init_deassert = NULL,
378 .smp_callin_clear_local_apic = NULL,
379 .inquire_remote_apic = NULL,
380
381 .read = native_apic_mem_read,
382 .write = native_apic_mem_write,
383 .icr_read = native_apic_icr_read,
384 .icr_write = native_apic_icr_write,
385 .wait_icr_idle = native_apic_wait_icr_idle,
386 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
307}; 387};
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
new file mode 100644
index 000000000000..d806ecaa948f
--- /dev/null
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -0,0 +1,267 @@
1/*
2 * APIC driver for "bigsmp" xAPIC machines with more than 8 virtual CPUs.
3 *
4 * Drives the local APIC in "clustered mode".
5 */
6#include <linux/threads.h>
7#include <linux/cpumask.h>
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/dmi.h>
11#include <linux/smp.h>
12
13#include <asm/apicdef.h>
14#include <asm/fixmap.h>
15#include <asm/mpspec.h>
16#include <asm/apic.h>
17#include <asm/ipi.h>
18
19static unsigned bigsmp_get_apic_id(unsigned long x)
20{
21 return (x >> 24) & 0xFF;
22}
23
24static int bigsmp_apic_id_registered(void)
25{
26 return 1;
27}
28
29static const cpumask_t *bigsmp_target_cpus(void)
30{
31#ifdef CONFIG_SMP
32 return &cpu_online_map;
33#else
34 return &cpumask_of_cpu(0);
35#endif
36}
37
38static unsigned long bigsmp_check_apicid_used(physid_mask_t bitmap, int apicid)
39{
40 return 0;
41}
42
43static unsigned long bigsmp_check_apicid_present(int bit)
44{
45 return 1;
46}
47
48static inline unsigned long calculate_ldr(int cpu)
49{
50 unsigned long val, id;
51
52 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
53 id = per_cpu(x86_bios_cpu_apicid, cpu);
54 val |= SET_APIC_LOGICAL_ID(id);
55
56 return val;
57}
58
59/*
60 * Set up the logical destination ID.
61 *
62 * Intel recommends to set DFR, LDR and TPR before enabling
63 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
64 * document number 292116). So here it goes...
65 */
66static void bigsmp_init_apic_ldr(void)
67{
68 unsigned long val;
69 int cpu = smp_processor_id();
70
71 apic_write(APIC_DFR, APIC_DFR_FLAT);
72 val = calculate_ldr(cpu);
73 apic_write(APIC_LDR, val);
74}
75
76static void bigsmp_setup_apic_routing(void)
77{
78 printk(KERN_INFO
79 "Enabling APIC mode: Physflat. Using %d I/O APICs\n",
80 nr_ioapics);
81}
82
83static int bigsmp_apicid_to_node(int logical_apicid)
84{
85 return apicid_2_node[hard_smp_processor_id()];
86}
87
88static int bigsmp_cpu_present_to_apicid(int mps_cpu)
89{
90 if (mps_cpu < nr_cpu_ids)
91 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
92
93 return BAD_APICID;
94}
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 */
102static inline int bigsmp_cpu_to_logical_apicid(int cpu)
103{
104 if (cpu >= nr_cpu_ids)
105 return BAD_APICID;
106 return cpu_physical_id(cpu);
107}
108
109static physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map)
110{
111 /* For clustered we don't have a good way to do this yet - hack */
112 return physids_promote(0xFFL);
113}
114
115static int bigsmp_check_phys_apicid_present(int boot_cpu_physical_apicid)
116{
117 return 1;
118}
119
120/* As we are using single CPU as destination, pick only one CPU here */
121static unsigned int bigsmp_cpu_mask_to_apicid(const cpumask_t *cpumask)
122{
123 return bigsmp_cpu_to_logical_apicid(first_cpu(*cpumask));
124}
125
126static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
127 const struct cpumask *andmask)
128{
129 int cpu;
130
131 /*
132 * We're using fixed IRQ delivery, can only return one phys APIC ID.
133 * May as well be the first.
134 */
135 for_each_cpu_and(cpu, cpumask, andmask) {
136 if (cpumask_test_cpu(cpu, cpu_online_mask))
137 break;
138 }
139 if (cpu < nr_cpu_ids)
140 return bigsmp_cpu_to_logical_apicid(cpu);
141
142 return BAD_APICID;
143}
144
145static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
146{
147 return cpuid_apic >> index_msb;
148}
149
150static inline void bigsmp_send_IPI_mask(const struct cpumask *mask, int vector)
151{
152 default_send_IPI_mask_sequence_phys(mask, vector);
153}
154
155static void bigsmp_send_IPI_allbutself(int vector)
156{
157 default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
158}
159
160static void bigsmp_send_IPI_all(int vector)
161{
162 bigsmp_send_IPI_mask(cpu_online_mask, vector);
163}
164
165static int dmi_bigsmp; /* can be set by dmi scanners */
166
167static int hp_ht_bigsmp(const struct dmi_system_id *d)
168{
169 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
170 dmi_bigsmp = 1;
171
172 return 0;
173}
174
175
176static const struct dmi_system_id bigsmp_dmi_table[] = {
177 { hp_ht_bigsmp, "HP ProLiant DL760 G2",
178 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
179 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
180 }
181 },
182
183 { hp_ht_bigsmp, "HP ProLiant DL740",
184 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
185 DMI_MATCH(DMI_BIOS_VERSION, "P47-"),
186 }
187 },
188 { } /* NULL entry stops DMI scanning */
189};
190
191static void bigsmp_vector_allocation_domain(int cpu, cpumask_t *retmask)
192{
193 cpus_clear(*retmask);
194 cpu_set(cpu, *retmask);
195}
196
197static int probe_bigsmp(void)
198{
199 if (def_to_bigsmp)
200 dmi_bigsmp = 1;
201 else
202 dmi_check_system(bigsmp_dmi_table);
203
204 return dmi_bigsmp;
205}
206
207struct apic apic_bigsmp = {
208
209 .name = "bigsmp",
210 .probe = probe_bigsmp,
211 .acpi_madt_oem_check = NULL,
212 .apic_id_registered = bigsmp_apic_id_registered,
213
214 .irq_delivery_mode = dest_Fixed,
215 /* phys delivery to target CPU: */
216 .irq_dest_mode = 0,
217
218 .target_cpus = bigsmp_target_cpus,
219 .disable_esr = 1,
220 .dest_logical = 0,
221 .check_apicid_used = bigsmp_check_apicid_used,
222 .check_apicid_present = bigsmp_check_apicid_present,
223
224 .vector_allocation_domain = bigsmp_vector_allocation_domain,
225 .init_apic_ldr = bigsmp_init_apic_ldr,
226
227 .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map,
228 .setup_apic_routing = bigsmp_setup_apic_routing,
229 .multi_timer_check = NULL,
230 .apicid_to_node = bigsmp_apicid_to_node,
231 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
232 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
233 .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present,
234 .setup_portio_remap = NULL,
235 .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
236 .enable_apic_mode = NULL,
237 .phys_pkg_id = bigsmp_phys_pkg_id,
238 .mps_oem_check = NULL,
239
240 .get_apic_id = bigsmp_get_apic_id,
241 .set_apic_id = NULL,
242 .apic_id_mask = 0xFF << 24,
243
244 .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid,
245 .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and,
246
247 .send_IPI_mask = bigsmp_send_IPI_mask,
248 .send_IPI_mask_allbutself = NULL,
249 .send_IPI_allbutself = bigsmp_send_IPI_allbutself,
250 .send_IPI_all = bigsmp_send_IPI_all,
251 .send_IPI_self = default_send_IPI_self,
252
253 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
254 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
255
256 .wait_for_init_deassert = default_wait_for_init_deassert,
257
258 .smp_callin_clear_local_apic = NULL,
259 .inquire_remote_apic = default_inquire_remote_apic,
260
261 .read = native_apic_mem_read,
262 .write = native_apic_mem_write,
263 .icr_read = native_apic_icr_read,
264 .icr_write = native_apic_icr_write,
265 .wait_icr_idle = native_apic_wait_icr_idle,
266 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
267};
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
new file mode 100644
index 000000000000..19588f2770ee
--- /dev/null
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -0,0 +1,780 @@
1/*
2 * Written by: Garry Forsgren, Unisys Corporation
3 * Natalie Protasevich, Unisys Corporation
4 *
5 * This file contains the code to configure and interface
6 * with Unisys ES7000 series hardware system manager.
7 *
8 * Copyright (c) 2003 Unisys Corporation.
9 * Copyright (C) 2009, Red Hat, Inc., Ingo Molnar
10 *
11 * All Rights Reserved.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of version 2 of the GNU General Public License as
15 * published by the Free Software Foundation.
16 *
17 * This program is distributed in the hope that it would be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write the Free Software Foundation, Inc., 59
23 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
24 *
25 * Contact information: Unisys Corporation, Township Line & Union Meeting
26 * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or:
27 *
28 * http://www.unisys.com
29 */
30#include <linux/notifier.h>
31#include <linux/spinlock.h>
32#include <linux/cpumask.h>
33#include <linux/threads.h>
34#include <linux/kernel.h>
35#include <linux/module.h>
36#include <linux/reboot.h>
37#include <linux/string.h>
38#include <linux/types.h>
39#include <linux/errno.h>
40#include <linux/acpi.h>
41#include <linux/init.h>
42#include <linux/nmi.h>
43#include <linux/smp.h>
44#include <linux/io.h>
45
46#include <asm/apicdef.h>
47#include <asm/atomic.h>
48#include <asm/fixmap.h>
49#include <asm/mpspec.h>
50#include <asm/setup.h>
51#include <asm/apic.h>
52#include <asm/ipi.h>
53
54/*
55 * ES7000 chipsets
56 */
57
58#define NON_UNISYS 0
59#define ES7000_CLASSIC 1
60#define ES7000_ZORRO 2
61
62#define MIP_REG 1
63#define MIP_PSAI_REG 4
64
65#define MIP_BUSY 1
66#define MIP_SPIN 0xf0000
67#define MIP_VALID 0x0100000000000000ULL
68#define MIP_SW_APIC 0x1020b
69
70#define MIP_PORT(val) ((val >> 32) & 0xffff)
71
72#define MIP_RD_LO(val) (val & 0xffffffff)
73
74struct mip_reg {
75 unsigned long long off_0x00;
76 unsigned long long off_0x08;
77 unsigned long long off_0x10;
78 unsigned long long off_0x18;
79 unsigned long long off_0x20;
80 unsigned long long off_0x28;
81 unsigned long long off_0x30;
82 unsigned long long off_0x38;
83};
84
85struct mip_reg_info {
86 unsigned long long mip_info;
87 unsigned long long delivery_info;
88 unsigned long long host_reg;
89 unsigned long long mip_reg;
90};
91
92struct psai {
93 unsigned long long entry_type;
94 unsigned long long addr;
95 unsigned long long bep_addr;
96};
97
98#ifdef CONFIG_ACPI
99
100struct es7000_oem_table {
101 struct acpi_table_header Header;
102 u32 OEMTableAddr;
103 u32 OEMTableSize;
104};
105
106static unsigned long oem_addrX;
107static unsigned long oem_size;
108
109#endif
110
111/*
112 * ES7000 Globals
113 */
114
115static volatile unsigned long *psai;
116static struct mip_reg *mip_reg;
117static struct mip_reg *host_reg;
118static int mip_port;
119static unsigned long mip_addr;
120static unsigned long host_addr;
121
122int es7000_plat;
123
124/*
125 * GSI override for ES7000 platforms.
126 */
127
128static unsigned int base;
129
130static int
131es7000_rename_gsi(int ioapic, int gsi)
132{
133 if (es7000_plat == ES7000_ZORRO)
134 return gsi;
135
136 if (!base) {
137 int i;
138 for (i = 0; i < nr_ioapics; i++)
139 base += nr_ioapic_registers[i];
140 }
141
142 if (!ioapic && (gsi < 16))
143 gsi += base;
144
145 return gsi;
146}
147
148static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
149{
150 unsigned long vect = 0, psaival = 0;
151
152 if (psai == NULL)
153 return -1;
154
155 vect = ((unsigned long)__pa(eip)/0x1000) << 16;
156 psaival = (0x1000000 | vect | cpu);
157
158 while (*psai & 0x1000000)
159 ;
160
161 *psai = psaival;
162
163 return 0;
164}
165
166static int es7000_apic_is_cluster(void)
167{
168 /* MPENTIUMIII */
169 if (boot_cpu_data.x86 == 6 &&
170 (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11))
171 return 1;
172
173 return 0;
174}
175
176static void setup_unisys(void)
177{
178 /*
179 * Determine the generation of the ES7000 currently running.
180 *
181 * es7000_plat = 1 if the machine is a 5xx ES7000 box
182 * es7000_plat = 2 if the machine is a x86_64 ES7000 box
183 *
184 */
185 if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
186 es7000_plat = ES7000_ZORRO;
187 else
188 es7000_plat = ES7000_CLASSIC;
189 ioapic_renumber_irq = es7000_rename_gsi;
190}
191
192/*
193 * Parse the OEM Table:
194 */
195static int parse_unisys_oem(char *oemptr)
196{
197 int i;
198 int success = 0;
199 unsigned char type, size;
200 unsigned long val;
201 char *tp = NULL;
202 struct psai *psaip = NULL;
203 struct mip_reg_info *mi;
204 struct mip_reg *host, *mip;
205
206 tp = oemptr;
207
208 tp += 8;
209
210 for (i = 0; i <= 6; i++) {
211 type = *tp++;
212 size = *tp++;
213 tp -= 2;
214 switch (type) {
215 case MIP_REG:
216 mi = (struct mip_reg_info *)tp;
217 val = MIP_RD_LO(mi->host_reg);
218 host_addr = val;
219 host = (struct mip_reg *)val;
220 host_reg = __va(host);
221 val = MIP_RD_LO(mi->mip_reg);
222 mip_port = MIP_PORT(mi->mip_info);
223 mip_addr = val;
224 mip = (struct mip_reg *)val;
225 mip_reg = __va(mip);
226 pr_debug("es7000_mipcfg: host_reg = 0x%lx \n",
227 (unsigned long)host_reg);
228 pr_debug("es7000_mipcfg: mip_reg = 0x%lx \n",
229 (unsigned long)mip_reg);
230 success++;
231 break;
232 case MIP_PSAI_REG:
233 psaip = (struct psai *)tp;
234 if (tp != NULL) {
235 if (psaip->addr)
236 psai = __va(psaip->addr);
237 else
238 psai = NULL;
239 success++;
240 }
241 break;
242 default:
243 break;
244 }
245 tp += size;
246 }
247
248 if (success < 2)
249 es7000_plat = NON_UNISYS;
250 else
251 setup_unisys();
252
253 return es7000_plat;
254}
255
256#ifdef CONFIG_ACPI
257static int find_unisys_acpi_oem_table(unsigned long *oem_addr)
258{
259 struct acpi_table_header *header = NULL;
260 struct es7000_oem_table *table;
261 acpi_size tbl_size;
262 acpi_status ret;
263 int i = 0;
264
265 for (;;) {
266 ret = acpi_get_table_with_size("OEM1", i++, &header, &tbl_size);
267 if (!ACPI_SUCCESS(ret))
268 return -1;
269
270 if (!memcmp((char *) &header->oem_id, "UNISYS", 6))
271 break;
272
273 early_acpi_os_unmap_memory(header, tbl_size);
274 }
275
276 table = (void *)header;
277
278 oem_addrX = table->OEMTableAddr;
279 oem_size = table->OEMTableSize;
280
281 early_acpi_os_unmap_memory(header, tbl_size);
282
283 *oem_addr = (unsigned long)__acpi_map_table(oem_addrX, oem_size);
284
285 return 0;
286}
287
288static void unmap_unisys_acpi_oem_table(unsigned long oem_addr)
289{
290 if (!oem_addr)
291 return;
292
293 __acpi_unmap_table((char *)oem_addr, oem_size);
294}
295
296static int es7000_check_dsdt(void)
297{
298 struct acpi_table_header header;
299
300 if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
301 !strncmp(header.oem_id, "UNISYS", 6))
302 return 1;
303 return 0;
304}
305
306static int es7000_acpi_ret;
307
308/* Hook from generic ACPI tables.c */
309static int es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
310{
311 unsigned long oem_addr = 0;
312 int check_dsdt;
313 int ret = 0;
314
315 /* check dsdt at first to avoid clear fix_map for oem_addr */
316 check_dsdt = es7000_check_dsdt();
317
318 if (!find_unisys_acpi_oem_table(&oem_addr)) {
319 if (check_dsdt) {
320 ret = parse_unisys_oem((char *)oem_addr);
321 } else {
322 setup_unisys();
323 ret = 1;
324 }
325 /*
326 * we need to unmap it
327 */
328 unmap_unisys_acpi_oem_table(oem_addr);
329 }
330
331 es7000_acpi_ret = ret;
332
333 return ret && !es7000_apic_is_cluster();
334}
335
336static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
337{
338 int ret = es7000_acpi_ret;
339
340 return ret && es7000_apic_is_cluster();
341}
342
343#else /* !CONFIG_ACPI: */
344static int es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
345{
346 return 0;
347}
348
349static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
350{
351 return 0;
352}
353#endif /* !CONFIG_ACPI */
354
355static void es7000_spin(int n)
356{
357 int i = 0;
358
359 while (i++ < n)
360 rep_nop();
361}
362
363static int es7000_mip_write(struct mip_reg *mip_reg)
364{
365 int status = 0;
366 int spin;
367
368 spin = MIP_SPIN;
369 while ((host_reg->off_0x38 & MIP_VALID) != 0) {
370 if (--spin <= 0) {
371 WARN(1, "Timeout waiting for Host Valid Flag\n");
372 return -1;
373 }
374 es7000_spin(MIP_SPIN);
375 }
376
377 memcpy(host_reg, mip_reg, sizeof(struct mip_reg));
378 outb(1, mip_port);
379
380 spin = MIP_SPIN;
381
382 while ((mip_reg->off_0x38 & MIP_VALID) == 0) {
383 if (--spin <= 0) {
384 WARN(1, "Timeout waiting for MIP Valid Flag\n");
385 return -1;
386 }
387 es7000_spin(MIP_SPIN);
388 }
389
390 status = (mip_reg->off_0x00 & 0xffff0000000000ULL) >> 48;
391 mip_reg->off_0x38 &= ~MIP_VALID;
392
393 return status;
394}
395
396static void es7000_enable_apic_mode(void)
397{
398 struct mip_reg es7000_mip_reg;
399 int mip_status;
400
401 if (!es7000_plat)
402 return;
403
404 printk(KERN_INFO "ES7000: Enabling APIC mode.\n");
405 memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
406 es7000_mip_reg.off_0x00 = MIP_SW_APIC;
407 es7000_mip_reg.off_0x38 = MIP_VALID;
408
409 while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
410 WARN(1, "Command failed, status = %x\n", mip_status);
411}
412
413static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask)
414{
415 /* Careful. Some cpus do not strictly honor the set of cpus
416 * specified in the interrupt destination when using lowest
417 * priority interrupt delivery mode.
418 *
419 * In particular there was a hyperthreading cpu observed to
420 * deliver interrupts to the wrong hyperthread when only one
421 * hyperthread was specified in the interrupt desitination.
422 */
423 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
424}
425
426
427static void es7000_wait_for_init_deassert(atomic_t *deassert)
428{
429 while (!atomic_read(deassert))
430 cpu_relax();
431}
432
433static unsigned int es7000_get_apic_id(unsigned long x)
434{
435 return (x >> 24) & 0xFF;
436}
437
438static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
439{
440 default_send_IPI_mask_sequence_phys(mask, vector);
441}
442
443static void es7000_send_IPI_allbutself(int vector)
444{
445 default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
446}
447
448static void es7000_send_IPI_all(int vector)
449{
450 es7000_send_IPI_mask(cpu_online_mask, vector);
451}
452
453static int es7000_apic_id_registered(void)
454{
455 return 1;
456}
457
458static const cpumask_t *target_cpus_cluster(void)
459{
460 return &CPU_MASK_ALL;
461}
462
463static const cpumask_t *es7000_target_cpus(void)
464{
465 return &cpumask_of_cpu(smp_processor_id());
466}
467
468static unsigned long
469es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
470{
471 return 0;
472}
473static unsigned long es7000_check_apicid_present(int bit)
474{
475 return physid_isset(bit, phys_cpu_present_map);
476}
477
478static unsigned long calculate_ldr(int cpu)
479{
480 unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu);
481
482 return SET_APIC_LOGICAL_ID(id);
483}
484
485/*
486 * Set up the logical destination ID.
487 *
488 * Intel recommends to set DFR, LdR and TPR before enabling
489 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
490 * document number 292116). So here it goes...
491 */
492static void es7000_init_apic_ldr_cluster(void)
493{
494 unsigned long val;
495 int cpu = smp_processor_id();
496
497 apic_write(APIC_DFR, APIC_DFR_CLUSTER);
498 val = calculate_ldr(cpu);
499 apic_write(APIC_LDR, val);
500}
501
502static void es7000_init_apic_ldr(void)
503{
504 unsigned long val;
505 int cpu = smp_processor_id();
506
507 apic_write(APIC_DFR, APIC_DFR_FLAT);
508 val = calculate_ldr(cpu);
509 apic_write(APIC_LDR, val);
510}
511
512static void es7000_setup_apic_routing(void)
513{
514 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
515
516 printk(KERN_INFO
517 "Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
518 (apic_version[apic] == 0x14) ?
519 "Physical Cluster" : "Logical Cluster",
520 nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
521}
522
523static int es7000_apicid_to_node(int logical_apicid)
524{
525 return 0;
526}
527
528
529static int es7000_cpu_present_to_apicid(int mps_cpu)
530{
531 if (!mps_cpu)
532 return boot_cpu_physical_apicid;
533 else if (mps_cpu < nr_cpu_ids)
534 return per_cpu(x86_bios_cpu_apicid, mps_cpu);
535 else
536 return BAD_APICID;
537}
538
539static int cpu_id;
540
541static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid)
542{
543 physid_mask_t mask;
544
545 mask = physid_mask_of_physid(cpu_id);
546 ++cpu_id;
547
548 return mask;
549}
550
551/* Mapping from cpu number to logical apicid */
552static int es7000_cpu_to_logical_apicid(int cpu)
553{
554#ifdef CONFIG_SMP
555 if (cpu >= nr_cpu_ids)
556 return BAD_APICID;
557 return cpu_2_logical_apicid[cpu];
558#else
559 return logical_smp_processor_id();
560#endif
561}
562
563static physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map)
564{
565 /* For clustered we don't have a good way to do this yet - hack */
566 return physids_promote(0xff);
567}
568
569static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
570{
571 boot_cpu_physical_apicid = read_apic_id();
572 return 1;
573}
574
575static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
576{
577 unsigned int round = 0;
578 int cpu, uninitialized_var(apicid);
579
580 /*
581 * The cpus in the mask must all be on the apic cluster.
582 */
583 for_each_cpu(cpu, cpumask) {
584 int new_apicid = es7000_cpu_to_logical_apicid(cpu);
585
586 if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
587 WARN(1, "Not a valid mask!");
588
589 return BAD_APICID;
590 }
591 apicid = new_apicid;
592 round++;
593 }
594 return apicid;
595}
596
597static unsigned int
598es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask,
599 const struct cpumask *andmask)
600{
601 int apicid = es7000_cpu_to_logical_apicid(0);
602 cpumask_var_t cpumask;
603
604 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
605 return apicid;
606
607 cpumask_and(cpumask, inmask, andmask);
608 cpumask_and(cpumask, cpumask, cpu_online_mask);
609 apicid = es7000_cpu_mask_to_apicid(cpumask);
610
611 free_cpumask_var(cpumask);
612
613 return apicid;
614}
615
616static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
617{
618 return cpuid_apic >> index_msb;
619}
620
621static int probe_es7000(void)
622{
623 /* probed later in mptable/ACPI hooks */
624 return 0;
625}
626
627static int es7000_mps_ret;
628static int es7000_mps_oem_check(struct mpc_table *mpc, char *oem,
629 char *productid)
630{
631 int ret = 0;
632
633 if (mpc->oemptr) {
634 struct mpc_oemtable *oem_table =
635 (struct mpc_oemtable *)mpc->oemptr;
636
637 if (!strncmp(oem, "UNISYS", 6))
638 ret = parse_unisys_oem((char *)oem_table);
639 }
640
641 es7000_mps_ret = ret;
642
643 return ret && !es7000_apic_is_cluster();
644}
645
646static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
647 char *productid)
648{
649 int ret = es7000_mps_ret;
650
651 return ret && es7000_apic_is_cluster();
652}
653
654struct apic apic_es7000_cluster = {
655
656 .name = "es7000",
657 .probe = probe_es7000,
658 .acpi_madt_oem_check = es7000_acpi_madt_oem_check_cluster,
659 .apic_id_registered = es7000_apic_id_registered,
660
661 .irq_delivery_mode = dest_LowestPrio,
662 /* logical delivery broadcast to all procs: */
663 .irq_dest_mode = 1,
664
665 .target_cpus = target_cpus_cluster,
666 .disable_esr = 1,
667 .dest_logical = 0,
668 .check_apicid_used = es7000_check_apicid_used,
669 .check_apicid_present = es7000_check_apicid_present,
670
671 .vector_allocation_domain = es7000_vector_allocation_domain,
672 .init_apic_ldr = es7000_init_apic_ldr_cluster,
673
674 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
675 .setup_apic_routing = es7000_setup_apic_routing,
676 .multi_timer_check = NULL,
677 .apicid_to_node = es7000_apicid_to_node,
678 .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
679 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
680 .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
681 .setup_portio_remap = NULL,
682 .check_phys_apicid_present = es7000_check_phys_apicid_present,
683 .enable_apic_mode = es7000_enable_apic_mode,
684 .phys_pkg_id = es7000_phys_pkg_id,
685 .mps_oem_check = es7000_mps_oem_check_cluster,
686
687 .get_apic_id = es7000_get_apic_id,
688 .set_apic_id = NULL,
689 .apic_id_mask = 0xFF << 24,
690
691 .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
692 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
693
694 .send_IPI_mask = es7000_send_IPI_mask,
695 .send_IPI_mask_allbutself = NULL,
696 .send_IPI_allbutself = es7000_send_IPI_allbutself,
697 .send_IPI_all = es7000_send_IPI_all,
698 .send_IPI_self = default_send_IPI_self,
699
700 .wakeup_secondary_cpu = wakeup_secondary_cpu_via_mip,
701
702 .trampoline_phys_low = 0x467,
703 .trampoline_phys_high = 0x469,
704
705 .wait_for_init_deassert = NULL,
706
707 /* Nothing to do for most platforms, since cleared by the INIT cycle: */
708 .smp_callin_clear_local_apic = NULL,
709 .inquire_remote_apic = default_inquire_remote_apic,
710
711 .read = native_apic_mem_read,
712 .write = native_apic_mem_write,
713 .icr_read = native_apic_icr_read,
714 .icr_write = native_apic_icr_write,
715 .wait_icr_idle = native_apic_wait_icr_idle,
716 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
717};
718
719struct apic apic_es7000 = {
720
721 .name = "es7000",
722 .probe = probe_es7000,
723 .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
724 .apic_id_registered = es7000_apic_id_registered,
725
726 .irq_delivery_mode = dest_Fixed,
727 /* phys delivery to target CPUs: */
728 .irq_dest_mode = 0,
729
730 .target_cpus = es7000_target_cpus,
731 .disable_esr = 1,
732 .dest_logical = 0,
733 .check_apicid_used = es7000_check_apicid_used,
734 .check_apicid_present = es7000_check_apicid_present,
735
736 .vector_allocation_domain = es7000_vector_allocation_domain,
737 .init_apic_ldr = es7000_init_apic_ldr,
738
739 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
740 .setup_apic_routing = es7000_setup_apic_routing,
741 .multi_timer_check = NULL,
742 .apicid_to_node = es7000_apicid_to_node,
743 .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
744 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
745 .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
746 .setup_portio_remap = NULL,
747 .check_phys_apicid_present = es7000_check_phys_apicid_present,
748 .enable_apic_mode = es7000_enable_apic_mode,
749 .phys_pkg_id = es7000_phys_pkg_id,
750 .mps_oem_check = es7000_mps_oem_check,
751
752 .get_apic_id = es7000_get_apic_id,
753 .set_apic_id = NULL,
754 .apic_id_mask = 0xFF << 24,
755
756 .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
757 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
758
759 .send_IPI_mask = es7000_send_IPI_mask,
760 .send_IPI_mask_allbutself = NULL,
761 .send_IPI_allbutself = es7000_send_IPI_allbutself,
762 .send_IPI_all = es7000_send_IPI_all,
763 .send_IPI_self = default_send_IPI_self,
764
765 .trampoline_phys_low = 0x467,
766 .trampoline_phys_high = 0x469,
767
768 .wait_for_init_deassert = es7000_wait_for_init_deassert,
769
770 /* Nothing to do for most platforms, since cleared by the INIT cycle: */
771 .smp_callin_clear_local_apic = NULL,
772 .inquire_remote_apic = default_inquire_remote_apic,
773
774 .read = native_apic_mem_read,
775 .write = native_apic_mem_write,
776 .icr_read = native_apic_icr_read,
777 .icr_write = native_apic_icr_write,
778 .wait_icr_idle = native_apic_wait_icr_idle,
779 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
780};
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index bc7ac4da90d7..00e6071cefc4 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Intel IO-APIC support for multi-Pentium hosts. 2 * Intel IO-APIC support for multi-Pentium hosts.
3 * 3 *
4 * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar, Hajnalka Szabo 4 * Copyright (C) 1997, 1998, 1999, 2000, 2009 Ingo Molnar, Hajnalka Szabo
5 * 5 *
6 * Many thanks to Stig Venaas for trying out countless experimental 6 * Many thanks to Stig Venaas for trying out countless experimental
7 * patches and reporting/debugging problems patiently! 7 * patches and reporting/debugging problems patiently!
@@ -46,6 +46,7 @@
46#include <asm/idle.h> 46#include <asm/idle.h>
47#include <asm/io.h> 47#include <asm/io.h>
48#include <asm/smp.h> 48#include <asm/smp.h>
49#include <asm/cpu.h>
49#include <asm/desc.h> 50#include <asm/desc.h>
50#include <asm/proto.h> 51#include <asm/proto.h>
51#include <asm/acpi.h> 52#include <asm/acpi.h>
@@ -61,9 +62,7 @@
61#include <asm/uv/uv_hub.h> 62#include <asm/uv/uv_hub.h>
62#include <asm/uv/uv_irq.h> 63#include <asm/uv/uv_irq.h>
63 64
64#include <mach_ipi.h> 65#include <asm/apic.h>
65#include <mach_apic.h>
66#include <mach_apicdef.h>
67 66
68#define __apicdebuginit(type) static type __init 67#define __apicdebuginit(type) static type __init
69 68
@@ -82,11 +81,11 @@ static DEFINE_SPINLOCK(vector_lock);
82int nr_ioapic_registers[MAX_IO_APICS]; 81int nr_ioapic_registers[MAX_IO_APICS];
83 82
84/* I/O APIC entries */ 83/* I/O APIC entries */
85struct mp_config_ioapic mp_ioapics[MAX_IO_APICS]; 84struct mpc_ioapic mp_ioapics[MAX_IO_APICS];
86int nr_ioapics; 85int nr_ioapics;
87 86
88/* MP IRQ source entries */ 87/* MP IRQ source entries */
89struct mp_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; 88struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES];
90 89
91/* # of MP IRQ source entries */ 90/* # of MP IRQ source entries */
92int mp_irq_entries; 91int mp_irq_entries;
@@ -99,10 +98,19 @@ DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);
99 98
100int skip_ioapic_setup; 99int skip_ioapic_setup;
101 100
101void arch_disable_smp_support(void)
102{
103#ifdef CONFIG_PCI
104 noioapicquirk = 1;
105 noioapicreroute = -1;
106#endif
107 skip_ioapic_setup = 1;
108}
109
102static int __init parse_noapic(char *str) 110static int __init parse_noapic(char *str)
103{ 111{
104 /* disable IO-APIC */ 112 /* disable IO-APIC */
105 disable_ioapic_setup(); 113 arch_disable_smp_support();
106 return 0; 114 return 0;
107} 115}
108early_param("noapic", parse_noapic); 116early_param("noapic", parse_noapic);
@@ -356,7 +364,7 @@ set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
356 364
357 if (!cfg->move_in_progress) { 365 if (!cfg->move_in_progress) {
358 /* it means that domain is not changed */ 366 /* it means that domain is not changed */
359 if (!cpumask_intersects(&desc->affinity, mask)) 367 if (!cpumask_intersects(desc->affinity, mask))
360 cfg->move_desc_pending = 1; 368 cfg->move_desc_pending = 1;
361 } 369 }
362} 370}
@@ -386,7 +394,7 @@ struct io_apic {
386static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx) 394static __attribute_const__ struct io_apic __iomem *io_apic_base(int idx)
387{ 395{
388 return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx) 396 return (void __iomem *) __fix_to_virt(FIX_IO_APIC_BASE_0 + idx)
389 + (mp_ioapics[idx].mp_apicaddr & ~PAGE_MASK); 397 + (mp_ioapics[idx].apicaddr & ~PAGE_MASK);
390} 398}
391 399
392static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) 400static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
@@ -478,7 +486,7 @@ __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
478 io_apic_write(apic, 0x10 + 2*pin, eu.w1); 486 io_apic_write(apic, 0x10 + 2*pin, eu.w1);
479} 487}
480 488
481static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) 489void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
482{ 490{
483 unsigned long flags; 491 unsigned long flags;
484 spin_lock_irqsave(&ioapic_lock, flags); 492 spin_lock_irqsave(&ioapic_lock, flags);
@@ -513,11 +521,11 @@ static void send_cleanup_vector(struct irq_cfg *cfg)
513 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) 521 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
514 cfg->move_cleanup_count++; 522 cfg->move_cleanup_count++;
515 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) 523 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
516 send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR); 524 apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
517 } else { 525 } else {
518 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask); 526 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask);
519 cfg->move_cleanup_count = cpumask_weight(cleanup_mask); 527 cfg->move_cleanup_count = cpumask_weight(cleanup_mask);
520 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); 528 apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
521 free_cpumask_var(cleanup_mask); 529 free_cpumask_var(cleanup_mask);
522 } 530 }
523 cfg->move_in_progress = 0; 531 cfg->move_in_progress = 0;
@@ -562,8 +570,9 @@ static int
562assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask); 570assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask);
563 571
564/* 572/*
565 * Either sets desc->affinity to a valid value, and returns cpu_mask_to_apicid 573 * Either sets desc->affinity to a valid value, and returns
566 * of that, or returns BAD_APICID and leaves desc->affinity untouched. 574 * ->cpu_mask_to_apicid of that, or returns BAD_APICID and
575 * leaves desc->affinity untouched.
567 */ 576 */
568static unsigned int 577static unsigned int
569set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask) 578set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
@@ -579,9 +588,10 @@ set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
579 if (assign_irq_vector(irq, cfg, mask)) 588 if (assign_irq_vector(irq, cfg, mask))
580 return BAD_APICID; 589 return BAD_APICID;
581 590
582 cpumask_and(&desc->affinity, cfg->domain, mask); 591 cpumask_and(desc->affinity, cfg->domain, mask);
583 set_extra_move_desc(desc, mask); 592 set_extra_move_desc(desc, mask);
584 return cpu_mask_to_apicid_and(&desc->affinity, cpu_online_mask); 593
594 return apic->cpu_mask_to_apicid_and(desc->affinity, cpu_online_mask);
585} 595}
586 596
587static void 597static void
@@ -796,23 +806,6 @@ static void clear_IO_APIC (void)
796 clear_IO_APIC_pin(apic, pin); 806 clear_IO_APIC_pin(apic, pin);
797} 807}
798 808
799#if !defined(CONFIG_SMP) && defined(CONFIG_X86_32)
800void send_IPI_self(int vector)
801{
802 unsigned int cfg;
803
804 /*
805 * Wait for idle.
806 */
807 apic_wait_icr_idle();
808 cfg = APIC_DM_FIXED | APIC_DEST_SELF | vector | APIC_DEST_LOGICAL;
809 /*
810 * Send the IPI. The write to APIC_ICR fires this off.
811 */
812 apic_write(APIC_ICR, cfg);
813}
814#endif /* !CONFIG_SMP && CONFIG_X86_32*/
815
816#ifdef CONFIG_X86_32 809#ifdef CONFIG_X86_32
817/* 810/*
818 * support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to 811 * support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to
@@ -820,8 +813,9 @@ void send_IPI_self(int vector)
820 */ 813 */
821 814
822#define MAX_PIRQS 8 815#define MAX_PIRQS 8
823static int pirq_entries [MAX_PIRQS]; 816static int pirq_entries[MAX_PIRQS] = {
824static int pirqs_enabled; 817 [0 ... MAX_PIRQS - 1] = -1
818};
825 819
826static int __init ioapic_pirq_setup(char *str) 820static int __init ioapic_pirq_setup(char *str)
827{ 821{
@@ -830,10 +824,6 @@ static int __init ioapic_pirq_setup(char *str)
830 824
831 get_options(str, ARRAY_SIZE(ints), ints); 825 get_options(str, ARRAY_SIZE(ints), ints);
832 826
833 for (i = 0; i < MAX_PIRQS; i++)
834 pirq_entries[i] = -1;
835
836 pirqs_enabled = 1;
837 apic_printk(APIC_VERBOSE, KERN_INFO 827 apic_printk(APIC_VERBOSE, KERN_INFO
838 "PIRQ redirection, working around broken MP-BIOS.\n"); 828 "PIRQ redirection, working around broken MP-BIOS.\n");
839 max = MAX_PIRQS; 829 max = MAX_PIRQS;
@@ -944,10 +934,10 @@ static int find_irq_entry(int apic, int pin, int type)
944 int i; 934 int i;
945 935
946 for (i = 0; i < mp_irq_entries; i++) 936 for (i = 0; i < mp_irq_entries; i++)
947 if (mp_irqs[i].mp_irqtype == type && 937 if (mp_irqs[i].irqtype == type &&
948 (mp_irqs[i].mp_dstapic == mp_ioapics[apic].mp_apicid || 938 (mp_irqs[i].dstapic == mp_ioapics[apic].apicid ||
949 mp_irqs[i].mp_dstapic == MP_APIC_ALL) && 939 mp_irqs[i].dstapic == MP_APIC_ALL) &&
950 mp_irqs[i].mp_dstirq == pin) 940 mp_irqs[i].dstirq == pin)
951 return i; 941 return i;
952 942
953 return -1; 943 return -1;
@@ -961,13 +951,13 @@ static int __init find_isa_irq_pin(int irq, int type)
961 int i; 951 int i;
962 952
963 for (i = 0; i < mp_irq_entries; i++) { 953 for (i = 0; i < mp_irq_entries; i++) {
964 int lbus = mp_irqs[i].mp_srcbus; 954 int lbus = mp_irqs[i].srcbus;
965 955
966 if (test_bit(lbus, mp_bus_not_pci) && 956 if (test_bit(lbus, mp_bus_not_pci) &&
967 (mp_irqs[i].mp_irqtype == type) && 957 (mp_irqs[i].irqtype == type) &&
968 (mp_irqs[i].mp_srcbusirq == irq)) 958 (mp_irqs[i].srcbusirq == irq))
969 959
970 return mp_irqs[i].mp_dstirq; 960 return mp_irqs[i].dstirq;
971 } 961 }
972 return -1; 962 return -1;
973} 963}
@@ -977,17 +967,17 @@ static int __init find_isa_irq_apic(int irq, int type)
977 int i; 967 int i;
978 968
979 for (i = 0; i < mp_irq_entries; i++) { 969 for (i = 0; i < mp_irq_entries; i++) {
980 int lbus = mp_irqs[i].mp_srcbus; 970 int lbus = mp_irqs[i].srcbus;
981 971
982 if (test_bit(lbus, mp_bus_not_pci) && 972 if (test_bit(lbus, mp_bus_not_pci) &&
983 (mp_irqs[i].mp_irqtype == type) && 973 (mp_irqs[i].irqtype == type) &&
984 (mp_irqs[i].mp_srcbusirq == irq)) 974 (mp_irqs[i].srcbusirq == irq))
985 break; 975 break;
986 } 976 }
987 if (i < mp_irq_entries) { 977 if (i < mp_irq_entries) {
988 int apic; 978 int apic;
989 for(apic = 0; apic < nr_ioapics; apic++) { 979 for(apic = 0; apic < nr_ioapics; apic++) {
990 if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic) 980 if (mp_ioapics[apic].apicid == mp_irqs[i].dstapic)
991 return apic; 981 return apic;
992 } 982 }
993 } 983 }
@@ -1012,23 +1002,23 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
1012 return -1; 1002 return -1;
1013 } 1003 }
1014 for (i = 0; i < mp_irq_entries; i++) { 1004 for (i = 0; i < mp_irq_entries; i++) {
1015 int lbus = mp_irqs[i].mp_srcbus; 1005 int lbus = mp_irqs[i].srcbus;
1016 1006
1017 for (apic = 0; apic < nr_ioapics; apic++) 1007 for (apic = 0; apic < nr_ioapics; apic++)
1018 if (mp_ioapics[apic].mp_apicid == mp_irqs[i].mp_dstapic || 1008 if (mp_ioapics[apic].apicid == mp_irqs[i].dstapic ||
1019 mp_irqs[i].mp_dstapic == MP_APIC_ALL) 1009 mp_irqs[i].dstapic == MP_APIC_ALL)
1020 break; 1010 break;
1021 1011
1022 if (!test_bit(lbus, mp_bus_not_pci) && 1012 if (!test_bit(lbus, mp_bus_not_pci) &&
1023 !mp_irqs[i].mp_irqtype && 1013 !mp_irqs[i].irqtype &&
1024 (bus == lbus) && 1014 (bus == lbus) &&
1025 (slot == ((mp_irqs[i].mp_srcbusirq >> 2) & 0x1f))) { 1015 (slot == ((mp_irqs[i].srcbusirq >> 2) & 0x1f))) {
1026 int irq = pin_2_irq(i,apic,mp_irqs[i].mp_dstirq); 1016 int irq = pin_2_irq(i, apic, mp_irqs[i].dstirq);
1027 1017
1028 if (!(apic || IO_APIC_IRQ(irq))) 1018 if (!(apic || IO_APIC_IRQ(irq)))
1029 continue; 1019 continue;
1030 1020
1031 if (pin == (mp_irqs[i].mp_srcbusirq & 3)) 1021 if (pin == (mp_irqs[i].srcbusirq & 3))
1032 return irq; 1022 return irq;
1033 /* 1023 /*
1034 * Use the first all-but-pin matching entry as a 1024 * Use the first all-but-pin matching entry as a
@@ -1071,7 +1061,7 @@ static int EISA_ELCR(unsigned int irq)
1071 * EISA conforming in the MP table, that means its trigger type must 1061 * EISA conforming in the MP table, that means its trigger type must
1072 * be read in from the ELCR */ 1062 * be read in from the ELCR */
1073 1063
1074#define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].mp_srcbusirq)) 1064#define default_EISA_trigger(idx) (EISA_ELCR(mp_irqs[idx].srcbusirq))
1075#define default_EISA_polarity(idx) default_ISA_polarity(idx) 1065#define default_EISA_polarity(idx) default_ISA_polarity(idx)
1076 1066
1077/* PCI interrupts are always polarity one level triggered, 1067/* PCI interrupts are always polarity one level triggered,
@@ -1088,13 +1078,13 @@ static int EISA_ELCR(unsigned int irq)
1088 1078
1089static int MPBIOS_polarity(int idx) 1079static int MPBIOS_polarity(int idx)
1090{ 1080{
1091 int bus = mp_irqs[idx].mp_srcbus; 1081 int bus = mp_irqs[idx].srcbus;
1092 int polarity; 1082 int polarity;
1093 1083
1094 /* 1084 /*
1095 * Determine IRQ line polarity (high active or low active): 1085 * Determine IRQ line polarity (high active or low active):
1096 */ 1086 */
1097 switch (mp_irqs[idx].mp_irqflag & 3) 1087 switch (mp_irqs[idx].irqflag & 3)
1098 { 1088 {
1099 case 0: /* conforms, ie. bus-type dependent polarity */ 1089 case 0: /* conforms, ie. bus-type dependent polarity */
1100 if (test_bit(bus, mp_bus_not_pci)) 1090 if (test_bit(bus, mp_bus_not_pci))
@@ -1130,13 +1120,13 @@ static int MPBIOS_polarity(int idx)
1130 1120
1131static int MPBIOS_trigger(int idx) 1121static int MPBIOS_trigger(int idx)
1132{ 1122{
1133 int bus = mp_irqs[idx].mp_srcbus; 1123 int bus = mp_irqs[idx].srcbus;
1134 int trigger; 1124 int trigger;
1135 1125
1136 /* 1126 /*
1137 * Determine IRQ trigger mode (edge or level sensitive): 1127 * Determine IRQ trigger mode (edge or level sensitive):
1138 */ 1128 */
1139 switch ((mp_irqs[idx].mp_irqflag>>2) & 3) 1129 switch ((mp_irqs[idx].irqflag>>2) & 3)
1140 { 1130 {
1141 case 0: /* conforms, ie. bus-type dependent */ 1131 case 0: /* conforms, ie. bus-type dependent */
1142 if (test_bit(bus, mp_bus_not_pci)) 1132 if (test_bit(bus, mp_bus_not_pci))
@@ -1214,16 +1204,16 @@ int (*ioapic_renumber_irq)(int ioapic, int irq);
1214static int pin_2_irq(int idx, int apic, int pin) 1204static int pin_2_irq(int idx, int apic, int pin)
1215{ 1205{
1216 int irq, i; 1206 int irq, i;
1217 int bus = mp_irqs[idx].mp_srcbus; 1207 int bus = mp_irqs[idx].srcbus;
1218 1208
1219 /* 1209 /*
1220 * Debugging check, we are in big trouble if this message pops up! 1210 * Debugging check, we are in big trouble if this message pops up!
1221 */ 1211 */
1222 if (mp_irqs[idx].mp_dstirq != pin) 1212 if (mp_irqs[idx].dstirq != pin)
1223 printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); 1213 printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n");
1224 1214
1225 if (test_bit(bus, mp_bus_not_pci)) { 1215 if (test_bit(bus, mp_bus_not_pci)) {
1226 irq = mp_irqs[idx].mp_srcbusirq; 1216 irq = mp_irqs[idx].srcbusirq;
1227 } else { 1217 } else {
1228 /* 1218 /*
1229 * PCI IRQs are mapped in order 1219 * PCI IRQs are mapped in order
@@ -1315,7 +1305,7 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1315 int new_cpu; 1305 int new_cpu;
1316 int vector, offset; 1306 int vector, offset;
1317 1307
1318 vector_allocation_domain(cpu, tmp_mask); 1308 apic->vector_allocation_domain(cpu, tmp_mask);
1319 1309
1320 vector = current_vector; 1310 vector = current_vector;
1321 offset = current_offset; 1311 offset = current_offset;
@@ -1485,10 +1475,10 @@ static void ioapic_register_intr(int irq, struct irq_desc *desc, unsigned long t
1485 handle_edge_irq, "edge"); 1475 handle_edge_irq, "edge");
1486} 1476}
1487 1477
1488static int setup_ioapic_entry(int apic, int irq, 1478int setup_ioapic_entry(int apic_id, int irq,
1489 struct IO_APIC_route_entry *entry, 1479 struct IO_APIC_route_entry *entry,
1490 unsigned int destination, int trigger, 1480 unsigned int destination, int trigger,
1491 int polarity, int vector) 1481 int polarity, int vector)
1492{ 1482{
1493 /* 1483 /*
1494 * add it to the IO-APIC irq-routing table: 1484 * add it to the IO-APIC irq-routing table:
@@ -1497,25 +1487,25 @@ static int setup_ioapic_entry(int apic, int irq,
1497 1487
1498#ifdef CONFIG_INTR_REMAP 1488#ifdef CONFIG_INTR_REMAP
1499 if (intr_remapping_enabled) { 1489 if (intr_remapping_enabled) {
1500 struct intel_iommu *iommu = map_ioapic_to_ir(apic); 1490 struct intel_iommu *iommu = map_ioapic_to_ir(apic_id);
1501 struct irte irte; 1491 struct irte irte;
1502 struct IR_IO_APIC_route_entry *ir_entry = 1492 struct IR_IO_APIC_route_entry *ir_entry =
1503 (struct IR_IO_APIC_route_entry *) entry; 1493 (struct IR_IO_APIC_route_entry *) entry;
1504 int index; 1494 int index;
1505 1495
1506 if (!iommu) 1496 if (!iommu)
1507 panic("No mapping iommu for ioapic %d\n", apic); 1497 panic("No mapping iommu for ioapic %d\n", apic_id);
1508 1498
1509 index = alloc_irte(iommu, irq, 1); 1499 index = alloc_irte(iommu, irq, 1);
1510 if (index < 0) 1500 if (index < 0)
1511 panic("Failed to allocate IRTE for ioapic %d\n", apic); 1501 panic("Failed to allocate IRTE for ioapic %d\n", apic_id);
1512 1502
1513 memset(&irte, 0, sizeof(irte)); 1503 memset(&irte, 0, sizeof(irte));
1514 1504
1515 irte.present = 1; 1505 irte.present = 1;
1516 irte.dst_mode = INT_DEST_MODE; 1506 irte.dst_mode = apic->irq_dest_mode;
1517 irte.trigger_mode = trigger; 1507 irte.trigger_mode = trigger;
1518 irte.dlvry_mode = INT_DELIVERY_MODE; 1508 irte.dlvry_mode = apic->irq_delivery_mode;
1519 irte.vector = vector; 1509 irte.vector = vector;
1520 irte.dest_id = IRTE_DEST(destination); 1510 irte.dest_id = IRTE_DEST(destination);
1521 1511
@@ -1528,8 +1518,8 @@ static int setup_ioapic_entry(int apic, int irq,
1528 } else 1518 } else
1529#endif 1519#endif
1530 { 1520 {
1531 entry->delivery_mode = INT_DELIVERY_MODE; 1521 entry->delivery_mode = apic->irq_delivery_mode;
1532 entry->dest_mode = INT_DEST_MODE; 1522 entry->dest_mode = apic->irq_dest_mode;
1533 entry->dest = destination; 1523 entry->dest = destination;
1534 } 1524 }
1535 1525
@@ -1546,7 +1536,7 @@ static int setup_ioapic_entry(int apic, int irq,
1546 return 0; 1536 return 0;
1547} 1537}
1548 1538
1549static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_desc *desc, 1539static void setup_IO_APIC_irq(int apic_id, int pin, unsigned int irq, struct irq_desc *desc,
1550 int trigger, int polarity) 1540 int trigger, int polarity)
1551{ 1541{
1552 struct irq_cfg *cfg; 1542 struct irq_cfg *cfg;
@@ -1558,22 +1548,22 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1558 1548
1559 cfg = desc->chip_data; 1549 cfg = desc->chip_data;
1560 1550
1561 if (assign_irq_vector(irq, cfg, TARGET_CPUS)) 1551 if (assign_irq_vector(irq, cfg, apic->target_cpus()))
1562 return; 1552 return;
1563 1553
1564 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); 1554 dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
1565 1555
1566 apic_printk(APIC_VERBOSE,KERN_DEBUG 1556 apic_printk(APIC_VERBOSE,KERN_DEBUG
1567 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " 1557 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
1568 "IRQ %d Mode:%i Active:%i)\n", 1558 "IRQ %d Mode:%i Active:%i)\n",
1569 apic, mp_ioapics[apic].mp_apicid, pin, cfg->vector, 1559 apic_id, mp_ioapics[apic_id].apicid, pin, cfg->vector,
1570 irq, trigger, polarity); 1560 irq, trigger, polarity);
1571 1561
1572 1562
1573 if (setup_ioapic_entry(mp_ioapics[apic].mp_apicid, irq, &entry, 1563 if (setup_ioapic_entry(mp_ioapics[apic_id].apicid, irq, &entry,
1574 dest, trigger, polarity, cfg->vector)) { 1564 dest, trigger, polarity, cfg->vector)) {
1575 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n", 1565 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n",
1576 mp_ioapics[apic].mp_apicid, pin); 1566 mp_ioapics[apic_id].apicid, pin);
1577 __clear_irq_vector(irq, cfg); 1567 __clear_irq_vector(irq, cfg);
1578 return; 1568 return;
1579 } 1569 }
@@ -1582,12 +1572,12 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1582 if (irq < NR_IRQS_LEGACY) 1572 if (irq < NR_IRQS_LEGACY)
1583 disable_8259A_irq(irq); 1573 disable_8259A_irq(irq);
1584 1574
1585 ioapic_write_entry(apic, pin, entry); 1575 ioapic_write_entry(apic_id, pin, entry);
1586} 1576}
1587 1577
1588static void __init setup_IO_APIC_irqs(void) 1578static void __init setup_IO_APIC_irqs(void)
1589{ 1579{
1590 int apic, pin, idx, irq; 1580 int apic_id, pin, idx, irq;
1591 int notcon = 0; 1581 int notcon = 0;
1592 struct irq_desc *desc; 1582 struct irq_desc *desc;
1593 struct irq_cfg *cfg; 1583 struct irq_cfg *cfg;
@@ -1595,21 +1585,19 @@ static void __init setup_IO_APIC_irqs(void)
1595 1585
1596 apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n"); 1586 apic_printk(APIC_VERBOSE, KERN_DEBUG "init IO_APIC IRQs\n");
1597 1587
1598 for (apic = 0; apic < nr_ioapics; apic++) { 1588 for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
1599 for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { 1589 for (pin = 0; pin < nr_ioapic_registers[apic_id]; pin++) {
1600 1590
1601 idx = find_irq_entry(apic, pin, mp_INT); 1591 idx = find_irq_entry(apic_id, pin, mp_INT);
1602 if (idx == -1) { 1592 if (idx == -1) {
1603 if (!notcon) { 1593 if (!notcon) {
1604 notcon = 1; 1594 notcon = 1;
1605 apic_printk(APIC_VERBOSE, 1595 apic_printk(APIC_VERBOSE,
1606 KERN_DEBUG " %d-%d", 1596 KERN_DEBUG " %d-%d",
1607 mp_ioapics[apic].mp_apicid, 1597 mp_ioapics[apic_id].apicid, pin);
1608 pin);
1609 } else 1598 } else
1610 apic_printk(APIC_VERBOSE, " %d-%d", 1599 apic_printk(APIC_VERBOSE, " %d-%d",
1611 mp_ioapics[apic].mp_apicid, 1600 mp_ioapics[apic_id].apicid, pin);
1612 pin);
1613 continue; 1601 continue;
1614 } 1602 }
1615 if (notcon) { 1603 if (notcon) {
@@ -1618,20 +1606,25 @@ static void __init setup_IO_APIC_irqs(void)
1618 notcon = 0; 1606 notcon = 0;
1619 } 1607 }
1620 1608
1621 irq = pin_2_irq(idx, apic, pin); 1609 irq = pin_2_irq(idx, apic_id, pin);
1622#ifdef CONFIG_X86_32 1610
1623 if (multi_timer_check(apic, irq)) 1611 /*
1612 * Skip the timer IRQ if there's a quirk handler
1613 * installed and if it returns 1:
1614 */
1615 if (apic->multi_timer_check &&
1616 apic->multi_timer_check(apic_id, irq))
1624 continue; 1617 continue;
1625#endif 1618
1626 desc = irq_to_desc_alloc_cpu(irq, cpu); 1619 desc = irq_to_desc_alloc_cpu(irq, cpu);
1627 if (!desc) { 1620 if (!desc) {
1628 printk(KERN_INFO "can not get irq_desc for %d\n", irq); 1621 printk(KERN_INFO "can not get irq_desc for %d\n", irq);
1629 continue; 1622 continue;
1630 } 1623 }
1631 cfg = desc->chip_data; 1624 cfg = desc->chip_data;
1632 add_pin_to_irq_cpu(cfg, cpu, apic, pin); 1625 add_pin_to_irq_cpu(cfg, cpu, apic_id, pin);
1633 1626
1634 setup_IO_APIC_irq(apic, pin, irq, desc, 1627 setup_IO_APIC_irq(apic_id, pin, irq, desc,
1635 irq_trigger(idx), irq_polarity(idx)); 1628 irq_trigger(idx), irq_polarity(idx));
1636 } 1629 }
1637 } 1630 }
@@ -1644,7 +1637,7 @@ static void __init setup_IO_APIC_irqs(void)
1644/* 1637/*
1645 * Set up the timer pin, possibly with the 8259A-master behind. 1638 * Set up the timer pin, possibly with the 8259A-master behind.
1646 */ 1639 */
1647static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, 1640static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
1648 int vector) 1641 int vector)
1649{ 1642{
1650 struct IO_APIC_route_entry entry; 1643 struct IO_APIC_route_entry entry;
@@ -1660,10 +1653,10 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
1660 * We use logical delivery to get the timer IRQ 1653 * We use logical delivery to get the timer IRQ
1661 * to the first CPU. 1654 * to the first CPU.
1662 */ 1655 */
1663 entry.dest_mode = INT_DEST_MODE; 1656 entry.dest_mode = apic->irq_dest_mode;
1664 entry.mask = 1; /* mask IRQ now */ 1657 entry.mask = 0; /* don't mask IRQ for edge */
1665 entry.dest = cpu_mask_to_apicid(TARGET_CPUS); 1658 entry.dest = apic->cpu_mask_to_apicid(apic->target_cpus());
1666 entry.delivery_mode = INT_DELIVERY_MODE; 1659 entry.delivery_mode = apic->irq_delivery_mode;
1667 entry.polarity = 0; 1660 entry.polarity = 0;
1668 entry.trigger = 0; 1661 entry.trigger = 0;
1669 entry.vector = vector; 1662 entry.vector = vector;
@@ -1677,7 +1670,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
1677 /* 1670 /*
1678 * Add it to the IO-APIC irq-routing table: 1671 * Add it to the IO-APIC irq-routing table:
1679 */ 1672 */
1680 ioapic_write_entry(apic, pin, entry); 1673 ioapic_write_entry(apic_id, pin, entry);
1681} 1674}
1682 1675
1683 1676
@@ -1699,7 +1692,7 @@ __apicdebuginit(void) print_IO_APIC(void)
1699 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1692 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
1700 for (i = 0; i < nr_ioapics; i++) 1693 for (i = 0; i < nr_ioapics; i++)
1701 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", 1694 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
1702 mp_ioapics[i].mp_apicid, nr_ioapic_registers[i]); 1695 mp_ioapics[i].apicid, nr_ioapic_registers[i]);
1703 1696
1704 /* 1697 /*
1705 * We are a bit conservative about what we expect. We have to 1698 * We are a bit conservative about what we expect. We have to
@@ -1719,7 +1712,7 @@ __apicdebuginit(void) print_IO_APIC(void)
1719 spin_unlock_irqrestore(&ioapic_lock, flags); 1712 spin_unlock_irqrestore(&ioapic_lock, flags);
1720 1713
1721 printk("\n"); 1714 printk("\n");
1722 printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].mp_apicid); 1715 printk(KERN_DEBUG "IO APIC #%d......\n", mp_ioapics[apic].apicid);
1723 printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw); 1716 printk(KERN_DEBUG ".... register #00: %08X\n", reg_00.raw);
1724 printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID); 1717 printk(KERN_DEBUG "....... : physical APIC id: %02X\n", reg_00.bits.ID);
1725 printk(KERN_DEBUG "....... : Delivery Type: %X\n", reg_00.bits.delivery_type); 1718 printk(KERN_DEBUG "....... : Delivery Type: %X\n", reg_00.bits.delivery_type);
@@ -1980,13 +1973,6 @@ void __init enable_IO_APIC(void)
1980 int apic; 1973 int apic;
1981 unsigned long flags; 1974 unsigned long flags;
1982 1975
1983#ifdef CONFIG_X86_32
1984 int i;
1985 if (!pirqs_enabled)
1986 for (i = 0; i < MAX_PIRQS; i++)
1987 pirq_entries[i] = -1;
1988#endif
1989
1990 /* 1976 /*
1991 * The number of IO-APIC IRQ registers (== #pins): 1977 * The number of IO-APIC IRQ registers (== #pins):
1992 */ 1978 */
@@ -2090,7 +2076,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
2090{ 2076{
2091 union IO_APIC_reg_00 reg_00; 2077 union IO_APIC_reg_00 reg_00;
2092 physid_mask_t phys_id_present_map; 2078 physid_mask_t phys_id_present_map;
2093 int apic; 2079 int apic_id;
2094 int i; 2080 int i;
2095 unsigned char old_id; 2081 unsigned char old_id;
2096 unsigned long flags; 2082 unsigned long flags;
@@ -2109,26 +2095,26 @@ static void __init setup_ioapic_ids_from_mpc(void)
2109 * This is broken; anything with a real cpu count has to 2095 * This is broken; anything with a real cpu count has to
2110 * circumvent this idiocy regardless. 2096 * circumvent this idiocy regardless.
2111 */ 2097 */
2112 phys_id_present_map = ioapic_phys_id_map(phys_cpu_present_map); 2098 phys_id_present_map = apic->ioapic_phys_id_map(phys_cpu_present_map);
2113 2099
2114 /* 2100 /*
2115 * Set the IOAPIC ID to the value stored in the MPC table. 2101 * Set the IOAPIC ID to the value stored in the MPC table.
2116 */ 2102 */
2117 for (apic = 0; apic < nr_ioapics; apic++) { 2103 for (apic_id = 0; apic_id < nr_ioapics; apic_id++) {
2118 2104
2119 /* Read the register 0 value */ 2105 /* Read the register 0 value */
2120 spin_lock_irqsave(&ioapic_lock, flags); 2106 spin_lock_irqsave(&ioapic_lock, flags);
2121 reg_00.raw = io_apic_read(apic, 0); 2107 reg_00.raw = io_apic_read(apic_id, 0);
2122 spin_unlock_irqrestore(&ioapic_lock, flags); 2108 spin_unlock_irqrestore(&ioapic_lock, flags);
2123 2109
2124 old_id = mp_ioapics[apic].mp_apicid; 2110 old_id = mp_ioapics[apic_id].apicid;
2125 2111
2126 if (mp_ioapics[apic].mp_apicid >= get_physical_broadcast()) { 2112 if (mp_ioapics[apic_id].apicid >= get_physical_broadcast()) {
2127 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", 2113 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
2128 apic, mp_ioapics[apic].mp_apicid); 2114 apic_id, mp_ioapics[apic_id].apicid);
2129 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", 2115 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
2130 reg_00.bits.ID); 2116 reg_00.bits.ID);
2131 mp_ioapics[apic].mp_apicid = reg_00.bits.ID; 2117 mp_ioapics[apic_id].apicid = reg_00.bits.ID;
2132 } 2118 }
2133 2119
2134 /* 2120 /*
@@ -2136,10 +2122,10 @@ static void __init setup_ioapic_ids_from_mpc(void)
2136 * system must have a unique ID or we get lots of nice 2122 * system must have a unique ID or we get lots of nice
2137 * 'stuck on smp_invalidate_needed IPI wait' messages. 2123 * 'stuck on smp_invalidate_needed IPI wait' messages.
2138 */ 2124 */
2139 if (check_apicid_used(phys_id_present_map, 2125 if (apic->check_apicid_used(phys_id_present_map,
2140 mp_ioapics[apic].mp_apicid)) { 2126 mp_ioapics[apic_id].apicid)) {
2141 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", 2127 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
2142 apic, mp_ioapics[apic].mp_apicid); 2128 apic_id, mp_ioapics[apic_id].apicid);
2143 for (i = 0; i < get_physical_broadcast(); i++) 2129 for (i = 0; i < get_physical_broadcast(); i++)
2144 if (!physid_isset(i, phys_id_present_map)) 2130 if (!physid_isset(i, phys_id_present_map))
2145 break; 2131 break;
@@ -2148,13 +2134,13 @@ static void __init setup_ioapic_ids_from_mpc(void)
2148 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", 2134 printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
2149 i); 2135 i);
2150 physid_set(i, phys_id_present_map); 2136 physid_set(i, phys_id_present_map);
2151 mp_ioapics[apic].mp_apicid = i; 2137 mp_ioapics[apic_id].apicid = i;
2152 } else { 2138 } else {
2153 physid_mask_t tmp; 2139 physid_mask_t tmp;
2154 tmp = apicid_to_cpu_present(mp_ioapics[apic].mp_apicid); 2140 tmp = apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid);
2155 apic_printk(APIC_VERBOSE, "Setting %d in the " 2141 apic_printk(APIC_VERBOSE, "Setting %d in the "
2156 "phys_id_present_map\n", 2142 "phys_id_present_map\n",
2157 mp_ioapics[apic].mp_apicid); 2143 mp_ioapics[apic_id].apicid);
2158 physids_or(phys_id_present_map, phys_id_present_map, tmp); 2144 physids_or(phys_id_present_map, phys_id_present_map, tmp);
2159 } 2145 }
2160 2146
@@ -2163,11 +2149,11 @@ static void __init setup_ioapic_ids_from_mpc(void)
2163 * We need to adjust the IRQ routing table 2149 * We need to adjust the IRQ routing table
2164 * if the ID changed. 2150 * if the ID changed.
2165 */ 2151 */
2166 if (old_id != mp_ioapics[apic].mp_apicid) 2152 if (old_id != mp_ioapics[apic_id].apicid)
2167 for (i = 0; i < mp_irq_entries; i++) 2153 for (i = 0; i < mp_irq_entries; i++)
2168 if (mp_irqs[i].mp_dstapic == old_id) 2154 if (mp_irqs[i].dstapic == old_id)
2169 mp_irqs[i].mp_dstapic 2155 mp_irqs[i].dstapic
2170 = mp_ioapics[apic].mp_apicid; 2156 = mp_ioapics[apic_id].apicid;
2171 2157
2172 /* 2158 /*
2173 * Read the right value from the MPC table and 2159 * Read the right value from the MPC table and
@@ -2175,20 +2161,20 @@ static void __init setup_ioapic_ids_from_mpc(void)
2175 */ 2161 */
2176 apic_printk(APIC_VERBOSE, KERN_INFO 2162 apic_printk(APIC_VERBOSE, KERN_INFO
2177 "...changing IO-APIC physical APIC ID to %d ...", 2163 "...changing IO-APIC physical APIC ID to %d ...",
2178 mp_ioapics[apic].mp_apicid); 2164 mp_ioapics[apic_id].apicid);
2179 2165
2180 reg_00.bits.ID = mp_ioapics[apic].mp_apicid; 2166 reg_00.bits.ID = mp_ioapics[apic_id].apicid;
2181 spin_lock_irqsave(&ioapic_lock, flags); 2167 spin_lock_irqsave(&ioapic_lock, flags);
2182 io_apic_write(apic, 0, reg_00.raw); 2168 io_apic_write(apic_id, 0, reg_00.raw);
2183 spin_unlock_irqrestore(&ioapic_lock, flags); 2169 spin_unlock_irqrestore(&ioapic_lock, flags);
2184 2170
2185 /* 2171 /*
2186 * Sanity check 2172 * Sanity check
2187 */ 2173 */
2188 spin_lock_irqsave(&ioapic_lock, flags); 2174 spin_lock_irqsave(&ioapic_lock, flags);
2189 reg_00.raw = io_apic_read(apic, 0); 2175 reg_00.raw = io_apic_read(apic_id, 0);
2190 spin_unlock_irqrestore(&ioapic_lock, flags); 2176 spin_unlock_irqrestore(&ioapic_lock, flags);
2191 if (reg_00.bits.ID != mp_ioapics[apic].mp_apicid) 2177 if (reg_00.bits.ID != mp_ioapics[apic_id].apicid)
2192 printk("could not set ID!\n"); 2178 printk("could not set ID!\n");
2193 else 2179 else
2194 apic_printk(APIC_VERBOSE, " ok.\n"); 2180 apic_printk(APIC_VERBOSE, " ok.\n");
@@ -2291,7 +2277,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
2291 unsigned long flags; 2277 unsigned long flags;
2292 2278
2293 spin_lock_irqsave(&vector_lock, flags); 2279 spin_lock_irqsave(&vector_lock, flags);
2294 send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector); 2280 apic->send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector);
2295 spin_unlock_irqrestore(&vector_lock, flags); 2281 spin_unlock_irqrestore(&vector_lock, flags);
2296 2282
2297 return 1; 2283 return 1;
@@ -2299,7 +2285,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
2299#else 2285#else
2300static int ioapic_retrigger_irq(unsigned int irq) 2286static int ioapic_retrigger_irq(unsigned int irq)
2301{ 2287{
2302 send_IPI_self(irq_cfg(irq)->vector); 2288 apic->send_IPI_self(irq_cfg(irq)->vector);
2303 2289
2304 return 1; 2290 return 1;
2305} 2291}
@@ -2363,7 +2349,7 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
2363 2349
2364 set_extra_move_desc(desc, mask); 2350 set_extra_move_desc(desc, mask);
2365 2351
2366 dest = cpu_mask_to_apicid_and(cfg->domain, mask); 2352 dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask);
2367 2353
2368 modify_ioapic_rte = desc->status & IRQ_LEVEL; 2354 modify_ioapic_rte = desc->status & IRQ_LEVEL;
2369 if (modify_ioapic_rte) { 2355 if (modify_ioapic_rte) {
@@ -2383,7 +2369,7 @@ migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
2383 if (cfg->move_in_progress) 2369 if (cfg->move_in_progress)
2384 send_cleanup_vector(cfg); 2370 send_cleanup_vector(cfg);
2385 2371
2386 cpumask_copy(&desc->affinity, mask); 2372 cpumask_copy(desc->affinity, mask);
2387} 2373}
2388 2374
2389static int migrate_irq_remapped_level_desc(struct irq_desc *desc) 2375static int migrate_irq_remapped_level_desc(struct irq_desc *desc)
@@ -2405,11 +2391,11 @@ static int migrate_irq_remapped_level_desc(struct irq_desc *desc)
2405 } 2391 }
2406 2392
2407 /* everthing is clear. we have right of way */ 2393 /* everthing is clear. we have right of way */
2408 migrate_ioapic_irq_desc(desc, &desc->pending_mask); 2394 migrate_ioapic_irq_desc(desc, desc->pending_mask);
2409 2395
2410 ret = 0; 2396 ret = 0;
2411 desc->status &= ~IRQ_MOVE_PENDING; 2397 desc->status &= ~IRQ_MOVE_PENDING;
2412 cpumask_clear(&desc->pending_mask); 2398 cpumask_clear(desc->pending_mask);
2413 2399
2414unmask: 2400unmask:
2415 unmask_IO_APIC_irq_desc(desc); 2401 unmask_IO_APIC_irq_desc(desc);
@@ -2434,7 +2420,7 @@ static void ir_irq_migration(struct work_struct *work)
2434 continue; 2420 continue;
2435 } 2421 }
2436 2422
2437 desc->chip->set_affinity(irq, &desc->pending_mask); 2423 desc->chip->set_affinity(irq, desc->pending_mask);
2438 spin_unlock_irqrestore(&desc->lock, flags); 2424 spin_unlock_irqrestore(&desc->lock, flags);
2439 } 2425 }
2440 } 2426 }
@@ -2448,7 +2434,7 @@ static void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc,
2448{ 2434{
2449 if (desc->status & IRQ_LEVEL) { 2435 if (desc->status & IRQ_LEVEL) {
2450 desc->status |= IRQ_MOVE_PENDING; 2436 desc->status |= IRQ_MOVE_PENDING;
2451 cpumask_copy(&desc->pending_mask, mask); 2437 cpumask_copy(desc->pending_mask, mask);
2452 migrate_irq_remapped_level_desc(desc); 2438 migrate_irq_remapped_level_desc(desc);
2453 return; 2439 return;
2454 } 2440 }
@@ -2516,7 +2502,7 @@ static void irq_complete_move(struct irq_desc **descp)
2516 2502
2517 /* domain has not changed, but affinity did */ 2503 /* domain has not changed, but affinity did */
2518 me = smp_processor_id(); 2504 me = smp_processor_id();
2519 if (cpu_isset(me, desc->affinity)) { 2505 if (cpumask_test_cpu(me, desc->affinity)) {
2520 *descp = desc = move_irq_desc(desc, me); 2506 *descp = desc = move_irq_desc(desc, me);
2521 /* get the new one */ 2507 /* get the new one */
2522 cfg = desc->chip_data; 2508 cfg = desc->chip_data;
@@ -2867,19 +2853,15 @@ static inline void __init check_timer(void)
2867 int cpu = boot_cpu_id; 2853 int cpu = boot_cpu_id;
2868 int apic1, pin1, apic2, pin2; 2854 int apic1, pin1, apic2, pin2;
2869 unsigned long flags; 2855 unsigned long flags;
2870 unsigned int ver;
2871 int no_pin1 = 0; 2856 int no_pin1 = 0;
2872 2857
2873 local_irq_save(flags); 2858 local_irq_save(flags);
2874 2859
2875 ver = apic_read(APIC_LVR);
2876 ver = GET_APIC_VERSION(ver);
2877
2878 /* 2860 /*
2879 * get/set the timer IRQ vector: 2861 * get/set the timer IRQ vector:
2880 */ 2862 */
2881 disable_8259A_irq(0); 2863 disable_8259A_irq(0);
2882 assign_irq_vector(0, cfg, TARGET_CPUS); 2864 assign_irq_vector(0, cfg, apic->target_cpus());
2883 2865
2884 /* 2866 /*
2885 * As IRQ0 is to be enabled in the 8259A, the virtual 2867 * As IRQ0 is to be enabled in the 8259A, the virtual
@@ -2893,7 +2875,13 @@ static inline void __init check_timer(void)
2893 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2875 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
2894 init_8259A(1); 2876 init_8259A(1);
2895#ifdef CONFIG_X86_32 2877#ifdef CONFIG_X86_32
2896 timer_ack = (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver)); 2878 {
2879 unsigned int ver;
2880
2881 ver = apic_read(APIC_LVR);
2882 ver = GET_APIC_VERSION(ver);
2883 timer_ack = (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
2884 }
2897#endif 2885#endif
2898 2886
2899 pin1 = find_isa_irq_pin(0, mp_INT); 2887 pin1 = find_isa_irq_pin(0, mp_INT);
@@ -2932,8 +2920,17 @@ static inline void __init check_timer(void)
2932 if (no_pin1) { 2920 if (no_pin1) {
2933 add_pin_to_irq_cpu(cfg, cpu, apic1, pin1); 2921 add_pin_to_irq_cpu(cfg, cpu, apic1, pin1);
2934 setup_timer_IRQ0_pin(apic1, pin1, cfg->vector); 2922 setup_timer_IRQ0_pin(apic1, pin1, cfg->vector);
2923 } else {
2924 /* for edge trigger, setup_IO_APIC_irq already
2925 * leave it unmasked.
2926 * so only need to unmask if it is level-trigger
2927 * do we really have level trigger timer?
2928 */
2929 int idx;
2930 idx = find_irq_entry(apic1, pin1, mp_INT);
2931 if (idx != -1 && irq_trigger(idx))
2932 unmask_IO_APIC_irq_desc(desc);
2935 } 2933 }
2936 unmask_IO_APIC_irq_desc(desc);
2937 if (timer_irq_works()) { 2934 if (timer_irq_works()) {
2938 if (nmi_watchdog == NMI_IO_APIC) { 2935 if (nmi_watchdog == NMI_IO_APIC) {
2939 setup_nmi(); 2936 setup_nmi();
@@ -2947,6 +2944,7 @@ static inline void __init check_timer(void)
2947 if (intr_remapping_enabled) 2944 if (intr_remapping_enabled)
2948 panic("timer doesn't work through Interrupt-remapped IO-APIC"); 2945 panic("timer doesn't work through Interrupt-remapped IO-APIC");
2949#endif 2946#endif
2947 local_irq_disable();
2950 clear_IO_APIC_pin(apic1, pin1); 2948 clear_IO_APIC_pin(apic1, pin1);
2951 if (!no_pin1) 2949 if (!no_pin1)
2952 apic_printk(APIC_QUIET, KERN_ERR "..MP-BIOS bug: " 2950 apic_printk(APIC_QUIET, KERN_ERR "..MP-BIOS bug: "
@@ -2961,7 +2959,6 @@ static inline void __init check_timer(void)
2961 */ 2959 */
2962 replace_pin_at_irq_cpu(cfg, cpu, apic1, pin1, apic2, pin2); 2960 replace_pin_at_irq_cpu(cfg, cpu, apic1, pin1, apic2, pin2);
2963 setup_timer_IRQ0_pin(apic2, pin2, cfg->vector); 2961 setup_timer_IRQ0_pin(apic2, pin2, cfg->vector);
2964 unmask_IO_APIC_irq_desc(desc);
2965 enable_8259A_irq(0); 2962 enable_8259A_irq(0);
2966 if (timer_irq_works()) { 2963 if (timer_irq_works()) {
2967 apic_printk(APIC_QUIET, KERN_INFO "....... works.\n"); 2964 apic_printk(APIC_QUIET, KERN_INFO "....... works.\n");
@@ -2976,6 +2973,7 @@ static inline void __init check_timer(void)
2976 /* 2973 /*
2977 * Cleanup, just in case ... 2974 * Cleanup, just in case ...
2978 */ 2975 */
2976 local_irq_disable();
2979 disable_8259A_irq(0); 2977 disable_8259A_irq(0);
2980 clear_IO_APIC_pin(apic2, pin2); 2978 clear_IO_APIC_pin(apic2, pin2);
2981 apic_printk(APIC_QUIET, KERN_INFO "....... failed.\n"); 2979 apic_printk(APIC_QUIET, KERN_INFO "....... failed.\n");
@@ -3001,6 +2999,7 @@ static inline void __init check_timer(void)
3001 apic_printk(APIC_QUIET, KERN_INFO "..... works.\n"); 2999 apic_printk(APIC_QUIET, KERN_INFO "..... works.\n");
3002 goto out; 3000 goto out;
3003 } 3001 }
3002 local_irq_disable();
3004 disable_8259A_irq(0); 3003 disable_8259A_irq(0);
3005 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector); 3004 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector);
3006 apic_printk(APIC_QUIET, KERN_INFO "..... failed.\n"); 3005 apic_printk(APIC_QUIET, KERN_INFO "..... failed.\n");
@@ -3018,6 +3017,7 @@ static inline void __init check_timer(void)
3018 apic_printk(APIC_QUIET, KERN_INFO "..... works.\n"); 3017 apic_printk(APIC_QUIET, KERN_INFO "..... works.\n");
3019 goto out; 3018 goto out;
3020 } 3019 }
3020 local_irq_disable();
3021 apic_printk(APIC_QUIET, KERN_INFO "..... failed :(.\n"); 3021 apic_printk(APIC_QUIET, KERN_INFO "..... failed :(.\n");
3022 panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a " 3022 panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a "
3023 "report. Then try booting with the 'noapic' option.\n"); 3023 "report. Then try booting with the 'noapic' option.\n");
@@ -3047,13 +3047,9 @@ out:
3047void __init setup_IO_APIC(void) 3047void __init setup_IO_APIC(void)
3048{ 3048{
3049 3049
3050#ifdef CONFIG_X86_32
3051 enable_IO_APIC();
3052#else
3053 /* 3050 /*
3054 * calling enable_IO_APIC() is moved to setup_local_APIC for BP 3051 * calling enable_IO_APIC() is moved to setup_local_APIC for BP
3055 */ 3052 */
3056#endif
3057 3053
3058 io_apic_irqs = ~PIC_IRQS; 3054 io_apic_irqs = ~PIC_IRQS;
3059 3055
@@ -3118,8 +3114,8 @@ static int ioapic_resume(struct sys_device *dev)
3118 3114
3119 spin_lock_irqsave(&ioapic_lock, flags); 3115 spin_lock_irqsave(&ioapic_lock, flags);
3120 reg_00.raw = io_apic_read(dev->id, 0); 3116 reg_00.raw = io_apic_read(dev->id, 0);
3121 if (reg_00.bits.ID != mp_ioapics[dev->id].mp_apicid) { 3117 if (reg_00.bits.ID != mp_ioapics[dev->id].apicid) {
3122 reg_00.bits.ID = mp_ioapics[dev->id].mp_apicid; 3118 reg_00.bits.ID = mp_ioapics[dev->id].apicid;
3123 io_apic_write(dev->id, 0, reg_00.raw); 3119 io_apic_write(dev->id, 0, reg_00.raw);
3124 } 3120 }
3125 spin_unlock_irqrestore(&ioapic_lock, flags); 3121 spin_unlock_irqrestore(&ioapic_lock, flags);
@@ -3169,6 +3165,7 @@ static int __init ioapic_init_sysfs(void)
3169 3165
3170device_initcall(ioapic_init_sysfs); 3166device_initcall(ioapic_init_sysfs);
3171 3167
3168static int nr_irqs_gsi = NR_IRQS_LEGACY;
3172/* 3169/*
3173 * Dynamic irq allocate and deallocation 3170 * Dynamic irq allocate and deallocation
3174 */ 3171 */
@@ -3183,11 +3180,11 @@ unsigned int create_irq_nr(unsigned int irq_want)
3183 struct irq_desc *desc_new = NULL; 3180 struct irq_desc *desc_new = NULL;
3184 3181
3185 irq = 0; 3182 irq = 0;
3186 spin_lock_irqsave(&vector_lock, flags); 3183 if (irq_want < nr_irqs_gsi)
3187 for (new = irq_want; new < NR_IRQS; new++) { 3184 irq_want = nr_irqs_gsi;
3188 if (platform_legacy_irq(new))
3189 continue;
3190 3185
3186 spin_lock_irqsave(&vector_lock, flags);
3187 for (new = irq_want; new < nr_irqs; new++) {
3191 desc_new = irq_to_desc_alloc_cpu(new, cpu); 3188 desc_new = irq_to_desc_alloc_cpu(new, cpu);
3192 if (!desc_new) { 3189 if (!desc_new) {
3193 printk(KERN_INFO "can not get irq_desc for %d\n", new); 3190 printk(KERN_INFO "can not get irq_desc for %d\n", new);
@@ -3197,7 +3194,7 @@ unsigned int create_irq_nr(unsigned int irq_want)
3197 3194
3198 if (cfg_new->vector != 0) 3195 if (cfg_new->vector != 0)
3199 continue; 3196 continue;
3200 if (__assign_irq_vector(new, cfg_new, TARGET_CPUS) == 0) 3197 if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
3201 irq = new; 3198 irq = new;
3202 break; 3199 break;
3203 } 3200 }
@@ -3212,7 +3209,6 @@ unsigned int create_irq_nr(unsigned int irq_want)
3212 return irq; 3209 return irq;
3213} 3210}
3214 3211
3215static int nr_irqs_gsi = NR_IRQS_LEGACY;
3216int create_irq(void) 3212int create_irq(void)
3217{ 3213{
3218 unsigned int irq_want; 3214 unsigned int irq_want;
@@ -3259,12 +3255,15 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3259 int err; 3255 int err;
3260 unsigned dest; 3256 unsigned dest;
3261 3257
3258 if (disable_apic)
3259 return -ENXIO;
3260
3262 cfg = irq_cfg(irq); 3261 cfg = irq_cfg(irq);
3263 err = assign_irq_vector(irq, cfg, TARGET_CPUS); 3262 err = assign_irq_vector(irq, cfg, apic->target_cpus());
3264 if (err) 3263 if (err)
3265 return err; 3264 return err;
3266 3265
3267 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); 3266 dest = apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus());
3268 3267
3269#ifdef CONFIG_INTR_REMAP 3268#ifdef CONFIG_INTR_REMAP
3270 if (irq_remapped(irq)) { 3269 if (irq_remapped(irq)) {
@@ -3278,9 +3277,9 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3278 memset (&irte, 0, sizeof(irte)); 3277 memset (&irte, 0, sizeof(irte));
3279 3278
3280 irte.present = 1; 3279 irte.present = 1;
3281 irte.dst_mode = INT_DEST_MODE; 3280 irte.dst_mode = apic->irq_dest_mode;
3282 irte.trigger_mode = 0; /* edge */ 3281 irte.trigger_mode = 0; /* edge */
3283 irte.dlvry_mode = INT_DELIVERY_MODE; 3282 irte.dlvry_mode = apic->irq_delivery_mode;
3284 irte.vector = cfg->vector; 3283 irte.vector = cfg->vector;
3285 irte.dest_id = IRTE_DEST(dest); 3284 irte.dest_id = IRTE_DEST(dest);
3286 3285
@@ -3298,10 +3297,10 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3298 msg->address_hi = MSI_ADDR_BASE_HI; 3297 msg->address_hi = MSI_ADDR_BASE_HI;
3299 msg->address_lo = 3298 msg->address_lo =
3300 MSI_ADDR_BASE_LO | 3299 MSI_ADDR_BASE_LO |
3301 ((INT_DEST_MODE == 0) ? 3300 ((apic->irq_dest_mode == 0) ?
3302 MSI_ADDR_DEST_MODE_PHYSICAL: 3301 MSI_ADDR_DEST_MODE_PHYSICAL:
3303 MSI_ADDR_DEST_MODE_LOGICAL) | 3302 MSI_ADDR_DEST_MODE_LOGICAL) |
3304 ((INT_DELIVERY_MODE != dest_LowestPrio) ? 3303 ((apic->irq_delivery_mode != dest_LowestPrio) ?
3305 MSI_ADDR_REDIRECTION_CPU: 3304 MSI_ADDR_REDIRECTION_CPU:
3306 MSI_ADDR_REDIRECTION_LOWPRI) | 3305 MSI_ADDR_REDIRECTION_LOWPRI) |
3307 MSI_ADDR_DEST_ID(dest); 3306 MSI_ADDR_DEST_ID(dest);
@@ -3309,7 +3308,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3309 msg->data = 3308 msg->data =
3310 MSI_DATA_TRIGGER_EDGE | 3309 MSI_DATA_TRIGGER_EDGE |
3311 MSI_DATA_LEVEL_ASSERT | 3310 MSI_DATA_LEVEL_ASSERT |
3312 ((INT_DELIVERY_MODE != dest_LowestPrio) ? 3311 ((apic->irq_delivery_mode != dest_LowestPrio) ?
3313 MSI_DATA_DELIVERY_FIXED: 3312 MSI_DATA_DELIVERY_FIXED:
3314 MSI_DATA_DELIVERY_LOWPRI) | 3313 MSI_DATA_DELIVERY_LOWPRI) |
3315 MSI_DATA_VECTOR(cfg->vector); 3314 MSI_DATA_VECTOR(cfg->vector);
@@ -3464,40 +3463,6 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int irq)
3464 return 0; 3463 return 0;
3465} 3464}
3466 3465
3467int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc)
3468{
3469 unsigned int irq;
3470 int ret;
3471 unsigned int irq_want;
3472
3473 irq_want = nr_irqs_gsi;
3474 irq = create_irq_nr(irq_want);
3475 if (irq == 0)
3476 return -1;
3477
3478#ifdef CONFIG_INTR_REMAP
3479 if (!intr_remapping_enabled)
3480 goto no_ir;
3481
3482 ret = msi_alloc_irte(dev, irq, 1);
3483 if (ret < 0)
3484 goto error;
3485no_ir:
3486#endif
3487 ret = setup_msi_irq(dev, msidesc, irq);
3488 if (ret < 0) {
3489 destroy_irq(irq);
3490 return ret;
3491 }
3492 return 0;
3493
3494#ifdef CONFIG_INTR_REMAP
3495error:
3496 destroy_irq(irq);
3497 return ret;
3498#endif
3499}
3500
3501int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) 3466int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3502{ 3467{
3503 unsigned int irq; 3468 unsigned int irq;
@@ -3514,9 +3479,9 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3514 sub_handle = 0; 3479 sub_handle = 0;
3515 list_for_each_entry(msidesc, &dev->msi_list, list) { 3480 list_for_each_entry(msidesc, &dev->msi_list, list) {
3516 irq = create_irq_nr(irq_want); 3481 irq = create_irq_nr(irq_want);
3517 irq_want++;
3518 if (irq == 0) 3482 if (irq == 0)
3519 return -1; 3483 return -1;
3484 irq_want = irq + 1;
3520#ifdef CONFIG_INTR_REMAP 3485#ifdef CONFIG_INTR_REMAP
3521 if (!intr_remapping_enabled) 3486 if (!intr_remapping_enabled)
3522 goto no_ir; 3487 goto no_ir;
@@ -3727,13 +3692,17 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3727 struct irq_cfg *cfg; 3692 struct irq_cfg *cfg;
3728 int err; 3693 int err;
3729 3694
3695 if (disable_apic)
3696 return -ENXIO;
3697
3730 cfg = irq_cfg(irq); 3698 cfg = irq_cfg(irq);
3731 err = assign_irq_vector(irq, cfg, TARGET_CPUS); 3699 err = assign_irq_vector(irq, cfg, apic->target_cpus());
3732 if (!err) { 3700 if (!err) {
3733 struct ht_irq_msg msg; 3701 struct ht_irq_msg msg;
3734 unsigned dest; 3702 unsigned dest;
3735 3703
3736 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS); 3704 dest = apic->cpu_mask_to_apicid_and(cfg->domain,
3705 apic->target_cpus());
3737 3706
3738 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); 3707 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
3739 3708
@@ -3741,11 +3710,11 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3741 HT_IRQ_LOW_BASE | 3710 HT_IRQ_LOW_BASE |
3742 HT_IRQ_LOW_DEST_ID(dest) | 3711 HT_IRQ_LOW_DEST_ID(dest) |
3743 HT_IRQ_LOW_VECTOR(cfg->vector) | 3712 HT_IRQ_LOW_VECTOR(cfg->vector) |
3744 ((INT_DEST_MODE == 0) ? 3713 ((apic->irq_dest_mode == 0) ?
3745 HT_IRQ_LOW_DM_PHYSICAL : 3714 HT_IRQ_LOW_DM_PHYSICAL :
3746 HT_IRQ_LOW_DM_LOGICAL) | 3715 HT_IRQ_LOW_DM_LOGICAL) |
3747 HT_IRQ_LOW_RQEOI_EDGE | 3716 HT_IRQ_LOW_RQEOI_EDGE |
3748 ((INT_DELIVERY_MODE != dest_LowestPrio) ? 3717 ((apic->irq_delivery_mode != dest_LowestPrio) ?
3749 HT_IRQ_LOW_MT_FIXED : 3718 HT_IRQ_LOW_MT_FIXED :
3750 HT_IRQ_LOW_MT_ARBITRATED) | 3719 HT_IRQ_LOW_MT_ARBITRATED) |
3751 HT_IRQ_LOW_IRQ_MASKED; 3720 HT_IRQ_LOW_IRQ_MASKED;
@@ -3761,7 +3730,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3761} 3730}
3762#endif /* CONFIG_HT_IRQ */ 3731#endif /* CONFIG_HT_IRQ */
3763 3732
3764#ifdef CONFIG_X86_64 3733#ifdef CONFIG_X86_UV
3765/* 3734/*
3766 * Re-target the irq to the specified CPU and enable the specified MMR located 3735 * Re-target the irq to the specified CPU and enable the specified MMR located
3767 * on the specified blade to allow the sending of MSIs to the specified CPU. 3736 * on the specified blade to allow the sending of MSIs to the specified CPU.
@@ -3793,12 +3762,12 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3793 BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long)); 3762 BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long));
3794 3763
3795 entry->vector = cfg->vector; 3764 entry->vector = cfg->vector;
3796 entry->delivery_mode = INT_DELIVERY_MODE; 3765 entry->delivery_mode = apic->irq_delivery_mode;
3797 entry->dest_mode = INT_DEST_MODE; 3766 entry->dest_mode = apic->irq_dest_mode;
3798 entry->polarity = 0; 3767 entry->polarity = 0;
3799 entry->trigger = 0; 3768 entry->trigger = 0;
3800 entry->mask = 0; 3769 entry->mask = 0;
3801 entry->dest = cpu_mask_to_apicid(eligible_cpu); 3770 entry->dest = apic->cpu_mask_to_apicid(eligible_cpu);
3802 3771
3803 mmr_pnode = uv_blade_to_pnode(mmr_blade); 3772 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3804 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); 3773 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
@@ -3861,6 +3830,28 @@ void __init probe_nr_irqs_gsi(void)
3861 printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi); 3830 printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi);
3862} 3831}
3863 3832
3833#ifdef CONFIG_SPARSE_IRQ
3834int __init arch_probe_nr_irqs(void)
3835{
3836 int nr;
3837
3838 if (nr_irqs > (NR_VECTORS * nr_cpu_ids))
3839 nr_irqs = NR_VECTORS * nr_cpu_ids;
3840
3841 nr = nr_irqs_gsi + 8 * nr_cpu_ids;
3842#if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ)
3843 /*
3844 * for MSI and HT dyn irq
3845 */
3846 nr += nr_irqs_gsi * 16;
3847#endif
3848 if (nr < nr_irqs)
3849 nr_irqs = nr;
3850
3851 return 0;
3852}
3853#endif
3854
3864/* -------------------------------------------------------------------------- 3855/* --------------------------------------------------------------------------
3865 ACPI-based IOAPIC Configuration 3856 ACPI-based IOAPIC Configuration
3866 -------------------------------------------------------------------------- */ 3857 -------------------------------------------------------------------------- */
@@ -3886,7 +3877,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3886 */ 3877 */
3887 3878
3888 if (physids_empty(apic_id_map)) 3879 if (physids_empty(apic_id_map))
3889 apic_id_map = ioapic_phys_id_map(phys_cpu_present_map); 3880 apic_id_map = apic->ioapic_phys_id_map(phys_cpu_present_map);
3890 3881
3891 spin_lock_irqsave(&ioapic_lock, flags); 3882 spin_lock_irqsave(&ioapic_lock, flags);
3892 reg_00.raw = io_apic_read(ioapic, 0); 3883 reg_00.raw = io_apic_read(ioapic, 0);
@@ -3902,10 +3893,10 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3902 * Every APIC in a system must have a unique ID or we get lots of nice 3893 * Every APIC in a system must have a unique ID or we get lots of nice
3903 * 'stuck on smp_invalidate_needed IPI wait' messages. 3894 * 'stuck on smp_invalidate_needed IPI wait' messages.
3904 */ 3895 */
3905 if (check_apicid_used(apic_id_map, apic_id)) { 3896 if (apic->check_apicid_used(apic_id_map, apic_id)) {
3906 3897
3907 for (i = 0; i < get_physical_broadcast(); i++) { 3898 for (i = 0; i < get_physical_broadcast(); i++) {
3908 if (!check_apicid_used(apic_id_map, i)) 3899 if (!apic->check_apicid_used(apic_id_map, i))
3909 break; 3900 break;
3910 } 3901 }
3911 3902
@@ -3918,7 +3909,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3918 apic_id = i; 3909 apic_id = i;
3919 } 3910 }
3920 3911
3921 tmp = apicid_to_cpu_present(apic_id); 3912 tmp = apic->apicid_to_cpu_present(apic_id);
3922 physids_or(apic_id_map, apic_id_map, tmp); 3913 physids_or(apic_id_map, apic_id_map, tmp);
3923 3914
3924 if (reg_00.bits.ID != apic_id) { 3915 if (reg_00.bits.ID != apic_id) {
@@ -3995,8 +3986,8 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
3995 return -1; 3986 return -1;
3996 3987
3997 for (i = 0; i < mp_irq_entries; i++) 3988 for (i = 0; i < mp_irq_entries; i++)
3998 if (mp_irqs[i].mp_irqtype == mp_INT && 3989 if (mp_irqs[i].irqtype == mp_INT &&
3999 mp_irqs[i].mp_srcbusirq == bus_irq) 3990 mp_irqs[i].srcbusirq == bus_irq)
4000 break; 3991 break;
4001 if (i >= mp_irq_entries) 3992 if (i >= mp_irq_entries)
4002 return -1; 3993 return -1;
@@ -4011,7 +4002,7 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
4011/* 4002/*
4012 * This function currently is only a helper for the i386 smp boot process where 4003 * This function currently is only a helper for the i386 smp boot process where
4013 * we need to reprogram the ioredtbls to cater for the cpus which have come online 4004 * we need to reprogram the ioredtbls to cater for the cpus which have come online
4014 * so mask in all cases should simply be TARGET_CPUS 4005 * so mask in all cases should simply be apic->target_cpus()
4015 */ 4006 */
4016#ifdef CONFIG_SMP 4007#ifdef CONFIG_SMP
4017void __init setup_ioapic_dest(void) 4008void __init setup_ioapic_dest(void)
@@ -4050,9 +4041,9 @@ void __init setup_ioapic_dest(void)
4050 */ 4041 */
4051 if (desc->status & 4042 if (desc->status &
4052 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET)) 4043 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
4053 mask = &desc->affinity; 4044 mask = desc->affinity;
4054 else 4045 else
4055 mask = TARGET_CPUS; 4046 mask = apic->target_cpus();
4056 4047
4057#ifdef CONFIG_INTR_REMAP 4048#ifdef CONFIG_INTR_REMAP
4058 if (intr_remapping_enabled) 4049 if (intr_remapping_enabled)
@@ -4111,7 +4102,7 @@ void __init ioapic_init_mappings(void)
4111 ioapic_res = ioapic_setup_resources(); 4102 ioapic_res = ioapic_setup_resources();
4112 for (i = 0; i < nr_ioapics; i++) { 4103 for (i = 0; i < nr_ioapics; i++) {
4113 if (smp_found_config) { 4104 if (smp_found_config) {
4114 ioapic_phys = mp_ioapics[i].mp_apicaddr; 4105 ioapic_phys = mp_ioapics[i].apicaddr;
4115#ifdef CONFIG_X86_32 4106#ifdef CONFIG_X86_32
4116 if (!ioapic_phys) { 4107 if (!ioapic_phys) {
4117 printk(KERN_ERR 4108 printk(KERN_ERR
diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c
new file mode 100644
index 000000000000..dbf5445727a9
--- /dev/null
+++ b/arch/x86/kernel/apic/ipi.c
@@ -0,0 +1,164 @@
1#include <linux/cpumask.h>
2#include <linux/interrupt.h>
3#include <linux/init.h>
4
5#include <linux/mm.h>
6#include <linux/delay.h>
7#include <linux/spinlock.h>
8#include <linux/kernel_stat.h>
9#include <linux/mc146818rtc.h>
10#include <linux/cache.h>
11#include <linux/cpu.h>
12#include <linux/module.h>
13
14#include <asm/smp.h>
15#include <asm/mtrr.h>
16#include <asm/tlbflush.h>
17#include <asm/mmu_context.h>
18#include <asm/apic.h>
19#include <asm/proto.h>
20#include <asm/ipi.h>
21
22void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector)
23{
24 unsigned long query_cpu;
25 unsigned long flags;
26
27 /*
28 * Hack. The clustered APIC addressing mode doesn't allow us to send
29 * to an arbitrary mask, so I do a unicast to each CPU instead.
30 * - mbligh
31 */
32 local_irq_save(flags);
33 for_each_cpu(query_cpu, mask) {
34 __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
35 query_cpu), vector, APIC_DEST_PHYSICAL);
36 }
37 local_irq_restore(flags);
38}
39
40void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
41 int vector)
42{
43 unsigned int this_cpu = smp_processor_id();
44 unsigned int query_cpu;
45 unsigned long flags;
46
47 /* See Hack comment above */
48
49 local_irq_save(flags);
50 for_each_cpu(query_cpu, mask) {
51 if (query_cpu == this_cpu)
52 continue;
53 __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
54 query_cpu), vector, APIC_DEST_PHYSICAL);
55 }
56 local_irq_restore(flags);
57}
58
59void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
60 int vector)
61{
62 unsigned long flags;
63 unsigned int query_cpu;
64
65 /*
66 * Hack. The clustered APIC addressing mode doesn't allow us to send
67 * to an arbitrary mask, so I do a unicasts to each CPU instead. This
68 * should be modified to do 1 message per cluster ID - mbligh
69 */
70
71 local_irq_save(flags);
72 for_each_cpu(query_cpu, mask)
73 __default_send_IPI_dest_field(
74 apic->cpu_to_logical_apicid(query_cpu), vector,
75 apic->dest_logical);
76 local_irq_restore(flags);
77}
78
79void default_send_IPI_mask_allbutself_logical(const struct cpumask *mask,
80 int vector)
81{
82 unsigned long flags;
83 unsigned int query_cpu;
84 unsigned int this_cpu = smp_processor_id();
85
86 /* See Hack comment above */
87
88 local_irq_save(flags);
89 for_each_cpu(query_cpu, mask) {
90 if (query_cpu == this_cpu)
91 continue;
92 __default_send_IPI_dest_field(
93 apic->cpu_to_logical_apicid(query_cpu), vector,
94 apic->dest_logical);
95 }
96 local_irq_restore(flags);
97}
98
99#ifdef CONFIG_X86_32
100
101/*
102 * This is only used on smaller machines.
103 */
104void default_send_IPI_mask_logical(const struct cpumask *cpumask, int vector)
105{
106 unsigned long mask = cpumask_bits(cpumask)[0];
107 unsigned long flags;
108
109 local_irq_save(flags);
110 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);
111 __default_send_IPI_dest_field(mask, vector, apic->dest_logical);
112 local_irq_restore(flags);
113}
114
115void default_send_IPI_allbutself(int vector)
116{
117 /*
118 * if there are no other CPUs in the system then we get an APIC send
119 * error if we try to broadcast, thus avoid sending IPIs in this case.
120 */
121 if (!(num_online_cpus() > 1))
122 return;
123
124 __default_local_send_IPI_allbutself(vector);
125}
126
127void default_send_IPI_all(int vector)
128{
129 __default_local_send_IPI_all(vector);
130}
131
132void default_send_IPI_self(int vector)
133{
134 __default_send_IPI_shortcut(APIC_DEST_SELF, vector, apic->dest_logical);
135}
136
137/* must come after the send_IPI functions above for inlining */
138static int convert_apicid_to_cpu(int apic_id)
139{
140 int i;
141
142 for_each_possible_cpu(i) {
143 if (per_cpu(x86_cpu_to_apicid, i) == apic_id)
144 return i;
145 }
146 return -1;
147}
148
149int safe_smp_processor_id(void)
150{
151 int apicid, cpuid;
152
153 if (!boot_cpu_has(X86_FEATURE_APIC))
154 return 0;
155
156 apicid = hard_smp_processor_id();
157 if (apicid == BAD_APICID)
158 return 0;
159
160 cpuid = convert_apicid_to_cpu(apicid);
161
162 return cpuid >= 0 ? cpuid : 0;
163}
164#endif
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/apic/nmi.c
index 7228979f1e7f..bdfad80c3cf1 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/apic/nmi.c
@@ -34,7 +34,7 @@
34 34
35#include <asm/mce.h> 35#include <asm/mce.h>
36 36
37#include <mach_traps.h> 37#include <asm/mach_traps.h>
38 38
39int unknown_nmi_panic; 39int unknown_nmi_panic;
40int nmi_watchdog_enabled; 40int nmi_watchdog_enabled;
@@ -61,11 +61,7 @@ static int endflag __initdata;
61 61
62static inline unsigned int get_nmi_count(int cpu) 62static inline unsigned int get_nmi_count(int cpu)
63{ 63{
64#ifdef CONFIG_X86_64 64 return per_cpu(irq_stat, cpu).__nmi_count;
65 return cpu_pda(cpu)->__nmi_count;
66#else
67 return nmi_count(cpu);
68#endif
69} 65}
70 66
71static inline int mce_in_progress(void) 67static inline int mce_in_progress(void)
@@ -82,12 +78,8 @@ static inline int mce_in_progress(void)
82 */ 78 */
83static inline unsigned int get_timer_irqs(int cpu) 79static inline unsigned int get_timer_irqs(int cpu)
84{ 80{
85#ifdef CONFIG_X86_64
86 return read_pda(apic_timer_irqs) + read_pda(irq0_irqs);
87#else
88 return per_cpu(irq_stat, cpu).apic_timer_irqs + 81 return per_cpu(irq_stat, cpu).apic_timer_irqs +
89 per_cpu(irq_stat, cpu).irq0_irqs; 82 per_cpu(irq_stat, cpu).irq0_irqs;
90#endif
91} 83}
92 84
93#ifdef CONFIG_SMP 85#ifdef CONFIG_SMP
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
new file mode 100644
index 000000000000..ba2fc6465534
--- /dev/null
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -0,0 +1,557 @@
1/*
2 * Written by: Patricia Gaughen, IBM Corporation
3 *
4 * Copyright (C) 2002, IBM Corp.
5 * Copyright (C) 2009, Red Hat, Inc., Ingo Molnar
6 *
7 * All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
17 * NON INFRINGEMENT. See the GNU General Public License for more
18 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * Send feedback to <gone@us.ibm.com>
25 */
26#include <linux/nodemask.h>
27#include <linux/topology.h>
28#include <linux/bootmem.h>
29#include <linux/threads.h>
30#include <linux/cpumask.h>
31#include <linux/kernel.h>
32#include <linux/mmzone.h>
33#include <linux/module.h>
34#include <linux/string.h>
35#include <linux/init.h>
36#include <linux/numa.h>
37#include <linux/smp.h>
38#include <linux/io.h>
39#include <linux/mm.h>
40
41#include <asm/processor.h>
42#include <asm/fixmap.h>
43#include <asm/mpspec.h>
44#include <asm/numaq.h>
45#include <asm/setup.h>
46#include <asm/apic.h>
47#include <asm/e820.h>
48#include <asm/ipi.h>
49
50#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
51
52int found_numaq;
53
54/*
55 * Have to match translation table entries to main table entries by counter
56 * hence the mpc_record variable .... can't see a less disgusting way of
57 * doing this ....
58 */
59struct mpc_trans {
60 unsigned char mpc_type;
61 unsigned char trans_len;
62 unsigned char trans_type;
63 unsigned char trans_quad;
64 unsigned char trans_global;
65 unsigned char trans_local;
66 unsigned short trans_reserved;
67};
68
69/* x86_quirks member */
70static int mpc_record;
71
72static struct mpc_trans *translation_table[MAX_MPC_ENTRY];
73
74int mp_bus_id_to_node[MAX_MP_BUSSES];
75int mp_bus_id_to_local[MAX_MP_BUSSES];
76int quad_local_to_mp_bus_id[NR_CPUS/4][4];
77
78
79static inline void numaq_register_node(int node, struct sys_cfg_data *scd)
80{
81 struct eachquadmem *eq = scd->eq + node;
82
83 node_set_online(node);
84
85 /* Convert to pages */
86 node_start_pfn[node] =
87 MB_TO_PAGES(eq->hi_shrd_mem_start - eq->priv_mem_size);
88
89 node_end_pfn[node] =
90 MB_TO_PAGES(eq->hi_shrd_mem_start + eq->hi_shrd_mem_size);
91
92 e820_register_active_regions(node, node_start_pfn[node],
93 node_end_pfn[node]);
94
95 memory_present(node, node_start_pfn[node], node_end_pfn[node]);
96
97 node_remap_size[node] = node_memmap_size_bytes(node,
98 node_start_pfn[node],
99 node_end_pfn[node]);
100}
101
102/*
103 * Function: smp_dump_qct()
104 *
105 * Description: gets memory layout from the quad config table. This
106 * function also updates node_online_map with the nodes (quads) present.
107 */
108static void __init smp_dump_qct(void)
109{
110 struct sys_cfg_data *scd;
111 int node;
112
113 scd = (void *)__va(SYS_CFG_DATA_PRIV_ADDR);
114
115 nodes_clear(node_online_map);
116 for_each_node(node) {
117 if (scd->quads_present31_0 & (1 << node))
118 numaq_register_node(node, scd);
119 }
120}
121
122void __cpuinit numaq_tsc_disable(void)
123{
124 if (!found_numaq)
125 return;
126
127 if (num_online_nodes() > 1) {
128 printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
129 setup_clear_cpu_cap(X86_FEATURE_TSC);
130 }
131}
132
133static int __init numaq_pre_time_init(void)
134{
135 numaq_tsc_disable();
136 return 0;
137}
138
139static inline int generate_logical_apicid(int quad, int phys_apicid)
140{
141 return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1);
142}
143
144/* x86_quirks member */
145static int mpc_apic_id(struct mpc_cpu *m)
146{
147 int quad = translation_table[mpc_record]->trans_quad;
148 int logical_apicid = generate_logical_apicid(quad, m->apicid);
149
150 printk(KERN_DEBUG
151 "Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n",
152 m->apicid, (m->cpufeature & CPU_FAMILY_MASK) >> 8,
153 (m->cpufeature & CPU_MODEL_MASK) >> 4,
154 m->apicver, quad, logical_apicid);
155
156 return logical_apicid;
157}
158
159/* x86_quirks member */
160static void mpc_oem_bus_info(struct mpc_bus *m, char *name)
161{
162 int quad = translation_table[mpc_record]->trans_quad;
163 int local = translation_table[mpc_record]->trans_local;
164
165 mp_bus_id_to_node[m->busid] = quad;
166 mp_bus_id_to_local[m->busid] = local;
167
168 printk(KERN_INFO "Bus #%d is %s (node %d)\n", m->busid, name, quad);
169}
170
171/* x86_quirks member */
172static void mpc_oem_pci_bus(struct mpc_bus *m)
173{
174 int quad = translation_table[mpc_record]->trans_quad;
175 int local = translation_table[mpc_record]->trans_local;
176
177 quad_local_to_mp_bus_id[quad][local] = m->busid;
178}
179
180static void __init MP_translation_info(struct mpc_trans *m)
181{
182 printk(KERN_INFO
183 "Translation: record %d, type %d, quad %d, global %d, local %d\n",
184 mpc_record, m->trans_type, m->trans_quad, m->trans_global,
185 m->trans_local);
186
187 if (mpc_record >= MAX_MPC_ENTRY)
188 printk(KERN_ERR "MAX_MPC_ENTRY exceeded!\n");
189 else
190 translation_table[mpc_record] = m; /* stash this for later */
191
192 if (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad))
193 node_set_online(m->trans_quad);
194}
195
196static int __init mpf_checksum(unsigned char *mp, int len)
197{
198 int sum = 0;
199
200 while (len--)
201 sum += *mp++;
202
203 return sum & 0xFF;
204}
205
206/*
207 * Read/parse the MPC oem tables
208 */
209static void __init
210 smp_read_mpc_oem(struct mpc_oemtable *oemtable, unsigned short oemsize)
211{
212 int count = sizeof(*oemtable); /* the header size */
213 unsigned char *oemptr = ((unsigned char *)oemtable) + count;
214
215 mpc_record = 0;
216 printk(KERN_INFO
217 "Found an OEM MPC table at %8p - parsing it ... \n", oemtable);
218
219 if (memcmp(oemtable->signature, MPC_OEM_SIGNATURE, 4)) {
220 printk(KERN_WARNING
221 "SMP mpc oemtable: bad signature [%c%c%c%c]!\n",
222 oemtable->signature[0], oemtable->signature[1],
223 oemtable->signature[2], oemtable->signature[3]);
224 return;
225 }
226
227 if (mpf_checksum((unsigned char *)oemtable, oemtable->length)) {
228 printk(KERN_WARNING "SMP oem mptable: checksum error!\n");
229 return;
230 }
231
232 while (count < oemtable->length) {
233 switch (*oemptr) {
234 case MP_TRANSLATION:
235 {
236 struct mpc_trans *m = (void *)oemptr;
237
238 MP_translation_info(m);
239 oemptr += sizeof(*m);
240 count += sizeof(*m);
241 ++mpc_record;
242 break;
243 }
244 default:
245 printk(KERN_WARNING
246 "Unrecognised OEM table entry type! - %d\n",
247 (int)*oemptr);
248 return;
249 }
250 }
251}
252
253static int __init numaq_setup_ioapic_ids(void)
254{
255 /* so can skip it */
256 return 1;
257}
258
259static struct x86_quirks numaq_x86_quirks __initdata = {
260 .arch_pre_time_init = numaq_pre_time_init,
261 .arch_time_init = NULL,
262 .arch_pre_intr_init = NULL,
263 .arch_memory_setup = NULL,
264 .arch_intr_init = NULL,
265 .arch_trap_init = NULL,
266 .mach_get_smp_config = NULL,
267 .mach_find_smp_config = NULL,
268 .mpc_record = &mpc_record,
269 .mpc_apic_id = mpc_apic_id,
270 .mpc_oem_bus_info = mpc_oem_bus_info,
271 .mpc_oem_pci_bus = mpc_oem_pci_bus,
272 .smp_read_mpc_oem = smp_read_mpc_oem,
273 .setup_ioapic_ids = numaq_setup_ioapic_ids,
274};
275
276static __init void early_check_numaq(void)
277{
278 /*
279 * Find possible boot-time SMP configuration:
280 */
281 early_find_smp_config();
282
283 /*
284 * get boot-time SMP configuration:
285 */
286 if (smp_found_config)
287 early_get_smp_config();
288
289 if (found_numaq)
290 x86_quirks = &numaq_x86_quirks;
291}
292
293int __init get_memcfg_numaq(void)
294{
295 early_check_numaq();
296 if (!found_numaq)
297 return 0;
298 smp_dump_qct();
299
300 return 1;
301}
302
303#define NUMAQ_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
304
305static inline unsigned int numaq_get_apic_id(unsigned long x)
306{
307 return (x >> 24) & 0x0F;
308}
309
310static inline void numaq_send_IPI_mask(const struct cpumask *mask, int vector)
311{
312 default_send_IPI_mask_sequence_logical(mask, vector);
313}
314
315static inline void numaq_send_IPI_allbutself(int vector)
316{
317 default_send_IPI_mask_allbutself_logical(cpu_online_mask, vector);
318}
319
320static inline void numaq_send_IPI_all(int vector)
321{
322 numaq_send_IPI_mask(cpu_online_mask, vector);
323}
324
325#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)
326#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)
327
328/*
329 * Because we use NMIs rather than the INIT-STARTUP sequence to
330 * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
331 */
332static inline void numaq_smp_callin_clear_local_apic(void)
333{
334 clear_local_APIC();
335}
336
337static inline const cpumask_t *numaq_target_cpus(void)
338{
339 return &CPU_MASK_ALL;
340}
341
342static inline unsigned long
343numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
344{
345 return physid_isset(apicid, bitmap);
346}
347
348static inline unsigned long numaq_check_apicid_present(int bit)
349{
350 return physid_isset(bit, phys_cpu_present_map);
351}
352
353static inline int numaq_apic_id_registered(void)
354{
355 return 1;
356}
357
358static inline void numaq_init_apic_ldr(void)
359{
360 /* Already done in NUMA-Q firmware */
361}
362
363static inline void numaq_setup_apic_routing(void)
364{
365 printk(KERN_INFO
366 "Enabling APIC mode: NUMA-Q. Using %d I/O APICs\n",
367 nr_ioapics);
368}
369
370/*
371 * Skip adding the timer int on secondary nodes, which causes
372 * a small but painful rift in the time-space continuum.
373 */
374static inline int numaq_multi_timer_check(int apic, int irq)
375{
376 return apic != 0 && irq == 0;
377}
378
379static inline physid_mask_t numaq_ioapic_phys_id_map(physid_mask_t phys_map)
380{
381 /* We don't have a good way to do this yet - hack */
382 return physids_promote(0xFUL);
383}
384
385static inline int numaq_cpu_to_logical_apicid(int cpu)
386{
387 if (cpu >= nr_cpu_ids)
388 return BAD_APICID;
389 return cpu_2_logical_apicid[cpu];
390}
391
392/*
393 * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
394 * cpu to APIC ID relation to properly interact with the intelligent
395 * mode of the cluster controller.
396 */
397static inline int numaq_cpu_present_to_apicid(int mps_cpu)
398{
399 if (mps_cpu < 60)
400 return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
401 else
402 return BAD_APICID;
403}
404
405static inline int numaq_apicid_to_node(int logical_apicid)
406{
407 return logical_apicid >> 4;
408}
409
410static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid)
411{
412 int node = numaq_apicid_to_node(logical_apicid);
413 int cpu = __ffs(logical_apicid & 0xf);
414
415 return physid_mask_of_physid(cpu + 4*node);
416}
417
418/* Where the IO area was mapped on multiquad, always 0 otherwise */
419void *xquad_portio;
420
421static inline int numaq_check_phys_apicid_present(int boot_cpu_physical_apicid)
422{
423 return 1;
424}
425
426/*
427 * We use physical apicids here, not logical, so just return the default
428 * physical broadcast to stop people from breaking us
429 */
430static inline unsigned int numaq_cpu_mask_to_apicid(const cpumask_t *cpumask)
431{
432 return 0x0F;
433}
434
435static inline unsigned int
436numaq_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
437 const struct cpumask *andmask)
438{
439 return 0x0F;
440}
441
442/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
443static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
444{
445 return cpuid_apic >> index_msb;
446}
447
448static int
449numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
450{
451 if (strncmp(oem, "IBM NUMA", 8))
452 printk(KERN_ERR "Warning! Not a NUMA-Q system!\n");
453 else
454 found_numaq = 1;
455
456 return found_numaq;
457}
458
459static int probe_numaq(void)
460{
461 /* already know from get_memcfg_numaq() */
462 return found_numaq;
463}
464
465static void numaq_vector_allocation_domain(int cpu, cpumask_t *retmask)
466{
467 /* Careful. Some cpus do not strictly honor the set of cpus
468 * specified in the interrupt destination when using lowest
469 * priority interrupt delivery mode.
470 *
471 * In particular there was a hyperthreading cpu observed to
472 * deliver interrupts to the wrong hyperthread when only one
473 * hyperthread was specified in the interrupt desitination.
474 */
475 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
476}
477
478static void numaq_setup_portio_remap(void)
479{
480 int num_quads = num_online_nodes();
481
482 if (num_quads <= 1)
483 return;
484
485 printk(KERN_INFO
486 "Remapping cross-quad port I/O for %d quads\n", num_quads);
487
488 xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
489
490 printk(KERN_INFO
491 "xquad_portio vaddr 0x%08lx, len %08lx\n",
492 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
493}
494
495struct apic apic_numaq = {
496
497 .name = "NUMAQ",
498 .probe = probe_numaq,
499 .acpi_madt_oem_check = NULL,
500 .apic_id_registered = numaq_apic_id_registered,
501
502 .irq_delivery_mode = dest_LowestPrio,
503 /* physical delivery on LOCAL quad: */
504 .irq_dest_mode = 0,
505
506 .target_cpus = numaq_target_cpus,
507 .disable_esr = 1,
508 .dest_logical = APIC_DEST_LOGICAL,
509 .check_apicid_used = numaq_check_apicid_used,
510 .check_apicid_present = numaq_check_apicid_present,
511
512 .vector_allocation_domain = numaq_vector_allocation_domain,
513 .init_apic_ldr = numaq_init_apic_ldr,
514
515 .ioapic_phys_id_map = numaq_ioapic_phys_id_map,
516 .setup_apic_routing = numaq_setup_apic_routing,
517 .multi_timer_check = numaq_multi_timer_check,
518 .apicid_to_node = numaq_apicid_to_node,
519 .cpu_to_logical_apicid = numaq_cpu_to_logical_apicid,
520 .cpu_present_to_apicid = numaq_cpu_present_to_apicid,
521 .apicid_to_cpu_present = numaq_apicid_to_cpu_present,
522 .setup_portio_remap = numaq_setup_portio_remap,
523 .check_phys_apicid_present = numaq_check_phys_apicid_present,
524 .enable_apic_mode = NULL,
525 .phys_pkg_id = numaq_phys_pkg_id,
526 .mps_oem_check = numaq_mps_oem_check,
527
528 .get_apic_id = numaq_get_apic_id,
529 .set_apic_id = NULL,
530 .apic_id_mask = 0x0F << 24,
531
532 .cpu_mask_to_apicid = numaq_cpu_mask_to_apicid,
533 .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and,
534
535 .send_IPI_mask = numaq_send_IPI_mask,
536 .send_IPI_mask_allbutself = NULL,
537 .send_IPI_allbutself = numaq_send_IPI_allbutself,
538 .send_IPI_all = numaq_send_IPI_all,
539 .send_IPI_self = default_send_IPI_self,
540
541 .wakeup_secondary_cpu = wakeup_secondary_cpu_via_nmi,
542 .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW,
543 .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH,
544
545 /* We don't do anything here because we use NMI's to boot instead */
546 .wait_for_init_deassert = NULL,
547
548 .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
549 .inquire_remote_apic = NULL,
550
551 .read = native_apic_mem_read,
552 .write = native_apic_mem_write,
553 .icr_read = native_apic_icr_read,
554 .icr_write = native_apic_icr_write,
555 .wait_icr_idle = native_apic_wait_icr_idle,
556 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
557};
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
new file mode 100644
index 000000000000..141c99a1c264
--- /dev/null
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -0,0 +1,284 @@
1/*
2 * Default generic APIC driver. This handles up to 8 CPUs.
3 *
4 * Copyright 2003 Andi Kleen, SuSE Labs.
5 * Subject to the GNU Public License, v.2
6 *
7 * Generic x86 APIC driver probe layer.
8 */
9#include <linux/threads.h>
10#include <linux/cpumask.h>
11#include <linux/module.h>
12#include <linux/string.h>
13#include <linux/kernel.h>
14#include <linux/ctype.h>
15#include <linux/init.h>
16#include <linux/errno.h>
17#include <asm/fixmap.h>
18#include <asm/mpspec.h>
19#include <asm/apicdef.h>
20#include <asm/apic.h>
21#include <asm/setup.h>
22
23#include <linux/threads.h>
24#include <linux/cpumask.h>
25#include <asm/mpspec.h>
26#include <asm/fixmap.h>
27#include <asm/apicdef.h>
28#include <linux/kernel.h>
29#include <linux/string.h>
30#include <linux/smp.h>
31#include <linux/init.h>
32#include <asm/ipi.h>
33
34#include <linux/smp.h>
35#include <linux/init.h>
36#include <linux/interrupt.h>
37#include <asm/acpi.h>
38#include <asm/e820.h>
39#include <asm/setup.h>
40
41#ifdef CONFIG_HOTPLUG_CPU
42#define DEFAULT_SEND_IPI (1)
43#else
44#define DEFAULT_SEND_IPI (0)
45#endif
46
47int no_broadcast = DEFAULT_SEND_IPI;
48
49static __init int no_ipi_broadcast(char *str)
50{
51 get_option(&str, &no_broadcast);
52 pr_info("Using %s mode\n",
53 no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
54 return 1;
55}
56__setup("no_ipi_broadcast=", no_ipi_broadcast);
57
58static int __init print_ipi_mode(void)
59{
60 pr_info("Using IPI %s mode\n",
61 no_broadcast ? "No-Shortcut" : "Shortcut");
62 return 0;
63}
64late_initcall(print_ipi_mode);
65
66void default_setup_apic_routing(void)
67{
68#ifdef CONFIG_X86_IO_APIC
69 printk(KERN_INFO
70 "Enabling APIC mode: Flat. Using %d I/O APICs\n",
71 nr_ioapics);
72#endif
73}
74
75static void default_vector_allocation_domain(int cpu, struct cpumask *retmask)
76{
77 /*
78 * Careful. Some cpus do not strictly honor the set of cpus
79 * specified in the interrupt destination when using lowest
80 * priority interrupt delivery mode.
81 *
82 * In particular there was a hyperthreading cpu observed to
83 * deliver interrupts to the wrong hyperthread when only one
84 * hyperthread was specified in the interrupt desitination.
85 */
86 *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
87}
88
89/* should be called last. */
90static int probe_default(void)
91{
92 return 1;
93}
94
95struct apic apic_default = {
96
97 .name = "default",
98 .probe = probe_default,
99 .acpi_madt_oem_check = NULL,
100 .apic_id_registered = default_apic_id_registered,
101
102 .irq_delivery_mode = dest_LowestPrio,
103 /* logical delivery broadcast to all CPUs: */
104 .irq_dest_mode = 1,
105
106 .target_cpus = default_target_cpus,
107 .disable_esr = 0,
108 .dest_logical = APIC_DEST_LOGICAL,
109 .check_apicid_used = default_check_apicid_used,
110 .check_apicid_present = default_check_apicid_present,
111
112 .vector_allocation_domain = default_vector_allocation_domain,
113 .init_apic_ldr = default_init_apic_ldr,
114
115 .ioapic_phys_id_map = default_ioapic_phys_id_map,
116 .setup_apic_routing = default_setup_apic_routing,
117 .multi_timer_check = NULL,
118 .apicid_to_node = default_apicid_to_node,
119 .cpu_to_logical_apicid = default_cpu_to_logical_apicid,
120 .cpu_present_to_apicid = default_cpu_present_to_apicid,
121 .apicid_to_cpu_present = default_apicid_to_cpu_present,
122 .setup_portio_remap = NULL,
123 .check_phys_apicid_present = default_check_phys_apicid_present,
124 .enable_apic_mode = NULL,
125 .phys_pkg_id = default_phys_pkg_id,
126 .mps_oem_check = NULL,
127
128 .get_apic_id = default_get_apic_id,
129 .set_apic_id = NULL,
130 .apic_id_mask = 0x0F << 24,
131
132 .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
133 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
134
135 .send_IPI_mask = default_send_IPI_mask_logical,
136 .send_IPI_mask_allbutself = default_send_IPI_mask_allbutself_logical,
137 .send_IPI_allbutself = default_send_IPI_allbutself,
138 .send_IPI_all = default_send_IPI_all,
139 .send_IPI_self = default_send_IPI_self,
140
141 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
142 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
143
144 .wait_for_init_deassert = default_wait_for_init_deassert,
145
146 .smp_callin_clear_local_apic = NULL,
147 .inquire_remote_apic = default_inquire_remote_apic,
148
149 .read = native_apic_mem_read,
150 .write = native_apic_mem_write,
151 .icr_read = native_apic_icr_read,
152 .icr_write = native_apic_icr_write,
153 .wait_icr_idle = native_apic_wait_icr_idle,
154 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
155};
156
157extern struct apic apic_numaq;
158extern struct apic apic_summit;
159extern struct apic apic_bigsmp;
160extern struct apic apic_es7000;
161extern struct apic apic_es7000_cluster;
162extern struct apic apic_default;
163
164struct apic *apic = &apic_default;
165EXPORT_SYMBOL_GPL(apic);
166
167static struct apic *apic_probe[] __initdata = {
168#ifdef CONFIG_X86_NUMAQ
169 &apic_numaq,
170#endif
171#ifdef CONFIG_X86_SUMMIT
172 &apic_summit,
173#endif
174#ifdef CONFIG_X86_BIGSMP
175 &apic_bigsmp,
176#endif
177#ifdef CONFIG_X86_ES7000
178 &apic_es7000,
179 &apic_es7000_cluster,
180#endif
181 &apic_default, /* must be last */
182 NULL,
183};
184
185static int cmdline_apic __initdata;
186static int __init parse_apic(char *arg)
187{
188 int i;
189
190 if (!arg)
191 return -EINVAL;
192
193 for (i = 0; apic_probe[i]; i++) {
194 if (!strcmp(apic_probe[i]->name, arg)) {
195 apic = apic_probe[i];
196 cmdline_apic = 1;
197 return 0;
198 }
199 }
200
201 /* Parsed again by __setup for debug/verbose */
202 return 0;
203}
204early_param("apic", parse_apic);
205
206void __init generic_bigsmp_probe(void)
207{
208#ifdef CONFIG_X86_BIGSMP
209 /*
210 * This routine is used to switch to bigsmp mode when
211 * - There is no apic= option specified by the user
212 * - generic_apic_probe() has chosen apic_default as the sub_arch
213 * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
214 */
215
216 if (!cmdline_apic && apic == &apic_default) {
217 if (apic_bigsmp.probe()) {
218 apic = &apic_bigsmp;
219 printk(KERN_INFO "Overriding APIC driver with %s\n",
220 apic->name);
221 }
222 }
223#endif
224}
225
226void __init generic_apic_probe(void)
227{
228 if (!cmdline_apic) {
229 int i;
230 for (i = 0; apic_probe[i]; i++) {
231 if (apic_probe[i]->probe()) {
232 apic = apic_probe[i];
233 break;
234 }
235 }
236 /* Not visible without early console */
237 if (!apic_probe[i])
238 panic("Didn't find an APIC driver");
239 }
240 printk(KERN_INFO "Using APIC driver %s\n", apic->name);
241}
242
243/* These functions can switch the APIC even after the initial ->probe() */
244
245int __init
246generic_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
247{
248 int i;
249
250 for (i = 0; apic_probe[i]; ++i) {
251 if (!apic_probe[i]->mps_oem_check)
252 continue;
253 if (!apic_probe[i]->mps_oem_check(mpc, oem, productid))
254 continue;
255
256 if (!cmdline_apic) {
257 apic = apic_probe[i];
258 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
259 apic->name);
260 }
261 return 1;
262 }
263 return 0;
264}
265
266int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
267{
268 int i;
269
270 for (i = 0; apic_probe[i]; ++i) {
271 if (!apic_probe[i]->acpi_madt_oem_check)
272 continue;
273 if (!apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id))
274 continue;
275
276 if (!cmdline_apic) {
277 apic = apic_probe[i];
278 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
279 apic->name);
280 }
281 return 1;
282 }
283 return 0;
284}
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/apic/probe_64.c
index 2bced78b0b8e..8d7748efe6a8 100644
--- a/arch/x86/kernel/genapic_64.c
+++ b/arch/x86/kernel/apic/probe_64.c
@@ -19,22 +19,27 @@
19#include <linux/dmar.h> 19#include <linux/dmar.h>
20 20
21#include <asm/smp.h> 21#include <asm/smp.h>
22#include <asm/apic.h>
22#include <asm/ipi.h> 23#include <asm/ipi.h>
23#include <asm/genapic.h>
24#include <asm/setup.h> 24#include <asm/setup.h>
25 25
26extern struct genapic apic_flat; 26extern struct apic apic_flat;
27extern struct genapic apic_physflat; 27extern struct apic apic_physflat;
28extern struct genapic apic_x2xpic_uv_x; 28extern struct apic apic_x2xpic_uv_x;
29extern struct genapic apic_x2apic_phys; 29extern struct apic apic_x2apic_phys;
30extern struct genapic apic_x2apic_cluster; 30extern struct apic apic_x2apic_cluster;
31 31
32struct genapic __read_mostly *genapic = &apic_flat; 32struct apic __read_mostly *apic = &apic_flat;
33EXPORT_SYMBOL_GPL(apic);
33 34
34static struct genapic *apic_probe[] __initdata = { 35static struct apic *apic_probe[] __initdata = {
36#ifdef CONFIG_X86_UV
35 &apic_x2apic_uv_x, 37 &apic_x2apic_uv_x,
38#endif
39#ifdef CONFIG_X86_X2APIC
36 &apic_x2apic_phys, 40 &apic_x2apic_phys,
37 &apic_x2apic_cluster, 41 &apic_x2apic_cluster,
42#endif
38 &apic_physflat, 43 &apic_physflat,
39 NULL, 44 NULL,
40}; 45};
@@ -42,39 +47,45 @@ static struct genapic *apic_probe[] __initdata = {
42/* 47/*
43 * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. 48 * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
44 */ 49 */
45void __init setup_apic_routing(void) 50void __init default_setup_apic_routing(void)
46{ 51{
47 if (genapic == &apic_x2apic_phys || genapic == &apic_x2apic_cluster) { 52#ifdef CONFIG_X86_X2APIC
48 if (!intr_remapping_enabled) 53 if (x2apic && (apic != &apic_x2apic_phys &&
49 genapic = &apic_flat; 54#ifdef CONFIG_X86_UV
55 apic != &apic_x2apic_uv_x &&
56#endif
57 apic != &apic_x2apic_cluster)) {
58 if (x2apic_phys)
59 apic = &apic_x2apic_phys;
60 else
61 apic = &apic_x2apic_cluster;
62 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
50 } 63 }
64#endif
51 65
52 if (genapic == &apic_flat) { 66 if (apic == &apic_flat) {
53 if (max_physical_apicid >= 8) 67 if (max_physical_apicid >= 8)
54 genapic = &apic_physflat; 68 apic = &apic_physflat;
55 printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); 69 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
56 } 70 }
57
58 if (x86_quirks->update_genapic)
59 x86_quirks->update_genapic();
60} 71}
61 72
62/* Same for both flat and physical. */ 73/* Same for both flat and physical. */
63 74
64void apic_send_IPI_self(int vector) 75void apic_send_IPI_self(int vector)
65{ 76{
66 __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); 77 __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
67} 78}
68 79
69int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) 80int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
70{ 81{
71 int i; 82 int i;
72 83
73 for (i = 0; apic_probe[i]; ++i) { 84 for (i = 0; apic_probe[i]; ++i) {
74 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { 85 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
75 genapic = apic_probe[i]; 86 apic = apic_probe[i];
76 printk(KERN_INFO "Setting APIC routing to %s.\n", 87 printk(KERN_INFO "Setting APIC routing to %s.\n",
77 genapic->name); 88 apic->name);
78 return 1; 89 return 1;
79 } 90 }
80 } 91 }
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c
new file mode 100644
index 000000000000..aac52fa873ff
--- /dev/null
+++ b/arch/x86/kernel/apic/summit_32.c
@@ -0,0 +1,579 @@
1/*
2 * IBM Summit-Specific Code
3 *
4 * Written By: Matthew Dobson, IBM Corporation
5 *
6 * Copyright (c) 2003 IBM Corp.
7 *
8 * 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 (at
13 * 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, GOOD TITLE or
18 * NON INFRINGEMENT. See the GNU General Public License for more
19 * details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * Send feedback to <colpatch@us.ibm.com>
26 *
27 */
28
29#include <linux/mm.h>
30#include <linux/init.h>
31#include <asm/io.h>
32#include <asm/bios_ebda.h>
33
34/*
35 * APIC driver for the IBM "Summit" chipset.
36 */
37#include <linux/threads.h>
38#include <linux/cpumask.h>
39#include <asm/mpspec.h>
40#include <asm/apic.h>
41#include <asm/smp.h>
42#include <asm/fixmap.h>
43#include <asm/apicdef.h>
44#include <asm/ipi.h>
45#include <linux/kernel.h>
46#include <linux/string.h>
47#include <linux/init.h>
48#include <linux/gfp.h>
49#include <linux/smp.h>
50
51static unsigned summit_get_apic_id(unsigned long x)
52{
53 return (x >> 24) & 0xFF;
54}
55
56static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector)
57{
58 default_send_IPI_mask_sequence_logical(mask, vector);
59}
60
61static void summit_send_IPI_allbutself(int vector)
62{
63 cpumask_t mask = cpu_online_map;
64 cpu_clear(smp_processor_id(), mask);
65
66 if (!cpus_empty(mask))
67 summit_send_IPI_mask(&mask, vector);
68}
69
70static void summit_send_IPI_all(int vector)
71{
72 summit_send_IPI_mask(&cpu_online_map, vector);
73}
74
75#include <asm/tsc.h>
76
77extern int use_cyclone;
78
79#ifdef CONFIG_X86_SUMMIT_NUMA
80static void setup_summit(void);
81#else
82static inline void setup_summit(void) {}
83#endif
84
85static int summit_mps_oem_check(struct mpc_table *mpc, char *oem,
86 char *productid)
87{
88 if (!strncmp(oem, "IBM ENSW", 8) &&
89 (!strncmp(productid, "VIGIL SMP", 9)
90 || !strncmp(productid, "EXA", 3)
91 || !strncmp(productid, "RUTHLESS SMP", 12))){
92 mark_tsc_unstable("Summit based system");
93 use_cyclone = 1; /*enable cyclone-timer*/
94 setup_summit();
95 return 1;
96 }
97 return 0;
98}
99
100/* Hook from generic ACPI tables.c */
101static int summit_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
102{
103 if (!strncmp(oem_id, "IBM", 3) &&
104 (!strncmp(oem_table_id, "SERVIGIL", 8)
105 || !strncmp(oem_table_id, "EXA", 3))){
106 mark_tsc_unstable("Summit based system");
107 use_cyclone = 1; /*enable cyclone-timer*/
108 setup_summit();
109 return 1;
110 }
111 return 0;
112}
113
114struct rio_table_hdr {
115 unsigned char version; /* Version number of this data structure */
116 /* Version 3 adds chassis_num & WP_index */
117 unsigned char num_scal_dev; /* # of Scalability devices (Twisters for Vigil) */
118 unsigned char num_rio_dev; /* # of RIO I/O devices (Cyclones and Winnipegs) */
119} __attribute__((packed));
120
121struct scal_detail {
122 unsigned char node_id; /* Scalability Node ID */
123 unsigned long CBAR; /* Address of 1MB register space */
124 unsigned char port0node; /* Node ID port connected to: 0xFF=None */
125 unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
126 unsigned char port1node; /* Node ID port connected to: 0xFF = None */
127 unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
128 unsigned char port2node; /* Node ID port connected to: 0xFF = None */
129 unsigned char port2port; /* Port num port connected to: 0,1,2, or 0xFF=None */
130 unsigned char chassis_num; /* 1 based Chassis number (1 = boot node) */
131} __attribute__((packed));
132
133struct rio_detail {
134 unsigned char node_id; /* RIO Node ID */
135 unsigned long BBAR; /* Address of 1MB register space */
136 unsigned char type; /* Type of device */
137 unsigned char owner_id; /* For WPEG: Node ID of Cyclone that owns this WPEG*/
138 /* For CYC: Node ID of Twister that owns this CYC */
139 unsigned char port0node; /* Node ID port connected to: 0xFF=None */
140 unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
141 unsigned char port1node; /* Node ID port connected to: 0xFF=None */
142 unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
143 unsigned char first_slot; /* For WPEG: Lowest slot number below this WPEG */
144 /* For CYC: 0 */
145 unsigned char status; /* For WPEG: Bit 0 = 1 : the XAPIC is used */
146 /* = 0 : the XAPIC is not used, ie:*/
147 /* ints fwded to another XAPIC */
148 /* Bits1:7 Reserved */
149 /* For CYC: Bits0:7 Reserved */
150 unsigned char WP_index; /* For WPEG: WPEG instance index - lower ones have */
151 /* lower slot numbers/PCI bus numbers */
152 /* For CYC: No meaning */
153 unsigned char chassis_num; /* 1 based Chassis number */
154 /* For LookOut WPEGs this field indicates the */
155 /* Expansion Chassis #, enumerated from Boot */
156 /* Node WPEG external port, then Boot Node CYC */
157 /* external port, then Next Vigil chassis WPEG */
158 /* external port, etc. */
159 /* Shared Lookouts have only 1 chassis number (the */
160 /* first one assigned) */
161} __attribute__((packed));
162
163
164typedef enum {
165 CompatTwister = 0, /* Compatibility Twister */
166 AltTwister = 1, /* Alternate Twister of internal 8-way */
167 CompatCyclone = 2, /* Compatibility Cyclone */
168 AltCyclone = 3, /* Alternate Cyclone of internal 8-way */
169 CompatWPEG = 4, /* Compatibility WPEG */
170 AltWPEG = 5, /* Second Planar WPEG */
171 LookOutAWPEG = 6, /* LookOut WPEG */
172 LookOutBWPEG = 7, /* LookOut WPEG */
173} node_type;
174
175static inline int is_WPEG(struct rio_detail *rio){
176 return (rio->type == CompatWPEG || rio->type == AltWPEG ||
177 rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
178}
179
180
181/* In clustered mode, the high nibble of APIC ID is a cluster number.
182 * The low nibble is a 4-bit bitmap. */
183#define XAPIC_DEST_CPUS_SHIFT 4
184#define XAPIC_DEST_CPUS_MASK ((1u << XAPIC_DEST_CPUS_SHIFT) - 1)
185#define XAPIC_DEST_CLUSTER_MASK (XAPIC_DEST_CPUS_MASK << XAPIC_DEST_CPUS_SHIFT)
186
187#define SUMMIT_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
188
189static const cpumask_t *summit_target_cpus(void)
190{
191 /* CPU_MASK_ALL (0xff) has undefined behaviour with
192 * dest_LowestPrio mode logical clustered apic interrupt routing
193 * Just start on cpu 0. IRQ balancing will spread load
194 */
195 return &cpumask_of_cpu(0);
196}
197
198static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid)
199{
200 return 0;
201}
202
203/* we don't use the phys_cpu_present_map to indicate apicid presence */
204static unsigned long summit_check_apicid_present(int bit)
205{
206 return 1;
207}
208
209static void summit_init_apic_ldr(void)
210{
211 unsigned long val, id;
212 int count = 0;
213 u8 my_id = (u8)hard_smp_processor_id();
214 u8 my_cluster = APIC_CLUSTER(my_id);
215#ifdef CONFIG_SMP
216 u8 lid;
217 int i;
218
219 /* Create logical APIC IDs by counting CPUs already in cluster. */
220 for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
221 lid = cpu_2_logical_apicid[i];
222 if (lid != BAD_APICID && APIC_CLUSTER(lid) == my_cluster)
223 ++count;
224 }
225#endif
226 /* We only have a 4 wide bitmap in cluster mode. If a deranged
227 * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
228 BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
229 id = my_cluster | (1UL << count);
230 apic_write(APIC_DFR, SUMMIT_APIC_DFR_VALUE);
231 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
232 val |= SET_APIC_LOGICAL_ID(id);
233 apic_write(APIC_LDR, val);
234}
235
236static int summit_apic_id_registered(void)
237{
238 return 1;
239}
240
241static void summit_setup_apic_routing(void)
242{
243 printk("Enabling APIC mode: Summit. Using %d I/O APICs\n",
244 nr_ioapics);
245}
246
247static int summit_apicid_to_node(int logical_apicid)
248{
249#ifdef CONFIG_SMP
250 return apicid_2_node[hard_smp_processor_id()];
251#else
252 return 0;
253#endif
254}
255
256/* Mapping from cpu number to logical apicid */
257static inline int summit_cpu_to_logical_apicid(int cpu)
258{
259#ifdef CONFIG_SMP
260 if (cpu >= nr_cpu_ids)
261 return BAD_APICID;
262 return cpu_2_logical_apicid[cpu];
263#else
264 return logical_smp_processor_id();
265#endif
266}
267
268static int summit_cpu_present_to_apicid(int mps_cpu)
269{
270 if (mps_cpu < nr_cpu_ids)
271 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
272 else
273 return BAD_APICID;
274}
275
276static physid_mask_t summit_ioapic_phys_id_map(physid_mask_t phys_id_map)
277{
278 /* For clustered we don't have a good way to do this yet - hack */
279 return physids_promote(0x0F);
280}
281
282static physid_mask_t summit_apicid_to_cpu_present(int apicid)
283{
284 return physid_mask_of_physid(0);
285}
286
287static int summit_check_phys_apicid_present(int boot_cpu_physical_apicid)
288{
289 return 1;
290}
291
292static unsigned int summit_cpu_mask_to_apicid(const cpumask_t *cpumask)
293{
294 unsigned int round = 0;
295 int cpu, apicid = 0;
296
297 /*
298 * The cpus in the mask must all be on the apic cluster.
299 */
300 for_each_cpu(cpu, cpumask) {
301 int new_apicid = summit_cpu_to_logical_apicid(cpu);
302
303 if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
304 printk("%s: Not a valid mask!\n", __func__);
305 return BAD_APICID;
306 }
307 apicid |= new_apicid;
308 round++;
309 }
310 return apicid;
311}
312
313static unsigned int summit_cpu_mask_to_apicid_and(const struct cpumask *inmask,
314 const struct cpumask *andmask)
315{
316 int apicid = summit_cpu_to_logical_apicid(0);
317 cpumask_var_t cpumask;
318
319 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
320 return apicid;
321
322 cpumask_and(cpumask, inmask, andmask);
323 cpumask_and(cpumask, cpumask, cpu_online_mask);
324 apicid = summit_cpu_mask_to_apicid(cpumask);
325
326 free_cpumask_var(cpumask);
327
328 return apicid;
329}
330
331/*
332 * cpuid returns the value latched in the HW at reset, not the APIC ID
333 * register's value. For any box whose BIOS changes APIC IDs, like
334 * clustered APIC systems, we must use hard_smp_processor_id.
335 *
336 * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
337 */
338static int summit_phys_pkg_id(int cpuid_apic, int index_msb)
339{
340 return hard_smp_processor_id() >> index_msb;
341}
342
343static int probe_summit(void)
344{
345 /* probed later in mptable/ACPI hooks */
346 return 0;
347}
348
349static void summit_vector_allocation_domain(int cpu, cpumask_t *retmask)
350{
351 /* Careful. Some cpus do not strictly honor the set of cpus
352 * specified in the interrupt destination when using lowest
353 * priority interrupt delivery mode.
354 *
355 * In particular there was a hyperthreading cpu observed to
356 * deliver interrupts to the wrong hyperthread when only one
357 * hyperthread was specified in the interrupt desitination.
358 */
359 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
360}
361
362#ifdef CONFIG_X86_SUMMIT_NUMA
363static struct rio_table_hdr *rio_table_hdr;
364static struct scal_detail *scal_devs[MAX_NUMNODES];
365static struct rio_detail *rio_devs[MAX_NUMNODES*4];
366
367#ifndef CONFIG_X86_NUMAQ
368static int mp_bus_id_to_node[MAX_MP_BUSSES];
369#endif
370
371static int setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
372{
373 int twister = 0, node = 0;
374 int i, bus, num_buses;
375
376 for (i = 0; i < rio_table_hdr->num_rio_dev; i++) {
377 if (rio_devs[i]->node_id == rio_devs[wpeg_num]->owner_id) {
378 twister = rio_devs[i]->owner_id;
379 break;
380 }
381 }
382 if (i == rio_table_hdr->num_rio_dev) {
383 printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __func__);
384 return last_bus;
385 }
386
387 for (i = 0; i < rio_table_hdr->num_scal_dev; i++) {
388 if (scal_devs[i]->node_id == twister) {
389 node = scal_devs[i]->node_id;
390 break;
391 }
392 }
393 if (i == rio_table_hdr->num_scal_dev) {
394 printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __func__);
395 return last_bus;
396 }
397
398 switch (rio_devs[wpeg_num]->type) {
399 case CompatWPEG:
400 /*
401 * The Compatibility Winnipeg controls the 2 legacy buses,
402 * the 66MHz PCI bus [2 slots] and the 2 "extra" buses in case
403 * a PCI-PCI bridge card is used in either slot: total 5 buses.
404 */
405 num_buses = 5;
406 break;
407 case AltWPEG:
408 /*
409 * The Alternate Winnipeg controls the 2 133MHz buses [1 slot
410 * each], their 2 "extra" buses, the 100MHz bus [2 slots] and
411 * the "extra" buses for each of those slots: total 7 buses.
412 */
413 num_buses = 7;
414 break;
415 case LookOutAWPEG:
416 case LookOutBWPEG:
417 /*
418 * A Lookout Winnipeg controls 3 100MHz buses [2 slots each]
419 * & the "extra" buses for each of those slots: total 9 buses.
420 */
421 num_buses = 9;
422 break;
423 default:
424 printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __func__);
425 return last_bus;
426 }
427
428 for (bus = last_bus; bus < last_bus + num_buses; bus++)
429 mp_bus_id_to_node[bus] = node;
430 return bus;
431}
432
433static int build_detail_arrays(void)
434{
435 unsigned long ptr;
436 int i, scal_detail_size, rio_detail_size;
437
438 if (rio_table_hdr->num_scal_dev > MAX_NUMNODES) {
439 printk(KERN_WARNING "%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n", __func__, MAX_NUMNODES, rio_table_hdr->num_scal_dev);
440 return 0;
441 }
442
443 switch (rio_table_hdr->version) {
444 default:
445 printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __func__, rio_table_hdr->version);
446 return 0;
447 case 2:
448 scal_detail_size = 11;
449 rio_detail_size = 13;
450 break;
451 case 3:
452 scal_detail_size = 12;
453 rio_detail_size = 15;
454 break;
455 }
456
457 ptr = (unsigned long)rio_table_hdr + 3;
458 for (i = 0; i < rio_table_hdr->num_scal_dev; i++, ptr += scal_detail_size)
459 scal_devs[i] = (struct scal_detail *)ptr;
460
461 for (i = 0; i < rio_table_hdr->num_rio_dev; i++, ptr += rio_detail_size)
462 rio_devs[i] = (struct rio_detail *)ptr;
463
464 return 1;
465}
466
467void setup_summit(void)
468{
469 unsigned long ptr;
470 unsigned short offset;
471 int i, next_wpeg, next_bus = 0;
472
473 /* The pointer to the EBDA is stored in the word @ phys 0x40E(40:0E) */
474 ptr = get_bios_ebda();
475 ptr = (unsigned long)phys_to_virt(ptr);
476
477 rio_table_hdr = NULL;
478 offset = 0x180;
479 while (offset) {
480 /* The block id is stored in the 2nd word */
481 if (*((unsigned short *)(ptr + offset + 2)) == 0x4752) {
482 /* set the pointer past the offset & block id */
483 rio_table_hdr = (struct rio_table_hdr *)(ptr + offset + 4);
484 break;
485 }
486 /* The next offset is stored in the 1st word. 0 means no more */
487 offset = *((unsigned short *)(ptr + offset));
488 }
489 if (!rio_table_hdr) {
490 printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __func__);
491 return;
492 }
493
494 if (!build_detail_arrays())
495 return;
496
497 /* The first Winnipeg we're looking for has an index of 0 */
498 next_wpeg = 0;
499 do {
500 for (i = 0; i < rio_table_hdr->num_rio_dev; i++) {
501 if (is_WPEG(rio_devs[i]) && rio_devs[i]->WP_index == next_wpeg) {
502 /* It's the Winnipeg we're looking for! */
503 next_bus = setup_pci_node_map_for_wpeg(i, next_bus);
504 next_wpeg++;
505 break;
506 }
507 }
508 /*
509 * If we go through all Rio devices and don't find one with
510 * the next index, it means we've found all the Winnipegs,
511 * and thus all the PCI buses.
512 */
513 if (i == rio_table_hdr->num_rio_dev)
514 next_wpeg = 0;
515 } while (next_wpeg != 0);
516}
517#endif
518
519struct apic apic_summit = {
520
521 .name = "summit",
522 .probe = probe_summit,
523 .acpi_madt_oem_check = summit_acpi_madt_oem_check,
524 .apic_id_registered = summit_apic_id_registered,
525
526 .irq_delivery_mode = dest_LowestPrio,
527 /* logical delivery broadcast to all CPUs: */
528 .irq_dest_mode = 1,
529
530 .target_cpus = summit_target_cpus,
531 .disable_esr = 1,
532 .dest_logical = APIC_DEST_LOGICAL,
533 .check_apicid_used = summit_check_apicid_used,
534 .check_apicid_present = summit_check_apicid_present,
535
536 .vector_allocation_domain = summit_vector_allocation_domain,
537 .init_apic_ldr = summit_init_apic_ldr,
538
539 .ioapic_phys_id_map = summit_ioapic_phys_id_map,
540 .setup_apic_routing = summit_setup_apic_routing,
541 .multi_timer_check = NULL,
542 .apicid_to_node = summit_apicid_to_node,
543 .cpu_to_logical_apicid = summit_cpu_to_logical_apicid,
544 .cpu_present_to_apicid = summit_cpu_present_to_apicid,
545 .apicid_to_cpu_present = summit_apicid_to_cpu_present,
546 .setup_portio_remap = NULL,
547 .check_phys_apicid_present = summit_check_phys_apicid_present,
548 .enable_apic_mode = NULL,
549 .phys_pkg_id = summit_phys_pkg_id,
550 .mps_oem_check = summit_mps_oem_check,
551
552 .get_apic_id = summit_get_apic_id,
553 .set_apic_id = NULL,
554 .apic_id_mask = 0xFF << 24,
555
556 .cpu_mask_to_apicid = summit_cpu_mask_to_apicid,
557 .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and,
558
559 .send_IPI_mask = summit_send_IPI_mask,
560 .send_IPI_mask_allbutself = NULL,
561 .send_IPI_allbutself = summit_send_IPI_allbutself,
562 .send_IPI_all = summit_send_IPI_all,
563 .send_IPI_self = default_send_IPI_self,
564
565 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
566 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
567
568 .wait_for_init_deassert = default_wait_for_init_deassert,
569
570 .smp_callin_clear_local_apic = NULL,
571 .inquire_remote_apic = default_inquire_remote_apic,
572
573 .read = native_apic_mem_read,
574 .write = native_apic_mem_write,
575 .icr_read = native_apic_icr_read,
576 .icr_write = native_apic_icr_write,
577 .wait_icr_idle = native_apic_wait_icr_idle,
578 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
579};
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
index 6ce497cc372d..8fb87b6dd633 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/apic/x2apic_cluster.c
@@ -7,17 +7,14 @@
7#include <linux/dmar.h> 7#include <linux/dmar.h>
8 8
9#include <asm/smp.h> 9#include <asm/smp.h>
10#include <asm/apic.h>
10#include <asm/ipi.h> 11#include <asm/ipi.h>
11#include <asm/genapic.h>
12 12
13DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid); 13DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid);
14 14
15static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 15static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
16{ 16{
17 if (cpu_has_x2apic) 17 return x2apic_enabled();
18 return 1;
19
20 return 0;
21} 18}
22 19
23/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 20/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */
@@ -36,8 +33,8 @@ static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
36 cpumask_set_cpu(cpu, retmask); 33 cpumask_set_cpu(cpu, retmask);
37} 34}
38 35
39static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, 36static void
40 unsigned int dest) 37 __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest)
41{ 38{
42 unsigned long cfg; 39 unsigned long cfg;
43 40
@@ -46,7 +43,7 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
46 /* 43 /*
47 * send the IPI. 44 * send the IPI.
48 */ 45 */
49 x2apic_icr_write(cfg, apicid); 46 native_x2apic_icr_write(cfg, apicid);
50} 47}
51 48
52/* 49/*
@@ -57,45 +54,50 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
57 */ 54 */
58static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) 55static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
59{ 56{
60 unsigned long flags;
61 unsigned long query_cpu; 57 unsigned long query_cpu;
58 unsigned long flags;
62 59
63 local_irq_save(flags); 60 local_irq_save(flags);
64 for_each_cpu(query_cpu, mask) 61 for_each_cpu(query_cpu, mask) {
65 __x2apic_send_IPI_dest( 62 __x2apic_send_IPI_dest(
66 per_cpu(x86_cpu_to_logical_apicid, query_cpu), 63 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
67 vector, APIC_DEST_LOGICAL); 64 vector, apic->dest_logical);
65 }
68 local_irq_restore(flags); 66 local_irq_restore(flags);
69} 67}
70 68
71static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, 69static void
72 int vector) 70 x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
73{ 71{
74 unsigned long flags;
75 unsigned long query_cpu;
76 unsigned long this_cpu = smp_processor_id(); 72 unsigned long this_cpu = smp_processor_id();
73 unsigned long query_cpu;
74 unsigned long flags;
77 75
78 local_irq_save(flags); 76 local_irq_save(flags);
79 for_each_cpu(query_cpu, mask) 77 for_each_cpu(query_cpu, mask) {
80 if (query_cpu != this_cpu) 78 if (query_cpu == this_cpu)
81 __x2apic_send_IPI_dest( 79 continue;
80 __x2apic_send_IPI_dest(
82 per_cpu(x86_cpu_to_logical_apicid, query_cpu), 81 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
83 vector, APIC_DEST_LOGICAL); 82 vector, apic->dest_logical);
83 }
84 local_irq_restore(flags); 84 local_irq_restore(flags);
85} 85}
86 86
87static void x2apic_send_IPI_allbutself(int vector) 87static void x2apic_send_IPI_allbutself(int vector)
88{ 88{
89 unsigned long flags;
90 unsigned long query_cpu;
91 unsigned long this_cpu = smp_processor_id(); 89 unsigned long this_cpu = smp_processor_id();
90 unsigned long query_cpu;
91 unsigned long flags;
92 92
93 local_irq_save(flags); 93 local_irq_save(flags);
94 for_each_online_cpu(query_cpu) 94 for_each_online_cpu(query_cpu) {
95 if (query_cpu != this_cpu) 95 if (query_cpu == this_cpu)
96 __x2apic_send_IPI_dest( 96 continue;
97 __x2apic_send_IPI_dest(
97 per_cpu(x86_cpu_to_logical_apicid, query_cpu), 98 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
98 vector, APIC_DEST_LOGICAL); 99 vector, apic->dest_logical);
100 }
99 local_irq_restore(flags); 101 local_irq_restore(flags);
100} 102}
101 103
@@ -111,21 +113,21 @@ static int x2apic_apic_id_registered(void)
111 113
112static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask) 114static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
113{ 115{
114 int cpu;
115
116 /* 116 /*
117 * We're using fixed IRQ delivery, can only return one logical APIC ID. 117 * We're using fixed IRQ delivery, can only return one logical APIC ID.
118 * May as well be the first. 118 * May as well be the first.
119 */ 119 */
120 cpu = cpumask_first(cpumask); 120 int cpu = cpumask_first(cpumask);
121
121 if ((unsigned)cpu < nr_cpu_ids) 122 if ((unsigned)cpu < nr_cpu_ids)
122 return per_cpu(x86_cpu_to_logical_apicid, cpu); 123 return per_cpu(x86_cpu_to_logical_apicid, cpu);
123 else 124 else
124 return BAD_APICID; 125 return BAD_APICID;
125} 126}
126 127
127static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask, 128static unsigned int
128 const struct cpumask *andmask) 129x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
130 const struct cpumask *andmask)
129{ 131{
130 int cpu; 132 int cpu;
131 133
@@ -133,15 +135,18 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
133 * We're using fixed IRQ delivery, can only return one logical APIC ID. 135 * We're using fixed IRQ delivery, can only return one logical APIC ID.
134 * May as well be the first. 136 * May as well be the first.
135 */ 137 */
136 for_each_cpu_and(cpu, cpumask, andmask) 138 for_each_cpu_and(cpu, cpumask, andmask) {
137 if (cpumask_test_cpu(cpu, cpu_online_mask)) 139 if (cpumask_test_cpu(cpu, cpu_online_mask))
138 break; 140 break;
141 }
142
139 if (cpu < nr_cpu_ids) 143 if (cpu < nr_cpu_ids)
140 return per_cpu(x86_cpu_to_logical_apicid, cpu); 144 return per_cpu(x86_cpu_to_logical_apicid, cpu);
145
141 return BAD_APICID; 146 return BAD_APICID;
142} 147}
143 148
144static unsigned int get_apic_id(unsigned long x) 149static unsigned int x2apic_cluster_phys_get_apic_id(unsigned long x)
145{ 150{
146 unsigned int id; 151 unsigned int id;
147 152
@@ -157,7 +162,7 @@ static unsigned long set_apic_id(unsigned int id)
157 return x; 162 return x;
158} 163}
159 164
160static unsigned int phys_pkg_id(int index_msb) 165static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb)
161{ 166{
162 return current_cpu_data.initial_apicid >> index_msb; 167 return current_cpu_data.initial_apicid >> index_msb;
163} 168}
@@ -172,27 +177,63 @@ static void init_x2apic_ldr(void)
172 int cpu = smp_processor_id(); 177 int cpu = smp_processor_id();
173 178
174 per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR); 179 per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR);
175 return; 180}
176} 181
177 182struct apic apic_x2apic_cluster = {
178struct genapic apic_x2apic_cluster = { 183
179 .name = "cluster x2apic", 184 .name = "cluster x2apic",
180 .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, 185 .probe = NULL,
181 .int_delivery_mode = dest_LowestPrio, 186 .acpi_madt_oem_check = x2apic_acpi_madt_oem_check,
182 .int_dest_mode = (APIC_DEST_LOGICAL != 0), 187 .apic_id_registered = x2apic_apic_id_registered,
183 .target_cpus = x2apic_target_cpus, 188
184 .vector_allocation_domain = x2apic_vector_allocation_domain, 189 .irq_delivery_mode = dest_LowestPrio,
185 .apic_id_registered = x2apic_apic_id_registered, 190 .irq_dest_mode = 1, /* logical */
186 .init_apic_ldr = init_x2apic_ldr, 191
187 .send_IPI_all = x2apic_send_IPI_all, 192 .target_cpus = x2apic_target_cpus,
188 .send_IPI_allbutself = x2apic_send_IPI_allbutself, 193 .disable_esr = 0,
189 .send_IPI_mask = x2apic_send_IPI_mask, 194 .dest_logical = APIC_DEST_LOGICAL,
190 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself, 195 .check_apicid_used = NULL,
191 .send_IPI_self = x2apic_send_IPI_self, 196 .check_apicid_present = NULL,
192 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, 197
193 .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and, 198 .vector_allocation_domain = x2apic_vector_allocation_domain,
194 .phys_pkg_id = phys_pkg_id, 199 .init_apic_ldr = init_x2apic_ldr,
195 .get_apic_id = get_apic_id, 200
196 .set_apic_id = set_apic_id, 201 .ioapic_phys_id_map = NULL,
197 .apic_id_mask = (0xFFFFFFFFu), 202 .setup_apic_routing = NULL,
203 .multi_timer_check = NULL,
204 .apicid_to_node = NULL,
205 .cpu_to_logical_apicid = NULL,
206 .cpu_present_to_apicid = default_cpu_present_to_apicid,
207 .apicid_to_cpu_present = NULL,
208 .setup_portio_remap = NULL,
209 .check_phys_apicid_present = default_check_phys_apicid_present,
210 .enable_apic_mode = NULL,
211 .phys_pkg_id = x2apic_cluster_phys_pkg_id,
212 .mps_oem_check = NULL,
213
214 .get_apic_id = x2apic_cluster_phys_get_apic_id,
215 .set_apic_id = set_apic_id,
216 .apic_id_mask = 0xFFFFFFFFu,
217
218 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,
219 .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and,
220
221 .send_IPI_mask = x2apic_send_IPI_mask,
222 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself,
223 .send_IPI_allbutself = x2apic_send_IPI_allbutself,
224 .send_IPI_all = x2apic_send_IPI_all,
225 .send_IPI_self = x2apic_send_IPI_self,
226
227 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
228 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
229 .wait_for_init_deassert = NULL,
230 .smp_callin_clear_local_apic = NULL,
231 .inquire_remote_apic = NULL,
232
233 .read = native_apic_msr_read,
234 .write = native_apic_msr_write,
235 .icr_read = native_x2apic_icr_read,
236 .icr_write = native_x2apic_icr_write,
237 .wait_icr_idle = native_x2apic_wait_icr_idle,
238 .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle,
198}; 239};
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 21bcc0e098ba..23625b9f98b2 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -7,10 +7,10 @@
7#include <linux/dmar.h> 7#include <linux/dmar.h>
8 8
9#include <asm/smp.h> 9#include <asm/smp.h>
10#include <asm/apic.h>
10#include <asm/ipi.h> 11#include <asm/ipi.h>
11#include <asm/genapic.h>
12 12
13static int x2apic_phys; 13int x2apic_phys;
14 14
15static int set_x2apic_phys_mode(char *arg) 15static int set_x2apic_phys_mode(char *arg)
16{ 16{
@@ -21,10 +21,10 @@ early_param("x2apic_phys", set_x2apic_phys_mode);
21 21
22static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 22static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
23{ 23{
24 if (cpu_has_x2apic && x2apic_phys) 24 if (x2apic_phys)
25 return 1; 25 return x2apic_enabled();
26 26 else
27 return 0; 27 return 0;
28} 28}
29 29
30/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 30/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */
@@ -50,13 +50,13 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
50 /* 50 /*
51 * send the IPI. 51 * send the IPI.
52 */ 52 */
53 x2apic_icr_write(cfg, apicid); 53 native_x2apic_icr_write(cfg, apicid);
54} 54}
55 55
56static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector) 56static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
57{ 57{
58 unsigned long flags;
59 unsigned long query_cpu; 58 unsigned long query_cpu;
59 unsigned long flags;
60 60
61 local_irq_save(flags); 61 local_irq_save(flags);
62 for_each_cpu(query_cpu, mask) { 62 for_each_cpu(query_cpu, mask) {
@@ -66,12 +66,12 @@ static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
66 local_irq_restore(flags); 66 local_irq_restore(flags);
67} 67}
68 68
69static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, 69static void
70 int vector) 70 x2apic_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
71{ 71{
72 unsigned long flags;
73 unsigned long query_cpu;
74 unsigned long this_cpu = smp_processor_id(); 72 unsigned long this_cpu = smp_processor_id();
73 unsigned long query_cpu;
74 unsigned long flags;
75 75
76 local_irq_save(flags); 76 local_irq_save(flags);
77 for_each_cpu(query_cpu, mask) { 77 for_each_cpu(query_cpu, mask) {
@@ -85,16 +85,17 @@ static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
85 85
86static void x2apic_send_IPI_allbutself(int vector) 86static void x2apic_send_IPI_allbutself(int vector)
87{ 87{
88 unsigned long flags;
89 unsigned long query_cpu;
90 unsigned long this_cpu = smp_processor_id(); 88 unsigned long this_cpu = smp_processor_id();
89 unsigned long query_cpu;
90 unsigned long flags;
91 91
92 local_irq_save(flags); 92 local_irq_save(flags);
93 for_each_online_cpu(query_cpu) 93 for_each_online_cpu(query_cpu) {
94 if (query_cpu != this_cpu) 94 if (query_cpu == this_cpu)
95 __x2apic_send_IPI_dest( 95 continue;
96 per_cpu(x86_cpu_to_apicid, query_cpu), 96 __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu),
97 vector, APIC_DEST_PHYSICAL); 97 vector, APIC_DEST_PHYSICAL);
98 }
98 local_irq_restore(flags); 99 local_irq_restore(flags);
99} 100}
100 101
@@ -110,21 +111,21 @@ static int x2apic_apic_id_registered(void)
110 111
111static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask) 112static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
112{ 113{
113 int cpu;
114
115 /* 114 /*
116 * We're using fixed IRQ delivery, can only return one phys APIC ID. 115 * We're using fixed IRQ delivery, can only return one phys APIC ID.
117 * May as well be the first. 116 * May as well be the first.
118 */ 117 */
119 cpu = cpumask_first(cpumask); 118 int cpu = cpumask_first(cpumask);
119
120 if ((unsigned)cpu < nr_cpu_ids) 120 if ((unsigned)cpu < nr_cpu_ids)
121 return per_cpu(x86_cpu_to_apicid, cpu); 121 return per_cpu(x86_cpu_to_apicid, cpu);
122 else 122 else
123 return BAD_APICID; 123 return BAD_APICID;
124} 124}
125 125
126static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask, 126static unsigned int
127 const struct cpumask *andmask) 127x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
128 const struct cpumask *andmask)
128{ 129{
129 int cpu; 130 int cpu;
130 131
@@ -132,31 +133,28 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
132 * We're using fixed IRQ delivery, can only return one phys APIC ID. 133 * We're using fixed IRQ delivery, can only return one phys APIC ID.
133 * May as well be the first. 134 * May as well be the first.
134 */ 135 */
135 for_each_cpu_and(cpu, cpumask, andmask) 136 for_each_cpu_and(cpu, cpumask, andmask) {
136 if (cpumask_test_cpu(cpu, cpu_online_mask)) 137 if (cpumask_test_cpu(cpu, cpu_online_mask))
137 break; 138 break;
139 }
140
138 if (cpu < nr_cpu_ids) 141 if (cpu < nr_cpu_ids)
139 return per_cpu(x86_cpu_to_apicid, cpu); 142 return per_cpu(x86_cpu_to_apicid, cpu);
143
140 return BAD_APICID; 144 return BAD_APICID;
141} 145}
142 146
143static unsigned int get_apic_id(unsigned long x) 147static unsigned int x2apic_phys_get_apic_id(unsigned long x)
144{ 148{
145 unsigned int id; 149 return x;
146
147 id = x;
148 return id;
149} 150}
150 151
151static unsigned long set_apic_id(unsigned int id) 152static unsigned long set_apic_id(unsigned int id)
152{ 153{
153 unsigned long x; 154 return id;
154
155 x = id;
156 return x;
157} 155}
158 156
159static unsigned int phys_pkg_id(int index_msb) 157static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
160{ 158{
161 return current_cpu_data.initial_apicid >> index_msb; 159 return current_cpu_data.initial_apicid >> index_msb;
162} 160}
@@ -168,27 +166,63 @@ static void x2apic_send_IPI_self(int vector)
168 166
169static void init_x2apic_ldr(void) 167static void init_x2apic_ldr(void)
170{ 168{
171 return; 169}
172} 170
173 171struct apic apic_x2apic_phys = {
174struct genapic apic_x2apic_phys = { 172
175 .name = "physical x2apic", 173 .name = "physical x2apic",
176 .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, 174 .probe = NULL,
177 .int_delivery_mode = dest_Fixed, 175 .acpi_madt_oem_check = x2apic_acpi_madt_oem_check,
178 .int_dest_mode = (APIC_DEST_PHYSICAL != 0), 176 .apic_id_registered = x2apic_apic_id_registered,
179 .target_cpus = x2apic_target_cpus, 177
180 .vector_allocation_domain = x2apic_vector_allocation_domain, 178 .irq_delivery_mode = dest_Fixed,
181 .apic_id_registered = x2apic_apic_id_registered, 179 .irq_dest_mode = 0, /* physical */
182 .init_apic_ldr = init_x2apic_ldr, 180
183 .send_IPI_all = x2apic_send_IPI_all, 181 .target_cpus = x2apic_target_cpus,
184 .send_IPI_allbutself = x2apic_send_IPI_allbutself, 182 .disable_esr = 0,
185 .send_IPI_mask = x2apic_send_IPI_mask, 183 .dest_logical = 0,
186 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself, 184 .check_apicid_used = NULL,
187 .send_IPI_self = x2apic_send_IPI_self, 185 .check_apicid_present = NULL,
188 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, 186
189 .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and, 187 .vector_allocation_domain = x2apic_vector_allocation_domain,
190 .phys_pkg_id = phys_pkg_id, 188 .init_apic_ldr = init_x2apic_ldr,
191 .get_apic_id = get_apic_id, 189
192 .set_apic_id = set_apic_id, 190 .ioapic_phys_id_map = NULL,
193 .apic_id_mask = (0xFFFFFFFFu), 191 .setup_apic_routing = NULL,
192 .multi_timer_check = NULL,
193 .apicid_to_node = NULL,
194 .cpu_to_logical_apicid = NULL,
195 .cpu_present_to_apicid = default_cpu_present_to_apicid,
196 .apicid_to_cpu_present = NULL,
197 .setup_portio_remap = NULL,
198 .check_phys_apicid_present = default_check_phys_apicid_present,
199 .enable_apic_mode = NULL,
200 .phys_pkg_id = x2apic_phys_pkg_id,
201 .mps_oem_check = NULL,
202
203 .get_apic_id = x2apic_phys_get_apic_id,
204 .set_apic_id = set_apic_id,
205 .apic_id_mask = 0xFFFFFFFFu,
206
207 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,
208 .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and,
209
210 .send_IPI_mask = x2apic_send_IPI_mask,
211 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself,
212 .send_IPI_allbutself = x2apic_send_IPI_allbutself,
213 .send_IPI_all = x2apic_send_IPI_all,
214 .send_IPI_self = x2apic_send_IPI_self,
215
216 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
217 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
218 .wait_for_init_deassert = NULL,
219 .smp_callin_clear_local_apic = NULL,
220 .inquire_remote_apic = NULL,
221
222 .read = native_apic_msr_read,
223 .write = native_apic_msr_write,
224 .icr_read = native_x2apic_icr_read,
225 .icr_write = native_x2apic_icr_write,
226 .wait_icr_idle = native_x2apic_wait_icr_idle,
227 .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle,
194}; 228};
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index b193e082f6ce..1bd6da1f8fad 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -7,27 +7,28 @@
7 * 7 *
8 * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved.
9 */ 9 */
10
11#include <linux/kernel.h>
12#include <linux/threads.h>
13#include <linux/cpu.h>
14#include <linux/cpumask.h> 10#include <linux/cpumask.h>
11#include <linux/hardirq.h>
12#include <linux/proc_fs.h>
13#include <linux/threads.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
15#include <linux/string.h> 16#include <linux/string.h>
16#include <linux/ctype.h> 17#include <linux/ctype.h>
17#include <linux/init.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/module.h>
20#include <linux/hardirq.h>
21#include <linux/timer.h> 19#include <linux/timer.h>
22#include <linux/proc_fs.h> 20#include <linux/cpu.h>
23#include <asm/current.h> 21#include <linux/init.h>
24#include <asm/smp.h> 22
25#include <asm/ipi.h>
26#include <asm/genapic.h>
27#include <asm/pgtable.h>
28#include <asm/uv/uv_mmrs.h> 23#include <asm/uv/uv_mmrs.h>
29#include <asm/uv/uv_hub.h> 24#include <asm/uv/uv_hub.h>
25#include <asm/current.h>
26#include <asm/pgtable.h>
30#include <asm/uv/bios.h> 27#include <asm/uv/bios.h>
28#include <asm/uv/uv.h>
29#include <asm/apic.h>
30#include <asm/ipi.h>
31#include <asm/smp.h>
31 32
32DEFINE_PER_CPU(int, x2apic_extra_bits); 33DEFINE_PER_CPU(int, x2apic_extra_bits);
33 34
@@ -90,39 +91,43 @@ static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask)
90 cpumask_set_cpu(cpu, retmask); 91 cpumask_set_cpu(cpu, retmask);
91} 92}
92 93
93int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip) 94static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
94{ 95{
96#ifdef CONFIG_SMP
95 unsigned long val; 97 unsigned long val;
96 int pnode; 98 int pnode;
97 99
98 pnode = uv_apicid_to_pnode(phys_apicid); 100 pnode = uv_apicid_to_pnode(phys_apicid);
99 val = (1UL << UVH_IPI_INT_SEND_SHFT) | 101 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
100 (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | 102 (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) |
101 (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | 103 ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) |
102 APIC_DM_INIT; 104 APIC_DM_INIT;
103 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 105 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
104 mdelay(10); 106 mdelay(10);
105 107
106 val = (1UL << UVH_IPI_INT_SEND_SHFT) | 108 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
107 (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | 109 (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) |
108 (((long)start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | 110 ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) |
109 APIC_DM_STARTUP; 111 APIC_DM_STARTUP;
110 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 112 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
113
114 atomic_set(&init_deasserted, 1);
115#endif
111 return 0; 116 return 0;
112} 117}
113 118
114static void uv_send_IPI_one(int cpu, int vector) 119static void uv_send_IPI_one(int cpu, int vector)
115{ 120{
116 unsigned long val, apicid, lapicid; 121 unsigned long val, apicid;
117 int pnode; 122 int pnode;
118 123
119 apicid = per_cpu(x86_cpu_to_apicid, cpu); 124 apicid = per_cpu(x86_cpu_to_apicid, cpu);
120 lapicid = apicid & 0x3f; /* ZZZ macro needed */
121 pnode = uv_apicid_to_pnode(apicid); 125 pnode = uv_apicid_to_pnode(apicid);
122 val = 126
123 (1UL << UVH_IPI_INT_SEND_SHFT) | (lapicid << 127 val = (1UL << UVH_IPI_INT_SEND_SHFT) |
124 UVH_IPI_INT_APIC_ID_SHFT) | 128 (apicid << UVH_IPI_INT_APIC_ID_SHFT) |
125 (vector << UVH_IPI_INT_VECTOR_SHFT); 129 (vector << UVH_IPI_INT_VECTOR_SHFT);
130
126 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 131 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
127} 132}
128 133
@@ -136,22 +141,24 @@ static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
136 141
137static void uv_send_IPI_mask_allbutself(const struct cpumask *mask, int vector) 142static void uv_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
138{ 143{
139 unsigned int cpu;
140 unsigned int this_cpu = smp_processor_id(); 144 unsigned int this_cpu = smp_processor_id();
145 unsigned int cpu;
141 146
142 for_each_cpu(cpu, mask) 147 for_each_cpu(cpu, mask) {
143 if (cpu != this_cpu) 148 if (cpu != this_cpu)
144 uv_send_IPI_one(cpu, vector); 149 uv_send_IPI_one(cpu, vector);
150 }
145} 151}
146 152
147static void uv_send_IPI_allbutself(int vector) 153static void uv_send_IPI_allbutself(int vector)
148{ 154{
149 unsigned int cpu;
150 unsigned int this_cpu = smp_processor_id(); 155 unsigned int this_cpu = smp_processor_id();
156 unsigned int cpu;
151 157
152 for_each_online_cpu(cpu) 158 for_each_online_cpu(cpu) {
153 if (cpu != this_cpu) 159 if (cpu != this_cpu)
154 uv_send_IPI_one(cpu, vector); 160 uv_send_IPI_one(cpu, vector);
161 }
155} 162}
156 163
157static void uv_send_IPI_all(int vector) 164static void uv_send_IPI_all(int vector)
@@ -170,21 +177,21 @@ static void uv_init_apic_ldr(void)
170 177
171static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask) 178static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask)
172{ 179{
173 int cpu;
174
175 /* 180 /*
176 * We're using fixed IRQ delivery, can only return one phys APIC ID. 181 * We're using fixed IRQ delivery, can only return one phys APIC ID.
177 * May as well be the first. 182 * May as well be the first.
178 */ 183 */
179 cpu = cpumask_first(cpumask); 184 int cpu = cpumask_first(cpumask);
185
180 if ((unsigned)cpu < nr_cpu_ids) 186 if ((unsigned)cpu < nr_cpu_ids)
181 return per_cpu(x86_cpu_to_apicid, cpu); 187 return per_cpu(x86_cpu_to_apicid, cpu);
182 else 188 else
183 return BAD_APICID; 189 return BAD_APICID;
184} 190}
185 191
186static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask, 192static unsigned int
187 const struct cpumask *andmask) 193uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
194 const struct cpumask *andmask)
188{ 195{
189 int cpu; 196 int cpu;
190 197
@@ -192,15 +199,17 @@ static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
192 * We're using fixed IRQ delivery, can only return one phys APIC ID. 199 * We're using fixed IRQ delivery, can only return one phys APIC ID.
193 * May as well be the first. 200 * May as well be the first.
194 */ 201 */
195 for_each_cpu_and(cpu, cpumask, andmask) 202 for_each_cpu_and(cpu, cpumask, andmask) {
196 if (cpumask_test_cpu(cpu, cpu_online_mask)) 203 if (cpumask_test_cpu(cpu, cpu_online_mask))
197 break; 204 break;
205 }
198 if (cpu < nr_cpu_ids) 206 if (cpu < nr_cpu_ids)
199 return per_cpu(x86_cpu_to_apicid, cpu); 207 return per_cpu(x86_cpu_to_apicid, cpu);
208
200 return BAD_APICID; 209 return BAD_APICID;
201} 210}
202 211
203static unsigned int get_apic_id(unsigned long x) 212static unsigned int x2apic_get_apic_id(unsigned long x)
204{ 213{
205 unsigned int id; 214 unsigned int id;
206 215
@@ -222,10 +231,10 @@ static unsigned long set_apic_id(unsigned int id)
222static unsigned int uv_read_apic_id(void) 231static unsigned int uv_read_apic_id(void)
223{ 232{
224 233
225 return get_apic_id(apic_read(APIC_ID)); 234 return x2apic_get_apic_id(apic_read(APIC_ID));
226} 235}
227 236
228static unsigned int phys_pkg_id(int index_msb) 237static int uv_phys_pkg_id(int initial_apicid, int index_msb)
229{ 238{
230 return uv_read_apic_id() >> index_msb; 239 return uv_read_apic_id() >> index_msb;
231} 240}
@@ -235,26 +244,64 @@ static void uv_send_IPI_self(int vector)
235 apic_write(APIC_SELF_IPI, vector); 244 apic_write(APIC_SELF_IPI, vector);
236} 245}
237 246
238struct genapic apic_x2apic_uv_x = { 247struct apic apic_x2apic_uv_x = {
239 .name = "UV large system", 248
240 .acpi_madt_oem_check = uv_acpi_madt_oem_check, 249 .name = "UV large system",
241 .int_delivery_mode = dest_Fixed, 250 .probe = NULL,
242 .int_dest_mode = (APIC_DEST_PHYSICAL != 0), 251 .acpi_madt_oem_check = uv_acpi_madt_oem_check,
243 .target_cpus = uv_target_cpus, 252 .apic_id_registered = uv_apic_id_registered,
244 .vector_allocation_domain = uv_vector_allocation_domain, 253
245 .apic_id_registered = uv_apic_id_registered, 254 .irq_delivery_mode = dest_Fixed,
246 .init_apic_ldr = uv_init_apic_ldr, 255 .irq_dest_mode = 1, /* logical */
247 .send_IPI_all = uv_send_IPI_all, 256
248 .send_IPI_allbutself = uv_send_IPI_allbutself, 257 .target_cpus = uv_target_cpus,
249 .send_IPI_mask = uv_send_IPI_mask, 258 .disable_esr = 0,
250 .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself, 259 .dest_logical = APIC_DEST_LOGICAL,
251 .send_IPI_self = uv_send_IPI_self, 260 .check_apicid_used = NULL,
252 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, 261 .check_apicid_present = NULL,
253 .cpu_mask_to_apicid_and = uv_cpu_mask_to_apicid_and, 262
254 .phys_pkg_id = phys_pkg_id, 263 .vector_allocation_domain = uv_vector_allocation_domain,
255 .get_apic_id = get_apic_id, 264 .init_apic_ldr = uv_init_apic_ldr,
256 .set_apic_id = set_apic_id, 265
257 .apic_id_mask = (0xFFFFFFFFu), 266 .ioapic_phys_id_map = NULL,
267 .setup_apic_routing = NULL,
268 .multi_timer_check = NULL,
269 .apicid_to_node = NULL,
270 .cpu_to_logical_apicid = NULL,
271 .cpu_present_to_apicid = default_cpu_present_to_apicid,
272 .apicid_to_cpu_present = NULL,
273 .setup_portio_remap = NULL,
274 .check_phys_apicid_present = default_check_phys_apicid_present,
275 .enable_apic_mode = NULL,
276 .phys_pkg_id = uv_phys_pkg_id,
277 .mps_oem_check = NULL,
278
279 .get_apic_id = x2apic_get_apic_id,
280 .set_apic_id = set_apic_id,
281 .apic_id_mask = 0xFFFFFFFFu,
282
283 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid,
284 .cpu_mask_to_apicid_and = uv_cpu_mask_to_apicid_and,
285
286 .send_IPI_mask = uv_send_IPI_mask,
287 .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself,
288 .send_IPI_allbutself = uv_send_IPI_allbutself,
289 .send_IPI_all = uv_send_IPI_all,
290 .send_IPI_self = uv_send_IPI_self,
291
292 .wakeup_secondary_cpu = uv_wakeup_secondary,
293 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
294 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
295 .wait_for_init_deassert = NULL,
296 .smp_callin_clear_local_apic = NULL,
297 .inquire_remote_apic = NULL,
298
299 .read = native_apic_msr_read,
300 .write = native_apic_msr_write,
301 .icr_read = native_x2apic_icr_read,
302 .icr_write = native_x2apic_icr_write,
303 .wait_icr_idle = native_x2apic_wait_icr_idle,
304 .safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle,
258}; 305};
259 306
260static __cpuinit void set_x2apic_extra_bits(int pnode) 307static __cpuinit void set_x2apic_extra_bits(int pnode)
@@ -322,7 +369,7 @@ static __init void map_high(char *id, unsigned long base, int shift,
322 paddr = base << shift; 369 paddr = base << shift;
323 bytes = (1UL << shift) * (max_pnode + 1); 370 bytes = (1UL << shift) * (max_pnode + 1);
324 printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr, 371 printk(KERN_INFO "UV: Map %s_HI 0x%lx - 0x%lx\n", id, paddr,
325 paddr + bytes); 372 paddr + bytes);
326 if (map_type == map_uc) 373 if (map_type == map_uc)
327 init_extra_mapping_uc(paddr, bytes); 374 init_extra_mapping_uc(paddr, bytes);
328 else 375 else
@@ -485,7 +532,7 @@ late_initcall(uv_init_heartbeat);
485 532
486/* 533/*
487 * Called on each cpu to initialize the per_cpu UV data area. 534 * Called on each cpu to initialize the per_cpu UV data area.
488 * ZZZ hotplug not supported yet 535 * FIXME: hotplug not supported yet
489 */ 536 */
490void __cpuinit uv_cpu_init(void) 537void __cpuinit uv_cpu_init(void)
491{ 538{
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 266ec6c18b6c..10033fe718e0 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -301,7 +301,7 @@ extern int (*console_blank_hook)(int);
301 */ 301 */
302#define APM_ZERO_SEGS 302#define APM_ZERO_SEGS
303 303
304#include "apm.h" 304#include <asm/apm.h>
305 305
306/* 306/*
307 * Define to re-initialize the interrupt 0 timer to 100 Hz after a suspend. 307 * Define to re-initialize the interrupt 0 timer to 100 Hz after a suspend.
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index ee4df08feee6..fbf2f33e3080 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -75,6 +75,7 @@ void foo(void)
75 OFFSET(PT_DS, pt_regs, ds); 75 OFFSET(PT_DS, pt_regs, ds);
76 OFFSET(PT_ES, pt_regs, es); 76 OFFSET(PT_ES, pt_regs, es);
77 OFFSET(PT_FS, pt_regs, fs); 77 OFFSET(PT_FS, pt_regs, fs);
78 OFFSET(PT_GS, pt_regs, gs);
78 OFFSET(PT_ORIG_EAX, pt_regs, orig_ax); 79 OFFSET(PT_ORIG_EAX, pt_regs, orig_ax);
79 OFFSET(PT_EIP, pt_regs, ip); 80 OFFSET(PT_EIP, pt_regs, ip);
80 OFFSET(PT_CS, pt_regs, cs); 81 OFFSET(PT_CS, pt_regs, cs);
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 1d41d3f1edbc..8793ab33e2c1 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -11,7 +11,6 @@
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/suspend.h> 12#include <linux/suspend.h>
13#include <linux/kbuild.h> 13#include <linux/kbuild.h>
14#include <asm/pda.h>
15#include <asm/processor.h> 14#include <asm/processor.h>
16#include <asm/segment.h> 15#include <asm/segment.h>
17#include <asm/thread_info.h> 16#include <asm/thread_info.h>
@@ -48,16 +47,6 @@ int main(void)
48#endif 47#endif
49 BLANK(); 48 BLANK();
50#undef ENTRY 49#undef ENTRY
51#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
52 ENTRY(kernelstack);
53 ENTRY(oldrsp);
54 ENTRY(pcurrent);
55 ENTRY(irqcount);
56 ENTRY(cpunumber);
57 ENTRY(irqstackptr);
58 ENTRY(data_offset);
59 BLANK();
60#undef ENTRY
61#ifdef CONFIG_PARAVIRT 50#ifdef CONFIG_PARAVIRT
62 BLANK(); 51 BLANK();
63 OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled); 52 OFFSET(PARAVIRT_enabled, pv_info, paravirt_enabled);
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 2cf23634b6d9..6882a735d9c0 100644
--- a/arch/x86/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
@@ -7,7 +7,7 @@
7#include <asm/pat.h> 7#include <asm/pat.h>
8#include <asm/processor.h> 8#include <asm/processor.h>
9 9
10#include <mach_apic.h> 10#include <asm/apic.h>
11 11
12struct cpuid_bit { 12struct cpuid_bit {
13 u16 feature; 13 u16 feature;
@@ -69,7 +69,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
69 */ 69 */
70void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) 70void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
71{ 71{
72#ifdef CONFIG_X86_SMP 72#ifdef CONFIG_SMP
73 unsigned int eax, ebx, ecx, edx, sub_index; 73 unsigned int eax, ebx, ecx, edx, sub_index;
74 unsigned int ht_mask_width, core_plus_mask_width; 74 unsigned int ht_mask_width, core_plus_mask_width;
75 unsigned int core_select_mask, core_level_siblings; 75 unsigned int core_select_mask, core_level_siblings;
@@ -116,22 +116,14 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
116 116
117 core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width; 117 core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width;
118 118
119#ifdef CONFIG_X86_32 119 c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, ht_mask_width)
120 c->cpu_core_id = phys_pkg_id(c->initial_apicid, ht_mask_width)
121 & core_select_mask; 120 & core_select_mask;
122 c->phys_proc_id = phys_pkg_id(c->initial_apicid, core_plus_mask_width); 121 c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, core_plus_mask_width);
123 /* 122 /*
124 * Reinit the apicid, now that we have extended initial_apicid. 123 * Reinit the apicid, now that we have extended initial_apicid.
125 */ 124 */
126 c->apicid = phys_pkg_id(c->initial_apicid, 0); 125 c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
127#else 126
128 c->cpu_core_id = phys_pkg_id(ht_mask_width) & core_select_mask;
129 c->phys_proc_id = phys_pkg_id(core_plus_mask_width);
130 /*
131 * Reinit the apicid, now that we have extended initial_apicid.
132 */
133 c->apicid = phys_pkg_id(0);
134#endif
135 c->x86_max_cores = (core_level_siblings / smp_num_siblings); 127 c->x86_max_cores = (core_level_siblings / smp_num_siblings);
136 128
137 129
@@ -143,37 +135,3 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
143 return; 135 return;
144#endif 136#endif
145} 137}
146
147#ifdef CONFIG_X86_PAT
148void __cpuinit validate_pat_support(struct cpuinfo_x86 *c)
149{
150 if (!cpu_has_pat)
151 pat_disable("PAT not supported by CPU.");
152
153 switch (c->x86_vendor) {
154 case X86_VENDOR_INTEL:
155 /*
156 * There is a known erratum on Pentium III and Core Solo
157 * and Core Duo CPUs.
158 * " Page with PAT set to WC while associated MTRR is UC
159 * may consolidate to UC "
160 * Because of this erratum, it is better to stick with
161 * setting WC in MTRR rather than using PAT on these CPUs.
162 *
163 * Enable PAT WC only on P4, Core 2 or later CPUs.
164 */
165 if (c->x86 > 0x6 || (c->x86 == 6 && c->x86_model >= 15))
166 return;
167
168 pat_disable("PAT WC disabled due to known CPU erratum.");
169 return;
170
171 case X86_VENDOR_AMD:
172 case X86_VENDOR_CENTAUR:
173 case X86_VENDOR_TRANSMETA:
174 return;
175 }
176
177 pat_disable("PAT disabled. Not yet verified on this CPU type.");
178}
179#endif
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 7c878f6aa919..25423a5b80ed 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -12,8 +12,6 @@
12# include <asm/cacheflush.h> 12# include <asm/cacheflush.h>
13#endif 13#endif
14 14
15#include <mach_apic.h>
16
17#include "cpu.h" 15#include "cpu.h"
18 16
19#ifdef CONFIG_X86_32 17#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 83492b1f93b1..826d5c876278 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -21,14 +21,14 @@
21#include <asm/asm.h> 21#include <asm/asm.h>
22#include <asm/numa.h> 22#include <asm/numa.h>
23#include <asm/smp.h> 23#include <asm/smp.h>
24#ifdef CONFIG_X86_LOCAL_APIC 24#include <asm/cpu.h>
25#include <asm/mpspec.h> 25#include <asm/cpumask.h>
26#include <asm/apic.h> 26#include <asm/apic.h>
27#include <mach_apic.h> 27
28#include <asm/genapic.h> 28#ifdef CONFIG_X86_LOCAL_APIC
29#include <asm/uv/uv.h>
29#endif 30#endif
30 31
31#include <asm/pda.h>
32#include <asm/pgtable.h> 32#include <asm/pgtable.h>
33#include <asm/processor.h> 33#include <asm/processor.h>
34#include <asm/desc.h> 34#include <asm/desc.h>
@@ -37,6 +37,7 @@
37#include <asm/sections.h> 37#include <asm/sections.h>
38#include <asm/setup.h> 38#include <asm/setup.h>
39#include <asm/hypervisor.h> 39#include <asm/hypervisor.h>
40#include <asm/stackprotector.h>
40 41
41#include "cpu.h" 42#include "cpu.h"
42 43
@@ -50,6 +51,15 @@ cpumask_var_t cpu_initialized_mask;
50/* representing cpus for which sibling maps can be computed */ 51/* representing cpus for which sibling maps can be computed */
51cpumask_var_t cpu_sibling_setup_mask; 52cpumask_var_t cpu_sibling_setup_mask;
52 53
54/* correctly size the local cpu masks */
55void __init setup_cpu_local_masks(void)
56{
57 alloc_bootmem_cpumask_var(&cpu_initialized_mask);
58 alloc_bootmem_cpumask_var(&cpu_callin_mask);
59 alloc_bootmem_cpumask_var(&cpu_callout_mask);
60 alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask);
61}
62
53#else /* CONFIG_X86_32 */ 63#else /* CONFIG_X86_32 */
54 64
55cpumask_t cpu_callin_map; 65cpumask_t cpu_callin_map;
@@ -62,23 +72,23 @@ cpumask_t cpu_sibling_setup_map;
62 72
63static struct cpu_dev *this_cpu __cpuinitdata; 73static struct cpu_dev *this_cpu __cpuinitdata;
64 74
75DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
65#ifdef CONFIG_X86_64 76#ifdef CONFIG_X86_64
66/* We need valid kernel segments for data and code in long mode too 77 /*
67 * IRET will check the segment types kkeil 2000/10/28 78 * We need valid kernel segments for data and code in long mode too
68 * Also sysret mandates a special GDT layout 79 * IRET will check the segment types kkeil 2000/10/28
69 */ 80 * Also sysret mandates a special GDT layout
70/* The TLS descriptors are currently at a different place compared to i386. 81 *
71 Hopefully nobody expects them at a fixed place (Wine?) */ 82 * The TLS descriptors are currently at a different place compared to i386.
72DEFINE_PER_CPU(struct gdt_page, gdt_page) = { .gdt = { 83 * Hopefully nobody expects them at a fixed place (Wine?)
84 */
73 [GDT_ENTRY_KERNEL32_CS] = { { { 0x0000ffff, 0x00cf9b00 } } }, 85 [GDT_ENTRY_KERNEL32_CS] = { { { 0x0000ffff, 0x00cf9b00 } } },
74 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } }, 86 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } },
75 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9300 } } }, 87 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9300 } } },
76 [GDT_ENTRY_DEFAULT_USER32_CS] = { { { 0x0000ffff, 0x00cffb00 } } }, 88 [GDT_ENTRY_DEFAULT_USER32_CS] = { { { 0x0000ffff, 0x00cffb00 } } },
77 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff300 } } }, 89 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff300 } } },
78 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00affb00 } } }, 90 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00affb00 } } },
79} };
80#else 91#else
81DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
82 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00cf9a00 } } }, 92 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00cf9a00 } } },
83 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } }, 93 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } },
84 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } }, 94 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } },
@@ -110,9 +120,10 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
110 [GDT_ENTRY_APMBIOS_BASE+2] = { { { 0x0000ffff, 0x00409200 } } }, 120 [GDT_ENTRY_APMBIOS_BASE+2] = { { { 0x0000ffff, 0x00409200 } } },
111 121
112 [GDT_ENTRY_ESPFIX_SS] = { { { 0x00000000, 0x00c09200 } } }, 122 [GDT_ENTRY_ESPFIX_SS] = { { { 0x00000000, 0x00c09200 } } },
113 [GDT_ENTRY_PERCPU] = { { { 0x00000000, 0x00000000 } } }, 123 [GDT_ENTRY_PERCPU] = { { { 0x0000ffff, 0x00cf9200 } } },
114} }; 124 GDT_STACK_CANARY_INIT
115#endif 125#endif
126} };
116EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); 127EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
117 128
118#ifdef CONFIG_X86_32 129#ifdef CONFIG_X86_32
@@ -213,6 +224,49 @@ static inline void squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
213#endif 224#endif
214 225
215/* 226/*
227 * Some CPU features depend on higher CPUID levels, which may not always
228 * be available due to CPUID level capping or broken virtualization
229 * software. Add those features to this table to auto-disable them.
230 */
231struct cpuid_dependent_feature {
232 u32 feature;
233 u32 level;
234};
235static const struct cpuid_dependent_feature __cpuinitconst
236cpuid_dependent_features[] = {
237 { X86_FEATURE_MWAIT, 0x00000005 },
238 { X86_FEATURE_DCA, 0x00000009 },
239 { X86_FEATURE_XSAVE, 0x0000000d },
240 { 0, 0 }
241};
242
243static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn)
244{
245 const struct cpuid_dependent_feature *df;
246 for (df = cpuid_dependent_features; df->feature; df++) {
247 /*
248 * Note: cpuid_level is set to -1 if unavailable, but
249 * extended_extended_level is set to 0 if unavailable
250 * and the legitimate extended levels are all negative
251 * when signed; hence the weird messing around with
252 * signs here...
253 */
254 if (cpu_has(c, df->feature) &&
255 ((s32)df->level < 0 ?
256 (u32)df->level > (u32)c->extended_cpuid_level :
257 (s32)df->level > (s32)c->cpuid_level)) {
258 clear_cpu_cap(c, df->feature);
259 if (warn)
260 printk(KERN_WARNING
261 "CPU: CPU feature %s disabled "
262 "due to lack of CPUID level 0x%x\n",
263 x86_cap_flags[df->feature],
264 df->level);
265 }
266 }
267}
268
269/*
216 * Naming convention should be: <Name> [(<Codename>)] 270 * Naming convention should be: <Name> [(<Codename>)]
217 * This table only is used unless init_<vendor>() below doesn't set it; 271 * This table only is used unless init_<vendor>() below doesn't set it;
218 * in particular, if CPUID levels 0x80000002..4 are supported, this isn't used 272 * in particular, if CPUID levels 0x80000002..4 are supported, this isn't used
@@ -242,18 +296,29 @@ static char __cpuinit *table_lookup_model(struct cpuinfo_x86 *c)
242 296
243__u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata; 297__u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata;
244 298
299void load_percpu_segment(int cpu)
300{
301#ifdef CONFIG_X86_32
302 loadsegment(fs, __KERNEL_PERCPU);
303#else
304 loadsegment(gs, 0);
305 wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu));
306#endif
307 load_stack_canary_segment();
308}
309
245/* Current gdt points %fs at the "master" per-cpu area: after this, 310/* Current gdt points %fs at the "master" per-cpu area: after this,
246 * it's on the real one. */ 311 * it's on the real one. */
247void switch_to_new_gdt(void) 312void switch_to_new_gdt(int cpu)
248{ 313{
249 struct desc_ptr gdt_descr; 314 struct desc_ptr gdt_descr;
250 315
251 gdt_descr.address = (long)get_cpu_gdt_table(smp_processor_id()); 316 gdt_descr.address = (long)get_cpu_gdt_table(cpu);
252 gdt_descr.size = GDT_SIZE - 1; 317 gdt_descr.size = GDT_SIZE - 1;
253 load_gdt(&gdt_descr); 318 load_gdt(&gdt_descr);
254#ifdef CONFIG_X86_32 319 /* Reload the per-cpu base */
255 asm("mov %0, %%fs" : : "r" (__KERNEL_PERCPU) : "memory"); 320
256#endif 321 load_percpu_segment(cpu);
257} 322}
258 323
259static struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {}; 324static struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {};
@@ -383,11 +448,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
383 } 448 }
384 449
385 index_msb = get_count_order(smp_num_siblings); 450 index_msb = get_count_order(smp_num_siblings);
386#ifdef CONFIG_X86_64 451 c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb);
387 c->phys_proc_id = phys_pkg_id(index_msb);
388#else
389 c->phys_proc_id = phys_pkg_id(c->initial_apicid, index_msb);
390#endif
391 452
392 smp_num_siblings = smp_num_siblings / c->x86_max_cores; 453 smp_num_siblings = smp_num_siblings / c->x86_max_cores;
393 454
@@ -395,13 +456,8 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
395 456
396 core_bits = get_count_order(c->x86_max_cores); 457 core_bits = get_count_order(c->x86_max_cores);
397 458
398#ifdef CONFIG_X86_64 459 c->cpu_core_id = apic->phys_pkg_id(c->initial_apicid, index_msb) &
399 c->cpu_core_id = phys_pkg_id(index_msb) &
400 ((1 << core_bits) - 1); 460 ((1 << core_bits) - 1);
401#else
402 c->cpu_core_id = phys_pkg_id(c->initial_apicid, index_msb) &
403 ((1 << core_bits) - 1);
404#endif
405 } 461 }
406 462
407out: 463out:
@@ -570,11 +626,10 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
570 if (this_cpu->c_early_init) 626 if (this_cpu->c_early_init)
571 this_cpu->c_early_init(c); 627 this_cpu->c_early_init(c);
572 628
573 validate_pat_support(c);
574
575#ifdef CONFIG_SMP 629#ifdef CONFIG_SMP
576 c->cpu_index = boot_cpu_id; 630 c->cpu_index = boot_cpu_id;
577#endif 631#endif
632 filter_cpuid_features(c, false);
578} 633}
579 634
580void __init early_cpu_init(void) 635void __init early_cpu_init(void)
@@ -637,7 +692,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
637 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF; 692 c->initial_apicid = (cpuid_ebx(1) >> 24) & 0xFF;
638#ifdef CONFIG_X86_32 693#ifdef CONFIG_X86_32
639# ifdef CONFIG_X86_HT 694# ifdef CONFIG_X86_HT
640 c->apicid = phys_pkg_id(c->initial_apicid, 0); 695 c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
641# else 696# else
642 c->apicid = c->initial_apicid; 697 c->apicid = c->initial_apicid;
643# endif 698# endif
@@ -684,7 +739,7 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
684 this_cpu->c_identify(c); 739 this_cpu->c_identify(c);
685 740
686#ifdef CONFIG_X86_64 741#ifdef CONFIG_X86_64
687 c->apicid = phys_pkg_id(0); 742 c->apicid = apic->phys_pkg_id(c->initial_apicid, 0);
688#endif 743#endif
689 744
690 /* 745 /*
@@ -708,6 +763,9 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
708 * we do "generic changes." 763 * we do "generic changes."
709 */ 764 */
710 765
766 /* Filter out anything that depends on CPUID levels we don't have */
767 filter_cpuid_features(c, true);
768
711 /* If the model name is still unset, do table lookup. */ 769 /* If the model name is still unset, do table lookup. */
712 if (!c->x86_model_id[0]) { 770 if (!c->x86_model_id[0]) {
713 char *p; 771 char *p;
@@ -877,54 +935,22 @@ static __init int setup_disablecpuid(char *arg)
877__setup("clearcpuid=", setup_disablecpuid); 935__setup("clearcpuid=", setup_disablecpuid);
878 936
879#ifdef CONFIG_X86_64 937#ifdef CONFIG_X86_64
880struct x8664_pda **_cpu_pda __read_mostly;
881EXPORT_SYMBOL(_cpu_pda);
882
883struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table }; 938struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table };
884 939
885static char boot_cpu_stack[IRQSTACKSIZE] __page_aligned_bss; 940DEFINE_PER_CPU_FIRST(union irq_stack_union,
941 irq_stack_union) __aligned(PAGE_SIZE);
942DEFINE_PER_CPU(char *, irq_stack_ptr) =
943 init_per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64;
886 944
887void __cpuinit pda_init(int cpu) 945DEFINE_PER_CPU(unsigned long, kernel_stack) =
888{ 946 (unsigned long)&init_thread_union - KERNEL_STACK_OFFSET + THREAD_SIZE;
889 struct x8664_pda *pda = cpu_pda(cpu); 947EXPORT_PER_CPU_SYMBOL(kernel_stack);
890 948
891 /* Setup up data that may be needed in __get_free_pages early */ 949DEFINE_PER_CPU(unsigned int, irq_count) = -1;
892 loadsegment(fs, 0);
893 loadsegment(gs, 0);
894 /* Memory clobbers used to order PDA accessed */
895 mb();
896 wrmsrl(MSR_GS_BASE, pda);
897 mb();
898
899 pda->cpunumber = cpu;
900 pda->irqcount = -1;
901 pda->kernelstack = (unsigned long)stack_thread_info() -
902 PDA_STACKOFFSET + THREAD_SIZE;
903 pda->active_mm = &init_mm;
904 pda->mmu_state = 0;
905
906 if (cpu == 0) {
907 /* others are initialized in smpboot.c */
908 pda->pcurrent = &init_task;
909 pda->irqstackptr = boot_cpu_stack;
910 pda->irqstackptr += IRQSTACKSIZE - 64;
911 } else {
912 if (!pda->irqstackptr) {
913 pda->irqstackptr = (char *)
914 __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER);
915 if (!pda->irqstackptr)
916 panic("cannot allocate irqstack for cpu %d",
917 cpu);
918 pda->irqstackptr += IRQSTACKSIZE - 64;
919 }
920 950
921 if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE) 951static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks
922 pda->nodenumber = cpu_to_node(cpu); 952 [(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ])
923 } 953 __aligned(PAGE_SIZE);
924}
925
926static char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ +
927 DEBUG_STKSZ] __page_aligned_bss;
928 954
929extern asmlinkage void ignore_sysret(void); 955extern asmlinkage void ignore_sysret(void);
930 956
@@ -957,16 +983,21 @@ unsigned long kernel_eflags;
957 */ 983 */
958DEFINE_PER_CPU(struct orig_ist, orig_ist); 984DEFINE_PER_CPU(struct orig_ist, orig_ist);
959 985
960#else 986#else /* x86_64 */
961 987
962/* Make sure %fs is initialized properly in idle threads */ 988#ifdef CONFIG_CC_STACKPROTECTOR
989DEFINE_PER_CPU(unsigned long, stack_canary);
990#endif
991
992/* Make sure %fs and %gs are initialized properly in idle threads */
963struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs) 993struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
964{ 994{
965 memset(regs, 0, sizeof(struct pt_regs)); 995 memset(regs, 0, sizeof(struct pt_regs));
966 regs->fs = __KERNEL_PERCPU; 996 regs->fs = __KERNEL_PERCPU;
997 regs->gs = __KERNEL_STACK_CANARY;
967 return regs; 998 return regs;
968} 999}
969#endif 1000#endif /* x86_64 */
970 1001
971/* 1002/*
972 * cpu_init() initializes state that is per-CPU. Some data is already 1003 * cpu_init() initializes state that is per-CPU. Some data is already
@@ -982,15 +1013,14 @@ void __cpuinit cpu_init(void)
982 struct tss_struct *t = &per_cpu(init_tss, cpu); 1013 struct tss_struct *t = &per_cpu(init_tss, cpu);
983 struct orig_ist *orig_ist = &per_cpu(orig_ist, cpu); 1014 struct orig_ist *orig_ist = &per_cpu(orig_ist, cpu);
984 unsigned long v; 1015 unsigned long v;
985 char *estacks = NULL;
986 struct task_struct *me; 1016 struct task_struct *me;
987 int i; 1017 int i;
988 1018
989 /* CPU 0 is initialised in head64.c */ 1019#ifdef CONFIG_NUMA
990 if (cpu != 0) 1020 if (cpu != 0 && percpu_read(node_number) == 0 &&
991 pda_init(cpu); 1021 cpu_to_node(cpu) != NUMA_NO_NODE)
992 else 1022 percpu_write(node_number, cpu_to_node(cpu));
993 estacks = boot_exception_stacks; 1023#endif
994 1024
995 me = current; 1025 me = current;
996 1026
@@ -1006,7 +1036,9 @@ void __cpuinit cpu_init(void)
1006 * and set up the GDT descriptor: 1036 * and set up the GDT descriptor:
1007 */ 1037 */
1008 1038
1009 switch_to_new_gdt(); 1039 switch_to_new_gdt(cpu);
1040 loadsegment(fs, 0);
1041
1010 load_idt((const struct desc_ptr *)&idt_descr); 1042 load_idt((const struct desc_ptr *)&idt_descr);
1011 1043
1012 memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8); 1044 memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);
@@ -1017,25 +1049,20 @@ void __cpuinit cpu_init(void)
1017 barrier(); 1049 barrier();
1018 1050
1019 check_efer(); 1051 check_efer();
1020 if (cpu != 0 && x2apic) 1052 if (cpu != 0)
1021 enable_x2apic(); 1053 enable_x2apic();
1022 1054
1023 /* 1055 /*
1024 * set up and load the per-CPU TSS 1056 * set up and load the per-CPU TSS
1025 */ 1057 */
1026 if (!orig_ist->ist[0]) { 1058 if (!orig_ist->ist[0]) {
1027 static const unsigned int order[N_EXCEPTION_STACKS] = { 1059 static const unsigned int sizes[N_EXCEPTION_STACKS] = {
1028 [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER, 1060 [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STKSZ,
1029 [DEBUG_STACK - 1] = DEBUG_STACK_ORDER 1061 [DEBUG_STACK - 1] = DEBUG_STKSZ
1030 }; 1062 };
1063 char *estacks = per_cpu(exception_stacks, cpu);
1031 for (v = 0; v < N_EXCEPTION_STACKS; v++) { 1064 for (v = 0; v < N_EXCEPTION_STACKS; v++) {
1032 if (cpu) { 1065 estacks += sizes[v];
1033 estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]);
1034 if (!estacks)
1035 panic("Cannot allocate exception "
1036 "stack %ld %d\n", v, cpu);
1037 }
1038 estacks += PAGE_SIZE << order[v];
1039 orig_ist->ist[v] = t->x86_tss.ist[v] = 1066 orig_ist->ist[v] = t->x86_tss.ist[v] =
1040 (unsigned long)estacks; 1067 (unsigned long)estacks;
1041 } 1068 }
@@ -1069,22 +1096,19 @@ void __cpuinit cpu_init(void)
1069 */ 1096 */
1070 if (kgdb_connected && arch_kgdb_ops.correct_hw_break) 1097 if (kgdb_connected && arch_kgdb_ops.correct_hw_break)
1071 arch_kgdb_ops.correct_hw_break(); 1098 arch_kgdb_ops.correct_hw_break();
1072 else { 1099 else
1073#endif 1100#endif
1074 /* 1101 {
1075 * Clear all 6 debug registers: 1102 /*
1076 */ 1103 * Clear all 6 debug registers:
1077 1104 */
1078 set_debugreg(0UL, 0); 1105 set_debugreg(0UL, 0);
1079 set_debugreg(0UL, 1); 1106 set_debugreg(0UL, 1);
1080 set_debugreg(0UL, 2); 1107 set_debugreg(0UL, 2);
1081 set_debugreg(0UL, 3); 1108 set_debugreg(0UL, 3);
1082 set_debugreg(0UL, 6); 1109 set_debugreg(0UL, 6);
1083 set_debugreg(0UL, 7); 1110 set_debugreg(0UL, 7);
1084#ifdef CONFIG_KGDB
1085 /* If the kgdb is connected no debug regs should be altered. */
1086 } 1111 }
1087#endif
1088 1112
1089 fpu_init(); 1113 fpu_init();
1090 1114
@@ -1114,7 +1138,7 @@ void __cpuinit cpu_init(void)
1114 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); 1138 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
1115 1139
1116 load_idt(&idt_descr); 1140 load_idt(&idt_descr);
1117 switch_to_new_gdt(); 1141 switch_to_new_gdt(cpu);
1118 1142
1119 /* 1143 /*
1120 * Set up and load the per-CPU TSS and LDT 1144 * Set up and load the per-CPU TSS and LDT
@@ -1135,9 +1159,6 @@ void __cpuinit cpu_init(void)
1135 __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); 1159 __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss);
1136#endif 1160#endif
1137 1161
1138 /* Clear %gs. */
1139 asm volatile ("mov %0, %%gs" : : "r" (0));
1140
1141 /* Clear all 6 debug registers: */ 1162 /* Clear all 6 debug registers: */
1142 set_debugreg(0, 0); 1163 set_debugreg(0, 0);
1143 set_debugreg(0, 1); 1164 set_debugreg(0, 1);
diff --git a/arch/x86/kernel/cpu/cpufreq/Kconfig b/arch/x86/kernel/cpu/cpufreq/Kconfig
index 65792c2cc462..52c839875478 100644
--- a/arch/x86/kernel/cpu/cpufreq/Kconfig
+++ b/arch/x86/kernel/cpu/cpufreq/Kconfig
@@ -87,30 +87,15 @@ config X86_POWERNOW_K7_ACPI
87config X86_POWERNOW_K8 87config X86_POWERNOW_K8
88 tristate "AMD Opteron/Athlon64 PowerNow!" 88 tristate "AMD Opteron/Athlon64 PowerNow!"
89 select CPU_FREQ_TABLE 89 select CPU_FREQ_TABLE
90 depends on ACPI && ACPI_PROCESSOR
90 help 91 help
91 This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors. 92 This adds the CPUFreq driver for K8/K10 Opteron/Athlon64 processors.
92 93
93 To compile this driver as a module, choose M here: the 94 To compile this driver as a module, choose M here: the
94 module will be called powernow-k8. 95 module will be called powernow-k8.
95 96
96 For details, take a look at <file:Documentation/cpu-freq/>. 97 For details, take a look at <file:Documentation/cpu-freq/>.
97 98
98 If in doubt, say N.
99
100config X86_POWERNOW_K8_ACPI
101 bool
102 prompt "ACPI Support" if X86_32
103 depends on ACPI && X86_POWERNOW_K8 && ACPI_PROCESSOR
104 depends on !(X86_POWERNOW_K8 = y && ACPI_PROCESSOR = m)
105 default y
106 help
107 This provides access to the K8s Processor Performance States via ACPI.
108 This driver is probably required for CPUFreq to work with multi-socket and
109 SMP systems. It is not required on at least some single-socket yet
110 multi-core systems, even if SMP is enabled.
111
112 It is safe to say Y here.
113
114config X86_GX_SUSPMOD 99config X86_GX_SUSPMOD
115 tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation" 100 tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"
116 depends on X86_32 && PCI 101 depends on X86_32 && PCI
diff --git a/arch/x86/kernel/cpu/cpufreq/Makefile b/arch/x86/kernel/cpu/cpufreq/Makefile
index 560f7760dae5..509296df294d 100644
--- a/arch/x86/kernel/cpu/cpufreq/Makefile
+++ b/arch/x86/kernel/cpu/cpufreq/Makefile
@@ -1,6 +1,11 @@
1# Link order matters. K8 is preferred to ACPI because of firmware bugs in early
2# K8 systems. ACPI is preferred to all other hardware-specific drivers.
3# speedstep-* is preferred over p4-clockmod.
4
5obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
6obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
1obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o 7obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o
2obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o 8obj-$(CONFIG_X86_POWERNOW_K7) += powernow-k7.o
3obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
4obj-$(CONFIG_X86_LONGHAUL) += longhaul.o 9obj-$(CONFIG_X86_LONGHAUL) += longhaul.o
5obj-$(CONFIG_X86_E_POWERSAVER) += e_powersaver.o 10obj-$(CONFIG_X86_E_POWERSAVER) += e_powersaver.o
6obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o 11obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o
@@ -10,7 +15,6 @@ obj-$(CONFIG_X86_GX_SUSPMOD) += gx-suspmod.o
10obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o 15obj-$(CONFIG_X86_SPEEDSTEP_ICH) += speedstep-ich.o
11obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o 16obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
12obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o 17obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o
13obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
14obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o 18obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
15obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o 19obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o
16obj-$(CONFIG_X86_CPUFREQ_NFORCE2) += cpufreq-nforce2.o 20obj-$(CONFIG_X86_CPUFREQ_NFORCE2) += cpufreq-nforce2.o
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 4b1c319d30c3..23da96e57b17 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * acpi-cpufreq.c - ACPI Processor P-States Driver ($Revision: 1.4 $) 2 * acpi-cpufreq.c - ACPI Processor P-States Driver
3 * 3 *
4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> 4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> 5 * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
@@ -36,16 +36,18 @@
36#include <linux/ftrace.h> 36#include <linux/ftrace.h>
37 37
38#include <linux/acpi.h> 38#include <linux/acpi.h>
39#include <linux/io.h>
40#include <linux/delay.h>
41#include <linux/uaccess.h>
42
39#include <acpi/processor.h> 43#include <acpi/processor.h>
40 44
41#include <asm/io.h>
42#include <asm/msr.h> 45#include <asm/msr.h>
43#include <asm/processor.h> 46#include <asm/processor.h>
44#include <asm/cpufeature.h> 47#include <asm/cpufeature.h>
45#include <asm/delay.h>
46#include <asm/uaccess.h>
47 48
48#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg) 49#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
50 "acpi-cpufreq", msg)
49 51
50MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski"); 52MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
51MODULE_DESCRIPTION("ACPI Processor P-States Driver"); 53MODULE_DESCRIPTION("ACPI Processor P-States Driver");
@@ -95,7 +97,7 @@ static unsigned extract_io(u32 value, struct acpi_cpufreq_data *data)
95 97
96 perf = data->acpi_data; 98 perf = data->acpi_data;
97 99
98 for (i=0; i<perf->state_count; i++) { 100 for (i = 0; i < perf->state_count; i++) {
99 if (value == perf->states[i].status) 101 if (value == perf->states[i].status)
100 return data->freq_table[i].frequency; 102 return data->freq_table[i].frequency;
101 } 103 }
@@ -110,7 +112,7 @@ static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
110 msr &= INTEL_MSR_RANGE; 112 msr &= INTEL_MSR_RANGE;
111 perf = data->acpi_data; 113 perf = data->acpi_data;
112 114
113 for (i=0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) { 115 for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
114 if (msr == perf->states[data->freq_table[i].index].status) 116 if (msr == perf->states[data->freq_table[i].index].status)
115 return data->freq_table[i].frequency; 117 return data->freq_table[i].frequency;
116 } 118 }
@@ -138,15 +140,13 @@ struct io_addr {
138 u8 bit_width; 140 u8 bit_width;
139}; 141};
140 142
141typedef union {
142 struct msr_addr msr;
143 struct io_addr io;
144} drv_addr_union;
145
146struct drv_cmd { 143struct drv_cmd {
147 unsigned int type; 144 unsigned int type;
148 const struct cpumask *mask; 145 const struct cpumask *mask;
149 drv_addr_union addr; 146 union {
147 struct msr_addr msr;
148 struct io_addr io;
149 } addr;
150 u32 val; 150 u32 val;
151}; 151};
152 152
@@ -369,7 +369,7 @@ static unsigned int check_freqs(const struct cpumask *mask, unsigned int freq,
369 unsigned int cur_freq; 369 unsigned int cur_freq;
370 unsigned int i; 370 unsigned int i;
371 371
372 for (i=0; i<100; i++) { 372 for (i = 0; i < 100; i++) {
373 cur_freq = extract_freq(get_cur_val(mask), data); 373 cur_freq = extract_freq(get_cur_val(mask), data);
374 if (cur_freq == freq) 374 if (cur_freq == freq)
375 return 1; 375 return 1;
@@ -494,7 +494,7 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
494 unsigned long freq; 494 unsigned long freq;
495 unsigned long freqn = perf->states[0].core_frequency * 1000; 495 unsigned long freqn = perf->states[0].core_frequency * 1000;
496 496
497 for (i=0; i<(perf->state_count-1); i++) { 497 for (i = 0; i < (perf->state_count-1); i++) {
498 freq = freqn; 498 freq = freqn;
499 freqn = perf->states[i+1].core_frequency * 1000; 499 freqn = perf->states[i+1].core_frequency * 1000;
500 if ((2 * cpu_khz) > (freqn + freq)) { 500 if ((2 * cpu_khz) > (freqn + freq)) {
@@ -601,7 +601,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
601 if (!data) 601 if (!data)
602 return -ENOMEM; 602 return -ENOMEM;
603 603
604 data->acpi_data = percpu_ptr(acpi_perf_data, cpu); 604 data->acpi_data = per_cpu_ptr(acpi_perf_data, cpu);
605 per_cpu(drv_data, cpu) = data; 605 per_cpu(drv_data, cpu) = data;
606 606
607 if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) 607 if (cpu_has(c, X86_FEATURE_CONSTANT_TSC))
@@ -673,7 +673,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
673 673
674 /* detect transition latency */ 674 /* detect transition latency */
675 policy->cpuinfo.transition_latency = 0; 675 policy->cpuinfo.transition_latency = 0;
676 for (i=0; i<perf->state_count; i++) { 676 for (i = 0; i < perf->state_count; i++) {
677 if ((perf->states[i].transition_latency * 1000) > 677 if ((perf->states[i].transition_latency * 1000) >
678 policy->cpuinfo.transition_latency) 678 policy->cpuinfo.transition_latency)
679 policy->cpuinfo.transition_latency = 679 policy->cpuinfo.transition_latency =
@@ -682,8 +682,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
682 682
683 data->max_freq = perf->states[0].core_frequency * 1000; 683 data->max_freq = perf->states[0].core_frequency * 1000;
684 /* table init */ 684 /* table init */
685 for (i=0; i<perf->state_count; i++) { 685 for (i = 0; i < perf->state_count; i++) {
686 if (i>0 && perf->states[i].core_frequency >= 686 if (i > 0 && perf->states[i].core_frequency >=
687 data->freq_table[valid_states-1].frequency / 1000) 687 data->freq_table[valid_states-1].frequency / 1000)
688 continue; 688 continue;
689 689
diff --git a/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
index 965ea52767ac..733093d60436 100644
--- a/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
+++ b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
@@ -32,7 +32,7 @@
32 * nforce2_chipset: 32 * nforce2_chipset:
33 * FSB is changed using the chipset 33 * FSB is changed using the chipset
34 */ 34 */
35static struct pci_dev *nforce2_chipset_dev; 35static struct pci_dev *nforce2_dev;
36 36
37/* fid: 37/* fid:
38 * multiplier * 10 38 * multiplier * 10
@@ -56,7 +56,9 @@ MODULE_PARM_DESC(fid, "CPU multiplier to use (11.5 = 115)");
56MODULE_PARM_DESC(min_fsb, 56MODULE_PARM_DESC(min_fsb,
57 "Minimum FSB to use, if not defined: current FSB - 50"); 57 "Minimum FSB to use, if not defined: current FSB - 50");
58 58
59#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "cpufreq-nforce2", msg) 59#define PFX "cpufreq-nforce2: "
60#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
61 "cpufreq-nforce2", msg)
60 62
61/** 63/**
62 * nforce2_calc_fsb - calculate FSB 64 * nforce2_calc_fsb - calculate FSB
@@ -118,11 +120,11 @@ static void nforce2_write_pll(int pll)
118 int temp; 120 int temp;
119 121
120 /* Set the pll addr. to 0x00 */ 122 /* Set the pll addr. to 0x00 */
121 pci_write_config_dword(nforce2_chipset_dev, NFORCE2_PLLADR, 0); 123 pci_write_config_dword(nforce2_dev, NFORCE2_PLLADR, 0);
122 124
123 /* Now write the value in all 64 registers */ 125 /* Now write the value in all 64 registers */
124 for (temp = 0; temp <= 0x3f; temp++) 126 for (temp = 0; temp <= 0x3f; temp++)
125 pci_write_config_dword(nforce2_chipset_dev, NFORCE2_PLLREG, pll); 127 pci_write_config_dword(nforce2_dev, NFORCE2_PLLREG, pll);
126 128
127 return; 129 return;
128} 130}
@@ -139,8 +141,8 @@ static unsigned int nforce2_fsb_read(int bootfsb)
139 u32 fsb, temp = 0; 141 u32 fsb, temp = 0;
140 142
141 /* Get chipset boot FSB from subdevice 5 (FSB at boot-time) */ 143 /* Get chipset boot FSB from subdevice 5 (FSB at boot-time) */
142 nforce2_sub5 = pci_get_subsys(PCI_VENDOR_ID_NVIDIA, 144 nforce2_sub5 = pci_get_subsys(PCI_VENDOR_ID_NVIDIA, 0x01EF,
143 0x01EF, PCI_ANY_ID, PCI_ANY_ID, NULL); 145 PCI_ANY_ID, PCI_ANY_ID, NULL);
144 if (!nforce2_sub5) 146 if (!nforce2_sub5)
145 return 0; 147 return 0;
146 148
@@ -148,13 +150,13 @@ static unsigned int nforce2_fsb_read(int bootfsb)
148 fsb /= 1000000; 150 fsb /= 1000000;
149 151
150 /* Check if PLL register is already set */ 152 /* Check if PLL register is already set */
151 pci_read_config_byte(nforce2_chipset_dev, NFORCE2_PLLENABLE, (u8 *)&temp); 153 pci_read_config_byte(nforce2_dev, NFORCE2_PLLENABLE, (u8 *)&temp);
152 154
153 if (bootfsb || !temp) 155 if (bootfsb || !temp)
154 return fsb; 156 return fsb;
155 157
156 /* Use PLL register FSB value */ 158 /* Use PLL register FSB value */
157 pci_read_config_dword(nforce2_chipset_dev, NFORCE2_PLLREG, &temp); 159 pci_read_config_dword(nforce2_dev, NFORCE2_PLLREG, &temp);
158 fsb = nforce2_calc_fsb(temp); 160 fsb = nforce2_calc_fsb(temp);
159 161
160 return fsb; 162 return fsb;
@@ -174,18 +176,18 @@ static int nforce2_set_fsb(unsigned int fsb)
174 int pll = 0; 176 int pll = 0;
175 177
176 if ((fsb > max_fsb) || (fsb < NFORCE2_MIN_FSB)) { 178 if ((fsb > max_fsb) || (fsb < NFORCE2_MIN_FSB)) {
177 printk(KERN_ERR "cpufreq: FSB %d is out of range!\n", fsb); 179 printk(KERN_ERR PFX "FSB %d is out of range!\n", fsb);
178 return -EINVAL; 180 return -EINVAL;
179 } 181 }
180 182
181 tfsb = nforce2_fsb_read(0); 183 tfsb = nforce2_fsb_read(0);
182 if (!tfsb) { 184 if (!tfsb) {
183 printk(KERN_ERR "cpufreq: Error while reading the FSB\n"); 185 printk(KERN_ERR PFX "Error while reading the FSB\n");
184 return -EINVAL; 186 return -EINVAL;
185 } 187 }
186 188
187 /* First write? Then set actual value */ 189 /* First write? Then set actual value */
188 pci_read_config_byte(nforce2_chipset_dev, NFORCE2_PLLENABLE, (u8 *)&temp); 190 pci_read_config_byte(nforce2_dev, NFORCE2_PLLENABLE, (u8 *)&temp);
189 if (!temp) { 191 if (!temp) {
190 pll = nforce2_calc_pll(tfsb); 192 pll = nforce2_calc_pll(tfsb);
191 193
@@ -197,7 +199,7 @@ static int nforce2_set_fsb(unsigned int fsb)
197 199
198 /* Enable write access */ 200 /* Enable write access */
199 temp = 0x01; 201 temp = 0x01;
200 pci_write_config_byte(nforce2_chipset_dev, NFORCE2_PLLENABLE, (u8)temp); 202 pci_write_config_byte(nforce2_dev, NFORCE2_PLLENABLE, (u8)temp);
201 203
202 diff = tfsb - fsb; 204 diff = tfsb - fsb;
203 205
@@ -222,7 +224,7 @@ static int nforce2_set_fsb(unsigned int fsb)
222 } 224 }
223 225
224 temp = 0x40; 226 temp = 0x40;
225 pci_write_config_byte(nforce2_chipset_dev, NFORCE2_PLLADR, (u8)temp); 227 pci_write_config_byte(nforce2_dev, NFORCE2_PLLADR, (u8)temp);
226 228
227 return 0; 229 return 0;
228} 230}
@@ -244,7 +246,8 @@ static unsigned int nforce2_get(unsigned int cpu)
244 * nforce2_target - set a new CPUFreq policy 246 * nforce2_target - set a new CPUFreq policy
245 * @policy: new policy 247 * @policy: new policy
246 * @target_freq: the target frequency 248 * @target_freq: the target frequency
247 * @relation: how that frequency relates to achieved frequency (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H) 249 * @relation: how that frequency relates to achieved frequency
250 * (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H)
248 * 251 *
249 * Sets a new CPUFreq policy. 252 * Sets a new CPUFreq policy.
250 */ 253 */
@@ -276,7 +279,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
276 /* local_irq_save(flags); */ 279 /* local_irq_save(flags); */
277 280
278 if (nforce2_set_fsb(target_fsb) < 0) 281 if (nforce2_set_fsb(target_fsb) < 0)
279 printk(KERN_ERR "cpufreq: Changing FSB to %d failed\n", 282 printk(KERN_ERR PFX "Changing FSB to %d failed\n",
280 target_fsb); 283 target_fsb);
281 else 284 else
282 dprintk("Changed FSB successfully to %d\n", 285 dprintk("Changed FSB successfully to %d\n",
@@ -327,8 +330,8 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
327 /* FIX: Get FID from CPU */ 330 /* FIX: Get FID from CPU */
328 if (!fid) { 331 if (!fid) {
329 if (!cpu_khz) { 332 if (!cpu_khz) {
330 printk(KERN_WARNING 333 printk(KERN_WARNING PFX
331 "cpufreq: cpu_khz not set, can't calculate multiplier!\n"); 334 "cpu_khz not set, can't calculate multiplier!\n");
332 return -ENODEV; 335 return -ENODEV;
333 } 336 }
334 337
@@ -343,7 +346,7 @@ static int nforce2_cpu_init(struct cpufreq_policy *policy)
343 } 346 }
344 } 347 }
345 348
346 printk(KERN_INFO "cpufreq: FSB currently at %i MHz, FID %d.%d\n", fsb, 349 printk(KERN_INFO PFX "FSB currently at %i MHz, FID %d.%d\n", fsb,
347 fid / 10, fid % 10); 350 fid / 10, fid % 10);
348 351
349 /* Set maximum FSB to FSB at boot time */ 352 /* Set maximum FSB to FSB at boot time */
@@ -392,17 +395,18 @@ static struct cpufreq_driver nforce2_driver = {
392 */ 395 */
393static unsigned int nforce2_detect_chipset(void) 396static unsigned int nforce2_detect_chipset(void)
394{ 397{
395 nforce2_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_NVIDIA, 398 nforce2_dev = pci_get_subsys(PCI_VENDOR_ID_NVIDIA,
396 PCI_DEVICE_ID_NVIDIA_NFORCE2, 399 PCI_DEVICE_ID_NVIDIA_NFORCE2,
397 PCI_ANY_ID, PCI_ANY_ID, NULL); 400 PCI_ANY_ID, PCI_ANY_ID, NULL);
398 401
399 if (nforce2_chipset_dev == NULL) 402 if (nforce2_dev == NULL)
400 return -ENODEV; 403 return -ENODEV;
401 404
402 printk(KERN_INFO "cpufreq: Detected nForce2 chipset revision %X\n", 405 printk(KERN_INFO PFX "Detected nForce2 chipset revision %X\n",
403 nforce2_chipset_dev->revision); 406 nforce2_dev->revision);
404 printk(KERN_INFO 407 printk(KERN_INFO PFX
405 "cpufreq: FSB changing is maybe unstable and can lead to crashes and data loss.\n"); 408 "FSB changing is maybe unstable and can lead to "
409 "crashes and data loss.\n");
406 410
407 return 0; 411 return 0;
408} 412}
@@ -420,7 +424,7 @@ static int __init nforce2_init(void)
420 424
421 /* detect chipset */ 425 /* detect chipset */
422 if (nforce2_detect_chipset()) { 426 if (nforce2_detect_chipset()) {
423 printk(KERN_ERR "cpufreq: No nForce2 chipset.\n"); 427 printk(KERN_INFO PFX "No nForce2 chipset.\n");
424 return -ENODEV; 428 return -ENODEV;
425 } 429 }
426 430
diff --git a/arch/x86/kernel/cpu/cpufreq/e_powersaver.c b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
index c2f930d86640..35a257dd4bb7 100644
--- a/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
+++ b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
@@ -12,12 +12,12 @@
12#include <linux/cpufreq.h> 12#include <linux/cpufreq.h>
13#include <linux/ioport.h> 13#include <linux/ioport.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/timex.h>
16#include <linux/io.h>
17#include <linux/delay.h>
15 18
16#include <asm/msr.h> 19#include <asm/msr.h>
17#include <asm/tsc.h> 20#include <asm/tsc.h>
18#include <asm/timex.h>
19#include <asm/io.h>
20#include <asm/delay.h>
21 21
22#define EPS_BRAND_C7M 0 22#define EPS_BRAND_C7M 0
23#define EPS_BRAND_C7 1 23#define EPS_BRAND_C7 1
@@ -184,7 +184,7 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
184 break; 184 break;
185 } 185 }
186 186
187 switch(brand) { 187 switch (brand) {
188 case EPS_BRAND_C7M: 188 case EPS_BRAND_C7M:
189 printk(KERN_CONT "C7-M\n"); 189 printk(KERN_CONT "C7-M\n");
190 break; 190 break;
@@ -204,12 +204,12 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
204 } 204 }
205 /* Enable Enhanced PowerSaver */ 205 /* Enable Enhanced PowerSaver */
206 rdmsrl(MSR_IA32_MISC_ENABLE, val); 206 rdmsrl(MSR_IA32_MISC_ENABLE, val);
207 if (!(val & 1 << 16)) { 207 if (!(val & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
208 val |= 1 << 16; 208 val |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP;
209 wrmsrl(MSR_IA32_MISC_ENABLE, val); 209 wrmsrl(MSR_IA32_MISC_ENABLE, val);
210 /* Can be locked at 0 */ 210 /* Can be locked at 0 */
211 rdmsrl(MSR_IA32_MISC_ENABLE, val); 211 rdmsrl(MSR_IA32_MISC_ENABLE, val);
212 if (!(val & 1 << 16)) { 212 if (!(val & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
213 printk(KERN_INFO "eps: Can't enable Enhanced PowerSaver\n"); 213 printk(KERN_INFO "eps: Can't enable Enhanced PowerSaver\n");
214 return -ENODEV; 214 return -ENODEV;
215 } 215 }
@@ -218,17 +218,20 @@ static int eps_cpu_init(struct cpufreq_policy *policy)
218 /* Print voltage and multiplier */ 218 /* Print voltage and multiplier */
219 rdmsr(MSR_IA32_PERF_STATUS, lo, hi); 219 rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
220 current_voltage = lo & 0xff; 220 current_voltage = lo & 0xff;
221 printk(KERN_INFO "eps: Current voltage = %dmV\n", current_voltage * 16 + 700); 221 printk(KERN_INFO "eps: Current voltage = %dmV\n",
222 current_voltage * 16 + 700);
222 current_multiplier = (lo >> 8) & 0xff; 223 current_multiplier = (lo >> 8) & 0xff;
223 printk(KERN_INFO "eps: Current multiplier = %d\n", current_multiplier); 224 printk(KERN_INFO "eps: Current multiplier = %d\n", current_multiplier);
224 225
225 /* Print limits */ 226 /* Print limits */
226 max_voltage = hi & 0xff; 227 max_voltage = hi & 0xff;
227 printk(KERN_INFO "eps: Highest voltage = %dmV\n", max_voltage * 16 + 700); 228 printk(KERN_INFO "eps: Highest voltage = %dmV\n",
229 max_voltage * 16 + 700);
228 max_multiplier = (hi >> 8) & 0xff; 230 max_multiplier = (hi >> 8) & 0xff;
229 printk(KERN_INFO "eps: Highest multiplier = %d\n", max_multiplier); 231 printk(KERN_INFO "eps: Highest multiplier = %d\n", max_multiplier);
230 min_voltage = (hi >> 16) & 0xff; 232 min_voltage = (hi >> 16) & 0xff;
231 printk(KERN_INFO "eps: Lowest voltage = %dmV\n", min_voltage * 16 + 700); 233 printk(KERN_INFO "eps: Lowest voltage = %dmV\n",
234 min_voltage * 16 + 700);
232 min_multiplier = (hi >> 24) & 0xff; 235 min_multiplier = (hi >> 24) & 0xff;
233 printk(KERN_INFO "eps: Lowest multiplier = %d\n", min_multiplier); 236 printk(KERN_INFO "eps: Lowest multiplier = %d\n", min_multiplier);
234 237
@@ -318,7 +321,7 @@ static int eps_cpu_exit(struct cpufreq_policy *policy)
318 return 0; 321 return 0;
319} 322}
320 323
321static struct freq_attr* eps_attr[] = { 324static struct freq_attr *eps_attr[] = {
322 &cpufreq_freq_attr_scaling_available_freqs, 325 &cpufreq_freq_attr_scaling_available_freqs,
323 NULL, 326 NULL,
324}; 327};
@@ -356,7 +359,7 @@ static void __exit eps_exit(void)
356 cpufreq_unregister_driver(&eps_driver); 359 cpufreq_unregister_driver(&eps_driver);
357} 360}
358 361
359MODULE_AUTHOR("Rafa³ Bilski <rafalbilski@interia.pl>"); 362MODULE_AUTHOR("Rafal Bilski <rafalbilski@interia.pl>");
360MODULE_DESCRIPTION("Enhanced PowerSaver driver for VIA C7 CPU's."); 363MODULE_DESCRIPTION("Enhanced PowerSaver driver for VIA C7 CPU's.");
361MODULE_LICENSE("GPL"); 364MODULE_LICENSE("GPL");
362 365
diff --git a/arch/x86/kernel/cpu/cpufreq/elanfreq.c b/arch/x86/kernel/cpu/cpufreq/elanfreq.c
index fe613c93b366..006b278b0d5d 100644
--- a/arch/x86/kernel/cpu/cpufreq/elanfreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/elanfreq.c
@@ -184,7 +184,8 @@ static int elanfreq_target(struct cpufreq_policy *policy,
184{ 184{
185 unsigned int newstate = 0; 185 unsigned int newstate = 0;
186 186
187 if (cpufreq_frequency_table_target(policy, &elanfreq_table[0], target_freq, relation, &newstate)) 187 if (cpufreq_frequency_table_target(policy, &elanfreq_table[0],
188 target_freq, relation, &newstate))
188 return -EINVAL; 189 return -EINVAL;
189 190
190 elanfreq_set_cpu_state(newstate); 191 elanfreq_set_cpu_state(newstate);
@@ -301,7 +302,8 @@ static void __exit elanfreq_exit(void)
301module_param(max_freq, int, 0444); 302module_param(max_freq, int, 0444);
302 303
303MODULE_LICENSE("GPL"); 304MODULE_LICENSE("GPL");
304MODULE_AUTHOR("Robert Schwebel <r.schwebel@pengutronix.de>, Sven Geggus <sven@geggus.net>"); 305MODULE_AUTHOR("Robert Schwebel <r.schwebel@pengutronix.de>, "
306 "Sven Geggus <sven@geggus.net>");
305MODULE_DESCRIPTION("cpufreq driver for AMD's Elan CPUs"); 307MODULE_DESCRIPTION("cpufreq driver for AMD's Elan CPUs");
306 308
307module_init(elanfreq_init); 309module_init(elanfreq_init);
diff --git a/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
index 9d9eae82e60f..ac27ec2264d5 100644
--- a/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
@@ -79,8 +79,9 @@
79#include <linux/smp.h> 79#include <linux/smp.h>
80#include <linux/cpufreq.h> 80#include <linux/cpufreq.h>
81#include <linux/pci.h> 81#include <linux/pci.h>
82#include <linux/errno.h>
83
82#include <asm/processor-cyrix.h> 84#include <asm/processor-cyrix.h>
83#include <asm/errno.h>
84 85
85/* PCI config registers, all at F0 */ 86/* PCI config registers, all at F0 */
86#define PCI_PMER1 0x80 /* power management enable register 1 */ 87#define PCI_PMER1 0x80 /* power management enable register 1 */
@@ -122,8 +123,8 @@ static struct gxfreq_params *gx_params;
122static int stock_freq; 123static int stock_freq;
123 124
124/* PCI bus clock - defaults to 30.000 if cpu_khz is not available */ 125/* PCI bus clock - defaults to 30.000 if cpu_khz is not available */
125static int pci_busclk = 0; 126static int pci_busclk;
126module_param (pci_busclk, int, 0444); 127module_param(pci_busclk, int, 0444);
127 128
128/* maximum duration for which the cpu may be suspended 129/* maximum duration for which the cpu may be suspended
129 * (32us * MAX_DURATION). If no parameter is given, this defaults 130 * (32us * MAX_DURATION). If no parameter is given, this defaults
@@ -132,7 +133,7 @@ module_param (pci_busclk, int, 0444);
132 * is suspended -- processing power is just 0.39% of what it used to be, 133 * is suspended -- processing power is just 0.39% of what it used to be,
133 * though. 781.25 kHz(!) for a 200 MHz processor -- wow. */ 134 * though. 781.25 kHz(!) for a 200 MHz processor -- wow. */
134static int max_duration = 255; 135static int max_duration = 255;
135module_param (max_duration, int, 0444); 136module_param(max_duration, int, 0444);
136 137
137/* For the default policy, we want at least some processing power 138/* For the default policy, we want at least some processing power
138 * - let's say 5%. (min = maxfreq / POLICY_MIN_DIV) 139 * - let's say 5%. (min = maxfreq / POLICY_MIN_DIV)
@@ -140,7 +141,8 @@ module_param (max_duration, int, 0444);
140#define POLICY_MIN_DIV 20 141#define POLICY_MIN_DIV 20
141 142
142 143
143#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg) 144#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
145 "gx-suspmod", msg)
144 146
145/** 147/**
146 * we can detect a core multipiler from dir0_lsb 148 * we can detect a core multipiler from dir0_lsb
@@ -166,12 +168,20 @@ static int gx_freq_mult[16] = {
166 * Low Level chipset interface * 168 * Low Level chipset interface *
167 ****************************************************************/ 169 ****************************************************************/
168static struct pci_device_id gx_chipset_tbl[] __initdata = { 170static struct pci_device_id gx_chipset_tbl[] __initdata = {
169 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, PCI_ANY_ID, PCI_ANY_ID }, 171 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,
170 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520, PCI_ANY_ID, PCI_ANY_ID }, 172 PCI_ANY_ID, PCI_ANY_ID },
171 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510, PCI_ANY_ID, PCI_ANY_ID }, 173 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520,
174 PCI_ANY_ID, PCI_ANY_ID },
175 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510,
176 PCI_ANY_ID, PCI_ANY_ID },
172 { 0, }, 177 { 0, },
173}; 178};
174 179
180static void gx_write_byte(int reg, int value)
181{
182 pci_write_config_byte(gx_params->cs55x0, reg, value);
183}
184
175/** 185/**
176 * gx_detect_chipset: 186 * gx_detect_chipset:
177 * 187 *
@@ -200,7 +210,8 @@ static __init struct pci_dev *gx_detect_chipset(void)
200/** 210/**
201 * gx_get_cpuspeed: 211 * gx_get_cpuspeed:
202 * 212 *
203 * Finds out at which efficient frequency the Cyrix MediaGX/NatSemi Geode CPU runs. 213 * Finds out at which efficient frequency the Cyrix MediaGX/NatSemi
214 * Geode CPU runs.
204 */ 215 */
205static unsigned int gx_get_cpuspeed(unsigned int cpu) 216static unsigned int gx_get_cpuspeed(unsigned int cpu)
206{ 217{
@@ -217,17 +228,18 @@ static unsigned int gx_get_cpuspeed(unsigned int cpu)
217 * 228 *
218 **/ 229 **/
219 230
220static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration, u8 *off_duration) 231static unsigned int gx_validate_speed(unsigned int khz, u8 *on_duration,
232 u8 *off_duration)
221{ 233{
222 unsigned int i; 234 unsigned int i;
223 u8 tmp_on, tmp_off; 235 u8 tmp_on, tmp_off;
224 int old_tmp_freq = stock_freq; 236 int old_tmp_freq = stock_freq;
225 int tmp_freq; 237 int tmp_freq;
226 238
227 *off_duration=1; 239 *off_duration = 1;
228 *on_duration=0; 240 *on_duration = 0;
229 241
230 for (i=max_duration; i>0; i--) { 242 for (i = max_duration; i > 0; i--) {
231 tmp_off = ((khz * i) / stock_freq) & 0xff; 243 tmp_off = ((khz * i) / stock_freq) & 0xff;
232 tmp_on = i - tmp_off; 244 tmp_on = i - tmp_off;
233 tmp_freq = (stock_freq * tmp_off) / i; 245 tmp_freq = (stock_freq * tmp_off) / i;
@@ -259,26 +271,34 @@ static void gx_set_cpuspeed(unsigned int khz)
259 freqs.cpu = 0; 271 freqs.cpu = 0;
260 freqs.old = gx_get_cpuspeed(0); 272 freqs.old = gx_get_cpuspeed(0);
261 273
262 new_khz = gx_validate_speed(khz, &gx_params->on_duration, &gx_params->off_duration); 274 new_khz = gx_validate_speed(khz, &gx_params->on_duration,
275 &gx_params->off_duration);
263 276
264 freqs.new = new_khz; 277 freqs.new = new_khz;
265 278
266 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 279 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
267 local_irq_save(flags); 280 local_irq_save(flags);
268 281
269 if (new_khz != stock_freq) { /* if new khz == 100% of CPU speed, it is special case */ 282
283
284 if (new_khz != stock_freq) {
285 /* if new khz == 100% of CPU speed, it is special case */
270 switch (gx_params->cs55x0->device) { 286 switch (gx_params->cs55x0->device) {
271 case PCI_DEVICE_ID_CYRIX_5530_LEGACY: 287 case PCI_DEVICE_ID_CYRIX_5530_LEGACY:
272 pmer1 = gx_params->pci_pmer1 | IRQ_SPDUP | VID_SPDUP; 288 pmer1 = gx_params->pci_pmer1 | IRQ_SPDUP | VID_SPDUP;
273 /* FIXME: need to test other values -- Zwane,Miura */ 289 /* FIXME: need to test other values -- Zwane,Miura */
274 pci_write_config_byte(gx_params->cs55x0, PCI_IRQTC, 4); /* typical 2 to 4ms */ 290 /* typical 2 to 4ms */
275 pci_write_config_byte(gx_params->cs55x0, PCI_VIDTC, 100);/* typical 50 to 100ms */ 291 gx_write_byte(PCI_IRQTC, 4);
276 pci_write_config_byte(gx_params->cs55x0, PCI_PMER1, pmer1); 292 /* typical 50 to 100ms */
277 293 gx_write_byte(PCI_VIDTC, 100);
278 if (gx_params->cs55x0->revision < 0x10) { /* CS5530(rev 1.2, 1.3) */ 294 gx_write_byte(PCI_PMER1, pmer1);
279 suscfg = gx_params->pci_suscfg | SUSMOD; 295
280 } else { /* CS5530A,B.. */ 296 if (gx_params->cs55x0->revision < 0x10) {
281 suscfg = gx_params->pci_suscfg | SUSMOD | PWRSVE; 297 /* CS5530(rev 1.2, 1.3) */
298 suscfg = gx_params->pci_suscfg|SUSMOD;
299 } else {
300 /* CS5530A,B.. */
301 suscfg = gx_params->pci_suscfg|SUSMOD|PWRSVE;
282 } 302 }
283 break; 303 break;
284 case PCI_DEVICE_ID_CYRIX_5520: 304 case PCI_DEVICE_ID_CYRIX_5520:
@@ -294,13 +314,13 @@ static void gx_set_cpuspeed(unsigned int khz)
294 suscfg = gx_params->pci_suscfg & ~(SUSMOD); 314 suscfg = gx_params->pci_suscfg & ~(SUSMOD);
295 gx_params->off_duration = 0; 315 gx_params->off_duration = 0;
296 gx_params->on_duration = 0; 316 gx_params->on_duration = 0;
297 dprintk("suspend modulation disabled: cpu runs 100 percent speed.\n"); 317 dprintk("suspend modulation disabled: cpu runs 100%% speed.\n");
298 } 318 }
299 319
300 pci_write_config_byte(gx_params->cs55x0, PCI_MODOFF, gx_params->off_duration); 320 gx_write_byte(PCI_MODOFF, gx_params->off_duration);
301 pci_write_config_byte(gx_params->cs55x0, PCI_MODON, gx_params->on_duration); 321 gx_write_byte(PCI_MODON, gx_params->on_duration);
302 322
303 pci_write_config_byte(gx_params->cs55x0, PCI_SUSCFG, suscfg); 323 gx_write_byte(PCI_SUSCFG, suscfg);
304 pci_read_config_byte(gx_params->cs55x0, PCI_SUSCFG, &suscfg); 324 pci_read_config_byte(gx_params->cs55x0, PCI_SUSCFG, &suscfg);
305 325
306 local_irq_restore(flags); 326 local_irq_restore(flags);
@@ -334,7 +354,8 @@ static int cpufreq_gx_verify(struct cpufreq_policy *policy)
334 return -EINVAL; 354 return -EINVAL;
335 355
336 policy->cpu = 0; 356 policy->cpu = 0;
337 cpufreq_verify_within_limits(policy, (stock_freq / max_duration), stock_freq); 357 cpufreq_verify_within_limits(policy, (stock_freq / max_duration),
358 stock_freq);
338 359
339 /* it needs to be assured that at least one supported frequency is 360 /* it needs to be assured that at least one supported frequency is
340 * within policy->min and policy->max. If it is not, policy->max 361 * within policy->min and policy->max. If it is not, policy->max
@@ -354,7 +375,8 @@ static int cpufreq_gx_verify(struct cpufreq_policy *policy)
354 policy->max = tmp_freq; 375 policy->max = tmp_freq;
355 if (policy->max < policy->min) 376 if (policy->max < policy->min)
356 policy->max = policy->min; 377 policy->max = policy->min;
357 cpufreq_verify_within_limits(policy, (stock_freq / max_duration), stock_freq); 378 cpufreq_verify_within_limits(policy, (stock_freq / max_duration),
379 stock_freq);
358 380
359 return 0; 381 return 0;
360} 382}
@@ -398,18 +420,18 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
398 return -ENODEV; 420 return -ENODEV;
399 421
400 /* determine maximum frequency */ 422 /* determine maximum frequency */
401 if (pci_busclk) { 423 if (pci_busclk)
402 maxfreq = pci_busclk * gx_freq_mult[getCx86(CX86_DIR1) & 0x0f]; 424 maxfreq = pci_busclk * gx_freq_mult[getCx86(CX86_DIR1) & 0x0f];
403 } else if (cpu_khz) { 425 else if (cpu_khz)
404 maxfreq = cpu_khz; 426 maxfreq = cpu_khz;
405 } else { 427 else
406 maxfreq = 30000 * gx_freq_mult[getCx86(CX86_DIR1) & 0x0f]; 428 maxfreq = 30000 * gx_freq_mult[getCx86(CX86_DIR1) & 0x0f];
407 } 429
408 stock_freq = maxfreq; 430 stock_freq = maxfreq;
409 curfreq = gx_get_cpuspeed(0); 431 curfreq = gx_get_cpuspeed(0);
410 432
411 dprintk("cpu max frequency is %d.\n", maxfreq); 433 dprintk("cpu max frequency is %d.\n", maxfreq);
412 dprintk("cpu current frequency is %dkHz.\n",curfreq); 434 dprintk("cpu current frequency is %dkHz.\n", curfreq);
413 435
414 /* setup basic struct for cpufreq API */ 436 /* setup basic struct for cpufreq API */
415 policy->cpu = 0; 437 policy->cpu = 0;
@@ -447,7 +469,8 @@ static int __init cpufreq_gx_init(void)
447 struct pci_dev *gx_pci; 469 struct pci_dev *gx_pci;
448 470
449 /* Test if we have the right hardware */ 471 /* Test if we have the right hardware */
450 if ((gx_pci = gx_detect_chipset()) == NULL) 472 gx_pci = gx_detect_chipset();
473 if (gx_pci == NULL)
451 return -ENODEV; 474 return -ENODEV;
452 475
453 /* check whether module parameters are sane */ 476 /* check whether module parameters are sane */
@@ -468,9 +491,11 @@ static int __init cpufreq_gx_init(void)
468 pci_read_config_byte(params->cs55x0, PCI_PMER1, &(params->pci_pmer1)); 491 pci_read_config_byte(params->cs55x0, PCI_PMER1, &(params->pci_pmer1));
469 pci_read_config_byte(params->cs55x0, PCI_PMER2, &(params->pci_pmer2)); 492 pci_read_config_byte(params->cs55x0, PCI_PMER2, &(params->pci_pmer2));
470 pci_read_config_byte(params->cs55x0, PCI_MODON, &(params->on_duration)); 493 pci_read_config_byte(params->cs55x0, PCI_MODON, &(params->on_duration));
471 pci_read_config_byte(params->cs55x0, PCI_MODOFF, &(params->off_duration)); 494 pci_read_config_byte(params->cs55x0, PCI_MODOFF,
495 &(params->off_duration));
472 496
473 if ((ret = cpufreq_register_driver(&gx_suspmod_driver))) { 497 ret = cpufreq_register_driver(&gx_suspmod_driver);
498 if (ret) {
474 kfree(params); 499 kfree(params);
475 return ret; /* register error! */ 500 return ret; /* register error! */
476 } 501 }
@@ -485,9 +510,9 @@ static void __exit cpufreq_gx_exit(void)
485 kfree(gx_params); 510 kfree(gx_params);
486} 511}
487 512
488MODULE_AUTHOR ("Hiroshi Miura <miura@da-cha.org>"); 513MODULE_AUTHOR("Hiroshi Miura <miura@da-cha.org>");
489MODULE_DESCRIPTION ("Cpufreq driver for Cyrix MediaGX and NatSemi Geode"); 514MODULE_DESCRIPTION("Cpufreq driver for Cyrix MediaGX and NatSemi Geode");
490MODULE_LICENSE ("GPL"); 515MODULE_LICENSE("GPL");
491 516
492module_init(cpufreq_gx_init); 517module_init(cpufreq_gx_init);
493module_exit(cpufreq_gx_exit); 518module_exit(cpufreq_gx_exit);
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c
index a4cff5d6e380..f1c51aea064d 100644
--- a/arch/x86/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c
@@ -30,12 +30,12 @@
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/timex.h>
34#include <linux/io.h>
35#include <linux/acpi.h>
36#include <linux/kernel.h>
33 37
34#include <asm/msr.h> 38#include <asm/msr.h>
35#include <asm/timex.h>
36#include <asm/io.h>
37#include <asm/acpi.h>
38#include <linux/acpi.h>
39#include <acpi/processor.h> 39#include <acpi/processor.h>
40 40
41#include "longhaul.h" 41#include "longhaul.h"
@@ -58,7 +58,7 @@
58#define USE_NORTHBRIDGE (1 << 2) 58#define USE_NORTHBRIDGE (1 << 2)
59 59
60static int cpu_model; 60static int cpu_model;
61static unsigned int numscales=16; 61static unsigned int numscales = 16;
62static unsigned int fsb; 62static unsigned int fsb;
63 63
64static const struct mV_pos *vrm_mV_table; 64static const struct mV_pos *vrm_mV_table;
@@ -67,8 +67,8 @@ static const unsigned char *mV_vrm_table;
67static unsigned int highest_speed, lowest_speed; /* kHz */ 67static unsigned int highest_speed, lowest_speed; /* kHz */
68static unsigned int minmult, maxmult; 68static unsigned int minmult, maxmult;
69static int can_scale_voltage; 69static int can_scale_voltage;
70static struct acpi_processor *pr = NULL; 70static struct acpi_processor *pr;
71static struct acpi_processor_cx *cx = NULL; 71static struct acpi_processor_cx *cx;
72static u32 acpi_regs_addr; 72static u32 acpi_regs_addr;
73static u8 longhaul_flags; 73static u8 longhaul_flags;
74static unsigned int longhaul_index; 74static unsigned int longhaul_index;
@@ -78,12 +78,13 @@ static int scale_voltage;
78static int disable_acpi_c3; 78static int disable_acpi_c3;
79static int revid_errata; 79static int revid_errata;
80 80
81#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) 81#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
82 "longhaul", msg)
82 83
83 84
84/* Clock ratios multiplied by 10 */ 85/* Clock ratios multiplied by 10 */
85static int clock_ratio[32]; 86static int mults[32];
86static int eblcr_table[32]; 87static int eblcr[32];
87static int longhaul_version; 88static int longhaul_version;
88static struct cpufreq_frequency_table *longhaul_table; 89static struct cpufreq_frequency_table *longhaul_table;
89 90
@@ -93,7 +94,7 @@ static char speedbuffer[8];
93static char *print_speed(int speed) 94static char *print_speed(int speed)
94{ 95{
95 if (speed < 1000) { 96 if (speed < 1000) {
96 snprintf(speedbuffer, sizeof(speedbuffer),"%dMHz", speed); 97 snprintf(speedbuffer, sizeof(speedbuffer), "%dMHz", speed);
97 return speedbuffer; 98 return speedbuffer;
98 } 99 }
99 100
@@ -122,27 +123,28 @@ static unsigned int calc_speed(int mult)
122 123
123static int longhaul_get_cpu_mult(void) 124static int longhaul_get_cpu_mult(void)
124{ 125{
125 unsigned long invalue=0,lo, hi; 126 unsigned long invalue = 0, lo, hi;
126 127
127 rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi); 128 rdmsr(MSR_IA32_EBL_CR_POWERON, lo, hi);
128 invalue = (lo & (1<<22|1<<23|1<<24|1<<25)) >>22; 129 invalue = (lo & (1<<22|1<<23|1<<24|1<<25))>>22;
129 if (longhaul_version==TYPE_LONGHAUL_V2 || longhaul_version==TYPE_POWERSAVER) { 130 if (longhaul_version == TYPE_LONGHAUL_V2 ||
131 longhaul_version == TYPE_POWERSAVER) {
130 if (lo & (1<<27)) 132 if (lo & (1<<27))
131 invalue+=16; 133 invalue += 16;
132 } 134 }
133 return eblcr_table[invalue]; 135 return eblcr[invalue];
134} 136}
135 137
136/* For processor with BCR2 MSR */ 138/* For processor with BCR2 MSR */
137 139
138static void do_longhaul1(unsigned int clock_ratio_index) 140static void do_longhaul1(unsigned int mults_index)
139{ 141{
140 union msr_bcr2 bcr2; 142 union msr_bcr2 bcr2;
141 143
142 rdmsrl(MSR_VIA_BCR2, bcr2.val); 144 rdmsrl(MSR_VIA_BCR2, bcr2.val);
143 /* Enable software clock multiplier */ 145 /* Enable software clock multiplier */
144 bcr2.bits.ESOFTBF = 1; 146 bcr2.bits.ESOFTBF = 1;
145 bcr2.bits.CLOCKMUL = clock_ratio_index & 0xff; 147 bcr2.bits.CLOCKMUL = mults_index & 0xff;
146 148
147 /* Sync to timer tick */ 149 /* Sync to timer tick */
148 safe_halt(); 150 safe_halt();
@@ -161,7 +163,7 @@ static void do_longhaul1(unsigned int clock_ratio_index)
161 163
162/* For processor with Longhaul MSR */ 164/* For processor with Longhaul MSR */
163 165
164static void do_powersaver(int cx_address, unsigned int clock_ratio_index, 166static void do_powersaver(int cx_address, unsigned int mults_index,
165 unsigned int dir) 167 unsigned int dir)
166{ 168{
167 union msr_longhaul longhaul; 169 union msr_longhaul longhaul;
@@ -173,11 +175,11 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index,
173 longhaul.bits.RevisionKey = longhaul.bits.RevisionID; 175 longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
174 else 176 else
175 longhaul.bits.RevisionKey = 0; 177 longhaul.bits.RevisionKey = 0;
176 longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf; 178 longhaul.bits.SoftBusRatio = mults_index & 0xf;
177 longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; 179 longhaul.bits.SoftBusRatio4 = (mults_index & 0x10) >> 4;
178 /* Setup new voltage */ 180 /* Setup new voltage */
179 if (can_scale_voltage) 181 if (can_scale_voltage)
180 longhaul.bits.SoftVID = (clock_ratio_index >> 8) & 0x1f; 182 longhaul.bits.SoftVID = (mults_index >> 8) & 0x1f;
181 /* Sync to timer tick */ 183 /* Sync to timer tick */
182 safe_halt(); 184 safe_halt();
183 /* Raise voltage if necessary */ 185 /* Raise voltage if necessary */
@@ -240,14 +242,14 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index,
240 242
241/** 243/**
242 * longhaul_set_cpu_frequency() 244 * longhaul_set_cpu_frequency()
243 * @clock_ratio_index : bitpattern of the new multiplier. 245 * @mults_index : bitpattern of the new multiplier.
244 * 246 *
245 * Sets a new clock ratio. 247 * Sets a new clock ratio.
246 */ 248 */
247 249
248static void longhaul_setstate(unsigned int table_index) 250static void longhaul_setstate(unsigned int table_index)
249{ 251{
250 unsigned int clock_ratio_index; 252 unsigned int mults_index;
251 int speed, mult; 253 int speed, mult;
252 struct cpufreq_freqs freqs; 254 struct cpufreq_freqs freqs;
253 unsigned long flags; 255 unsigned long flags;
@@ -256,9 +258,9 @@ static void longhaul_setstate(unsigned int table_index)
256 u32 bm_timeout = 1000; 258 u32 bm_timeout = 1000;
257 unsigned int dir = 0; 259 unsigned int dir = 0;
258 260
259 clock_ratio_index = longhaul_table[table_index].index; 261 mults_index = longhaul_table[table_index].index;
260 /* Safety precautions */ 262 /* Safety precautions */
261 mult = clock_ratio[clock_ratio_index & 0x1f]; 263 mult = mults[mults_index & 0x1f];
262 if (mult == -1) 264 if (mult == -1)
263 return; 265 return;
264 speed = calc_speed(mult); 266 speed = calc_speed(mult);
@@ -274,7 +276,7 @@ static void longhaul_setstate(unsigned int table_index)
274 276
275 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 277 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
276 278
277 dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", 279 dprintk("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
278 fsb, mult/10, mult%10, print_speed(speed/1000)); 280 fsb, mult/10, mult%10, print_speed(speed/1000));
279retry_loop: 281retry_loop:
280 preempt_disable(); 282 preempt_disable();
@@ -282,8 +284,8 @@ retry_loop:
282 284
283 pic2_mask = inb(0xA1); 285 pic2_mask = inb(0xA1);
284 pic1_mask = inb(0x21); /* works on C3. save mask. */ 286 pic1_mask = inb(0x21); /* works on C3. save mask. */
285 outb(0xFF,0xA1); /* Overkill */ 287 outb(0xFF, 0xA1); /* Overkill */
286 outb(0xFE,0x21); /* TMR0 only */ 288 outb(0xFE, 0x21); /* TMR0 only */
287 289
288 /* Wait while PCI bus is busy. */ 290 /* Wait while PCI bus is busy. */
289 if (acpi_regs_addr && (longhaul_flags & USE_NORTHBRIDGE 291 if (acpi_regs_addr && (longhaul_flags & USE_NORTHBRIDGE
@@ -312,7 +314,7 @@ retry_loop:
312 * Software controlled multipliers only. 314 * Software controlled multipliers only.
313 */ 315 */
314 case TYPE_LONGHAUL_V1: 316 case TYPE_LONGHAUL_V1:
315 do_longhaul1(clock_ratio_index); 317 do_longhaul1(mults_index);
316 break; 318 break;
317 319
318 /* 320 /*
@@ -327,9 +329,9 @@ retry_loop:
327 if (longhaul_flags & USE_ACPI_C3) { 329 if (longhaul_flags & USE_ACPI_C3) {
328 /* Don't allow wakeup */ 330 /* Don't allow wakeup */
329 acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0); 331 acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
330 do_powersaver(cx->address, clock_ratio_index, dir); 332 do_powersaver(cx->address, mults_index, dir);
331 } else { 333 } else {
332 do_powersaver(0, clock_ratio_index, dir); 334 do_powersaver(0, mults_index, dir);
333 } 335 }
334 break; 336 break;
335 } 337 }
@@ -341,8 +343,8 @@ retry_loop:
341 /* Enable bus master arbitration */ 343 /* Enable bus master arbitration */
342 acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); 344 acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
343 } 345 }
344 outb(pic2_mask,0xA1); /* restore mask */ 346 outb(pic2_mask, 0xA1); /* restore mask */
345 outb(pic1_mask,0x21); 347 outb(pic1_mask, 0x21);
346 348
347 local_irq_restore(flags); 349 local_irq_restore(flags);
348 preempt_enable(); 350 preempt_enable();
@@ -392,7 +394,8 @@ retry_loop:
392 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 394 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
393 395
394 if (!bm_timeout) 396 if (!bm_timeout)
395 printk(KERN_INFO PFX "Warning: Timeout while waiting for idle PCI bus.\n"); 397 printk(KERN_INFO PFX "Warning: Timeout while waiting for "
398 "idle PCI bus.\n");
396} 399}
397 400
398/* 401/*
@@ -458,31 +461,32 @@ static int __init longhaul_get_ranges(void)
458 break; 461 break;
459 } 462 }
460 463
461 dprintk ("MinMult:%d.%dx MaxMult:%d.%dx\n", 464 dprintk("MinMult:%d.%dx MaxMult:%d.%dx\n",
462 minmult/10, minmult%10, maxmult/10, maxmult%10); 465 minmult/10, minmult%10, maxmult/10, maxmult%10);
463 466
464 highest_speed = calc_speed(maxmult); 467 highest_speed = calc_speed(maxmult);
465 lowest_speed = calc_speed(minmult); 468 lowest_speed = calc_speed(minmult);
466 dprintk ("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, 469 dprintk("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb,
467 print_speed(lowest_speed/1000), 470 print_speed(lowest_speed/1000),
468 print_speed(highest_speed/1000)); 471 print_speed(highest_speed/1000));
469 472
470 if (lowest_speed == highest_speed) { 473 if (lowest_speed == highest_speed) {
471 printk (KERN_INFO PFX "highestspeed == lowest, aborting.\n"); 474 printk(KERN_INFO PFX "highestspeed == lowest, aborting.\n");
472 return -EINVAL; 475 return -EINVAL;
473 } 476 }
474 if (lowest_speed > highest_speed) { 477 if (lowest_speed > highest_speed) {
475 printk (KERN_INFO PFX "nonsense! lowest (%d > %d) !\n", 478 printk(KERN_INFO PFX "nonsense! lowest (%d > %d) !\n",
476 lowest_speed, highest_speed); 479 lowest_speed, highest_speed);
477 return -EINVAL; 480 return -EINVAL;
478 } 481 }
479 482
480 longhaul_table = kmalloc((numscales + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL); 483 longhaul_table = kmalloc((numscales + 1) * sizeof(*longhaul_table),
481 if(!longhaul_table) 484 GFP_KERNEL);
485 if (!longhaul_table)
482 return -ENOMEM; 486 return -ENOMEM;
483 487
484 for (j = 0; j < numscales; j++) { 488 for (j = 0; j < numscales; j++) {
485 ratio = clock_ratio[j]; 489 ratio = mults[j];
486 if (ratio == -1) 490 if (ratio == -1)
487 continue; 491 continue;
488 if (ratio > maxmult || ratio < minmult) 492 if (ratio > maxmult || ratio < minmult)
@@ -507,13 +511,10 @@ static int __init longhaul_get_ranges(void)
507 } 511 }
508 } 512 }
509 if (min_i != j) { 513 if (min_i != j) {
510 unsigned int temp; 514 swap(longhaul_table[j].frequency,
511 temp = longhaul_table[j].frequency; 515 longhaul_table[min_i].frequency);
512 longhaul_table[j].frequency = longhaul_table[min_i].frequency; 516 swap(longhaul_table[j].index,
513 longhaul_table[min_i].frequency = temp; 517 longhaul_table[min_i].index);
514 temp = longhaul_table[j].index;
515 longhaul_table[j].index = longhaul_table[min_i].index;
516 longhaul_table[min_i].index = temp;
517 } 518 }
518 } 519 }
519 520
@@ -521,7 +522,7 @@ static int __init longhaul_get_ranges(void)
521 522
522 /* Find index we are running on */ 523 /* Find index we are running on */
523 for (j = 0; j < k; j++) { 524 for (j = 0; j < k; j++) {
524 if (clock_ratio[longhaul_table[j].index & 0x1f] == mult) { 525 if (mults[longhaul_table[j].index & 0x1f] == mult) {
525 longhaul_index = j; 526 longhaul_index = j;
526 break; 527 break;
527 } 528 }
@@ -559,20 +560,22 @@ static void __init longhaul_setup_voltagescaling(void)
559 maxvid = vrm_mV_table[longhaul.bits.MaximumVID]; 560 maxvid = vrm_mV_table[longhaul.bits.MaximumVID];
560 561
561 if (minvid.mV == 0 || maxvid.mV == 0 || minvid.mV > maxvid.mV) { 562 if (minvid.mV == 0 || maxvid.mV == 0 || minvid.mV > maxvid.mV) {
562 printk (KERN_INFO PFX "Bogus values Min:%d.%03d Max:%d.%03d. " 563 printk(KERN_INFO PFX "Bogus values Min:%d.%03d Max:%d.%03d. "
563 "Voltage scaling disabled.\n", 564 "Voltage scaling disabled.\n",
564 minvid.mV/1000, minvid.mV%1000, maxvid.mV/1000, maxvid.mV%1000); 565 minvid.mV/1000, minvid.mV%1000,
566 maxvid.mV/1000, maxvid.mV%1000);
565 return; 567 return;
566 } 568 }
567 569
568 if (minvid.mV == maxvid.mV) { 570 if (minvid.mV == maxvid.mV) {
569 printk (KERN_INFO PFX "Claims to support voltage scaling but min & max are " 571 printk(KERN_INFO PFX "Claims to support voltage scaling but "
570 "both %d.%03d. Voltage scaling disabled\n", 572 "min & max are both %d.%03d. "
573 "Voltage scaling disabled\n",
571 maxvid.mV/1000, maxvid.mV%1000); 574 maxvid.mV/1000, maxvid.mV%1000);
572 return; 575 return;
573 } 576 }
574 577
575 /* How many voltage steps */ 578 /* How many voltage steps*/
576 numvscales = maxvid.pos - minvid.pos + 1; 579 numvscales = maxvid.pos - minvid.pos + 1;
577 printk(KERN_INFO PFX 580 printk(KERN_INFO PFX
578 "Max VID=%d.%03d " 581 "Max VID=%d.%03d "
@@ -586,7 +589,7 @@ static void __init longhaul_setup_voltagescaling(void)
586 j = longhaul.bits.MinMHzBR; 589 j = longhaul.bits.MinMHzBR;
587 if (longhaul.bits.MinMHzBR4) 590 if (longhaul.bits.MinMHzBR4)
588 j += 16; 591 j += 16;
589 min_vid_speed = eblcr_table[j]; 592 min_vid_speed = eblcr[j];
590 if (min_vid_speed == -1) 593 if (min_vid_speed == -1)
591 return; 594 return;
592 switch (longhaul.bits.MinMHzFSB) { 595 switch (longhaul.bits.MinMHzFSB) {
@@ -617,7 +620,8 @@ static void __init longhaul_setup_voltagescaling(void)
617 pos = minvid.pos; 620 pos = minvid.pos;
618 longhaul_table[j].index |= mV_vrm_table[pos] << 8; 621 longhaul_table[j].index |= mV_vrm_table[pos] << 8;
619 vid = vrm_mV_table[mV_vrm_table[pos]]; 622 vid = vrm_mV_table[mV_vrm_table[pos]];
620 printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n", speed, j, vid.mV); 623 printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n",
624 speed, j, vid.mV);
621 j++; 625 j++;
622 } 626 }
623 627
@@ -640,7 +644,8 @@ static int longhaul_target(struct cpufreq_policy *policy,
640 unsigned int dir = 0; 644 unsigned int dir = 0;
641 u8 vid, current_vid; 645 u8 vid, current_vid;
642 646
643 if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq, relation, &table_index)) 647 if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq,
648 relation, &table_index))
644 return -EINVAL; 649 return -EINVAL;
645 650
646 /* Don't set same frequency again */ 651 /* Don't set same frequency again */
@@ -656,7 +661,8 @@ static int longhaul_target(struct cpufreq_policy *policy,
656 * this in hardware, C3 is old and we need to do this 661 * this in hardware, C3 is old and we need to do this
657 * in software. */ 662 * in software. */
658 i = longhaul_index; 663 i = longhaul_index;
659 current_vid = (longhaul_table[longhaul_index].index >> 8) & 0x1f; 664 current_vid = (longhaul_table[longhaul_index].index >> 8);
665 current_vid &= 0x1f;
660 if (table_index > longhaul_index) 666 if (table_index > longhaul_index)
661 dir = 1; 667 dir = 1;
662 while (i != table_index) { 668 while (i != table_index) {
@@ -691,9 +697,9 @@ static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
691{ 697{
692 struct acpi_device *d; 698 struct acpi_device *d;
693 699
694 if ( acpi_bus_get_device(obj_handle, &d) ) { 700 if (acpi_bus_get_device(obj_handle, &d))
695 return 0; 701 return 0;
696 } 702
697 *return_value = acpi_driver_data(d); 703 *return_value = acpi_driver_data(d);
698 return 1; 704 return 1;
699} 705}
@@ -750,7 +756,7 @@ static int longhaul_setup_southbridge(void)
750 /* Find VT8235 southbridge */ 756 /* Find VT8235 southbridge */
751 dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, NULL); 757 dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, NULL);
752 if (dev == NULL) 758 if (dev == NULL)
753 /* Find VT8237 southbridge */ 759 /* Find VT8237 southbridge */
754 dev = pci_get_device(PCI_VENDOR_ID_VIA, 760 dev = pci_get_device(PCI_VENDOR_ID_VIA,
755 PCI_DEVICE_ID_VIA_8237, NULL); 761 PCI_DEVICE_ID_VIA_8237, NULL);
756 if (dev != NULL) { 762 if (dev != NULL) {
@@ -769,7 +775,8 @@ static int longhaul_setup_southbridge(void)
769 if (pci_cmd & 1 << 7) { 775 if (pci_cmd & 1 << 7) {
770 pci_read_config_dword(dev, 0x88, &acpi_regs_addr); 776 pci_read_config_dword(dev, 0x88, &acpi_regs_addr);
771 acpi_regs_addr &= 0xff00; 777 acpi_regs_addr &= 0xff00;
772 printk(KERN_INFO PFX "ACPI I/O at 0x%x\n", acpi_regs_addr); 778 printk(KERN_INFO PFX "ACPI I/O at 0x%x\n",
779 acpi_regs_addr);
773 } 780 }
774 781
775 pci_dev_put(dev); 782 pci_dev_put(dev);
@@ -781,7 +788,7 @@ static int longhaul_setup_southbridge(void)
781static int __init longhaul_cpu_init(struct cpufreq_policy *policy) 788static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
782{ 789{
783 struct cpuinfo_x86 *c = &cpu_data(0); 790 struct cpuinfo_x86 *c = &cpu_data(0);
784 char *cpuname=NULL; 791 char *cpuname = NULL;
785 int ret; 792 int ret;
786 u32 lo, hi; 793 u32 lo, hi;
787 794
@@ -791,8 +798,8 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
791 cpu_model = CPU_SAMUEL; 798 cpu_model = CPU_SAMUEL;
792 cpuname = "C3 'Samuel' [C5A]"; 799 cpuname = "C3 'Samuel' [C5A]";
793 longhaul_version = TYPE_LONGHAUL_V1; 800 longhaul_version = TYPE_LONGHAUL_V1;
794 memcpy (clock_ratio, samuel1_clock_ratio, sizeof(samuel1_clock_ratio)); 801 memcpy(mults, samuel1_mults, sizeof(samuel1_mults));
795 memcpy (eblcr_table, samuel1_eblcr, sizeof(samuel1_eblcr)); 802 memcpy(eblcr, samuel1_eblcr, sizeof(samuel1_eblcr));
796 break; 803 break;
797 804
798 case 7: 805 case 7:
@@ -803,10 +810,8 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
803 cpuname = "C3 'Samuel 2' [C5B]"; 810 cpuname = "C3 'Samuel 2' [C5B]";
804 /* Note, this is not a typo, early Samuel2's had 811 /* Note, this is not a typo, early Samuel2's had
805 * Samuel1 ratios. */ 812 * Samuel1 ratios. */
806 memcpy(clock_ratio, samuel1_clock_ratio, 813 memcpy(mults, samuel1_mults, sizeof(samuel1_mults));
807 sizeof(samuel1_clock_ratio)); 814 memcpy(eblcr, samuel2_eblcr, sizeof(samuel2_eblcr));
808 memcpy(eblcr_table, samuel2_eblcr,
809 sizeof(samuel2_eblcr));
810 break; 815 break;
811 case 1 ... 15: 816 case 1 ... 15:
812 longhaul_version = TYPE_LONGHAUL_V1; 817 longhaul_version = TYPE_LONGHAUL_V1;
@@ -817,10 +822,8 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
817 cpu_model = CPU_EZRA; 822 cpu_model = CPU_EZRA;
818 cpuname = "C3 'Ezra' [C5C]"; 823 cpuname = "C3 'Ezra' [C5C]";
819 } 824 }
820 memcpy(clock_ratio, ezra_clock_ratio, 825 memcpy(mults, ezra_mults, sizeof(ezra_mults));
821 sizeof(ezra_clock_ratio)); 826 memcpy(eblcr, ezra_eblcr, sizeof(ezra_eblcr));
822 memcpy(eblcr_table, ezra_eblcr,
823 sizeof(ezra_eblcr));
824 break; 827 break;
825 } 828 }
826 break; 829 break;
@@ -829,18 +832,16 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
829 cpu_model = CPU_EZRA_T; 832 cpu_model = CPU_EZRA_T;
830 cpuname = "C3 'Ezra-T' [C5M]"; 833 cpuname = "C3 'Ezra-T' [C5M]";
831 longhaul_version = TYPE_POWERSAVER; 834 longhaul_version = TYPE_POWERSAVER;
832 numscales=32; 835 numscales = 32;
833 memcpy (clock_ratio, ezrat_clock_ratio, sizeof(ezrat_clock_ratio)); 836 memcpy(mults, ezrat_mults, sizeof(ezrat_mults));
834 memcpy (eblcr_table, ezrat_eblcr, sizeof(ezrat_eblcr)); 837 memcpy(eblcr, ezrat_eblcr, sizeof(ezrat_eblcr));
835 break; 838 break;
836 839
837 case 9: 840 case 9:
838 longhaul_version = TYPE_POWERSAVER; 841 longhaul_version = TYPE_POWERSAVER;
839 numscales = 32; 842 numscales = 32;
840 memcpy(clock_ratio, 843 memcpy(mults, nehemiah_mults, sizeof(nehemiah_mults));
841 nehemiah_clock_ratio, 844 memcpy(eblcr, nehemiah_eblcr, sizeof(nehemiah_eblcr));
842 sizeof(nehemiah_clock_ratio));
843 memcpy(eblcr_table, nehemiah_eblcr, sizeof(nehemiah_eblcr));
844 switch (c->x86_mask) { 845 switch (c->x86_mask) {
845 case 0 ... 1: 846 case 0 ... 1:
846 cpu_model = CPU_NEHEMIAH; 847 cpu_model = CPU_NEHEMIAH;
@@ -869,14 +870,14 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
869 longhaul_version = TYPE_LONGHAUL_V1; 870 longhaul_version = TYPE_LONGHAUL_V1;
870 } 871 }
871 872
872 printk (KERN_INFO PFX "VIA %s CPU detected. ", cpuname); 873 printk(KERN_INFO PFX "VIA %s CPU detected. ", cpuname);
873 switch (longhaul_version) { 874 switch (longhaul_version) {
874 case TYPE_LONGHAUL_V1: 875 case TYPE_LONGHAUL_V1:
875 case TYPE_LONGHAUL_V2: 876 case TYPE_LONGHAUL_V2:
876 printk ("Longhaul v%d supported.\n", longhaul_version); 877 printk(KERN_CONT "Longhaul v%d supported.\n", longhaul_version);
877 break; 878 break;
878 case TYPE_POWERSAVER: 879 case TYPE_POWERSAVER:
879 printk ("Powersaver supported.\n"); 880 printk(KERN_CONT "Powersaver supported.\n");
880 break; 881 break;
881 }; 882 };
882 883
@@ -940,7 +941,7 @@ static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy)
940 return 0; 941 return 0;
941} 942}
942 943
943static struct freq_attr* longhaul_attr[] = { 944static struct freq_attr *longhaul_attr[] = {
944 &cpufreq_freq_attr_scaling_available_freqs, 945 &cpufreq_freq_attr_scaling_available_freqs,
945 NULL, 946 NULL,
946}; 947};
@@ -966,13 +967,15 @@ static int __init longhaul_init(void)
966 967
967#ifdef CONFIG_SMP 968#ifdef CONFIG_SMP
968 if (num_online_cpus() > 1) { 969 if (num_online_cpus() > 1) {
969 printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n"); 970 printk(KERN_ERR PFX "More than 1 CPU detected, "
971 "longhaul disabled.\n");
970 return -ENODEV; 972 return -ENODEV;
971 } 973 }
972#endif 974#endif
973#ifdef CONFIG_X86_IO_APIC 975#ifdef CONFIG_X86_IO_APIC
974 if (cpu_has_apic) { 976 if (cpu_has_apic) {
975 printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n"); 977 printk(KERN_ERR PFX "APIC detected. Longhaul is currently "
978 "broken in this configuration.\n");
976 return -ENODEV; 979 return -ENODEV;
977 } 980 }
978#endif 981#endif
@@ -993,8 +996,8 @@ static void __exit longhaul_exit(void)
993{ 996{
994 int i; 997 int i;
995 998
996 for (i=0; i < numscales; i++) { 999 for (i = 0; i < numscales; i++) {
997 if (clock_ratio[i] == maxmult) { 1000 if (mults[i] == maxmult) {
998 longhaul_setstate(i); 1001 longhaul_setstate(i);
999 break; 1002 break;
1000 } 1003 }
@@ -1007,11 +1010,11 @@ static void __exit longhaul_exit(void)
1007/* Even if BIOS is exporting ACPI C3 state, and it is used 1010/* Even if BIOS is exporting ACPI C3 state, and it is used
1008 * with success when CPU is idle, this state doesn't 1011 * with success when CPU is idle, this state doesn't
1009 * trigger frequency transition in some cases. */ 1012 * trigger frequency transition in some cases. */
1010module_param (disable_acpi_c3, int, 0644); 1013module_param(disable_acpi_c3, int, 0644);
1011MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support"); 1014MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support");
1012/* Change CPU voltage with frequency. Very usefull to save 1015/* Change CPU voltage with frequency. Very usefull to save
1013 * power, but most VIA C3 processors aren't supporting it. */ 1016 * power, but most VIA C3 processors aren't supporting it. */
1014module_param (scale_voltage, int, 0644); 1017module_param(scale_voltage, int, 0644);
1015MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor"); 1018MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor");
1016/* Force revision key to 0 for processors which doesn't 1019/* Force revision key to 0 for processors which doesn't
1017 * support voltage scaling, but are introducing itself as 1020 * support voltage scaling, but are introducing itself as
@@ -1019,9 +1022,9 @@ MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor");
1019module_param(revid_errata, int, 0644); 1022module_param(revid_errata, int, 0644);
1020MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID"); 1023MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID");
1021 1024
1022MODULE_AUTHOR ("Dave Jones <davej@redhat.com>"); 1025MODULE_AUTHOR("Dave Jones <davej@redhat.com>");
1023MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); 1026MODULE_DESCRIPTION("Longhaul driver for VIA Cyrix processors.");
1024MODULE_LICENSE ("GPL"); 1027MODULE_LICENSE("GPL");
1025 1028
1026late_initcall(longhaul_init); 1029late_initcall(longhaul_init);
1027module_exit(longhaul_exit); 1030module_exit(longhaul_exit);
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.h b/arch/x86/kernel/cpu/cpufreq/longhaul.h
index 4fcc320997df..e2360a469f79 100644
--- a/arch/x86/kernel/cpu/cpufreq/longhaul.h
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.h
@@ -49,14 +49,14 @@ union msr_longhaul {
49 49
50/* 50/*
51 * Clock ratio tables. Div/Mod by 10 to get ratio. 51 * Clock ratio tables. Div/Mod by 10 to get ratio.
52 * The eblcr ones specify the ratio read from the CPU. 52 * The eblcr values specify the ratio read from the CPU.
53 * The clock_ratio ones specify what to write to the CPU. 53 * The mults values specify what to write to the CPU.
54 */ 54 */
55 55
56/* 56/*
57 * VIA C3 Samuel 1 & Samuel 2 (stepping 0) 57 * VIA C3 Samuel 1 & Samuel 2 (stepping 0)
58 */ 58 */
59static const int __initdata samuel1_clock_ratio[16] = { 59static const int __initdata samuel1_mults[16] = {
60 -1, /* 0000 -> RESERVED */ 60 -1, /* 0000 -> RESERVED */
61 30, /* 0001 -> 3.0x */ 61 30, /* 0001 -> 3.0x */
62 40, /* 0010 -> 4.0x */ 62 40, /* 0010 -> 4.0x */
@@ -119,7 +119,7 @@ static const int __initdata samuel2_eblcr[16] = {
119/* 119/*
120 * VIA C3 Ezra 120 * VIA C3 Ezra
121 */ 121 */
122static const int __initdata ezra_clock_ratio[16] = { 122static const int __initdata ezra_mults[16] = {
123 100, /* 0000 -> 10.0x */ 123 100, /* 0000 -> 10.0x */
124 30, /* 0001 -> 3.0x */ 124 30, /* 0001 -> 3.0x */
125 40, /* 0010 -> 4.0x */ 125 40, /* 0010 -> 4.0x */
@@ -160,7 +160,7 @@ static const int __initdata ezra_eblcr[16] = {
160/* 160/*
161 * VIA C3 (Ezra-T) [C5M]. 161 * VIA C3 (Ezra-T) [C5M].
162 */ 162 */
163static const int __initdata ezrat_clock_ratio[32] = { 163static const int __initdata ezrat_mults[32] = {
164 100, /* 0000 -> 10.0x */ 164 100, /* 0000 -> 10.0x */
165 30, /* 0001 -> 3.0x */ 165 30, /* 0001 -> 3.0x */
166 40, /* 0010 -> 4.0x */ 166 40, /* 0010 -> 4.0x */
@@ -235,7 +235,7 @@ static const int __initdata ezrat_eblcr[32] = {
235/* 235/*
236 * VIA C3 Nehemiah */ 236 * VIA C3 Nehemiah */
237 237
238static const int __initdata nehemiah_clock_ratio[32] = { 238static const int __initdata nehemiah_mults[32] = {
239 100, /* 0000 -> 10.0x */ 239 100, /* 0000 -> 10.0x */
240 -1, /* 0001 -> 16.0x */ 240 -1, /* 0001 -> 16.0x */
241 40, /* 0010 -> 4.0x */ 241 40, /* 0010 -> 4.0x */
diff --git a/arch/x86/kernel/cpu/cpufreq/longrun.c b/arch/x86/kernel/cpu/cpufreq/longrun.c
index 777a7ff075de..da5f70fcb766 100644
--- a/arch/x86/kernel/cpu/cpufreq/longrun.c
+++ b/arch/x86/kernel/cpu/cpufreq/longrun.c
@@ -11,12 +11,13 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/cpufreq.h> 13#include <linux/cpufreq.h>
14#include <linux/timex.h>
14 15
15#include <asm/msr.h> 16#include <asm/msr.h>
16#include <asm/processor.h> 17#include <asm/processor.h>
17#include <asm/timex.h>
18 18
19#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) 19#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
20 "longrun", msg)
20 21
21static struct cpufreq_driver longrun_driver; 22static struct cpufreq_driver longrun_driver;
22 23
@@ -51,7 +52,7 @@ static void __init longrun_get_policy(struct cpufreq_policy *policy)
51 msr_lo &= 0x0000007F; 52 msr_lo &= 0x0000007F;
52 msr_hi &= 0x0000007F; 53 msr_hi &= 0x0000007F;
53 54
54 if ( longrun_high_freq <= longrun_low_freq ) { 55 if (longrun_high_freq <= longrun_low_freq) {
55 /* Assume degenerate Longrun table */ 56 /* Assume degenerate Longrun table */
56 policy->min = policy->max = longrun_high_freq; 57 policy->min = policy->max = longrun_high_freq;
57 } else { 58 } else {
@@ -79,7 +80,7 @@ static int longrun_set_policy(struct cpufreq_policy *policy)
79 if (!policy) 80 if (!policy)
80 return -EINVAL; 81 return -EINVAL;
81 82
82 if ( longrun_high_freq <= longrun_low_freq ) { 83 if (longrun_high_freq <= longrun_low_freq) {
83 /* Assume degenerate Longrun table */ 84 /* Assume degenerate Longrun table */
84 pctg_lo = pctg_hi = 100; 85 pctg_lo = pctg_hi = 100;
85 } else { 86 } else {
@@ -152,7 +153,7 @@ static unsigned int longrun_get(unsigned int cpu)
152 cpuid(0x80860007, &eax, &ebx, &ecx, &edx); 153 cpuid(0x80860007, &eax, &ebx, &ecx, &edx);
153 dprintk("cpuid eax is %u\n", eax); 154 dprintk("cpuid eax is %u\n", eax);
154 155
155 return (eax * 1000); 156 return eax * 1000;
156} 157}
157 158
158/** 159/**
@@ -196,7 +197,8 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq,
196 rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi); 197 rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi);
197 *high_freq = msr_lo * 1000; /* to kHz */ 198 *high_freq = msr_lo * 1000; /* to kHz */
198 199
199 dprintk("longrun table interface told %u - %u kHz\n", *low_freq, *high_freq); 200 dprintk("longrun table interface told %u - %u kHz\n",
201 *low_freq, *high_freq);
200 202
201 if (*low_freq > *high_freq) 203 if (*low_freq > *high_freq)
202 *low_freq = *high_freq; 204 *low_freq = *high_freq;
@@ -219,7 +221,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq,
219 cpuid(0x80860007, &eax, &ebx, &ecx, &edx); 221 cpuid(0x80860007, &eax, &ebx, &ecx, &edx);
220 /* try decreasing in 10% steps, some processors react only 222 /* try decreasing in 10% steps, some processors react only
221 * on some barrier values */ 223 * on some barrier values */
222 for (try_hi = 80; try_hi > 0 && ecx > 90; try_hi -=10) { 224 for (try_hi = 80; try_hi > 0 && ecx > 90; try_hi -= 10) {
223 /* set to 0 to try_hi perf_pctg */ 225 /* set to 0 to try_hi perf_pctg */
224 msr_lo &= 0xFFFFFF80; 226 msr_lo &= 0xFFFFFF80;
225 msr_hi &= 0xFFFFFF80; 227 msr_hi &= 0xFFFFFF80;
@@ -236,7 +238,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq,
236 238
237 /* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq) 239 /* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq)
238 * eqals 240 * eqals
239 * low_freq * ( 1 - perf_pctg) = (cur_freq - high_freq * perf_pctg) 241 * low_freq * (1 - perf_pctg) = (cur_freq - high_freq * perf_pctg)
240 * 242 *
241 * high_freq * perf_pctg is stored tempoarily into "ebx". 243 * high_freq * perf_pctg is stored tempoarily into "ebx".
242 */ 244 */
@@ -317,9 +319,10 @@ static void __exit longrun_exit(void)
317} 319}
318 320
319 321
320MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>"); 322MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
321MODULE_DESCRIPTION ("LongRun driver for Transmeta Crusoe and Efficeon processors."); 323MODULE_DESCRIPTION("LongRun driver for Transmeta Crusoe and "
322MODULE_LICENSE ("GPL"); 324 "Efficeon processors.");
325MODULE_LICENSE("GPL");
323 326
324module_init(longrun_init); 327module_init(longrun_init);
325module_exit(longrun_exit); 328module_exit(longrun_exit);
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index 3178c3acd97e..41ed94915f97 100644
--- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
@@ -27,15 +27,17 @@
27#include <linux/cpufreq.h> 27#include <linux/cpufreq.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/cpumask.h> 29#include <linux/cpumask.h>
30#include <linux/timex.h>
30 31
31#include <asm/processor.h> 32#include <asm/processor.h>
32#include <asm/msr.h> 33#include <asm/msr.h>
33#include <asm/timex.h> 34#include <asm/timer.h>
34 35
35#include "speedstep-lib.h" 36#include "speedstep-lib.h"
36 37
37#define PFX "p4-clockmod: " 38#define PFX "p4-clockmod: "
38#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "p4-clockmod", msg) 39#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
40 "p4-clockmod", msg)
39 41
40/* 42/*
41 * Duty Cycle (3bits), note DC_DISABLE is not specified in 43 * Duty Cycle (3bits), note DC_DISABLE is not specified in
@@ -58,7 +60,8 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
58{ 60{
59 u32 l, h; 61 u32 l, h;
60 62
61 if (!cpu_online(cpu) || (newstate > DC_DISABLE) || (newstate == DC_RESV)) 63 if (!cpu_online(cpu) ||
64 (newstate > DC_DISABLE) || (newstate == DC_RESV))
62 return -EINVAL; 65 return -EINVAL;
63 66
64 rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h); 67 rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h);
@@ -66,7 +69,8 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
66 if (l & 0x01) 69 if (l & 0x01)
67 dprintk("CPU#%d currently thermal throttled\n", cpu); 70 dprintk("CPU#%d currently thermal throttled\n", cpu);
68 71
69 if (has_N44_O17_errata[cpu] && (newstate == DC_25PT || newstate == DC_DFLT)) 72 if (has_N44_O17_errata[cpu] &&
73 (newstate == DC_25PT || newstate == DC_DFLT))
70 newstate = DC_38PT; 74 newstate = DC_38PT;
71 75
72 rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, &l, &h); 76 rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, &l, &h);
@@ -112,7 +116,8 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
112 struct cpufreq_freqs freqs; 116 struct cpufreq_freqs freqs;
113 int i; 117 int i;
114 118
115 if (cpufreq_frequency_table_target(policy, &p4clockmod_table[0], target_freq, relation, &newstate)) 119 if (cpufreq_frequency_table_target(policy, &p4clockmod_table[0],
120 target_freq, relation, &newstate))
116 return -EINVAL; 121 return -EINVAL;
117 122
118 freqs.old = cpufreq_p4_get(policy->cpu); 123 freqs.old = cpufreq_p4_get(policy->cpu);
@@ -127,7 +132,8 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
127 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 132 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
128 } 133 }
129 134
130 /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software 135 /* run on each logical CPU,
136 * see section 13.15.3 of IA32 Intel Architecture Software
131 * Developer's Manual, Volume 3 137 * Developer's Manual, Volume 3
132 */ 138 */
133 for_each_cpu(i, policy->cpus) 139 for_each_cpu(i, policy->cpus)
@@ -153,28 +159,30 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
153{ 159{
154 if (c->x86 == 0x06) { 160 if (c->x86 == 0x06) {
155 if (cpu_has(c, X86_FEATURE_EST)) 161 if (cpu_has(c, X86_FEATURE_EST))
156 printk(KERN_WARNING PFX "Warning: EST-capable CPU detected. " 162 printk(KERN_WARNING PFX "Warning: EST-capable CPU "
157 "The acpi-cpufreq module offers voltage scaling" 163 "detected. The acpi-cpufreq module offers "
158 " in addition of frequency scaling. You should use " 164 "voltage scaling in addition of frequency "
159 "that instead of p4-clockmod, if possible.\n"); 165 "scaling. You should use that instead of "
166 "p4-clockmod, if possible.\n");
160 switch (c->x86_model) { 167 switch (c->x86_model) {
161 case 0x0E: /* Core */ 168 case 0x0E: /* Core */
162 case 0x0F: /* Core Duo */ 169 case 0x0F: /* Core Duo */
163 case 0x16: /* Celeron Core */ 170 case 0x16: /* Celeron Core */
164 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; 171 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
165 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PCORE); 172 return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE);
166 case 0x0D: /* Pentium M (Dothan) */ 173 case 0x0D: /* Pentium M (Dothan) */
167 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; 174 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
168 /* fall through */ 175 /* fall through */
169 case 0x09: /* Pentium M (Banias) */ 176 case 0x09: /* Pentium M (Banias) */
170 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PM); 177 return speedstep_get_frequency(SPEEDSTEP_CPU_PM);
171 } 178 }
172 } 179 }
173 180
174 if (c->x86 != 0xF) { 181 if (c->x86 != 0xF) {
175 if (!cpu_has(c, X86_FEATURE_EST)) 182 if (!cpu_has(c, X86_FEATURE_EST))
176 printk(KERN_WARNING PFX "Unknown p4-clockmod-capable CPU. " 183 printk(KERN_WARNING PFX "Unknown CPU. "
177 "Please send an e-mail to <cpufreq@vger.kernel.org>\n"); 184 "Please send an e-mail to "
185 "<cpufreq@vger.kernel.org>\n");
178 return 0; 186 return 0;
179 } 187 }
180 188
@@ -182,16 +190,16 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
182 * throttling is active or not. */ 190 * throttling is active or not. */
183 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; 191 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
184 192
185 if (speedstep_detect_processor() == SPEEDSTEP_PROCESSOR_P4M) { 193 if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4M) {
186 printk(KERN_WARNING PFX "Warning: Pentium 4-M detected. " 194 printk(KERN_WARNING PFX "Warning: Pentium 4-M detected. "
187 "The speedstep-ich or acpi cpufreq modules offer " 195 "The speedstep-ich or acpi cpufreq modules offer "
188 "voltage scaling in addition of frequency scaling. " 196 "voltage scaling in addition of frequency scaling. "
189 "You should use either one instead of p4-clockmod, " 197 "You should use either one instead of p4-clockmod, "
190 "if possible.\n"); 198 "if possible.\n");
191 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4M); 199 return speedstep_get_frequency(SPEEDSTEP_CPU_P4M);
192 } 200 }
193 201
194 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_P4D); 202 return speedstep_get_frequency(SPEEDSTEP_CPU_P4D);
195} 203}
196 204
197 205
@@ -217,14 +225,20 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
217 dprintk("has errata -- disabling low frequencies\n"); 225 dprintk("has errata -- disabling low frequencies\n");
218 } 226 }
219 227
228 if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4D &&
229 c->x86_model < 2) {
230 /* switch to maximum frequency and measure result */
231 cpufreq_p4_setdc(policy->cpu, DC_DISABLE);
232 recalibrate_cpu_khz();
233 }
220 /* get max frequency */ 234 /* get max frequency */
221 stock_freq = cpufreq_p4_get_frequency(c); 235 stock_freq = cpufreq_p4_get_frequency(c);
222 if (!stock_freq) 236 if (!stock_freq)
223 return -EINVAL; 237 return -EINVAL;
224 238
225 /* table init */ 239 /* table init */
226 for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { 240 for (i = 1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) {
227 if ((i<2) && (has_N44_O17_errata[policy->cpu])) 241 if ((i < 2) && (has_N44_O17_errata[policy->cpu]))
228 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; 242 p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
229 else 243 else
230 p4clockmod_table[i].frequency = (stock_freq * i)/8; 244 p4clockmod_table[i].frequency = (stock_freq * i)/8;
@@ -232,7 +246,10 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
232 cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu); 246 cpufreq_frequency_table_get_attr(p4clockmod_table, policy->cpu);
233 247
234 /* cpuinfo and default policy values */ 248 /* cpuinfo and default policy values */
235 policy->cpuinfo.transition_latency = 1000000; /* assumed */ 249
250 /* the transition latency is set to be 1 higher than the maximum
251 * transition latency of the ondemand governor */
252 policy->cpuinfo.transition_latency = 10000001;
236 policy->cur = stock_freq; 253 policy->cur = stock_freq;
237 254
238 return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]); 255 return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]);
@@ -258,12 +275,12 @@ static unsigned int cpufreq_p4_get(unsigned int cpu)
258 l = DC_DISABLE; 275 l = DC_DISABLE;
259 276
260 if (l != DC_DISABLE) 277 if (l != DC_DISABLE)
261 return (stock_freq * l / 8); 278 return stock_freq * l / 8;
262 279
263 return stock_freq; 280 return stock_freq;
264} 281}
265 282
266static struct freq_attr* p4clockmod_attr[] = { 283static struct freq_attr *p4clockmod_attr[] = {
267 &cpufreq_freq_attr_scaling_available_freqs, 284 &cpufreq_freq_attr_scaling_available_freqs,
268 NULL, 285 NULL,
269}; 286};
@@ -298,9 +315,10 @@ static int __init cpufreq_p4_init(void)
298 315
299 ret = cpufreq_register_driver(&p4clockmod_driver); 316 ret = cpufreq_register_driver(&p4clockmod_driver);
300 if (!ret) 317 if (!ret)
301 printk(KERN_INFO PFX "P4/Xeon(TM) CPU On-Demand Clock Modulation available\n"); 318 printk(KERN_INFO PFX "P4/Xeon(TM) CPU On-Demand Clock "
319 "Modulation available\n");
302 320
303 return (ret); 321 return ret;
304} 322}
305 323
306 324
@@ -310,9 +328,9 @@ static void __exit cpufreq_p4_exit(void)
310} 328}
311 329
312 330
313MODULE_AUTHOR ("Zwane Mwaikambo <zwane@commfireservices.com>"); 331MODULE_AUTHOR("Zwane Mwaikambo <zwane@commfireservices.com>");
314MODULE_DESCRIPTION ("cpufreq driver for Pentium(TM) 4/Xeon(TM)"); 332MODULE_DESCRIPTION("cpufreq driver for Pentium(TM) 4/Xeon(TM)");
315MODULE_LICENSE ("GPL"); 333MODULE_LICENSE("GPL");
316 334
317late_initcall(cpufreq_p4_init); 335late_initcall(cpufreq_p4_init);
318module_exit(cpufreq_p4_exit); 336module_exit(cpufreq_p4_exit);
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k6.c b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
index c1ac5790c63e..f10dea409f40 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * This file was based upon code in Powertweak Linux (http://powertweak.sf.net) 2 * This file was based upon code in Powertweak Linux (http://powertweak.sf.net)
3 * (C) 2000-2003 Dave Jones, Arjan van de Ven, Janne Pänkälä, Dominik Brodowski. 3 * (C) 2000-2003 Dave Jones, Arjan van de Ven, Janne Pänkälä,
4 * Dominik Brodowski.
4 * 5 *
5 * Licensed under the terms of the GNU GPL License version 2. 6 * Licensed under the terms of the GNU GPL License version 2.
6 * 7 *
@@ -13,14 +14,15 @@
13#include <linux/cpufreq.h> 14#include <linux/cpufreq.h>
14#include <linux/ioport.h> 15#include <linux/ioport.h>
15#include <linux/slab.h> 16#include <linux/slab.h>
16
17#include <asm/msr.h>
18#include <linux/timex.h> 17#include <linux/timex.h>
19#include <linux/io.h> 18#include <linux/io.h>
20 19
20#include <asm/msr.h>
21
21#define POWERNOW_IOPORT 0xfff0 /* it doesn't matter where, as long 22#define POWERNOW_IOPORT 0xfff0 /* it doesn't matter where, as long
22 as it is unused */ 23 as it is unused */
23 24
25#define PFX "powernow-k6: "
24static unsigned int busfreq; /* FSB, in 10 kHz */ 26static unsigned int busfreq; /* FSB, in 10 kHz */
25static unsigned int max_multiplier; 27static unsigned int max_multiplier;
26 28
@@ -47,8 +49,8 @@ static struct cpufreq_frequency_table clock_ratio[] = {
47 */ 49 */
48static int powernow_k6_get_cpu_multiplier(void) 50static int powernow_k6_get_cpu_multiplier(void)
49{ 51{
50 u64 invalue = 0; 52 u64 invalue = 0;
51 u32 msrval; 53 u32 msrval;
52 54
53 msrval = POWERNOW_IOPORT + 0x1; 55 msrval = POWERNOW_IOPORT + 0x1;
54 wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */ 56 wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */
@@ -68,12 +70,12 @@ static int powernow_k6_get_cpu_multiplier(void)
68 */ 70 */
69static void powernow_k6_set_state(unsigned int best_i) 71static void powernow_k6_set_state(unsigned int best_i)
70{ 72{
71 unsigned long outvalue = 0, invalue = 0; 73 unsigned long outvalue = 0, invalue = 0;
72 unsigned long msrval; 74 unsigned long msrval;
73 struct cpufreq_freqs freqs; 75 struct cpufreq_freqs freqs;
74 76
75 if (clock_ratio[best_i].index > max_multiplier) { 77 if (clock_ratio[best_i].index > max_multiplier) {
76 printk(KERN_ERR "cpufreq: invalid target frequency\n"); 78 printk(KERN_ERR PFX "invalid target frequency\n");
77 return; 79 return;
78 } 80 }
79 81
@@ -119,7 +121,8 @@ static int powernow_k6_verify(struct cpufreq_policy *policy)
119 * powernow_k6_setpolicy - sets a new CPUFreq policy 121 * powernow_k6_setpolicy - sets a new CPUFreq policy
120 * @policy: new policy 122 * @policy: new policy
121 * @target_freq: the target frequency 123 * @target_freq: the target frequency
122 * @relation: how that frequency relates to achieved frequency (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H) 124 * @relation: how that frequency relates to achieved frequency
125 * (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H)
123 * 126 *
124 * sets a new CPUFreq policy 127 * sets a new CPUFreq policy
125 */ 128 */
@@ -127,9 +130,10 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
127 unsigned int target_freq, 130 unsigned int target_freq,
128 unsigned int relation) 131 unsigned int relation)
129{ 132{
130 unsigned int newstate = 0; 133 unsigned int newstate = 0;
131 134
132 if (cpufreq_frequency_table_target(policy, &clock_ratio[0], target_freq, relation, &newstate)) 135 if (cpufreq_frequency_table_target(policy, &clock_ratio[0],
136 target_freq, relation, &newstate))
133 return -EINVAL; 137 return -EINVAL;
134 138
135 powernow_k6_set_state(newstate); 139 powernow_k6_set_state(newstate);
@@ -140,7 +144,7 @@ static int powernow_k6_target(struct cpufreq_policy *policy,
140 144
141static int powernow_k6_cpu_init(struct cpufreq_policy *policy) 145static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
142{ 146{
143 unsigned int i; 147 unsigned int i, f;
144 int result; 148 int result;
145 149
146 if (policy->cpu != 0) 150 if (policy->cpu != 0)
@@ -152,10 +156,11 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy)
152 156
153 /* table init */ 157 /* table init */
154 for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) { 158 for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) {
155 if (clock_ratio[i].index > max_multiplier) 159 f = clock_ratio[i].index;
160 if (f > max_multiplier)
156 clock_ratio[i].frequency = CPUFREQ_ENTRY_INVALID; 161 clock_ratio[i].frequency = CPUFREQ_ENTRY_INVALID;
157 else 162 else
158 clock_ratio[i].frequency = busfreq * clock_ratio[i].index; 163 clock_ratio[i].frequency = busfreq * f;
159 } 164 }
160 165
161 /* cpuinfo and default policy values */ 166 /* cpuinfo and default policy values */
@@ -185,7 +190,9 @@ static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
185 190
186static unsigned int powernow_k6_get(unsigned int cpu) 191static unsigned int powernow_k6_get(unsigned int cpu)
187{ 192{
188 return busfreq * powernow_k6_get_cpu_multiplier(); 193 unsigned int ret;
194 ret = (busfreq * powernow_k6_get_cpu_multiplier());
195 return ret;
189} 196}
190 197
191static struct freq_attr *powernow_k6_attr[] = { 198static struct freq_attr *powernow_k6_attr[] = {
@@ -221,7 +228,7 @@ static int __init powernow_k6_init(void)
221 return -ENODEV; 228 return -ENODEV;
222 229
223 if (!request_region(POWERNOW_IOPORT, 16, "PowerNow!")) { 230 if (!request_region(POWERNOW_IOPORT, 16, "PowerNow!")) {
224 printk("cpufreq: PowerNow IOPORT region already used.\n"); 231 printk(KERN_INFO PFX "PowerNow IOPORT region already used.\n");
225 return -EIO; 232 return -EIO;
226 } 233 }
227 234
@@ -246,7 +253,8 @@ static void __exit powernow_k6_exit(void)
246} 253}
247 254
248 255
249MODULE_AUTHOR("Arjan van de Ven, Dave Jones <davej@redhat.com>, Dominik Brodowski <linux@brodo.de>"); 256MODULE_AUTHOR("Arjan van de Ven, Dave Jones <davej@redhat.com>, "
257 "Dominik Brodowski <linux@brodo.de>");
250MODULE_DESCRIPTION("PowerNow! driver for AMD K6-2+ / K6-3+ processors."); 258MODULE_DESCRIPTION("PowerNow! driver for AMD K6-2+ / K6-3+ processors.");
251MODULE_LICENSE("GPL"); 259MODULE_LICENSE("GPL");
252 260
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
index 1b446d79a8fd..3c28ccd49742 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
@@ -6,10 +6,12 @@
6 * Licensed under the terms of the GNU GPL License version 2. 6 * Licensed under the terms of the GNU GPL License version 2.
7 * Based upon datasheets & sample CPUs kindly provided by AMD. 7 * Based upon datasheets & sample CPUs kindly provided by AMD.
8 * 8 *
9 * Errata 5: Processor may fail to execute a FID/VID change in presence of interrupt. 9 * Errata 5:
10 * - We cli/sti on stepping A0 CPUs around the FID/VID transition. 10 * CPU may fail to execute a FID/VID change in presence of interrupt.
11 * Errata 15: Processors with half frequency multipliers may hang upon wakeup from disconnect. 11 * - We cli/sti on stepping A0 CPUs around the FID/VID transition.
12 * - We disable half multipliers if ACPI is used on A0 stepping CPUs. 12 * Errata 15:
13 * CPU with half frequency multipliers may hang upon wakeup from disconnect.
14 * - We disable half multipliers if ACPI is used on A0 stepping CPUs.
13 */ 15 */
14 16
15#include <linux/kernel.h> 17#include <linux/kernel.h>
@@ -20,11 +22,11 @@
20#include <linux/slab.h> 22#include <linux/slab.h>
21#include <linux/string.h> 23#include <linux/string.h>
22#include <linux/dmi.h> 24#include <linux/dmi.h>
25#include <linux/timex.h>
26#include <linux/io.h>
23 27
28#include <asm/timer.h> /* Needed for recalibrate_cpu_khz() */
24#include <asm/msr.h> 29#include <asm/msr.h>
25#include <asm/timer.h>
26#include <asm/timex.h>
27#include <asm/io.h>
28#include <asm/system.h> 30#include <asm/system.h>
29 31
30#ifdef CONFIG_X86_POWERNOW_K7_ACPI 32#ifdef CONFIG_X86_POWERNOW_K7_ACPI
@@ -58,9 +60,9 @@ struct pst_s {
58union powernow_acpi_control_t { 60union powernow_acpi_control_t {
59 struct { 61 struct {
60 unsigned long fid:5, 62 unsigned long fid:5,
61 vid:5, 63 vid:5,
62 sgtc:20, 64 sgtc:20,
63 res1:2; 65 res1:2;
64 } bits; 66 } bits;
65 unsigned long val; 67 unsigned long val;
66}; 68};
@@ -94,14 +96,15 @@ static struct cpufreq_frequency_table *powernow_table;
94 96
95static unsigned int can_scale_bus; 97static unsigned int can_scale_bus;
96static unsigned int can_scale_vid; 98static unsigned int can_scale_vid;
97static unsigned int minimum_speed=-1; 99static unsigned int minimum_speed = -1;
98static unsigned int maximum_speed; 100static unsigned int maximum_speed;
99static unsigned int number_scales; 101static unsigned int number_scales;
100static unsigned int fsb; 102static unsigned int fsb;
101static unsigned int latency; 103static unsigned int latency;
102static char have_a0; 104static char have_a0;
103 105
104#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k7", msg) 106#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
107 "powernow-k7", msg)
105 108
106static int check_fsb(unsigned int fsbspeed) 109static int check_fsb(unsigned int fsbspeed)
107{ 110{
@@ -109,7 +112,7 @@ static int check_fsb(unsigned int fsbspeed)
109 unsigned int f = fsb / 1000; 112 unsigned int f = fsb / 1000;
110 113
111 delta = (fsbspeed > f) ? fsbspeed - f : f - fsbspeed; 114 delta = (fsbspeed > f) ? fsbspeed - f : f - fsbspeed;
112 return (delta < 5); 115 return delta < 5;
113} 116}
114 117
115static int check_powernow(void) 118static int check_powernow(void)
@@ -117,24 +120,26 @@ static int check_powernow(void)
117 struct cpuinfo_x86 *c = &cpu_data(0); 120 struct cpuinfo_x86 *c = &cpu_data(0);
118 unsigned int maxei, eax, ebx, ecx, edx; 121 unsigned int maxei, eax, ebx, ecx, edx;
119 122
120 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 !=6)) { 123 if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 6)) {
121#ifdef MODULE 124#ifdef MODULE
122 printk (KERN_INFO PFX "This module only works with AMD K7 CPUs\n"); 125 printk(KERN_INFO PFX "This module only works with "
126 "AMD K7 CPUs\n");
123#endif 127#endif
124 return 0; 128 return 0;
125 } 129 }
126 130
127 /* Get maximum capabilities */ 131 /* Get maximum capabilities */
128 maxei = cpuid_eax (0x80000000); 132 maxei = cpuid_eax(0x80000000);
129 if (maxei < 0x80000007) { /* Any powernow info ? */ 133 if (maxei < 0x80000007) { /* Any powernow info ? */
130#ifdef MODULE 134#ifdef MODULE
131 printk (KERN_INFO PFX "No powernow capabilities detected\n"); 135 printk(KERN_INFO PFX "No powernow capabilities detected\n");
132#endif 136#endif
133 return 0; 137 return 0;
134 } 138 }
135 139
136 if ((c->x86_model == 6) && (c->x86_mask == 0)) { 140 if ((c->x86_model == 6) && (c->x86_mask == 0)) {
137 printk (KERN_INFO PFX "K7 660[A0] core detected, enabling errata workarounds\n"); 141 printk(KERN_INFO PFX "K7 660[A0] core detected, "
142 "enabling errata workarounds\n");
138 have_a0 = 1; 143 have_a0 = 1;
139 } 144 }
140 145
@@ -144,37 +149,42 @@ static int check_powernow(void)
144 if (!(edx & (1 << 1 | 1 << 2))) 149 if (!(edx & (1 << 1 | 1 << 2)))
145 return 0; 150 return 0;
146 151
147 printk (KERN_INFO PFX "PowerNOW! Technology present. Can scale: "); 152 printk(KERN_INFO PFX "PowerNOW! Technology present. Can scale: ");
148 153
149 if (edx & 1 << 1) { 154 if (edx & 1 << 1) {
150 printk ("frequency"); 155 printk("frequency");
151 can_scale_bus=1; 156 can_scale_bus = 1;
152 } 157 }
153 158
154 if ((edx & (1 << 1 | 1 << 2)) == 0x6) 159 if ((edx & (1 << 1 | 1 << 2)) == 0x6)
155 printk (" and "); 160 printk(" and ");
156 161
157 if (edx & 1 << 2) { 162 if (edx & 1 << 2) {
158 printk ("voltage"); 163 printk("voltage");
159 can_scale_vid=1; 164 can_scale_vid = 1;
160 } 165 }
161 166
162 printk (".\n"); 167 printk(".\n");
163 return 1; 168 return 1;
164} 169}
165 170
171static void invalidate_entry(unsigned int entry)
172{
173 powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID;
174}
166 175
167static int get_ranges (unsigned char *pst) 176static int get_ranges(unsigned char *pst)
168{ 177{
169 unsigned int j; 178 unsigned int j;
170 unsigned int speed; 179 unsigned int speed;
171 u8 fid, vid; 180 u8 fid, vid;
172 181
173 powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL); 182 powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) *
183 (number_scales + 1)), GFP_KERNEL);
174 if (!powernow_table) 184 if (!powernow_table)
175 return -ENOMEM; 185 return -ENOMEM;
176 186
177 for (j=0 ; j < number_scales; j++) { 187 for (j = 0 ; j < number_scales; j++) {
178 fid = *pst++; 188 fid = *pst++;
179 189
180 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10; 190 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10;
@@ -182,10 +192,10 @@ static int get_ranges (unsigned char *pst)
182 192
183 speed = powernow_table[j].frequency; 193 speed = powernow_table[j].frequency;
184 194
185 if ((fid_codes[fid] % 10)==5) { 195 if ((fid_codes[fid] % 10) == 5) {
186#ifdef CONFIG_X86_POWERNOW_K7_ACPI 196#ifdef CONFIG_X86_POWERNOW_K7_ACPI
187 if (have_a0 == 1) 197 if (have_a0 == 1)
188 powernow_table[j].frequency = CPUFREQ_ENTRY_INVALID; 198 invalidate_entry(j);
189#endif 199#endif
190 } 200 }
191 201
@@ -197,7 +207,7 @@ static int get_ranges (unsigned char *pst)
197 vid = *pst++; 207 vid = *pst++;
198 powernow_table[j].index |= (vid << 8); /* upper 8 bits */ 208 powernow_table[j].index |= (vid << 8); /* upper 8 bits */
199 209
200 dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " 210 dprintk(" FID: 0x%x (%d.%dx [%dMHz]) "
201 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, 211 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
202 fid_codes[fid] % 10, speed/1000, vid, 212 fid_codes[fid] % 10, speed/1000, vid,
203 mobile_vid_table[vid]/1000, 213 mobile_vid_table[vid]/1000,
@@ -214,13 +224,13 @@ static void change_FID(int fid)
214{ 224{
215 union msr_fidvidctl fidvidctl; 225 union msr_fidvidctl fidvidctl;
216 226
217 rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val); 227 rdmsrl(MSR_K7_FID_VID_CTL, fidvidctl.val);
218 if (fidvidctl.bits.FID != fid) { 228 if (fidvidctl.bits.FID != fid) {
219 fidvidctl.bits.SGTC = latency; 229 fidvidctl.bits.SGTC = latency;
220 fidvidctl.bits.FID = fid; 230 fidvidctl.bits.FID = fid;
221 fidvidctl.bits.VIDC = 0; 231 fidvidctl.bits.VIDC = 0;
222 fidvidctl.bits.FIDC = 1; 232 fidvidctl.bits.FIDC = 1;
223 wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val); 233 wrmsrl(MSR_K7_FID_VID_CTL, fidvidctl.val);
224 } 234 }
225} 235}
226 236
@@ -229,18 +239,18 @@ static void change_VID(int vid)
229{ 239{
230 union msr_fidvidctl fidvidctl; 240 union msr_fidvidctl fidvidctl;
231 241
232 rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val); 242 rdmsrl(MSR_K7_FID_VID_CTL, fidvidctl.val);
233 if (fidvidctl.bits.VID != vid) { 243 if (fidvidctl.bits.VID != vid) {
234 fidvidctl.bits.SGTC = latency; 244 fidvidctl.bits.SGTC = latency;
235 fidvidctl.bits.VID = vid; 245 fidvidctl.bits.VID = vid;
236 fidvidctl.bits.FIDC = 0; 246 fidvidctl.bits.FIDC = 0;
237 fidvidctl.bits.VIDC = 1; 247 fidvidctl.bits.VIDC = 1;
238 wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val); 248 wrmsrl(MSR_K7_FID_VID_CTL, fidvidctl.val);
239 } 249 }
240} 250}
241 251
242 252
243static void change_speed (unsigned int index) 253static void change_speed(unsigned int index)
244{ 254{
245 u8 fid, vid; 255 u8 fid, vid;
246 struct cpufreq_freqs freqs; 256 struct cpufreq_freqs freqs;
@@ -257,7 +267,7 @@ static void change_speed (unsigned int index)
257 267
258 freqs.cpu = 0; 268 freqs.cpu = 0;
259 269
260 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); 270 rdmsrl(MSR_K7_FID_VID_STATUS, fidvidstatus.val);
261 cfid = fidvidstatus.bits.CFID; 271 cfid = fidvidstatus.bits.CFID;
262 freqs.old = fsb * fid_codes[cfid] / 10; 272 freqs.old = fsb * fid_codes[cfid] / 10;
263 273
@@ -321,12 +331,14 @@ static int powernow_acpi_init(void)
321 goto err1; 331 goto err1;
322 } 332 }
323 333
324 if (acpi_processor_perf->control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) { 334 if (acpi_processor_perf->control_register.space_id !=
335 ACPI_ADR_SPACE_FIXED_HARDWARE) {
325 retval = -ENODEV; 336 retval = -ENODEV;
326 goto err2; 337 goto err2;
327 } 338 }
328 339
329 if (acpi_processor_perf->status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) { 340 if (acpi_processor_perf->status_register.space_id !=
341 ACPI_ADR_SPACE_FIXED_HARDWARE) {
330 retval = -ENODEV; 342 retval = -ENODEV;
331 goto err2; 343 goto err2;
332 } 344 }
@@ -338,7 +350,8 @@ static int powernow_acpi_init(void)
338 goto err2; 350 goto err2;
339 } 351 }
340 352
341 powernow_table = kzalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL); 353 powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) *
354 (number_scales + 1)), GFP_KERNEL);
342 if (!powernow_table) { 355 if (!powernow_table) {
343 retval = -ENOMEM; 356 retval = -ENOMEM;
344 goto err2; 357 goto err2;
@@ -352,7 +365,7 @@ static int powernow_acpi_init(void)
352 unsigned int speed, speed_mhz; 365 unsigned int speed, speed_mhz;
353 366
354 pc.val = (unsigned long) state->control; 367 pc.val = (unsigned long) state->control;
355 dprintk ("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", 368 dprintk("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n",
356 i, 369 i,
357 (u32) state->core_frequency, 370 (u32) state->core_frequency,
358 (u32) state->power, 371 (u32) state->power,
@@ -381,12 +394,12 @@ static int powernow_acpi_init(void)
381 if (speed % 1000 > 0) 394 if (speed % 1000 > 0)
382 speed_mhz++; 395 speed_mhz++;
383 396
384 if ((fid_codes[fid] % 10)==5) { 397 if ((fid_codes[fid] % 10) == 5) {
385 if (have_a0 == 1) 398 if (have_a0 == 1)
386 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 399 invalidate_entry(i);
387 } 400 }
388 401
389 dprintk (" FID: 0x%x (%d.%dx [%dMHz]) " 402 dprintk(" FID: 0x%x (%d.%dx [%dMHz]) "
390 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, 403 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
391 fid_codes[fid] % 10, speed_mhz, vid, 404 fid_codes[fid] % 10, speed_mhz, vid,
392 mobile_vid_table[vid]/1000, 405 mobile_vid_table[vid]/1000,
@@ -422,7 +435,8 @@ err1:
422err05: 435err05:
423 kfree(acpi_processor_perf); 436 kfree(acpi_processor_perf);
424err0: 437err0:
425 printk(KERN_WARNING PFX "ACPI perflib can not be used in this platform\n"); 438 printk(KERN_WARNING PFX "ACPI perflib can not be used on "
439 "this platform\n");
426 acpi_processor_perf = NULL; 440 acpi_processor_perf = NULL;
427 return retval; 441 return retval;
428} 442}
@@ -435,7 +449,14 @@ static int powernow_acpi_init(void)
435} 449}
436#endif 450#endif
437 451
438static int powernow_decode_bios (int maxfid, int startvid) 452static void print_pst_entry(struct pst_s *pst, unsigned int j)
453{
454 dprintk("PST:%d (@%p)\n", j, pst);
455 dprintk(" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n",
456 pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid);
457}
458
459static int powernow_decode_bios(int maxfid, int startvid)
439{ 460{
440 struct psb_s *psb; 461 struct psb_s *psb;
441 struct pst_s *pst; 462 struct pst_s *pst;
@@ -446,61 +467,67 @@ static int powernow_decode_bios (int maxfid, int startvid)
446 467
447 etuple = cpuid_eax(0x80000001); 468 etuple = cpuid_eax(0x80000001);
448 469
449 for (i=0xC0000; i < 0xffff0 ; i+=16) { 470 for (i = 0xC0000; i < 0xffff0 ; i += 16) {
450 471
451 p = phys_to_virt(i); 472 p = phys_to_virt(i);
452 473
453 if (memcmp(p, "AMDK7PNOW!", 10) == 0){ 474 if (memcmp(p, "AMDK7PNOW!", 10) == 0) {
454 dprintk ("Found PSB header at %p\n", p); 475 dprintk("Found PSB header at %p\n", p);
455 psb = (struct psb_s *) p; 476 psb = (struct psb_s *) p;
456 dprintk ("Table version: 0x%x\n", psb->tableversion); 477 dprintk("Table version: 0x%x\n", psb->tableversion);
457 if (psb->tableversion != 0x12) { 478 if (psb->tableversion != 0x12) {
458 printk (KERN_INFO PFX "Sorry, only v1.2 tables supported right now\n"); 479 printk(KERN_INFO PFX "Sorry, only v1.2 tables"
480 " supported right now\n");
459 return -ENODEV; 481 return -ENODEV;
460 } 482 }
461 483
462 dprintk ("Flags: 0x%x\n", psb->flags); 484 dprintk("Flags: 0x%x\n", psb->flags);
463 if ((psb->flags & 1)==0) { 485 if ((psb->flags & 1) == 0)
464 dprintk ("Mobile voltage regulator\n"); 486 dprintk("Mobile voltage regulator\n");
465 } else { 487 else
466 dprintk ("Desktop voltage regulator\n"); 488 dprintk("Desktop voltage regulator\n");
467 }
468 489
469 latency = psb->settlingtime; 490 latency = psb->settlingtime;
470 if (latency < 100) { 491 if (latency < 100) {
471 printk(KERN_INFO PFX "BIOS set settling time to %d microseconds. " 492 printk(KERN_INFO PFX "BIOS set settling time "
472 "Should be at least 100. Correcting.\n", latency); 493 "to %d microseconds. "
494 "Should be at least 100. "
495 "Correcting.\n", latency);
473 latency = 100; 496 latency = 100;
474 } 497 }
475 dprintk ("Settling Time: %d microseconds.\n", psb->settlingtime); 498 dprintk("Settling Time: %d microseconds.\n",
476 dprintk ("Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst); 499 psb->settlingtime);
500 dprintk("Has %d PST tables. (Only dumping ones "
501 "relevant to this CPU).\n",
502 psb->numpst);
477 503
478 p += sizeof (struct psb_s); 504 p += sizeof(struct psb_s);
479 505
480 pst = (struct pst_s *) p; 506 pst = (struct pst_s *) p;
481 507
482 for (j=0; j<psb->numpst; j++) { 508 for (j = 0; j < psb->numpst; j++) {
483 pst = (struct pst_s *) p; 509 pst = (struct pst_s *) p;
484 number_scales = pst->numpstates; 510 number_scales = pst->numpstates;
485 511
486 if ((etuple == pst->cpuid) && check_fsb(pst->fsbspeed) && 512 if ((etuple == pst->cpuid) &&
487 (maxfid==pst->maxfid) && (startvid==pst->startvid)) 513 check_fsb(pst->fsbspeed) &&
488 { 514 (maxfid == pst->maxfid) &&
489 dprintk ("PST:%d (@%p)\n", j, pst); 515 (startvid == pst->startvid)) {
490 dprintk (" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n", 516 print_pst_entry(pst, j);
491 pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid); 517 p = (char *)pst + sizeof(struct pst_s);
492 518 ret = get_ranges(p);
493 ret = get_ranges ((char *) pst + sizeof (struct pst_s));
494 return ret; 519 return ret;
495 } else { 520 } else {
496 unsigned int k; 521 unsigned int k;
497 p = (char *) pst + sizeof (struct pst_s); 522 p = (char *)pst + sizeof(struct pst_s);
498 for (k=0; k<number_scales; k++) 523 for (k = 0; k < number_scales; k++)
499 p+=2; 524 p += 2;
500 } 525 }
501 } 526 }
502 printk (KERN_INFO PFX "No PST tables match this cpuid (0x%x)\n", etuple); 527 printk(KERN_INFO PFX "No PST tables match this cpuid "
503 printk (KERN_INFO PFX "This is indicative of a broken BIOS.\n"); 528 "(0x%x)\n", etuple);
529 printk(KERN_INFO PFX "This is indicative of a broken "
530 "BIOS.\n");
504 531
505 return -EINVAL; 532 return -EINVAL;
506 } 533 }
@@ -511,13 +538,14 @@ static int powernow_decode_bios (int maxfid, int startvid)
511} 538}
512 539
513 540
514static int powernow_target (struct cpufreq_policy *policy, 541static int powernow_target(struct cpufreq_policy *policy,
515 unsigned int target_freq, 542 unsigned int target_freq,
516 unsigned int relation) 543 unsigned int relation)
517{ 544{
518 unsigned int newstate; 545 unsigned int newstate;
519 546
520 if (cpufreq_frequency_table_target(policy, powernow_table, target_freq, relation, &newstate)) 547 if (cpufreq_frequency_table_target(policy, powernow_table, target_freq,
548 relation, &newstate))
521 return -EINVAL; 549 return -EINVAL;
522 550
523 change_speed(newstate); 551 change_speed(newstate);
@@ -526,7 +554,7 @@ static int powernow_target (struct cpufreq_policy *policy,
526} 554}
527 555
528 556
529static int powernow_verify (struct cpufreq_policy *policy) 557static int powernow_verify(struct cpufreq_policy *policy)
530{ 558{
531 return cpufreq_frequency_table_verify(policy, powernow_table); 559 return cpufreq_frequency_table_verify(policy, powernow_table);
532} 560}
@@ -566,18 +594,23 @@ static unsigned int powernow_get(unsigned int cpu)
566 594
567 if (cpu) 595 if (cpu)
568 return 0; 596 return 0;
569 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); 597 rdmsrl(MSR_K7_FID_VID_STATUS, fidvidstatus.val);
570 cfid = fidvidstatus.bits.CFID; 598 cfid = fidvidstatus.bits.CFID;
571 599
572 return (fsb * fid_codes[cfid] / 10); 600 return fsb * fid_codes[cfid] / 10;
573} 601}
574 602
575 603
576static int __init acer_cpufreq_pst(const struct dmi_system_id *d) 604static int __init acer_cpufreq_pst(const struct dmi_system_id *d)
577{ 605{
578 printk(KERN_WARNING "%s laptop with broken PST tables in BIOS detected.\n", d->ident); 606 printk(KERN_WARNING PFX
579 printk(KERN_WARNING "You need to downgrade to 3A21 (09/09/2002), or try a newer BIOS than 3A71 (01/20/2003)\n"); 607 "%s laptop with broken PST tables in BIOS detected.\n",
580 printk(KERN_WARNING "cpufreq scaling has been disabled as a result of this.\n"); 608 d->ident);
609 printk(KERN_WARNING PFX
610 "You need to downgrade to 3A21 (09/09/2002), or try a newer "
611 "BIOS than 3A71 (01/20/2003)\n");
612 printk(KERN_WARNING PFX
613 "cpufreq scaling has been disabled as a result of this.\n");
581 return 0; 614 return 0;
582} 615}
583 616
@@ -598,7 +631,7 @@ static struct dmi_system_id __initdata powernow_dmi_table[] = {
598 { } 631 { }
599}; 632};
600 633
601static int __init powernow_cpu_init (struct cpufreq_policy *policy) 634static int __init powernow_cpu_init(struct cpufreq_policy *policy)
602{ 635{
603 union msr_fidvidstatus fidvidstatus; 636 union msr_fidvidstatus fidvidstatus;
604 int result; 637 int result;
@@ -606,7 +639,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
606 if (policy->cpu != 0) 639 if (policy->cpu != 0)
607 return -ENODEV; 640 return -ENODEV;
608 641
609 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val); 642 rdmsrl(MSR_K7_FID_VID_STATUS, fidvidstatus.val);
610 643
611 recalibrate_cpu_khz(); 644 recalibrate_cpu_khz();
612 645
@@ -618,19 +651,21 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
618 dprintk("FSB: %3dMHz\n", fsb/1000); 651 dprintk("FSB: %3dMHz\n", fsb/1000);
619 652
620 if (dmi_check_system(powernow_dmi_table) || acpi_force) { 653 if (dmi_check_system(powernow_dmi_table) || acpi_force) {
621 printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n"); 654 printk(KERN_INFO PFX "PSB/PST known to be broken. "
655 "Trying ACPI instead\n");
622 result = powernow_acpi_init(); 656 result = powernow_acpi_init();
623 } else { 657 } else {
624 result = powernow_decode_bios(fidvidstatus.bits.MFID, fidvidstatus.bits.SVID); 658 result = powernow_decode_bios(fidvidstatus.bits.MFID,
659 fidvidstatus.bits.SVID);
625 if (result) { 660 if (result) {
626 printk (KERN_INFO PFX "Trying ACPI perflib\n"); 661 printk(KERN_INFO PFX "Trying ACPI perflib\n");
627 maximum_speed = 0; 662 maximum_speed = 0;
628 minimum_speed = -1; 663 minimum_speed = -1;
629 latency = 0; 664 latency = 0;
630 result = powernow_acpi_init(); 665 result = powernow_acpi_init();
631 if (result) { 666 if (result) {
632 printk (KERN_INFO PFX "ACPI and legacy methods failed\n"); 667 printk(KERN_INFO PFX
633 printk (KERN_INFO PFX "See http://www.codemonkey.org.uk/projects/cpufreq/powernow-k7.html\n"); 668 "ACPI and legacy methods failed\n");
634 } 669 }
635 } else { 670 } else {
636 /* SGTC use the bus clock as timer */ 671 /* SGTC use the bus clock as timer */
@@ -642,10 +677,11 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
642 if (result) 677 if (result)
643 return result; 678 return result;
644 679
645 printk (KERN_INFO PFX "Minimum speed %d MHz. Maximum speed %d MHz.\n", 680 printk(KERN_INFO PFX "Minimum speed %d MHz. Maximum speed %d MHz.\n",
646 minimum_speed/1000, maximum_speed/1000); 681 minimum_speed/1000, maximum_speed/1000);
647 682
648 policy->cpuinfo.transition_latency = cpufreq_scale(2000000UL, fsb, latency); 683 policy->cpuinfo.transition_latency =
684 cpufreq_scale(2000000UL, fsb, latency);
649 685
650 policy->cur = powernow_get(0); 686 policy->cur = powernow_get(0);
651 687
@@ -654,7 +690,8 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
654 return cpufreq_frequency_table_cpuinfo(policy, powernow_table); 690 return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
655} 691}
656 692
657static int powernow_cpu_exit (struct cpufreq_policy *policy) { 693static int powernow_cpu_exit(struct cpufreq_policy *policy)
694{
658 cpufreq_frequency_table_put_attr(policy->cpu); 695 cpufreq_frequency_table_put_attr(policy->cpu);
659 696
660#ifdef CONFIG_X86_POWERNOW_K7_ACPI 697#ifdef CONFIG_X86_POWERNOW_K7_ACPI
@@ -669,7 +706,7 @@ static int powernow_cpu_exit (struct cpufreq_policy *policy) {
669 return 0; 706 return 0;
670} 707}
671 708
672static struct freq_attr* powernow_table_attr[] = { 709static struct freq_attr *powernow_table_attr[] = {
673 &cpufreq_freq_attr_scaling_available_freqs, 710 &cpufreq_freq_attr_scaling_available_freqs,
674 NULL, 711 NULL,
675}; 712};
@@ -685,15 +722,15 @@ static struct cpufreq_driver powernow_driver = {
685 .attr = powernow_table_attr, 722 .attr = powernow_table_attr,
686}; 723};
687 724
688static int __init powernow_init (void) 725static int __init powernow_init(void)
689{ 726{
690 if (check_powernow()==0) 727 if (check_powernow() == 0)
691 return -ENODEV; 728 return -ENODEV;
692 return cpufreq_register_driver(&powernow_driver); 729 return cpufreq_register_driver(&powernow_driver);
693} 730}
694 731
695 732
696static void __exit powernow_exit (void) 733static void __exit powernow_exit(void)
697{ 734{
698 cpufreq_unregister_driver(&powernow_driver); 735 cpufreq_unregister_driver(&powernow_driver);
699} 736}
@@ -701,9 +738,9 @@ static void __exit powernow_exit (void)
701module_param(acpi_force, int, 0444); 738module_param(acpi_force, int, 0444);
702MODULE_PARM_DESC(acpi_force, "Force ACPI to be used."); 739MODULE_PARM_DESC(acpi_force, "Force ACPI to be used.");
703 740
704MODULE_AUTHOR ("Dave Jones <davej@redhat.com>"); 741MODULE_AUTHOR("Dave Jones <davej@redhat.com>");
705MODULE_DESCRIPTION ("Powernow driver for AMD K7 processors."); 742MODULE_DESCRIPTION("Powernow driver for AMD K7 processors.");
706MODULE_LICENSE ("GPL"); 743MODULE_LICENSE("GPL");
707 744
708late_initcall(powernow_init); 745late_initcall(powernow_init);
709module_exit(powernow_exit); 746module_exit(powernow_exit);
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 6428aa17b40e..a15ac94e0b9b 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -33,16 +33,14 @@
33#include <linux/string.h> 33#include <linux/string.h>
34#include <linux/cpumask.h> 34#include <linux/cpumask.h>
35#include <linux/sched.h> /* for current / set_cpus_allowed() */ 35#include <linux/sched.h> /* for current / set_cpus_allowed() */
36#include <linux/io.h>
37#include <linux/delay.h>
36 38
37#include <asm/msr.h> 39#include <asm/msr.h>
38#include <asm/io.h>
39#include <asm/delay.h>
40 40
41#ifdef CONFIG_X86_POWERNOW_K8_ACPI
42#include <linux/acpi.h> 41#include <linux/acpi.h>
43#include <linux/mutex.h> 42#include <linux/mutex.h>
44#include <acpi/processor.h> 43#include <acpi/processor.h>
45#endif
46 44
47#define PFX "powernow-k8: " 45#define PFX "powernow-k8: "
48#define VERSION "version 2.20.00" 46#define VERSION "version 2.20.00"
@@ -71,7 +69,8 @@ static u32 find_khz_freq_from_fid(u32 fid)
71 return 1000 * find_freq_from_fid(fid); 69 return 1000 * find_freq_from_fid(fid);
72} 70}
73 71
74static u32 find_khz_freq_from_pstate(struct cpufreq_frequency_table *data, u32 pstate) 72static u32 find_khz_freq_from_pstate(struct cpufreq_frequency_table *data,
73 u32 pstate)
75{ 74{
76 return data[pstate].frequency; 75 return data[pstate].frequency;
77} 76}
@@ -186,7 +185,9 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
186 return 1; 185 return 1;
187 } 186 }
188 187
189 lo = fid | (data->currvid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; 188 lo = fid;
189 lo |= (data->currvid << MSR_C_LO_VID_SHIFT);
190 lo |= MSR_C_LO_INIT_FID_VID;
190 191
191 dprintk("writing fid 0x%x, lo 0x%x, hi 0x%x\n", 192 dprintk("writing fid 0x%x, lo 0x%x, hi 0x%x\n",
192 fid, lo, data->plllock * PLL_LOCK_CONVERSION); 193 fid, lo, data->plllock * PLL_LOCK_CONVERSION);
@@ -194,7 +195,9 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
194 do { 195 do {
195 wrmsr(MSR_FIDVID_CTL, lo, data->plllock * PLL_LOCK_CONVERSION); 196 wrmsr(MSR_FIDVID_CTL, lo, data->plllock * PLL_LOCK_CONVERSION);
196 if (i++ > 100) { 197 if (i++ > 100) {
197 printk(KERN_ERR PFX "Hardware error - pending bit very stuck - no further pstate changes possible\n"); 198 printk(KERN_ERR PFX
199 "Hardware error - pending bit very stuck - "
200 "no further pstate changes possible\n");
198 return 1; 201 return 1;
199 } 202 }
200 } while (query_current_values_with_pending_wait(data)); 203 } while (query_current_values_with_pending_wait(data));
@@ -202,14 +205,16 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
202 count_off_irt(data); 205 count_off_irt(data);
203 206
204 if (savevid != data->currvid) { 207 if (savevid != data->currvid) {
205 printk(KERN_ERR PFX "vid change on fid trans, old 0x%x, new 0x%x\n", 208 printk(KERN_ERR PFX
206 savevid, data->currvid); 209 "vid change on fid trans, old 0x%x, new 0x%x\n",
210 savevid, data->currvid);
207 return 1; 211 return 1;
208 } 212 }
209 213
210 if (fid != data->currfid) { 214 if (fid != data->currfid) {
211 printk(KERN_ERR PFX "fid trans failed, fid 0x%x, curr 0x%x\n", fid, 215 printk(KERN_ERR PFX
212 data->currfid); 216 "fid trans failed, fid 0x%x, curr 0x%x\n", fid,
217 data->currfid);
213 return 1; 218 return 1;
214 } 219 }
215 220
@@ -228,7 +233,9 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
228 return 1; 233 return 1;
229 } 234 }
230 235
231 lo = data->currfid | (vid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; 236 lo = data->currfid;
237 lo |= (vid << MSR_C_LO_VID_SHIFT);
238 lo |= MSR_C_LO_INIT_FID_VID;
232 239
233 dprintk("writing vid 0x%x, lo 0x%x, hi 0x%x\n", 240 dprintk("writing vid 0x%x, lo 0x%x, hi 0x%x\n",
234 vid, lo, STOP_GRANT_5NS); 241 vid, lo, STOP_GRANT_5NS);
@@ -236,20 +243,24 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
236 do { 243 do {
237 wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS); 244 wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS);
238 if (i++ > 100) { 245 if (i++ > 100) {
239 printk(KERN_ERR PFX "internal error - pending bit very stuck - no further pstate changes possible\n"); 246 printk(KERN_ERR PFX "internal error - pending bit "
247 "very stuck - no further pstate "
248 "changes possible\n");
240 return 1; 249 return 1;
241 } 250 }
242 } while (query_current_values_with_pending_wait(data)); 251 } while (query_current_values_with_pending_wait(data));
243 252
244 if (savefid != data->currfid) { 253 if (savefid != data->currfid) {
245 printk(KERN_ERR PFX "fid changed on vid trans, old 0x%x new 0x%x\n", 254 printk(KERN_ERR PFX "fid changed on vid trans, old "
255 "0x%x new 0x%x\n",
246 savefid, data->currfid); 256 savefid, data->currfid);
247 return 1; 257 return 1;
248 } 258 }
249 259
250 if (vid != data->currvid) { 260 if (vid != data->currvid) {
251 printk(KERN_ERR PFX "vid trans failed, vid 0x%x, curr 0x%x\n", vid, 261 printk(KERN_ERR PFX "vid trans failed, vid 0x%x, "
252 data->currvid); 262 "curr 0x%x\n",
263 vid, data->currvid);
253 return 1; 264 return 1;
254 } 265 }
255 266
@@ -261,7 +272,8 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
261 * Decreasing vid codes represent increasing voltages: 272 * Decreasing vid codes represent increasing voltages:
262 * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of VID_OFF is off. 273 * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of VID_OFF is off.
263 */ 274 */
264static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid, u32 step) 275static int decrease_vid_code_by_step(struct powernow_k8_data *data,
276 u32 reqvid, u32 step)
265{ 277{
266 if ((data->currvid - reqvid) > step) 278 if ((data->currvid - reqvid) > step)
267 reqvid = data->currvid - step; 279 reqvid = data->currvid - step;
@@ -283,7 +295,8 @@ static int transition_pstate(struct powernow_k8_data *data, u32 pstate)
283} 295}
284 296
285/* Change Opteron/Athlon64 fid and vid, by the 3 phases. */ 297/* Change Opteron/Athlon64 fid and vid, by the 3 phases. */
286static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 reqvid) 298static int transition_fid_vid(struct powernow_k8_data *data,
299 u32 reqfid, u32 reqvid)
287{ 300{
288 if (core_voltage_pre_transition(data, reqvid)) 301 if (core_voltage_pre_transition(data, reqvid))
289 return 1; 302 return 1;
@@ -298,7 +311,8 @@ static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 req
298 return 1; 311 return 1;
299 312
300 if ((reqfid != data->currfid) || (reqvid != data->currvid)) { 313 if ((reqfid != data->currfid) || (reqvid != data->currvid)) {
301 printk(KERN_ERR PFX "failed (cpu%d): req 0x%x 0x%x, curr 0x%x 0x%x\n", 314 printk(KERN_ERR PFX "failed (cpu%d): req 0x%x 0x%x, "
315 "curr 0x%x 0x%x\n",
302 smp_processor_id(), 316 smp_processor_id(),
303 reqfid, reqvid, data->currfid, data->currvid); 317 reqfid, reqvid, data->currfid, data->currvid);
304 return 1; 318 return 1;
@@ -311,13 +325,15 @@ static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 req
311} 325}
312 326
313/* Phase 1 - core voltage transition ... setup voltage */ 327/* Phase 1 - core voltage transition ... setup voltage */
314static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid) 328static int core_voltage_pre_transition(struct powernow_k8_data *data,
329 u32 reqvid)
315{ 330{
316 u32 rvosteps = data->rvo; 331 u32 rvosteps = data->rvo;
317 u32 savefid = data->currfid; 332 u32 savefid = data->currfid;
318 u32 maxvid, lo; 333 u32 maxvid, lo;
319 334
320 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n", 335 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, "
336 "reqvid 0x%x, rvo 0x%x\n",
321 smp_processor_id(), 337 smp_processor_id(),
322 data->currfid, data->currvid, reqvid, data->rvo); 338 data->currfid, data->currvid, reqvid, data->rvo);
323 339
@@ -340,7 +356,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
340 } else { 356 } else {
341 dprintk("ph1: changing vid for rvo, req 0x%x\n", 357 dprintk("ph1: changing vid for rvo, req 0x%x\n",
342 data->currvid - 1); 358 data->currvid - 1);
343 if (decrease_vid_code_by_step(data, data->currvid - 1, 1)) 359 if (decrease_vid_code_by_step(data, data->currvid-1, 1))
344 return 1; 360 return 1;
345 rvosteps--; 361 rvosteps--;
346 } 362 }
@@ -350,7 +366,8 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
350 return 1; 366 return 1;
351 367
352 if (savefid != data->currfid) { 368 if (savefid != data->currfid) {
353 printk(KERN_ERR PFX "ph1 err, currfid changed 0x%x\n", data->currfid); 369 printk(KERN_ERR PFX "ph1 err, currfid changed 0x%x\n",
370 data->currfid);
354 return 1; 371 return 1;
355 } 372 }
356 373
@@ -363,20 +380,24 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
363/* Phase 2 - core frequency transition */ 380/* Phase 2 - core frequency transition */
364static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) 381static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
365{ 382{
366 u32 vcoreqfid, vcocurrfid, vcofiddiff, fid_interval, savevid = data->currvid; 383 u32 vcoreqfid, vcocurrfid, vcofiddiff;
384 u32 fid_interval, savevid = data->currvid;
367 385
368 if ((reqfid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { 386 if ((reqfid < HI_FID_TABLE_BOTTOM) &&
369 printk(KERN_ERR PFX "ph2: illegal lo-lo transition 0x%x 0x%x\n", 387 (data->currfid < HI_FID_TABLE_BOTTOM)) {
370 reqfid, data->currfid); 388 printk(KERN_ERR PFX "ph2: illegal lo-lo transition "
389 "0x%x 0x%x\n", reqfid, data->currfid);
371 return 1; 390 return 1;
372 } 391 }
373 392
374 if (data->currfid == reqfid) { 393 if (data->currfid == reqfid) {
375 printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n", data->currfid); 394 printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n",
395 data->currfid);
376 return 0; 396 return 0;
377 } 397 }
378 398
379 dprintk("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, reqfid 0x%x\n", 399 dprintk("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, "
400 "reqfid 0x%x\n",
380 smp_processor_id(), 401 smp_processor_id(),
381 data->currfid, data->currvid, reqfid); 402 data->currfid, data->currvid, reqfid);
382 403
@@ -390,14 +411,14 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
390 411
391 if (reqfid > data->currfid) { 412 if (reqfid > data->currfid) {
392 if (data->currfid > LO_FID_TABLE_TOP) { 413 if (data->currfid > LO_FID_TABLE_TOP) {
393 if (write_new_fid(data, data->currfid + fid_interval)) { 414 if (write_new_fid(data,
415 data->currfid + fid_interval))
394 return 1; 416 return 1;
395 }
396 } else { 417 } else {
397 if (write_new_fid 418 if (write_new_fid
398 (data, 2 + convert_fid_to_vco_fid(data->currfid))) { 419 (data,
420 2 + convert_fid_to_vco_fid(data->currfid)))
399 return 1; 421 return 1;
400 }
401 } 422 }
402 } else { 423 } else {
403 if (write_new_fid(data, data->currfid - fid_interval)) 424 if (write_new_fid(data, data->currfid - fid_interval))
@@ -417,7 +438,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
417 438
418 if (data->currfid != reqfid) { 439 if (data->currfid != reqfid) {
419 printk(KERN_ERR PFX 440 printk(KERN_ERR PFX
420 "ph2: mismatch, failed fid transition, curr 0x%x, req 0x%x\n", 441 "ph2: mismatch, failed fid transition, "
442 "curr 0x%x, req 0x%x\n",
421 data->currfid, reqfid); 443 data->currfid, reqfid);
422 return 1; 444 return 1;
423 } 445 }
@@ -435,7 +457,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
435} 457}
436 458
437/* Phase 3 - core voltage transition flow ... jump to the final vid. */ 459/* Phase 3 - core voltage transition flow ... jump to the final vid. */
438static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid) 460static int core_voltage_post_transition(struct powernow_k8_data *data,
461 u32 reqvid)
439{ 462{
440 u32 savefid = data->currfid; 463 u32 savefid = data->currfid;
441 u32 savereqvid = reqvid; 464 u32 savereqvid = reqvid;
@@ -457,7 +480,8 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
457 480
458 if (data->currvid != reqvid) { 481 if (data->currvid != reqvid) {
459 printk(KERN_ERR PFX 482 printk(KERN_ERR PFX
460 "ph3: failed vid transition\n, req 0x%x, curr 0x%x", 483 "ph3: failed vid transition\n, "
484 "req 0x%x, curr 0x%x",
461 reqvid, data->currvid); 485 reqvid, data->currvid);
462 return 1; 486 return 1;
463 } 487 }
@@ -508,7 +532,8 @@ static int check_supported_cpu(unsigned int cpu)
508 if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) { 532 if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) {
509 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || 533 if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
510 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_MASK)) { 534 ((eax & CPUID_XMOD) > CPUID_XMOD_REV_MASK)) {
511 printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); 535 printk(KERN_INFO PFX
536 "Processor cpuid %x not supported\n", eax);
512 goto out; 537 goto out;
513 } 538 }
514 539
@@ -520,8 +545,10 @@ static int check_supported_cpu(unsigned int cpu)
520 } 545 }
521 546
522 cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx); 547 cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
523 if ((edx & P_STATE_TRANSITION_CAPABLE) != P_STATE_TRANSITION_CAPABLE) { 548 if ((edx & P_STATE_TRANSITION_CAPABLE)
524 printk(KERN_INFO PFX "Power state transitions not supported\n"); 549 != P_STATE_TRANSITION_CAPABLE) {
550 printk(KERN_INFO PFX
551 "Power state transitions not supported\n");
525 goto out; 552 goto out;
526 } 553 }
527 } else { /* must be a HW Pstate capable processor */ 554 } else { /* must be a HW Pstate capable processor */
@@ -539,7 +566,8 @@ out:
539 return rc; 566 return rc;
540} 567}
541 568
542static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid) 569static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst,
570 u8 maxvid)
543{ 571{
544 unsigned int j; 572 unsigned int j;
545 u8 lastfid = 0xff; 573 u8 lastfid = 0xff;
@@ -550,12 +578,14 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8
550 j, pst[j].vid); 578 j, pst[j].vid);
551 return -EINVAL; 579 return -EINVAL;
552 } 580 }
553 if (pst[j].vid < data->rvo) { /* vid + rvo >= 0 */ 581 if (pst[j].vid < data->rvo) {
582 /* vid + rvo >= 0 */
554 printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate" 583 printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate"
555 " %d\n", j); 584 " %d\n", j);
556 return -ENODEV; 585 return -ENODEV;
557 } 586 }
558 if (pst[j].vid < maxvid + data->rvo) { /* vid + rvo >= maxvid */ 587 if (pst[j].vid < maxvid + data->rvo) {
588 /* vid + rvo >= maxvid */
559 printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate" 589 printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate"
560 " %d\n", j); 590 " %d\n", j);
561 return -ENODEV; 591 return -ENODEV;
@@ -579,23 +609,31 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8
579 return -EINVAL; 609 return -EINVAL;
580 } 610 }
581 if (lastfid > LO_FID_TABLE_TOP) 611 if (lastfid > LO_FID_TABLE_TOP)
582 printk(KERN_INFO FW_BUG PFX "first fid not from lo freq table\n"); 612 printk(KERN_INFO FW_BUG PFX
613 "first fid not from lo freq table\n");
583 614
584 return 0; 615 return 0;
585} 616}
586 617
618static void invalidate_entry(struct powernow_k8_data *data, unsigned int entry)
619{
620 data->powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID;
621}
622
587static void print_basics(struct powernow_k8_data *data) 623static void print_basics(struct powernow_k8_data *data)
588{ 624{
589 int j; 625 int j;
590 for (j = 0; j < data->numps; j++) { 626 for (j = 0; j < data->numps; j++) {
591 if (data->powernow_table[j].frequency != CPUFREQ_ENTRY_INVALID) { 627 if (data->powernow_table[j].frequency !=
628 CPUFREQ_ENTRY_INVALID) {
592 if (cpu_family == CPU_HW_PSTATE) { 629 if (cpu_family == CPU_HW_PSTATE) {
593 printk(KERN_INFO PFX " %d : pstate %d (%d MHz)\n", 630 printk(KERN_INFO PFX
594 j, 631 " %d : pstate %d (%d MHz)\n", j,
595 data->powernow_table[j].index, 632 data->powernow_table[j].index,
596 data->powernow_table[j].frequency/1000); 633 data->powernow_table[j].frequency/1000);
597 } else { 634 } else {
598 printk(KERN_INFO PFX " %d : fid 0x%x (%d MHz), vid 0x%x\n", 635 printk(KERN_INFO PFX
636 " %d : fid 0x%x (%d MHz), vid 0x%x\n",
599 j, 637 j,
600 data->powernow_table[j].index & 0xff, 638 data->powernow_table[j].index & 0xff,
601 data->powernow_table[j].frequency/1000, 639 data->powernow_table[j].frequency/1000,
@@ -604,20 +642,25 @@ static void print_basics(struct powernow_k8_data *data)
604 } 642 }
605 } 643 }
606 if (data->batps) 644 if (data->batps)
607 printk(KERN_INFO PFX "Only %d pstates on battery\n", data->batps); 645 printk(KERN_INFO PFX "Only %d pstates on battery\n",
646 data->batps);
608} 647}
609 648
610static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid) 649static int fill_powernow_table(struct powernow_k8_data *data,
650 struct pst_s *pst, u8 maxvid)
611{ 651{
612 struct cpufreq_frequency_table *powernow_table; 652 struct cpufreq_frequency_table *powernow_table;
613 unsigned int j; 653 unsigned int j;
614 654
615 if (data->batps) { /* use ACPI support to get full speed on mains power */ 655 if (data->batps) {
616 printk(KERN_WARNING PFX "Only %d pstates usable (use ACPI driver for full range\n", data->batps); 656 /* use ACPI support to get full speed on mains power */
657 printk(KERN_WARNING PFX
658 "Only %d pstates usable (use ACPI driver for full "
659 "range\n", data->batps);
617 data->numps = data->batps; 660 data->numps = data->batps;
618 } 661 }
619 662
620 for ( j=1; j<data->numps; j++ ) { 663 for (j = 1; j < data->numps; j++) {
621 if (pst[j-1].fid >= pst[j].fid) { 664 if (pst[j-1].fid >= pst[j].fid) {
622 printk(KERN_ERR PFX "PST out of sequence\n"); 665 printk(KERN_ERR PFX "PST out of sequence\n");
623 return -EINVAL; 666 return -EINVAL;
@@ -640,9 +683,11 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst,
640 } 683 }
641 684
642 for (j = 0; j < data->numps; j++) { 685 for (j = 0; j < data->numps; j++) {
686 int freq;
643 powernow_table[j].index = pst[j].fid; /* lower 8 bits */ 687 powernow_table[j].index = pst[j].fid; /* lower 8 bits */
644 powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */ 688 powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */
645 powernow_table[j].frequency = find_khz_freq_from_fid(pst[j].fid); 689 freq = find_khz_freq_from_fid(pst[j].fid);
690 powernow_table[j].frequency = freq;
646 } 691 }
647 powernow_table[data->numps].frequency = CPUFREQ_TABLE_END; 692 powernow_table[data->numps].frequency = CPUFREQ_TABLE_END;
648 powernow_table[data->numps].index = 0; 693 powernow_table[data->numps].index = 0;
@@ -658,7 +703,8 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst,
658 print_basics(data); 703 print_basics(data);
659 704
660 for (j = 0; j < data->numps; j++) 705 for (j = 0; j < data->numps; j++)
661 if ((pst[j].fid==data->currfid) && (pst[j].vid==data->currvid)) 706 if ((pst[j].fid == data->currfid) &&
707 (pst[j].vid == data->currvid))
662 return 0; 708 return 0;
663 709
664 dprintk("currfid/vid do not match PST, ignoring\n"); 710 dprintk("currfid/vid do not match PST, ignoring\n");
@@ -698,7 +744,8 @@ static int find_psb_table(struct powernow_k8_data *data)
698 } 744 }
699 745
700 data->vstable = psb->vstable; 746 data->vstable = psb->vstable;
701 dprintk("voltage stabilization time: %d(*20us)\n", data->vstable); 747 dprintk("voltage stabilization time: %d(*20us)\n",
748 data->vstable);
702 749
703 dprintk("flags2: 0x%x\n", psb->flags2); 750 dprintk("flags2: 0x%x\n", psb->flags2);
704 data->rvo = psb->flags2 & 3; 751 data->rvo = psb->flags2 & 3;
@@ -713,11 +760,12 @@ static int find_psb_table(struct powernow_k8_data *data)
713 760
714 dprintk("numpst: 0x%x\n", psb->num_tables); 761 dprintk("numpst: 0x%x\n", psb->num_tables);
715 cpst = psb->num_tables; 762 cpst = psb->num_tables;
716 if ((psb->cpuid == 0x00000fc0) || (psb->cpuid == 0x00000fe0) ){ 763 if ((psb->cpuid == 0x00000fc0) ||
764 (psb->cpuid == 0x00000fe0)) {
717 thiscpuid = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); 765 thiscpuid = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
718 if ((thiscpuid == 0x00000fc0) || (thiscpuid == 0x00000fe0) ) { 766 if ((thiscpuid == 0x00000fc0) ||
767 (thiscpuid == 0x00000fe0))
719 cpst = 1; 768 cpst = 1;
720 }
721 } 769 }
722 if (cpst != 1) { 770 if (cpst != 1) {
723 printk(KERN_ERR FW_BUG PFX "numpst must be 1\n"); 771 printk(KERN_ERR FW_BUG PFX "numpst must be 1\n");
@@ -732,7 +780,8 @@ static int find_psb_table(struct powernow_k8_data *data)
732 780
733 data->numps = psb->numps; 781 data->numps = psb->numps;
734 dprintk("numpstates: 0x%x\n", data->numps); 782 dprintk("numpstates: 0x%x\n", data->numps);
735 return fill_powernow_table(data, (struct pst_s *)(psb+1), maxvid); 783 return fill_powernow_table(data,
784 (struct pst_s *)(psb+1), maxvid);
736 } 785 }
737 /* 786 /*
738 * If you see this message, complain to BIOS manufacturer. If 787 * If you see this message, complain to BIOS manufacturer. If
@@ -745,28 +794,31 @@ static int find_psb_table(struct powernow_k8_data *data)
745 * BIOS and Kernel Developer's Guide, which is available on 794 * BIOS and Kernel Developer's Guide, which is available on
746 * www.amd.com 795 * www.amd.com
747 */ 796 */
748 printk(KERN_ERR PFX "BIOS error - no PSB or ACPI _PSS objects\n"); 797 printk(KERN_ERR FW_BUG PFX "No PSB or ACPI _PSS objects\n");
749 return -ENODEV; 798 return -ENODEV;
750} 799}
751 800
752#ifdef CONFIG_X86_POWERNOW_K8_ACPI 801static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data,
753static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) 802 unsigned int index)
754{ 803{
804 acpi_integer control;
805
755 if (!data->acpi_data.state_count || (cpu_family == CPU_HW_PSTATE)) 806 if (!data->acpi_data.state_count || (cpu_family == CPU_HW_PSTATE))
756 return; 807 return;
757 808
758 data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK; 809 control = data->acpi_data.states[index].control; data->irt = (control
759 data->rvo = (data->acpi_data.states[index].control >> RVO_SHIFT) & RVO_MASK; 810 >> IRT_SHIFT) & IRT_MASK; data->rvo = (control >>
760 data->exttype = (data->acpi_data.states[index].control >> EXT_TYPE_SHIFT) & EXT_TYPE_MASK; 811 RVO_SHIFT) & RVO_MASK; data->exttype = (control
761 data->plllock = (data->acpi_data.states[index].control >> PLL_L_SHIFT) & PLL_L_MASK; 812 >> EXT_TYPE_SHIFT) & EXT_TYPE_MASK;
762 data->vidmvs = 1 << ((data->acpi_data.states[index].control >> MVS_SHIFT) & MVS_MASK); 813 data->plllock = (control >> PLL_L_SHIFT) & PLL_L_MASK; data->vidmvs = 1
763 data->vstable = (data->acpi_data.states[index].control >> VST_SHIFT) & VST_MASK; 814 << ((control >> MVS_SHIFT) & MVS_MASK); data->vstable =
764} 815 (control >> VST_SHIFT) & VST_MASK; }
765 816
766static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) 817static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
767{ 818{
768 struct cpufreq_frequency_table *powernow_table; 819 struct cpufreq_frequency_table *powernow_table;
769 int ret_val = -ENODEV; 820 int ret_val = -ENODEV;
821 acpi_integer space_id;
770 822
771 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) { 823 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {
772 dprintk("register performance failed: bad ACPI data\n"); 824 dprintk("register performance failed: bad ACPI data\n");
@@ -779,11 +831,12 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
779 goto err_out; 831 goto err_out;
780 } 832 }
781 833
782 if ((data->acpi_data.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) || 834 space_id = data->acpi_data.control_register.space_id;
783 (data->acpi_data.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) { 835 if ((space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
836 (space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
784 dprintk("Invalid control/status registers (%x - %x)\n", 837 dprintk("Invalid control/status registers (%x - %x)\n",
785 data->acpi_data.control_register.space_id, 838 data->acpi_data.control_register.space_id,
786 data->acpi_data.status_register.space_id); 839 space_id);
787 goto err_out; 840 goto err_out;
788 } 841 }
789 842
@@ -802,7 +855,8 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
802 if (ret_val) 855 if (ret_val)
803 goto err_out_mem; 856 goto err_out_mem;
804 857
805 powernow_table[data->acpi_data.state_count].frequency = CPUFREQ_TABLE_END; 858 powernow_table[data->acpi_data.state_count].frequency =
859 CPUFREQ_TABLE_END;
806 powernow_table[data->acpi_data.state_count].index = 0; 860 powernow_table[data->acpi_data.state_count].index = 0;
807 data->powernow_table = powernow_table; 861 data->powernow_table = powernow_table;
808 862
@@ -830,13 +884,15 @@ err_out_mem:
830err_out: 884err_out:
831 acpi_processor_unregister_performance(&data->acpi_data, data->cpu); 885 acpi_processor_unregister_performance(&data->acpi_data, data->cpu);
832 886
833 /* data->acpi_data.state_count informs us at ->exit() whether ACPI was used */ 887 /* data->acpi_data.state_count informs us at ->exit()
888 * whether ACPI was used */
834 data->acpi_data.state_count = 0; 889 data->acpi_data.state_count = 0;
835 890
836 return ret_val; 891 return ret_val;
837} 892}
838 893
839static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table) 894static int fill_powernow_table_pstate(struct powernow_k8_data *data,
895 struct cpufreq_frequency_table *powernow_table)
840{ 896{
841 int i; 897 int i;
842 u32 hi = 0, lo = 0; 898 u32 hi = 0, lo = 0;
@@ -848,84 +904,101 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpuf
848 904
849 index = data->acpi_data.states[i].control & HW_PSTATE_MASK; 905 index = data->acpi_data.states[i].control & HW_PSTATE_MASK;
850 if (index > data->max_hw_pstate) { 906 if (index > data->max_hw_pstate) {
851 printk(KERN_ERR PFX "invalid pstate %d - bad value %d.\n", i, index); 907 printk(KERN_ERR PFX "invalid pstate %d - "
852 printk(KERN_ERR PFX "Please report to BIOS manufacturer\n"); 908 "bad value %d.\n", i, index);
853 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 909 printk(KERN_ERR PFX "Please report to BIOS "
910 "manufacturer\n");
911 invalidate_entry(data, i);
854 continue; 912 continue;
855 } 913 }
856 rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi); 914 rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
857 if (!(hi & HW_PSTATE_VALID_MASK)) { 915 if (!(hi & HW_PSTATE_VALID_MASK)) {
858 dprintk("invalid pstate %d, ignoring\n", index); 916 dprintk("invalid pstate %d, ignoring\n", index);
859 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 917 invalidate_entry(data, i);
860 continue; 918 continue;
861 } 919 }
862 920
863 powernow_table[i].index = index; 921 powernow_table[i].index = index;
864 922
865 powernow_table[i].frequency = data->acpi_data.states[i].core_frequency * 1000; 923 powernow_table[i].frequency =
924 data->acpi_data.states[i].core_frequency * 1000;
866 } 925 }
867 return 0; 926 return 0;
868} 927}
869 928
870static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table) 929static int fill_powernow_table_fidvid(struct powernow_k8_data *data,
930 struct cpufreq_frequency_table *powernow_table)
871{ 931{
872 int i; 932 int i;
873 int cntlofreq = 0; 933 int cntlofreq = 0;
934
874 for (i = 0; i < data->acpi_data.state_count; i++) { 935 for (i = 0; i < data->acpi_data.state_count; i++) {
875 u32 fid; 936 u32 fid;
876 u32 vid; 937 u32 vid;
938 u32 freq, index;
939 acpi_integer status, control;
877 940
878 if (data->exttype) { 941 if (data->exttype) {
879 fid = data->acpi_data.states[i].status & EXT_FID_MASK; 942 status = data->acpi_data.states[i].status;
880 vid = (data->acpi_data.states[i].status >> VID_SHIFT) & EXT_VID_MASK; 943 fid = status & EXT_FID_MASK;
944 vid = (status >> VID_SHIFT) & EXT_VID_MASK;
881 } else { 945 } else {
882 fid = data->acpi_data.states[i].control & FID_MASK; 946 control = data->acpi_data.states[i].control;
883 vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK; 947 fid = control & FID_MASK;
948 vid = (control >> VID_SHIFT) & VID_MASK;
884 } 949 }
885 950
886 dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); 951 dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
887 952
888 powernow_table[i].index = fid; /* lower 8 bits */ 953 index = fid | (vid<<8);
889 powernow_table[i].index |= (vid << 8); /* upper 8 bits */ 954 powernow_table[i].index = index;
890 powernow_table[i].frequency = find_khz_freq_from_fid(fid); 955
956 freq = find_khz_freq_from_fid(fid);
957 powernow_table[i].frequency = freq;
891 958
892 /* verify frequency is OK */ 959 /* verify frequency is OK */
893 if ((powernow_table[i].frequency > (MAX_FREQ * 1000)) || 960 if ((freq > (MAX_FREQ * 1000)) || (freq < (MIN_FREQ * 1000))) {
894 (powernow_table[i].frequency < (MIN_FREQ * 1000))) { 961 dprintk("invalid freq %u kHz, ignoring\n", freq);
895 dprintk("invalid freq %u kHz, ignoring\n", powernow_table[i].frequency); 962 invalidate_entry(data, i);
896 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
897 continue; 963 continue;
898 } 964 }
899 965
900 /* verify voltage is OK - BIOSs are using "off" to indicate invalid */ 966 /* verify voltage is OK -
967 * BIOSs are using "off" to indicate invalid */
901 if (vid == VID_OFF) { 968 if (vid == VID_OFF) {
902 dprintk("invalid vid %u, ignoring\n", vid); 969 dprintk("invalid vid %u, ignoring\n", vid);
903 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 970 invalidate_entry(data, i);
904 continue; 971 continue;
905 } 972 }
906 973
907 /* verify only 1 entry from the lo frequency table */ 974 /* verify only 1 entry from the lo frequency table */
908 if (fid < HI_FID_TABLE_BOTTOM) { 975 if (fid < HI_FID_TABLE_BOTTOM) {
909 if (cntlofreq) { 976 if (cntlofreq) {
910 /* if both entries are the same, ignore this one ... */ 977 /* if both entries are the same,
911 if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) || 978 * ignore this one ... */
912 (powernow_table[i].index != powernow_table[cntlofreq].index)) { 979 if ((freq != powernow_table[cntlofreq].frequency) ||
913 printk(KERN_ERR PFX "Too many lo freq table entries\n"); 980 (index != powernow_table[cntlofreq].index)) {
981 printk(KERN_ERR PFX
982 "Too many lo freq table "
983 "entries\n");
914 return 1; 984 return 1;
915 } 985 }
916 986
917 dprintk("double low frequency table entry, ignoring it.\n"); 987 dprintk("double low frequency table entry, "
918 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 988 "ignoring it.\n");
989 invalidate_entry(data, i);
919 continue; 990 continue;
920 } else 991 } else
921 cntlofreq = i; 992 cntlofreq = i;
922 } 993 }
923 994
924 if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) { 995 if (freq != (data->acpi_data.states[i].core_frequency * 1000)) {
925 printk(KERN_INFO PFX "invalid freq entries %u kHz vs. %u kHz\n", 996 printk(KERN_INFO PFX "invalid freq entries "
926 powernow_table[i].frequency, 997 "%u kHz vs. %u kHz\n", freq,
927 (unsigned int) (data->acpi_data.states[i].core_frequency * 1000)); 998 (unsigned int)
928 powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; 999 (data->acpi_data.states[i].core_frequency
1000 * 1000));
1001 invalidate_entry(data, i);
929 continue; 1002 continue;
930 } 1003 }
931 } 1004 }
@@ -935,7 +1008,8 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpuf
935static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) 1008static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data)
936{ 1009{
937 if (data->acpi_data.state_count) 1010 if (data->acpi_data.state_count)
938 acpi_processor_unregister_performance(&data->acpi_data, data->cpu); 1011 acpi_processor_unregister_performance(&data->acpi_data,
1012 data->cpu);
939 free_cpumask_var(data->acpi_data.shared_cpu_map); 1013 free_cpumask_var(data->acpi_data.shared_cpu_map);
940} 1014}
941 1015
@@ -953,15 +1027,9 @@ static int get_transition_latency(struct powernow_k8_data *data)
953 return 1000 * max_latency; 1027 return 1000 * max_latency;
954} 1028}
955 1029
956#else
957static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) { return -ENODEV; }
958static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) { return; }
959static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) { return; }
960static int get_transition_latency(struct powernow_k8_data *data) { return 0; }
961#endif /* CONFIG_X86_POWERNOW_K8_ACPI */
962
963/* Take a frequency, and issue the fid/vid transition command */ 1030/* Take a frequency, and issue the fid/vid transition command */
964static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned int index) 1031static int transition_frequency_fidvid(struct powernow_k8_data *data,
1032 unsigned int index)
965{ 1033{
966 u32 fid = 0; 1034 u32 fid = 0;
967 u32 vid = 0; 1035 u32 vid = 0;
@@ -989,7 +1057,8 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i
989 return 0; 1057 return 0;
990 } 1058 }
991 1059
992 if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { 1060 if ((fid < HI_FID_TABLE_BOTTOM) &&
1061 (data->currfid < HI_FID_TABLE_BOTTOM)) {
993 printk(KERN_ERR PFX 1062 printk(KERN_ERR PFX
994 "ignoring illegal change in lo freq table-%x to 0x%x\n", 1063 "ignoring illegal change in lo freq table-%x to 0x%x\n",
995 data->currfid, fid); 1064 data->currfid, fid);
@@ -1017,7 +1086,8 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i
1017} 1086}
1018 1087
1019/* Take a frequency, and issue the hardware pstate transition command */ 1088/* Take a frequency, and issue the hardware pstate transition command */
1020static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned int index) 1089static int transition_frequency_pstate(struct powernow_k8_data *data,
1090 unsigned int index)
1021{ 1091{
1022 u32 pstate = 0; 1092 u32 pstate = 0;
1023 int res, i; 1093 int res, i;
@@ -1029,7 +1099,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
1029 pstate = index & HW_PSTATE_MASK; 1099 pstate = index & HW_PSTATE_MASK;
1030 if (pstate > data->max_hw_pstate) 1100 if (pstate > data->max_hw_pstate)
1031 return 0; 1101 return 0;
1032 freqs.old = find_khz_freq_from_pstate(data->powernow_table, data->currpstate); 1102 freqs.old = find_khz_freq_from_pstate(data->powernow_table,
1103 data->currpstate);
1033 freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate); 1104 freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
1034 1105
1035 for_each_cpu_mask_nr(i, *(data->available_cores)) { 1106 for_each_cpu_mask_nr(i, *(data->available_cores)) {
@@ -1048,7 +1119,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
1048} 1119}
1049 1120
1050/* Driver entry point to switch to the target frequency */ 1121/* Driver entry point to switch to the target frequency */
1051static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) 1122static int powernowk8_target(struct cpufreq_policy *pol,
1123 unsigned targfreq, unsigned relation)
1052{ 1124{
1053 cpumask_t oldmask; 1125 cpumask_t oldmask;
1054 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); 1126 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
@@ -1087,14 +1159,18 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
1087 dprintk("targ: curr fid 0x%x, vid 0x%x\n", 1159 dprintk("targ: curr fid 0x%x, vid 0x%x\n",
1088 data->currfid, data->currvid); 1160 data->currfid, data->currvid);
1089 1161
1090 if ((checkvid != data->currvid) || (checkfid != data->currfid)) { 1162 if ((checkvid != data->currvid) ||
1163 (checkfid != data->currfid)) {
1091 printk(KERN_INFO PFX 1164 printk(KERN_INFO PFX
1092 "error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n", 1165 "error - out of sync, fix 0x%x 0x%x, "
1093 checkfid, data->currfid, checkvid, data->currvid); 1166 "vid 0x%x 0x%x\n",
1167 checkfid, data->currfid,
1168 checkvid, data->currvid);
1094 } 1169 }
1095 } 1170 }
1096 1171
1097 if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate)) 1172 if (cpufreq_frequency_table_target(pol, data->powernow_table,
1173 targfreq, relation, &newstate))
1098 goto err_out; 1174 goto err_out;
1099 1175
1100 mutex_lock(&fidvid_mutex); 1176 mutex_lock(&fidvid_mutex);
@@ -1114,7 +1190,8 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
1114 mutex_unlock(&fidvid_mutex); 1190 mutex_unlock(&fidvid_mutex);
1115 1191
1116 if (cpu_family == CPU_HW_PSTATE) 1192 if (cpu_family == CPU_HW_PSTATE)
1117 pol->cur = find_khz_freq_from_pstate(data->powernow_table, newstate); 1193 pol->cur = find_khz_freq_from_pstate(data->powernow_table,
1194 newstate);
1118 else 1195 else
1119 pol->cur = find_khz_freq_from_fid(data->currfid); 1196 pol->cur = find_khz_freq_from_fid(data->currfid);
1120 ret = 0; 1197 ret = 0;
@@ -1141,6 +1218,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1141 struct powernow_k8_data *data; 1218 struct powernow_k8_data *data;
1142 cpumask_t oldmask; 1219 cpumask_t oldmask;
1143 int rc; 1220 int rc;
1221 static int print_once;
1144 1222
1145 if (!cpu_online(pol->cpu)) 1223 if (!cpu_online(pol->cpu))
1146 return -ENODEV; 1224 return -ENODEV;
@@ -1163,33 +1241,31 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1163 * an UP version, and is deprecated by AMD. 1241 * an UP version, and is deprecated by AMD.
1164 */ 1242 */
1165 if (num_online_cpus() != 1) { 1243 if (num_online_cpus() != 1) {
1166#ifndef CONFIG_ACPI_PROCESSOR 1244 /*
1167 printk(KERN_ERR PFX "ACPI Processor support is required " 1245 * Replace this one with print_once as soon as such a
1168 "for SMP systems but is absent. Please load the " 1246 * thing gets introduced
1169 "ACPI Processor module before starting this " 1247 */
1170 "driver.\n"); 1248 if (!print_once) {
1171#else 1249 WARN_ONCE(1, KERN_ERR FW_BUG PFX "Your BIOS "
1172 printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide" 1250 "does not provide ACPI _PSS objects "
1173 " ACPI _PSS objects in a way that Linux " 1251 "in a way that Linux understands. "
1174 "understands. Please report this to the Linux " 1252 "Please report this to the Linux ACPI"
1175 "ACPI maintainers and complain to your BIOS " 1253 " maintainers and complain to your "
1176 "vendor.\n"); 1254 "BIOS vendor.\n");
1177#endif 1255 print_once++;
1178 kfree(data); 1256 }
1179 return -ENODEV; 1257 goto err_out;
1180 } 1258 }
1181 if (pol->cpu != 0) { 1259 if (pol->cpu != 0) {
1182 printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " 1260 printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
1183 "CPU other than CPU0. Complain to your BIOS " 1261 "CPU other than CPU0. Complain to your BIOS "
1184 "vendor.\n"); 1262 "vendor.\n");
1185 kfree(data); 1263 goto err_out;
1186 return -ENODEV;
1187 } 1264 }
1188 rc = find_psb_table(data); 1265 rc = find_psb_table(data);
1189 if (rc) { 1266 if (rc)
1190 kfree(data); 1267 goto err_out;
1191 return -ENODEV; 1268
1192 }
1193 /* Take a crude guess here. 1269 /* Take a crude guess here.
1194 * That guess was in microseconds, so multiply with 1000 */ 1270 * That guess was in microseconds, so multiply with 1000 */
1195 pol->cpuinfo.transition_latency = ( 1271 pol->cpuinfo.transition_latency = (
@@ -1204,16 +1280,16 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1204 1280
1205 if (smp_processor_id() != pol->cpu) { 1281 if (smp_processor_id() != pol->cpu) {
1206 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); 1282 printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu);
1207 goto err_out; 1283 goto err_out_unmask;
1208 } 1284 }
1209 1285
1210 if (pending_bit_stuck()) { 1286 if (pending_bit_stuck()) {
1211 printk(KERN_ERR PFX "failing init, change pending bit set\n"); 1287 printk(KERN_ERR PFX "failing init, change pending bit set\n");
1212 goto err_out; 1288 goto err_out_unmask;
1213 } 1289 }
1214 1290
1215 if (query_current_values_with_pending_wait(data)) 1291 if (query_current_values_with_pending_wait(data))
1216 goto err_out; 1292 goto err_out_unmask;
1217 1293
1218 if (cpu_family == CPU_OPTERON) 1294 if (cpu_family == CPU_OPTERON)
1219 fidvid_msr_init(); 1295 fidvid_msr_init();
@@ -1228,7 +1304,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1228 data->available_cores = pol->cpus; 1304 data->available_cores = pol->cpus;
1229 1305
1230 if (cpu_family == CPU_HW_PSTATE) 1306 if (cpu_family == CPU_HW_PSTATE)
1231 pol->cur = find_khz_freq_from_pstate(data->powernow_table, data->currpstate); 1307 pol->cur = find_khz_freq_from_pstate(data->powernow_table,
1308 data->currpstate);
1232 else 1309 else
1233 pol->cur = find_khz_freq_from_fid(data->currfid); 1310 pol->cur = find_khz_freq_from_fid(data->currfid);
1234 dprintk("policy current frequency %d kHz\n", pol->cur); 1311 dprintk("policy current frequency %d kHz\n", pol->cur);
@@ -1245,7 +1322,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1245 cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu); 1322 cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu);
1246 1323
1247 if (cpu_family == CPU_HW_PSTATE) 1324 if (cpu_family == CPU_HW_PSTATE)
1248 dprintk("cpu_init done, current pstate 0x%x\n", data->currpstate); 1325 dprintk("cpu_init done, current pstate 0x%x\n",
1326 data->currpstate);
1249 else 1327 else
1250 dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n", 1328 dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n",
1251 data->currfid, data->currvid); 1329 data->currfid, data->currvid);
@@ -1254,15 +1332,16 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1254 1332
1255 return 0; 1333 return 0;
1256 1334
1257err_out: 1335err_out_unmask:
1258 set_cpus_allowed_ptr(current, &oldmask); 1336 set_cpus_allowed_ptr(current, &oldmask);
1259 powernow_k8_cpu_exit_acpi(data); 1337 powernow_k8_cpu_exit_acpi(data);
1260 1338
1339err_out:
1261 kfree(data); 1340 kfree(data);
1262 return -ENODEV; 1341 return -ENODEV;
1263} 1342}
1264 1343
1265static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol) 1344static int __devexit powernowk8_cpu_exit(struct cpufreq_policy *pol)
1266{ 1345{
1267 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); 1346 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
1268 1347
@@ -1279,7 +1358,7 @@ static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol)
1279 return 0; 1358 return 0;
1280} 1359}
1281 1360
1282static unsigned int powernowk8_get (unsigned int cpu) 1361static unsigned int powernowk8_get(unsigned int cpu)
1283{ 1362{
1284 struct powernow_k8_data *data; 1363 struct powernow_k8_data *data;
1285 cpumask_t oldmask = current->cpus_allowed; 1364 cpumask_t oldmask = current->cpus_allowed;
@@ -1315,7 +1394,7 @@ out:
1315 return khz; 1394 return khz;
1316} 1395}
1317 1396
1318static struct freq_attr* powernow_k8_attr[] = { 1397static struct freq_attr *powernow_k8_attr[] = {
1319 &cpufreq_freq_attr_scaling_available_freqs, 1398 &cpufreq_freq_attr_scaling_available_freqs,
1320 NULL, 1399 NULL,
1321}; 1400};
@@ -1360,7 +1439,8 @@ static void __exit powernowk8_exit(void)
1360 cpufreq_unregister_driver(&cpufreq_amd64_driver); 1439 cpufreq_unregister_driver(&cpufreq_amd64_driver);
1361} 1440}
1362 1441
1363MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com>"); 1442MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and "
1443 "Mark Langsdorf <mark.langsdorf@amd.com>");
1364MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver."); 1444MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");
1365MODULE_LICENSE("GPL"); 1445MODULE_LICENSE("GPL");
1366 1446
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
index 8ecc75b6c7c3..6c6698feade1 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
@@ -45,11 +45,10 @@ struct powernow_k8_data {
45 * frequency is in kHz */ 45 * frequency is in kHz */
46 struct cpufreq_frequency_table *powernow_table; 46 struct cpufreq_frequency_table *powernow_table;
47 47
48#ifdef CONFIG_X86_POWERNOW_K8_ACPI
49 /* the acpi table needs to be kept. it's only available if ACPI was 48 /* the acpi table needs to be kept. it's only available if ACPI was
50 * used to determine valid frequency/vid/fid states */ 49 * used to determine valid frequency/vid/fid states */
51 struct acpi_processor_performance acpi_data; 50 struct acpi_processor_performance acpi_data;
52#endif 51
53 /* we need to keep track of associated cores, but let cpufreq 52 /* we need to keep track of associated cores, but let cpufreq
54 * handle hotplug events - so just point at cpufreq pol->cpus 53 * handle hotplug events - so just point at cpufreq pol->cpus
55 * structure */ 54 * structure */
@@ -222,10 +221,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid);
222 221
223static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index); 222static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index);
224 223
225#ifdef CONFIG_X86_POWERNOW_K8_ACPI
226static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table); 224static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table);
227static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table); 225static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table);
228#endif
229 226
230#ifdef CONFIG_SMP 227#ifdef CONFIG_SMP
231static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[]) 228static inline void define_siblings(int cpu, cpumask_t cpu_sharedcore_mask[])
diff --git a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
index 42da9bd677d6..435a996a613a 100644
--- a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
+++ b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
@@ -19,17 +19,19 @@
19 19
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/cpufreq.h> 21#include <linux/cpufreq.h>
22#include <linux/timex.h>
23#include <linux/io.h>
22 24
23#include <asm/msr.h> 25#include <asm/msr.h>
24#include <asm/timex.h>
25#include <asm/io.h>
26 26
27#define MMCR_BASE 0xfffef000 /* The default base address */ 27#define MMCR_BASE 0xfffef000 /* The default base address */
28#define OFFS_CPUCTL 0x2 /* CPU Control Register */ 28#define OFFS_CPUCTL 0x2 /* CPU Control Register */
29 29
30static __u8 __iomem *cpuctl; 30static __u8 __iomem *cpuctl;
31 31
32#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "sc520_freq", msg) 32#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
33 "sc520_freq", msg)
34#define PFX "sc520_freq: "
33 35
34static struct cpufreq_frequency_table sc520_freq_table[] = { 36static struct cpufreq_frequency_table sc520_freq_table[] = {
35 {0x01, 100000}, 37 {0x01, 100000},
@@ -43,7 +45,8 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
43 45
44 switch (clockspeed_reg & 0x03) { 46 switch (clockspeed_reg & 0x03) {
45 default: 47 default:
46 printk(KERN_ERR "sc520_freq: error: cpuctl register has unexpected value %02x\n", clockspeed_reg); 48 printk(KERN_ERR PFX "error: cpuctl register has unexpected "
49 "value %02x\n", clockspeed_reg);
47 case 0x01: 50 case 0x01:
48 return 100000; 51 return 100000;
49 case 0x02: 52 case 0x02:
@@ -51,7 +54,7 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu)
51 } 54 }
52} 55}
53 56
54static void sc520_freq_set_cpu_state (unsigned int state) 57static void sc520_freq_set_cpu_state(unsigned int state)
55{ 58{
56 59
57 struct cpufreq_freqs freqs; 60 struct cpufreq_freqs freqs;
@@ -76,18 +79,19 @@ static void sc520_freq_set_cpu_state (unsigned int state)
76 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 79 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
77}; 80};
78 81
79static int sc520_freq_verify (struct cpufreq_policy *policy) 82static int sc520_freq_verify(struct cpufreq_policy *policy)
80{ 83{
81 return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]); 84 return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]);
82} 85}
83 86
84static int sc520_freq_target (struct cpufreq_policy *policy, 87static int sc520_freq_target(struct cpufreq_policy *policy,
85 unsigned int target_freq, 88 unsigned int target_freq,
86 unsigned int relation) 89 unsigned int relation)
87{ 90{
88 unsigned int newstate = 0; 91 unsigned int newstate = 0;
89 92
90 if (cpufreq_frequency_table_target(policy, sc520_freq_table, target_freq, relation, &newstate)) 93 if (cpufreq_frequency_table_target(policy, sc520_freq_table,
94 target_freq, relation, &newstate))
91 return -EINVAL; 95 return -EINVAL;
92 96
93 sc520_freq_set_cpu_state(newstate); 97 sc520_freq_set_cpu_state(newstate);
@@ -116,7 +120,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
116 120
117 result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table); 121 result = cpufreq_frequency_table_cpuinfo(policy, sc520_freq_table);
118 if (result) 122 if (result)
119 return (result); 123 return result;
120 124
121 cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu); 125 cpufreq_frequency_table_get_attr(sc520_freq_table, policy->cpu);
122 126
@@ -131,7 +135,7 @@ static int sc520_freq_cpu_exit(struct cpufreq_policy *policy)
131} 135}
132 136
133 137
134static struct freq_attr* sc520_freq_attr[] = { 138static struct freq_attr *sc520_freq_attr[] = {
135 &cpufreq_freq_attr_scaling_available_freqs, 139 &cpufreq_freq_attr_scaling_available_freqs,
136 NULL, 140 NULL,
137}; 141};
@@ -155,13 +159,13 @@ static int __init sc520_freq_init(void)
155 int err; 159 int err;
156 160
157 /* Test if we have the right hardware */ 161 /* Test if we have the right hardware */
158 if(c->x86_vendor != X86_VENDOR_AMD || 162 if (c->x86_vendor != X86_VENDOR_AMD ||
159 c->x86 != 4 || c->x86_model != 9) { 163 c->x86 != 4 || c->x86_model != 9) {
160 dprintk("no Elan SC520 processor found!\n"); 164 dprintk("no Elan SC520 processor found!\n");
161 return -ENODEV; 165 return -ENODEV;
162 } 166 }
163 cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1); 167 cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1);
164 if(!cpuctl) { 168 if (!cpuctl) {
165 printk(KERN_ERR "sc520_freq: error: failed to remap memory\n"); 169 printk(KERN_ERR "sc520_freq: error: failed to remap memory\n");
166 return -ENOMEM; 170 return -ENOMEM;
167 } 171 }
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
index f08998278a3a..c9f1fdc02830 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -390,14 +390,14 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
390 enable it if not. */ 390 enable it if not. */
391 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 391 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
392 392
393 if (!(l & (1<<16))) { 393 if (!(l & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
394 l |= (1<<16); 394 l |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP;
395 dprintk("trying to enable Enhanced SpeedStep (%x)\n", l); 395 dprintk("trying to enable Enhanced SpeedStep (%x)\n", l);
396 wrmsr(MSR_IA32_MISC_ENABLE, l, h); 396 wrmsr(MSR_IA32_MISC_ENABLE, l, h);
397 397
398 /* check to see if it stuck */ 398 /* check to see if it stuck */
399 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 399 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
400 if (!(l & (1<<16))) { 400 if (!(l & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
401 printk(KERN_INFO PFX 401 printk(KERN_INFO PFX
402 "couldn't enable Enhanced SpeedStep\n"); 402 "couldn't enable Enhanced SpeedStep\n");
403 return -ENODEV; 403 return -ENODEV;
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
index dedc1e98f168..8bbb11adb315 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
@@ -39,7 +39,7 @@ static struct pci_dev *speedstep_chipset_dev;
39 39
40/* speedstep_processor 40/* speedstep_processor
41 */ 41 */
42static unsigned int speedstep_processor = 0; 42static unsigned int speedstep_processor;
43 43
44static u32 pmbase; 44static u32 pmbase;
45 45
@@ -54,7 +54,8 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
54}; 54};
55 55
56 56
57#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-ich", msg) 57#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
58 "speedstep-ich", msg)
58 59
59 60
60/** 61/**
@@ -62,7 +63,7 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
62 * 63 *
63 * Returns: -ENODEV if no register could be found 64 * Returns: -ENODEV if no register could be found
64 */ 65 */
65static int speedstep_find_register (void) 66static int speedstep_find_register(void)
66{ 67{
67 if (!speedstep_chipset_dev) 68 if (!speedstep_chipset_dev)
68 return -ENODEV; 69 return -ENODEV;
@@ -90,7 +91,7 @@ static int speedstep_find_register (void)
90 * 91 *
91 * Tries to change the SpeedStep state. 92 * Tries to change the SpeedStep state.
92 */ 93 */
93static void speedstep_set_state (unsigned int state) 94static void speedstep_set_state(unsigned int state)
94{ 95{
95 u8 pm2_blk; 96 u8 pm2_blk;
96 u8 value; 97 u8 value;
@@ -133,11 +134,11 @@ static void speedstep_set_state (unsigned int state)
133 134
134 dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); 135 dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value);
135 136
136 if (state == (value & 0x1)) { 137 if (state == (value & 0x1))
137 dprintk("change to %u MHz succeeded\n", (speedstep_get_processor_frequency(speedstep_processor) / 1000)); 138 dprintk("change to %u MHz succeeded\n",
138 } else { 139 speedstep_get_frequency(speedstep_processor) / 1000);
139 printk (KERN_ERR "cpufreq: change failed - I/O error\n"); 140 else
140 } 141 printk(KERN_ERR "cpufreq: change failed - I/O error\n");
141 142
142 return; 143 return;
143} 144}
@@ -149,7 +150,7 @@ static void speedstep_set_state (unsigned int state)
149 * Tries to activate the SpeedStep status and control registers. 150 * Tries to activate the SpeedStep status and control registers.
150 * Returns -EINVAL on an unsupported chipset, and zero on success. 151 * Returns -EINVAL on an unsupported chipset, and zero on success.
151 */ 152 */
152static int speedstep_activate (void) 153static int speedstep_activate(void)
153{ 154{
154 u16 value = 0; 155 u16 value = 0;
155 156
@@ -175,20 +176,18 @@ static int speedstep_activate (void)
175 * functions. Returns the SPEEDSTEP_CHIPSET_-number for the detected 176 * functions. Returns the SPEEDSTEP_CHIPSET_-number for the detected
176 * chipset, or zero on failure. 177 * chipset, or zero on failure.
177 */ 178 */
178static unsigned int speedstep_detect_chipset (void) 179static unsigned int speedstep_detect_chipset(void)
179{ 180{
180 speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL, 181 speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
181 PCI_DEVICE_ID_INTEL_82801DB_12, 182 PCI_DEVICE_ID_INTEL_82801DB_12,
182 PCI_ANY_ID, 183 PCI_ANY_ID, PCI_ANY_ID,
183 PCI_ANY_ID,
184 NULL); 184 NULL);
185 if (speedstep_chipset_dev) 185 if (speedstep_chipset_dev)
186 return 4; /* 4-M */ 186 return 4; /* 4-M */
187 187
188 speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL, 188 speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
189 PCI_DEVICE_ID_INTEL_82801CA_12, 189 PCI_DEVICE_ID_INTEL_82801CA_12,
190 PCI_ANY_ID, 190 PCI_ANY_ID, PCI_ANY_ID,
191 PCI_ANY_ID,
192 NULL); 191 NULL);
193 if (speedstep_chipset_dev) 192 if (speedstep_chipset_dev)
194 return 3; /* 3-M */ 193 return 3; /* 3-M */
@@ -196,8 +195,7 @@ static unsigned int speedstep_detect_chipset (void)
196 195
197 speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL, 196 speedstep_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
198 PCI_DEVICE_ID_INTEL_82801BA_10, 197 PCI_DEVICE_ID_INTEL_82801BA_10,
199 PCI_ANY_ID, 198 PCI_ANY_ID, PCI_ANY_ID,
200 PCI_ANY_ID,
201 NULL); 199 NULL);
202 if (speedstep_chipset_dev) { 200 if (speedstep_chipset_dev) {
203 /* speedstep.c causes lockups on Dell Inspirons 8000 and 201 /* speedstep.c causes lockups on Dell Inspirons 8000 and
@@ -208,8 +206,7 @@ static unsigned int speedstep_detect_chipset (void)
208 206
209 hostbridge = pci_get_subsys(PCI_VENDOR_ID_INTEL, 207 hostbridge = pci_get_subsys(PCI_VENDOR_ID_INTEL,
210 PCI_DEVICE_ID_INTEL_82815_MC, 208 PCI_DEVICE_ID_INTEL_82815_MC,
211 PCI_ANY_ID, 209 PCI_ANY_ID, PCI_ANY_ID,
212 PCI_ANY_ID,
213 NULL); 210 NULL);
214 211
215 if (!hostbridge) 212 if (!hostbridge)
@@ -236,7 +233,7 @@ static unsigned int _speedstep_get(const struct cpumask *cpus)
236 233
237 cpus_allowed = current->cpus_allowed; 234 cpus_allowed = current->cpus_allowed;
238 set_cpus_allowed_ptr(current, cpus); 235 set_cpus_allowed_ptr(current, cpus);
239 speed = speedstep_get_processor_frequency(speedstep_processor); 236 speed = speedstep_get_frequency(speedstep_processor);
240 set_cpus_allowed_ptr(current, &cpus_allowed); 237 set_cpus_allowed_ptr(current, &cpus_allowed);
241 dprintk("detected %u kHz as current frequency\n", speed); 238 dprintk("detected %u kHz as current frequency\n", speed);
242 return speed; 239 return speed;
@@ -251,11 +248,12 @@ static unsigned int speedstep_get(unsigned int cpu)
251 * speedstep_target - set a new CPUFreq policy 248 * speedstep_target - set a new CPUFreq policy
252 * @policy: new policy 249 * @policy: new policy
253 * @target_freq: the target frequency 250 * @target_freq: the target frequency
254 * @relation: how that frequency relates to achieved frequency (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H) 251 * @relation: how that frequency relates to achieved frequency
252 * (CPUFREQ_RELATION_L or CPUFREQ_RELATION_H)
255 * 253 *
256 * Sets a new CPUFreq policy. 254 * Sets a new CPUFreq policy.
257 */ 255 */
258static int speedstep_target (struct cpufreq_policy *policy, 256static int speedstep_target(struct cpufreq_policy *policy,
259 unsigned int target_freq, 257 unsigned int target_freq,
260 unsigned int relation) 258 unsigned int relation)
261{ 259{
@@ -264,7 +262,8 @@ static int speedstep_target (struct cpufreq_policy *policy,
264 cpumask_t cpus_allowed; 262 cpumask_t cpus_allowed;
265 int i; 263 int i;
266 264
267 if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate)) 265 if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0],
266 target_freq, relation, &newstate))
268 return -EINVAL; 267 return -EINVAL;
269 268
270 freqs.old = _speedstep_get(policy->cpus); 269 freqs.old = _speedstep_get(policy->cpus);
@@ -308,7 +307,7 @@ static int speedstep_target (struct cpufreq_policy *policy,
308 * Limit must be within speedstep_low_freq and speedstep_high_freq, with 307 * Limit must be within speedstep_low_freq and speedstep_high_freq, with
309 * at least one border included. 308 * at least one border included.
310 */ 309 */
311static int speedstep_verify (struct cpufreq_policy *policy) 310static int speedstep_verify(struct cpufreq_policy *policy)
312{ 311{
313 return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]); 312 return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]);
314} 313}
@@ -344,7 +343,8 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
344 return -EIO; 343 return -EIO;
345 344
346 dprintk("currently at %s speed setting - %i MHz\n", 345 dprintk("currently at %s speed setting - %i MHz\n",
347 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high", 346 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
347 ? "low" : "high",
348 (speed / 1000)); 348 (speed / 1000));
349 349
350 /* cpuinfo and default policy values */ 350 /* cpuinfo and default policy values */
@@ -352,9 +352,9 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
352 352
353 result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); 353 result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
354 if (result) 354 if (result)
355 return (result); 355 return result;
356 356
357 cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); 357 cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
358 358
359 return 0; 359 return 0;
360} 360}
@@ -366,7 +366,7 @@ static int speedstep_cpu_exit(struct cpufreq_policy *policy)
366 return 0; 366 return 0;
367} 367}
368 368
369static struct freq_attr* speedstep_attr[] = { 369static struct freq_attr *speedstep_attr[] = {
370 &cpufreq_freq_attr_scaling_available_freqs, 370 &cpufreq_freq_attr_scaling_available_freqs,
371 NULL, 371 NULL,
372}; 372};
@@ -396,13 +396,15 @@ static int __init speedstep_init(void)
396 /* detect processor */ 396 /* detect processor */
397 speedstep_processor = speedstep_detect_processor(); 397 speedstep_processor = speedstep_detect_processor();
398 if (!speedstep_processor) { 398 if (!speedstep_processor) {
399 dprintk("Intel(R) SpeedStep(TM) capable processor not found\n"); 399 dprintk("Intel(R) SpeedStep(TM) capable processor "
400 "not found\n");
400 return -ENODEV; 401 return -ENODEV;
401 } 402 }
402 403
403 /* detect chipset */ 404 /* detect chipset */
404 if (!speedstep_detect_chipset()) { 405 if (!speedstep_detect_chipset()) {
405 dprintk("Intel(R) SpeedStep(TM) for this chipset not (yet) available.\n"); 406 dprintk("Intel(R) SpeedStep(TM) for this chipset not "
407 "(yet) available.\n");
406 return -ENODEV; 408 return -ENODEV;
407 } 409 }
408 410
@@ -431,9 +433,11 @@ static void __exit speedstep_exit(void)
431} 433}
432 434
433 435
434MODULE_AUTHOR ("Dave Jones <davej@redhat.com>, Dominik Brodowski <linux@brodo.de>"); 436MODULE_AUTHOR("Dave Jones <davej@redhat.com>, "
435MODULE_DESCRIPTION ("Speedstep driver for Intel mobile processors on chipsets with ICH-M southbridges."); 437 "Dominik Brodowski <linux@brodo.de>");
436MODULE_LICENSE ("GPL"); 438MODULE_DESCRIPTION("Speedstep driver for Intel mobile processors on chipsets "
439 "with ICH-M southbridges.");
440MODULE_LICENSE("GPL");
437 441
438module_init(speedstep_init); 442module_init(speedstep_init);
439module_exit(speedstep_exit); 443module_exit(speedstep_exit);
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index cdac7d62369b..2e3c6862657b 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
@@ -16,12 +16,16 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17 17
18#include <asm/msr.h> 18#include <asm/msr.h>
19#include <asm/tsc.h>
19#include "speedstep-lib.h" 20#include "speedstep-lib.h"
20 21
21#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-lib", msg) 22#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
23 "speedstep-lib", msg)
24
25#define PFX "speedstep-lib: "
22 26
23#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK 27#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
24static int relaxed_check = 0; 28static int relaxed_check;
25#else 29#else
26#define relaxed_check 0 30#define relaxed_check 0
27#endif 31#endif
@@ -30,14 +34,14 @@ static int relaxed_check = 0;
30 * GET PROCESSOR CORE SPEED IN KHZ * 34 * GET PROCESSOR CORE SPEED IN KHZ *
31 *********************************************************************/ 35 *********************************************************************/
32 36
33static unsigned int pentium3_get_frequency (unsigned int processor) 37static unsigned int pentium3_get_frequency(unsigned int processor)
34{ 38{
35 /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */ 39 /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */
36 struct { 40 struct {
37 unsigned int ratio; /* Frequency Multiplier (x10) */ 41 unsigned int ratio; /* Frequency Multiplier (x10) */
38 u8 bitmap; /* power on configuration bits 42 u8 bitmap; /* power on configuration bits
39 [27, 25:22] (in MSR 0x2a) */ 43 [27, 25:22] (in MSR 0x2a) */
40 } msr_decode_mult [] = { 44 } msr_decode_mult[] = {
41 { 30, 0x01 }, 45 { 30, 0x01 },
42 { 35, 0x05 }, 46 { 35, 0x05 },
43 { 40, 0x02 }, 47 { 40, 0x02 },
@@ -52,7 +56,7 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
52 { 85, 0x26 }, 56 { 85, 0x26 },
53 { 90, 0x20 }, 57 { 90, 0x20 },
54 { 100, 0x2b }, 58 { 100, 0x2b },
55 { 0, 0xff } /* error or unknown value */ 59 { 0, 0xff } /* error or unknown value */
56 }; 60 };
57 61
58 /* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */ 62 /* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */
@@ -60,7 +64,7 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
60 unsigned int value; /* Front Side Bus speed in MHz */ 64 unsigned int value; /* Front Side Bus speed in MHz */
61 u8 bitmap; /* power on configuration bits [18: 19] 65 u8 bitmap; /* power on configuration bits [18: 19]
62 (in MSR 0x2a) */ 66 (in MSR 0x2a) */
63 } msr_decode_fsb [] = { 67 } msr_decode_fsb[] = {
64 { 66, 0x0 }, 68 { 66, 0x0 },
65 { 100, 0x2 }, 69 { 100, 0x2 },
66 { 133, 0x1 }, 70 { 133, 0x1 },
@@ -85,7 +89,7 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
85 } 89 }
86 90
87 /* decode the multiplier */ 91 /* decode the multiplier */
88 if (processor == SPEEDSTEP_PROCESSOR_PIII_C_EARLY) { 92 if (processor == SPEEDSTEP_CPU_PIII_C_EARLY) {
89 dprintk("workaround for early PIIIs\n"); 93 dprintk("workaround for early PIIIs\n");
90 msr_lo &= 0x03c00000; 94 msr_lo &= 0x03c00000;
91 } else 95 } else
@@ -97,9 +101,10 @@ static unsigned int pentium3_get_frequency (unsigned int processor)
97 j++; 101 j++;
98 } 102 }
99 103
100 dprintk("speed is %u\n", (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100)); 104 dprintk("speed is %u\n",
105 (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100));
101 106
102 return (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100); 107 return msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100;
103} 108}
104 109
105 110
@@ -112,20 +117,23 @@ static unsigned int pentiumM_get_frequency(void)
112 117
113 /* see table B-2 of 24547212.pdf */ 118 /* see table B-2 of 24547212.pdf */
114 if (msr_lo & 0x00040000) { 119 if (msr_lo & 0x00040000) {
115 printk(KERN_DEBUG "speedstep-lib: PM - invalid FSB: 0x%x 0x%x\n", msr_lo, msr_tmp); 120 printk(KERN_DEBUG PFX "PM - invalid FSB: 0x%x 0x%x\n",
121 msr_lo, msr_tmp);
116 return 0; 122 return 0;
117 } 123 }
118 124
119 msr_tmp = (msr_lo >> 22) & 0x1f; 125 msr_tmp = (msr_lo >> 22) & 0x1f;
120 dprintk("bits 22-26 are 0x%x, speed is %u\n", msr_tmp, (msr_tmp * 100 * 1000)); 126 dprintk("bits 22-26 are 0x%x, speed is %u\n",
127 msr_tmp, (msr_tmp * 100 * 1000));
121 128
122 return (msr_tmp * 100 * 1000); 129 return msr_tmp * 100 * 1000;
123} 130}
124 131
125static unsigned int pentium_core_get_frequency(void) 132static unsigned int pentium_core_get_frequency(void)
126{ 133{
127 u32 fsb = 0; 134 u32 fsb = 0;
128 u32 msr_lo, msr_tmp; 135 u32 msr_lo, msr_tmp;
136 int ret;
129 137
130 rdmsr(MSR_FSB_FREQ, msr_lo, msr_tmp); 138 rdmsr(MSR_FSB_FREQ, msr_lo, msr_tmp);
131 /* see table B-2 of 25366920.pdf */ 139 /* see table B-2 of 25366920.pdf */
@@ -153,12 +161,15 @@ static unsigned int pentium_core_get_frequency(void)
153 } 161 }
154 162
155 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); 163 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
156 dprintk("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); 164 dprintk("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n",
165 msr_lo, msr_tmp);
157 166
158 msr_tmp = (msr_lo >> 22) & 0x1f; 167 msr_tmp = (msr_lo >> 22) & 0x1f;
159 dprintk("bits 22-26 are 0x%x, speed is %u\n", msr_tmp, (msr_tmp * fsb)); 168 dprintk("bits 22-26 are 0x%x, speed is %u\n",
169 msr_tmp, (msr_tmp * fsb));
160 170
161 return (msr_tmp * fsb); 171 ret = (msr_tmp * fsb);
172 return ret;
162} 173}
163 174
164 175
@@ -167,6 +178,16 @@ static unsigned int pentium4_get_frequency(void)
167 struct cpuinfo_x86 *c = &boot_cpu_data; 178 struct cpuinfo_x86 *c = &boot_cpu_data;
168 u32 msr_lo, msr_hi, mult; 179 u32 msr_lo, msr_hi, mult;
169 unsigned int fsb = 0; 180 unsigned int fsb = 0;
181 unsigned int ret;
182 u8 fsb_code;
183
184 /* Pentium 4 Model 0 and 1 do not have the Core Clock Frequency
185 * to System Bus Frequency Ratio Field in the Processor Frequency
186 * Configuration Register of the MSR. Therefore the current
187 * frequency cannot be calculated and has to be measured.
188 */
189 if (c->x86_model < 2)
190 return cpu_khz;
170 191
171 rdmsr(0x2c, msr_lo, msr_hi); 192 rdmsr(0x2c, msr_lo, msr_hi);
172 193
@@ -177,62 +198,61 @@ static unsigned int pentium4_get_frequency(void)
177 * revision #12 in Table B-1: MSRs in the Pentium 4 and 198 * revision #12 in Table B-1: MSRs in the Pentium 4 and
178 * Intel Xeon Processors, on page B-4 and B-5. 199 * Intel Xeon Processors, on page B-4 and B-5.
179 */ 200 */
180 if (c->x86_model < 2) 201 fsb_code = (msr_lo >> 16) & 0x7;
202 switch (fsb_code) {
203 case 0:
181 fsb = 100 * 1000; 204 fsb = 100 * 1000;
182 else { 205 break;
183 u8 fsb_code = (msr_lo >> 16) & 0x7; 206 case 1:
184 switch (fsb_code) { 207 fsb = 13333 * 10;
185 case 0: 208 break;
186 fsb = 100 * 1000; 209 case 2:
187 break; 210 fsb = 200 * 1000;
188 case 1: 211 break;
189 fsb = 13333 * 10;
190 break;
191 case 2:
192 fsb = 200 * 1000;
193 break;
194 }
195 } 212 }
196 213
197 if (!fsb) 214 if (!fsb)
198 printk(KERN_DEBUG "speedstep-lib: couldn't detect FSB speed. Please send an e-mail to <linux@brodo.de>\n"); 215 printk(KERN_DEBUG PFX "couldn't detect FSB speed. "
216 "Please send an e-mail to <linux@brodo.de>\n");
199 217
200 /* Multiplier. */ 218 /* Multiplier. */
201 mult = msr_lo >> 24; 219 mult = msr_lo >> 24;
202 220
203 dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n", fsb, mult, (fsb * mult)); 221 dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n",
222 fsb, mult, (fsb * mult));
204 223
205 return (fsb * mult); 224 ret = (fsb * mult);
225 return ret;
206} 226}
207 227
208 228
209unsigned int speedstep_get_processor_frequency(unsigned int processor) 229unsigned int speedstep_get_frequency(unsigned int processor)
210{ 230{
211 switch (processor) { 231 switch (processor) {
212 case SPEEDSTEP_PROCESSOR_PCORE: 232 case SPEEDSTEP_CPU_PCORE:
213 return pentium_core_get_frequency(); 233 return pentium_core_get_frequency();
214 case SPEEDSTEP_PROCESSOR_PM: 234 case SPEEDSTEP_CPU_PM:
215 return pentiumM_get_frequency(); 235 return pentiumM_get_frequency();
216 case SPEEDSTEP_PROCESSOR_P4D: 236 case SPEEDSTEP_CPU_P4D:
217 case SPEEDSTEP_PROCESSOR_P4M: 237 case SPEEDSTEP_CPU_P4M:
218 return pentium4_get_frequency(); 238 return pentium4_get_frequency();
219 case SPEEDSTEP_PROCESSOR_PIII_T: 239 case SPEEDSTEP_CPU_PIII_T:
220 case SPEEDSTEP_PROCESSOR_PIII_C: 240 case SPEEDSTEP_CPU_PIII_C:
221 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY: 241 case SPEEDSTEP_CPU_PIII_C_EARLY:
222 return pentium3_get_frequency(processor); 242 return pentium3_get_frequency(processor);
223 default: 243 default:
224 return 0; 244 return 0;
225 }; 245 };
226 return 0; 246 return 0;
227} 247}
228EXPORT_SYMBOL_GPL(speedstep_get_processor_frequency); 248EXPORT_SYMBOL_GPL(speedstep_get_frequency);
229 249
230 250
231/********************************************************************* 251/*********************************************************************
232 * DETECT SPEEDSTEP-CAPABLE PROCESSOR * 252 * DETECT SPEEDSTEP-CAPABLE PROCESSOR *
233 *********************************************************************/ 253 *********************************************************************/
234 254
235unsigned int speedstep_detect_processor (void) 255unsigned int speedstep_detect_processor(void)
236{ 256{
237 struct cpuinfo_x86 *c = &cpu_data(0); 257 struct cpuinfo_x86 *c = &cpu_data(0);
238 u32 ebx, msr_lo, msr_hi; 258 u32 ebx, msr_lo, msr_hi;
@@ -261,7 +281,7 @@ unsigned int speedstep_detect_processor (void)
261 * sample has ebx = 0x0f, production has 0x0e. 281 * sample has ebx = 0x0f, production has 0x0e.
262 */ 282 */
263 if ((ebx == 0x0e) || (ebx == 0x0f)) 283 if ((ebx == 0x0e) || (ebx == 0x0f))
264 return SPEEDSTEP_PROCESSOR_P4M; 284 return SPEEDSTEP_CPU_P4M;
265 break; 285 break;
266 case 7: 286 case 7:
267 /* 287 /*
@@ -272,7 +292,7 @@ unsigned int speedstep_detect_processor (void)
272 * samples are only of B-stepping... 292 * samples are only of B-stepping...
273 */ 293 */
274 if (ebx == 0x0e) 294 if (ebx == 0x0e)
275 return SPEEDSTEP_PROCESSOR_P4M; 295 return SPEEDSTEP_CPU_P4M;
276 break; 296 break;
277 case 9: 297 case 9:
278 /* 298 /*
@@ -288,10 +308,13 @@ unsigned int speedstep_detect_processor (void)
288 * M-P4-Ms may have either ebx=0xe or 0xf [see above] 308 * M-P4-Ms may have either ebx=0xe or 0xf [see above]
289 * M-P4/533 have either ebx=0xe or 0xf. [25317607.pdf] 309 * M-P4/533 have either ebx=0xe or 0xf. [25317607.pdf]
290 * also, M-P4M HTs have ebx=0x8, too 310 * also, M-P4M HTs have ebx=0x8, too
291 * For now, they are distinguished by the model_id string 311 * For now, they are distinguished by the model_id
312 * string
292 */ 313 */
293 if ((ebx == 0x0e) || (strstr(c->x86_model_id,"Mobile Intel(R) Pentium(R) 4") != NULL)) 314 if ((ebx == 0x0e) ||
294 return SPEEDSTEP_PROCESSOR_P4M; 315 (strstr(c->x86_model_id,
316 "Mobile Intel(R) Pentium(R) 4") != NULL))
317 return SPEEDSTEP_CPU_P4M;
295 break; 318 break;
296 default: 319 default:
297 break; 320 break;
@@ -301,7 +324,8 @@ unsigned int speedstep_detect_processor (void)
301 324
302 switch (c->x86_model) { 325 switch (c->x86_model) {
303 case 0x0B: /* Intel PIII [Tualatin] */ 326 case 0x0B: /* Intel PIII [Tualatin] */
304 /* cpuid_ebx(1) is 0x04 for desktop PIII, 0x06 for mobile PIII-M */ 327 /* cpuid_ebx(1) is 0x04 for desktop PIII,
328 * 0x06 for mobile PIII-M */
305 ebx = cpuid_ebx(0x00000001); 329 ebx = cpuid_ebx(0x00000001);
306 dprintk("ebx is %x\n", ebx); 330 dprintk("ebx is %x\n", ebx);
307 331
@@ -313,14 +337,15 @@ unsigned int speedstep_detect_processor (void)
313 /* So far all PIII-M processors support SpeedStep. See 337 /* So far all PIII-M processors support SpeedStep. See
314 * Intel's 24540640.pdf of June 2003 338 * Intel's 24540640.pdf of June 2003
315 */ 339 */
316 return SPEEDSTEP_PROCESSOR_PIII_T; 340 return SPEEDSTEP_CPU_PIII_T;
317 341
318 case 0x08: /* Intel PIII [Coppermine] */ 342 case 0x08: /* Intel PIII [Coppermine] */
319 343
320 /* all mobile PIII Coppermines have FSB 100 MHz 344 /* all mobile PIII Coppermines have FSB 100 MHz
321 * ==> sort out a few desktop PIIIs. */ 345 * ==> sort out a few desktop PIIIs. */
322 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi); 346 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi);
323 dprintk("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n", msr_lo, msr_hi); 347 dprintk("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n",
348 msr_lo, msr_hi);
324 msr_lo &= 0x00c0000; 349 msr_lo &= 0x00c0000;
325 if (msr_lo != 0x0080000) 350 if (msr_lo != 0x0080000)
326 return 0; 351 return 0;
@@ -332,13 +357,15 @@ unsigned int speedstep_detect_processor (void)
332 * bit 56 or 57 is set 357 * bit 56 or 57 is set
333 */ 358 */
334 rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi); 359 rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi);
335 dprintk("Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi); 360 dprintk("Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n",
336 if ((msr_hi & (1<<18)) && (relaxed_check ? 1 : (msr_hi & (3<<24)))) { 361 msr_lo, msr_hi);
362 if ((msr_hi & (1<<18)) &&
363 (relaxed_check ? 1 : (msr_hi & (3<<24)))) {
337 if (c->x86_mask == 0x01) { 364 if (c->x86_mask == 0x01) {
338 dprintk("early PIII version\n"); 365 dprintk("early PIII version\n");
339 return SPEEDSTEP_PROCESSOR_PIII_C_EARLY; 366 return SPEEDSTEP_CPU_PIII_C_EARLY;
340 } else 367 } else
341 return SPEEDSTEP_PROCESSOR_PIII_C; 368 return SPEEDSTEP_CPU_PIII_C;
342 } 369 }
343 370
344 default: 371 default:
@@ -369,7 +396,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
369 dprintk("trying to determine both speeds\n"); 396 dprintk("trying to determine both speeds\n");
370 397
371 /* get current speed */ 398 /* get current speed */
372 prev_speed = speedstep_get_processor_frequency(processor); 399 prev_speed = speedstep_get_frequency(processor);
373 if (!prev_speed) 400 if (!prev_speed)
374 return -EIO; 401 return -EIO;
375 402
@@ -379,7 +406,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
379 406
380 /* switch to low state */ 407 /* switch to low state */
381 set_state(SPEEDSTEP_LOW); 408 set_state(SPEEDSTEP_LOW);
382 *low_speed = speedstep_get_processor_frequency(processor); 409 *low_speed = speedstep_get_frequency(processor);
383 if (!*low_speed) { 410 if (!*low_speed) {
384 ret = -EIO; 411 ret = -EIO;
385 goto out; 412 goto out;
@@ -398,7 +425,7 @@ unsigned int speedstep_get_freqs(unsigned int processor,
398 if (transition_latency) 425 if (transition_latency)
399 do_gettimeofday(&tv2); 426 do_gettimeofday(&tv2);
400 427
401 *high_speed = speedstep_get_processor_frequency(processor); 428 *high_speed = speedstep_get_frequency(processor);
402 if (!*high_speed) { 429 if (!*high_speed) {
403 ret = -EIO; 430 ret = -EIO;
404 goto out; 431 goto out;
@@ -426,9 +453,12 @@ unsigned int speedstep_get_freqs(unsigned int processor,
426 /* check if the latency measurement is too high or too low 453 /* check if the latency measurement is too high or too low
427 * and set it to a safe value (500uSec) in that case 454 * and set it to a safe value (500uSec) in that case
428 */ 455 */
429 if (*transition_latency > 10000000 || *transition_latency < 50000) { 456 if (*transition_latency > 10000000 ||
430 printk (KERN_WARNING "speedstep: frequency transition measured seems out of " 457 *transition_latency < 50000) {
431 "range (%u nSec), falling back to a safe one of %u nSec.\n", 458 printk(KERN_WARNING PFX "frequency transition "
459 "measured seems out of range (%u "
460 "nSec), falling back to a safe one of"
461 "%u nSec.\n",
432 *transition_latency, 500000); 462 *transition_latency, 500000);
433 *transition_latency = 500000; 463 *transition_latency = 500000;
434 } 464 }
@@ -436,15 +466,16 @@ unsigned int speedstep_get_freqs(unsigned int processor,
436 466
437out: 467out:
438 local_irq_restore(flags); 468 local_irq_restore(flags);
439 return (ret); 469 return ret;
440} 470}
441EXPORT_SYMBOL_GPL(speedstep_get_freqs); 471EXPORT_SYMBOL_GPL(speedstep_get_freqs);
442 472
443#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK 473#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
444module_param(relaxed_check, int, 0444); 474module_param(relaxed_check, int, 0444);
445MODULE_PARM_DESC(relaxed_check, "Don't do all checks for speedstep capability."); 475MODULE_PARM_DESC(relaxed_check,
476 "Don't do all checks for speedstep capability.");
446#endif 477#endif
447 478
448MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>"); 479MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
449MODULE_DESCRIPTION ("Library for Intel SpeedStep 1 or 2 cpufreq drivers."); 480MODULE_DESCRIPTION("Library for Intel SpeedStep 1 or 2 cpufreq drivers.");
450MODULE_LICENSE ("GPL"); 481MODULE_LICENSE("GPL");
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h
index b11bcc608cac..2b6c04e5a304 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h
@@ -12,17 +12,17 @@
12 12
13/* processors */ 13/* processors */
14 14
15#define SPEEDSTEP_PROCESSOR_PIII_C_EARLY 0x00000001 /* Coppermine core */ 15#define SPEEDSTEP_CPU_PIII_C_EARLY 0x00000001 /* Coppermine core */
16#define SPEEDSTEP_PROCESSOR_PIII_C 0x00000002 /* Coppermine core */ 16#define SPEEDSTEP_CPU_PIII_C 0x00000002 /* Coppermine core */
17#define SPEEDSTEP_PROCESSOR_PIII_T 0x00000003 /* Tualatin core */ 17#define SPEEDSTEP_CPU_PIII_T 0x00000003 /* Tualatin core */
18#define SPEEDSTEP_PROCESSOR_P4M 0x00000004 /* P4-M */ 18#define SPEEDSTEP_CPU_P4M 0x00000004 /* P4-M */
19 19
20/* the following processors are not speedstep-capable and are not auto-detected 20/* the following processors are not speedstep-capable and are not auto-detected
21 * in speedstep_detect_processor(). However, their speed can be detected using 21 * in speedstep_detect_processor(). However, their speed can be detected using
22 * the speedstep_get_processor_frequency() call. */ 22 * the speedstep_get_frequency() call. */
23#define SPEEDSTEP_PROCESSOR_PM 0xFFFFFF03 /* Pentium M */ 23#define SPEEDSTEP_CPU_PM 0xFFFFFF03 /* Pentium M */
24#define SPEEDSTEP_PROCESSOR_P4D 0xFFFFFF04 /* desktop P4 */ 24#define SPEEDSTEP_CPU_P4D 0xFFFFFF04 /* desktop P4 */
25#define SPEEDSTEP_PROCESSOR_PCORE 0xFFFFFF05 /* Core */ 25#define SPEEDSTEP_CPU_PCORE 0xFFFFFF05 /* Core */
26 26
27/* speedstep states -- only two of them */ 27/* speedstep states -- only two of them */
28 28
@@ -34,7 +34,7 @@
34extern unsigned int speedstep_detect_processor (void); 34extern unsigned int speedstep_detect_processor (void);
35 35
36/* detect the current speed (in khz) of the processor */ 36/* detect the current speed (in khz) of the processor */
37extern unsigned int speedstep_get_processor_frequency(unsigned int processor); 37extern unsigned int speedstep_get_frequency(unsigned int processor);
38 38
39 39
40/* detect the low and high speeds of the processor. The callback 40/* detect the low and high speeds of the processor. The callback
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
index 8a85c93bd62a..befea088e4f5 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
@@ -19,8 +19,8 @@
19#include <linux/cpufreq.h> 19#include <linux/cpufreq.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/io.h>
22#include <asm/ist.h> 23#include <asm/ist.h>
23#include <asm/io.h>
24 24
25#include "speedstep-lib.h" 25#include "speedstep-lib.h"
26 26
@@ -30,12 +30,12 @@
30 * If user gives it, these are used. 30 * If user gives it, these are used.
31 * 31 *
32 */ 32 */
33static int smi_port = 0; 33static int smi_port;
34static int smi_cmd = 0; 34static int smi_cmd;
35static unsigned int smi_sig = 0; 35static unsigned int smi_sig;
36 36
37/* info about the processor */ 37/* info about the processor */
38static unsigned int speedstep_processor = 0; 38static unsigned int speedstep_processor;
39 39
40/* 40/*
41 * There are only two frequency states for each processor. Values 41 * There are only two frequency states for each processor. Values
@@ -56,12 +56,13 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
56 * of DMA activity going on? */ 56 * of DMA activity going on? */
57#define SMI_TRIES 5 57#define SMI_TRIES 5
58 58
59#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-smi", msg) 59#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
60 "speedstep-smi", msg)
60 61
61/** 62/**
62 * speedstep_smi_ownership 63 * speedstep_smi_ownership
63 */ 64 */
64static int speedstep_smi_ownership (void) 65static int speedstep_smi_ownership(void)
65{ 66{
66 u32 command, result, magic, dummy; 67 u32 command, result, magic, dummy;
67 u32 function = GET_SPEEDSTEP_OWNER; 68 u32 function = GET_SPEEDSTEP_OWNER;
@@ -70,16 +71,18 @@ static int speedstep_smi_ownership (void)
70 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 71 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
71 magic = virt_to_phys(magic_data); 72 magic = virt_to_phys(magic_data);
72 73
73 dprintk("trying to obtain ownership with command %x at port %x\n", command, smi_port); 74 dprintk("trying to obtain ownership with command %x at port %x\n",
75 command, smi_port);
74 76
75 __asm__ __volatile__( 77 __asm__ __volatile__(
76 "push %%ebp\n" 78 "push %%ebp\n"
77 "out %%al, (%%dx)\n" 79 "out %%al, (%%dx)\n"
78 "pop %%ebp\n" 80 "pop %%ebp\n"
79 : "=D" (result), "=a" (dummy), "=b" (dummy), "=c" (dummy), "=d" (dummy), 81 : "=D" (result),
80 "=S" (dummy) 82 "=a" (dummy), "=b" (dummy), "=c" (dummy), "=d" (dummy),
83 "=S" (dummy)
81 : "a" (command), "b" (function), "c" (0), "d" (smi_port), 84 : "a" (command), "b" (function), "c" (0), "d" (smi_port),
82 "D" (0), "S" (magic) 85 "D" (0), "S" (magic)
83 : "memory" 86 : "memory"
84 ); 87 );
85 88
@@ -97,10 +100,10 @@ static int speedstep_smi_ownership (void)
97 * even hangs [cf. bugme.osdl.org # 1422] on earlier systems. Empirical testing 100 * even hangs [cf. bugme.osdl.org # 1422] on earlier systems. Empirical testing
98 * shows that the latter occurs if !(ist_info.event & 0xFFFF). 101 * shows that the latter occurs if !(ist_info.event & 0xFFFF).
99 */ 102 */
100static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high) 103static int speedstep_smi_get_freqs(unsigned int *low, unsigned int *high)
101{ 104{
102 u32 command, result = 0, edi, high_mhz, low_mhz, dummy; 105 u32 command, result = 0, edi, high_mhz, low_mhz, dummy;
103 u32 state=0; 106 u32 state = 0;
104 u32 function = GET_SPEEDSTEP_FREQS; 107 u32 function = GET_SPEEDSTEP_FREQS;
105 108
106 if (!(ist_info.event & 0xFFFF)) { 109 if (!(ist_info.event & 0xFFFF)) {
@@ -110,17 +113,25 @@ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
110 113
111 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 114 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
112 115
113 dprintk("trying to determine frequencies with command %x at port %x\n", command, smi_port); 116 dprintk("trying to determine frequencies with command %x at port %x\n",
117 command, smi_port);
114 118
115 __asm__ __volatile__( 119 __asm__ __volatile__(
116 "push %%ebp\n" 120 "push %%ebp\n"
117 "out %%al, (%%dx)\n" 121 "out %%al, (%%dx)\n"
118 "pop %%ebp" 122 "pop %%ebp"
119 : "=a" (result), "=b" (high_mhz), "=c" (low_mhz), "=d" (state), "=D" (edi), "=S" (dummy) 123 : "=a" (result),
120 : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0), "D" (0) 124 "=b" (high_mhz),
125 "=c" (low_mhz),
126 "=d" (state), "=D" (edi), "=S" (dummy)
127 : "a" (command),
128 "b" (function),
129 "c" (state),
130 "d" (smi_port), "S" (0), "D" (0)
121 ); 131 );
122 132
123 dprintk("result %x, low_freq %u, high_freq %u\n", result, low_mhz, high_mhz); 133 dprintk("result %x, low_freq %u, high_freq %u\n",
134 result, low_mhz, high_mhz);
124 135
125 /* abort if results are obviously incorrect... */ 136 /* abort if results are obviously incorrect... */
126 if ((high_mhz + low_mhz) < 600) 137 if ((high_mhz + low_mhz) < 600)
@@ -137,26 +148,30 @@ static int speedstep_smi_get_freqs (unsigned int *low, unsigned int *high)
137 * @state: processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH) 148 * @state: processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
138 * 149 *
139 */ 150 */
140static int speedstep_get_state (void) 151static int speedstep_get_state(void)
141{ 152{
142 u32 function=GET_SPEEDSTEP_STATE; 153 u32 function = GET_SPEEDSTEP_STATE;
143 u32 result, state, edi, command, dummy; 154 u32 result, state, edi, command, dummy;
144 155
145 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 156 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
146 157
147 dprintk("trying to determine current setting with command %x at port %x\n", command, smi_port); 158 dprintk("trying to determine current setting with command %x "
159 "at port %x\n", command, smi_port);
148 160
149 __asm__ __volatile__( 161 __asm__ __volatile__(
150 "push %%ebp\n" 162 "push %%ebp\n"
151 "out %%al, (%%dx)\n" 163 "out %%al, (%%dx)\n"
152 "pop %%ebp\n" 164 "pop %%ebp\n"
153 : "=a" (result), "=b" (state), "=D" (edi), "=c" (dummy), "=d" (dummy), "=S" (dummy) 165 : "=a" (result),
154 : "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0), "D" (0) 166 "=b" (state), "=D" (edi),
167 "=c" (dummy), "=d" (dummy), "=S" (dummy)
168 : "a" (command), "b" (function), "c" (0),
169 "d" (smi_port), "S" (0), "D" (0)
155 ); 170 );
156 171
157 dprintk("state is %x, result is %x\n", state, result); 172 dprintk("state is %x, result is %x\n", state, result);
158 173
159 return (state & 1); 174 return state & 1;
160} 175}
161 176
162 177
@@ -165,11 +180,11 @@ static int speedstep_get_state (void)
165 * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH) 180 * @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
166 * 181 *
167 */ 182 */
168static void speedstep_set_state (unsigned int state) 183static void speedstep_set_state(unsigned int state)
169{ 184{
170 unsigned int result = 0, command, new_state, dummy; 185 unsigned int result = 0, command, new_state, dummy;
171 unsigned long flags; 186 unsigned long flags;
172 unsigned int function=SET_SPEEDSTEP_STATE; 187 unsigned int function = SET_SPEEDSTEP_STATE;
173 unsigned int retry = 0; 188 unsigned int retry = 0;
174 189
175 if (state > 0x1) 190 if (state > 0x1)
@@ -180,11 +195,14 @@ static void speedstep_set_state (unsigned int state)
180 195
181 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 196 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
182 197
183 dprintk("trying to set frequency to state %u with command %x at port %x\n", state, command, smi_port); 198 dprintk("trying to set frequency to state %u "
199 "with command %x at port %x\n",
200 state, command, smi_port);
184 201
185 do { 202 do {
186 if (retry) { 203 if (retry) {
187 dprintk("retry %u, previous result %u, waiting...\n", retry, result); 204 dprintk("retry %u, previous result %u, waiting...\n",
205 retry, result);
188 mdelay(retry * 50); 206 mdelay(retry * 50);
189 } 207 }
190 retry++; 208 retry++;
@@ -192,20 +210,26 @@ static void speedstep_set_state (unsigned int state)
192 "push %%ebp\n" 210 "push %%ebp\n"
193 "out %%al, (%%dx)\n" 211 "out %%al, (%%dx)\n"
194 "pop %%ebp" 212 "pop %%ebp"
195 : "=b" (new_state), "=D" (result), "=c" (dummy), "=a" (dummy), 213 : "=b" (new_state), "=D" (result),
196 "=d" (dummy), "=S" (dummy) 214 "=c" (dummy), "=a" (dummy),
197 : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0), "D" (0) 215 "=d" (dummy), "=S" (dummy)
216 : "a" (command), "b" (function), "c" (state),
217 "d" (smi_port), "S" (0), "D" (0)
198 ); 218 );
199 } while ((new_state != state) && (retry <= SMI_TRIES)); 219 } while ((new_state != state) && (retry <= SMI_TRIES));
200 220
201 /* enable IRQs */ 221 /* enable IRQs */
202 local_irq_restore(flags); 222 local_irq_restore(flags);
203 223
204 if (new_state == state) { 224 if (new_state == state)
205 dprintk("change to %u MHz succeeded after %u tries with result %u\n", (speedstep_freqs[new_state].frequency / 1000), retry, result); 225 dprintk("change to %u MHz succeeded after %u tries "
206 } else { 226 "with result %u\n",
207 printk(KERN_ERR "cpufreq: change to state %u failed with new_state %u and result %u\n", state, new_state, result); 227 (speedstep_freqs[new_state].frequency / 1000),
208 } 228 retry, result);
229 else
230 printk(KERN_ERR "cpufreq: change to state %u "
231 "failed with new_state %u and result %u\n",
232 state, new_state, result);
209 233
210 return; 234 return;
211} 235}
@@ -219,13 +243,14 @@ static void speedstep_set_state (unsigned int state)
219 * 243 *
220 * Sets a new CPUFreq policy/freq. 244 * Sets a new CPUFreq policy/freq.
221 */ 245 */
222static int speedstep_target (struct cpufreq_policy *policy, 246static int speedstep_target(struct cpufreq_policy *policy,
223 unsigned int target_freq, unsigned int relation) 247 unsigned int target_freq, unsigned int relation)
224{ 248{
225 unsigned int newstate = 0; 249 unsigned int newstate = 0;
226 struct cpufreq_freqs freqs; 250 struct cpufreq_freqs freqs;
227 251
228 if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate)) 252 if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0],
253 target_freq, relation, &newstate))
229 return -EINVAL; 254 return -EINVAL;
230 255
231 freqs.old = speedstep_freqs[speedstep_get_state()].frequency; 256 freqs.old = speedstep_freqs[speedstep_get_state()].frequency;
@@ -250,7 +275,7 @@ static int speedstep_target (struct cpufreq_policy *policy,
250 * Limit must be within speedstep_low_freq and speedstep_high_freq, with 275 * Limit must be within speedstep_low_freq and speedstep_high_freq, with
251 * at least one border included. 276 * at least one border included.
252 */ 277 */
253static int speedstep_verify (struct cpufreq_policy *policy) 278static int speedstep_verify(struct cpufreq_policy *policy)
254{ 279{
255 return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]); 280 return cpufreq_frequency_table_verify(policy, &speedstep_freqs[0]);
256} 281}
@@ -259,7 +284,8 @@ static int speedstep_verify (struct cpufreq_policy *policy)
259static int speedstep_cpu_init(struct cpufreq_policy *policy) 284static int speedstep_cpu_init(struct cpufreq_policy *policy)
260{ 285{
261 int result; 286 int result;
262 unsigned int speed,state; 287 unsigned int speed, state;
288 unsigned int *low, *high;
263 289
264 /* capability check */ 290 /* capability check */
265 if (policy->cpu != 0) 291 if (policy->cpu != 0)
@@ -272,19 +298,23 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
272 } 298 }
273 299
274 /* detect low and high frequency */ 300 /* detect low and high frequency */
275 result = speedstep_smi_get_freqs(&speedstep_freqs[SPEEDSTEP_LOW].frequency, 301 low = &speedstep_freqs[SPEEDSTEP_LOW].frequency;
276 &speedstep_freqs[SPEEDSTEP_HIGH].frequency); 302 high = &speedstep_freqs[SPEEDSTEP_HIGH].frequency;
303
304 result = speedstep_smi_get_freqs(low, high);
277 if (result) { 305 if (result) {
278 /* fall back to speedstep_lib.c dection mechanism: try both states out */ 306 /* fall back to speedstep_lib.c dection mechanism:
279 dprintk("could not detect low and high frequencies by SMI call.\n"); 307 * try both states out */
308 dprintk("could not detect low and high frequencies "
309 "by SMI call.\n");
280 result = speedstep_get_freqs(speedstep_processor, 310 result = speedstep_get_freqs(speedstep_processor,
281 &speedstep_freqs[SPEEDSTEP_LOW].frequency, 311 low, high,
282 &speedstep_freqs[SPEEDSTEP_HIGH].frequency,
283 NULL, 312 NULL,
284 &speedstep_set_state); 313 &speedstep_set_state);
285 314
286 if (result) { 315 if (result) {
287 dprintk("could not detect two different speeds -- aborting.\n"); 316 dprintk("could not detect two different speeds"
317 " -- aborting.\n");
288 return result; 318 return result;
289 } else 319 } else
290 dprintk("workaround worked.\n"); 320 dprintk("workaround worked.\n");
@@ -295,7 +325,8 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
295 speed = speedstep_freqs[state].frequency; 325 speed = speedstep_freqs[state].frequency;
296 326
297 dprintk("currently at %s speed setting - %i MHz\n", 327 dprintk("currently at %s speed setting - %i MHz\n",
298 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) ? "low" : "high", 328 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
329 ? "low" : "high",
299 (speed / 1000)); 330 (speed / 1000));
300 331
301 /* cpuinfo and default policy values */ 332 /* cpuinfo and default policy values */
@@ -304,7 +335,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
304 335
305 result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); 336 result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs);
306 if (result) 337 if (result)
307 return (result); 338 return result;
308 339
309 cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); 340 cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
310 341
@@ -321,7 +352,7 @@ static unsigned int speedstep_get(unsigned int cpu)
321{ 352{
322 if (cpu) 353 if (cpu)
323 return -ENODEV; 354 return -ENODEV;
324 return speedstep_get_processor_frequency(speedstep_processor); 355 return speedstep_get_frequency(speedstep_processor);
325} 356}
326 357
327 358
@@ -335,7 +366,7 @@ static int speedstep_resume(struct cpufreq_policy *policy)
335 return result; 366 return result;
336} 367}
337 368
338static struct freq_attr* speedstep_attr[] = { 369static struct freq_attr *speedstep_attr[] = {
339 &cpufreq_freq_attr_scaling_available_freqs, 370 &cpufreq_freq_attr_scaling_available_freqs,
340 NULL, 371 NULL,
341}; 372};
@@ -364,21 +395,23 @@ static int __init speedstep_init(void)
364 speedstep_processor = speedstep_detect_processor(); 395 speedstep_processor = speedstep_detect_processor();
365 396
366 switch (speedstep_processor) { 397 switch (speedstep_processor) {
367 case SPEEDSTEP_PROCESSOR_PIII_T: 398 case SPEEDSTEP_CPU_PIII_T:
368 case SPEEDSTEP_PROCESSOR_PIII_C: 399 case SPEEDSTEP_CPU_PIII_C:
369 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY: 400 case SPEEDSTEP_CPU_PIII_C_EARLY:
370 break; 401 break;
371 default: 402 default:
372 speedstep_processor = 0; 403 speedstep_processor = 0;
373 } 404 }
374 405
375 if (!speedstep_processor) { 406 if (!speedstep_processor) {
376 dprintk ("No supported Intel CPU detected.\n"); 407 dprintk("No supported Intel CPU detected.\n");
377 return -ENODEV; 408 return -ENODEV;
378 } 409 }
379 410
380 dprintk("signature:0x%.8lx, command:0x%.8lx, event:0x%.8lx, perf_level:0x%.8lx.\n", 411 dprintk("signature:0x%.8lx, command:0x%.8lx, "
381 ist_info.signature, ist_info.command, ist_info.event, ist_info.perf_level); 412 "event:0x%.8lx, perf_level:0x%.8lx.\n",
413 ist_info.signature, ist_info.command,
414 ist_info.event, ist_info.perf_level);
382 415
383 /* Error if no IST-SMI BIOS or no PARM 416 /* Error if no IST-SMI BIOS or no PARM
384 sig= 'ISGE' aka 'Intel Speedstep Gate E' */ 417 sig= 'ISGE' aka 'Intel Speedstep Gate E' */
@@ -416,17 +449,20 @@ static void __exit speedstep_exit(void)
416 cpufreq_unregister_driver(&speedstep_driver); 449 cpufreq_unregister_driver(&speedstep_driver);
417} 450}
418 451
419module_param(smi_port, int, 0444); 452module_param(smi_port, int, 0444);
420module_param(smi_cmd, int, 0444); 453module_param(smi_cmd, int, 0444);
421module_param(smi_sig, uint, 0444); 454module_param(smi_sig, uint, 0444);
422 455
423MODULE_PARM_DESC(smi_port, "Override the BIOS-given IST port with this value -- Intel's default setting is 0xb2"); 456MODULE_PARM_DESC(smi_port, "Override the BIOS-given IST port with this value "
424MODULE_PARM_DESC(smi_cmd, "Override the BIOS-given IST command with this value -- Intel's default setting is 0x82"); 457 "-- Intel's default setting is 0xb2");
425MODULE_PARM_DESC(smi_sig, "Set to 1 to fake the IST signature when using the SMI interface."); 458MODULE_PARM_DESC(smi_cmd, "Override the BIOS-given IST command with this value "
459 "-- Intel's default setting is 0x82");
460MODULE_PARM_DESC(smi_sig, "Set to 1 to fake the IST signature when using the "
461 "SMI interface.");
426 462
427MODULE_AUTHOR ("Hiroshi Miura"); 463MODULE_AUTHOR("Hiroshi Miura");
428MODULE_DESCRIPTION ("Speedstep driver for IST applet SMI interface."); 464MODULE_DESCRIPTION("Speedstep driver for IST applet SMI interface.");
429MODULE_LICENSE ("GPL"); 465MODULE_LICENSE("GPL");
430 466
431module_init(speedstep_init); 467module_init(speedstep_init);
432module_exit(speedstep_exit); 468module_exit(speedstep_exit);
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 24ff26a38ade..1a89a2b68d15 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -4,6 +4,7 @@
4#include <linux/string.h> 4#include <linux/string.h>
5#include <linux/bitops.h> 5#include <linux/bitops.h>
6#include <linux/smp.h> 6#include <linux/smp.h>
7#include <linux/sched.h>
7#include <linux/thread_info.h> 8#include <linux/thread_info.h>
8#include <linux/module.h> 9#include <linux/module.h>
9 10
@@ -24,7 +25,6 @@
24#ifdef CONFIG_X86_LOCAL_APIC 25#ifdef CONFIG_X86_LOCAL_APIC
25#include <asm/mpspec.h> 26#include <asm/mpspec.h>
26#include <asm/apic.h> 27#include <asm/apic.h>
27#include <mach_apic.h>
28#endif 28#endif
29 29
30static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) 30static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
@@ -56,13 +56,30 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
56 56
57 /* 57 /*
58 * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate 58 * c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate
59 * with P/T states and does not stop in deep C-states 59 * with P/T states and does not stop in deep C-states.
60 *
61 * It is also reliable across cores and sockets. (but not across
62 * cabinets - we turn it off in that case explicitly.)
60 */ 63 */
61 if (c->x86_power & (1 << 8)) { 64 if (c->x86_power & (1 << 8)) {
62 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); 65 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
63 set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); 66 set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
67 set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE);
68 sched_clock_stable = 1;
64 } 69 }
65 70
71 /*
72 * There is a known erratum on Pentium III and Core Solo
73 * and Core Duo CPUs.
74 * " Page with PAT set to WC while associated MTRR is UC
75 * may consolidate to UC "
76 * Because of this erratum, it is better to stick with
77 * setting WC in MTRR rather than using PAT on these CPUs.
78 *
79 * Enable PAT WC only on P4, Core 2 or later CPUs.
80 */
81 if (c->x86 == 6 && c->x86_model < 15)
82 clear_cpu_cap(c, X86_FEATURE_PAT);
66} 83}
67 84
68#ifdef CONFIG_X86_32 85#ifdef CONFIG_X86_32
@@ -135,10 +152,10 @@ static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
135 */ 152 */
136 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { 153 if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) {
137 rdmsr(MSR_IA32_MISC_ENABLE, lo, hi); 154 rdmsr(MSR_IA32_MISC_ENABLE, lo, hi);
138 if ((lo & (1<<9)) == 0) { 155 if ((lo & MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE) == 0) {
139 printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); 156 printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n");
140 printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n"); 157 printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n");
141 lo |= (1<<9); /* Disable hw prefetching */ 158 lo |= MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE;
142 wrmsr (MSR_IA32_MISC_ENABLE, lo, hi); 159 wrmsr (MSR_IA32_MISC_ENABLE, lo, hi);
143 } 160 }
144 } 161 }
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index da299eb85fc0..7293508d8f5c 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -147,7 +147,16 @@ struct _cpuid4_info {
147 union _cpuid4_leaf_ecx ecx; 147 union _cpuid4_leaf_ecx ecx;
148 unsigned long size; 148 unsigned long size;
149 unsigned long can_disable; 149 unsigned long can_disable;
150 cpumask_t shared_cpu_map; /* future?: only cpus/node is needed */ 150 DECLARE_BITMAP(shared_cpu_map, NR_CPUS);
151};
152
153/* subset of above _cpuid4_info w/o shared_cpu_map */
154struct _cpuid4_info_regs {
155 union _cpuid4_leaf_eax eax;
156 union _cpuid4_leaf_ebx ebx;
157 union _cpuid4_leaf_ecx ecx;
158 unsigned long size;
159 unsigned long can_disable;
151}; 160};
152 161
153#ifdef CONFIG_PCI 162#ifdef CONFIG_PCI
@@ -278,7 +287,7 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
278} 287}
279 288
280static void __cpuinit 289static void __cpuinit
281amd_check_l3_disable(int index, struct _cpuid4_info *this_leaf) 290amd_check_l3_disable(int index, struct _cpuid4_info_regs *this_leaf)
282{ 291{
283 if (index < 3) 292 if (index < 3)
284 return; 293 return;
@@ -286,7 +295,8 @@ amd_check_l3_disable(int index, struct _cpuid4_info *this_leaf)
286} 295}
287 296
288static int 297static int
289__cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf) 298__cpuinit cpuid4_cache_lookup_regs(int index,
299 struct _cpuid4_info_regs *this_leaf)
290{ 300{
291 union _cpuid4_leaf_eax eax; 301 union _cpuid4_leaf_eax eax;
292 union _cpuid4_leaf_ebx ebx; 302 union _cpuid4_leaf_ebx ebx;
@@ -314,6 +324,15 @@ __cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)
314 return 0; 324 return 0;
315} 325}
316 326
327static int
328__cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)
329{
330 struct _cpuid4_info_regs *leaf_regs =
331 (struct _cpuid4_info_regs *)this_leaf;
332
333 return cpuid4_cache_lookup_regs(index, leaf_regs);
334}
335
317static int __cpuinit find_num_cache_leaves(void) 336static int __cpuinit find_num_cache_leaves(void)
318{ 337{
319 unsigned int eax, ebx, ecx, edx; 338 unsigned int eax, ebx, ecx, edx;
@@ -353,11 +372,10 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
353 * parameters cpuid leaf to find the cache details 372 * parameters cpuid leaf to find the cache details
354 */ 373 */
355 for (i = 0; i < num_cache_leaves; i++) { 374 for (i = 0; i < num_cache_leaves; i++) {
356 struct _cpuid4_info this_leaf; 375 struct _cpuid4_info_regs this_leaf;
357
358 int retval; 376 int retval;
359 377
360 retval = cpuid4_cache_lookup(i, &this_leaf); 378 retval = cpuid4_cache_lookup_regs(i, &this_leaf);
361 if (retval >= 0) { 379 if (retval >= 0) {
362 switch(this_leaf.eax.split.level) { 380 switch(this_leaf.eax.split.level) {
363 case 1: 381 case 1:
@@ -506,17 +524,20 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
506 num_threads_sharing = 1 + this_leaf->eax.split.num_threads_sharing; 524 num_threads_sharing = 1 + this_leaf->eax.split.num_threads_sharing;
507 525
508 if (num_threads_sharing == 1) 526 if (num_threads_sharing == 1)
509 cpu_set(cpu, this_leaf->shared_cpu_map); 527 cpumask_set_cpu(cpu, to_cpumask(this_leaf->shared_cpu_map));
510 else { 528 else {
511 index_msb = get_count_order(num_threads_sharing); 529 index_msb = get_count_order(num_threads_sharing);
512 530
513 for_each_online_cpu(i) { 531 for_each_online_cpu(i) {
514 if (cpu_data(i).apicid >> index_msb == 532 if (cpu_data(i).apicid >> index_msb ==
515 c->apicid >> index_msb) { 533 c->apicid >> index_msb) {
516 cpu_set(i, this_leaf->shared_cpu_map); 534 cpumask_set_cpu(i,
535 to_cpumask(this_leaf->shared_cpu_map));
517 if (i != cpu && per_cpu(cpuid4_info, i)) { 536 if (i != cpu && per_cpu(cpuid4_info, i)) {
518 sibling_leaf = CPUID4_INFO_IDX(i, index); 537 sibling_leaf =
519 cpu_set(cpu, sibling_leaf->shared_cpu_map); 538 CPUID4_INFO_IDX(i, index);
539 cpumask_set_cpu(cpu, to_cpumask(
540 sibling_leaf->shared_cpu_map));
520 } 541 }
521 } 542 }
522 } 543 }
@@ -528,9 +549,10 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index)
528 int sibling; 549 int sibling;
529 550
530 this_leaf = CPUID4_INFO_IDX(cpu, index); 551 this_leaf = CPUID4_INFO_IDX(cpu, index);
531 for_each_cpu_mask_nr(sibling, this_leaf->shared_cpu_map) { 552 for_each_cpu(sibling, to_cpumask(this_leaf->shared_cpu_map)) {
532 sibling_leaf = CPUID4_INFO_IDX(sibling, index); 553 sibling_leaf = CPUID4_INFO_IDX(sibling, index);
533 cpu_clear(cpu, sibling_leaf->shared_cpu_map); 554 cpumask_clear_cpu(cpu,
555 to_cpumask(sibling_leaf->shared_cpu_map));
534 } 556 }
535} 557}
536#else 558#else
@@ -635,8 +657,9 @@ static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf,
635 int n = 0; 657 int n = 0;
636 658
637 if (len > 1) { 659 if (len > 1) {
638 cpumask_t *mask = &this_leaf->shared_cpu_map; 660 const struct cpumask *mask;
639 661
662 mask = to_cpumask(this_leaf->shared_cpu_map);
640 n = type? 663 n = type?
641 cpulist_scnprintf(buf, len-2, mask) : 664 cpulist_scnprintf(buf, len-2, mask) :
642 cpumask_scnprintf(buf, len-2, mask); 665 cpumask_scnprintf(buf, len-2, mask);
@@ -699,7 +722,8 @@ static struct pci_dev *get_k8_northbridge(int node)
699 722
700static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf) 723static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf)
701{ 724{
702 int node = cpu_to_node(first_cpu(this_leaf->shared_cpu_map)); 725 const struct cpumask *mask = to_cpumask(this_leaf->shared_cpu_map);
726 int node = cpu_to_node(cpumask_first(mask));
703 struct pci_dev *dev = NULL; 727 struct pci_dev *dev = NULL;
704 ssize_t ret = 0; 728 ssize_t ret = 0;
705 int i; 729 int i;
@@ -733,7 +757,8 @@ static ssize_t
733store_cache_disable(struct _cpuid4_info *this_leaf, const char *buf, 757store_cache_disable(struct _cpuid4_info *this_leaf, const char *buf,
734 size_t count) 758 size_t count)
735{ 759{
736 int node = cpu_to_node(first_cpu(this_leaf->shared_cpu_map)); 760 const struct cpumask *mask = to_cpumask(this_leaf->shared_cpu_map);
761 int node = cpu_to_node(cpumask_first(mask));
737 struct pci_dev *dev = NULL; 762 struct pci_dev *dev = NULL;
738 unsigned int ret, index, val; 763 unsigned int ret, index, val;
739 764
@@ -878,7 +903,7 @@ err_out:
878 return -ENOMEM; 903 return -ENOMEM;
879} 904}
880 905
881static cpumask_t cache_dev_map = CPU_MASK_NONE; 906static DECLARE_BITMAP(cache_dev_map, NR_CPUS);
882 907
883/* Add/Remove cache interface for CPU device */ 908/* Add/Remove cache interface for CPU device */
884static int __cpuinit cache_add_dev(struct sys_device * sys_dev) 909static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
@@ -918,7 +943,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
918 } 943 }
919 kobject_uevent(&(this_object->kobj), KOBJ_ADD); 944 kobject_uevent(&(this_object->kobj), KOBJ_ADD);
920 } 945 }
921 cpu_set(cpu, cache_dev_map); 946 cpumask_set_cpu(cpu, to_cpumask(cache_dev_map));
922 947
923 kobject_uevent(per_cpu(cache_kobject, cpu), KOBJ_ADD); 948 kobject_uevent(per_cpu(cache_kobject, cpu), KOBJ_ADD);
924 return 0; 949 return 0;
@@ -931,9 +956,9 @@ static void __cpuinit cache_remove_dev(struct sys_device * sys_dev)
931 956
932 if (per_cpu(cpuid4_info, cpu) == NULL) 957 if (per_cpu(cpuid4_info, cpu) == NULL)
933 return; 958 return;
934 if (!cpu_isset(cpu, cache_dev_map)) 959 if (!cpumask_test_cpu(cpu, to_cpumask(cache_dev_map)))
935 return; 960 return;
936 cpu_clear(cpu, cache_dev_map); 961 cpumask_clear_cpu(cpu, to_cpumask(cache_dev_map));
937 962
938 for (i = 0; i < num_cache_leaves; i++) 963 for (i = 0; i < num_cache_leaves; i++)
939 kobject_put(&(INDEX_KOBJECT_PTR(cpu,i)->kobj)); 964 kobject_put(&(INDEX_KOBJECT_PTR(cpu,i)->kobj));
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
index f2ee0ae29bd6..9817506dd469 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
@@ -67,7 +67,7 @@ static struct threshold_block threshold_defaults = {
67struct threshold_bank { 67struct threshold_bank {
68 struct kobject *kobj; 68 struct kobject *kobj;
69 struct threshold_block *blocks; 69 struct threshold_block *blocks;
70 cpumask_t cpus; 70 cpumask_var_t cpus;
71}; 71};
72static DEFINE_PER_CPU(struct threshold_bank *, threshold_banks[NR_BANKS]); 72static DEFINE_PER_CPU(struct threshold_bank *, threshold_banks[NR_BANKS]);
73 73
@@ -481,7 +481,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
481 481
482#ifdef CONFIG_SMP 482#ifdef CONFIG_SMP
483 if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */ 483 if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */
484 i = first_cpu(per_cpu(cpu_core_map, cpu)); 484 i = cpumask_first(&per_cpu(cpu_core_map, cpu));
485 485
486 /* first core not up yet */ 486 /* first core not up yet */
487 if (cpu_data(i).cpu_core_id) 487 if (cpu_data(i).cpu_core_id)
@@ -501,7 +501,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
501 if (err) 501 if (err)
502 goto out; 502 goto out;
503 503
504 b->cpus = per_cpu(cpu_core_map, cpu); 504 cpumask_copy(b->cpus, &per_cpu(cpu_core_map, cpu));
505 per_cpu(threshold_banks, cpu)[bank] = b; 505 per_cpu(threshold_banks, cpu)[bank] = b;
506 goto out; 506 goto out;
507 } 507 }
@@ -512,15 +512,20 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
512 err = -ENOMEM; 512 err = -ENOMEM;
513 goto out; 513 goto out;
514 } 514 }
515 if (!alloc_cpumask_var(&b->cpus, GFP_KERNEL)) {
516 kfree(b);
517 err = -ENOMEM;
518 goto out;
519 }
515 520
516 b->kobj = kobject_create_and_add(name, &per_cpu(device_mce, cpu).kobj); 521 b->kobj = kobject_create_and_add(name, &per_cpu(device_mce, cpu).kobj);
517 if (!b->kobj) 522 if (!b->kobj)
518 goto out_free; 523 goto out_free;
519 524
520#ifndef CONFIG_SMP 525#ifndef CONFIG_SMP
521 b->cpus = CPU_MASK_ALL; 526 cpumask_setall(b->cpus);
522#else 527#else
523 b->cpus = per_cpu(cpu_core_map, cpu); 528 cpumask_copy(b->cpus, &per_cpu(cpu_core_map, cpu));
524#endif 529#endif
525 530
526 per_cpu(threshold_banks, cpu)[bank] = b; 531 per_cpu(threshold_banks, cpu)[bank] = b;
@@ -529,7 +534,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
529 if (err) 534 if (err)
530 goto out_free; 535 goto out_free;
531 536
532 for_each_cpu_mask_nr(i, b->cpus) { 537 for_each_cpu(i, b->cpus) {
533 if (i == cpu) 538 if (i == cpu)
534 continue; 539 continue;
535 540
@@ -545,6 +550,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
545 550
546out_free: 551out_free:
547 per_cpu(threshold_banks, cpu)[bank] = NULL; 552 per_cpu(threshold_banks, cpu)[bank] = NULL;
553 free_cpumask_var(b->cpus);
548 kfree(b); 554 kfree(b);
549out: 555out:
550 return err; 556 return err;
@@ -619,7 +625,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
619#endif 625#endif
620 626
621 /* remove all sibling symlinks before unregistering */ 627 /* remove all sibling symlinks before unregistering */
622 for_each_cpu_mask_nr(i, b->cpus) { 628 for_each_cpu(i, b->cpus) {
623 if (i == cpu) 629 if (i == cpu)
624 continue; 630 continue;
625 631
@@ -632,6 +638,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
632free_out: 638free_out:
633 kobject_del(b->kobj); 639 kobject_del(b->kobj);
634 kobject_put(b->kobj); 640 kobject_put(b->kobj);
641 free_cpumask_var(b->cpus);
635 kfree(b); 642 kfree(b);
636 per_cpu(threshold_banks, cpu)[bank] = NULL; 643 per_cpu(threshold_banks, cpu)[bank] = NULL;
637} 644}
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
index f44c36624360..aa5e287c98e0 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
@@ -7,6 +7,7 @@
7#include <linux/interrupt.h> 7#include <linux/interrupt.h>
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/apic.h>
10#include <asm/msr.h> 11#include <asm/msr.h>
11#include <asm/mce.h> 12#include <asm/mce.h>
12#include <asm/hw_irq.h> 13#include <asm/hw_irq.h>
@@ -48,13 +49,13 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
48 */ 49 */
49 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 50 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
50 h = apic_read(APIC_LVTTHMR); 51 h = apic_read(APIC_LVTTHMR);
51 if ((l & (1 << 3)) && (h & APIC_DM_SMI)) { 52 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
52 printk(KERN_DEBUG 53 printk(KERN_DEBUG
53 "CPU%d: Thermal monitoring handled by SMI\n", cpu); 54 "CPU%d: Thermal monitoring handled by SMI\n", cpu);
54 return; 55 return;
55 } 56 }
56 57
57 if (cpu_has(c, X86_FEATURE_TM2) && (l & (1 << 13))) 58 if (cpu_has(c, X86_FEATURE_TM2) && (l & MSR_IA32_MISC_ENABLE_TM2))
58 tm2 = 1; 59 tm2 = 1;
59 60
60 if (h & APIC_VECTOR_MASK) { 61 if (h & APIC_VECTOR_MASK) {
@@ -72,7 +73,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
72 wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03, h); 73 wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03, h);
73 74
74 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 75 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
75 wrmsr(MSR_IA32_MISC_ENABLE, l | (1 << 3), h); 76 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);
76 77
77 l = apic_read(APIC_LVTTHMR); 78 l = apic_read(APIC_LVTTHMR);
78 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED); 79 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
diff --git a/arch/x86/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c
index 9b60fce09f75..f53bdcbaf382 100644
--- a/arch/x86/kernel/cpu/mcheck/p4.c
+++ b/arch/x86/kernel/cpu/mcheck/p4.c
@@ -85,7 +85,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
85 */ 85 */
86 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 86 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
87 h = apic_read(APIC_LVTTHMR); 87 h = apic_read(APIC_LVTTHMR);
88 if ((l & (1<<3)) && (h & APIC_DM_SMI)) { 88 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
89 printk(KERN_DEBUG "CPU%d: Thermal monitoring handled by SMI\n", 89 printk(KERN_DEBUG "CPU%d: Thermal monitoring handled by SMI\n",
90 cpu); 90 cpu);
91 return; /* -EBUSY */ 91 return; /* -EBUSY */
@@ -111,7 +111,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
111 vendor_thermal_interrupt = intel_thermal_interrupt; 111 vendor_thermal_interrupt = intel_thermal_interrupt;
112 112
113 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 113 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
114 wrmsr(MSR_IA32_MISC_ENABLE, l | (1<<3), h); 114 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);
115 115
116 l = apic_read(APIC_LVTTHMR); 116 l = apic_read(APIC_LVTTHMR);
117 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED); 117 apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 9abd48b22674..f6c70a164e32 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -19,7 +19,7 @@
19#include <linux/nmi.h> 19#include <linux/nmi.h>
20#include <linux/kprobes.h> 20#include <linux/kprobes.h>
21 21
22#include <asm/apic.h> 22#include <asm/genapic.h>
23#include <asm/intel_arch_perfmon.h> 23#include <asm/intel_arch_perfmon.h>
24 24
25struct nmi_watchdog_ctlblk { 25struct nmi_watchdog_ctlblk {
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 01b1244ef1c0..d67e0e48bc2d 100644
--- a/arch/x86/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
@@ -7,11 +7,10 @@
7/* 7/*
8 * Get CPU information for use by the procfs. 8 * Get CPU information for use by the procfs.
9 */ 9 */
10#ifdef CONFIG_X86_32
11static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c, 10static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c,
12 unsigned int cpu) 11 unsigned int cpu)
13{ 12{
14#ifdef CONFIG_X86_HT 13#ifdef CONFIG_SMP
15 if (c->x86_max_cores * smp_num_siblings > 1) { 14 if (c->x86_max_cores * smp_num_siblings > 1) {
16 seq_printf(m, "physical id\t: %d\n", c->phys_proc_id); 15 seq_printf(m, "physical id\t: %d\n", c->phys_proc_id);
17 seq_printf(m, "siblings\t: %d\n", 16 seq_printf(m, "siblings\t: %d\n",
@@ -24,6 +23,7 @@ static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c,
24#endif 23#endif
25} 24}
26 25
26#ifdef CONFIG_X86_32
27static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c) 27static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
28{ 28{
29 /* 29 /*
@@ -50,22 +50,6 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
50 c->wp_works_ok ? "yes" : "no"); 50 c->wp_works_ok ? "yes" : "no");
51} 51}
52#else 52#else
53static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c,
54 unsigned int cpu)
55{
56#ifdef CONFIG_SMP
57 if (c->x86_max_cores * smp_num_siblings > 1) {
58 seq_printf(m, "physical id\t: %d\n", c->phys_proc_id);
59 seq_printf(m, "siblings\t: %d\n",
60 cpus_weight(per_cpu(cpu_core_map, cpu)));
61 seq_printf(m, "core id\t\t: %d\n", c->cpu_core_id);
62 seq_printf(m, "cpu cores\t: %d\n", c->booted_cores);
63 seq_printf(m, "apicid\t\t: %d\n", c->apicid);
64 seq_printf(m, "initial apicid\t: %d\n", c->initial_apicid);
65 }
66#endif
67}
68
69static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c) 53static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
70{ 54{
71 seq_printf(m, 55 seq_printf(m,
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index c689d19e35ab..ff958248e61d 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -24,12 +24,10 @@
24#include <asm/apic.h> 24#include <asm/apic.h>
25#include <asm/hpet.h> 25#include <asm/hpet.h>
26#include <linux/kdebug.h> 26#include <linux/kdebug.h>
27#include <asm/smp.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 30
31#include <mach_ipi.h>
32
33 31
34#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) 32#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
35 33
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index c0852291b623..dd2130b0fb3e 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -100,7 +100,7 @@ print_context_stack(struct thread_info *tinfo,
100 frame = frame->next_frame; 100 frame = frame->next_frame;
101 bp = (unsigned long) frame; 101 bp = (unsigned long) frame;
102 } else { 102 } else {
103 ops->address(data, addr, bp == 0); 103 ops->address(data, addr, 0);
104 } 104 }
105 print_ftrace_graph_addr(addr, data, ops, tinfo, graph); 105 print_ftrace_graph_addr(addr, data, ops, tinfo, graph);
106 } 106 }
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index c302d0707048..d35db5993fd6 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -106,7 +106,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
106 const struct stacktrace_ops *ops, void *data) 106 const struct stacktrace_ops *ops, void *data)
107{ 107{
108 const unsigned cpu = get_cpu(); 108 const unsigned cpu = get_cpu();
109 unsigned long *irqstack_end = (unsigned long *)cpu_pda(cpu)->irqstackptr; 109 unsigned long *irq_stack_end =
110 (unsigned long *)per_cpu(irq_stack_ptr, cpu);
110 unsigned used = 0; 111 unsigned used = 0;
111 struct thread_info *tinfo; 112 struct thread_info *tinfo;
112 int graph = 0; 113 int graph = 0;
@@ -160,23 +161,23 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
160 stack = (unsigned long *) estack_end[-2]; 161 stack = (unsigned long *) estack_end[-2];
161 continue; 162 continue;
162 } 163 }
163 if (irqstack_end) { 164 if (irq_stack_end) {
164 unsigned long *irqstack; 165 unsigned long *irq_stack;
165 irqstack = irqstack_end - 166 irq_stack = irq_stack_end -
166 (IRQSTACKSIZE - 64) / sizeof(*irqstack); 167 (IRQ_STACK_SIZE - 64) / sizeof(*irq_stack);
167 168
168 if (stack >= irqstack && stack < irqstack_end) { 169 if (stack >= irq_stack && stack < irq_stack_end) {
169 if (ops->stack(data, "IRQ") < 0) 170 if (ops->stack(data, "IRQ") < 0)
170 break; 171 break;
171 bp = print_context_stack(tinfo, stack, bp, 172 bp = print_context_stack(tinfo, stack, bp,
172 ops, data, irqstack_end, &graph); 173 ops, data, irq_stack_end, &graph);
173 /* 174 /*
174 * We link to the next stack (which would be 175 * We link to the next stack (which would be
175 * the process stack normally) the last 176 * the process stack normally) the last
176 * pointer (index -1 to end) in the IRQ stack: 177 * pointer (index -1 to end) in the IRQ stack:
177 */ 178 */
178 stack = (unsigned long *) (irqstack_end[-1]); 179 stack = (unsigned long *) (irq_stack_end[-1]);
179 irqstack_end = NULL; 180 irq_stack_end = NULL;
180 ops->stack(data, "EOI"); 181 ops->stack(data, "EOI");
181 continue; 182 continue;
182 } 183 }
@@ -199,10 +200,10 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
199 unsigned long *stack; 200 unsigned long *stack;
200 int i; 201 int i;
201 const int cpu = smp_processor_id(); 202 const int cpu = smp_processor_id();
202 unsigned long *irqstack_end = 203 unsigned long *irq_stack_end =
203 (unsigned long *) (cpu_pda(cpu)->irqstackptr); 204 (unsigned long *)(per_cpu(irq_stack_ptr, cpu));
204 unsigned long *irqstack = 205 unsigned long *irq_stack =
205 (unsigned long *) (cpu_pda(cpu)->irqstackptr - IRQSTACKSIZE); 206 (unsigned long *)(per_cpu(irq_stack_ptr, cpu) - IRQ_STACK_SIZE);
206 207
207 /* 208 /*
208 * debugging aid: "show_stack(NULL, NULL);" prints the 209 * debugging aid: "show_stack(NULL, NULL);" prints the
@@ -218,9 +219,9 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
218 219
219 stack = sp; 220 stack = sp;
220 for (i = 0; i < kstack_depth_to_print; i++) { 221 for (i = 0; i < kstack_depth_to_print; i++) {
221 if (stack >= irqstack && stack <= irqstack_end) { 222 if (stack >= irq_stack && stack <= irq_stack_end) {
222 if (stack == irqstack_end) { 223 if (stack == irq_stack_end) {
223 stack = (unsigned long *) (irqstack_end[-1]); 224 stack = (unsigned long *) (irq_stack_end[-1]);
224 printk(" <EOI> "); 225 printk(" <EOI> ");
225 } 226 }
226 } else { 227 } else {
@@ -241,7 +242,7 @@ void show_registers(struct pt_regs *regs)
241 int i; 242 int i;
242 unsigned long sp; 243 unsigned long sp;
243 const int cpu = smp_processor_id(); 244 const int cpu = smp_processor_id();
244 struct task_struct *cur = cpu_pda(cpu)->pcurrent; 245 struct task_struct *cur = current;
245 246
246 sp = regs->sp; 247 sp = regs->sp;
247 printk("CPU %d ", cpu); 248 printk("CPU %d ", cpu);
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index e85826829cf2..508bec1cee27 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -858,6 +858,9 @@ void __init reserve_early_overlap_ok(u64 start, u64 end, char *name)
858 */ 858 */
859void __init reserve_early(u64 start, u64 end, char *name) 859void __init reserve_early(u64 start, u64 end, char *name)
860{ 860{
861 if (start >= end)
862 return;
863
861 drop_overlaps_that_are_ok(start, end); 864 drop_overlaps_that_are_ok(start, end);
862 __reserve_early(start, end, name, 0); 865 __reserve_early(start, end, name, 0);
863} 866}
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 504ad198e4ad..639ad98238a2 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -13,8 +13,8 @@
13#include <asm/setup.h> 13#include <asm/setup.h>
14#include <xen/hvc-console.h> 14#include <xen/hvc-console.h>
15#include <asm/pci-direct.h> 15#include <asm/pci-direct.h>
16#include <asm/pgtable.h>
17#include <asm/fixmap.h> 16#include <asm/fixmap.h>
17#include <asm/pgtable.h>
18#include <linux/usb/ehci_def.h> 18#include <linux/usb/ehci_def.h>
19 19
20/* Simple VGA output */ 20/* Simple VGA output */
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c
index eb1ef3b67dd5..1736acc4d7aa 100644
--- a/arch/x86/kernel/efi.c
+++ b/arch/x86/kernel/efi.c
@@ -366,10 +366,12 @@ void __init efi_init(void)
366 SMBIOS_TABLE_GUID)) { 366 SMBIOS_TABLE_GUID)) {
367 efi.smbios = config_tables[i].table; 367 efi.smbios = config_tables[i].table;
368 printk(" SMBIOS=0x%lx ", config_tables[i].table); 368 printk(" SMBIOS=0x%lx ", config_tables[i].table);
369#ifdef CONFIG_X86_UV
369 } else if (!efi_guidcmp(config_tables[i].guid, 370 } else if (!efi_guidcmp(config_tables[i].guid,
370 UV_SYSTEM_TABLE_GUID)) { 371 UV_SYSTEM_TABLE_GUID)) {
371 efi.uv_systab = config_tables[i].table; 372 efi.uv_systab = config_tables[i].table;
372 printk(" UVsystab=0x%lx ", config_tables[i].table); 373 printk(" UVsystab=0x%lx ", config_tables[i].table);
374#endif
373 } else if (!efi_guidcmp(config_tables[i].guid, 375 } else if (!efi_guidcmp(config_tables[i].guid,
374 HCDP_TABLE_GUID)) { 376 HCDP_TABLE_GUID)) {
375 efi.hcdp = config_tables[i].table; 377 efi.hcdp = config_tables[i].table;
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c
index cb783b92c50c..22c3b7828c50 100644
--- a/arch/x86/kernel/efi_64.c
+++ b/arch/x86/kernel/efi_64.c
@@ -36,6 +36,7 @@
36#include <asm/proto.h> 36#include <asm/proto.h>
37#include <asm/efi.h> 37#include <asm/efi.h>
38#include <asm/cacheflush.h> 38#include <asm/cacheflush.h>
39#include <asm/fixmap.h>
39 40
40static pgd_t save_pgd __initdata; 41static pgd_t save_pgd __initdata;
41static unsigned long efi_flags __initdata; 42static unsigned long efi_flags __initdata;
diff --git a/arch/x86/kernel/efi_stub_32.S b/arch/x86/kernel/efi_stub_32.S
index ef00bb77d7e4..fbe66e626c09 100644
--- a/arch/x86/kernel/efi_stub_32.S
+++ b/arch/x86/kernel/efi_stub_32.S
@@ -6,7 +6,7 @@
6 */ 6 */
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/page.h> 9#include <asm/page_types.h>
10 10
11/* 11/*
12 * efi_call_phys(void *, ...) is a function with variable parameters. 12 * efi_call_phys(void *, ...) is a function with variable parameters.
@@ -113,6 +113,7 @@ ENTRY(efi_call_phys)
113 movl (%edx), %ecx 113 movl (%edx), %ecx
114 pushl %ecx 114 pushl %ecx
115 ret 115 ret
116ENDPROC(efi_call_phys)
116.previous 117.previous
117 118
118.data 119.data
diff --git a/arch/x86/kernel/efi_stub_64.S b/arch/x86/kernel/efi_stub_64.S
index 99b47d48c9f4..4c07ccab8146 100644
--- a/arch/x86/kernel/efi_stub_64.S
+++ b/arch/x86/kernel/efi_stub_64.S
@@ -41,6 +41,7 @@ ENTRY(efi_call0)
41 addq $32, %rsp 41 addq $32, %rsp
42 RESTORE_XMM 42 RESTORE_XMM
43 ret 43 ret
44ENDPROC(efi_call0)
44 45
45ENTRY(efi_call1) 46ENTRY(efi_call1)
46 SAVE_XMM 47 SAVE_XMM
@@ -50,6 +51,7 @@ ENTRY(efi_call1)
50 addq $32, %rsp 51 addq $32, %rsp
51 RESTORE_XMM 52 RESTORE_XMM
52 ret 53 ret
54ENDPROC(efi_call1)
53 55
54ENTRY(efi_call2) 56ENTRY(efi_call2)
55 SAVE_XMM 57 SAVE_XMM
@@ -59,6 +61,7 @@ ENTRY(efi_call2)
59 addq $32, %rsp 61 addq $32, %rsp
60 RESTORE_XMM 62 RESTORE_XMM
61 ret 63 ret
64ENDPROC(efi_call2)
62 65
63ENTRY(efi_call3) 66ENTRY(efi_call3)
64 SAVE_XMM 67 SAVE_XMM
@@ -69,6 +72,7 @@ ENTRY(efi_call3)
69 addq $32, %rsp 72 addq $32, %rsp
70 RESTORE_XMM 73 RESTORE_XMM
71 ret 74 ret
75ENDPROC(efi_call3)
72 76
73ENTRY(efi_call4) 77ENTRY(efi_call4)
74 SAVE_XMM 78 SAVE_XMM
@@ -80,6 +84,7 @@ ENTRY(efi_call4)
80 addq $32, %rsp 84 addq $32, %rsp
81 RESTORE_XMM 85 RESTORE_XMM
82 ret 86 ret
87ENDPROC(efi_call4)
83 88
84ENTRY(efi_call5) 89ENTRY(efi_call5)
85 SAVE_XMM 90 SAVE_XMM
@@ -92,6 +97,7 @@ ENTRY(efi_call5)
92 addq $48, %rsp 97 addq $48, %rsp
93 RESTORE_XMM 98 RESTORE_XMM
94 ret 99 ret
100ENDPROC(efi_call5)
95 101
96ENTRY(efi_call6) 102ENTRY(efi_call6)
97 SAVE_XMM 103 SAVE_XMM
@@ -107,3 +113,4 @@ ENTRY(efi_call6)
107 addq $48, %rsp 113 addq $48, %rsp
108 RESTORE_XMM 114 RESTORE_XMM
109 ret 115 ret
116ENDPROC(efi_call6)
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 46469029e9d3..899e8938e79f 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -30,12 +30,13 @@
30 * 1C(%esp) - %ds 30 * 1C(%esp) - %ds
31 * 20(%esp) - %es 31 * 20(%esp) - %es
32 * 24(%esp) - %fs 32 * 24(%esp) - %fs
33 * 28(%esp) - orig_eax 33 * 28(%esp) - %gs saved iff !CONFIG_X86_32_LAZY_GS
34 * 2C(%esp) - %eip 34 * 2C(%esp) - orig_eax
35 * 30(%esp) - %cs 35 * 30(%esp) - %eip
36 * 34(%esp) - %eflags 36 * 34(%esp) - %cs
37 * 38(%esp) - %oldesp 37 * 38(%esp) - %eflags
38 * 3C(%esp) - %oldss 38 * 3C(%esp) - %oldesp
39 * 40(%esp) - %oldss
39 * 40 *
40 * "current" is in register %ebx during any slow entries. 41 * "current" is in register %ebx during any slow entries.
41 */ 42 */
@@ -46,7 +47,7 @@
46#include <asm/errno.h> 47#include <asm/errno.h>
47#include <asm/segment.h> 48#include <asm/segment.h>
48#include <asm/smp.h> 49#include <asm/smp.h>
49#include <asm/page.h> 50#include <asm/page_types.h>
50#include <asm/desc.h> 51#include <asm/desc.h>
51#include <asm/percpu.h> 52#include <asm/percpu.h>
52#include <asm/dwarf2.h> 53#include <asm/dwarf2.h>
@@ -101,121 +102,221 @@
101#define resume_userspace_sig resume_userspace 102#define resume_userspace_sig resume_userspace
102#endif 103#endif
103 104
104#define SAVE_ALL \ 105/*
105 cld; \ 106 * User gs save/restore
106 pushl %fs; \ 107 *
107 CFI_ADJUST_CFA_OFFSET 4;\ 108 * %gs is used for userland TLS and kernel only uses it for stack
108 /*CFI_REL_OFFSET fs, 0;*/\ 109 * canary which is required to be at %gs:20 by gcc. Read the comment
109 pushl %es; \ 110 * at the top of stackprotector.h for more info.
110 CFI_ADJUST_CFA_OFFSET 4;\ 111 *
111 /*CFI_REL_OFFSET es, 0;*/\ 112 * Local labels 98 and 99 are used.
112 pushl %ds; \ 113 */
113 CFI_ADJUST_CFA_OFFSET 4;\ 114#ifdef CONFIG_X86_32_LAZY_GS
114 /*CFI_REL_OFFSET ds, 0;*/\ 115
115 pushl %eax; \ 116 /* unfortunately push/pop can't be no-op */
116 CFI_ADJUST_CFA_OFFSET 4;\ 117.macro PUSH_GS
117 CFI_REL_OFFSET eax, 0;\ 118 pushl $0
118 pushl %ebp; \ 119 CFI_ADJUST_CFA_OFFSET 4
119 CFI_ADJUST_CFA_OFFSET 4;\ 120.endm
120 CFI_REL_OFFSET ebp, 0;\ 121.macro POP_GS pop=0
121 pushl %edi; \ 122 addl $(4 + \pop), %esp
122 CFI_ADJUST_CFA_OFFSET 4;\ 123 CFI_ADJUST_CFA_OFFSET -(4 + \pop)
123 CFI_REL_OFFSET edi, 0;\ 124.endm
124 pushl %esi; \ 125.macro POP_GS_EX
125 CFI_ADJUST_CFA_OFFSET 4;\ 126.endm
126 CFI_REL_OFFSET esi, 0;\ 127
127 pushl %edx; \ 128 /* all the rest are no-op */
128 CFI_ADJUST_CFA_OFFSET 4;\ 129.macro PTGS_TO_GS
129 CFI_REL_OFFSET edx, 0;\ 130.endm
130 pushl %ecx; \ 131.macro PTGS_TO_GS_EX
131 CFI_ADJUST_CFA_OFFSET 4;\ 132.endm
132 CFI_REL_OFFSET ecx, 0;\ 133.macro GS_TO_REG reg
133 pushl %ebx; \ 134.endm
134 CFI_ADJUST_CFA_OFFSET 4;\ 135.macro REG_TO_PTGS reg
135 CFI_REL_OFFSET ebx, 0;\ 136.endm
136 movl $(__USER_DS), %edx; \ 137.macro SET_KERNEL_GS reg
137 movl %edx, %ds; \ 138.endm
138 movl %edx, %es; \ 139
139 movl $(__KERNEL_PERCPU), %edx; \ 140#else /* CONFIG_X86_32_LAZY_GS */
141
142.macro PUSH_GS
143 pushl %gs
144 CFI_ADJUST_CFA_OFFSET 4
145 /*CFI_REL_OFFSET gs, 0*/
146.endm
147
148.macro POP_GS pop=0
14998: popl %gs
150 CFI_ADJUST_CFA_OFFSET -4
151 /*CFI_RESTORE gs*/
152 .if \pop <> 0
153 add $\pop, %esp
154 CFI_ADJUST_CFA_OFFSET -\pop
155 .endif
156.endm
157.macro POP_GS_EX
158.pushsection .fixup, "ax"
15999: movl $0, (%esp)
160 jmp 98b
161.section __ex_table, "a"
162 .align 4
163 .long 98b, 99b
164.popsection
165.endm
166
167.macro PTGS_TO_GS
16898: mov PT_GS(%esp), %gs
169.endm
170.macro PTGS_TO_GS_EX
171.pushsection .fixup, "ax"
17299: movl $0, PT_GS(%esp)
173 jmp 98b
174.section __ex_table, "a"
175 .align 4
176 .long 98b, 99b
177.popsection
178.endm
179
180.macro GS_TO_REG reg
181 movl %gs, \reg
182 /*CFI_REGISTER gs, \reg*/
183.endm
184.macro REG_TO_PTGS reg
185 movl \reg, PT_GS(%esp)
186 /*CFI_REL_OFFSET gs, PT_GS*/
187.endm
188.macro SET_KERNEL_GS reg
189 movl $(__KERNEL_STACK_CANARY), \reg
190 movl \reg, %gs
191.endm
192
193#endif /* CONFIG_X86_32_LAZY_GS */
194
195.macro SAVE_ALL
196 cld
197 PUSH_GS
198 pushl %fs
199 CFI_ADJUST_CFA_OFFSET 4
200 /*CFI_REL_OFFSET fs, 0;*/
201 pushl %es
202 CFI_ADJUST_CFA_OFFSET 4
203 /*CFI_REL_OFFSET es, 0;*/
204 pushl %ds
205 CFI_ADJUST_CFA_OFFSET 4
206 /*CFI_REL_OFFSET ds, 0;*/
207 pushl %eax
208 CFI_ADJUST_CFA_OFFSET 4
209 CFI_REL_OFFSET eax, 0
210 pushl %ebp
211 CFI_ADJUST_CFA_OFFSET 4
212 CFI_REL_OFFSET ebp, 0
213 pushl %edi
214 CFI_ADJUST_CFA_OFFSET 4
215 CFI_REL_OFFSET edi, 0
216 pushl %esi
217 CFI_ADJUST_CFA_OFFSET 4
218 CFI_REL_OFFSET esi, 0
219 pushl %edx
220 CFI_ADJUST_CFA_OFFSET 4
221 CFI_REL_OFFSET edx, 0
222 pushl %ecx
223 CFI_ADJUST_CFA_OFFSET 4
224 CFI_REL_OFFSET ecx, 0
225 pushl %ebx
226 CFI_ADJUST_CFA_OFFSET 4
227 CFI_REL_OFFSET ebx, 0
228 movl $(__USER_DS), %edx
229 movl %edx, %ds
230 movl %edx, %es
231 movl $(__KERNEL_PERCPU), %edx
140 movl %edx, %fs 232 movl %edx, %fs
233 SET_KERNEL_GS %edx
234.endm
141 235
142#define RESTORE_INT_REGS \ 236.macro RESTORE_INT_REGS
143 popl %ebx; \ 237 popl %ebx
144 CFI_ADJUST_CFA_OFFSET -4;\ 238 CFI_ADJUST_CFA_OFFSET -4
145 CFI_RESTORE ebx;\ 239 CFI_RESTORE ebx
146 popl %ecx; \ 240 popl %ecx
147 CFI_ADJUST_CFA_OFFSET -4;\ 241 CFI_ADJUST_CFA_OFFSET -4
148 CFI_RESTORE ecx;\ 242 CFI_RESTORE ecx
149 popl %edx; \ 243 popl %edx
150 CFI_ADJUST_CFA_OFFSET -4;\ 244 CFI_ADJUST_CFA_OFFSET -4
151 CFI_RESTORE edx;\ 245 CFI_RESTORE edx
152 popl %esi; \ 246 popl %esi
153 CFI_ADJUST_CFA_OFFSET -4;\ 247 CFI_ADJUST_CFA_OFFSET -4
154 CFI_RESTORE esi;\ 248 CFI_RESTORE esi
155 popl %edi; \ 249 popl %edi
156 CFI_ADJUST_CFA_OFFSET -4;\ 250 CFI_ADJUST_CFA_OFFSET -4
157 CFI_RESTORE edi;\ 251 CFI_RESTORE edi
158 popl %ebp; \ 252 popl %ebp
159 CFI_ADJUST_CFA_OFFSET -4;\ 253 CFI_ADJUST_CFA_OFFSET -4
160 CFI_RESTORE ebp;\ 254 CFI_RESTORE ebp
161 popl %eax; \ 255 popl %eax
162 CFI_ADJUST_CFA_OFFSET -4;\ 256 CFI_ADJUST_CFA_OFFSET -4
163 CFI_RESTORE eax 257 CFI_RESTORE eax
258.endm
164 259
165#define RESTORE_REGS \ 260.macro RESTORE_REGS pop=0
166 RESTORE_INT_REGS; \ 261 RESTORE_INT_REGS
1671: popl %ds; \ 2621: popl %ds
168 CFI_ADJUST_CFA_OFFSET -4;\ 263 CFI_ADJUST_CFA_OFFSET -4
169 /*CFI_RESTORE ds;*/\ 264 /*CFI_RESTORE ds;*/
1702: popl %es; \ 2652: popl %es
171 CFI_ADJUST_CFA_OFFSET -4;\ 266 CFI_ADJUST_CFA_OFFSET -4
172 /*CFI_RESTORE es;*/\ 267 /*CFI_RESTORE es;*/
1733: popl %fs; \ 2683: popl %fs
174 CFI_ADJUST_CFA_OFFSET -4;\ 269 CFI_ADJUST_CFA_OFFSET -4
175 /*CFI_RESTORE fs;*/\ 270 /*CFI_RESTORE fs;*/
176.pushsection .fixup,"ax"; \ 271 POP_GS \pop
1774: movl $0,(%esp); \ 272.pushsection .fixup, "ax"
178 jmp 1b; \ 2734: movl $0, (%esp)
1795: movl $0,(%esp); \ 274 jmp 1b
180 jmp 2b; \ 2755: movl $0, (%esp)
1816: movl $0,(%esp); \ 276 jmp 2b
182 jmp 3b; \ 2776: movl $0, (%esp)
183.section __ex_table,"a";\ 278 jmp 3b
184 .align 4; \ 279.section __ex_table, "a"
185 .long 1b,4b; \ 280 .align 4
186 .long 2b,5b; \ 281 .long 1b, 4b
187 .long 3b,6b; \ 282 .long 2b, 5b
283 .long 3b, 6b
188.popsection 284.popsection
285 POP_GS_EX
286.endm
189 287
190#define RING0_INT_FRAME \ 288.macro RING0_INT_FRAME
191 CFI_STARTPROC simple;\ 289 CFI_STARTPROC simple
192 CFI_SIGNAL_FRAME;\ 290 CFI_SIGNAL_FRAME
193 CFI_DEF_CFA esp, 3*4;\ 291 CFI_DEF_CFA esp, 3*4
194 /*CFI_OFFSET cs, -2*4;*/\ 292 /*CFI_OFFSET cs, -2*4;*/
195 CFI_OFFSET eip, -3*4 293 CFI_OFFSET eip, -3*4
294.endm
196 295
197#define RING0_EC_FRAME \ 296.macro RING0_EC_FRAME
198 CFI_STARTPROC simple;\ 297 CFI_STARTPROC simple
199 CFI_SIGNAL_FRAME;\ 298 CFI_SIGNAL_FRAME
200 CFI_DEF_CFA esp, 4*4;\ 299 CFI_DEF_CFA esp, 4*4
201 /*CFI_OFFSET cs, -2*4;*/\ 300 /*CFI_OFFSET cs, -2*4;*/
202 CFI_OFFSET eip, -3*4 301 CFI_OFFSET eip, -3*4
302.endm
203 303
204#define RING0_PTREGS_FRAME \ 304.macro RING0_PTREGS_FRAME
205 CFI_STARTPROC simple;\ 305 CFI_STARTPROC simple
206 CFI_SIGNAL_FRAME;\ 306 CFI_SIGNAL_FRAME
207 CFI_DEF_CFA esp, PT_OLDESP-PT_EBX;\ 307 CFI_DEF_CFA esp, PT_OLDESP-PT_EBX
208 /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/\ 308 /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/
209 CFI_OFFSET eip, PT_EIP-PT_OLDESP;\ 309 CFI_OFFSET eip, PT_EIP-PT_OLDESP
210 /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/\ 310 /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/
211 /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/\ 311 /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/
212 CFI_OFFSET eax, PT_EAX-PT_OLDESP;\ 312 CFI_OFFSET eax, PT_EAX-PT_OLDESP
213 CFI_OFFSET ebp, PT_EBP-PT_OLDESP;\ 313 CFI_OFFSET ebp, PT_EBP-PT_OLDESP
214 CFI_OFFSET edi, PT_EDI-PT_OLDESP;\ 314 CFI_OFFSET edi, PT_EDI-PT_OLDESP
215 CFI_OFFSET esi, PT_ESI-PT_OLDESP;\ 315 CFI_OFFSET esi, PT_ESI-PT_OLDESP
216 CFI_OFFSET edx, PT_EDX-PT_OLDESP;\ 316 CFI_OFFSET edx, PT_EDX-PT_OLDESP
217 CFI_OFFSET ecx, PT_ECX-PT_OLDESP;\ 317 CFI_OFFSET ecx, PT_ECX-PT_OLDESP
218 CFI_OFFSET ebx, PT_EBX-PT_OLDESP 318 CFI_OFFSET ebx, PT_EBX-PT_OLDESP
319.endm
219 320
220ENTRY(ret_from_fork) 321ENTRY(ret_from_fork)
221 CFI_STARTPROC 322 CFI_STARTPROC
@@ -362,6 +463,7 @@ sysenter_exit:
362 xorl %ebp,%ebp 463 xorl %ebp,%ebp
363 TRACE_IRQS_ON 464 TRACE_IRQS_ON
3641: mov PT_FS(%esp), %fs 4651: mov PT_FS(%esp), %fs
466 PTGS_TO_GS
365 ENABLE_INTERRUPTS_SYSEXIT 467 ENABLE_INTERRUPTS_SYSEXIT
366 468
367#ifdef CONFIG_AUDITSYSCALL 469#ifdef CONFIG_AUDITSYSCALL
@@ -410,6 +512,7 @@ sysexit_audit:
410 .align 4 512 .align 4
411 .long 1b,2b 513 .long 1b,2b
412.popsection 514.popsection
515 PTGS_TO_GS_EX
413ENDPROC(ia32_sysenter_target) 516ENDPROC(ia32_sysenter_target)
414 517
415 # system call handler stub 518 # system call handler stub
@@ -452,8 +555,7 @@ restore_all:
452restore_nocheck: 555restore_nocheck:
453 TRACE_IRQS_IRET 556 TRACE_IRQS_IRET
454restore_nocheck_notrace: 557restore_nocheck_notrace:
455 RESTORE_REGS 558 RESTORE_REGS 4 # skip orig_eax/error_code
456 addl $4, %esp # skip orig_eax/error_code
457 CFI_ADJUST_CFA_OFFSET -4 559 CFI_ADJUST_CFA_OFFSET -4
458irq_return: 560irq_return:
459 INTERRUPT_RETURN 561 INTERRUPT_RETURN
@@ -595,28 +697,50 @@ syscall_badsys:
595END(syscall_badsys) 697END(syscall_badsys)
596 CFI_ENDPROC 698 CFI_ENDPROC
597 699
598#define FIXUP_ESPFIX_STACK \ 700/*
599 /* since we are on a wrong stack, we cant make it a C code :( */ \ 701 * System calls that need a pt_regs pointer.
600 PER_CPU(gdt_page, %ebx); \ 702 */
601 GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \ 703#define PTREGSCALL(name) \
602 addl %esp, %eax; \ 704 ALIGN; \
603 pushl $__KERNEL_DS; \ 705ptregs_##name: \
604 CFI_ADJUST_CFA_OFFSET 4; \ 706 leal 4(%esp),%eax; \
605 pushl %eax; \ 707 jmp sys_##name;
606 CFI_ADJUST_CFA_OFFSET 4; \ 708
607 lss (%esp), %esp; \ 709PTREGSCALL(iopl)
608 CFI_ADJUST_CFA_OFFSET -8; 710PTREGSCALL(fork)
609#define UNWIND_ESPFIX_STACK \ 711PTREGSCALL(clone)
610 movl %ss, %eax; \ 712PTREGSCALL(vfork)
611 /* see if on espfix stack */ \ 713PTREGSCALL(execve)
612 cmpw $__ESPFIX_SS, %ax; \ 714PTREGSCALL(sigaltstack)
613 jne 27f; \ 715PTREGSCALL(sigreturn)
614 movl $__KERNEL_DS, %eax; \ 716PTREGSCALL(rt_sigreturn)
615 movl %eax, %ds; \ 717PTREGSCALL(vm86)
616 movl %eax, %es; \ 718PTREGSCALL(vm86old)
617 /* switch to normal stack */ \ 719
618 FIXUP_ESPFIX_STACK; \ 720.macro FIXUP_ESPFIX_STACK
61927:; 721 /* since we are on a wrong stack, we cant make it a C code :( */
722 PER_CPU(gdt_page, %ebx)
723 GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah)
724 addl %esp, %eax
725 pushl $__KERNEL_DS
726 CFI_ADJUST_CFA_OFFSET 4
727 pushl %eax
728 CFI_ADJUST_CFA_OFFSET 4
729 lss (%esp), %esp
730 CFI_ADJUST_CFA_OFFSET -8
731.endm
732.macro UNWIND_ESPFIX_STACK
733 movl %ss, %eax
734 /* see if on espfix stack */
735 cmpw $__ESPFIX_SS, %ax
736 jne 27f
737 movl $__KERNEL_DS, %eax
738 movl %eax, %ds
739 movl %eax, %es
740 /* switch to normal stack */
741 FIXUP_ESPFIX_STACK
74227:
743.endm
620 744
621/* 745/*
622 * Build the entry stubs and pointer table with some assembler magic. 746 * Build the entry stubs and pointer table with some assembler magic.
@@ -672,7 +796,7 @@ common_interrupt:
672ENDPROC(common_interrupt) 796ENDPROC(common_interrupt)
673 CFI_ENDPROC 797 CFI_ENDPROC
674 798
675#define BUILD_INTERRUPT(name, nr) \ 799#define BUILD_INTERRUPT3(name, nr, fn) \
676ENTRY(name) \ 800ENTRY(name) \
677 RING0_INT_FRAME; \ 801 RING0_INT_FRAME; \
678 pushl $~(nr); \ 802 pushl $~(nr); \
@@ -680,13 +804,15 @@ ENTRY(name) \
680 SAVE_ALL; \ 804 SAVE_ALL; \
681 TRACE_IRQS_OFF \ 805 TRACE_IRQS_OFF \
682 movl %esp,%eax; \ 806 movl %esp,%eax; \
683 call smp_##name; \ 807 call fn; \
684 jmp ret_from_intr; \ 808 jmp ret_from_intr; \
685 CFI_ENDPROC; \ 809 CFI_ENDPROC; \
686ENDPROC(name) 810ENDPROC(name)
687 811
812#define BUILD_INTERRUPT(name, nr) BUILD_INTERRUPT3(name, nr, smp_##name)
813
688/* The include is where all of the SMP etc. interrupts come from */ 814/* The include is where all of the SMP etc. interrupts come from */
689#include "entry_arch.h" 815#include <asm/entry_arch.h>
690 816
691ENTRY(coprocessor_error) 817ENTRY(coprocessor_error)
692 RING0_INT_FRAME 818 RING0_INT_FRAME
@@ -1068,7 +1194,10 @@ ENTRY(page_fault)
1068 CFI_ADJUST_CFA_OFFSET 4 1194 CFI_ADJUST_CFA_OFFSET 4
1069 ALIGN 1195 ALIGN
1070error_code: 1196error_code:
1071 /* the function address is in %fs's slot on the stack */ 1197 /* the function address is in %gs's slot on the stack */
1198 pushl %fs
1199 CFI_ADJUST_CFA_OFFSET 4
1200 /*CFI_REL_OFFSET fs, 0*/
1072 pushl %es 1201 pushl %es
1073 CFI_ADJUST_CFA_OFFSET 4 1202 CFI_ADJUST_CFA_OFFSET 4
1074 /*CFI_REL_OFFSET es, 0*/ 1203 /*CFI_REL_OFFSET es, 0*/
@@ -1097,20 +1226,15 @@ error_code:
1097 CFI_ADJUST_CFA_OFFSET 4 1226 CFI_ADJUST_CFA_OFFSET 4
1098 CFI_REL_OFFSET ebx, 0 1227 CFI_REL_OFFSET ebx, 0
1099 cld 1228 cld
1100 pushl %fs
1101 CFI_ADJUST_CFA_OFFSET 4
1102 /*CFI_REL_OFFSET fs, 0*/
1103 movl $(__KERNEL_PERCPU), %ecx 1229 movl $(__KERNEL_PERCPU), %ecx
1104 movl %ecx, %fs 1230 movl %ecx, %fs
1105 UNWIND_ESPFIX_STACK 1231 UNWIND_ESPFIX_STACK
1106 popl %ecx 1232 GS_TO_REG %ecx
1107 CFI_ADJUST_CFA_OFFSET -4 1233 movl PT_GS(%esp), %edi # get the function address
1108 /*CFI_REGISTER es, ecx*/
1109 movl PT_FS(%esp), %edi # get the function address
1110 movl PT_ORIG_EAX(%esp), %edx # get the error code 1234 movl PT_ORIG_EAX(%esp), %edx # get the error code
1111 movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart 1235 movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
1112 mov %ecx, PT_FS(%esp) 1236 REG_TO_PTGS %ecx
1113 /*CFI_REL_OFFSET fs, ES*/ 1237 SET_KERNEL_GS %ecx
1114 movl $(__USER_DS), %ecx 1238 movl $(__USER_DS), %ecx
1115 movl %ecx, %ds 1239 movl %ecx, %ds
1116 movl %ecx, %es 1240 movl %ecx, %es
@@ -1134,26 +1258,27 @@ END(page_fault)
1134 * by hand onto the new stack - while updating the return eip past 1258 * by hand onto the new stack - while updating the return eip past
1135 * the instruction that would have done it for sysenter. 1259 * the instruction that would have done it for sysenter.
1136 */ 1260 */
1137#define FIX_STACK(offset, ok, label) \ 1261.macro FIX_STACK offset ok label
1138 cmpw $__KERNEL_CS,4(%esp); \ 1262 cmpw $__KERNEL_CS, 4(%esp)
1139 jne ok; \ 1263 jne \ok
1140label: \ 1264\label:
1141 movl TSS_sysenter_sp0+offset(%esp),%esp; \ 1265 movl TSS_sysenter_sp0 + \offset(%esp), %esp
1142 CFI_DEF_CFA esp, 0; \ 1266 CFI_DEF_CFA esp, 0
1143 CFI_UNDEFINED eip; \ 1267 CFI_UNDEFINED eip
1144 pushfl; \ 1268 pushfl
1145 CFI_ADJUST_CFA_OFFSET 4; \ 1269 CFI_ADJUST_CFA_OFFSET 4
1146 pushl $__KERNEL_CS; \ 1270 pushl $__KERNEL_CS
1147 CFI_ADJUST_CFA_OFFSET 4; \ 1271 CFI_ADJUST_CFA_OFFSET 4
1148 pushl $sysenter_past_esp; \ 1272 pushl $sysenter_past_esp
1149 CFI_ADJUST_CFA_OFFSET 4; \ 1273 CFI_ADJUST_CFA_OFFSET 4
1150 CFI_REL_OFFSET eip, 0 1274 CFI_REL_OFFSET eip, 0
1275.endm
1151 1276
1152ENTRY(debug) 1277ENTRY(debug)
1153 RING0_INT_FRAME 1278 RING0_INT_FRAME
1154 cmpl $ia32_sysenter_target,(%esp) 1279 cmpl $ia32_sysenter_target,(%esp)
1155 jne debug_stack_correct 1280 jne debug_stack_correct
1156 FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn) 1281 FIX_STACK 12, debug_stack_correct, debug_esp_fix_insn
1157debug_stack_correct: 1282debug_stack_correct:
1158 pushl $-1 # mark this as an int 1283 pushl $-1 # mark this as an int
1159 CFI_ADJUST_CFA_OFFSET 4 1284 CFI_ADJUST_CFA_OFFSET 4
@@ -1211,7 +1336,7 @@ nmi_stack_correct:
1211 1336
1212nmi_stack_fixup: 1337nmi_stack_fixup:
1213 RING0_INT_FRAME 1338 RING0_INT_FRAME
1214 FIX_STACK(12,nmi_stack_correct, 1) 1339 FIX_STACK 12, nmi_stack_correct, 1
1215 jmp nmi_stack_correct 1340 jmp nmi_stack_correct
1216 1341
1217nmi_debug_stack_check: 1342nmi_debug_stack_check:
@@ -1222,7 +1347,7 @@ nmi_debug_stack_check:
1222 jb nmi_stack_correct 1347 jb nmi_stack_correct
1223 cmpl $debug_esp_fix_insn,(%esp) 1348 cmpl $debug_esp_fix_insn,(%esp)
1224 ja nmi_stack_correct 1349 ja nmi_stack_correct
1225 FIX_STACK(24,nmi_stack_correct, 1) 1350 FIX_STACK 24, nmi_stack_correct, 1
1226 jmp nmi_stack_correct 1351 jmp nmi_stack_correct
1227 1352
1228nmi_espfix_stack: 1353nmi_espfix_stack:
@@ -1234,7 +1359,7 @@ nmi_espfix_stack:
1234 CFI_ADJUST_CFA_OFFSET 4 1359 CFI_ADJUST_CFA_OFFSET 4
1235 pushl %esp 1360 pushl %esp
1236 CFI_ADJUST_CFA_OFFSET 4 1361 CFI_ADJUST_CFA_OFFSET 4
1237 addw $4, (%esp) 1362 addl $4, (%esp)
1238 /* copy the iret frame of 12 bytes */ 1363 /* copy the iret frame of 12 bytes */
1239 .rept 3 1364 .rept 3
1240 pushl 16(%esp) 1365 pushl 16(%esp)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index a1346217e43c..83d1836b9467 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -48,10 +48,11 @@
48#include <asm/unistd.h> 48#include <asm/unistd.h>
49#include <asm/thread_info.h> 49#include <asm/thread_info.h>
50#include <asm/hw_irq.h> 50#include <asm/hw_irq.h>
51#include <asm/page.h> 51#include <asm/page_types.h>
52#include <asm/irqflags.h> 52#include <asm/irqflags.h>
53#include <asm/paravirt.h> 53#include <asm/paravirt.h>
54#include <asm/ftrace.h> 54#include <asm/ftrace.h>
55#include <asm/percpu.h>
55 56
56/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */ 57/* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */
57#include <linux/elf-em.h> 58#include <linux/elf-em.h>
@@ -76,20 +77,17 @@ ENTRY(ftrace_caller)
76 movq 8(%rbp), %rsi 77 movq 8(%rbp), %rsi
77 subq $MCOUNT_INSN_SIZE, %rdi 78 subq $MCOUNT_INSN_SIZE, %rdi
78 79
79.globl ftrace_call 80GLOBAL(ftrace_call)
80ftrace_call:
81 call ftrace_stub 81 call ftrace_stub
82 82
83 MCOUNT_RESTORE_FRAME 83 MCOUNT_RESTORE_FRAME
84 84
85#ifdef CONFIG_FUNCTION_GRAPH_TRACER 85#ifdef CONFIG_FUNCTION_GRAPH_TRACER
86.globl ftrace_graph_call 86GLOBAL(ftrace_graph_call)
87ftrace_graph_call:
88 jmp ftrace_stub 87 jmp ftrace_stub
89#endif 88#endif
90 89
91.globl ftrace_stub 90GLOBAL(ftrace_stub)
92ftrace_stub:
93 retq 91 retq
94END(ftrace_caller) 92END(ftrace_caller)
95 93
@@ -109,8 +107,7 @@ ENTRY(mcount)
109 jnz ftrace_graph_caller 107 jnz ftrace_graph_caller
110#endif 108#endif
111 109
112.globl ftrace_stub 110GLOBAL(ftrace_stub)
113ftrace_stub:
114 retq 111 retq
115 112
116trace: 113trace:
@@ -147,9 +144,7 @@ ENTRY(ftrace_graph_caller)
147 retq 144 retq
148END(ftrace_graph_caller) 145END(ftrace_graph_caller)
149 146
150 147GLOBAL(return_to_handler)
151.globl return_to_handler
152return_to_handler:
153 subq $80, %rsp 148 subq $80, %rsp
154 149
155 movq %rax, (%rsp) 150 movq %rax, (%rsp)
@@ -187,6 +182,7 @@ return_to_handler:
187ENTRY(native_usergs_sysret64) 182ENTRY(native_usergs_sysret64)
188 swapgs 183 swapgs
189 sysretq 184 sysretq
185ENDPROC(native_usergs_sysret64)
190#endif /* CONFIG_PARAVIRT */ 186#endif /* CONFIG_PARAVIRT */
191 187
192 188
@@ -209,7 +205,7 @@ ENTRY(native_usergs_sysret64)
209 205
210 /* %rsp:at FRAMEEND */ 206 /* %rsp:at FRAMEEND */
211 .macro FIXUP_TOP_OF_STACK tmp offset=0 207 .macro FIXUP_TOP_OF_STACK tmp offset=0
212 movq %gs:pda_oldrsp,\tmp 208 movq PER_CPU_VAR(old_rsp),\tmp
213 movq \tmp,RSP+\offset(%rsp) 209 movq \tmp,RSP+\offset(%rsp)
214 movq $__USER_DS,SS+\offset(%rsp) 210 movq $__USER_DS,SS+\offset(%rsp)
215 movq $__USER_CS,CS+\offset(%rsp) 211 movq $__USER_CS,CS+\offset(%rsp)
@@ -220,7 +216,7 @@ ENTRY(native_usergs_sysret64)
220 216
221 .macro RESTORE_TOP_OF_STACK tmp offset=0 217 .macro RESTORE_TOP_OF_STACK tmp offset=0
222 movq RSP+\offset(%rsp),\tmp 218 movq RSP+\offset(%rsp),\tmp
223 movq \tmp,%gs:pda_oldrsp 219 movq \tmp,PER_CPU_VAR(old_rsp)
224 movq EFLAGS+\offset(%rsp),\tmp 220 movq EFLAGS+\offset(%rsp),\tmp
225 movq \tmp,R11+\offset(%rsp) 221 movq \tmp,R11+\offset(%rsp)
226 .endm 222 .endm
@@ -336,15 +332,15 @@ ENTRY(save_args)
336 je 1f 332 je 1f
337 SWAPGS 333 SWAPGS
338 /* 334 /*
339 * irqcount is used to check if a CPU is already on an interrupt stack 335 * irq_count is used to check if a CPU is already on an interrupt stack
340 * or not. While this is essentially redundant with preempt_count it is 336 * or not. While this is essentially redundant with preempt_count it is
341 * a little cheaper to use a separate counter in the PDA (short of 337 * a little cheaper to use a separate counter in the PDA (short of
342 * moving irq_enter into assembly, which would be too much work) 338 * moving irq_enter into assembly, which would be too much work)
343 */ 339 */
3441: incl %gs:pda_irqcount 3401: incl PER_CPU_VAR(irq_count)
345 jne 2f 341 jne 2f
346 popq_cfi %rax /* move return address... */ 342 popq_cfi %rax /* move return address... */
347 mov %gs:pda_irqstackptr,%rsp 343 mov PER_CPU_VAR(irq_stack_ptr),%rsp
348 EMPTY_FRAME 0 344 EMPTY_FRAME 0
349 pushq_cfi %rbp /* backlink for unwinder */ 345 pushq_cfi %rbp /* backlink for unwinder */
350 pushq_cfi %rax /* ... to the new stack */ 346 pushq_cfi %rax /* ... to the new stack */
@@ -409,6 +405,8 @@ END(save_paranoid)
409ENTRY(ret_from_fork) 405ENTRY(ret_from_fork)
410 DEFAULT_FRAME 406 DEFAULT_FRAME
411 407
408 LOCK ; btr $TIF_FORK,TI_flags(%r8)
409
412 push kernel_eflags(%rip) 410 push kernel_eflags(%rip)
413 CFI_ADJUST_CFA_OFFSET 8 411 CFI_ADJUST_CFA_OFFSET 8
414 popf # reset kernel eflags 412 popf # reset kernel eflags
@@ -468,7 +466,7 @@ END(ret_from_fork)
468ENTRY(system_call) 466ENTRY(system_call)
469 CFI_STARTPROC simple 467 CFI_STARTPROC simple
470 CFI_SIGNAL_FRAME 468 CFI_SIGNAL_FRAME
471 CFI_DEF_CFA rsp,PDA_STACKOFFSET 469 CFI_DEF_CFA rsp,KERNEL_STACK_OFFSET
472 CFI_REGISTER rip,rcx 470 CFI_REGISTER rip,rcx
473 /*CFI_REGISTER rflags,r11*/ 471 /*CFI_REGISTER rflags,r11*/
474 SWAPGS_UNSAFE_STACK 472 SWAPGS_UNSAFE_STACK
@@ -479,8 +477,8 @@ ENTRY(system_call)
479 */ 477 */
480ENTRY(system_call_after_swapgs) 478ENTRY(system_call_after_swapgs)
481 479
482 movq %rsp,%gs:pda_oldrsp 480 movq %rsp,PER_CPU_VAR(old_rsp)
483 movq %gs:pda_kernelstack,%rsp 481 movq PER_CPU_VAR(kernel_stack),%rsp
484 /* 482 /*
485 * No need to follow this irqs off/on section - it's straight 483 * No need to follow this irqs off/on section - it's straight
486 * and short: 484 * and short:
@@ -523,7 +521,7 @@ sysret_check:
523 CFI_REGISTER rip,rcx 521 CFI_REGISTER rip,rcx
524 RESTORE_ARGS 0,-ARG_SKIP,1 522 RESTORE_ARGS 0,-ARG_SKIP,1
525 /*CFI_REGISTER rflags,r11*/ 523 /*CFI_REGISTER rflags,r11*/
526 movq %gs:pda_oldrsp, %rsp 524 movq PER_CPU_VAR(old_rsp), %rsp
527 USERGS_SYSRET64 525 USERGS_SYSRET64
528 526
529 CFI_RESTORE_STATE 527 CFI_RESTORE_STATE
@@ -630,16 +628,14 @@ tracesys:
630 * Syscall return path ending with IRET. 628 * Syscall return path ending with IRET.
631 * Has correct top of stack, but partial stack frame. 629 * Has correct top of stack, but partial stack frame.
632 */ 630 */
633 .globl int_ret_from_sys_call 631GLOBAL(int_ret_from_sys_call)
634 .globl int_with_check
635int_ret_from_sys_call:
636 DISABLE_INTERRUPTS(CLBR_NONE) 632 DISABLE_INTERRUPTS(CLBR_NONE)
637 TRACE_IRQS_OFF 633 TRACE_IRQS_OFF
638 testl $3,CS-ARGOFFSET(%rsp) 634 testl $3,CS-ARGOFFSET(%rsp)
639 je retint_restore_args 635 je retint_restore_args
640 movl $_TIF_ALLWORK_MASK,%edi 636 movl $_TIF_ALLWORK_MASK,%edi
641 /* edi: mask to check */ 637 /* edi: mask to check */
642int_with_check: 638GLOBAL(int_with_check)
643 LOCKDEP_SYS_EXIT_IRQ 639 LOCKDEP_SYS_EXIT_IRQ
644 GET_THREAD_INFO(%rcx) 640 GET_THREAD_INFO(%rcx)
645 movl TI_flags(%rcx),%edx 641 movl TI_flags(%rcx),%edx
@@ -833,11 +829,11 @@ common_interrupt:
833 XCPT_FRAME 829 XCPT_FRAME
834 addq $-0x80,(%rsp) /* Adjust vector to [-256,-1] range */ 830 addq $-0x80,(%rsp) /* Adjust vector to [-256,-1] range */
835 interrupt do_IRQ 831 interrupt do_IRQ
836 /* 0(%rsp): oldrsp-ARGOFFSET */ 832 /* 0(%rsp): old_rsp-ARGOFFSET */
837ret_from_intr: 833ret_from_intr:
838 DISABLE_INTERRUPTS(CLBR_NONE) 834 DISABLE_INTERRUPTS(CLBR_NONE)
839 TRACE_IRQS_OFF 835 TRACE_IRQS_OFF
840 decl %gs:pda_irqcount 836 decl PER_CPU_VAR(irq_count)
841 leaveq 837 leaveq
842 CFI_DEF_CFA_REGISTER rsp 838 CFI_DEF_CFA_REGISTER rsp
843 CFI_ADJUST_CFA_OFFSET -8 839 CFI_ADJUST_CFA_OFFSET -8
@@ -982,8 +978,10 @@ apicinterrupt IRQ_MOVE_CLEANUP_VECTOR \
982 irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt 978 irq_move_cleanup_interrupt smp_irq_move_cleanup_interrupt
983#endif 979#endif
984 980
981#ifdef CONFIG_X86_UV
985apicinterrupt UV_BAU_MESSAGE \ 982apicinterrupt UV_BAU_MESSAGE \
986 uv_bau_message_intr1 uv_bau_message_interrupt 983 uv_bau_message_intr1 uv_bau_message_interrupt
984#endif
987apicinterrupt LOCAL_TIMER_VECTOR \ 985apicinterrupt LOCAL_TIMER_VECTOR \
988 apic_timer_interrupt smp_apic_timer_interrupt 986 apic_timer_interrupt smp_apic_timer_interrupt
989 987
@@ -1073,10 +1071,10 @@ ENTRY(\sym)
1073 TRACE_IRQS_OFF 1071 TRACE_IRQS_OFF
1074 movq %rsp,%rdi /* pt_regs pointer */ 1072 movq %rsp,%rdi /* pt_regs pointer */
1075 xorl %esi,%esi /* no error code */ 1073 xorl %esi,%esi /* no error code */
1076 movq %gs:pda_data_offset, %rbp 1074 PER_CPU(init_tss, %rbp)
1077 subq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) 1075 subq $EXCEPTION_STKSZ, TSS_ist + (\ist - 1) * 8(%rbp)
1078 call \do_sym 1076 call \do_sym
1079 addq $EXCEPTION_STKSZ, per_cpu__init_tss + TSS_ist + (\ist - 1) * 8(%rbp) 1077 addq $EXCEPTION_STKSZ, TSS_ist + (\ist - 1) * 8(%rbp)
1080 jmp paranoid_exit /* %ebx: no swapgs flag */ 1078 jmp paranoid_exit /* %ebx: no swapgs flag */
1081 CFI_ENDPROC 1079 CFI_ENDPROC
1082END(\sym) 1080END(\sym)
@@ -1138,7 +1136,7 @@ ENTRY(native_load_gs_index)
1138 CFI_STARTPROC 1136 CFI_STARTPROC
1139 pushf 1137 pushf
1140 CFI_ADJUST_CFA_OFFSET 8 1138 CFI_ADJUST_CFA_OFFSET 8
1141 DISABLE_INTERRUPTS(CLBR_ANY | ~(CLBR_RDI)) 1139 DISABLE_INTERRUPTS(CLBR_ANY & ~CLBR_RDI)
1142 SWAPGS 1140 SWAPGS
1143gs_change: 1141gs_change:
1144 movl %edi,%gs 1142 movl %edi,%gs
@@ -1260,14 +1258,14 @@ ENTRY(call_softirq)
1260 CFI_REL_OFFSET rbp,0 1258 CFI_REL_OFFSET rbp,0
1261 mov %rsp,%rbp 1259 mov %rsp,%rbp
1262 CFI_DEF_CFA_REGISTER rbp 1260 CFI_DEF_CFA_REGISTER rbp
1263 incl %gs:pda_irqcount 1261 incl PER_CPU_VAR(irq_count)
1264 cmove %gs:pda_irqstackptr,%rsp 1262 cmove PER_CPU_VAR(irq_stack_ptr),%rsp
1265 push %rbp # backlink for old unwinder 1263 push %rbp # backlink for old unwinder
1266 call __do_softirq 1264 call __do_softirq
1267 leaveq 1265 leaveq
1268 CFI_DEF_CFA_REGISTER rsp 1266 CFI_DEF_CFA_REGISTER rsp
1269 CFI_ADJUST_CFA_OFFSET -8 1267 CFI_ADJUST_CFA_OFFSET -8
1270 decl %gs:pda_irqcount 1268 decl PER_CPU_VAR(irq_count)
1271 ret 1269 ret
1272 CFI_ENDPROC 1270 CFI_ENDPROC
1273END(call_softirq) 1271END(call_softirq)
@@ -1297,15 +1295,15 @@ ENTRY(xen_do_hypervisor_callback) # do_hypervisor_callback(struct *pt_regs)
1297 movq %rdi, %rsp # we don't return, adjust the stack frame 1295 movq %rdi, %rsp # we don't return, adjust the stack frame
1298 CFI_ENDPROC 1296 CFI_ENDPROC
1299 DEFAULT_FRAME 1297 DEFAULT_FRAME
130011: incl %gs:pda_irqcount 129811: incl PER_CPU_VAR(irq_count)
1301 movq %rsp,%rbp 1299 movq %rsp,%rbp
1302 CFI_DEF_CFA_REGISTER rbp 1300 CFI_DEF_CFA_REGISTER rbp
1303 cmovzq %gs:pda_irqstackptr,%rsp 1301 cmovzq PER_CPU_VAR(irq_stack_ptr),%rsp
1304 pushq %rbp # backlink for old unwinder 1302 pushq %rbp # backlink for old unwinder
1305 call xen_evtchn_do_upcall 1303 call xen_evtchn_do_upcall
1306 popq %rsp 1304 popq %rsp
1307 CFI_DEF_CFA_REGISTER rsp 1305 CFI_DEF_CFA_REGISTER rsp
1308 decl %gs:pda_irqcount 1306 decl PER_CPU_VAR(irq_count)
1309 jmp error_exit 1307 jmp error_exit
1310 CFI_ENDPROC 1308 CFI_ENDPROC
1311END(do_hypervisor_callback) 1309END(do_hypervisor_callback)
diff --git a/arch/x86/kernel/es7000_32.c b/arch/x86/kernel/es7000_32.c
deleted file mode 100644
index 53699c931ad4..000000000000
--- a/arch/x86/kernel/es7000_32.c
+++ /dev/null
@@ -1,378 +0,0 @@
1/*
2 * Written by: Garry Forsgren, Unisys Corporation
3 * Natalie Protasevich, Unisys Corporation
4 * This file contains the code to configure and interface
5 * with Unisys ES7000 series hardware system manager.
6 *
7 * Copyright (c) 2003 Unisys Corporation. All Rights Reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it would be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write the Free Software Foundation, Inc., 59
19 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
20 *
21 * Contact information: Unisys Corporation, Township Line & Union Meeting
22 * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or:
23 *
24 * http://www.unisys.com
25 */
26
27#include <linux/module.h>
28#include <linux/types.h>
29#include <linux/kernel.h>
30#include <linux/smp.h>
31#include <linux/string.h>
32#include <linux/spinlock.h>
33#include <linux/errno.h>
34#include <linux/notifier.h>
35#include <linux/reboot.h>
36#include <linux/init.h>
37#include <linux/acpi.h>
38#include <asm/io.h>
39#include <asm/nmi.h>
40#include <asm/smp.h>
41#include <asm/atomic.h>
42#include <asm/apicdef.h>
43#include <mach_mpparse.h>
44#include <asm/genapic.h>
45#include <asm/setup.h>
46
47/*
48 * ES7000 chipsets
49 */
50
51#define NON_UNISYS 0
52#define ES7000_CLASSIC 1
53#define ES7000_ZORRO 2
54
55
56#define MIP_REG 1
57#define MIP_PSAI_REG 4
58
59#define MIP_BUSY 1
60#define MIP_SPIN 0xf0000
61#define MIP_VALID 0x0100000000000000ULL
62#define MIP_PORT(VALUE) ((VALUE >> 32) & 0xffff)
63
64#define MIP_RD_LO(VALUE) (VALUE & 0xffffffff)
65
66struct mip_reg_info {
67 unsigned long long mip_info;
68 unsigned long long delivery_info;
69 unsigned long long host_reg;
70 unsigned long long mip_reg;
71};
72
73struct part_info {
74 unsigned char type;
75 unsigned char length;
76 unsigned char part_id;
77 unsigned char apic_mode;
78 unsigned long snum;
79 char ptype[16];
80 char sname[64];
81 char pname[64];
82};
83
84struct psai {
85 unsigned long long entry_type;
86 unsigned long long addr;
87 unsigned long long bep_addr;
88};
89
90struct es7000_mem_info {
91 unsigned char type;
92 unsigned char length;
93 unsigned char resv[6];
94 unsigned long long start;
95 unsigned long long size;
96};
97
98struct es7000_oem_table {
99 unsigned long long hdr;
100 struct mip_reg_info mip;
101 struct part_info pif;
102 struct es7000_mem_info shm;
103 struct psai psai;
104};
105
106#ifdef CONFIG_ACPI
107
108struct oem_table {
109 struct acpi_table_header Header;
110 u32 OEMTableAddr;
111 u32 OEMTableSize;
112};
113
114extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
115extern void unmap_unisys_acpi_oem_table(unsigned long oem_addr);
116#endif
117
118struct mip_reg {
119 unsigned long long off_0;
120 unsigned long long off_8;
121 unsigned long long off_10;
122 unsigned long long off_18;
123 unsigned long long off_20;
124 unsigned long long off_28;
125 unsigned long long off_30;
126 unsigned long long off_38;
127};
128
129#define MIP_SW_APIC 0x1020b
130#define MIP_FUNC(VALUE) (VALUE & 0xff)
131
132/*
133 * ES7000 Globals
134 */
135
136static volatile unsigned long *psai = NULL;
137static struct mip_reg *mip_reg;
138static struct mip_reg *host_reg;
139static int mip_port;
140static unsigned long mip_addr, host_addr;
141
142int es7000_plat;
143
144/*
145 * GSI override for ES7000 platforms.
146 */
147
148static unsigned int base;
149
150static int
151es7000_rename_gsi(int ioapic, int gsi)
152{
153 if (es7000_plat == ES7000_ZORRO)
154 return gsi;
155
156 if (!base) {
157 int i;
158 for (i = 0; i < nr_ioapics; i++)
159 base += nr_ioapic_registers[i];
160 }
161
162 if (!ioapic && (gsi < 16))
163 gsi += base;
164 return gsi;
165}
166
167static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
168{
169 unsigned long vect = 0, psaival = 0;
170
171 if (psai == NULL)
172 return -1;
173
174 vect = ((unsigned long)__pa(eip)/0x1000) << 16;
175 psaival = (0x1000000 | vect | cpu);
176
177 while (*psai & 0x1000000)
178 ;
179
180 *psai = psaival;
181
182 return 0;
183}
184
185static void noop_wait_for_deassert(atomic_t *deassert_not_used)
186{
187}
188
189static int __init es7000_update_genapic(void)
190{
191 genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
192
193 /* MPENTIUMIII */
194 if (boot_cpu_data.x86 == 6 &&
195 (boot_cpu_data.x86_model >= 7 || boot_cpu_data.x86_model <= 11)) {
196 es7000_update_genapic_to_cluster();
197 genapic->wait_for_init_deassert = noop_wait_for_deassert;
198 genapic->wakeup_cpu = wakeup_secondary_cpu_via_mip;
199 }
200
201 return 0;
202}
203
204void __init
205setup_unisys(void)
206{
207 /*
208 * Determine the generation of the ES7000 currently running.
209 *
210 * es7000_plat = 1 if the machine is a 5xx ES7000 box
211 * es7000_plat = 2 if the machine is a x86_64 ES7000 box
212 *
213 */
214 if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
215 es7000_plat = ES7000_ZORRO;
216 else
217 es7000_plat = ES7000_CLASSIC;
218 ioapic_renumber_irq = es7000_rename_gsi;
219
220 x86_quirks->update_genapic = es7000_update_genapic;
221}
222
223/*
224 * Parse the OEM Table
225 */
226
227int __init
228parse_unisys_oem (char *oemptr)
229{
230 int i;
231 int success = 0;
232 unsigned char type, size;
233 unsigned long val;
234 char *tp = NULL;
235 struct psai *psaip = NULL;
236 struct mip_reg_info *mi;
237 struct mip_reg *host, *mip;
238
239 tp = oemptr;
240
241 tp += 8;
242
243 for (i=0; i <= 6; i++) {
244 type = *tp++;
245 size = *tp++;
246 tp -= 2;
247 switch (type) {
248 case MIP_REG:
249 mi = (struct mip_reg_info *)tp;
250 val = MIP_RD_LO(mi->host_reg);
251 host_addr = val;
252 host = (struct mip_reg *)val;
253 host_reg = __va(host);
254 val = MIP_RD_LO(mi->mip_reg);
255 mip_port = MIP_PORT(mi->mip_info);
256 mip_addr = val;
257 mip = (struct mip_reg *)val;
258 mip_reg = __va(mip);
259 pr_debug("es7000_mipcfg: host_reg = 0x%lx \n",
260 (unsigned long)host_reg);
261 pr_debug("es7000_mipcfg: mip_reg = 0x%lx \n",
262 (unsigned long)mip_reg);
263 success++;
264 break;
265 case MIP_PSAI_REG:
266 psaip = (struct psai *)tp;
267 if (tp != NULL) {
268 if (psaip->addr)
269 psai = __va(psaip->addr);
270 else
271 psai = NULL;
272 success++;
273 }
274 break;
275 default:
276 break;
277 }
278 tp += size;
279 }
280
281 if (success < 2) {
282 es7000_plat = NON_UNISYS;
283 } else
284 setup_unisys();
285 return es7000_plat;
286}
287
288#ifdef CONFIG_ACPI
289static unsigned long oem_addrX;
290static unsigned long oem_size;
291int __init find_unisys_acpi_oem_table(unsigned long *oem_addr)
292{
293 struct acpi_table_header *header = NULL;
294 int i = 0;
295
296 while (ACPI_SUCCESS(acpi_get_table("OEM1", i++, &header))) {
297 if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) {
298 struct oem_table *t = (struct oem_table *)header;
299
300 oem_addrX = t->OEMTableAddr;
301 oem_size = t->OEMTableSize;
302
303 *oem_addr = (unsigned long)__acpi_map_table(oem_addrX,
304 oem_size);
305 return 0;
306 }
307 }
308 return -1;
309}
310
311void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr)
312{
313}
314#endif
315
316static void
317es7000_spin(int n)
318{
319 int i = 0;
320
321 while (i++ < n)
322 rep_nop();
323}
324
325static int __init
326es7000_mip_write(struct mip_reg *mip_reg)
327{
328 int status = 0;
329 int spin;
330
331 spin = MIP_SPIN;
332 while (((unsigned long long)host_reg->off_38 &
333 (unsigned long long)MIP_VALID) != 0) {
334 if (--spin <= 0) {
335 printk("es7000_mip_write: Timeout waiting for Host Valid Flag");
336 return -1;
337 }
338 es7000_spin(MIP_SPIN);
339 }
340
341 memcpy(host_reg, mip_reg, sizeof(struct mip_reg));
342 outb(1, mip_port);
343
344 spin = MIP_SPIN;
345
346 while (((unsigned long long)mip_reg->off_38 &
347 (unsigned long long)MIP_VALID) == 0) {
348 if (--spin <= 0) {
349 printk("es7000_mip_write: Timeout waiting for MIP Valid Flag");
350 return -1;
351 }
352 es7000_spin(MIP_SPIN);
353 }
354
355 status = ((unsigned long long)mip_reg->off_0 &
356 (unsigned long long)0xffff0000000000ULL) >> 48;
357 mip_reg->off_38 = ((unsigned long long)mip_reg->off_38 &
358 (unsigned long long)~MIP_VALID);
359 return status;
360}
361
362void __init
363es7000_sw_apic(void)
364{
365 if (es7000_plat) {
366 int mip_status;
367 struct mip_reg es7000_mip_reg;
368
369 printk("ES7000: Enabling APIC mode.\n");
370 memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
371 es7000_mip_reg.off_0 = MIP_SW_APIC;
372 es7000_mip_reg.off_38 = (MIP_VALID);
373 while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
374 printk("es7000_sw_apic: command failed, status = %x\n",
375 mip_status);
376 return;
377 }
378}
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index b9a4d8c4b935..f5b272247690 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -26,27 +26,6 @@
26#include <asm/bios_ebda.h> 26#include <asm/bios_ebda.h>
27#include <asm/trampoline.h> 27#include <asm/trampoline.h>
28 28
29/* boot cpu pda */
30static struct x8664_pda _boot_cpu_pda;
31
32#ifdef CONFIG_SMP
33/*
34 * We install an empty cpu_pda pointer table to indicate to early users
35 * (numa_set_node) that the cpu_pda pointer table for cpus other than
36 * the boot cpu is not yet setup.
37 */
38static struct x8664_pda *__cpu_pda[NR_CPUS] __initdata;
39#else
40static struct x8664_pda *__cpu_pda[NR_CPUS] __read_mostly;
41#endif
42
43void __init x86_64_init_pda(void)
44{
45 _cpu_pda = __cpu_pda;
46 cpu_pda(0) = &_boot_cpu_pda;
47 pda_init(0);
48}
49
50static void __init zap_identity_mappings(void) 29static void __init zap_identity_mappings(void)
51{ 30{
52 pgd_t *pgd = pgd_offset_k(0UL); 31 pgd_t *pgd = pgd_offset_k(0UL);
@@ -112,8 +91,6 @@ void __init x86_64_start_kernel(char * real_mode_data)
112 if (console_loglevel == 10) 91 if (console_loglevel == 10)
113 early_printk("Kernel alive\n"); 92 early_printk("Kernel alive\n");
114 93
115 x86_64_init_pda();
116
117 x86_64_start_reservations(real_mode_data); 94 x86_64_start_reservations(real_mode_data);
118} 95}
119 96
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index e835b4eea70b..c32ca19d591a 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -11,14 +11,15 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/segment.h> 13#include <asm/segment.h>
14#include <asm/page.h> 14#include <asm/page_types.h>
15#include <asm/pgtable.h> 15#include <asm/pgtable_types.h>
16#include <asm/desc.h> 16#include <asm/desc.h>
17#include <asm/cache.h> 17#include <asm/cache.h>
18#include <asm/thread_info.h> 18#include <asm/thread_info.h>
19#include <asm/asm-offsets.h> 19#include <asm/asm-offsets.h>
20#include <asm/setup.h> 20#include <asm/setup.h>
21#include <asm/processor-flags.h> 21#include <asm/processor-flags.h>
22#include <asm/percpu.h>
22 23
23/* Physical address */ 24/* Physical address */
24#define pa(X) ((X) - __PAGE_OFFSET) 25#define pa(X) ((X) - __PAGE_OFFSET)
@@ -429,14 +430,34 @@ is386: movl $2,%ecx # set MP
429 ljmp $(__KERNEL_CS),$1f 430 ljmp $(__KERNEL_CS),$1f
4301: movl $(__KERNEL_DS),%eax # reload all the segment registers 4311: movl $(__KERNEL_DS),%eax # reload all the segment registers
431 movl %eax,%ss # after changing gdt. 432 movl %eax,%ss # after changing gdt.
432 movl %eax,%fs # gets reset once there's real percpu
433 433
434 movl $(__USER_DS),%eax # DS/ES contains default USER segment 434 movl $(__USER_DS),%eax # DS/ES contains default USER segment
435 movl %eax,%ds 435 movl %eax,%ds
436 movl %eax,%es 436 movl %eax,%es
437 437
438 xorl %eax,%eax # Clear GS and LDT 438 movl $(__KERNEL_PERCPU), %eax
439 movl %eax,%fs # set this cpu's percpu
440
441#ifdef CONFIG_CC_STACKPROTECTOR
442 /*
443 * The linker can't handle this by relocation. Manually set
444 * base address in stack canary segment descriptor.
445 */
446 cmpb $0,ready
447 jne 1f
448 movl $per_cpu__gdt_page,%eax
449 movl $per_cpu__stack_canary,%ecx
450 subl $20, %ecx
451 movw %cx, 8 * GDT_ENTRY_STACK_CANARY + 2(%eax)
452 shrl $16, %ecx
453 movb %cl, 8 * GDT_ENTRY_STACK_CANARY + 4(%eax)
454 movb %ch, 8 * GDT_ENTRY_STACK_CANARY + 7(%eax)
4551:
456#endif
457 movl $(__KERNEL_STACK_CANARY),%eax
439 movl %eax,%gs 458 movl %eax,%gs
459
460 xorl %eax,%eax # Clear LDT
440 lldt %ax 461 lldt %ax
441 462
442 cld # gcc2 wants the direction flag cleared at all times 463 cld # gcc2 wants the direction flag cleared at all times
@@ -446,8 +467,6 @@ is386: movl $2,%ecx # set MP
446 movb $1, ready 467 movb $1, ready
447 cmpb $0,%cl # the first CPU calls start_kernel 468 cmpb $0,%cl # the first CPU calls start_kernel
448 je 1f 469 je 1f
449 movl $(__KERNEL_PERCPU), %eax
450 movl %eax,%fs # set this cpu's percpu
451 movl (stack_start), %esp 470 movl (stack_start), %esp
4521: 4711:
453#endif /* CONFIG_SMP */ 472#endif /* CONFIG_SMP */
@@ -548,12 +567,8 @@ early_fault:
548 pushl %eax 567 pushl %eax
549 pushl %edx /* trapno */ 568 pushl %edx /* trapno */
550 pushl $fault_msg 569 pushl $fault_msg
551#ifdef CONFIG_EARLY_PRINTK
552 call early_printk
553#else
554 call printk 570 call printk
555#endif 571#endif
556#endif
557 call dump_stack 572 call dump_stack
558hlt_loop: 573hlt_loop:
559 hlt 574 hlt
@@ -580,11 +595,10 @@ ignore_int:
580 pushl 32(%esp) 595 pushl 32(%esp)
581 pushl 40(%esp) 596 pushl 40(%esp)
582 pushl $int_msg 597 pushl $int_msg
583#ifdef CONFIG_EARLY_PRINTK
584 call early_printk
585#else
586 call printk 598 call printk
587#endif 599
600 call dump_stack
601
588 addl $(5*4),%esp 602 addl $(5*4),%esp
589 popl %ds 603 popl %ds
590 popl %es 604 popl %es
@@ -660,7 +674,7 @@ early_recursion_flag:
660 .long 0 674 .long 0
661 675
662int_msg: 676int_msg:
663 .asciz "Unknown interrupt or fault at EIP %p %p %p\n" 677 .asciz "Unknown interrupt or fault at: %p %p %p\n"
664 678
665fault_msg: 679fault_msg:
666/* fault info: */ 680/* fault info: */
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 0e275d495563..54b29bb24e71 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -19,6 +19,7 @@
19#include <asm/msr.h> 19#include <asm/msr.h>
20#include <asm/cache.h> 20#include <asm/cache.h>
21#include <asm/processor-flags.h> 21#include <asm/processor-flags.h>
22#include <asm/percpu.h>
22 23
23#ifdef CONFIG_PARAVIRT 24#ifdef CONFIG_PARAVIRT
24#include <asm/asm-offsets.h> 25#include <asm/asm-offsets.h>
@@ -226,12 +227,15 @@ ENTRY(secondary_startup_64)
226 movl %eax,%fs 227 movl %eax,%fs
227 movl %eax,%gs 228 movl %eax,%gs
228 229
229 /* 230 /* Set up %gs.
230 * Setup up a dummy PDA. this is just for some early bootup code 231 *
231 * that does in_interrupt() 232 * The base of %gs always points to the bottom of the irqstack
232 */ 233 * union. If the stack protector canary is enabled, it is
234 * located at %gs:40. Note that, on SMP, the boot cpu uses
235 * init data section till per cpu areas are set up.
236 */
233 movl $MSR_GS_BASE,%ecx 237 movl $MSR_GS_BASE,%ecx
234 movq $empty_zero_page,%rax 238 movq initial_gs(%rip),%rax
235 movq %rax,%rdx 239 movq %rax,%rdx
236 shrq $32,%rdx 240 shrq $32,%rdx
237 wrmsr 241 wrmsr
@@ -257,6 +261,8 @@ ENTRY(secondary_startup_64)
257 .align 8 261 .align 8
258 ENTRY(initial_code) 262 ENTRY(initial_code)
259 .quad x86_64_start_kernel 263 .quad x86_64_start_kernel
264 ENTRY(initial_gs)
265 .quad INIT_PER_CPU_VAR(irq_stack_union)
260 __FINITDATA 266 __FINITDATA
261 267
262 ENTRY(stack_start) 268 ENTRY(stack_start)
@@ -323,8 +329,6 @@ early_idt_ripmsg:
323#endif /* CONFIG_EARLY_PRINTK */ 329#endif /* CONFIG_EARLY_PRINTK */
324 .previous 330 .previous
325 331
326.balign PAGE_SIZE
327
328#define NEXT_PAGE(name) \ 332#define NEXT_PAGE(name) \
329 .balign PAGE_SIZE; \ 333 .balign PAGE_SIZE; \
330ENTRY(name) 334ENTRY(name)
@@ -401,7 +405,8 @@ NEXT_PAGE(level2_spare_pgt)
401 .globl early_gdt_descr 405 .globl early_gdt_descr
402early_gdt_descr: 406early_gdt_descr:
403 .word GDT_ENTRIES*8-1 407 .word GDT_ENTRIES*8-1
404 .quad per_cpu__gdt_page 408early_gdt_descr_base:
409 .quad INIT_PER_CPU_VAR(gdt_page)
405 410
406ENTRY(phys_base) 411ENTRY(phys_base)
407 /* This must match the first entry in level2_kernel_pgt */ 412 /* This must match the first entry in level2_kernel_pgt */
@@ -412,7 +417,7 @@ ENTRY(phys_base)
412 .section .bss, "aw", @nobits 417 .section .bss, "aw", @nobits
413 .align L1_CACHE_BYTES 418 .align L1_CACHE_BYTES
414ENTRY(idt_table) 419ENTRY(idt_table)
415 .skip 256 * 16 420 .skip IDT_ENTRIES * 16
416 421
417 .section .bss.page_aligned, "aw", @nobits 422 .section .bss.page_aligned, "aw", @nobits
418 .align PAGE_SIZE 423 .align PAGE_SIZE
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index a00545fe5cdd..648b3a2a3a44 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -80,6 +80,7 @@ static inline void hpet_clear_mapping(void)
80 */ 80 */
81static int boot_hpet_disable; 81static int boot_hpet_disable;
82int hpet_force_user; 82int hpet_force_user;
83static int hpet_verbose;
83 84
84static int __init hpet_setup(char *str) 85static int __init hpet_setup(char *str)
85{ 86{
@@ -88,6 +89,8 @@ static int __init hpet_setup(char *str)
88 boot_hpet_disable = 1; 89 boot_hpet_disable = 1;
89 if (!strncmp("force", str, 5)) 90 if (!strncmp("force", str, 5))
90 hpet_force_user = 1; 91 hpet_force_user = 1;
92 if (!strncmp("verbose", str, 7))
93 hpet_verbose = 1;
91 } 94 }
92 return 1; 95 return 1;
93} 96}
@@ -119,6 +122,43 @@ int is_hpet_enabled(void)
119} 122}
120EXPORT_SYMBOL_GPL(is_hpet_enabled); 123EXPORT_SYMBOL_GPL(is_hpet_enabled);
121 124
125static void _hpet_print_config(const char *function, int line)
126{
127 u32 i, timers, l, h;
128 printk(KERN_INFO "hpet: %s(%d):\n", function, line);
129 l = hpet_readl(HPET_ID);
130 h = hpet_readl(HPET_PERIOD);
131 timers = ((l & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT) + 1;
132 printk(KERN_INFO "hpet: ID: 0x%x, PERIOD: 0x%x\n", l, h);
133 l = hpet_readl(HPET_CFG);
134 h = hpet_readl(HPET_STATUS);
135 printk(KERN_INFO "hpet: CFG: 0x%x, STATUS: 0x%x\n", l, h);
136 l = hpet_readl(HPET_COUNTER);
137 h = hpet_readl(HPET_COUNTER+4);
138 printk(KERN_INFO "hpet: COUNTER_l: 0x%x, COUNTER_h: 0x%x\n", l, h);
139
140 for (i = 0; i < timers; i++) {
141 l = hpet_readl(HPET_Tn_CFG(i));
142 h = hpet_readl(HPET_Tn_CFG(i)+4);
143 printk(KERN_INFO "hpet: T%d: CFG_l: 0x%x, CFG_h: 0x%x\n",
144 i, l, h);
145 l = hpet_readl(HPET_Tn_CMP(i));
146 h = hpet_readl(HPET_Tn_CMP(i)+4);
147 printk(KERN_INFO "hpet: T%d: CMP_l: 0x%x, CMP_h: 0x%x\n",
148 i, l, h);
149 l = hpet_readl(HPET_Tn_ROUTE(i));
150 h = hpet_readl(HPET_Tn_ROUTE(i)+4);
151 printk(KERN_INFO "hpet: T%d ROUTE_l: 0x%x, ROUTE_h: 0x%x\n",
152 i, l, h);
153 }
154}
155
156#define hpet_print_config() \
157do { \
158 if (hpet_verbose) \
159 _hpet_print_config(__FUNCTION__, __LINE__); \
160} while (0)
161
122/* 162/*
123 * When the hpet driver (/dev/hpet) is enabled, we need to reserve 163 * When the hpet driver (/dev/hpet) is enabled, we need to reserve
124 * timer 0 and timer 1 in case of RTC emulation. 164 * timer 0 and timer 1 in case of RTC emulation.
@@ -191,27 +231,37 @@ static struct clock_event_device hpet_clockevent = {
191 .rating = 50, 231 .rating = 50,
192}; 232};
193 233
194static void hpet_start_counter(void) 234static void hpet_stop_counter(void)
195{ 235{
196 unsigned long cfg = hpet_readl(HPET_CFG); 236 unsigned long cfg = hpet_readl(HPET_CFG);
197
198 cfg &= ~HPET_CFG_ENABLE; 237 cfg &= ~HPET_CFG_ENABLE;
199 hpet_writel(cfg, HPET_CFG); 238 hpet_writel(cfg, HPET_CFG);
200 hpet_writel(0, HPET_COUNTER); 239 hpet_writel(0, HPET_COUNTER);
201 hpet_writel(0, HPET_COUNTER + 4); 240 hpet_writel(0, HPET_COUNTER + 4);
241}
242
243static void hpet_start_counter(void)
244{
245 unsigned long cfg = hpet_readl(HPET_CFG);
202 cfg |= HPET_CFG_ENABLE; 246 cfg |= HPET_CFG_ENABLE;
203 hpet_writel(cfg, HPET_CFG); 247 hpet_writel(cfg, HPET_CFG);
204} 248}
205 249
250static void hpet_restart_counter(void)
251{
252 hpet_stop_counter();
253 hpet_start_counter();
254}
255
206static void hpet_resume_device(void) 256static void hpet_resume_device(void)
207{ 257{
208 force_hpet_resume(); 258 force_hpet_resume();
209} 259}
210 260
211static void hpet_restart_counter(void) 261static void hpet_resume_counter(void)
212{ 262{
213 hpet_resume_device(); 263 hpet_resume_device();
214 hpet_start_counter(); 264 hpet_restart_counter();
215} 265}
216 266
217static void hpet_enable_legacy_int(void) 267static void hpet_enable_legacy_int(void)
@@ -259,29 +309,23 @@ static int hpet_setup_msi_irq(unsigned int irq);
259static void hpet_set_mode(enum clock_event_mode mode, 309static void hpet_set_mode(enum clock_event_mode mode,
260 struct clock_event_device *evt, int timer) 310 struct clock_event_device *evt, int timer)
261{ 311{
262 unsigned long cfg, cmp, now; 312 unsigned long cfg;
263 uint64_t delta; 313 uint64_t delta;
264 314
265 switch (mode) { 315 switch (mode) {
266 case CLOCK_EVT_MODE_PERIODIC: 316 case CLOCK_EVT_MODE_PERIODIC:
317 hpet_stop_counter();
267 delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * evt->mult; 318 delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * evt->mult;
268 delta >>= evt->shift; 319 delta >>= evt->shift;
269 now = hpet_readl(HPET_COUNTER);
270 cmp = now + (unsigned long) delta;
271 cfg = hpet_readl(HPET_Tn_CFG(timer)); 320 cfg = hpet_readl(HPET_Tn_CFG(timer));
272 /* Make sure we use edge triggered interrupts */ 321 /* Make sure we use edge triggered interrupts */
273 cfg &= ~HPET_TN_LEVEL; 322 cfg &= ~HPET_TN_LEVEL;
274 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | 323 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC |
275 HPET_TN_SETVAL | HPET_TN_32BIT; 324 HPET_TN_SETVAL | HPET_TN_32BIT;
276 hpet_writel(cfg, HPET_Tn_CFG(timer)); 325 hpet_writel(cfg, HPET_Tn_CFG(timer));
277 /*
278 * The first write after writing TN_SETVAL to the
279 * config register sets the counter value, the second
280 * write sets the period.
281 */
282 hpet_writel(cmp, HPET_Tn_CMP(timer));
283 udelay(1);
284 hpet_writel((unsigned long) delta, HPET_Tn_CMP(timer)); 326 hpet_writel((unsigned long) delta, HPET_Tn_CMP(timer));
327 hpet_start_counter();
328 hpet_print_config();
285 break; 329 break;
286 330
287 case CLOCK_EVT_MODE_ONESHOT: 331 case CLOCK_EVT_MODE_ONESHOT:
@@ -308,6 +352,7 @@ static void hpet_set_mode(enum clock_event_mode mode,
308 irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu)); 352 irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu));
309 enable_irq(hdev->irq); 353 enable_irq(hdev->irq);
310 } 354 }
355 hpet_print_config();
311 break; 356 break;
312 } 357 }
313} 358}
@@ -526,6 +571,7 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)
526 571
527 num_timers = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT); 572 num_timers = ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT);
528 num_timers++; /* Value read out starts from 0 */ 573 num_timers++; /* Value read out starts from 0 */
574 hpet_print_config();
529 575
530 hpet_devs = kzalloc(sizeof(struct hpet_dev) * num_timers, GFP_KERNEL); 576 hpet_devs = kzalloc(sizeof(struct hpet_dev) * num_timers, GFP_KERNEL);
531 if (!hpet_devs) 577 if (!hpet_devs)
@@ -695,7 +741,7 @@ static struct clocksource clocksource_hpet = {
695 .mask = HPET_MASK, 741 .mask = HPET_MASK,
696 .shift = HPET_SHIFT, 742 .shift = HPET_SHIFT,
697 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 743 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
698 .resume = hpet_restart_counter, 744 .resume = hpet_resume_counter,
699#ifdef CONFIG_X86_64 745#ifdef CONFIG_X86_64
700 .vread = vread_hpet, 746 .vread = vread_hpet,
701#endif 747#endif
@@ -707,7 +753,7 @@ static int hpet_clocksource_register(void)
707 cycle_t t1; 753 cycle_t t1;
708 754
709 /* Start the counter */ 755 /* Start the counter */
710 hpet_start_counter(); 756 hpet_restart_counter();
711 757
712 /* Verify whether hpet counter works */ 758 /* Verify whether hpet counter works */
713 t1 = read_hpet(); 759 t1 = read_hpet();
@@ -793,6 +839,7 @@ int __init hpet_enable(void)
793 * information and the number of channels 839 * information and the number of channels
794 */ 840 */
795 id = hpet_readl(HPET_ID); 841 id = hpet_readl(HPET_ID);
842 hpet_print_config();
796 843
797#ifdef CONFIG_HPET_EMULATE_RTC 844#ifdef CONFIG_HPET_EMULATE_RTC
798 /* 845 /*
@@ -845,6 +892,7 @@ static __init int hpet_late_init(void)
845 return -ENODEV; 892 return -ENODEV;
846 893
847 hpet_reserve_platform_timers(hpet_readl(HPET_ID)); 894 hpet_reserve_platform_timers(hpet_readl(HPET_ID));
895 hpet_print_config();
848 896
849 for_each_online_cpu(cpu) { 897 for_each_online_cpu(cpu) {
850 hpet_cpuhp_notify(NULL, CPU_ONLINE, (void *)(long)cpu); 898 hpet_cpuhp_notify(NULL, CPU_ONLINE, (void *)(long)cpu);
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index 11d5093eb281..df89102bef80 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -22,7 +22,6 @@
22#include <asm/pgtable.h> 22#include <asm/pgtable.h>
23#include <asm/desc.h> 23#include <asm/desc.h>
24#include <asm/apic.h> 24#include <asm/apic.h>
25#include <asm/arch_hooks.h>
26#include <asm/i8259.h> 25#include <asm/i8259.h>
27 26
28/* 27/*
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index b12208f4dfee..99c4d308f16b 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -85,19 +85,8 @@ asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
85 85
86 t->io_bitmap_max = bytes; 86 t->io_bitmap_max = bytes;
87 87
88#ifdef CONFIG_X86_32
89 /*
90 * Sets the lazy trigger so that the next I/O operation will
91 * reload the correct bitmap.
92 * Reset the owner so that a process switch will not set
93 * tss->io_bitmap_base to IO_BITMAP_OFFSET.
94 */
95 tss->x86_tss.io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY;
96 tss->io_bitmap_owner = NULL;
97#else
98 /* Update the TSS: */ 88 /* Update the TSS: */
99 memcpy(tss->io_bitmap, t->io_bitmap_ptr, bytes_updated); 89 memcpy(tss->io_bitmap, t->io_bitmap_ptr, bytes_updated);
100#endif
101 90
102 put_cpu(); 91 put_cpu();
103 92
@@ -131,9 +120,8 @@ static int do_iopl(unsigned int level, struct pt_regs *regs)
131} 120}
132 121
133#ifdef CONFIG_X86_32 122#ifdef CONFIG_X86_32
134asmlinkage long sys_iopl(unsigned long regsp) 123long sys_iopl(struct pt_regs *regs)
135{ 124{
136 struct pt_regs *regs = (struct pt_regs *)&regsp;
137 unsigned int level = regs->bx; 125 unsigned int level = regs->bx;
138 struct thread_struct *t = &current->thread; 126 struct thread_struct *t = &current->thread;
139 int rc; 127 int rc;
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
deleted file mode 100644
index 285bbf8831fa..000000000000
--- a/arch/x86/kernel/ipi.c
+++ /dev/null
@@ -1,190 +0,0 @@
1#include <linux/cpumask.h>
2#include <linux/interrupt.h>
3#include <linux/init.h>
4
5#include <linux/mm.h>
6#include <linux/delay.h>
7#include <linux/spinlock.h>
8#include <linux/kernel_stat.h>
9#include <linux/mc146818rtc.h>
10#include <linux/cache.h>
11#include <linux/cpu.h>
12#include <linux/module.h>
13
14#include <asm/smp.h>
15#include <asm/mtrr.h>
16#include <asm/tlbflush.h>
17#include <asm/mmu_context.h>
18#include <asm/apic.h>
19#include <asm/proto.h>
20
21#ifdef CONFIG_X86_32
22#include <mach_apic.h>
23#include <mach_ipi.h>
24
25/*
26 * the following functions deal with sending IPIs between CPUs.
27 *
28 * We use 'broadcast', CPU->CPU IPIs and self-IPIs too.
29 */
30
31static inline int __prepare_ICR(unsigned int shortcut, int vector)
32{
33 unsigned int icr = shortcut | APIC_DEST_LOGICAL;
34
35 switch (vector) {
36 default:
37 icr |= APIC_DM_FIXED | vector;
38 break;
39 case NMI_VECTOR:
40 icr |= APIC_DM_NMI;
41 break;
42 }
43 return icr;
44}
45
46static inline int __prepare_ICR2(unsigned int mask)
47{
48 return SET_APIC_DEST_FIELD(mask);
49}
50
51void __send_IPI_shortcut(unsigned int shortcut, int vector)
52{
53 /*
54 * Subtle. In the case of the 'never do double writes' workaround
55 * we have to lock out interrupts to be safe. As we don't care
56 * of the value read we use an atomic rmw access to avoid costly
57 * cli/sti. Otherwise we use an even cheaper single atomic write
58 * to the APIC.
59 */
60 unsigned int cfg;
61
62 /*
63 * Wait for idle.
64 */
65 apic_wait_icr_idle();
66
67 /*
68 * No need to touch the target chip field
69 */
70 cfg = __prepare_ICR(shortcut, vector);
71
72 /*
73 * Send the IPI. The write to APIC_ICR fires this off.
74 */
75 apic_write(APIC_ICR, cfg);
76}
77
78void send_IPI_self(int vector)
79{
80 __send_IPI_shortcut(APIC_DEST_SELF, vector);
81}
82
83/*
84 * This is used to send an IPI with no shorthand notation (the destination is
85 * specified in bits 56 to 63 of the ICR).
86 */
87static inline void __send_IPI_dest_field(unsigned long mask, int vector)
88{
89 unsigned long cfg;
90
91 /*
92 * Wait for idle.
93 */
94 if (unlikely(vector == NMI_VECTOR))
95 safe_apic_wait_icr_idle();
96 else
97 apic_wait_icr_idle();
98
99 /*
100 * prepare target chip field
101 */
102 cfg = __prepare_ICR2(mask);
103 apic_write(APIC_ICR2, cfg);
104
105 /*
106 * program the ICR
107 */
108 cfg = __prepare_ICR(0, vector);
109
110 /*
111 * Send the IPI. The write to APIC_ICR fires this off.
112 */
113 apic_write(APIC_ICR, cfg);
114}
115
116/*
117 * This is only used on smaller machines.
118 */
119void send_IPI_mask_bitmask(const struct cpumask *cpumask, int vector)
120{
121 unsigned long mask = cpumask_bits(cpumask)[0];
122 unsigned long flags;
123
124 local_irq_save(flags);
125 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);
126 __send_IPI_dest_field(mask, vector);
127 local_irq_restore(flags);
128}
129
130void send_IPI_mask_sequence(const struct cpumask *mask, int vector)
131{
132 unsigned long flags;
133 unsigned int query_cpu;
134
135 /*
136 * Hack. The clustered APIC addressing mode doesn't allow us to send
137 * to an arbitrary mask, so I do a unicasts to each CPU instead. This
138 * should be modified to do 1 message per cluster ID - mbligh
139 */
140
141 local_irq_save(flags);
142 for_each_cpu(query_cpu, mask)
143 __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu), vector);
144 local_irq_restore(flags);
145}
146
147void send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
148{
149 unsigned long flags;
150 unsigned int query_cpu;
151 unsigned int this_cpu = smp_processor_id();
152
153 /* See Hack comment above */
154
155 local_irq_save(flags);
156 for_each_cpu(query_cpu, mask)
157 if (query_cpu != this_cpu)
158 __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu),
159 vector);
160 local_irq_restore(flags);
161}
162
163/* must come after the send_IPI functions above for inlining */
164static int convert_apicid_to_cpu(int apic_id)
165{
166 int i;
167
168 for_each_possible_cpu(i) {
169 if (per_cpu(x86_cpu_to_apicid, i) == apic_id)
170 return i;
171 }
172 return -1;
173}
174
175int safe_smp_processor_id(void)
176{
177 int apicid, cpuid;
178
179 if (!boot_cpu_has(X86_FEATURE_APIC))
180 return 0;
181
182 apicid = hard_smp_processor_id();
183 if (apicid == BAD_APICID)
184 return 0;
185
186 cpuid = convert_apicid_to_cpu(apicid);
187
188 return cpuid >= 0 ? cpuid : 0;
189}
190#endif
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 3973e2df7f87..f13ca1650aaf 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -6,10 +6,12 @@
6#include <linux/kernel_stat.h> 6#include <linux/kernel_stat.h>
7#include <linux/seq_file.h> 7#include <linux/seq_file.h>
8#include <linux/smp.h> 8#include <linux/smp.h>
9#include <linux/ftrace.h>
9 10
10#include <asm/apic.h> 11#include <asm/apic.h>
11#include <asm/io_apic.h> 12#include <asm/io_apic.h>
12#include <asm/irq.h> 13#include <asm/irq.h>
14#include <asm/idle.h>
13 15
14atomic_t irq_err_count; 16atomic_t irq_err_count;
15 17
@@ -36,11 +38,7 @@ void ack_bad_irq(unsigned int irq)
36#endif 38#endif
37} 39}
38 40
39#ifdef CONFIG_X86_32 41#define irq_stats(x) (&per_cpu(irq_stat, x))
40# define irq_stats(x) (&per_cpu(irq_stat, x))
41#else
42# define irq_stats(x) cpu_pda(x)
43#endif
44/* 42/*
45 * /proc/interrupts printing: 43 * /proc/interrupts printing:
46 */ 44 */
@@ -192,4 +190,40 @@ u64 arch_irq_stat(void)
192 return sum; 190 return sum;
193} 191}
194 192
193
194/*
195 * do_IRQ handles all normal device IRQ's (the special
196 * SMP cross-CPU interrupts have their own specific
197 * handlers).
198 */
199unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
200{
201 struct pt_regs *old_regs = set_irq_regs(regs);
202
203 /* high bit used in ret_from_ code */
204 unsigned vector = ~regs->orig_ax;
205 unsigned irq;
206
207 exit_idle();
208 irq_enter();
209
210 irq = __get_cpu_var(vector_irq)[vector];
211
212 if (!handle_irq(irq, regs)) {
213#ifdef CONFIG_X86_64
214 if (!disable_apic)
215 ack_APIC_irq();
216#endif
217
218 if (printk_ratelimit())
219 printk(KERN_EMERG "%s: %d.%d No irq handler for vector (irq %d)\n",
220 __func__, smp_processor_id(), vector, irq);
221 }
222
223 irq_exit();
224
225 set_irq_regs(old_regs);
226 return 1;
227}
228
195EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); 229EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 74b9ff7341e9..3b09634a5153 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -16,6 +16,7 @@
16#include <linux/cpu.h> 16#include <linux/cpu.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/uaccess.h> 18#include <linux/uaccess.h>
19#include <linux/percpu.h>
19 20
20#include <asm/apic.h> 21#include <asm/apic.h>
21 22
@@ -55,13 +56,13 @@ static inline void print_stack_overflow(void) { }
55union irq_ctx { 56union irq_ctx {
56 struct thread_info tinfo; 57 struct thread_info tinfo;
57 u32 stack[THREAD_SIZE/sizeof(u32)]; 58 u32 stack[THREAD_SIZE/sizeof(u32)];
58}; 59} __attribute__((aligned(PAGE_SIZE)));
59 60
60static union irq_ctx *hardirq_ctx[NR_CPUS] __read_mostly; 61static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx);
61static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly; 62static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx);
62 63
63static char softirq_stack[NR_CPUS * THREAD_SIZE] __page_aligned_bss; 64static DEFINE_PER_CPU_PAGE_ALIGNED(union irq_ctx, hardirq_stack);
64static char hardirq_stack[NR_CPUS * THREAD_SIZE] __page_aligned_bss; 65static DEFINE_PER_CPU_PAGE_ALIGNED(union irq_ctx, softirq_stack);
65 66
66static void call_on_stack(void *func, void *stack) 67static void call_on_stack(void *func, void *stack)
67{ 68{
@@ -81,7 +82,7 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
81 u32 *isp, arg1, arg2; 82 u32 *isp, arg1, arg2;
82 83
83 curctx = (union irq_ctx *) current_thread_info(); 84 curctx = (union irq_ctx *) current_thread_info();
84 irqctx = hardirq_ctx[smp_processor_id()]; 85 irqctx = __get_cpu_var(hardirq_ctx);
85 86
86 /* 87 /*
87 * this is where we switch to the IRQ stack. However, if we are 88 * this is where we switch to the IRQ stack. However, if we are
@@ -125,34 +126,34 @@ void __cpuinit irq_ctx_init(int cpu)
125{ 126{
126 union irq_ctx *irqctx; 127 union irq_ctx *irqctx;
127 128
128 if (hardirq_ctx[cpu]) 129 if (per_cpu(hardirq_ctx, cpu))
129 return; 130 return;
130 131
131 irqctx = (union irq_ctx*) &hardirq_stack[cpu*THREAD_SIZE]; 132 irqctx = &per_cpu(hardirq_stack, cpu);
132 irqctx->tinfo.task = NULL; 133 irqctx->tinfo.task = NULL;
133 irqctx->tinfo.exec_domain = NULL; 134 irqctx->tinfo.exec_domain = NULL;
134 irqctx->tinfo.cpu = cpu; 135 irqctx->tinfo.cpu = cpu;
135 irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; 136 irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
136 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); 137 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
137 138
138 hardirq_ctx[cpu] = irqctx; 139 per_cpu(hardirq_ctx, cpu) = irqctx;
139 140
140 irqctx = (union irq_ctx *) &softirq_stack[cpu*THREAD_SIZE]; 141 irqctx = &per_cpu(softirq_stack, cpu);
141 irqctx->tinfo.task = NULL; 142 irqctx->tinfo.task = NULL;
142 irqctx->tinfo.exec_domain = NULL; 143 irqctx->tinfo.exec_domain = NULL;
143 irqctx->tinfo.cpu = cpu; 144 irqctx->tinfo.cpu = cpu;
144 irqctx->tinfo.preempt_count = 0; 145 irqctx->tinfo.preempt_count = 0;
145 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); 146 irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
146 147
147 softirq_ctx[cpu] = irqctx; 148 per_cpu(softirq_ctx, cpu) = irqctx;
148 149
149 printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", 150 printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n",
150 cpu, hardirq_ctx[cpu], softirq_ctx[cpu]); 151 cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu));
151} 152}
152 153
153void irq_ctx_exit(int cpu) 154void irq_ctx_exit(int cpu)
154{ 155{
155 hardirq_ctx[cpu] = NULL; 156 per_cpu(hardirq_ctx, cpu) = NULL;
156} 157}
157 158
158asmlinkage void do_softirq(void) 159asmlinkage void do_softirq(void)
@@ -169,7 +170,7 @@ asmlinkage void do_softirq(void)
169 170
170 if (local_softirq_pending()) { 171 if (local_softirq_pending()) {
171 curctx = current_thread_info(); 172 curctx = current_thread_info();
172 irqctx = softirq_ctx[smp_processor_id()]; 173 irqctx = __get_cpu_var(softirq_ctx);
173 irqctx->tinfo.task = curctx->task; 174 irqctx->tinfo.task = curctx->task;
174 irqctx->tinfo.previous_esp = current_stack_pointer; 175 irqctx->tinfo.previous_esp = current_stack_pointer;
175 176
@@ -191,33 +192,16 @@ static inline int
191execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) { return 0; } 192execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) { return 0; }
192#endif 193#endif
193 194
194/* 195bool handle_irq(unsigned irq, struct pt_regs *regs)
195 * do_IRQ handles all normal device IRQ's (the special
196 * SMP cross-CPU interrupts have their own specific
197 * handlers).
198 */
199unsigned int do_IRQ(struct pt_regs *regs)
200{ 196{
201 struct pt_regs *old_regs;
202 /* high bit used in ret_from_ code */
203 int overflow;
204 unsigned vector = ~regs->orig_ax;
205 struct irq_desc *desc; 197 struct irq_desc *desc;
206 unsigned irq; 198 int overflow;
207
208
209 old_regs = set_irq_regs(regs);
210 irq_enter();
211 irq = __get_cpu_var(vector_irq)[vector];
212 199
213 overflow = check_stack_overflow(); 200 overflow = check_stack_overflow();
214 201
215 desc = irq_to_desc(irq); 202 desc = irq_to_desc(irq);
216 if (unlikely(!desc)) { 203 if (unlikely(!desc))
217 printk(KERN_EMERG "%s: cannot handle IRQ %d vector %#x cpu %d\n", 204 return false;
218 __func__, irq, vector, smp_processor_id());
219 BUG();
220 }
221 205
222 if (!execute_on_irq_stack(overflow, desc, irq)) { 206 if (!execute_on_irq_stack(overflow, desc, irq)) {
223 if (unlikely(overflow)) 207 if (unlikely(overflow))
@@ -225,13 +209,10 @@ unsigned int do_IRQ(struct pt_regs *regs)
225 desc->handle_irq(irq, desc); 209 desc->handle_irq(irq, desc);
226 } 210 }
227 211
228 irq_exit(); 212 return true;
229 set_irq_regs(old_regs);
230 return 1;
231} 213}
232 214
233#ifdef CONFIG_HOTPLUG_CPU 215#ifdef CONFIG_HOTPLUG_CPU
234#include <mach_apic.h>
235 216
236/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */ 217/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
237void fixup_irqs(void) 218void fixup_irqs(void)
@@ -248,7 +229,7 @@ void fixup_irqs(void)
248 if (irq == 2) 229 if (irq == 2)
249 continue; 230 continue;
250 231
251 affinity = &desc->affinity; 232 affinity = desc->affinity;
252 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { 233 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
253 printk("Breaking affinity for irq %i\n", irq); 234 printk("Breaking affinity for irq %i\n", irq);
254 affinity = cpu_all_mask; 235 affinity = cpu_all_mask;
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 63c88e6ec025..977d8b43a0dd 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -18,6 +18,13 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <asm/io_apic.h> 19#include <asm/io_apic.h>
20#include <asm/idle.h> 20#include <asm/idle.h>
21#include <asm/apic.h>
22
23DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
24EXPORT_PER_CPU_SYMBOL(irq_stat);
25
26DEFINE_PER_CPU(struct pt_regs *, irq_regs);
27EXPORT_PER_CPU_SYMBOL(irq_regs);
21 28
22/* 29/*
23 * Probabilistic stack overflow check: 30 * Probabilistic stack overflow check:
@@ -41,42 +48,18 @@ static inline void stack_overflow_check(struct pt_regs *regs)
41#endif 48#endif
42} 49}
43 50
44/* 51bool handle_irq(unsigned irq, struct pt_regs *regs)
45 * do_IRQ handles all normal device IRQ's (the special
46 * SMP cross-CPU interrupts have their own specific
47 * handlers).
48 */
49asmlinkage unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
50{ 52{
51 struct pt_regs *old_regs = set_irq_regs(regs);
52 struct irq_desc *desc; 53 struct irq_desc *desc;
53 54
54 /* high bit used in ret_from_ code */
55 unsigned vector = ~regs->orig_ax;
56 unsigned irq;
57
58 exit_idle();
59 irq_enter();
60 irq = __get_cpu_var(vector_irq)[vector];
61
62 stack_overflow_check(regs); 55 stack_overflow_check(regs);
63 56
64 desc = irq_to_desc(irq); 57 desc = irq_to_desc(irq);
65 if (likely(desc)) 58 if (unlikely(!desc))
66 generic_handle_irq_desc(irq, desc); 59 return false;
67 else {
68 if (!disable_apic)
69 ack_APIC_irq();
70
71 if (printk_ratelimit())
72 printk(KERN_EMERG "%s: %d.%d No irq handler for vector\n",
73 __func__, smp_processor_id(), vector);
74 }
75
76 irq_exit();
77 60
78 set_irq_regs(old_regs); 61 generic_handle_irq_desc(irq, desc);
79 return 1; 62 return true;
80} 63}
81 64
82#ifdef CONFIG_HOTPLUG_CPU 65#ifdef CONFIG_HOTPLUG_CPU
@@ -100,7 +83,7 @@ void fixup_irqs(void)
100 /* interrupt's are disabled at this point */ 83 /* interrupt's are disabled at this point */
101 spin_lock(&desc->lock); 84 spin_lock(&desc->lock);
102 85
103 affinity = &desc->affinity; 86 affinity = desc->affinity;
104 if (!irq_has_action(irq) || 87 if (!irq_has_action(irq) ||
105 cpumask_equal(affinity, cpu_online_mask)) { 88 cpumask_equal(affinity, cpu_online_mask)) {
106 spin_unlock(&desc->lock); 89 spin_unlock(&desc->lock);
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index 10a09c2f1828..50b8c3a3006c 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -18,7 +18,7 @@
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/desc.h> 19#include <asm/desc.h>
20#include <asm/apic.h> 20#include <asm/apic.h>
21#include <asm/arch_hooks.h> 21#include <asm/setup.h>
22#include <asm/i8259.h> 22#include <asm/i8259.h>
23#include <asm/traps.h> 23#include <asm/traps.h>
24 24
@@ -78,6 +78,15 @@ void __init init_ISA_irqs(void)
78 } 78 }
79} 79}
80 80
81/*
82 * IRQ2 is cascade interrupt to second interrupt controller
83 */
84static struct irqaction irq2 = {
85 .handler = no_action,
86 .mask = CPU_MASK_NONE,
87 .name = "cascade",
88};
89
81DEFINE_PER_CPU(vector_irq_t, vector_irq) = { 90DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
82 [0 ... IRQ0_VECTOR - 1] = -1, 91 [0 ... IRQ0_VECTOR - 1] = -1,
83 [IRQ0_VECTOR] = 0, 92 [IRQ0_VECTOR] = 0,
@@ -118,8 +127,8 @@ void __init native_init_IRQ(void)
118{ 127{
119 int i; 128 int i;
120 129
121 /* all the set up before the call gates are initialised */ 130 /* Execute any quirks before the call gates are initialised: */
122 pre_intr_init_hook(); 131 x86_quirk_pre_intr_init();
123 132
124 /* 133 /*
125 * Cover the whole vector space, no vector can escape 134 * Cover the whole vector space, no vector can escape
@@ -140,8 +149,15 @@ void __init native_init_IRQ(void)
140 */ 149 */
141 alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt); 150 alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt);
142 151
143 /* IPI for invalidation */ 152 /* IPIs for invalidation */
144 alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt); 153 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+0, invalidate_interrupt0);
154 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+1, invalidate_interrupt1);
155 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+2, invalidate_interrupt2);
156 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+3, invalidate_interrupt3);
157 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+4, invalidate_interrupt4);
158 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+5, invalidate_interrupt5);
159 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+6, invalidate_interrupt6);
160 alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+7, invalidate_interrupt7);
145 161
146 /* IPI for generic function call */ 162 /* IPI for generic function call */
147 alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); 163 alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
@@ -169,10 +185,14 @@ void __init native_init_IRQ(void)
169 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); 185 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
170#endif 186#endif
171 187
172 /* setup after call gates are initialised (usually add in 188 if (!acpi_ioapic)
173 * the architecture specific gates) 189 setup_irq(2, &irq2);
190
191 /*
192 * Call quirks after call gates are initialised (usually add in
193 * the architecture specific gates):
174 */ 194 */
175 intr_init_hook(); 195 x86_quirk_intr_init();
176 196
177 /* 197 /*
178 * External FPU? Set up irq13 if so, for 198 * External FPU? Set up irq13 if so, for
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 10435a120d22..eedfaebe1063 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -46,7 +46,7 @@
46#include <asm/apicdef.h> 46#include <asm/apicdef.h>
47#include <asm/system.h> 47#include <asm/system.h>
48 48
49#include <mach_ipi.h> 49#include <asm/apic.h>
50 50
51/* 51/*
52 * Put the error code here just in case the user cares: 52 * Put the error code here just in case the user cares:
@@ -347,7 +347,7 @@ void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
347 */ 347 */
348void kgdb_roundup_cpus(unsigned long flags) 348void kgdb_roundup_cpus(unsigned long flags)
349{ 349{
350 send_IPI_allbutself(APIC_DM_NMI); 350 apic->send_IPI_allbutself(APIC_DM_NMI);
351} 351}
352#endif 352#endif
353 353
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 652fce6d2cce..137f2e8132df 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -19,7 +19,6 @@
19#include <linux/clocksource.h> 19#include <linux/clocksource.h>
20#include <linux/kvm_para.h> 20#include <linux/kvm_para.h>
21#include <asm/pvclock.h> 21#include <asm/pvclock.h>
22#include <asm/arch_hooks.h>
23#include <asm/msr.h> 22#include <asm/msr.h>
24#include <asm/apic.h> 23#include <asm/apic.h>
25#include <linux/percpu.h> 24#include <linux/percpu.h>
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index 37f420018a41..f5fc8c781a62 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -121,7 +121,7 @@ static void machine_kexec_page_table_set_one(
121static void machine_kexec_prepare_page_tables(struct kimage *image) 121static void machine_kexec_prepare_page_tables(struct kimage *image)
122{ 122{
123 void *control_page; 123 void *control_page;
124 pmd_t *pmd = 0; 124 pmd_t *pmd = NULL;
125 125
126 control_page = page_address(image->control_code_page); 126 control_page = page_address(image->control_code_page);
127#ifdef CONFIG_X86_PAE 127#ifdef CONFIG_X86_PAE
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index c43caa3a91f3..6993d51b7fd8 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -18,15 +18,6 @@
18#include <asm/mmu_context.h> 18#include <asm/mmu_context.h>
19#include <asm/io.h> 19#include <asm/io.h>
20 20
21#define PAGE_ALIGNED __attribute__ ((__aligned__(PAGE_SIZE)))
22static u64 kexec_pgd[512] PAGE_ALIGNED;
23static u64 kexec_pud0[512] PAGE_ALIGNED;
24static u64 kexec_pmd0[512] PAGE_ALIGNED;
25static u64 kexec_pte0[512] PAGE_ALIGNED;
26static u64 kexec_pud1[512] PAGE_ALIGNED;
27static u64 kexec_pmd1[512] PAGE_ALIGNED;
28static u64 kexec_pte1[512] PAGE_ALIGNED;
29
30static void init_level2_page(pmd_t *level2p, unsigned long addr) 21static void init_level2_page(pmd_t *level2p, unsigned long addr)
31{ 22{
32 unsigned long end_addr; 23 unsigned long end_addr;
@@ -107,12 +98,65 @@ out:
107 return result; 98 return result;
108} 99}
109 100
101static void free_transition_pgtable(struct kimage *image)
102{
103 free_page((unsigned long)image->arch.pud);
104 free_page((unsigned long)image->arch.pmd);
105 free_page((unsigned long)image->arch.pte);
106}
107
108static int init_transition_pgtable(struct kimage *image, pgd_t *pgd)
109{
110 pud_t *pud;
111 pmd_t *pmd;
112 pte_t *pte;
113 unsigned long vaddr, paddr;
114 int result = -ENOMEM;
115
116 vaddr = (unsigned long)relocate_kernel;
117 paddr = __pa(page_address(image->control_code_page)+PAGE_SIZE);
118 pgd += pgd_index(vaddr);
119 if (!pgd_present(*pgd)) {
120 pud = (pud_t *)get_zeroed_page(GFP_KERNEL);
121 if (!pud)
122 goto err;
123 image->arch.pud = pud;
124 set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE));
125 }
126 pud = pud_offset(pgd, vaddr);
127 if (!pud_present(*pud)) {
128 pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL);
129 if (!pmd)
130 goto err;
131 image->arch.pmd = pmd;
132 set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE));
133 }
134 pmd = pmd_offset(pud, vaddr);
135 if (!pmd_present(*pmd)) {
136 pte = (pte_t *)get_zeroed_page(GFP_KERNEL);
137 if (!pte)
138 goto err;
139 image->arch.pte = pte;
140 set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE));
141 }
142 pte = pte_offset_kernel(pmd, vaddr);
143 set_pte(pte, pfn_pte(paddr >> PAGE_SHIFT, PAGE_KERNEL_EXEC));
144 return 0;
145err:
146 free_transition_pgtable(image);
147 return result;
148}
149
110 150
111static int init_pgtable(struct kimage *image, unsigned long start_pgtable) 151static int init_pgtable(struct kimage *image, unsigned long start_pgtable)
112{ 152{
113 pgd_t *level4p; 153 pgd_t *level4p;
154 int result;
114 level4p = (pgd_t *)__va(start_pgtable); 155 level4p = (pgd_t *)__va(start_pgtable);
115 return init_level4_page(image, level4p, 0, max_pfn << PAGE_SHIFT); 156 result = init_level4_page(image, level4p, 0, max_pfn << PAGE_SHIFT);
157 if (result)
158 return result;
159 return init_transition_pgtable(image, level4p);
116} 160}
117 161
118static void set_idt(void *newidt, u16 limit) 162static void set_idt(void *newidt, u16 limit)
@@ -174,7 +218,7 @@ int machine_kexec_prepare(struct kimage *image)
174 218
175void machine_kexec_cleanup(struct kimage *image) 219void machine_kexec_cleanup(struct kimage *image)
176{ 220{
177 return; 221 free_transition_pgtable(image);
178} 222}
179 223
180/* 224/*
@@ -195,22 +239,6 @@ void machine_kexec(struct kimage *image)
195 memcpy(control_page, relocate_kernel, PAGE_SIZE); 239 memcpy(control_page, relocate_kernel, PAGE_SIZE);
196 240
197 page_list[PA_CONTROL_PAGE] = virt_to_phys(control_page); 241 page_list[PA_CONTROL_PAGE] = virt_to_phys(control_page);
198 page_list[VA_CONTROL_PAGE] = (unsigned long)relocate_kernel;
199 page_list[PA_PGD] = virt_to_phys(&kexec_pgd);
200 page_list[VA_PGD] = (unsigned long)kexec_pgd;
201 page_list[PA_PUD_0] = virt_to_phys(&kexec_pud0);
202 page_list[VA_PUD_0] = (unsigned long)kexec_pud0;
203 page_list[PA_PMD_0] = virt_to_phys(&kexec_pmd0);
204 page_list[VA_PMD_0] = (unsigned long)kexec_pmd0;
205 page_list[PA_PTE_0] = virt_to_phys(&kexec_pte0);
206 page_list[VA_PTE_0] = (unsigned long)kexec_pte0;
207 page_list[PA_PUD_1] = virt_to_phys(&kexec_pud1);
208 page_list[VA_PUD_1] = (unsigned long)kexec_pud1;
209 page_list[PA_PMD_1] = virt_to_phys(&kexec_pmd1);
210 page_list[VA_PMD_1] = (unsigned long)kexec_pmd1;
211 page_list[PA_PTE_1] = virt_to_phys(&kexec_pte1);
212 page_list[VA_PTE_1] = (unsigned long)kexec_pte1;
213
214 page_list[PA_TABLE_PAGE] = 242 page_list[PA_TABLE_PAGE] =
215 (unsigned long)__pa(page_address(image->control_code_page)); 243 (unsigned long)__pa(page_address(image->control_code_page));
216 244
diff --git a/arch/x86/kernel/mca_32.c b/arch/x86/kernel/mca_32.c
index 2dc183758be3..845d80ce1ef1 100644
--- a/arch/x86/kernel/mca_32.c
+++ b/arch/x86/kernel/mca_32.c
@@ -51,7 +51,6 @@
51#include <linux/ioport.h> 51#include <linux/ioport.h>
52#include <asm/uaccess.h> 52#include <asm/uaccess.h>
53#include <linux/init.h> 53#include <linux/init.h>
54#include <asm/arch_hooks.h>
55 54
56static unsigned char which_scsi; 55static unsigned char which_scsi;
57 56
@@ -474,6 +473,4 @@ void __kprobes mca_handle_nmi(void)
474 * adapter was responsible for the error. 473 * adapter was responsible for the error.
475 */ 474 */
476 bus_for_each_dev(&mca_bus_type, NULL, NULL, mca_handle_nmi_callback); 475 bus_for_each_dev(&mca_bus_type, NULL, NULL, mca_handle_nmi_callback);
477 476}
478 mca_nmi_hook();
479} /* mca_handle_nmi */
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c
index b7f4c929e615..5e9f4fc51385 100644
--- a/arch/x86/kernel/microcode_intel.c
+++ b/arch/x86/kernel/microcode_intel.c
@@ -87,9 +87,9 @@
87#include <linux/cpu.h> 87#include <linux/cpu.h>
88#include <linux/firmware.h> 88#include <linux/firmware.h>
89#include <linux/platform_device.h> 89#include <linux/platform_device.h>
90#include <linux/uaccess.h>
90 91
91#include <asm/msr.h> 92#include <asm/msr.h>
92#include <asm/uaccess.h>
93#include <asm/processor.h> 93#include <asm/processor.h>
94#include <asm/microcode.h> 94#include <asm/microcode.h>
95 95
@@ -196,7 +196,7 @@ static inline int update_match_cpu(struct cpu_signature *csig, int sig, int pf)
196 return (!sigmatch(sig, csig->sig, pf, csig->pf)) ? 0 : 1; 196 return (!sigmatch(sig, csig->sig, pf, csig->pf)) ? 0 : 1;
197} 197}
198 198
199static inline int 199static inline int
200update_match_revision(struct microcode_header_intel *mc_header, int rev) 200update_match_revision(struct microcode_header_intel *mc_header, int rev)
201{ 201{
202 return (mc_header->rev <= rev) ? 0 : 1; 202 return (mc_header->rev <= rev) ? 0 : 1;
@@ -442,8 +442,8 @@ static int request_microcode_fw(int cpu, struct device *device)
442 return ret; 442 return ret;
443 } 443 }
444 444
445 ret = generic_load_microcode(cpu, (void*)firmware->data, firmware->size, 445 ret = generic_load_microcode(cpu, (void *)firmware->data,
446 &get_ucode_fw); 446 firmware->size, &get_ucode_fw);
447 447
448 release_firmware(firmware); 448 release_firmware(firmware);
449 449
@@ -460,7 +460,7 @@ static int request_microcode_user(int cpu, const void __user *buf, size_t size)
460 /* We should bind the task to the CPU */ 460 /* We should bind the task to the CPU */
461 BUG_ON(cpu != raw_smp_processor_id()); 461 BUG_ON(cpu != raw_smp_processor_id());
462 462
463 return generic_load_microcode(cpu, (void*)buf, size, &get_ucode_user); 463 return generic_load_microcode(cpu, (void *)buf, size, &get_ucode_user);
464} 464}
465 465
466static void microcode_fini_cpu(int cpu) 466static void microcode_fini_cpu(int cpu)
diff --git a/arch/x86/kernel/module_32.c b/arch/x86/kernel/module_32.c
index 3db0a5442eb1..0edd819050e7 100644
--- a/arch/x86/kernel/module_32.c
+++ b/arch/x86/kernel/module_32.c
@@ -42,7 +42,7 @@ void module_free(struct module *mod, void *module_region)
42{ 42{
43 vfree(module_region); 43 vfree(module_region);
44 /* FIXME: If module_region == mod->init_region, trim exception 44 /* FIXME: If module_region == mod->init_region, trim exception
45 table entries. */ 45 table entries. */
46} 46}
47 47
48/* We don't need anything special. */ 48/* We don't need anything special. */
@@ -113,13 +113,13 @@ int module_finalize(const Elf_Ehdr *hdr,
113 *para = NULL; 113 *para = NULL;
114 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 114 char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
115 115
116 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { 116 for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
117 if (!strcmp(".text", secstrings + s->sh_name)) 117 if (!strcmp(".text", secstrings + s->sh_name))
118 text = s; 118 text = s;
119 if (!strcmp(".altinstructions", secstrings + s->sh_name)) 119 if (!strcmp(".altinstructions", secstrings + s->sh_name))
120 alt = s; 120 alt = s;
121 if (!strcmp(".smp_locks", secstrings + s->sh_name)) 121 if (!strcmp(".smp_locks", secstrings + s->sh_name))
122 locks= s; 122 locks = s;
123 if (!strcmp(".parainstructions", secstrings + s->sh_name)) 123 if (!strcmp(".parainstructions", secstrings + s->sh_name))
124 para = s; 124 para = s;
125 } 125 }
diff --git a/arch/x86/kernel/module_64.c b/arch/x86/kernel/module_64.c
index 6ba87830d4b1..c23880b90b5c 100644
--- a/arch/x86/kernel/module_64.c
+++ b/arch/x86/kernel/module_64.c
@@ -30,14 +30,14 @@
30#include <asm/page.h> 30#include <asm/page.h>
31#include <asm/pgtable.h> 31#include <asm/pgtable.h>
32 32
33#define DEBUGP(fmt...) 33#define DEBUGP(fmt...)
34 34
35#ifndef CONFIG_UML 35#ifndef CONFIG_UML
36void module_free(struct module *mod, void *module_region) 36void module_free(struct module *mod, void *module_region)
37{ 37{
38 vfree(module_region); 38 vfree(module_region);
39 /* FIXME: If module_region == mod->init_region, trim exception 39 /* FIXME: If module_region == mod->init_region, trim exception
40 table entries. */ 40 table entries. */
41} 41}
42 42
43void *module_alloc(unsigned long size) 43void *module_alloc(unsigned long size)
@@ -77,7 +77,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
77 Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr; 77 Elf64_Rela *rel = (void *)sechdrs[relsec].sh_addr;
78 Elf64_Sym *sym; 78 Elf64_Sym *sym;
79 void *loc; 79 void *loc;
80 u64 val; 80 u64 val;
81 81
82 DEBUGP("Applying relocate section %u to %u\n", relsec, 82 DEBUGP("Applying relocate section %u to %u\n", relsec,
83 sechdrs[relsec].sh_info); 83 sechdrs[relsec].sh_info);
@@ -91,11 +91,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
91 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr 91 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr
92 + ELF64_R_SYM(rel[i].r_info); 92 + ELF64_R_SYM(rel[i].r_info);
93 93
94 DEBUGP("type %d st_value %Lx r_addend %Lx loc %Lx\n", 94 DEBUGP("type %d st_value %Lx r_addend %Lx loc %Lx\n",
95 (int)ELF64_R_TYPE(rel[i].r_info), 95 (int)ELF64_R_TYPE(rel[i].r_info),
96 sym->st_value, rel[i].r_addend, (u64)loc); 96 sym->st_value, rel[i].r_addend, (u64)loc);
97 97
98 val = sym->st_value + rel[i].r_addend; 98 val = sym->st_value + rel[i].r_addend;
99 99
100 switch (ELF64_R_TYPE(rel[i].r_info)) { 100 switch (ELF64_R_TYPE(rel[i].r_info)) {
101 case R_X86_64_NONE: 101 case R_X86_64_NONE:
@@ -113,16 +113,16 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
113 if ((s64)val != *(s32 *)loc) 113 if ((s64)val != *(s32 *)loc)
114 goto overflow; 114 goto overflow;
115 break; 115 break;
116 case R_X86_64_PC32: 116 case R_X86_64_PC32:
117 val -= (u64)loc; 117 val -= (u64)loc;
118 *(u32 *)loc = val; 118 *(u32 *)loc = val;
119#if 0 119#if 0
120 if ((s64)val != *(s32 *)loc) 120 if ((s64)val != *(s32 *)loc)
121 goto overflow; 121 goto overflow;
122#endif 122#endif
123 break; 123 break;
124 default: 124 default:
125 printk(KERN_ERR "module %s: Unknown rela relocation: %Lu\n", 125 printk(KERN_ERR "module %s: Unknown rela relocation: %llu\n",
126 me->name, ELF64_R_TYPE(rel[i].r_info)); 126 me->name, ELF64_R_TYPE(rel[i].r_info));
127 return -ENOEXEC; 127 return -ENOEXEC;
128 } 128 }
@@ -130,7 +130,7 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
130 return 0; 130 return 0;
131 131
132overflow: 132overflow:
133 printk(KERN_ERR "overflow in relocation type %d val %Lx\n", 133 printk(KERN_ERR "overflow in relocation type %d val %Lx\n",
134 (int)ELF64_R_TYPE(rel[i].r_info), val); 134 (int)ELF64_R_TYPE(rel[i].r_info), val);
135 printk(KERN_ERR "`%s' likely not compiled with -mcmodel=kernel\n", 135 printk(KERN_ERR "`%s' likely not compiled with -mcmodel=kernel\n",
136 me->name); 136 me->name);
@@ -143,13 +143,13 @@ int apply_relocate(Elf_Shdr *sechdrs,
143 unsigned int relsec, 143 unsigned int relsec,
144 struct module *me) 144 struct module *me)
145{ 145{
146 printk("non add relocation not supported\n"); 146 printk(KERN_ERR "non add relocation not supported\n");
147 return -ENOSYS; 147 return -ENOSYS;
148} 148}
149 149
150int module_finalize(const Elf_Ehdr *hdr, 150int module_finalize(const Elf_Ehdr *hdr,
151 const Elf_Shdr *sechdrs, 151 const Elf_Shdr *sechdrs,
152 struct module *me) 152 struct module *me)
153{ 153{
154 const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL, 154 const Elf_Shdr *s, *text = NULL, *alt = NULL, *locks = NULL,
155 *para = NULL; 155 *para = NULL;
@@ -161,7 +161,7 @@ int module_finalize(const Elf_Ehdr *hdr,
161 if (!strcmp(".altinstructions", secstrings + s->sh_name)) 161 if (!strcmp(".altinstructions", secstrings + s->sh_name))
162 alt = s; 162 alt = s;
163 if (!strcmp(".smp_locks", secstrings + s->sh_name)) 163 if (!strcmp(".smp_locks", secstrings + s->sh_name))
164 locks= s; 164 locks = s;
165 if (!strcmp(".parainstructions", secstrings + s->sh_name)) 165 if (!strcmp(".parainstructions", secstrings + s->sh_name))
166 para = s; 166 para = s;
167 } 167 }
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index a649a4ccad43..37cb1bda1baf 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -3,7 +3,7 @@
3 * compliant MP-table parsing routines. 3 * compliant MP-table parsing routines.
4 * 4 *
5 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk> 5 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
6 * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com> 6 * (c) 1998, 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com>
7 * (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de> 7 * (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de>
8 */ 8 */
9 9
@@ -29,12 +29,7 @@
29#include <asm/setup.h> 29#include <asm/setup.h>
30#include <asm/smp.h> 30#include <asm/smp.h>
31 31
32#include <mach_apic.h> 32#include <asm/apic.h>
33#ifdef CONFIG_X86_32
34#include <mach_apicdef.h>
35#include <mach_mpparse.h>
36#endif
37
38/* 33/*
39 * Checksum an MP configuration block. 34 * Checksum an MP configuration block.
40 */ 35 */
@@ -144,11 +139,11 @@ static void __init MP_ioapic_info(struct mpc_ioapic *m)
144 if (bad_ioapic(m->apicaddr)) 139 if (bad_ioapic(m->apicaddr))
145 return; 140 return;
146 141
147 mp_ioapics[nr_ioapics].mp_apicaddr = m->apicaddr; 142 mp_ioapics[nr_ioapics].apicaddr = m->apicaddr;
148 mp_ioapics[nr_ioapics].mp_apicid = m->apicid; 143 mp_ioapics[nr_ioapics].apicid = m->apicid;
149 mp_ioapics[nr_ioapics].mp_type = m->type; 144 mp_ioapics[nr_ioapics].type = m->type;
150 mp_ioapics[nr_ioapics].mp_apicver = m->apicver; 145 mp_ioapics[nr_ioapics].apicver = m->apicver;
151 mp_ioapics[nr_ioapics].mp_flags = m->flags; 146 mp_ioapics[nr_ioapics].flags = m->flags;
152 nr_ioapics++; 147 nr_ioapics++;
153} 148}
154 149
@@ -160,55 +155,55 @@ static void print_MP_intsrc_info(struct mpc_intsrc *m)
160 m->srcbusirq, m->dstapic, m->dstirq); 155 m->srcbusirq, m->dstapic, m->dstirq);
161} 156}
162 157
163static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq) 158static void __init print_mp_irq_info(struct mpc_intsrc *mp_irq)
164{ 159{
165 apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x," 160 apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
166 " IRQ %02x, APIC ID %x, APIC INT %02x\n", 161 " IRQ %02x, APIC ID %x, APIC INT %02x\n",
167 mp_irq->mp_irqtype, mp_irq->mp_irqflag & 3, 162 mp_irq->irqtype, mp_irq->irqflag & 3,
168 (mp_irq->mp_irqflag >> 2) & 3, mp_irq->mp_srcbus, 163 (mp_irq->irqflag >> 2) & 3, mp_irq->srcbus,
169 mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq); 164 mp_irq->srcbusirq, mp_irq->dstapic, mp_irq->dstirq);
170} 165}
171 166
172static void __init assign_to_mp_irq(struct mpc_intsrc *m, 167static void __init assign_to_mp_irq(struct mpc_intsrc *m,
173 struct mp_config_intsrc *mp_irq) 168 struct mpc_intsrc *mp_irq)
174{ 169{
175 mp_irq->mp_dstapic = m->dstapic; 170 mp_irq->dstapic = m->dstapic;
176 mp_irq->mp_type = m->type; 171 mp_irq->type = m->type;
177 mp_irq->mp_irqtype = m->irqtype; 172 mp_irq->irqtype = m->irqtype;
178 mp_irq->mp_irqflag = m->irqflag; 173 mp_irq->irqflag = m->irqflag;
179 mp_irq->mp_srcbus = m->srcbus; 174 mp_irq->srcbus = m->srcbus;
180 mp_irq->mp_srcbusirq = m->srcbusirq; 175 mp_irq->srcbusirq = m->srcbusirq;
181 mp_irq->mp_dstirq = m->dstirq; 176 mp_irq->dstirq = m->dstirq;
182} 177}
183 178
184static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq, 179static void __init assign_to_mpc_intsrc(struct mpc_intsrc *mp_irq,
185 struct mpc_intsrc *m) 180 struct mpc_intsrc *m)
186{ 181{
187 m->dstapic = mp_irq->mp_dstapic; 182 m->dstapic = mp_irq->dstapic;
188 m->type = mp_irq->mp_type; 183 m->type = mp_irq->type;
189 m->irqtype = mp_irq->mp_irqtype; 184 m->irqtype = mp_irq->irqtype;
190 m->irqflag = mp_irq->mp_irqflag; 185 m->irqflag = mp_irq->irqflag;
191 m->srcbus = mp_irq->mp_srcbus; 186 m->srcbus = mp_irq->srcbus;
192 m->srcbusirq = mp_irq->mp_srcbusirq; 187 m->srcbusirq = mp_irq->srcbusirq;
193 m->dstirq = mp_irq->mp_dstirq; 188 m->dstirq = mp_irq->dstirq;
194} 189}
195 190
196static int __init mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq, 191static int __init mp_irq_mpc_intsrc_cmp(struct mpc_intsrc *mp_irq,
197 struct mpc_intsrc *m) 192 struct mpc_intsrc *m)
198{ 193{
199 if (mp_irq->mp_dstapic != m->dstapic) 194 if (mp_irq->dstapic != m->dstapic)
200 return 1; 195 return 1;
201 if (mp_irq->mp_type != m->type) 196 if (mp_irq->type != m->type)
202 return 2; 197 return 2;
203 if (mp_irq->mp_irqtype != m->irqtype) 198 if (mp_irq->irqtype != m->irqtype)
204 return 3; 199 return 3;
205 if (mp_irq->mp_irqflag != m->irqflag) 200 if (mp_irq->irqflag != m->irqflag)
206 return 4; 201 return 4;
207 if (mp_irq->mp_srcbus != m->srcbus) 202 if (mp_irq->srcbus != m->srcbus)
208 return 5; 203 return 5;
209 if (mp_irq->mp_srcbusirq != m->srcbusirq) 204 if (mp_irq->srcbusirq != m->srcbusirq)
210 return 6; 205 return 6;
211 if (mp_irq->mp_dstirq != m->dstirq) 206 if (mp_irq->dstirq != m->dstirq)
212 return 7; 207 return 7;
213 208
214 return 0; 209 return 0;
@@ -292,16 +287,7 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
292 return 0; 287 return 0;
293 288
294#ifdef CONFIG_X86_32 289#ifdef CONFIG_X86_32
295 /* 290 generic_mps_oem_check(mpc, oem, str);
296 * need to make sure summit and es7000's mps_oem_check is safe to be
297 * called early via genericarch 's mps_oem_check
298 */
299 if (early) {
300#ifdef CONFIG_X86_NUMAQ
301 numaq_mps_oem_check(mpc, oem, str);
302#endif
303 } else
304 mps_oem_check(mpc, oem, str);
305#endif 291#endif
306 /* save the local APIC address, it might be non-default */ 292 /* save the local APIC address, it might be non-default */
307 if (!acpi_lapic) 293 if (!acpi_lapic)
@@ -386,13 +372,13 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
386 (*x86_quirks->mpc_record)++; 372 (*x86_quirks->mpc_record)++;
387 } 373 }
388 374
389#ifdef CONFIG_X86_GENERICARCH 375#ifdef CONFIG_X86_BIGSMP
390 generic_bigsmp_probe(); 376 generic_bigsmp_probe();
391#endif 377#endif
392 378
393#ifdef CONFIG_X86_32 379 if (apic->setup_apic_routing)
394 setup_apic_routing(); 380 apic->setup_apic_routing();
395#endif 381
396 if (!num_processors) 382 if (!num_processors)
397 printk(KERN_ERR "MPTABLE: no processors registered!\n"); 383 printk(KERN_ERR "MPTABLE: no processors registered!\n");
398 return num_processors; 384 return num_processors;
@@ -417,7 +403,7 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type)
417 intsrc.type = MP_INTSRC; 403 intsrc.type = MP_INTSRC;
418 intsrc.irqflag = 0; /* conforming */ 404 intsrc.irqflag = 0; /* conforming */
419 intsrc.srcbus = 0; 405 intsrc.srcbus = 0;
420 intsrc.dstapic = mp_ioapics[0].mp_apicid; 406 intsrc.dstapic = mp_ioapics[0].apicid;
421 407
422 intsrc.irqtype = mp_INT; 408 intsrc.irqtype = mp_INT;
423 409
@@ -570,14 +556,14 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
570 } 556 }
571} 557}
572 558
573static struct intel_mp_floating *mpf_found; 559static struct mpf_intel *mpf_found;
574 560
575/* 561/*
576 * Scan the memory blocks for an SMP configuration block. 562 * Scan the memory blocks for an SMP configuration block.
577 */ 563 */
578static void __init __get_smp_config(unsigned int early) 564static void __init __get_smp_config(unsigned int early)
579{ 565{
580 struct intel_mp_floating *mpf = mpf_found; 566 struct mpf_intel *mpf = mpf_found;
581 567
582 if (!mpf) 568 if (!mpf)
583 return; 569 return;
@@ -598,9 +584,9 @@ static void __init __get_smp_config(unsigned int early)
598 } 584 }
599 585
600 printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n", 586 printk(KERN_INFO "Intel MultiProcessor Specification v1.%d\n",
601 mpf->mpf_specification); 587 mpf->specification);
602#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) 588#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
603 if (mpf->mpf_feature2 & (1 << 7)) { 589 if (mpf->feature2 & (1 << 7)) {
604 printk(KERN_INFO " IMCR and PIC compatibility mode.\n"); 590 printk(KERN_INFO " IMCR and PIC compatibility mode.\n");
605 pic_mode = 1; 591 pic_mode = 1;
606 } else { 592 } else {
@@ -611,7 +597,7 @@ static void __init __get_smp_config(unsigned int early)
611 /* 597 /*
612 * Now see if we need to read further. 598 * Now see if we need to read further.
613 */ 599 */
614 if (mpf->mpf_feature1 != 0) { 600 if (mpf->feature1 != 0) {
615 if (early) { 601 if (early) {
616 /* 602 /*
617 * local APIC has default address 603 * local APIC has default address
@@ -621,16 +607,16 @@ static void __init __get_smp_config(unsigned int early)
621 } 607 }
622 608
623 printk(KERN_INFO "Default MP configuration #%d\n", 609 printk(KERN_INFO "Default MP configuration #%d\n",
624 mpf->mpf_feature1); 610 mpf->feature1);
625 construct_default_ISA_mptable(mpf->mpf_feature1); 611 construct_default_ISA_mptable(mpf->feature1);
626 612
627 } else if (mpf->mpf_physptr) { 613 } else if (mpf->physptr) {
628 614
629 /* 615 /*
630 * Read the physical hardware table. Anything here will 616 * Read the physical hardware table. Anything here will
631 * override the defaults. 617 * override the defaults.
632 */ 618 */
633 if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr), early)) { 619 if (!smp_read_mpc(phys_to_virt(mpf->physptr), early)) {
634#ifdef CONFIG_X86_LOCAL_APIC 620#ifdef CONFIG_X86_LOCAL_APIC
635 smp_found_config = 0; 621 smp_found_config = 0;
636#endif 622#endif
@@ -688,32 +674,32 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
688 unsigned reserve) 674 unsigned reserve)
689{ 675{
690 unsigned int *bp = phys_to_virt(base); 676 unsigned int *bp = phys_to_virt(base);
691 struct intel_mp_floating *mpf; 677 struct mpf_intel *mpf;
692 678
693 apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n", 679 apic_printk(APIC_VERBOSE, "Scan SMP from %p for %ld bytes.\n",
694 bp, length); 680 bp, length);
695 BUILD_BUG_ON(sizeof(*mpf) != 16); 681 BUILD_BUG_ON(sizeof(*mpf) != 16);
696 682
697 while (length > 0) { 683 while (length > 0) {
698 mpf = (struct intel_mp_floating *)bp; 684 mpf = (struct mpf_intel *)bp;
699 if ((*bp == SMP_MAGIC_IDENT) && 685 if ((*bp == SMP_MAGIC_IDENT) &&
700 (mpf->mpf_length == 1) && 686 (mpf->length == 1) &&
701 !mpf_checksum((unsigned char *)bp, 16) && 687 !mpf_checksum((unsigned char *)bp, 16) &&
702 ((mpf->mpf_specification == 1) 688 ((mpf->specification == 1)
703 || (mpf->mpf_specification == 4))) { 689 || (mpf->specification == 4))) {
704#ifdef CONFIG_X86_LOCAL_APIC 690#ifdef CONFIG_X86_LOCAL_APIC
705 smp_found_config = 1; 691 smp_found_config = 1;
706#endif 692#endif
707 mpf_found = mpf; 693 mpf_found = mpf;
708 694
709 printk(KERN_INFO "found SMP MP-table at [%p] %08lx\n", 695 printk(KERN_INFO "found SMP MP-table at [%p] %llx\n",
710 mpf, virt_to_phys(mpf)); 696 mpf, (u64)virt_to_phys(mpf));
711 697
712 if (!reserve) 698 if (!reserve)
713 return 1; 699 return 1;
714 reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE, 700 reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
715 BOOTMEM_DEFAULT); 701 BOOTMEM_DEFAULT);
716 if (mpf->mpf_physptr) { 702 if (mpf->physptr) {
717 unsigned long size = PAGE_SIZE; 703 unsigned long size = PAGE_SIZE;
718#ifdef CONFIG_X86_32 704#ifdef CONFIG_X86_32
719 /* 705 /*
@@ -722,15 +708,24 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
722 * the bottom is mapped now. 708 * the bottom is mapped now.
723 * PC-9800's MPC table places on the very last 709 * PC-9800's MPC table places on the very last
724 * of physical memory; so that simply reserving 710 * of physical memory; so that simply reserving
725 * PAGE_SIZE from mpg->mpf_physptr yields BUG() 711 * PAGE_SIZE from mpf->physptr yields BUG()
726 * in reserve_bootmem. 712 * in reserve_bootmem.
713 * also need to make sure physptr is below than
714 * max_low_pfn
715 * we don't need reserve the area above max_low_pfn
727 */ 716 */
728 unsigned long end = max_low_pfn * PAGE_SIZE; 717 unsigned long end = max_low_pfn * PAGE_SIZE;
729 if (mpf->mpf_physptr + size > end) 718
730 size = end - mpf->mpf_physptr; 719 if (mpf->physptr < end) {
731#endif 720 if (mpf->physptr + size > end)
732 reserve_bootmem_generic(mpf->mpf_physptr, size, 721 size = end - mpf->physptr;
722 reserve_bootmem_generic(mpf->physptr, size,
723 BOOTMEM_DEFAULT);
724 }
725#else
726 reserve_bootmem_generic(mpf->physptr, size,
733 BOOTMEM_DEFAULT); 727 BOOTMEM_DEFAULT);
728#endif
734 } 729 }
735 730
736 return 1; 731 return 1;
@@ -809,15 +804,15 @@ static int __init get_MP_intsrc_index(struct mpc_intsrc *m)
809 /* not legacy */ 804 /* not legacy */
810 805
811 for (i = 0; i < mp_irq_entries; i++) { 806 for (i = 0; i < mp_irq_entries; i++) {
812 if (mp_irqs[i].mp_irqtype != mp_INT) 807 if (mp_irqs[i].irqtype != mp_INT)
813 continue; 808 continue;
814 809
815 if (mp_irqs[i].mp_irqflag != 0x0f) 810 if (mp_irqs[i].irqflag != 0x0f)
816 continue; 811 continue;
817 812
818 if (mp_irqs[i].mp_srcbus != m->srcbus) 813 if (mp_irqs[i].srcbus != m->srcbus)
819 continue; 814 continue;
820 if (mp_irqs[i].mp_srcbusirq != m->srcbusirq) 815 if (mp_irqs[i].srcbusirq != m->srcbusirq)
821 continue; 816 continue;
822 if (irq_used[i]) { 817 if (irq_used[i]) {
823 /* already claimed */ 818 /* already claimed */
@@ -922,10 +917,10 @@ static int __init replace_intsrc_all(struct mpc_table *mpc,
922 if (irq_used[i]) 917 if (irq_used[i])
923 continue; 918 continue;
924 919
925 if (mp_irqs[i].mp_irqtype != mp_INT) 920 if (mp_irqs[i].irqtype != mp_INT)
926 continue; 921 continue;
927 922
928 if (mp_irqs[i].mp_irqflag != 0x0f) 923 if (mp_irqs[i].irqflag != 0x0f)
929 continue; 924 continue;
930 925
931 if (nr_m_spare > 0) { 926 if (nr_m_spare > 0) {
@@ -1001,7 +996,7 @@ static int __init update_mp_table(void)
1001{ 996{
1002 char str[16]; 997 char str[16];
1003 char oem[10]; 998 char oem[10];
1004 struct intel_mp_floating *mpf; 999 struct mpf_intel *mpf;
1005 struct mpc_table *mpc, *mpc_new; 1000 struct mpc_table *mpc, *mpc_new;
1006 1001
1007 if (!enable_update_mptable) 1002 if (!enable_update_mptable)
@@ -1014,19 +1009,19 @@ static int __init update_mp_table(void)
1014 /* 1009 /*
1015 * Now see if we need to go further. 1010 * Now see if we need to go further.
1016 */ 1011 */
1017 if (mpf->mpf_feature1 != 0) 1012 if (mpf->feature1 != 0)
1018 return 0; 1013 return 0;
1019 1014
1020 if (!mpf->mpf_physptr) 1015 if (!mpf->physptr)
1021 return 0; 1016 return 0;
1022 1017
1023 mpc = phys_to_virt(mpf->mpf_physptr); 1018 mpc = phys_to_virt(mpf->physptr);
1024 1019
1025 if (!smp_check_mpc(mpc, oem, str)) 1020 if (!smp_check_mpc(mpc, oem, str))
1026 return 0; 1021 return 0;
1027 1022
1028 printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf)); 1023 printk(KERN_INFO "mpf: %llx\n", (u64)virt_to_phys(mpf));
1029 printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr); 1024 printk(KERN_INFO "physptr: %x\n", mpf->physptr);
1030 1025
1031 if (mpc_new_phys && mpc->length > mpc_new_length) { 1026 if (mpc_new_phys && mpc->length > mpc_new_length) {
1032 mpc_new_phys = 0; 1027 mpc_new_phys = 0;
@@ -1047,23 +1042,23 @@ static int __init update_mp_table(void)
1047 } 1042 }
1048 printk(KERN_INFO "use in-positon replacing\n"); 1043 printk(KERN_INFO "use in-positon replacing\n");
1049 } else { 1044 } else {
1050 mpf->mpf_physptr = mpc_new_phys; 1045 mpf->physptr = mpc_new_phys;
1051 mpc_new = phys_to_virt(mpc_new_phys); 1046 mpc_new = phys_to_virt(mpc_new_phys);
1052 memcpy(mpc_new, mpc, mpc->length); 1047 memcpy(mpc_new, mpc, mpc->length);
1053 mpc = mpc_new; 1048 mpc = mpc_new;
1054 /* check if we can modify that */ 1049 /* check if we can modify that */
1055 if (mpc_new_phys - mpf->mpf_physptr) { 1050 if (mpc_new_phys - mpf->physptr) {
1056 struct intel_mp_floating *mpf_new; 1051 struct mpf_intel *mpf_new;
1057 /* steal 16 bytes from [0, 1k) */ 1052 /* steal 16 bytes from [0, 1k) */
1058 printk(KERN_INFO "mpf new: %x\n", 0x400 - 16); 1053 printk(KERN_INFO "mpf new: %x\n", 0x400 - 16);
1059 mpf_new = phys_to_virt(0x400 - 16); 1054 mpf_new = phys_to_virt(0x400 - 16);
1060 memcpy(mpf_new, mpf, 16); 1055 memcpy(mpf_new, mpf, 16);
1061 mpf = mpf_new; 1056 mpf = mpf_new;
1062 mpf->mpf_physptr = mpc_new_phys; 1057 mpf->physptr = mpc_new_phys;
1063 } 1058 }
1064 mpf->mpf_checksum = 0; 1059 mpf->checksum = 0;
1065 mpf->mpf_checksum -= mpf_checksum((unsigned char *)mpf, 16); 1060 mpf->checksum -= mpf_checksum((unsigned char *)mpf, 16);
1066 printk(KERN_INFO "mpf_physptr new: %x\n", mpf->mpf_physptr); 1061 printk(KERN_INFO "physptr new: %x\n", mpf->physptr);
1067 } 1062 }
1068 1063
1069 /* 1064 /*
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 726266695b2c..3cf3413ec626 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -35,10 +35,10 @@
35#include <linux/device.h> 35#include <linux/device.h>
36#include <linux/cpu.h> 36#include <linux/cpu.h>
37#include <linux/notifier.h> 37#include <linux/notifier.h>
38#include <linux/uaccess.h>
38 39
39#include <asm/processor.h> 40#include <asm/processor.h>
40#include <asm/msr.h> 41#include <asm/msr.h>
41#include <asm/uaccess.h>
42#include <asm/system.h> 42#include <asm/system.h>
43 43
44static struct class *msr_class; 44static struct class *msr_class;
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
deleted file mode 100644
index f2191d4f2717..000000000000
--- a/arch/x86/kernel/numaq_32.c
+++ /dev/null
@@ -1,293 +0,0 @@
1/*
2 * Written by: Patricia Gaughen, IBM Corporation
3 *
4 * Copyright (C) 2002, IBM Corp.
5 *
6 * All rights reserved.
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, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
16 * NON INFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * Send feedback to <gone@us.ibm.com>
24 */
25
26#include <linux/mm.h>
27#include <linux/bootmem.h>
28#include <linux/mmzone.h>
29#include <linux/module.h>
30#include <linux/nodemask.h>
31#include <asm/numaq.h>
32#include <asm/topology.h>
33#include <asm/processor.h>
34#include <asm/genapic.h>
35#include <asm/e820.h>
36#include <asm/setup.h>
37
38#define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT))
39
40/*
41 * Function: smp_dump_qct()
42 *
43 * Description: gets memory layout from the quad config table. This
44 * function also updates node_online_map with the nodes (quads) present.
45 */
46static void __init smp_dump_qct(void)
47{
48 int node;
49 struct eachquadmem *eq;
50 struct sys_cfg_data *scd =
51 (struct sys_cfg_data *)__va(SYS_CFG_DATA_PRIV_ADDR);
52
53 nodes_clear(node_online_map);
54 for_each_node(node) {
55 if (scd->quads_present31_0 & (1 << node)) {
56 node_set_online(node);
57 eq = &scd->eq[node];
58 /* Convert to pages */
59 node_start_pfn[node] = MB_TO_PAGES(
60 eq->hi_shrd_mem_start - eq->priv_mem_size);
61 node_end_pfn[node] = MB_TO_PAGES(
62 eq->hi_shrd_mem_start + eq->hi_shrd_mem_size);
63
64 e820_register_active_regions(node, node_start_pfn[node],
65 node_end_pfn[node]);
66 memory_present(node,
67 node_start_pfn[node], node_end_pfn[node]);
68 node_remap_size[node] = node_memmap_size_bytes(node,
69 node_start_pfn[node],
70 node_end_pfn[node]);
71 }
72 }
73}
74
75
76void __cpuinit numaq_tsc_disable(void)
77{
78 if (!found_numaq)
79 return;
80
81 if (num_online_nodes() > 1) {
82 printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
83 setup_clear_cpu_cap(X86_FEATURE_TSC);
84 }
85}
86
87static int __init numaq_pre_time_init(void)
88{
89 numaq_tsc_disable();
90 return 0;
91}
92
93int found_numaq;
94/*
95 * Have to match translation table entries to main table entries by counter
96 * hence the mpc_record variable .... can't see a less disgusting way of
97 * doing this ....
98 */
99struct mpc_config_translation {
100 unsigned char mpc_type;
101 unsigned char trans_len;
102 unsigned char trans_type;
103 unsigned char trans_quad;
104 unsigned char trans_global;
105 unsigned char trans_local;
106 unsigned short trans_reserved;
107};
108
109/* x86_quirks member */
110static int mpc_record;
111static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY]
112 __cpuinitdata;
113
114static inline int generate_logical_apicid(int quad, int phys_apicid)
115{
116 return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1);
117}
118
119/* x86_quirks member */
120static int mpc_apic_id(struct mpc_cpu *m)
121{
122 int quad = translation_table[mpc_record]->trans_quad;
123 int logical_apicid = generate_logical_apicid(quad, m->apicid);
124
125 printk(KERN_DEBUG "Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n",
126 m->apicid, (m->cpufeature & CPU_FAMILY_MASK) >> 8,
127 (m->cpufeature & CPU_MODEL_MASK) >> 4,
128 m->apicver, quad, logical_apicid);
129 return logical_apicid;
130}
131
132int mp_bus_id_to_node[MAX_MP_BUSSES];
133
134int mp_bus_id_to_local[MAX_MP_BUSSES];
135
136/* x86_quirks member */
137static void mpc_oem_bus_info(struct mpc_bus *m, char *name)
138{
139 int quad = translation_table[mpc_record]->trans_quad;
140 int local = translation_table[mpc_record]->trans_local;
141
142 mp_bus_id_to_node[m->busid] = quad;
143 mp_bus_id_to_local[m->busid] = local;
144 printk(KERN_INFO "Bus #%d is %s (node %d)\n",
145 m->busid, name, quad);
146}
147
148int quad_local_to_mp_bus_id [NR_CPUS/4][4];
149
150/* x86_quirks member */
151static void mpc_oem_pci_bus(struct mpc_bus *m)
152{
153 int quad = translation_table[mpc_record]->trans_quad;
154 int local = translation_table[mpc_record]->trans_local;
155
156 quad_local_to_mp_bus_id[quad][local] = m->busid;
157}
158
159static void __init MP_translation_info(struct mpc_config_translation *m)
160{
161 printk(KERN_INFO
162 "Translation: record %d, type %d, quad %d, global %d, local %d\n",
163 mpc_record, m->trans_type, m->trans_quad, m->trans_global,
164 m->trans_local);
165
166 if (mpc_record >= MAX_MPC_ENTRY)
167 printk(KERN_ERR "MAX_MPC_ENTRY exceeded!\n");
168 else
169 translation_table[mpc_record] = m; /* stash this for later */
170 if (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad))
171 node_set_online(m->trans_quad);
172}
173
174static int __init mpf_checksum(unsigned char *mp, int len)
175{
176 int sum = 0;
177
178 while (len--)
179 sum += *mp++;
180
181 return sum & 0xFF;
182}
183
184/*
185 * Read/parse the MPC oem tables
186 */
187
188static void __init smp_read_mpc_oem(struct mpc_oemtable *oemtable,
189 unsigned short oemsize)
190{
191 int count = sizeof(*oemtable); /* the header size */
192 unsigned char *oemptr = ((unsigned char *)oemtable) + count;
193
194 mpc_record = 0;
195 printk(KERN_INFO "Found an OEM MPC table at %8p - parsing it ... \n",
196 oemtable);
197 if (memcmp(oemtable->signature, MPC_OEM_SIGNATURE, 4)) {
198 printk(KERN_WARNING
199 "SMP mpc oemtable: bad signature [%c%c%c%c]!\n",
200 oemtable->signature[0], oemtable->signature[1],
201 oemtable->signature[2], oemtable->signature[3]);
202 return;
203 }
204 if (mpf_checksum((unsigned char *)oemtable, oemtable->length)) {
205 printk(KERN_WARNING "SMP oem mptable: checksum error!\n");
206 return;
207 }
208 while (count < oemtable->length) {
209 switch (*oemptr) {
210 case MP_TRANSLATION:
211 {
212 struct mpc_config_translation *m =
213 (struct mpc_config_translation *)oemptr;
214 MP_translation_info(m);
215 oemptr += sizeof(*m);
216 count += sizeof(*m);
217 ++mpc_record;
218 break;
219 }
220 default:
221 {
222 printk(KERN_WARNING
223 "Unrecognised OEM table entry type! - %d\n",
224 (int)*oemptr);
225 return;
226 }
227 }
228 }
229}
230
231static int __init numaq_setup_ioapic_ids(void)
232{
233 /* so can skip it */
234 return 1;
235}
236
237static int __init numaq_update_genapic(void)
238{
239 genapic->wakeup_cpu = wakeup_secondary_cpu_via_nmi;
240
241 return 0;
242}
243
244static struct x86_quirks numaq_x86_quirks __initdata = {
245 .arch_pre_time_init = numaq_pre_time_init,
246 .arch_time_init = NULL,
247 .arch_pre_intr_init = NULL,
248 .arch_memory_setup = NULL,
249 .arch_intr_init = NULL,
250 .arch_trap_init = NULL,
251 .mach_get_smp_config = NULL,
252 .mach_find_smp_config = NULL,
253 .mpc_record = &mpc_record,
254 .mpc_apic_id = mpc_apic_id,
255 .mpc_oem_bus_info = mpc_oem_bus_info,
256 .mpc_oem_pci_bus = mpc_oem_pci_bus,
257 .smp_read_mpc_oem = smp_read_mpc_oem,
258 .setup_ioapic_ids = numaq_setup_ioapic_ids,
259 .update_genapic = numaq_update_genapic,
260};
261
262void numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
263{
264 if (strncmp(oem, "IBM NUMA", 8))
265 printk("Warning! Not a NUMA-Q system!\n");
266 else
267 found_numaq = 1;
268}
269
270static __init void early_check_numaq(void)
271{
272 /*
273 * Find possible boot-time SMP configuration:
274 */
275 early_find_smp_config();
276 /*
277 * get boot-time SMP configuration:
278 */
279 if (smp_found_config)
280 early_get_smp_config();
281
282 if (found_numaq)
283 x86_quirks = &numaq_x86_quirks;
284}
285
286int __init get_memcfg_numaq(void)
287{
288 early_check_numaq();
289 if (!found_numaq)
290 return 0;
291 smp_dump_qct();
292 return 1;
293}
diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c
index 95777b0faa73..3a7c5a44082e 100644
--- a/arch/x86/kernel/paravirt-spinlocks.c
+++ b/arch/x86/kernel/paravirt-spinlocks.c
@@ -26,13 +26,3 @@ struct pv_lock_ops pv_lock_ops = {
26}; 26};
27EXPORT_SYMBOL(pv_lock_ops); 27EXPORT_SYMBOL(pv_lock_ops);
28 28
29void __init paravirt_use_bytelocks(void)
30{
31#ifdef CONFIG_SMP
32 pv_lock_ops.spin_is_locked = __byte_spin_is_locked;
33 pv_lock_ops.spin_is_contended = __byte_spin_is_contended;
34 pv_lock_ops.spin_lock = __byte_spin_lock;
35 pv_lock_ops.spin_trylock = __byte_spin_trylock;
36 pv_lock_ops.spin_unlock = __byte_spin_unlock;
37#endif
38}
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index c6520a4e85d4..63dd358d8ee1 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -28,7 +28,6 @@
28#include <asm/paravirt.h> 28#include <asm/paravirt.h>
29#include <asm/desc.h> 29#include <asm/desc.h>
30#include <asm/setup.h> 30#include <asm/setup.h>
31#include <asm/arch_hooks.h>
32#include <asm/pgtable.h> 31#include <asm/pgtable.h>
33#include <asm/time.h> 32#include <asm/time.h>
34#include <asm/pgalloc.h> 33#include <asm/pgalloc.h>
@@ -44,6 +43,17 @@ void _paravirt_nop(void)
44{ 43{
45} 44}
46 45
46/* identity function, which can be inlined */
47u32 _paravirt_ident_32(u32 x)
48{
49 return x;
50}
51
52u64 _paravirt_ident_64(u64 x)
53{
54 return x;
55}
56
47static void __init default_banner(void) 57static void __init default_banner(void)
48{ 58{
49 printk(KERN_INFO "Booting paravirtualized kernel on %s\n", 59 printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
@@ -138,9 +148,16 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
138 if (opfunc == NULL) 148 if (opfunc == NULL)
139 /* If there's no function, patch it with a ud2a (BUG) */ 149 /* If there's no function, patch it with a ud2a (BUG) */
140 ret = paravirt_patch_insns(insnbuf, len, ud2a, ud2a+sizeof(ud2a)); 150 ret = paravirt_patch_insns(insnbuf, len, ud2a, ud2a+sizeof(ud2a));
141 else if (opfunc == paravirt_nop) 151 else if (opfunc == _paravirt_nop)
142 /* If the operation is a nop, then nop the callsite */ 152 /* If the operation is a nop, then nop the callsite */
143 ret = paravirt_patch_nop(); 153 ret = paravirt_patch_nop();
154
155 /* identity functions just return their single argument */
156 else if (opfunc == _paravirt_ident_32)
157 ret = paravirt_patch_ident_32(insnbuf, len);
158 else if (opfunc == _paravirt_ident_64)
159 ret = paravirt_patch_ident_64(insnbuf, len);
160
144 else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) || 161 else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
145 type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) || 162 type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) ||
146 type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret32) || 163 type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret32) ||
@@ -318,10 +335,10 @@ struct pv_time_ops pv_time_ops = {
318 335
319struct pv_irq_ops pv_irq_ops = { 336struct pv_irq_ops pv_irq_ops = {
320 .init_IRQ = native_init_IRQ, 337 .init_IRQ = native_init_IRQ,
321 .save_fl = native_save_fl, 338 .save_fl = __PV_IS_CALLEE_SAVE(native_save_fl),
322 .restore_fl = native_restore_fl, 339 .restore_fl = __PV_IS_CALLEE_SAVE(native_restore_fl),
323 .irq_disable = native_irq_disable, 340 .irq_disable = __PV_IS_CALLEE_SAVE(native_irq_disable),
324 .irq_enable = native_irq_enable, 341 .irq_enable = __PV_IS_CALLEE_SAVE(native_irq_enable),
325 .safe_halt = native_safe_halt, 342 .safe_halt = native_safe_halt,
326 .halt = native_halt, 343 .halt = native_halt,
327#ifdef CONFIG_X86_64 344#ifdef CONFIG_X86_64
@@ -399,6 +416,14 @@ struct pv_apic_ops pv_apic_ops = {
399#endif 416#endif
400}; 417};
401 418
419#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
420/* 32-bit pagetable entries */
421#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_32)
422#else
423/* 64-bit pagetable entries */
424#define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_64)
425#endif
426
402struct pv_mmu_ops pv_mmu_ops = { 427struct pv_mmu_ops pv_mmu_ops = {
403#ifndef CONFIG_X86_64 428#ifndef CONFIG_X86_64
404 .pagetable_setup_start = native_pagetable_setup_start, 429 .pagetable_setup_start = native_pagetable_setup_start,
@@ -450,22 +475,23 @@ struct pv_mmu_ops pv_mmu_ops = {
450 .pmd_clear = native_pmd_clear, 475 .pmd_clear = native_pmd_clear,
451#endif 476#endif
452 .set_pud = native_set_pud, 477 .set_pud = native_set_pud,
453 .pmd_val = native_pmd_val, 478
454 .make_pmd = native_make_pmd, 479 .pmd_val = PTE_IDENT,
480 .make_pmd = PTE_IDENT,
455 481
456#if PAGETABLE_LEVELS == 4 482#if PAGETABLE_LEVELS == 4
457 .pud_val = native_pud_val, 483 .pud_val = PTE_IDENT,
458 .make_pud = native_make_pud, 484 .make_pud = PTE_IDENT,
485
459 .set_pgd = native_set_pgd, 486 .set_pgd = native_set_pgd,
460#endif 487#endif
461#endif /* PAGETABLE_LEVELS >= 3 */ 488#endif /* PAGETABLE_LEVELS >= 3 */
462 489
463 .pte_val = native_pte_val, 490 .pte_val = PTE_IDENT,
464 .pte_flags = native_pte_flags, 491 .pgd_val = PTE_IDENT,
465 .pgd_val = native_pgd_val,
466 492
467 .make_pte = native_make_pte, 493 .make_pte = PTE_IDENT,
468 .make_pgd = native_make_pgd, 494 .make_pgd = PTE_IDENT,
469 495
470 .dup_mmap = paravirt_nop, 496 .dup_mmap = paravirt_nop,
471 .exit_mmap = paravirt_nop, 497 .exit_mmap = paravirt_nop,
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index 9fe644f4861d..d9f32e6d6ab6 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -12,6 +12,18 @@ DEF_NATIVE(pv_mmu_ops, read_cr3, "mov %cr3, %eax");
12DEF_NATIVE(pv_cpu_ops, clts, "clts"); 12DEF_NATIVE(pv_cpu_ops, clts, "clts");
13DEF_NATIVE(pv_cpu_ops, read_tsc, "rdtsc"); 13DEF_NATIVE(pv_cpu_ops, read_tsc, "rdtsc");
14 14
15unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len)
16{
17 /* arg in %eax, return in %eax */
18 return 0;
19}
20
21unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len)
22{
23 /* arg in %edx:%eax, return in %edx:%eax */
24 return 0;
25}
26
15unsigned native_patch(u8 type, u16 clobbers, void *ibuf, 27unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
16 unsigned long addr, unsigned len) 28 unsigned long addr, unsigned len)
17{ 29{
diff --git a/arch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
index 061d01df9ae6..3f08f34f93eb 100644
--- a/arch/x86/kernel/paravirt_patch_64.c
+++ b/arch/x86/kernel/paravirt_patch_64.c
@@ -19,6 +19,21 @@ DEF_NATIVE(pv_cpu_ops, usergs_sysret64, "swapgs; sysretq");
19DEF_NATIVE(pv_cpu_ops, usergs_sysret32, "swapgs; sysretl"); 19DEF_NATIVE(pv_cpu_ops, usergs_sysret32, "swapgs; sysretl");
20DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs"); 20DEF_NATIVE(pv_cpu_ops, swapgs, "swapgs");
21 21
22DEF_NATIVE(, mov32, "mov %edi, %eax");
23DEF_NATIVE(, mov64, "mov %rdi, %rax");
24
25unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len)
26{
27 return paravirt_patch_insns(insnbuf, len,
28 start__mov32, end__mov32);
29}
30
31unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len)
32{
33 return paravirt_patch_insns(insnbuf, len,
34 start__mov64, end__mov64);
35}
36
22unsigned native_patch(u8 type, u16 clobbers, void *ibuf, 37unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
23 unsigned long addr, unsigned len) 38 unsigned long addr, unsigned len)
24{ 39{
diff --git a/arch/x86/kernel/probe_roms_32.c b/arch/x86/kernel/probe_roms_32.c
index 675a48c404a5..071e7fea42e5 100644
--- a/arch/x86/kernel/probe_roms_32.c
+++ b/arch/x86/kernel/probe_roms_32.c
@@ -18,7 +18,7 @@
18#include <asm/setup.h> 18#include <asm/setup.h>
19#include <asm/sections.h> 19#include <asm/sections.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <setup_arch.h> 21#include <asm/setup_arch.h>
22 22
23static struct resource system_rom_resource = { 23static struct resource system_rom_resource = {
24 .name = "System ROM", 24 .name = "System ROM",
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 6d12f7e37f8c..6afa5232dbb7 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -1,8 +1,8 @@
1#include <linux/errno.h> 1#include <linux/errno.h>
2#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <linux/mm.h> 3#include <linux/mm.h>
4#include <asm/idle.h>
5#include <linux/smp.h> 4#include <linux/smp.h>
5#include <linux/prctl.h>
6#include <linux/slab.h> 6#include <linux/slab.h>
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/module.h> 8#include <linux/module.h>
@@ -11,6 +11,9 @@
11#include <linux/ftrace.h> 11#include <linux/ftrace.h>
12#include <asm/system.h> 12#include <asm/system.h>
13#include <asm/apic.h> 13#include <asm/apic.h>
14#include <asm/idle.h>
15#include <asm/uaccess.h>
16#include <asm/i387.h>
14 17
15unsigned long idle_halt; 18unsigned long idle_halt;
16EXPORT_SYMBOL(idle_halt); 19EXPORT_SYMBOL(idle_halt);
@@ -56,6 +59,192 @@ void arch_task_cache_init(void)
56} 59}
57 60
58/* 61/*
62 * Free current thread data structures etc..
63 */
64void exit_thread(void)
65{
66 struct task_struct *me = current;
67 struct thread_struct *t = &me->thread;
68
69 if (me->thread.io_bitmap_ptr) {
70 struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
71
72 kfree(t->io_bitmap_ptr);
73 t->io_bitmap_ptr = NULL;
74 clear_thread_flag(TIF_IO_BITMAP);
75 /*
76 * Careful, clear this in the TSS too:
77 */
78 memset(tss->io_bitmap, 0xff, t->io_bitmap_max);
79 t->io_bitmap_max = 0;
80 put_cpu();
81 }
82
83 ds_exit_thread(current);
84}
85
86void flush_thread(void)
87{
88 struct task_struct *tsk = current;
89
90#ifdef CONFIG_X86_64
91 if (test_tsk_thread_flag(tsk, TIF_ABI_PENDING)) {
92 clear_tsk_thread_flag(tsk, TIF_ABI_PENDING);
93 if (test_tsk_thread_flag(tsk, TIF_IA32)) {
94 clear_tsk_thread_flag(tsk, TIF_IA32);
95 } else {
96 set_tsk_thread_flag(tsk, TIF_IA32);
97 current_thread_info()->status |= TS_COMPAT;
98 }
99 }
100#endif
101
102 clear_tsk_thread_flag(tsk, TIF_DEBUG);
103
104 tsk->thread.debugreg0 = 0;
105 tsk->thread.debugreg1 = 0;
106 tsk->thread.debugreg2 = 0;
107 tsk->thread.debugreg3 = 0;
108 tsk->thread.debugreg6 = 0;
109 tsk->thread.debugreg7 = 0;
110 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
111 /*
112 * Forget coprocessor state..
113 */
114 tsk->fpu_counter = 0;
115 clear_fpu(tsk);
116 clear_used_math();
117}
118
119static void hard_disable_TSC(void)
120{
121 write_cr4(read_cr4() | X86_CR4_TSD);
122}
123
124void disable_TSC(void)
125{
126 preempt_disable();
127 if (!test_and_set_thread_flag(TIF_NOTSC))
128 /*
129 * Must flip the CPU state synchronously with
130 * TIF_NOTSC in the current running context.
131 */
132 hard_disable_TSC();
133 preempt_enable();
134}
135
136static void hard_enable_TSC(void)
137{
138 write_cr4(read_cr4() & ~X86_CR4_TSD);
139}
140
141static void enable_TSC(void)
142{
143 preempt_disable();
144 if (test_and_clear_thread_flag(TIF_NOTSC))
145 /*
146 * Must flip the CPU state synchronously with
147 * TIF_NOTSC in the current running context.
148 */
149 hard_enable_TSC();
150 preempt_enable();
151}
152
153int get_tsc_mode(unsigned long adr)
154{
155 unsigned int val;
156
157 if (test_thread_flag(TIF_NOTSC))
158 val = PR_TSC_SIGSEGV;
159 else
160 val = PR_TSC_ENABLE;
161
162 return put_user(val, (unsigned int __user *)adr);
163}
164
165int set_tsc_mode(unsigned int val)
166{
167 if (val == PR_TSC_SIGSEGV)
168 disable_TSC();
169 else if (val == PR_TSC_ENABLE)
170 enable_TSC();
171 else
172 return -EINVAL;
173
174 return 0;
175}
176
177void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
178 struct tss_struct *tss)
179{
180 struct thread_struct *prev, *next;
181
182 prev = &prev_p->thread;
183 next = &next_p->thread;
184
185 if (test_tsk_thread_flag(next_p, TIF_DS_AREA_MSR) ||
186 test_tsk_thread_flag(prev_p, TIF_DS_AREA_MSR))
187 ds_switch_to(prev_p, next_p);
188 else if (next->debugctlmsr != prev->debugctlmsr)
189 update_debugctlmsr(next->debugctlmsr);
190
191 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
192 set_debugreg(next->debugreg0, 0);
193 set_debugreg(next->debugreg1, 1);
194 set_debugreg(next->debugreg2, 2);
195 set_debugreg(next->debugreg3, 3);
196 /* no 4 and 5 */
197 set_debugreg(next->debugreg6, 6);
198 set_debugreg(next->debugreg7, 7);
199 }
200
201 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
202 test_tsk_thread_flag(next_p, TIF_NOTSC)) {
203 /* prev and next are different */
204 if (test_tsk_thread_flag(next_p, TIF_NOTSC))
205 hard_disable_TSC();
206 else
207 hard_enable_TSC();
208 }
209
210 if (test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
211 /*
212 * Copy the relevant range of the IO bitmap.
213 * Normally this is 128 bytes or less:
214 */
215 memcpy(tss->io_bitmap, next->io_bitmap_ptr,
216 max(prev->io_bitmap_max, next->io_bitmap_max));
217 } else if (test_tsk_thread_flag(prev_p, TIF_IO_BITMAP)) {
218 /*
219 * Clear any possible leftover bits:
220 */
221 memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
222 }
223}
224
225int sys_fork(struct pt_regs *regs)
226{
227 return do_fork(SIGCHLD, regs->sp, regs, 0, NULL, NULL);
228}
229
230/*
231 * This is trivial, and on the face of it looks like it
232 * could equally well be done in user mode.
233 *
234 * Not so, for quite unobvious reasons - register pressure.
235 * In user mode vfork() cannot have a stack frame, and if
236 * done by calling the "clone()" system call directly, you
237 * do not have enough call-clobbered registers to hold all
238 * the information you need.
239 */
240int sys_vfork(struct pt_regs *regs)
241{
242 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->sp, regs, 0,
243 NULL, NULL);
244}
245
246
247/*
59 * Idle related variables and functions 248 * Idle related variables and functions
60 */ 249 */
61unsigned long boot_option_idle_override = 0; 250unsigned long boot_option_idle_override = 0;
@@ -350,7 +539,7 @@ static void c1e_idle(void)
350 539
351void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) 540void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
352{ 541{
353#ifdef CONFIG_X86_SMP 542#ifdef CONFIG_SMP
354 if (pm_idle == poll_idle && smp_num_siblings > 1) { 543 if (pm_idle == poll_idle && smp_num_siblings > 1) {
355 printk(KERN_WARNING "WARNING: polling idle and HT enabled," 544 printk(KERN_WARNING "WARNING: polling idle and HT enabled,"
356 " performance may degrade.\n"); 545 " performance may degrade.\n");
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index bd4da2af08ae..14014d766cad 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -11,6 +11,7 @@
11 11
12#include <stdarg.h> 12#include <stdarg.h>
13 13
14#include <linux/stackprotector.h>
14#include <linux/cpu.h> 15#include <linux/cpu.h>
15#include <linux/errno.h> 16#include <linux/errno.h>
16#include <linux/sched.h> 17#include <linux/sched.h>
@@ -66,9 +67,6 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
66DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; 67DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
67EXPORT_PER_CPU_SYMBOL(current_task); 68EXPORT_PER_CPU_SYMBOL(current_task);
68 69
69DEFINE_PER_CPU(int, cpu_number);
70EXPORT_PER_CPU_SYMBOL(cpu_number);
71
72/* 70/*
73 * Return saved PC of a blocked thread. 71 * Return saved PC of a blocked thread.
74 */ 72 */
@@ -94,6 +92,15 @@ void cpu_idle(void)
94{ 92{
95 int cpu = smp_processor_id(); 93 int cpu = smp_processor_id();
96 94
95 /*
96 * If we're the non-boot CPU, nothing set the stack canary up
97 * for us. CPU0 already has it initialized but no harm in
98 * doing it again. This is a good place for updating it, as
99 * we wont ever return from this function (so the invalid
100 * canaries already on the stack wont ever trigger).
101 */
102 boot_init_stack_canary();
103
97 current_thread_info()->status |= TS_POLLING; 104 current_thread_info()->status |= TS_POLLING;
98 105
99 /* endless idle loop with no priority at all */ 106 /* endless idle loop with no priority at all */
@@ -108,7 +115,6 @@ void cpu_idle(void)
108 play_dead(); 115 play_dead();
109 116
110 local_irq_disable(); 117 local_irq_disable();
111 __get_cpu_var(irq_stat).idle_timestamp = jiffies;
112 /* Don't trace irqs off for idle */ 118 /* Don't trace irqs off for idle */
113 stop_critical_timings(); 119 stop_critical_timings();
114 pm_idle(); 120 pm_idle();
@@ -132,7 +138,7 @@ void __show_regs(struct pt_regs *regs, int all)
132 if (user_mode_vm(regs)) { 138 if (user_mode_vm(regs)) {
133 sp = regs->sp; 139 sp = regs->sp;
134 ss = regs->ss & 0xffff; 140 ss = regs->ss & 0xffff;
135 savesegment(gs, gs); 141 gs = get_user_gs(regs);
136 } else { 142 } else {
137 sp = (unsigned long) (&regs->sp); 143 sp = (unsigned long) (&regs->sp);
138 savesegment(ss, ss); 144 savesegment(ss, ss);
@@ -213,6 +219,7 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
213 regs.ds = __USER_DS; 219 regs.ds = __USER_DS;
214 regs.es = __USER_DS; 220 regs.es = __USER_DS;
215 regs.fs = __KERNEL_PERCPU; 221 regs.fs = __KERNEL_PERCPU;
222 regs.gs = __KERNEL_STACK_CANARY;
216 regs.orig_ax = -1; 223 regs.orig_ax = -1;
217 regs.ip = (unsigned long) kernel_thread_helper; 224 regs.ip = (unsigned long) kernel_thread_helper;
218 regs.cs = __KERNEL_CS | get_kernel_rpl(); 225 regs.cs = __KERNEL_CS | get_kernel_rpl();
@@ -223,55 +230,6 @@ int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
223} 230}
224EXPORT_SYMBOL(kernel_thread); 231EXPORT_SYMBOL(kernel_thread);
225 232
226/*
227 * Free current thread data structures etc..
228 */
229void exit_thread(void)
230{
231 /* The process may have allocated an io port bitmap... nuke it. */
232 if (unlikely(test_thread_flag(TIF_IO_BITMAP))) {
233 struct task_struct *tsk = current;
234 struct thread_struct *t = &tsk->thread;
235 int cpu = get_cpu();
236 struct tss_struct *tss = &per_cpu(init_tss, cpu);
237
238 kfree(t->io_bitmap_ptr);
239 t->io_bitmap_ptr = NULL;
240 clear_thread_flag(TIF_IO_BITMAP);
241 /*
242 * Careful, clear this in the TSS too:
243 */
244 memset(tss->io_bitmap, 0xff, tss->io_bitmap_max);
245 t->io_bitmap_max = 0;
246 tss->io_bitmap_owner = NULL;
247 tss->io_bitmap_max = 0;
248 tss->x86_tss.io_bitmap_base = INVALID_IO_BITMAP_OFFSET;
249 put_cpu();
250 }
251
252 ds_exit_thread(current);
253}
254
255void flush_thread(void)
256{
257 struct task_struct *tsk = current;
258
259 tsk->thread.debugreg0 = 0;
260 tsk->thread.debugreg1 = 0;
261 tsk->thread.debugreg2 = 0;
262 tsk->thread.debugreg3 = 0;
263 tsk->thread.debugreg6 = 0;
264 tsk->thread.debugreg7 = 0;
265 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
266 clear_tsk_thread_flag(tsk, TIF_DEBUG);
267 /*
268 * Forget coprocessor state..
269 */
270 tsk->fpu_counter = 0;
271 clear_fpu(tsk);
272 clear_used_math();
273}
274
275void release_thread(struct task_struct *dead_task) 233void release_thread(struct task_struct *dead_task)
276{ 234{
277 BUG_ON(dead_task->mm); 235 BUG_ON(dead_task->mm);
@@ -305,7 +263,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
305 263
306 p->thread.ip = (unsigned long) ret_from_fork; 264 p->thread.ip = (unsigned long) ret_from_fork;
307 265
308 savesegment(gs, p->thread.gs); 266 task_user_gs(p) = get_user_gs(regs);
309 267
310 tsk = current; 268 tsk = current;
311 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) { 269 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) {
@@ -343,7 +301,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
343void 301void
344start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) 302start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
345{ 303{
346 __asm__("movl %0, %%gs" : : "r"(0)); 304 set_user_gs(regs, 0);
347 regs->fs = 0; 305 regs->fs = 0;
348 set_fs(USER_DS); 306 set_fs(USER_DS);
349 regs->ds = __USER_DS; 307 regs->ds = __USER_DS;
@@ -359,127 +317,6 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
359} 317}
360EXPORT_SYMBOL_GPL(start_thread); 318EXPORT_SYMBOL_GPL(start_thread);
361 319
362static void hard_disable_TSC(void)
363{
364 write_cr4(read_cr4() | X86_CR4_TSD);
365}
366
367void disable_TSC(void)
368{
369 preempt_disable();
370 if (!test_and_set_thread_flag(TIF_NOTSC))
371 /*
372 * Must flip the CPU state synchronously with
373 * TIF_NOTSC in the current running context.
374 */
375 hard_disable_TSC();
376 preempt_enable();
377}
378
379static void hard_enable_TSC(void)
380{
381 write_cr4(read_cr4() & ~X86_CR4_TSD);
382}
383
384static void enable_TSC(void)
385{
386 preempt_disable();
387 if (test_and_clear_thread_flag(TIF_NOTSC))
388 /*
389 * Must flip the CPU state synchronously with
390 * TIF_NOTSC in the current running context.
391 */
392 hard_enable_TSC();
393 preempt_enable();
394}
395
396int get_tsc_mode(unsigned long adr)
397{
398 unsigned int val;
399
400 if (test_thread_flag(TIF_NOTSC))
401 val = PR_TSC_SIGSEGV;
402 else
403 val = PR_TSC_ENABLE;
404
405 return put_user(val, (unsigned int __user *)adr);
406}
407
408int set_tsc_mode(unsigned int val)
409{
410 if (val == PR_TSC_SIGSEGV)
411 disable_TSC();
412 else if (val == PR_TSC_ENABLE)
413 enable_TSC();
414 else
415 return -EINVAL;
416
417 return 0;
418}
419
420static noinline void
421__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
422 struct tss_struct *tss)
423{
424 struct thread_struct *prev, *next;
425
426 prev = &prev_p->thread;
427 next = &next_p->thread;
428
429 if (test_tsk_thread_flag(next_p, TIF_DS_AREA_MSR) ||
430 test_tsk_thread_flag(prev_p, TIF_DS_AREA_MSR))
431 ds_switch_to(prev_p, next_p);
432 else if (next->debugctlmsr != prev->debugctlmsr)
433 update_debugctlmsr(next->debugctlmsr);
434
435 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
436 set_debugreg(next->debugreg0, 0);
437 set_debugreg(next->debugreg1, 1);
438 set_debugreg(next->debugreg2, 2);
439 set_debugreg(next->debugreg3, 3);
440 /* no 4 and 5 */
441 set_debugreg(next->debugreg6, 6);
442 set_debugreg(next->debugreg7, 7);
443 }
444
445 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
446 test_tsk_thread_flag(next_p, TIF_NOTSC)) {
447 /* prev and next are different */
448 if (test_tsk_thread_flag(next_p, TIF_NOTSC))
449 hard_disable_TSC();
450 else
451 hard_enable_TSC();
452 }
453
454 if (!test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
455 /*
456 * Disable the bitmap via an invalid offset. We still cache
457 * the previous bitmap owner and the IO bitmap contents:
458 */
459 tss->x86_tss.io_bitmap_base = INVALID_IO_BITMAP_OFFSET;
460 return;
461 }
462
463 if (likely(next == tss->io_bitmap_owner)) {
464 /*
465 * Previous owner of the bitmap (hence the bitmap content)
466 * matches the next task, we dont have to do anything but
467 * to set a valid offset in the TSS:
468 */
469 tss->x86_tss.io_bitmap_base = IO_BITMAP_OFFSET;
470 return;
471 }
472 /*
473 * Lazy TSS's I/O bitmap copy. We set an invalid offset here
474 * and we let the task to get a GPF in case an I/O instruction
475 * is performed. The handler of the GPF will verify that the
476 * faulting task has a valid I/O bitmap and, it true, does the
477 * real copy and restart the instruction. This will save us
478 * redundant copies when the currently switched task does not
479 * perform any I/O during its timeslice.
480 */
481 tss->x86_tss.io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY;
482}
483 320
484/* 321/*
485 * switch_to(x,yn) should switch tasks from x to y. 322 * switch_to(x,yn) should switch tasks from x to y.
@@ -540,7 +377,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
540 * used %fs or %gs (it does not today), or if the kernel is 377 * used %fs or %gs (it does not today), or if the kernel is
541 * running inside of a hypervisor layer. 378 * running inside of a hypervisor layer.
542 */ 379 */
543 savesegment(gs, prev->gs); 380 lazy_save_gs(prev->gs);
544 381
545 /* 382 /*
546 * Load the per-thread Thread-Local Storage descriptor. 383 * Load the per-thread Thread-Local Storage descriptor.
@@ -586,64 +423,44 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
586 * Restore %gs if needed (which is common) 423 * Restore %gs if needed (which is common)
587 */ 424 */
588 if (prev->gs | next->gs) 425 if (prev->gs | next->gs)
589 loadsegment(gs, next->gs); 426 lazy_load_gs(next->gs);
590 427
591 x86_write_percpu(current_task, next_p); 428 percpu_write(current_task, next_p);
592 429
593 return prev_p; 430 return prev_p;
594} 431}
595 432
596asmlinkage int sys_fork(struct pt_regs regs) 433int sys_clone(struct pt_regs *regs)
597{
598 return do_fork(SIGCHLD, regs.sp, &regs, 0, NULL, NULL);
599}
600
601asmlinkage int sys_clone(struct pt_regs regs)
602{ 434{
603 unsigned long clone_flags; 435 unsigned long clone_flags;
604 unsigned long newsp; 436 unsigned long newsp;
605 int __user *parent_tidptr, *child_tidptr; 437 int __user *parent_tidptr, *child_tidptr;
606 438
607 clone_flags = regs.bx; 439 clone_flags = regs->bx;
608 newsp = regs.cx; 440 newsp = regs->cx;
609 parent_tidptr = (int __user *)regs.dx; 441 parent_tidptr = (int __user *)regs->dx;
610 child_tidptr = (int __user *)regs.di; 442 child_tidptr = (int __user *)regs->di;
611 if (!newsp) 443 if (!newsp)
612 newsp = regs.sp; 444 newsp = regs->sp;
613 return do_fork(clone_flags, newsp, &regs, 0, parent_tidptr, child_tidptr); 445 return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr);
614}
615
616/*
617 * This is trivial, and on the face of it looks like it
618 * could equally well be done in user mode.
619 *
620 * Not so, for quite unobvious reasons - register pressure.
621 * In user mode vfork() cannot have a stack frame, and if
622 * done by calling the "clone()" system call directly, you
623 * do not have enough call-clobbered registers to hold all
624 * the information you need.
625 */
626asmlinkage int sys_vfork(struct pt_regs regs)
627{
628 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.sp, &regs, 0, NULL, NULL);
629} 446}
630 447
631/* 448/*
632 * sys_execve() executes a new program. 449 * sys_execve() executes a new program.
633 */ 450 */
634asmlinkage int sys_execve(struct pt_regs regs) 451int sys_execve(struct pt_regs *regs)
635{ 452{
636 int error; 453 int error;
637 char *filename; 454 char *filename;
638 455
639 filename = getname((char __user *) regs.bx); 456 filename = getname((char __user *) regs->bx);
640 error = PTR_ERR(filename); 457 error = PTR_ERR(filename);
641 if (IS_ERR(filename)) 458 if (IS_ERR(filename))
642 goto out; 459 goto out;
643 error = do_execve(filename, 460 error = do_execve(filename,
644 (char __user * __user *) regs.cx, 461 (char __user * __user *) regs->cx,
645 (char __user * __user *) regs.dx, 462 (char __user * __user *) regs->dx,
646 &regs); 463 regs);
647 if (error == 0) { 464 if (error == 0) {
648 /* Make sure we don't return using sysenter.. */ 465 /* Make sure we don't return using sysenter.. */
649 set_thread_flag(TIF_IRET); 466 set_thread_flag(TIF_IRET);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 85b4cb5c1980..abb7e6a7f0c6 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -16,6 +16,7 @@
16 16
17#include <stdarg.h> 17#include <stdarg.h>
18 18
19#include <linux/stackprotector.h>
19#include <linux/cpu.h> 20#include <linux/cpu.h>
20#include <linux/errno.h> 21#include <linux/errno.h>
21#include <linux/sched.h> 22#include <linux/sched.h>
@@ -47,7 +48,6 @@
47#include <asm/processor.h> 48#include <asm/processor.h>
48#include <asm/i387.h> 49#include <asm/i387.h>
49#include <asm/mmu_context.h> 50#include <asm/mmu_context.h>
50#include <asm/pda.h>
51#include <asm/prctl.h> 51#include <asm/prctl.h>
52#include <asm/desc.h> 52#include <asm/desc.h>
53#include <asm/proto.h> 53#include <asm/proto.h>
@@ -58,6 +58,12 @@
58 58
59asmlinkage extern void ret_from_fork(void); 59asmlinkage extern void ret_from_fork(void);
60 60
61DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
62EXPORT_PER_CPU_SYMBOL(current_task);
63
64DEFINE_PER_CPU(unsigned long, old_rsp);
65static DEFINE_PER_CPU(unsigned char, is_idle);
66
61unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; 67unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
62 68
63static ATOMIC_NOTIFIER_HEAD(idle_notifier); 69static ATOMIC_NOTIFIER_HEAD(idle_notifier);
@@ -76,13 +82,13 @@ EXPORT_SYMBOL_GPL(idle_notifier_unregister);
76 82
77void enter_idle(void) 83void enter_idle(void)
78{ 84{
79 write_pda(isidle, 1); 85 percpu_write(is_idle, 1);
80 atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL); 86 atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
81} 87}
82 88
83static void __exit_idle(void) 89static void __exit_idle(void)
84{ 90{
85 if (test_and_clear_bit_pda(0, isidle) == 0) 91 if (x86_test_and_clear_bit_percpu(0, is_idle) == 0)
86 return; 92 return;
87 atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL); 93 atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
88} 94}
@@ -112,6 +118,16 @@ static inline void play_dead(void)
112void cpu_idle(void) 118void cpu_idle(void)
113{ 119{
114 current_thread_info()->status |= TS_POLLING; 120 current_thread_info()->status |= TS_POLLING;
121
122 /*
123 * If we're the non-boot CPU, nothing set the stack canary up
124 * for us. CPU0 already has it initialized but no harm in
125 * doing it again. This is a good place for updating it, as
126 * we wont ever return from this function (so the invalid
127 * canaries already on the stack wont ever trigger).
128 */
129 boot_init_stack_canary();
130
115 /* endless idle loop with no priority at all */ 131 /* endless idle loop with no priority at all */
116 while (1) { 132 while (1) {
117 tick_nohz_stop_sched_tick(1); 133 tick_nohz_stop_sched_tick(1);
@@ -221,61 +237,6 @@ void show_regs(struct pt_regs *regs)
221 show_trace(NULL, regs, (void *)(regs + 1), regs->bp); 237 show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
222} 238}
223 239
224/*
225 * Free current thread data structures etc..
226 */
227void exit_thread(void)
228{
229 struct task_struct *me = current;
230 struct thread_struct *t = &me->thread;
231
232 if (me->thread.io_bitmap_ptr) {
233 struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
234
235 kfree(t->io_bitmap_ptr);
236 t->io_bitmap_ptr = NULL;
237 clear_thread_flag(TIF_IO_BITMAP);
238 /*
239 * Careful, clear this in the TSS too:
240 */
241 memset(tss->io_bitmap, 0xff, t->io_bitmap_max);
242 t->io_bitmap_max = 0;
243 put_cpu();
244 }
245
246 ds_exit_thread(current);
247}
248
249void flush_thread(void)
250{
251 struct task_struct *tsk = current;
252
253 if (test_tsk_thread_flag(tsk, TIF_ABI_PENDING)) {
254 clear_tsk_thread_flag(tsk, TIF_ABI_PENDING);
255 if (test_tsk_thread_flag(tsk, TIF_IA32)) {
256 clear_tsk_thread_flag(tsk, TIF_IA32);
257 } else {
258 set_tsk_thread_flag(tsk, TIF_IA32);
259 current_thread_info()->status |= TS_COMPAT;
260 }
261 }
262 clear_tsk_thread_flag(tsk, TIF_DEBUG);
263
264 tsk->thread.debugreg0 = 0;
265 tsk->thread.debugreg1 = 0;
266 tsk->thread.debugreg2 = 0;
267 tsk->thread.debugreg3 = 0;
268 tsk->thread.debugreg6 = 0;
269 tsk->thread.debugreg7 = 0;
270 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
271 /*
272 * Forget coprocessor state..
273 */
274 tsk->fpu_counter = 0;
275 clear_fpu(tsk);
276 clear_used_math();
277}
278
279void release_thread(struct task_struct *dead_task) 240void release_thread(struct task_struct *dead_task)
280{ 241{
281 if (dead_task->mm) { 242 if (dead_task->mm) {
@@ -397,7 +358,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
397 load_gs_index(0); 358 load_gs_index(0);
398 regs->ip = new_ip; 359 regs->ip = new_ip;
399 regs->sp = new_sp; 360 regs->sp = new_sp;
400 write_pda(oldrsp, new_sp); 361 percpu_write(old_rsp, new_sp);
401 regs->cs = __USER_CS; 362 regs->cs = __USER_CS;
402 regs->ss = __USER_DS; 363 regs->ss = __USER_DS;
403 regs->flags = 0x200; 364 regs->flags = 0x200;
@@ -409,118 +370,6 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
409} 370}
410EXPORT_SYMBOL_GPL(start_thread); 371EXPORT_SYMBOL_GPL(start_thread);
411 372
412static void hard_disable_TSC(void)
413{
414 write_cr4(read_cr4() | X86_CR4_TSD);
415}
416
417void disable_TSC(void)
418{
419 preempt_disable();
420 if (!test_and_set_thread_flag(TIF_NOTSC))
421 /*
422 * Must flip the CPU state synchronously with
423 * TIF_NOTSC in the current running context.
424 */
425 hard_disable_TSC();
426 preempt_enable();
427}
428
429static void hard_enable_TSC(void)
430{
431 write_cr4(read_cr4() & ~X86_CR4_TSD);
432}
433
434static void enable_TSC(void)
435{
436 preempt_disable();
437 if (test_and_clear_thread_flag(TIF_NOTSC))
438 /*
439 * Must flip the CPU state synchronously with
440 * TIF_NOTSC in the current running context.
441 */
442 hard_enable_TSC();
443 preempt_enable();
444}
445
446int get_tsc_mode(unsigned long adr)
447{
448 unsigned int val;
449
450 if (test_thread_flag(TIF_NOTSC))
451 val = PR_TSC_SIGSEGV;
452 else
453 val = PR_TSC_ENABLE;
454
455 return put_user(val, (unsigned int __user *)adr);
456}
457
458int set_tsc_mode(unsigned int val)
459{
460 if (val == PR_TSC_SIGSEGV)
461 disable_TSC();
462 else if (val == PR_TSC_ENABLE)
463 enable_TSC();
464 else
465 return -EINVAL;
466
467 return 0;
468}
469
470/*
471 * This special macro can be used to load a debugging register
472 */
473#define loaddebug(thread, r) set_debugreg(thread->debugreg ## r, r)
474
475static inline void __switch_to_xtra(struct task_struct *prev_p,
476 struct task_struct *next_p,
477 struct tss_struct *tss)
478{
479 struct thread_struct *prev, *next;
480
481 prev = &prev_p->thread,
482 next = &next_p->thread;
483
484 if (test_tsk_thread_flag(next_p, TIF_DS_AREA_MSR) ||
485 test_tsk_thread_flag(prev_p, TIF_DS_AREA_MSR))
486 ds_switch_to(prev_p, next_p);
487 else if (next->debugctlmsr != prev->debugctlmsr)
488 update_debugctlmsr(next->debugctlmsr);
489
490 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
491 loaddebug(next, 0);
492 loaddebug(next, 1);
493 loaddebug(next, 2);
494 loaddebug(next, 3);
495 /* no 4 and 5 */
496 loaddebug(next, 6);
497 loaddebug(next, 7);
498 }
499
500 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
501 test_tsk_thread_flag(next_p, TIF_NOTSC)) {
502 /* prev and next are different */
503 if (test_tsk_thread_flag(next_p, TIF_NOTSC))
504 hard_disable_TSC();
505 else
506 hard_enable_TSC();
507 }
508
509 if (test_tsk_thread_flag(next_p, TIF_IO_BITMAP)) {
510 /*
511 * Copy the relevant range of the IO bitmap.
512 * Normally this is 128 bytes or less:
513 */
514 memcpy(tss->io_bitmap, next->io_bitmap_ptr,
515 max(prev->io_bitmap_max, next->io_bitmap_max));
516 } else if (test_tsk_thread_flag(prev_p, TIF_IO_BITMAP)) {
517 /*
518 * Clear any possible leftover bits:
519 */
520 memset(tss->io_bitmap, 0xff, prev->io_bitmap_max);
521 }
522}
523
524/* 373/*
525 * switch_to(x,y) should switch tasks from x to y. 374 * switch_to(x,y) should switch tasks from x to y.
526 * 375 *
@@ -618,21 +467,13 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
618 /* 467 /*
619 * Switch the PDA and FPU contexts. 468 * Switch the PDA and FPU contexts.
620 */ 469 */
621 prev->usersp = read_pda(oldrsp); 470 prev->usersp = percpu_read(old_rsp);
622 write_pda(oldrsp, next->usersp); 471 percpu_write(old_rsp, next->usersp);
623 write_pda(pcurrent, next_p); 472 percpu_write(current_task, next_p);
624 473
625 write_pda(kernelstack, 474 percpu_write(kernel_stack,
626 (unsigned long)task_stack_page(next_p) + 475 (unsigned long)task_stack_page(next_p) +
627 THREAD_SIZE - PDA_STACKOFFSET); 476 THREAD_SIZE - KERNEL_STACK_OFFSET);
628#ifdef CONFIG_CC_STACKPROTECTOR
629 write_pda(stack_canary, next_p->stack_canary);
630 /*
631 * Build time only check to make sure the stack_canary is at
632 * offset 40 in the pda; this is a gcc ABI requirement
633 */
634 BUILD_BUG_ON(offsetof(struct x8664_pda, stack_canary) != 40);
635#endif
636 477
637 /* 478 /*
638 * Now maybe reload the debug registers and handle I/O bitmaps 479 * Now maybe reload the debug registers and handle I/O bitmaps
@@ -686,11 +527,6 @@ void set_personality_64bit(void)
686 current->personality &= ~READ_IMPLIES_EXEC; 527 current->personality &= ~READ_IMPLIES_EXEC;
687} 528}
688 529
689asmlinkage long sys_fork(struct pt_regs *regs)
690{
691 return do_fork(SIGCHLD, regs->sp, regs, 0, NULL, NULL);
692}
693
694asmlinkage long 530asmlinkage long
695sys_clone(unsigned long clone_flags, unsigned long newsp, 531sys_clone(unsigned long clone_flags, unsigned long newsp,
696 void __user *parent_tid, void __user *child_tid, struct pt_regs *regs) 532 void __user *parent_tid, void __user *child_tid, struct pt_regs *regs)
@@ -700,22 +536,6 @@ sys_clone(unsigned long clone_flags, unsigned long newsp,
700 return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); 536 return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid);
701} 537}
702 538
703/*
704 * This is trivial, and on the face of it looks like it
705 * could equally well be done in user mode.
706 *
707 * Not so, for quite unobvious reasons - register pressure.
708 * In user mode vfork() cannot have a stack frame, and if
709 * done by calling the "clone()" system call directly, you
710 * do not have enough call-clobbered registers to hold all
711 * the information you need.
712 */
713asmlinkage long sys_vfork(struct pt_regs *regs)
714{
715 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->sp, regs, 0,
716 NULL, NULL);
717}
718
719unsigned long get_wchan(struct task_struct *p) 539unsigned long get_wchan(struct task_struct *p)
720{ 540{
721 unsigned long stack; 541 unsigned long stack;
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 06ca07f6ad86..3d9672e59c16 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -75,10 +75,7 @@ static inline bool invalid_selector(u16 value)
75static unsigned long *pt_regs_access(struct pt_regs *regs, unsigned long regno) 75static unsigned long *pt_regs_access(struct pt_regs *regs, unsigned long regno)
76{ 76{
77 BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0); 77 BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0);
78 regno >>= 2; 78 return &regs->bx + (regno >> 2);
79 if (regno > FS)
80 --regno;
81 return &regs->bx + regno;
82} 79}
83 80
84static u16 get_segment_reg(struct task_struct *task, unsigned long offset) 81static u16 get_segment_reg(struct task_struct *task, unsigned long offset)
@@ -90,9 +87,10 @@ static u16 get_segment_reg(struct task_struct *task, unsigned long offset)
90 if (offset != offsetof(struct user_regs_struct, gs)) 87 if (offset != offsetof(struct user_regs_struct, gs))
91 retval = *pt_regs_access(task_pt_regs(task), offset); 88 retval = *pt_regs_access(task_pt_regs(task), offset);
92 else { 89 else {
93 retval = task->thread.gs;
94 if (task == current) 90 if (task == current)
95 savesegment(gs, retval); 91 retval = get_user_gs(task_pt_regs(task));
92 else
93 retval = task_user_gs(task);
96 } 94 }
97 return retval; 95 return retval;
98} 96}
@@ -126,13 +124,10 @@ static int set_segment_reg(struct task_struct *task,
126 break; 124 break;
127 125
128 case offsetof(struct user_regs_struct, gs): 126 case offsetof(struct user_regs_struct, gs):
129 task->thread.gs = value;
130 if (task == current) 127 if (task == current)
131 /* 128 set_user_gs(task_pt_regs(task), value);
132 * The user-mode %gs is not affected by 129 else
133 * kernel entry, so we must update the CPU. 130 task_user_gs(task) = value;
134 */
135 loadsegment(gs, value);
136 } 131 }
137 132
138 return 0; 133 return 0;
@@ -273,7 +268,7 @@ static unsigned long debugreg_addr_limit(struct task_struct *task)
273 if (test_tsk_thread_flag(task, TIF_IA32)) 268 if (test_tsk_thread_flag(task, TIF_IA32))
274 return IA32_PAGE_OFFSET - 3; 269 return IA32_PAGE_OFFSET - 3;
275#endif 270#endif
276 return TASK_SIZE64 - 7; 271 return TASK_SIZE_MAX - 7;
277} 272}
278 273
279#endif /* CONFIG_X86_32 */ 274#endif /* CONFIG_X86_32 */
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 309949e9e1c1..697d1b78cfbf 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -172,7 +172,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4,
172 ich_force_enable_hpet); 172 ich_force_enable_hpet);
173DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, 173DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7,
174 ich_force_enable_hpet); 174 ich_force_enable_hpet);
175 175DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x3a16, /* ICH10 */
176 ich_force_enable_hpet);
176 177
177static struct pci_dev *cached_dev; 178static struct pci_dev *cached_dev;
178 179
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 4526b3a75ed2..2aef36d8aca2 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -14,6 +14,7 @@
14#include <asm/reboot.h> 14#include <asm/reboot.h>
15#include <asm/pci_x86.h> 15#include <asm/pci_x86.h>
16#include <asm/virtext.h> 16#include <asm/virtext.h>
17#include <asm/cpu.h>
17 18
18#ifdef CONFIG_X86_32 19#ifdef CONFIG_X86_32
19# include <linux/dmi.h> 20# include <linux/dmi.h>
@@ -23,8 +24,6 @@
23# include <asm/iommu.h> 24# include <asm/iommu.h>
24#endif 25#endif
25 26
26#include <mach_ipi.h>
27
28/* 27/*
29 * Power off function, if any 28 * Power off function, if any
30 */ 29 */
@@ -658,7 +657,7 @@ static int crash_nmi_callback(struct notifier_block *self,
658 657
659static void smp_send_nmi_allbutself(void) 658static void smp_send_nmi_allbutself(void)
660{ 659{
661 send_IPI_allbutself(NMI_VECTOR); 660 apic->send_IPI_allbutself(NMI_VECTOR);
662} 661}
663 662
664static struct notifier_block crash_nmi_nb = { 663static struct notifier_block crash_nmi_nb = {
diff --git a/arch/x86/kernel/relocate_kernel_32.S b/arch/x86/kernel/relocate_kernel_32.S
index a160f3119725..2064d0aa8d28 100644
--- a/arch/x86/kernel/relocate_kernel_32.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/page.h> 10#include <asm/page_types.h>
11#include <asm/kexec.h> 11#include <asm/kexec.h>
12#include <asm/processor-flags.h> 12#include <asm/processor-flags.h>
13 13
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index f5afe665a82b..d32cfb27a479 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -7,10 +7,10 @@
7 */ 7 */
8 8
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/page.h> 10#include <asm/page_types.h>
11#include <asm/kexec.h> 11#include <asm/kexec.h>
12#include <asm/processor-flags.h> 12#include <asm/processor-flags.h>
13#include <asm/pgtable.h> 13#include <asm/pgtable_types.h>
14 14
15/* 15/*
16 * Must be relocatable PIC code callable as a C function 16 * Must be relocatable PIC code callable as a C function
@@ -29,122 +29,6 @@ relocate_kernel:
29 * %rdx start address 29 * %rdx start address
30 */ 30 */
31 31
32 /* map the control page at its virtual address */
33
34 movq $0x0000ff8000000000, %r10 /* mask */
35 mov $(39 - 3), %cl /* bits to shift */
36 movq PTR(VA_CONTROL_PAGE)(%rsi), %r11 /* address to map */
37
38 movq %r11, %r9
39 andq %r10, %r9
40 shrq %cl, %r9
41
42 movq PTR(VA_PGD)(%rsi), %r8
43 addq %r8, %r9
44 movq PTR(PA_PUD_0)(%rsi), %r8
45 orq $PAGE_ATTR, %r8
46 movq %r8, (%r9)
47
48 shrq $9, %r10
49 sub $9, %cl
50
51 movq %r11, %r9
52 andq %r10, %r9
53 shrq %cl, %r9
54
55 movq PTR(VA_PUD_0)(%rsi), %r8
56 addq %r8, %r9
57 movq PTR(PA_PMD_0)(%rsi), %r8
58 orq $PAGE_ATTR, %r8
59 movq %r8, (%r9)
60
61 shrq $9, %r10
62 sub $9, %cl
63
64 movq %r11, %r9
65 andq %r10, %r9
66 shrq %cl, %r9
67
68 movq PTR(VA_PMD_0)(%rsi), %r8
69 addq %r8, %r9
70 movq PTR(PA_PTE_0)(%rsi), %r8
71 orq $PAGE_ATTR, %r8
72 movq %r8, (%r9)
73
74 shrq $9, %r10
75 sub $9, %cl
76
77 movq %r11, %r9
78 andq %r10, %r9
79 shrq %cl, %r9
80
81 movq PTR(VA_PTE_0)(%rsi), %r8
82 addq %r8, %r9
83 movq PTR(PA_CONTROL_PAGE)(%rsi), %r8
84 orq $PAGE_ATTR, %r8
85 movq %r8, (%r9)
86
87 /* identity map the control page at its physical address */
88
89 movq $0x0000ff8000000000, %r10 /* mask */
90 mov $(39 - 3), %cl /* bits to shift */
91 movq PTR(PA_CONTROL_PAGE)(%rsi), %r11 /* address to map */
92
93 movq %r11, %r9
94 andq %r10, %r9
95 shrq %cl, %r9
96
97 movq PTR(VA_PGD)(%rsi), %r8
98 addq %r8, %r9
99 movq PTR(PA_PUD_1)(%rsi), %r8
100 orq $PAGE_ATTR, %r8
101 movq %r8, (%r9)
102
103 shrq $9, %r10
104 sub $9, %cl
105
106 movq %r11, %r9
107 andq %r10, %r9
108 shrq %cl, %r9
109
110 movq PTR(VA_PUD_1)(%rsi), %r8
111 addq %r8, %r9
112 movq PTR(PA_PMD_1)(%rsi), %r8
113 orq $PAGE_ATTR, %r8
114 movq %r8, (%r9)
115
116 shrq $9, %r10
117 sub $9, %cl
118
119 movq %r11, %r9
120 andq %r10, %r9
121 shrq %cl, %r9
122
123 movq PTR(VA_PMD_1)(%rsi), %r8
124 addq %r8, %r9
125 movq PTR(PA_PTE_1)(%rsi), %r8
126 orq $PAGE_ATTR, %r8
127 movq %r8, (%r9)
128
129 shrq $9, %r10
130 sub $9, %cl
131
132 movq %r11, %r9
133 andq %r10, %r9
134 shrq %cl, %r9
135
136 movq PTR(VA_PTE_1)(%rsi), %r8
137 addq %r8, %r9
138 movq PTR(PA_CONTROL_PAGE)(%rsi), %r8
139 orq $PAGE_ATTR, %r8
140 movq %r8, (%r9)
141
142relocate_new_kernel:
143 /* %rdi indirection_page
144 * %rsi page_list
145 * %rdx start address
146 */
147
148 /* zero out flags, and disable interrupts */ 32 /* zero out flags, and disable interrupts */
149 pushq $0 33 pushq $0
150 popfq 34 popfq
@@ -156,9 +40,8 @@ relocate_new_kernel:
156 /* get physical address of page table now too */ 40 /* get physical address of page table now too */
157 movq PTR(PA_TABLE_PAGE)(%rsi), %rcx 41 movq PTR(PA_TABLE_PAGE)(%rsi), %rcx
158 42
159 /* switch to new set of page tables */ 43 /* Switch to the identity mapped page tables */
160 movq PTR(PA_PGD)(%rsi), %r9 44 movq %rcx, %cr3
161 movq %r9, %cr3
162 45
163 /* setup a new stack at the end of the physical control page */ 46 /* setup a new stack at the end of the physical control page */
164 lea PAGE_SIZE(%r8), %rsp 47 lea PAGE_SIZE(%r8), %rsp
@@ -194,9 +77,7 @@ identity_mapped:
194 jmp 1f 77 jmp 1f
1951: 781:
196 79
197 /* Switch to the identity mapped page tables, 80 /* Flush the TLB (needed?) */
198 * and flush the TLB.
199 */
200 movq %rcx, %cr3 81 movq %rcx, %cr3
201 82
202 /* Do the copies */ 83 /* Do the copies */
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 6a8811a69324..b746deb9ebc6 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -74,14 +74,15 @@
74#include <asm/e820.h> 74#include <asm/e820.h>
75#include <asm/mpspec.h> 75#include <asm/mpspec.h>
76#include <asm/setup.h> 76#include <asm/setup.h>
77#include <asm/arch_hooks.h>
78#include <asm/efi.h> 77#include <asm/efi.h>
78#include <asm/timer.h>
79#include <asm/i8259.h>
79#include <asm/sections.h> 80#include <asm/sections.h>
80#include <asm/dmi.h> 81#include <asm/dmi.h>
81#include <asm/io_apic.h> 82#include <asm/io_apic.h>
82#include <asm/ist.h> 83#include <asm/ist.h>
83#include <asm/vmi.h> 84#include <asm/vmi.h>
84#include <setup_arch.h> 85#include <asm/setup_arch.h>
85#include <asm/bios_ebda.h> 86#include <asm/bios_ebda.h>
86#include <asm/cacheflush.h> 87#include <asm/cacheflush.h>
87#include <asm/processor.h> 88#include <asm/processor.h>
@@ -89,7 +90,7 @@
89 90
90#include <asm/system.h> 91#include <asm/system.h>
91#include <asm/vsyscall.h> 92#include <asm/vsyscall.h>
92#include <asm/smp.h> 93#include <asm/cpu.h>
93#include <asm/desc.h> 94#include <asm/desc.h>
94#include <asm/dma.h> 95#include <asm/dma.h>
95#include <asm/iommu.h> 96#include <asm/iommu.h>
@@ -97,7 +98,6 @@
97#include <asm/mmu_context.h> 98#include <asm/mmu_context.h>
98#include <asm/proto.h> 99#include <asm/proto.h>
99 100
100#include <mach_apic.h>
101#include <asm/paravirt.h> 101#include <asm/paravirt.h>
102#include <asm/hypervisor.h> 102#include <asm/hypervisor.h>
103 103
@@ -112,6 +112,20 @@
112#define ARCH_SETUP 112#define ARCH_SETUP
113#endif 113#endif
114 114
115unsigned int boot_cpu_id __read_mostly;
116
117#ifdef CONFIG_X86_64
118int default_cpu_present_to_apicid(int mps_cpu)
119{
120 return __default_cpu_present_to_apicid(mps_cpu);
121}
122
123int default_check_phys_apicid_present(int boot_cpu_physical_apicid)
124{
125 return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
126}
127#endif
128
115#ifndef CONFIG_DEBUG_BOOT_PARAMS 129#ifndef CONFIG_DEBUG_BOOT_PARAMS
116struct boot_params __initdata boot_params; 130struct boot_params __initdata boot_params;
117#else 131#else
@@ -586,20 +600,7 @@ static int __init setup_elfcorehdr(char *arg)
586early_param("elfcorehdr", setup_elfcorehdr); 600early_param("elfcorehdr", setup_elfcorehdr);
587#endif 601#endif
588 602
589static int __init default_update_genapic(void) 603static struct x86_quirks default_x86_quirks __initdata;
590{
591#ifdef CONFIG_X86_SMP
592# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64)
593 genapic->wakeup_cpu = wakeup_secondary_cpu_via_init;
594# endif
595#endif
596
597 return 0;
598}
599
600static struct x86_quirks default_x86_quirks __initdata = {
601 .update_genapic = default_update_genapic,
602};
603 604
604struct x86_quirks *x86_quirks __initdata = &default_x86_quirks; 605struct x86_quirks *x86_quirks __initdata = &default_x86_quirks;
605 606
@@ -656,7 +657,6 @@ void __init setup_arch(char **cmdline_p)
656#ifdef CONFIG_X86_32 657#ifdef CONFIG_X86_32
657 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); 658 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
658 visws_early_detect(); 659 visws_early_detect();
659 pre_setup_arch_hook();
660#else 660#else
661 printk(KERN_INFO "Command line: %s\n", boot_command_line); 661 printk(KERN_INFO "Command line: %s\n", boot_command_line);
662#endif 662#endif
@@ -824,8 +824,7 @@ void __init setup_arch(char **cmdline_p)
824#else 824#else
825 num_physpages = max_pfn; 825 num_physpages = max_pfn;
826 826
827 if (cpu_has_x2apic) 827 check_x2apic();
828 check_x2apic();
829 828
830 /* How many end-of-memory variables you have, grandma! */ 829 /* How many end-of-memory variables you have, grandma! */
831 /* need this before calling reserve_initrd */ 830 /* need this before calling reserve_initrd */
@@ -865,9 +864,7 @@ void __init setup_arch(char **cmdline_p)
865 864
866 reserve_initrd(); 865 reserve_initrd();
867 866
868#ifdef CONFIG_X86_64
869 vsmp_init(); 867 vsmp_init();
870#endif
871 868
872 io_delay_init(); 869 io_delay_init();
873 870
@@ -893,12 +890,11 @@ void __init setup_arch(char **cmdline_p)
893 */ 890 */
894 acpi_reserve_bootmem(); 891 acpi_reserve_bootmem();
895#endif 892#endif
896#ifdef CONFIG_X86_FIND_SMP_CONFIG
897 /* 893 /*
898 * Find and reserve possible boot-time SMP configuration: 894 * Find and reserve possible boot-time SMP configuration:
899 */ 895 */
900 find_smp_config(); 896 find_smp_config();
901#endif 897
902 reserve_crashkernel(); 898 reserve_crashkernel();
903 899
904#ifdef CONFIG_X86_64 900#ifdef CONFIG_X86_64
@@ -925,9 +921,7 @@ void __init setup_arch(char **cmdline_p)
925 map_vsyscall(); 921 map_vsyscall();
926#endif 922#endif
927 923
928#ifdef CONFIG_X86_GENERICARCH
929 generic_apic_probe(); 924 generic_apic_probe();
930#endif
931 925
932 early_quirks(); 926 early_quirks();
933 927
@@ -978,4 +972,95 @@ void __init setup_arch(char **cmdline_p)
978#endif 972#endif
979} 973}
980 974
975#ifdef CONFIG_X86_32
981 976
977/**
978 * x86_quirk_pre_intr_init - initialisation prior to setting up interrupt vectors
979 *
980 * Description:
981 * Perform any necessary interrupt initialisation prior to setting up
982 * the "ordinary" interrupt call gates. For legacy reasons, the ISA
983 * interrupts should be initialised here if the machine emulates a PC
984 * in any way.
985 **/
986void __init x86_quirk_pre_intr_init(void)
987{
988 if (x86_quirks->arch_pre_intr_init) {
989 if (x86_quirks->arch_pre_intr_init())
990 return;
991 }
992 init_ISA_irqs();
993}
994
995/**
996 * x86_quirk_intr_init - post gate setup interrupt initialisation
997 *
998 * Description:
999 * Fill in any interrupts that may have been left out by the general
1000 * init_IRQ() routine. interrupts having to do with the machine rather
1001 * than the devices on the I/O bus (like APIC interrupts in intel MP
1002 * systems) are started here.
1003 **/
1004void __init x86_quirk_intr_init(void)
1005{
1006 if (x86_quirks->arch_intr_init) {
1007 if (x86_quirks->arch_intr_init())
1008 return;
1009 }
1010}
1011
1012/**
1013 * x86_quirk_trap_init - initialise system specific traps
1014 *
1015 * Description:
1016 * Called as the final act of trap_init(). Used in VISWS to initialise
1017 * the various board specific APIC traps.
1018 **/
1019void __init x86_quirk_trap_init(void)
1020{
1021 if (x86_quirks->arch_trap_init) {
1022 if (x86_quirks->arch_trap_init())
1023 return;
1024 }
1025}
1026
1027static struct irqaction irq0 = {
1028 .handler = timer_interrupt,
1029 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
1030 .mask = CPU_MASK_NONE,
1031 .name = "timer"
1032};
1033
1034/**
1035 * x86_quirk_pre_time_init - do any specific initialisations before.
1036 *
1037 **/
1038void __init x86_quirk_pre_time_init(void)
1039{
1040 if (x86_quirks->arch_pre_time_init)
1041 x86_quirks->arch_pre_time_init();
1042}
1043
1044/**
1045 * x86_quirk_time_init - do any specific initialisations for the system timer.
1046 *
1047 * Description:
1048 * Must plug the system timer interrupt source at HZ into the IRQ listed
1049 * in irq_vectors.h:TIMER_IRQ
1050 **/
1051void __init x86_quirk_time_init(void)
1052{
1053 if (x86_quirks->arch_time_init) {
1054 /*
1055 * A nonzero return code does not mean failure, it means
1056 * that the architecture quirk does not want any
1057 * generic (timer) setup to be performed after this:
1058 */
1059 if (x86_quirks->arch_time_init())
1060 return;
1061 }
1062
1063 irq0.mask = cpumask_of_cpu(0);
1064 setup_irq(0, &irq0);
1065}
1066#endif /* CONFIG_X86_32 */
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 01161077a49c..400331b50a53 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -7,402 +7,439 @@
7#include <linux/crash_dump.h> 7#include <linux/crash_dump.h>
8#include <linux/smp.h> 8#include <linux/smp.h>
9#include <linux/topology.h> 9#include <linux/topology.h>
10#include <linux/pfn.h>
10#include <asm/sections.h> 11#include <asm/sections.h>
11#include <asm/processor.h> 12#include <asm/processor.h>
12#include <asm/setup.h> 13#include <asm/setup.h>
13#include <asm/mpspec.h> 14#include <asm/mpspec.h>
14#include <asm/apicdef.h> 15#include <asm/apicdef.h>
15#include <asm/highmem.h> 16#include <asm/highmem.h>
17#include <asm/proto.h>
18#include <asm/cpumask.h>
19#include <asm/cpu.h>
20#include <asm/stackprotector.h>
16 21
17#ifdef CONFIG_X86_LOCAL_APIC 22#ifdef CONFIG_DEBUG_PER_CPU_MAPS
18unsigned int num_processors; 23# define DBG(x...) printk(KERN_DEBUG x)
19unsigned disabled_cpus __cpuinitdata; 24#else
20/* Processor that is doing the boot up */ 25# define DBG(x...)
21unsigned int boot_cpu_physical_apicid = -1U;
22EXPORT_SYMBOL(boot_cpu_physical_apicid);
23unsigned int max_physical_apicid;
24
25/* Bitmask of physically existing CPUs */
26physid_mask_t phys_cpu_present_map;
27#endif 26#endif
28 27
29/* map cpu index to physical APIC ID */ 28DEFINE_PER_CPU(int, cpu_number);
30DEFINE_EARLY_PER_CPU(u16, x86_cpu_to_apicid, BAD_APICID); 29EXPORT_PER_CPU_SYMBOL(cpu_number);
31DEFINE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid, BAD_APICID);
32EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_apicid);
33EXPORT_EARLY_PER_CPU_SYMBOL(x86_bios_cpu_apicid);
34
35#if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
36#define X86_64_NUMA 1
37 30
38/* map cpu index to node index */ 31#ifdef CONFIG_X86_64
39DEFINE_EARLY_PER_CPU(int, x86_cpu_to_node_map, NUMA_NO_NODE); 32#define BOOT_PERCPU_OFFSET ((unsigned long)__per_cpu_load)
40EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_node_map); 33#else
34#define BOOT_PERCPU_OFFSET 0
35#endif
41 36
42/* which logical CPUs are on which nodes */ 37DEFINE_PER_CPU(unsigned long, this_cpu_off) = BOOT_PERCPU_OFFSET;
43cpumask_t *node_to_cpumask_map; 38EXPORT_PER_CPU_SYMBOL(this_cpu_off);
44EXPORT_SYMBOL(node_to_cpumask_map);
45 39
46/* setup node_to_cpumask_map */ 40unsigned long __per_cpu_offset[NR_CPUS] __read_mostly = {
47static void __init setup_node_to_cpumask_map(void); 41 [0 ... NR_CPUS-1] = BOOT_PERCPU_OFFSET,
42};
43EXPORT_SYMBOL(__per_cpu_offset);
48 44
45/*
46 * On x86_64 symbols referenced from code should be reachable using
47 * 32bit relocations. Reserve space for static percpu variables in
48 * modules so that they are always served from the first chunk which
49 * is located at the percpu segment base. On x86_32, anything can
50 * address anywhere. No need to reserve space in the first chunk.
51 */
52#ifdef CONFIG_X86_64
53#define PERCPU_FIRST_CHUNK_RESERVE PERCPU_MODULE_RESERVE
49#else 54#else
50static inline void setup_node_to_cpumask_map(void) { } 55#define PERCPU_FIRST_CHUNK_RESERVE 0
51#endif 56#endif
52 57
53#if defined(CONFIG_HAVE_SETUP_PER_CPU_AREA) && defined(CONFIG_X86_SMP) 58/**
54/* 59 * pcpu_need_numa - determine percpu allocation needs to consider NUMA
55 * Copy data used in early init routines from the initial arrays to the 60 *
56 * per cpu data areas. These arrays then become expendable and the 61 * If NUMA is not configured or there is only one NUMA node available,
57 * *_early_ptr's are zeroed indicating that the static arrays are gone. 62 * there is no reason to consider NUMA. This function determines
63 * whether percpu allocation should consider NUMA or not.
64 *
65 * RETURNS:
66 * true if NUMA should be considered; otherwise, false.
58 */ 67 */
59static void __init setup_per_cpu_maps(void) 68static bool __init pcpu_need_numa(void)
60{ 69{
61 int cpu; 70#ifdef CONFIG_NEED_MULTIPLE_NODES
71 pg_data_t *last = NULL;
72 unsigned int cpu;
62 73
63 for_each_possible_cpu(cpu) { 74 for_each_possible_cpu(cpu) {
64 per_cpu(x86_cpu_to_apicid, cpu) = 75 int node = early_cpu_to_node(cpu);
65 early_per_cpu_map(x86_cpu_to_apicid, cpu);
66 per_cpu(x86_bios_cpu_apicid, cpu) =
67 early_per_cpu_map(x86_bios_cpu_apicid, cpu);
68#ifdef X86_64_NUMA
69 per_cpu(x86_cpu_to_node_map, cpu) =
70 early_per_cpu_map(x86_cpu_to_node_map, cpu);
71#endif
72 }
73 76
74 /* indicate the early static arrays will soon be gone */ 77 if (node_online(node) && NODE_DATA(node) &&
75 early_per_cpu_ptr(x86_cpu_to_apicid) = NULL; 78 last && last != NODE_DATA(node))
76 early_per_cpu_ptr(x86_bios_cpu_apicid) = NULL; 79 return true;
77#ifdef X86_64_NUMA 80
78 early_per_cpu_ptr(x86_cpu_to_node_map) = NULL; 81 last = NODE_DATA(node);
82 }
79#endif 83#endif
84 return false;
80} 85}
81 86
82#ifdef CONFIG_X86_32 87/**
83/* 88 * pcpu_alloc_bootmem - NUMA friendly alloc_bootmem wrapper for percpu
84 * Great future not-so-futuristic plan: make i386 and x86_64 do it 89 * @cpu: cpu to allocate for
85 * the same way 90 * @size: size allocation in bytes
86 */ 91 * @align: alignment
87unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; 92 *
88EXPORT_SYMBOL(__per_cpu_offset); 93 * Allocate @size bytes aligned at @align for cpu @cpu. This wrapper
89static inline void setup_cpu_pda_map(void) { } 94 * does the right thing for NUMA regardless of the current
90 95 * configuration.
91#elif !defined(CONFIG_SMP) 96 *
92static inline void setup_cpu_pda_map(void) { } 97 * RETURNS:
93 98 * Pointer to the allocated area on success, NULL on failure.
94#else /* CONFIG_SMP && CONFIG_X86_64 */
95
96/*
97 * Allocate cpu_pda pointer table and array via alloc_bootmem.
98 */ 99 */
99static void __init setup_cpu_pda_map(void) 100static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
101 unsigned long align)
100{ 102{
101 char *pda; 103 const unsigned long goal = __pa(MAX_DMA_ADDRESS);
102 struct x8664_pda **new_cpu_pda; 104#ifdef CONFIG_NEED_MULTIPLE_NODES
103 unsigned long size; 105 int node = early_cpu_to_node(cpu);
104 int cpu; 106 void *ptr;
105 107
106 size = roundup(sizeof(struct x8664_pda), cache_line_size()); 108 if (!node_online(node) || !NODE_DATA(node)) {
107 109 ptr = __alloc_bootmem_nopanic(size, align, goal);
108 /* allocate cpu_pda array and pointer table */ 110 pr_info("cpu %d has no node %d or node-local memory\n",
109 { 111 cpu, node);
110 unsigned long tsize = nr_cpu_ids * sizeof(void *); 112 pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n",
111 unsigned long asize = size * (nr_cpu_ids - 1); 113 cpu, size, __pa(ptr));
112 114 } else {
113 tsize = roundup(tsize, cache_line_size()); 115 ptr = __alloc_bootmem_node_nopanic(NODE_DATA(node),
114 new_cpu_pda = alloc_bootmem(tsize + asize); 116 size, align, goal);
115 pda = (char *)new_cpu_pda + tsize; 117 pr_debug("per cpu data for cpu%d %lu bytes on node%d at "
116 } 118 "%016lx\n", cpu, size, node, __pa(ptr));
117
118 /* initialize pointer table to static pda's */
119 for_each_possible_cpu(cpu) {
120 if (cpu == 0) {
121 /* leave boot cpu pda in place */
122 new_cpu_pda[0] = cpu_pda(0);
123 continue;
124 }
125 new_cpu_pda[cpu] = (struct x8664_pda *)pda;
126 new_cpu_pda[cpu]->in_bootmem = 1;
127 pda += size;
128 } 119 }
129 120 return ptr;
130 /* point to new pointer table */ 121#else
131 _cpu_pda = new_cpu_pda; 122 return __alloc_bootmem_nopanic(size, align, goal);
123#endif
132} 124}
133 125
134#endif /* CONFIG_SMP && CONFIG_X86_64 */ 126/*
135 127 * Remap allocator
136#ifdef CONFIG_X86_64 128 *
129 * This allocator uses PMD page as unit. A PMD page is allocated for
130 * each cpu and each is remapped into vmalloc area using PMD mapping.
131 * As PMD page is quite large, only part of it is used for the first
132 * chunk. Unused part is returned to the bootmem allocator.
133 *
134 * So, the PMD pages are mapped twice - once to the physical mapping
135 * and to the vmalloc area for the first percpu chunk. The double
136 * mapping does add one more PMD TLB entry pressure but still is much
137 * better than only using 4k mappings while still being NUMA friendly.
138 */
139#ifdef CONFIG_NEED_MULTIPLE_NODES
140static size_t pcpur_size __initdata;
141static void **pcpur_ptrs __initdata;
137 142
138/* correctly size the local cpu masks */ 143static struct page * __init pcpur_get_page(unsigned int cpu, int pageno)
139static void __init setup_cpu_local_masks(void)
140{ 144{
141 alloc_bootmem_cpumask_var(&cpu_initialized_mask); 145 size_t off = (size_t)pageno << PAGE_SHIFT;
142 alloc_bootmem_cpumask_var(&cpu_callin_mask);
143 alloc_bootmem_cpumask_var(&cpu_callout_mask);
144 alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask);
145}
146 146
147#else /* CONFIG_X86_32 */ 147 if (off >= pcpur_size)
148 return NULL;
148 149
149static inline void setup_cpu_local_masks(void) 150 return virt_to_page(pcpur_ptrs[cpu] + off);
150{
151} 151}
152 152
153#endif /* CONFIG_X86_32 */ 153static ssize_t __init setup_pcpu_remap(size_t static_size)
154
155/*
156 * Great future plan:
157 * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data.
158 * Always point %gs to its beginning
159 */
160void __init setup_per_cpu_areas(void)
161{ 154{
162 ssize_t size, old_size; 155 static struct vm_struct vm;
163 char *ptr; 156 pg_data_t *last;
164 int cpu; 157 size_t ptrs_size, dyn_size;
165 unsigned long align = 1; 158 unsigned int cpu;
166 159 ssize_t ret;
167 /* Setup cpu_pda map */ 160
168 setup_cpu_pda_map(); 161 /*
162 * If large page isn't supported, there's no benefit in doing
163 * this. Also, on non-NUMA, embedding is better.
164 */
165 if (!cpu_has_pse || pcpu_need_numa())
166 return -EINVAL;
167
168 last = NULL;
169 for_each_possible_cpu(cpu) {
170 int node = early_cpu_to_node(cpu);
169 171
170 /* Copy section for each CPU (we discard the original) */ 172 if (node_online(node) && NODE_DATA(node) &&
171 old_size = PERCPU_ENOUGH_ROOM; 173 last && last != NODE_DATA(node))
172 align = max_t(unsigned long, PAGE_SIZE, align); 174 goto proceed;
173 size = roundup(old_size, align);
174 175
175 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n", 176 last = NODE_DATA(node);
176 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids); 177 }
178 return -EINVAL;
179
180proceed:
181 /*
182 * Currently supports only single page. Supporting multiple
183 * pages won't be too difficult if it ever becomes necessary.
184 */
185 pcpur_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE +
186 PERCPU_DYNAMIC_RESERVE);
187 if (pcpur_size > PMD_SIZE) {
188 pr_warning("PERCPU: static data is larger than large page, "
189 "can't use large page\n");
190 return -EINVAL;
191 }
192 dyn_size = pcpur_size - static_size - PERCPU_FIRST_CHUNK_RESERVE;
177 193
178 pr_info("PERCPU: Allocating %zd bytes of per cpu data\n", size); 194 /* allocate pointer array and alloc large pages */
195 ptrs_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpur_ptrs[0]));
196 pcpur_ptrs = alloc_bootmem(ptrs_size);
179 197
180 for_each_possible_cpu(cpu) { 198 for_each_possible_cpu(cpu) {
181#ifndef CONFIG_NEED_MULTIPLE_NODES 199 pcpur_ptrs[cpu] = pcpu_alloc_bootmem(cpu, PMD_SIZE, PMD_SIZE);
182 ptr = __alloc_bootmem(size, align, 200 if (!pcpur_ptrs[cpu])
183 __pa(MAX_DMA_ADDRESS)); 201 goto enomem;
184#else 202
185 int node = early_cpu_to_node(cpu); 203 /*
186 if (!node_online(node) || !NODE_DATA(node)) { 204 * Only use pcpur_size bytes and give back the rest.
187 ptr = __alloc_bootmem(size, align, 205 *
188 __pa(MAX_DMA_ADDRESS)); 206 * Ingo: The 2MB up-rounding bootmem is needed to make
189 pr_info("cpu %d has no node %d or node-local memory\n", 207 * sure the partial 2MB page is still fully RAM - it's
190 cpu, node); 208 * not well-specified to have a PAT-incompatible area
191 pr_debug("per cpu data for cpu%d at %016lx\n", 209 * (unmapped RAM, device memory, etc.) in that hole.
192 cpu, __pa(ptr)); 210 */
193 } else { 211 free_bootmem(__pa(pcpur_ptrs[cpu] + pcpur_size),
194 ptr = __alloc_bootmem_node(NODE_DATA(node), size, align, 212 PMD_SIZE - pcpur_size);
195 __pa(MAX_DMA_ADDRESS)); 213
196 pr_debug("per cpu data for cpu%d on node%d at %016lx\n", 214 memcpy(pcpur_ptrs[cpu], __per_cpu_load, static_size);
197 cpu, node, __pa(ptr));
198 }
199#endif
200 per_cpu_offset(cpu) = ptr - __per_cpu_start;
201 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
202 } 215 }
203 216
204 /* Setup percpu data maps */ 217 /* allocate address and map */
205 setup_per_cpu_maps(); 218 vm.flags = VM_ALLOC;
206 219 vm.size = num_possible_cpus() * PMD_SIZE;
207 /* Setup node to cpumask map */ 220 vm_area_register_early(&vm, PMD_SIZE);
208 setup_node_to_cpumask_map();
209
210 /* Setup cpu initialized, callin, callout masks */
211 setup_cpu_local_masks();
212}
213
214#endif
215 221
216#ifdef X86_64_NUMA 222 for_each_possible_cpu(cpu) {
223 pmd_t *pmd;
217 224
218/* 225 pmd = populate_extra_pmd((unsigned long)vm.addr
219 * Allocate node_to_cpumask_map based on number of available nodes 226 + cpu * PMD_SIZE);
220 * Requires node_possible_map to be valid. 227 set_pmd(pmd, pfn_pmd(page_to_pfn(virt_to_page(pcpur_ptrs[cpu])),
221 * 228 PAGE_KERNEL_LARGE));
222 * Note: node_to_cpumask() is not valid until after this is done.
223 */
224static void __init setup_node_to_cpumask_map(void)
225{
226 unsigned int node, num = 0;
227 cpumask_t *map;
228
229 /* setup nr_node_ids if not done yet */
230 if (nr_node_ids == MAX_NUMNODES) {
231 for_each_node_mask(node, node_possible_map)
232 num = node;
233 nr_node_ids = num + 1;
234 } 229 }
235 230
236 /* allocate the map */ 231 /* we're ready, commit */
237 map = alloc_bootmem_low(nr_node_ids * sizeof(cpumask_t)); 232 pr_info("PERCPU: Remapped at %p with large pages, static data "
238 233 "%zu bytes\n", vm.addr, static_size);
239 pr_debug("Node to cpumask map at %p for %d nodes\n", 234
240 map, nr_node_ids); 235 ret = pcpu_setup_first_chunk(pcpur_get_page, static_size,
241 236 PERCPU_FIRST_CHUNK_RESERVE, dyn_size,
242 /* node_to_cpumask() will now work */ 237 PMD_SIZE, vm.addr, NULL);
243 node_to_cpumask_map = map; 238 goto out_free_ar;
239
240enomem:
241 for_each_possible_cpu(cpu)
242 if (pcpur_ptrs[cpu])
243 free_bootmem(__pa(pcpur_ptrs[cpu]), PMD_SIZE);
244 ret = -ENOMEM;
245out_free_ar:
246 free_bootmem(__pa(pcpur_ptrs), ptrs_size);
247 return ret;
244} 248}
245 249#else
246void __cpuinit numa_set_node(int cpu, int node) 250static ssize_t __init setup_pcpu_remap(size_t static_size)
247{ 251{
248 int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map); 252 return -EINVAL;
249
250 if (cpu_pda(cpu) && node != NUMA_NO_NODE)
251 cpu_pda(cpu)->nodenumber = node;
252
253 if (cpu_to_node_map)
254 cpu_to_node_map[cpu] = node;
255
256 else if (per_cpu_offset(cpu))
257 per_cpu(x86_cpu_to_node_map, cpu) = node;
258
259 else
260 pr_debug("Setting node for non-present cpu %d\n", cpu);
261} 253}
254#endif
262 255
263void __cpuinit numa_clear_node(int cpu) 256/*
257 * Embedding allocator
258 *
259 * The first chunk is sized to just contain the static area plus
260 * module and dynamic reserves and embedded into linear physical
261 * mapping so that it can use PMD mapping without additional TLB
262 * pressure.
263 */
264static ssize_t __init setup_pcpu_embed(size_t static_size)
264{ 265{
265 numa_set_node(cpu, NUMA_NO_NODE); 266 size_t reserve = PERCPU_MODULE_RESERVE + PERCPU_DYNAMIC_RESERVE;
267
268 /*
269 * If large page isn't supported, there's no benefit in doing
270 * this. Also, embedding allocation doesn't play well with
271 * NUMA.
272 */
273 if (!cpu_has_pse || pcpu_need_numa())
274 return -EINVAL;
275
276 return pcpu_embed_first_chunk(static_size, PERCPU_FIRST_CHUNK_RESERVE,
277 reserve - PERCPU_FIRST_CHUNK_RESERVE, -1);
266} 278}
267 279
268#ifndef CONFIG_DEBUG_PER_CPU_MAPS 280/*
281 * 4k page allocator
282 *
283 * This is the basic allocator. Static percpu area is allocated
284 * page-by-page and most of initialization is done by the generic
285 * setup function.
286 */
287static struct page **pcpu4k_pages __initdata;
288static int pcpu4k_nr_static_pages __initdata;
269 289
270void __cpuinit numa_add_cpu(int cpu) 290static struct page * __init pcpu4k_get_page(unsigned int cpu, int pageno)
271{ 291{
272 cpu_set(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]); 292 if (pageno < pcpu4k_nr_static_pages)
293 return pcpu4k_pages[cpu * pcpu4k_nr_static_pages + pageno];
294 return NULL;
273} 295}
274 296
275void __cpuinit numa_remove_cpu(int cpu) 297static void __init pcpu4k_populate_pte(unsigned long addr)
276{ 298{
277 cpu_clear(cpu, node_to_cpumask_map[cpu_to_node(cpu)]); 299 populate_extra_pte(addr);
278} 300}
279 301
280#else /* CONFIG_DEBUG_PER_CPU_MAPS */ 302static ssize_t __init setup_pcpu_4k(size_t static_size)
281
282/*
283 * --------- debug versions of the numa functions ---------
284 */
285static void __cpuinit numa_set_cpumask(int cpu, int enable)
286{ 303{
287 int node = cpu_to_node(cpu); 304 size_t pages_size;
288 cpumask_t *mask; 305 unsigned int cpu;
289 char buf[64]; 306 int i, j;
290 307 ssize_t ret;
291 if (node_to_cpumask_map == NULL) { 308
292 printk(KERN_ERR "node_to_cpumask_map NULL\n"); 309 pcpu4k_nr_static_pages = PFN_UP(static_size);
293 dump_stack(); 310
294 return; 311 /* unaligned allocations can't be freed, round up to page size */
295 } 312 pages_size = PFN_ALIGN(pcpu4k_nr_static_pages * num_possible_cpus()
296 313 * sizeof(pcpu4k_pages[0]));
297 mask = &node_to_cpumask_map[node]; 314 pcpu4k_pages = alloc_bootmem(pages_size);
298 if (enable) 315
299 cpu_set(cpu, *mask); 316 /* allocate and copy */
300 else 317 j = 0;
301 cpu_clear(cpu, *mask); 318 for_each_possible_cpu(cpu)
319 for (i = 0; i < pcpu4k_nr_static_pages; i++) {
320 void *ptr;
321
322 ptr = pcpu_alloc_bootmem(cpu, PAGE_SIZE, PAGE_SIZE);
323 if (!ptr)
324 goto enomem;
325
326 memcpy(ptr, __per_cpu_load + i * PAGE_SIZE, PAGE_SIZE);
327 pcpu4k_pages[j++] = virt_to_page(ptr);
328 }
302 329
303 cpulist_scnprintf(buf, sizeof(buf), mask); 330 /* we're ready, commit */
304 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n", 331 pr_info("PERCPU: Allocated %d 4k pages, static data %zu bytes\n",
305 enable ? "numa_add_cpu" : "numa_remove_cpu", cpu, node, buf); 332 pcpu4k_nr_static_pages, static_size);
333
334 ret = pcpu_setup_first_chunk(pcpu4k_get_page, static_size,
335 PERCPU_FIRST_CHUNK_RESERVE, -1,
336 -1, NULL, pcpu4k_populate_pte);
337 goto out_free_ar;
338
339enomem:
340 while (--j >= 0)
341 free_bootmem(__pa(page_address(pcpu4k_pages[j])), PAGE_SIZE);
342 ret = -ENOMEM;
343out_free_ar:
344 free_bootmem(__pa(pcpu4k_pages), pages_size);
345 return ret;
306} 346}
307 347
308void __cpuinit numa_add_cpu(int cpu) 348static inline void setup_percpu_segment(int cpu)
309{ 349{
310 numa_set_cpumask(cpu, 1); 350#ifdef CONFIG_X86_32
311} 351 struct desc_struct gdt;
312
313void __cpuinit numa_remove_cpu(int cpu)
314{
315 numa_set_cpumask(cpu, 0);
316}
317 352
318int cpu_to_node(int cpu) 353 pack_descriptor(&gdt, per_cpu_offset(cpu), 0xFFFFF,
319{ 354 0x2 | DESCTYPE_S, 0x8);
320 if (early_per_cpu_ptr(x86_cpu_to_node_map)) { 355 gdt.s = 1;
321 printk(KERN_WARNING 356 write_gdt_entry(get_cpu_gdt_table(cpu),
322 "cpu_to_node(%d): usage too early!\n", cpu); 357 GDT_ENTRY_PERCPU, &gdt, DESCTYPE_S);
323 dump_stack(); 358#endif
324 return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
325 }
326 return per_cpu(x86_cpu_to_node_map, cpu);
327} 359}
328EXPORT_SYMBOL(cpu_to_node);
329 360
330/* 361/*
331 * Same function as cpu_to_node() but used if called before the 362 * Great future plan:
332 * per_cpu areas are setup. 363 * Declare PDA itself and support (irqstack,tss,pgd) as per cpu data.
364 * Always point %gs to its beginning
333 */ 365 */
334int early_cpu_to_node(int cpu) 366void __init setup_per_cpu_areas(void)
335{ 367{
336 if (early_per_cpu_ptr(x86_cpu_to_node_map)) 368 size_t static_size = __per_cpu_end - __per_cpu_start;
337 return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu]; 369 unsigned int cpu;
338 370 unsigned long delta;
339 if (!per_cpu_offset(cpu)) { 371 size_t pcpu_unit_size;
340 printk(KERN_WARNING 372 ssize_t ret;
341 "early_cpu_to_node(%d): no per_cpu area!\n", cpu);
342 dump_stack();
343 return NUMA_NO_NODE;
344 }
345 return per_cpu(x86_cpu_to_node_map, cpu);
346}
347 373
374 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
375 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids);
348 376
349/* empty cpumask */ 377 /*
350static const cpumask_t cpu_mask_none; 378 * Allocate percpu area. If PSE is supported, try to make use
351 379 * of large page mappings. Please read comments on top of
352/* 380 * each allocator for details.
353 * Returns a pointer to the bitmask of CPUs on Node 'node'. 381 */
354 */ 382 ret = setup_pcpu_remap(static_size);
355const cpumask_t *cpumask_of_node(int node) 383 if (ret < 0)
356{ 384 ret = setup_pcpu_embed(static_size);
357 if (node_to_cpumask_map == NULL) { 385 if (ret < 0)
358 printk(KERN_WARNING 386 ret = setup_pcpu_4k(static_size);
359 "cpumask_of_node(%d): no node_to_cpumask_map!\n", 387 if (ret < 0)
360 node); 388 panic("cannot allocate static percpu area (%zu bytes, err=%zd)",
361 dump_stack(); 389 static_size, ret);
362 return (const cpumask_t *)&cpu_online_map; 390
363 } 391 pcpu_unit_size = ret;
364 if (node >= nr_node_ids) { 392
365 printk(KERN_WARNING 393 /* alrighty, percpu areas up and running */
366 "cpumask_of_node(%d): node > nr_node_ids(%d)\n", 394 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
367 node, nr_node_ids); 395 for_each_possible_cpu(cpu) {
368 dump_stack(); 396 per_cpu_offset(cpu) = delta + cpu * pcpu_unit_size;
369 return &cpu_mask_none; 397 per_cpu(this_cpu_off, cpu) = per_cpu_offset(cpu);
370 } 398 per_cpu(cpu_number, cpu) = cpu;
371 return &node_to_cpumask_map[node]; 399 setup_percpu_segment(cpu);
372} 400 setup_stack_canary_segment(cpu);
373EXPORT_SYMBOL(cpumask_of_node); 401 /*
374 402 * Copy data used in early init routines from the
375/* 403 * initial arrays to the per cpu data areas. These
376 * Returns a bitmask of CPUs on Node 'node'. 404 * arrays then become expendable and the *_early_ptr's
377 * 405 * are zeroed indicating that the static arrays are
378 * Side note: this function creates the returned cpumask on the stack 406 * gone.
379 * so with a high NR_CPUS count, excessive stack space is used. The 407 */
380 * node_to_cpumask_ptr function should be used whenever possible. 408#ifdef CONFIG_X86_LOCAL_APIC
381 */ 409 per_cpu(x86_cpu_to_apicid, cpu) =
382cpumask_t node_to_cpumask(int node) 410 early_per_cpu_map(x86_cpu_to_apicid, cpu);
383{ 411 per_cpu(x86_bios_cpu_apicid, cpu) =
384 if (node_to_cpumask_map == NULL) { 412 early_per_cpu_map(x86_bios_cpu_apicid, cpu);
385 printk(KERN_WARNING 413#endif
386 "node_to_cpumask(%d): no node_to_cpumask_map!\n", node); 414#ifdef CONFIG_X86_64
387 dump_stack(); 415 per_cpu(irq_stack_ptr, cpu) =
388 return cpu_online_map; 416 per_cpu(irq_stack_union.irq_stack, cpu) +
389 } 417 IRQ_STACK_SIZE - 64;
390 if (node >= nr_node_ids) { 418#ifdef CONFIG_NUMA
391 printk(KERN_WARNING 419 per_cpu(x86_cpu_to_node_map, cpu) =
392 "node_to_cpumask(%d): node > nr_node_ids(%d)\n", 420 early_per_cpu_map(x86_cpu_to_node_map, cpu);
393 node, nr_node_ids); 421#endif
394 dump_stack(); 422#endif
395 return cpu_mask_none; 423 /*
424 * Up to this point, the boot CPU has been using .data.init
425 * area. Reload any changed state for the boot CPU.
426 */
427 if (cpu == boot_cpu_id)
428 switch_to_new_gdt(cpu);
396 } 429 }
397 return node_to_cpumask_map[node];
398}
399EXPORT_SYMBOL(node_to_cpumask);
400 430
401/* 431 /* indicate the early static arrays will soon be gone */
402 * --------- end of debug versions of the numa functions --------- 432#ifdef CONFIG_X86_LOCAL_APIC
403 */ 433 early_per_cpu_ptr(x86_cpu_to_apicid) = NULL;
404 434 early_per_cpu_ptr(x86_bios_cpu_apicid) = NULL;
405#endif /* CONFIG_DEBUG_PER_CPU_MAPS */ 435#endif
436#if defined(CONFIG_X86_64) && defined(CONFIG_NUMA)
437 early_per_cpu_ptr(x86_cpu_to_node_map) = NULL;
438#endif
406 439
407#endif /* X86_64_NUMA */ 440 /* Setup node to cpumask map */
441 setup_node_to_cpumask_map();
408 442
443 /* Setup cpu initialized, callin, callout masks */
444 setup_cpu_local_masks();
445}
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index df0587f24c54..d2cc6428c587 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -50,27 +50,23 @@
50# define FIX_EFLAGS __FIX_EFLAGS 50# define FIX_EFLAGS __FIX_EFLAGS
51#endif 51#endif
52 52
53#define COPY(x) { \ 53#define COPY(x) do { \
54 err |= __get_user(regs->x, &sc->x); \ 54 get_user_ex(regs->x, &sc->x); \
55} 55} while (0)
56 56
57#define COPY_SEG(seg) { \ 57#define GET_SEG(seg) ({ \
58 unsigned short tmp; \ 58 unsigned short tmp; \
59 err |= __get_user(tmp, &sc->seg); \ 59 get_user_ex(tmp, &sc->seg); \
60 regs->seg = tmp; \ 60 tmp; \
61} 61})
62 62
63#define COPY_SEG_CPL3(seg) { \ 63#define COPY_SEG(seg) do { \
64 unsigned short tmp; \ 64 regs->seg = GET_SEG(seg); \
65 err |= __get_user(tmp, &sc->seg); \ 65} while (0)
66 regs->seg = tmp | 3; \
67}
68 66
69#define GET_SEG(seg) { \ 67#define COPY_SEG_CPL3(seg) do { \
70 unsigned short tmp; \ 68 regs->seg = GET_SEG(seg) | 3; \
71 err |= __get_user(tmp, &sc->seg); \ 69} while (0)
72 loadsegment(seg, tmp); \
73}
74 70
75static int 71static int
76restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, 72restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
@@ -83,45 +79,49 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
83 /* Always make any pending restarted system calls return -EINTR */ 79 /* Always make any pending restarted system calls return -EINTR */
84 current_thread_info()->restart_block.fn = do_no_restart_syscall; 80 current_thread_info()->restart_block.fn = do_no_restart_syscall;
85 81
82 get_user_try {
83
86#ifdef CONFIG_X86_32 84#ifdef CONFIG_X86_32
87 GET_SEG(gs); 85 set_user_gs(regs, GET_SEG(gs));
88 COPY_SEG(fs); 86 COPY_SEG(fs);
89 COPY_SEG(es); 87 COPY_SEG(es);
90 COPY_SEG(ds); 88 COPY_SEG(ds);
91#endif /* CONFIG_X86_32 */ 89#endif /* CONFIG_X86_32 */
92 90
93 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); 91 COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx);
94 COPY(dx); COPY(cx); COPY(ip); 92 COPY(dx); COPY(cx); COPY(ip);
95 93
96#ifdef CONFIG_X86_64 94#ifdef CONFIG_X86_64
97 COPY(r8); 95 COPY(r8);
98 COPY(r9); 96 COPY(r9);
99 COPY(r10); 97 COPY(r10);
100 COPY(r11); 98 COPY(r11);
101 COPY(r12); 99 COPY(r12);
102 COPY(r13); 100 COPY(r13);
103 COPY(r14); 101 COPY(r14);
104 COPY(r15); 102 COPY(r15);
105#endif /* CONFIG_X86_64 */ 103#endif /* CONFIG_X86_64 */
106 104
107#ifdef CONFIG_X86_32 105#ifdef CONFIG_X86_32
108 COPY_SEG_CPL3(cs); 106 COPY_SEG_CPL3(cs);
109 COPY_SEG_CPL3(ss); 107 COPY_SEG_CPL3(ss);
110#else /* !CONFIG_X86_32 */ 108#else /* !CONFIG_X86_32 */
111 /* Kernel saves and restores only the CS segment register on signals, 109 /* Kernel saves and restores only the CS segment register on signals,
112 * which is the bare minimum needed to allow mixed 32/64-bit code. 110 * which is the bare minimum needed to allow mixed 32/64-bit code.
113 * App's signal handler can save/restore other segments if needed. */ 111 * App's signal handler can save/restore other segments if needed. */
114 COPY_SEG_CPL3(cs); 112 COPY_SEG_CPL3(cs);
115#endif /* CONFIG_X86_32 */ 113#endif /* CONFIG_X86_32 */
116 114
117 err |= __get_user(tmpflags, &sc->flags); 115 get_user_ex(tmpflags, &sc->flags);
118 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); 116 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
119 regs->orig_ax = -1; /* disable syscall checks */ 117 regs->orig_ax = -1; /* disable syscall checks */
120 118
121 err |= __get_user(buf, &sc->fpstate); 119 get_user_ex(buf, &sc->fpstate);
122 err |= restore_i387_xstate(buf); 120 err |= restore_i387_xstate(buf);
121
122 get_user_ex(*pax, &sc->ax);
123 } get_user_catch(err);
123 124
124 err |= __get_user(*pax, &sc->ax);
125 return err; 125 return err;
126} 126}
127 127
@@ -131,57 +131,55 @@ setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate,
131{ 131{
132 int err = 0; 132 int err = 0;
133 133
134#ifdef CONFIG_X86_32 134 put_user_try {
135 {
136 unsigned int tmp;
137 135
138 savesegment(gs, tmp); 136#ifdef CONFIG_X86_32
139 err |= __put_user(tmp, (unsigned int __user *)&sc->gs); 137 put_user_ex(get_user_gs(regs), (unsigned int __user *)&sc->gs);
140 } 138 put_user_ex(regs->fs, (unsigned int __user *)&sc->fs);
141 err |= __put_user(regs->fs, (unsigned int __user *)&sc->fs); 139 put_user_ex(regs->es, (unsigned int __user *)&sc->es);
142 err |= __put_user(regs->es, (unsigned int __user *)&sc->es); 140 put_user_ex(regs->ds, (unsigned int __user *)&sc->ds);
143 err |= __put_user(regs->ds, (unsigned int __user *)&sc->ds);
144#endif /* CONFIG_X86_32 */ 141#endif /* CONFIG_X86_32 */
145 142
146 err |= __put_user(regs->di, &sc->di); 143 put_user_ex(regs->di, &sc->di);
147 err |= __put_user(regs->si, &sc->si); 144 put_user_ex(regs->si, &sc->si);
148 err |= __put_user(regs->bp, &sc->bp); 145 put_user_ex(regs->bp, &sc->bp);
149 err |= __put_user(regs->sp, &sc->sp); 146 put_user_ex(regs->sp, &sc->sp);
150 err |= __put_user(regs->bx, &sc->bx); 147 put_user_ex(regs->bx, &sc->bx);
151 err |= __put_user(regs->dx, &sc->dx); 148 put_user_ex(regs->dx, &sc->dx);
152 err |= __put_user(regs->cx, &sc->cx); 149 put_user_ex(regs->cx, &sc->cx);
153 err |= __put_user(regs->ax, &sc->ax); 150 put_user_ex(regs->ax, &sc->ax);
154#ifdef CONFIG_X86_64 151#ifdef CONFIG_X86_64
155 err |= __put_user(regs->r8, &sc->r8); 152 put_user_ex(regs->r8, &sc->r8);
156 err |= __put_user(regs->r9, &sc->r9); 153 put_user_ex(regs->r9, &sc->r9);
157 err |= __put_user(regs->r10, &sc->r10); 154 put_user_ex(regs->r10, &sc->r10);
158 err |= __put_user(regs->r11, &sc->r11); 155 put_user_ex(regs->r11, &sc->r11);
159 err |= __put_user(regs->r12, &sc->r12); 156 put_user_ex(regs->r12, &sc->r12);
160 err |= __put_user(regs->r13, &sc->r13); 157 put_user_ex(regs->r13, &sc->r13);
161 err |= __put_user(regs->r14, &sc->r14); 158 put_user_ex(regs->r14, &sc->r14);
162 err |= __put_user(regs->r15, &sc->r15); 159 put_user_ex(regs->r15, &sc->r15);
163#endif /* CONFIG_X86_64 */ 160#endif /* CONFIG_X86_64 */
164 161
165 err |= __put_user(current->thread.trap_no, &sc->trapno); 162 put_user_ex(current->thread.trap_no, &sc->trapno);
166 err |= __put_user(current->thread.error_code, &sc->err); 163 put_user_ex(current->thread.error_code, &sc->err);
167 err |= __put_user(regs->ip, &sc->ip); 164 put_user_ex(regs->ip, &sc->ip);
168#ifdef CONFIG_X86_32 165#ifdef CONFIG_X86_32
169 err |= __put_user(regs->cs, (unsigned int __user *)&sc->cs); 166 put_user_ex(regs->cs, (unsigned int __user *)&sc->cs);
170 err |= __put_user(regs->flags, &sc->flags); 167 put_user_ex(regs->flags, &sc->flags);
171 err |= __put_user(regs->sp, &sc->sp_at_signal); 168 put_user_ex(regs->sp, &sc->sp_at_signal);
172 err |= __put_user(regs->ss, (unsigned int __user *)&sc->ss); 169 put_user_ex(regs->ss, (unsigned int __user *)&sc->ss);
173#else /* !CONFIG_X86_32 */ 170#else /* !CONFIG_X86_32 */
174 err |= __put_user(regs->flags, &sc->flags); 171 put_user_ex(regs->flags, &sc->flags);
175 err |= __put_user(regs->cs, &sc->cs); 172 put_user_ex(regs->cs, &sc->cs);
176 err |= __put_user(0, &sc->gs); 173 put_user_ex(0, &sc->gs);
177 err |= __put_user(0, &sc->fs); 174 put_user_ex(0, &sc->fs);
178#endif /* CONFIG_X86_32 */ 175#endif /* CONFIG_X86_32 */
179 176
180 err |= __put_user(fpstate, &sc->fpstate); 177 put_user_ex(fpstate, &sc->fpstate);
181 178
182 /* non-iBCS2 extensions.. */ 179 /* non-iBCS2 extensions.. */
183 err |= __put_user(mask, &sc->oldmask); 180 put_user_ex(mask, &sc->oldmask);
184 err |= __put_user(current->thread.cr2, &sc->cr2); 181 put_user_ex(current->thread.cr2, &sc->cr2);
182 } put_user_catch(err);
185 183
186 return err; 184 return err;
187} 185}
@@ -189,40 +187,35 @@ setup_sigcontext(struct sigcontext __user *sc, void __user *fpstate,
189/* 187/*
190 * Set up a signal frame. 188 * Set up a signal frame.
191 */ 189 */
192#ifdef CONFIG_X86_32
193static const struct {
194 u16 poplmovl;
195 u32 val;
196 u16 int80;
197} __attribute__((packed)) retcode = {
198 0xb858, /* popl %eax; movl $..., %eax */
199 __NR_sigreturn,
200 0x80cd, /* int $0x80 */
201};
202
203static const struct {
204 u8 movl;
205 u32 val;
206 u16 int80;
207 u8 pad;
208} __attribute__((packed)) rt_retcode = {
209 0xb8, /* movl $..., %eax */
210 __NR_rt_sigreturn,
211 0x80cd, /* int $0x80 */
212 0
213};
214 190
215/* 191/*
216 * Determine which stack to use.. 192 * Determine which stack to use..
217 */ 193 */
194static unsigned long align_sigframe(unsigned long sp)
195{
196#ifdef CONFIG_X86_32
197 /*
198 * Align the stack pointer according to the i386 ABI,
199 * i.e. so that on function entry ((sp + 4) & 15) == 0.
200 */
201 sp = ((sp + 4) & -16ul) - 4;
202#else /* !CONFIG_X86_32 */
203 sp = round_down(sp, 16) - 8;
204#endif
205 return sp;
206}
207
218static inline void __user * 208static inline void __user *
219get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size, 209get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
220 void **fpstate) 210 void __user **fpstate)
221{ 211{
222 unsigned long sp;
223
224 /* Default to using normal stack */ 212 /* Default to using normal stack */
225 sp = regs->sp; 213 unsigned long sp = regs->sp;
214
215#ifdef CONFIG_X86_64
216 /* redzone */
217 sp -= 128;
218#endif /* CONFIG_X86_64 */
226 219
227 /* 220 /*
228 * If we are on the alternate signal stack and would overflow it, don't. 221 * If we are on the alternate signal stack and would overflow it, don't.
@@ -236,30 +229,52 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size,
236 if (sas_ss_flags(sp) == 0) 229 if (sas_ss_flags(sp) == 0)
237 sp = current->sas_ss_sp + current->sas_ss_size; 230 sp = current->sas_ss_sp + current->sas_ss_size;
238 } else { 231 } else {
232#ifdef CONFIG_X86_32
239 /* This is the legacy signal stack switching. */ 233 /* This is the legacy signal stack switching. */
240 if ((regs->ss & 0xffff) != __USER_DS && 234 if ((regs->ss & 0xffff) != __USER_DS &&
241 !(ka->sa.sa_flags & SA_RESTORER) && 235 !(ka->sa.sa_flags & SA_RESTORER) &&
242 ka->sa.sa_restorer) 236 ka->sa.sa_restorer)
243 sp = (unsigned long) ka->sa.sa_restorer; 237 sp = (unsigned long) ka->sa.sa_restorer;
238#endif /* CONFIG_X86_32 */
244 } 239 }
245 240
246 if (used_math()) { 241 if (used_math()) {
247 sp = sp - sig_xstate_size; 242 sp -= sig_xstate_size;
248 *fpstate = (struct _fpstate *) sp; 243#ifdef CONFIG_X86_64
244 sp = round_down(sp, 64);
245#endif /* CONFIG_X86_64 */
246 *fpstate = (void __user *)sp;
247
249 if (save_i387_xstate(*fpstate) < 0) 248 if (save_i387_xstate(*fpstate) < 0)
250 return (void __user *)-1L; 249 return (void __user *)-1L;
251 } 250 }
252 251
253 sp -= frame_size; 252 return (void __user *)align_sigframe(sp - frame_size);
254 /*
255 * Align the stack pointer according to the i386 ABI,
256 * i.e. so that on function entry ((sp + 4) & 15) == 0.
257 */
258 sp = ((sp + 4) & -16ul) - 4;
259
260 return (void __user *) sp;
261} 253}
262 254
255#ifdef CONFIG_X86_32
256static const struct {
257 u16 poplmovl;
258 u32 val;
259 u16 int80;
260} __attribute__((packed)) retcode = {
261 0xb858, /* popl %eax; movl $..., %eax */
262 __NR_sigreturn,
263 0x80cd, /* int $0x80 */
264};
265
266static const struct {
267 u8 movl;
268 u32 val;
269 u16 int80;
270 u8 pad;
271} __attribute__((packed)) rt_retcode = {
272 0xb8, /* movl $..., %eax */
273 __NR_rt_sigreturn,
274 0x80cd, /* int $0x80 */
275 0
276};
277
263static int 278static int
264__setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, 279__setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
265 struct pt_regs *regs) 280 struct pt_regs *regs)
@@ -336,43 +351,41 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
336 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 351 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
337 return -EFAULT; 352 return -EFAULT;
338 353
339 err |= __put_user(sig, &frame->sig); 354 put_user_try {
340 err |= __put_user(&frame->info, &frame->pinfo); 355 put_user_ex(sig, &frame->sig);
341 err |= __put_user(&frame->uc, &frame->puc); 356 put_user_ex(&frame->info, &frame->pinfo);
342 err |= copy_siginfo_to_user(&frame->info, info); 357 put_user_ex(&frame->uc, &frame->puc);
343 if (err) 358 err |= copy_siginfo_to_user(&frame->info, info);
344 return -EFAULT;
345 359
346 /* Create the ucontext. */ 360 /* Create the ucontext. */
347 if (cpu_has_xsave) 361 if (cpu_has_xsave)
348 err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags); 362 put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
349 else 363 else
350 err |= __put_user(0, &frame->uc.uc_flags); 364 put_user_ex(0, &frame->uc.uc_flags);
351 err |= __put_user(0, &frame->uc.uc_link); 365 put_user_ex(0, &frame->uc.uc_link);
352 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 366 put_user_ex(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
353 err |= __put_user(sas_ss_flags(regs->sp), 367 put_user_ex(sas_ss_flags(regs->sp),
354 &frame->uc.uc_stack.ss_flags); 368 &frame->uc.uc_stack.ss_flags);
355 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); 369 put_user_ex(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
356 err |= setup_sigcontext(&frame->uc.uc_mcontext, fpstate, 370 err |= setup_sigcontext(&frame->uc.uc_mcontext, fpstate,
357 regs, set->sig[0]); 371 regs, set->sig[0]);
358 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 372 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
359 if (err) 373
360 return -EFAULT; 374 /* Set up to return from userspace. */
361 375 restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn);
362 /* Set up to return from userspace. */ 376 if (ka->sa.sa_flags & SA_RESTORER)
363 restorer = VDSO32_SYMBOL(current->mm->context.vdso, rt_sigreturn); 377 restorer = ka->sa.sa_restorer;
364 if (ka->sa.sa_flags & SA_RESTORER) 378 put_user_ex(restorer, &frame->pretcode);
365 restorer = ka->sa.sa_restorer;
366 err |= __put_user(restorer, &frame->pretcode);
367 379
368 /* 380 /*
369 * This is movl $__NR_rt_sigreturn, %ax ; int $0x80 381 * This is movl $__NR_rt_sigreturn, %ax ; int $0x80
370 * 382 *
371 * WE DO NOT USE IT ANY MORE! It's only left here for historical 383 * WE DO NOT USE IT ANY MORE! It's only left here for historical
372 * reasons and because gdb uses it as a signature to notice 384 * reasons and because gdb uses it as a signature to notice
373 * signal handler stack frames. 385 * signal handler stack frames.
374 */ 386 */
375 err |= __put_user(*((u64 *)&rt_retcode), (u64 *)frame->retcode); 387 put_user_ex(*((u64 *)&rt_retcode), (u64 *)frame->retcode);
388 } put_user_catch(err);
376 389
377 if (err) 390 if (err)
378 return -EFAULT; 391 return -EFAULT;
@@ -392,24 +405,6 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
392 return 0; 405 return 0;
393} 406}
394#else /* !CONFIG_X86_32 */ 407#else /* !CONFIG_X86_32 */
395/*
396 * Determine which stack to use..
397 */
398static void __user *
399get_stack(struct k_sigaction *ka, unsigned long sp, unsigned long size)
400{
401 /* Default to using normal stack - redzone*/
402 sp -= 128;
403
404 /* This is the X/Open sanctioned signal stack switching. */
405 if (ka->sa.sa_flags & SA_ONSTACK) {
406 if (sas_ss_flags(sp) == 0)
407 sp = current->sas_ss_sp + current->sas_ss_size;
408 }
409
410 return (void __user *)round_down(sp - size, 64);
411}
412
413static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 408static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
414 sigset_t *set, struct pt_regs *regs) 409 sigset_t *set, struct pt_regs *regs)
415{ 410{
@@ -418,15 +413,7 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
418 int err = 0; 413 int err = 0;
419 struct task_struct *me = current; 414 struct task_struct *me = current;
420 415
421 if (used_math()) { 416 frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe), &fp);
422 fp = get_stack(ka, regs->sp, sig_xstate_size);
423 frame = (void __user *)round_down(
424 (unsigned long)fp - sizeof(struct rt_sigframe), 16) - 8;
425
426 if (save_i387_xstate(fp) < 0)
427 return -EFAULT;
428 } else
429 frame = get_stack(ka, regs->sp, sizeof(struct rt_sigframe)) - 8;
430 417
431 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 418 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
432 return -EFAULT; 419 return -EFAULT;
@@ -436,28 +423,30 @@ static int __setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
436 return -EFAULT; 423 return -EFAULT;
437 } 424 }
438 425
439 /* Create the ucontext. */ 426 put_user_try {
440 if (cpu_has_xsave) 427 /* Create the ucontext. */
441 err |= __put_user(UC_FP_XSTATE, &frame->uc.uc_flags); 428 if (cpu_has_xsave)
442 else 429 put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags);
443 err |= __put_user(0, &frame->uc.uc_flags); 430 else
444 err |= __put_user(0, &frame->uc.uc_link); 431 put_user_ex(0, &frame->uc.uc_flags);
445 err |= __put_user(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 432 put_user_ex(0, &frame->uc.uc_link);
446 err |= __put_user(sas_ss_flags(regs->sp), 433 put_user_ex(me->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
447 &frame->uc.uc_stack.ss_flags); 434 put_user_ex(sas_ss_flags(regs->sp),
448 err |= __put_user(me->sas_ss_size, &frame->uc.uc_stack.ss_size); 435 &frame->uc.uc_stack.ss_flags);
449 err |= setup_sigcontext(&frame->uc.uc_mcontext, fp, regs, set->sig[0]); 436 put_user_ex(me->sas_ss_size, &frame->uc.uc_stack.ss_size);
450 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 437 err |= setup_sigcontext(&frame->uc.uc_mcontext, fp, regs, set->sig[0]);
451 438 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
452 /* Set up to return from userspace. If provided, use a stub 439
453 already in userspace. */ 440 /* Set up to return from userspace. If provided, use a stub
454 /* x86-64 should always use SA_RESTORER. */ 441 already in userspace. */
455 if (ka->sa.sa_flags & SA_RESTORER) { 442 /* x86-64 should always use SA_RESTORER. */
456 err |= __put_user(ka->sa.sa_restorer, &frame->pretcode); 443 if (ka->sa.sa_flags & SA_RESTORER) {
457 } else { 444 put_user_ex(ka->sa.sa_restorer, &frame->pretcode);
458 /* could use a vstub here */ 445 } else {
459 return -EFAULT; 446 /* could use a vstub here */
460 } 447 err |= -EFAULT;
448 }
449 } put_user_catch(err);
461 450
462 if (err) 451 if (err)
463 return -EFAULT; 452 return -EFAULT;
@@ -509,31 +498,41 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
509 struct old_sigaction __user *oact) 498 struct old_sigaction __user *oact)
510{ 499{
511 struct k_sigaction new_ka, old_ka; 500 struct k_sigaction new_ka, old_ka;
512 int ret; 501 int ret = 0;
513 502
514 if (act) { 503 if (act) {
515 old_sigset_t mask; 504 old_sigset_t mask;
516 505
517 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 506 if (!access_ok(VERIFY_READ, act, sizeof(*act)))
518 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
519 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
520 return -EFAULT; 507 return -EFAULT;
521 508
522 __get_user(new_ka.sa.sa_flags, &act->sa_flags); 509 get_user_try {
523 __get_user(mask, &act->sa_mask); 510 get_user_ex(new_ka.sa.sa_handler, &act->sa_handler);
511 get_user_ex(new_ka.sa.sa_flags, &act->sa_flags);
512 get_user_ex(mask, &act->sa_mask);
513 get_user_ex(new_ka.sa.sa_restorer, &act->sa_restorer);
514 } get_user_catch(ret);
515
516 if (ret)
517 return -EFAULT;
524 siginitset(&new_ka.sa.sa_mask, mask); 518 siginitset(&new_ka.sa.sa_mask, mask);
525 } 519 }
526 520
527 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 521 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
528 522
529 if (!ret && oact) { 523 if (!ret && oact) {
530 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 524 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)))
531 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
532 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
533 return -EFAULT; 525 return -EFAULT;
534 526
535 __put_user(old_ka.sa.sa_flags, &oact->sa_flags); 527 put_user_try {
536 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); 528 put_user_ex(old_ka.sa.sa_handler, &oact->sa_handler);
529 put_user_ex(old_ka.sa.sa_flags, &oact->sa_flags);
530 put_user_ex(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
531 put_user_ex(old_ka.sa.sa_restorer, &oact->sa_restorer);
532 } put_user_catch(ret);
533
534 if (ret)
535 return -EFAULT;
537 } 536 }
538 537
539 return ret; 538 return ret;
@@ -541,14 +540,9 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
541#endif /* CONFIG_X86_32 */ 540#endif /* CONFIG_X86_32 */
542 541
543#ifdef CONFIG_X86_32 542#ifdef CONFIG_X86_32
544asmlinkage int sys_sigaltstack(unsigned long bx) 543int sys_sigaltstack(struct pt_regs *regs)
545{ 544{
546 /* 545 const stack_t __user *uss = (const stack_t __user *)regs->bx;
547 * This is needed to make gcc realize it doesn't own the
548 * "struct pt_regs"
549 */
550 struct pt_regs *regs = (struct pt_regs *)&bx;
551 const stack_t __user *uss = (const stack_t __user *)bx;
552 stack_t __user *uoss = (stack_t __user *)regs->cx; 546 stack_t __user *uoss = (stack_t __user *)regs->cx;
553 547
554 return do_sigaltstack(uss, uoss, regs->sp); 548 return do_sigaltstack(uss, uoss, regs->sp);
@@ -566,14 +560,12 @@ sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
566 * Do a signal return; undo the signal stack. 560 * Do a signal return; undo the signal stack.
567 */ 561 */
568#ifdef CONFIG_X86_32 562#ifdef CONFIG_X86_32
569asmlinkage unsigned long sys_sigreturn(unsigned long __unused) 563unsigned long sys_sigreturn(struct pt_regs *regs)
570{ 564{
571 struct sigframe __user *frame; 565 struct sigframe __user *frame;
572 struct pt_regs *regs;
573 unsigned long ax; 566 unsigned long ax;
574 sigset_t set; 567 sigset_t set;
575 568
576 regs = (struct pt_regs *) &__unused;
577 frame = (struct sigframe __user *)(regs->sp - 8); 569 frame = (struct sigframe __user *)(regs->sp - 8);
578 570
579 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 571 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
@@ -600,7 +592,7 @@ badframe:
600} 592}
601#endif /* CONFIG_X86_32 */ 593#endif /* CONFIG_X86_32 */
602 594
603static long do_rt_sigreturn(struct pt_regs *regs) 595long sys_rt_sigreturn(struct pt_regs *regs)
604{ 596{
605 struct rt_sigframe __user *frame; 597 struct rt_sigframe __user *frame;
606 unsigned long ax; 598 unsigned long ax;
@@ -631,25 +623,6 @@ badframe:
631 return 0; 623 return 0;
632} 624}
633 625
634#ifdef CONFIG_X86_32
635/*
636 * Note: do not pass in pt_regs directly as with tail-call optimization
637 * GCC will incorrectly stomp on the caller's frame and corrupt user-space
638 * register state:
639 */
640asmlinkage int sys_rt_sigreturn(unsigned long __unused)
641{
642 struct pt_regs *regs = (struct pt_regs *)&__unused;
643
644 return do_rt_sigreturn(regs);
645}
646#else /* !CONFIG_X86_32 */
647asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
648{
649 return do_rt_sigreturn(regs);
650}
651#endif /* CONFIG_X86_32 */
652
653/* 626/*
654 * OK, we're invoking a handler: 627 * OK, we're invoking a handler:
655 */ 628 */
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index e6faa3316bd2..13f33ea8ccaa 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -2,7 +2,7 @@
2 * Intel SMP support routines. 2 * Intel SMP support routines.
3 * 3 *
4 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk> 4 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
5 * (c) 1998-99, 2000 Ingo Molnar <mingo@redhat.com> 5 * (c) 1998-99, 2000, 2009 Ingo Molnar <mingo@redhat.com>
6 * (c) 2002,2003 Andi Kleen, SuSE Labs. 6 * (c) 2002,2003 Andi Kleen, SuSE Labs.
7 * 7 *
8 * i386 and x86_64 integration by Glauber Costa <gcosta@redhat.com> 8 * i386 and x86_64 integration by Glauber Costa <gcosta@redhat.com>
@@ -26,8 +26,7 @@
26#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
27#include <asm/mmu_context.h> 27#include <asm/mmu_context.h>
28#include <asm/proto.h> 28#include <asm/proto.h>
29#include <mach_ipi.h> 29#include <asm/apic.h>
30#include <mach_apic.h>
31/* 30/*
32 * Some notes on x86 processor bugs affecting SMP operation: 31 * Some notes on x86 processor bugs affecting SMP operation:
33 * 32 *
@@ -118,12 +117,12 @@ static void native_smp_send_reschedule(int cpu)
118 WARN_ON(1); 117 WARN_ON(1);
119 return; 118 return;
120 } 119 }
121 send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR); 120 apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
122} 121}
123 122
124void native_send_call_func_single_ipi(int cpu) 123void native_send_call_func_single_ipi(int cpu)
125{ 124{
126 send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR); 125 apic->send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
127} 126}
128 127
129void native_send_call_func_ipi(const struct cpumask *mask) 128void native_send_call_func_ipi(const struct cpumask *mask)
@@ -131,7 +130,7 @@ void native_send_call_func_ipi(const struct cpumask *mask)
131 cpumask_var_t allbutself; 130 cpumask_var_t allbutself;
132 131
133 if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) { 132 if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) {
134 send_IPI_mask(mask, CALL_FUNCTION_VECTOR); 133 apic->send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
135 return; 134 return;
136 } 135 }
137 136
@@ -140,9 +139,9 @@ void native_send_call_func_ipi(const struct cpumask *mask)
140 139
141 if (cpumask_equal(mask, allbutself) && 140 if (cpumask_equal(mask, allbutself) &&
142 cpumask_equal(cpu_online_mask, cpu_callout_mask)) 141 cpumask_equal(cpu_online_mask, cpu_callout_mask))
143 send_IPI_allbutself(CALL_FUNCTION_VECTOR); 142 apic->send_IPI_allbutself(CALL_FUNCTION_VECTOR);
144 else 143 else
145 send_IPI_mask(mask, CALL_FUNCTION_VECTOR); 144 apic->send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
146 145
147 free_cpumask_var(allbutself); 146 free_cpumask_var(allbutself);
148} 147}
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index bb1a3b1fc87f..249334f5080a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -2,7 +2,7 @@
2 * x86 SMP booting functions 2 * x86 SMP booting functions
3 * 3 *
4 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk> 4 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
5 * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com> 5 * (c) 1998, 1999, 2000, 2009 Ingo Molnar <mingo@redhat.com>
6 * Copyright 2001 Andi Kleen, SuSE Labs. 6 * Copyright 2001 Andi Kleen, SuSE Labs.
7 * 7 *
8 * Much of the core SMP work is based on previous work by Thomas Radke, to 8 * Much of the core SMP work is based on previous work by Thomas Radke, to
@@ -53,7 +53,6 @@
53#include <asm/nmi.h> 53#include <asm/nmi.h>
54#include <asm/irq.h> 54#include <asm/irq.h>
55#include <asm/idle.h> 55#include <asm/idle.h>
56#include <asm/smp.h>
57#include <asm/trampoline.h> 56#include <asm/trampoline.h>
58#include <asm/cpu.h> 57#include <asm/cpu.h>
59#include <asm/numa.h> 58#include <asm/numa.h>
@@ -61,13 +60,12 @@
61#include <asm/tlbflush.h> 60#include <asm/tlbflush.h>
62#include <asm/mtrr.h> 61#include <asm/mtrr.h>
63#include <asm/vmi.h> 62#include <asm/vmi.h>
64#include <asm/genapic.h> 63#include <asm/apic.h>
65#include <asm/setup.h> 64#include <asm/setup.h>
65#include <asm/uv/uv.h>
66#include <linux/mc146818rtc.h> 66#include <linux/mc146818rtc.h>
67 67
68#include <mach_apic.h> 68#include <asm/smpboot_hooks.h>
69#include <mach_wakecpu.h>
70#include <smpboot_hooks.h>
71 69
72#ifdef CONFIG_X86_32 70#ifdef CONFIG_X86_32
73u8 apicid_2_node[MAX_APICID]; 71u8 apicid_2_node[MAX_APICID];
@@ -114,7 +112,7 @@ EXPORT_PER_CPU_SYMBOL(cpu_core_map);
114DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); 112DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
115EXPORT_PER_CPU_SYMBOL(cpu_info); 113EXPORT_PER_CPU_SYMBOL(cpu_info);
116 114
117static atomic_t init_deasserted; 115atomic_t init_deasserted;
118 116
119 117
120/* Set if we find a B stepping CPU */ 118/* Set if we find a B stepping CPU */
@@ -163,7 +161,7 @@ static void map_cpu_to_logical_apicid(void)
163{ 161{
164 int cpu = smp_processor_id(); 162 int cpu = smp_processor_id();
165 int apicid = logical_smp_processor_id(); 163 int apicid = logical_smp_processor_id();
166 int node = apicid_to_node(apicid); 164 int node = apic->apicid_to_node(apicid);
167 165
168 if (!node_online(node)) 166 if (!node_online(node))
169 node = first_online_node; 167 node = first_online_node;
@@ -196,7 +194,8 @@ static void __cpuinit smp_callin(void)
196 * our local APIC. We have to wait for the IPI or we'll 194 * our local APIC. We have to wait for the IPI or we'll
197 * lock up on an APIC access. 195 * lock up on an APIC access.
198 */ 196 */
199 wait_for_init_deassert(&init_deasserted); 197 if (apic->wait_for_init_deassert)
198 apic->wait_for_init_deassert(&init_deasserted);
200 199
201 /* 200 /*
202 * (This works even if the APIC is not enabled.) 201 * (This works even if the APIC is not enabled.)
@@ -243,7 +242,8 @@ static void __cpuinit smp_callin(void)
243 */ 242 */
244 243
245 pr_debug("CALLIN, before setup_local_APIC().\n"); 244 pr_debug("CALLIN, before setup_local_APIC().\n");
246 smp_callin_clear_local_apic(); 245 if (apic->smp_callin_clear_local_apic)
246 apic->smp_callin_clear_local_apic();
247 setup_local_APIC(); 247 setup_local_APIC();
248 end_local_APIC_setup(); 248 end_local_APIC_setup();
249 map_cpu_to_logical_apicid(); 249 map_cpu_to_logical_apicid();
@@ -583,7 +583,7 @@ wakeup_secondary_cpu_via_nmi(int logical_apicid, unsigned long start_eip)
583 /* Target chip */ 583 /* Target chip */
584 /* Boot on the stack */ 584 /* Boot on the stack */
585 /* Kick the second */ 585 /* Kick the second */
586 apic_icr_write(APIC_DM_NMI | APIC_DEST_LOGICAL, logical_apicid); 586 apic_icr_write(APIC_DM_NMI | apic->dest_logical, logical_apicid);
587 587
588 pr_debug("Waiting for send to finish...\n"); 588 pr_debug("Waiting for send to finish...\n");
589 send_status = safe_apic_wait_icr_idle(); 589 send_status = safe_apic_wait_icr_idle();
@@ -614,12 +614,6 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
614 unsigned long send_status, accept_status = 0; 614 unsigned long send_status, accept_status = 0;
615 int maxlvt, num_starts, j; 615 int maxlvt, num_starts, j;
616 616
617 if (get_uv_system_type() == UV_NON_UNIQUE_APIC) {
618 send_status = uv_wakeup_secondary(phys_apicid, start_eip);
619 atomic_set(&init_deasserted, 1);
620 return send_status;
621 }
622
623 maxlvt = lapic_get_maxlvt(); 617 maxlvt = lapic_get_maxlvt();
624 618
625 /* 619 /*
@@ -745,78 +739,23 @@ static void __cpuinit do_fork_idle(struct work_struct *work)
745 complete(&c_idle->done); 739 complete(&c_idle->done);
746} 740}
747 741
748#ifdef CONFIG_X86_64
749
750/* __ref because it's safe to call free_bootmem when after_bootmem == 0. */
751static void __ref free_bootmem_pda(struct x8664_pda *oldpda)
752{
753 if (!after_bootmem)
754 free_bootmem((unsigned long)oldpda, sizeof(*oldpda));
755}
756
757/*
758 * Allocate node local memory for the AP pda.
759 *
760 * Must be called after the _cpu_pda pointer table is initialized.
761 */
762int __cpuinit get_local_pda(int cpu)
763{
764 struct x8664_pda *oldpda, *newpda;
765 unsigned long size = sizeof(struct x8664_pda);
766 int node = cpu_to_node(cpu);
767
768 if (cpu_pda(cpu) && !cpu_pda(cpu)->in_bootmem)
769 return 0;
770
771 oldpda = cpu_pda(cpu);
772 newpda = kmalloc_node(size, GFP_ATOMIC, node);
773 if (!newpda) {
774 printk(KERN_ERR "Could not allocate node local PDA "
775 "for CPU %d on node %d\n", cpu, node);
776
777 if (oldpda)
778 return 0; /* have a usable pda */
779 else
780 return -1;
781 }
782
783 if (oldpda) {
784 memcpy(newpda, oldpda, size);
785 free_bootmem_pda(oldpda);
786 }
787
788 newpda->in_bootmem = 0;
789 cpu_pda(cpu) = newpda;
790 return 0;
791}
792#endif /* CONFIG_X86_64 */
793
794static int __cpuinit do_boot_cpu(int apicid, int cpu)
795/* 742/*
796 * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad 743 * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
797 * (ie clustered apic addressing mode), this is a LOGICAL apic ID. 744 * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
798 * Returns zero if CPU booted OK, else error code from wakeup_secondary_cpu. 745 * Returns zero if CPU booted OK, else error code from
746 * ->wakeup_secondary_cpu.
799 */ 747 */
748static int __cpuinit do_boot_cpu(int apicid, int cpu)
800{ 749{
801 unsigned long boot_error = 0; 750 unsigned long boot_error = 0;
802 int timeout;
803 unsigned long start_ip; 751 unsigned long start_ip;
804 unsigned short nmi_high = 0, nmi_low = 0; 752 int timeout;
805 struct create_idle c_idle = { 753 struct create_idle c_idle = {
806 .cpu = cpu, 754 .cpu = cpu,
807 .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done), 755 .done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done),
808 }; 756 };
809 INIT_WORK(&c_idle.work, do_fork_idle);
810 757
811#ifdef CONFIG_X86_64 758 INIT_WORK(&c_idle.work, do_fork_idle);
812 /* Allocate node local memory for AP pdas */
813 if (cpu > 0) {
814 boot_error = get_local_pda(cpu);
815 if (boot_error)
816 goto restore_state;
817 /* if can't get pda memory, can't start cpu */
818 }
819#endif
820 759
821 alternatives_smp_switch(1); 760 alternatives_smp_switch(1);
822 761
@@ -847,14 +786,16 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
847 786
848 set_idle_for_cpu(cpu, c_idle.idle); 787 set_idle_for_cpu(cpu, c_idle.idle);
849do_rest: 788do_rest:
850#ifdef CONFIG_X86_32
851 per_cpu(current_task, cpu) = c_idle.idle; 789 per_cpu(current_task, cpu) = c_idle.idle;
852 init_gdt(cpu); 790#ifdef CONFIG_X86_32
853 /* Stack for startup_32 can be just as for start_secondary onwards */ 791 /* Stack for startup_32 can be just as for start_secondary onwards */
854 irq_ctx_init(cpu); 792 irq_ctx_init(cpu);
855#else 793#else
856 cpu_pda(cpu)->pcurrent = c_idle.idle;
857 clear_tsk_thread_flag(c_idle.idle, TIF_FORK); 794 clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
795 initial_gs = per_cpu_offset(cpu);
796 per_cpu(kernel_stack, cpu) =
797 (unsigned long)task_stack_page(c_idle.idle) -
798 KERNEL_STACK_OFFSET + THREAD_SIZE;
858#endif 799#endif
859 early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); 800 early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
860 initial_code = (unsigned long)start_secondary; 801 initial_code = (unsigned long)start_secondary;
@@ -878,8 +819,6 @@ do_rest:
878 819
879 pr_debug("Setting warm reset code and vector.\n"); 820 pr_debug("Setting warm reset code and vector.\n");
880 821
881 store_NMI_vector(&nmi_high, &nmi_low);
882
883 smpboot_setup_warm_reset_vector(start_ip); 822 smpboot_setup_warm_reset_vector(start_ip);
884 /* 823 /*
885 * Be paranoid about clearing APIC errors. 824 * Be paranoid about clearing APIC errors.
@@ -891,9 +830,13 @@ do_rest:
891 } 830 }
892 831
893 /* 832 /*
894 * Starting actual IPI sequence... 833 * Kick the secondary CPU. Use the method in the APIC driver
834 * if it's defined - or use an INIT boot APIC message otherwise:
895 */ 835 */
896 boot_error = wakeup_secondary_cpu(apicid, start_ip); 836 if (apic->wakeup_secondary_cpu)
837 boot_error = apic->wakeup_secondary_cpu(apicid, start_ip);
838 else
839 boot_error = wakeup_secondary_cpu_via_init(apicid, start_ip);
897 840
898 if (!boot_error) { 841 if (!boot_error) {
899 /* 842 /*
@@ -927,13 +870,11 @@ do_rest:
927 else 870 else
928 /* trampoline code not run */ 871 /* trampoline code not run */
929 printk(KERN_ERR "Not responding.\n"); 872 printk(KERN_ERR "Not responding.\n");
930 if (get_uv_system_type() != UV_NON_UNIQUE_APIC) 873 if (apic->inquire_remote_apic)
931 inquire_remote_apic(apicid); 874 apic->inquire_remote_apic(apicid);
932 } 875 }
933 } 876 }
934#ifdef CONFIG_X86_64 877
935restore_state:
936#endif
937 if (boot_error) { 878 if (boot_error) {
938 /* Try to put things back the way they were before ... */ 879 /* Try to put things back the way they were before ... */
939 numa_remove_cpu(cpu); /* was set by numa_add_cpu */ 880 numa_remove_cpu(cpu); /* was set by numa_add_cpu */
@@ -961,7 +902,7 @@ restore_state:
961 902
962int __cpuinit native_cpu_up(unsigned int cpu) 903int __cpuinit native_cpu_up(unsigned int cpu)
963{ 904{
964 int apicid = cpu_present_to_apicid(cpu); 905 int apicid = apic->cpu_present_to_apicid(cpu);
965 unsigned long flags; 906 unsigned long flags;
966 int err; 907 int err;
967 908
@@ -1054,14 +995,14 @@ static int __init smp_sanity_check(unsigned max_cpus)
1054{ 995{
1055 preempt_disable(); 996 preempt_disable();
1056 997
1057#if defined(CONFIG_X86_PC) && defined(CONFIG_X86_32) 998#if !defined(CONFIG_X86_BIGSMP) && defined(CONFIG_X86_32)
1058 if (def_to_bigsmp && nr_cpu_ids > 8) { 999 if (def_to_bigsmp && nr_cpu_ids > 8) {
1059 unsigned int cpu; 1000 unsigned int cpu;
1060 unsigned nr; 1001 unsigned nr;
1061 1002
1062 printk(KERN_WARNING 1003 printk(KERN_WARNING
1063 "More than 8 CPUs detected - skipping them.\n" 1004 "More than 8 CPUs detected - skipping them.\n"
1064 "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n"); 1005 "Use CONFIG_X86_BIGSMP.\n");
1065 1006
1066 nr = 0; 1007 nr = 0;
1067 for_each_present_cpu(cpu) { 1008 for_each_present_cpu(cpu) {
@@ -1107,7 +1048,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
1107 * Should not be necessary because the MP table should list the boot 1048 * Should not be necessary because the MP table should list the boot
1108 * CPU too, but we do it for the sake of robustness anyway. 1049 * CPU too, but we do it for the sake of robustness anyway.
1109 */ 1050 */
1110 if (!check_phys_apicid_present(boot_cpu_physical_apicid)) { 1051 if (!apic->check_phys_apicid_present(boot_cpu_physical_apicid)) {
1111 printk(KERN_NOTICE 1052 printk(KERN_NOTICE
1112 "weird, boot CPU (#%d) not listed by the BIOS.\n", 1053 "weird, boot CPU (#%d) not listed by the BIOS.\n",
1113 boot_cpu_physical_apicid); 1054 boot_cpu_physical_apicid);
@@ -1125,6 +1066,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
1125 printk(KERN_ERR "... forcing use of dummy APIC emulation." 1066 printk(KERN_ERR "... forcing use of dummy APIC emulation."
1126 "(tell your hw vendor)\n"); 1067 "(tell your hw vendor)\n");
1127 smpboot_clear_io_apic(); 1068 smpboot_clear_io_apic();
1069 arch_disable_smp_support();
1128 return -1; 1070 return -1;
1129 } 1071 }
1130 1072
@@ -1181,9 +1123,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1181 current_thread_info()->cpu = 0; /* needed? */ 1123 current_thread_info()->cpu = 0; /* needed? */
1182 set_cpu_sibling_map(0); 1124 set_cpu_sibling_map(0);
1183 1125
1184#ifdef CONFIG_X86_64
1185 enable_IR_x2apic(); 1126 enable_IR_x2apic();
1186 setup_apic_routing(); 1127#ifdef CONFIG_X86_64
1128 default_setup_apic_routing();
1187#endif 1129#endif
1188 1130
1189 if (smp_sanity_check(max_cpus) < 0) { 1131 if (smp_sanity_check(max_cpus) < 0) {
@@ -1207,18 +1149,18 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1207 */ 1149 */
1208 setup_local_APIC(); 1150 setup_local_APIC();
1209 1151
1210#ifdef CONFIG_X86_64
1211 /* 1152 /*
1212 * Enable IO APIC before setting up error vector 1153 * Enable IO APIC before setting up error vector
1213 */ 1154 */
1214 if (!skip_ioapic_setup && nr_ioapics) 1155 if (!skip_ioapic_setup && nr_ioapics)
1215 enable_IO_APIC(); 1156 enable_IO_APIC();
1216#endif 1157
1217 end_local_APIC_setup(); 1158 end_local_APIC_setup();
1218 1159
1219 map_cpu_to_logical_apicid(); 1160 map_cpu_to_logical_apicid();
1220 1161
1221 setup_portio_remap(); 1162 if (apic->setup_portio_remap)
1163 apic->setup_portio_remap();
1222 1164
1223 smpboot_setup_io_apic(); 1165 smpboot_setup_io_apic();
1224 /* 1166 /*
@@ -1240,10 +1182,7 @@ out:
1240void __init native_smp_prepare_boot_cpu(void) 1182void __init native_smp_prepare_boot_cpu(void)
1241{ 1183{
1242 int me = smp_processor_id(); 1184 int me = smp_processor_id();
1243#ifdef CONFIG_X86_32 1185 switch_to_new_gdt(me);
1244 init_gdt(me);
1245#endif
1246 switch_to_new_gdt();
1247 /* already set me in cpu_online_mask in boot_cpu_init() */ 1186 /* already set me in cpu_online_mask in boot_cpu_init() */
1248 cpumask_set_cpu(me, cpu_callout_mask); 1187 cpumask_set_cpu(me, cpu_callout_mask);
1249 per_cpu(cpu_state, me) = CPU_ONLINE; 1188 per_cpu(cpu_state, me) = CPU_ONLINE;
diff --git a/arch/x86/kernel/smpcommon.c b/arch/x86/kernel/smpcommon.c
deleted file mode 100644
index 397e309839dd..000000000000
--- a/arch/x86/kernel/smpcommon.c
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * SMP stuff which is common to all sub-architectures.
3 */
4#include <linux/module.h>
5#include <asm/smp.h>
6
7#ifdef CONFIG_X86_32
8DEFINE_PER_CPU(unsigned long, this_cpu_off);
9EXPORT_PER_CPU_SYMBOL(this_cpu_off);
10
11/*
12 * Initialize the CPU's GDT. This is either the boot CPU doing itself
13 * (still using the master per-cpu area), or a CPU doing it for a
14 * secondary which will soon come up.
15 */
16__cpuinit void init_gdt(int cpu)
17{
18 struct desc_struct gdt;
19
20 pack_descriptor(&gdt, __per_cpu_offset[cpu], 0xFFFFF,
21 0x2 | DESCTYPE_S, 0x8);
22 gdt.s = 1;
23
24 write_gdt_entry(get_cpu_gdt_table(cpu),
25 GDT_ENTRY_PERCPU, &gdt, DESCTYPE_S);
26
27 per_cpu(this_cpu_off, cpu) = __per_cpu_offset[cpu];
28 per_cpu(cpu_number, cpu) = cpu;
29}
30#endif
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
index 10786af95545..f7bddc2e37d1 100644
--- a/arch/x86/kernel/stacktrace.c
+++ b/arch/x86/kernel/stacktrace.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Stack trace management functions 2 * Stack trace management functions
3 * 3 *
4 * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com> 4 * Copyright (C) 2006-2009 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
5 */ 5 */
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/stacktrace.h> 7#include <linux/stacktrace.h>
diff --git a/arch/x86/kernel/summit_32.c b/arch/x86/kernel/summit_32.c
deleted file mode 100644
index 7b987852e876..000000000000
--- a/arch/x86/kernel/summit_32.c
+++ /dev/null
@@ -1,188 +0,0 @@
1/*
2 * IBM Summit-Specific Code
3 *
4 * Written By: Matthew Dobson, IBM Corporation
5 *
6 * Copyright (c) 2003 IBM Corp.
7 *
8 * 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 (at
13 * 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, GOOD TITLE or
18 * NON INFRINGEMENT. See the GNU General Public License for more
19 * details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * Send feedback to <colpatch@us.ibm.com>
26 *
27 */
28
29#include <linux/mm.h>
30#include <linux/init.h>
31#include <asm/io.h>
32#include <asm/bios_ebda.h>
33#include <asm/summit/mpparse.h>
34
35static struct rio_table_hdr *rio_table_hdr __initdata;
36static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata;
37static struct rio_detail *rio_devs[MAX_NUMNODES*4] __initdata;
38
39#ifndef CONFIG_X86_NUMAQ
40static int mp_bus_id_to_node[MAX_MP_BUSSES] __initdata;
41#endif
42
43static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
44{
45 int twister = 0, node = 0;
46 int i, bus, num_buses;
47
48 for (i = 0; i < rio_table_hdr->num_rio_dev; i++) {
49 if (rio_devs[i]->node_id == rio_devs[wpeg_num]->owner_id) {
50 twister = rio_devs[i]->owner_id;
51 break;
52 }
53 }
54 if (i == rio_table_hdr->num_rio_dev) {
55 printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __func__);
56 return last_bus;
57 }
58
59 for (i = 0; i < rio_table_hdr->num_scal_dev; i++) {
60 if (scal_devs[i]->node_id == twister) {
61 node = scal_devs[i]->node_id;
62 break;
63 }
64 }
65 if (i == rio_table_hdr->num_scal_dev) {
66 printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __func__);
67 return last_bus;
68 }
69
70 switch (rio_devs[wpeg_num]->type) {
71 case CompatWPEG:
72 /*
73 * The Compatibility Winnipeg controls the 2 legacy buses,
74 * the 66MHz PCI bus [2 slots] and the 2 "extra" buses in case
75 * a PCI-PCI bridge card is used in either slot: total 5 buses.
76 */
77 num_buses = 5;
78 break;
79 case AltWPEG:
80 /*
81 * The Alternate Winnipeg controls the 2 133MHz buses [1 slot
82 * each], their 2 "extra" buses, the 100MHz bus [2 slots] and
83 * the "extra" buses for each of those slots: total 7 buses.
84 */
85 num_buses = 7;
86 break;
87 case LookOutAWPEG:
88 case LookOutBWPEG:
89 /*
90 * A Lookout Winnipeg controls 3 100MHz buses [2 slots each]
91 * & the "extra" buses for each of those slots: total 9 buses.
92 */
93 num_buses = 9;
94 break;
95 default:
96 printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __func__);
97 return last_bus;
98 }
99
100 for (bus = last_bus; bus < last_bus + num_buses; bus++)
101 mp_bus_id_to_node[bus] = node;
102 return bus;
103}
104
105static int __init build_detail_arrays(void)
106{
107 unsigned long ptr;
108 int i, scal_detail_size, rio_detail_size;
109
110 if (rio_table_hdr->num_scal_dev > MAX_NUMNODES) {
111 printk(KERN_WARNING "%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n", __func__, MAX_NUMNODES, rio_table_hdr->num_scal_dev);
112 return 0;
113 }
114
115 switch (rio_table_hdr->version) {
116 default:
117 printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __func__, rio_table_hdr->version);
118 return 0;
119 case 2:
120 scal_detail_size = 11;
121 rio_detail_size = 13;
122 break;
123 case 3:
124 scal_detail_size = 12;
125 rio_detail_size = 15;
126 break;
127 }
128
129 ptr = (unsigned long)rio_table_hdr + 3;
130 for (i = 0; i < rio_table_hdr->num_scal_dev; i++, ptr += scal_detail_size)
131 scal_devs[i] = (struct scal_detail *)ptr;
132
133 for (i = 0; i < rio_table_hdr->num_rio_dev; i++, ptr += rio_detail_size)
134 rio_devs[i] = (struct rio_detail *)ptr;
135
136 return 1;
137}
138
139void __init setup_summit(void)
140{
141 unsigned long ptr;
142 unsigned short offset;
143 int i, next_wpeg, next_bus = 0;
144
145 /* The pointer to the EBDA is stored in the word @ phys 0x40E(40:0E) */
146 ptr = get_bios_ebda();
147 ptr = (unsigned long)phys_to_virt(ptr);
148
149 rio_table_hdr = NULL;
150 offset = 0x180;
151 while (offset) {
152 /* The block id is stored in the 2nd word */
153 if (*((unsigned short *)(ptr + offset + 2)) == 0x4752) {
154 /* set the pointer past the offset & block id */
155 rio_table_hdr = (struct rio_table_hdr *)(ptr + offset + 4);
156 break;
157 }
158 /* The next offset is stored in the 1st word. 0 means no more */
159 offset = *((unsigned short *)(ptr + offset));
160 }
161 if (!rio_table_hdr) {
162 printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __func__);
163 return;
164 }
165
166 if (!build_detail_arrays())
167 return;
168
169 /* The first Winnipeg we're looking for has an index of 0 */
170 next_wpeg = 0;
171 do {
172 for (i = 0; i < rio_table_hdr->num_rio_dev; i++) {
173 if (is_WPEG(rio_devs[i]) && rio_devs[i]->WP_index == next_wpeg) {
174 /* It's the Winnipeg we're looking for! */
175 next_bus = setup_pci_node_map_for_wpeg(i, next_bus);
176 next_wpeg++;
177 break;
178 }
179 }
180 /*
181 * If we go through all Rio devices and don't find one with
182 * the next index, it means we've found all the Winnipegs,
183 * and thus all the PCI buses.
184 */
185 if (i == rio_table_hdr->num_rio_dev)
186 next_wpeg = 0;
187 } while (next_wpeg != 0);
188}
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S
index e2e86a08f31d..3bdb64829b82 100644
--- a/arch/x86/kernel/syscall_table_32.S
+++ b/arch/x86/kernel/syscall_table_32.S
@@ -1,7 +1,7 @@
1ENTRY(sys_call_table) 1ENTRY(sys_call_table)
2 .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */ 2 .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
3 .long sys_exit 3 .long sys_exit
4 .long sys_fork 4 .long ptregs_fork
5 .long sys_read 5 .long sys_read
6 .long sys_write 6 .long sys_write
7 .long sys_open /* 5 */ 7 .long sys_open /* 5 */
@@ -10,7 +10,7 @@ ENTRY(sys_call_table)
10 .long sys_creat 10 .long sys_creat
11 .long sys_link 11 .long sys_link
12 .long sys_unlink /* 10 */ 12 .long sys_unlink /* 10 */
13 .long sys_execve 13 .long ptregs_execve
14 .long sys_chdir 14 .long sys_chdir
15 .long sys_time 15 .long sys_time
16 .long sys_mknod 16 .long sys_mknod
@@ -109,17 +109,17 @@ ENTRY(sys_call_table)
109 .long sys_newlstat 109 .long sys_newlstat
110 .long sys_newfstat 110 .long sys_newfstat
111 .long sys_uname 111 .long sys_uname
112 .long sys_iopl /* 110 */ 112 .long ptregs_iopl /* 110 */
113 .long sys_vhangup 113 .long sys_vhangup
114 .long sys_ni_syscall /* old "idle" system call */ 114 .long sys_ni_syscall /* old "idle" system call */
115 .long sys_vm86old 115 .long ptregs_vm86old
116 .long sys_wait4 116 .long sys_wait4
117 .long sys_swapoff /* 115 */ 117 .long sys_swapoff /* 115 */
118 .long sys_sysinfo 118 .long sys_sysinfo
119 .long sys_ipc 119 .long sys_ipc
120 .long sys_fsync 120 .long sys_fsync
121 .long sys_sigreturn 121 .long ptregs_sigreturn
122 .long sys_clone /* 120 */ 122 .long ptregs_clone /* 120 */
123 .long sys_setdomainname 123 .long sys_setdomainname
124 .long sys_newuname 124 .long sys_newuname
125 .long sys_modify_ldt 125 .long sys_modify_ldt
@@ -165,14 +165,14 @@ ENTRY(sys_call_table)
165 .long sys_mremap 165 .long sys_mremap
166 .long sys_setresuid16 166 .long sys_setresuid16
167 .long sys_getresuid16 /* 165 */ 167 .long sys_getresuid16 /* 165 */
168 .long sys_vm86 168 .long ptregs_vm86
169 .long sys_ni_syscall /* Old sys_query_module */ 169 .long sys_ni_syscall /* Old sys_query_module */
170 .long sys_poll 170 .long sys_poll
171 .long sys_nfsservctl 171 .long sys_nfsservctl
172 .long sys_setresgid16 /* 170 */ 172 .long sys_setresgid16 /* 170 */
173 .long sys_getresgid16 173 .long sys_getresgid16
174 .long sys_prctl 174 .long sys_prctl
175 .long sys_rt_sigreturn 175 .long ptregs_rt_sigreturn
176 .long sys_rt_sigaction 176 .long sys_rt_sigaction
177 .long sys_rt_sigprocmask /* 175 */ 177 .long sys_rt_sigprocmask /* 175 */
178 .long sys_rt_sigpending 178 .long sys_rt_sigpending
@@ -185,11 +185,11 @@ ENTRY(sys_call_table)
185 .long sys_getcwd 185 .long sys_getcwd
186 .long sys_capget 186 .long sys_capget
187 .long sys_capset /* 185 */ 187 .long sys_capset /* 185 */
188 .long sys_sigaltstack 188 .long ptregs_sigaltstack
189 .long sys_sendfile 189 .long sys_sendfile
190 .long sys_ni_syscall /* reserved for streams1 */ 190 .long sys_ni_syscall /* reserved for streams1 */
191 .long sys_ni_syscall /* reserved for streams2 */ 191 .long sys_ni_syscall /* reserved for streams2 */
192 .long sys_vfork /* 190 */ 192 .long ptregs_vfork /* 190 */
193 .long sys_getrlimit 193 .long sys_getrlimit
194 .long sys_mmap2 194 .long sys_mmap2
195 .long sys_truncate64 195 .long sys_truncate64
diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c
index 3985cac0ed47..5c5d87f0b2e1 100644
--- a/arch/x86/kernel/time_32.c
+++ b/arch/x86/kernel/time_32.c
@@ -33,12 +33,12 @@
33#include <linux/time.h> 33#include <linux/time.h>
34#include <linux/mca.h> 34#include <linux/mca.h>
35 35
36#include <asm/arch_hooks.h> 36#include <asm/setup.h>
37#include <asm/hpet.h> 37#include <asm/hpet.h>
38#include <asm/time.h> 38#include <asm/time.h>
39#include <asm/timer.h> 39#include <asm/timer.h>
40 40
41#include "do_timer.h" 41#include <asm/do_timer.h>
42 42
43int timer_ack; 43int timer_ack;
44 44
@@ -118,7 +118,7 @@ void __init hpet_time_init(void)
118{ 118{
119 if (!hpet_enable()) 119 if (!hpet_enable())
120 setup_pit_timer(); 120 setup_pit_timer();
121 time_init_hook(); 121 x86_quirk_time_init();
122} 122}
123 123
124/* 124/*
@@ -131,7 +131,7 @@ void __init hpet_time_init(void)
131 */ 131 */
132void __init time_init(void) 132void __init time_init(void)
133{ 133{
134 pre_time_init_hook(); 134 x86_quirk_pre_time_init();
135 tsc_init(); 135 tsc_init();
136 late_time_init = choose_time_init(); 136 late_time_init = choose_time_init();
137} 137}
diff --git a/arch/x86/kernel/tlb_32.c b/arch/x86/kernel/tlb_32.c
deleted file mode 100644
index ce5054642247..000000000000
--- a/arch/x86/kernel/tlb_32.c
+++ /dev/null
@@ -1,256 +0,0 @@
1#include <linux/spinlock.h>
2#include <linux/cpu.h>
3#include <linux/interrupt.h>
4
5#include <asm/tlbflush.h>
6
7DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate)
8 ____cacheline_aligned = { &init_mm, 0, };
9
10/* must come after the send_IPI functions above for inlining */
11#include <mach_ipi.h>
12
13/*
14 * Smarter SMP flushing macros.
15 * c/o Linus Torvalds.
16 *
17 * These mean you can really definitely utterly forget about
18 * writing to user space from interrupts. (Its not allowed anyway).
19 *
20 * Optimizations Manfred Spraul <manfred@colorfullife.com>
21 */
22
23static cpumask_t flush_cpumask;
24static struct mm_struct *flush_mm;
25static unsigned long flush_va;
26static DEFINE_SPINLOCK(tlbstate_lock);
27
28/*
29 * We cannot call mmdrop() because we are in interrupt context,
30 * instead update mm->cpu_vm_mask.
31 *
32 * We need to reload %cr3 since the page tables may be going
33 * away from under us..
34 */
35void leave_mm(int cpu)
36{
37 BUG_ON(x86_read_percpu(cpu_tlbstate.state) == TLBSTATE_OK);
38 cpu_clear(cpu, x86_read_percpu(cpu_tlbstate.active_mm)->cpu_vm_mask);
39 load_cr3(swapper_pg_dir);
40}
41EXPORT_SYMBOL_GPL(leave_mm);
42
43/*
44 *
45 * The flush IPI assumes that a thread switch happens in this order:
46 * [cpu0: the cpu that switches]
47 * 1) switch_mm() either 1a) or 1b)
48 * 1a) thread switch to a different mm
49 * 1a1) cpu_clear(cpu, old_mm->cpu_vm_mask);
50 * Stop ipi delivery for the old mm. This is not synchronized with
51 * the other cpus, but smp_invalidate_interrupt ignore flush ipis
52 * for the wrong mm, and in the worst case we perform a superfluous
53 * tlb flush.
54 * 1a2) set cpu_tlbstate to TLBSTATE_OK
55 * Now the smp_invalidate_interrupt won't call leave_mm if cpu0
56 * was in lazy tlb mode.
57 * 1a3) update cpu_tlbstate[].active_mm
58 * Now cpu0 accepts tlb flushes for the new mm.
59 * 1a4) cpu_set(cpu, new_mm->cpu_vm_mask);
60 * Now the other cpus will send tlb flush ipis.
61 * 1a4) change cr3.
62 * 1b) thread switch without mm change
63 * cpu_tlbstate[].active_mm is correct, cpu0 already handles
64 * flush ipis.
65 * 1b1) set cpu_tlbstate to TLBSTATE_OK
66 * 1b2) test_and_set the cpu bit in cpu_vm_mask.
67 * Atomically set the bit [other cpus will start sending flush ipis],
68 * and test the bit.
69 * 1b3) if the bit was 0: leave_mm was called, flush the tlb.
70 * 2) switch %%esp, ie current
71 *
72 * The interrupt must handle 2 special cases:
73 * - cr3 is changed before %%esp, ie. it cannot use current->{active_,}mm.
74 * - the cpu performs speculative tlb reads, i.e. even if the cpu only
75 * runs in kernel space, the cpu could load tlb entries for user space
76 * pages.
77 *
78 * The good news is that cpu_tlbstate is local to each cpu, no
79 * write/read ordering problems.
80 */
81
82/*
83 * TLB flush IPI:
84 *
85 * 1) Flush the tlb entries if the cpu uses the mm that's being flushed.
86 * 2) Leave the mm if we are in the lazy tlb mode.
87 */
88
89void smp_invalidate_interrupt(struct pt_regs *regs)
90{
91 unsigned long cpu;
92
93 cpu = get_cpu();
94
95 if (!cpu_isset(cpu, flush_cpumask))
96 goto out;
97 /*
98 * This was a BUG() but until someone can quote me the
99 * line from the intel manual that guarantees an IPI to
100 * multiple CPUs is retried _only_ on the erroring CPUs
101 * its staying as a return
102 *
103 * BUG();
104 */
105
106 if (flush_mm == x86_read_percpu(cpu_tlbstate.active_mm)) {
107 if (x86_read_percpu(cpu_tlbstate.state) == TLBSTATE_OK) {
108 if (flush_va == TLB_FLUSH_ALL)
109 local_flush_tlb();
110 else
111 __flush_tlb_one(flush_va);
112 } else
113 leave_mm(cpu);
114 }
115 ack_APIC_irq();
116 smp_mb__before_clear_bit();
117 cpu_clear(cpu, flush_cpumask);
118 smp_mb__after_clear_bit();
119out:
120 put_cpu_no_resched();
121 inc_irq_stat(irq_tlb_count);
122}
123
124void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
125 unsigned long va)
126{
127 cpumask_t cpumask = *cpumaskp;
128
129 /*
130 * A couple of (to be removed) sanity checks:
131 *
132 * - current CPU must not be in mask
133 * - mask must exist :)
134 */
135 BUG_ON(cpus_empty(cpumask));
136 BUG_ON(cpu_isset(smp_processor_id(), cpumask));
137 BUG_ON(!mm);
138
139#ifdef CONFIG_HOTPLUG_CPU
140 /* If a CPU which we ran on has gone down, OK. */
141 cpus_and(cpumask, cpumask, cpu_online_map);
142 if (unlikely(cpus_empty(cpumask)))
143 return;
144#endif
145
146 /*
147 * i'm not happy about this global shared spinlock in the
148 * MM hot path, but we'll see how contended it is.
149 * AK: x86-64 has a faster method that could be ported.
150 */
151 spin_lock(&tlbstate_lock);
152
153 flush_mm = mm;
154 flush_va = va;
155 cpus_or(flush_cpumask, cpumask, flush_cpumask);
156
157 /*
158 * Make the above memory operations globally visible before
159 * sending the IPI.
160 */
161 smp_mb();
162 /*
163 * We have to send the IPI only to
164 * CPUs affected.
165 */
166 send_IPI_mask(&cpumask, INVALIDATE_TLB_VECTOR);
167
168 while (!cpus_empty(flush_cpumask))
169 /* nothing. lockup detection does not belong here */
170 cpu_relax();
171
172 flush_mm = NULL;
173 flush_va = 0;
174 spin_unlock(&tlbstate_lock);
175}
176
177void flush_tlb_current_task(void)
178{
179 struct mm_struct *mm = current->mm;
180 cpumask_t cpu_mask;
181
182 preempt_disable();
183 cpu_mask = mm->cpu_vm_mask;
184 cpu_clear(smp_processor_id(), cpu_mask);
185
186 local_flush_tlb();
187 if (!cpus_empty(cpu_mask))
188 flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL);
189 preempt_enable();
190}
191
192void flush_tlb_mm(struct mm_struct *mm)
193{
194 cpumask_t cpu_mask;
195
196 preempt_disable();
197 cpu_mask = mm->cpu_vm_mask;
198 cpu_clear(smp_processor_id(), cpu_mask);
199
200 if (current->active_mm == mm) {
201 if (current->mm)
202 local_flush_tlb();
203 else
204 leave_mm(smp_processor_id());
205 }
206 if (!cpus_empty(cpu_mask))
207 flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL);
208
209 preempt_enable();
210}
211
212void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
213{
214 struct mm_struct *mm = vma->vm_mm;
215 cpumask_t cpu_mask;
216
217 preempt_disable();
218 cpu_mask = mm->cpu_vm_mask;
219 cpu_clear(smp_processor_id(), cpu_mask);
220
221 if (current->active_mm == mm) {
222 if (current->mm)
223 __flush_tlb_one(va);
224 else
225 leave_mm(smp_processor_id());
226 }
227
228 if (!cpus_empty(cpu_mask))
229 flush_tlb_others(cpu_mask, mm, va);
230
231 preempt_enable();
232}
233EXPORT_SYMBOL(flush_tlb_page);
234
235static void do_flush_tlb_all(void *info)
236{
237 unsigned long cpu = smp_processor_id();
238
239 __flush_tlb_all();
240 if (x86_read_percpu(cpu_tlbstate.state) == TLBSTATE_LAZY)
241 leave_mm(cpu);
242}
243
244void flush_tlb_all(void)
245{
246 on_each_cpu(do_flush_tlb_all, NULL, 1);
247}
248
249void reset_lazy_tlbstate(void)
250{
251 int cpu = raw_smp_processor_id();
252
253 per_cpu(cpu_tlbstate, cpu).state = 0;
254 per_cpu(cpu_tlbstate, cpu).active_mm = &init_mm;
255}
256
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 6812b829ed83..d038b9c45cf8 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -11,16 +11,15 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12 12
13#include <asm/mmu_context.h> 13#include <asm/mmu_context.h>
14#include <asm/uv/uv.h>
14#include <asm/uv/uv_mmrs.h> 15#include <asm/uv/uv_mmrs.h>
15#include <asm/uv/uv_hub.h> 16#include <asm/uv/uv_hub.h>
16#include <asm/uv/uv_bau.h> 17#include <asm/uv/uv_bau.h>
17#include <asm/genapic.h> 18#include <asm/apic.h>
18#include <asm/idle.h> 19#include <asm/idle.h>
19#include <asm/tsc.h> 20#include <asm/tsc.h>
20#include <asm/irq_vectors.h> 21#include <asm/irq_vectors.h>
21 22
22#include <mach_apic.h>
23
24static struct bau_control **uv_bau_table_bases __read_mostly; 23static struct bau_control **uv_bau_table_bases __read_mostly;
25static int uv_bau_retry_limit __read_mostly; 24static int uv_bau_retry_limit __read_mostly;
26 25
@@ -210,14 +209,15 @@ static int uv_wait_completion(struct bau_desc *bau_desc,
210 * 209 *
211 * Send a broadcast and wait for a broadcast message to complete. 210 * Send a broadcast and wait for a broadcast message to complete.
212 * 211 *
213 * The cpumaskp mask contains the cpus the broadcast was sent to. 212 * The flush_mask contains the cpus the broadcast was sent to.
214 * 213 *
215 * Returns 1 if all remote flushing was done. The mask is zeroed. 214 * Returns NULL if all remote flushing was done. The mask is zeroed.
216 * Returns 0 if some remote flushing remains to be done. The mask is left 215 * Returns @flush_mask if some remote flushing remains to be done. The
217 * unchanged. 216 * mask will have some bits still set.
218 */ 217 */
219int uv_flush_send_and_wait(int cpu, int this_blade, struct bau_desc *bau_desc, 218const struct cpumask *uv_flush_send_and_wait(int cpu, int this_blade,
220 cpumask_t *cpumaskp) 219 struct bau_desc *bau_desc,
220 struct cpumask *flush_mask)
221{ 221{
222 int completion_status = 0; 222 int completion_status = 0;
223 int right_shift; 223 int right_shift;
@@ -257,66 +257,74 @@ int uv_flush_send_and_wait(int cpu, int this_blade, struct bau_desc *bau_desc,
257 * the cpu's, all of which are still in the mask. 257 * the cpu's, all of which are still in the mask.
258 */ 258 */
259 __get_cpu_var(ptcstats).ptc_i++; 259 __get_cpu_var(ptcstats).ptc_i++;
260 return 0; 260 return flush_mask;
261 } 261 }
262 262
263 /* 263 /*
264 * Success, so clear the remote cpu's from the mask so we don't 264 * Success, so clear the remote cpu's from the mask so we don't
265 * use the IPI method of shootdown on them. 265 * use the IPI method of shootdown on them.
266 */ 266 */
267 for_each_cpu_mask(bit, *cpumaskp) { 267 for_each_cpu(bit, flush_mask) {
268 blade = uv_cpu_to_blade_id(bit); 268 blade = uv_cpu_to_blade_id(bit);
269 if (blade == this_blade) 269 if (blade == this_blade)
270 continue; 270 continue;
271 cpu_clear(bit, *cpumaskp); 271 cpumask_clear_cpu(bit, flush_mask);
272 } 272 }
273 if (!cpus_empty(*cpumaskp)) 273 if (!cpumask_empty(flush_mask))
274 return 0; 274 return flush_mask;
275 return 1; 275 return NULL;
276} 276}
277 277
278/** 278/**
279 * uv_flush_tlb_others - globally purge translation cache of a virtual 279 * uv_flush_tlb_others - globally purge translation cache of a virtual
280 * address or all TLB's 280 * address or all TLB's
281 * @cpumaskp: mask of all cpu's in which the address is to be removed 281 * @cpumask: mask of all cpu's in which the address is to be removed
282 * @mm: mm_struct containing virtual address range 282 * @mm: mm_struct containing virtual address range
283 * @va: virtual address to be removed (or TLB_FLUSH_ALL for all TLB's on cpu) 283 * @va: virtual address to be removed (or TLB_FLUSH_ALL for all TLB's on cpu)
284 * @cpu: the current cpu
284 * 285 *
285 * This is the entry point for initiating any UV global TLB shootdown. 286 * This is the entry point for initiating any UV global TLB shootdown.
286 * 287 *
287 * Purges the translation caches of all specified processors of the given 288 * Purges the translation caches of all specified processors of the given
288 * virtual address, or purges all TLB's on specified processors. 289 * virtual address, or purges all TLB's on specified processors.
289 * 290 *
290 * The caller has derived the cpumaskp from the mm_struct and has subtracted 291 * The caller has derived the cpumask from the mm_struct. This function
291 * the local cpu from the mask. This function is called only if there 292 * is called only if there are bits set in the mask. (e.g. flush_tlb_page())
292 * are bits set in the mask. (e.g. flush_tlb_page())
293 * 293 *
294 * The cpumaskp is converted into a nodemask of the nodes containing 294 * The cpumask is converted into a nodemask of the nodes containing
295 * the cpus. 295 * the cpus.
296 * 296 *
297 * Returns 1 if all remote flushing was done. 297 * Note that this function should be called with preemption disabled.
298 * Returns 0 if some remote flushing remains to be done. 298 *
299 * Returns NULL if all remote flushing was done.
300 * Returns pointer to cpumask if some remote flushing remains to be
301 * done. The returned pointer is valid till preemption is re-enabled.
299 */ 302 */
300int uv_flush_tlb_others(cpumask_t *cpumaskp, struct mm_struct *mm, 303const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
301 unsigned long va) 304 struct mm_struct *mm,
305 unsigned long va, unsigned int cpu)
302{ 306{
307 static DEFINE_PER_CPU(cpumask_t, flush_tlb_mask);
308 struct cpumask *flush_mask = &__get_cpu_var(flush_tlb_mask);
303 int i; 309 int i;
304 int bit; 310 int bit;
305 int blade; 311 int blade;
306 int cpu; 312 int uv_cpu;
307 int this_blade; 313 int this_blade;
308 int locals = 0; 314 int locals = 0;
309 struct bau_desc *bau_desc; 315 struct bau_desc *bau_desc;
310 316
311 cpu = uv_blade_processor_id(); 317 cpumask_andnot(flush_mask, cpumask, cpumask_of(cpu));
318
319 uv_cpu = uv_blade_processor_id();
312 this_blade = uv_numa_blade_id(); 320 this_blade = uv_numa_blade_id();
313 bau_desc = __get_cpu_var(bau_control).descriptor_base; 321 bau_desc = __get_cpu_var(bau_control).descriptor_base;
314 bau_desc += UV_ITEMS_PER_DESCRIPTOR * cpu; 322 bau_desc += UV_ITEMS_PER_DESCRIPTOR * uv_cpu;
315 323
316 bau_nodes_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE); 324 bau_nodes_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE);
317 325
318 i = 0; 326 i = 0;
319 for_each_cpu_mask(bit, *cpumaskp) { 327 for_each_cpu(bit, flush_mask) {
320 blade = uv_cpu_to_blade_id(bit); 328 blade = uv_cpu_to_blade_id(bit);
321 BUG_ON(blade > (UV_DISTRIBUTION_SIZE - 1)); 329 BUG_ON(blade > (UV_DISTRIBUTION_SIZE - 1));
322 if (blade == this_blade) { 330 if (blade == this_blade) {
@@ -331,17 +339,17 @@ int uv_flush_tlb_others(cpumask_t *cpumaskp, struct mm_struct *mm,
331 * no off_node flushing; return status for local node 339 * no off_node flushing; return status for local node
332 */ 340 */
333 if (locals) 341 if (locals)
334 return 0; 342 return flush_mask;
335 else 343 else
336 return 1; 344 return NULL;
337 } 345 }
338 __get_cpu_var(ptcstats).requestor++; 346 __get_cpu_var(ptcstats).requestor++;
339 __get_cpu_var(ptcstats).ntargeted += i; 347 __get_cpu_var(ptcstats).ntargeted += i;
340 348
341 bau_desc->payload.address = va; 349 bau_desc->payload.address = va;
342 bau_desc->payload.sending_cpu = smp_processor_id(); 350 bau_desc->payload.sending_cpu = cpu;
343 351
344 return uv_flush_send_and_wait(cpu, this_blade, bau_desc, cpumaskp); 352 return uv_flush_send_and_wait(uv_cpu, this_blade, bau_desc, flush_mask);
345} 353}
346 354
347/* 355/*
diff --git a/arch/x86/kernel/trampoline_32.S b/arch/x86/kernel/trampoline_32.S
index d8ccc3c6552f..66d874e5404c 100644
--- a/arch/x86/kernel/trampoline_32.S
+++ b/arch/x86/kernel/trampoline_32.S
@@ -29,7 +29,7 @@
29 29
30#include <linux/linkage.h> 30#include <linux/linkage.h>
31#include <asm/segment.h> 31#include <asm/segment.h>
32#include <asm/page.h> 32#include <asm/page_types.h>
33 33
34/* We can free up trampoline after bootup if cpu hotplug is not supported. */ 34/* We can free up trampoline after bootup if cpu hotplug is not supported. */
35#ifndef CONFIG_HOTPLUG_CPU 35#ifndef CONFIG_HOTPLUG_CPU
diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S
index 894293c598db..cddfb8d386b9 100644
--- a/arch/x86/kernel/trampoline_64.S
+++ b/arch/x86/kernel/trampoline_64.S
@@ -25,10 +25,11 @@
25 */ 25 */
26 26
27#include <linux/linkage.h> 27#include <linux/linkage.h>
28#include <asm/pgtable.h> 28#include <asm/pgtable_types.h>
29#include <asm/page.h> 29#include <asm/page_types.h>
30#include <asm/msr.h> 30#include <asm/msr.h>
31#include <asm/segment.h> 31#include <asm/segment.h>
32#include <asm/processor-flags.h>
32 33
33.section .rodata, "a", @progbits 34.section .rodata, "a", @progbits
34 35
@@ -37,7 +38,7 @@
37ENTRY(trampoline_data) 38ENTRY(trampoline_data)
38r_base = . 39r_base = .
39 cli # We should be safe anyway 40 cli # We should be safe anyway
40 wbinvd 41 wbinvd
41 mov %cs, %ax # Code and data in the same place 42 mov %cs, %ax # Code and data in the same place
42 mov %ax, %ds 43 mov %ax, %ds
43 mov %ax, %es 44 mov %ax, %es
@@ -73,9 +74,8 @@ r_base = .
73 lidtl tidt - r_base # load idt with 0, 0 74 lidtl tidt - r_base # load idt with 0, 0
74 lgdtl tgdt - r_base # load gdt with whatever is appropriate 75 lgdtl tgdt - r_base # load gdt with whatever is appropriate
75 76
76 xor %ax, %ax 77 mov $X86_CR0_PE, %ax # protected mode (PE) bit
77 inc %ax # protected mode (PE) bit 78 lmsw %ax # into protected mode
78 lmsw %ax # into protected mode
79 79
80 # flush prefetch and jump to startup_32 80 # flush prefetch and jump to startup_32
81 ljmpl *(startup_32_vector - r_base) 81 ljmpl *(startup_32_vector - r_base)
@@ -86,9 +86,8 @@ startup_32:
86 movl $__KERNEL_DS, %eax # Initialize the %ds segment register 86 movl $__KERNEL_DS, %eax # Initialize the %ds segment register
87 movl %eax, %ds 87 movl %eax, %ds
88 88
89 xorl %eax, %eax 89 movl $X86_CR4_PAE, %eax
90 btsl $5, %eax # Enable PAE mode 90 movl %eax, %cr4 # Enable PAE mode
91 movl %eax, %cr4
92 91
93 # Setup trampoline 4 level pagetables 92 # Setup trampoline 4 level pagetables
94 leal (trampoline_level4_pgt - r_base)(%esi), %eax 93 leal (trampoline_level4_pgt - r_base)(%esi), %eax
@@ -99,9 +98,9 @@ startup_32:
99 xorl %edx, %edx 98 xorl %edx, %edx
100 wrmsr 99 wrmsr
101 100
102 xorl %eax, %eax 101 # Enable paging and in turn activate Long Mode
103 btsl $31, %eax # Enable paging and in turn activate Long Mode 102 # Enable protected mode
104 btsl $0, %eax # Enable protected mode 103 movl $(X86_CR0_PG | X86_CR0_PE), %eax
105 movl %eax, %cr0 104 movl %eax, %cr0
106 105
107 /* 106 /*
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a9e7548e1790..a1d288327ff0 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -54,15 +54,14 @@
54#include <asm/desc.h> 54#include <asm/desc.h>
55#include <asm/i387.h> 55#include <asm/i387.h>
56 56
57#include <mach_traps.h> 57#include <asm/mach_traps.h>
58 58
59#ifdef CONFIG_X86_64 59#ifdef CONFIG_X86_64
60#include <asm/pgalloc.h> 60#include <asm/pgalloc.h>
61#include <asm/proto.h> 61#include <asm/proto.h>
62#include <asm/pda.h>
63#else 62#else
64#include <asm/processor-flags.h> 63#include <asm/processor-flags.h>
65#include <asm/arch_hooks.h> 64#include <asm/setup.h>
66#include <asm/traps.h> 65#include <asm/traps.h>
67 66
68#include "cpu/mcheck/mce.h" 67#include "cpu/mcheck/mce.h"
@@ -119,47 +118,6 @@ die_if_kernel(const char *str, struct pt_regs *regs, long err)
119 if (!user_mode_vm(regs)) 118 if (!user_mode_vm(regs))
120 die(str, regs, err); 119 die(str, regs, err);
121} 120}
122
123/*
124 * Perform the lazy TSS's I/O bitmap copy. If the TSS has an
125 * invalid offset set (the LAZY one) and the faulting thread has
126 * a valid I/O bitmap pointer, we copy the I/O bitmap in the TSS,
127 * we set the offset field correctly and return 1.
128 */
129static int lazy_iobitmap_copy(void)
130{
131 struct thread_struct *thread;
132 struct tss_struct *tss;
133 int cpu;
134
135 cpu = get_cpu();
136 tss = &per_cpu(init_tss, cpu);
137 thread = &current->thread;
138
139 if (tss->x86_tss.io_bitmap_base == INVALID_IO_BITMAP_OFFSET_LAZY &&
140 thread->io_bitmap_ptr) {
141 memcpy(tss->io_bitmap, thread->io_bitmap_ptr,
142 thread->io_bitmap_max);
143 /*
144 * If the previously set map was extending to higher ports
145 * than the current one, pad extra space with 0xff (no access).
146 */
147 if (thread->io_bitmap_max < tss->io_bitmap_max) {
148 memset((char *) tss->io_bitmap +
149 thread->io_bitmap_max, 0xff,
150 tss->io_bitmap_max - thread->io_bitmap_max);
151 }
152 tss->io_bitmap_max = thread->io_bitmap_max;
153 tss->x86_tss.io_bitmap_base = IO_BITMAP_OFFSET;
154 tss->io_bitmap_owner = thread;
155 put_cpu();
156
157 return 1;
158 }
159 put_cpu();
160
161 return 0;
162}
163#endif 121#endif
164 122
165static void __kprobes 123static void __kprobes
@@ -310,11 +268,6 @@ do_general_protection(struct pt_regs *regs, long error_code)
310 conditional_sti(regs); 268 conditional_sti(regs);
311 269
312#ifdef CONFIG_X86_32 270#ifdef CONFIG_X86_32
313 if (lazy_iobitmap_copy()) {
314 /* restart the faulting instruction */
315 return;
316 }
317
318 if (regs->flags & X86_VM_MASK) 271 if (regs->flags & X86_VM_MASK)
319 goto gp_in_vm86; 272 goto gp_in_vm86;
320#endif 273#endif
@@ -914,19 +867,20 @@ void math_emulate(struct math_emu_info *info)
914} 867}
915#endif /* CONFIG_MATH_EMULATION */ 868#endif /* CONFIG_MATH_EMULATION */
916 869
917dotraplinkage void __kprobes do_device_not_available(struct pt_regs regs) 870dotraplinkage void __kprobes
871do_device_not_available(struct pt_regs *regs, long error_code)
918{ 872{
919#ifdef CONFIG_X86_32 873#ifdef CONFIG_X86_32
920 if (read_cr0() & X86_CR0_EM) { 874 if (read_cr0() & X86_CR0_EM) {
921 struct math_emu_info info = { }; 875 struct math_emu_info info = { };
922 876
923 conditional_sti(&regs); 877 conditional_sti(regs);
924 878
925 info.regs = &regs; 879 info.regs = regs;
926 math_emulate(&info); 880 math_emulate(&info);
927 } else { 881 } else {
928 math_state_restore(); /* interrupts still off */ 882 math_state_restore(); /* interrupts still off */
929 conditional_sti(&regs); 883 conditional_sti(regs);
930 } 884 }
931#else 885#else
932 math_state_restore(); 886 math_state_restore();
@@ -942,7 +896,7 @@ dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code)
942 info.si_signo = SIGILL; 896 info.si_signo = SIGILL;
943 info.si_errno = 0; 897 info.si_errno = 0;
944 info.si_code = ILL_BADSTK; 898 info.si_code = ILL_BADSTK;
945 info.si_addr = 0; 899 info.si_addr = NULL;
946 if (notify_die(DIE_TRAP, "iret exception", 900 if (notify_die(DIE_TRAP, "iret exception",
947 regs, error_code, 32, SIGILL) == NOTIFY_STOP) 901 regs, error_code, 32, SIGILL) == NOTIFY_STOP)
948 return; 902 return;
@@ -1026,6 +980,6 @@ void __init trap_init(void)
1026 cpu_init(); 980 cpu_init();
1027 981
1028#ifdef CONFIG_X86_32 982#ifdef CONFIG_X86_32
1029 trap_init_hook(); 983 x86_quirk_trap_init();
1030#endif 984#endif
1031} 985}
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index d5cebb52d45b..7a567ebe6361 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -17,20 +17,21 @@
17#include <asm/delay.h> 17#include <asm/delay.h>
18#include <asm/hypervisor.h> 18#include <asm/hypervisor.h>
19 19
20unsigned int cpu_khz; /* TSC clocks / usec, not used here */ 20unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
21EXPORT_SYMBOL(cpu_khz); 21EXPORT_SYMBOL(cpu_khz);
22unsigned int tsc_khz; 22
23unsigned int __read_mostly tsc_khz;
23EXPORT_SYMBOL(tsc_khz); 24EXPORT_SYMBOL(tsc_khz);
24 25
25/* 26/*
26 * TSC can be unstable due to cpufreq or due to unsynced TSCs 27 * TSC can be unstable due to cpufreq or due to unsynced TSCs
27 */ 28 */
28static int tsc_unstable; 29static int __read_mostly tsc_unstable;
29 30
30/* native_sched_clock() is called before tsc_init(), so 31/* native_sched_clock() is called before tsc_init(), so
31 we must start with the TSC soft disabled to prevent 32 we must start with the TSC soft disabled to prevent
32 erroneous rdtsc usage on !cpu_has_tsc processors */ 33 erroneous rdtsc usage on !cpu_has_tsc processors */
33static int tsc_disabled = -1; 34static int __read_mostly tsc_disabled = -1;
34 35
35static int tsc_clocksource_reliable; 36static int tsc_clocksource_reliable;
36/* 37/*
@@ -543,8 +544,6 @@ unsigned long native_calibrate_tsc(void)
543 return tsc_pit_min; 544 return tsc_pit_min;
544} 545}
545 546
546#ifdef CONFIG_X86_32
547/* Only called from the Powernow K7 cpu freq driver */
548int recalibrate_cpu_khz(void) 547int recalibrate_cpu_khz(void)
549{ 548{
550#ifndef CONFIG_SMP 549#ifndef CONFIG_SMP
@@ -566,7 +565,6 @@ int recalibrate_cpu_khz(void)
566 565
567EXPORT_SYMBOL(recalibrate_cpu_khz); 566EXPORT_SYMBOL(recalibrate_cpu_khz);
568 567
569#endif /* CONFIG_X86_32 */
570 568
571/* Accelerators for sched_clock() 569/* Accelerators for sched_clock()
572 * convert from cycles(64bits) => nanoseconds (64bits) 570 * convert from cycles(64bits) => nanoseconds (64bits)
@@ -793,7 +791,7 @@ __cpuinit int unsynchronized_tsc(void)
793 if (!cpu_has_tsc || tsc_unstable) 791 if (!cpu_has_tsc || tsc_unstable)
794 return 1; 792 return 1;
795 793
796#ifdef CONFIG_X86_SMP 794#ifdef CONFIG_SMP
797 if (apic_is_clustered_box()) 795 if (apic_is_clustered_box())
798 return 1; 796 return 1;
799#endif 797#endif
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index d801d06af068..191a876e9e87 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -24,18 +24,14 @@
24 24
25#include <asm/visws/cobalt.h> 25#include <asm/visws/cobalt.h>
26#include <asm/visws/piix4.h> 26#include <asm/visws/piix4.h>
27#include <asm/arch_hooks.h>
28#include <asm/io_apic.h> 27#include <asm/io_apic.h>
29#include <asm/fixmap.h> 28#include <asm/fixmap.h>
30#include <asm/reboot.h> 29#include <asm/reboot.h>
31#include <asm/setup.h> 30#include <asm/setup.h>
31#include <asm/apic.h>
32#include <asm/e820.h> 32#include <asm/e820.h>
33#include <asm/io.h> 33#include <asm/io.h>
34 34
35#include <mach_ipi.h>
36
37#include "mach_apic.h"
38
39#include <linux/kernel_stat.h> 35#include <linux/kernel_stat.h>
40 36
41#include <asm/i8259.h> 37#include <asm/i8259.h>
@@ -49,8 +45,6 @@
49 45
50extern int no_broadcast; 46extern int no_broadcast;
51 47
52#include <asm/apic.h>
53
54char visws_board_type = -1; 48char visws_board_type = -1;
55char visws_board_rev = -1; 49char visws_board_rev = -1;
56 50
@@ -200,7 +194,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
200 return; 194 return;
201 } 195 }
202 196
203 apic_cpus = apicid_to_cpu_present(m->apicid); 197 apic_cpus = apic->apicid_to_cpu_present(m->apicid);
204 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus); 198 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
205 /* 199 /*
206 * Validate version 200 * Validate version
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 4eeb5cf9720d..d7ac84e7fc1c 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -158,7 +158,7 @@ struct pt_regs *save_v86_state(struct kernel_vm86_regs *regs)
158 ret = KVM86->regs32; 158 ret = KVM86->regs32;
159 159
160 ret->fs = current->thread.saved_fs; 160 ret->fs = current->thread.saved_fs;
161 loadsegment(gs, current->thread.saved_gs); 161 set_user_gs(ret, current->thread.saved_gs);
162 162
163 return ret; 163 return ret;
164} 164}
@@ -197,9 +197,9 @@ out:
197static int do_vm86_irq_handling(int subfunction, int irqnumber); 197static int do_vm86_irq_handling(int subfunction, int irqnumber);
198static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); 198static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk);
199 199
200asmlinkage int sys_vm86old(struct pt_regs regs) 200int sys_vm86old(struct pt_regs *regs)
201{ 201{
202 struct vm86_struct __user *v86 = (struct vm86_struct __user *)regs.bx; 202 struct vm86_struct __user *v86 = (struct vm86_struct __user *)regs->bx;
203 struct kernel_vm86_struct info; /* declare this _on top_, 203 struct kernel_vm86_struct info; /* declare this _on top_,
204 * this avoids wasting of stack space. 204 * this avoids wasting of stack space.
205 * This remains on the stack until we 205 * This remains on the stack until we
@@ -218,7 +218,7 @@ asmlinkage int sys_vm86old(struct pt_regs regs)
218 if (tmp) 218 if (tmp)
219 goto out; 219 goto out;
220 memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); 220 memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus);
221 info.regs32 = &regs; 221 info.regs32 = regs;
222 tsk->thread.vm86_info = v86; 222 tsk->thread.vm86_info = v86;
223 do_sys_vm86(&info, tsk); 223 do_sys_vm86(&info, tsk);
224 ret = 0; /* we never return here */ 224 ret = 0; /* we never return here */
@@ -227,7 +227,7 @@ out:
227} 227}
228 228
229 229
230asmlinkage int sys_vm86(struct pt_regs regs) 230int sys_vm86(struct pt_regs *regs)
231{ 231{
232 struct kernel_vm86_struct info; /* declare this _on top_, 232 struct kernel_vm86_struct info; /* declare this _on top_,
233 * this avoids wasting of stack space. 233 * this avoids wasting of stack space.
@@ -239,12 +239,12 @@ asmlinkage int sys_vm86(struct pt_regs regs)
239 struct vm86plus_struct __user *v86; 239 struct vm86plus_struct __user *v86;
240 240
241 tsk = current; 241 tsk = current;
242 switch (regs.bx) { 242 switch (regs->bx) {
243 case VM86_REQUEST_IRQ: 243 case VM86_REQUEST_IRQ:
244 case VM86_FREE_IRQ: 244 case VM86_FREE_IRQ:
245 case VM86_GET_IRQ_BITS: 245 case VM86_GET_IRQ_BITS:
246 case VM86_GET_AND_RESET_IRQ: 246 case VM86_GET_AND_RESET_IRQ:
247 ret = do_vm86_irq_handling(regs.bx, (int)regs.cx); 247 ret = do_vm86_irq_handling(regs->bx, (int)regs->cx);
248 goto out; 248 goto out;
249 case VM86_PLUS_INSTALL_CHECK: 249 case VM86_PLUS_INSTALL_CHECK:
250 /* 250 /*
@@ -261,14 +261,14 @@ asmlinkage int sys_vm86(struct pt_regs regs)
261 ret = -EPERM; 261 ret = -EPERM;
262 if (tsk->thread.saved_sp0) 262 if (tsk->thread.saved_sp0)
263 goto out; 263 goto out;
264 v86 = (struct vm86plus_struct __user *)regs.cx; 264 v86 = (struct vm86plus_struct __user *)regs->cx;
265 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 265 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs,
266 offsetof(struct kernel_vm86_struct, regs32) - 266 offsetof(struct kernel_vm86_struct, regs32) -
267 sizeof(info.regs)); 267 sizeof(info.regs));
268 ret = -EFAULT; 268 ret = -EFAULT;
269 if (tmp) 269 if (tmp)
270 goto out; 270 goto out;
271 info.regs32 = &regs; 271 info.regs32 = regs;
272 info.vm86plus.is_vm86pus = 1; 272 info.vm86plus.is_vm86pus = 1;
273 tsk->thread.vm86_info = (struct vm86_struct __user *)v86; 273 tsk->thread.vm86_info = (struct vm86_struct __user *)v86;
274 do_sys_vm86(&info, tsk); 274 do_sys_vm86(&info, tsk);
@@ -323,7 +323,7 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
323 info->regs32->ax = 0; 323 info->regs32->ax = 0;
324 tsk->thread.saved_sp0 = tsk->thread.sp0; 324 tsk->thread.saved_sp0 = tsk->thread.sp0;
325 tsk->thread.saved_fs = info->regs32->fs; 325 tsk->thread.saved_fs = info->regs32->fs;
326 savesegment(gs, tsk->thread.saved_gs); 326 tsk->thread.saved_gs = get_user_gs(info->regs32);
327 327
328 tss = &per_cpu(init_tss, get_cpu()); 328 tss = &per_cpu(init_tss, get_cpu());
329 tsk->thread.sp0 = (unsigned long) &info->VM86_TSS_ESP0; 329 tsk->thread.sp0 = (unsigned long) &info->VM86_TSS_ESP0;
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index bef58b4982db..2cc4a90e2cb3 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -680,10 +680,11 @@ static inline int __init activate_vmi(void)
680 para_fill(pv_mmu_ops.write_cr2, SetCR2); 680 para_fill(pv_mmu_ops.write_cr2, SetCR2);
681 para_fill(pv_mmu_ops.write_cr3, SetCR3); 681 para_fill(pv_mmu_ops.write_cr3, SetCR3);
682 para_fill(pv_cpu_ops.write_cr4, SetCR4); 682 para_fill(pv_cpu_ops.write_cr4, SetCR4);
683 para_fill(pv_irq_ops.save_fl, GetInterruptMask); 683
684 para_fill(pv_irq_ops.restore_fl, SetInterruptMask); 684 para_fill(pv_irq_ops.save_fl.func, GetInterruptMask);
685 para_fill(pv_irq_ops.irq_disable, DisableInterrupts); 685 para_fill(pv_irq_ops.restore_fl.func, SetInterruptMask);
686 para_fill(pv_irq_ops.irq_enable, EnableInterrupts); 686 para_fill(pv_irq_ops.irq_disable.func, DisableInterrupts);
687 para_fill(pv_irq_ops.irq_enable.func, EnableInterrupts);
687 688
688 para_fill(pv_cpu_ops.wbinvd, WBINVD); 689 para_fill(pv_cpu_ops.wbinvd, WBINVD);
689 para_fill(pv_cpu_ops.read_tsc, RDTSC); 690 para_fill(pv_cpu_ops.read_tsc, RDTSC);
@@ -797,8 +798,8 @@ static inline int __init activate_vmi(void)
797#endif 798#endif
798 799
799#ifdef CONFIG_X86_LOCAL_APIC 800#ifdef CONFIG_X86_LOCAL_APIC
800 para_fill(apic_ops->read, APICRead); 801 para_fill(apic->read, APICRead);
801 para_fill(apic_ops->write, APICWrite); 802 para_fill(apic->write, APICWrite);
802#endif 803#endif
803 804
804 /* 805 /*
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index e5b088fffa40..33a788d5879c 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -28,7 +28,6 @@
28 28
29#include <asm/vmi.h> 29#include <asm/vmi.h>
30#include <asm/vmi_time.h> 30#include <asm/vmi_time.h>
31#include <asm/arch_hooks.h>
32#include <asm/apicdef.h> 31#include <asm/apicdef.h>
33#include <asm/apic.h> 32#include <asm/apic.h>
34#include <asm/timer.h> 33#include <asm/timer.h>
@@ -256,7 +255,7 @@ void __devinit vmi_time_bsp_init(void)
256 */ 255 */
257 clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL); 256 clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
258 local_irq_disable(); 257 local_irq_disable();
259#ifdef CONFIG_X86_SMP 258#ifdef CONFIG_SMP
260 /* 259 /*
261 * XXX handle_percpu_irq only defined for SMP; we need to switch over 260 * XXX handle_percpu_irq only defined for SMP; we need to switch over
262 * to using it, since this is a local interrupt, which each CPU must 261 * to using it, since this is a local interrupt, which each CPU must
@@ -288,8 +287,7 @@ static struct clocksource clocksource_vmi;
288static cycle_t read_real_cycles(void) 287static cycle_t read_real_cycles(void)
289{ 288{
290 cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL); 289 cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
291 return ret >= clocksource_vmi.cycle_last ? 290 return max(ret, clocksource_vmi.cycle_last);
292 ret : clocksource_vmi.cycle_last;
293} 291}
294 292
295static struct clocksource clocksource_vmi = { 293static struct clocksource clocksource_vmi = {
diff --git a/arch/x86/kernel/vmlinux_32.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 82c67559dde7..0d860963f268 100644
--- a/arch/x86/kernel/vmlinux_32.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
@@ -12,7 +12,7 @@
12 12
13#include <asm-generic/vmlinux.lds.h> 13#include <asm-generic/vmlinux.lds.h>
14#include <asm/thread_info.h> 14#include <asm/thread_info.h>
15#include <asm/page.h> 15#include <asm/page_types.h>
16#include <asm/cache.h> 16#include <asm/cache.h>
17#include <asm/boot.h> 17#include <asm/boot.h>
18 18
@@ -178,14 +178,7 @@ SECTIONS
178 __initramfs_end = .; 178 __initramfs_end = .;
179 } 179 }
180#endif 180#endif
181 . = ALIGN(PAGE_SIZE); 181 PERCPU(PAGE_SIZE)
182 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
183 __per_cpu_start = .;
184 *(.data.percpu.page_aligned)
185 *(.data.percpu)
186 *(.data.percpu.shared_aligned)
187 __per_cpu_end = .;
188 }
189 . = ALIGN(PAGE_SIZE); 182 . = ALIGN(PAGE_SIZE);
190 /* freed after init ends here */ 183 /* freed after init ends here */
191 184
diff --git a/arch/x86/kernel/vmlinux_64.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index 1a614c0e6bef..fbfced6f6800 100644
--- a/arch/x86/kernel/vmlinux_64.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
@@ -5,7 +5,8 @@
5#define LOAD_OFFSET __START_KERNEL_map 5#define LOAD_OFFSET __START_KERNEL_map
6 6
7#include <asm-generic/vmlinux.lds.h> 7#include <asm-generic/vmlinux.lds.h>
8#include <asm/page.h> 8#include <asm/asm-offsets.h>
9#include <asm/page_types.h>
9 10
10#undef i386 /* in case the preprocessor is a 32bit one */ 11#undef i386 /* in case the preprocessor is a 32bit one */
11 12
@@ -13,12 +14,15 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
13OUTPUT_ARCH(i386:x86-64) 14OUTPUT_ARCH(i386:x86-64)
14ENTRY(phys_startup_64) 15ENTRY(phys_startup_64)
15jiffies_64 = jiffies; 16jiffies_64 = jiffies;
16_proxy_pda = 1;
17PHDRS { 17PHDRS {
18 text PT_LOAD FLAGS(5); /* R_E */ 18 text PT_LOAD FLAGS(5); /* R_E */
19 data PT_LOAD FLAGS(7); /* RWE */ 19 data PT_LOAD FLAGS(7); /* RWE */
20 user PT_LOAD FLAGS(7); /* RWE */ 20 user PT_LOAD FLAGS(7); /* RWE */
21 data.init PT_LOAD FLAGS(7); /* RWE */ 21 data.init PT_LOAD FLAGS(7); /* RWE */
22#ifdef CONFIG_SMP
23 percpu PT_LOAD FLAGS(7); /* RWE */
24#endif
25 data.init2 PT_LOAD FLAGS(7); /* RWE */
22 note PT_NOTE FLAGS(0); /* ___ */ 26 note PT_NOTE FLAGS(0); /* ___ */
23} 27}
24SECTIONS 28SECTIONS
@@ -208,14 +212,28 @@ SECTIONS
208 __initramfs_end = .; 212 __initramfs_end = .;
209#endif 213#endif
210 214
215#ifdef CONFIG_SMP
216 /*
217 * percpu offsets are zero-based on SMP. PERCPU_VADDR() changes the
218 * output PHDR, so the next output section - __data_nosave - should
219 * start another section data.init2. Also, pda should be at the head of
220 * percpu area. Preallocate it and define the percpu offset symbol
221 * so that it can be accessed as a percpu variable.
222 */
223 . = ALIGN(PAGE_SIZE);
224 PERCPU_VADDR(0, :percpu)
225#else
211 PERCPU(PAGE_SIZE) 226 PERCPU(PAGE_SIZE)
227#endif
212 228
213 . = ALIGN(PAGE_SIZE); 229 . = ALIGN(PAGE_SIZE);
214 __init_end = .; 230 __init_end = .;
215 231
216 . = ALIGN(PAGE_SIZE); 232 . = ALIGN(PAGE_SIZE);
217 __nosave_begin = .; 233 __nosave_begin = .;
218 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) } 234 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
235 *(.data.nosave)
236 } :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
219 . = ALIGN(PAGE_SIZE); 237 . = ALIGN(PAGE_SIZE);
220 __nosave_end = .; 238 __nosave_end = .;
221 239
@@ -239,8 +257,21 @@ SECTIONS
239 DWARF_DEBUG 257 DWARF_DEBUG
240} 258}
241 259
260 /*
261 * Per-cpu symbols which need to be offset from __per_cpu_load
262 * for the boot processor.
263 */
264#define INIT_PER_CPU(x) init_per_cpu__##x = per_cpu__##x + __per_cpu_load
265INIT_PER_CPU(gdt_page);
266INIT_PER_CPU(irq_stack_union);
267
242/* 268/*
243 * Build-time check on the image size: 269 * Build-time check on the image size:
244 */ 270 */
245ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), 271ASSERT((_end - _text <= KERNEL_IMAGE_SIZE),
246 "kernel image bigger than KERNEL_IMAGE_SIZE") 272 "kernel image bigger than KERNEL_IMAGE_SIZE")
273
274#ifdef CONFIG_SMP
275ASSERT((per_cpu__irq_stack_union == 0),
276 "irq_stack_union is not at start of per-cpu area");
277#endif
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index a688f3bfaec2..74de562812cc 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -22,7 +22,7 @@
22#include <asm/paravirt.h> 22#include <asm/paravirt.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24 24
25#if defined CONFIG_PCI && defined CONFIG_PARAVIRT 25#ifdef CONFIG_PARAVIRT
26/* 26/*
27 * Interrupt control on vSMPowered systems: 27 * Interrupt control on vSMPowered systems:
28 * ~AC is a shadow of IF. If IF is 'on' AC should be 'off' 28 * ~AC is a shadow of IF. If IF is 'on' AC should be 'off'
@@ -37,6 +37,7 @@ static unsigned long vsmp_save_fl(void)
37 flags &= ~X86_EFLAGS_IF; 37 flags &= ~X86_EFLAGS_IF;
38 return flags; 38 return flags;
39} 39}
40PV_CALLEE_SAVE_REGS_THUNK(vsmp_save_fl);
40 41
41static void vsmp_restore_fl(unsigned long flags) 42static void vsmp_restore_fl(unsigned long flags)
42{ 43{
@@ -46,6 +47,7 @@ static void vsmp_restore_fl(unsigned long flags)
46 flags |= X86_EFLAGS_AC; 47 flags |= X86_EFLAGS_AC;
47 native_restore_fl(flags); 48 native_restore_fl(flags);
48} 49}
50PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl);
49 51
50static void vsmp_irq_disable(void) 52static void vsmp_irq_disable(void)
51{ 53{
@@ -53,6 +55,7 @@ static void vsmp_irq_disable(void)
53 55
54 native_restore_fl((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC); 56 native_restore_fl((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC);
55} 57}
58PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable);
56 59
57static void vsmp_irq_enable(void) 60static void vsmp_irq_enable(void)
58{ 61{
@@ -60,6 +63,7 @@ static void vsmp_irq_enable(void)
60 63
61 native_restore_fl((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC)); 64 native_restore_fl((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC));
62} 65}
66PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_enable);
63 67
64static unsigned __init_or_module vsmp_patch(u8 type, u16 clobbers, void *ibuf, 68static unsigned __init_or_module vsmp_patch(u8 type, u16 clobbers, void *ibuf,
65 unsigned long addr, unsigned len) 69 unsigned long addr, unsigned len)
@@ -90,10 +94,10 @@ static void __init set_vsmp_pv_ops(void)
90 cap, ctl); 94 cap, ctl);
91 if (cap & ctl & (1 << 4)) { 95 if (cap & ctl & (1 << 4)) {
92 /* Setup irq ops and turn on vSMP IRQ fastpath handling */ 96 /* Setup irq ops and turn on vSMP IRQ fastpath handling */
93 pv_irq_ops.irq_disable = vsmp_irq_disable; 97 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(vsmp_irq_disable);
94 pv_irq_ops.irq_enable = vsmp_irq_enable; 98 pv_irq_ops.irq_enable = PV_CALLEE_SAVE(vsmp_irq_enable);
95 pv_irq_ops.save_fl = vsmp_save_fl; 99 pv_irq_ops.save_fl = PV_CALLEE_SAVE(vsmp_save_fl);
96 pv_irq_ops.restore_fl = vsmp_restore_fl; 100 pv_irq_ops.restore_fl = PV_CALLEE_SAVE(vsmp_restore_fl);
97 pv_init_ops.patch = vsmp_patch; 101 pv_init_ops.patch = vsmp_patch;
98 102
99 ctl &= ~(1 << 4); 103 ctl &= ~(1 << 4);
@@ -110,7 +114,6 @@ static void __init set_vsmp_pv_ops(void)
110} 114}
111#endif 115#endif
112 116
113#ifdef CONFIG_PCI
114static int is_vsmp = -1; 117static int is_vsmp = -1;
115 118
116static void __init detect_vsmp_box(void) 119static void __init detect_vsmp_box(void)
@@ -135,15 +138,6 @@ int is_vsmp_box(void)
135 return 0; 138 return 0;
136 } 139 }
137} 140}
138#else
139static void __init detect_vsmp_box(void)
140{
141}
142int is_vsmp_box(void)
143{
144 return 0;
145}
146#endif
147 141
148void __init vsmp_init(void) 142void __init vsmp_init(void)
149{ 143{
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index 695e426aa354..3909e3ba5ce3 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
@@ -58,5 +58,3 @@ EXPORT_SYMBOL(__memcpy);
58EXPORT_SYMBOL(empty_zero_page); 58EXPORT_SYMBOL(empty_zero_page);
59EXPORT_SYMBOL(init_level4_pgt); 59EXPORT_SYMBOL(init_level4_pgt);
60EXPORT_SYMBOL(load_gs_index); 60EXPORT_SYMBOL(load_gs_index);
61
62EXPORT_SYMBOL(_proxy_pda);
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index b81125f0bdee..0a303c3ed11f 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -4,6 +4,10 @@
4config HAVE_KVM 4config HAVE_KVM
5 bool 5 bool
6 6
7config HAVE_KVM_IRQCHIP
8 bool
9 default y
10
7menuconfig VIRTUALIZATION 11menuconfig VIRTUALIZATION
8 bool "Virtualization" 12 bool "Virtualization"
9 depends on HAVE_KVM || X86 13 depends on HAVE_KVM || X86
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 72bd275a9b5c..c13bb92d3157 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -201,6 +201,9 @@ static int __pit_timer_fn(struct kvm_kpit_state *ps)
201 if (!atomic_inc_and_test(&pt->pending)) 201 if (!atomic_inc_and_test(&pt->pending))
202 set_bit(KVM_REQ_PENDING_TIMER, &vcpu0->requests); 202 set_bit(KVM_REQ_PENDING_TIMER, &vcpu0->requests);
203 203
204 if (!pt->reinject)
205 atomic_set(&pt->pending, 1);
206
204 if (vcpu0 && waitqueue_active(&vcpu0->wq)) 207 if (vcpu0 && waitqueue_active(&vcpu0->wq))
205 wake_up_interruptible(&vcpu0->wq); 208 wake_up_interruptible(&vcpu0->wq);
206 209
@@ -536,6 +539,16 @@ void kvm_pit_reset(struct kvm_pit *pit)
536 pit->pit_state.irq_ack = 1; 539 pit->pit_state.irq_ack = 1;
537} 540}
538 541
542static void pit_mask_notifer(struct kvm_irq_mask_notifier *kimn, bool mask)
543{
544 struct kvm_pit *pit = container_of(kimn, struct kvm_pit, mask_notifier);
545
546 if (!mask) {
547 atomic_set(&pit->pit_state.pit_timer.pending, 0);
548 pit->pit_state.irq_ack = 1;
549 }
550}
551
539struct kvm_pit *kvm_create_pit(struct kvm *kvm) 552struct kvm_pit *kvm_create_pit(struct kvm *kvm)
540{ 553{
541 struct kvm_pit *pit; 554 struct kvm_pit *pit;
@@ -545,9 +558,7 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm)
545 if (!pit) 558 if (!pit)
546 return NULL; 559 return NULL;
547 560
548 mutex_lock(&kvm->lock);
549 pit->irq_source_id = kvm_request_irq_source_id(kvm); 561 pit->irq_source_id = kvm_request_irq_source_id(kvm);
550 mutex_unlock(&kvm->lock);
551 if (pit->irq_source_id < 0) { 562 if (pit->irq_source_id < 0) {
552 kfree(pit); 563 kfree(pit);
553 return NULL; 564 return NULL;
@@ -580,10 +591,14 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm)
580 pit_state->irq_ack_notifier.gsi = 0; 591 pit_state->irq_ack_notifier.gsi = 0;
581 pit_state->irq_ack_notifier.irq_acked = kvm_pit_ack_irq; 592 pit_state->irq_ack_notifier.irq_acked = kvm_pit_ack_irq;
582 kvm_register_irq_ack_notifier(kvm, &pit_state->irq_ack_notifier); 593 kvm_register_irq_ack_notifier(kvm, &pit_state->irq_ack_notifier);
594 pit_state->pit_timer.reinject = true;
583 mutex_unlock(&pit->pit_state.lock); 595 mutex_unlock(&pit->pit_state.lock);
584 596
585 kvm_pit_reset(pit); 597 kvm_pit_reset(pit);
586 598
599 pit->mask_notifier.func = pit_mask_notifer;
600 kvm_register_irq_mask_notifier(kvm, 0, &pit->mask_notifier);
601
587 return pit; 602 return pit;
588} 603}
589 604
@@ -592,6 +607,8 @@ void kvm_free_pit(struct kvm *kvm)
592 struct hrtimer *timer; 607 struct hrtimer *timer;
593 608
594 if (kvm->arch.vpit) { 609 if (kvm->arch.vpit) {
610 kvm_unregister_irq_mask_notifier(kvm, 0,
611 &kvm->arch.vpit->mask_notifier);
595 mutex_lock(&kvm->arch.vpit->pit_state.lock); 612 mutex_lock(&kvm->arch.vpit->pit_state.lock);
596 timer = &kvm->arch.vpit->pit_state.pit_timer.timer; 613 timer = &kvm->arch.vpit->pit_state.pit_timer.timer;
597 hrtimer_cancel(timer); 614 hrtimer_cancel(timer);
diff --git a/arch/x86/kvm/i8254.h b/arch/x86/kvm/i8254.h
index 4178022b97aa..6acbe4b505d5 100644
--- a/arch/x86/kvm/i8254.h
+++ b/arch/x86/kvm/i8254.h
@@ -9,6 +9,7 @@ struct kvm_kpit_timer {
9 s64 period; /* unit: ns */ 9 s64 period; /* unit: ns */
10 s64 scheduled; 10 s64 scheduled;
11 atomic_t pending; 11 atomic_t pending;
12 bool reinject;
12}; 13};
13 14
14struct kvm_kpit_channel_state { 15struct kvm_kpit_channel_state {
@@ -45,6 +46,7 @@ struct kvm_pit {
45 struct kvm *kvm; 46 struct kvm *kvm;
46 struct kvm_kpit_state pit_state; 47 struct kvm_kpit_state pit_state;
47 int irq_source_id; 48 int irq_source_id;
49 struct kvm_irq_mask_notifier mask_notifier;
48}; 50};
49 51
50#define KVM_PIT_BASE_ADDRESS 0x40 52#define KVM_PIT_BASE_ADDRESS 0x40
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 179dcb0103fd..1ccb50c74f18 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -32,11 +32,13 @@
32#include <linux/kvm_host.h> 32#include <linux/kvm_host.h>
33 33
34static void pic_lock(struct kvm_pic *s) 34static void pic_lock(struct kvm_pic *s)
35 __acquires(&s->lock)
35{ 36{
36 spin_lock(&s->lock); 37 spin_lock(&s->lock);
37} 38}
38 39
39static void pic_unlock(struct kvm_pic *s) 40static void pic_unlock(struct kvm_pic *s)
41 __releases(&s->lock)
40{ 42{
41 struct kvm *kvm = s->kvm; 43 struct kvm *kvm = s->kvm;
42 unsigned acks = s->pending_acks; 44 unsigned acks = s->pending_acks;
@@ -49,7 +51,8 @@ static void pic_unlock(struct kvm_pic *s)
49 spin_unlock(&s->lock); 51 spin_unlock(&s->lock);
50 52
51 while (acks) { 53 while (acks) {
52 kvm_notify_acked_irq(kvm, __ffs(acks)); 54 kvm_notify_acked_irq(kvm, SELECT_PIC(__ffs(acks)),
55 __ffs(acks));
53 acks &= acks - 1; 56 acks &= acks - 1;
54 } 57 }
55 58
@@ -76,12 +79,13 @@ void kvm_pic_clear_isr_ack(struct kvm *kvm)
76/* 79/*
77 * set irq level. If an edge is detected, then the IRR is set to 1 80 * set irq level. If an edge is detected, then the IRR is set to 1
78 */ 81 */
79static inline void pic_set_irq1(struct kvm_kpic_state *s, int irq, int level) 82static inline int pic_set_irq1(struct kvm_kpic_state *s, int irq, int level)
80{ 83{
81 int mask; 84 int mask, ret = 1;
82 mask = 1 << irq; 85 mask = 1 << irq;
83 if (s->elcr & mask) /* level triggered */ 86 if (s->elcr & mask) /* level triggered */
84 if (level) { 87 if (level) {
88 ret = !(s->irr & mask);
85 s->irr |= mask; 89 s->irr |= mask;
86 s->last_irr |= mask; 90 s->last_irr |= mask;
87 } else { 91 } else {
@@ -90,11 +94,15 @@ static inline void pic_set_irq1(struct kvm_kpic_state *s, int irq, int level)
90 } 94 }
91 else /* edge triggered */ 95 else /* edge triggered */
92 if (level) { 96 if (level) {
93 if ((s->last_irr & mask) == 0) 97 if ((s->last_irr & mask) == 0) {
98 ret = !(s->irr & mask);
94 s->irr |= mask; 99 s->irr |= mask;
100 }
95 s->last_irr |= mask; 101 s->last_irr |= mask;
96 } else 102 } else
97 s->last_irr &= ~mask; 103 s->last_irr &= ~mask;
104
105 return (s->imr & mask) ? -1 : ret;
98} 106}
99 107
100/* 108/*
@@ -171,16 +179,19 @@ void kvm_pic_update_irq(struct kvm_pic *s)
171 pic_unlock(s); 179 pic_unlock(s);
172} 180}
173 181
174void kvm_pic_set_irq(void *opaque, int irq, int level) 182int kvm_pic_set_irq(void *opaque, int irq, int level)
175{ 183{
176 struct kvm_pic *s = opaque; 184 struct kvm_pic *s = opaque;
185 int ret = -1;
177 186
178 pic_lock(s); 187 pic_lock(s);
179 if (irq >= 0 && irq < PIC_NUM_PINS) { 188 if (irq >= 0 && irq < PIC_NUM_PINS) {
180 pic_set_irq1(&s->pics[irq >> 3], irq & 7, level); 189 ret = pic_set_irq1(&s->pics[irq >> 3], irq & 7, level);
181 pic_update_irq(s); 190 pic_update_irq(s);
182 } 191 }
183 pic_unlock(s); 192 pic_unlock(s);
193
194 return ret;
184} 195}
185 196
186/* 197/*
@@ -232,7 +243,7 @@ int kvm_pic_read_irq(struct kvm *kvm)
232 } 243 }
233 pic_update_irq(s); 244 pic_update_irq(s);
234 pic_unlock(s); 245 pic_unlock(s);
235 kvm_notify_acked_irq(kvm, irq); 246 kvm_notify_acked_irq(kvm, SELECT_PIC(irq), irq);
236 247
237 return intno; 248 return intno;
238} 249}
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index 82579ee538d0..9f593188129e 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -32,6 +32,8 @@
32#include "lapic.h" 32#include "lapic.h"
33 33
34#define PIC_NUM_PINS 16 34#define PIC_NUM_PINS 16
35#define SELECT_PIC(irq) \
36 ((irq) < 8 ? KVM_IRQCHIP_PIC_MASTER : KVM_IRQCHIP_PIC_SLAVE)
35 37
36struct kvm; 38struct kvm;
37struct kvm_vcpu; 39struct kvm_vcpu;
diff --git a/arch/x86/kvm/kvm_svm.h b/arch/x86/kvm/kvm_svm.h
index 8e5ee99551f6..ed66e4c078dc 100644
--- a/arch/x86/kvm/kvm_svm.h
+++ b/arch/x86/kvm/kvm_svm.h
@@ -18,7 +18,6 @@ static const u32 host_save_user_msrs[] = {
18}; 18};
19 19
20#define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs) 20#define NR_HOST_SAVE_USER_MSRS ARRAY_SIZE(host_save_user_msrs)
21#define NUM_DB_REGS 4
22 21
23struct kvm_vcpu; 22struct kvm_vcpu;
24 23
@@ -29,18 +28,23 @@ struct vcpu_svm {
29 struct svm_cpu_data *svm_data; 28 struct svm_cpu_data *svm_data;
30 uint64_t asid_generation; 29 uint64_t asid_generation;
31 30
32 unsigned long db_regs[NUM_DB_REGS];
33
34 u64 next_rip; 31 u64 next_rip;
35 32
36 u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS]; 33 u64 host_user_msrs[NR_HOST_SAVE_USER_MSRS];
37 u64 host_gs_base; 34 u64 host_gs_base;
38 unsigned long host_cr2; 35 unsigned long host_cr2;
39 unsigned long host_db_regs[NUM_DB_REGS];
40 unsigned long host_dr6;
41 unsigned long host_dr7;
42 36
43 u32 *msrpm; 37 u32 *msrpm;
38 struct vmcb *hsave;
39 u64 hsave_msr;
40
41 u64 nested_vmcb;
42
43 /* These are the merged vectors */
44 u32 *nested_msrpm;
45
46 /* gpa pointers to the real vectors */
47 u64 nested_vmcb_msrpm;
44}; 48};
45 49
46#endif 50#endif
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 2d4477c71473..2a36f7f7c4c7 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -145,11 +145,20 @@ struct kvm_rmap_desc {
145 struct kvm_rmap_desc *more; 145 struct kvm_rmap_desc *more;
146}; 146};
147 147
148struct kvm_shadow_walk { 148struct kvm_shadow_walk_iterator {
149 int (*entry)(struct kvm_shadow_walk *walk, struct kvm_vcpu *vcpu, 149 u64 addr;
150 u64 addr, u64 *spte, int level); 150 hpa_t shadow_addr;
151 int level;
152 u64 *sptep;
153 unsigned index;
151}; 154};
152 155
156#define for_each_shadow_entry(_vcpu, _addr, _walker) \
157 for (shadow_walk_init(&(_walker), _vcpu, _addr); \
158 shadow_walk_okay(&(_walker)); \
159 shadow_walk_next(&(_walker)))
160
161
153struct kvm_unsync_walk { 162struct kvm_unsync_walk {
154 int (*entry) (struct kvm_mmu_page *sp, struct kvm_unsync_walk *walk); 163 int (*entry) (struct kvm_mmu_page *sp, struct kvm_unsync_walk *walk);
155}; 164};
@@ -343,7 +352,6 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc,
343 352
344 BUG_ON(!mc->nobjs); 353 BUG_ON(!mc->nobjs);
345 p = mc->objects[--mc->nobjs]; 354 p = mc->objects[--mc->nobjs];
346 memset(p, 0, size);
347 return p; 355 return p;
348} 356}
349 357
@@ -794,10 +802,8 @@ static struct kvm_mmu_page *kvm_mmu_alloc_page(struct kvm_vcpu *vcpu,
794 set_page_private(virt_to_page(sp->spt), (unsigned long)sp); 802 set_page_private(virt_to_page(sp->spt), (unsigned long)sp);
795 list_add(&sp->link, &vcpu->kvm->arch.active_mmu_pages); 803 list_add(&sp->link, &vcpu->kvm->arch.active_mmu_pages);
796 INIT_LIST_HEAD(&sp->oos_link); 804 INIT_LIST_HEAD(&sp->oos_link);
797 ASSERT(is_empty_shadow_page(sp->spt));
798 bitmap_zero(sp->slot_bitmap, KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS); 805 bitmap_zero(sp->slot_bitmap, KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS);
799 sp->multimapped = 0; 806 sp->multimapped = 0;
800 sp->global = 1;
801 sp->parent_pte = parent_pte; 807 sp->parent_pte = parent_pte;
802 --vcpu->kvm->arch.n_free_mmu_pages; 808 --vcpu->kvm->arch.n_free_mmu_pages;
803 return sp; 809 return sp;
@@ -983,8 +989,8 @@ struct kvm_mmu_pages {
983 idx < 512; \ 989 idx < 512; \
984 idx = find_next_bit(bitmap, 512, idx+1)) 990 idx = find_next_bit(bitmap, 512, idx+1))
985 991
986int mmu_pages_add(struct kvm_mmu_pages *pvec, struct kvm_mmu_page *sp, 992static int mmu_pages_add(struct kvm_mmu_pages *pvec, struct kvm_mmu_page *sp,
987 int idx) 993 int idx)
988{ 994{
989 int i; 995 int i;
990 996
@@ -1059,7 +1065,7 @@ static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm *kvm, gfn_t gfn)
1059 index = kvm_page_table_hashfn(gfn); 1065 index = kvm_page_table_hashfn(gfn);
1060 bucket = &kvm->arch.mmu_page_hash[index]; 1066 bucket = &kvm->arch.mmu_page_hash[index];
1061 hlist_for_each_entry(sp, node, bucket, hash_link) 1067 hlist_for_each_entry(sp, node, bucket, hash_link)
1062 if (sp->gfn == gfn && !sp->role.metaphysical 1068 if (sp->gfn == gfn && !sp->role.direct
1063 && !sp->role.invalid) { 1069 && !sp->role.invalid) {
1064 pgprintk("%s: found role %x\n", 1070 pgprintk("%s: found role %x\n",
1065 __func__, sp->role.word); 1071 __func__, sp->role.word);
@@ -1115,8 +1121,9 @@ struct mmu_page_path {
1115 i < pvec.nr && ({ sp = pvec.page[i].sp; 1;}); \ 1121 i < pvec.nr && ({ sp = pvec.page[i].sp; 1;}); \
1116 i = mmu_pages_next(&pvec, &parents, i)) 1122 i = mmu_pages_next(&pvec, &parents, i))
1117 1123
1118int mmu_pages_next(struct kvm_mmu_pages *pvec, struct mmu_page_path *parents, 1124static int mmu_pages_next(struct kvm_mmu_pages *pvec,
1119 int i) 1125 struct mmu_page_path *parents,
1126 int i)
1120{ 1127{
1121 int n; 1128 int n;
1122 1129
@@ -1135,7 +1142,7 @@ int mmu_pages_next(struct kvm_mmu_pages *pvec, struct mmu_page_path *parents,
1135 return n; 1142 return n;
1136} 1143}
1137 1144
1138void mmu_pages_clear_parents(struct mmu_page_path *parents) 1145static void mmu_pages_clear_parents(struct mmu_page_path *parents)
1139{ 1146{
1140 struct kvm_mmu_page *sp; 1147 struct kvm_mmu_page *sp;
1141 unsigned int level = 0; 1148 unsigned int level = 0;
@@ -1193,7 +1200,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1193 gfn_t gfn, 1200 gfn_t gfn,
1194 gva_t gaddr, 1201 gva_t gaddr,
1195 unsigned level, 1202 unsigned level,
1196 int metaphysical, 1203 int direct,
1197 unsigned access, 1204 unsigned access,
1198 u64 *parent_pte) 1205 u64 *parent_pte)
1199{ 1206{
@@ -1204,10 +1211,9 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1204 struct kvm_mmu_page *sp; 1211 struct kvm_mmu_page *sp;
1205 struct hlist_node *node, *tmp; 1212 struct hlist_node *node, *tmp;
1206 1213
1207 role.word = 0; 1214 role = vcpu->arch.mmu.base_role;
1208 role.glevels = vcpu->arch.mmu.root_level;
1209 role.level = level; 1215 role.level = level;
1210 role.metaphysical = metaphysical; 1216 role.direct = direct;
1211 role.access = access; 1217 role.access = access;
1212 if (vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) { 1218 if (vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) {
1213 quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level)); 1219 quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level));
@@ -1242,8 +1248,9 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1242 pgprintk("%s: adding gfn %lx role %x\n", __func__, gfn, role.word); 1248 pgprintk("%s: adding gfn %lx role %x\n", __func__, gfn, role.word);
1243 sp->gfn = gfn; 1249 sp->gfn = gfn;
1244 sp->role = role; 1250 sp->role = role;
1251 sp->global = role.cr4_pge;
1245 hlist_add_head(&sp->hash_link, bucket); 1252 hlist_add_head(&sp->hash_link, bucket);
1246 if (!metaphysical) { 1253 if (!direct) {
1247 if (rmap_write_protect(vcpu->kvm, gfn)) 1254 if (rmap_write_protect(vcpu->kvm, gfn))
1248 kvm_flush_remote_tlbs(vcpu->kvm); 1255 kvm_flush_remote_tlbs(vcpu->kvm);
1249 account_shadowed(vcpu->kvm, gfn); 1256 account_shadowed(vcpu->kvm, gfn);
@@ -1255,35 +1262,35 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1255 return sp; 1262 return sp;
1256} 1263}
1257 1264
1258static int walk_shadow(struct kvm_shadow_walk *walker, 1265static void shadow_walk_init(struct kvm_shadow_walk_iterator *iterator,
1259 struct kvm_vcpu *vcpu, u64 addr) 1266 struct kvm_vcpu *vcpu, u64 addr)
1260{ 1267{
1261 hpa_t shadow_addr; 1268 iterator->addr = addr;
1262 int level; 1269 iterator->shadow_addr = vcpu->arch.mmu.root_hpa;
1263 int r; 1270 iterator->level = vcpu->arch.mmu.shadow_root_level;
1264 u64 *sptep; 1271 if (iterator->level == PT32E_ROOT_LEVEL) {
1265 unsigned index; 1272 iterator->shadow_addr
1266 1273 = vcpu->arch.mmu.pae_root[(addr >> 30) & 3];
1267 shadow_addr = vcpu->arch.mmu.root_hpa; 1274 iterator->shadow_addr &= PT64_BASE_ADDR_MASK;
1268 level = vcpu->arch.mmu.shadow_root_level; 1275 --iterator->level;
1269 if (level == PT32E_ROOT_LEVEL) { 1276 if (!iterator->shadow_addr)
1270 shadow_addr = vcpu->arch.mmu.pae_root[(addr >> 30) & 3]; 1277 iterator->level = 0;
1271 shadow_addr &= PT64_BASE_ADDR_MASK;
1272 if (!shadow_addr)
1273 return 1;
1274 --level;
1275 } 1278 }
1279}
1276 1280
1277 while (level >= PT_PAGE_TABLE_LEVEL) { 1281static bool shadow_walk_okay(struct kvm_shadow_walk_iterator *iterator)
1278 index = SHADOW_PT_INDEX(addr, level); 1282{
1279 sptep = ((u64 *)__va(shadow_addr)) + index; 1283 if (iterator->level < PT_PAGE_TABLE_LEVEL)
1280 r = walker->entry(walker, vcpu, addr, sptep, level); 1284 return false;
1281 if (r) 1285 iterator->index = SHADOW_PT_INDEX(iterator->addr, iterator->level);
1282 return r; 1286 iterator->sptep = ((u64 *)__va(iterator->shadow_addr)) + iterator->index;
1283 shadow_addr = *sptep & PT64_BASE_ADDR_MASK; 1287 return true;
1284 --level; 1288}
1285 } 1289
1286 return 0; 1290static void shadow_walk_next(struct kvm_shadow_walk_iterator *iterator)
1291{
1292 iterator->shadow_addr = *iterator->sptep & PT64_BASE_ADDR_MASK;
1293 --iterator->level;
1287} 1294}
1288 1295
1289static void kvm_mmu_page_unlink_children(struct kvm *kvm, 1296static void kvm_mmu_page_unlink_children(struct kvm *kvm,
@@ -1388,7 +1395,7 @@ static int kvm_mmu_zap_page(struct kvm *kvm, struct kvm_mmu_page *sp)
1388 kvm_mmu_page_unlink_children(kvm, sp); 1395 kvm_mmu_page_unlink_children(kvm, sp);
1389 kvm_mmu_unlink_parents(kvm, sp); 1396 kvm_mmu_unlink_parents(kvm, sp);
1390 kvm_flush_remote_tlbs(kvm); 1397 kvm_flush_remote_tlbs(kvm);
1391 if (!sp->role.invalid && !sp->role.metaphysical) 1398 if (!sp->role.invalid && !sp->role.direct)
1392 unaccount_shadowed(kvm, sp->gfn); 1399 unaccount_shadowed(kvm, sp->gfn);
1393 if (sp->unsync) 1400 if (sp->unsync)
1394 kvm_unlink_unsync_page(kvm, sp); 1401 kvm_unlink_unsync_page(kvm, sp);
@@ -1451,7 +1458,7 @@ static int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn)
1451 index = kvm_page_table_hashfn(gfn); 1458 index = kvm_page_table_hashfn(gfn);
1452 bucket = &kvm->arch.mmu_page_hash[index]; 1459 bucket = &kvm->arch.mmu_page_hash[index];
1453 hlist_for_each_entry_safe(sp, node, n, bucket, hash_link) 1460 hlist_for_each_entry_safe(sp, node, n, bucket, hash_link)
1454 if (sp->gfn == gfn && !sp->role.metaphysical) { 1461 if (sp->gfn == gfn && !sp->role.direct) {
1455 pgprintk("%s: gfn %lx role %x\n", __func__, gfn, 1462 pgprintk("%s: gfn %lx role %x\n", __func__, gfn,
1456 sp->role.word); 1463 sp->role.word);
1457 r = 1; 1464 r = 1;
@@ -1463,11 +1470,20 @@ static int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn)
1463 1470
1464static void mmu_unshadow(struct kvm *kvm, gfn_t gfn) 1471static void mmu_unshadow(struct kvm *kvm, gfn_t gfn)
1465{ 1472{
1473 unsigned index;
1474 struct hlist_head *bucket;
1466 struct kvm_mmu_page *sp; 1475 struct kvm_mmu_page *sp;
1476 struct hlist_node *node, *nn;
1467 1477
1468 while ((sp = kvm_mmu_lookup_page(kvm, gfn)) != NULL) { 1478 index = kvm_page_table_hashfn(gfn);
1469 pgprintk("%s: zap %lx %x\n", __func__, gfn, sp->role.word); 1479 bucket = &kvm->arch.mmu_page_hash[index];
1470 kvm_mmu_zap_page(kvm, sp); 1480 hlist_for_each_entry_safe(sp, node, nn, bucket, hash_link) {
1481 if (sp->gfn == gfn && !sp->role.direct
1482 && !sp->role.invalid) {
1483 pgprintk("%s: zap %lx %x\n",
1484 __func__, gfn, sp->role.word);
1485 kvm_mmu_zap_page(kvm, sp);
1486 }
1471 } 1487 }
1472} 1488}
1473 1489
@@ -1622,7 +1638,7 @@ static int kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1622 bucket = &vcpu->kvm->arch.mmu_page_hash[index]; 1638 bucket = &vcpu->kvm->arch.mmu_page_hash[index];
1623 /* don't unsync if pagetable is shadowed with multiple roles */ 1639 /* don't unsync if pagetable is shadowed with multiple roles */
1624 hlist_for_each_entry_safe(s, node, n, bucket, hash_link) { 1640 hlist_for_each_entry_safe(s, node, n, bucket, hash_link) {
1625 if (s->gfn != sp->gfn || s->role.metaphysical) 1641 if (s->gfn != sp->gfn || s->role.direct)
1626 continue; 1642 continue;
1627 if (s->role.word != sp->role.word) 1643 if (s->role.word != sp->role.word)
1628 return 1; 1644 return 1;
@@ -1669,8 +1685,6 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1669 u64 mt_mask = shadow_mt_mask; 1685 u64 mt_mask = shadow_mt_mask;
1670 struct kvm_mmu_page *sp = page_header(__pa(shadow_pte)); 1686 struct kvm_mmu_page *sp = page_header(__pa(shadow_pte));
1671 1687
1672 if (!(vcpu->arch.cr4 & X86_CR4_PGE))
1673 global = 0;
1674 if (!global && sp->global) { 1688 if (!global && sp->global) {
1675 sp->global = 0; 1689 sp->global = 0;
1676 if (sp->unsync) { 1690 if (sp->unsync) {
@@ -1777,12 +1791,8 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1777 pgprintk("hfn old %lx new %lx\n", 1791 pgprintk("hfn old %lx new %lx\n",
1778 spte_to_pfn(*shadow_pte), pfn); 1792 spte_to_pfn(*shadow_pte), pfn);
1779 rmap_remove(vcpu->kvm, shadow_pte); 1793 rmap_remove(vcpu->kvm, shadow_pte);
1780 } else { 1794 } else
1781 if (largepage) 1795 was_rmapped = 1;
1782 was_rmapped = is_large_pte(*shadow_pte);
1783 else
1784 was_rmapped = 1;
1785 }
1786 } 1796 }
1787 if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault, 1797 if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault,
1788 dirty, largepage, global, gfn, pfn, speculative, true)) { 1798 dirty, largepage, global, gfn, pfn, speculative, true)) {
@@ -1820,67 +1830,42 @@ static void nonpaging_new_cr3(struct kvm_vcpu *vcpu)
1820{ 1830{
1821} 1831}
1822 1832
1823struct direct_shadow_walk { 1833static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
1824 struct kvm_shadow_walk walker; 1834 int largepage, gfn_t gfn, pfn_t pfn)
1825 pfn_t pfn;
1826 int write;
1827 int largepage;
1828 int pt_write;
1829};
1830
1831static int direct_map_entry(struct kvm_shadow_walk *_walk,
1832 struct kvm_vcpu *vcpu,
1833 u64 addr, u64 *sptep, int level)
1834{ 1835{
1835 struct direct_shadow_walk *walk = 1836 struct kvm_shadow_walk_iterator iterator;
1836 container_of(_walk, struct direct_shadow_walk, walker);
1837 struct kvm_mmu_page *sp; 1837 struct kvm_mmu_page *sp;
1838 int pt_write = 0;
1838 gfn_t pseudo_gfn; 1839 gfn_t pseudo_gfn;
1839 gfn_t gfn = addr >> PAGE_SHIFT;
1840
1841 if (level == PT_PAGE_TABLE_LEVEL
1842 || (walk->largepage && level == PT_DIRECTORY_LEVEL)) {
1843 mmu_set_spte(vcpu, sptep, ACC_ALL, ACC_ALL,
1844 0, walk->write, 1, &walk->pt_write,
1845 walk->largepage, 0, gfn, walk->pfn, false);
1846 ++vcpu->stat.pf_fixed;
1847 return 1;
1848 }
1849 1840
1850 if (*sptep == shadow_trap_nonpresent_pte) { 1841 for_each_shadow_entry(vcpu, (u64)gfn << PAGE_SHIFT, iterator) {
1851 pseudo_gfn = (addr & PT64_DIR_BASE_ADDR_MASK) >> PAGE_SHIFT; 1842 if (iterator.level == PT_PAGE_TABLE_LEVEL
1852 sp = kvm_mmu_get_page(vcpu, pseudo_gfn, (gva_t)addr, level - 1, 1843 || (largepage && iterator.level == PT_DIRECTORY_LEVEL)) {
1853 1, ACC_ALL, sptep); 1844 mmu_set_spte(vcpu, iterator.sptep, ACC_ALL, ACC_ALL,
1854 if (!sp) { 1845 0, write, 1, &pt_write,
1855 pgprintk("nonpaging_map: ENOMEM\n"); 1846 largepage, 0, gfn, pfn, false);
1856 kvm_release_pfn_clean(walk->pfn); 1847 ++vcpu->stat.pf_fixed;
1857 return -ENOMEM; 1848 break;
1858 } 1849 }
1859 1850
1860 set_shadow_pte(sptep, 1851 if (*iterator.sptep == shadow_trap_nonpresent_pte) {
1861 __pa(sp->spt) 1852 pseudo_gfn = (iterator.addr & PT64_DIR_BASE_ADDR_MASK) >> PAGE_SHIFT;
1862 | PT_PRESENT_MASK | PT_WRITABLE_MASK 1853 sp = kvm_mmu_get_page(vcpu, pseudo_gfn, iterator.addr,
1863 | shadow_user_mask | shadow_x_mask); 1854 iterator.level - 1,
1864 } 1855 1, ACC_ALL, iterator.sptep);
1865 return 0; 1856 if (!sp) {
1866} 1857 pgprintk("nonpaging_map: ENOMEM\n");
1858 kvm_release_pfn_clean(pfn);
1859 return -ENOMEM;
1860 }
1867 1861
1868static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, 1862 set_shadow_pte(iterator.sptep,
1869 int largepage, gfn_t gfn, pfn_t pfn) 1863 __pa(sp->spt)
1870{ 1864 | PT_PRESENT_MASK | PT_WRITABLE_MASK
1871 int r; 1865 | shadow_user_mask | shadow_x_mask);
1872 struct direct_shadow_walk walker = { 1866 }
1873 .walker = { .entry = direct_map_entry, }, 1867 }
1874 .pfn = pfn, 1868 return pt_write;
1875 .largepage = largepage,
1876 .write = write,
1877 .pt_write = 0,
1878 };
1879
1880 r = walk_shadow(&walker.walker, vcpu, gfn << PAGE_SHIFT);
1881 if (r < 0)
1882 return r;
1883 return walker.pt_write;
1884} 1869}
1885 1870
1886static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn) 1871static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn)
@@ -1962,7 +1947,7 @@ static void mmu_alloc_roots(struct kvm_vcpu *vcpu)
1962 int i; 1947 int i;
1963 gfn_t root_gfn; 1948 gfn_t root_gfn;
1964 struct kvm_mmu_page *sp; 1949 struct kvm_mmu_page *sp;
1965 int metaphysical = 0; 1950 int direct = 0;
1966 1951
1967 root_gfn = vcpu->arch.cr3 >> PAGE_SHIFT; 1952 root_gfn = vcpu->arch.cr3 >> PAGE_SHIFT;
1968 1953
@@ -1971,18 +1956,18 @@ static void mmu_alloc_roots(struct kvm_vcpu *vcpu)
1971 1956
1972 ASSERT(!VALID_PAGE(root)); 1957 ASSERT(!VALID_PAGE(root));
1973 if (tdp_enabled) 1958 if (tdp_enabled)
1974 metaphysical = 1; 1959 direct = 1;
1975 sp = kvm_mmu_get_page(vcpu, root_gfn, 0, 1960 sp = kvm_mmu_get_page(vcpu, root_gfn, 0,
1976 PT64_ROOT_LEVEL, metaphysical, 1961 PT64_ROOT_LEVEL, direct,
1977 ACC_ALL, NULL); 1962 ACC_ALL, NULL);
1978 root = __pa(sp->spt); 1963 root = __pa(sp->spt);
1979 ++sp->root_count; 1964 ++sp->root_count;
1980 vcpu->arch.mmu.root_hpa = root; 1965 vcpu->arch.mmu.root_hpa = root;
1981 return; 1966 return;
1982 } 1967 }
1983 metaphysical = !is_paging(vcpu); 1968 direct = !is_paging(vcpu);
1984 if (tdp_enabled) 1969 if (tdp_enabled)
1985 metaphysical = 1; 1970 direct = 1;
1986 for (i = 0; i < 4; ++i) { 1971 for (i = 0; i < 4; ++i) {
1987 hpa_t root = vcpu->arch.mmu.pae_root[i]; 1972 hpa_t root = vcpu->arch.mmu.pae_root[i];
1988 1973
@@ -1996,7 +1981,7 @@ static void mmu_alloc_roots(struct kvm_vcpu *vcpu)
1996 } else if (vcpu->arch.mmu.root_level == 0) 1981 } else if (vcpu->arch.mmu.root_level == 0)
1997 root_gfn = 0; 1982 root_gfn = 0;
1998 sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30, 1983 sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30,
1999 PT32_ROOT_LEVEL, metaphysical, 1984 PT32_ROOT_LEVEL, direct,
2000 ACC_ALL, NULL); 1985 ACC_ALL, NULL);
2001 root = __pa(sp->spt); 1986 root = __pa(sp->spt);
2002 ++sp->root_count; 1987 ++sp->root_count;
@@ -2251,17 +2236,23 @@ static int init_kvm_tdp_mmu(struct kvm_vcpu *vcpu)
2251 2236
2252static int init_kvm_softmmu(struct kvm_vcpu *vcpu) 2237static int init_kvm_softmmu(struct kvm_vcpu *vcpu)
2253{ 2238{
2239 int r;
2240
2254 ASSERT(vcpu); 2241 ASSERT(vcpu);
2255 ASSERT(!VALID_PAGE(vcpu->arch.mmu.root_hpa)); 2242 ASSERT(!VALID_PAGE(vcpu->arch.mmu.root_hpa));
2256 2243
2257 if (!is_paging(vcpu)) 2244 if (!is_paging(vcpu))
2258 return nonpaging_init_context(vcpu); 2245 r = nonpaging_init_context(vcpu);
2259 else if (is_long_mode(vcpu)) 2246 else if (is_long_mode(vcpu))
2260 return paging64_init_context(vcpu); 2247 r = paging64_init_context(vcpu);
2261 else if (is_pae(vcpu)) 2248 else if (is_pae(vcpu))
2262 return paging32E_init_context(vcpu); 2249 r = paging32E_init_context(vcpu);
2263 else 2250 else
2264 return paging32_init_context(vcpu); 2251 r = paging32_init_context(vcpu);
2252
2253 vcpu->arch.mmu.base_role.glevels = vcpu->arch.mmu.root_level;
2254
2255 return r;
2265} 2256}
2266 2257
2267static int init_kvm_mmu(struct kvm_vcpu *vcpu) 2258static int init_kvm_mmu(struct kvm_vcpu *vcpu)
@@ -2492,7 +2483,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
2492 index = kvm_page_table_hashfn(gfn); 2483 index = kvm_page_table_hashfn(gfn);
2493 bucket = &vcpu->kvm->arch.mmu_page_hash[index]; 2484 bucket = &vcpu->kvm->arch.mmu_page_hash[index];
2494 hlist_for_each_entry_safe(sp, node, n, bucket, hash_link) { 2485 hlist_for_each_entry_safe(sp, node, n, bucket, hash_link) {
2495 if (sp->gfn != gfn || sp->role.metaphysical || sp->role.invalid) 2486 if (sp->gfn != gfn || sp->role.direct || sp->role.invalid)
2496 continue; 2487 continue;
2497 pte_size = sp->role.glevels == PT32_ROOT_LEVEL ? 4 : 8; 2488 pte_size = sp->role.glevels == PT32_ROOT_LEVEL ? 4 : 8;
2498 misaligned = (offset ^ (offset + bytes - 1)) & ~(pte_size - 1); 2489 misaligned = (offset ^ (offset + bytes - 1)) & ~(pte_size - 1);
@@ -3130,7 +3121,7 @@ static void audit_write_protection(struct kvm_vcpu *vcpu)
3130 gfn_t gfn; 3121 gfn_t gfn;
3131 3122
3132 list_for_each_entry(sp, &vcpu->kvm->arch.active_mmu_pages, link) { 3123 list_for_each_entry(sp, &vcpu->kvm->arch.active_mmu_pages, link) {
3133 if (sp->role.metaphysical) 3124 if (sp->role.direct)
3134 continue; 3125 continue;
3135 3126
3136 gfn = unalias_gfn(vcpu->kvm, sp->gfn); 3127 gfn = unalias_gfn(vcpu->kvm, sp->gfn);
diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h
index 258e5d56298e..eaab2145f62b 100644
--- a/arch/x86/kvm/mmu.h
+++ b/arch/x86/kvm/mmu.h
@@ -54,7 +54,7 @@ static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
54static inline int is_long_mode(struct kvm_vcpu *vcpu) 54static inline int is_long_mode(struct kvm_vcpu *vcpu)
55{ 55{
56#ifdef CONFIG_X86_64 56#ifdef CONFIG_X86_64
57 return vcpu->arch.shadow_efer & EFER_LME; 57 return vcpu->arch.shadow_efer & EFER_LMA;
58#else 58#else
59 return 0; 59 return 0;
60#endif 60#endif
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 9fd78b6e17ad..6bd70206c561 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -25,7 +25,6 @@
25#if PTTYPE == 64 25#if PTTYPE == 64
26 #define pt_element_t u64 26 #define pt_element_t u64
27 #define guest_walker guest_walker64 27 #define guest_walker guest_walker64
28 #define shadow_walker shadow_walker64
29 #define FNAME(name) paging##64_##name 28 #define FNAME(name) paging##64_##name
30 #define PT_BASE_ADDR_MASK PT64_BASE_ADDR_MASK 29 #define PT_BASE_ADDR_MASK PT64_BASE_ADDR_MASK
31 #define PT_DIR_BASE_ADDR_MASK PT64_DIR_BASE_ADDR_MASK 30 #define PT_DIR_BASE_ADDR_MASK PT64_DIR_BASE_ADDR_MASK
@@ -42,7 +41,6 @@
42#elif PTTYPE == 32 41#elif PTTYPE == 32
43 #define pt_element_t u32 42 #define pt_element_t u32
44 #define guest_walker guest_walker32 43 #define guest_walker guest_walker32
45 #define shadow_walker shadow_walker32
46 #define FNAME(name) paging##32_##name 44 #define FNAME(name) paging##32_##name
47 #define PT_BASE_ADDR_MASK PT32_BASE_ADDR_MASK 45 #define PT_BASE_ADDR_MASK PT32_BASE_ADDR_MASK
48 #define PT_DIR_BASE_ADDR_MASK PT32_DIR_BASE_ADDR_MASK 46 #define PT_DIR_BASE_ADDR_MASK PT32_DIR_BASE_ADDR_MASK
@@ -73,18 +71,6 @@ struct guest_walker {
73 u32 error_code; 71 u32 error_code;
74}; 72};
75 73
76struct shadow_walker {
77 struct kvm_shadow_walk walker;
78 struct guest_walker *guest_walker;
79 int user_fault;
80 int write_fault;
81 int largepage;
82 int *ptwrite;
83 pfn_t pfn;
84 u64 *sptep;
85 gpa_t pte_gpa;
86};
87
88static gfn_t gpte_to_gfn(pt_element_t gpte) 74static gfn_t gpte_to_gfn(pt_element_t gpte)
89{ 75{
90 return (gpte & PT_BASE_ADDR_MASK) >> PAGE_SHIFT; 76 return (gpte & PT_BASE_ADDR_MASK) >> PAGE_SHIFT;
@@ -283,91 +269,79 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page,
283/* 269/*
284 * Fetch a shadow pte for a specific level in the paging hierarchy. 270 * Fetch a shadow pte for a specific level in the paging hierarchy.
285 */ 271 */
286static int FNAME(shadow_walk_entry)(struct kvm_shadow_walk *_sw, 272static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
287 struct kvm_vcpu *vcpu, u64 addr, 273 struct guest_walker *gw,
288 u64 *sptep, int level) 274 int user_fault, int write_fault, int largepage,
275 int *ptwrite, pfn_t pfn)
289{ 276{
290 struct shadow_walker *sw =
291 container_of(_sw, struct shadow_walker, walker);
292 struct guest_walker *gw = sw->guest_walker;
293 unsigned access = gw->pt_access; 277 unsigned access = gw->pt_access;
294 struct kvm_mmu_page *shadow_page; 278 struct kvm_mmu_page *shadow_page;
295 u64 spte; 279 u64 spte, *sptep;
296 int metaphysical; 280 int direct;
297 gfn_t table_gfn; 281 gfn_t table_gfn;
298 int r; 282 int r;
283 int level;
299 pt_element_t curr_pte; 284 pt_element_t curr_pte;
285 struct kvm_shadow_walk_iterator iterator;
300 286
301 if (level == PT_PAGE_TABLE_LEVEL 287 if (!is_present_pte(gw->ptes[gw->level - 1]))
302 || (sw->largepage && level == PT_DIRECTORY_LEVEL)) { 288 return NULL;
303 mmu_set_spte(vcpu, sptep, access, gw->pte_access & access,
304 sw->user_fault, sw->write_fault,
305 gw->ptes[gw->level-1] & PT_DIRTY_MASK,
306 sw->ptwrite, sw->largepage,
307 gw->ptes[gw->level-1] & PT_GLOBAL_MASK,
308 gw->gfn, sw->pfn, false);
309 sw->sptep = sptep;
310 return 1;
311 }
312 289
313 if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)) 290 for_each_shadow_entry(vcpu, addr, iterator) {
314 return 0; 291 level = iterator.level;
292 sptep = iterator.sptep;
293 if (level == PT_PAGE_TABLE_LEVEL
294 || (largepage && level == PT_DIRECTORY_LEVEL)) {
295 mmu_set_spte(vcpu, sptep, access,
296 gw->pte_access & access,
297 user_fault, write_fault,
298 gw->ptes[gw->level-1] & PT_DIRTY_MASK,
299 ptwrite, largepage,
300 gw->ptes[gw->level-1] & PT_GLOBAL_MASK,
301 gw->gfn, pfn, false);
302 break;
303 }
315 304
316 if (is_large_pte(*sptep)) { 305 if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep))
317 set_shadow_pte(sptep, shadow_trap_nonpresent_pte); 306 continue;
318 kvm_flush_remote_tlbs(vcpu->kvm);
319 rmap_remove(vcpu->kvm, sptep);
320 }
321 307
322 if (level == PT_DIRECTORY_LEVEL && gw->level == PT_DIRECTORY_LEVEL) { 308 if (is_large_pte(*sptep)) {
323 metaphysical = 1; 309 rmap_remove(vcpu->kvm, sptep);
324 if (!is_dirty_pte(gw->ptes[level - 1])) 310 set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
325 access &= ~ACC_WRITE_MASK; 311 kvm_flush_remote_tlbs(vcpu->kvm);
326 table_gfn = gpte_to_gfn(gw->ptes[level - 1]);
327 } else {
328 metaphysical = 0;
329 table_gfn = gw->table_gfn[level - 2];
330 }
331 shadow_page = kvm_mmu_get_page(vcpu, table_gfn, (gva_t)addr, level-1,
332 metaphysical, access, sptep);
333 if (!metaphysical) {
334 r = kvm_read_guest_atomic(vcpu->kvm, gw->pte_gpa[level - 2],
335 &curr_pte, sizeof(curr_pte));
336 if (r || curr_pte != gw->ptes[level - 2]) {
337 kvm_mmu_put_page(shadow_page, sptep);
338 kvm_release_pfn_clean(sw->pfn);
339 sw->sptep = NULL;
340 return 1;
341 } 312 }
342 }
343 313
344 spte = __pa(shadow_page->spt) | PT_PRESENT_MASK | PT_ACCESSED_MASK 314 if (level == PT_DIRECTORY_LEVEL
345 | PT_WRITABLE_MASK | PT_USER_MASK; 315 && gw->level == PT_DIRECTORY_LEVEL) {
346 *sptep = spte; 316 direct = 1;
347 return 0; 317 if (!is_dirty_pte(gw->ptes[level - 1]))
348} 318 access &= ~ACC_WRITE_MASK;
349 319 table_gfn = gpte_to_gfn(gw->ptes[level - 1]);
350static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, 320 } else {
351 struct guest_walker *guest_walker, 321 direct = 0;
352 int user_fault, int write_fault, int largepage, 322 table_gfn = gw->table_gfn[level - 2];
353 int *ptwrite, pfn_t pfn) 323 }
354{ 324 shadow_page = kvm_mmu_get_page(vcpu, table_gfn, addr, level-1,
355 struct shadow_walker walker = { 325 direct, access, sptep);
356 .walker = { .entry = FNAME(shadow_walk_entry), }, 326 if (!direct) {
357 .guest_walker = guest_walker, 327 r = kvm_read_guest_atomic(vcpu->kvm,
358 .user_fault = user_fault, 328 gw->pte_gpa[level - 2],
359 .write_fault = write_fault, 329 &curr_pte, sizeof(curr_pte));
360 .largepage = largepage, 330 if (r || curr_pte != gw->ptes[level - 2]) {
361 .ptwrite = ptwrite, 331 kvm_mmu_put_page(shadow_page, sptep);
362 .pfn = pfn, 332 kvm_release_pfn_clean(pfn);
363 }; 333 sptep = NULL;
364 334 break;
365 if (!is_present_pte(guest_walker->ptes[guest_walker->level - 1])) 335 }
366 return NULL; 336 }
367 337
368 walk_shadow(&walker.walker, vcpu, addr); 338 spte = __pa(shadow_page->spt)
339 | PT_PRESENT_MASK | PT_ACCESSED_MASK
340 | PT_WRITABLE_MASK | PT_USER_MASK;
341 *sptep = spte;
342 }
369 343
370 return walker.sptep; 344 return sptep;
371} 345}
372 346
373/* 347/*
@@ -465,54 +439,56 @@ out_unlock:
465 return 0; 439 return 0;
466} 440}
467 441
468static int FNAME(shadow_invlpg_entry)(struct kvm_shadow_walk *_sw, 442static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
469 struct kvm_vcpu *vcpu, u64 addr,
470 u64 *sptep, int level)
471{ 443{
472 struct shadow_walker *sw = 444 struct kvm_shadow_walk_iterator iterator;
473 container_of(_sw, struct shadow_walker, walker); 445 pt_element_t gpte;
474 446 gpa_t pte_gpa = -1;
475 /* FIXME: properly handle invlpg on large guest pages */ 447 int level;
476 if (level == PT_PAGE_TABLE_LEVEL || 448 u64 *sptep;
477 ((level == PT_DIRECTORY_LEVEL) && is_large_pte(*sptep))) { 449 int need_flush = 0;
478 struct kvm_mmu_page *sp = page_header(__pa(sptep));
479 450
480 sw->pte_gpa = (sp->gfn << PAGE_SHIFT); 451 spin_lock(&vcpu->kvm->mmu_lock);
481 sw->pte_gpa += (sptep - sp->spt) * sizeof(pt_element_t);
482 452
483 if (is_shadow_present_pte(*sptep)) { 453 for_each_shadow_entry(vcpu, gva, iterator) {
484 rmap_remove(vcpu->kvm, sptep); 454 level = iterator.level;
485 if (is_large_pte(*sptep)) 455 sptep = iterator.sptep;
486 --vcpu->kvm->stat.lpages; 456
457 /* FIXME: properly handle invlpg on large guest pages */
458 if (level == PT_PAGE_TABLE_LEVEL ||
459 ((level == PT_DIRECTORY_LEVEL) && is_large_pte(*sptep))) {
460 struct kvm_mmu_page *sp = page_header(__pa(sptep));
461
462 pte_gpa = (sp->gfn << PAGE_SHIFT);
463 pte_gpa += (sptep - sp->spt) * sizeof(pt_element_t);
464
465 if (is_shadow_present_pte(*sptep)) {
466 rmap_remove(vcpu->kvm, sptep);
467 if (is_large_pte(*sptep))
468 --vcpu->kvm->stat.lpages;
469 need_flush = 1;
470 }
471 set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
472 break;
487 } 473 }
488 set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
489 return 1;
490 }
491 if (!is_shadow_present_pte(*sptep))
492 return 1;
493 return 0;
494}
495 474
496static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva) 475 if (!is_shadow_present_pte(*sptep))
497{ 476 break;
498 pt_element_t gpte; 477 }
499 struct shadow_walker walker = {
500 .walker = { .entry = FNAME(shadow_invlpg_entry), },
501 .pte_gpa = -1,
502 };
503 478
504 spin_lock(&vcpu->kvm->mmu_lock); 479 if (need_flush)
505 walk_shadow(&walker.walker, vcpu, gva); 480 kvm_flush_remote_tlbs(vcpu->kvm);
506 spin_unlock(&vcpu->kvm->mmu_lock); 481 spin_unlock(&vcpu->kvm->mmu_lock);
507 if (walker.pte_gpa == -1) 482
483 if (pte_gpa == -1)
508 return; 484 return;
509 if (kvm_read_guest_atomic(vcpu->kvm, walker.pte_gpa, &gpte, 485 if (kvm_read_guest_atomic(vcpu->kvm, pte_gpa, &gpte,
510 sizeof(pt_element_t))) 486 sizeof(pt_element_t)))
511 return; 487 return;
512 if (is_present_pte(gpte) && (gpte & PT_ACCESSED_MASK)) { 488 if (is_present_pte(gpte) && (gpte & PT_ACCESSED_MASK)) {
513 if (mmu_topup_memory_caches(vcpu)) 489 if (mmu_topup_memory_caches(vcpu))
514 return; 490 return;
515 kvm_mmu_pte_write(vcpu, walker.pte_gpa, (const u8 *)&gpte, 491 kvm_mmu_pte_write(vcpu, pte_gpa, (const u8 *)&gpte,
516 sizeof(pt_element_t), 0); 492 sizeof(pt_element_t), 0);
517 } 493 }
518} 494}
@@ -540,7 +516,7 @@ static void FNAME(prefetch_page)(struct kvm_vcpu *vcpu,
540 pt_element_t pt[256 / sizeof(pt_element_t)]; 516 pt_element_t pt[256 / sizeof(pt_element_t)];
541 gpa_t pte_gpa; 517 gpa_t pte_gpa;
542 518
543 if (sp->role.metaphysical 519 if (sp->role.direct
544 || (PTTYPE == 32 && sp->role.level > PT_PAGE_TABLE_LEVEL)) { 520 || (PTTYPE == 32 && sp->role.level > PT_PAGE_TABLE_LEVEL)) {
545 nonpaging_prefetch_page(vcpu, sp); 521 nonpaging_prefetch_page(vcpu, sp);
546 return; 522 return;
@@ -619,7 +595,6 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
619 595
620#undef pt_element_t 596#undef pt_element_t
621#undef guest_walker 597#undef guest_walker
622#undef shadow_walker
623#undef FNAME 598#undef FNAME
624#undef PT_BASE_ADDR_MASK 599#undef PT_BASE_ADDR_MASK
625#undef PT_INDEX 600#undef PT_INDEX
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index a9e769e4e251..1821c2078199 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -38,9 +38,6 @@ MODULE_LICENSE("GPL");
38#define IOPM_ALLOC_ORDER 2 38#define IOPM_ALLOC_ORDER 2
39#define MSRPM_ALLOC_ORDER 1 39#define MSRPM_ALLOC_ORDER 1
40 40
41#define DR7_GD_MASK (1 << 13)
42#define DR6_BD_MASK (1 << 13)
43
44#define SEG_TYPE_LDT 2 41#define SEG_TYPE_LDT 2
45#define SEG_TYPE_BUSY_TSS16 3 42#define SEG_TYPE_BUSY_TSS16 3
46 43
@@ -50,6 +47,15 @@ MODULE_LICENSE("GPL");
50 47
51#define DEBUGCTL_RESERVED_BITS (~(0x3fULL)) 48#define DEBUGCTL_RESERVED_BITS (~(0x3fULL))
52 49
50/* Turn on to get debugging output*/
51/* #define NESTED_DEBUG */
52
53#ifdef NESTED_DEBUG
54#define nsvm_printk(fmt, args...) printk(KERN_INFO fmt, ## args)
55#else
56#define nsvm_printk(fmt, args...) do {} while(0)
57#endif
58
53/* enable NPT for AMD64 and X86 with PAE */ 59/* enable NPT for AMD64 and X86 with PAE */
54#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) 60#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
55static bool npt_enabled = true; 61static bool npt_enabled = true;
@@ -60,14 +66,29 @@ static int npt = 1;
60 66
61module_param(npt, int, S_IRUGO); 67module_param(npt, int, S_IRUGO);
62 68
69static int nested = 0;
70module_param(nested, int, S_IRUGO);
71
63static void kvm_reput_irq(struct vcpu_svm *svm); 72static void kvm_reput_irq(struct vcpu_svm *svm);
64static void svm_flush_tlb(struct kvm_vcpu *vcpu); 73static void svm_flush_tlb(struct kvm_vcpu *vcpu);
65 74
75static int nested_svm_exit_handled(struct vcpu_svm *svm, bool kvm_override);
76static int nested_svm_vmexit(struct vcpu_svm *svm);
77static int nested_svm_vmsave(struct vcpu_svm *svm, void *nested_vmcb,
78 void *arg2, void *opaque);
79static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
80 bool has_error_code, u32 error_code);
81
66static inline struct vcpu_svm *to_svm(struct kvm_vcpu *vcpu) 82static inline struct vcpu_svm *to_svm(struct kvm_vcpu *vcpu)
67{ 83{
68 return container_of(vcpu, struct vcpu_svm, vcpu); 84 return container_of(vcpu, struct vcpu_svm, vcpu);
69} 85}
70 86
87static inline bool is_nested(struct vcpu_svm *svm)
88{
89 return svm->nested_vmcb;
90}
91
71static unsigned long iopm_base; 92static unsigned long iopm_base;
72 93
73struct kvm_ldttss_desc { 94struct kvm_ldttss_desc {
@@ -157,32 +178,6 @@ static inline void kvm_write_cr2(unsigned long val)
157 asm volatile ("mov %0, %%cr2" :: "r" (val)); 178 asm volatile ("mov %0, %%cr2" :: "r" (val));
158} 179}
159 180
160static inline unsigned long read_dr6(void)
161{
162 unsigned long dr6;
163
164 asm volatile ("mov %%dr6, %0" : "=r" (dr6));
165 return dr6;
166}
167
168static inline void write_dr6(unsigned long val)
169{
170 asm volatile ("mov %0, %%dr6" :: "r" (val));
171}
172
173static inline unsigned long read_dr7(void)
174{
175 unsigned long dr7;
176
177 asm volatile ("mov %%dr7, %0" : "=r" (dr7));
178 return dr7;
179}
180
181static inline void write_dr7(unsigned long val)
182{
183 asm volatile ("mov %0, %%dr7" :: "r" (val));
184}
185
186static inline void force_new_asid(struct kvm_vcpu *vcpu) 181static inline void force_new_asid(struct kvm_vcpu *vcpu)
187{ 182{
188 to_svm(vcpu)->asid_generation--; 183 to_svm(vcpu)->asid_generation--;
@@ -198,7 +193,7 @@ static void svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
198 if (!npt_enabled && !(efer & EFER_LMA)) 193 if (!npt_enabled && !(efer & EFER_LMA))
199 efer &= ~EFER_LME; 194 efer &= ~EFER_LME;
200 195
201 to_svm(vcpu)->vmcb->save.efer = efer | MSR_EFER_SVME_MASK; 196 to_svm(vcpu)->vmcb->save.efer = efer | EFER_SVME;
202 vcpu->arch.shadow_efer = efer; 197 vcpu->arch.shadow_efer = efer;
203} 198}
204 199
@@ -207,6 +202,11 @@ static void svm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr,
207{ 202{
208 struct vcpu_svm *svm = to_svm(vcpu); 203 struct vcpu_svm *svm = to_svm(vcpu);
209 204
205 /* If we are within a nested VM we'd better #VMEXIT and let the
206 guest handle the exception */
207 if (nested_svm_check_exception(svm, nr, has_error_code, error_code))
208 return;
209
210 svm->vmcb->control.event_inj = nr 210 svm->vmcb->control.event_inj = nr
211 | SVM_EVTINJ_VALID 211 | SVM_EVTINJ_VALID
212 | (has_error_code ? SVM_EVTINJ_VALID_ERR : 0) 212 | (has_error_code ? SVM_EVTINJ_VALID_ERR : 0)
@@ -242,7 +242,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
242 kvm_rip_write(vcpu, svm->next_rip); 242 kvm_rip_write(vcpu, svm->next_rip);
243 svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; 243 svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK;
244 244
245 vcpu->arch.interrupt_window_open = 1; 245 vcpu->arch.interrupt_window_open = (svm->vcpu.arch.hflags & HF_GIF_MASK);
246} 246}
247 247
248static int has_svm(void) 248static int has_svm(void)
@@ -250,7 +250,7 @@ static int has_svm(void)
250 const char *msg; 250 const char *msg;
251 251
252 if (!cpu_has_svm(&msg)) { 252 if (!cpu_has_svm(&msg)) {
253 printk(KERN_INFO "has_svn: %s\n", msg); 253 printk(KERN_INFO "has_svm: %s\n", msg);
254 return 0; 254 return 0;
255 } 255 }
256 256
@@ -292,7 +292,7 @@ static void svm_hardware_enable(void *garbage)
292 svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); 292 svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS);
293 293
294 rdmsrl(MSR_EFER, efer); 294 rdmsrl(MSR_EFER, efer);
295 wrmsrl(MSR_EFER, efer | MSR_EFER_SVME_MASK); 295 wrmsrl(MSR_EFER, efer | EFER_SVME);
296 296
297 wrmsrl(MSR_VM_HSAVE_PA, 297 wrmsrl(MSR_VM_HSAVE_PA,
298 page_to_pfn(svm_data->save_area) << PAGE_SHIFT); 298 page_to_pfn(svm_data->save_area) << PAGE_SHIFT);
@@ -417,6 +417,14 @@ static __init int svm_hardware_setup(void)
417 if (boot_cpu_has(X86_FEATURE_NX)) 417 if (boot_cpu_has(X86_FEATURE_NX))
418 kvm_enable_efer_bits(EFER_NX); 418 kvm_enable_efer_bits(EFER_NX);
419 419
420 if (boot_cpu_has(X86_FEATURE_FXSR_OPT))
421 kvm_enable_efer_bits(EFER_FFXSR);
422
423 if (nested) {
424 printk(KERN_INFO "kvm: Nested Virtualization enabled\n");
425 kvm_enable_efer_bits(EFER_SVME);
426 }
427
420 for_each_online_cpu(cpu) { 428 for_each_online_cpu(cpu) {
421 r = svm_cpu_init(cpu); 429 r = svm_cpu_init(cpu);
422 if (r) 430 if (r)
@@ -559,7 +567,7 @@ static void init_vmcb(struct vcpu_svm *svm)
559 init_sys_seg(&save->ldtr, SEG_TYPE_LDT); 567 init_sys_seg(&save->ldtr, SEG_TYPE_LDT);
560 init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16); 568 init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16);
561 569
562 save->efer = MSR_EFER_SVME_MASK; 570 save->efer = EFER_SVME;
563 save->dr6 = 0xffff0ff0; 571 save->dr6 = 0xffff0ff0;
564 save->dr7 = 0x400; 572 save->dr7 = 0x400;
565 save->rflags = 2; 573 save->rflags = 2;
@@ -591,6 +599,9 @@ static void init_vmcb(struct vcpu_svm *svm)
591 save->cr4 = 0; 599 save->cr4 = 0;
592 } 600 }
593 force_new_asid(&svm->vcpu); 601 force_new_asid(&svm->vcpu);
602
603 svm->nested_vmcb = 0;
604 svm->vcpu.arch.hflags = HF_GIF_MASK;
594} 605}
595 606
596static int svm_vcpu_reset(struct kvm_vcpu *vcpu) 607static int svm_vcpu_reset(struct kvm_vcpu *vcpu)
@@ -615,6 +626,8 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
615 struct vcpu_svm *svm; 626 struct vcpu_svm *svm;
616 struct page *page; 627 struct page *page;
617 struct page *msrpm_pages; 628 struct page *msrpm_pages;
629 struct page *hsave_page;
630 struct page *nested_msrpm_pages;
618 int err; 631 int err;
619 632
620 svm = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL); 633 svm = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
@@ -637,14 +650,25 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
637 msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER); 650 msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER);
638 if (!msrpm_pages) 651 if (!msrpm_pages)
639 goto uninit; 652 goto uninit;
653
654 nested_msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER);
655 if (!nested_msrpm_pages)
656 goto uninit;
657
640 svm->msrpm = page_address(msrpm_pages); 658 svm->msrpm = page_address(msrpm_pages);
641 svm_vcpu_init_msrpm(svm->msrpm); 659 svm_vcpu_init_msrpm(svm->msrpm);
642 660
661 hsave_page = alloc_page(GFP_KERNEL);
662 if (!hsave_page)
663 goto uninit;
664 svm->hsave = page_address(hsave_page);
665
666 svm->nested_msrpm = page_address(nested_msrpm_pages);
667
643 svm->vmcb = page_address(page); 668 svm->vmcb = page_address(page);
644 clear_page(svm->vmcb); 669 clear_page(svm->vmcb);
645 svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT; 670 svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT;
646 svm->asid_generation = 0; 671 svm->asid_generation = 0;
647 memset(svm->db_regs, 0, sizeof(svm->db_regs));
648 init_vmcb(svm); 672 init_vmcb(svm);
649 673
650 fx_init(&svm->vcpu); 674 fx_init(&svm->vcpu);
@@ -669,6 +693,8 @@ static void svm_free_vcpu(struct kvm_vcpu *vcpu)
669 693
670 __free_page(pfn_to_page(svm->vmcb_pa >> PAGE_SHIFT)); 694 __free_page(pfn_to_page(svm->vmcb_pa >> PAGE_SHIFT));
671 __free_pages(virt_to_page(svm->msrpm), MSRPM_ALLOC_ORDER); 695 __free_pages(virt_to_page(svm->msrpm), MSRPM_ALLOC_ORDER);
696 __free_page(virt_to_page(svm->hsave));
697 __free_pages(virt_to_page(svm->nested_msrpm), MSRPM_ALLOC_ORDER);
672 kvm_vcpu_uninit(vcpu); 698 kvm_vcpu_uninit(vcpu);
673 kmem_cache_free(kvm_vcpu_cache, svm); 699 kmem_cache_free(kvm_vcpu_cache, svm);
674} 700}
@@ -718,6 +744,16 @@ static void svm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags)
718 to_svm(vcpu)->vmcb->save.rflags = rflags; 744 to_svm(vcpu)->vmcb->save.rflags = rflags;
719} 745}
720 746
747static void svm_set_vintr(struct vcpu_svm *svm)
748{
749 svm->vmcb->control.intercept |= 1ULL << INTERCEPT_VINTR;
750}
751
752static void svm_clear_vintr(struct vcpu_svm *svm)
753{
754 svm->vmcb->control.intercept &= ~(1ULL << INTERCEPT_VINTR);
755}
756
721static struct vmcb_seg *svm_seg(struct kvm_vcpu *vcpu, int seg) 757static struct vmcb_seg *svm_seg(struct kvm_vcpu *vcpu, int seg)
722{ 758{
723 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save; 759 struct vmcb_save_area *save = &to_svm(vcpu)->vmcb->save;
@@ -760,20 +796,37 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
760 var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; 796 var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1;
761 var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1; 797 var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1;
762 798
763 /* 799 switch (seg) {
764 * SVM always stores 0 for the 'G' bit in the CS selector in 800 case VCPU_SREG_CS:
765 * the VMCB on a VMEXIT. This hurts cross-vendor migration: 801 /*
766 * Intel's VMENTRY has a check on the 'G' bit. 802 * SVM always stores 0 for the 'G' bit in the CS selector in
767 */ 803 * the VMCB on a VMEXIT. This hurts cross-vendor migration:
768 if (seg == VCPU_SREG_CS) 804 * Intel's VMENTRY has a check on the 'G' bit.
805 */
769 var->g = s->limit > 0xfffff; 806 var->g = s->limit > 0xfffff;
770 807 break;
771 /* 808 case VCPU_SREG_TR:
772 * Work around a bug where the busy flag in the tr selector 809 /*
773 * isn't exposed 810 * Work around a bug where the busy flag in the tr selector
774 */ 811 * isn't exposed
775 if (seg == VCPU_SREG_TR) 812 */
776 var->type |= 0x2; 813 var->type |= 0x2;
814 break;
815 case VCPU_SREG_DS:
816 case VCPU_SREG_ES:
817 case VCPU_SREG_FS:
818 case VCPU_SREG_GS:
819 /*
820 * The accessed bit must always be set in the segment
821 * descriptor cache, although it can be cleared in the
822 * descriptor, the cached bit always remains at 1. Since
823 * Intel has a check on this, set it here to support
824 * cross-vendor migration.
825 */
826 if (!var->unusable)
827 var->type |= 0x1;
828 break;
829 }
777 830
778 var->unusable = !var->present; 831 var->unusable = !var->present;
779} 832}
@@ -905,9 +958,37 @@ static void svm_set_segment(struct kvm_vcpu *vcpu,
905 958
906} 959}
907 960
908static int svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_debug_guest *dbg) 961static int svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
909{ 962{
910 return -EOPNOTSUPP; 963 int old_debug = vcpu->guest_debug;
964 struct vcpu_svm *svm = to_svm(vcpu);
965
966 vcpu->guest_debug = dbg->control;
967
968 svm->vmcb->control.intercept_exceptions &=
969 ~((1 << DB_VECTOR) | (1 << BP_VECTOR));
970 if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) {
971 if (vcpu->guest_debug &
972 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))
973 svm->vmcb->control.intercept_exceptions |=
974 1 << DB_VECTOR;
975 if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP)
976 svm->vmcb->control.intercept_exceptions |=
977 1 << BP_VECTOR;
978 } else
979 vcpu->guest_debug = 0;
980
981 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
982 svm->vmcb->save.dr7 = dbg->arch.debugreg[7];
983 else
984 svm->vmcb->save.dr7 = vcpu->arch.dr7;
985
986 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
987 svm->vmcb->save.rflags |= X86_EFLAGS_TF | X86_EFLAGS_RF;
988 else if (old_debug & KVM_GUESTDBG_SINGLESTEP)
989 svm->vmcb->save.rflags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF);
990
991 return 0;
911} 992}
912 993
913static int svm_get_irq(struct kvm_vcpu *vcpu) 994static int svm_get_irq(struct kvm_vcpu *vcpu)
@@ -949,7 +1030,29 @@ static void new_asid(struct vcpu_svm *svm, struct svm_cpu_data *svm_data)
949 1030
950static unsigned long svm_get_dr(struct kvm_vcpu *vcpu, int dr) 1031static unsigned long svm_get_dr(struct kvm_vcpu *vcpu, int dr)
951{ 1032{
952 unsigned long val = to_svm(vcpu)->db_regs[dr]; 1033 struct vcpu_svm *svm = to_svm(vcpu);
1034 unsigned long val;
1035
1036 switch (dr) {
1037 case 0 ... 3:
1038 val = vcpu->arch.db[dr];
1039 break;
1040 case 6:
1041 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
1042 val = vcpu->arch.dr6;
1043 else
1044 val = svm->vmcb->save.dr6;
1045 break;
1046 case 7:
1047 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
1048 val = vcpu->arch.dr7;
1049 else
1050 val = svm->vmcb->save.dr7;
1051 break;
1052 default:
1053 val = 0;
1054 }
1055
953 KVMTRACE_2D(DR_READ, vcpu, (u32)dr, (u32)val, handler); 1056 KVMTRACE_2D(DR_READ, vcpu, (u32)dr, (u32)val, handler);
954 return val; 1057 return val;
955} 1058}
@@ -959,33 +1062,40 @@ static void svm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long value,
959{ 1062{
960 struct vcpu_svm *svm = to_svm(vcpu); 1063 struct vcpu_svm *svm = to_svm(vcpu);
961 1064
962 *exception = 0; 1065 KVMTRACE_2D(DR_WRITE, vcpu, (u32)dr, (u32)value, handler);
963 1066
964 if (svm->vmcb->save.dr7 & DR7_GD_MASK) { 1067 *exception = 0;
965 svm->vmcb->save.dr7 &= ~DR7_GD_MASK;
966 svm->vmcb->save.dr6 |= DR6_BD_MASK;
967 *exception = DB_VECTOR;
968 return;
969 }
970 1068
971 switch (dr) { 1069 switch (dr) {
972 case 0 ... 3: 1070 case 0 ... 3:
973 svm->db_regs[dr] = value; 1071 vcpu->arch.db[dr] = value;
1072 if (!(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP))
1073 vcpu->arch.eff_db[dr] = value;
974 return; 1074 return;
975 case 4 ... 5: 1075 case 4 ... 5:
976 if (vcpu->arch.cr4 & X86_CR4_DE) { 1076 if (vcpu->arch.cr4 & X86_CR4_DE)
977 *exception = UD_VECTOR; 1077 *exception = UD_VECTOR;
1078 return;
1079 case 6:
1080 if (value & 0xffffffff00000000ULL) {
1081 *exception = GP_VECTOR;
978 return; 1082 return;
979 } 1083 }
980 case 7: { 1084 vcpu->arch.dr6 = (value & DR6_VOLATILE) | DR6_FIXED_1;
981 if (value & ~((1ULL << 32) - 1)) { 1085 return;
1086 case 7:
1087 if (value & 0xffffffff00000000ULL) {
982 *exception = GP_VECTOR; 1088 *exception = GP_VECTOR;
983 return; 1089 return;
984 } 1090 }
985 svm->vmcb->save.dr7 = value; 1091 vcpu->arch.dr7 = (value & DR7_VOLATILE) | DR7_FIXED_1;
1092 if (!(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)) {
1093 svm->vmcb->save.dr7 = vcpu->arch.dr7;
1094 vcpu->arch.switch_db_regs = (value & DR7_BP_EN_MASK);
1095 }
986 return; 1096 return;
987 }
988 default: 1097 default:
1098 /* FIXME: Possible case? */
989 printk(KERN_DEBUG "%s: unexpected dr %u\n", 1099 printk(KERN_DEBUG "%s: unexpected dr %u\n",
990 __func__, dr); 1100 __func__, dr);
991 *exception = UD_VECTOR; 1101 *exception = UD_VECTOR;
@@ -1031,6 +1141,27 @@ static int pf_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1031 return kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code); 1141 return kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code);
1032} 1142}
1033 1143
1144static int db_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1145{
1146 if (!(svm->vcpu.guest_debug &
1147 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) {
1148 kvm_queue_exception(&svm->vcpu, DB_VECTOR);
1149 return 1;
1150 }
1151 kvm_run->exit_reason = KVM_EXIT_DEBUG;
1152 kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip;
1153 kvm_run->debug.arch.exception = DB_VECTOR;
1154 return 0;
1155}
1156
1157static int bp_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1158{
1159 kvm_run->exit_reason = KVM_EXIT_DEBUG;
1160 kvm_run->debug.arch.pc = svm->vmcb->save.cs.base + svm->vmcb->save.rip;
1161 kvm_run->debug.arch.exception = BP_VECTOR;
1162 return 0;
1163}
1164
1034static int ud_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1165static int ud_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1035{ 1166{
1036 int er; 1167 int er;
@@ -1080,7 +1211,7 @@ static int shutdown_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1080static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1211static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1081{ 1212{
1082 u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */ 1213 u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */
1083 int size, down, in, string, rep; 1214 int size, in, string;
1084 unsigned port; 1215 unsigned port;
1085 1216
1086 ++svm->vcpu.stat.io_exits; 1217 ++svm->vcpu.stat.io_exits;
@@ -1099,8 +1230,6 @@ static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1099 in = (io_info & SVM_IOIO_TYPE_MASK) != 0; 1230 in = (io_info & SVM_IOIO_TYPE_MASK) != 0;
1100 port = io_info >> 16; 1231 port = io_info >> 16;
1101 size = (io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT; 1232 size = (io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT;
1102 rep = (io_info & SVM_IOIO_REP_MASK) != 0;
1103 down = (svm->vmcb->save.rflags & X86_EFLAGS_DF) != 0;
1104 1233
1105 skip_emulated_instruction(&svm->vcpu); 1234 skip_emulated_instruction(&svm->vcpu);
1106 return kvm_emulate_pio(&svm->vcpu, kvm_run, in, size, port); 1235 return kvm_emulate_pio(&svm->vcpu, kvm_run, in, size, port);
@@ -1139,6 +1268,567 @@ static int vmmcall_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1139 return 1; 1268 return 1;
1140} 1269}
1141 1270
1271static int nested_svm_check_permissions(struct vcpu_svm *svm)
1272{
1273 if (!(svm->vcpu.arch.shadow_efer & EFER_SVME)
1274 || !is_paging(&svm->vcpu)) {
1275 kvm_queue_exception(&svm->vcpu, UD_VECTOR);
1276 return 1;
1277 }
1278
1279 if (svm->vmcb->save.cpl) {
1280 kvm_inject_gp(&svm->vcpu, 0);
1281 return 1;
1282 }
1283
1284 return 0;
1285}
1286
1287static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
1288 bool has_error_code, u32 error_code)
1289{
1290 if (is_nested(svm)) {
1291 svm->vmcb->control.exit_code = SVM_EXIT_EXCP_BASE + nr;
1292 svm->vmcb->control.exit_code_hi = 0;
1293 svm->vmcb->control.exit_info_1 = error_code;
1294 svm->vmcb->control.exit_info_2 = svm->vcpu.arch.cr2;
1295 if (nested_svm_exit_handled(svm, false)) {
1296 nsvm_printk("VMexit -> EXCP 0x%x\n", nr);
1297
1298 nested_svm_vmexit(svm);
1299 return 1;
1300 }
1301 }
1302
1303 return 0;
1304}
1305
1306static inline int nested_svm_intr(struct vcpu_svm *svm)
1307{
1308 if (is_nested(svm)) {
1309 if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK))
1310 return 0;
1311
1312 if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
1313 return 0;
1314
1315 svm->vmcb->control.exit_code = SVM_EXIT_INTR;
1316
1317 if (nested_svm_exit_handled(svm, false)) {
1318 nsvm_printk("VMexit -> INTR\n");
1319 nested_svm_vmexit(svm);
1320 return 1;
1321 }
1322 }
1323
1324 return 0;
1325}
1326
1327static struct page *nested_svm_get_page(struct vcpu_svm *svm, u64 gpa)
1328{
1329 struct page *page;
1330
1331 down_read(&current->mm->mmap_sem);
1332 page = gfn_to_page(svm->vcpu.kvm, gpa >> PAGE_SHIFT);
1333 up_read(&current->mm->mmap_sem);
1334
1335 if (is_error_page(page)) {
1336 printk(KERN_INFO "%s: could not find page at 0x%llx\n",
1337 __func__, gpa);
1338 kvm_release_page_clean(page);
1339 kvm_inject_gp(&svm->vcpu, 0);
1340 return NULL;
1341 }
1342 return page;
1343}
1344
1345static int nested_svm_do(struct vcpu_svm *svm,
1346 u64 arg1_gpa, u64 arg2_gpa, void *opaque,
1347 int (*handler)(struct vcpu_svm *svm,
1348 void *arg1,
1349 void *arg2,
1350 void *opaque))
1351{
1352 struct page *arg1_page;
1353 struct page *arg2_page = NULL;
1354 void *arg1;
1355 void *arg2 = NULL;
1356 int retval;
1357
1358 arg1_page = nested_svm_get_page(svm, arg1_gpa);
1359 if(arg1_page == NULL)
1360 return 1;
1361
1362 if (arg2_gpa) {
1363 arg2_page = nested_svm_get_page(svm, arg2_gpa);
1364 if(arg2_page == NULL) {
1365 kvm_release_page_clean(arg1_page);
1366 return 1;
1367 }
1368 }
1369
1370 arg1 = kmap_atomic(arg1_page, KM_USER0);
1371 if (arg2_gpa)
1372 arg2 = kmap_atomic(arg2_page, KM_USER1);
1373
1374 retval = handler(svm, arg1, arg2, opaque);
1375
1376 kunmap_atomic(arg1, KM_USER0);
1377 if (arg2_gpa)
1378 kunmap_atomic(arg2, KM_USER1);
1379
1380 kvm_release_page_dirty(arg1_page);
1381 if (arg2_gpa)
1382 kvm_release_page_dirty(arg2_page);
1383
1384 return retval;
1385}
1386
1387static int nested_svm_exit_handled_real(struct vcpu_svm *svm,
1388 void *arg1,
1389 void *arg2,
1390 void *opaque)
1391{
1392 struct vmcb *nested_vmcb = (struct vmcb *)arg1;
1393 bool kvm_overrides = *(bool *)opaque;
1394 u32 exit_code = svm->vmcb->control.exit_code;
1395
1396 if (kvm_overrides) {
1397 switch (exit_code) {
1398 case SVM_EXIT_INTR:
1399 case SVM_EXIT_NMI:
1400 return 0;
1401 /* For now we are always handling NPFs when using them */
1402 case SVM_EXIT_NPF:
1403 if (npt_enabled)
1404 return 0;
1405 break;
1406 /* When we're shadowing, trap PFs */
1407 case SVM_EXIT_EXCP_BASE + PF_VECTOR:
1408 if (!npt_enabled)
1409 return 0;
1410 break;
1411 default:
1412 break;
1413 }
1414 }
1415
1416 switch (exit_code) {
1417 case SVM_EXIT_READ_CR0 ... SVM_EXIT_READ_CR8: {
1418 u32 cr_bits = 1 << (exit_code - SVM_EXIT_READ_CR0);
1419 if (nested_vmcb->control.intercept_cr_read & cr_bits)
1420 return 1;
1421 break;
1422 }
1423 case SVM_EXIT_WRITE_CR0 ... SVM_EXIT_WRITE_CR8: {
1424 u32 cr_bits = 1 << (exit_code - SVM_EXIT_WRITE_CR0);
1425 if (nested_vmcb->control.intercept_cr_write & cr_bits)
1426 return 1;
1427 break;
1428 }
1429 case SVM_EXIT_READ_DR0 ... SVM_EXIT_READ_DR7: {
1430 u32 dr_bits = 1 << (exit_code - SVM_EXIT_READ_DR0);
1431 if (nested_vmcb->control.intercept_dr_read & dr_bits)
1432 return 1;
1433 break;
1434 }
1435 case SVM_EXIT_WRITE_DR0 ... SVM_EXIT_WRITE_DR7: {
1436 u32 dr_bits = 1 << (exit_code - SVM_EXIT_WRITE_DR0);
1437 if (nested_vmcb->control.intercept_dr_write & dr_bits)
1438 return 1;
1439 break;
1440 }
1441 case SVM_EXIT_EXCP_BASE ... SVM_EXIT_EXCP_BASE + 0x1f: {
1442 u32 excp_bits = 1 << (exit_code - SVM_EXIT_EXCP_BASE);
1443 if (nested_vmcb->control.intercept_exceptions & excp_bits)
1444 return 1;
1445 break;
1446 }
1447 default: {
1448 u64 exit_bits = 1ULL << (exit_code - SVM_EXIT_INTR);
1449 nsvm_printk("exit code: 0x%x\n", exit_code);
1450 if (nested_vmcb->control.intercept & exit_bits)
1451 return 1;
1452 }
1453 }
1454
1455 return 0;
1456}
1457
1458static int nested_svm_exit_handled_msr(struct vcpu_svm *svm,
1459 void *arg1, void *arg2,
1460 void *opaque)
1461{
1462 struct vmcb *nested_vmcb = (struct vmcb *)arg1;
1463 u8 *msrpm = (u8 *)arg2;
1464 u32 t0, t1;
1465 u32 msr = svm->vcpu.arch.regs[VCPU_REGS_RCX];
1466 u32 param = svm->vmcb->control.exit_info_1 & 1;
1467
1468 if (!(nested_vmcb->control.intercept & (1ULL << INTERCEPT_MSR_PROT)))
1469 return 0;
1470
1471 switch(msr) {
1472 case 0 ... 0x1fff:
1473 t0 = (msr * 2) % 8;
1474 t1 = msr / 8;
1475 break;
1476 case 0xc0000000 ... 0xc0001fff:
1477 t0 = (8192 + msr - 0xc0000000) * 2;
1478 t1 = (t0 / 8);
1479 t0 %= 8;
1480 break;
1481 case 0xc0010000 ... 0xc0011fff:
1482 t0 = (16384 + msr - 0xc0010000) * 2;
1483 t1 = (t0 / 8);
1484 t0 %= 8;
1485 break;
1486 default:
1487 return 1;
1488 break;
1489 }
1490 if (msrpm[t1] & ((1 << param) << t0))
1491 return 1;
1492
1493 return 0;
1494}
1495
1496static int nested_svm_exit_handled(struct vcpu_svm *svm, bool kvm_override)
1497{
1498 bool k = kvm_override;
1499
1500 switch (svm->vmcb->control.exit_code) {
1501 case SVM_EXIT_MSR:
1502 return nested_svm_do(svm, svm->nested_vmcb,
1503 svm->nested_vmcb_msrpm, NULL,
1504 nested_svm_exit_handled_msr);
1505 default: break;
1506 }
1507
1508 return nested_svm_do(svm, svm->nested_vmcb, 0, &k,
1509 nested_svm_exit_handled_real);
1510}
1511
1512static int nested_svm_vmexit_real(struct vcpu_svm *svm, void *arg1,
1513 void *arg2, void *opaque)
1514{
1515 struct vmcb *nested_vmcb = (struct vmcb *)arg1;
1516 struct vmcb *hsave = svm->hsave;
1517 u64 nested_save[] = { nested_vmcb->save.cr0,
1518 nested_vmcb->save.cr3,
1519 nested_vmcb->save.cr4,
1520 nested_vmcb->save.efer,
1521 nested_vmcb->control.intercept_cr_read,
1522 nested_vmcb->control.intercept_cr_write,
1523 nested_vmcb->control.intercept_dr_read,
1524 nested_vmcb->control.intercept_dr_write,
1525 nested_vmcb->control.intercept_exceptions,
1526 nested_vmcb->control.intercept,
1527 nested_vmcb->control.msrpm_base_pa,
1528 nested_vmcb->control.iopm_base_pa,
1529 nested_vmcb->control.tsc_offset };
1530
1531 /* Give the current vmcb to the guest */
1532 memcpy(nested_vmcb, svm->vmcb, sizeof(struct vmcb));
1533 nested_vmcb->save.cr0 = nested_save[0];
1534 if (!npt_enabled)
1535 nested_vmcb->save.cr3 = nested_save[1];
1536 nested_vmcb->save.cr4 = nested_save[2];
1537 nested_vmcb->save.efer = nested_save[3];
1538 nested_vmcb->control.intercept_cr_read = nested_save[4];
1539 nested_vmcb->control.intercept_cr_write = nested_save[5];
1540 nested_vmcb->control.intercept_dr_read = nested_save[6];
1541 nested_vmcb->control.intercept_dr_write = nested_save[7];
1542 nested_vmcb->control.intercept_exceptions = nested_save[8];
1543 nested_vmcb->control.intercept = nested_save[9];
1544 nested_vmcb->control.msrpm_base_pa = nested_save[10];
1545 nested_vmcb->control.iopm_base_pa = nested_save[11];
1546 nested_vmcb->control.tsc_offset = nested_save[12];
1547
1548 /* We always set V_INTR_MASKING and remember the old value in hflags */
1549 if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK))
1550 nested_vmcb->control.int_ctl &= ~V_INTR_MASKING_MASK;
1551
1552 if ((nested_vmcb->control.int_ctl & V_IRQ_MASK) &&
1553 (nested_vmcb->control.int_vector)) {
1554 nsvm_printk("WARNING: IRQ 0x%x still enabled on #VMEXIT\n",
1555 nested_vmcb->control.int_vector);
1556 }
1557
1558 /* Restore the original control entries */
1559 svm->vmcb->control = hsave->control;
1560
1561 /* Kill any pending exceptions */
1562 if (svm->vcpu.arch.exception.pending == true)
1563 nsvm_printk("WARNING: Pending Exception\n");
1564 svm->vcpu.arch.exception.pending = false;
1565
1566 /* Restore selected save entries */
1567 svm->vmcb->save.es = hsave->save.es;
1568 svm->vmcb->save.cs = hsave->save.cs;
1569 svm->vmcb->save.ss = hsave->save.ss;
1570 svm->vmcb->save.ds = hsave->save.ds;
1571 svm->vmcb->save.gdtr = hsave->save.gdtr;
1572 svm->vmcb->save.idtr = hsave->save.idtr;
1573 svm->vmcb->save.rflags = hsave->save.rflags;
1574 svm_set_efer(&svm->vcpu, hsave->save.efer);
1575 svm_set_cr0(&svm->vcpu, hsave->save.cr0 | X86_CR0_PE);
1576 svm_set_cr4(&svm->vcpu, hsave->save.cr4);
1577 if (npt_enabled) {
1578 svm->vmcb->save.cr3 = hsave->save.cr3;
1579 svm->vcpu.arch.cr3 = hsave->save.cr3;
1580 } else {
1581 kvm_set_cr3(&svm->vcpu, hsave->save.cr3);
1582 }
1583 kvm_register_write(&svm->vcpu, VCPU_REGS_RAX, hsave->save.rax);
1584 kvm_register_write(&svm->vcpu, VCPU_REGS_RSP, hsave->save.rsp);
1585 kvm_register_write(&svm->vcpu, VCPU_REGS_RIP, hsave->save.rip);
1586 svm->vmcb->save.dr7 = 0;
1587 svm->vmcb->save.cpl = 0;
1588 svm->vmcb->control.exit_int_info = 0;
1589
1590 svm->vcpu.arch.hflags &= ~HF_GIF_MASK;
1591 /* Exit nested SVM mode */
1592 svm->nested_vmcb = 0;
1593
1594 return 0;
1595}
1596
1597static int nested_svm_vmexit(struct vcpu_svm *svm)
1598{
1599 nsvm_printk("VMexit\n");
1600 if (nested_svm_do(svm, svm->nested_vmcb, 0,
1601 NULL, nested_svm_vmexit_real))
1602 return 1;
1603
1604 kvm_mmu_reset_context(&svm->vcpu);
1605 kvm_mmu_load(&svm->vcpu);
1606
1607 return 0;
1608}
1609
1610static int nested_svm_vmrun_msrpm(struct vcpu_svm *svm, void *arg1,
1611 void *arg2, void *opaque)
1612{
1613 int i;
1614 u32 *nested_msrpm = (u32*)arg1;
1615 for (i=0; i< PAGE_SIZE * (1 << MSRPM_ALLOC_ORDER) / 4; i++)
1616 svm->nested_msrpm[i] = svm->msrpm[i] | nested_msrpm[i];
1617 svm->vmcb->control.msrpm_base_pa = __pa(svm->nested_msrpm);
1618
1619 return 0;
1620}
1621
1622static int nested_svm_vmrun(struct vcpu_svm *svm, void *arg1,
1623 void *arg2, void *opaque)
1624{
1625 struct vmcb *nested_vmcb = (struct vmcb *)arg1;
1626 struct vmcb *hsave = svm->hsave;
1627
1628 /* nested_vmcb is our indicator if nested SVM is activated */
1629 svm->nested_vmcb = svm->vmcb->save.rax;
1630
1631 /* Clear internal status */
1632 svm->vcpu.arch.exception.pending = false;
1633
1634 /* Save the old vmcb, so we don't need to pick what we save, but
1635 can restore everything when a VMEXIT occurs */
1636 memcpy(hsave, svm->vmcb, sizeof(struct vmcb));
1637 /* We need to remember the original CR3 in the SPT case */
1638 if (!npt_enabled)
1639 hsave->save.cr3 = svm->vcpu.arch.cr3;
1640 hsave->save.cr4 = svm->vcpu.arch.cr4;
1641 hsave->save.rip = svm->next_rip;
1642
1643 if (svm->vmcb->save.rflags & X86_EFLAGS_IF)
1644 svm->vcpu.arch.hflags |= HF_HIF_MASK;
1645 else
1646 svm->vcpu.arch.hflags &= ~HF_HIF_MASK;
1647
1648 /* Load the nested guest state */
1649 svm->vmcb->save.es = nested_vmcb->save.es;
1650 svm->vmcb->save.cs = nested_vmcb->save.cs;
1651 svm->vmcb->save.ss = nested_vmcb->save.ss;
1652 svm->vmcb->save.ds = nested_vmcb->save.ds;
1653 svm->vmcb->save.gdtr = nested_vmcb->save.gdtr;
1654 svm->vmcb->save.idtr = nested_vmcb->save.idtr;
1655 svm->vmcb->save.rflags = nested_vmcb->save.rflags;
1656 svm_set_efer(&svm->vcpu, nested_vmcb->save.efer);
1657 svm_set_cr0(&svm->vcpu, nested_vmcb->save.cr0);
1658 svm_set_cr4(&svm->vcpu, nested_vmcb->save.cr4);
1659 if (npt_enabled) {
1660 svm->vmcb->save.cr3 = nested_vmcb->save.cr3;
1661 svm->vcpu.arch.cr3 = nested_vmcb->save.cr3;
1662 } else {
1663 kvm_set_cr3(&svm->vcpu, nested_vmcb->save.cr3);
1664 kvm_mmu_reset_context(&svm->vcpu);
1665 }
1666 svm->vmcb->save.cr2 = nested_vmcb->save.cr2;
1667 kvm_register_write(&svm->vcpu, VCPU_REGS_RAX, nested_vmcb->save.rax);
1668 kvm_register_write(&svm->vcpu, VCPU_REGS_RSP, nested_vmcb->save.rsp);
1669 kvm_register_write(&svm->vcpu, VCPU_REGS_RIP, nested_vmcb->save.rip);
1670 /* In case we don't even reach vcpu_run, the fields are not updated */
1671 svm->vmcb->save.rax = nested_vmcb->save.rax;
1672 svm->vmcb->save.rsp = nested_vmcb->save.rsp;
1673 svm->vmcb->save.rip = nested_vmcb->save.rip;
1674 svm->vmcb->save.dr7 = nested_vmcb->save.dr7;
1675 svm->vmcb->save.dr6 = nested_vmcb->save.dr6;
1676 svm->vmcb->save.cpl = nested_vmcb->save.cpl;
1677
1678 /* We don't want a nested guest to be more powerful than the guest,
1679 so all intercepts are ORed */
1680 svm->vmcb->control.intercept_cr_read |=
1681 nested_vmcb->control.intercept_cr_read;
1682 svm->vmcb->control.intercept_cr_write |=
1683 nested_vmcb->control.intercept_cr_write;
1684 svm->vmcb->control.intercept_dr_read |=
1685 nested_vmcb->control.intercept_dr_read;
1686 svm->vmcb->control.intercept_dr_write |=
1687 nested_vmcb->control.intercept_dr_write;
1688 svm->vmcb->control.intercept_exceptions |=
1689 nested_vmcb->control.intercept_exceptions;
1690
1691 svm->vmcb->control.intercept |= nested_vmcb->control.intercept;
1692
1693 svm->nested_vmcb_msrpm = nested_vmcb->control.msrpm_base_pa;
1694
1695 force_new_asid(&svm->vcpu);
1696 svm->vmcb->control.exit_int_info = nested_vmcb->control.exit_int_info;
1697 svm->vmcb->control.exit_int_info_err = nested_vmcb->control.exit_int_info_err;
1698 svm->vmcb->control.int_ctl = nested_vmcb->control.int_ctl | V_INTR_MASKING_MASK;
1699 if (nested_vmcb->control.int_ctl & V_IRQ_MASK) {
1700 nsvm_printk("nSVM Injecting Interrupt: 0x%x\n",
1701 nested_vmcb->control.int_ctl);
1702 }
1703 if (nested_vmcb->control.int_ctl & V_INTR_MASKING_MASK)
1704 svm->vcpu.arch.hflags |= HF_VINTR_MASK;
1705 else
1706 svm->vcpu.arch.hflags &= ~HF_VINTR_MASK;
1707
1708 nsvm_printk("nSVM exit_int_info: 0x%x | int_state: 0x%x\n",
1709 nested_vmcb->control.exit_int_info,
1710 nested_vmcb->control.int_state);
1711
1712 svm->vmcb->control.int_vector = nested_vmcb->control.int_vector;
1713 svm->vmcb->control.int_state = nested_vmcb->control.int_state;
1714 svm->vmcb->control.tsc_offset += nested_vmcb->control.tsc_offset;
1715 if (nested_vmcb->control.event_inj & SVM_EVTINJ_VALID)
1716 nsvm_printk("Injecting Event: 0x%x\n",
1717 nested_vmcb->control.event_inj);
1718 svm->vmcb->control.event_inj = nested_vmcb->control.event_inj;
1719 svm->vmcb->control.event_inj_err = nested_vmcb->control.event_inj_err;
1720
1721 svm->vcpu.arch.hflags |= HF_GIF_MASK;
1722
1723 return 0;
1724}
1725
1726static int nested_svm_vmloadsave(struct vmcb *from_vmcb, struct vmcb *to_vmcb)
1727{
1728 to_vmcb->save.fs = from_vmcb->save.fs;
1729 to_vmcb->save.gs = from_vmcb->save.gs;
1730 to_vmcb->save.tr = from_vmcb->save.tr;
1731 to_vmcb->save.ldtr = from_vmcb->save.ldtr;
1732 to_vmcb->save.kernel_gs_base = from_vmcb->save.kernel_gs_base;
1733 to_vmcb->save.star = from_vmcb->save.star;
1734 to_vmcb->save.lstar = from_vmcb->save.lstar;
1735 to_vmcb->save.cstar = from_vmcb->save.cstar;
1736 to_vmcb->save.sfmask = from_vmcb->save.sfmask;
1737 to_vmcb->save.sysenter_cs = from_vmcb->save.sysenter_cs;
1738 to_vmcb->save.sysenter_esp = from_vmcb->save.sysenter_esp;
1739 to_vmcb->save.sysenter_eip = from_vmcb->save.sysenter_eip;
1740
1741 return 1;
1742}
1743
1744static int nested_svm_vmload(struct vcpu_svm *svm, void *nested_vmcb,
1745 void *arg2, void *opaque)
1746{
1747 return nested_svm_vmloadsave((struct vmcb *)nested_vmcb, svm->vmcb);
1748}
1749
1750static int nested_svm_vmsave(struct vcpu_svm *svm, void *nested_vmcb,
1751 void *arg2, void *opaque)
1752{
1753 return nested_svm_vmloadsave(svm->vmcb, (struct vmcb *)nested_vmcb);
1754}
1755
1756static int vmload_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1757{
1758 if (nested_svm_check_permissions(svm))
1759 return 1;
1760
1761 svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
1762 skip_emulated_instruction(&svm->vcpu);
1763
1764 nested_svm_do(svm, svm->vmcb->save.rax, 0, NULL, nested_svm_vmload);
1765
1766 return 1;
1767}
1768
1769static int vmsave_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1770{
1771 if (nested_svm_check_permissions(svm))
1772 return 1;
1773
1774 svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
1775 skip_emulated_instruction(&svm->vcpu);
1776
1777 nested_svm_do(svm, svm->vmcb->save.rax, 0, NULL, nested_svm_vmsave);
1778
1779 return 1;
1780}
1781
1782static int vmrun_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1783{
1784 nsvm_printk("VMrun\n");
1785 if (nested_svm_check_permissions(svm))
1786 return 1;
1787
1788 svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
1789 skip_emulated_instruction(&svm->vcpu);
1790
1791 if (nested_svm_do(svm, svm->vmcb->save.rax, 0,
1792 NULL, nested_svm_vmrun))
1793 return 1;
1794
1795 if (nested_svm_do(svm, svm->nested_vmcb_msrpm, 0,
1796 NULL, nested_svm_vmrun_msrpm))
1797 return 1;
1798
1799 return 1;
1800}
1801
1802static int stgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1803{
1804 if (nested_svm_check_permissions(svm))
1805 return 1;
1806
1807 svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
1808 skip_emulated_instruction(&svm->vcpu);
1809
1810 svm->vcpu.arch.hflags |= HF_GIF_MASK;
1811
1812 return 1;
1813}
1814
1815static int clgi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1816{
1817 if (nested_svm_check_permissions(svm))
1818 return 1;
1819
1820 svm->next_rip = kvm_rip_read(&svm->vcpu) + 3;
1821 skip_emulated_instruction(&svm->vcpu);
1822
1823 svm->vcpu.arch.hflags &= ~HF_GIF_MASK;
1824
1825 /* After a CLGI no interrupts should come */
1826 svm_clear_vintr(svm);
1827 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
1828
1829 return 1;
1830}
1831
1142static int invalid_op_interception(struct vcpu_svm *svm, 1832static int invalid_op_interception(struct vcpu_svm *svm,
1143 struct kvm_run *kvm_run) 1833 struct kvm_run *kvm_run)
1144{ 1834{
@@ -1250,6 +1940,15 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
1250 case MSR_IA32_LASTINTTOIP: 1940 case MSR_IA32_LASTINTTOIP:
1251 *data = svm->vmcb->save.last_excp_to; 1941 *data = svm->vmcb->save.last_excp_to;
1252 break; 1942 break;
1943 case MSR_VM_HSAVE_PA:
1944 *data = svm->hsave_msr;
1945 break;
1946 case MSR_VM_CR:
1947 *data = 0;
1948 break;
1949 case MSR_IA32_UCODE_REV:
1950 *data = 0x01000065;
1951 break;
1253 default: 1952 default:
1254 return kvm_get_msr_common(vcpu, ecx, data); 1953 return kvm_get_msr_common(vcpu, ecx, data);
1255 } 1954 }
@@ -1344,6 +2043,9 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
1344 pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 0x%llx\n", ecx, data); 2043 pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 0x%llx\n", ecx, data);
1345 2044
1346 break; 2045 break;
2046 case MSR_VM_HSAVE_PA:
2047 svm->hsave_msr = data;
2048 break;
1347 default: 2049 default:
1348 return kvm_set_msr_common(vcpu, ecx, data); 2050 return kvm_set_msr_common(vcpu, ecx, data);
1349 } 2051 }
@@ -1380,7 +2082,7 @@ static int interrupt_window_interception(struct vcpu_svm *svm,
1380{ 2082{
1381 KVMTRACE_0D(PEND_INTR, &svm->vcpu, handler); 2083 KVMTRACE_0D(PEND_INTR, &svm->vcpu, handler);
1382 2084
1383 svm->vmcb->control.intercept &= ~(1ULL << INTERCEPT_VINTR); 2085 svm_clear_vintr(svm);
1384 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; 2086 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
1385 /* 2087 /*
1386 * If the user space waits to inject interrupts, exit as soon as 2088 * If the user space waits to inject interrupts, exit as soon as
@@ -1417,6 +2119,8 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
1417 [SVM_EXIT_WRITE_DR3] = emulate_on_interception, 2119 [SVM_EXIT_WRITE_DR3] = emulate_on_interception,
1418 [SVM_EXIT_WRITE_DR5] = emulate_on_interception, 2120 [SVM_EXIT_WRITE_DR5] = emulate_on_interception,
1419 [SVM_EXIT_WRITE_DR7] = emulate_on_interception, 2121 [SVM_EXIT_WRITE_DR7] = emulate_on_interception,
2122 [SVM_EXIT_EXCP_BASE + DB_VECTOR] = db_interception,
2123 [SVM_EXIT_EXCP_BASE + BP_VECTOR] = bp_interception,
1420 [SVM_EXIT_EXCP_BASE + UD_VECTOR] = ud_interception, 2124 [SVM_EXIT_EXCP_BASE + UD_VECTOR] = ud_interception,
1421 [SVM_EXIT_EXCP_BASE + PF_VECTOR] = pf_interception, 2125 [SVM_EXIT_EXCP_BASE + PF_VECTOR] = pf_interception,
1422 [SVM_EXIT_EXCP_BASE + NM_VECTOR] = nm_interception, 2126 [SVM_EXIT_EXCP_BASE + NM_VECTOR] = nm_interception,
@@ -1436,12 +2140,12 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm,
1436 [SVM_EXIT_MSR] = msr_interception, 2140 [SVM_EXIT_MSR] = msr_interception,
1437 [SVM_EXIT_TASK_SWITCH] = task_switch_interception, 2141 [SVM_EXIT_TASK_SWITCH] = task_switch_interception,
1438 [SVM_EXIT_SHUTDOWN] = shutdown_interception, 2142 [SVM_EXIT_SHUTDOWN] = shutdown_interception,
1439 [SVM_EXIT_VMRUN] = invalid_op_interception, 2143 [SVM_EXIT_VMRUN] = vmrun_interception,
1440 [SVM_EXIT_VMMCALL] = vmmcall_interception, 2144 [SVM_EXIT_VMMCALL] = vmmcall_interception,
1441 [SVM_EXIT_VMLOAD] = invalid_op_interception, 2145 [SVM_EXIT_VMLOAD] = vmload_interception,
1442 [SVM_EXIT_VMSAVE] = invalid_op_interception, 2146 [SVM_EXIT_VMSAVE] = vmsave_interception,
1443 [SVM_EXIT_STGI] = invalid_op_interception, 2147 [SVM_EXIT_STGI] = stgi_interception,
1444 [SVM_EXIT_CLGI] = invalid_op_interception, 2148 [SVM_EXIT_CLGI] = clgi_interception,
1445 [SVM_EXIT_SKINIT] = invalid_op_interception, 2149 [SVM_EXIT_SKINIT] = invalid_op_interception,
1446 [SVM_EXIT_WBINVD] = emulate_on_interception, 2150 [SVM_EXIT_WBINVD] = emulate_on_interception,
1447 [SVM_EXIT_MONITOR] = invalid_op_interception, 2151 [SVM_EXIT_MONITOR] = invalid_op_interception,
@@ -1457,6 +2161,17 @@ static int handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
1457 KVMTRACE_3D(VMEXIT, vcpu, exit_code, (u32)svm->vmcb->save.rip, 2161 KVMTRACE_3D(VMEXIT, vcpu, exit_code, (u32)svm->vmcb->save.rip,
1458 (u32)((u64)svm->vmcb->save.rip >> 32), entryexit); 2162 (u32)((u64)svm->vmcb->save.rip >> 32), entryexit);
1459 2163
2164 if (is_nested(svm)) {
2165 nsvm_printk("nested handle_exit: 0x%x | 0x%lx | 0x%lx | 0x%lx\n",
2166 exit_code, svm->vmcb->control.exit_info_1,
2167 svm->vmcb->control.exit_info_2, svm->vmcb->save.rip);
2168 if (nested_svm_exit_handled(svm, true)) {
2169 nested_svm_vmexit(svm);
2170 nsvm_printk("-> #VMEXIT\n");
2171 return 1;
2172 }
2173 }
2174
1460 if (npt_enabled) { 2175 if (npt_enabled) {
1461 int mmu_reload = 0; 2176 int mmu_reload = 0;
1462 if ((vcpu->arch.cr0 ^ svm->vmcb->save.cr0) & X86_CR0_PG) { 2177 if ((vcpu->arch.cr0 ^ svm->vmcb->save.cr0) & X86_CR0_PG) {
@@ -1544,6 +2259,8 @@ static void svm_set_irq(struct kvm_vcpu *vcpu, int irq)
1544{ 2259{
1545 struct vcpu_svm *svm = to_svm(vcpu); 2260 struct vcpu_svm *svm = to_svm(vcpu);
1546 2261
2262 nested_svm_intr(svm);
2263
1547 svm_inject_irq(svm, irq); 2264 svm_inject_irq(svm, irq);
1548} 2265}
1549 2266
@@ -1589,11 +2306,17 @@ static void svm_intr_assist(struct kvm_vcpu *vcpu)
1589 if (!kvm_cpu_has_interrupt(vcpu)) 2306 if (!kvm_cpu_has_interrupt(vcpu))
1590 goto out; 2307 goto out;
1591 2308
2309 if (nested_svm_intr(svm))
2310 goto out;
2311
2312 if (!(svm->vcpu.arch.hflags & HF_GIF_MASK))
2313 goto out;
2314
1592 if (!(vmcb->save.rflags & X86_EFLAGS_IF) || 2315 if (!(vmcb->save.rflags & X86_EFLAGS_IF) ||
1593 (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) || 2316 (vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) ||
1594 (vmcb->control.event_inj & SVM_EVTINJ_VALID)) { 2317 (vmcb->control.event_inj & SVM_EVTINJ_VALID)) {
1595 /* unable to deliver irq, set pending irq */ 2318 /* unable to deliver irq, set pending irq */
1596 vmcb->control.intercept |= (1ULL << INTERCEPT_VINTR); 2319 svm_set_vintr(svm);
1597 svm_inject_irq(svm, 0x0); 2320 svm_inject_irq(svm, 0x0);
1598 goto out; 2321 goto out;
1599 } 2322 }
@@ -1615,7 +2338,8 @@ static void kvm_reput_irq(struct vcpu_svm *svm)
1615 } 2338 }
1616 2339
1617 svm->vcpu.arch.interrupt_window_open = 2340 svm->vcpu.arch.interrupt_window_open =
1618 !(control->int_state & SVM_INTERRUPT_SHADOW_MASK); 2341 !(control->int_state & SVM_INTERRUPT_SHADOW_MASK) &&
2342 (svm->vcpu.arch.hflags & HF_GIF_MASK);
1619} 2343}
1620 2344
1621static void svm_do_inject_vector(struct vcpu_svm *svm) 2345static void svm_do_inject_vector(struct vcpu_svm *svm)
@@ -1637,9 +2361,13 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu,
1637 struct vcpu_svm *svm = to_svm(vcpu); 2361 struct vcpu_svm *svm = to_svm(vcpu);
1638 struct vmcb_control_area *control = &svm->vmcb->control; 2362 struct vmcb_control_area *control = &svm->vmcb->control;
1639 2363
2364 if (nested_svm_intr(svm))
2365 return;
2366
1640 svm->vcpu.arch.interrupt_window_open = 2367 svm->vcpu.arch.interrupt_window_open =
1641 (!(control->int_state & SVM_INTERRUPT_SHADOW_MASK) && 2368 (!(control->int_state & SVM_INTERRUPT_SHADOW_MASK) &&
1642 (svm->vmcb->save.rflags & X86_EFLAGS_IF)); 2369 (svm->vmcb->save.rflags & X86_EFLAGS_IF) &&
2370 (svm->vcpu.arch.hflags & HF_GIF_MASK));
1643 2371
1644 if (svm->vcpu.arch.interrupt_window_open && svm->vcpu.arch.irq_summary) 2372 if (svm->vcpu.arch.interrupt_window_open && svm->vcpu.arch.irq_summary)
1645 /* 2373 /*
@@ -1652,9 +2380,9 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu,
1652 */ 2380 */
1653 if (!svm->vcpu.arch.interrupt_window_open && 2381 if (!svm->vcpu.arch.interrupt_window_open &&
1654 (svm->vcpu.arch.irq_summary || kvm_run->request_interrupt_window)) 2382 (svm->vcpu.arch.irq_summary || kvm_run->request_interrupt_window))
1655 control->intercept |= 1ULL << INTERCEPT_VINTR; 2383 svm_set_vintr(svm);
1656 else 2384 else
1657 control->intercept &= ~(1ULL << INTERCEPT_VINTR); 2385 svm_clear_vintr(svm);
1658} 2386}
1659 2387
1660static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr) 2388static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr)
@@ -1662,22 +2390,6 @@ static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr)
1662 return 0; 2390 return 0;
1663} 2391}
1664 2392
1665static void save_db_regs(unsigned long *db_regs)
1666{
1667 asm volatile ("mov %%dr0, %0" : "=r"(db_regs[0]));
1668 asm volatile ("mov %%dr1, %0" : "=r"(db_regs[1]));
1669 asm volatile ("mov %%dr2, %0" : "=r"(db_regs[2]));
1670 asm volatile ("mov %%dr3, %0" : "=r"(db_regs[3]));
1671}
1672
1673static void load_db_regs(unsigned long *db_regs)
1674{
1675 asm volatile ("mov %0, %%dr0" : : "r"(db_regs[0]));
1676 asm volatile ("mov %0, %%dr1" : : "r"(db_regs[1]));
1677 asm volatile ("mov %0, %%dr2" : : "r"(db_regs[2]));
1678 asm volatile ("mov %0, %%dr3" : : "r"(db_regs[3]));
1679}
1680
1681static void svm_flush_tlb(struct kvm_vcpu *vcpu) 2393static void svm_flush_tlb(struct kvm_vcpu *vcpu)
1682{ 2394{
1683 force_new_asid(vcpu); 2395 force_new_asid(vcpu);
@@ -1736,19 +2448,12 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1736 gs_selector = kvm_read_gs(); 2448 gs_selector = kvm_read_gs();
1737 ldt_selector = kvm_read_ldt(); 2449 ldt_selector = kvm_read_ldt();
1738 svm->host_cr2 = kvm_read_cr2(); 2450 svm->host_cr2 = kvm_read_cr2();
1739 svm->host_dr6 = read_dr6(); 2451 if (!is_nested(svm))
1740 svm->host_dr7 = read_dr7(); 2452 svm->vmcb->save.cr2 = vcpu->arch.cr2;
1741 svm->vmcb->save.cr2 = vcpu->arch.cr2;
1742 /* required for live migration with NPT */ 2453 /* required for live migration with NPT */
1743 if (npt_enabled) 2454 if (npt_enabled)
1744 svm->vmcb->save.cr3 = vcpu->arch.cr3; 2455 svm->vmcb->save.cr3 = vcpu->arch.cr3;
1745 2456
1746 if (svm->vmcb->save.dr7 & 0xff) {
1747 write_dr7(0);
1748 save_db_regs(svm->host_db_regs);
1749 load_db_regs(svm->db_regs);
1750 }
1751
1752 clgi(); 2457 clgi();
1753 2458
1754 local_irq_enable(); 2459 local_irq_enable();
@@ -1824,16 +2529,11 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1824#endif 2529#endif
1825 ); 2530 );
1826 2531
1827 if ((svm->vmcb->save.dr7 & 0xff))
1828 load_db_regs(svm->host_db_regs);
1829
1830 vcpu->arch.cr2 = svm->vmcb->save.cr2; 2532 vcpu->arch.cr2 = svm->vmcb->save.cr2;
1831 vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax; 2533 vcpu->arch.regs[VCPU_REGS_RAX] = svm->vmcb->save.rax;
1832 vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp; 2534 vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp;
1833 vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip; 2535 vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip;
1834 2536
1835 write_dr6(svm->host_dr6);
1836 write_dr7(svm->host_dr7);
1837 kvm_write_cr2(svm->host_cr2); 2537 kvm_write_cr2(svm->host_cr2);
1838 2538
1839 kvm_load_fs(fs_selector); 2539 kvm_load_fs(fs_selector);
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 7611af576829..bb481330716f 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -91,6 +91,7 @@ struct vcpu_vmx {
91 } rmode; 91 } rmode;
92 int vpid; 92 int vpid;
93 bool emulation_required; 93 bool emulation_required;
94 enum emulation_result invalid_state_emulation_result;
94 95
95 /* Support for vnmi-less CPUs */ 96 /* Support for vnmi-less CPUs */
96 int soft_vnmi_blocked; 97 int soft_vnmi_blocked;
@@ -189,21 +190,21 @@ static inline int is_page_fault(u32 intr_info)
189{ 190{
190 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK | 191 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
191 INTR_INFO_VALID_MASK)) == 192 INTR_INFO_VALID_MASK)) ==
192 (INTR_TYPE_EXCEPTION | PF_VECTOR | INTR_INFO_VALID_MASK); 193 (INTR_TYPE_HARD_EXCEPTION | PF_VECTOR | INTR_INFO_VALID_MASK);
193} 194}
194 195
195static inline int is_no_device(u32 intr_info) 196static inline int is_no_device(u32 intr_info)
196{ 197{
197 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK | 198 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
198 INTR_INFO_VALID_MASK)) == 199 INTR_INFO_VALID_MASK)) ==
199 (INTR_TYPE_EXCEPTION | NM_VECTOR | INTR_INFO_VALID_MASK); 200 (INTR_TYPE_HARD_EXCEPTION | NM_VECTOR | INTR_INFO_VALID_MASK);
200} 201}
201 202
202static inline int is_invalid_opcode(u32 intr_info) 203static inline int is_invalid_opcode(u32 intr_info)
203{ 204{
204 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK | 205 return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK |
205 INTR_INFO_VALID_MASK)) == 206 INTR_INFO_VALID_MASK)) ==
206 (INTR_TYPE_EXCEPTION | UD_VECTOR | INTR_INFO_VALID_MASK); 207 (INTR_TYPE_HARD_EXCEPTION | UD_VECTOR | INTR_INFO_VALID_MASK);
207} 208}
208 209
209static inline int is_external_interrupt(u32 intr_info) 210static inline int is_external_interrupt(u32 intr_info)
@@ -480,8 +481,13 @@ static void update_exception_bitmap(struct kvm_vcpu *vcpu)
480 eb = (1u << PF_VECTOR) | (1u << UD_VECTOR); 481 eb = (1u << PF_VECTOR) | (1u << UD_VECTOR);
481 if (!vcpu->fpu_active) 482 if (!vcpu->fpu_active)
482 eb |= 1u << NM_VECTOR; 483 eb |= 1u << NM_VECTOR;
483 if (vcpu->guest_debug.enabled) 484 if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) {
484 eb |= 1u << DB_VECTOR; 485 if (vcpu->guest_debug &
486 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))
487 eb |= 1u << DB_VECTOR;
488 if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP)
489 eb |= 1u << BP_VECTOR;
490 }
485 if (vcpu->arch.rmode.active) 491 if (vcpu->arch.rmode.active)
486 eb = ~0; 492 eb = ~0;
487 if (vm_need_ept()) 493 if (vm_need_ept())
@@ -747,29 +753,33 @@ static void vmx_queue_exception(struct kvm_vcpu *vcpu, unsigned nr,
747 bool has_error_code, u32 error_code) 753 bool has_error_code, u32 error_code)
748{ 754{
749 struct vcpu_vmx *vmx = to_vmx(vcpu); 755 struct vcpu_vmx *vmx = to_vmx(vcpu);
756 u32 intr_info = nr | INTR_INFO_VALID_MASK;
750 757
751 if (has_error_code) 758 if (has_error_code) {
752 vmcs_write32(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code); 759 vmcs_write32(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
760 intr_info |= INTR_INFO_DELIVER_CODE_MASK;
761 }
753 762
754 if (vcpu->arch.rmode.active) { 763 if (vcpu->arch.rmode.active) {
755 vmx->rmode.irq.pending = true; 764 vmx->rmode.irq.pending = true;
756 vmx->rmode.irq.vector = nr; 765 vmx->rmode.irq.vector = nr;
757 vmx->rmode.irq.rip = kvm_rip_read(vcpu); 766 vmx->rmode.irq.rip = kvm_rip_read(vcpu);
758 if (nr == BP_VECTOR) 767 if (nr == BP_VECTOR || nr == OF_VECTOR)
759 vmx->rmode.irq.rip++; 768 vmx->rmode.irq.rip++;
760 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 769 intr_info |= INTR_TYPE_SOFT_INTR;
761 nr | INTR_TYPE_SOFT_INTR 770 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, intr_info);
762 | (has_error_code ? INTR_INFO_DELIVER_CODE_MASK : 0)
763 | INTR_INFO_VALID_MASK);
764 vmcs_write32(VM_ENTRY_INSTRUCTION_LEN, 1); 771 vmcs_write32(VM_ENTRY_INSTRUCTION_LEN, 1);
765 kvm_rip_write(vcpu, vmx->rmode.irq.rip - 1); 772 kvm_rip_write(vcpu, vmx->rmode.irq.rip - 1);
766 return; 773 return;
767 } 774 }
768 775
769 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 776 if (nr == BP_VECTOR || nr == OF_VECTOR) {
770 nr | INTR_TYPE_EXCEPTION 777 vmcs_write32(VM_ENTRY_INSTRUCTION_LEN, 1);
771 | (has_error_code ? INTR_INFO_DELIVER_CODE_MASK : 0) 778 intr_info |= INTR_TYPE_SOFT_EXCEPTION;
772 | INTR_INFO_VALID_MASK); 779 } else
780 intr_info |= INTR_TYPE_HARD_EXCEPTION;
781
782 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, intr_info);
773} 783}
774 784
775static bool vmx_exception_injected(struct kvm_vcpu *vcpu) 785static bool vmx_exception_injected(struct kvm_vcpu *vcpu)
@@ -856,11 +866,8 @@ static u64 guest_read_tsc(void)
856 * writes 'guest_tsc' into guest's timestamp counter "register" 866 * writes 'guest_tsc' into guest's timestamp counter "register"
857 * guest_tsc = host_tsc + tsc_offset ==> tsc_offset = guest_tsc - host_tsc 867 * guest_tsc = host_tsc + tsc_offset ==> tsc_offset = guest_tsc - host_tsc
858 */ 868 */
859static void guest_write_tsc(u64 guest_tsc) 869static void guest_write_tsc(u64 guest_tsc, u64 host_tsc)
860{ 870{
861 u64 host_tsc;
862
863 rdtscll(host_tsc);
864 vmcs_write64(TSC_OFFSET, guest_tsc - host_tsc); 871 vmcs_write64(TSC_OFFSET, guest_tsc - host_tsc);
865} 872}
866 873
@@ -925,14 +932,15 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
925{ 932{
926 struct vcpu_vmx *vmx = to_vmx(vcpu); 933 struct vcpu_vmx *vmx = to_vmx(vcpu);
927 struct kvm_msr_entry *msr; 934 struct kvm_msr_entry *msr;
935 u64 host_tsc;
928 int ret = 0; 936 int ret = 0;
929 937
930 switch (msr_index) { 938 switch (msr_index) {
931#ifdef CONFIG_X86_64
932 case MSR_EFER: 939 case MSR_EFER:
933 vmx_load_host_state(vmx); 940 vmx_load_host_state(vmx);
934 ret = kvm_set_msr_common(vcpu, msr_index, data); 941 ret = kvm_set_msr_common(vcpu, msr_index, data);
935 break; 942 break;
943#ifdef CONFIG_X86_64
936 case MSR_FS_BASE: 944 case MSR_FS_BASE:
937 vmcs_writel(GUEST_FS_BASE, data); 945 vmcs_writel(GUEST_FS_BASE, data);
938 break; 946 break;
@@ -950,7 +958,8 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
950 vmcs_writel(GUEST_SYSENTER_ESP, data); 958 vmcs_writel(GUEST_SYSENTER_ESP, data);
951 break; 959 break;
952 case MSR_IA32_TIME_STAMP_COUNTER: 960 case MSR_IA32_TIME_STAMP_COUNTER:
953 guest_write_tsc(data); 961 rdtscll(host_tsc);
962 guest_write_tsc(data, host_tsc);
954 break; 963 break;
955 case MSR_P6_PERFCTR0: 964 case MSR_P6_PERFCTR0:
956 case MSR_P6_PERFCTR1: 965 case MSR_P6_PERFCTR1:
@@ -999,40 +1008,28 @@ static void vmx_cache_reg(struct kvm_vcpu *vcpu, enum kvm_reg reg)
999 } 1008 }
1000} 1009}
1001 1010
1002static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_debug_guest *dbg) 1011static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
1003{ 1012{
1004 unsigned long dr7 = 0x400; 1013 int old_debug = vcpu->guest_debug;
1005 int old_singlestep; 1014 unsigned long flags;
1006
1007 old_singlestep = vcpu->guest_debug.singlestep;
1008
1009 vcpu->guest_debug.enabled = dbg->enabled;
1010 if (vcpu->guest_debug.enabled) {
1011 int i;
1012 1015
1013 dr7 |= 0x200; /* exact */ 1016 vcpu->guest_debug = dbg->control;
1014 for (i = 0; i < 4; ++i) { 1017 if (!(vcpu->guest_debug & KVM_GUESTDBG_ENABLE))
1015 if (!dbg->breakpoints[i].enabled) 1018 vcpu->guest_debug = 0;
1016 continue;
1017 vcpu->guest_debug.bp[i] = dbg->breakpoints[i].address;
1018 dr7 |= 2 << (i*2); /* global enable */
1019 dr7 |= 0 << (i*4+16); /* execution breakpoint */
1020 }
1021 1019
1022 vcpu->guest_debug.singlestep = dbg->singlestep; 1020 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)
1023 } else 1021 vmcs_writel(GUEST_DR7, dbg->arch.debugreg[7]);
1024 vcpu->guest_debug.singlestep = 0; 1022 else
1025 1023 vmcs_writel(GUEST_DR7, vcpu->arch.dr7);
1026 if (old_singlestep && !vcpu->guest_debug.singlestep) {
1027 unsigned long flags;
1028 1024
1029 flags = vmcs_readl(GUEST_RFLAGS); 1025 flags = vmcs_readl(GUEST_RFLAGS);
1026 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
1027 flags |= X86_EFLAGS_TF | X86_EFLAGS_RF;
1028 else if (old_debug & KVM_GUESTDBG_SINGLESTEP)
1030 flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF); 1029 flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF);
1031 vmcs_writel(GUEST_RFLAGS, flags); 1030 vmcs_writel(GUEST_RFLAGS, flags);
1032 }
1033 1031
1034 update_exception_bitmap(vcpu); 1032 update_exception_bitmap(vcpu);
1035 vmcs_writel(GUEST_DR7, dr7);
1036 1033
1037 return 0; 1034 return 0;
1038} 1035}
@@ -1433,6 +1430,29 @@ continue_rmode:
1433 init_rmode(vcpu->kvm); 1430 init_rmode(vcpu->kvm);
1434} 1431}
1435 1432
1433static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
1434{
1435 struct vcpu_vmx *vmx = to_vmx(vcpu);
1436 struct kvm_msr_entry *msr = find_msr_entry(vmx, MSR_EFER);
1437
1438 vcpu->arch.shadow_efer = efer;
1439 if (!msr)
1440 return;
1441 if (efer & EFER_LMA) {
1442 vmcs_write32(VM_ENTRY_CONTROLS,
1443 vmcs_read32(VM_ENTRY_CONTROLS) |
1444 VM_ENTRY_IA32E_MODE);
1445 msr->data = efer;
1446 } else {
1447 vmcs_write32(VM_ENTRY_CONTROLS,
1448 vmcs_read32(VM_ENTRY_CONTROLS) &
1449 ~VM_ENTRY_IA32E_MODE);
1450
1451 msr->data = efer & ~EFER_LME;
1452 }
1453 setup_msrs(vmx);
1454}
1455
1436#ifdef CONFIG_X86_64 1456#ifdef CONFIG_X86_64
1437 1457
1438static void enter_lmode(struct kvm_vcpu *vcpu) 1458static void enter_lmode(struct kvm_vcpu *vcpu)
@@ -1447,13 +1467,8 @@ static void enter_lmode(struct kvm_vcpu *vcpu)
1447 (guest_tr_ar & ~AR_TYPE_MASK) 1467 (guest_tr_ar & ~AR_TYPE_MASK)
1448 | AR_TYPE_BUSY_64_TSS); 1468 | AR_TYPE_BUSY_64_TSS);
1449 } 1469 }
1450
1451 vcpu->arch.shadow_efer |= EFER_LMA; 1470 vcpu->arch.shadow_efer |= EFER_LMA;
1452 1471 vmx_set_efer(vcpu, vcpu->arch.shadow_efer);
1453 find_msr_entry(to_vmx(vcpu), MSR_EFER)->data |= EFER_LMA | EFER_LME;
1454 vmcs_write32(VM_ENTRY_CONTROLS,
1455 vmcs_read32(VM_ENTRY_CONTROLS)
1456 | VM_ENTRY_IA32E_MODE);
1457} 1472}
1458 1473
1459static void exit_lmode(struct kvm_vcpu *vcpu) 1474static void exit_lmode(struct kvm_vcpu *vcpu)
@@ -1612,30 +1627,6 @@ static void vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
1612 vmcs_writel(GUEST_CR4, hw_cr4); 1627 vmcs_writel(GUEST_CR4, hw_cr4);
1613} 1628}
1614 1629
1615static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
1616{
1617 struct vcpu_vmx *vmx = to_vmx(vcpu);
1618 struct kvm_msr_entry *msr = find_msr_entry(vmx, MSR_EFER);
1619
1620 vcpu->arch.shadow_efer = efer;
1621 if (!msr)
1622 return;
1623 if (efer & EFER_LMA) {
1624 vmcs_write32(VM_ENTRY_CONTROLS,
1625 vmcs_read32(VM_ENTRY_CONTROLS) |
1626 VM_ENTRY_IA32E_MODE);
1627 msr->data = efer;
1628
1629 } else {
1630 vmcs_write32(VM_ENTRY_CONTROLS,
1631 vmcs_read32(VM_ENTRY_CONTROLS) &
1632 ~VM_ENTRY_IA32E_MODE);
1633
1634 msr->data = efer & ~EFER_LME;
1635 }
1636 setup_msrs(vmx);
1637}
1638
1639static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg) 1630static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg)
1640{ 1631{
1641 struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; 1632 struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg];
@@ -1653,7 +1644,7 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
1653 var->limit = vmcs_read32(sf->limit); 1644 var->limit = vmcs_read32(sf->limit);
1654 var->selector = vmcs_read16(sf->selector); 1645 var->selector = vmcs_read16(sf->selector);
1655 ar = vmcs_read32(sf->ar_bytes); 1646 ar = vmcs_read32(sf->ar_bytes);
1656 if (ar & AR_UNUSABLE_MASK) 1647 if ((ar & AR_UNUSABLE_MASK) && !emulate_invalid_guest_state)
1657 ar = 0; 1648 ar = 0;
1658 var->type = ar & 15; 1649 var->type = ar & 15;
1659 var->s = (ar >> 4) & 1; 1650 var->s = (ar >> 4) & 1;
@@ -1788,14 +1779,16 @@ static bool code_segment_valid(struct kvm_vcpu *vcpu)
1788 vmx_get_segment(vcpu, &cs, VCPU_SREG_CS); 1779 vmx_get_segment(vcpu, &cs, VCPU_SREG_CS);
1789 cs_rpl = cs.selector & SELECTOR_RPL_MASK; 1780 cs_rpl = cs.selector & SELECTOR_RPL_MASK;
1790 1781
1782 if (cs.unusable)
1783 return false;
1791 if (~cs.type & (AR_TYPE_CODE_MASK|AR_TYPE_ACCESSES_MASK)) 1784 if (~cs.type & (AR_TYPE_CODE_MASK|AR_TYPE_ACCESSES_MASK))
1792 return false; 1785 return false;
1793 if (!cs.s) 1786 if (!cs.s)
1794 return false; 1787 return false;
1795 if (!(~cs.type & (AR_TYPE_CODE_MASK|AR_TYPE_WRITEABLE_MASK))) { 1788 if (cs.type & AR_TYPE_WRITEABLE_MASK) {
1796 if (cs.dpl > cs_rpl) 1789 if (cs.dpl > cs_rpl)
1797 return false; 1790 return false;
1798 } else if (cs.type & AR_TYPE_CODE_MASK) { 1791 } else {
1799 if (cs.dpl != cs_rpl) 1792 if (cs.dpl != cs_rpl)
1800 return false; 1793 return false;
1801 } 1794 }
@@ -1814,7 +1807,9 @@ static bool stack_segment_valid(struct kvm_vcpu *vcpu)
1814 vmx_get_segment(vcpu, &ss, VCPU_SREG_SS); 1807 vmx_get_segment(vcpu, &ss, VCPU_SREG_SS);
1815 ss_rpl = ss.selector & SELECTOR_RPL_MASK; 1808 ss_rpl = ss.selector & SELECTOR_RPL_MASK;
1816 1809
1817 if ((ss.type != 3) || (ss.type != 7)) 1810 if (ss.unusable)
1811 return true;
1812 if (ss.type != 3 && ss.type != 7)
1818 return false; 1813 return false;
1819 if (!ss.s) 1814 if (!ss.s)
1820 return false; 1815 return false;
@@ -1834,6 +1829,8 @@ static bool data_segment_valid(struct kvm_vcpu *vcpu, int seg)
1834 vmx_get_segment(vcpu, &var, seg); 1829 vmx_get_segment(vcpu, &var, seg);
1835 rpl = var.selector & SELECTOR_RPL_MASK; 1830 rpl = var.selector & SELECTOR_RPL_MASK;
1836 1831
1832 if (var.unusable)
1833 return true;
1837 if (!var.s) 1834 if (!var.s)
1838 return false; 1835 return false;
1839 if (!var.present) 1836 if (!var.present)
@@ -1855,9 +1852,11 @@ static bool tr_valid(struct kvm_vcpu *vcpu)
1855 1852
1856 vmx_get_segment(vcpu, &tr, VCPU_SREG_TR); 1853 vmx_get_segment(vcpu, &tr, VCPU_SREG_TR);
1857 1854
1855 if (tr.unusable)
1856 return false;
1858 if (tr.selector & SELECTOR_TI_MASK) /* TI = 1 */ 1857 if (tr.selector & SELECTOR_TI_MASK) /* TI = 1 */
1859 return false; 1858 return false;
1860 if ((tr.type != 3) || (tr.type != 11)) /* TODO: Check if guest is in IA32e mode */ 1859 if (tr.type != 3 && tr.type != 11) /* TODO: Check if guest is in IA32e mode */
1861 return false; 1860 return false;
1862 if (!tr.present) 1861 if (!tr.present)
1863 return false; 1862 return false;
@@ -1871,6 +1870,8 @@ static bool ldtr_valid(struct kvm_vcpu *vcpu)
1871 1870
1872 vmx_get_segment(vcpu, &ldtr, VCPU_SREG_LDTR); 1871 vmx_get_segment(vcpu, &ldtr, VCPU_SREG_LDTR);
1873 1872
1873 if (ldtr.unusable)
1874 return true;
1874 if (ldtr.selector & SELECTOR_TI_MASK) /* TI = 1 */ 1875 if (ldtr.selector & SELECTOR_TI_MASK) /* TI = 1 */
1875 return false; 1876 return false;
1876 if (ldtr.type != 2) 1877 if (ldtr.type != 2)
@@ -2112,7 +2113,7 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
2112{ 2113{
2113 u32 host_sysenter_cs, msr_low, msr_high; 2114 u32 host_sysenter_cs, msr_low, msr_high;
2114 u32 junk; 2115 u32 junk;
2115 u64 host_pat; 2116 u64 host_pat, tsc_this, tsc_base;
2116 unsigned long a; 2117 unsigned long a;
2117 struct descriptor_table dt; 2118 struct descriptor_table dt;
2118 int i; 2119 int i;
@@ -2240,6 +2241,12 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
2240 vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL); 2241 vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL);
2241 vmcs_writel(CR4_GUEST_HOST_MASK, KVM_GUEST_CR4_MASK); 2242 vmcs_writel(CR4_GUEST_HOST_MASK, KVM_GUEST_CR4_MASK);
2242 2243
2244 tsc_base = vmx->vcpu.kvm->arch.vm_init_tsc;
2245 rdtscll(tsc_this);
2246 if (tsc_this < vmx->vcpu.kvm->arch.vm_init_tsc)
2247 tsc_base = tsc_this;
2248
2249 guest_write_tsc(0, tsc_base);
2243 2250
2244 return 0; 2251 return 0;
2245} 2252}
@@ -2319,7 +2326,6 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
2319 kvm_rip_write(vcpu, 0); 2326 kvm_rip_write(vcpu, 0);
2320 kvm_register_write(vcpu, VCPU_REGS_RSP, 0); 2327 kvm_register_write(vcpu, VCPU_REGS_RSP, 0);
2321 2328
2322 /* todo: dr0 = dr1 = dr2 = dr3 = 0; dr6 = 0xffff0ff0 */
2323 vmcs_writel(GUEST_DR7, 0x400); 2329 vmcs_writel(GUEST_DR7, 0x400);
2324 2330
2325 vmcs_writel(GUEST_GDTR_BASE, 0); 2331 vmcs_writel(GUEST_GDTR_BASE, 0);
@@ -2332,8 +2338,6 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
2332 vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, 0); 2338 vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, 0);
2333 vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0); 2339 vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0);
2334 2340
2335 guest_write_tsc(0);
2336
2337 /* Special registers */ 2341 /* Special registers */
2338 vmcs_write64(GUEST_IA32_DEBUGCTL, 0); 2342 vmcs_write64(GUEST_IA32_DEBUGCTL, 0);
2339 2343
@@ -2486,6 +2490,11 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu,
2486{ 2490{
2487 vmx_update_window_states(vcpu); 2491 vmx_update_window_states(vcpu);
2488 2492
2493 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
2494 vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO,
2495 GUEST_INTR_STATE_STI |
2496 GUEST_INTR_STATE_MOV_SS);
2497
2489 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) { 2498 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
2490 if (vcpu->arch.interrupt.pending) { 2499 if (vcpu->arch.interrupt.pending) {
2491 enable_nmi_window(vcpu); 2500 enable_nmi_window(vcpu);
@@ -2536,24 +2545,6 @@ static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr)
2536 return 0; 2545 return 0;
2537} 2546}
2538 2547
2539static void kvm_guest_debug_pre(struct kvm_vcpu *vcpu)
2540{
2541 struct kvm_guest_debug *dbg = &vcpu->guest_debug;
2542
2543 set_debugreg(dbg->bp[0], 0);
2544 set_debugreg(dbg->bp[1], 1);
2545 set_debugreg(dbg->bp[2], 2);
2546 set_debugreg(dbg->bp[3], 3);
2547
2548 if (dbg->singlestep) {
2549 unsigned long flags;
2550
2551 flags = vmcs_readl(GUEST_RFLAGS);
2552 flags |= X86_EFLAGS_TF | X86_EFLAGS_RF;
2553 vmcs_writel(GUEST_RFLAGS, flags);
2554 }
2555}
2556
2557static int handle_rmode_exception(struct kvm_vcpu *vcpu, 2548static int handle_rmode_exception(struct kvm_vcpu *vcpu,
2558 int vec, u32 err_code) 2549 int vec, u32 err_code)
2559{ 2550{
@@ -2570,9 +2561,17 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
2570 * the required debugging infrastructure rework. 2561 * the required debugging infrastructure rework.
2571 */ 2562 */
2572 switch (vec) { 2563 switch (vec) {
2573 case DE_VECTOR:
2574 case DB_VECTOR: 2564 case DB_VECTOR:
2565 if (vcpu->guest_debug &
2566 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))
2567 return 0;
2568 kvm_queue_exception(vcpu, vec);
2569 return 1;
2575 case BP_VECTOR: 2570 case BP_VECTOR:
2571 if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP)
2572 return 0;
2573 /* fall through */
2574 case DE_VECTOR:
2576 case OF_VECTOR: 2575 case OF_VECTOR:
2577 case BR_VECTOR: 2576 case BR_VECTOR:
2578 case UD_VECTOR: 2577 case UD_VECTOR:
@@ -2589,8 +2588,8 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
2589static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2588static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2590{ 2589{
2591 struct vcpu_vmx *vmx = to_vmx(vcpu); 2590 struct vcpu_vmx *vmx = to_vmx(vcpu);
2592 u32 intr_info, error_code; 2591 u32 intr_info, ex_no, error_code;
2593 unsigned long cr2, rip; 2592 unsigned long cr2, rip, dr6;
2594 u32 vect_info; 2593 u32 vect_info;
2595 enum emulation_result er; 2594 enum emulation_result er;
2596 2595
@@ -2649,14 +2648,30 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2649 return 1; 2648 return 1;
2650 } 2649 }
2651 2650
2652 if ((intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK)) == 2651 ex_no = intr_info & INTR_INFO_VECTOR_MASK;
2653 (INTR_TYPE_EXCEPTION | 1)) { 2652 switch (ex_no) {
2653 case DB_VECTOR:
2654 dr6 = vmcs_readl(EXIT_QUALIFICATION);
2655 if (!(vcpu->guest_debug &
2656 (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) {
2657 vcpu->arch.dr6 = dr6 | DR6_FIXED_1;
2658 kvm_queue_exception(vcpu, DB_VECTOR);
2659 return 1;
2660 }
2661 kvm_run->debug.arch.dr6 = dr6 | DR6_FIXED_1;
2662 kvm_run->debug.arch.dr7 = vmcs_readl(GUEST_DR7);
2663 /* fall through */
2664 case BP_VECTOR:
2654 kvm_run->exit_reason = KVM_EXIT_DEBUG; 2665 kvm_run->exit_reason = KVM_EXIT_DEBUG;
2655 return 0; 2666 kvm_run->debug.arch.pc = vmcs_readl(GUEST_CS_BASE) + rip;
2667 kvm_run->debug.arch.exception = ex_no;
2668 break;
2669 default:
2670 kvm_run->exit_reason = KVM_EXIT_EXCEPTION;
2671 kvm_run->ex.exception = ex_no;
2672 kvm_run->ex.error_code = error_code;
2673 break;
2656 } 2674 }
2657 kvm_run->exit_reason = KVM_EXIT_EXCEPTION;
2658 kvm_run->ex.exception = intr_info & INTR_INFO_VECTOR_MASK;
2659 kvm_run->ex.error_code = error_code;
2660 return 0; 2675 return 0;
2661} 2676}
2662 2677
@@ -2677,7 +2692,7 @@ static int handle_triple_fault(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2677static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2692static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2678{ 2693{
2679 unsigned long exit_qualification; 2694 unsigned long exit_qualification;
2680 int size, down, in, string, rep; 2695 int size, in, string;
2681 unsigned port; 2696 unsigned port;
2682 2697
2683 ++vcpu->stat.io_exits; 2698 ++vcpu->stat.io_exits;
@@ -2693,8 +2708,6 @@ static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2693 2708
2694 size = (exit_qualification & 7) + 1; 2709 size = (exit_qualification & 7) + 1;
2695 in = (exit_qualification & 8) != 0; 2710 in = (exit_qualification & 8) != 0;
2696 down = (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_DF) != 0;
2697 rep = (exit_qualification & 32) != 0;
2698 port = exit_qualification >> 16; 2711 port = exit_qualification >> 16;
2699 2712
2700 skip_emulated_instruction(vcpu); 2713 skip_emulated_instruction(vcpu);
@@ -2795,21 +2808,44 @@ static int handle_dr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2795 unsigned long val; 2808 unsigned long val;
2796 int dr, reg; 2809 int dr, reg;
2797 2810
2798 /* 2811 dr = vmcs_readl(GUEST_DR7);
2799 * FIXME: this code assumes the host is debugging the guest. 2812 if (dr & DR7_GD) {
2800 * need to deal with guest debugging itself too. 2813 /*
2801 */ 2814 * As the vm-exit takes precedence over the debug trap, we
2815 * need to emulate the latter, either for the host or the
2816 * guest debugging itself.
2817 */
2818 if (vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) {
2819 kvm_run->debug.arch.dr6 = vcpu->arch.dr6;
2820 kvm_run->debug.arch.dr7 = dr;
2821 kvm_run->debug.arch.pc =
2822 vmcs_readl(GUEST_CS_BASE) +
2823 vmcs_readl(GUEST_RIP);
2824 kvm_run->debug.arch.exception = DB_VECTOR;
2825 kvm_run->exit_reason = KVM_EXIT_DEBUG;
2826 return 0;
2827 } else {
2828 vcpu->arch.dr7 &= ~DR7_GD;
2829 vcpu->arch.dr6 |= DR6_BD;
2830 vmcs_writel(GUEST_DR7, vcpu->arch.dr7);
2831 kvm_queue_exception(vcpu, DB_VECTOR);
2832 return 1;
2833 }
2834 }
2835
2802 exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 2836 exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
2803 dr = exit_qualification & 7; 2837 dr = exit_qualification & DEBUG_REG_ACCESS_NUM;
2804 reg = (exit_qualification >> 8) & 15; 2838 reg = DEBUG_REG_ACCESS_REG(exit_qualification);
2805 if (exit_qualification & 16) { 2839 if (exit_qualification & TYPE_MOV_FROM_DR) {
2806 /* mov from dr */
2807 switch (dr) { 2840 switch (dr) {
2841 case 0 ... 3:
2842 val = vcpu->arch.db[dr];
2843 break;
2808 case 6: 2844 case 6:
2809 val = 0xffff0ff0; 2845 val = vcpu->arch.dr6;
2810 break; 2846 break;
2811 case 7: 2847 case 7:
2812 val = 0x400; 2848 val = vcpu->arch.dr7;
2813 break; 2849 break;
2814 default: 2850 default:
2815 val = 0; 2851 val = 0;
@@ -2817,7 +2853,38 @@ static int handle_dr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2817 kvm_register_write(vcpu, reg, val); 2853 kvm_register_write(vcpu, reg, val);
2818 KVMTRACE_2D(DR_READ, vcpu, (u32)dr, (u32)val, handler); 2854 KVMTRACE_2D(DR_READ, vcpu, (u32)dr, (u32)val, handler);
2819 } else { 2855 } else {
2820 /* mov to dr */ 2856 val = vcpu->arch.regs[reg];
2857 switch (dr) {
2858 case 0 ... 3:
2859 vcpu->arch.db[dr] = val;
2860 if (!(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP))
2861 vcpu->arch.eff_db[dr] = val;
2862 break;
2863 case 4 ... 5:
2864 if (vcpu->arch.cr4 & X86_CR4_DE)
2865 kvm_queue_exception(vcpu, UD_VECTOR);
2866 break;
2867 case 6:
2868 if (val & 0xffffffff00000000ULL) {
2869 kvm_queue_exception(vcpu, GP_VECTOR);
2870 break;
2871 }
2872 vcpu->arch.dr6 = (val & DR6_VOLATILE) | DR6_FIXED_1;
2873 break;
2874 case 7:
2875 if (val & 0xffffffff00000000ULL) {
2876 kvm_queue_exception(vcpu, GP_VECTOR);
2877 break;
2878 }
2879 vcpu->arch.dr7 = (val & DR7_VOLATILE) | DR7_FIXED_1;
2880 if (!(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)) {
2881 vmcs_writel(GUEST_DR7, vcpu->arch.dr7);
2882 vcpu->arch.switch_db_regs =
2883 (val & DR7_BP_EN_MASK);
2884 }
2885 break;
2886 }
2887 KVMTRACE_2D(DR_WRITE, vcpu, (u32)dr, (u32)val, handler);
2821 } 2888 }
2822 skip_emulated_instruction(vcpu); 2889 skip_emulated_instruction(vcpu);
2823 return 1; 2890 return 1;
@@ -2968,17 +3035,25 @@ static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2968 } 3035 }
2969 tss_selector = exit_qualification; 3036 tss_selector = exit_qualification;
2970 3037
2971 return kvm_task_switch(vcpu, tss_selector, reason); 3038 if (!kvm_task_switch(vcpu, tss_selector, reason))
3039 return 0;
3040
3041 /* clear all local breakpoint enable flags */
3042 vmcs_writel(GUEST_DR7, vmcs_readl(GUEST_DR7) & ~55);
3043
3044 /*
3045 * TODO: What about debug traps on tss switch?
3046 * Are we supposed to inject them and update dr6?
3047 */
3048
3049 return 1;
2972} 3050}
2973 3051
2974static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3052static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2975{ 3053{
2976 u64 exit_qualification; 3054 u64 exit_qualification;
2977 enum emulation_result er;
2978 gpa_t gpa; 3055 gpa_t gpa;
2979 unsigned long hva;
2980 int gla_validity; 3056 int gla_validity;
2981 int r;
2982 3057
2983 exit_qualification = vmcs_read64(EXIT_QUALIFICATION); 3058 exit_qualification = vmcs_read64(EXIT_QUALIFICATION);
2984 3059
@@ -3001,32 +3076,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3001 } 3076 }
3002 3077
3003 gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); 3078 gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
3004 hva = gfn_to_hva(vcpu->kvm, gpa >> PAGE_SHIFT); 3079 return kvm_mmu_page_fault(vcpu, gpa & PAGE_MASK, 0);
3005 if (!kvm_is_error_hva(hva)) {
3006 r = kvm_mmu_page_fault(vcpu, gpa & PAGE_MASK, 0);
3007 if (r < 0) {
3008 printk(KERN_ERR "EPT: Not enough memory!\n");
3009 return -ENOMEM;
3010 }
3011 return 1;
3012 } else {
3013 /* must be MMIO */
3014 er = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
3015
3016 if (er == EMULATE_FAIL) {
3017 printk(KERN_ERR
3018 "EPT: Fail to handle EPT violation vmexit!er is %d\n",
3019 er);
3020 printk(KERN_ERR "EPT: GPA: 0x%lx, GVA: 0x%lx\n",
3021 (long unsigned int)vmcs_read64(GUEST_PHYSICAL_ADDRESS),
3022 (long unsigned int)vmcs_read64(GUEST_LINEAR_ADDRESS));
3023 printk(KERN_ERR "EPT: Exit qualification is 0x%lx\n",
3024 (long unsigned int)exit_qualification);
3025 return -ENOTSUPP;
3026 } else if (er == EMULATE_DO_MMIO)
3027 return 0;
3028 }
3029 return 1;
3030} 3080}
3031 3081
3032static int handle_nmi_window(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 3082static int handle_nmi_window(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
@@ -3046,7 +3096,7 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3046 struct kvm_run *kvm_run) 3096 struct kvm_run *kvm_run)
3047{ 3097{
3048 struct vcpu_vmx *vmx = to_vmx(vcpu); 3098 struct vcpu_vmx *vmx = to_vmx(vcpu);
3049 int err; 3099 enum emulation_result err = EMULATE_DONE;
3050 3100
3051 preempt_enable(); 3101 preempt_enable();
3052 local_irq_enable(); 3102 local_irq_enable();
@@ -3071,10 +3121,7 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
3071 local_irq_disable(); 3121 local_irq_disable();
3072 preempt_disable(); 3122 preempt_disable();
3073 3123
3074 /* Guest state should be valid now except if we need to 3124 vmx->invalid_state_emulation_result = err;
3075 * emulate an MMIO */
3076 if (guest_state_valid(vcpu))
3077 vmx->emulation_required = 0;
3078} 3125}
3079 3126
3080/* 3127/*
@@ -3123,8 +3170,11 @@ static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
3123 3170
3124 /* If we need to emulate an MMIO from handle_invalid_guest_state 3171 /* If we need to emulate an MMIO from handle_invalid_guest_state
3125 * we just return 0 */ 3172 * we just return 0 */
3126 if (vmx->emulation_required && emulate_invalid_guest_state) 3173 if (vmx->emulation_required && emulate_invalid_guest_state) {
3127 return 0; 3174 if (guest_state_valid(vcpu))
3175 vmx->emulation_required = 0;
3176 return vmx->invalid_state_emulation_result != EMULATE_DO_MMIO;
3177 }
3128 3178
3129 /* Access CR3 don't cause VMExit in paging mode, so we need 3179 /* Access CR3 don't cause VMExit in paging mode, so we need
3130 * to sync with guest real CR3. */ 3180 * to sync with guest real CR3. */
@@ -3238,7 +3288,8 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
3238 vmx->vcpu.arch.nmi_injected = false; 3288 vmx->vcpu.arch.nmi_injected = false;
3239 } 3289 }
3240 kvm_clear_exception_queue(&vmx->vcpu); 3290 kvm_clear_exception_queue(&vmx->vcpu);
3241 if (idtv_info_valid && type == INTR_TYPE_EXCEPTION) { 3291 if (idtv_info_valid && (type == INTR_TYPE_HARD_EXCEPTION ||
3292 type == INTR_TYPE_SOFT_EXCEPTION)) {
3242 if (idt_vectoring_info & VECTORING_INFO_DELIVER_CODE_MASK) { 3293 if (idt_vectoring_info & VECTORING_INFO_DELIVER_CODE_MASK) {
3243 error = vmcs_read32(IDT_VECTORING_ERROR_CODE); 3294 error = vmcs_read32(IDT_VECTORING_ERROR_CODE);
3244 kvm_queue_exception_e(&vmx->vcpu, vector, error); 3295 kvm_queue_exception_e(&vmx->vcpu, vector, error);
@@ -3259,6 +3310,11 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
3259 3310
3260 vmx_update_window_states(vcpu); 3311 vmx_update_window_states(vcpu);
3261 3312
3313 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
3314 vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO,
3315 GUEST_INTR_STATE_STI |
3316 GUEST_INTR_STATE_MOV_SS);
3317
3262 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) { 3318 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
3263 if (vcpu->arch.interrupt.pending) { 3319 if (vcpu->arch.interrupt.pending) {
3264 enable_nmi_window(vcpu); 3320 enable_nmi_window(vcpu);
@@ -3347,6 +3403,8 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3347 */ 3403 */
3348 vmcs_writel(HOST_CR0, read_cr0()); 3404 vmcs_writel(HOST_CR0, read_cr0());
3349 3405
3406 set_debugreg(vcpu->arch.dr6, 6);
3407
3350 asm( 3408 asm(
3351 /* Store host registers */ 3409 /* Store host registers */
3352 "push %%"R"dx; push %%"R"bp;" 3410 "push %%"R"dx; push %%"R"bp;"
@@ -3441,6 +3499,8 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3441 vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)); 3499 vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP));
3442 vcpu->arch.regs_dirty = 0; 3500 vcpu->arch.regs_dirty = 0;
3443 3501
3502 get_debugreg(vcpu->arch.dr6, 6);
3503
3444 vmx->idt_vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD); 3504 vmx->idt_vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD);
3445 if (vmx->rmode.irq.pending) 3505 if (vmx->rmode.irq.pending)
3446 fixup_rmode_irq(vmx); 3506 fixup_rmode_irq(vmx);
@@ -3595,7 +3655,6 @@ static struct kvm_x86_ops vmx_x86_ops = {
3595 .vcpu_put = vmx_vcpu_put, 3655 .vcpu_put = vmx_vcpu_put,
3596 3656
3597 .set_guest_debug = set_guest_debug, 3657 .set_guest_debug = set_guest_debug,
3598 .guest_debug_pre = kvm_guest_debug_pre,
3599 .get_msr = vmx_get_msr, 3658 .get_msr = vmx_get_msr,
3600 .set_msr = vmx_set_msr, 3659 .set_msr = vmx_set_msr,
3601 .get_segment_base = vmx_get_segment_base, 3660 .get_segment_base = vmx_get_segment_base,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 758b7a155ae9..8ca100a9ecac 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -36,6 +36,7 @@
36#include <linux/highmem.h> 36#include <linux/highmem.h>
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 40
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/msr.h> 42#include <asm/msr.h>
@@ -69,6 +70,8 @@ static u64 __read_mostly efer_reserved_bits = 0xfffffffffffffffeULL;
69 70
70static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, 71static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
71 struct kvm_cpuid_entry2 __user *entries); 72 struct kvm_cpuid_entry2 __user *entries);
73struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
74 u32 function, u32 index);
72 75
73struct kvm_x86_ops *kvm_x86_ops; 76struct kvm_x86_ops *kvm_x86_ops;
74EXPORT_SYMBOL_GPL(kvm_x86_ops); 77EXPORT_SYMBOL_GPL(kvm_x86_ops);
@@ -173,6 +176,7 @@ void kvm_inject_page_fault(struct kvm_vcpu *vcpu, unsigned long addr,
173 u32 error_code) 176 u32 error_code)
174{ 177{
175 ++vcpu->stat.pf_guest; 178 ++vcpu->stat.pf_guest;
179
176 if (vcpu->arch.exception.pending) { 180 if (vcpu->arch.exception.pending) {
177 if (vcpu->arch.exception.nr == PF_VECTOR) { 181 if (vcpu->arch.exception.nr == PF_VECTOR) {
178 printk(KERN_DEBUG "kvm: inject_page_fault:" 182 printk(KERN_DEBUG "kvm: inject_page_fault:"
@@ -361,6 +365,7 @@ void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
361 } 365 }
362 kvm_x86_ops->set_cr4(vcpu, cr4); 366 kvm_x86_ops->set_cr4(vcpu, cr4);
363 vcpu->arch.cr4 = cr4; 367 vcpu->arch.cr4 = cr4;
368 vcpu->arch.mmu.base_role.cr4_pge = (cr4 & X86_CR4_PGE) && !tdp_enabled;
364 kvm_mmu_sync_global(vcpu); 369 kvm_mmu_sync_global(vcpu);
365 kvm_mmu_reset_context(vcpu); 370 kvm_mmu_reset_context(vcpu);
366} 371}
@@ -442,6 +447,11 @@ unsigned long kvm_get_cr8(struct kvm_vcpu *vcpu)
442} 447}
443EXPORT_SYMBOL_GPL(kvm_get_cr8); 448EXPORT_SYMBOL_GPL(kvm_get_cr8);
444 449
450static inline u32 bit(int bitno)
451{
452 return 1 << (bitno & 31);
453}
454
445/* 455/*
446 * List of msr numbers which we expose to userspace through KVM_GET_MSRS 456 * List of msr numbers which we expose to userspace through KVM_GET_MSRS
447 * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST. 457 * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST.
@@ -456,7 +466,7 @@ static u32 msrs_to_save[] = {
456 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, 466 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
457#endif 467#endif
458 MSR_IA32_TIME_STAMP_COUNTER, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, 468 MSR_IA32_TIME_STAMP_COUNTER, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
459 MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT 469 MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA
460}; 470};
461 471
462static unsigned num_msrs_to_save; 472static unsigned num_msrs_to_save;
@@ -481,6 +491,28 @@ static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
481 return; 491 return;
482 } 492 }
483 493
494 if (efer & EFER_FFXSR) {
495 struct kvm_cpuid_entry2 *feat;
496
497 feat = kvm_find_cpuid_entry(vcpu, 0x80000001, 0);
498 if (!feat || !(feat->edx & bit(X86_FEATURE_FXSR_OPT))) {
499 printk(KERN_DEBUG "set_efer: #GP, enable FFXSR w/o CPUID capability\n");
500 kvm_inject_gp(vcpu, 0);
501 return;
502 }
503 }
504
505 if (efer & EFER_SVME) {
506 struct kvm_cpuid_entry2 *feat;
507
508 feat = kvm_find_cpuid_entry(vcpu, 0x80000001, 0);
509 if (!feat || !(feat->ecx & bit(X86_FEATURE_SVM))) {
510 printk(KERN_DEBUG "set_efer: #GP, enable SVM w/o SVM\n");
511 kvm_inject_gp(vcpu, 0);
512 return;
513 }
514 }
515
484 kvm_x86_ops->set_efer(vcpu, efer); 516 kvm_x86_ops->set_efer(vcpu, efer);
485 517
486 efer &= ~EFER_LMA; 518 efer &= ~EFER_LMA;
@@ -586,6 +618,8 @@ static void kvm_set_time_scale(uint32_t tsc_khz, struct pvclock_vcpu_time_info *
586 hv_clock->tsc_to_system_mul); 618 hv_clock->tsc_to_system_mul);
587} 619}
588 620
621static DEFINE_PER_CPU(unsigned long, cpu_tsc_khz);
622
589static void kvm_write_guest_time(struct kvm_vcpu *v) 623static void kvm_write_guest_time(struct kvm_vcpu *v)
590{ 624{
591 struct timespec ts; 625 struct timespec ts;
@@ -596,9 +630,9 @@ static void kvm_write_guest_time(struct kvm_vcpu *v)
596 if ((!vcpu->time_page)) 630 if ((!vcpu->time_page))
597 return; 631 return;
598 632
599 if (unlikely(vcpu->hv_clock_tsc_khz != tsc_khz)) { 633 if (unlikely(vcpu->hv_clock_tsc_khz != __get_cpu_var(cpu_tsc_khz))) {
600 kvm_set_time_scale(tsc_khz, &vcpu->hv_clock); 634 kvm_set_time_scale(__get_cpu_var(cpu_tsc_khz), &vcpu->hv_clock);
601 vcpu->hv_clock_tsc_khz = tsc_khz; 635 vcpu->hv_clock_tsc_khz = __get_cpu_var(cpu_tsc_khz);
602 } 636 }
603 637
604 /* Keep irq disabled to prevent changes to the clock */ 638 /* Keep irq disabled to prevent changes to the clock */
@@ -629,6 +663,16 @@ static void kvm_write_guest_time(struct kvm_vcpu *v)
629 mark_page_dirty(v->kvm, vcpu->time >> PAGE_SHIFT); 663 mark_page_dirty(v->kvm, vcpu->time >> PAGE_SHIFT);
630} 664}
631 665
666static int kvm_request_guest_time_update(struct kvm_vcpu *v)
667{
668 struct kvm_vcpu_arch *vcpu = &v->arch;
669
670 if (!vcpu->time_page)
671 return 0;
672 set_bit(KVM_REQ_KVMCLOCK_UPDATE, &v->requests);
673 return 1;
674}
675
632static bool msr_mtrr_valid(unsigned msr) 676static bool msr_mtrr_valid(unsigned msr)
633{ 677{
634 switch (msr) { 678 switch (msr) {
@@ -722,6 +766,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
722 break; 766 break;
723 case MSR_IA32_UCODE_REV: 767 case MSR_IA32_UCODE_REV:
724 case MSR_IA32_UCODE_WRITE: 768 case MSR_IA32_UCODE_WRITE:
769 case MSR_VM_HSAVE_PA:
725 break; 770 break;
726 case 0x200 ... 0x2ff: 771 case 0x200 ... 0x2ff:
727 return set_msr_mtrr(vcpu, msr, data); 772 return set_msr_mtrr(vcpu, msr, data);
@@ -758,7 +803,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
758 vcpu->arch.time_page = NULL; 803 vcpu->arch.time_page = NULL;
759 } 804 }
760 805
761 kvm_write_guest_time(vcpu); 806 kvm_request_guest_time_update(vcpu);
762 break; 807 break;
763 } 808 }
764 default: 809 default:
@@ -843,6 +888,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
843 case MSR_IA32_LASTBRANCHTOIP: 888 case MSR_IA32_LASTBRANCHTOIP:
844 case MSR_IA32_LASTINTFROMIP: 889 case MSR_IA32_LASTINTFROMIP:
845 case MSR_IA32_LASTINTTOIP: 890 case MSR_IA32_LASTINTTOIP:
891 case MSR_VM_HSAVE_PA:
846 data = 0; 892 data = 0;
847 break; 893 break;
848 case MSR_MTRRcap: 894 case MSR_MTRRcap:
@@ -967,10 +1013,13 @@ int kvm_dev_ioctl_check_extension(long ext)
967 case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: 1013 case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
968 case KVM_CAP_SET_TSS_ADDR: 1014 case KVM_CAP_SET_TSS_ADDR:
969 case KVM_CAP_EXT_CPUID: 1015 case KVM_CAP_EXT_CPUID:
1016 case KVM_CAP_CLOCKSOURCE:
970 case KVM_CAP_PIT: 1017 case KVM_CAP_PIT:
971 case KVM_CAP_NOP_IO_DELAY: 1018 case KVM_CAP_NOP_IO_DELAY:
972 case KVM_CAP_MP_STATE: 1019 case KVM_CAP_MP_STATE:
973 case KVM_CAP_SYNC_MMU: 1020 case KVM_CAP_SYNC_MMU:
1021 case KVM_CAP_REINJECT_CONTROL:
1022 case KVM_CAP_IRQ_INJECT_STATUS:
974 r = 1; 1023 r = 1;
975 break; 1024 break;
976 case KVM_CAP_COALESCED_MMIO: 1025 case KVM_CAP_COALESCED_MMIO:
@@ -991,9 +1040,6 @@ int kvm_dev_ioctl_check_extension(long ext)
991 case KVM_CAP_IOMMU: 1040 case KVM_CAP_IOMMU:
992 r = iommu_found(); 1041 r = iommu_found();
993 break; 1042 break;
994 case KVM_CAP_CLOCKSOURCE:
995 r = boot_cpu_has(X86_FEATURE_CONSTANT_TSC);
996 break;
997 default: 1043 default:
998 r = 0; 1044 r = 0;
999 break; 1045 break;
@@ -1044,7 +1090,7 @@ long kvm_arch_dev_ioctl(struct file *filp,
1044 if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) 1090 if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
1045 goto out; 1091 goto out;
1046 r = kvm_dev_ioctl_get_supported_cpuid(&cpuid, 1092 r = kvm_dev_ioctl_get_supported_cpuid(&cpuid,
1047 cpuid_arg->entries); 1093 cpuid_arg->entries);
1048 if (r) 1094 if (r)
1049 goto out; 1095 goto out;
1050 1096
@@ -1064,7 +1110,7 @@ out:
1064void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 1110void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
1065{ 1111{
1066 kvm_x86_ops->vcpu_load(vcpu, cpu); 1112 kvm_x86_ops->vcpu_load(vcpu, cpu);
1067 kvm_write_guest_time(vcpu); 1113 kvm_request_guest_time_update(vcpu);
1068} 1114}
1069 1115
1070void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) 1116void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
@@ -1142,8 +1188,8 @@ out:
1142} 1188}
1143 1189
1144static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu, 1190static int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
1145 struct kvm_cpuid2 *cpuid, 1191 struct kvm_cpuid2 *cpuid,
1146 struct kvm_cpuid_entry2 __user *entries) 1192 struct kvm_cpuid_entry2 __user *entries)
1147{ 1193{
1148 int r; 1194 int r;
1149 1195
@@ -1162,8 +1208,8 @@ out:
1162} 1208}
1163 1209
1164static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu, 1210static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
1165 struct kvm_cpuid2 *cpuid, 1211 struct kvm_cpuid2 *cpuid,
1166 struct kvm_cpuid_entry2 __user *entries) 1212 struct kvm_cpuid_entry2 __user *entries)
1167{ 1213{
1168 int r; 1214 int r;
1169 1215
@@ -1172,7 +1218,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
1172 goto out; 1218 goto out;
1173 r = -EFAULT; 1219 r = -EFAULT;
1174 if (copy_to_user(entries, &vcpu->arch.cpuid_entries, 1220 if (copy_to_user(entries, &vcpu->arch.cpuid_entries,
1175 vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2))) 1221 vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
1176 goto out; 1222 goto out;
1177 return 0; 1223 return 0;
1178 1224
@@ -1181,18 +1227,13 @@ out:
1181 return r; 1227 return r;
1182} 1228}
1183 1229
1184static inline u32 bit(int bitno)
1185{
1186 return 1 << (bitno & 31);
1187}
1188
1189static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function, 1230static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1190 u32 index) 1231 u32 index)
1191{ 1232{
1192 entry->function = function; 1233 entry->function = function;
1193 entry->index = index; 1234 entry->index = index;
1194 cpuid_count(entry->function, entry->index, 1235 cpuid_count(entry->function, entry->index,
1195 &entry->eax, &entry->ebx, &entry->ecx, &entry->edx); 1236 &entry->eax, &entry->ebx, &entry->ecx, &entry->edx);
1196 entry->flags = 0; 1237 entry->flags = 0;
1197} 1238}
1198 1239
@@ -1222,15 +1263,17 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1222#ifdef CONFIG_X86_64 1263#ifdef CONFIG_X86_64
1223 bit(X86_FEATURE_LM) | 1264 bit(X86_FEATURE_LM) |
1224#endif 1265#endif
1266 bit(X86_FEATURE_FXSR_OPT) |
1225 bit(X86_FEATURE_MMXEXT) | 1267 bit(X86_FEATURE_MMXEXT) |
1226 bit(X86_FEATURE_3DNOWEXT) | 1268 bit(X86_FEATURE_3DNOWEXT) |
1227 bit(X86_FEATURE_3DNOW); 1269 bit(X86_FEATURE_3DNOW);
1228 const u32 kvm_supported_word3_x86_features = 1270 const u32 kvm_supported_word3_x86_features =
1229 bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16); 1271 bit(X86_FEATURE_XMM3) | bit(X86_FEATURE_CX16);
1230 const u32 kvm_supported_word6_x86_features = 1272 const u32 kvm_supported_word6_x86_features =
1231 bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY); 1273 bit(X86_FEATURE_LAHF_LM) | bit(X86_FEATURE_CMP_LEGACY) |
1274 bit(X86_FEATURE_SVM);
1232 1275
1233 /* all func 2 cpuid_count() should be called on the same cpu */ 1276 /* all calls to cpuid_count() should be made on the same cpu */
1234 get_cpu(); 1277 get_cpu();
1235 do_cpuid_1_ent(entry, function, index); 1278 do_cpuid_1_ent(entry, function, index);
1236 ++*nent; 1279 ++*nent;
@@ -1304,7 +1347,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1304} 1347}
1305 1348
1306static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid, 1349static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
1307 struct kvm_cpuid_entry2 __user *entries) 1350 struct kvm_cpuid_entry2 __user *entries)
1308{ 1351{
1309 struct kvm_cpuid_entry2 *cpuid_entries; 1352 struct kvm_cpuid_entry2 *cpuid_entries;
1310 int limit, nent = 0, r = -E2BIG; 1353 int limit, nent = 0, r = -E2BIG;
@@ -1321,7 +1364,7 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
1321 limit = cpuid_entries[0].eax; 1364 limit = cpuid_entries[0].eax;
1322 for (func = 1; func <= limit && nent < cpuid->nent; ++func) 1365 for (func = 1; func <= limit && nent < cpuid->nent; ++func)
1323 do_cpuid_ent(&cpuid_entries[nent], func, 0, 1366 do_cpuid_ent(&cpuid_entries[nent], func, 0,
1324 &nent, cpuid->nent); 1367 &nent, cpuid->nent);
1325 r = -E2BIG; 1368 r = -E2BIG;
1326 if (nent >= cpuid->nent) 1369 if (nent >= cpuid->nent)
1327 goto out_free; 1370 goto out_free;
@@ -1330,10 +1373,10 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
1330 limit = cpuid_entries[nent - 1].eax; 1373 limit = cpuid_entries[nent - 1].eax;
1331 for (func = 0x80000001; func <= limit && nent < cpuid->nent; ++func) 1374 for (func = 0x80000001; func <= limit && nent < cpuid->nent; ++func)
1332 do_cpuid_ent(&cpuid_entries[nent], func, 0, 1375 do_cpuid_ent(&cpuid_entries[nent], func, 0,
1333 &nent, cpuid->nent); 1376 &nent, cpuid->nent);
1334 r = -EFAULT; 1377 r = -EFAULT;
1335 if (copy_to_user(entries, cpuid_entries, 1378 if (copy_to_user(entries, cpuid_entries,
1336 nent * sizeof(struct kvm_cpuid_entry2))) 1379 nent * sizeof(struct kvm_cpuid_entry2)))
1337 goto out_free; 1380 goto out_free;
1338 cpuid->nent = nent; 1381 cpuid->nent = nent;
1339 r = 0; 1382 r = 0;
@@ -1477,7 +1520,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
1477 if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) 1520 if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
1478 goto out; 1521 goto out;
1479 r = kvm_vcpu_ioctl_set_cpuid2(vcpu, &cpuid, 1522 r = kvm_vcpu_ioctl_set_cpuid2(vcpu, &cpuid,
1480 cpuid_arg->entries); 1523 cpuid_arg->entries);
1481 if (r) 1524 if (r)
1482 goto out; 1525 goto out;
1483 break; 1526 break;
@@ -1490,7 +1533,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
1490 if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid)) 1533 if (copy_from_user(&cpuid, cpuid_arg, sizeof cpuid))
1491 goto out; 1534 goto out;
1492 r = kvm_vcpu_ioctl_get_cpuid2(vcpu, &cpuid, 1535 r = kvm_vcpu_ioctl_get_cpuid2(vcpu, &cpuid,
1493 cpuid_arg->entries); 1536 cpuid_arg->entries);
1494 if (r) 1537 if (r)
1495 goto out; 1538 goto out;
1496 r = -EFAULT; 1539 r = -EFAULT;
@@ -1710,6 +1753,15 @@ static int kvm_vm_ioctl_set_pit(struct kvm *kvm, struct kvm_pit_state *ps)
1710 return r; 1753 return r;
1711} 1754}
1712 1755
1756static int kvm_vm_ioctl_reinject(struct kvm *kvm,
1757 struct kvm_reinject_control *control)
1758{
1759 if (!kvm->arch.vpit)
1760 return -ENXIO;
1761 kvm->arch.vpit->pit_state.pit_timer.reinject = control->pit_reinject;
1762 return 0;
1763}
1764
1713/* 1765/*
1714 * Get (and clear) the dirty memory log for a memory slot. 1766 * Get (and clear) the dirty memory log for a memory slot.
1715 */ 1767 */
@@ -1807,13 +1859,26 @@ long kvm_arch_vm_ioctl(struct file *filp,
1807 } 1859 }
1808 } else 1860 } else
1809 goto out; 1861 goto out;
1862 r = kvm_setup_default_irq_routing(kvm);
1863 if (r) {
1864 kfree(kvm->arch.vpic);
1865 kfree(kvm->arch.vioapic);
1866 goto out;
1867 }
1810 break; 1868 break;
1811 case KVM_CREATE_PIT: 1869 case KVM_CREATE_PIT:
1870 mutex_lock(&kvm->lock);
1871 r = -EEXIST;
1872 if (kvm->arch.vpit)
1873 goto create_pit_unlock;
1812 r = -ENOMEM; 1874 r = -ENOMEM;
1813 kvm->arch.vpit = kvm_create_pit(kvm); 1875 kvm->arch.vpit = kvm_create_pit(kvm);
1814 if (kvm->arch.vpit) 1876 if (kvm->arch.vpit)
1815 r = 0; 1877 r = 0;
1878 create_pit_unlock:
1879 mutex_unlock(&kvm->lock);
1816 break; 1880 break;
1881 case KVM_IRQ_LINE_STATUS:
1817 case KVM_IRQ_LINE: { 1882 case KVM_IRQ_LINE: {
1818 struct kvm_irq_level irq_event; 1883 struct kvm_irq_level irq_event;
1819 1884
@@ -1821,10 +1886,17 @@ long kvm_arch_vm_ioctl(struct file *filp,
1821 if (copy_from_user(&irq_event, argp, sizeof irq_event)) 1886 if (copy_from_user(&irq_event, argp, sizeof irq_event))
1822 goto out; 1887 goto out;
1823 if (irqchip_in_kernel(kvm)) { 1888 if (irqchip_in_kernel(kvm)) {
1889 __s32 status;
1824 mutex_lock(&kvm->lock); 1890 mutex_lock(&kvm->lock);
1825 kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 1891 status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
1826 irq_event.irq, irq_event.level); 1892 irq_event.irq, irq_event.level);
1827 mutex_unlock(&kvm->lock); 1893 mutex_unlock(&kvm->lock);
1894 if (ioctl == KVM_IRQ_LINE_STATUS) {
1895 irq_event.status = status;
1896 if (copy_to_user(argp, &irq_event,
1897 sizeof irq_event))
1898 goto out;
1899 }
1828 r = 0; 1900 r = 0;
1829 } 1901 }
1830 break; 1902 break;
@@ -1907,6 +1979,17 @@ long kvm_arch_vm_ioctl(struct file *filp,
1907 r = 0; 1979 r = 0;
1908 break; 1980 break;
1909 } 1981 }
1982 case KVM_REINJECT_CONTROL: {
1983 struct kvm_reinject_control control;
1984 r = -EFAULT;
1985 if (copy_from_user(&control, argp, sizeof(control)))
1986 goto out;
1987 r = kvm_vm_ioctl_reinject(kvm, &control);
1988 if (r)
1989 goto out;
1990 r = 0;
1991 break;
1992 }
1910 default: 1993 default:
1911 ; 1994 ;
1912 } 1995 }
@@ -1960,10 +2043,38 @@ static struct kvm_io_device *vcpu_find_mmio_dev(struct kvm_vcpu *vcpu,
1960 return dev; 2043 return dev;
1961} 2044}
1962 2045
1963int emulator_read_std(unsigned long addr, 2046static int kvm_read_guest_virt(gva_t addr, void *val, unsigned int bytes,
1964 void *val, 2047 struct kvm_vcpu *vcpu)
1965 unsigned int bytes, 2048{
1966 struct kvm_vcpu *vcpu) 2049 void *data = val;
2050 int r = X86EMUL_CONTINUE;
2051
2052 while (bytes) {
2053 gpa_t gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr);
2054 unsigned offset = addr & (PAGE_SIZE-1);
2055 unsigned toread = min(bytes, (unsigned)PAGE_SIZE - offset);
2056 int ret;
2057
2058 if (gpa == UNMAPPED_GVA) {
2059 r = X86EMUL_PROPAGATE_FAULT;
2060 goto out;
2061 }
2062 ret = kvm_read_guest(vcpu->kvm, gpa, data, toread);
2063 if (ret < 0) {
2064 r = X86EMUL_UNHANDLEABLE;
2065 goto out;
2066 }
2067
2068 bytes -= toread;
2069 data += toread;
2070 addr += toread;
2071 }
2072out:
2073 return r;
2074}
2075
2076static int kvm_write_guest_virt(gva_t addr, void *val, unsigned int bytes,
2077 struct kvm_vcpu *vcpu)
1967{ 2078{
1968 void *data = val; 2079 void *data = val;
1969 int r = X86EMUL_CONTINUE; 2080 int r = X86EMUL_CONTINUE;
@@ -1971,27 +2082,27 @@ int emulator_read_std(unsigned long addr,
1971 while (bytes) { 2082 while (bytes) {
1972 gpa_t gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr); 2083 gpa_t gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, addr);
1973 unsigned offset = addr & (PAGE_SIZE-1); 2084 unsigned offset = addr & (PAGE_SIZE-1);
1974 unsigned tocopy = min(bytes, (unsigned)PAGE_SIZE - offset); 2085 unsigned towrite = min(bytes, (unsigned)PAGE_SIZE - offset);
1975 int ret; 2086 int ret;
1976 2087
1977 if (gpa == UNMAPPED_GVA) { 2088 if (gpa == UNMAPPED_GVA) {
1978 r = X86EMUL_PROPAGATE_FAULT; 2089 r = X86EMUL_PROPAGATE_FAULT;
1979 goto out; 2090 goto out;
1980 } 2091 }
1981 ret = kvm_read_guest(vcpu->kvm, gpa, data, tocopy); 2092 ret = kvm_write_guest(vcpu->kvm, gpa, data, towrite);
1982 if (ret < 0) { 2093 if (ret < 0) {
1983 r = X86EMUL_UNHANDLEABLE; 2094 r = X86EMUL_UNHANDLEABLE;
1984 goto out; 2095 goto out;
1985 } 2096 }
1986 2097
1987 bytes -= tocopy; 2098 bytes -= towrite;
1988 data += tocopy; 2099 data += towrite;
1989 addr += tocopy; 2100 addr += towrite;
1990 } 2101 }
1991out: 2102out:
1992 return r; 2103 return r;
1993} 2104}
1994EXPORT_SYMBOL_GPL(emulator_read_std); 2105
1995 2106
1996static int emulator_read_emulated(unsigned long addr, 2107static int emulator_read_emulated(unsigned long addr,
1997 void *val, 2108 void *val,
@@ -2013,8 +2124,8 @@ static int emulator_read_emulated(unsigned long addr,
2013 if ((gpa & PAGE_MASK) == APIC_DEFAULT_PHYS_BASE) 2124 if ((gpa & PAGE_MASK) == APIC_DEFAULT_PHYS_BASE)
2014 goto mmio; 2125 goto mmio;
2015 2126
2016 if (emulator_read_std(addr, val, bytes, vcpu) 2127 if (kvm_read_guest_virt(addr, val, bytes, vcpu)
2017 == X86EMUL_CONTINUE) 2128 == X86EMUL_CONTINUE)
2018 return X86EMUL_CONTINUE; 2129 return X86EMUL_CONTINUE;
2019 if (gpa == UNMAPPED_GVA) 2130 if (gpa == UNMAPPED_GVA)
2020 return X86EMUL_PROPAGATE_FAULT; 2131 return X86EMUL_PROPAGATE_FAULT;
@@ -2217,7 +2328,7 @@ void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context)
2217 2328
2218 rip_linear = rip + get_segment_base(vcpu, VCPU_SREG_CS); 2329 rip_linear = rip + get_segment_base(vcpu, VCPU_SREG_CS);
2219 2330
2220 emulator_read_std(rip_linear, (void *)opcodes, 4, vcpu); 2331 kvm_read_guest_virt(rip_linear, (void *)opcodes, 4, vcpu);
2221 2332
2222 printk(KERN_ERR "emulation failed (%s) rip %lx %02x %02x %02x %02x\n", 2333 printk(KERN_ERR "emulation failed (%s) rip %lx %02x %02x %02x %02x\n",
2223 context, rip, opcodes[0], opcodes[1], opcodes[2], opcodes[3]); 2334 context, rip, opcodes[0], opcodes[1], opcodes[2], opcodes[3]);
@@ -2225,7 +2336,7 @@ void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context)
2225EXPORT_SYMBOL_GPL(kvm_report_emulation_failure); 2336EXPORT_SYMBOL_GPL(kvm_report_emulation_failure);
2226 2337
2227static struct x86_emulate_ops emulate_ops = { 2338static struct x86_emulate_ops emulate_ops = {
2228 .read_std = emulator_read_std, 2339 .read_std = kvm_read_guest_virt,
2229 .read_emulated = emulator_read_emulated, 2340 .read_emulated = emulator_read_emulated,
2230 .write_emulated = emulator_write_emulated, 2341 .write_emulated = emulator_write_emulated,
2231 .cmpxchg_emulated = emulator_cmpxchg_emulated, 2342 .cmpxchg_emulated = emulator_cmpxchg_emulated,
@@ -2327,40 +2438,19 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
2327} 2438}
2328EXPORT_SYMBOL_GPL(emulate_instruction); 2439EXPORT_SYMBOL_GPL(emulate_instruction);
2329 2440
2330static void free_pio_guest_pages(struct kvm_vcpu *vcpu)
2331{
2332 int i;
2333
2334 for (i = 0; i < ARRAY_SIZE(vcpu->arch.pio.guest_pages); ++i)
2335 if (vcpu->arch.pio.guest_pages[i]) {
2336 kvm_release_page_dirty(vcpu->arch.pio.guest_pages[i]);
2337 vcpu->arch.pio.guest_pages[i] = NULL;
2338 }
2339}
2340
2341static int pio_copy_data(struct kvm_vcpu *vcpu) 2441static int pio_copy_data(struct kvm_vcpu *vcpu)
2342{ 2442{
2343 void *p = vcpu->arch.pio_data; 2443 void *p = vcpu->arch.pio_data;
2344 void *q; 2444 gva_t q = vcpu->arch.pio.guest_gva;
2345 unsigned bytes; 2445 unsigned bytes;
2346 int nr_pages = vcpu->arch.pio.guest_pages[1] ? 2 : 1; 2446 int ret;
2347 2447
2348 q = vmap(vcpu->arch.pio.guest_pages, nr_pages, VM_READ|VM_WRITE,
2349 PAGE_KERNEL);
2350 if (!q) {
2351 free_pio_guest_pages(vcpu);
2352 return -ENOMEM;
2353 }
2354 q += vcpu->arch.pio.guest_page_offset;
2355 bytes = vcpu->arch.pio.size * vcpu->arch.pio.cur_count; 2448 bytes = vcpu->arch.pio.size * vcpu->arch.pio.cur_count;
2356 if (vcpu->arch.pio.in) 2449 if (vcpu->arch.pio.in)
2357 memcpy(q, p, bytes); 2450 ret = kvm_write_guest_virt(q, p, bytes, vcpu);
2358 else 2451 else
2359 memcpy(p, q, bytes); 2452 ret = kvm_read_guest_virt(q, p, bytes, vcpu);
2360 q -= vcpu->arch.pio.guest_page_offset; 2453 return ret;
2361 vunmap(q);
2362 free_pio_guest_pages(vcpu);
2363 return 0;
2364} 2454}
2365 2455
2366int complete_pio(struct kvm_vcpu *vcpu) 2456int complete_pio(struct kvm_vcpu *vcpu)
@@ -2471,7 +2561,6 @@ int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2471 vcpu->arch.pio.in = in; 2561 vcpu->arch.pio.in = in;
2472 vcpu->arch.pio.string = 0; 2562 vcpu->arch.pio.string = 0;
2473 vcpu->arch.pio.down = 0; 2563 vcpu->arch.pio.down = 0;
2474 vcpu->arch.pio.guest_page_offset = 0;
2475 vcpu->arch.pio.rep = 0; 2564 vcpu->arch.pio.rep = 0;
2476 2565
2477 if (vcpu->run->io.direction == KVM_EXIT_IO_IN) 2566 if (vcpu->run->io.direction == KVM_EXIT_IO_IN)
@@ -2499,9 +2588,7 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2499 gva_t address, int rep, unsigned port) 2588 gva_t address, int rep, unsigned port)
2500{ 2589{
2501 unsigned now, in_page; 2590 unsigned now, in_page;
2502 int i, ret = 0; 2591 int ret = 0;
2503 int nr_pages = 1;
2504 struct page *page;
2505 struct kvm_io_device *pio_dev; 2592 struct kvm_io_device *pio_dev;
2506 2593
2507 vcpu->run->exit_reason = KVM_EXIT_IO; 2594 vcpu->run->exit_reason = KVM_EXIT_IO;
@@ -2513,7 +2600,6 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2513 vcpu->arch.pio.in = in; 2600 vcpu->arch.pio.in = in;
2514 vcpu->arch.pio.string = 1; 2601 vcpu->arch.pio.string = 1;
2515 vcpu->arch.pio.down = down; 2602 vcpu->arch.pio.down = down;
2516 vcpu->arch.pio.guest_page_offset = offset_in_page(address);
2517 vcpu->arch.pio.rep = rep; 2603 vcpu->arch.pio.rep = rep;
2518 2604
2519 if (vcpu->run->io.direction == KVM_EXIT_IO_IN) 2605 if (vcpu->run->io.direction == KVM_EXIT_IO_IN)
@@ -2533,15 +2619,8 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2533 else 2619 else
2534 in_page = offset_in_page(address) + size; 2620 in_page = offset_in_page(address) + size;
2535 now = min(count, (unsigned long)in_page / size); 2621 now = min(count, (unsigned long)in_page / size);
2536 if (!now) { 2622 if (!now)
2537 /*
2538 * String I/O straddles page boundary. Pin two guest pages
2539 * so that we satisfy atomicity constraints. Do just one
2540 * transaction to avoid complexity.
2541 */
2542 nr_pages = 2;
2543 now = 1; 2623 now = 1;
2544 }
2545 if (down) { 2624 if (down) {
2546 /* 2625 /*
2547 * String I/O in reverse. Yuck. Kill the guest, fix later. 2626 * String I/O in reverse. Yuck. Kill the guest, fix later.
@@ -2556,15 +2635,7 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2556 if (vcpu->arch.pio.cur_count == vcpu->arch.pio.count) 2635 if (vcpu->arch.pio.cur_count == vcpu->arch.pio.count)
2557 kvm_x86_ops->skip_emulated_instruction(vcpu); 2636 kvm_x86_ops->skip_emulated_instruction(vcpu);
2558 2637
2559 for (i = 0; i < nr_pages; ++i) { 2638 vcpu->arch.pio.guest_gva = address;
2560 page = gva_to_page(vcpu, address + i * PAGE_SIZE);
2561 vcpu->arch.pio.guest_pages[i] = page;
2562 if (!page) {
2563 kvm_inject_gp(vcpu, 0);
2564 free_pio_guest_pages(vcpu);
2565 return 1;
2566 }
2567 }
2568 2639
2569 pio_dev = vcpu_find_pio_dev(vcpu, port, 2640 pio_dev = vcpu_find_pio_dev(vcpu, port,
2570 vcpu->arch.pio.cur_count, 2641 vcpu->arch.pio.cur_count,
@@ -2572,7 +2643,11 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2572 if (!vcpu->arch.pio.in) { 2643 if (!vcpu->arch.pio.in) {
2573 /* string PIO write */ 2644 /* string PIO write */
2574 ret = pio_copy_data(vcpu); 2645 ret = pio_copy_data(vcpu);
2575 if (ret >= 0 && pio_dev) { 2646 if (ret == X86EMUL_PROPAGATE_FAULT) {
2647 kvm_inject_gp(vcpu, 0);
2648 return 1;
2649 }
2650 if (ret == 0 && pio_dev) {
2576 pio_string_write(pio_dev, vcpu); 2651 pio_string_write(pio_dev, vcpu);
2577 complete_pio(vcpu); 2652 complete_pio(vcpu);
2578 if (vcpu->arch.pio.count == 0) 2653 if (vcpu->arch.pio.count == 0)
@@ -2587,9 +2662,72 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2587} 2662}
2588EXPORT_SYMBOL_GPL(kvm_emulate_pio_string); 2663EXPORT_SYMBOL_GPL(kvm_emulate_pio_string);
2589 2664
2665static void bounce_off(void *info)
2666{
2667 /* nothing */
2668}
2669
2670static unsigned int ref_freq;
2671static unsigned long tsc_khz_ref;
2672
2673static int kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
2674 void *data)
2675{
2676 struct cpufreq_freqs *freq = data;
2677 struct kvm *kvm;
2678 struct kvm_vcpu *vcpu;
2679 int i, send_ipi = 0;
2680
2681 if (!ref_freq)
2682 ref_freq = freq->old;
2683
2684 if (val == CPUFREQ_PRECHANGE && freq->old > freq->new)
2685 return 0;
2686 if (val == CPUFREQ_POSTCHANGE && freq->old < freq->new)
2687 return 0;
2688 per_cpu(cpu_tsc_khz, freq->cpu) = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new);
2689
2690 spin_lock(&kvm_lock);
2691 list_for_each_entry(kvm, &vm_list, vm_list) {
2692 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
2693 vcpu = kvm->vcpus[i];
2694 if (!vcpu)
2695 continue;
2696 if (vcpu->cpu != freq->cpu)
2697 continue;
2698 if (!kvm_request_guest_time_update(vcpu))
2699 continue;
2700 if (vcpu->cpu != smp_processor_id())
2701 send_ipi++;
2702 }
2703 }
2704 spin_unlock(&kvm_lock);
2705
2706 if (freq->old < freq->new && send_ipi) {
2707 /*
2708 * We upscale the frequency. Must make the guest
2709 * doesn't see old kvmclock values while running with
2710 * the new frequency, otherwise we risk the guest sees
2711 * time go backwards.
2712 *
2713 * In case we update the frequency for another cpu
2714 * (which might be in guest context) send an interrupt
2715 * to kick the cpu out of guest context. Next time
2716 * guest context is entered kvmclock will be updated,
2717 * so the guest will not see stale values.
2718 */
2719 smp_call_function_single(freq->cpu, bounce_off, NULL, 1);
2720 }
2721 return 0;
2722}
2723
2724static struct notifier_block kvmclock_cpufreq_notifier_block = {
2725 .notifier_call = kvmclock_cpufreq_notifier
2726};
2727
2590int kvm_arch_init(void *opaque) 2728int kvm_arch_init(void *opaque)
2591{ 2729{
2592 int r; 2730 int r, cpu;
2593 struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque; 2731 struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque;
2594 2732
2595 if (kvm_x86_ops) { 2733 if (kvm_x86_ops) {
@@ -2620,6 +2758,15 @@ int kvm_arch_init(void *opaque)
2620 kvm_mmu_set_base_ptes(PT_PRESENT_MASK); 2758 kvm_mmu_set_base_ptes(PT_PRESENT_MASK);
2621 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK, 2759 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
2622 PT_DIRTY_MASK, PT64_NX_MASK, 0, 0); 2760 PT_DIRTY_MASK, PT64_NX_MASK, 0, 0);
2761
2762 for_each_possible_cpu(cpu)
2763 per_cpu(cpu_tsc_khz, cpu) = tsc_khz;
2764 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
2765 tsc_khz_ref = tsc_khz;
2766 cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
2767 CPUFREQ_TRANSITION_NOTIFIER);
2768 }
2769
2623 return 0; 2770 return 0;
2624 2771
2625out: 2772out:
@@ -2827,25 +2974,20 @@ static int is_matching_cpuid_entry(struct kvm_cpuid_entry2 *e,
2827 if ((e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && e->index != index) 2974 if ((e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && e->index != index)
2828 return 0; 2975 return 0;
2829 if ((e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC) && 2976 if ((e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC) &&
2830 !(e->flags & KVM_CPUID_FLAG_STATE_READ_NEXT)) 2977 !(e->flags & KVM_CPUID_FLAG_STATE_READ_NEXT))
2831 return 0; 2978 return 0;
2832 return 1; 2979 return 1;
2833} 2980}
2834 2981
2835void kvm_emulate_cpuid(struct kvm_vcpu *vcpu) 2982struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
2983 u32 function, u32 index)
2836{ 2984{
2837 int i; 2985 int i;
2838 u32 function, index; 2986 struct kvm_cpuid_entry2 *best = NULL;
2839 struct kvm_cpuid_entry2 *e, *best;
2840 2987
2841 function = kvm_register_read(vcpu, VCPU_REGS_RAX);
2842 index = kvm_register_read(vcpu, VCPU_REGS_RCX);
2843 kvm_register_write(vcpu, VCPU_REGS_RAX, 0);
2844 kvm_register_write(vcpu, VCPU_REGS_RBX, 0);
2845 kvm_register_write(vcpu, VCPU_REGS_RCX, 0);
2846 kvm_register_write(vcpu, VCPU_REGS_RDX, 0);
2847 best = NULL;
2848 for (i = 0; i < vcpu->arch.cpuid_nent; ++i) { 2988 for (i = 0; i < vcpu->arch.cpuid_nent; ++i) {
2989 struct kvm_cpuid_entry2 *e;
2990
2849 e = &vcpu->arch.cpuid_entries[i]; 2991 e = &vcpu->arch.cpuid_entries[i];
2850 if (is_matching_cpuid_entry(e, function, index)) { 2992 if (is_matching_cpuid_entry(e, function, index)) {
2851 if (e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC) 2993 if (e->flags & KVM_CPUID_FLAG_STATEFUL_FUNC)
@@ -2860,6 +3002,21 @@ void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
2860 if (!best || e->function > best->function) 3002 if (!best || e->function > best->function)
2861 best = e; 3003 best = e;
2862 } 3004 }
3005 return best;
3006}
3007
3008void kvm_emulate_cpuid(struct kvm_vcpu *vcpu)
3009{
3010 u32 function, index;
3011 struct kvm_cpuid_entry2 *best;
3012
3013 function = kvm_register_read(vcpu, VCPU_REGS_RAX);
3014 index = kvm_register_read(vcpu, VCPU_REGS_RCX);
3015 kvm_register_write(vcpu, VCPU_REGS_RAX, 0);
3016 kvm_register_write(vcpu, VCPU_REGS_RBX, 0);
3017 kvm_register_write(vcpu, VCPU_REGS_RCX, 0);
3018 kvm_register_write(vcpu, VCPU_REGS_RDX, 0);
3019 best = kvm_find_cpuid_entry(vcpu, function, index);
2863 if (best) { 3020 if (best) {
2864 kvm_register_write(vcpu, VCPU_REGS_RAX, best->eax); 3021 kvm_register_write(vcpu, VCPU_REGS_RAX, best->eax);
2865 kvm_register_write(vcpu, VCPU_REGS_RBX, best->ebx); 3022 kvm_register_write(vcpu, VCPU_REGS_RBX, best->ebx);
@@ -2945,6 +3102,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2945 if (vcpu->requests) { 3102 if (vcpu->requests) {
2946 if (test_and_clear_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests)) 3103 if (test_and_clear_bit(KVM_REQ_MIGRATE_TIMER, &vcpu->requests))
2947 __kvm_migrate_timers(vcpu); 3104 __kvm_migrate_timers(vcpu);
3105 if (test_and_clear_bit(KVM_REQ_KVMCLOCK_UPDATE, &vcpu->requests))
3106 kvm_write_guest_time(vcpu);
2948 if (test_and_clear_bit(KVM_REQ_MMU_SYNC, &vcpu->requests)) 3107 if (test_and_clear_bit(KVM_REQ_MMU_SYNC, &vcpu->requests))
2949 kvm_mmu_sync_roots(vcpu); 3108 kvm_mmu_sync_roots(vcpu);
2950 if (test_and_clear_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests)) 3109 if (test_and_clear_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests))
@@ -2979,9 +3138,6 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2979 goto out; 3138 goto out;
2980 } 3139 }
2981 3140
2982 if (vcpu->guest_debug.enabled)
2983 kvm_x86_ops->guest_debug_pre(vcpu);
2984
2985 vcpu->guest_mode = 1; 3141 vcpu->guest_mode = 1;
2986 /* 3142 /*
2987 * Make sure that guest_mode assignment won't happen after 3143 * Make sure that guest_mode assignment won't happen after
@@ -3002,10 +3158,34 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3002 3158
3003 kvm_guest_enter(); 3159 kvm_guest_enter();
3004 3160
3161 get_debugreg(vcpu->arch.host_dr6, 6);
3162 get_debugreg(vcpu->arch.host_dr7, 7);
3163 if (unlikely(vcpu->arch.switch_db_regs)) {
3164 get_debugreg(vcpu->arch.host_db[0], 0);
3165 get_debugreg(vcpu->arch.host_db[1], 1);
3166 get_debugreg(vcpu->arch.host_db[2], 2);
3167 get_debugreg(vcpu->arch.host_db[3], 3);
3168
3169 set_debugreg(0, 7);
3170 set_debugreg(vcpu->arch.eff_db[0], 0);
3171 set_debugreg(vcpu->arch.eff_db[1], 1);
3172 set_debugreg(vcpu->arch.eff_db[2], 2);
3173 set_debugreg(vcpu->arch.eff_db[3], 3);
3174 }
3005 3175
3006 KVMTRACE_0D(VMENTRY, vcpu, entryexit); 3176 KVMTRACE_0D(VMENTRY, vcpu, entryexit);
3007 kvm_x86_ops->run(vcpu, kvm_run); 3177 kvm_x86_ops->run(vcpu, kvm_run);
3008 3178
3179 if (unlikely(vcpu->arch.switch_db_regs)) {
3180 set_debugreg(0, 7);
3181 set_debugreg(vcpu->arch.host_db[0], 0);
3182 set_debugreg(vcpu->arch.host_db[1], 1);
3183 set_debugreg(vcpu->arch.host_db[2], 2);
3184 set_debugreg(vcpu->arch.host_db[3], 3);
3185 }
3186 set_debugreg(vcpu->arch.host_dr6, 6);
3187 set_debugreg(vcpu->arch.host_dr7, 7);
3188
3009 vcpu->guest_mode = 0; 3189 vcpu->guest_mode = 0;
3010 local_irq_enable(); 3190 local_irq_enable();
3011 3191
@@ -3192,7 +3372,7 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
3192 /* 3372 /*
3193 * Don't leak debug flags in case they were set for guest debugging 3373 * Don't leak debug flags in case they were set for guest debugging
3194 */ 3374 */
3195 if (vcpu->guest_debug.enabled && vcpu->guest_debug.singlestep) 3375 if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
3196 regs->rflags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF); 3376 regs->rflags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF);
3197 3377
3198 vcpu_put(vcpu); 3378 vcpu_put(vcpu);
@@ -3811,15 +3991,32 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
3811 return 0; 3991 return 0;
3812} 3992}
3813 3993
3814int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, 3994int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
3815 struct kvm_debug_guest *dbg) 3995 struct kvm_guest_debug *dbg)
3816{ 3996{
3817 int r; 3997 int i, r;
3818 3998
3819 vcpu_load(vcpu); 3999 vcpu_load(vcpu);
3820 4000
4001 if ((dbg->control & (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP)) ==
4002 (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW_BP)) {
4003 for (i = 0; i < KVM_NR_DB_REGS; ++i)
4004 vcpu->arch.eff_db[i] = dbg->arch.debugreg[i];
4005 vcpu->arch.switch_db_regs =
4006 (dbg->arch.debugreg[7] & DR7_BP_EN_MASK);
4007 } else {
4008 for (i = 0; i < KVM_NR_DB_REGS; i++)
4009 vcpu->arch.eff_db[i] = vcpu->arch.db[i];
4010 vcpu->arch.switch_db_regs = (vcpu->arch.dr7 & DR7_BP_EN_MASK);
4011 }
4012
3821 r = kvm_x86_ops->set_guest_debug(vcpu, dbg); 4013 r = kvm_x86_ops->set_guest_debug(vcpu, dbg);
3822 4014
4015 if (dbg->control & KVM_GUESTDBG_INJECT_DB)
4016 kvm_queue_exception(vcpu, DB_VECTOR);
4017 else if (dbg->control & KVM_GUESTDBG_INJECT_BP)
4018 kvm_queue_exception(vcpu, BP_VECTOR);
4019
3823 vcpu_put(vcpu); 4020 vcpu_put(vcpu);
3824 4021
3825 return r; 4022 return r;
@@ -4007,6 +4204,11 @@ int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu)
4007 vcpu->arch.nmi_pending = false; 4204 vcpu->arch.nmi_pending = false;
4008 vcpu->arch.nmi_injected = false; 4205 vcpu->arch.nmi_injected = false;
4009 4206
4207 vcpu->arch.switch_db_regs = 0;
4208 memset(vcpu->arch.db, 0, sizeof(vcpu->arch.db));
4209 vcpu->arch.dr6 = DR6_FIXED_1;
4210 vcpu->arch.dr7 = DR7_FIXED_1;
4211
4010 return kvm_x86_ops->vcpu_reset(vcpu); 4212 return kvm_x86_ops->vcpu_reset(vcpu);
4011} 4213}
4012 4214
@@ -4100,6 +4302,8 @@ struct kvm *kvm_arch_create_vm(void)
4100 /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */ 4302 /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */
4101 set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap); 4303 set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap);
4102 4304
4305 rdtscll(kvm->arch.vm_init_tsc);
4306
4103 return kvm; 4307 return kvm;
4104} 4308}
4105 4309
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index d174db7a3370..ca91749d2083 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -178,7 +178,7 @@ static u32 opcode_table[256] = {
178 0, ImplicitOps | Stack, 0, 0, 178 0, ImplicitOps | Stack, 0, 0,
179 ByteOp | DstMem | SrcImm | ModRM | Mov, DstMem | SrcImm | ModRM | Mov, 179 ByteOp | DstMem | SrcImm | ModRM | Mov, DstMem | SrcImm | ModRM | Mov,
180 /* 0xC8 - 0xCF */ 180 /* 0xC8 - 0xCF */
181 0, 0, 0, 0, 0, 0, 0, 0, 181 0, 0, 0, ImplicitOps | Stack, 0, 0, 0, 0,
182 /* 0xD0 - 0xD7 */ 182 /* 0xD0 - 0xD7 */
183 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM, 183 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM,
184 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM, 184 ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM,
@@ -1136,18 +1136,19 @@ static inline void emulate_push(struct x86_emulate_ctxt *ctxt)
1136} 1136}
1137 1137
1138static int emulate_pop(struct x86_emulate_ctxt *ctxt, 1138static int emulate_pop(struct x86_emulate_ctxt *ctxt,
1139 struct x86_emulate_ops *ops) 1139 struct x86_emulate_ops *ops,
1140 void *dest, int len)
1140{ 1141{
1141 struct decode_cache *c = &ctxt->decode; 1142 struct decode_cache *c = &ctxt->decode;
1142 int rc; 1143 int rc;
1143 1144
1144 rc = ops->read_emulated(register_address(c, ss_base(ctxt), 1145 rc = ops->read_emulated(register_address(c, ss_base(ctxt),
1145 c->regs[VCPU_REGS_RSP]), 1146 c->regs[VCPU_REGS_RSP]),
1146 &c->src.val, c->src.bytes, ctxt->vcpu); 1147 dest, len, ctxt->vcpu);
1147 if (rc != 0) 1148 if (rc != 0)
1148 return rc; 1149 return rc;
1149 1150
1150 register_address_increment(c, &c->regs[VCPU_REGS_RSP], c->src.bytes); 1151 register_address_increment(c, &c->regs[VCPU_REGS_RSP], len);
1151 return rc; 1152 return rc;
1152} 1153}
1153 1154
@@ -1157,11 +1158,9 @@ static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt,
1157 struct decode_cache *c = &ctxt->decode; 1158 struct decode_cache *c = &ctxt->decode;
1158 int rc; 1159 int rc;
1159 1160
1160 c->src.bytes = c->dst.bytes; 1161 rc = emulate_pop(ctxt, ops, &c->dst.val, c->dst.bytes);
1161 rc = emulate_pop(ctxt, ops);
1162 if (rc != 0) 1162 if (rc != 0)
1163 return rc; 1163 return rc;
1164 c->dst.val = c->src.val;
1165 return 0; 1164 return 0;
1166} 1165}
1167 1166
@@ -1279,6 +1278,25 @@ static inline int emulate_grp9(struct x86_emulate_ctxt *ctxt,
1279 return 0; 1278 return 0;
1280} 1279}
1281 1280
1281static int emulate_ret_far(struct x86_emulate_ctxt *ctxt,
1282 struct x86_emulate_ops *ops)
1283{
1284 struct decode_cache *c = &ctxt->decode;
1285 int rc;
1286 unsigned long cs;
1287
1288 rc = emulate_pop(ctxt, ops, &c->eip, c->op_bytes);
1289 if (rc)
1290 return rc;
1291 if (c->op_bytes == 4)
1292 c->eip = (u32)c->eip;
1293 rc = emulate_pop(ctxt, ops, &cs, c->op_bytes);
1294 if (rc)
1295 return rc;
1296 rc = kvm_load_segment_descriptor(ctxt->vcpu, (u16)cs, 1, VCPU_SREG_CS);
1297 return rc;
1298}
1299
1282static inline int writeback(struct x86_emulate_ctxt *ctxt, 1300static inline int writeback(struct x86_emulate_ctxt *ctxt,
1283 struct x86_emulate_ops *ops) 1301 struct x86_emulate_ops *ops)
1284{ 1302{
@@ -1467,11 +1485,9 @@ special_insn:
1467 break; 1485 break;
1468 case 0x58 ... 0x5f: /* pop reg */ 1486 case 0x58 ... 0x5f: /* pop reg */
1469 pop_instruction: 1487 pop_instruction:
1470 c->src.bytes = c->op_bytes; 1488 rc = emulate_pop(ctxt, ops, &c->dst.val, c->op_bytes);
1471 rc = emulate_pop(ctxt, ops);
1472 if (rc != 0) 1489 if (rc != 0)
1473 goto done; 1490 goto done;
1474 c->dst.val = c->src.val;
1475 break; 1491 break;
1476 case 0x63: /* movsxd */ 1492 case 0x63: /* movsxd */
1477 if (ctxt->mode != X86EMUL_MODE_PROT64) 1493 if (ctxt->mode != X86EMUL_MODE_PROT64)
@@ -1738,6 +1754,11 @@ special_insn:
1738 mov: 1754 mov:
1739 c->dst.val = c->src.val; 1755 c->dst.val = c->src.val;
1740 break; 1756 break;
1757 case 0xcb: /* ret far */
1758 rc = emulate_ret_far(ctxt, ops);
1759 if (rc)
1760 goto done;
1761 break;
1741 case 0xd0 ... 0xd1: /* Grp2 */ 1762 case 0xd0 ... 0xd1: /* Grp2 */
1742 c->src.val = 1; 1763 c->src.val = 1;
1743 emulate_grp2(ctxt); 1764 emulate_grp2(ctxt);
@@ -1908,11 +1929,16 @@ twobyte_insn:
1908 c->dst.type = OP_NONE; 1929 c->dst.type = OP_NONE;
1909 break; 1930 break;
1910 case 3: /* lidt/vmmcall */ 1931 case 3: /* lidt/vmmcall */
1911 if (c->modrm_mod == 3 && c->modrm_rm == 1) { 1932 if (c->modrm_mod == 3) {
1912 rc = kvm_fix_hypercall(ctxt->vcpu); 1933 switch (c->modrm_rm) {
1913 if (rc) 1934 case 1:
1914 goto done; 1935 rc = kvm_fix_hypercall(ctxt->vcpu);
1915 kvm_emulate_hypercall(ctxt->vcpu); 1936 if (rc)
1937 goto done;
1938 break;
1939 default:
1940 goto cannot_emulate;
1941 }
1916 } else { 1942 } else {
1917 rc = read_descriptor(ctxt, ops, c->src.ptr, 1943 rc = read_descriptor(ctxt, ops, c->src.ptr,
1918 &size, &address, 1944 &size, &address,
diff --git a/arch/x86/lguest/Kconfig b/arch/x86/lguest/Kconfig
index c70e12b1a637..8dab8f7844d3 100644
--- a/arch/x86/lguest/Kconfig
+++ b/arch/x86/lguest/Kconfig
@@ -3,7 +3,6 @@ config LGUEST_GUEST
3 select PARAVIRT 3 select PARAVIRT
4 depends on X86_32 4 depends on X86_32
5 depends on !X86_PAE 5 depends on !X86_PAE
6 depends on !X86_VOYAGER
7 select VIRTIO 6 select VIRTIO
8 select VIRTIO_RING 7 select VIRTIO_RING
9 select VIRTIO_CONSOLE 8 select VIRTIO_CONSOLE
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 960a8d9c049c..9fe4ddaa8f6f 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -173,24 +173,29 @@ static unsigned long save_fl(void)
173{ 173{
174 return lguest_data.irq_enabled; 174 return lguest_data.irq_enabled;
175} 175}
176PV_CALLEE_SAVE_REGS_THUNK(save_fl);
176 177
177/* restore_flags() just sets the flags back to the value given. */ 178/* restore_flags() just sets the flags back to the value given. */
178static void restore_fl(unsigned long flags) 179static void restore_fl(unsigned long flags)
179{ 180{
180 lguest_data.irq_enabled = flags; 181 lguest_data.irq_enabled = flags;
181} 182}
183PV_CALLEE_SAVE_REGS_THUNK(restore_fl);
182 184
183/* Interrupts go off... */ 185/* Interrupts go off... */
184static void irq_disable(void) 186static void irq_disable(void)
185{ 187{
186 lguest_data.irq_enabled = 0; 188 lguest_data.irq_enabled = 0;
187} 189}
190PV_CALLEE_SAVE_REGS_THUNK(irq_disable);
188 191
189/* Interrupts go on... */ 192/* Interrupts go on... */
190static void irq_enable(void) 193static void irq_enable(void)
191{ 194{
192 lguest_data.irq_enabled = X86_EFLAGS_IF; 195 lguest_data.irq_enabled = X86_EFLAGS_IF;
193} 196}
197PV_CALLEE_SAVE_REGS_THUNK(irq_enable);
198
194/*:*/ 199/*:*/
195/*M:003 Note that we don't check for outstanding interrupts when we re-enable 200/*M:003 Note that we don't check for outstanding interrupts when we re-enable
196 * them (or when we unmask an interrupt). This seems to work for the moment, 201 * them (or when we unmask an interrupt). This seems to work for the moment,
@@ -278,7 +283,7 @@ static void lguest_load_tls(struct thread_struct *t, unsigned int cpu)
278 /* There's one problem which normal hardware doesn't have: the Host 283 /* There's one problem which normal hardware doesn't have: the Host
279 * can't handle us removing entries we're currently using. So we clear 284 * can't handle us removing entries we're currently using. So we clear
280 * the GS register here: if it's needed it'll be reloaded anyway. */ 285 * the GS register here: if it's needed it'll be reloaded anyway. */
281 loadsegment(gs, 0); 286 lazy_load_gs(0);
282 lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0); 287 lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0);
283} 288}
284 289
@@ -830,13 +835,14 @@ static u32 lguest_apic_safe_wait_icr_idle(void)
830 return 0; 835 return 0;
831} 836}
832 837
833static struct apic_ops lguest_basic_apic_ops = { 838static void set_lguest_basic_apic_ops(void)
834 .read = lguest_apic_read, 839{
835 .write = lguest_apic_write, 840 apic->read = lguest_apic_read;
836 .icr_read = lguest_apic_icr_read, 841 apic->write = lguest_apic_write;
837 .icr_write = lguest_apic_icr_write, 842 apic->icr_read = lguest_apic_icr_read;
838 .wait_icr_idle = lguest_apic_wait_icr_idle, 843 apic->icr_write = lguest_apic_icr_write;
839 .safe_wait_icr_idle = lguest_apic_safe_wait_icr_idle, 844 apic->wait_icr_idle = lguest_apic_wait_icr_idle;
845 apic->safe_wait_icr_idle = lguest_apic_safe_wait_icr_idle;
840}; 846};
841#endif 847#endif
842 848
@@ -991,10 +997,10 @@ __init void lguest_init(void)
991 997
992 /* interrupt-related operations */ 998 /* interrupt-related operations */
993 pv_irq_ops.init_IRQ = lguest_init_IRQ; 999 pv_irq_ops.init_IRQ = lguest_init_IRQ;
994 pv_irq_ops.save_fl = save_fl; 1000 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl);
995 pv_irq_ops.restore_fl = restore_fl; 1001 pv_irq_ops.restore_fl = PV_CALLEE_SAVE(restore_fl);
996 pv_irq_ops.irq_disable = irq_disable; 1002 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(irq_disable);
997 pv_irq_ops.irq_enable = irq_enable; 1003 pv_irq_ops.irq_enable = PV_CALLEE_SAVE(irq_enable);
998 pv_irq_ops.safe_halt = lguest_safe_halt; 1004 pv_irq_ops.safe_halt = lguest_safe_halt;
999 1005
1000 /* init-time operations */ 1006 /* init-time operations */
@@ -1037,7 +1043,7 @@ __init void lguest_init(void)
1037 1043
1038#ifdef CONFIG_X86_LOCAL_APIC 1044#ifdef CONFIG_X86_LOCAL_APIC
1039 /* apic read/write intercepts */ 1045 /* apic read/write intercepts */
1040 apic_ops = &lguest_basic_apic_ops; 1046 set_lguest_basic_apic_ops();
1041#endif 1047#endif
1042 1048
1043 /* time operations */ 1049 /* time operations */
diff --git a/arch/x86/lib/getuser.S b/arch/x86/lib/getuser.S
index ad374003742f..51f1504cddd9 100644
--- a/arch/x86/lib/getuser.S
+++ b/arch/x86/lib/getuser.S
@@ -28,7 +28,7 @@
28 28
29#include <linux/linkage.h> 29#include <linux/linkage.h>
30#include <asm/dwarf2.h> 30#include <asm/dwarf2.h>
31#include <asm/page.h> 31#include <asm/page_types.h>
32#include <asm/errno.h> 32#include <asm/errno.h>
33#include <asm/asm-offsets.h> 33#include <asm/asm-offsets.h>
34#include <asm/thread_info.h> 34#include <asm/thread_info.h>
diff --git a/arch/x86/mach-default/Makefile b/arch/x86/mach-default/Makefile
deleted file mode 100644
index 012fe34459e6..000000000000
--- a/arch/x86/mach-default/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := setup.o
diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c
deleted file mode 100644
index 50b591871128..000000000000
--- a/arch/x86/mach-default/setup.c
+++ /dev/null
@@ -1,174 +0,0 @@
1/*
2 * Machine specific setup for generic
3 */
4
5#include <linux/smp.h>
6#include <linux/init.h>
7#include <linux/interrupt.h>
8#include <asm/acpi.h>
9#include <asm/arch_hooks.h>
10#include <asm/e820.h>
11#include <asm/setup.h>
12
13#include <mach_ipi.h>
14
15#ifdef CONFIG_HOTPLUG_CPU
16#define DEFAULT_SEND_IPI (1)
17#else
18#define DEFAULT_SEND_IPI (0)
19#endif
20
21int no_broadcast = DEFAULT_SEND_IPI;
22
23/**
24 * pre_intr_init_hook - initialisation prior to setting up interrupt vectors
25 *
26 * Description:
27 * Perform any necessary interrupt initialisation prior to setting up
28 * the "ordinary" interrupt call gates. For legacy reasons, the ISA
29 * interrupts should be initialised here if the machine emulates a PC
30 * in any way.
31 **/
32void __init pre_intr_init_hook(void)
33{
34 if (x86_quirks->arch_pre_intr_init) {
35 if (x86_quirks->arch_pre_intr_init())
36 return;
37 }
38 init_ISA_irqs();
39}
40
41/*
42 * IRQ2 is cascade interrupt to second interrupt controller
43 */
44static struct irqaction irq2 = {
45 .handler = no_action,
46 .mask = CPU_MASK_NONE,
47 .name = "cascade",
48};
49
50/**
51 * intr_init_hook - post gate setup interrupt initialisation
52 *
53 * Description:
54 * Fill in any interrupts that may have been left out by the general
55 * init_IRQ() routine. interrupts having to do with the machine rather
56 * than the devices on the I/O bus (like APIC interrupts in intel MP
57 * systems) are started here.
58 **/
59void __init intr_init_hook(void)
60{
61 if (x86_quirks->arch_intr_init) {
62 if (x86_quirks->arch_intr_init())
63 return;
64 }
65 if (!acpi_ioapic)
66 setup_irq(2, &irq2);
67
68}
69
70/**
71 * pre_setup_arch_hook - hook called prior to any setup_arch() execution
72 *
73 * Description:
74 * generally used to activate any machine specific identification
75 * routines that may be needed before setup_arch() runs. On Voyager
76 * this is used to get the board revision and type.
77 **/
78void __init pre_setup_arch_hook(void)
79{
80}
81
82/**
83 * trap_init_hook - initialise system specific traps
84 *
85 * Description:
86 * Called as the final act of trap_init(). Used in VISWS to initialise
87 * the various board specific APIC traps.
88 **/
89void __init trap_init_hook(void)
90{
91 if (x86_quirks->arch_trap_init) {
92 if (x86_quirks->arch_trap_init())
93 return;
94 }
95}
96
97static struct irqaction irq0 = {
98 .handler = timer_interrupt,
99 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
100 .mask = CPU_MASK_NONE,
101 .name = "timer"
102};
103
104/**
105 * pre_time_init_hook - do any specific initialisations before.
106 *
107 **/
108void __init pre_time_init_hook(void)
109{
110 if (x86_quirks->arch_pre_time_init)
111 x86_quirks->arch_pre_time_init();
112}
113
114/**
115 * time_init_hook - do any specific initialisations for the system timer.
116 *
117 * Description:
118 * Must plug the system timer interrupt source at HZ into the IRQ listed
119 * in irq_vectors.h:TIMER_IRQ
120 **/
121void __init time_init_hook(void)
122{
123 if (x86_quirks->arch_time_init) {
124 /*
125 * A nonzero return code does not mean failure, it means
126 * that the architecture quirk does not want any
127 * generic (timer) setup to be performed after this:
128 */
129 if (x86_quirks->arch_time_init())
130 return;
131 }
132
133 irq0.mask = cpumask_of_cpu(0);
134 setup_irq(0, &irq0);
135}
136
137#ifdef CONFIG_MCA
138/**
139 * mca_nmi_hook - hook into MCA specific NMI chain
140 *
141 * Description:
142 * The MCA (Microchannel Architecture) has an NMI chain for NMI sources
143 * along the MCA bus. Use this to hook into that chain if you will need
144 * it.
145 **/
146void mca_nmi_hook(void)
147{
148 /*
149 * If I recall correctly, there's a whole bunch of other things that
150 * we can do to check for NMI problems, but that's all I know about
151 * at the moment.
152 */
153 pr_warning("NMI generated from unknown source!\n");
154}
155#endif
156
157static __init int no_ipi_broadcast(char *str)
158{
159 get_option(&str, &no_broadcast);
160 pr_info("Using %s mode\n",
161 no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
162 return 1;
163}
164__setup("no_ipi_broadcast=", no_ipi_broadcast);
165
166static int __init print_ipi_mode(void)
167{
168 pr_info("Using IPI %s mode\n",
169 no_broadcast ? "No-Shortcut" : "Shortcut");
170 return 0;
171}
172
173late_initcall(print_ipi_mode);
174
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
deleted file mode 100644
index 6730f4e7c744..000000000000
--- a/arch/x86/mach-generic/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
1#
2# Makefile for the generic architecture
3#
4
5EXTRA_CFLAGS := -Iarch/x86/kernel
6
7obj-y := probe.o default.o
8obj-$(CONFIG_X86_NUMAQ) += numaq.o
9obj-$(CONFIG_X86_SUMMIT) += summit.o
10obj-$(CONFIG_X86_BIGSMP) += bigsmp.o
11obj-$(CONFIG_X86_ES7000) += es7000.o
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
deleted file mode 100644
index bc4c7840b2a8..000000000000
--- a/arch/x86/mach-generic/bigsmp.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
3 * Drives the local APIC in "clustered mode".
4 */
5#define APIC_DEFINITION 1
6#include <linux/threads.h>
7#include <linux/cpumask.h>
8#include <asm/mpspec.h>
9#include <asm/genapic.h>
10#include <asm/fixmap.h>
11#include <asm/apicdef.h>
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/dmi.h>
15#include <asm/bigsmp/apicdef.h>
16#include <linux/smp.h>
17#include <asm/bigsmp/apic.h>
18#include <asm/bigsmp/ipi.h>
19#include <asm/mach-default/mach_mpparse.h>
20#include <asm/mach-default/mach_wakecpu.h>
21
22static int dmi_bigsmp; /* can be set by dmi scanners */
23
24static int hp_ht_bigsmp(const struct dmi_system_id *d)
25{
26 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
27 dmi_bigsmp = 1;
28 return 0;
29}
30
31
32static const struct dmi_system_id bigsmp_dmi_table[] = {
33 { hp_ht_bigsmp, "HP ProLiant DL760 G2",
34 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
35 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),}
36 },
37
38 { hp_ht_bigsmp, "HP ProLiant DL740",
39 { DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
40 DMI_MATCH(DMI_BIOS_VERSION, "P47-"),}
41 },
42 { }
43};
44
45static void vector_allocation_domain(int cpu, cpumask_t *retmask)
46{
47 cpus_clear(*retmask);
48 cpu_set(cpu, *retmask);
49}
50
51static int probe_bigsmp(void)
52{
53 if (def_to_bigsmp)
54 dmi_bigsmp = 1;
55 else
56 dmi_check_system(bigsmp_dmi_table);
57 return dmi_bigsmp;
58}
59
60struct genapic apic_bigsmp = APIC_INIT("bigsmp", probe_bigsmp);
diff --git a/arch/x86/mach-generic/default.c b/arch/x86/mach-generic/default.c
deleted file mode 100644
index e63a4a76d8cd..000000000000
--- a/arch/x86/mach-generic/default.c
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Default generic APIC driver. This handles up to 8 CPUs.
3 */
4#define APIC_DEFINITION 1
5#include <linux/threads.h>
6#include <linux/cpumask.h>
7#include <asm/mpspec.h>
8#include <asm/mach-default/mach_apicdef.h>
9#include <asm/genapic.h>
10#include <asm/fixmap.h>
11#include <asm/apicdef.h>
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/smp.h>
15#include <linux/init.h>
16#include <asm/mach-default/mach_apic.h>
17#include <asm/mach-default/mach_ipi.h>
18#include <asm/mach-default/mach_mpparse.h>
19#include <asm/mach-default/mach_wakecpu.h>
20
21/* should be called last. */
22static int probe_default(void)
23{
24 return 1;
25}
26
27struct genapic apic_default = APIC_INIT("default", probe_default);
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
deleted file mode 100644
index c2ded1448024..000000000000
--- a/arch/x86/mach-generic/es7000.c
+++ /dev/null
@@ -1,103 +0,0 @@
1/*
2 * APIC driver for the Unisys ES7000 chipset.
3 */
4#define APIC_DEFINITION 1
5#include <linux/threads.h>
6#include <linux/cpumask.h>
7#include <asm/mpspec.h>
8#include <asm/genapic.h>
9#include <asm/fixmap.h>
10#include <asm/apicdef.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/init.h>
14#include <asm/es7000/apicdef.h>
15#include <linux/smp.h>
16#include <asm/es7000/apic.h>
17#include <asm/es7000/ipi.h>
18#include <asm/es7000/mpparse.h>
19#include <asm/mach-default/mach_wakecpu.h>
20
21void __init es7000_update_genapic_to_cluster(void)
22{
23 genapic->target_cpus = target_cpus_cluster;
24 genapic->int_delivery_mode = INT_DELIVERY_MODE_CLUSTER;
25 genapic->int_dest_mode = INT_DEST_MODE_CLUSTER;
26 genapic->no_balance_irq = NO_BALANCE_IRQ_CLUSTER;
27
28 genapic->init_apic_ldr = init_apic_ldr_cluster;
29
30 genapic->cpu_mask_to_apicid = cpu_mask_to_apicid_cluster;
31}
32
33static int probe_es7000(void)
34{
35 /* probed later in mptable/ACPI hooks */
36 return 0;
37}
38
39extern void es7000_sw_apic(void);
40static void __init enable_apic_mode(void)
41{
42 es7000_sw_apic();
43 return;
44}
45
46static __init int
47mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
48{
49 if (mpc->oemptr) {
50 struct mpc_oemtable *oem_table =
51 (struct mpc_oemtable *)mpc->oemptr;
52 if (!strncmp(oem, "UNISYS", 6))
53 return parse_unisys_oem((char *)oem_table);
54 }
55 return 0;
56}
57
58#ifdef CONFIG_ACPI
59/* Hook from generic ACPI tables.c */
60static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
61{
62 unsigned long oem_addr = 0;
63 int check_dsdt;
64 int ret = 0;
65
66 /* check dsdt at first to avoid clear fix_map for oem_addr */
67 check_dsdt = es7000_check_dsdt();
68
69 if (!find_unisys_acpi_oem_table(&oem_addr)) {
70 if (check_dsdt)
71 ret = parse_unisys_oem((char *)oem_addr);
72 else {
73 setup_unisys();
74 ret = 1;
75 }
76 /*
77 * we need to unmap it
78 */
79 unmap_unisys_acpi_oem_table(oem_addr);
80 }
81 return ret;
82}
83#else
84static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
85{
86 return 0;
87}
88#endif
89
90static void vector_allocation_domain(int cpu, cpumask_t *retmask)
91{
92 /* Careful. Some cpus do not strictly honor the set of cpus
93 * specified in the interrupt destination when using lowest
94 * priority interrupt delivery mode.
95 *
96 * In particular there was a hyperthreading cpu observed to
97 * deliver interrupts to the wrong hyperthread when only one
98 * hyperthread was specified in the interrupt desitination.
99 */
100 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
101}
102
103struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000);
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
deleted file mode 100644
index 3679e2255645..000000000000
--- a/arch/x86/mach-generic/numaq.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * APIC driver for the IBM NUMAQ chipset.
3 */
4#define APIC_DEFINITION 1
5#include <linux/threads.h>
6#include <linux/cpumask.h>
7#include <asm/mpspec.h>
8#include <asm/genapic.h>
9#include <asm/fixmap.h>
10#include <asm/apicdef.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/init.h>
14#include <asm/numaq/apicdef.h>
15#include <linux/smp.h>
16#include <asm/numaq/apic.h>
17#include <asm/numaq/ipi.h>
18#include <asm/numaq/mpparse.h>
19#include <asm/numaq/wakecpu.h>
20#include <asm/numaq.h>
21
22static int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
23{
24 numaq_mps_oem_check(mpc, oem, productid);
25 return found_numaq;
26}
27
28static int probe_numaq(void)
29{
30 /* already know from get_memcfg_numaq() */
31 return found_numaq;
32}
33
34/* Hook from generic ACPI tables.c */
35static int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
36{
37 return 0;
38}
39
40static void vector_allocation_domain(int cpu, cpumask_t *retmask)
41{
42 /* Careful. Some cpus do not strictly honor the set of cpus
43 * specified in the interrupt destination when using lowest
44 * priority interrupt delivery mode.
45 *
46 * In particular there was a hyperthreading cpu observed to
47 * deliver interrupts to the wrong hyperthread when only one
48 * hyperthread was specified in the interrupt desitination.
49 */
50 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
51}
52
53struct genapic apic_numaq = APIC_INIT("NUMAQ", probe_numaq);
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
deleted file mode 100644
index 15a38daef1a8..000000000000
--- a/arch/x86/mach-generic/probe.c
+++ /dev/null
@@ -1,152 +0,0 @@
1/*
2 * Copyright 2003 Andi Kleen, SuSE Labs.
3 * Subject to the GNU Public License, v.2
4 *
5 * Generic x86 APIC driver probe layer.
6 */
7#include <linux/threads.h>
8#include <linux/cpumask.h>
9#include <linux/string.h>
10#include <linux/kernel.h>
11#include <linux/ctype.h>
12#include <linux/init.h>
13#include <linux/errno.h>
14#include <asm/fixmap.h>
15#include <asm/mpspec.h>
16#include <asm/apicdef.h>
17#include <asm/genapic.h>
18#include <asm/setup.h>
19
20extern struct genapic apic_numaq;
21extern struct genapic apic_summit;
22extern struct genapic apic_bigsmp;
23extern struct genapic apic_es7000;
24extern struct genapic apic_default;
25
26struct genapic *genapic = &apic_default;
27
28static struct genapic *apic_probe[] __initdata = {
29#ifdef CONFIG_X86_NUMAQ
30 &apic_numaq,
31#endif
32#ifdef CONFIG_X86_SUMMIT
33 &apic_summit,
34#endif
35#ifdef CONFIG_X86_BIGSMP
36 &apic_bigsmp,
37#endif
38#ifdef CONFIG_X86_ES7000
39 &apic_es7000,
40#endif
41 &apic_default, /* must be last */
42 NULL,
43};
44
45static int cmdline_apic __initdata;
46static int __init parse_apic(char *arg)
47{
48 int i;
49
50 if (!arg)
51 return -EINVAL;
52
53 for (i = 0; apic_probe[i]; i++) {
54 if (!strcmp(apic_probe[i]->name, arg)) {
55 genapic = apic_probe[i];
56 cmdline_apic = 1;
57 return 0;
58 }
59 }
60
61 if (x86_quirks->update_genapic)
62 x86_quirks->update_genapic();
63
64 /* Parsed again by __setup for debug/verbose */
65 return 0;
66}
67early_param("apic", parse_apic);
68
69void __init generic_bigsmp_probe(void)
70{
71#ifdef CONFIG_X86_BIGSMP
72 /*
73 * This routine is used to switch to bigsmp mode when
74 * - There is no apic= option specified by the user
75 * - generic_apic_probe() has chosen apic_default as the sub_arch
76 * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
77 */
78
79 if (!cmdline_apic && genapic == &apic_default) {
80 if (apic_bigsmp.probe()) {
81 genapic = &apic_bigsmp;
82 if (x86_quirks->update_genapic)
83 x86_quirks->update_genapic();
84 printk(KERN_INFO "Overriding APIC driver with %s\n",
85 genapic->name);
86 }
87 }
88#endif
89}
90
91void __init generic_apic_probe(void)
92{
93 if (!cmdline_apic) {
94 int i;
95 for (i = 0; apic_probe[i]; i++) {
96 if (apic_probe[i]->probe()) {
97 genapic = apic_probe[i];
98 break;
99 }
100 }
101 /* Not visible without early console */
102 if (!apic_probe[i])
103 panic("Didn't find an APIC driver");
104
105 if (x86_quirks->update_genapic)
106 x86_quirks->update_genapic();
107 }
108 printk(KERN_INFO "Using APIC driver %s\n", genapic->name);
109}
110
111/* These functions can switch the APIC even after the initial ->probe() */
112
113int __init mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
114{
115 int i;
116 for (i = 0; apic_probe[i]; ++i) {
117 if (apic_probe[i]->mps_oem_check(mpc, oem, productid)) {
118 if (!cmdline_apic) {
119 genapic = apic_probe[i];
120 if (x86_quirks->update_genapic)
121 x86_quirks->update_genapic();
122 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
123 genapic->name);
124 }
125 return 1;
126 }
127 }
128 return 0;
129}
130
131int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
132{
133 int i;
134 for (i = 0; apic_probe[i]; ++i) {
135 if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) {
136 if (!cmdline_apic) {
137 genapic = apic_probe[i];
138 if (x86_quirks->update_genapic)
139 x86_quirks->update_genapic();
140 printk(KERN_INFO "Switched to APIC driver `%s'.\n",
141 genapic->name);
142 }
143 return 1;
144 }
145 }
146 return 0;
147}
148
149int hard_smp_processor_id(void)
150{
151 return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID));
152}
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
deleted file mode 100644
index 2821ffc188b5..000000000000
--- a/arch/x86/mach-generic/summit.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * APIC driver for the IBM "Summit" chipset.
3 */
4#define APIC_DEFINITION 1
5#include <linux/threads.h>
6#include <linux/cpumask.h>
7#include <asm/mpspec.h>
8#include <asm/genapic.h>
9#include <asm/fixmap.h>
10#include <asm/apicdef.h>
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/init.h>
14#include <asm/summit/apicdef.h>
15#include <linux/smp.h>
16#include <asm/summit/apic.h>
17#include <asm/summit/ipi.h>
18#include <asm/summit/mpparse.h>
19#include <asm/mach-default/mach_wakecpu.h>
20
21static int probe_summit(void)
22{
23 /* probed later in mptable/ACPI hooks */
24 return 0;
25}
26
27static void vector_allocation_domain(int cpu, cpumask_t *retmask)
28{
29 /* Careful. Some cpus do not strictly honor the set of cpus
30 * specified in the interrupt destination when using lowest
31 * priority interrupt delivery mode.
32 *
33 * In particular there was a hyperthreading cpu observed to
34 * deliver interrupts to the wrong hyperthread when only one
35 * hyperthread was specified in the interrupt desitination.
36 */
37 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
38}
39
40struct genapic apic_summit = APIC_INIT("summit", probe_summit);
diff --git a/arch/x86/mach-rdc321x/Makefile b/arch/x86/mach-rdc321x/Makefile
deleted file mode 100644
index 8325b4ca431c..000000000000
--- a/arch/x86/mach-rdc321x/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the RDC321x specific parts of the kernel
3#
4obj-$(CONFIG_X86_RDC321X) := gpio.o platform.o
5
diff --git a/arch/x86/mach-rdc321x/gpio.c b/arch/x86/mach-rdc321x/gpio.c
deleted file mode 100644
index 247f33d3a407..000000000000
--- a/arch/x86/mach-rdc321x/gpio.c
+++ /dev/null
@@ -1,194 +0,0 @@
1/*
2 * GPIO support for RDC SoC R3210/R8610
3 *
4 * Copyright (C) 2007, Florian Fainelli <florian@openwrt.org>
5 * Copyright (C) 2008, Volker Weiss <dev@tintuc.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
23
24#include <linux/spinlock.h>
25#include <linux/io.h>
26#include <linux/types.h>
27#include <linux/module.h>
28
29#include <asm/gpio.h>
30#include <asm/mach-rdc321x/rdc321x_defs.h>
31
32
33/* spin lock to protect our private copy of GPIO data register plus
34 the access to PCI conf registers. */
35static DEFINE_SPINLOCK(gpio_lock);
36
37/* copy of GPIO data registers */
38static u32 gpio_data_reg1;
39static u32 gpio_data_reg2;
40
41static u32 gpio_request_data[2];
42
43
44static inline void rdc321x_conf_write(unsigned addr, u32 value)
45{
46 outl((1 << 31) | (7 << 11) | addr, RDC3210_CFGREG_ADDR);
47 outl(value, RDC3210_CFGREG_DATA);
48}
49
50static inline void rdc321x_conf_or(unsigned addr, u32 value)
51{
52 outl((1 << 31) | (7 << 11) | addr, RDC3210_CFGREG_ADDR);
53 value |= inl(RDC3210_CFGREG_DATA);
54 outl(value, RDC3210_CFGREG_DATA);
55}
56
57static inline u32 rdc321x_conf_read(unsigned addr)
58{
59 outl((1 << 31) | (7 << 11) | addr, RDC3210_CFGREG_ADDR);
60
61 return inl(RDC3210_CFGREG_DATA);
62}
63
64/* configure pin as GPIO */
65static void rdc321x_configure_gpio(unsigned gpio)
66{
67 unsigned long flags;
68
69 spin_lock_irqsave(&gpio_lock, flags);
70 rdc321x_conf_or(gpio < 32
71 ? RDC321X_GPIO_CTRL_REG1 : RDC321X_GPIO_CTRL_REG2,
72 1 << (gpio & 0x1f));
73 spin_unlock_irqrestore(&gpio_lock, flags);
74}
75
76/* initially setup the 2 copies of the gpio data registers.
77 This function must be called by the platform setup code. */
78void __init rdc321x_gpio_setup()
79{
80 /* this might not be, what others (BIOS, bootloader, etc.)
81 wrote to these registers before, but it's a good guess. Still
82 better than just using 0xffffffff. */
83
84 gpio_data_reg1 = rdc321x_conf_read(RDC321X_GPIO_DATA_REG1);
85 gpio_data_reg2 = rdc321x_conf_read(RDC321X_GPIO_DATA_REG2);
86}
87
88/* determine, if gpio number is valid */
89static inline int rdc321x_is_gpio(unsigned gpio)
90{
91 return gpio <= RDC321X_MAX_GPIO;
92}
93
94/* request GPIO */
95int rdc_gpio_request(unsigned gpio, const char *label)
96{
97 unsigned long flags;
98
99 if (!rdc321x_is_gpio(gpio))
100 return -EINVAL;
101
102 spin_lock_irqsave(&gpio_lock, flags);
103 if (gpio_request_data[(gpio & 0x20) ? 1 : 0] & (1 << (gpio & 0x1f)))
104 goto inuse;
105 gpio_request_data[(gpio & 0x20) ? 1 : 0] |= (1 << (gpio & 0x1f));
106 spin_unlock_irqrestore(&gpio_lock, flags);
107
108 return 0;
109inuse:
110 spin_unlock_irqrestore(&gpio_lock, flags);
111 return -EINVAL;
112}
113EXPORT_SYMBOL(rdc_gpio_request);
114
115/* release previously-claimed GPIO */
116void rdc_gpio_free(unsigned gpio)
117{
118 unsigned long flags;
119
120 if (!rdc321x_is_gpio(gpio))
121 return;
122
123 spin_lock_irqsave(&gpio_lock, flags);
124 gpio_request_data[(gpio & 0x20) ? 1 : 0] &= ~(1 << (gpio & 0x1f));
125 spin_unlock_irqrestore(&gpio_lock, flags);
126}
127EXPORT_SYMBOL(rdc_gpio_free);
128
129/* read GPIO pin */
130int rdc_gpio_get_value(unsigned gpio)
131{
132 u32 reg;
133 unsigned long flags;
134
135 spin_lock_irqsave(&gpio_lock, flags);
136 reg = rdc321x_conf_read(gpio < 32
137 ? RDC321X_GPIO_DATA_REG1 : RDC321X_GPIO_DATA_REG2);
138 spin_unlock_irqrestore(&gpio_lock, flags);
139
140 return (1 << (gpio & 0x1f)) & reg ? 1 : 0;
141}
142EXPORT_SYMBOL(rdc_gpio_get_value);
143
144/* set GPIO pin to value */
145void rdc_gpio_set_value(unsigned gpio, int value)
146{
147 unsigned long flags;
148 u32 reg;
149
150 reg = 1 << (gpio & 0x1f);
151 if (gpio < 32) {
152 spin_lock_irqsave(&gpio_lock, flags);
153 if (value)
154 gpio_data_reg1 |= reg;
155 else
156 gpio_data_reg1 &= ~reg;
157 rdc321x_conf_write(RDC321X_GPIO_DATA_REG1, gpio_data_reg1);
158 spin_unlock_irqrestore(&gpio_lock, flags);
159 } else {
160 spin_lock_irqsave(&gpio_lock, flags);
161 if (value)
162 gpio_data_reg2 |= reg;
163 else
164 gpio_data_reg2 &= ~reg;
165 rdc321x_conf_write(RDC321X_GPIO_DATA_REG2, gpio_data_reg2);
166 spin_unlock_irqrestore(&gpio_lock, flags);
167 }
168}
169EXPORT_SYMBOL(rdc_gpio_set_value);
170
171/* configure GPIO pin as input */
172int rdc_gpio_direction_input(unsigned gpio)
173{
174 if (!rdc321x_is_gpio(gpio))
175 return -EINVAL;
176
177 rdc321x_configure_gpio(gpio);
178
179 return 0;
180}
181EXPORT_SYMBOL(rdc_gpio_direction_input);
182
183/* configure GPIO pin as output and set value */
184int rdc_gpio_direction_output(unsigned gpio, int value)
185{
186 if (!rdc321x_is_gpio(gpio))
187 return -EINVAL;
188
189 gpio_set_value(gpio, value);
190 rdc321x_configure_gpio(gpio);
191
192 return 0;
193}
194EXPORT_SYMBOL(rdc_gpio_direction_output);
diff --git a/arch/x86/mach-rdc321x/platform.c b/arch/x86/mach-rdc321x/platform.c
deleted file mode 100644
index 4f4e50c3ad3b..000000000000
--- a/arch/x86/mach-rdc321x/platform.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Generic RDC321x platform devices
3 *
4 * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
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
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (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
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/list.h>
26#include <linux/device.h>
27#include <linux/platform_device.h>
28#include <linux/leds.h>
29
30#include <asm/gpio.h>
31
32/* LEDS */
33static struct gpio_led default_leds[] = {
34 { .name = "rdc:dmz", .gpio = 1, },
35};
36
37static struct gpio_led_platform_data rdc321x_led_data = {
38 .num_leds = ARRAY_SIZE(default_leds),
39 .leds = default_leds,
40};
41
42static struct platform_device rdc321x_leds = {
43 .name = "leds-gpio",
44 .id = -1,
45 .dev = {
46 .platform_data = &rdc321x_led_data,
47 }
48};
49
50/* Watchdog */
51static struct platform_device rdc321x_wdt = {
52 .name = "rdc321x-wdt",
53 .id = -1,
54 .num_resources = 0,
55};
56
57static struct platform_device *rdc321x_devs[] = {
58 &rdc321x_leds,
59 &rdc321x_wdt
60};
61
62static int __init rdc_board_setup(void)
63{
64 rdc321x_gpio_setup();
65
66 return platform_add_devices(rdc321x_devs, ARRAY_SIZE(rdc321x_devs));
67}
68
69arch_initcall(rdc_board_setup);
diff --git a/arch/x86/mach-voyager/Makefile b/arch/x86/mach-voyager/Makefile
deleted file mode 100644
index 15c250b371d3..000000000000
--- a/arch/x86/mach-voyager/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5EXTRA_CFLAGS := -Iarch/x86/kernel
6obj-y := setup.o voyager_basic.o voyager_thread.o
7
8obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o
diff --git a/arch/x86/mach-voyager/setup.c b/arch/x86/mach-voyager/setup.c
deleted file mode 100644
index 8e5118371f0f..000000000000
--- a/arch/x86/mach-voyager/setup.c
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * Machine specific setup for generic
3 */
4
5#include <linux/init.h>
6#include <linux/interrupt.h>
7#include <asm/arch_hooks.h>
8#include <asm/voyager.h>
9#include <asm/e820.h>
10#include <asm/io.h>
11#include <asm/setup.h>
12
13void __init pre_intr_init_hook(void)
14{
15 init_ISA_irqs();
16}
17
18/*
19 * IRQ2 is cascade interrupt to second interrupt controller
20 */
21static struct irqaction irq2 = {
22 .handler = no_action,
23 .mask = CPU_MASK_NONE,
24 .name = "cascade",
25};
26
27void __init intr_init_hook(void)
28{
29#ifdef CONFIG_SMP
30 voyager_smp_intr_init();
31#endif
32
33 setup_irq(2, &irq2);
34}
35
36static void voyager_disable_tsc(void)
37{
38 /* Voyagers run their CPUs from independent clocks, so disable
39 * the TSC code because we can't sync them */
40 setup_clear_cpu_cap(X86_FEATURE_TSC);
41}
42
43void __init pre_setup_arch_hook(void)
44{
45 voyager_disable_tsc();
46}
47
48void __init pre_time_init_hook(void)
49{
50 voyager_disable_tsc();
51}
52
53void __init trap_init_hook(void)
54{
55}
56
57static struct irqaction irq0 = {
58 .handler = timer_interrupt,
59 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
60 .mask = CPU_MASK_NONE,
61 .name = "timer"
62};
63
64void __init time_init_hook(void)
65{
66 irq0.mask = cpumask_of_cpu(safe_smp_processor_id());
67 setup_irq(0, &irq0);
68}
69
70/* Hook for machine specific memory setup. */
71
72char *__init machine_specific_memory_setup(void)
73{
74 char *who;
75 int new_nr;
76
77 who = "NOT VOYAGER";
78
79 if (voyager_level == 5) {
80 __u32 addr, length;
81 int i;
82
83 who = "Voyager-SUS";
84
85 e820.nr_map = 0;
86 for (i = 0; voyager_memory_detect(i, &addr, &length); i++) {
87 e820_add_region(addr, length, E820_RAM);
88 }
89 return who;
90 } else if (voyager_level == 4) {
91 __u32 tom;
92 __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT) << 8;
93 /* select the DINO config space */
94 outb(VOYAGER_DINO, VOYAGER_CAT_CONFIG_PORT);
95 /* Read DINO top of memory register */
96 tom = ((inb(catbase + 0x4) & 0xf0) << 16)
97 + ((inb(catbase + 0x5) & 0x7f) << 24);
98
99 if (inb(catbase) != VOYAGER_DINO) {
100 printk(KERN_ERR
101 "Voyager: Failed to get DINO for L4, setting tom to EXT_MEM_K\n");
102 tom = (boot_params.screen_info.ext_mem_k) << 10;
103 }
104 who = "Voyager-TOM";
105 e820_add_region(0, 0x9f000, E820_RAM);
106 /* map from 1M to top of memory */
107 e820_add_region(1 * 1024 * 1024, tom - 1 * 1024 * 1024,
108 E820_RAM);
109 /* FIXME: Should check the ASICs to see if I need to
110 * take out the 8M window. Just do it at the moment
111 * */
112 e820_add_region(8 * 1024 * 1024, 8 * 1024 * 1024,
113 E820_RESERVED);
114 return who;
115 }
116
117 return default_machine_specific_memory_setup();
118}
diff --git a/arch/x86/mach-voyager/voyager_basic.c b/arch/x86/mach-voyager/voyager_basic.c
deleted file mode 100644
index 46d6f8067690..000000000000
--- a/arch/x86/mach-voyager/voyager_basic.c
+++ /dev/null
@@ -1,317 +0,0 @@
1/* Copyright (C) 1999,2001
2 *
3 * Author: J.E.J.Bottomley@HansenPartnership.com
4 *
5 * This file contains all the voyager specific routines for getting
6 * initialisation of the architecture to function. For additional
7 * features see:
8 *
9 * voyager_cat.c - Voyager CAT bus interface
10 * voyager_smp.c - Voyager SMP hal (emulates linux smp.c)
11 */
12
13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/sched.h>
16#include <linux/ptrace.h>
17#include <linux/ioport.h>
18#include <linux/interrupt.h>
19#include <linux/init.h>
20#include <linux/delay.h>
21#include <linux/reboot.h>
22#include <linux/sysrq.h>
23#include <linux/smp.h>
24#include <linux/nodemask.h>
25#include <asm/io.h>
26#include <asm/voyager.h>
27#include <asm/vic.h>
28#include <linux/pm.h>
29#include <asm/tlbflush.h>
30#include <asm/arch_hooks.h>
31#include <asm/i8253.h>
32
33/*
34 * Power off function, if any
35 */
36void (*pm_power_off) (void);
37EXPORT_SYMBOL(pm_power_off);
38
39int voyager_level = 0;
40
41struct voyager_SUS *voyager_SUS = NULL;
42
43#ifdef CONFIG_SMP
44static void voyager_dump(int dummy1, struct tty_struct *dummy3)
45{
46 /* get here via a sysrq */
47 voyager_smp_dump();
48}
49
50static struct sysrq_key_op sysrq_voyager_dump_op = {
51 .handler = voyager_dump,
52 .help_msg = "Voyager",
53 .action_msg = "Dump Voyager Status",
54};
55#endif
56
57void voyager_detect(struct voyager_bios_info *bios)
58{
59 if (bios->len != 0xff) {
60 int class = (bios->class_1 << 8)
61 | (bios->class_2 & 0xff);
62
63 printk("Voyager System detected.\n"
64 " Class %x, Revision %d.%d\n",
65 class, bios->major, bios->minor);
66 if (class == VOYAGER_LEVEL4)
67 voyager_level = 4;
68 else if (class < VOYAGER_LEVEL5_AND_ABOVE)
69 voyager_level = 3;
70 else
71 voyager_level = 5;
72 printk(" Architecture Level %d\n", voyager_level);
73 if (voyager_level < 4)
74 printk
75 ("\n**WARNING**: Voyager HAL only supports Levels 4 and 5 Architectures at the moment\n\n");
76 /* install the power off handler */
77 pm_power_off = voyager_power_off;
78#ifdef CONFIG_SMP
79 register_sysrq_key('v', &sysrq_voyager_dump_op);
80#endif
81 } else {
82 printk("\n\n**WARNING**: No Voyager Subsystem Found\n");
83 }
84}
85
86void voyager_system_interrupt(int cpl, void *dev_id)
87{
88 printk("Voyager: detected system interrupt\n");
89}
90
91/* Routine to read information from the extended CMOS area */
92__u8 voyager_extended_cmos_read(__u16 addr)
93{
94 outb(addr & 0xff, 0x74);
95 outb((addr >> 8) & 0xff, 0x75);
96 return inb(0x76);
97}
98
99/* internal definitions for the SUS Click Map of memory */
100
101#define CLICK_ENTRIES 16
102#define CLICK_SIZE 4096 /* click to byte conversion for Length */
103
104typedef struct ClickMap {
105 struct Entry {
106 __u32 Address;
107 __u32 Length;
108 } Entry[CLICK_ENTRIES];
109} ClickMap_t;
110
111/* This routine is pretty much an awful hack to read the bios clickmap by
112 * mapping it into page 0. There are usually three regions in the map:
113 * Base Memory
114 * Extended Memory
115 * zero length marker for end of map
116 *
117 * Returns are 0 for failure and 1 for success on extracting region.
118 */
119int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)
120{
121 int i;
122 int retval = 0;
123 __u8 cmos[4];
124 ClickMap_t *map;
125 unsigned long map_addr;
126 unsigned long old;
127
128 if (region >= CLICK_ENTRIES) {
129 printk("Voyager: Illegal ClickMap region %d\n", region);
130 return 0;
131 }
132
133 for (i = 0; i < sizeof(cmos); i++)
134 cmos[i] =
135 voyager_extended_cmos_read(VOYAGER_MEMORY_CLICKMAP + i);
136
137 map_addr = *(unsigned long *)cmos;
138
139 /* steal page 0 for this */
140 old = pg0[0];
141 pg0[0] = ((map_addr & PAGE_MASK) | _PAGE_RW | _PAGE_PRESENT);
142 local_flush_tlb();
143 /* now clear everything out but page 0 */
144 map = (ClickMap_t *) (map_addr & (~PAGE_MASK));
145
146 /* zero length is the end of the clickmap */
147 if (map->Entry[region].Length != 0) {
148 *length = map->Entry[region].Length * CLICK_SIZE;
149 *start = map->Entry[region].Address;
150 retval = 1;
151 }
152
153 /* replace the mapping */
154 pg0[0] = old;
155 local_flush_tlb();
156 return retval;
157}
158
159/* voyager specific handling code for timer interrupts. Used to hand
160 * off the timer tick to the SMP code, since the VIC doesn't have an
161 * internal timer (The QIC does, but that's another story). */
162void voyager_timer_interrupt(void)
163{
164 if ((jiffies & 0x3ff) == 0) {
165
166 /* There seems to be something flaky in either
167 * hardware or software that is resetting the timer 0
168 * count to something much higher than it should be
169 * This seems to occur in the boot sequence, just
170 * before root is mounted. Therefore, every 10
171 * seconds or so, we sanity check the timer zero count
172 * and kick it back to where it should be.
173 *
174 * FIXME: This is the most awful hack yet seen. I
175 * should work out exactly what is interfering with
176 * the timer count settings early in the boot sequence
177 * and swiftly introduce it to something sharp and
178 * pointy. */
179 __u16 val;
180
181 spin_lock(&i8253_lock);
182
183 outb_p(0x00, 0x43);
184 val = inb_p(0x40);
185 val |= inb(0x40) << 8;
186 spin_unlock(&i8253_lock);
187
188 if (val > LATCH) {
189 printk
190 ("\nVOYAGER: countdown timer value too high (%d), resetting\n\n",
191 val);
192 spin_lock(&i8253_lock);
193 outb(0x34, 0x43);
194 outb_p(LATCH & 0xff, 0x40); /* LSB */
195 outb(LATCH >> 8, 0x40); /* MSB */
196 spin_unlock(&i8253_lock);
197 }
198 }
199#ifdef CONFIG_SMP
200 smp_vic_timer_interrupt();
201#endif
202}
203
204void voyager_power_off(void)
205{
206 printk("VOYAGER Power Off\n");
207
208 if (voyager_level == 5) {
209 voyager_cat_power_off();
210 } else if (voyager_level == 4) {
211 /* This doesn't apparently work on most L4 machines,
212 * but the specs say to do this to get automatic power
213 * off. Unfortunately, if it doesn't power off the
214 * machine, it ends up doing a cold restart, which
215 * isn't really intended, so comment out the code */
216#if 0
217 int port;
218
219 /* enable the voyager Configuration Space */
220 outb((inb(VOYAGER_MC_SETUP) & 0xf0) | 0x8, VOYAGER_MC_SETUP);
221 /* the port for the power off flag is an offset from the
222 floating base */
223 port = (inb(VOYAGER_SSPB_RELOCATION_PORT) << 8) + 0x21;
224 /* set the power off flag */
225 outb(inb(port) | 0x1, port);
226#endif
227 }
228 /* and wait for it to happen */
229 local_irq_disable();
230 for (;;)
231 halt();
232}
233
234/* copied from process.c */
235static inline void kb_wait(void)
236{
237 int i;
238
239 for (i = 0; i < 0x10000; i++)
240 if ((inb_p(0x64) & 0x02) == 0)
241 break;
242}
243
244void machine_shutdown(void)
245{
246 /* Architecture specific shutdown needed before a kexec */
247}
248
249void machine_restart(char *cmd)
250{
251 printk("Voyager Warm Restart\n");
252 kb_wait();
253
254 if (voyager_level == 5) {
255 /* write magic values to the RTC to inform system that
256 * shutdown is beginning */
257 outb(0x8f, 0x70);
258 outb(0x5, 0x71);
259
260 udelay(50);
261 outb(0xfe, 0x64); /* pull reset low */
262 } else if (voyager_level == 4) {
263 __u16 catbase = inb(VOYAGER_SSPB_RELOCATION_PORT) << 8;
264 __u8 basebd = inb(VOYAGER_MC_SETUP);
265
266 outb(basebd | 0x08, VOYAGER_MC_SETUP);
267 outb(0x02, catbase + 0x21);
268 }
269 local_irq_disable();
270 for (;;)
271 halt();
272}
273
274void machine_emergency_restart(void)
275{
276 /*for now, just hook this to a warm restart */
277 machine_restart(NULL);
278}
279
280void mca_nmi_hook(void)
281{
282 __u8 dumpval __maybe_unused = inb(0xf823);
283 __u8 swnmi __maybe_unused = inb(0xf813);
284
285 /* FIXME: assume dump switch pressed */
286 /* check to see if the dump switch was pressed */
287 VDEBUG(("VOYAGER: dumpval = 0x%x, swnmi = 0x%x\n", dumpval, swnmi));
288 /* clear swnmi */
289 outb(0xff, 0xf813);
290 /* tell SUS to ignore dump */
291 if (voyager_level == 5 && voyager_SUS != NULL) {
292 if (voyager_SUS->SUS_mbox == VOYAGER_DUMP_BUTTON_NMI) {
293 voyager_SUS->kernel_mbox = VOYAGER_NO_COMMAND;
294 voyager_SUS->kernel_flags |= VOYAGER_OS_IN_PROGRESS;
295 udelay(1000);
296 voyager_SUS->kernel_mbox = VOYAGER_IGNORE_DUMP;
297 voyager_SUS->kernel_flags &= ~VOYAGER_OS_IN_PROGRESS;
298 }
299 }
300 printk(KERN_ERR
301 "VOYAGER: Dump switch pressed, printing CPU%d tracebacks\n",
302 smp_processor_id());
303 show_stack(NULL, NULL);
304 show_state();
305}
306
307void machine_halt(void)
308{
309 /* treat a halt like a power off */
310 machine_power_off();
311}
312
313void machine_power_off(void)
314{
315 if (pm_power_off)
316 pm_power_off();
317}
diff --git a/arch/x86/mach-voyager/voyager_cat.c b/arch/x86/mach-voyager/voyager_cat.c
deleted file mode 100644
index 2ad598c104af..000000000000
--- a/arch/x86/mach-voyager/voyager_cat.c
+++ /dev/null
@@ -1,1197 +0,0 @@
1/* -*- mode: c; c-basic-offset: 8 -*- */
2
3/* Copyright (C) 1999,2001
4 *
5 * Author: J.E.J.Bottomley@HansenPartnership.com
6 *
7 * This file contains all the logic for manipulating the CAT bus
8 * in a level 5 machine.
9 *
10 * The CAT bus is a serial configuration and test bus. Its primary
11 * uses are to probe the initial configuration of the system and to
12 * diagnose error conditions when a system interrupt occurs. The low
13 * level interface is fairly primitive, so most of this file consists
14 * of bit shift manipulations to send and receive packets on the
15 * serial bus */
16
17#include <linux/types.h>
18#include <linux/completion.h>
19#include <linux/sched.h>
20#include <asm/voyager.h>
21#include <asm/vic.h>
22#include <linux/ioport.h>
23#include <linux/init.h>
24#include <linux/slab.h>
25#include <linux/delay.h>
26#include <asm/io.h>
27
28#ifdef VOYAGER_CAT_DEBUG
29#define CDEBUG(x) printk x
30#else
31#define CDEBUG(x)
32#endif
33
34/* the CAT command port */
35#define CAT_CMD (sspb + 0xe)
36/* the CAT data port */
37#define CAT_DATA (sspb + 0xd)
38
39/* the internal cat functions */
40static void cat_pack(__u8 * msg, __u16 start_bit, __u8 * data, __u16 num_bits);
41static void cat_unpack(__u8 * msg, __u16 start_bit, __u8 * data,
42 __u16 num_bits);
43static void cat_build_header(__u8 * header, const __u16 len,
44 const __u16 smallest_reg_bits,
45 const __u16 longest_reg_bits);
46static int cat_sendinst(voyager_module_t * modp, voyager_asic_t * asicp,
47 __u8 reg, __u8 op);
48static int cat_getdata(voyager_module_t * modp, voyager_asic_t * asicp,
49 __u8 reg, __u8 * value);
50static int cat_shiftout(__u8 * data, __u16 data_bytes, __u16 header_bytes,
51 __u8 pad_bits);
52static int cat_write(voyager_module_t * modp, voyager_asic_t * asicp, __u8 reg,
53 __u8 value);
54static int cat_read(voyager_module_t * modp, voyager_asic_t * asicp, __u8 reg,
55 __u8 * value);
56static int cat_subread(voyager_module_t * modp, voyager_asic_t * asicp,
57 __u16 offset, __u16 len, void *buf);
58static int cat_senddata(voyager_module_t * modp, voyager_asic_t * asicp,
59 __u8 reg, __u8 value);
60static int cat_disconnect(voyager_module_t * modp, voyager_asic_t * asicp);
61static int cat_connect(voyager_module_t * modp, voyager_asic_t * asicp);
62
63static inline const char *cat_module_name(int module_id)
64{
65 switch (module_id) {
66 case 0x10:
67 return "Processor Slot 0";
68 case 0x11:
69 return "Processor Slot 1";
70 case 0x12:
71 return "Processor Slot 2";
72 case 0x13:
73 return "Processor Slot 4";
74 case 0x14:
75 return "Memory Slot 0";
76 case 0x15:
77 return "Memory Slot 1";
78 case 0x18:
79 return "Primary Microchannel";
80 case 0x19:
81 return "Secondary Microchannel";
82 case 0x1a:
83 return "Power Supply Interface";
84 case 0x1c:
85 return "Processor Slot 5";
86 case 0x1d:
87 return "Processor Slot 6";
88 case 0x1e:
89 return "Processor Slot 7";
90 case 0x1f:
91 return "Processor Slot 8";
92 default:
93 return "Unknown Module";
94 }
95}
96
97static int sspb = 0; /* stores the super port location */
98int voyager_8slot = 0; /* set to true if a 51xx monster */
99
100voyager_module_t *voyager_cat_list;
101
102/* the I/O port assignments for the VIC and QIC */
103static struct resource vic_res = {
104 .name = "Voyager Interrupt Controller",
105 .start = 0xFC00,
106 .end = 0xFC6F
107};
108static struct resource qic_res = {
109 .name = "Quad Interrupt Controller",
110 .start = 0xFC70,
111 .end = 0xFCFF
112};
113
114/* This function is used to pack a data bit stream inside a message.
115 * It writes num_bits of the data buffer in msg starting at start_bit.
116 * Note: This function assumes that any unused bit in the data stream
117 * is set to zero so that the ors will work correctly */
118static void
119cat_pack(__u8 * msg, const __u16 start_bit, __u8 * data, const __u16 num_bits)
120{
121 /* compute initial shift needed */
122 const __u16 offset = start_bit % BITS_PER_BYTE;
123 __u16 len = num_bits / BITS_PER_BYTE;
124 __u16 byte = start_bit / BITS_PER_BYTE;
125 __u16 residue = (num_bits % BITS_PER_BYTE) + offset;
126 int i;
127
128 /* adjust if we have more than a byte of residue */
129 if (residue >= BITS_PER_BYTE) {
130 residue -= BITS_PER_BYTE;
131 len++;
132 }
133
134 /* clear out the bits. We assume here that if len==0 then
135 * residue >= offset. This is always true for the catbus
136 * operations */
137 msg[byte] &= 0xff << (BITS_PER_BYTE - offset);
138 msg[byte++] |= data[0] >> offset;
139 if (len == 0)
140 return;
141 for (i = 1; i < len; i++)
142 msg[byte++] = (data[i - 1] << (BITS_PER_BYTE - offset))
143 | (data[i] >> offset);
144 if (residue != 0) {
145 __u8 mask = 0xff >> residue;
146 __u8 last_byte = data[i - 1] << (BITS_PER_BYTE - offset)
147 | (data[i] >> offset);
148
149 last_byte &= ~mask;
150 msg[byte] &= mask;
151 msg[byte] |= last_byte;
152 }
153 return;
154}
155
156/* unpack the data again (same arguments as cat_pack()). data buffer
157 * must be zero populated.
158 *
159 * Function: given a message string move to start_bit and copy num_bits into
160 * data (starting at bit 0 in data).
161 */
162static void
163cat_unpack(__u8 * msg, const __u16 start_bit, __u8 * data, const __u16 num_bits)
164{
165 /* compute initial shift needed */
166 const __u16 offset = start_bit % BITS_PER_BYTE;
167 __u16 len = num_bits / BITS_PER_BYTE;
168 const __u8 last_bits = num_bits % BITS_PER_BYTE;
169 __u16 byte = start_bit / BITS_PER_BYTE;
170 int i;
171
172 if (last_bits != 0)
173 len++;
174
175 /* special case: want < 8 bits from msg and we can get it from
176 * a single byte of the msg */
177 if (len == 0 && BITS_PER_BYTE - offset >= num_bits) {
178 data[0] = msg[byte] << offset;
179 data[0] &= 0xff >> (BITS_PER_BYTE - num_bits);
180 return;
181 }
182 for (i = 0; i < len; i++) {
183 /* this annoying if has to be done just in case a read of
184 * msg one beyond the array causes a panic */
185 if (offset != 0) {
186 data[i] = msg[byte++] << offset;
187 data[i] |= msg[byte] >> (BITS_PER_BYTE - offset);
188 } else {
189 data[i] = msg[byte++];
190 }
191 }
192 /* do we need to truncate the final byte */
193 if (last_bits != 0) {
194 data[i - 1] &= 0xff << (BITS_PER_BYTE - last_bits);
195 }
196 return;
197}
198
199static void
200cat_build_header(__u8 * header, const __u16 len, const __u16 smallest_reg_bits,
201 const __u16 longest_reg_bits)
202{
203 int i;
204 __u16 start_bit = (smallest_reg_bits - 1) % BITS_PER_BYTE;
205 __u8 *last_byte = &header[len - 1];
206
207 if (start_bit == 0)
208 start_bit = 1; /* must have at least one bit in the hdr */
209
210 for (i = 0; i < len; i++)
211 header[i] = 0;
212
213 for (i = start_bit; i > 0; i--)
214 *last_byte = ((*last_byte) << 1) + 1;
215
216}
217
218static int
219cat_sendinst(voyager_module_t * modp, voyager_asic_t * asicp, __u8 reg, __u8 op)
220{
221 __u8 parity, inst, inst_buf[4] = { 0 };
222 __u8 iseq[VOYAGER_MAX_SCAN_PATH], hseq[VOYAGER_MAX_REG_SIZE];
223 __u16 ibytes, hbytes, padbits;
224 int i;
225
226 /*
227 * Parity is the parity of the register number + 1 (READ_REGISTER
228 * and WRITE_REGISTER always add '1' to the number of bits == 1)
229 */
230 parity = (__u8) (1 + (reg & 0x01) +
231 ((__u8) (reg & 0x02) >> 1) +
232 ((__u8) (reg & 0x04) >> 2) +
233 ((__u8) (reg & 0x08) >> 3)) % 2;
234
235 inst = ((parity << 7) | (reg << 2) | op);
236
237 outb(VOYAGER_CAT_IRCYC, CAT_CMD);
238 if (!modp->scan_path_connected) {
239 if (asicp->asic_id != VOYAGER_CAT_ID) {
240 printk
241 ("**WARNING***: cat_sendinst has disconnected scan path not to CAT asic\n");
242 return 1;
243 }
244 outb(VOYAGER_CAT_HEADER, CAT_DATA);
245 outb(inst, CAT_DATA);
246 if (inb(CAT_DATA) != VOYAGER_CAT_HEADER) {
247 CDEBUG(("VOYAGER CAT: cat_sendinst failed to get CAT_HEADER\n"));
248 return 1;
249 }
250 return 0;
251 }
252 ibytes = modp->inst_bits / BITS_PER_BYTE;
253 if ((padbits = modp->inst_bits % BITS_PER_BYTE) != 0) {
254 padbits = BITS_PER_BYTE - padbits;
255 ibytes++;
256 }
257 hbytes = modp->largest_reg / BITS_PER_BYTE;
258 if (modp->largest_reg % BITS_PER_BYTE)
259 hbytes++;
260 CDEBUG(("cat_sendinst: ibytes=%d, hbytes=%d\n", ibytes, hbytes));
261 /* initialise the instruction sequence to 0xff */
262 for (i = 0; i < ibytes + hbytes; i++)
263 iseq[i] = 0xff;
264 cat_build_header(hseq, hbytes, modp->smallest_reg, modp->largest_reg);
265 cat_pack(iseq, modp->inst_bits, hseq, hbytes * BITS_PER_BYTE);
266 inst_buf[0] = inst;
267 inst_buf[1] = 0xFF >> (modp->largest_reg % BITS_PER_BYTE);
268 cat_pack(iseq, asicp->bit_location, inst_buf, asicp->ireg_length);
269#ifdef VOYAGER_CAT_DEBUG
270 printk("ins = 0x%x, iseq: ", inst);
271 for (i = 0; i < ibytes + hbytes; i++)
272 printk("0x%x ", iseq[i]);
273 printk("\n");
274#endif
275 if (cat_shiftout(iseq, ibytes, hbytes, padbits)) {
276 CDEBUG(("VOYAGER CAT: cat_sendinst: cat_shiftout failed\n"));
277 return 1;
278 }
279 CDEBUG(("CAT SHIFTOUT DONE\n"));
280 return 0;
281}
282
283static int
284cat_getdata(voyager_module_t * modp, voyager_asic_t * asicp, __u8 reg,
285 __u8 * value)
286{
287 if (!modp->scan_path_connected) {
288 if (asicp->asic_id != VOYAGER_CAT_ID) {
289 CDEBUG(("VOYAGER CAT: ERROR: cat_getdata to CAT asic with scan path connected\n"));
290 return 1;
291 }
292 if (reg > VOYAGER_SUBADDRHI)
293 outb(VOYAGER_CAT_RUN, CAT_CMD);
294 outb(VOYAGER_CAT_DRCYC, CAT_CMD);
295 outb(VOYAGER_CAT_HEADER, CAT_DATA);
296 *value = inb(CAT_DATA);
297 outb(0xAA, CAT_DATA);
298 if (inb(CAT_DATA) != VOYAGER_CAT_HEADER) {
299 CDEBUG(("cat_getdata: failed to get VOYAGER_CAT_HEADER\n"));
300 return 1;
301 }
302 return 0;
303 } else {
304 __u16 sbits = modp->num_asics - 1 + asicp->ireg_length;
305 __u16 sbytes = sbits / BITS_PER_BYTE;
306 __u16 tbytes;
307 __u8 string[VOYAGER_MAX_SCAN_PATH],
308 trailer[VOYAGER_MAX_REG_SIZE];
309 __u8 padbits;
310 int i;
311
312 outb(VOYAGER_CAT_DRCYC, CAT_CMD);
313
314 if ((padbits = sbits % BITS_PER_BYTE) != 0) {
315 padbits = BITS_PER_BYTE - padbits;
316 sbytes++;
317 }
318 tbytes = asicp->ireg_length / BITS_PER_BYTE;
319 if (asicp->ireg_length % BITS_PER_BYTE)
320 tbytes++;
321 CDEBUG(("cat_getdata: tbytes = %d, sbytes = %d, padbits = %d\n",
322 tbytes, sbytes, padbits));
323 cat_build_header(trailer, tbytes, 1, asicp->ireg_length);
324
325 for (i = tbytes - 1; i >= 0; i--) {
326 outb(trailer[i], CAT_DATA);
327 string[sbytes + i] = inb(CAT_DATA);
328 }
329
330 for (i = sbytes - 1; i >= 0; i--) {
331 outb(0xaa, CAT_DATA);
332 string[i] = inb(CAT_DATA);
333 }
334 *value = 0;
335 cat_unpack(string,
336 padbits + (tbytes * BITS_PER_BYTE) +
337 asicp->asic_location, value, asicp->ireg_length);
338#ifdef VOYAGER_CAT_DEBUG
339 printk("value=0x%x, string: ", *value);
340 for (i = 0; i < tbytes + sbytes; i++)
341 printk("0x%x ", string[i]);
342 printk("\n");
343#endif
344
345 /* sanity check the rest of the return */
346 for (i = 0; i < tbytes; i++) {
347 __u8 input = 0;
348
349 cat_unpack(string, padbits + (i * BITS_PER_BYTE),
350 &input, BITS_PER_BYTE);
351 if (trailer[i] != input) {
352 CDEBUG(("cat_getdata: failed to sanity check rest of ret(%d) 0x%x != 0x%x\n", i, input, trailer[i]));
353 return 1;
354 }
355 }
356 CDEBUG(("cat_getdata DONE\n"));
357 return 0;
358 }
359}
360
361static int
362cat_shiftout(__u8 * data, __u16 data_bytes, __u16 header_bytes, __u8 pad_bits)
363{
364 int i;
365
366 for (i = data_bytes + header_bytes - 1; i >= header_bytes; i--)
367 outb(data[i], CAT_DATA);
368
369 for (i = header_bytes - 1; i >= 0; i--) {
370 __u8 header = 0;
371 __u8 input;
372
373 outb(data[i], CAT_DATA);
374 input = inb(CAT_DATA);
375 CDEBUG(("cat_shiftout: returned 0x%x\n", input));
376 cat_unpack(data, ((data_bytes + i) * BITS_PER_BYTE) - pad_bits,
377 &header, BITS_PER_BYTE);
378 if (input != header) {
379 CDEBUG(("VOYAGER CAT: cat_shiftout failed to return header 0x%x != 0x%x\n", input, header));
380 return 1;
381 }
382 }
383 return 0;
384}
385
386static int
387cat_senddata(voyager_module_t * modp, voyager_asic_t * asicp,
388 __u8 reg, __u8 value)
389{
390 outb(VOYAGER_CAT_DRCYC, CAT_CMD);
391 if (!modp->scan_path_connected) {
392 if (asicp->asic_id != VOYAGER_CAT_ID) {
393 CDEBUG(("VOYAGER CAT: ERROR: scan path disconnected when asic != CAT\n"));
394 return 1;
395 }
396 outb(VOYAGER_CAT_HEADER, CAT_DATA);
397 outb(value, CAT_DATA);
398 if (inb(CAT_DATA) != VOYAGER_CAT_HEADER) {
399 CDEBUG(("cat_senddata: failed to get correct header response to sent data\n"));
400 return 1;
401 }
402 if (reg > VOYAGER_SUBADDRHI) {
403 outb(VOYAGER_CAT_RUN, CAT_CMD);
404 outb(VOYAGER_CAT_END, CAT_CMD);
405 outb(VOYAGER_CAT_RUN, CAT_CMD);
406 }
407
408 return 0;
409 } else {
410 __u16 hbytes = asicp->ireg_length / BITS_PER_BYTE;
411 __u16 dbytes =
412 (modp->num_asics - 1 + asicp->ireg_length) / BITS_PER_BYTE;
413 __u8 padbits, dseq[VOYAGER_MAX_SCAN_PATH],
414 hseq[VOYAGER_MAX_REG_SIZE];
415 int i;
416
417 if ((padbits = (modp->num_asics - 1
418 + asicp->ireg_length) % BITS_PER_BYTE) != 0) {
419 padbits = BITS_PER_BYTE - padbits;
420 dbytes++;
421 }
422 if (asicp->ireg_length % BITS_PER_BYTE)
423 hbytes++;
424
425 cat_build_header(hseq, hbytes, 1, asicp->ireg_length);
426
427 for (i = 0; i < dbytes + hbytes; i++)
428 dseq[i] = 0xff;
429 CDEBUG(("cat_senddata: dbytes=%d, hbytes=%d, padbits=%d\n",
430 dbytes, hbytes, padbits));
431 cat_pack(dseq, modp->num_asics - 1 + asicp->ireg_length,
432 hseq, hbytes * BITS_PER_BYTE);
433 cat_pack(dseq, asicp->asic_location, &value,
434 asicp->ireg_length);
435#ifdef VOYAGER_CAT_DEBUG
436 printk("dseq ");
437 for (i = 0; i < hbytes + dbytes; i++) {
438 printk("0x%x ", dseq[i]);
439 }
440 printk("\n");
441#endif
442 return cat_shiftout(dseq, dbytes, hbytes, padbits);
443 }
444}
445
446static int
447cat_write(voyager_module_t * modp, voyager_asic_t * asicp, __u8 reg, __u8 value)
448{
449 if (cat_sendinst(modp, asicp, reg, VOYAGER_WRITE_CONFIG))
450 return 1;
451 return cat_senddata(modp, asicp, reg, value);
452}
453
454static int
455cat_read(voyager_module_t * modp, voyager_asic_t * asicp, __u8 reg,
456 __u8 * value)
457{
458 if (cat_sendinst(modp, asicp, reg, VOYAGER_READ_CONFIG))
459 return 1;
460 return cat_getdata(modp, asicp, reg, value);
461}
462
463static int
464cat_subaddrsetup(voyager_module_t * modp, voyager_asic_t * asicp, __u16 offset,
465 __u16 len)
466{
467 __u8 val;
468
469 if (len > 1) {
470 /* set auto increment */
471 __u8 newval;
472
473 if (cat_read(modp, asicp, VOYAGER_AUTO_INC_REG, &val)) {
474 CDEBUG(("cat_subaddrsetup: read of VOYAGER_AUTO_INC_REG failed\n"));
475 return 1;
476 }
477 CDEBUG(("cat_subaddrsetup: VOYAGER_AUTO_INC_REG = 0x%x\n",
478 val));
479 newval = val | VOYAGER_AUTO_INC;
480 if (newval != val) {
481 if (cat_write(modp, asicp, VOYAGER_AUTO_INC_REG, val)) {
482 CDEBUG(("cat_subaddrsetup: write to VOYAGER_AUTO_INC_REG failed\n"));
483 return 1;
484 }
485 }
486 }
487 if (cat_write(modp, asicp, VOYAGER_SUBADDRLO, (__u8) (offset & 0xff))) {
488 CDEBUG(("cat_subaddrsetup: write to SUBADDRLO failed\n"));
489 return 1;
490 }
491 if (asicp->subaddr > VOYAGER_SUBADDR_LO) {
492 if (cat_write
493 (modp, asicp, VOYAGER_SUBADDRHI, (__u8) (offset >> 8))) {
494 CDEBUG(("cat_subaddrsetup: write to SUBADDRHI failed\n"));
495 return 1;
496 }
497 cat_read(modp, asicp, VOYAGER_SUBADDRHI, &val);
498 CDEBUG(("cat_subaddrsetup: offset = %d, hi = %d\n", offset,
499 val));
500 }
501 cat_read(modp, asicp, VOYAGER_SUBADDRLO, &val);
502 CDEBUG(("cat_subaddrsetup: offset = %d, lo = %d\n", offset, val));
503 return 0;
504}
505
506static int
507cat_subwrite(voyager_module_t * modp, voyager_asic_t * asicp, __u16 offset,
508 __u16 len, void *buf)
509{
510 int i, retval;
511
512 /* FIXME: need special actions for VOYAGER_CAT_ID here */
513 if (asicp->asic_id == VOYAGER_CAT_ID) {
514 CDEBUG(("cat_subwrite: ATTEMPT TO WRITE TO CAT ASIC\n"));
515 /* FIXME -- This is supposed to be handled better
516 * There is a problem writing to the cat asic in the
517 * PSI. The 30us delay seems to work, though */
518 udelay(30);
519 }
520
521 if ((retval = cat_subaddrsetup(modp, asicp, offset, len)) != 0) {
522 printk("cat_subwrite: cat_subaddrsetup FAILED\n");
523 return retval;
524 }
525
526 if (cat_sendinst
527 (modp, asicp, VOYAGER_SUBADDRDATA, VOYAGER_WRITE_CONFIG)) {
528 printk("cat_subwrite: cat_sendinst FAILED\n");
529 return 1;
530 }
531 for (i = 0; i < len; i++) {
532 if (cat_senddata(modp, asicp, 0xFF, ((__u8 *) buf)[i])) {
533 printk
534 ("cat_subwrite: cat_sendata element at %d FAILED\n",
535 i);
536 return 1;
537 }
538 }
539 return 0;
540}
541static int
542cat_subread(voyager_module_t * modp, voyager_asic_t * asicp, __u16 offset,
543 __u16 len, void *buf)
544{
545 int i, retval;
546
547 if ((retval = cat_subaddrsetup(modp, asicp, offset, len)) != 0) {
548 CDEBUG(("cat_subread: cat_subaddrsetup FAILED\n"));
549 return retval;
550 }
551
552 if (cat_sendinst(modp, asicp, VOYAGER_SUBADDRDATA, VOYAGER_READ_CONFIG)) {
553 CDEBUG(("cat_subread: cat_sendinst failed\n"));
554 return 1;
555 }
556 for (i = 0; i < len; i++) {
557 if (cat_getdata(modp, asicp, 0xFF, &((__u8 *) buf)[i])) {
558 CDEBUG(("cat_subread: cat_getdata element %d failed\n",
559 i));
560 return 1;
561 }
562 }
563 return 0;
564}
565
566/* buffer for storing EPROM data read in during initialisation */
567static __initdata __u8 eprom_buf[0xFFFF];
568static voyager_module_t *voyager_initial_module;
569
570/* Initialise the cat bus components. We assume this is called by the
571 * boot cpu *after* all memory initialisation has been done (so we can
572 * use kmalloc) but before smp initialisation, so we can probe the SMP
573 * configuration and pick up necessary information. */
574void __init voyager_cat_init(void)
575{
576 voyager_module_t **modpp = &voyager_initial_module;
577 voyager_asic_t **asicpp;
578 voyager_asic_t *qabc_asic = NULL;
579 int i, j;
580 unsigned long qic_addr = 0;
581 __u8 qabc_data[0x20];
582 __u8 num_submodules, val;
583 voyager_eprom_hdr_t *eprom_hdr = (voyager_eprom_hdr_t *) & eprom_buf[0];
584
585 __u8 cmos[4];
586 unsigned long addr;
587
588 /* initiallise the SUS mailbox */
589 for (i = 0; i < sizeof(cmos); i++)
590 cmos[i] = voyager_extended_cmos_read(VOYAGER_DUMP_LOCATION + i);
591 addr = *(unsigned long *)cmos;
592 if ((addr & 0xff000000) != 0xff000000) {
593 printk(KERN_ERR
594 "Voyager failed to get SUS mailbox (addr = 0x%lx\n",
595 addr);
596 } else {
597 static struct resource res;
598
599 res.name = "voyager SUS";
600 res.start = addr;
601 res.end = addr + 0x3ff;
602
603 request_resource(&iomem_resource, &res);
604 voyager_SUS = (struct voyager_SUS *)
605 ioremap(addr, 0x400);
606 printk(KERN_NOTICE "Voyager SUS mailbox version 0x%x\n",
607 voyager_SUS->SUS_version);
608 voyager_SUS->kernel_version = VOYAGER_MAILBOX_VERSION;
609 voyager_SUS->kernel_flags = VOYAGER_OS_HAS_SYSINT;
610 }
611
612 /* clear the processor counts */
613 voyager_extended_vic_processors = 0;
614 voyager_quad_processors = 0;
615
616 printk("VOYAGER: beginning CAT bus probe\n");
617 /* set up the SuperSet Port Block which tells us where the
618 * CAT communication port is */
619 sspb = inb(VOYAGER_SSPB_RELOCATION_PORT) * 0x100;
620 VDEBUG(("VOYAGER DEBUG: sspb = 0x%x\n", sspb));
621
622 /* now find out if were 8 slot or normal */
623 if ((inb(VIC_PROC_WHO_AM_I) & EIGHT_SLOT_IDENTIFIER)
624 == EIGHT_SLOT_IDENTIFIER) {
625 voyager_8slot = 1;
626 printk(KERN_NOTICE
627 "Voyager: Eight slot 51xx configuration detected\n");
628 }
629
630 for (i = VOYAGER_MIN_MODULE; i <= VOYAGER_MAX_MODULE; i++) {
631 __u8 input;
632 int asic;
633 __u16 eprom_size;
634 __u16 sp_offset;
635
636 outb(VOYAGER_CAT_DESELECT, VOYAGER_CAT_CONFIG_PORT);
637 outb(i, VOYAGER_CAT_CONFIG_PORT);
638
639 /* check the presence of the module */
640 outb(VOYAGER_CAT_RUN, CAT_CMD);
641 outb(VOYAGER_CAT_IRCYC, CAT_CMD);
642 outb(VOYAGER_CAT_HEADER, CAT_DATA);
643 /* stream series of alternating 1's and 0's to stimulate
644 * response */
645 outb(0xAA, CAT_DATA);
646 input = inb(CAT_DATA);
647 outb(VOYAGER_CAT_END, CAT_CMD);
648 if (input != VOYAGER_CAT_HEADER) {
649 continue;
650 }
651 CDEBUG(("VOYAGER DEBUG: found module id 0x%x, %s\n", i,
652 cat_module_name(i)));
653 *modpp = kmalloc(sizeof(voyager_module_t), GFP_KERNEL); /*&voyager_module_storage[cat_count++]; */
654 if (*modpp == NULL) {
655 printk("**WARNING** kmalloc failure in cat_init\n");
656 continue;
657 }
658 memset(*modpp, 0, sizeof(voyager_module_t));
659 /* need temporary asic for cat_subread. It will be
660 * filled in correctly later */
661 (*modpp)->asic = kmalloc(sizeof(voyager_asic_t), GFP_KERNEL); /*&voyager_asic_storage[asic_count]; */
662 if ((*modpp)->asic == NULL) {
663 printk("**WARNING** kmalloc failure in cat_init\n");
664 continue;
665 }
666 memset((*modpp)->asic, 0, sizeof(voyager_asic_t));
667 (*modpp)->asic->asic_id = VOYAGER_CAT_ID;
668 (*modpp)->asic->subaddr = VOYAGER_SUBADDR_HI;
669 (*modpp)->module_addr = i;
670 (*modpp)->scan_path_connected = 0;
671 if (i == VOYAGER_PSI) {
672 /* Exception leg for modules with no EEPROM */
673 printk("Module \"%s\"\n", cat_module_name(i));
674 continue;
675 }
676
677 CDEBUG(("cat_init: Reading eeprom for module 0x%x at offset %d\n", i, VOYAGER_XSUM_END_OFFSET));
678 outb(VOYAGER_CAT_RUN, CAT_CMD);
679 cat_disconnect(*modpp, (*modpp)->asic);
680 if (cat_subread(*modpp, (*modpp)->asic,
681 VOYAGER_XSUM_END_OFFSET, sizeof(eprom_size),
682 &eprom_size)) {
683 printk
684 ("**WARNING**: Voyager couldn't read EPROM size for module 0x%x\n",
685 i);
686 outb(VOYAGER_CAT_END, CAT_CMD);
687 continue;
688 }
689 if (eprom_size > sizeof(eprom_buf)) {
690 printk
691 ("**WARNING**: Voyager insufficient size to read EPROM data, module 0x%x. Need %d\n",
692 i, eprom_size);
693 outb(VOYAGER_CAT_END, CAT_CMD);
694 continue;
695 }
696 outb(VOYAGER_CAT_END, CAT_CMD);
697 outb(VOYAGER_CAT_RUN, CAT_CMD);
698 CDEBUG(("cat_init: module 0x%x, eeprom_size %d\n", i,
699 eprom_size));
700 if (cat_subread
701 (*modpp, (*modpp)->asic, 0, eprom_size, eprom_buf)) {
702 outb(VOYAGER_CAT_END, CAT_CMD);
703 continue;
704 }
705 outb(VOYAGER_CAT_END, CAT_CMD);
706 printk("Module \"%s\", version 0x%x, tracer 0x%x, asics %d\n",
707 cat_module_name(i), eprom_hdr->version_id,
708 *((__u32 *) eprom_hdr->tracer), eprom_hdr->num_asics);
709 (*modpp)->ee_size = eprom_hdr->ee_size;
710 (*modpp)->num_asics = eprom_hdr->num_asics;
711 asicpp = &((*modpp)->asic);
712 sp_offset = eprom_hdr->scan_path_offset;
713 /* All we really care about are the Quad cards. We
714 * identify them because they are in a processor slot
715 * and have only four asics */
716 if ((i < 0x10 || (i >= 0x14 && i < 0x1c) || i > 0x1f)) {
717 modpp = &((*modpp)->next);
718 continue;
719 }
720 /* Now we know it's in a processor slot, does it have
721 * a quad baseboard submodule */
722 outb(VOYAGER_CAT_RUN, CAT_CMD);
723 cat_read(*modpp, (*modpp)->asic, VOYAGER_SUBMODPRESENT,
724 &num_submodules);
725 /* lowest two bits, active low */
726 num_submodules = ~(0xfc | num_submodules);
727 CDEBUG(("VOYAGER CAT: %d submodules present\n",
728 num_submodules));
729 if (num_submodules == 0) {
730 /* fill in the dyadic extended processors */
731 __u8 cpu = i & 0x07;
732
733 printk("Module \"%s\": Dyadic Processor Card\n",
734 cat_module_name(i));
735 voyager_extended_vic_processors |= (1 << cpu);
736 cpu += 4;
737 voyager_extended_vic_processors |= (1 << cpu);
738 outb(VOYAGER_CAT_END, CAT_CMD);
739 continue;
740 }
741
742 /* now we want to read the asics on the first submodule,
743 * which should be the quad base board */
744
745 cat_read(*modpp, (*modpp)->asic, VOYAGER_SUBMODSELECT, &val);
746 CDEBUG(("cat_init: SUBMODSELECT value = 0x%x\n", val));
747 val = (val & 0x7c) | VOYAGER_QUAD_BASEBOARD;
748 cat_write(*modpp, (*modpp)->asic, VOYAGER_SUBMODSELECT, val);
749
750 outb(VOYAGER_CAT_END, CAT_CMD);
751
752 CDEBUG(("cat_init: Reading eeprom for module 0x%x at offset %d\n", i, VOYAGER_XSUM_END_OFFSET));
753 outb(VOYAGER_CAT_RUN, CAT_CMD);
754 cat_disconnect(*modpp, (*modpp)->asic);
755 if (cat_subread(*modpp, (*modpp)->asic,
756 VOYAGER_XSUM_END_OFFSET, sizeof(eprom_size),
757 &eprom_size)) {
758 printk
759 ("**WARNING**: Voyager couldn't read EPROM size for module 0x%x\n",
760 i);
761 outb(VOYAGER_CAT_END, CAT_CMD);
762 continue;
763 }
764 if (eprom_size > sizeof(eprom_buf)) {
765 printk
766 ("**WARNING**: Voyager insufficient size to read EPROM data, module 0x%x. Need %d\n",
767 i, eprom_size);
768 outb(VOYAGER_CAT_END, CAT_CMD);
769 continue;
770 }
771 outb(VOYAGER_CAT_END, CAT_CMD);
772 outb(VOYAGER_CAT_RUN, CAT_CMD);
773 CDEBUG(("cat_init: module 0x%x, eeprom_size %d\n", i,
774 eprom_size));
775 if (cat_subread
776 (*modpp, (*modpp)->asic, 0, eprom_size, eprom_buf)) {
777 outb(VOYAGER_CAT_END, CAT_CMD);
778 continue;
779 }
780 outb(VOYAGER_CAT_END, CAT_CMD);
781 /* Now do everything for the QBB submodule 1 */
782 (*modpp)->ee_size = eprom_hdr->ee_size;
783 (*modpp)->num_asics = eprom_hdr->num_asics;
784 asicpp = &((*modpp)->asic);
785 sp_offset = eprom_hdr->scan_path_offset;
786 /* get rid of the dummy CAT asic and read the real one */
787 kfree((*modpp)->asic);
788 for (asic = 0; asic < (*modpp)->num_asics; asic++) {
789 int j;
790 voyager_asic_t *asicp = *asicpp = kzalloc(sizeof(voyager_asic_t), GFP_KERNEL); /*&voyager_asic_storage[asic_count++]; */
791 voyager_sp_table_t *sp_table;
792 voyager_at_t *asic_table;
793 voyager_jtt_t *jtag_table;
794
795 if (asicp == NULL) {
796 printk
797 ("**WARNING** kmalloc failure in cat_init\n");
798 continue;
799 }
800 asicpp = &(asicp->next);
801 asicp->asic_location = asic;
802 sp_table =
803 (voyager_sp_table_t *) (eprom_buf + sp_offset);
804 asicp->asic_id = sp_table->asic_id;
805 asic_table =
806 (voyager_at_t *) (eprom_buf +
807 sp_table->asic_data_offset);
808 for (j = 0; j < 4; j++)
809 asicp->jtag_id[j] = asic_table->jtag_id[j];
810 jtag_table =
811 (voyager_jtt_t *) (eprom_buf +
812 asic_table->jtag_offset);
813 asicp->ireg_length = jtag_table->ireg_len;
814 asicp->bit_location = (*modpp)->inst_bits;
815 (*modpp)->inst_bits += asicp->ireg_length;
816 if (asicp->ireg_length > (*modpp)->largest_reg)
817 (*modpp)->largest_reg = asicp->ireg_length;
818 if (asicp->ireg_length < (*modpp)->smallest_reg ||
819 (*modpp)->smallest_reg == 0)
820 (*modpp)->smallest_reg = asicp->ireg_length;
821 CDEBUG(("asic 0x%x, ireg_length=%d, bit_location=%d\n",
822 asicp->asic_id, asicp->ireg_length,
823 asicp->bit_location));
824 if (asicp->asic_id == VOYAGER_QUAD_QABC) {
825 CDEBUG(("VOYAGER CAT: QABC ASIC found\n"));
826 qabc_asic = asicp;
827 }
828 sp_offset += sizeof(voyager_sp_table_t);
829 }
830 CDEBUG(("Module inst_bits = %d, largest_reg = %d, smallest_reg=%d\n", (*modpp)->inst_bits, (*modpp)->largest_reg, (*modpp)->smallest_reg));
831 /* OK, now we have the QUAD ASICs set up, use them.
832 * we need to:
833 *
834 * 1. Find the Memory area for the Quad CPIs.
835 * 2. Find the Extended VIC processor
836 * 3. Configure a second extended VIC processor (This
837 * cannot be done for the 51xx.
838 * */
839 outb(VOYAGER_CAT_RUN, CAT_CMD);
840 cat_connect(*modpp, (*modpp)->asic);
841 CDEBUG(("CAT CONNECTED!!\n"));
842 cat_subread(*modpp, qabc_asic, 0, sizeof(qabc_data), qabc_data);
843 qic_addr = qabc_data[5] << 8;
844 qic_addr = (qic_addr | qabc_data[6]) << 8;
845 qic_addr = (qic_addr | qabc_data[7]) << 8;
846 printk
847 ("Module \"%s\": Quad Processor Card; CPI 0x%lx, SET=0x%x\n",
848 cat_module_name(i), qic_addr, qabc_data[8]);
849#if 0 /* plumbing fails---FIXME */
850 if ((qabc_data[8] & 0xf0) == 0) {
851 /* FIXME: 32 way 8 CPU slot monster cannot be
852 * plumbed this way---need to check for it */
853
854 printk("Plumbing second Extended Quad Processor\n");
855 /* second VIC line hardwired to Quad CPU 1 */
856 qabc_data[8] |= 0x20;
857 cat_subwrite(*modpp, qabc_asic, 8, 1, &qabc_data[8]);
858#ifdef VOYAGER_CAT_DEBUG
859 /* verify plumbing */
860 cat_subread(*modpp, qabc_asic, 8, 1, &qabc_data[8]);
861 if ((qabc_data[8] & 0xf0) == 0) {
862 CDEBUG(("PLUMBING FAILED: 0x%x\n",
863 qabc_data[8]));
864 }
865#endif
866 }
867#endif
868
869 {
870 struct resource *res =
871 kzalloc(sizeof(struct resource), GFP_KERNEL);
872 res->name = kmalloc(128, GFP_KERNEL);
873 sprintf((char *)res->name, "Voyager %s Quad CPI",
874 cat_module_name(i));
875 res->start = qic_addr;
876 res->end = qic_addr + 0x3ff;
877 request_resource(&iomem_resource, res);
878 }
879
880 qic_addr = (unsigned long)ioremap_cache(qic_addr, 0x400);
881
882 for (j = 0; j < 4; j++) {
883 __u8 cpu;
884
885 if (voyager_8slot) {
886 /* 8 slot has a different mapping,
887 * each slot has only one vic line, so
888 * 1 cpu in each slot must be < 8 */
889 cpu = (i & 0x07) + j * 8;
890 } else {
891 cpu = (i & 0x03) + j * 4;
892 }
893 if ((qabc_data[8] & (1 << j))) {
894 voyager_extended_vic_processors |= (1 << cpu);
895 }
896 if (qabc_data[8] & (1 << (j + 4))) {
897 /* Second SET register plumbed: Quad
898 * card has two VIC connected CPUs.
899 * Secondary cannot be booted as a VIC
900 * CPU */
901 voyager_extended_vic_processors |= (1 << cpu);
902 voyager_allowed_boot_processors &=
903 (~(1 << cpu));
904 }
905
906 voyager_quad_processors |= (1 << cpu);
907 voyager_quad_cpi_addr[cpu] = (struct voyager_qic_cpi *)
908 (qic_addr + (j << 8));
909 CDEBUG(("CPU%d: CPI address 0x%lx\n", cpu,
910 (unsigned long)voyager_quad_cpi_addr[cpu]));
911 }
912 outb(VOYAGER_CAT_END, CAT_CMD);
913
914 *asicpp = NULL;
915 modpp = &((*modpp)->next);
916 }
917 *modpp = NULL;
918 printk
919 ("CAT Bus Initialisation finished: extended procs 0x%x, quad procs 0x%x, allowed vic boot = 0x%x\n",
920 voyager_extended_vic_processors, voyager_quad_processors,
921 voyager_allowed_boot_processors);
922 request_resource(&ioport_resource, &vic_res);
923 if (voyager_quad_processors)
924 request_resource(&ioport_resource, &qic_res);
925 /* set up the front power switch */
926}
927
928int voyager_cat_readb(__u8 module, __u8 asic, int reg)
929{
930 return 0;
931}
932
933static int cat_disconnect(voyager_module_t * modp, voyager_asic_t * asicp)
934{
935 __u8 val;
936 int err = 0;
937
938 if (!modp->scan_path_connected)
939 return 0;
940 if (asicp->asic_id != VOYAGER_CAT_ID) {
941 CDEBUG(("cat_disconnect: ASIC is not CAT\n"));
942 return 1;
943 }
944 err = cat_read(modp, asicp, VOYAGER_SCANPATH, &val);
945 if (err) {
946 CDEBUG(("cat_disconnect: failed to read SCANPATH\n"));
947 return err;
948 }
949 val &= VOYAGER_DISCONNECT_ASIC;
950 err = cat_write(modp, asicp, VOYAGER_SCANPATH, val);
951 if (err) {
952 CDEBUG(("cat_disconnect: failed to write SCANPATH\n"));
953 return err;
954 }
955 outb(VOYAGER_CAT_END, CAT_CMD);
956 outb(VOYAGER_CAT_RUN, CAT_CMD);
957 modp->scan_path_connected = 0;
958
959 return 0;
960}
961
962static int cat_connect(voyager_module_t * modp, voyager_asic_t * asicp)
963{
964 __u8 val;
965 int err = 0;
966
967 if (modp->scan_path_connected)
968 return 0;
969 if (asicp->asic_id != VOYAGER_CAT_ID) {
970 CDEBUG(("cat_connect: ASIC is not CAT\n"));
971 return 1;
972 }
973
974 err = cat_read(modp, asicp, VOYAGER_SCANPATH, &val);
975 if (err) {
976 CDEBUG(("cat_connect: failed to read SCANPATH\n"));
977 return err;
978 }
979 val |= VOYAGER_CONNECT_ASIC;
980 err = cat_write(modp, asicp, VOYAGER_SCANPATH, val);
981 if (err) {
982 CDEBUG(("cat_connect: failed to write SCANPATH\n"));
983 return err;
984 }
985 outb(VOYAGER_CAT_END, CAT_CMD);
986 outb(VOYAGER_CAT_RUN, CAT_CMD);
987 modp->scan_path_connected = 1;
988
989 return 0;
990}
991
992void voyager_cat_power_off(void)
993{
994 /* Power the machine off by writing to the PSI over the CAT
995 * bus */
996 __u8 data;
997 voyager_module_t psi = { 0 };
998 voyager_asic_t psi_asic = { 0 };
999
1000 psi.asic = &psi_asic;
1001 psi.asic->asic_id = VOYAGER_CAT_ID;
1002 psi.asic->subaddr = VOYAGER_SUBADDR_HI;
1003 psi.module_addr = VOYAGER_PSI;
1004 psi.scan_path_connected = 0;
1005
1006 outb(VOYAGER_CAT_END, CAT_CMD);
1007 /* Connect the PSI to the CAT Bus */
1008 outb(VOYAGER_CAT_DESELECT, VOYAGER_CAT_CONFIG_PORT);
1009 outb(VOYAGER_PSI, VOYAGER_CAT_CONFIG_PORT);
1010 outb(VOYAGER_CAT_RUN, CAT_CMD);
1011 cat_disconnect(&psi, &psi_asic);
1012 /* Read the status */
1013 cat_subread(&psi, &psi_asic, VOYAGER_PSI_GENERAL_REG, 1, &data);
1014 outb(VOYAGER_CAT_END, CAT_CMD);
1015 CDEBUG(("PSI STATUS 0x%x\n", data));
1016 /* These two writes are power off prep and perform */
1017 data = PSI_CLEAR;
1018 outb(VOYAGER_CAT_RUN, CAT_CMD);
1019 cat_subwrite(&psi, &psi_asic, VOYAGER_PSI_GENERAL_REG, 1, &data);
1020 outb(VOYAGER_CAT_END, CAT_CMD);
1021 data = PSI_POWER_DOWN;
1022 outb(VOYAGER_CAT_RUN, CAT_CMD);
1023 cat_subwrite(&psi, &psi_asic, VOYAGER_PSI_GENERAL_REG, 1, &data);
1024 outb(VOYAGER_CAT_END, CAT_CMD);
1025}
1026
1027struct voyager_status voyager_status = { 0 };
1028
1029void voyager_cat_psi(__u8 cmd, __u16 reg, __u8 * data)
1030{
1031 voyager_module_t psi = { 0 };
1032 voyager_asic_t psi_asic = { 0 };
1033
1034 psi.asic = &psi_asic;
1035 psi.asic->asic_id = VOYAGER_CAT_ID;
1036 psi.asic->subaddr = VOYAGER_SUBADDR_HI;
1037 psi.module_addr = VOYAGER_PSI;
1038 psi.scan_path_connected = 0;
1039
1040 outb(VOYAGER_CAT_END, CAT_CMD);
1041 /* Connect the PSI to the CAT Bus */
1042 outb(VOYAGER_CAT_DESELECT, VOYAGER_CAT_CONFIG_PORT);
1043 outb(VOYAGER_PSI, VOYAGER_CAT_CONFIG_PORT);
1044 outb(VOYAGER_CAT_RUN, CAT_CMD);
1045 cat_disconnect(&psi, &psi_asic);
1046 switch (cmd) {
1047 case VOYAGER_PSI_READ:
1048 cat_read(&psi, &psi_asic, reg, data);
1049 break;
1050 case VOYAGER_PSI_WRITE:
1051 cat_write(&psi, &psi_asic, reg, *data);
1052 break;
1053 case VOYAGER_PSI_SUBREAD:
1054 cat_subread(&psi, &psi_asic, reg, 1, data);
1055 break;
1056 case VOYAGER_PSI_SUBWRITE:
1057 cat_subwrite(&psi, &psi_asic, reg, 1, data);
1058 break;
1059 default:
1060 printk(KERN_ERR "Voyager PSI, unrecognised command %d\n", cmd);
1061 break;
1062 }
1063 outb(VOYAGER_CAT_END, CAT_CMD);
1064}
1065
1066void voyager_cat_do_common_interrupt(void)
1067{
1068 /* This is caused either by a memory parity error or something
1069 * in the PSI */
1070 __u8 data;
1071 voyager_module_t psi = { 0 };
1072 voyager_asic_t psi_asic = { 0 };
1073 struct voyager_psi psi_reg;
1074 int i;
1075 re_read:
1076 psi.asic = &psi_asic;
1077 psi.asic->asic_id = VOYAGER_CAT_ID;
1078 psi.asic->subaddr = VOYAGER_SUBADDR_HI;
1079 psi.module_addr = VOYAGER_PSI;
1080 psi.scan_path_connected = 0;
1081
1082 outb(VOYAGER_CAT_END, CAT_CMD);
1083 /* Connect the PSI to the CAT Bus */
1084 outb(VOYAGER_CAT_DESELECT, VOYAGER_CAT_CONFIG_PORT);
1085 outb(VOYAGER_PSI, VOYAGER_CAT_CONFIG_PORT);
1086 outb(VOYAGER_CAT_RUN, CAT_CMD);
1087 cat_disconnect(&psi, &psi_asic);
1088 /* Read the status. NOTE: Need to read *all* the PSI regs here
1089 * otherwise the cmn int will be reasserted */
1090 for (i = 0; i < sizeof(psi_reg.regs); i++) {
1091 cat_read(&psi, &psi_asic, i, &((__u8 *) & psi_reg.regs)[i]);
1092 }
1093 outb(VOYAGER_CAT_END, CAT_CMD);
1094 if ((psi_reg.regs.checkbit & 0x02) == 0) {
1095 psi_reg.regs.checkbit |= 0x02;
1096 cat_write(&psi, &psi_asic, 5, psi_reg.regs.checkbit);
1097 printk("VOYAGER RE-READ PSI\n");
1098 goto re_read;
1099 }
1100 outb(VOYAGER_CAT_RUN, CAT_CMD);
1101 for (i = 0; i < sizeof(psi_reg.subregs); i++) {
1102 /* This looks strange, but the PSI doesn't do auto increment
1103 * correctly */
1104 cat_subread(&psi, &psi_asic, VOYAGER_PSI_SUPPLY_REG + i,
1105 1, &((__u8 *) & psi_reg.subregs)[i]);
1106 }
1107 outb(VOYAGER_CAT_END, CAT_CMD);
1108#ifdef VOYAGER_CAT_DEBUG
1109 printk("VOYAGER PSI: ");
1110 for (i = 0; i < sizeof(psi_reg.regs); i++)
1111 printk("%02x ", ((__u8 *) & psi_reg.regs)[i]);
1112 printk("\n ");
1113 for (i = 0; i < sizeof(psi_reg.subregs); i++)
1114 printk("%02x ", ((__u8 *) & psi_reg.subregs)[i]);
1115 printk("\n");
1116#endif
1117 if (psi_reg.regs.intstatus & PSI_MON) {
1118 /* switch off or power fail */
1119
1120 if (psi_reg.subregs.supply & PSI_SWITCH_OFF) {
1121 if (voyager_status.switch_off) {
1122 printk(KERN_ERR
1123 "Voyager front panel switch turned off again---Immediate power off!\n");
1124 voyager_cat_power_off();
1125 /* not reached */
1126 } else {
1127 printk(KERN_ERR
1128 "Voyager front panel switch turned off\n");
1129 voyager_status.switch_off = 1;
1130 voyager_status.request_from_kernel = 1;
1131 wake_up_process(voyager_thread);
1132 }
1133 /* Tell the hardware we're taking care of the
1134 * shutdown, otherwise it will power the box off
1135 * within 3 seconds of the switch being pressed and,
1136 * which is much more important to us, continue to
1137 * assert the common interrupt */
1138 data = PSI_CLR_SWITCH_OFF;
1139 outb(VOYAGER_CAT_RUN, CAT_CMD);
1140 cat_subwrite(&psi, &psi_asic, VOYAGER_PSI_SUPPLY_REG,
1141 1, &data);
1142 outb(VOYAGER_CAT_END, CAT_CMD);
1143 } else {
1144
1145 VDEBUG(("Voyager ac fail reg 0x%x\n",
1146 psi_reg.subregs.ACfail));
1147 if ((psi_reg.subregs.ACfail & AC_FAIL_STAT_CHANGE) == 0) {
1148 /* No further update */
1149 return;
1150 }
1151#if 0
1152 /* Don't bother trying to find out who failed.
1153 * FIXME: This probably makes the code incorrect on
1154 * anything other than a 345x */
1155 for (i = 0; i < 5; i++) {
1156 if (psi_reg.subregs.ACfail & (1 << i)) {
1157 break;
1158 }
1159 }
1160 printk(KERN_NOTICE "AC FAIL IN SUPPLY %d\n", i);
1161#endif
1162 /* DON'T do this: it shuts down the AC PSI
1163 outb(VOYAGER_CAT_RUN, CAT_CMD);
1164 data = PSI_MASK_MASK | i;
1165 cat_subwrite(&psi, &psi_asic, VOYAGER_PSI_MASK,
1166 1, &data);
1167 outb(VOYAGER_CAT_END, CAT_CMD);
1168 */
1169 printk(KERN_ERR "Voyager AC power failure\n");
1170 outb(VOYAGER_CAT_RUN, CAT_CMD);
1171 data = PSI_COLD_START;
1172 cat_subwrite(&psi, &psi_asic, VOYAGER_PSI_GENERAL_REG,
1173 1, &data);
1174 outb(VOYAGER_CAT_END, CAT_CMD);
1175 voyager_status.power_fail = 1;
1176 voyager_status.request_from_kernel = 1;
1177 wake_up_process(voyager_thread);
1178 }
1179
1180 } else if (psi_reg.regs.intstatus & PSI_FAULT) {
1181 /* Major fault! */
1182 printk(KERN_ERR
1183 "Voyager PSI Detected major fault, immediate power off!\n");
1184 voyager_cat_power_off();
1185 /* not reached */
1186 } else if (psi_reg.regs.intstatus & (PSI_DC_FAIL | PSI_ALARM
1187 | PSI_CURRENT | PSI_DVM
1188 | PSI_PSCFAULT | PSI_STAT_CHG)) {
1189 /* other psi fault */
1190
1191 printk(KERN_WARNING "Voyager PSI status 0x%x\n", data);
1192 /* clear the PSI fault */
1193 outb(VOYAGER_CAT_RUN, CAT_CMD);
1194 cat_write(&psi, &psi_asic, VOYAGER_PSI_STATUS_REG, 0);
1195 outb(VOYAGER_CAT_END, CAT_CMD);
1196 }
1197}
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
deleted file mode 100644
index b9cc84a2a4fc..000000000000
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ /dev/null
@@ -1,1807 +0,0 @@
1/* -*- mode: c; c-basic-offset: 8 -*- */
2
3/* Copyright (C) 1999,2001
4 *
5 * Author: J.E.J.Bottomley@HansenPartnership.com
6 *
7 * This file provides all the same external entries as smp.c but uses
8 * the voyager hal to provide the functionality
9 */
10#include <linux/cpu.h>
11#include <linux/module.h>
12#include <linux/mm.h>
13#include <linux/kernel_stat.h>
14#include <linux/delay.h>
15#include <linux/mc146818rtc.h>
16#include <linux/cache.h>
17#include <linux/interrupt.h>
18#include <linux/init.h>
19#include <linux/kernel.h>
20#include <linux/bootmem.h>
21#include <linux/completion.h>
22#include <asm/desc.h>
23#include <asm/voyager.h>
24#include <asm/vic.h>
25#include <asm/mtrr.h>
26#include <asm/pgalloc.h>
27#include <asm/tlbflush.h>
28#include <asm/arch_hooks.h>
29#include <asm/trampoline.h>
30
31/* TLB state -- visible externally, indexed physically */
32DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = { &init_mm, 0 };
33
34/* CPU IRQ affinity -- set to all ones initially */
35static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned =
36 {[0 ... NR_CPUS-1] = ~0UL };
37
38/* per CPU data structure (for /proc/cpuinfo et al), visible externally
39 * indexed physically */
40DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
41EXPORT_PER_CPU_SYMBOL(cpu_info);
42
43/* physical ID of the CPU used to boot the system */
44unsigned char boot_cpu_id;
45
46/* The memory line addresses for the Quad CPIs */
47struct voyager_qic_cpi *voyager_quad_cpi_addr[NR_CPUS] __cacheline_aligned;
48
49/* The masks for the Extended VIC processors, filled in by cat_init */
50__u32 voyager_extended_vic_processors = 0;
51
52/* Masks for the extended Quad processors which cannot be VIC booted */
53__u32 voyager_allowed_boot_processors = 0;
54
55/* The mask for the Quad Processors (both extended and non-extended) */
56__u32 voyager_quad_processors = 0;
57
58/* Total count of live CPUs, used in process.c to display
59 * the CPU information and in irq.c for the per CPU irq
60 * activity count. Finally exported by i386_ksyms.c */
61static int voyager_extended_cpus = 1;
62
63/* Used for the invalidate map that's also checked in the spinlock */
64static volatile unsigned long smp_invalidate_needed;
65
66/* Bitmask of CPUs present in the system - exported by i386_syms.c, used
67 * by scheduler but indexed physically */
68static cpumask_t voyager_phys_cpu_present_map = CPU_MASK_NONE;
69
70/* The internal functions */
71static void send_CPI(__u32 cpuset, __u8 cpi);
72static void ack_CPI(__u8 cpi);
73static int ack_QIC_CPI(__u8 cpi);
74static void ack_special_QIC_CPI(__u8 cpi);
75static void ack_VIC_CPI(__u8 cpi);
76static void send_CPI_allbutself(__u8 cpi);
77static void mask_vic_irq(unsigned int irq);
78static void unmask_vic_irq(unsigned int irq);
79static unsigned int startup_vic_irq(unsigned int irq);
80static void enable_local_vic_irq(unsigned int irq);
81static void disable_local_vic_irq(unsigned int irq);
82static void before_handle_vic_irq(unsigned int irq);
83static void after_handle_vic_irq(unsigned int irq);
84static void set_vic_irq_affinity(unsigned int irq, const struct cpumask *mask);
85static void ack_vic_irq(unsigned int irq);
86static void vic_enable_cpi(void);
87static void do_boot_cpu(__u8 cpuid);
88static void do_quad_bootstrap(void);
89static void initialize_secondary(void);
90
91int hard_smp_processor_id(void);
92int safe_smp_processor_id(void);
93
94/* Inline functions */
95static inline void send_one_QIC_CPI(__u8 cpu, __u8 cpi)
96{
97 voyager_quad_cpi_addr[cpu]->qic_cpi[cpi].cpi =
98 (smp_processor_id() << 16) + cpi;
99}
100
101static inline void send_QIC_CPI(__u32 cpuset, __u8 cpi)
102{
103 int cpu;
104
105 for_each_online_cpu(cpu) {
106 if (cpuset & (1 << cpu)) {
107#ifdef VOYAGER_DEBUG
108 if (!cpu_online(cpu))
109 VDEBUG(("CPU%d sending cpi %d to CPU%d not in "
110 "cpu_online_map\n",
111 hard_smp_processor_id(), cpi, cpu));
112#endif
113 send_one_QIC_CPI(cpu, cpi - QIC_CPI_OFFSET);
114 }
115 }
116}
117
118static inline void wrapper_smp_local_timer_interrupt(void)
119{
120 irq_enter();
121 smp_local_timer_interrupt();
122 irq_exit();
123}
124
125static inline void send_one_CPI(__u8 cpu, __u8 cpi)
126{
127 if (voyager_quad_processors & (1 << cpu))
128 send_one_QIC_CPI(cpu, cpi - QIC_CPI_OFFSET);
129 else
130 send_CPI(1 << cpu, cpi);
131}
132
133static inline void send_CPI_allbutself(__u8 cpi)
134{
135 __u8 cpu = smp_processor_id();
136 __u32 mask = cpus_addr(cpu_online_map)[0] & ~(1 << cpu);
137 send_CPI(mask, cpi);
138}
139
140static inline int is_cpu_quad(void)
141{
142 __u8 cpumask = inb(VIC_PROC_WHO_AM_I);
143 return ((cpumask & QUAD_IDENTIFIER) == QUAD_IDENTIFIER);
144}
145
146static inline int is_cpu_extended(void)
147{
148 __u8 cpu = hard_smp_processor_id();
149
150 return (voyager_extended_vic_processors & (1 << cpu));
151}
152
153static inline int is_cpu_vic_boot(void)
154{
155 __u8 cpu = hard_smp_processor_id();
156
157 return (voyager_extended_vic_processors
158 & voyager_allowed_boot_processors & (1 << cpu));
159}
160
161static inline void ack_CPI(__u8 cpi)
162{
163 switch (cpi) {
164 case VIC_CPU_BOOT_CPI:
165 if (is_cpu_quad() && !is_cpu_vic_boot())
166 ack_QIC_CPI(cpi);
167 else
168 ack_VIC_CPI(cpi);
169 break;
170 case VIC_SYS_INT:
171 case VIC_CMN_INT:
172 /* These are slightly strange. Even on the Quad card,
173 * They are vectored as VIC CPIs */
174 if (is_cpu_quad())
175 ack_special_QIC_CPI(cpi);
176 else
177 ack_VIC_CPI(cpi);
178 break;
179 default:
180 printk("VOYAGER ERROR: CPI%d is in common CPI code\n", cpi);
181 break;
182 }
183}
184
185/* local variables */
186
187/* The VIC IRQ descriptors -- these look almost identical to the
188 * 8259 IRQs except that masks and things must be kept per processor
189 */
190static struct irq_chip vic_chip = {
191 .name = "VIC",
192 .startup = startup_vic_irq,
193 .mask = mask_vic_irq,
194 .unmask = unmask_vic_irq,
195 .set_affinity = set_vic_irq_affinity,
196};
197
198/* used to count up as CPUs are brought on line (starts at 0) */
199static int cpucount = 0;
200
201/* The per cpu profile stuff - used in smp_local_timer_interrupt */
202static DEFINE_PER_CPU(int, prof_multiplier) = 1;
203static DEFINE_PER_CPU(int, prof_old_multiplier) = 1;
204static DEFINE_PER_CPU(int, prof_counter) = 1;
205
206/* the map used to check if a CPU has booted */
207static __u32 cpu_booted_map;
208
209/* the synchronize flag used to hold all secondary CPUs spinning in
210 * a tight loop until the boot sequence is ready for them */
211static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
212
213/* This is for the new dynamic CPU boot code */
214
215/* The per processor IRQ masks (these are usually kept in sync) */
216static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned;
217
218/* the list of IRQs to be enabled by the VIC_ENABLE_IRQ_CPI */
219static __u16 vic_irq_enable_mask[NR_CPUS] __cacheline_aligned = { 0 };
220
221/* Lock for enable/disable of VIC interrupts */
222static __cacheline_aligned DEFINE_SPINLOCK(vic_irq_lock);
223
224/* The boot processor is correctly set up in PC mode when it
225 * comes up, but the secondaries need their master/slave 8259
226 * pairs initializing correctly */
227
228/* Interrupt counters (per cpu) and total - used to try to
229 * even up the interrupt handling routines */
230static long vic_intr_total = 0;
231static long vic_intr_count[NR_CPUS] __cacheline_aligned = { 0 };
232static unsigned long vic_tick[NR_CPUS] __cacheline_aligned = { 0 };
233
234/* Since we can only use CPI0, we fake all the other CPIs */
235static unsigned long vic_cpi_mailbox[NR_CPUS] __cacheline_aligned;
236
237/* debugging routine to read the isr of the cpu's pic */
238static inline __u16 vic_read_isr(void)
239{
240 __u16 isr;
241
242 outb(0x0b, 0xa0);
243 isr = inb(0xa0) << 8;
244 outb(0x0b, 0x20);
245 isr |= inb(0x20);
246
247 return isr;
248}
249
250static __init void qic_setup(void)
251{
252 if (!is_cpu_quad()) {
253 /* not a quad, no setup */
254 return;
255 }
256 outb(QIC_DEFAULT_MASK0, QIC_MASK_REGISTER0);
257 outb(QIC_CPI_ENABLE, QIC_MASK_REGISTER1);
258
259 if (is_cpu_extended()) {
260 /* the QIC duplicate of the VIC base register */
261 outb(VIC_DEFAULT_CPI_BASE, QIC_VIC_CPI_BASE_REGISTER);
262 outb(QIC_DEFAULT_CPI_BASE, QIC_CPI_BASE_REGISTER);
263
264 /* FIXME: should set up the QIC timer and memory parity
265 * error vectors here */
266 }
267}
268
269static __init void vic_setup_pic(void)
270{
271 outb(1, VIC_REDIRECT_REGISTER_1);
272 /* clear the claim registers for dynamic routing */
273 outb(0, VIC_CLAIM_REGISTER_0);
274 outb(0, VIC_CLAIM_REGISTER_1);
275
276 outb(0, VIC_PRIORITY_REGISTER);
277 /* Set the Primary and Secondary Microchannel vector
278 * bases to be the same as the ordinary interrupts
279 *
280 * FIXME: This would be more efficient using separate
281 * vectors. */
282 outb(FIRST_EXTERNAL_VECTOR, VIC_PRIMARY_MC_BASE);
283 outb(FIRST_EXTERNAL_VECTOR, VIC_SECONDARY_MC_BASE);
284 /* Now initiallise the master PIC belonging to this CPU by
285 * sending the four ICWs */
286
287 /* ICW1: level triggered, ICW4 needed */
288 outb(0x19, 0x20);
289
290 /* ICW2: vector base */
291 outb(FIRST_EXTERNAL_VECTOR, 0x21);
292
293 /* ICW3: slave at line 2 */
294 outb(0x04, 0x21);
295
296 /* ICW4: 8086 mode */
297 outb(0x01, 0x21);
298
299 /* now the same for the slave PIC */
300
301 /* ICW1: level trigger, ICW4 needed */
302 outb(0x19, 0xA0);
303
304 /* ICW2: slave vector base */
305 outb(FIRST_EXTERNAL_VECTOR + 8, 0xA1);
306
307 /* ICW3: slave ID */
308 outb(0x02, 0xA1);
309
310 /* ICW4: 8086 mode */
311 outb(0x01, 0xA1);
312}
313
314static void do_quad_bootstrap(void)
315{
316 if (is_cpu_quad() && is_cpu_vic_boot()) {
317 int i;
318 unsigned long flags;
319 __u8 cpuid = hard_smp_processor_id();
320
321 local_irq_save(flags);
322
323 for (i = 0; i < 4; i++) {
324 /* FIXME: this would be >>3 &0x7 on the 32 way */
325 if (((cpuid >> 2) & 0x03) == i)
326 /* don't lower our own mask! */
327 continue;
328
329 /* masquerade as local Quad CPU */
330 outb(QIC_CPUID_ENABLE | i, QIC_PROCESSOR_ID);
331 /* enable the startup CPI */
332 outb(QIC_BOOT_CPI_MASK, QIC_MASK_REGISTER1);
333 /* restore cpu id */
334 outb(0, QIC_PROCESSOR_ID);
335 }
336 local_irq_restore(flags);
337 }
338}
339
340void prefill_possible_map(void)
341{
342 /* This is empty on voyager because we need a much
343 * earlier detection which is done in find_smp_config */
344}
345
346/* Set up all the basic stuff: read the SMP config and make all the
347 * SMP information reflect only the boot cpu. All others will be
348 * brought on-line later. */
349void __init find_smp_config(void)
350{
351 int i;
352
353 boot_cpu_id = hard_smp_processor_id();
354
355 printk("VOYAGER SMP: Boot cpu is %d\n", boot_cpu_id);
356
357 /* initialize the CPU structures (moved from smp_boot_cpus) */
358 for (i = 0; i < nr_cpu_ids; i++)
359 cpu_irq_affinity[i] = ~0;
360 cpu_online_map = cpumask_of_cpu(boot_cpu_id);
361
362 /* The boot CPU must be extended */
363 voyager_extended_vic_processors = 1 << boot_cpu_id;
364 /* initially, all of the first 8 CPUs can boot */
365 voyager_allowed_boot_processors = 0xff;
366 /* set up everything for just this CPU, we can alter
367 * this as we start the other CPUs later */
368 /* now get the CPU disposition from the extended CMOS */
369 cpus_addr(voyager_phys_cpu_present_map)[0] =
370 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK);
371 cpus_addr(voyager_phys_cpu_present_map)[0] |=
372 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8;
373 cpus_addr(voyager_phys_cpu_present_map)[0] |=
374 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
375 2) << 16;
376 cpus_addr(voyager_phys_cpu_present_map)[0] |=
377 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
378 3) << 24;
379 init_cpu_possible(&voyager_phys_cpu_present_map);
380 printk("VOYAGER SMP: voyager_phys_cpu_present_map = 0x%lx\n",
381 cpus_addr(voyager_phys_cpu_present_map)[0]);
382 /* Here we set up the VIC to enable SMP */
383 /* enable the CPIs by writing the base vector to their register */
384 outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER);
385 outb(1, VIC_REDIRECT_REGISTER_1);
386 /* set the claim registers for static routing --- Boot CPU gets
387 * all interrupts untill all other CPUs started */
388 outb(0xff, VIC_CLAIM_REGISTER_0);
389 outb(0xff, VIC_CLAIM_REGISTER_1);
390 /* Set the Primary and Secondary Microchannel vector
391 * bases to be the same as the ordinary interrupts
392 *
393 * FIXME: This would be more efficient using separate
394 * vectors. */
395 outb(FIRST_EXTERNAL_VECTOR, VIC_PRIMARY_MC_BASE);
396 outb(FIRST_EXTERNAL_VECTOR, VIC_SECONDARY_MC_BASE);
397
398 /* Finally tell the firmware that we're driving */
399 outb(inb(VOYAGER_SUS_IN_CONTROL_PORT) | VOYAGER_IN_CONTROL_FLAG,
400 VOYAGER_SUS_IN_CONTROL_PORT);
401
402 current_thread_info()->cpu = boot_cpu_id;
403 x86_write_percpu(cpu_number, boot_cpu_id);
404}
405
406/*
407 * The bootstrap kernel entry code has set these up. Save them
408 * for a given CPU, id is physical */
409void __init smp_store_cpu_info(int id)
410{
411 struct cpuinfo_x86 *c = &cpu_data(id);
412
413 *c = boot_cpu_data;
414 c->cpu_index = id;
415
416 identify_secondary_cpu(c);
417}
418
419/* Routine initially called when a non-boot CPU is brought online */
420static void __init start_secondary(void *unused)
421{
422 __u8 cpuid = hard_smp_processor_id();
423
424 cpu_init();
425
426 /* OK, we're in the routine */
427 ack_CPI(VIC_CPU_BOOT_CPI);
428
429 /* setup the 8259 master slave pair belonging to this CPU ---
430 * we won't actually receive any until the boot CPU
431 * relinquishes it's static routing mask */
432 vic_setup_pic();
433
434 qic_setup();
435
436 if (is_cpu_quad() && !is_cpu_vic_boot()) {
437 /* clear the boot CPI */
438 __u8 dummy;
439
440 dummy =
441 voyager_quad_cpi_addr[cpuid]->qic_cpi[VIC_CPU_BOOT_CPI].cpi;
442 printk("read dummy %d\n", dummy);
443 }
444
445 /* lower the mask to receive CPIs */
446 vic_enable_cpi();
447
448 VDEBUG(("VOYAGER SMP: CPU%d, stack at about %p\n", cpuid, &cpuid));
449
450 notify_cpu_starting(cpuid);
451
452 /* enable interrupts */
453 local_irq_enable();
454
455 /* get our bogomips */
456 calibrate_delay();
457
458 /* save our processor parameters */
459 smp_store_cpu_info(cpuid);
460
461 /* if we're a quad, we may need to bootstrap other CPUs */
462 do_quad_bootstrap();
463
464 /* FIXME: this is rather a poor hack to prevent the CPU
465 * activating softirqs while it's supposed to be waiting for
466 * permission to proceed. Without this, the new per CPU stuff
467 * in the softirqs will fail */
468 local_irq_disable();
469 cpu_set(cpuid, cpu_callin_map);
470
471 /* signal that we're done */
472 cpu_booted_map = 1;
473
474 while (!cpu_isset(cpuid, smp_commenced_mask))
475 rep_nop();
476 local_irq_enable();
477
478 local_flush_tlb();
479
480 cpu_set(cpuid, cpu_online_map);
481 wmb();
482 cpu_idle();
483}
484
485/* Routine to kick start the given CPU and wait for it to report ready
486 * (or timeout in startup). When this routine returns, the requested
487 * CPU is either fully running and configured or known to be dead.
488 *
489 * We call this routine sequentially 1 CPU at a time, so no need for
490 * locking */
491
492static void __init do_boot_cpu(__u8 cpu)
493{
494 struct task_struct *idle;
495 int timeout;
496 unsigned long flags;
497 int quad_boot = (1 << cpu) & voyager_quad_processors
498 & ~(voyager_extended_vic_processors
499 & voyager_allowed_boot_processors);
500
501 /* This is the format of the CPI IDT gate (in real mode) which
502 * we're hijacking to boot the CPU */
503 union IDTFormat {
504 struct seg {
505 __u16 Offset;
506 __u16 Segment;
507 } idt;
508 __u32 val;
509 } hijack_source;
510
511 __u32 *hijack_vector;
512 __u32 start_phys_address = setup_trampoline();
513
514 /* There's a clever trick to this: The linux trampoline is
515 * compiled to begin at absolute location zero, so make the
516 * address zero but have the data segment selector compensate
517 * for the actual address */
518 hijack_source.idt.Offset = start_phys_address & 0x000F;
519 hijack_source.idt.Segment = (start_phys_address >> 4) & 0xFFFF;
520
521 cpucount++;
522 alternatives_smp_switch(1);
523
524 idle = fork_idle(cpu);
525 if (IS_ERR(idle))
526 panic("failed fork for CPU%d", cpu);
527 idle->thread.ip = (unsigned long)start_secondary;
528 /* init_tasks (in sched.c) is indexed logically */
529 stack_start.sp = (void *)idle->thread.sp;
530
531 init_gdt(cpu);
532 per_cpu(current_task, cpu) = idle;
533 early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu);
534 irq_ctx_init(cpu);
535
536 /* Note: Don't modify initial ss override */
537 VDEBUG(("VOYAGER SMP: Booting CPU%d at 0x%lx[%x:%x], stack %p\n", cpu,
538 (unsigned long)hijack_source.val, hijack_source.idt.Segment,
539 hijack_source.idt.Offset, stack_start.sp));
540
541 /* init lowmem identity mapping */
542 clone_pgd_range(swapper_pg_dir, swapper_pg_dir + KERNEL_PGD_BOUNDARY,
543 min_t(unsigned long, KERNEL_PGD_PTRS, KERNEL_PGD_BOUNDARY));
544 flush_tlb_all();
545
546 if (quad_boot) {
547 printk("CPU %d: non extended Quad boot\n", cpu);
548 hijack_vector =
549 (__u32 *)
550 phys_to_virt((VIC_CPU_BOOT_CPI + QIC_DEFAULT_CPI_BASE) * 4);
551 *hijack_vector = hijack_source.val;
552 } else {
553 printk("CPU%d: extended VIC boot\n", cpu);
554 hijack_vector =
555 (__u32 *)
556 phys_to_virt((VIC_CPU_BOOT_CPI + VIC_DEFAULT_CPI_BASE) * 4);
557 *hijack_vector = hijack_source.val;
558 /* VIC errata, may also receive interrupt at this address */
559 hijack_vector =
560 (__u32 *)
561 phys_to_virt((VIC_CPU_BOOT_ERRATA_CPI +
562 VIC_DEFAULT_CPI_BASE) * 4);
563 *hijack_vector = hijack_source.val;
564 }
565 /* All non-boot CPUs start with interrupts fully masked. Need
566 * to lower the mask of the CPI we're about to send. We do
567 * this in the VIC by masquerading as the processor we're
568 * about to boot and lowering its interrupt mask */
569 local_irq_save(flags);
570 if (quad_boot) {
571 send_one_QIC_CPI(cpu, VIC_CPU_BOOT_CPI);
572 } else {
573 outb(VIC_CPU_MASQUERADE_ENABLE | cpu, VIC_PROCESSOR_ID);
574 /* here we're altering registers belonging to `cpu' */
575
576 outb(VIC_BOOT_INTERRUPT_MASK, 0x21);
577 /* now go back to our original identity */
578 outb(boot_cpu_id, VIC_PROCESSOR_ID);
579
580 /* and boot the CPU */
581
582 send_CPI((1 << cpu), VIC_CPU_BOOT_CPI);
583 }
584 cpu_booted_map = 0;
585 local_irq_restore(flags);
586
587 /* now wait for it to become ready (or timeout) */
588 for (timeout = 0; timeout < 50000; timeout++) {
589 if (cpu_booted_map)
590 break;
591 udelay(100);
592 }
593 /* reset the page table */
594 zap_low_mappings();
595
596 if (cpu_booted_map) {
597 VDEBUG(("CPU%d: Booted successfully, back in CPU %d\n",
598 cpu, smp_processor_id()));
599
600 printk("CPU%d: ", cpu);
601 print_cpu_info(&cpu_data(cpu));
602 wmb();
603 cpu_set(cpu, cpu_callout_map);
604 cpu_set(cpu, cpu_present_map);
605 } else {
606 printk("CPU%d FAILED TO BOOT: ", cpu);
607 if (*
608 ((volatile unsigned char *)phys_to_virt(start_phys_address))
609 == 0xA5)
610 printk("Stuck.\n");
611 else
612 printk("Not responding.\n");
613
614 cpucount--;
615 }
616}
617
618void __init smp_boot_cpus(void)
619{
620 int i;
621
622 /* CAT BUS initialisation must be done after the memory */
623 /* FIXME: The L4 has a catbus too, it just needs to be
624 * accessed in a totally different way */
625 if (voyager_level == 5) {
626 voyager_cat_init();
627
628 /* now that the cat has probed the Voyager System Bus, sanity
629 * check the cpu map */
630 if (((voyager_quad_processors | voyager_extended_vic_processors)
631 & cpus_addr(voyager_phys_cpu_present_map)[0]) !=
632 cpus_addr(voyager_phys_cpu_present_map)[0]) {
633 /* should panic */
634 printk("\n\n***WARNING*** "
635 "Sanity check of CPU present map FAILED\n");
636 }
637 } else if (voyager_level == 4)
638 voyager_extended_vic_processors =
639 cpus_addr(voyager_phys_cpu_present_map)[0];
640
641 /* this sets up the idle task to run on the current cpu */
642 voyager_extended_cpus = 1;
643 /* Remove the global_irq_holder setting, it triggers a BUG() on
644 * schedule at the moment */
645 //global_irq_holder = boot_cpu_id;
646
647 /* FIXME: Need to do something about this but currently only works
648 * on CPUs with a tsc which none of mine have.
649 smp_tune_scheduling();
650 */
651 smp_store_cpu_info(boot_cpu_id);
652 /* setup the jump vector */
653 initial_code = (unsigned long)initialize_secondary;
654 printk("CPU%d: ", boot_cpu_id);
655 print_cpu_info(&cpu_data(boot_cpu_id));
656
657 if (is_cpu_quad()) {
658 /* booting on a Quad CPU */
659 printk("VOYAGER SMP: Boot CPU is Quad\n");
660 qic_setup();
661 do_quad_bootstrap();
662 }
663
664 /* enable our own CPIs */
665 vic_enable_cpi();
666
667 cpu_set(boot_cpu_id, cpu_online_map);
668 cpu_set(boot_cpu_id, cpu_callout_map);
669
670 /* loop over all the extended VIC CPUs and boot them. The
671 * Quad CPUs must be bootstrapped by their extended VIC cpu */
672 for (i = 0; i < nr_cpu_ids; i++) {
673 if (i == boot_cpu_id || !cpu_isset(i, voyager_phys_cpu_present_map))
674 continue;
675 do_boot_cpu(i);
676 /* This udelay seems to be needed for the Quad boots
677 * don't remove unless you know what you're doing */
678 udelay(1000);
679 }
680 /* we could compute the total bogomips here, but why bother?,
681 * Code added from smpboot.c */
682 {
683 unsigned long bogosum = 0;
684
685 for_each_online_cpu(i)
686 bogosum += cpu_data(i).loops_per_jiffy;
687 printk(KERN_INFO "Total of %d processors activated "
688 "(%lu.%02lu BogoMIPS).\n",
689 cpucount + 1, bogosum / (500000 / HZ),
690 (bogosum / (5000 / HZ)) % 100);
691 }
692 voyager_extended_cpus = hweight32(voyager_extended_vic_processors);
693 printk("VOYAGER: Extended (interrupt handling CPUs): "
694 "%d, non-extended: %d\n", voyager_extended_cpus,
695 num_booting_cpus() - voyager_extended_cpus);
696 /* that's it, switch to symmetric mode */
697 outb(0, VIC_PRIORITY_REGISTER);
698 outb(0, VIC_CLAIM_REGISTER_0);
699 outb(0, VIC_CLAIM_REGISTER_1);
700
701 VDEBUG(("VOYAGER SMP: Booted with %d CPUs\n", num_booting_cpus()));
702}
703
704/* Reload the secondary CPUs task structure (this function does not
705 * return ) */
706static void __init initialize_secondary(void)
707{
708#if 0
709 // AC kernels only
710 set_current(hard_get_current());
711#endif
712
713 /*
714 * We don't actually need to load the full TSS,
715 * basically just the stack pointer and the eip.
716 */
717
718 asm volatile ("movl %0,%%esp\n\t"
719 "jmp *%1"::"r" (current->thread.sp),
720 "r"(current->thread.ip));
721}
722
723/* handle a Voyager SYS_INT -- If we don't, the base board will
724 * panic the system.
725 *
726 * System interrupts occur because some problem was detected on the
727 * various busses. To find out what you have to probe all the
728 * hardware via the CAT bus. FIXME: At the moment we do nothing. */
729void smp_vic_sys_interrupt(struct pt_regs *regs)
730{
731 ack_CPI(VIC_SYS_INT);
732 printk("Voyager SYSTEM INTERRUPT\n");
733}
734
735/* Handle a voyager CMN_INT; These interrupts occur either because of
736 * a system status change or because a single bit memory error
737 * occurred. FIXME: At the moment, ignore all this. */
738void smp_vic_cmn_interrupt(struct pt_regs *regs)
739{
740 static __u8 in_cmn_int = 0;
741 static DEFINE_SPINLOCK(cmn_int_lock);
742
743 /* common ints are broadcast, so make sure we only do this once */
744 _raw_spin_lock(&cmn_int_lock);
745 if (in_cmn_int)
746 goto unlock_end;
747
748 in_cmn_int++;
749 _raw_spin_unlock(&cmn_int_lock);
750
751 VDEBUG(("Voyager COMMON INTERRUPT\n"));
752
753 if (voyager_level == 5)
754 voyager_cat_do_common_interrupt();
755
756 _raw_spin_lock(&cmn_int_lock);
757 in_cmn_int = 0;
758 unlock_end:
759 _raw_spin_unlock(&cmn_int_lock);
760 ack_CPI(VIC_CMN_INT);
761}
762
763/*
764 * Reschedule call back. Nothing to do, all the work is done
765 * automatically when we return from the interrupt. */
766static void smp_reschedule_interrupt(void)
767{
768 /* do nothing */
769}
770
771static struct mm_struct *flush_mm;
772static unsigned long flush_va;
773static DEFINE_SPINLOCK(tlbstate_lock);
774
775/*
776 * We cannot call mmdrop() because we are in interrupt context,
777 * instead update mm->cpu_vm_mask.
778 *
779 * We need to reload %cr3 since the page tables may be going
780 * away from under us..
781 */
782static inline void voyager_leave_mm(unsigned long cpu)
783{
784 if (per_cpu(cpu_tlbstate, cpu).state == TLBSTATE_OK)
785 BUG();
786 cpu_clear(cpu, per_cpu(cpu_tlbstate, cpu).active_mm->cpu_vm_mask);
787 load_cr3(swapper_pg_dir);
788}
789
790/*
791 * Invalidate call-back
792 */
793static void smp_invalidate_interrupt(void)
794{
795 __u8 cpu = smp_processor_id();
796
797 if (!test_bit(cpu, &smp_invalidate_needed))
798 return;
799 /* This will flood messages. Don't uncomment unless you see
800 * Problems with cross cpu invalidation
801 VDEBUG(("VOYAGER SMP: CPU%d received INVALIDATE_CPI\n",
802 smp_processor_id()));
803 */
804
805 if (flush_mm == per_cpu(cpu_tlbstate, cpu).active_mm) {
806 if (per_cpu(cpu_tlbstate, cpu).state == TLBSTATE_OK) {
807 if (flush_va == TLB_FLUSH_ALL)
808 local_flush_tlb();
809 else
810 __flush_tlb_one(flush_va);
811 } else
812 voyager_leave_mm(cpu);
813 }
814 smp_mb__before_clear_bit();
815 clear_bit(cpu, &smp_invalidate_needed);
816 smp_mb__after_clear_bit();
817}
818
819/* All the new flush operations for 2.4 */
820
821/* This routine is called with a physical cpu mask */
822static void
823voyager_flush_tlb_others(unsigned long cpumask, struct mm_struct *mm,
824 unsigned long va)
825{
826 int stuck = 50000;
827
828 if (!cpumask)
829 BUG();
830 if ((cpumask & cpus_addr(cpu_online_map)[0]) != cpumask)
831 BUG();
832 if (cpumask & (1 << smp_processor_id()))
833 BUG();
834 if (!mm)
835 BUG();
836
837 spin_lock(&tlbstate_lock);
838
839 flush_mm = mm;
840 flush_va = va;
841 atomic_set_mask(cpumask, &smp_invalidate_needed);
842 /*
843 * We have to send the CPI only to
844 * CPUs affected.
845 */
846 send_CPI(cpumask, VIC_INVALIDATE_CPI);
847
848 while (smp_invalidate_needed) {
849 mb();
850 if (--stuck == 0) {
851 printk("***WARNING*** Stuck doing invalidate CPI "
852 "(CPU%d)\n", smp_processor_id());
853 break;
854 }
855 }
856
857 /* Uncomment only to debug invalidation problems
858 VDEBUG(("VOYAGER SMP: Completed invalidate CPI (CPU%d)\n", cpu));
859 */
860
861 flush_mm = NULL;
862 flush_va = 0;
863 spin_unlock(&tlbstate_lock);
864}
865
866void flush_tlb_current_task(void)
867{
868 struct mm_struct *mm = current->mm;
869 unsigned long cpu_mask;
870
871 preempt_disable();
872
873 cpu_mask = cpus_addr(mm->cpu_vm_mask)[0] & ~(1 << smp_processor_id());
874 local_flush_tlb();
875 if (cpu_mask)
876 voyager_flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL);
877
878 preempt_enable();
879}
880
881void flush_tlb_mm(struct mm_struct *mm)
882{
883 unsigned long cpu_mask;
884
885 preempt_disable();
886
887 cpu_mask = cpus_addr(mm->cpu_vm_mask)[0] & ~(1 << smp_processor_id());
888
889 if (current->active_mm == mm) {
890 if (current->mm)
891 local_flush_tlb();
892 else
893 voyager_leave_mm(smp_processor_id());
894 }
895 if (cpu_mask)
896 voyager_flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL);
897
898 preempt_enable();
899}
900
901void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
902{
903 struct mm_struct *mm = vma->vm_mm;
904 unsigned long cpu_mask;
905
906 preempt_disable();
907
908 cpu_mask = cpus_addr(mm->cpu_vm_mask)[0] & ~(1 << smp_processor_id());
909 if (current->active_mm == mm) {
910 if (current->mm)
911 __flush_tlb_one(va);
912 else
913 voyager_leave_mm(smp_processor_id());
914 }
915
916 if (cpu_mask)
917 voyager_flush_tlb_others(cpu_mask, mm, va);
918
919 preempt_enable();
920}
921
922EXPORT_SYMBOL(flush_tlb_page);
923
924/* enable the requested IRQs */
925static void smp_enable_irq_interrupt(void)
926{
927 __u8 irq;
928 __u8 cpu = get_cpu();
929
930 VDEBUG(("VOYAGER SMP: CPU%d enabling irq mask 0x%x\n", cpu,
931 vic_irq_enable_mask[cpu]));
932
933 spin_lock(&vic_irq_lock);
934 for (irq = 0; irq < 16; irq++) {
935 if (vic_irq_enable_mask[cpu] & (1 << irq))
936 enable_local_vic_irq(irq);
937 }
938 vic_irq_enable_mask[cpu] = 0;
939 spin_unlock(&vic_irq_lock);
940
941 put_cpu_no_resched();
942}
943
944/*
945 * CPU halt call-back
946 */
947static void smp_stop_cpu_function(void *dummy)
948{
949 VDEBUG(("VOYAGER SMP: CPU%d is STOPPING\n", smp_processor_id()));
950 cpu_clear(smp_processor_id(), cpu_online_map);
951 local_irq_disable();
952 for (;;)
953 halt();
954}
955
956/* execute a thread on a new CPU. The function to be called must be
957 * previously set up. This is used to schedule a function for
958 * execution on all CPUs - set up the function then broadcast a
959 * function_interrupt CPI to come here on each CPU */
960static void smp_call_function_interrupt(void)
961{
962 irq_enter();
963 generic_smp_call_function_interrupt();
964 __get_cpu_var(irq_stat).irq_call_count++;
965 irq_exit();
966}
967
968static void smp_call_function_single_interrupt(void)
969{
970 irq_enter();
971 generic_smp_call_function_single_interrupt();
972 __get_cpu_var(irq_stat).irq_call_count++;
973 irq_exit();
974}
975
976/* Sorry about the name. In an APIC based system, the APICs
977 * themselves are programmed to send a timer interrupt. This is used
978 * by linux to reschedule the processor. Voyager doesn't have this,
979 * so we use the system clock to interrupt one processor, which in
980 * turn, broadcasts a timer CPI to all the others --- we receive that
981 * CPI here. We don't use this actually for counting so losing
982 * ticks doesn't matter
983 *
984 * FIXME: For those CPUs which actually have a local APIC, we could
985 * try to use it to trigger this interrupt instead of having to
986 * broadcast the timer tick. Unfortunately, all my pentium DYADs have
987 * no local APIC, so I can't do this
988 *
989 * This function is currently a placeholder and is unused in the code */
990void smp_apic_timer_interrupt(struct pt_regs *regs)
991{
992 struct pt_regs *old_regs = set_irq_regs(regs);
993 wrapper_smp_local_timer_interrupt();
994 set_irq_regs(old_regs);
995}
996
997/* All of the QUAD interrupt GATES */
998void smp_qic_timer_interrupt(struct pt_regs *regs)
999{
1000 struct pt_regs *old_regs = set_irq_regs(regs);
1001 ack_QIC_CPI(QIC_TIMER_CPI);
1002 wrapper_smp_local_timer_interrupt();
1003 set_irq_regs(old_regs);
1004}
1005
1006void smp_qic_invalidate_interrupt(struct pt_regs *regs)
1007{
1008 ack_QIC_CPI(QIC_INVALIDATE_CPI);
1009 smp_invalidate_interrupt();
1010}
1011
1012void smp_qic_reschedule_interrupt(struct pt_regs *regs)
1013{
1014 ack_QIC_CPI(QIC_RESCHEDULE_CPI);
1015 smp_reschedule_interrupt();
1016}
1017
1018void smp_qic_enable_irq_interrupt(struct pt_regs *regs)
1019{
1020 ack_QIC_CPI(QIC_ENABLE_IRQ_CPI);
1021 smp_enable_irq_interrupt();
1022}
1023
1024void smp_qic_call_function_interrupt(struct pt_regs *regs)
1025{
1026 ack_QIC_CPI(QIC_CALL_FUNCTION_CPI);
1027 smp_call_function_interrupt();
1028}
1029
1030void smp_qic_call_function_single_interrupt(struct pt_regs *regs)
1031{
1032 ack_QIC_CPI(QIC_CALL_FUNCTION_SINGLE_CPI);
1033 smp_call_function_single_interrupt();
1034}
1035
1036void smp_vic_cpi_interrupt(struct pt_regs *regs)
1037{
1038 struct pt_regs *old_regs = set_irq_regs(regs);
1039 __u8 cpu = smp_processor_id();
1040
1041 if (is_cpu_quad())
1042 ack_QIC_CPI(VIC_CPI_LEVEL0);
1043 else
1044 ack_VIC_CPI(VIC_CPI_LEVEL0);
1045
1046 if (test_and_clear_bit(VIC_TIMER_CPI, &vic_cpi_mailbox[cpu]))
1047 wrapper_smp_local_timer_interrupt();
1048 if (test_and_clear_bit(VIC_INVALIDATE_CPI, &vic_cpi_mailbox[cpu]))
1049 smp_invalidate_interrupt();
1050 if (test_and_clear_bit(VIC_RESCHEDULE_CPI, &vic_cpi_mailbox[cpu]))
1051 smp_reschedule_interrupt();
1052 if (test_and_clear_bit(VIC_ENABLE_IRQ_CPI, &vic_cpi_mailbox[cpu]))
1053 smp_enable_irq_interrupt();
1054 if (test_and_clear_bit(VIC_CALL_FUNCTION_CPI, &vic_cpi_mailbox[cpu]))
1055 smp_call_function_interrupt();
1056 if (test_and_clear_bit(VIC_CALL_FUNCTION_SINGLE_CPI, &vic_cpi_mailbox[cpu]))
1057 smp_call_function_single_interrupt();
1058 set_irq_regs(old_regs);
1059}
1060
1061static void do_flush_tlb_all(void *info)
1062{
1063 unsigned long cpu = smp_processor_id();
1064
1065 __flush_tlb_all();
1066 if (per_cpu(cpu_tlbstate, cpu).state == TLBSTATE_LAZY)
1067 voyager_leave_mm(cpu);
1068}
1069
1070/* flush the TLB of every active CPU in the system */
1071void flush_tlb_all(void)
1072{
1073 on_each_cpu(do_flush_tlb_all, 0, 1);
1074}
1075
1076/* send a reschedule CPI to one CPU by physical CPU number*/
1077static void voyager_smp_send_reschedule(int cpu)
1078{
1079 send_one_CPI(cpu, VIC_RESCHEDULE_CPI);
1080}
1081
1082int hard_smp_processor_id(void)
1083{
1084 __u8 i;
1085 __u8 cpumask = inb(VIC_PROC_WHO_AM_I);
1086 if ((cpumask & QUAD_IDENTIFIER) == QUAD_IDENTIFIER)
1087 return cpumask & 0x1F;
1088
1089 for (i = 0; i < 8; i++) {
1090 if (cpumask & (1 << i))
1091 return i;
1092 }
1093 printk("** WARNING ** Illegal cpuid returned by VIC: %d", cpumask);
1094 return 0;
1095}
1096
1097int safe_smp_processor_id(void)
1098{
1099 return hard_smp_processor_id();
1100}
1101
1102/* broadcast a halt to all other CPUs */
1103static void voyager_smp_send_stop(void)
1104{
1105 smp_call_function(smp_stop_cpu_function, NULL, 1);
1106}
1107
1108/* this function is triggered in time.c when a clock tick fires
1109 * we need to re-broadcast the tick to all CPUs */
1110void smp_vic_timer_interrupt(void)
1111{
1112 send_CPI_allbutself(VIC_TIMER_CPI);
1113 smp_local_timer_interrupt();
1114}
1115
1116/* local (per CPU) timer interrupt. It does both profiling and
1117 * process statistics/rescheduling.
1118 *
1119 * We do profiling in every local tick, statistics/rescheduling
1120 * happen only every 'profiling multiplier' ticks. The default
1121 * multiplier is 1 and it can be changed by writing the new multiplier
1122 * value into /proc/profile.
1123 */
1124void smp_local_timer_interrupt(void)
1125{
1126 int cpu = smp_processor_id();
1127 long weight;
1128
1129 profile_tick(CPU_PROFILING);
1130 if (--per_cpu(prof_counter, cpu) <= 0) {
1131 /*
1132 * The multiplier may have changed since the last time we got
1133 * to this point as a result of the user writing to
1134 * /proc/profile. In this case we need to adjust the APIC
1135 * timer accordingly.
1136 *
1137 * Interrupts are already masked off at this point.
1138 */
1139 per_cpu(prof_counter, cpu) = per_cpu(prof_multiplier, cpu);
1140 if (per_cpu(prof_counter, cpu) !=
1141 per_cpu(prof_old_multiplier, cpu)) {
1142 /* FIXME: need to update the vic timer tick here */
1143 per_cpu(prof_old_multiplier, cpu) =
1144 per_cpu(prof_counter, cpu);
1145 }
1146
1147 update_process_times(user_mode_vm(get_irq_regs()));
1148 }
1149
1150 if (((1 << cpu) & voyager_extended_vic_processors) == 0)
1151 /* only extended VIC processors participate in
1152 * interrupt distribution */
1153 return;
1154
1155 /*
1156 * We take the 'long' return path, and there every subsystem
1157 * grabs the appropriate locks (kernel lock/ irq lock).
1158 *
1159 * we might want to decouple profiling from the 'long path',
1160 * and do the profiling totally in assembly.
1161 *
1162 * Currently this isn't too much of an issue (performance wise),
1163 * we can take more than 100K local irqs per second on a 100 MHz P5.
1164 */
1165
1166 if ((++vic_tick[cpu] & 0x7) != 0)
1167 return;
1168 /* get here every 16 ticks (about every 1/6 of a second) */
1169
1170 /* Change our priority to give someone else a chance at getting
1171 * the IRQ. The algorithm goes like this:
1172 *
1173 * In the VIC, the dynamically routed interrupt is always
1174 * handled by the lowest priority eligible (i.e. receiving
1175 * interrupts) CPU. If >1 eligible CPUs are equal lowest, the
1176 * lowest processor number gets it.
1177 *
1178 * The priority of a CPU is controlled by a special per-CPU
1179 * VIC priority register which is 3 bits wide 0 being lowest
1180 * and 7 highest priority..
1181 *
1182 * Therefore we subtract the average number of interrupts from
1183 * the number we've fielded. If this number is negative, we
1184 * lower the activity count and if it is positive, we raise
1185 * it.
1186 *
1187 * I'm afraid this still leads to odd looking interrupt counts:
1188 * the totals are all roughly equal, but the individual ones
1189 * look rather skewed.
1190 *
1191 * FIXME: This algorithm is total crap when mixed with SMP
1192 * affinity code since we now try to even up the interrupt
1193 * counts when an affinity binding is keeping them on a
1194 * particular CPU*/
1195 weight = (vic_intr_count[cpu] * voyager_extended_cpus
1196 - vic_intr_total) >> 4;
1197 weight += 4;
1198 if (weight > 7)
1199 weight = 7;
1200 if (weight < 0)
1201 weight = 0;
1202
1203 outb((__u8) weight, VIC_PRIORITY_REGISTER);
1204
1205#ifdef VOYAGER_DEBUG
1206 if ((vic_tick[cpu] & 0xFFF) == 0) {
1207 /* print this message roughly every 25 secs */
1208 printk("VOYAGER SMP: vic_tick[%d] = %lu, weight = %ld\n",
1209 cpu, vic_tick[cpu], weight);
1210 }
1211#endif
1212}
1213
1214/* setup the profiling timer */
1215int setup_profiling_timer(unsigned int multiplier)
1216{
1217 int i;
1218
1219 if ((!multiplier))
1220 return -EINVAL;
1221
1222 /*
1223 * Set the new multiplier for each CPU. CPUs don't start using the
1224 * new values until the next timer interrupt in which they do process
1225 * accounting.
1226 */
1227 for (i = 0; i < nr_cpu_ids; ++i)
1228 per_cpu(prof_multiplier, i) = multiplier;
1229
1230 return 0;
1231}
1232
1233/* This is a bit of a mess, but forced on us by the genirq changes
1234 * there's no genirq handler that really does what voyager wants
1235 * so hack it up with the simple IRQ handler */
1236static void handle_vic_irq(unsigned int irq, struct irq_desc *desc)
1237{
1238 before_handle_vic_irq(irq);
1239 handle_simple_irq(irq, desc);
1240 after_handle_vic_irq(irq);
1241}
1242
1243/* The CPIs are handled in the per cpu 8259s, so they must be
1244 * enabled to be received: FIX: enabling the CPIs in the early
1245 * boot sequence interferes with bug checking; enable them later
1246 * on in smp_init */
1247#define VIC_SET_GATE(cpi, vector) \
1248 set_intr_gate((cpi) + VIC_DEFAULT_CPI_BASE, (vector))
1249#define QIC_SET_GATE(cpi, vector) \
1250 set_intr_gate((cpi) + QIC_DEFAULT_CPI_BASE, (vector))
1251
1252void __init voyager_smp_intr_init(void)
1253{
1254 int i;
1255
1256 /* initialize the per cpu irq mask to all disabled */
1257 for (i = 0; i < nr_cpu_ids; i++)
1258 vic_irq_mask[i] = 0xFFFF;
1259
1260 VIC_SET_GATE(VIC_CPI_LEVEL0, vic_cpi_interrupt);
1261
1262 VIC_SET_GATE(VIC_SYS_INT, vic_sys_interrupt);
1263 VIC_SET_GATE(VIC_CMN_INT, vic_cmn_interrupt);
1264
1265 QIC_SET_GATE(QIC_TIMER_CPI, qic_timer_interrupt);
1266 QIC_SET_GATE(QIC_INVALIDATE_CPI, qic_invalidate_interrupt);
1267 QIC_SET_GATE(QIC_RESCHEDULE_CPI, qic_reschedule_interrupt);
1268 QIC_SET_GATE(QIC_ENABLE_IRQ_CPI, qic_enable_irq_interrupt);
1269 QIC_SET_GATE(QIC_CALL_FUNCTION_CPI, qic_call_function_interrupt);
1270
1271 /* now put the VIC descriptor into the first 48 IRQs
1272 *
1273 * This is for later: first 16 correspond to PC IRQs; next 16
1274 * are Primary MC IRQs and final 16 are Secondary MC IRQs */
1275 for (i = 0; i < 48; i++)
1276 set_irq_chip_and_handler(i, &vic_chip, handle_vic_irq);
1277}
1278
1279/* send a CPI at level cpi to a set of cpus in cpuset (set 1 bit per
1280 * processor to receive CPI */
1281static void send_CPI(__u32 cpuset, __u8 cpi)
1282{
1283 int cpu;
1284 __u32 quad_cpuset = (cpuset & voyager_quad_processors);
1285
1286 if (cpi < VIC_START_FAKE_CPI) {
1287 /* fake CPI are only used for booting, so send to the
1288 * extended quads as well---Quads must be VIC booted */
1289 outb((__u8) (cpuset), VIC_CPI_Registers[cpi]);
1290 return;
1291 }
1292 if (quad_cpuset)
1293 send_QIC_CPI(quad_cpuset, cpi);
1294 cpuset &= ~quad_cpuset;
1295 cpuset &= 0xff; /* only first 8 CPUs vaild for VIC CPI */
1296 if (cpuset == 0)
1297 return;
1298 for_each_online_cpu(cpu) {
1299 if (cpuset & (1 << cpu))
1300 set_bit(cpi, &vic_cpi_mailbox[cpu]);
1301 }
1302 if (cpuset)
1303 outb((__u8) cpuset, VIC_CPI_Registers[VIC_CPI_LEVEL0]);
1304}
1305
1306/* Acknowledge receipt of CPI in the QIC, clear in QIC hardware and
1307 * set the cache line to shared by reading it.
1308 *
1309 * DON'T make this inline otherwise the cache line read will be
1310 * optimised away
1311 * */
1312static int ack_QIC_CPI(__u8 cpi)
1313{
1314 __u8 cpu = hard_smp_processor_id();
1315
1316 cpi &= 7;
1317
1318 outb(1 << cpi, QIC_INTERRUPT_CLEAR1);
1319 return voyager_quad_cpi_addr[cpu]->qic_cpi[cpi].cpi;
1320}
1321
1322static void ack_special_QIC_CPI(__u8 cpi)
1323{
1324 switch (cpi) {
1325 case VIC_CMN_INT:
1326 outb(QIC_CMN_INT, QIC_INTERRUPT_CLEAR0);
1327 break;
1328 case VIC_SYS_INT:
1329 outb(QIC_SYS_INT, QIC_INTERRUPT_CLEAR0);
1330 break;
1331 }
1332 /* also clear at the VIC, just in case (nop for non-extended proc) */
1333 ack_VIC_CPI(cpi);
1334}
1335
1336/* Acknowledge receipt of CPI in the VIC (essentially an EOI) */
1337static void ack_VIC_CPI(__u8 cpi)
1338{
1339#ifdef VOYAGER_DEBUG
1340 unsigned long flags;
1341 __u16 isr;
1342 __u8 cpu = smp_processor_id();
1343
1344 local_irq_save(flags);
1345 isr = vic_read_isr();
1346 if ((isr & (1 << (cpi & 7))) == 0) {
1347 printk("VOYAGER SMP: CPU%d lost CPI%d\n", cpu, cpi);
1348 }
1349#endif
1350 /* send specific EOI; the two system interrupts have
1351 * bit 4 set for a separate vector but behave as the
1352 * corresponding 3 bit intr */
1353 outb_p(0x60 | (cpi & 7), 0x20);
1354
1355#ifdef VOYAGER_DEBUG
1356 if ((vic_read_isr() & (1 << (cpi & 7))) != 0) {
1357 printk("VOYAGER SMP: CPU%d still asserting CPI%d\n", cpu, cpi);
1358 }
1359 local_irq_restore(flags);
1360#endif
1361}
1362
1363/* cribbed with thanks from irq.c */
1364#define __byte(x,y) (((unsigned char *)&(y))[x])
1365#define cached_21(cpu) (__byte(0,vic_irq_mask[cpu]))
1366#define cached_A1(cpu) (__byte(1,vic_irq_mask[cpu]))
1367
1368static unsigned int startup_vic_irq(unsigned int irq)
1369{
1370 unmask_vic_irq(irq);
1371
1372 return 0;
1373}
1374
1375/* The enable and disable routines. This is where we run into
1376 * conflicting architectural philosophy. Fundamentally, the voyager
1377 * architecture does not expect to have to disable interrupts globally
1378 * (the IRQ controllers belong to each CPU). The processor masquerade
1379 * which is used to start the system shouldn't be used in a running OS
1380 * since it will cause great confusion if two separate CPUs drive to
1381 * the same IRQ controller (I know, I've tried it).
1382 *
1383 * The solution is a variant on the NCR lazy SPL design:
1384 *
1385 * 1) To disable an interrupt, do nothing (other than set the
1386 * IRQ_DISABLED flag). This dares the interrupt actually to arrive.
1387 *
1388 * 2) If the interrupt dares to come in, raise the local mask against
1389 * it (this will result in all the CPU masks being raised
1390 * eventually).
1391 *
1392 * 3) To enable the interrupt, lower the mask on the local CPU and
1393 * broadcast an Interrupt enable CPI which causes all other CPUs to
1394 * adjust their masks accordingly. */
1395
1396static void unmask_vic_irq(unsigned int irq)
1397{
1398 /* linux doesn't to processor-irq affinity, so enable on
1399 * all CPUs we know about */
1400 int cpu = smp_processor_id(), real_cpu;
1401 __u16 mask = (1 << irq);
1402 __u32 processorList = 0;
1403 unsigned long flags;
1404
1405 VDEBUG(("VOYAGER: unmask_vic_irq(%d) CPU%d affinity 0x%lx\n",
1406 irq, cpu, cpu_irq_affinity[cpu]));
1407 spin_lock_irqsave(&vic_irq_lock, flags);
1408 for_each_online_cpu(real_cpu) {
1409 if (!(voyager_extended_vic_processors & (1 << real_cpu)))
1410 continue;
1411 if (!(cpu_irq_affinity[real_cpu] & mask)) {
1412 /* irq has no affinity for this CPU, ignore */
1413 continue;
1414 }
1415 if (real_cpu == cpu) {
1416 enable_local_vic_irq(irq);
1417 } else if (vic_irq_mask[real_cpu] & mask) {
1418 vic_irq_enable_mask[real_cpu] |= mask;
1419 processorList |= (1 << real_cpu);
1420 }
1421 }
1422 spin_unlock_irqrestore(&vic_irq_lock, flags);
1423 if (processorList)
1424 send_CPI(processorList, VIC_ENABLE_IRQ_CPI);
1425}
1426
1427static void mask_vic_irq(unsigned int irq)
1428{
1429 /* lazy disable, do nothing */
1430}
1431
1432static void enable_local_vic_irq(unsigned int irq)
1433{
1434 __u8 cpu = smp_processor_id();
1435 __u16 mask = ~(1 << irq);
1436 __u16 old_mask = vic_irq_mask[cpu];
1437
1438 vic_irq_mask[cpu] &= mask;
1439 if (vic_irq_mask[cpu] == old_mask)
1440 return;
1441
1442 VDEBUG(("VOYAGER DEBUG: Enabling irq %d in hardware on CPU %d\n",
1443 irq, cpu));
1444
1445 if (irq & 8) {
1446 outb_p(cached_A1(cpu), 0xA1);
1447 (void)inb_p(0xA1);
1448 } else {
1449 outb_p(cached_21(cpu), 0x21);
1450 (void)inb_p(0x21);
1451 }
1452}
1453
1454static void disable_local_vic_irq(unsigned int irq)
1455{
1456 __u8 cpu = smp_processor_id();
1457 __u16 mask = (1 << irq);
1458 __u16 old_mask = vic_irq_mask[cpu];
1459
1460 if (irq == 7)
1461 return;
1462
1463 vic_irq_mask[cpu] |= mask;
1464 if (old_mask == vic_irq_mask[cpu])
1465 return;
1466
1467 VDEBUG(("VOYAGER DEBUG: Disabling irq %d in hardware on CPU %d\n",
1468 irq, cpu));
1469
1470 if (irq & 8) {
1471 outb_p(cached_A1(cpu), 0xA1);
1472 (void)inb_p(0xA1);
1473 } else {
1474 outb_p(cached_21(cpu), 0x21);
1475 (void)inb_p(0x21);
1476 }
1477}
1478
1479/* The VIC is level triggered, so the ack can only be issued after the
1480 * interrupt completes. However, we do Voyager lazy interrupt
1481 * handling here: It is an extremely expensive operation to mask an
1482 * interrupt in the vic, so we merely set a flag (IRQ_DISABLED). If
1483 * this interrupt actually comes in, then we mask and ack here to push
1484 * the interrupt off to another CPU */
1485static void before_handle_vic_irq(unsigned int irq)
1486{
1487 irq_desc_t *desc = irq_to_desc(irq);
1488 __u8 cpu = smp_processor_id();
1489
1490 _raw_spin_lock(&vic_irq_lock);
1491 vic_intr_total++;
1492 vic_intr_count[cpu]++;
1493
1494 if (!(cpu_irq_affinity[cpu] & (1 << irq))) {
1495 /* The irq is not in our affinity mask, push it off
1496 * onto another CPU */
1497 VDEBUG(("VOYAGER DEBUG: affinity triggered disable of irq %d "
1498 "on cpu %d\n", irq, cpu));
1499 disable_local_vic_irq(irq);
1500 /* set IRQ_INPROGRESS to prevent the handler in irq.c from
1501 * actually calling the interrupt routine */
1502 desc->status |= IRQ_REPLAY | IRQ_INPROGRESS;
1503 } else if (desc->status & IRQ_DISABLED) {
1504 /* Damn, the interrupt actually arrived, do the lazy
1505 * disable thing. The interrupt routine in irq.c will
1506 * not handle a IRQ_DISABLED interrupt, so nothing more
1507 * need be done here */
1508 VDEBUG(("VOYAGER DEBUG: lazy disable of irq %d on CPU %d\n",
1509 irq, cpu));
1510 disable_local_vic_irq(irq);
1511 desc->status |= IRQ_REPLAY;
1512 } else {
1513 desc->status &= ~IRQ_REPLAY;
1514 }
1515
1516 _raw_spin_unlock(&vic_irq_lock);
1517}
1518
1519/* Finish the VIC interrupt: basically mask */
1520static void after_handle_vic_irq(unsigned int irq)
1521{
1522 irq_desc_t *desc = irq_to_desc(irq);
1523
1524 _raw_spin_lock(&vic_irq_lock);
1525 {
1526 unsigned int status = desc->status & ~IRQ_INPROGRESS;
1527#ifdef VOYAGER_DEBUG
1528 __u16 isr;
1529#endif
1530
1531 desc->status = status;
1532 if ((status & IRQ_DISABLED))
1533 disable_local_vic_irq(irq);
1534#ifdef VOYAGER_DEBUG
1535 /* DEBUG: before we ack, check what's in progress */
1536 isr = vic_read_isr();
1537 if ((isr & (1 << irq) && !(status & IRQ_REPLAY)) == 0) {
1538 int i;
1539 __u8 cpu = smp_processor_id();
1540 __u8 real_cpu;
1541 int mask; /* Um... initialize me??? --RR */
1542
1543 printk("VOYAGER SMP: CPU%d lost interrupt %d\n",
1544 cpu, irq);
1545 for_each_possible_cpu(real_cpu, mask) {
1546
1547 outb(VIC_CPU_MASQUERADE_ENABLE | real_cpu,
1548 VIC_PROCESSOR_ID);
1549 isr = vic_read_isr();
1550 if (isr & (1 << irq)) {
1551 printk
1552 ("VOYAGER SMP: CPU%d ack irq %d\n",
1553 real_cpu, irq);
1554 ack_vic_irq(irq);
1555 }
1556 outb(cpu, VIC_PROCESSOR_ID);
1557 }
1558 }
1559#endif /* VOYAGER_DEBUG */
1560 /* as soon as we ack, the interrupt is eligible for
1561 * receipt by another CPU so everything must be in
1562 * order here */
1563 ack_vic_irq(irq);
1564 if (status & IRQ_REPLAY) {
1565 /* replay is set if we disable the interrupt
1566 * in the before_handle_vic_irq() routine, so
1567 * clear the in progress bit here to allow the
1568 * next CPU to handle this correctly */
1569 desc->status &= ~(IRQ_REPLAY | IRQ_INPROGRESS);
1570 }
1571#ifdef VOYAGER_DEBUG
1572 isr = vic_read_isr();
1573 if ((isr & (1 << irq)) != 0)
1574 printk("VOYAGER SMP: after_handle_vic_irq() after "
1575 "ack irq=%d, isr=0x%x\n", irq, isr);
1576#endif /* VOYAGER_DEBUG */
1577 }
1578 _raw_spin_unlock(&vic_irq_lock);
1579
1580 /* All code after this point is out of the main path - the IRQ
1581 * may be intercepted by another CPU if reasserted */
1582}
1583
1584/* Linux processor - interrupt affinity manipulations.
1585 *
1586 * For each processor, we maintain a 32 bit irq affinity mask.
1587 * Initially it is set to all 1's so every processor accepts every
1588 * interrupt. In this call, we change the processor's affinity mask:
1589 *
1590 * Change from enable to disable:
1591 *
1592 * If the interrupt ever comes in to the processor, we will disable it
1593 * and ack it to push it off to another CPU, so just accept the mask here.
1594 *
1595 * Change from disable to enable:
1596 *
1597 * change the mask and then do an interrupt enable CPI to re-enable on
1598 * the selected processors */
1599
1600void set_vic_irq_affinity(unsigned int irq, const struct cpumask *mask)
1601{
1602 /* Only extended processors handle interrupts */
1603 unsigned long real_mask;
1604 unsigned long irq_mask = 1 << irq;
1605 int cpu;
1606
1607 real_mask = cpus_addr(*mask)[0] & voyager_extended_vic_processors;
1608
1609 if (cpus_addr(*mask)[0] == 0)
1610 /* can't have no CPUs to accept the interrupt -- extremely
1611 * bad things will happen */
1612 return;
1613
1614 if (irq == 0)
1615 /* can't change the affinity of the timer IRQ. This
1616 * is due to the constraint in the voyager
1617 * architecture that the CPI also comes in on and IRQ
1618 * line and we have chosen IRQ0 for this. If you
1619 * raise the mask on this interrupt, the processor
1620 * will no-longer be able to accept VIC CPIs */
1621 return;
1622
1623 if (irq >= 32)
1624 /* You can only have 32 interrupts in a voyager system
1625 * (and 32 only if you have a secondary microchannel
1626 * bus) */
1627 return;
1628
1629 for_each_online_cpu(cpu) {
1630 unsigned long cpu_mask = 1 << cpu;
1631
1632 if (cpu_mask & real_mask) {
1633 /* enable the interrupt for this cpu */
1634 cpu_irq_affinity[cpu] |= irq_mask;
1635 } else {
1636 /* disable the interrupt for this cpu */
1637 cpu_irq_affinity[cpu] &= ~irq_mask;
1638 }
1639 }
1640 /* this is magic, we now have the correct affinity maps, so
1641 * enable the interrupt. This will send an enable CPI to
1642 * those CPUs who need to enable it in their local masks,
1643 * causing them to correct for the new affinity . If the
1644 * interrupt is currently globally disabled, it will simply be
1645 * disabled again as it comes in (voyager lazy disable). If
1646 * the affinity map is tightened to disable the interrupt on a
1647 * cpu, it will be pushed off when it comes in */
1648 unmask_vic_irq(irq);
1649}
1650
1651static void ack_vic_irq(unsigned int irq)
1652{
1653 if (irq & 8) {
1654 outb(0x62, 0x20); /* Specific EOI to cascade */
1655 outb(0x60 | (irq & 7), 0xA0);
1656 } else {
1657 outb(0x60 | (irq & 7), 0x20);
1658 }
1659}
1660
1661/* enable the CPIs. In the VIC, the CPIs are delivered by the 8259
1662 * but are not vectored by it. This means that the 8259 mask must be
1663 * lowered to receive them */
1664static __init void vic_enable_cpi(void)
1665{
1666 __u8 cpu = smp_processor_id();
1667
1668 /* just take a copy of the current mask (nop for boot cpu) */
1669 vic_irq_mask[cpu] = vic_irq_mask[boot_cpu_id];
1670
1671 enable_local_vic_irq(VIC_CPI_LEVEL0);
1672 enable_local_vic_irq(VIC_CPI_LEVEL1);
1673 /* for sys int and cmn int */
1674 enable_local_vic_irq(7);
1675
1676 if (is_cpu_quad()) {
1677 outb(QIC_DEFAULT_MASK0, QIC_MASK_REGISTER0);
1678 outb(QIC_CPI_ENABLE, QIC_MASK_REGISTER1);
1679 VDEBUG(("VOYAGER SMP: QIC ENABLE CPI: CPU%d: MASK 0x%x\n",
1680 cpu, QIC_CPI_ENABLE));
1681 }
1682
1683 VDEBUG(("VOYAGER SMP: ENABLE CPI: CPU%d: MASK 0x%x\n",
1684 cpu, vic_irq_mask[cpu]));
1685}
1686
1687void voyager_smp_dump()
1688{
1689 int old_cpu = smp_processor_id(), cpu;
1690
1691 /* dump the interrupt masks of each processor */
1692 for_each_online_cpu(cpu) {
1693 __u16 imr, isr, irr;
1694 unsigned long flags;
1695
1696 local_irq_save(flags);
1697 outb(VIC_CPU_MASQUERADE_ENABLE | cpu, VIC_PROCESSOR_ID);
1698 imr = (inb(0xa1) << 8) | inb(0x21);
1699 outb(0x0a, 0xa0);
1700 irr = inb(0xa0) << 8;
1701 outb(0x0a, 0x20);
1702 irr |= inb(0x20);
1703 outb(0x0b, 0xa0);
1704 isr = inb(0xa0) << 8;
1705 outb(0x0b, 0x20);
1706 isr |= inb(0x20);
1707 outb(old_cpu, VIC_PROCESSOR_ID);
1708 local_irq_restore(flags);
1709 printk("\tCPU%d: mask=0x%x, IMR=0x%x, IRR=0x%x, ISR=0x%x\n",
1710 cpu, vic_irq_mask[cpu], imr, irr, isr);
1711#if 0
1712 /* These lines are put in to try to unstick an un ack'd irq */
1713 if (isr != 0) {
1714 int irq;
1715 for (irq = 0; irq < 16; irq++) {
1716 if (isr & (1 << irq)) {
1717 printk("\tCPU%d: ack irq %d\n",
1718 cpu, irq);
1719 local_irq_save(flags);
1720 outb(VIC_CPU_MASQUERADE_ENABLE | cpu,
1721 VIC_PROCESSOR_ID);
1722 ack_vic_irq(irq);
1723 outb(old_cpu, VIC_PROCESSOR_ID);
1724 local_irq_restore(flags);
1725 }
1726 }
1727 }
1728#endif
1729 }
1730}
1731
1732void smp_voyager_power_off(void *dummy)
1733{
1734 if (smp_processor_id() == boot_cpu_id)
1735 voyager_power_off();
1736 else
1737 smp_stop_cpu_function(NULL);
1738}
1739
1740static void __init voyager_smp_prepare_cpus(unsigned int max_cpus)
1741{
1742 /* FIXME: ignore max_cpus for now */
1743 smp_boot_cpus();
1744}
1745
1746static void __cpuinit voyager_smp_prepare_boot_cpu(void)
1747{
1748 init_gdt(smp_processor_id());
1749 switch_to_new_gdt();
1750
1751 cpu_online_map = cpumask_of_cpu(smp_processor_id());
1752 cpu_callout_map = cpumask_of_cpu(smp_processor_id());
1753 cpu_callin_map = CPU_MASK_NONE;
1754 cpu_present_map = cpumask_of_cpu(smp_processor_id());
1755
1756}
1757
1758static int __cpuinit voyager_cpu_up(unsigned int cpu)
1759{
1760 /* This only works at boot for x86. See "rewrite" above. */
1761 if (cpu_isset(cpu, smp_commenced_mask))
1762 return -ENOSYS;
1763
1764 /* In case one didn't come up */
1765 if (!cpu_isset(cpu, cpu_callin_map))
1766 return -EIO;
1767 /* Unleash the CPU! */
1768 cpu_set(cpu, smp_commenced_mask);
1769 while (!cpu_online(cpu))
1770 mb();
1771 return 0;
1772}
1773
1774static void __init voyager_smp_cpus_done(unsigned int max_cpus)
1775{
1776 zap_low_mappings();
1777}
1778
1779void __init smp_setup_processor_id(void)
1780{
1781 current_thread_info()->cpu = hard_smp_processor_id();
1782 x86_write_percpu(cpu_number, hard_smp_processor_id());
1783}
1784
1785static void voyager_send_call_func(const struct cpumask *callmask)
1786{
1787 __u32 mask = cpus_addr(*callmask)[0] & ~(1 << smp_processor_id());
1788 send_CPI(mask, VIC_CALL_FUNCTION_CPI);
1789}
1790
1791static void voyager_send_call_func_single(int cpu)
1792{
1793 send_CPI(1 << cpu, VIC_CALL_FUNCTION_SINGLE_CPI);
1794}
1795
1796struct smp_ops smp_ops = {
1797 .smp_prepare_boot_cpu = voyager_smp_prepare_boot_cpu,
1798 .smp_prepare_cpus = voyager_smp_prepare_cpus,
1799 .cpu_up = voyager_cpu_up,
1800 .smp_cpus_done = voyager_smp_cpus_done,
1801
1802 .smp_send_stop = voyager_smp_send_stop,
1803 .smp_send_reschedule = voyager_smp_send_reschedule,
1804
1805 .send_call_func_ipi = voyager_send_call_func,
1806 .send_call_func_single_ipi = voyager_send_call_func_single,
1807};
diff --git a/arch/x86/mach-voyager/voyager_thread.c b/arch/x86/mach-voyager/voyager_thread.c
deleted file mode 100644
index 15464a20fb38..000000000000
--- a/arch/x86/mach-voyager/voyager_thread.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/* -*- mode: c; c-basic-offset: 8 -*- */
2
3/* Copyright (C) 2001
4 *
5 * Author: J.E.J.Bottomley@HansenPartnership.com
6 *
7 * This module provides the machine status monitor thread for the
8 * voyager architecture. This allows us to monitor the machine
9 * environment (temp, voltage, fan function) and the front panel and
10 * internal UPS. If a fault is detected, this thread takes corrective
11 * action (usually just informing init)
12 * */
13
14#include <linux/module.h>
15#include <linux/mm.h>
16#include <linux/kernel_stat.h>
17#include <linux/delay.h>
18#include <linux/mc146818rtc.h>
19#include <linux/init.h>
20#include <linux/bootmem.h>
21#include <linux/kmod.h>
22#include <linux/completion.h>
23#include <linux/sched.h>
24#include <linux/kthread.h>
25#include <asm/desc.h>
26#include <asm/voyager.h>
27#include <asm/vic.h>
28#include <asm/mtrr.h>
29#include <asm/msr.h>
30
31struct task_struct *voyager_thread;
32static __u8 set_timeout;
33
34static int execute(const char *string)
35{
36 int ret;
37
38 char *envp[] = {
39 "HOME=/",
40 "TERM=linux",
41 "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
42 NULL,
43 };
44 char *argv[] = {
45 "/bin/bash",
46 "-c",
47 (char *)string,
48 NULL,
49 };
50
51 if ((ret =
52 call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC)) != 0) {
53 printk(KERN_ERR "Voyager failed to run \"%s\": %i\n", string,
54 ret);
55 }
56 return ret;
57}
58
59static void check_from_kernel(void)
60{
61 if (voyager_status.switch_off) {
62
63 /* FIXME: This should be configurable via proc */
64 execute("umask 600; echo 0 > /etc/initrunlvl; kill -HUP 1");
65 } else if (voyager_status.power_fail) {
66 VDEBUG(("Voyager daemon detected AC power failure\n"));
67
68 /* FIXME: This should be configureable via proc */
69 execute("umask 600; echo F > /etc/powerstatus; kill -PWR 1");
70 set_timeout = 1;
71 }
72}
73
74static void check_continuing_condition(void)
75{
76 if (voyager_status.power_fail) {
77 __u8 data;
78 voyager_cat_psi(VOYAGER_PSI_SUBREAD,
79 VOYAGER_PSI_AC_FAIL_REG, &data);
80 if ((data & 0x1f) == 0) {
81 /* all power restored */
82 printk(KERN_NOTICE
83 "VOYAGER AC power restored, cancelling shutdown\n");
84 /* FIXME: should be user configureable */
85 execute
86 ("umask 600; echo O > /etc/powerstatus; kill -PWR 1");
87 set_timeout = 0;
88 }
89 }
90}
91
92static int thread(void *unused)
93{
94 printk(KERN_NOTICE "Voyager starting monitor thread\n");
95
96 for (;;) {
97 set_current_state(TASK_INTERRUPTIBLE);
98 schedule_timeout(set_timeout ? HZ : MAX_SCHEDULE_TIMEOUT);
99
100 VDEBUG(("Voyager Daemon awoken\n"));
101 if (voyager_status.request_from_kernel == 0) {
102 /* probably awoken from timeout */
103 check_continuing_condition();
104 } else {
105 check_from_kernel();
106 voyager_status.request_from_kernel = 0;
107 }
108 }
109}
110
111static int __init voyager_thread_start(void)
112{
113 voyager_thread = kthread_run(thread, NULL, "kvoyagerd");
114 if (IS_ERR(voyager_thread)) {
115 printk(KERN_ERR
116 "Voyager: Failed to create system monitor thread.\n");
117 return PTR_ERR(voyager_thread);
118 }
119 return 0;
120}
121
122static void __exit voyager_thread_stop(void)
123{
124 kthread_stop(voyager_thread);
125}
126
127module_init(voyager_thread_start);
128module_exit(voyager_thread_stop);
diff --git a/arch/x86/math-emu/get_address.c b/arch/x86/math-emu/get_address.c
index 420b3b6e3915..6ef5e99380f9 100644
--- a/arch/x86/math-emu/get_address.c
+++ b/arch/x86/math-emu/get_address.c
@@ -150,11 +150,9 @@ static long pm_address(u_char FPU_modrm, u_char segment,
150#endif /* PARANOID */ 150#endif /* PARANOID */
151 151
152 switch (segment) { 152 switch (segment) {
153 /* gs isn't used by the kernel, so it still has its
154 user-space value. */
155 case PREFIX_GS_ - 1: 153 case PREFIX_GS_ - 1:
156 /* N.B. - movl %seg, mem is a 2 byte write regardless of prefix */ 154 /* user gs handling can be lazy, use special accessors */
157 savesegment(gs, addr->selector); 155 addr->selector = get_user_gs(FPU_info->regs);
158 break; 156 break;
159 default: 157 default:
160 addr->selector = PM_REG_(segment); 158 addr->selector = PM_REG_(segment);
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index d8cc96a2738f..08537747cb58 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -1,6 +1,8 @@
1obj-y := init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ 1obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \
2 pat.o pgtable.o gup.o 2 pat.o pgtable.o gup.o
3 3
4obj-$(CONFIG_SMP) += tlb.o
5
4obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o 6obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o
5 7
6obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 8obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 7e8db53528a7..61b41ca3b5a2 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -23,6 +23,12 @@ int fixup_exception(struct pt_regs *regs)
23 23
24 fixup = search_exception_tables(regs->ip); 24 fixup = search_exception_tables(regs->ip);
25 if (fixup) { 25 if (fixup) {
26 /* If fixup is less than 16, it means uaccess error */
27 if (fixup->fixup < 16) {
28 current_thread_info()->uaccess_err = -EFAULT;
29 regs->ip += fixup->fixup;
30 return 1;
31 }
26 regs->ip = fixup->fixup; 32 regs->ip = fixup->fixup;
27 return 1; 33 return 1;
28 } 34 }
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index c76ef1d701c9..a03b7279efa0 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1,73 +1,79 @@
1/* 1/*
2 * Copyright (C) 1995 Linus Torvalds 2 * Copyright (C) 1995 Linus Torvalds
3 * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs. 3 * Copyright (C) 2001, 2002 Andi Kleen, SuSE Labs.
4 * Copyright (C) 2008-2009, Red Hat Inc., Ingo Molnar
4 */ 5 */
5
6#include <linux/signal.h>
7#include <linux/sched.h>
8#include <linux/kernel.h>
9#include <linux/errno.h>
10#include <linux/string.h>
11#include <linux/types.h>
12#include <linux/ptrace.h>
13#include <linux/mmiotrace.h>
14#include <linux/mman.h>
15#include <linux/mm.h>
16#include <linux/smp.h>
17#include <linux/interrupt.h> 6#include <linux/interrupt.h>
18#include <linux/init.h> 7#include <linux/mmiotrace.h>
19#include <linux/tty.h> 8#include <linux/bootmem.h>
20#include <linux/vt_kern.h> /* For unblank_screen() */
21#include <linux/compiler.h> 9#include <linux/compiler.h>
22#include <linux/highmem.h> 10#include <linux/highmem.h>
23#include <linux/bootmem.h> /* for max_low_pfn */
24#include <linux/vmalloc.h>
25#include <linux/module.h>
26#include <linux/kprobes.h> 11#include <linux/kprobes.h>
27#include <linux/uaccess.h> 12#include <linux/uaccess.h>
13#include <linux/vmalloc.h>
14#include <linux/vt_kern.h>
15#include <linux/signal.h>
16#include <linux/kernel.h>
17#include <linux/ptrace.h>
18#include <linux/string.h>
19#include <linux/module.h>
28#include <linux/kdebug.h> 20#include <linux/kdebug.h>
21#include <linux/errno.h>
22#include <linux/magic.h>
23#include <linux/sched.h>
24#include <linux/types.h>
25#include <linux/init.h>
26#include <linux/mman.h>
27#include <linux/tty.h>
28#include <linux/smp.h>
29#include <linux/mm.h>
30
31#include <asm-generic/sections.h>
29 32
30#include <asm/system.h>
31#include <asm/desc.h>
32#include <asm/segment.h>
33#include <asm/pgalloc.h>
34#include <asm/smp.h>
35#include <asm/tlbflush.h> 33#include <asm/tlbflush.h>
34#include <asm/pgalloc.h>
35#include <asm/segment.h>
36#include <asm/system.h>
36#include <asm/proto.h> 37#include <asm/proto.h>
37#include <asm-generic/sections.h>
38#include <asm/traps.h> 38#include <asm/traps.h>
39#include <asm/desc.h>
39 40
40/* 41/*
41 * Page fault error code bits 42 * Page fault error code bits:
42 * bit 0 == 0 means no page found, 1 means protection fault 43 *
43 * bit 1 == 0 means read, 1 means write 44 * bit 0 == 0: no page found 1: protection fault
44 * bit 2 == 0 means kernel, 1 means user-mode 45 * bit 1 == 0: read access 1: write access
45 * bit 3 == 1 means use of reserved bit detected 46 * bit 2 == 0: kernel-mode access 1: user-mode access
46 * bit 4 == 1 means fault was an instruction fetch 47 * bit 3 == 1: use of reserved bit detected
48 * bit 4 == 1: fault was an instruction fetch
47 */ 49 */
48#define PF_PROT (1<<0) 50enum x86_pf_error_code {
49#define PF_WRITE (1<<1) 51
50#define PF_USER (1<<2) 52 PF_PROT = 1 << 0,
51#define PF_RSVD (1<<3) 53 PF_WRITE = 1 << 1,
52#define PF_INSTR (1<<4) 54 PF_USER = 1 << 2,
55 PF_RSVD = 1 << 3,
56 PF_INSTR = 1 << 4,
57};
53 58
59/*
60 * Returns 0 if mmiotrace is disabled, or if the fault is not
61 * handled by mmiotrace:
62 */
54static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr) 63static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr)
55{ 64{
56#ifdef CONFIG_MMIOTRACE
57 if (unlikely(is_kmmio_active())) 65 if (unlikely(is_kmmio_active()))
58 if (kmmio_handler(regs, addr) == 1) 66 if (kmmio_handler(regs, addr) == 1)
59 return -1; 67 return -1;
60#endif
61 return 0; 68 return 0;
62} 69}
63 70
64static inline int notify_page_fault(struct pt_regs *regs) 71static inline int notify_page_fault(struct pt_regs *regs)
65{ 72{
66#ifdef CONFIG_KPROBES
67 int ret = 0; 73 int ret = 0;
68 74
69 /* kprobe_running() needs smp_processor_id() */ 75 /* kprobe_running() needs smp_processor_id() */
70 if (!user_mode_vm(regs)) { 76 if (kprobes_built_in() && !user_mode_vm(regs)) {
71 preempt_disable(); 77 preempt_disable();
72 if (kprobe_running() && kprobe_fault_handler(regs, 14)) 78 if (kprobe_running() && kprobe_fault_handler(regs, 14))
73 ret = 1; 79 ret = 1;
@@ -75,29 +81,76 @@ static inline int notify_page_fault(struct pt_regs *regs)
75 } 81 }
76 82
77 return ret; 83 return ret;
78#else
79 return 0;
80#endif
81} 84}
82 85
83/* 86/*
84 * X86_32 87 * Prefetch quirks:
85 * Sometimes AMD Athlon/Opteron CPUs report invalid exceptions on prefetch. 88 *
86 * Check that here and ignore it. 89 * 32-bit mode:
90 *
91 * Sometimes AMD Athlon/Opteron CPUs report invalid exceptions on prefetch.
92 * Check that here and ignore it.
93 *
94 * 64-bit mode:
87 * 95 *
88 * X86_64 96 * Sometimes the CPU reports invalid exceptions on prefetch.
89 * Sometimes the CPU reports invalid exceptions on prefetch. 97 * Check that here and ignore it.
90 * Check that here and ignore it.
91 * 98 *
92 * Opcode checker based on code by Richard Brunner 99 * Opcode checker based on code by Richard Brunner.
93 */ 100 */
94static int is_prefetch(struct pt_regs *regs, unsigned long addr, 101static inline int
95 unsigned long error_code) 102check_prefetch_opcode(struct pt_regs *regs, unsigned char *instr,
103 unsigned char opcode, int *prefetch)
96{ 104{
105 unsigned char instr_hi = opcode & 0xf0;
106 unsigned char instr_lo = opcode & 0x0f;
107
108 switch (instr_hi) {
109 case 0x20:
110 case 0x30:
111 /*
112 * Values 0x26,0x2E,0x36,0x3E are valid x86 prefixes.
113 * In X86_64 long mode, the CPU will signal invalid
114 * opcode if some of these prefixes are present so
115 * X86_64 will never get here anyway
116 */
117 return ((instr_lo & 7) == 0x6);
118#ifdef CONFIG_X86_64
119 case 0x40:
120 /*
121 * In AMD64 long mode 0x40..0x4F are valid REX prefixes
122 * Need to figure out under what instruction mode the
123 * instruction was issued. Could check the LDT for lm,
124 * but for now it's good enough to assume that long
125 * mode only uses well known segments or kernel.
126 */
127 return (!user_mode(regs)) || (regs->cs == __USER_CS);
128#endif
129 case 0x60:
130 /* 0x64 thru 0x67 are valid prefixes in all modes. */
131 return (instr_lo & 0xC) == 0x4;
132 case 0xF0:
133 /* 0xF0, 0xF2, 0xF3 are valid prefixes in all modes. */
134 return !instr_lo || (instr_lo>>1) == 1;
135 case 0x00:
136 /* Prefetch instruction is 0x0F0D or 0x0F18 */
137 if (probe_kernel_address(instr, opcode))
138 return 0;
139
140 *prefetch = (instr_lo == 0xF) &&
141 (opcode == 0x0D || opcode == 0x18);
142 return 0;
143 default:
144 return 0;
145 }
146}
147
148static int
149is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr)
150{
151 unsigned char *max_instr;
97 unsigned char *instr; 152 unsigned char *instr;
98 int scan_more = 1;
99 int prefetch = 0; 153 int prefetch = 0;
100 unsigned char *max_instr;
101 154
102 /* 155 /*
103 * If it was a exec (instruction fetch) fault on NX page, then 156 * If it was a exec (instruction fetch) fault on NX page, then
@@ -106,106 +159,170 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
106 if (error_code & PF_INSTR) 159 if (error_code & PF_INSTR)
107 return 0; 160 return 0;
108 161
109 instr = (unsigned char *)convert_ip_to_linear(current, regs); 162 instr = (void *)convert_ip_to_linear(current, regs);
110 max_instr = instr + 15; 163 max_instr = instr + 15;
111 164
112 if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE) 165 if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE)
113 return 0; 166 return 0;
114 167
115 while (scan_more && instr < max_instr) { 168 while (instr < max_instr) {
116 unsigned char opcode; 169 unsigned char opcode;
117 unsigned char instr_hi;
118 unsigned char instr_lo;
119 170
120 if (probe_kernel_address(instr, opcode)) 171 if (probe_kernel_address(instr, opcode))
121 break; 172 break;
122 173
123 instr_hi = opcode & 0xf0;
124 instr_lo = opcode & 0x0f;
125 instr++; 174 instr++;
126 175
127 switch (instr_hi) { 176 if (!check_prefetch_opcode(regs, instr, opcode, &prefetch))
128 case 0x20:
129 case 0x30:
130 /*
131 * Values 0x26,0x2E,0x36,0x3E are valid x86 prefixes.
132 * In X86_64 long mode, the CPU will signal invalid
133 * opcode if some of these prefixes are present so
134 * X86_64 will never get here anyway
135 */
136 scan_more = ((instr_lo & 7) == 0x6);
137 break; 177 break;
138#ifdef CONFIG_X86_64
139 case 0x40:
140 /*
141 * In AMD64 long mode 0x40..0x4F are valid REX prefixes
142 * Need to figure out under what instruction mode the
143 * instruction was issued. Could check the LDT for lm,
144 * but for now it's good enough to assume that long
145 * mode only uses well known segments or kernel.
146 */
147 scan_more = (!user_mode(regs)) || (regs->cs == __USER_CS);
148 break;
149#endif
150 case 0x60:
151 /* 0x64 thru 0x67 are valid prefixes in all modes. */
152 scan_more = (instr_lo & 0xC) == 0x4;
153 break;
154 case 0xF0:
155 /* 0xF0, 0xF2, 0xF3 are valid prefixes in all modes. */
156 scan_more = !instr_lo || (instr_lo>>1) == 1;
157 break;
158 case 0x00:
159 /* Prefetch instruction is 0x0F0D or 0x0F18 */
160 scan_more = 0;
161
162 if (probe_kernel_address(instr, opcode))
163 break;
164 prefetch = (instr_lo == 0xF) &&
165 (opcode == 0x0D || opcode == 0x18);
166 break;
167 default:
168 scan_more = 0;
169 break;
170 }
171 } 178 }
172 return prefetch; 179 return prefetch;
173} 180}
174 181
175static void force_sig_info_fault(int si_signo, int si_code, 182static void
176 unsigned long address, struct task_struct *tsk) 183force_sig_info_fault(int si_signo, int si_code, unsigned long address,
184 struct task_struct *tsk)
177{ 185{
178 siginfo_t info; 186 siginfo_t info;
179 187
180 info.si_signo = si_signo; 188 info.si_signo = si_signo;
181 info.si_errno = 0; 189 info.si_errno = 0;
182 info.si_code = si_code; 190 info.si_code = si_code;
183 info.si_addr = (void __user *)address; 191 info.si_addr = (void __user *)address;
192
184 force_sig_info(si_signo, &info, tsk); 193 force_sig_info(si_signo, &info, tsk);
185} 194}
186 195
187#ifdef CONFIG_X86_64 196DEFINE_SPINLOCK(pgd_lock);
188static int bad_address(void *p) 197LIST_HEAD(pgd_list);
198
199#ifdef CONFIG_X86_32
200static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
189{ 201{
190 unsigned long dummy; 202 unsigned index = pgd_index(address);
191 return probe_kernel_address((unsigned long *)p, dummy); 203 pgd_t *pgd_k;
204 pud_t *pud, *pud_k;
205 pmd_t *pmd, *pmd_k;
206
207 pgd += index;
208 pgd_k = init_mm.pgd + index;
209
210 if (!pgd_present(*pgd_k))
211 return NULL;
212
213 /*
214 * set_pgd(pgd, *pgd_k); here would be useless on PAE
215 * and redundant with the set_pmd() on non-PAE. As would
216 * set_pud.
217 */
218 pud = pud_offset(pgd, address);
219 pud_k = pud_offset(pgd_k, address);
220 if (!pud_present(*pud_k))
221 return NULL;
222
223 pmd = pmd_offset(pud, address);
224 pmd_k = pmd_offset(pud_k, address);
225 if (!pmd_present(*pmd_k))
226 return NULL;
227
228 if (!pmd_present(*pmd)) {
229 set_pmd(pmd, *pmd_k);
230 arch_flush_lazy_mmu_mode();
231 } else {
232 BUG_ON(pmd_page(*pmd) != pmd_page(*pmd_k));
233 }
234
235 return pmd_k;
236}
237
238void vmalloc_sync_all(void)
239{
240 unsigned long address;
241
242 if (SHARED_KERNEL_PMD)
243 return;
244
245 for (address = VMALLOC_START & PMD_MASK;
246 address >= TASK_SIZE && address < FIXADDR_TOP;
247 address += PMD_SIZE) {
248
249 unsigned long flags;
250 struct page *page;
251
252 spin_lock_irqsave(&pgd_lock, flags);
253 list_for_each_entry(page, &pgd_list, lru) {
254 if (!vmalloc_sync_one(page_address(page), address))
255 break;
256 }
257 spin_unlock_irqrestore(&pgd_lock, flags);
258 }
259}
260
261/*
262 * 32-bit:
263 *
264 * Handle a fault on the vmalloc or module mapping area
265 */
266static noinline int vmalloc_fault(unsigned long address)
267{
268 unsigned long pgd_paddr;
269 pmd_t *pmd_k;
270 pte_t *pte_k;
271
272 /* Make sure we are in vmalloc area: */
273 if (!(address >= VMALLOC_START && address < VMALLOC_END))
274 return -1;
275
276 /*
277 * Synchronize this task's top level page-table
278 * with the 'reference' page table.
279 *
280 * Do _not_ use "current" here. We might be inside
281 * an interrupt in the middle of a task switch..
282 */
283 pgd_paddr = read_cr3();
284 pmd_k = vmalloc_sync_one(__va(pgd_paddr), address);
285 if (!pmd_k)
286 return -1;
287
288 pte_k = pte_offset_kernel(pmd_k, address);
289 if (!pte_present(*pte_k))
290 return -1;
291
292 return 0;
293}
294
295/*
296 * Did it hit the DOS screen memory VA from vm86 mode?
297 */
298static inline void
299check_v8086_mode(struct pt_regs *regs, unsigned long address,
300 struct task_struct *tsk)
301{
302 unsigned long bit;
303
304 if (!v8086_mode(regs))
305 return;
306
307 bit = (address - 0xA0000) >> PAGE_SHIFT;
308 if (bit < 32)
309 tsk->thread.screen_bitmap |= 1 << bit;
192} 310}
193#endif
194 311
195static void dump_pagetable(unsigned long address) 312static void dump_pagetable(unsigned long address)
196{ 313{
197#ifdef CONFIG_X86_32
198 __typeof__(pte_val(__pte(0))) page; 314 __typeof__(pte_val(__pte(0))) page;
199 315
200 page = read_cr3(); 316 page = read_cr3();
201 page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT]; 317 page = ((__typeof__(page) *) __va(page))[address >> PGDIR_SHIFT];
318
202#ifdef CONFIG_X86_PAE 319#ifdef CONFIG_X86_PAE
203 printk("*pdpt = %016Lx ", page); 320 printk("*pdpt = %016Lx ", page);
204 if ((page >> PAGE_SHIFT) < max_low_pfn 321 if ((page >> PAGE_SHIFT) < max_low_pfn
205 && page & _PAGE_PRESENT) { 322 && page & _PAGE_PRESENT) {
206 page &= PAGE_MASK; 323 page &= PAGE_MASK;
207 page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) 324 page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT)
208 & (PTRS_PER_PMD - 1)]; 325 & (PTRS_PER_PMD - 1)];
209 printk(KERN_CONT "*pde = %016Lx ", page); 326 printk(KERN_CONT "*pde = %016Lx ", page);
210 page &= ~_PAGE_NX; 327 page &= ~_PAGE_NX;
211 } 328 }
@@ -217,19 +334,145 @@ static void dump_pagetable(unsigned long address)
217 * We must not directly access the pte in the highpte 334 * We must not directly access the pte in the highpte
218 * case if the page table is located in highmem. 335 * case if the page table is located in highmem.
219 * And let's rather not kmap-atomic the pte, just in case 336 * And let's rather not kmap-atomic the pte, just in case
220 * it's allocated already. 337 * it's allocated already:
221 */ 338 */
222 if ((page >> PAGE_SHIFT) < max_low_pfn 339 if ((page >> PAGE_SHIFT) < max_low_pfn
223 && (page & _PAGE_PRESENT) 340 && (page & _PAGE_PRESENT)
224 && !(page & _PAGE_PSE)) { 341 && !(page & _PAGE_PSE)) {
342
225 page &= PAGE_MASK; 343 page &= PAGE_MASK;
226 page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT) 344 page = ((__typeof__(page) *) __va(page))[(address >> PAGE_SHIFT)
227 & (PTRS_PER_PTE - 1)]; 345 & (PTRS_PER_PTE - 1)];
228 printk("*pte = %0*Lx ", sizeof(page)*2, (u64)page); 346 printk("*pte = %0*Lx ", sizeof(page)*2, (u64)page);
229 } 347 }
230 348
231 printk("\n"); 349 printk("\n");
232#else /* CONFIG_X86_64 */ 350}
351
352#else /* CONFIG_X86_64: */
353
354void vmalloc_sync_all(void)
355{
356 unsigned long address;
357
358 for (address = VMALLOC_START & PGDIR_MASK; address <= VMALLOC_END;
359 address += PGDIR_SIZE) {
360
361 const pgd_t *pgd_ref = pgd_offset_k(address);
362 unsigned long flags;
363 struct page *page;
364
365 if (pgd_none(*pgd_ref))
366 continue;
367
368 spin_lock_irqsave(&pgd_lock, flags);
369 list_for_each_entry(page, &pgd_list, lru) {
370 pgd_t *pgd;
371 pgd = (pgd_t *)page_address(page) + pgd_index(address);
372 if (pgd_none(*pgd))
373 set_pgd(pgd, *pgd_ref);
374 else
375 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
376 }
377 spin_unlock_irqrestore(&pgd_lock, flags);
378 }
379}
380
381/*
382 * 64-bit:
383 *
384 * Handle a fault on the vmalloc area
385 *
386 * This assumes no large pages in there.
387 */
388static noinline int vmalloc_fault(unsigned long address)
389{
390 pgd_t *pgd, *pgd_ref;
391 pud_t *pud, *pud_ref;
392 pmd_t *pmd, *pmd_ref;
393 pte_t *pte, *pte_ref;
394
395 /* Make sure we are in vmalloc area: */
396 if (!(address >= VMALLOC_START && address < VMALLOC_END))
397 return -1;
398
399 /*
400 * Copy kernel mappings over when needed. This can also
401 * happen within a race in page table update. In the later
402 * case just flush:
403 */
404 pgd = pgd_offset(current->active_mm, address);
405 pgd_ref = pgd_offset_k(address);
406 if (pgd_none(*pgd_ref))
407 return -1;
408
409 if (pgd_none(*pgd))
410 set_pgd(pgd, *pgd_ref);
411 else
412 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
413
414 /*
415 * Below here mismatches are bugs because these lower tables
416 * are shared:
417 */
418
419 pud = pud_offset(pgd, address);
420 pud_ref = pud_offset(pgd_ref, address);
421 if (pud_none(*pud_ref))
422 return -1;
423
424 if (pud_none(*pud) || pud_page_vaddr(*pud) != pud_page_vaddr(*pud_ref))
425 BUG();
426
427 pmd = pmd_offset(pud, address);
428 pmd_ref = pmd_offset(pud_ref, address);
429 if (pmd_none(*pmd_ref))
430 return -1;
431
432 if (pmd_none(*pmd) || pmd_page(*pmd) != pmd_page(*pmd_ref))
433 BUG();
434
435 pte_ref = pte_offset_kernel(pmd_ref, address);
436 if (!pte_present(*pte_ref))
437 return -1;
438
439 pte = pte_offset_kernel(pmd, address);
440
441 /*
442 * Don't use pte_page here, because the mappings can point
443 * outside mem_map, and the NUMA hash lookup cannot handle
444 * that:
445 */
446 if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref))
447 BUG();
448
449 return 0;
450}
451
452static const char errata93_warning[] =
453KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"
454KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n"
455KERN_ERR "******* Please consider a BIOS update.\n"
456KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n";
457
458/*
459 * No vm86 mode in 64-bit mode:
460 */
461static inline void
462check_v8086_mode(struct pt_regs *regs, unsigned long address,
463 struct task_struct *tsk)
464{
465}
466
467static int bad_address(void *p)
468{
469 unsigned long dummy;
470
471 return probe_kernel_address((unsigned long *)p, dummy);
472}
473
474static void dump_pagetable(unsigned long address)
475{
233 pgd_t *pgd; 476 pgd_t *pgd;
234 pud_t *pud; 477 pud_t *pud;
235 pmd_t *pmd; 478 pmd_t *pmd;
@@ -238,102 +481,77 @@ static void dump_pagetable(unsigned long address)
238 pgd = (pgd_t *)read_cr3(); 481 pgd = (pgd_t *)read_cr3();
239 482
240 pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK); 483 pgd = __va((unsigned long)pgd & PHYSICAL_PAGE_MASK);
484
241 pgd += pgd_index(address); 485 pgd += pgd_index(address);
242 if (bad_address(pgd)) goto bad; 486 if (bad_address(pgd))
487 goto bad;
488
243 printk("PGD %lx ", pgd_val(*pgd)); 489 printk("PGD %lx ", pgd_val(*pgd));
244 if (!pgd_present(*pgd)) goto ret; 490
491 if (!pgd_present(*pgd))
492 goto out;
245 493
246 pud = pud_offset(pgd, address); 494 pud = pud_offset(pgd, address);
247 if (bad_address(pud)) goto bad; 495 if (bad_address(pud))
496 goto bad;
497
248 printk("PUD %lx ", pud_val(*pud)); 498 printk("PUD %lx ", pud_val(*pud));
249 if (!pud_present(*pud) || pud_large(*pud)) 499 if (!pud_present(*pud) || pud_large(*pud))
250 goto ret; 500 goto out;
251 501
252 pmd = pmd_offset(pud, address); 502 pmd = pmd_offset(pud, address);
253 if (bad_address(pmd)) goto bad; 503 if (bad_address(pmd))
504 goto bad;
505
254 printk("PMD %lx ", pmd_val(*pmd)); 506 printk("PMD %lx ", pmd_val(*pmd));
255 if (!pmd_present(*pmd) || pmd_large(*pmd)) goto ret; 507 if (!pmd_present(*pmd) || pmd_large(*pmd))
508 goto out;
256 509
257 pte = pte_offset_kernel(pmd, address); 510 pte = pte_offset_kernel(pmd, address);
258 if (bad_address(pte)) goto bad; 511 if (bad_address(pte))
512 goto bad;
513
259 printk("PTE %lx", pte_val(*pte)); 514 printk("PTE %lx", pte_val(*pte));
260ret: 515out:
261 printk("\n"); 516 printk("\n");
262 return; 517 return;
263bad: 518bad:
264 printk("BAD\n"); 519 printk("BAD\n");
265#endif
266}
267
268#ifdef CONFIG_X86_32
269static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address)
270{
271 unsigned index = pgd_index(address);
272 pgd_t *pgd_k;
273 pud_t *pud, *pud_k;
274 pmd_t *pmd, *pmd_k;
275
276 pgd += index;
277 pgd_k = init_mm.pgd + index;
278
279 if (!pgd_present(*pgd_k))
280 return NULL;
281
282 /*
283 * set_pgd(pgd, *pgd_k); here would be useless on PAE
284 * and redundant with the set_pmd() on non-PAE. As would
285 * set_pud.
286 */
287
288 pud = pud_offset(pgd, address);
289 pud_k = pud_offset(pgd_k, address);
290 if (!pud_present(*pud_k))
291 return NULL;
292
293 pmd = pmd_offset(pud, address);
294 pmd_k = pmd_offset(pud_k, address);
295 if (!pmd_present(*pmd_k))
296 return NULL;
297 if (!pmd_present(*pmd)) {
298 set_pmd(pmd, *pmd_k);
299 arch_flush_lazy_mmu_mode();
300 } else
301 BUG_ON(pmd_page(*pmd) != pmd_page(*pmd_k));
302 return pmd_k;
303} 520}
304#endif
305 521
306#ifdef CONFIG_X86_64 522#endif /* CONFIG_X86_64 */
307static const char errata93_warning[] =
308KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"
309KERN_ERR "******* Working around it, but it may cause SEGVs or burn power.\n"
310KERN_ERR "******* Please consider a BIOS update.\n"
311KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n";
312#endif
313 523
314/* Workaround for K8 erratum #93 & buggy BIOS. 524/*
315 BIOS SMM functions are required to use a specific workaround 525 * Workaround for K8 erratum #93 & buggy BIOS.
316 to avoid corruption of the 64bit RIP register on C stepping K8. 526 *
317 A lot of BIOS that didn't get tested properly miss this. 527 * BIOS SMM functions are required to use a specific workaround
318 The OS sees this as a page fault with the upper 32bits of RIP cleared. 528 * to avoid corruption of the 64bit RIP register on C stepping K8.
319 Try to work around it here. 529 *
320 Note we only handle faults in kernel here. 530 * A lot of BIOS that didn't get tested properly miss this.
321 Does nothing for X86_32 531 *
532 * The OS sees this as a page fault with the upper 32bits of RIP cleared.
533 * Try to work around it here.
534 *
535 * Note we only handle faults in kernel here.
536 * Does nothing on 32-bit.
322 */ 537 */
323static int is_errata93(struct pt_regs *regs, unsigned long address) 538static int is_errata93(struct pt_regs *regs, unsigned long address)
324{ 539{
325#ifdef CONFIG_X86_64 540#ifdef CONFIG_X86_64
326 static int warned; 541 static int once;
542
327 if (address != regs->ip) 543 if (address != regs->ip)
328 return 0; 544 return 0;
545
329 if ((address >> 32) != 0) 546 if ((address >> 32) != 0)
330 return 0; 547 return 0;
548
331 address |= 0xffffffffUL << 32; 549 address |= 0xffffffffUL << 32;
332 if ((address >= (u64)_stext && address <= (u64)_etext) || 550 if ((address >= (u64)_stext && address <= (u64)_etext) ||
333 (address >= MODULES_VADDR && address <= MODULES_END)) { 551 (address >= MODULES_VADDR && address <= MODULES_END)) {
334 if (!warned) { 552 if (!once) {
335 printk(errata93_warning); 553 printk(errata93_warning);
336 warned = 1; 554 once = 1;
337 } 555 }
338 regs->ip = address; 556 regs->ip = address;
339 return 1; 557 return 1;
@@ -343,16 +561,17 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
343} 561}
344 562
345/* 563/*
346 * Work around K8 erratum #100 K8 in compat mode occasionally jumps to illegal 564 * Work around K8 erratum #100 K8 in compat mode occasionally jumps
347 * addresses >4GB. We catch this in the page fault handler because these 565 * to illegal addresses >4GB.
348 * addresses are not reachable. Just detect this case and return. Any code 566 *
567 * We catch this in the page fault handler because these addresses
568 * are not reachable. Just detect this case and return. Any code
349 * segment in LDT is compatibility mode. 569 * segment in LDT is compatibility mode.
350 */ 570 */
351static int is_errata100(struct pt_regs *regs, unsigned long address) 571static int is_errata100(struct pt_regs *regs, unsigned long address)
352{ 572{
353#ifdef CONFIG_X86_64 573#ifdef CONFIG_X86_64
354 if ((regs->cs == __USER32_CS || (regs->cs & (1<<2))) && 574 if ((regs->cs == __USER32_CS || (regs->cs & (1<<2))) && (address >> 32))
355 (address >> 32))
356 return 1; 575 return 1;
357#endif 576#endif
358 return 0; 577 return 0;
@@ -362,8 +581,9 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
362{ 581{
363#ifdef CONFIG_X86_F00F_BUG 582#ifdef CONFIG_X86_F00F_BUG
364 unsigned long nr; 583 unsigned long nr;
584
365 /* 585 /*
366 * Pentium F0 0F C7 C8 bug workaround. 586 * Pentium F0 0F C7 C8 bug workaround:
367 */ 587 */
368 if (boot_cpu_data.f00f_bug) { 588 if (boot_cpu_data.f00f_bug) {
369 nr = (address - idt_descr.address) >> 3; 589 nr = (address - idt_descr.address) >> 3;
@@ -377,62 +597,277 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address)
377 return 0; 597 return 0;
378} 598}
379 599
380static void show_fault_oops(struct pt_regs *regs, unsigned long error_code, 600static const char nx_warning[] = KERN_CRIT
381 unsigned long address) 601"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n";
602
603static void
604show_fault_oops(struct pt_regs *regs, unsigned long error_code,
605 unsigned long address)
382{ 606{
383#ifdef CONFIG_X86_32
384 if (!oops_may_print()) 607 if (!oops_may_print())
385 return; 608 return;
386#endif
387 609
388#ifdef CONFIG_X86_PAE
389 if (error_code & PF_INSTR) { 610 if (error_code & PF_INSTR) {
390 unsigned int level; 611 unsigned int level;
612
391 pte_t *pte = lookup_address(address, &level); 613 pte_t *pte = lookup_address(address, &level);
392 614
393 if (pte && pte_present(*pte) && !pte_exec(*pte)) 615 if (pte && pte_present(*pte) && !pte_exec(*pte))
394 printk(KERN_CRIT "kernel tried to execute " 616 printk(nx_warning, current_uid());
395 "NX-protected page - exploit attempt? "
396 "(uid: %d)\n", current_uid());
397 } 617 }
398#endif
399 618
400 printk(KERN_ALERT "BUG: unable to handle kernel "); 619 printk(KERN_ALERT "BUG: unable to handle kernel ");
401 if (address < PAGE_SIZE) 620 if (address < PAGE_SIZE)
402 printk(KERN_CONT "NULL pointer dereference"); 621 printk(KERN_CONT "NULL pointer dereference");
403 else 622 else
404 printk(KERN_CONT "paging request"); 623 printk(KERN_CONT "paging request");
624
405 printk(KERN_CONT " at %p\n", (void *) address); 625 printk(KERN_CONT " at %p\n", (void *) address);
406 printk(KERN_ALERT "IP:"); 626 printk(KERN_ALERT "IP:");
407 printk_address(regs->ip, 1); 627 printk_address(regs->ip, 1);
628
408 dump_pagetable(address); 629 dump_pagetable(address);
409} 630}
410 631
411#ifdef CONFIG_X86_64 632static noinline void
412static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs, 633pgtable_bad(struct pt_regs *regs, unsigned long error_code,
413 unsigned long error_code) 634 unsigned long address)
414{ 635{
415 unsigned long flags = oops_begin();
416 int sig = SIGKILL;
417 struct task_struct *tsk; 636 struct task_struct *tsk;
637 unsigned long flags;
638 int sig;
639
640 flags = oops_begin();
641 tsk = current;
642 sig = SIGKILL;
418 643
419 printk(KERN_ALERT "%s: Corrupted page table at address %lx\n", 644 printk(KERN_ALERT "%s: Corrupted page table at address %lx\n",
420 current->comm, address); 645 tsk->comm, address);
421 dump_pagetable(address); 646 dump_pagetable(address);
422 tsk = current; 647
423 tsk->thread.cr2 = address; 648 tsk->thread.cr2 = address;
424 tsk->thread.trap_no = 14; 649 tsk->thread.trap_no = 14;
425 tsk->thread.error_code = error_code; 650 tsk->thread.error_code = error_code;
651
426 if (__die("Bad pagetable", regs, error_code)) 652 if (__die("Bad pagetable", regs, error_code))
427 sig = 0; 653 sig = 0;
654
428 oops_end(flags, regs, sig); 655 oops_end(flags, regs, sig);
429} 656}
430#endif 657
658static noinline void
659no_context(struct pt_regs *regs, unsigned long error_code,
660 unsigned long address)
661{
662 struct task_struct *tsk = current;
663 unsigned long *stackend;
664 unsigned long flags;
665 int sig;
666
667 /* Are we prepared to handle this kernel fault? */
668 if (fixup_exception(regs))
669 return;
670
671 /*
672 * 32-bit:
673 *
674 * Valid to do another page fault here, because if this fault
675 * had been triggered by is_prefetch fixup_exception would have
676 * handled it.
677 *
678 * 64-bit:
679 *
680 * Hall of shame of CPU/BIOS bugs.
681 */
682 if (is_prefetch(regs, error_code, address))
683 return;
684
685 if (is_errata93(regs, address))
686 return;
687
688 /*
689 * Oops. The kernel tried to access some bad page. We'll have to
690 * terminate things with extreme prejudice:
691 */
692 flags = oops_begin();
693
694 show_fault_oops(regs, error_code, address);
695
696 stackend = end_of_stack(tsk);
697 if (*stackend != STACK_END_MAGIC)
698 printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
699
700 tsk->thread.cr2 = address;
701 tsk->thread.trap_no = 14;
702 tsk->thread.error_code = error_code;
703
704 sig = SIGKILL;
705 if (__die("Oops", regs, error_code))
706 sig = 0;
707
708 /* Executive summary in case the body of the oops scrolled away */
709 printk(KERN_EMERG "CR2: %016lx\n", address);
710
711 oops_end(flags, regs, sig);
712}
713
714/*
715 * Print out info about fatal segfaults, if the show_unhandled_signals
716 * sysctl is set:
717 */
718static inline void
719show_signal_msg(struct pt_regs *regs, unsigned long error_code,
720 unsigned long address, struct task_struct *tsk)
721{
722 if (!unhandled_signal(tsk, SIGSEGV))
723 return;
724
725 if (!printk_ratelimit())
726 return;
727
728 printk(KERN_CONT "%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
729 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
730 tsk->comm, task_pid_nr(tsk), address,
731 (void *)regs->ip, (void *)regs->sp, error_code);
732
733 print_vma_addr(KERN_CONT " in ", regs->ip);
734
735 printk(KERN_CONT "\n");
736}
737
738static void
739__bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
740 unsigned long address, int si_code)
741{
742 struct task_struct *tsk = current;
743
744 /* User mode accesses just cause a SIGSEGV */
745 if (error_code & PF_USER) {
746 /*
747 * It's possible to have interrupts off here:
748 */
749 local_irq_enable();
750
751 /*
752 * Valid to do another page fault here because this one came
753 * from user space:
754 */
755 if (is_prefetch(regs, error_code, address))
756 return;
757
758 if (is_errata100(regs, address))
759 return;
760
761 if (unlikely(show_unhandled_signals))
762 show_signal_msg(regs, error_code, address, tsk);
763
764 /* Kernel addresses are always protection faults: */
765 tsk->thread.cr2 = address;
766 tsk->thread.error_code = error_code | (address >= TASK_SIZE);
767 tsk->thread.trap_no = 14;
768
769 force_sig_info_fault(SIGSEGV, si_code, address, tsk);
770
771 return;
772 }
773
774 if (is_f00f_bug(regs, address))
775 return;
776
777 no_context(regs, error_code, address);
778}
779
780static noinline void
781bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
782 unsigned long address)
783{
784 __bad_area_nosemaphore(regs, error_code, address, SEGV_MAPERR);
785}
786
787static void
788__bad_area(struct pt_regs *regs, unsigned long error_code,
789 unsigned long address, int si_code)
790{
791 struct mm_struct *mm = current->mm;
792
793 /*
794 * Something tried to access memory that isn't in our memory map..
795 * Fix it, but check if it's kernel or user first..
796 */
797 up_read(&mm->mmap_sem);
798
799 __bad_area_nosemaphore(regs, error_code, address, si_code);
800}
801
802static noinline void
803bad_area(struct pt_regs *regs, unsigned long error_code, unsigned long address)
804{
805 __bad_area(regs, error_code, address, SEGV_MAPERR);
806}
807
808static noinline void
809bad_area_access_error(struct pt_regs *regs, unsigned long error_code,
810 unsigned long address)
811{
812 __bad_area(regs, error_code, address, SEGV_ACCERR);
813}
814
815/* TODO: fixup for "mm-invoke-oom-killer-from-page-fault.patch" */
816static void
817out_of_memory(struct pt_regs *regs, unsigned long error_code,
818 unsigned long address)
819{
820 /*
821 * We ran out of memory, call the OOM killer, and return the userspace
822 * (which will retry the fault, or kill us if we got oom-killed):
823 */
824 up_read(&current->mm->mmap_sem);
825
826 pagefault_out_of_memory();
827}
828
829static void
830do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address)
831{
832 struct task_struct *tsk = current;
833 struct mm_struct *mm = tsk->mm;
834
835 up_read(&mm->mmap_sem);
836
837 /* Kernel mode? Handle exceptions or die: */
838 if (!(error_code & PF_USER))
839 no_context(regs, error_code, address);
840
841 /* User-space => ok to do another page fault: */
842 if (is_prefetch(regs, error_code, address))
843 return;
844
845 tsk->thread.cr2 = address;
846 tsk->thread.error_code = error_code;
847 tsk->thread.trap_no = 14;
848
849 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
850}
851
852static noinline void
853mm_fault_error(struct pt_regs *regs, unsigned long error_code,
854 unsigned long address, unsigned int fault)
855{
856 if (fault & VM_FAULT_OOM) {
857 out_of_memory(regs, error_code, address);
858 } else {
859 if (fault & VM_FAULT_SIGBUS)
860 do_sigbus(regs, error_code, address);
861 else
862 BUG();
863 }
864}
431 865
432static int spurious_fault_check(unsigned long error_code, pte_t *pte) 866static int spurious_fault_check(unsigned long error_code, pte_t *pte)
433{ 867{
434 if ((error_code & PF_WRITE) && !pte_write(*pte)) 868 if ((error_code & PF_WRITE) && !pte_write(*pte))
435 return 0; 869 return 0;
870
436 if ((error_code & PF_INSTR) && !pte_exec(*pte)) 871 if ((error_code & PF_INSTR) && !pte_exec(*pte))
437 return 0; 872 return 0;
438 873
@@ -440,21 +875,25 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
440} 875}
441 876
442/* 877/*
443 * Handle a spurious fault caused by a stale TLB entry. This allows 878 * Handle a spurious fault caused by a stale TLB entry.
444 * us to lazily refresh the TLB when increasing the permissions of a 879 *
445 * kernel page (RO -> RW or NX -> X). Doing it eagerly is very 880 * This allows us to lazily refresh the TLB when increasing the
446 * expensive since that implies doing a full cross-processor TLB 881 * permissions of a kernel page (RO -> RW or NX -> X). Doing it
447 * flush, even if no stale TLB entries exist on other processors. 882 * eagerly is very expensive since that implies doing a full
883 * cross-processor TLB flush, even if no stale TLB entries exist
884 * on other processors.
885 *
448 * There are no security implications to leaving a stale TLB when 886 * There are no security implications to leaving a stale TLB when
449 * increasing the permissions on a page. 887 * increasing the permissions on a page.
450 */ 888 */
451static int spurious_fault(unsigned long address, 889static noinline int
452 unsigned long error_code) 890spurious_fault(unsigned long error_code, unsigned long address)
453{ 891{
454 pgd_t *pgd; 892 pgd_t *pgd;
455 pud_t *pud; 893 pud_t *pud;
456 pmd_t *pmd; 894 pmd_t *pmd;
457 pte_t *pte; 895 pte_t *pte;
896 int ret;
458 897
459 /* Reserved-bit violation or user access to kernel space? */ 898 /* Reserved-bit violation or user access to kernel space? */
460 if (error_code & (PF_USER | PF_RSVD)) 899 if (error_code & (PF_USER | PF_RSVD))
@@ -482,127 +921,71 @@ static int spurious_fault(unsigned long address,
482 if (!pte_present(*pte)) 921 if (!pte_present(*pte))
483 return 0; 922 return 0;
484 923
485 return spurious_fault_check(error_code, pte); 924 ret = spurious_fault_check(error_code, pte);
486} 925 if (!ret)
487 926 return 0;
488/*
489 * X86_32
490 * Handle a fault on the vmalloc or module mapping area
491 *
492 * X86_64
493 * Handle a fault on the vmalloc area
494 *
495 * This assumes no large pages in there.
496 */
497static int vmalloc_fault(unsigned long address)
498{
499#ifdef CONFIG_X86_32
500 unsigned long pgd_paddr;
501 pmd_t *pmd_k;
502 pte_t *pte_k;
503
504 /* Make sure we are in vmalloc area */
505 if (!(address >= VMALLOC_START && address < VMALLOC_END))
506 return -1;
507 927
508 /* 928 /*
509 * Synchronize this task's top level page-table 929 * Make sure we have permissions in PMD.
510 * with the 'reference' page table. 930 * If not, then there's a bug in the page tables:
511 *
512 * Do _not_ use "current" here. We might be inside
513 * an interrupt in the middle of a task switch..
514 */ 931 */
515 pgd_paddr = read_cr3(); 932 ret = spurious_fault_check(error_code, (pte_t *) pmd);
516 pmd_k = vmalloc_sync_one(__va(pgd_paddr), address); 933 WARN_ONCE(!ret, "PMD has incorrect permission bits\n");
517 if (!pmd_k)
518 return -1;
519 pte_k = pte_offset_kernel(pmd_k, address);
520 if (!pte_present(*pte_k))
521 return -1;
522 return 0;
523#else
524 pgd_t *pgd, *pgd_ref;
525 pud_t *pud, *pud_ref;
526 pmd_t *pmd, *pmd_ref;
527 pte_t *pte, *pte_ref;
528 934
529 /* Make sure we are in vmalloc area */ 935 return ret;
530 if (!(address >= VMALLOC_START && address < VMALLOC_END)) 936}
531 return -1;
532 937
533 /* Copy kernel mappings over when needed. This can also 938int show_unhandled_signals = 1;
534 happen within a race in page table update. In the later
535 case just flush. */
536 939
537 pgd = pgd_offset(current->active_mm, address); 940static inline int
538 pgd_ref = pgd_offset_k(address); 941access_error(unsigned long error_code, int write, struct vm_area_struct *vma)
539 if (pgd_none(*pgd_ref)) 942{
540 return -1; 943 if (write) {
541 if (pgd_none(*pgd)) 944 /* write, present and write, not present: */
542 set_pgd(pgd, *pgd_ref); 945 if (unlikely(!(vma->vm_flags & VM_WRITE)))
543 else 946 return 1;
544 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref)); 947 return 0;
948 }
545 949
546 /* Below here mismatches are bugs because these lower tables 950 /* read, present: */
547 are shared */ 951 if (unlikely(error_code & PF_PROT))
952 return 1;
953
954 /* read, not present: */
955 if (unlikely(!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))))
956 return 1;
548 957
549 pud = pud_offset(pgd, address);
550 pud_ref = pud_offset(pgd_ref, address);
551 if (pud_none(*pud_ref))
552 return -1;
553 if (pud_none(*pud) || pud_page_vaddr(*pud) != pud_page_vaddr(*pud_ref))
554 BUG();
555 pmd = pmd_offset(pud, address);
556 pmd_ref = pmd_offset(pud_ref, address);
557 if (pmd_none(*pmd_ref))
558 return -1;
559 if (pmd_none(*pmd) || pmd_page(*pmd) != pmd_page(*pmd_ref))
560 BUG();
561 pte_ref = pte_offset_kernel(pmd_ref, address);
562 if (!pte_present(*pte_ref))
563 return -1;
564 pte = pte_offset_kernel(pmd, address);
565 /* Don't use pte_page here, because the mappings can point
566 outside mem_map, and the NUMA hash lookup cannot handle
567 that. */
568 if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref))
569 BUG();
570 return 0; 958 return 0;
571#endif
572} 959}
573 960
574int show_unhandled_signals = 1; 961static int fault_in_kernel_space(unsigned long address)
962{
963 return address >= TASK_SIZE_MAX;
964}
575 965
576/* 966/*
577 * This routine handles page faults. It determines the address, 967 * This routine handles page faults. It determines the address,
578 * and the problem, and then passes it off to one of the appropriate 968 * and the problem, and then passes it off to one of the appropriate
579 * routines. 969 * routines.
580 */ 970 */
581#ifdef CONFIG_X86_64 971dotraplinkage void __kprobes
582asmlinkage 972do_page_fault(struct pt_regs *regs, unsigned long error_code)
583#endif
584void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
585{ 973{
586 struct task_struct *tsk;
587 struct mm_struct *mm;
588 struct vm_area_struct *vma; 974 struct vm_area_struct *vma;
975 struct task_struct *tsk;
589 unsigned long address; 976 unsigned long address;
590 int write, si_code; 977 struct mm_struct *mm;
978 int write;
591 int fault; 979 int fault;
592#ifdef CONFIG_X86_64
593 unsigned long flags;
594 int sig;
595#endif
596 980
597 tsk = current; 981 tsk = current;
598 mm = tsk->mm; 982 mm = tsk->mm;
983
599 prefetchw(&mm->mmap_sem); 984 prefetchw(&mm->mmap_sem);
600 985
601 /* get the address */ 986 /* Get the faulting address: */
602 address = read_cr2(); 987 address = read_cr2();
603 988
604 si_code = SEGV_MAPERR;
605
606 if (unlikely(kmmio_fault(regs, address))) 989 if (unlikely(kmmio_fault(regs, address)))
607 return; 990 return;
608 991
@@ -619,319 +1002,147 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
619 * (error_code & 4) == 0, and that the fault was not a 1002 * (error_code & 4) == 0, and that the fault was not a
620 * protection error (error_code & 9) == 0. 1003 * protection error (error_code & 9) == 0.
621 */ 1004 */
622#ifdef CONFIG_X86_32 1005 if (unlikely(fault_in_kernel_space(address))) {
623 if (unlikely(address >= TASK_SIZE)) {
624#else
625 if (unlikely(address >= TASK_SIZE64)) {
626#endif
627 if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) && 1006 if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
628 vmalloc_fault(address) >= 0) 1007 vmalloc_fault(address) >= 0)
629 return; 1008 return;
630 1009
631 /* Can handle a stale RO->RW TLB */ 1010 /* Can handle a stale RO->RW TLB: */
632 if (spurious_fault(address, error_code)) 1011 if (spurious_fault(error_code, address))
633 return; 1012 return;
634 1013
635 /* kprobes don't want to hook the spurious faults. */ 1014 /* kprobes don't want to hook the spurious faults: */
636 if (notify_page_fault(regs)) 1015 if (notify_page_fault(regs))
637 return; 1016 return;
638 /* 1017 /*
639 * Don't take the mm semaphore here. If we fixup a prefetch 1018 * Don't take the mm semaphore here. If we fixup a prefetch
640 * fault we could otherwise deadlock. 1019 * fault we could otherwise deadlock:
641 */ 1020 */
642 goto bad_area_nosemaphore; 1021 bad_area_nosemaphore(regs, error_code, address);
643 }
644 1022
645 /* kprobes don't want to hook the spurious faults. */
646 if (notify_page_fault(regs))
647 return; 1023 return;
1024 }
648 1025
1026 /* kprobes don't want to hook the spurious faults: */
1027 if (unlikely(notify_page_fault(regs)))
1028 return;
649 /* 1029 /*
650 * It's safe to allow irq's after cr2 has been saved and the 1030 * It's safe to allow irq's after cr2 has been saved and the
651 * vmalloc fault has been handled. 1031 * vmalloc fault has been handled.
652 * 1032 *
653 * User-mode registers count as a user access even for any 1033 * User-mode registers count as a user access even for any
654 * potential system fault or CPU buglet. 1034 * potential system fault or CPU buglet:
655 */ 1035 */
656 if (user_mode_vm(regs)) { 1036 if (user_mode_vm(regs)) {
657 local_irq_enable(); 1037 local_irq_enable();
658 error_code |= PF_USER; 1038 error_code |= PF_USER;
659 } else if (regs->flags & X86_EFLAGS_IF) 1039 } else {
660 local_irq_enable(); 1040 if (regs->flags & X86_EFLAGS_IF)
1041 local_irq_enable();
1042 }
661 1043
662#ifdef CONFIG_X86_64
663 if (unlikely(error_code & PF_RSVD)) 1044 if (unlikely(error_code & PF_RSVD))
664 pgtable_bad(address, regs, error_code); 1045 pgtable_bad(regs, error_code, address);
665#endif
666 1046
667 /* 1047 /*
668 * If we're in an interrupt, have no user context or are running in an 1048 * If we're in an interrupt, have no user context or are running
669 * atomic region then we must not take the fault. 1049 * in an atomic region then we must not take the fault:
670 */ 1050 */
671 if (unlikely(in_atomic() || !mm)) 1051 if (unlikely(in_atomic() || !mm)) {
672 goto bad_area_nosemaphore; 1052 bad_area_nosemaphore(regs, error_code, address);
1053 return;
1054 }
673 1055
674 /* 1056 /*
675 * When running in the kernel we expect faults to occur only to 1057 * When running in the kernel we expect faults to occur only to
676 * addresses in user space. All other faults represent errors in the 1058 * addresses in user space. All other faults represent errors in
677 * kernel and should generate an OOPS. Unfortunately, in the case of an 1059 * the kernel and should generate an OOPS. Unfortunately, in the
678 * erroneous fault occurring in a code path which already holds mmap_sem 1060 * case of an erroneous fault occurring in a code path which already
679 * we will deadlock attempting to validate the fault against the 1061 * holds mmap_sem we will deadlock attempting to validate the fault
680 * address space. Luckily the kernel only validly references user 1062 * against the address space. Luckily the kernel only validly
681 * space from well defined areas of code, which are listed in the 1063 * references user space from well defined areas of code, which are
682 * exceptions table. 1064 * listed in the exceptions table.
683 * 1065 *
684 * As the vast majority of faults will be valid we will only perform 1066 * As the vast majority of faults will be valid we will only perform
685 * the source reference check when there is a possibility of a deadlock. 1067 * the source reference check when there is a possibility of a
686 * Attempt to lock the address space, if we cannot we then validate the 1068 * deadlock. Attempt to lock the address space, if we cannot we then
687 * source. If this is invalid we can skip the address space check, 1069 * validate the source. If this is invalid we can skip the address
688 * thus avoiding the deadlock. 1070 * space check, thus avoiding the deadlock:
689 */ 1071 */
690 if (!down_read_trylock(&mm->mmap_sem)) { 1072 if (unlikely(!down_read_trylock(&mm->mmap_sem))) {
691 if ((error_code & PF_USER) == 0 && 1073 if ((error_code & PF_USER) == 0 &&
692 !search_exception_tables(regs->ip)) 1074 !search_exception_tables(regs->ip)) {
693 goto bad_area_nosemaphore; 1075 bad_area_nosemaphore(regs, error_code, address);
1076 return;
1077 }
694 down_read(&mm->mmap_sem); 1078 down_read(&mm->mmap_sem);
1079 } else {
1080 /*
1081 * The above down_read_trylock() might have succeeded in
1082 * which case we'll have missed the might_sleep() from
1083 * down_read():
1084 */
1085 might_sleep();
695 } 1086 }
696 1087
697 vma = find_vma(mm, address); 1088 vma = find_vma(mm, address);
698 if (!vma) 1089 if (unlikely(!vma)) {
699 goto bad_area; 1090 bad_area(regs, error_code, address);
700 if (vma->vm_start <= address) 1091 return;
1092 }
1093 if (likely(vma->vm_start <= address))
701 goto good_area; 1094 goto good_area;
702 if (!(vma->vm_flags & VM_GROWSDOWN)) 1095 if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) {
703 goto bad_area; 1096 bad_area(regs, error_code, address);
1097 return;
1098 }
704 if (error_code & PF_USER) { 1099 if (error_code & PF_USER) {
705 /* 1100 /*
706 * Accessing the stack below %sp is always a bug. 1101 * Accessing the stack below %sp is always a bug.
707 * The large cushion allows instructions like enter 1102 * The large cushion allows instructions like enter
708 * and pusha to work. ("enter $65535,$31" pushes 1103 * and pusha to work. ("enter $65535, $31" pushes
709 * 32 pointers and then decrements %sp by 65535.) 1104 * 32 pointers and then decrements %sp by 65535.)
710 */ 1105 */
711 if (address + 65536 + 32 * sizeof(unsigned long) < regs->sp) 1106 if (unlikely(address + 65536 + 32 * sizeof(unsigned long) < regs->sp)) {
712 goto bad_area; 1107 bad_area(regs, error_code, address);
1108 return;
1109 }
713 } 1110 }
714 if (expand_stack(vma, address)) 1111 if (unlikely(expand_stack(vma, address))) {
715 goto bad_area; 1112 bad_area(regs, error_code, address);
716/* 1113 return;
717 * Ok, we have a good vm_area for this memory access, so 1114 }
718 * we can handle it.. 1115
719 */ 1116 /*
1117 * Ok, we have a good vm_area for this memory access, so
1118 * we can handle it..
1119 */
720good_area: 1120good_area:
721 si_code = SEGV_ACCERR; 1121 write = error_code & PF_WRITE;
722 write = 0; 1122
723 switch (error_code & (PF_PROT|PF_WRITE)) { 1123 if (unlikely(access_error(error_code, write, vma))) {
724 default: /* 3: write, present */ 1124 bad_area_access_error(regs, error_code, address);
725 /* fall through */ 1125 return;
726 case PF_WRITE: /* write, not present */
727 if (!(vma->vm_flags & VM_WRITE))
728 goto bad_area;
729 write++;
730 break;
731 case PF_PROT: /* read, present */
732 goto bad_area;
733 case 0: /* read, not present */
734 if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
735 goto bad_area;
736 } 1126 }
737 1127
738 /* 1128 /*
739 * If for any reason at all we couldn't handle the fault, 1129 * If for any reason at all we couldn't handle the fault,
740 * make sure we exit gracefully rather than endlessly redo 1130 * make sure we exit gracefully rather than endlessly redo
741 * the fault. 1131 * the fault:
742 */ 1132 */
743 fault = handle_mm_fault(mm, vma, address, write); 1133 fault = handle_mm_fault(mm, vma, address, write);
1134
744 if (unlikely(fault & VM_FAULT_ERROR)) { 1135 if (unlikely(fault & VM_FAULT_ERROR)) {
745 if (fault & VM_FAULT_OOM) 1136 mm_fault_error(regs, error_code, address, fault);
746 goto out_of_memory; 1137 return;
747 else if (fault & VM_FAULT_SIGBUS)
748 goto do_sigbus;
749 BUG();
750 } 1138 }
1139
751 if (fault & VM_FAULT_MAJOR) 1140 if (fault & VM_FAULT_MAJOR)
752 tsk->maj_flt++; 1141 tsk->maj_flt++;
753 else 1142 else
754 tsk->min_flt++; 1143 tsk->min_flt++;
755 1144
756#ifdef CONFIG_X86_32 1145 check_v8086_mode(regs, address, tsk);
757 /*
758 * Did it hit the DOS screen memory VA from vm86 mode?
759 */
760 if (v8086_mode(regs)) {
761 unsigned long bit = (address - 0xA0000) >> PAGE_SHIFT;
762 if (bit < 32)
763 tsk->thread.screen_bitmap |= 1 << bit;
764 }
765#endif
766 up_read(&mm->mmap_sem);
767 return;
768 1146
769/*
770 * Something tried to access memory that isn't in our memory map..
771 * Fix it, but check if it's kernel or user first..
772 */
773bad_area:
774 up_read(&mm->mmap_sem); 1147 up_read(&mm->mmap_sem);
775
776bad_area_nosemaphore:
777 /* User mode accesses just cause a SIGSEGV */
778 if (error_code & PF_USER) {
779 /*
780 * It's possible to have interrupts off here.
781 */
782 local_irq_enable();
783
784 /*
785 * Valid to do another page fault here because this one came
786 * from user space.
787 */
788 if (is_prefetch(regs, address, error_code))
789 return;
790
791 if (is_errata100(regs, address))
792 return;
793
794 if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&
795 printk_ratelimit()) {
796 printk(
797 "%s%s[%d]: segfault at %lx ip %p sp %p error %lx",
798 task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,
799 tsk->comm, task_pid_nr(tsk), address,
800 (void *) regs->ip, (void *) regs->sp, error_code);
801 print_vma_addr(" in ", regs->ip);
802 printk("\n");
803 }
804
805 tsk->thread.cr2 = address;
806 /* Kernel addresses are always protection faults */
807 tsk->thread.error_code = error_code | (address >= TASK_SIZE);
808 tsk->thread.trap_no = 14;
809 force_sig_info_fault(SIGSEGV, si_code, address, tsk);
810 return;
811 }
812
813 if (is_f00f_bug(regs, address))
814 return;
815
816no_context:
817 /* Are we prepared to handle this kernel fault? */
818 if (fixup_exception(regs))
819 return;
820
821 /*
822 * X86_32
823 * Valid to do another page fault here, because if this fault
824 * had been triggered by is_prefetch fixup_exception would have
825 * handled it.
826 *
827 * X86_64
828 * Hall of shame of CPU/BIOS bugs.
829 */
830 if (is_prefetch(regs, address, error_code))
831 return;
832
833 if (is_errata93(regs, address))
834 return;
835
836/*
837 * Oops. The kernel tried to access some bad page. We'll have to
838 * terminate things with extreme prejudice.
839 */
840#ifdef CONFIG_X86_32
841 bust_spinlocks(1);
842#else
843 flags = oops_begin();
844#endif
845
846 show_fault_oops(regs, error_code, address);
847
848 tsk->thread.cr2 = address;
849 tsk->thread.trap_no = 14;
850 tsk->thread.error_code = error_code;
851
852#ifdef CONFIG_X86_32
853 die("Oops", regs, error_code);
854 bust_spinlocks(0);
855 do_exit(SIGKILL);
856#else
857 sig = SIGKILL;
858 if (__die("Oops", regs, error_code))
859 sig = 0;
860 /* Executive summary in case the body of the oops scrolled away */
861 printk(KERN_EMERG "CR2: %016lx\n", address);
862 oops_end(flags, regs, sig);
863#endif
864
865out_of_memory:
866 /*
867 * We ran out of memory, call the OOM killer, and return the userspace
868 * (which will retry the fault, or kill us if we got oom-killed).
869 */
870 up_read(&mm->mmap_sem);
871 pagefault_out_of_memory();
872 return;
873
874do_sigbus:
875 up_read(&mm->mmap_sem);
876
877 /* Kernel mode? Handle exceptions or die */
878 if (!(error_code & PF_USER))
879 goto no_context;
880#ifdef CONFIG_X86_32
881 /* User space => ok to do another page fault */
882 if (is_prefetch(regs, address, error_code))
883 return;
884#endif
885 tsk->thread.cr2 = address;
886 tsk->thread.error_code = error_code;
887 tsk->thread.trap_no = 14;
888 force_sig_info_fault(SIGBUS, BUS_ADRERR, address, tsk);
889}
890
891DEFINE_SPINLOCK(pgd_lock);
892LIST_HEAD(pgd_list);
893
894void vmalloc_sync_all(void)
895{
896 unsigned long address;
897
898#ifdef CONFIG_X86_32
899 if (SHARED_KERNEL_PMD)
900 return;
901
902 for (address = VMALLOC_START & PMD_MASK;
903 address >= TASK_SIZE && address < FIXADDR_TOP;
904 address += PMD_SIZE) {
905 unsigned long flags;
906 struct page *page;
907
908 spin_lock_irqsave(&pgd_lock, flags);
909 list_for_each_entry(page, &pgd_list, lru) {
910 if (!vmalloc_sync_one(page_address(page),
911 address))
912 break;
913 }
914 spin_unlock_irqrestore(&pgd_lock, flags);
915 }
916#else /* CONFIG_X86_64 */
917 for (address = VMALLOC_START & PGDIR_MASK; address <= VMALLOC_END;
918 address += PGDIR_SIZE) {
919 const pgd_t *pgd_ref = pgd_offset_k(address);
920 unsigned long flags;
921 struct page *page;
922
923 if (pgd_none(*pgd_ref))
924 continue;
925 spin_lock_irqsave(&pgd_lock, flags);
926 list_for_each_entry(page, &pgd_list, lru) {
927 pgd_t *pgd;
928 pgd = (pgd_t *)page_address(page) + pgd_index(address);
929 if (pgd_none(*pgd))
930 set_pgd(pgd, *pgd_ref);
931 else
932 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
933 }
934 spin_unlock_irqrestore(&pgd_lock, flags);
935 }
936#endif
937} 1148}
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index bcc079c282dd..00f127c80b0e 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -1,5 +1,6 @@
1#include <linux/highmem.h> 1#include <linux/highmem.h>
2#include <linux/module.h> 2#include <linux/module.h>
3#include <linux/swap.h> /* for totalram_pages */
3 4
4void *kmap(struct page *page) 5void *kmap(struct page *page)
5{ 6{
@@ -156,3 +157,36 @@ EXPORT_SYMBOL(kmap);
156EXPORT_SYMBOL(kunmap); 157EXPORT_SYMBOL(kunmap);
157EXPORT_SYMBOL(kmap_atomic); 158EXPORT_SYMBOL(kmap_atomic);
158EXPORT_SYMBOL(kunmap_atomic); 159EXPORT_SYMBOL(kunmap_atomic);
160
161#ifdef CONFIG_NUMA
162void __init set_highmem_pages_init(void)
163{
164 struct zone *zone;
165 int nid;
166
167 for_each_zone(zone) {
168 unsigned long zone_start_pfn, zone_end_pfn;
169
170 if (!is_highmem(zone))
171 continue;
172
173 zone_start_pfn = zone->zone_start_pfn;
174 zone_end_pfn = zone_start_pfn + zone->spanned_pages;
175
176 nid = zone_to_nid(zone);
177 printk(KERN_INFO "Initializing %s for node %d (%08lx:%08lx)\n",
178 zone->name, nid, zone_start_pfn, zone_end_pfn);
179
180 add_highpages_with_active_regions(nid, zone_start_pfn,
181 zone_end_pfn);
182 }
183 totalram_pages += totalhigh_pages;
184}
185#else
186void __init set_highmem_pages_init(void)
187{
188 add_highpages_with_active_regions(0, highstart_pfn, highend_pfn);
189
190 totalram_pages += totalhigh_pages;
191}
192#endif /* CONFIG_NUMA */
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
new file mode 100644
index 000000000000..ce6a722587d8
--- /dev/null
+++ b/arch/x86/mm/init.c
@@ -0,0 +1,49 @@
1#include <linux/swap.h>
2#include <asm/cacheflush.h>
3#include <asm/page.h>
4#include <asm/sections.h>
5#include <asm/system.h>
6
7void free_init_pages(char *what, unsigned long begin, unsigned long end)
8{
9 unsigned long addr = begin;
10
11 if (addr >= end)
12 return;
13
14 /*
15 * If debugging page accesses then do not free this memory but
16 * mark them not present - any buggy init-section access will
17 * create a kernel page fault:
18 */
19#ifdef CONFIG_DEBUG_PAGEALLOC
20 printk(KERN_INFO "debug: unmapping init memory %08lx..%08lx\n",
21 begin, PAGE_ALIGN(end));
22 set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
23#else
24 /*
25 * We just marked the kernel text read only above, now that
26 * we are going to free part of that, we need to make that
27 * writeable first.
28 */
29 set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
30
31 printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
32
33 for (; addr < end; addr += PAGE_SIZE) {
34 ClearPageReserved(virt_to_page(addr));
35 init_page_count(virt_to_page(addr));
36 memset((void *)(addr & ~(PAGE_SIZE-1)),
37 POISON_FREE_INITMEM, PAGE_SIZE);
38 free_page(addr);
39 totalram_pages++;
40 }
41#endif
42}
43
44void free_initmem(void)
45{
46 free_init_pages("unused kernel memory",
47 (unsigned long)(&__init_begin),
48 (unsigned long)(&__init_end));
49}
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 2cef05074413..47df0e1bbeb9 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -49,9 +49,6 @@
49#include <asm/paravirt.h> 49#include <asm/paravirt.h>
50#include <asm/setup.h> 50#include <asm/setup.h>
51#include <asm/cacheflush.h> 51#include <asm/cacheflush.h>
52#include <asm/smp.h>
53
54unsigned int __VMALLOC_RESERVE = 128 << 20;
55 52
56unsigned long max_low_pfn_mapped; 53unsigned long max_low_pfn_mapped;
57unsigned long max_pfn_mapped; 54unsigned long max_pfn_mapped;
@@ -138,6 +135,23 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
138 return pte_offset_kernel(pmd, 0); 135 return pte_offset_kernel(pmd, 0);
139} 136}
140 137
138pmd_t * __init populate_extra_pmd(unsigned long vaddr)
139{
140 int pgd_idx = pgd_index(vaddr);
141 int pmd_idx = pmd_index(vaddr);
142
143 return one_md_table_init(swapper_pg_dir + pgd_idx) + pmd_idx;
144}
145
146pte_t * __init populate_extra_pte(unsigned long vaddr)
147{
148 int pte_idx = pte_index(vaddr);
149 pmd_t *pmd;
150
151 pmd = populate_extra_pmd(vaddr);
152 return one_page_table_init(pmd) + pte_idx;
153}
154
141static pte_t *__init page_table_kmap_check(pte_t *pte, pmd_t *pmd, 155static pte_t *__init page_table_kmap_check(pte_t *pte, pmd_t *pmd,
142 unsigned long vaddr, pte_t *lastpte) 156 unsigned long vaddr, pte_t *lastpte)
143{ 157{
@@ -470,22 +484,10 @@ void __init add_highpages_with_active_regions(int nid, unsigned long start_pfn,
470 work_with_active_regions(nid, add_highpages_work_fn, &data); 484 work_with_active_regions(nid, add_highpages_work_fn, &data);
471} 485}
472 486
473#ifndef CONFIG_NUMA
474static void __init set_highmem_pages_init(void)
475{
476 add_highpages_with_active_regions(0, highstart_pfn, highend_pfn);
477
478 totalram_pages += totalhigh_pages;
479}
480#endif /* !CONFIG_NUMA */
481
482#else 487#else
483static inline void permanent_kmaps_init(pgd_t *pgd_base) 488static inline void permanent_kmaps_init(pgd_t *pgd_base)
484{ 489{
485} 490}
486static inline void set_highmem_pages_init(void)
487{
488}
489#endif /* CONFIG_HIGHMEM */ 491#endif /* CONFIG_HIGHMEM */
490 492
491void __init native_pagetable_setup_start(pgd_t *base) 493void __init native_pagetable_setup_start(pgd_t *base)
@@ -675,75 +677,97 @@ static int __init parse_highmem(char *arg)
675} 677}
676early_param("highmem", parse_highmem); 678early_param("highmem", parse_highmem);
677 679
680#define MSG_HIGHMEM_TOO_BIG \
681 "highmem size (%luMB) is bigger than pages available (%luMB)!\n"
682
683#define MSG_LOWMEM_TOO_SMALL \
684 "highmem size (%luMB) results in <64MB lowmem, ignoring it!\n"
678/* 685/*
679 * Determine low and high memory ranges: 686 * All of RAM fits into lowmem - but if user wants highmem
687 * artificially via the highmem=x boot parameter then create
688 * it:
680 */ 689 */
681void __init find_low_pfn_range(void) 690void __init lowmem_pfn_init(void)
682{ 691{
683 /* it could update max_pfn */
684
685 /* max_low_pfn is 0, we already have early_res support */ 692 /* max_low_pfn is 0, we already have early_res support */
686
687 max_low_pfn = max_pfn; 693 max_low_pfn = max_pfn;
688 if (max_low_pfn > MAXMEM_PFN) { 694
689 if (highmem_pages == -1) 695 if (highmem_pages == -1)
690 highmem_pages = max_pfn - MAXMEM_PFN; 696 highmem_pages = 0;
691 if (highmem_pages + MAXMEM_PFN < max_pfn) 697#ifdef CONFIG_HIGHMEM
692 max_pfn = MAXMEM_PFN + highmem_pages; 698 if (highmem_pages >= max_pfn) {
693 if (highmem_pages + MAXMEM_PFN > max_pfn) { 699 printk(KERN_ERR MSG_HIGHMEM_TOO_BIG,
694 printk(KERN_WARNING "only %luMB highmem pages " 700 pages_to_mb(highmem_pages), pages_to_mb(max_pfn));
695 "available, ignoring highmem size of %uMB.\n", 701 highmem_pages = 0;
696 pages_to_mb(max_pfn - MAXMEM_PFN), 702 }
703 if (highmem_pages) {
704 if (max_low_pfn - highmem_pages < 64*1024*1024/PAGE_SIZE) {
705 printk(KERN_ERR MSG_LOWMEM_TOO_SMALL,
697 pages_to_mb(highmem_pages)); 706 pages_to_mb(highmem_pages));
698 highmem_pages = 0; 707 highmem_pages = 0;
699 } 708 }
700 max_low_pfn = MAXMEM_PFN; 709 max_low_pfn -= highmem_pages;
710 }
711#else
712 if (highmem_pages)
713 printk(KERN_ERR "ignoring highmem size on non-highmem kernel!\n");
714#endif
715}
716
717#define MSG_HIGHMEM_TOO_SMALL \
718 "only %luMB highmem pages available, ignoring highmem size of %luMB!\n"
719
720#define MSG_HIGHMEM_TRIMMED \
721 "Warning: only 4GB will be used. Use a HIGHMEM64G enabled kernel!\n"
722/*
723 * We have more RAM than fits into lowmem - we try to put it into
724 * highmem, also taking the highmem=x boot parameter into account:
725 */
726void __init highmem_pfn_init(void)
727{
728 max_low_pfn = MAXMEM_PFN;
729
730 if (highmem_pages == -1)
731 highmem_pages = max_pfn - MAXMEM_PFN;
732
733 if (highmem_pages + MAXMEM_PFN < max_pfn)
734 max_pfn = MAXMEM_PFN + highmem_pages;
735
736 if (highmem_pages + MAXMEM_PFN > max_pfn) {
737 printk(KERN_WARNING MSG_HIGHMEM_TOO_SMALL,
738 pages_to_mb(max_pfn - MAXMEM_PFN),
739 pages_to_mb(highmem_pages));
740 highmem_pages = 0;
741 }
701#ifndef CONFIG_HIGHMEM 742#ifndef CONFIG_HIGHMEM
702 /* Maximum memory usable is what is directly addressable */ 743 /* Maximum memory usable is what is directly addressable */
703 printk(KERN_WARNING "Warning only %ldMB will be used.\n", 744 printk(KERN_WARNING "Warning only %ldMB will be used.\n", MAXMEM>>20);
704 MAXMEM>>20); 745 if (max_pfn > MAX_NONPAE_PFN)
705 if (max_pfn > MAX_NONPAE_PFN) 746 printk(KERN_WARNING "Use a HIGHMEM64G enabled kernel.\n");
706 printk(KERN_WARNING 747 else
707 "Use a HIGHMEM64G enabled kernel.\n"); 748 printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
708 else 749 max_pfn = MAXMEM_PFN;
709 printk(KERN_WARNING "Use a HIGHMEM enabled kernel.\n");
710 max_pfn = MAXMEM_PFN;
711#else /* !CONFIG_HIGHMEM */ 750#else /* !CONFIG_HIGHMEM */
712#ifndef CONFIG_HIGHMEM64G 751#ifndef CONFIG_HIGHMEM64G
713 if (max_pfn > MAX_NONPAE_PFN) { 752 if (max_pfn > MAX_NONPAE_PFN) {
714 max_pfn = MAX_NONPAE_PFN; 753 max_pfn = MAX_NONPAE_PFN;
715 printk(KERN_WARNING "Warning only 4GB will be used." 754 printk(KERN_WARNING MSG_HIGHMEM_TRIMMED);
716 "Use a HIGHMEM64G enabled kernel.\n"); 755 }
717 }
718#endif /* !CONFIG_HIGHMEM64G */ 756#endif /* !CONFIG_HIGHMEM64G */
719#endif /* !CONFIG_HIGHMEM */ 757#endif /* !CONFIG_HIGHMEM */
720 } else { 758}
721 if (highmem_pages == -1) 759
722 highmem_pages = 0; 760/*
723#ifdef CONFIG_HIGHMEM 761 * Determine low and high memory ranges:
724 if (highmem_pages >= max_pfn) { 762 */
725 printk(KERN_ERR "highmem size specified (%uMB) is " 763void __init find_low_pfn_range(void)
726 "bigger than pages available (%luMB)!.\n", 764{
727 pages_to_mb(highmem_pages), 765 /* it could update max_pfn */
728 pages_to_mb(max_pfn)); 766
729 highmem_pages = 0; 767 if (max_pfn <= MAXMEM_PFN)
730 } 768 lowmem_pfn_init();
731 if (highmem_pages) { 769 else
732 if (max_low_pfn - highmem_pages < 770 highmem_pfn_init();
733 64*1024*1024/PAGE_SIZE){
734 printk(KERN_ERR "highmem size %uMB results in "
735 "smaller than 64MB lowmem, ignoring it.\n"
736 , pages_to_mb(highmem_pages));
737 highmem_pages = 0;
738 }
739 max_low_pfn -= highmem_pages;
740 }
741#else
742 if (highmem_pages)
743 printk(KERN_ERR "ignoring highmem size on non-highmem"
744 " kernel!\n");
745#endif
746 }
747} 771}
748 772
749#ifndef CONFIG_NEED_MULTIPLE_NODES 773#ifndef CONFIG_NEED_MULTIPLE_NODES
@@ -826,10 +850,10 @@ static void __init find_early_table_space(unsigned long end, int use_pse)
826 unsigned long puds, pmds, ptes, tables, start; 850 unsigned long puds, pmds, ptes, tables, start;
827 851
828 puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; 852 puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
829 tables = PAGE_ALIGN(puds * sizeof(pud_t)); 853 tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
830 854
831 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; 855 pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
832 tables += PAGE_ALIGN(pmds * sizeof(pmd_t)); 856 tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
833 857
834 if (use_pse) { 858 if (use_pse) {
835 unsigned long extra; 859 unsigned long extra;
@@ -840,10 +864,10 @@ static void __init find_early_table_space(unsigned long end, int use_pse)
840 } else 864 } else
841 ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT; 865 ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
842 866
843 tables += PAGE_ALIGN(ptes * sizeof(pte_t)); 867 tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
844 868
845 /* for fixmap */ 869 /* for fixmap */
846 tables += PAGE_ALIGN(__end_of_fixed_addresses * sizeof(pte_t)); 870 tables += roundup(__end_of_fixed_addresses * sizeof(pte_t), PAGE_SIZE);
847 871
848 /* 872 /*
849 * RED-PEN putting page tables only on node 0 could 873 * RED-PEN putting page tables only on node 0 could
@@ -1193,45 +1217,6 @@ void mark_rodata_ro(void)
1193} 1217}
1194#endif 1218#endif
1195 1219
1196void free_init_pages(char *what, unsigned long begin, unsigned long end)
1197{
1198#ifdef CONFIG_DEBUG_PAGEALLOC
1199 /*
1200 * If debugging page accesses then do not free this memory but
1201 * mark them not present - any buggy init-section access will
1202 * create a kernel page fault:
1203 */
1204 printk(KERN_INFO "debug: unmapping init memory %08lx..%08lx\n",
1205 begin, PAGE_ALIGN(end));
1206 set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
1207#else
1208 unsigned long addr;
1209
1210 /*
1211 * We just marked the kernel text read only above, now that
1212 * we are going to free part of that, we need to make that
1213 * writeable first.
1214 */
1215 set_memory_rw(begin, (end - begin) >> PAGE_SHIFT);
1216
1217 for (addr = begin; addr < end; addr += PAGE_SIZE) {
1218 ClearPageReserved(virt_to_page(addr));
1219 init_page_count(virt_to_page(addr));
1220 memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
1221 free_page(addr);
1222 totalram_pages++;
1223 }
1224 printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
1225#endif
1226}
1227
1228void free_initmem(void)
1229{
1230 free_init_pages("unused kernel memory",
1231 (unsigned long)(&__init_begin),
1232 (unsigned long)(&__init_end));
1233}
1234
1235#ifdef CONFIG_BLK_DEV_INITRD 1220#ifdef CONFIG_BLK_DEV_INITRD
1236void free_initrd_mem(unsigned long start, unsigned long end) 1221void free_initrd_mem(unsigned long start, unsigned long end)
1237{ 1222{
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index b1352250096e..07f44d491df1 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -168,34 +168,51 @@ static __ref void *spp_getpage(void)
168 return ptr; 168 return ptr;
169} 169}
170 170
171void 171static pud_t *fill_pud(pgd_t *pgd, unsigned long vaddr)
172set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
173{ 172{
174 pud_t *pud; 173 if (pgd_none(*pgd)) {
175 pmd_t *pmd; 174 pud_t *pud = (pud_t *)spp_getpage();
176 pte_t *pte; 175 pgd_populate(&init_mm, pgd, pud);
176 if (pud != pud_offset(pgd, 0))
177 printk(KERN_ERR "PAGETABLE BUG #00! %p <-> %p\n",
178 pud, pud_offset(pgd, 0));
179 }
180 return pud_offset(pgd, vaddr);
181}
177 182
178 pud = pud_page + pud_index(vaddr); 183static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
184{
179 if (pud_none(*pud)) { 185 if (pud_none(*pud)) {
180 pmd = (pmd_t *) spp_getpage(); 186 pmd_t *pmd = (pmd_t *) spp_getpage();
181 pud_populate(&init_mm, pud, pmd); 187 pud_populate(&init_mm, pud, pmd);
182 if (pmd != pmd_offset(pud, 0)) { 188 if (pmd != pmd_offset(pud, 0))
183 printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n", 189 printk(KERN_ERR "PAGETABLE BUG #01! %p <-> %p\n",
184 pmd, pmd_offset(pud, 0)); 190 pmd, pmd_offset(pud, 0));
185 return;
186 }
187 } 191 }
188 pmd = pmd_offset(pud, vaddr); 192 return pmd_offset(pud, vaddr);
193}
194
195static pte_t *fill_pte(pmd_t *pmd, unsigned long vaddr)
196{
189 if (pmd_none(*pmd)) { 197 if (pmd_none(*pmd)) {
190 pte = (pte_t *) spp_getpage(); 198 pte_t *pte = (pte_t *) spp_getpage();
191 pmd_populate_kernel(&init_mm, pmd, pte); 199 pmd_populate_kernel(&init_mm, pmd, pte);
192 if (pte != pte_offset_kernel(pmd, 0)) { 200 if (pte != pte_offset_kernel(pmd, 0))
193 printk(KERN_ERR "PAGETABLE BUG #02!\n"); 201 printk(KERN_ERR "PAGETABLE BUG #02!\n");
194 return;
195 }
196 } 202 }
203 return pte_offset_kernel(pmd, vaddr);
204}
205
206void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
207{
208 pud_t *pud;
209 pmd_t *pmd;
210 pte_t *pte;
211
212 pud = pud_page + pud_index(vaddr);
213 pmd = fill_pmd(pud, vaddr);
214 pte = fill_pte(pmd, vaddr);
197 215
198 pte = pte_offset_kernel(pmd, vaddr);
199 set_pte(pte, new_pte); 216 set_pte(pte, new_pte);
200 217
201 /* 218 /*
@@ -205,8 +222,7 @@ set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
205 __flush_tlb_one(vaddr); 222 __flush_tlb_one(vaddr);
206} 223}
207 224
208void 225void set_pte_vaddr(unsigned long vaddr, pte_t pteval)
209set_pte_vaddr(unsigned long vaddr, pte_t pteval)
210{ 226{
211 pgd_t *pgd; 227 pgd_t *pgd;
212 pud_t *pud_page; 228 pud_t *pud_page;
@@ -223,6 +239,24 @@ set_pte_vaddr(unsigned long vaddr, pte_t pteval)
223 set_pte_vaddr_pud(pud_page, vaddr, pteval); 239 set_pte_vaddr_pud(pud_page, vaddr, pteval);
224} 240}
225 241
242pmd_t * __init populate_extra_pmd(unsigned long vaddr)
243{
244 pgd_t *pgd;
245 pud_t *pud;
246
247 pgd = pgd_offset_k(vaddr);
248 pud = fill_pud(pgd, vaddr);
249 return fill_pmd(pud, vaddr);
250}
251
252pte_t * __init populate_extra_pte(unsigned long vaddr)
253{
254 pmd_t *pmd;
255
256 pmd = populate_extra_pmd(vaddr);
257 return fill_pte(pmd, vaddr);
258}
259
226/* 260/*
227 * Create large page table mappings for a range of physical addresses. 261 * Create large page table mappings for a range of physical addresses.
228 */ 262 */
@@ -947,43 +981,6 @@ void __init mem_init(void)
947 initsize >> 10); 981 initsize >> 10);
948} 982}
949 983
950void free_init_pages(char *what, unsigned long begin, unsigned long end)
951{
952 unsigned long addr = begin;
953
954 if (addr >= end)
955 return;
956
957 /*
958 * If debugging page accesses then do not free this memory but
959 * mark them not present - any buggy init-section access will
960 * create a kernel page fault:
961 */
962#ifdef CONFIG_DEBUG_PAGEALLOC
963 printk(KERN_INFO "debug: unmapping init memory %08lx..%08lx\n",
964 begin, PAGE_ALIGN(end));
965 set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
966#else
967 printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
968
969 for (; addr < end; addr += PAGE_SIZE) {
970 ClearPageReserved(virt_to_page(addr));
971 init_page_count(virt_to_page(addr));
972 memset((void *)(addr & ~(PAGE_SIZE-1)),
973 POISON_FREE_INITMEM, PAGE_SIZE);
974 free_page(addr);
975 totalram_pages++;
976 }
977#endif
978}
979
980void free_initmem(void)
981{
982 free_init_pages("unused kernel memory",
983 (unsigned long)(&__init_begin),
984 (unsigned long)(&__init_end));
985}
986
987#ifdef CONFIG_DEBUG_RODATA 984#ifdef CONFIG_DEBUG_RODATA
988const int rodata_test_data = 0xC3; 985const int rodata_test_data = 0xC3;
989EXPORT_SYMBOL_GPL(rodata_test_data); 986EXPORT_SYMBOL_GPL(rodata_test_data);
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index f45d5e29a72e..433f7bd4648a 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -348,7 +348,7 @@ EXPORT_SYMBOL(ioremap_nocache);
348 * 348 *
349 * Must be freed with iounmap. 349 * Must be freed with iounmap.
350 */ 350 */
351void __iomem *ioremap_wc(unsigned long phys_addr, unsigned long size) 351void __iomem *ioremap_wc(resource_size_t phys_addr, unsigned long size)
352{ 352{
353 if (pat_enabled) 353 if (pat_enabled)
354 return __ioremap_caller(phys_addr, size, _PAGE_CACHE_WC, 354 return __ioremap_caller(phys_addr, size, _PAGE_CACHE_WC,
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index 9cab18b0b857..0bcd7883d036 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -9,44 +9,44 @@
9 9
10#include <asm/e820.h> 10#include <asm/e820.h>
11 11
12static void __init memtest(unsigned long start_phys, unsigned long size, 12static u64 patterns[] __initdata = {
13 unsigned pattern) 13 0,
14 0xffffffffffffffffULL,
15 0x5555555555555555ULL,
16 0xaaaaaaaaaaaaaaaaULL,
17 0x1111111111111111ULL,
18 0x2222222222222222ULL,
19 0x4444444444444444ULL,
20 0x8888888888888888ULL,
21 0x3333333333333333ULL,
22 0x6666666666666666ULL,
23 0x9999999999999999ULL,
24 0xccccccccccccccccULL,
25 0x7777777777777777ULL,
26 0xbbbbbbbbbbbbbbbbULL,
27 0xddddddddddddddddULL,
28 0xeeeeeeeeeeeeeeeeULL,
29 0x7a6c7258554e494cULL, /* yeah ;-) */
30};
31
32static void __init reserve_bad_mem(u64 pattern, u64 start_bad, u64 end_bad)
14{ 33{
15 unsigned long i; 34 printk(KERN_INFO " %016llx bad mem addr %010llx - %010llx reserved\n",
16 unsigned long *start; 35 (unsigned long long) pattern,
17 unsigned long start_bad; 36 (unsigned long long) start_bad,
18 unsigned long last_bad; 37 (unsigned long long) end_bad);
19 unsigned long val; 38 reserve_early(start_bad, end_bad, "BAD RAM");
20 unsigned long start_phys_aligned; 39}
21 unsigned long count;
22 unsigned long incr;
23
24 switch (pattern) {
25 case 0:
26 val = 0UL;
27 break;
28 case 1:
29 val = -1UL;
30 break;
31 case 2:
32#ifdef CONFIG_X86_64
33 val = 0x5555555555555555UL;
34#else
35 val = 0x55555555UL;
36#endif
37 break;
38 case 3:
39#ifdef CONFIG_X86_64
40 val = 0xaaaaaaaaaaaaaaaaUL;
41#else
42 val = 0xaaaaaaaaUL;
43#endif
44 break;
45 default:
46 return;
47 }
48 40
49 incr = sizeof(unsigned long); 41static void __init memtest(u64 pattern, u64 start_phys, u64 size)
42{
43 u64 i, count;
44 u64 *start;
45 u64 start_bad, last_bad;
46 u64 start_phys_aligned;
47 size_t incr;
48
49 incr = sizeof(pattern);
50 start_phys_aligned = ALIGN(start_phys, incr); 50 start_phys_aligned = ALIGN(start_phys, incr);
51 count = (size - (start_phys_aligned - start_phys))/incr; 51 count = (size - (start_phys_aligned - start_phys))/incr;
52 start = __va(start_phys_aligned); 52 start = __va(start_phys_aligned);
@@ -54,25 +54,42 @@ static void __init memtest(unsigned long start_phys, unsigned long size,
54 last_bad = 0; 54 last_bad = 0;
55 55
56 for (i = 0; i < count; i++) 56 for (i = 0; i < count; i++)
57 start[i] = val; 57 start[i] = pattern;
58 for (i = 0; i < count; i++, start++, start_phys_aligned += incr) { 58 for (i = 0; i < count; i++, start++, start_phys_aligned += incr) {
59 if (*start != val) { 59 if (*start == pattern)
60 if (start_phys_aligned == last_bad + incr) { 60 continue;
61 last_bad += incr; 61 if (start_phys_aligned == last_bad + incr) {
62 } else { 62 last_bad += incr;
63 if (start_bad) { 63 continue;
64 printk(KERN_CONT "\n %016lx bad mem addr %010lx - %010lx reserved",
65 val, start_bad, last_bad + incr);
66 reserve_early(start_bad, last_bad + incr, "BAD RAM");
67 }
68 start_bad = last_bad = start_phys_aligned;
69 }
70 } 64 }
65 if (start_bad)
66 reserve_bad_mem(pattern, start_bad, last_bad + incr);
67 start_bad = last_bad = start_phys_aligned;
71 } 68 }
72 if (start_bad) { 69 if (start_bad)
73 printk(KERN_CONT "\n %016lx bad mem addr %010lx - %010lx reserved", 70 reserve_bad_mem(pattern, start_bad, last_bad + incr);
74 val, start_bad, last_bad + incr); 71}
75 reserve_early(start_bad, last_bad + incr, "BAD RAM"); 72
73static void __init do_one_pass(u64 pattern, u64 start, u64 end)
74{
75 u64 size = 0;
76
77 while (start < end) {
78 start = find_e820_area_size(start, &size, 1);
79
80 /* done ? */
81 if (start >= end)
82 break;
83 if (start + size > end)
84 size = end - start;
85
86 printk(KERN_INFO " %010llx - %010llx pattern %016llx\n",
87 (unsigned long long) start,
88 (unsigned long long) start + size,
89 (unsigned long long) cpu_to_be64(pattern));
90 memtest(pattern, start, size);
91
92 start += size;
76 } 93 }
77} 94}
78 95
@@ -90,33 +107,22 @@ early_param("memtest", parse_memtest);
90 107
91void __init early_memtest(unsigned long start, unsigned long end) 108void __init early_memtest(unsigned long start, unsigned long end)
92{ 109{
93 u64 t_start, t_size; 110 unsigned int i;
94 unsigned pattern; 111 unsigned int idx = 0;
95 112
96 if (!memtest_pattern) 113 if (!memtest_pattern)
97 return; 114 return;
98 115
99 printk(KERN_INFO "early_memtest: pattern num %d", memtest_pattern); 116 printk(KERN_INFO "early_memtest: # of tests: %d\n", memtest_pattern);
100 for (pattern = 0; pattern < memtest_pattern; pattern++) { 117 for (i = 0; i < memtest_pattern; i++) {
101 t_start = start; 118 idx = i % ARRAY_SIZE(patterns);
102 t_size = 0; 119 do_one_pass(patterns[idx], start, end);
103 while (t_start < end) { 120 }
104 t_start = find_e820_area_size(t_start, &t_size, 1);
105
106 /* done ? */
107 if (t_start >= end)
108 break;
109 if (t_start + t_size > end)
110 t_size = end - t_start;
111
112 printk(KERN_CONT "\n %010llx - %010llx pattern %d",
113 (unsigned long long)t_start,
114 (unsigned long long)t_start + t_size, pattern);
115
116 memtest(t_start, t_size, pattern);
117 121
118 t_start += t_size; 122 if (idx > 0) {
119 } 123 printk(KERN_INFO "early_memtest: wipe out "
124 "test pattern from memory\n");
125 /* additional test with pattern 0 will do this */
126 do_one_pass(0, start, end);
120 } 127 }
121 printk(KERN_CONT "\n");
122} 128}
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index 56fe7124fbec..165829600566 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -4,7 +4,7 @@
4 * Based on code by Ingo Molnar and Andi Kleen, copyrighted 4 * Based on code by Ingo Molnar and Andi Kleen, copyrighted
5 * as follows: 5 * as follows:
6 * 6 *
7 * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. 7 * Copyright 2003-2009 Red Hat Inc.
8 * All Rights Reserved. 8 * All Rights Reserved.
9 * Copyright 2005 Andi Kleen, SUSE Labs. 9 * Copyright 2005 Andi Kleen, SUSE Labs.
10 * Copyright 2007 Jiri Kosina, SUSE Labs. 10 * Copyright 2007 Jiri Kosina, SUSE Labs.
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index d1f7439d173c..451fe95a0352 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -194,7 +194,7 @@ void *alloc_remap(int nid, unsigned long size)
194 size = ALIGN(size, L1_CACHE_BYTES); 194 size = ALIGN(size, L1_CACHE_BYTES);
195 195
196 if (!allocation || (allocation + size) >= node_remap_end_vaddr[nid]) 196 if (!allocation || (allocation + size) >= node_remap_end_vaddr[nid])
197 return 0; 197 return NULL;
198 198
199 node_remap_alloc_vaddr[nid] += size; 199 node_remap_alloc_vaddr[nid] += size;
200 memset(allocation, 0, size); 200 memset(allocation, 0, size);
@@ -423,32 +423,6 @@ void __init initmem_init(unsigned long start_pfn,
423 setup_bootmem_allocator(); 423 setup_bootmem_allocator();
424} 424}
425 425
426void __init set_highmem_pages_init(void)
427{
428#ifdef CONFIG_HIGHMEM
429 struct zone *zone;
430 int nid;
431
432 for_each_zone(zone) {
433 unsigned long zone_start_pfn, zone_end_pfn;
434
435 if (!is_highmem(zone))
436 continue;
437
438 zone_start_pfn = zone->zone_start_pfn;
439 zone_end_pfn = zone_start_pfn + zone->spanned_pages;
440
441 nid = zone_to_nid(zone);
442 printk(KERN_INFO "Initializing %s for node %d (%08lx:%08lx)\n",
443 zone->name, nid, zone_start_pfn, zone_end_pfn);
444
445 add_highpages_with_active_regions(nid, zone_start_pfn,
446 zone_end_pfn);
447 }
448 totalram_pages += totalhigh_pages;
449#endif
450}
451
452#ifdef CONFIG_MEMORY_HOTPLUG 426#ifdef CONFIG_MEMORY_HOTPLUG
453static int paddr_to_nid(u64 addr) 427static int paddr_to_nid(u64 addr)
454{ 428{
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index f3516da035d1..64c9cf043cdd 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -20,6 +20,12 @@
20#include <asm/acpi.h> 20#include <asm/acpi.h>
21#include <asm/k8.h> 21#include <asm/k8.h>
22 22
23#ifdef CONFIG_DEBUG_PER_CPU_MAPS
24# define DBG(x...) printk(KERN_DEBUG x)
25#else
26# define DBG(x...)
27#endif
28
23struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; 29struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
24EXPORT_SYMBOL(node_data); 30EXPORT_SYMBOL(node_data);
25 31
@@ -33,6 +39,21 @@ int numa_off __initdata;
33static unsigned long __initdata nodemap_addr; 39static unsigned long __initdata nodemap_addr;
34static unsigned long __initdata nodemap_size; 40static unsigned long __initdata nodemap_size;
35 41
42DEFINE_PER_CPU(int, node_number) = 0;
43EXPORT_PER_CPU_SYMBOL(node_number);
44
45/*
46 * Map cpu index to node index
47 */
48DEFINE_EARLY_PER_CPU(int, x86_cpu_to_node_map, NUMA_NO_NODE);
49EXPORT_EARLY_PER_CPU_SYMBOL(x86_cpu_to_node_map);
50
51/*
52 * Which logical CPUs are on which nodes
53 */
54cpumask_t *node_to_cpumask_map;
55EXPORT_SYMBOL(node_to_cpumask_map);
56
36/* 57/*
37 * Given a shift value, try to populate memnodemap[] 58 * Given a shift value, try to populate memnodemap[]
38 * Returns : 59 * Returns :
@@ -640,3 +661,199 @@ void __init init_cpu_to_node(void)
640#endif 661#endif
641 662
642 663
664/*
665 * Allocate node_to_cpumask_map based on number of available nodes
666 * Requires node_possible_map to be valid.
667 *
668 * Note: node_to_cpumask() is not valid until after this is done.
669 * (Use CONFIG_DEBUG_PER_CPU_MAPS to check this.)
670 */
671void __init setup_node_to_cpumask_map(void)
672{
673 unsigned int node, num = 0;
674 cpumask_t *map;
675
676 /* setup nr_node_ids if not done yet */
677 if (nr_node_ids == MAX_NUMNODES) {
678 for_each_node_mask(node, node_possible_map)
679 num = node;
680 nr_node_ids = num + 1;
681 }
682
683 /* allocate the map */
684 map = alloc_bootmem_low(nr_node_ids * sizeof(cpumask_t));
685 DBG("node_to_cpumask_map at %p for %d nodes\n", map, nr_node_ids);
686
687 pr_debug("Node to cpumask map at %p for %d nodes\n",
688 map, nr_node_ids);
689
690 /* node_to_cpumask() will now work */
691 node_to_cpumask_map = map;
692}
693
694void __cpuinit numa_set_node(int cpu, int node)
695{
696 int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map);
697
698 /* early setting, no percpu area yet */
699 if (cpu_to_node_map) {
700 cpu_to_node_map[cpu] = node;
701 return;
702 }
703
704#ifdef CONFIG_DEBUG_PER_CPU_MAPS
705 if (cpu >= nr_cpu_ids || !cpu_possible(cpu)) {
706 printk(KERN_ERR "numa_set_node: invalid cpu# (%d)\n", cpu);
707 dump_stack();
708 return;
709 }
710#endif
711 per_cpu(x86_cpu_to_node_map, cpu) = node;
712
713 if (node != NUMA_NO_NODE)
714 per_cpu(node_number, cpu) = node;
715}
716
717void __cpuinit numa_clear_node(int cpu)
718{
719 numa_set_node(cpu, NUMA_NO_NODE);
720}
721
722#ifndef CONFIG_DEBUG_PER_CPU_MAPS
723
724void __cpuinit numa_add_cpu(int cpu)
725{
726 cpu_set(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]);
727}
728
729void __cpuinit numa_remove_cpu(int cpu)
730{
731 cpu_clear(cpu, node_to_cpumask_map[early_cpu_to_node(cpu)]);
732}
733
734#else /* CONFIG_DEBUG_PER_CPU_MAPS */
735
736/*
737 * --------- debug versions of the numa functions ---------
738 */
739static void __cpuinit numa_set_cpumask(int cpu, int enable)
740{
741 int node = early_cpu_to_node(cpu);
742 cpumask_t *mask;
743 char buf[64];
744
745 if (node_to_cpumask_map == NULL) {
746 printk(KERN_ERR "node_to_cpumask_map NULL\n");
747 dump_stack();
748 return;
749 }
750
751 mask = &node_to_cpumask_map[node];
752 if (enable)
753 cpu_set(cpu, *mask);
754 else
755 cpu_clear(cpu, *mask);
756
757 cpulist_scnprintf(buf, sizeof(buf), mask);
758 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
759 enable ? "numa_add_cpu" : "numa_remove_cpu", cpu, node, buf);
760}
761
762void __cpuinit numa_add_cpu(int cpu)
763{
764 numa_set_cpumask(cpu, 1);
765}
766
767void __cpuinit numa_remove_cpu(int cpu)
768{
769 numa_set_cpumask(cpu, 0);
770}
771
772int cpu_to_node(int cpu)
773{
774 if (early_per_cpu_ptr(x86_cpu_to_node_map)) {
775 printk(KERN_WARNING
776 "cpu_to_node(%d): usage too early!\n", cpu);
777 dump_stack();
778 return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
779 }
780 return per_cpu(x86_cpu_to_node_map, cpu);
781}
782EXPORT_SYMBOL(cpu_to_node);
783
784/*
785 * Same function as cpu_to_node() but used if called before the
786 * per_cpu areas are setup.
787 */
788int early_cpu_to_node(int cpu)
789{
790 if (early_per_cpu_ptr(x86_cpu_to_node_map))
791 return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
792
793 if (!cpu_possible(cpu)) {
794 printk(KERN_WARNING
795 "early_cpu_to_node(%d): no per_cpu area!\n", cpu);
796 dump_stack();
797 return NUMA_NO_NODE;
798 }
799 return per_cpu(x86_cpu_to_node_map, cpu);
800}
801
802
803/* empty cpumask */
804static const cpumask_t cpu_mask_none;
805
806/*
807 * Returns a pointer to the bitmask of CPUs on Node 'node'.
808 */
809const cpumask_t *cpumask_of_node(int node)
810{
811 if (node_to_cpumask_map == NULL) {
812 printk(KERN_WARNING
813 "cpumask_of_node(%d): no node_to_cpumask_map!\n",
814 node);
815 dump_stack();
816 return (const cpumask_t *)&cpu_online_map;
817 }
818 if (node >= nr_node_ids) {
819 printk(KERN_WARNING
820 "cpumask_of_node(%d): node > nr_node_ids(%d)\n",
821 node, nr_node_ids);
822 dump_stack();
823 return &cpu_mask_none;
824 }
825 return &node_to_cpumask_map[node];
826}
827EXPORT_SYMBOL(cpumask_of_node);
828
829/*
830 * Returns a bitmask of CPUs on Node 'node'.
831 *
832 * Side note: this function creates the returned cpumask on the stack
833 * so with a high NR_CPUS count, excessive stack space is used. The
834 * node_to_cpumask_ptr function should be used whenever possible.
835 */
836cpumask_t node_to_cpumask(int node)
837{
838 if (node_to_cpumask_map == NULL) {
839 printk(KERN_WARNING
840 "node_to_cpumask(%d): no node_to_cpumask_map!\n", node);
841 dump_stack();
842 return cpu_online_map;
843 }
844 if (node >= nr_node_ids) {
845 printk(KERN_WARNING
846 "node_to_cpumask(%d): node > nr_node_ids(%d)\n",
847 node, nr_node_ids);
848 dump_stack();
849 return cpu_mask_none;
850 }
851 return node_to_cpumask_map[node];
852}
853EXPORT_SYMBOL(node_to_cpumask);
854
855/*
856 * --------- end of debug versions of the numa functions ---------
857 */
858
859#endif /* CONFIG_DEBUG_PER_CPU_MAPS */
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 7233bd7e357b..9c4294986af7 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -482,6 +482,13 @@ static int split_large_page(pte_t *kpte, unsigned long address)
482 pbase = (pte_t *)page_address(base); 482 pbase = (pte_t *)page_address(base);
483 paravirt_alloc_pte(&init_mm, page_to_pfn(base)); 483 paravirt_alloc_pte(&init_mm, page_to_pfn(base));
484 ref_prot = pte_pgprot(pte_clrhuge(*kpte)); 484 ref_prot = pte_pgprot(pte_clrhuge(*kpte));
485 /*
486 * If we ever want to utilize the PAT bit, we need to
487 * update this function to make sure it's converted from
488 * bit 12 to bit 7 when we cross from the 2MB level to
489 * the 4K level:
490 */
491 WARN_ON_ONCE(pgprot_val(ref_prot) & _PAGE_PAT_LARGE);
485 492
486#ifdef CONFIG_X86_64 493#ifdef CONFIG_X86_64
487 if (level == PG_LEVEL_1G) { 494 if (level == PG_LEVEL_1G) {
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index e0ab173b6974..2ed37158012d 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -31,7 +31,7 @@
31#ifdef CONFIG_X86_PAT 31#ifdef CONFIG_X86_PAT
32int __read_mostly pat_enabled = 1; 32int __read_mostly pat_enabled = 1;
33 33
34void __cpuinit pat_disable(char *reason) 34void __cpuinit pat_disable(const char *reason)
35{ 35{
36 pat_enabled = 0; 36 pat_enabled = 0;
37 printk(KERN_INFO "%s\n", reason); 37 printk(KERN_INFO "%s\n", reason);
@@ -43,6 +43,11 @@ static int __init nopat(char *str)
43 return 0; 43 return 0;
44} 44}
45early_param("nopat", nopat); 45early_param("nopat", nopat);
46#else
47static inline void pat_disable(const char *reason)
48{
49 (void)reason;
50}
46#endif 51#endif
47 52
48 53
@@ -79,16 +84,20 @@ void pat_init(void)
79 if (!pat_enabled) 84 if (!pat_enabled)
80 return; 85 return;
81 86
82 /* Paranoia check. */ 87 if (!cpu_has_pat) {
83 if (!cpu_has_pat && boot_pat_state) { 88 if (!boot_pat_state) {
84 /* 89 pat_disable("PAT not supported by CPU.");
85 * If this happens we are on a secondary CPU, but 90 return;
86 * switched to PAT on the boot CPU. We have no way to 91 } else {
87 * undo PAT. 92 /*
88 */ 93 * If this happens we are on a secondary CPU, but
89 printk(KERN_ERR "PAT enabled, " 94 * switched to PAT on the boot CPU. We have no way to
90 "but not supported by secondary CPU\n"); 95 * undo PAT.
91 BUG(); 96 */
97 printk(KERN_ERR "PAT enabled, "
98 "but not supported by secondary CPU\n");
99 BUG();
100 }
92 } 101 }
93 102
94 /* Set PWT to Write-Combining. All other bits stay the same */ 103 /* Set PWT to Write-Combining. All other bits stay the same */
@@ -626,6 +635,33 @@ void unmap_devmem(unsigned long pfn, unsigned long size, pgprot_t vma_prot)
626} 635}
627 636
628/* 637/*
638 * Change the memory type for the physial address range in kernel identity
639 * mapping space if that range is a part of identity map.
640 */
641int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags)
642{
643 unsigned long id_sz;
644
645 if (!pat_enabled || base >= __pa(high_memory))
646 return 0;
647
648 id_sz = (__pa(high_memory) < base + size) ?
649 __pa(high_memory) - base :
650 size;
651
652 if (ioremap_change_attr((unsigned long)__va(base), id_sz, flags) < 0) {
653 printk(KERN_INFO
654 "%s:%d ioremap_change_attr failed %s "
655 "for %Lx-%Lx\n",
656 current->comm, current->pid,
657 cattr_name(flags),
658 base, (unsigned long long)(base + size));
659 return -EINVAL;
660 }
661 return 0;
662}
663
664/*
629 * Internal interface to reserve a range of physical memory with prot. 665 * Internal interface to reserve a range of physical memory with prot.
630 * Reserved non RAM regions only and after successful reserve_memtype, 666 * Reserved non RAM regions only and after successful reserve_memtype,
631 * this func also keeps identity mapping (if any) in sync with this new prot. 667 * this func also keeps identity mapping (if any) in sync with this new prot.
@@ -634,7 +670,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
634 int strict_prot) 670 int strict_prot)
635{ 671{
636 int is_ram = 0; 672 int is_ram = 0;
637 int id_sz, ret; 673 int ret;
638 unsigned long flags; 674 unsigned long flags;
639 unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK); 675 unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK);
640 676
@@ -671,23 +707,8 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
671 flags); 707 flags);
672 } 708 }
673 709
674 /* Need to keep identity mapping in sync */ 710 if (kernel_map_sync_memtype(paddr, size, flags) < 0) {
675 if (paddr >= __pa(high_memory))
676 return 0;
677
678 id_sz = (__pa(high_memory) < paddr + size) ?
679 __pa(high_memory) - paddr :
680 size;
681
682 if (ioremap_change_attr((unsigned long)__va(paddr), id_sz, flags) < 0) {
683 free_memtype(paddr, paddr + size); 711 free_memtype(paddr, paddr + size);
684 printk(KERN_ERR
685 "%s:%d reserve_pfn_range ioremap_change_attr failed %s "
686 "for %Lx-%Lx\n",
687 current->comm, current->pid,
688 cattr_name(flags),
689 (unsigned long long)paddr,
690 (unsigned long long)(paddr + size));
691 return -EINVAL; 712 return -EINVAL;
692 } 713 }
693 return 0; 714 return 0;
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 86f2ffc43c3d..5b7c7c8464fe 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -313,6 +313,24 @@ int ptep_clear_flush_young(struct vm_area_struct *vma,
313 return young; 313 return young;
314} 314}
315 315
316/**
317 * reserve_top_address - reserves a hole in the top of kernel address space
318 * @reserve - size of hole to reserve
319 *
320 * Can be used to relocate the fixmap area and poke a hole in the top
321 * of kernel address space to make room for a hypervisor.
322 */
323void __init reserve_top_address(unsigned long reserve)
324{
325#ifdef CONFIG_X86_32
326 BUG_ON(fixmaps_set > 0);
327 printk(KERN_INFO "Reserving virtual address space above 0x%08x\n",
328 (int)-reserve);
329 __FIXADDR_TOP = -reserve - PAGE_SIZE;
330 __VMALLOC_RESERVE += reserve;
331#endif
332}
333
316int fixmaps_set; 334int fixmaps_set;
317 335
318void __native_set_fixmap(enum fixed_addresses idx, pte_t pte) 336void __native_set_fixmap(enum fixed_addresses idx, pte_t pte)
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index 0951db9ee519..f2e477c91c1b 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -20,6 +20,8 @@
20#include <asm/tlb.h> 20#include <asm/tlb.h>
21#include <asm/tlbflush.h> 21#include <asm/tlbflush.h>
22 22
23unsigned int __VMALLOC_RESERVE = 128 << 20;
24
23/* 25/*
24 * Associate a virtual page frame with a given physical page frame 26 * Associate a virtual page frame with a given physical page frame
25 * and protection flags for that frame. 27 * and protection flags for that frame.
@@ -97,22 +99,6 @@ void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags)
97unsigned long __FIXADDR_TOP = 0xfffff000; 99unsigned long __FIXADDR_TOP = 0xfffff000;
98EXPORT_SYMBOL(__FIXADDR_TOP); 100EXPORT_SYMBOL(__FIXADDR_TOP);
99 101
100/**
101 * reserve_top_address - reserves a hole in the top of kernel address space
102 * @reserve - size of hole to reserve
103 *
104 * Can be used to relocate the fixmap area and poke a hole in the top
105 * of kernel address space to make room for a hypervisor.
106 */
107void __init reserve_top_address(unsigned long reserve)
108{
109 BUG_ON(fixmaps_set > 0);
110 printk(KERN_INFO "Reserving virtual address space above 0x%08x\n",
111 (int)-reserve);
112 __FIXADDR_TOP = -reserve - PAGE_SIZE;
113 __VMALLOC_RESERVE += reserve;
114}
115
116/* 102/*
117 * vmalloc=size forces the vmalloc area to be exactly 'size' 103 * vmalloc=size forces the vmalloc area to be exactly 'size'
118 * bytes. This can be used to increase (or decrease) the 104 * bytes. This can be used to increase (or decrease) the
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 09737c8af074..574c8bc95ef0 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -20,7 +20,8 @@
20#include <asm/proto.h> 20#include <asm/proto.h>
21#include <asm/numa.h> 21#include <asm/numa.h>
22#include <asm/e820.h> 22#include <asm/e820.h>
23#include <asm/genapic.h> 23#include <asm/apic.h>
24#include <asm/uv/uv.h>
24 25
25int acpi_numa __initdata; 26int acpi_numa __initdata;
26 27
diff --git a/arch/x86/kernel/tlb_64.c b/arch/x86/mm/tlb.c
index f8be6f1d2e48..a654d59e4483 100644
--- a/arch/x86/kernel/tlb_64.c
+++ b/arch/x86/mm/tlb.c
@@ -1,24 +1,19 @@
1#include <linux/init.h> 1#include <linux/init.h>
2 2
3#include <linux/mm.h> 3#include <linux/mm.h>
4#include <linux/delay.h>
5#include <linux/spinlock.h> 4#include <linux/spinlock.h>
6#include <linux/smp.h> 5#include <linux/smp.h>
7#include <linux/kernel_stat.h>
8#include <linux/mc146818rtc.h>
9#include <linux/interrupt.h> 6#include <linux/interrupt.h>
7#include <linux/module.h>
10 8
11#include <asm/mtrr.h>
12#include <asm/pgalloc.h>
13#include <asm/tlbflush.h> 9#include <asm/tlbflush.h>
14#include <asm/mmu_context.h> 10#include <asm/mmu_context.h>
15#include <asm/proto.h> 11#include <asm/apic.h>
16#include <asm/apicdef.h> 12#include <asm/uv/uv.h>
17#include <asm/idle.h> 13
18#include <asm/uv/uv_hub.h> 14DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate)
19#include <asm/uv/uv_bau.h> 15 = { &init_mm, 0, };
20 16
21#include <mach_ipi.h>
22/* 17/*
23 * Smarter SMP flushing macros. 18 * Smarter SMP flushing macros.
24 * c/o Linus Torvalds. 19 * c/o Linus Torvalds.
@@ -33,7 +28,7 @@
33 * To avoid global state use 8 different call vectors. 28 * To avoid global state use 8 different call vectors.
34 * Each CPU uses a specific vector to trigger flushes on other 29 * Each CPU uses a specific vector to trigger flushes on other
35 * CPUs. Depending on the received vector the target CPUs look into 30 * CPUs. Depending on the received vector the target CPUs look into
36 * the right per cpu variable for the flush data. 31 * the right array slot for the flush data.
37 * 32 *
38 * With more than 8 CPUs they are hashed to the 8 available 33 * With more than 8 CPUs they are hashed to the 8 available
39 * vectors. The limited global vector space forces us to this right now. 34 * vectors. The limited global vector space forces us to this right now.
@@ -43,18 +38,18 @@
43 38
44union smp_flush_state { 39union smp_flush_state {
45 struct { 40 struct {
46 cpumask_t flush_cpumask;
47 struct mm_struct *flush_mm; 41 struct mm_struct *flush_mm;
48 unsigned long flush_va; 42 unsigned long flush_va;
49 spinlock_t tlbstate_lock; 43 spinlock_t tlbstate_lock;
44 DECLARE_BITMAP(flush_cpumask, NR_CPUS);
50 }; 45 };
51 char pad[SMP_CACHE_BYTES]; 46 char pad[CONFIG_X86_INTERNODE_CACHE_BYTES];
52} ____cacheline_aligned; 47} ____cacheline_internodealigned_in_smp;
53 48
54/* State is put into the per CPU data section, but padded 49/* State is put into the per CPU data section, but padded
55 to a full cache line because other CPUs can access it and we don't 50 to a full cache line because other CPUs can access it and we don't
56 want false sharing in the per cpu data segment. */ 51 want false sharing in the per cpu data segment. */
57static DEFINE_PER_CPU(union smp_flush_state, flush_state); 52static union smp_flush_state flush_state[NUM_INVALIDATE_TLB_VECTORS];
58 53
59/* 54/*
60 * We cannot call mmdrop() because we are in interrupt context, 55 * We cannot call mmdrop() because we are in interrupt context,
@@ -62,9 +57,9 @@ static DEFINE_PER_CPU(union smp_flush_state, flush_state);
62 */ 57 */
63void leave_mm(int cpu) 58void leave_mm(int cpu)
64{ 59{
65 if (read_pda(mmu_state) == TLBSTATE_OK) 60 if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK)
66 BUG(); 61 BUG();
67 cpu_clear(cpu, read_pda(active_mm)->cpu_vm_mask); 62 cpu_clear(cpu, percpu_read(cpu_tlbstate.active_mm)->cpu_vm_mask);
68 load_cr3(swapper_pg_dir); 63 load_cr3(swapper_pg_dir);
69} 64}
70EXPORT_SYMBOL_GPL(leave_mm); 65EXPORT_SYMBOL_GPL(leave_mm);
@@ -117,10 +112,20 @@ EXPORT_SYMBOL_GPL(leave_mm);
117 * Interrupts are disabled. 112 * Interrupts are disabled.
118 */ 113 */
119 114
120asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs) 115/*
116 * FIXME: use of asmlinkage is not consistent. On x86_64 it's noop
117 * but still used for documentation purpose but the usage is slightly
118 * inconsistent. On x86_32, asmlinkage is regparm(0) but interrupt
119 * entry calls in with the first parameter in %eax. Maybe define
120 * intrlinkage?
121 */
122#ifdef CONFIG_X86_64
123asmlinkage
124#endif
125void smp_invalidate_interrupt(struct pt_regs *regs)
121{ 126{
122 int cpu; 127 unsigned int cpu;
123 int sender; 128 unsigned int sender;
124 union smp_flush_state *f; 129 union smp_flush_state *f;
125 130
126 cpu = smp_processor_id(); 131 cpu = smp_processor_id();
@@ -129,9 +134,9 @@ asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs)
129 * Use that to determine where the sender put the data. 134 * Use that to determine where the sender put the data.
130 */ 135 */
131 sender = ~regs->orig_ax - INVALIDATE_TLB_VECTOR_START; 136 sender = ~regs->orig_ax - INVALIDATE_TLB_VECTOR_START;
132 f = &per_cpu(flush_state, sender); 137 f = &flush_state[sender];
133 138
134 if (!cpu_isset(cpu, f->flush_cpumask)) 139 if (!cpumask_test_cpu(cpu, to_cpumask(f->flush_cpumask)))
135 goto out; 140 goto out;
136 /* 141 /*
137 * This was a BUG() but until someone can quote me the 142 * This was a BUG() but until someone can quote me the
@@ -142,8 +147,8 @@ asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs)
142 * BUG(); 147 * BUG();
143 */ 148 */
144 149
145 if (f->flush_mm == read_pda(active_mm)) { 150 if (f->flush_mm == percpu_read(cpu_tlbstate.active_mm)) {
146 if (read_pda(mmu_state) == TLBSTATE_OK) { 151 if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK) {
147 if (f->flush_va == TLB_FLUSH_ALL) 152 if (f->flush_va == TLB_FLUSH_ALL)
148 local_flush_tlb(); 153 local_flush_tlb();
149 else 154 else
@@ -153,23 +158,21 @@ asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs)
153 } 158 }
154out: 159out:
155 ack_APIC_irq(); 160 ack_APIC_irq();
156 cpu_clear(cpu, f->flush_cpumask); 161 smp_mb__before_clear_bit();
162 cpumask_clear_cpu(cpu, to_cpumask(f->flush_cpumask));
163 smp_mb__after_clear_bit();
157 inc_irq_stat(irq_tlb_count); 164 inc_irq_stat(irq_tlb_count);
158} 165}
159 166
160void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, 167static void flush_tlb_others_ipi(const struct cpumask *cpumask,
161 unsigned long va) 168 struct mm_struct *mm, unsigned long va)
162{ 169{
163 int sender; 170 unsigned int sender;
164 union smp_flush_state *f; 171 union smp_flush_state *f;
165 cpumask_t cpumask = *cpumaskp;
166
167 if (is_uv_system() && uv_flush_tlb_others(&cpumask, mm, va))
168 return;
169 172
170 /* Caller has disabled preemption */ 173 /* Caller has disabled preemption */
171 sender = smp_processor_id() % NUM_INVALIDATE_TLB_VECTORS; 174 sender = smp_processor_id() % NUM_INVALIDATE_TLB_VECTORS;
172 f = &per_cpu(flush_state, sender); 175 f = &flush_state[sender];
173 176
174 /* 177 /*
175 * Could avoid this lock when 178 * Could avoid this lock when
@@ -180,7 +183,8 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
180 183
181 f->flush_mm = mm; 184 f->flush_mm = mm;
182 f->flush_va = va; 185 f->flush_va = va;
183 cpus_or(f->flush_cpumask, cpumask, f->flush_cpumask); 186 cpumask_andnot(to_cpumask(f->flush_cpumask),
187 cpumask, cpumask_of(smp_processor_id()));
184 188
185 /* 189 /*
186 * Make the above memory operations globally visible before 190 * Make the above memory operations globally visible before
@@ -191,9 +195,10 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
191 * We have to send the IPI only to 195 * We have to send the IPI only to
192 * CPUs affected. 196 * CPUs affected.
193 */ 197 */
194 send_IPI_mask(&cpumask, INVALIDATE_TLB_VECTOR_START + sender); 198 apic->send_IPI_mask(to_cpumask(f->flush_cpumask),
199 INVALIDATE_TLB_VECTOR_START + sender);
195 200
196 while (!cpus_empty(f->flush_cpumask)) 201 while (!cpumask_empty(to_cpumask(f->flush_cpumask)))
197 cpu_relax(); 202 cpu_relax();
198 203
199 f->flush_mm = NULL; 204 f->flush_mm = NULL;
@@ -201,12 +206,28 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
201 spin_unlock(&f->tlbstate_lock); 206 spin_unlock(&f->tlbstate_lock);
202} 207}
203 208
209void native_flush_tlb_others(const struct cpumask *cpumask,
210 struct mm_struct *mm, unsigned long va)
211{
212 if (is_uv_system()) {
213 unsigned int cpu;
214
215 cpu = get_cpu();
216 cpumask = uv_flush_tlb_others(cpumask, mm, va, cpu);
217 if (cpumask)
218 flush_tlb_others_ipi(cpumask, mm, va);
219 put_cpu();
220 return;
221 }
222 flush_tlb_others_ipi(cpumask, mm, va);
223}
224
204static int __cpuinit init_smp_flush(void) 225static int __cpuinit init_smp_flush(void)
205{ 226{
206 int i; 227 int i;
207 228
208 for_each_possible_cpu(i) 229 for (i = 0; i < ARRAY_SIZE(flush_state); i++)
209 spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock); 230 spin_lock_init(&flush_state[i].tlbstate_lock);
210 231
211 return 0; 232 return 0;
212} 233}
@@ -215,25 +236,18 @@ core_initcall(init_smp_flush);
215void flush_tlb_current_task(void) 236void flush_tlb_current_task(void)
216{ 237{
217 struct mm_struct *mm = current->mm; 238 struct mm_struct *mm = current->mm;
218 cpumask_t cpu_mask;
219 239
220 preempt_disable(); 240 preempt_disable();
221 cpu_mask = mm->cpu_vm_mask;
222 cpu_clear(smp_processor_id(), cpu_mask);
223 241
224 local_flush_tlb(); 242 local_flush_tlb();
225 if (!cpus_empty(cpu_mask)) 243 if (cpumask_any_but(&mm->cpu_vm_mask, smp_processor_id()) < nr_cpu_ids)
226 flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL); 244 flush_tlb_others(&mm->cpu_vm_mask, mm, TLB_FLUSH_ALL);
227 preempt_enable(); 245 preempt_enable();
228} 246}
229 247
230void flush_tlb_mm(struct mm_struct *mm) 248void flush_tlb_mm(struct mm_struct *mm)
231{ 249{
232 cpumask_t cpu_mask;
233
234 preempt_disable(); 250 preempt_disable();
235 cpu_mask = mm->cpu_vm_mask;
236 cpu_clear(smp_processor_id(), cpu_mask);
237 251
238 if (current->active_mm == mm) { 252 if (current->active_mm == mm) {
239 if (current->mm) 253 if (current->mm)
@@ -241,8 +255,8 @@ void flush_tlb_mm(struct mm_struct *mm)
241 else 255 else
242 leave_mm(smp_processor_id()); 256 leave_mm(smp_processor_id());
243 } 257 }
244 if (!cpus_empty(cpu_mask)) 258 if (cpumask_any_but(&mm->cpu_vm_mask, smp_processor_id()) < nr_cpu_ids)
245 flush_tlb_others(cpu_mask, mm, TLB_FLUSH_ALL); 259 flush_tlb_others(&mm->cpu_vm_mask, mm, TLB_FLUSH_ALL);
246 260
247 preempt_enable(); 261 preempt_enable();
248} 262}
@@ -250,11 +264,8 @@ void flush_tlb_mm(struct mm_struct *mm)
250void flush_tlb_page(struct vm_area_struct *vma, unsigned long va) 264void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
251{ 265{
252 struct mm_struct *mm = vma->vm_mm; 266 struct mm_struct *mm = vma->vm_mm;
253 cpumask_t cpu_mask;
254 267
255 preempt_disable(); 268 preempt_disable();
256 cpu_mask = mm->cpu_vm_mask;
257 cpu_clear(smp_processor_id(), cpu_mask);
258 269
259 if (current->active_mm == mm) { 270 if (current->active_mm == mm) {
260 if (current->mm) 271 if (current->mm)
@@ -263,8 +274,8 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long va)
263 leave_mm(smp_processor_id()); 274 leave_mm(smp_processor_id());
264 } 275 }
265 276
266 if (!cpus_empty(cpu_mask)) 277 if (cpumask_any_but(&mm->cpu_vm_mask, smp_processor_id()) < nr_cpu_ids)
267 flush_tlb_others(cpu_mask, mm, va); 278 flush_tlb_others(&mm->cpu_vm_mask, mm, va);
268 279
269 preempt_enable(); 280 preempt_enable();
270} 281}
@@ -274,7 +285,7 @@ static void do_flush_tlb_all(void *info)
274 unsigned long cpu = smp_processor_id(); 285 unsigned long cpu = smp_processor_id();
275 286
276 __flush_tlb_all(); 287 __flush_tlb_all();
277 if (read_pda(mmu_state) == TLBSTATE_LAZY) 288 if (percpu_read(cpu_tlbstate.state) == TLBSTATE_LAZY)
278 leave_mm(cpu); 289 leave_mm(cpu);
279} 290}
280 291
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
index 2089354968a2..8eb295e116f6 100644
--- a/arch/x86/pci/numaq_32.c
+++ b/arch/x86/pci/numaq_32.c
@@ -5,7 +5,7 @@
5#include <linux/pci.h> 5#include <linux/pci.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <mach_apic.h> 8#include <asm/apic.h>
9#include <asm/mpspec.h> 9#include <asm/mpspec.h>
10#include <asm/pci_x86.h> 10#include <asm/pci_x86.h>
11 11
@@ -18,10 +18,6 @@
18 18
19#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local]) 19#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
20 20
21/* Where the IO area was mapped on multiquad, always 0 otherwise */
22void *xquad_portio;
23EXPORT_SYMBOL(xquad_portio);
24
25#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port) 21#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port)
26 22
27#define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \ 23#define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index b82cae970dfd..1c975cc9839e 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -7,7 +7,7 @@
7#include <linux/module.h> 7#include <linux/module.h>
8#include <linux/uaccess.h> 8#include <linux/uaccess.h>
9#include <asm/pci_x86.h> 9#include <asm/pci_x86.h>
10#include <asm/mach-default/pci-functions.h> 10#include <asm/pci-functions.h>
11 11
12/* BIOS32 signature: "_32_" */ 12/* BIOS32 signature: "_32_" */
13#define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24)) 13#define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
diff --git a/arch/x86/power/hibernate_asm_32.S b/arch/x86/power/hibernate_asm_32.S
index d1e9b53f9d33..b641388d8286 100644
--- a/arch/x86/power/hibernate_asm_32.S
+++ b/arch/x86/power/hibernate_asm_32.S
@@ -8,7 +8,7 @@
8 8
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/segment.h> 10#include <asm/segment.h>
11#include <asm/page.h> 11#include <asm/page_types.h>
12#include <asm/asm-offsets.h> 12#include <asm/asm-offsets.h>
13#include <asm/processor-flags.h> 13#include <asm/processor-flags.h>
14 14
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S
index 000415947d93..9356547d8c01 100644
--- a/arch/x86/power/hibernate_asm_64.S
+++ b/arch/x86/power/hibernate_asm_64.S
@@ -18,7 +18,7 @@
18 .text 18 .text
19#include <linux/linkage.h> 19#include <linux/linkage.h>
20#include <asm/segment.h> 20#include <asm/segment.h>
21#include <asm/page.h> 21#include <asm/page_types.h>
22#include <asm/asm-offsets.h> 22#include <asm/asm-offsets.h>
23#include <asm/processor-flags.h> 23#include <asm/processor-flags.h>
24 24
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 4d6ef0a336d6..16a9020c8f11 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -38,7 +38,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
38 $(call if_changed,objcopy) 38 $(call if_changed,objcopy)
39 39
40CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \ 40CFL := $(PROFILING) -mcmodel=small -fPIC -O2 -fasynchronous-unwind-tables -m64 \
41 $(filter -g%,$(KBUILD_CFLAGS)) 41 $(filter -g%,$(KBUILD_CFLAGS)) $(call cc-option, -fno-stack-protector)
42 42
43$(vobjs): KBUILD_CFLAGS += $(CFL) 43$(vobjs): KBUILD_CFLAGS += $(CFL)
44 44
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index 9c98cc6ba978..7133cdf9098b 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -85,8 +85,8 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
85 unsigned long addr, end; 85 unsigned long addr, end;
86 unsigned offset; 86 unsigned offset;
87 end = (start + PMD_SIZE - 1) & PMD_MASK; 87 end = (start + PMD_SIZE - 1) & PMD_MASK;
88 if (end >= TASK_SIZE64) 88 if (end >= TASK_SIZE_MAX)
89 end = TASK_SIZE64; 89 end = TASK_SIZE_MAX;
90 end -= len; 90 end -= len;
91 /* This loses some more bits than a modulo, but is cheaper */ 91 /* This loses some more bits than a modulo, but is cheaper */
92 offset = get_random_int() & (PTRS_PER_PTE - 1); 92 offset = get_random_int() & (PTRS_PER_PTE - 1);
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index 87b9ab166423..b83e119fbeb0 100644
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -6,7 +6,7 @@ config XEN
6 bool "Xen guest support" 6 bool "Xen guest support"
7 select PARAVIRT 7 select PARAVIRT
8 select PARAVIRT_CLOCK 8 select PARAVIRT_CLOCK
9 depends on X86_64 || (X86_32 && X86_PAE && !(X86_VISWS || X86_VOYAGER)) 9 depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS)
10 depends on X86_CMPXCHG && X86_TSC 10 depends on X86_CMPXCHG && X86_TSC
11 help 11 help
12 This is the Linux Xen port. Enabling this will allow the 12 This is the Linux Xen port. Enabling this will allow the
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 6dcefba7836f..3b767d03fd6a 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -6,7 +6,8 @@ CFLAGS_REMOVE_irq.o = -pg
6endif 6endif
7 7
8obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ 8obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \
9 time.o xen-asm_$(BITS).o grant-table.o suspend.o 9 time.o xen-asm.o xen-asm_$(BITS).o \
10 grant-table.o suspend.o
10 11
11obj-$(CONFIG_SMP) += smp.o spinlock.o 12obj-$(CONFIG_SMP) += smp.o spinlock.o
12obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o \ No newline at end of file 13obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o \ No newline at end of file
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index b58e96338149..82cd39a6cbd3 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -61,40 +61,13 @@ DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
61enum xen_domain_type xen_domain_type = XEN_NATIVE; 61enum xen_domain_type xen_domain_type = XEN_NATIVE;
62EXPORT_SYMBOL_GPL(xen_domain_type); 62EXPORT_SYMBOL_GPL(xen_domain_type);
63 63
64/*
65 * Identity map, in addition to plain kernel map. This needs to be
66 * large enough to allocate page table pages to allocate the rest.
67 * Each page can map 2MB.
68 */
69static pte_t level1_ident_pgt[PTRS_PER_PTE * 4] __page_aligned_bss;
70
71#ifdef CONFIG_X86_64
72/* l3 pud for userspace vsyscall mapping */
73static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
74#endif /* CONFIG_X86_64 */
75
76/*
77 * Note about cr3 (pagetable base) values:
78 *
79 * xen_cr3 contains the current logical cr3 value; it contains the
80 * last set cr3. This may not be the current effective cr3, because
81 * its update may be being lazily deferred. However, a vcpu looking
82 * at its own cr3 can use this value knowing that it everything will
83 * be self-consistent.
84 *
85 * xen_current_cr3 contains the actual vcpu cr3; it is set once the
86 * hypercall to set the vcpu cr3 is complete (so it may be a little
87 * out of date, but it will never be set early). If one vcpu is
88 * looking at another vcpu's cr3 value, it should use this variable.
89 */
90DEFINE_PER_CPU(unsigned long, xen_cr3); /* cr3 stored as physaddr */
91DEFINE_PER_CPU(unsigned long, xen_current_cr3); /* actual vcpu cr3 */
92
93struct start_info *xen_start_info; 64struct start_info *xen_start_info;
94EXPORT_SYMBOL_GPL(xen_start_info); 65EXPORT_SYMBOL_GPL(xen_start_info);
95 66
96struct shared_info xen_dummy_shared_info; 67struct shared_info xen_dummy_shared_info;
97 68
69void *xen_initial_gdt;
70
98/* 71/*
99 * Point at some empty memory to start with. We map the real shared_info 72 * Point at some empty memory to start with. We map the real shared_info
100 * page as soon as fixmap is up and running. 73 * page as soon as fixmap is up and running.
@@ -114,14 +87,7 @@ struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info;
114 * 87 *
115 * 0: not available, 1: available 88 * 0: not available, 1: available
116 */ 89 */
117static int have_vcpu_info_placement = 90static int have_vcpu_info_placement = 1;
118#ifdef CONFIG_X86_32
119 1
120#else
121 0
122#endif
123 ;
124
125 91
126static void xen_vcpu_setup(int cpu) 92static void xen_vcpu_setup(int cpu)
127{ 93{
@@ -137,7 +103,7 @@ static void xen_vcpu_setup(int cpu)
137 103
138 vcpup = &per_cpu(xen_vcpu_info, cpu); 104 vcpup = &per_cpu(xen_vcpu_info, cpu);
139 105
140 info.mfn = virt_to_mfn(vcpup); 106 info.mfn = arbitrary_virt_to_mfn(vcpup);
141 info.offset = offset_in_page(vcpup); 107 info.offset = offset_in_page(vcpup);
142 108
143 printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %llx, offset %d\n", 109 printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %llx, offset %d\n",
@@ -237,7 +203,7 @@ static unsigned long xen_get_debugreg(int reg)
237 return HYPERVISOR_get_debugreg(reg); 203 return HYPERVISOR_get_debugreg(reg);
238} 204}
239 205
240static void xen_leave_lazy(void) 206void xen_leave_lazy(void)
241{ 207{
242 paravirt_leave_lazy(paravirt_get_lazy_mode()); 208 paravirt_leave_lazy(paravirt_get_lazy_mode());
243 xen_mc_flush(); 209 xen_mc_flush();
@@ -335,8 +301,10 @@ static void xen_load_gdt(const struct desc_ptr *dtr)
335 frames = mcs.args; 301 frames = mcs.args;
336 302
337 for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) { 303 for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
338 frames[f] = virt_to_mfn(va); 304 frames[f] = arbitrary_virt_to_mfn((void *)va);
305
339 make_lowmem_page_readonly((void *)va); 306 make_lowmem_page_readonly((void *)va);
307 make_lowmem_page_readonly(mfn_to_virt(frames[f]));
340 } 308 }
341 309
342 MULTI_set_gdt(mcs.mc, frames, size / sizeof(struct desc_struct)); 310 MULTI_set_gdt(mcs.mc, frames, size / sizeof(struct desc_struct));
@@ -348,7 +316,7 @@ static void load_TLS_descriptor(struct thread_struct *t,
348 unsigned int cpu, unsigned int i) 316 unsigned int cpu, unsigned int i)
349{ 317{
350 struct desc_struct *gdt = get_cpu_gdt_table(cpu); 318 struct desc_struct *gdt = get_cpu_gdt_table(cpu);
351 xmaddr_t maddr = virt_to_machine(&gdt[GDT_ENTRY_TLS_MIN+i]); 319 xmaddr_t maddr = arbitrary_virt_to_machine(&gdt[GDT_ENTRY_TLS_MIN+i]);
352 struct multicall_space mc = __xen_mc_entry(0); 320 struct multicall_space mc = __xen_mc_entry(0);
353 321
354 MULTI_update_descriptor(mc.mc, maddr.maddr, t->tls_array[i]); 322 MULTI_update_descriptor(mc.mc, maddr.maddr, t->tls_array[i]);
@@ -357,13 +325,14 @@ static void load_TLS_descriptor(struct thread_struct *t,
357static void xen_load_tls(struct thread_struct *t, unsigned int cpu) 325static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
358{ 326{
359 /* 327 /*
360 * XXX sleazy hack: If we're being called in a lazy-cpu zone, 328 * XXX sleazy hack: If we're being called in a lazy-cpu zone
361 * it means we're in a context switch, and %gs has just been 329 * and lazy gs handling is enabled, it means we're in a
362 * saved. This means we can zero it out to prevent faults on 330 * context switch, and %gs has just been saved. This means we
363 * exit from the hypervisor if the next process has no %gs. 331 * can zero it out to prevent faults on exit from the
364 * Either way, it has been saved, and the new value will get 332 * hypervisor if the next process has no %gs. Either way, it
365 * loaded properly. This will go away as soon as Xen has been 333 * has been saved, and the new value will get loaded properly.
366 * modified to not save/restore %gs for normal hypercalls. 334 * This will go away as soon as Xen has been modified to not
335 * save/restore %gs for normal hypercalls.
367 * 336 *
368 * On x86_64, this hack is not used for %gs, because gs points 337 * On x86_64, this hack is not used for %gs, because gs points
369 * to KERNEL_GS_BASE (and uses it for PDA references), so we 338 * to KERNEL_GS_BASE (and uses it for PDA references), so we
@@ -375,7 +344,7 @@ static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
375 */ 344 */
376 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU) { 345 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU) {
377#ifdef CONFIG_X86_32 346#ifdef CONFIG_X86_32
378 loadsegment(gs, 0); 347 lazy_load_gs(0);
379#else 348#else
380 loadsegment(fs, 0); 349 loadsegment(fs, 0);
381#endif 350#endif
@@ -521,7 +490,7 @@ static void xen_write_gdt_entry(struct desc_struct *dt, int entry,
521 break; 490 break;
522 491
523 default: { 492 default: {
524 xmaddr_t maddr = virt_to_machine(&dt[entry]); 493 xmaddr_t maddr = arbitrary_virt_to_machine(&dt[entry]);
525 494
526 xen_mc_flush(); 495 xen_mc_flush();
527 if (HYPERVISOR_update_descriptor(maddr.maddr, *(u64 *)desc)) 496 if (HYPERVISOR_update_descriptor(maddr.maddr, *(u64 *)desc))
@@ -587,94 +556,18 @@ static u32 xen_safe_apic_wait_icr_idle(void)
587 return 0; 556 return 0;
588} 557}
589 558
590static struct apic_ops xen_basic_apic_ops = { 559static void set_xen_basic_apic_ops(void)
591 .read = xen_apic_read,
592 .write = xen_apic_write,
593 .icr_read = xen_apic_icr_read,
594 .icr_write = xen_apic_icr_write,
595 .wait_icr_idle = xen_apic_wait_icr_idle,
596 .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle,
597};
598
599#endif
600
601static void xen_flush_tlb(void)
602{
603 struct mmuext_op *op;
604 struct multicall_space mcs;
605
606 preempt_disable();
607
608 mcs = xen_mc_entry(sizeof(*op));
609
610 op = mcs.args;
611 op->cmd = MMUEXT_TLB_FLUSH_LOCAL;
612 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
613
614 xen_mc_issue(PARAVIRT_LAZY_MMU);
615
616 preempt_enable();
617}
618
619static void xen_flush_tlb_single(unsigned long addr)
620{ 560{
621 struct mmuext_op *op; 561 apic->read = xen_apic_read;
622 struct multicall_space mcs; 562 apic->write = xen_apic_write;
623 563 apic->icr_read = xen_apic_icr_read;
624 preempt_disable(); 564 apic->icr_write = xen_apic_icr_write;
625 565 apic->wait_icr_idle = xen_apic_wait_icr_idle;
626 mcs = xen_mc_entry(sizeof(*op)); 566 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;
627 op = mcs.args;
628 op->cmd = MMUEXT_INVLPG_LOCAL;
629 op->arg1.linear_addr = addr & PAGE_MASK;
630 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
631
632 xen_mc_issue(PARAVIRT_LAZY_MMU);
633
634 preempt_enable();
635} 567}
636 568
637static void xen_flush_tlb_others(const cpumask_t *cpus, struct mm_struct *mm, 569#endif
638 unsigned long va)
639{
640 struct {
641 struct mmuext_op op;
642 cpumask_t mask;
643 } *args;
644 cpumask_t cpumask = *cpus;
645 struct multicall_space mcs;
646
647 /*
648 * A couple of (to be removed) sanity checks:
649 *
650 * - current CPU must not be in mask
651 * - mask must exist :)
652 */
653 BUG_ON(cpus_empty(cpumask));
654 BUG_ON(cpu_isset(smp_processor_id(), cpumask));
655 BUG_ON(!mm);
656
657 /* If a CPU which we ran on has gone down, OK. */
658 cpus_and(cpumask, cpumask, cpu_online_map);
659 if (cpus_empty(cpumask))
660 return;
661
662 mcs = xen_mc_entry(sizeof(*args));
663 args = mcs.args;
664 args->mask = cpumask;
665 args->op.arg2.vcpumask = &args->mask;
666
667 if (va == TLB_FLUSH_ALL) {
668 args->op.cmd = MMUEXT_TLB_FLUSH_MULTI;
669 } else {
670 args->op.cmd = MMUEXT_INVLPG_MULTI;
671 args->op.arg1.linear_addr = va;
672 }
673
674 MULTI_mmuext_op(mcs.mc, &args->op, 1, NULL, DOMID_SELF);
675 570
676 xen_mc_issue(PARAVIRT_LAZY_MMU);
677}
678 571
679static void xen_clts(void) 572static void xen_clts(void)
680{ 573{
@@ -700,21 +593,6 @@ static void xen_write_cr0(unsigned long cr0)
700 xen_mc_issue(PARAVIRT_LAZY_CPU); 593 xen_mc_issue(PARAVIRT_LAZY_CPU);
701} 594}
702 595
703static void xen_write_cr2(unsigned long cr2)
704{
705 x86_read_percpu(xen_vcpu)->arch.cr2 = cr2;
706}
707
708static unsigned long xen_read_cr2(void)
709{
710 return x86_read_percpu(xen_vcpu)->arch.cr2;
711}
712
713static unsigned long xen_read_cr2_direct(void)
714{
715 return x86_read_percpu(xen_vcpu_info.arch.cr2);
716}
717
718static void xen_write_cr4(unsigned long cr4) 596static void xen_write_cr4(unsigned long cr4)
719{ 597{
720 cr4 &= ~X86_CR4_PGE; 598 cr4 &= ~X86_CR4_PGE;
@@ -723,71 +601,6 @@ static void xen_write_cr4(unsigned long cr4)
723 native_write_cr4(cr4); 601 native_write_cr4(cr4);
724} 602}
725 603
726static unsigned long xen_read_cr3(void)
727{
728 return x86_read_percpu(xen_cr3);
729}
730
731static void set_current_cr3(void *v)
732{
733 x86_write_percpu(xen_current_cr3, (unsigned long)v);
734}
735
736static void __xen_write_cr3(bool kernel, unsigned long cr3)
737{
738 struct mmuext_op *op;
739 struct multicall_space mcs;
740 unsigned long mfn;
741
742 if (cr3)
743 mfn = pfn_to_mfn(PFN_DOWN(cr3));
744 else
745 mfn = 0;
746
747 WARN_ON(mfn == 0 && kernel);
748
749 mcs = __xen_mc_entry(sizeof(*op));
750
751 op = mcs.args;
752 op->cmd = kernel ? MMUEXT_NEW_BASEPTR : MMUEXT_NEW_USER_BASEPTR;
753 op->arg1.mfn = mfn;
754
755 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
756
757 if (kernel) {
758 x86_write_percpu(xen_cr3, cr3);
759
760 /* Update xen_current_cr3 once the batch has actually
761 been submitted. */
762 xen_mc_callback(set_current_cr3, (void *)cr3);
763 }
764}
765
766static void xen_write_cr3(unsigned long cr3)
767{
768 BUG_ON(preemptible());
769
770 xen_mc_batch(); /* disables interrupts */
771
772 /* Update while interrupts are disabled, so its atomic with
773 respect to ipis */
774 x86_write_percpu(xen_cr3, cr3);
775
776 __xen_write_cr3(true, cr3);
777
778#ifdef CONFIG_X86_64
779 {
780 pgd_t *user_pgd = xen_get_user_pgd(__va(cr3));
781 if (user_pgd)
782 __xen_write_cr3(false, __pa(user_pgd));
783 else
784 __xen_write_cr3(false, 0);
785 }
786#endif
787
788 xen_mc_issue(PARAVIRT_LAZY_CPU); /* interrupts restored */
789}
790
791static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high) 604static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
792{ 605{
793 int ret; 606 int ret;
@@ -829,185 +642,6 @@ static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)
829 return ret; 642 return ret;
830} 643}
831 644
832/* Early in boot, while setting up the initial pagetable, assume
833 everything is pinned. */
834static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)
835{
836#ifdef CONFIG_FLATMEM
837 BUG_ON(mem_map); /* should only be used early */
838#endif
839 make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
840}
841
842/* Early release_pte assumes that all pts are pinned, since there's
843 only init_mm and anything attached to that is pinned. */
844static void xen_release_pte_init(unsigned long pfn)
845{
846 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
847}
848
849static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
850{
851 struct mmuext_op op;
852 op.cmd = cmd;
853 op.arg1.mfn = pfn_to_mfn(pfn);
854 if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
855 BUG();
856}
857
858/* This needs to make sure the new pte page is pinned iff its being
859 attached to a pinned pagetable. */
860static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned level)
861{
862 struct page *page = pfn_to_page(pfn);
863
864 if (PagePinned(virt_to_page(mm->pgd))) {
865 SetPagePinned(page);
866
867 vm_unmap_aliases();
868 if (!PageHighMem(page)) {
869 make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn)));
870 if (level == PT_PTE && USE_SPLIT_PTLOCKS)
871 pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn);
872 } else {
873 /* make sure there are no stray mappings of
874 this page */
875 kmap_flush_unused();
876 }
877 }
878}
879
880static void xen_alloc_pte(struct mm_struct *mm, unsigned long pfn)
881{
882 xen_alloc_ptpage(mm, pfn, PT_PTE);
883}
884
885static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
886{
887 xen_alloc_ptpage(mm, pfn, PT_PMD);
888}
889
890static int xen_pgd_alloc(struct mm_struct *mm)
891{
892 pgd_t *pgd = mm->pgd;
893 int ret = 0;
894
895 BUG_ON(PagePinned(virt_to_page(pgd)));
896
897#ifdef CONFIG_X86_64
898 {
899 struct page *page = virt_to_page(pgd);
900 pgd_t *user_pgd;
901
902 BUG_ON(page->private != 0);
903
904 ret = -ENOMEM;
905
906 user_pgd = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
907 page->private = (unsigned long)user_pgd;
908
909 if (user_pgd != NULL) {
910 user_pgd[pgd_index(VSYSCALL_START)] =
911 __pgd(__pa(level3_user_vsyscall) | _PAGE_TABLE);
912 ret = 0;
913 }
914
915 BUG_ON(PagePinned(virt_to_page(xen_get_user_pgd(pgd))));
916 }
917#endif
918
919 return ret;
920}
921
922static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd)
923{
924#ifdef CONFIG_X86_64
925 pgd_t *user_pgd = xen_get_user_pgd(pgd);
926
927 if (user_pgd)
928 free_page((unsigned long)user_pgd);
929#endif
930}
931
932/* This should never happen until we're OK to use struct page */
933static void xen_release_ptpage(unsigned long pfn, unsigned level)
934{
935 struct page *page = pfn_to_page(pfn);
936
937 if (PagePinned(page)) {
938 if (!PageHighMem(page)) {
939 if (level == PT_PTE && USE_SPLIT_PTLOCKS)
940 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn);
941 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
942 }
943 ClearPagePinned(page);
944 }
945}
946
947static void xen_release_pte(unsigned long pfn)
948{
949 xen_release_ptpage(pfn, PT_PTE);
950}
951
952static void xen_release_pmd(unsigned long pfn)
953{
954 xen_release_ptpage(pfn, PT_PMD);
955}
956
957#if PAGETABLE_LEVELS == 4
958static void xen_alloc_pud(struct mm_struct *mm, unsigned long pfn)
959{
960 xen_alloc_ptpage(mm, pfn, PT_PUD);
961}
962
963static void xen_release_pud(unsigned long pfn)
964{
965 xen_release_ptpage(pfn, PT_PUD);
966}
967#endif
968
969#ifdef CONFIG_HIGHPTE
970static void *xen_kmap_atomic_pte(struct page *page, enum km_type type)
971{
972 pgprot_t prot = PAGE_KERNEL;
973
974 if (PagePinned(page))
975 prot = PAGE_KERNEL_RO;
976
977 if (0 && PageHighMem(page))
978 printk("mapping highpte %lx type %d prot %s\n",
979 page_to_pfn(page), type,
980 (unsigned long)pgprot_val(prot) & _PAGE_RW ? "WRITE" : "READ");
981
982 return kmap_atomic_prot(page, type, prot);
983}
984#endif
985
986#ifdef CONFIG_X86_32
987static __init pte_t mask_rw_pte(pte_t *ptep, pte_t pte)
988{
989 /* If there's an existing pte, then don't allow _PAGE_RW to be set */
990 if (pte_val_ma(*ptep) & _PAGE_PRESENT)
991 pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) &
992 pte_val_ma(pte));
993
994 return pte;
995}
996
997/* Init-time set_pte while constructing initial pagetables, which
998 doesn't allow RO pagetable pages to be remapped RW */
999static __init void xen_set_pte_init(pte_t *ptep, pte_t pte)
1000{
1001 pte = mask_rw_pte(ptep, pte);
1002
1003 xen_set_pte(ptep, pte);
1004}
1005#endif
1006
1007static __init void xen_pagetable_setup_start(pgd_t *base)
1008{
1009}
1010
1011void xen_setup_shared_info(void) 645void xen_setup_shared_info(void)
1012{ 646{
1013 if (!xen_feature(XENFEAT_auto_translated_physmap)) { 647 if (!xen_feature(XENFEAT_auto_translated_physmap)) {
@@ -1028,37 +662,6 @@ void xen_setup_shared_info(void)
1028 xen_setup_mfn_list_list(); 662 xen_setup_mfn_list_list();
1029} 663}
1030 664
1031static __init void xen_pagetable_setup_done(pgd_t *base)
1032{
1033 xen_setup_shared_info();
1034}
1035
1036static __init void xen_post_allocator_init(void)
1037{
1038 pv_mmu_ops.set_pte = xen_set_pte;
1039 pv_mmu_ops.set_pmd = xen_set_pmd;
1040 pv_mmu_ops.set_pud = xen_set_pud;
1041#if PAGETABLE_LEVELS == 4
1042 pv_mmu_ops.set_pgd = xen_set_pgd;
1043#endif
1044
1045 /* This will work as long as patching hasn't happened yet
1046 (which it hasn't) */
1047 pv_mmu_ops.alloc_pte = xen_alloc_pte;
1048 pv_mmu_ops.alloc_pmd = xen_alloc_pmd;
1049 pv_mmu_ops.release_pte = xen_release_pte;
1050 pv_mmu_ops.release_pmd = xen_release_pmd;
1051#if PAGETABLE_LEVELS == 4
1052 pv_mmu_ops.alloc_pud = xen_alloc_pud;
1053 pv_mmu_ops.release_pud = xen_release_pud;
1054#endif
1055
1056#ifdef CONFIG_X86_64
1057 SetPagePinned(virt_to_page(level3_user_vsyscall));
1058#endif
1059 xen_mark_init_mm_pinned();
1060}
1061
1062/* This is called once we have the cpu_possible_map */ 665/* This is called once we have the cpu_possible_map */
1063void xen_setup_vcpu_info_placement(void) 666void xen_setup_vcpu_info_placement(void)
1064{ 667{
@@ -1072,10 +675,10 @@ void xen_setup_vcpu_info_placement(void)
1072 if (have_vcpu_info_placement) { 675 if (have_vcpu_info_placement) {
1073 printk(KERN_INFO "Xen: using vcpu_info placement\n"); 676 printk(KERN_INFO "Xen: using vcpu_info placement\n");
1074 677
1075 pv_irq_ops.save_fl = xen_save_fl_direct; 678 pv_irq_ops.save_fl = __PV_IS_CALLEE_SAVE(xen_save_fl_direct);
1076 pv_irq_ops.restore_fl = xen_restore_fl_direct; 679 pv_irq_ops.restore_fl = __PV_IS_CALLEE_SAVE(xen_restore_fl_direct);
1077 pv_irq_ops.irq_disable = xen_irq_disable_direct; 680 pv_irq_ops.irq_disable = __PV_IS_CALLEE_SAVE(xen_irq_disable_direct);
1078 pv_irq_ops.irq_enable = xen_irq_enable_direct; 681 pv_irq_ops.irq_enable = __PV_IS_CALLEE_SAVE(xen_irq_enable_direct);
1079 pv_mmu_ops.read_cr2 = xen_read_cr2_direct; 682 pv_mmu_ops.read_cr2 = xen_read_cr2_direct;
1080 } 683 }
1081} 684}
@@ -1133,49 +736,6 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf,
1133 return ret; 736 return ret;
1134} 737}
1135 738
1136static void xen_set_fixmap(unsigned idx, unsigned long phys, pgprot_t prot)
1137{
1138 pte_t pte;
1139
1140 phys >>= PAGE_SHIFT;
1141
1142 switch (idx) {
1143 case FIX_BTMAP_END ... FIX_BTMAP_BEGIN:
1144#ifdef CONFIG_X86_F00F_BUG
1145 case FIX_F00F_IDT:
1146#endif
1147#ifdef CONFIG_X86_32
1148 case FIX_WP_TEST:
1149 case FIX_VDSO:
1150# ifdef CONFIG_HIGHMEM
1151 case FIX_KMAP_BEGIN ... FIX_KMAP_END:
1152# endif
1153#else
1154 case VSYSCALL_LAST_PAGE ... VSYSCALL_FIRST_PAGE:
1155#endif
1156#ifdef CONFIG_X86_LOCAL_APIC
1157 case FIX_APIC_BASE: /* maps dummy local APIC */
1158#endif
1159 pte = pfn_pte(phys, prot);
1160 break;
1161
1162 default:
1163 pte = mfn_pte(phys, prot);
1164 break;
1165 }
1166
1167 __native_set_fixmap(idx, pte);
1168
1169#ifdef CONFIG_X86_64
1170 /* Replicate changes to map the vsyscall page into the user
1171 pagetable vsyscall mapping. */
1172 if (idx >= VSYSCALL_LAST_PAGE && idx <= VSYSCALL_FIRST_PAGE) {
1173 unsigned long vaddr = __fix_to_virt(idx);
1174 set_pte_vaddr_pud(level3_user_vsyscall, vaddr, pte);
1175 }
1176#endif
1177}
1178
1179static const struct pv_info xen_info __initdata = { 739static const struct pv_info xen_info __initdata = {
1180 .paravirt_enabled = 1, 740 .paravirt_enabled = 1,
1181 .shared_kernel_pmd = 0, 741 .shared_kernel_pmd = 0,
@@ -1271,87 +831,6 @@ static const struct pv_apic_ops xen_apic_ops __initdata = {
1271#endif 831#endif
1272}; 832};
1273 833
1274static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1275 .pagetable_setup_start = xen_pagetable_setup_start,
1276 .pagetable_setup_done = xen_pagetable_setup_done,
1277
1278 .read_cr2 = xen_read_cr2,
1279 .write_cr2 = xen_write_cr2,
1280
1281 .read_cr3 = xen_read_cr3,
1282 .write_cr3 = xen_write_cr3,
1283
1284 .flush_tlb_user = xen_flush_tlb,
1285 .flush_tlb_kernel = xen_flush_tlb,
1286 .flush_tlb_single = xen_flush_tlb_single,
1287 .flush_tlb_others = xen_flush_tlb_others,
1288
1289 .pte_update = paravirt_nop,
1290 .pte_update_defer = paravirt_nop,
1291
1292 .pgd_alloc = xen_pgd_alloc,
1293 .pgd_free = xen_pgd_free,
1294
1295 .alloc_pte = xen_alloc_pte_init,
1296 .release_pte = xen_release_pte_init,
1297 .alloc_pmd = xen_alloc_pte_init,
1298 .alloc_pmd_clone = paravirt_nop,
1299 .release_pmd = xen_release_pte_init,
1300
1301#ifdef CONFIG_HIGHPTE
1302 .kmap_atomic_pte = xen_kmap_atomic_pte,
1303#endif
1304
1305#ifdef CONFIG_X86_64
1306 .set_pte = xen_set_pte,
1307#else
1308 .set_pte = xen_set_pte_init,
1309#endif
1310 .set_pte_at = xen_set_pte_at,
1311 .set_pmd = xen_set_pmd_hyper,
1312
1313 .ptep_modify_prot_start = __ptep_modify_prot_start,
1314 .ptep_modify_prot_commit = __ptep_modify_prot_commit,
1315
1316 .pte_val = xen_pte_val,
1317 .pte_flags = native_pte_flags,
1318 .pgd_val = xen_pgd_val,
1319
1320 .make_pte = xen_make_pte,
1321 .make_pgd = xen_make_pgd,
1322
1323#ifdef CONFIG_X86_PAE
1324 .set_pte_atomic = xen_set_pte_atomic,
1325 .set_pte_present = xen_set_pte_at,
1326 .pte_clear = xen_pte_clear,
1327 .pmd_clear = xen_pmd_clear,
1328#endif /* CONFIG_X86_PAE */
1329 .set_pud = xen_set_pud_hyper,
1330
1331 .make_pmd = xen_make_pmd,
1332 .pmd_val = xen_pmd_val,
1333
1334#if PAGETABLE_LEVELS == 4
1335 .pud_val = xen_pud_val,
1336 .make_pud = xen_make_pud,
1337 .set_pgd = xen_set_pgd_hyper,
1338
1339 .alloc_pud = xen_alloc_pte_init,
1340 .release_pud = xen_release_pte_init,
1341#endif /* PAGETABLE_LEVELS == 4 */
1342
1343 .activate_mm = xen_activate_mm,
1344 .dup_mmap = xen_dup_mmap,
1345 .exit_mmap = xen_exit_mmap,
1346
1347 .lazy_mode = {
1348 .enter = paravirt_enter_lazy_mmu,
1349 .leave = xen_leave_lazy,
1350 },
1351
1352 .set_fixmap = xen_set_fixmap,
1353};
1354
1355static void xen_reboot(int reason) 834static void xen_reboot(int reason)
1356{ 835{
1357 struct sched_shutdown r = { .reason = reason }; 836 struct sched_shutdown r = { .reason = reason };
@@ -1394,223 +873,6 @@ static const struct machine_ops __initdata xen_machine_ops = {
1394}; 873};
1395 874
1396 875
1397static void __init xen_reserve_top(void)
1398{
1399#ifdef CONFIG_X86_32
1400 unsigned long top = HYPERVISOR_VIRT_START;
1401 struct xen_platform_parameters pp;
1402
1403 if (HYPERVISOR_xen_version(XENVER_platform_parameters, &pp) == 0)
1404 top = pp.virt_start;
1405
1406 reserve_top_address(-top);
1407#endif /* CONFIG_X86_32 */
1408}
1409
1410/*
1411 * Like __va(), but returns address in the kernel mapping (which is
1412 * all we have until the physical memory mapping has been set up.
1413 */
1414static void *__ka(phys_addr_t paddr)
1415{
1416#ifdef CONFIG_X86_64
1417 return (void *)(paddr + __START_KERNEL_map);
1418#else
1419 return __va(paddr);
1420#endif
1421}
1422
1423/* Convert a machine address to physical address */
1424static unsigned long m2p(phys_addr_t maddr)
1425{
1426 phys_addr_t paddr;
1427
1428 maddr &= PTE_PFN_MASK;
1429 paddr = mfn_to_pfn(maddr >> PAGE_SHIFT) << PAGE_SHIFT;
1430
1431 return paddr;
1432}
1433
1434/* Convert a machine address to kernel virtual */
1435static void *m2v(phys_addr_t maddr)
1436{
1437 return __ka(m2p(maddr));
1438}
1439
1440static void set_page_prot(void *addr, pgprot_t prot)
1441{
1442 unsigned long pfn = __pa(addr) >> PAGE_SHIFT;
1443 pte_t pte = pfn_pte(pfn, prot);
1444
1445 if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, 0))
1446 BUG();
1447}
1448
1449static __init void xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn)
1450{
1451 unsigned pmdidx, pteidx;
1452 unsigned ident_pte;
1453 unsigned long pfn;
1454
1455 ident_pte = 0;
1456 pfn = 0;
1457 for (pmdidx = 0; pmdidx < PTRS_PER_PMD && pfn < max_pfn; pmdidx++) {
1458 pte_t *pte_page;
1459
1460 /* Reuse or allocate a page of ptes */
1461 if (pmd_present(pmd[pmdidx]))
1462 pte_page = m2v(pmd[pmdidx].pmd);
1463 else {
1464 /* Check for free pte pages */
1465 if (ident_pte == ARRAY_SIZE(level1_ident_pgt))
1466 break;
1467
1468 pte_page = &level1_ident_pgt[ident_pte];
1469 ident_pte += PTRS_PER_PTE;
1470
1471 pmd[pmdidx] = __pmd(__pa(pte_page) | _PAGE_TABLE);
1472 }
1473
1474 /* Install mappings */
1475 for (pteidx = 0; pteidx < PTRS_PER_PTE; pteidx++, pfn++) {
1476 pte_t pte;
1477
1478 if (pfn > max_pfn_mapped)
1479 max_pfn_mapped = pfn;
1480
1481 if (!pte_none(pte_page[pteidx]))
1482 continue;
1483
1484 pte = pfn_pte(pfn, PAGE_KERNEL_EXEC);
1485 pte_page[pteidx] = pte;
1486 }
1487 }
1488
1489 for (pteidx = 0; pteidx < ident_pte; pteidx += PTRS_PER_PTE)
1490 set_page_prot(&level1_ident_pgt[pteidx], PAGE_KERNEL_RO);
1491
1492 set_page_prot(pmd, PAGE_KERNEL_RO);
1493}
1494
1495#ifdef CONFIG_X86_64
1496static void convert_pfn_mfn(void *v)
1497{
1498 pte_t *pte = v;
1499 int i;
1500
1501 /* All levels are converted the same way, so just treat them
1502 as ptes. */
1503 for (i = 0; i < PTRS_PER_PTE; i++)
1504 pte[i] = xen_make_pte(pte[i].pte);
1505}
1506
1507/*
1508 * Set up the inital kernel pagetable.
1509 *
1510 * We can construct this by grafting the Xen provided pagetable into
1511 * head_64.S's preconstructed pagetables. We copy the Xen L2's into
1512 * level2_ident_pgt, level2_kernel_pgt and level2_fixmap_pgt. This
1513 * means that only the kernel has a physical mapping to start with -
1514 * but that's enough to get __va working. We need to fill in the rest
1515 * of the physical mapping once some sort of allocator has been set
1516 * up.
1517 */
1518static __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
1519 unsigned long max_pfn)
1520{
1521 pud_t *l3;
1522 pmd_t *l2;
1523
1524 /* Zap identity mapping */
1525 init_level4_pgt[0] = __pgd(0);
1526
1527 /* Pre-constructed entries are in pfn, so convert to mfn */
1528 convert_pfn_mfn(init_level4_pgt);
1529 convert_pfn_mfn(level3_ident_pgt);
1530 convert_pfn_mfn(level3_kernel_pgt);
1531
1532 l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd);
1533 l2 = m2v(l3[pud_index(__START_KERNEL_map)].pud);
1534
1535 memcpy(level2_ident_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD);
1536 memcpy(level2_kernel_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD);
1537
1538 l3 = m2v(pgd[pgd_index(__START_KERNEL_map + PMD_SIZE)].pgd);
1539 l2 = m2v(l3[pud_index(__START_KERNEL_map + PMD_SIZE)].pud);
1540 memcpy(level2_fixmap_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD);
1541
1542 /* Set up identity map */
1543 xen_map_identity_early(level2_ident_pgt, max_pfn);
1544
1545 /* Make pagetable pieces RO */
1546 set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);
1547 set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
1548 set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
1549 set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);
1550 set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
1551 set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
1552
1553 /* Pin down new L4 */
1554 pin_pagetable_pfn(MMUEXT_PIN_L4_TABLE,
1555 PFN_DOWN(__pa_symbol(init_level4_pgt)));
1556
1557 /* Unpin Xen-provided one */
1558 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
1559
1560 /* Switch over */
1561 pgd = init_level4_pgt;
1562
1563 /*
1564 * At this stage there can be no user pgd, and no page
1565 * structure to attach it to, so make sure we just set kernel
1566 * pgd.
1567 */
1568 xen_mc_batch();
1569 __xen_write_cr3(true, __pa(pgd));
1570 xen_mc_issue(PARAVIRT_LAZY_CPU);
1571
1572 reserve_early(__pa(xen_start_info->pt_base),
1573 __pa(xen_start_info->pt_base +
1574 xen_start_info->nr_pt_frames * PAGE_SIZE),
1575 "XEN PAGETABLES");
1576
1577 return pgd;
1578}
1579#else /* !CONFIG_X86_64 */
1580static pmd_t level2_kernel_pgt[PTRS_PER_PMD] __page_aligned_bss;
1581
1582static __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
1583 unsigned long max_pfn)
1584{
1585 pmd_t *kernel_pmd;
1586
1587 init_pg_tables_start = __pa(pgd);
1588 init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE;
1589 max_pfn_mapped = PFN_DOWN(init_pg_tables_end + 512*1024);
1590
1591 kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd);
1592 memcpy(level2_kernel_pgt, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD);
1593
1594 xen_map_identity_early(level2_kernel_pgt, max_pfn);
1595
1596 memcpy(swapper_pg_dir, pgd, sizeof(pgd_t) * PTRS_PER_PGD);
1597 set_pgd(&swapper_pg_dir[KERNEL_PGD_BOUNDARY],
1598 __pgd(__pa(level2_kernel_pgt) | _PAGE_PRESENT));
1599
1600 set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
1601 set_page_prot(swapper_pg_dir, PAGE_KERNEL_RO);
1602 set_page_prot(empty_zero_page, PAGE_KERNEL_RO);
1603
1604 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
1605
1606 xen_write_cr3(__pa(swapper_pg_dir));
1607
1608 pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir)));
1609
1610 return swapper_pg_dir;
1611}
1612#endif /* CONFIG_X86_64 */
1613
1614/* First C function to be called on Xen boot */ 876/* First C function to be called on Xen boot */
1615asmlinkage void __init xen_start_kernel(void) 877asmlinkage void __init xen_start_kernel(void)
1616{ 878{
@@ -1639,7 +901,7 @@ asmlinkage void __init xen_start_kernel(void)
1639 /* 901 /*
1640 * set up the basic apic ops. 902 * set up the basic apic ops.
1641 */ 903 */
1642 apic_ops = &xen_basic_apic_ops; 904 set_xen_basic_apic_ops();
1643#endif 905#endif
1644 906
1645 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { 907 if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) {
@@ -1650,10 +912,18 @@ asmlinkage void __init xen_start_kernel(void)
1650 machine_ops = xen_machine_ops; 912 machine_ops = xen_machine_ops;
1651 913
1652#ifdef CONFIG_X86_64 914#ifdef CONFIG_X86_64
1653 /* Disable until direct per-cpu data access. */ 915 /*
1654 have_vcpu_info_placement = 0; 916 * Setup percpu state. We only need to do this for 64-bit
1655 x86_64_init_pda(); 917 * because 32-bit already has %fs set properly.
918 */
919 load_percpu_segment(0);
1656#endif 920#endif
921 /*
922 * The only reliable way to retain the initial address of the
923 * percpu gdt_page is to remember it here, so we can go and
924 * mark it RW later, when the initial percpu area is freed.
925 */
926 xen_initial_gdt = &per_cpu(gdt_page, 0);
1657 927
1658 xen_smp_init(); 928 xen_smp_init();
1659 929
diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c
index bb042608c602..cfd17799bd6d 100644
--- a/arch/x86/xen/irq.c
+++ b/arch/x86/xen/irq.c
@@ -19,27 +19,12 @@ void xen_force_evtchn_callback(void)
19 (void)HYPERVISOR_xen_version(0, NULL); 19 (void)HYPERVISOR_xen_version(0, NULL);
20} 20}
21 21
22static void __init __xen_init_IRQ(void)
23{
24 int i;
25
26 /* Create identity vector->irq map */
27 for(i = 0; i < NR_VECTORS; i++) {
28 int cpu;
29
30 for_each_possible_cpu(cpu)
31 per_cpu(vector_irq, cpu)[i] = i;
32 }
33
34 xen_init_IRQ();
35}
36
37static unsigned long xen_save_fl(void) 22static unsigned long xen_save_fl(void)
38{ 23{
39 struct vcpu_info *vcpu; 24 struct vcpu_info *vcpu;
40 unsigned long flags; 25 unsigned long flags;
41 26
42 vcpu = x86_read_percpu(xen_vcpu); 27 vcpu = percpu_read(xen_vcpu);
43 28
44 /* flag has opposite sense of mask */ 29 /* flag has opposite sense of mask */
45 flags = !vcpu->evtchn_upcall_mask; 30 flags = !vcpu->evtchn_upcall_mask;
@@ -50,6 +35,7 @@ static unsigned long xen_save_fl(void)
50 */ 35 */
51 return (-flags) & X86_EFLAGS_IF; 36 return (-flags) & X86_EFLAGS_IF;
52} 37}
38PV_CALLEE_SAVE_REGS_THUNK(xen_save_fl);
53 39
54static void xen_restore_fl(unsigned long flags) 40static void xen_restore_fl(unsigned long flags)
55{ 41{
@@ -62,7 +48,7 @@ static void xen_restore_fl(unsigned long flags)
62 make sure we're don't switch CPUs between getting the vcpu 48 make sure we're don't switch CPUs between getting the vcpu
63 pointer and updating the mask. */ 49 pointer and updating the mask. */
64 preempt_disable(); 50 preempt_disable();
65 vcpu = x86_read_percpu(xen_vcpu); 51 vcpu = percpu_read(xen_vcpu);
66 vcpu->evtchn_upcall_mask = flags; 52 vcpu->evtchn_upcall_mask = flags;
67 preempt_enable_no_resched(); 53 preempt_enable_no_resched();
68 54
@@ -76,6 +62,7 @@ static void xen_restore_fl(unsigned long flags)
76 xen_force_evtchn_callback(); 62 xen_force_evtchn_callback();
77 } 63 }
78} 64}
65PV_CALLEE_SAVE_REGS_THUNK(xen_restore_fl);
79 66
80static void xen_irq_disable(void) 67static void xen_irq_disable(void)
81{ 68{
@@ -83,9 +70,10 @@ static void xen_irq_disable(void)
83 make sure we're don't switch CPUs between getting the vcpu 70 make sure we're don't switch CPUs between getting the vcpu
84 pointer and updating the mask. */ 71 pointer and updating the mask. */
85 preempt_disable(); 72 preempt_disable();
86 x86_read_percpu(xen_vcpu)->evtchn_upcall_mask = 1; 73 percpu_read(xen_vcpu)->evtchn_upcall_mask = 1;
87 preempt_enable_no_resched(); 74 preempt_enable_no_resched();
88} 75}
76PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable);
89 77
90static void xen_irq_enable(void) 78static void xen_irq_enable(void)
91{ 79{
@@ -96,7 +84,7 @@ static void xen_irq_enable(void)
96 the caller is confused and is trying to re-enable interrupts 84 the caller is confused and is trying to re-enable interrupts
97 on an indeterminate processor. */ 85 on an indeterminate processor. */
98 86
99 vcpu = x86_read_percpu(xen_vcpu); 87 vcpu = percpu_read(xen_vcpu);
100 vcpu->evtchn_upcall_mask = 0; 88 vcpu->evtchn_upcall_mask = 0;
101 89
102 /* Doesn't matter if we get preempted here, because any 90 /* Doesn't matter if we get preempted here, because any
@@ -106,6 +94,7 @@ static void xen_irq_enable(void)
106 if (unlikely(vcpu->evtchn_upcall_pending)) 94 if (unlikely(vcpu->evtchn_upcall_pending))
107 xen_force_evtchn_callback(); 95 xen_force_evtchn_callback();
108} 96}
97PV_CALLEE_SAVE_REGS_THUNK(xen_irq_enable);
109 98
110static void xen_safe_halt(void) 99static void xen_safe_halt(void)
111{ 100{
@@ -123,11 +112,13 @@ static void xen_halt(void)
123} 112}
124 113
125static const struct pv_irq_ops xen_irq_ops __initdata = { 114static const struct pv_irq_ops xen_irq_ops __initdata = {
126 .init_IRQ = __xen_init_IRQ, 115 .init_IRQ = xen_init_IRQ,
127 .save_fl = xen_save_fl, 116
128 .restore_fl = xen_restore_fl, 117 .save_fl = PV_CALLEE_SAVE(xen_save_fl),
129 .irq_disable = xen_irq_disable, 118 .restore_fl = PV_CALLEE_SAVE(xen_restore_fl),
130 .irq_enable = xen_irq_enable, 119 .irq_disable = PV_CALLEE_SAVE(xen_irq_disable),
120 .irq_enable = PV_CALLEE_SAVE(xen_irq_enable),
121
131 .safe_halt = xen_safe_halt, 122 .safe_halt = xen_safe_halt,
132 .halt = xen_halt, 123 .halt = xen_halt,
133#ifdef CONFIG_X86_64 124#ifdef CONFIG_X86_64
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 503c240e26c7..cb6afa4ec95c 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -47,6 +47,7 @@
47#include <asm/tlbflush.h> 47#include <asm/tlbflush.h>
48#include <asm/fixmap.h> 48#include <asm/fixmap.h>
49#include <asm/mmu_context.h> 49#include <asm/mmu_context.h>
50#include <asm/setup.h>
50#include <asm/paravirt.h> 51#include <asm/paravirt.h>
51#include <asm/linkage.h> 52#include <asm/linkage.h>
52 53
@@ -55,6 +56,8 @@
55 56
56#include <xen/page.h> 57#include <xen/page.h>
57#include <xen/interface/xen.h> 58#include <xen/interface/xen.h>
59#include <xen/interface/version.h>
60#include <xen/hvc-console.h>
58 61
59#include "multicalls.h" 62#include "multicalls.h"
60#include "mmu.h" 63#include "mmu.h"
@@ -114,6 +117,37 @@ static inline void check_zero(void)
114 117
115#endif /* CONFIG_XEN_DEBUG_FS */ 118#endif /* CONFIG_XEN_DEBUG_FS */
116 119
120
121/*
122 * Identity map, in addition to plain kernel map. This needs to be
123 * large enough to allocate page table pages to allocate the rest.
124 * Each page can map 2MB.
125 */
126static pte_t level1_ident_pgt[PTRS_PER_PTE * 4] __page_aligned_bss;
127
128#ifdef CONFIG_X86_64
129/* l3 pud for userspace vsyscall mapping */
130static pud_t level3_user_vsyscall[PTRS_PER_PUD] __page_aligned_bss;
131#endif /* CONFIG_X86_64 */
132
133/*
134 * Note about cr3 (pagetable base) values:
135 *
136 * xen_cr3 contains the current logical cr3 value; it contains the
137 * last set cr3. This may not be the current effective cr3, because
138 * its update may be being lazily deferred. However, a vcpu looking
139 * at its own cr3 can use this value knowing that it everything will
140 * be self-consistent.
141 *
142 * xen_current_cr3 contains the actual vcpu cr3; it is set once the
143 * hypercall to set the vcpu cr3 is complete (so it may be a little
144 * out of date, but it will never be set early). If one vcpu is
145 * looking at another vcpu's cr3 value, it should use this variable.
146 */
147DEFINE_PER_CPU(unsigned long, xen_cr3); /* cr3 stored as physaddr */
148DEFINE_PER_CPU(unsigned long, xen_current_cr3); /* actual vcpu cr3 */
149
150
117/* 151/*
118 * Just beyond the highest usermode address. STACK_TOP_MAX has a 152 * Just beyond the highest usermode address. STACK_TOP_MAX has a
119 * redzone above it, so round it up to a PGD boundary. 153 * redzone above it, so round it up to a PGD boundary.
@@ -242,6 +276,13 @@ void set_phys_to_machine(unsigned long pfn, unsigned long mfn)
242 p2m_top[topidx][idx] = mfn; 276 p2m_top[topidx][idx] = mfn;
243} 277}
244 278
279unsigned long arbitrary_virt_to_mfn(void *vaddr)
280{
281 xmaddr_t maddr = arbitrary_virt_to_machine(vaddr);
282
283 return PFN_DOWN(maddr.maddr);
284}
285
245xmaddr_t arbitrary_virt_to_machine(void *vaddr) 286xmaddr_t arbitrary_virt_to_machine(void *vaddr)
246{ 287{
247 unsigned long address = (unsigned long)vaddr; 288 unsigned long address = (unsigned long)vaddr;
@@ -458,28 +499,33 @@ pteval_t xen_pte_val(pte_t pte)
458{ 499{
459 return pte_mfn_to_pfn(pte.pte); 500 return pte_mfn_to_pfn(pte.pte);
460} 501}
502PV_CALLEE_SAVE_REGS_THUNK(xen_pte_val);
461 503
462pgdval_t xen_pgd_val(pgd_t pgd) 504pgdval_t xen_pgd_val(pgd_t pgd)
463{ 505{
464 return pte_mfn_to_pfn(pgd.pgd); 506 return pte_mfn_to_pfn(pgd.pgd);
465} 507}
508PV_CALLEE_SAVE_REGS_THUNK(xen_pgd_val);
466 509
467pte_t xen_make_pte(pteval_t pte) 510pte_t xen_make_pte(pteval_t pte)
468{ 511{
469 pte = pte_pfn_to_mfn(pte); 512 pte = pte_pfn_to_mfn(pte);
470 return native_make_pte(pte); 513 return native_make_pte(pte);
471} 514}
515PV_CALLEE_SAVE_REGS_THUNK(xen_make_pte);
472 516
473pgd_t xen_make_pgd(pgdval_t pgd) 517pgd_t xen_make_pgd(pgdval_t pgd)
474{ 518{
475 pgd = pte_pfn_to_mfn(pgd); 519 pgd = pte_pfn_to_mfn(pgd);
476 return native_make_pgd(pgd); 520 return native_make_pgd(pgd);
477} 521}
522PV_CALLEE_SAVE_REGS_THUNK(xen_make_pgd);
478 523
479pmdval_t xen_pmd_val(pmd_t pmd) 524pmdval_t xen_pmd_val(pmd_t pmd)
480{ 525{
481 return pte_mfn_to_pfn(pmd.pmd); 526 return pte_mfn_to_pfn(pmd.pmd);
482} 527}
528PV_CALLEE_SAVE_REGS_THUNK(xen_pmd_val);
483 529
484void xen_set_pud_hyper(pud_t *ptr, pud_t val) 530void xen_set_pud_hyper(pud_t *ptr, pud_t val)
485{ 531{
@@ -556,12 +602,14 @@ pmd_t xen_make_pmd(pmdval_t pmd)
556 pmd = pte_pfn_to_mfn(pmd); 602 pmd = pte_pfn_to_mfn(pmd);
557 return native_make_pmd(pmd); 603 return native_make_pmd(pmd);
558} 604}
605PV_CALLEE_SAVE_REGS_THUNK(xen_make_pmd);
559 606
560#if PAGETABLE_LEVELS == 4 607#if PAGETABLE_LEVELS == 4
561pudval_t xen_pud_val(pud_t pud) 608pudval_t xen_pud_val(pud_t pud)
562{ 609{
563 return pte_mfn_to_pfn(pud.pud); 610 return pte_mfn_to_pfn(pud.pud);
564} 611}
612PV_CALLEE_SAVE_REGS_THUNK(xen_pud_val);
565 613
566pud_t xen_make_pud(pudval_t pud) 614pud_t xen_make_pud(pudval_t pud)
567{ 615{
@@ -569,6 +617,7 @@ pud_t xen_make_pud(pudval_t pud)
569 617
570 return native_make_pud(pud); 618 return native_make_pud(pud);
571} 619}
620PV_CALLEE_SAVE_REGS_THUNK(xen_make_pud);
572 621
573pgd_t *xen_get_user_pgd(pgd_t *pgd) 622pgd_t *xen_get_user_pgd(pgd_t *pgd)
574{ 623{
@@ -1063,18 +1112,14 @@ static void drop_other_mm_ref(void *info)
1063 struct mm_struct *mm = info; 1112 struct mm_struct *mm = info;
1064 struct mm_struct *active_mm; 1113 struct mm_struct *active_mm;
1065 1114
1066#ifdef CONFIG_X86_64 1115 active_mm = percpu_read(cpu_tlbstate.active_mm);
1067 active_mm = read_pda(active_mm);
1068#else
1069 active_mm = __get_cpu_var(cpu_tlbstate).active_mm;
1070#endif
1071 1116
1072 if (active_mm == mm) 1117 if (active_mm == mm)
1073 leave_mm(smp_processor_id()); 1118 leave_mm(smp_processor_id());
1074 1119
1075 /* If this cpu still has a stale cr3 reference, then make sure 1120 /* If this cpu still has a stale cr3 reference, then make sure
1076 it has been flushed. */ 1121 it has been flushed. */
1077 if (x86_read_percpu(xen_current_cr3) == __pa(mm->pgd)) { 1122 if (percpu_read(xen_current_cr3) == __pa(mm->pgd)) {
1078 load_cr3(swapper_pg_dir); 1123 load_cr3(swapper_pg_dir);
1079 arch_flush_lazy_cpu_mode(); 1124 arch_flush_lazy_cpu_mode();
1080 } 1125 }
@@ -1156,6 +1201,706 @@ void xen_exit_mmap(struct mm_struct *mm)
1156 spin_unlock(&mm->page_table_lock); 1201 spin_unlock(&mm->page_table_lock);
1157} 1202}
1158 1203
1204static __init void xen_pagetable_setup_start(pgd_t *base)
1205{
1206}
1207
1208static __init void xen_pagetable_setup_done(pgd_t *base)
1209{
1210 xen_setup_shared_info();
1211}
1212
1213static void xen_write_cr2(unsigned long cr2)
1214{
1215 percpu_read(xen_vcpu)->arch.cr2 = cr2;
1216}
1217
1218static unsigned long xen_read_cr2(void)
1219{
1220 return percpu_read(xen_vcpu)->arch.cr2;
1221}
1222
1223unsigned long xen_read_cr2_direct(void)
1224{
1225 return percpu_read(xen_vcpu_info.arch.cr2);
1226}
1227
1228static void xen_flush_tlb(void)
1229{
1230 struct mmuext_op *op;
1231 struct multicall_space mcs;
1232
1233 preempt_disable();
1234
1235 mcs = xen_mc_entry(sizeof(*op));
1236
1237 op = mcs.args;
1238 op->cmd = MMUEXT_TLB_FLUSH_LOCAL;
1239 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
1240
1241 xen_mc_issue(PARAVIRT_LAZY_MMU);
1242
1243 preempt_enable();
1244}
1245
1246static void xen_flush_tlb_single(unsigned long addr)
1247{
1248 struct mmuext_op *op;
1249 struct multicall_space mcs;
1250
1251 preempt_disable();
1252
1253 mcs = xen_mc_entry(sizeof(*op));
1254 op = mcs.args;
1255 op->cmd = MMUEXT_INVLPG_LOCAL;
1256 op->arg1.linear_addr = addr & PAGE_MASK;
1257 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
1258
1259 xen_mc_issue(PARAVIRT_LAZY_MMU);
1260
1261 preempt_enable();
1262}
1263
1264static void xen_flush_tlb_others(const struct cpumask *cpus,
1265 struct mm_struct *mm, unsigned long va)
1266{
1267 struct {
1268 struct mmuext_op op;
1269 DECLARE_BITMAP(mask, NR_CPUS);
1270 } *args;
1271 struct multicall_space mcs;
1272
1273 BUG_ON(cpumask_empty(cpus));
1274 BUG_ON(!mm);
1275
1276 mcs = xen_mc_entry(sizeof(*args));
1277 args = mcs.args;
1278 args->op.arg2.vcpumask = to_cpumask(args->mask);
1279
1280 /* Remove us, and any offline CPUS. */
1281 cpumask_and(to_cpumask(args->mask), cpus, cpu_online_mask);
1282 cpumask_clear_cpu(smp_processor_id(), to_cpumask(args->mask));
1283
1284 if (va == TLB_FLUSH_ALL) {
1285 args->op.cmd = MMUEXT_TLB_FLUSH_MULTI;
1286 } else {
1287 args->op.cmd = MMUEXT_INVLPG_MULTI;
1288 args->op.arg1.linear_addr = va;
1289 }
1290
1291 MULTI_mmuext_op(mcs.mc, &args->op, 1, NULL, DOMID_SELF);
1292
1293 xen_mc_issue(PARAVIRT_LAZY_MMU);
1294}
1295
1296static unsigned long xen_read_cr3(void)
1297{
1298 return percpu_read(xen_cr3);
1299}
1300
1301static void set_current_cr3(void *v)
1302{
1303 percpu_write(xen_current_cr3, (unsigned long)v);
1304}
1305
1306static void __xen_write_cr3(bool kernel, unsigned long cr3)
1307{
1308 struct mmuext_op *op;
1309 struct multicall_space mcs;
1310 unsigned long mfn;
1311
1312 if (cr3)
1313 mfn = pfn_to_mfn(PFN_DOWN(cr3));
1314 else
1315 mfn = 0;
1316
1317 WARN_ON(mfn == 0 && kernel);
1318
1319 mcs = __xen_mc_entry(sizeof(*op));
1320
1321 op = mcs.args;
1322 op->cmd = kernel ? MMUEXT_NEW_BASEPTR : MMUEXT_NEW_USER_BASEPTR;
1323 op->arg1.mfn = mfn;
1324
1325 MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF);
1326
1327 if (kernel) {
1328 percpu_write(xen_cr3, cr3);
1329
1330 /* Update xen_current_cr3 once the batch has actually
1331 been submitted. */
1332 xen_mc_callback(set_current_cr3, (void *)cr3);
1333 }
1334}
1335
1336static void xen_write_cr3(unsigned long cr3)
1337{
1338 BUG_ON(preemptible());
1339
1340 xen_mc_batch(); /* disables interrupts */
1341
1342 /* Update while interrupts are disabled, so its atomic with
1343 respect to ipis */
1344 percpu_write(xen_cr3, cr3);
1345
1346 __xen_write_cr3(true, cr3);
1347
1348#ifdef CONFIG_X86_64
1349 {
1350 pgd_t *user_pgd = xen_get_user_pgd(__va(cr3));
1351 if (user_pgd)
1352 __xen_write_cr3(false, __pa(user_pgd));
1353 else
1354 __xen_write_cr3(false, 0);
1355 }
1356#endif
1357
1358 xen_mc_issue(PARAVIRT_LAZY_CPU); /* interrupts restored */
1359}
1360
1361static int xen_pgd_alloc(struct mm_struct *mm)
1362{
1363 pgd_t *pgd = mm->pgd;
1364 int ret = 0;
1365
1366 BUG_ON(PagePinned(virt_to_page(pgd)));
1367
1368#ifdef CONFIG_X86_64
1369 {
1370 struct page *page = virt_to_page(pgd);
1371 pgd_t *user_pgd;
1372
1373 BUG_ON(page->private != 0);
1374
1375 ret = -ENOMEM;
1376
1377 user_pgd = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
1378 page->private = (unsigned long)user_pgd;
1379
1380 if (user_pgd != NULL) {
1381 user_pgd[pgd_index(VSYSCALL_START)] =
1382 __pgd(__pa(level3_user_vsyscall) | _PAGE_TABLE);
1383 ret = 0;
1384 }
1385
1386 BUG_ON(PagePinned(virt_to_page(xen_get_user_pgd(pgd))));
1387 }
1388#endif
1389
1390 return ret;
1391}
1392
1393static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd)
1394{
1395#ifdef CONFIG_X86_64
1396 pgd_t *user_pgd = xen_get_user_pgd(pgd);
1397
1398 if (user_pgd)
1399 free_page((unsigned long)user_pgd);
1400#endif
1401}
1402
1403#ifdef CONFIG_HIGHPTE
1404static void *xen_kmap_atomic_pte(struct page *page, enum km_type type)
1405{
1406 pgprot_t prot = PAGE_KERNEL;
1407
1408 if (PagePinned(page))
1409 prot = PAGE_KERNEL_RO;
1410
1411 if (0 && PageHighMem(page))
1412 printk("mapping highpte %lx type %d prot %s\n",
1413 page_to_pfn(page), type,
1414 (unsigned long)pgprot_val(prot) & _PAGE_RW ? "WRITE" : "READ");
1415
1416 return kmap_atomic_prot(page, type, prot);
1417}
1418#endif
1419
1420#ifdef CONFIG_X86_32
1421static __init pte_t mask_rw_pte(pte_t *ptep, pte_t pte)
1422{
1423 /* If there's an existing pte, then don't allow _PAGE_RW to be set */
1424 if (pte_val_ma(*ptep) & _PAGE_PRESENT)
1425 pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) &
1426 pte_val_ma(pte));
1427
1428 return pte;
1429}
1430
1431/* Init-time set_pte while constructing initial pagetables, which
1432 doesn't allow RO pagetable pages to be remapped RW */
1433static __init void xen_set_pte_init(pte_t *ptep, pte_t pte)
1434{
1435 pte = mask_rw_pte(ptep, pte);
1436
1437 xen_set_pte(ptep, pte);
1438}
1439#endif
1440
1441/* Early in boot, while setting up the initial pagetable, assume
1442 everything is pinned. */
1443static __init void xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn)
1444{
1445#ifdef CONFIG_FLATMEM
1446 BUG_ON(mem_map); /* should only be used early */
1447#endif
1448 make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
1449}
1450
1451/* Early release_pte assumes that all pts are pinned, since there's
1452 only init_mm and anything attached to that is pinned. */
1453static void xen_release_pte_init(unsigned long pfn)
1454{
1455 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
1456}
1457
1458static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn)
1459{
1460 struct mmuext_op op;
1461 op.cmd = cmd;
1462 op.arg1.mfn = pfn_to_mfn(pfn);
1463 if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF))
1464 BUG();
1465}
1466
1467/* This needs to make sure the new pte page is pinned iff its being
1468 attached to a pinned pagetable. */
1469static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned level)
1470{
1471 struct page *page = pfn_to_page(pfn);
1472
1473 if (PagePinned(virt_to_page(mm->pgd))) {
1474 SetPagePinned(page);
1475
1476 vm_unmap_aliases();
1477 if (!PageHighMem(page)) {
1478 make_lowmem_page_readonly(__va(PFN_PHYS((unsigned long)pfn)));
1479 if (level == PT_PTE && USE_SPLIT_PTLOCKS)
1480 pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn);
1481 } else {
1482 /* make sure there are no stray mappings of
1483 this page */
1484 kmap_flush_unused();
1485 }
1486 }
1487}
1488
1489static void xen_alloc_pte(struct mm_struct *mm, unsigned long pfn)
1490{
1491 xen_alloc_ptpage(mm, pfn, PT_PTE);
1492}
1493
1494static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
1495{
1496 xen_alloc_ptpage(mm, pfn, PT_PMD);
1497}
1498
1499/* This should never happen until we're OK to use struct page */
1500static void xen_release_ptpage(unsigned long pfn, unsigned level)
1501{
1502 struct page *page = pfn_to_page(pfn);
1503
1504 if (PagePinned(page)) {
1505 if (!PageHighMem(page)) {
1506 if (level == PT_PTE && USE_SPLIT_PTLOCKS)
1507 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn);
1508 make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
1509 }
1510 ClearPagePinned(page);
1511 }
1512}
1513
1514static void xen_release_pte(unsigned long pfn)
1515{
1516 xen_release_ptpage(pfn, PT_PTE);
1517}
1518
1519static void xen_release_pmd(unsigned long pfn)
1520{
1521 xen_release_ptpage(pfn, PT_PMD);
1522}
1523
1524#if PAGETABLE_LEVELS == 4
1525static void xen_alloc_pud(struct mm_struct *mm, unsigned long pfn)
1526{
1527 xen_alloc_ptpage(mm, pfn, PT_PUD);
1528}
1529
1530static void xen_release_pud(unsigned long pfn)
1531{
1532 xen_release_ptpage(pfn, PT_PUD);
1533}
1534#endif
1535
1536void __init xen_reserve_top(void)
1537{
1538#ifdef CONFIG_X86_32
1539 unsigned long top = HYPERVISOR_VIRT_START;
1540 struct xen_platform_parameters pp;
1541
1542 if (HYPERVISOR_xen_version(XENVER_platform_parameters, &pp) == 0)
1543 top = pp.virt_start;
1544
1545 reserve_top_address(-top);
1546#endif /* CONFIG_X86_32 */
1547}
1548
1549/*
1550 * Like __va(), but returns address in the kernel mapping (which is
1551 * all we have until the physical memory mapping has been set up.
1552 */
1553static void *__ka(phys_addr_t paddr)
1554{
1555#ifdef CONFIG_X86_64
1556 return (void *)(paddr + __START_KERNEL_map);
1557#else
1558 return __va(paddr);
1559#endif
1560}
1561
1562/* Convert a machine address to physical address */
1563static unsigned long m2p(phys_addr_t maddr)
1564{
1565 phys_addr_t paddr;
1566
1567 maddr &= PTE_PFN_MASK;
1568 paddr = mfn_to_pfn(maddr >> PAGE_SHIFT) << PAGE_SHIFT;
1569
1570 return paddr;
1571}
1572
1573/* Convert a machine address to kernel virtual */
1574static void *m2v(phys_addr_t maddr)
1575{
1576 return __ka(m2p(maddr));
1577}
1578
1579static void set_page_prot(void *addr, pgprot_t prot)
1580{
1581 unsigned long pfn = __pa(addr) >> PAGE_SHIFT;
1582 pte_t pte = pfn_pte(pfn, prot);
1583
1584 if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, 0))
1585 BUG();
1586}
1587
1588static __init void xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn)
1589{
1590 unsigned pmdidx, pteidx;
1591 unsigned ident_pte;
1592 unsigned long pfn;
1593
1594 ident_pte = 0;
1595 pfn = 0;
1596 for (pmdidx = 0; pmdidx < PTRS_PER_PMD && pfn < max_pfn; pmdidx++) {
1597 pte_t *pte_page;
1598
1599 /* Reuse or allocate a page of ptes */
1600 if (pmd_present(pmd[pmdidx]))
1601 pte_page = m2v(pmd[pmdidx].pmd);
1602 else {
1603 /* Check for free pte pages */
1604 if (ident_pte == ARRAY_SIZE(level1_ident_pgt))
1605 break;
1606
1607 pte_page = &level1_ident_pgt[ident_pte];
1608 ident_pte += PTRS_PER_PTE;
1609
1610 pmd[pmdidx] = __pmd(__pa(pte_page) | _PAGE_TABLE);
1611 }
1612
1613 /* Install mappings */
1614 for (pteidx = 0; pteidx < PTRS_PER_PTE; pteidx++, pfn++) {
1615 pte_t pte;
1616
1617 if (pfn > max_pfn_mapped)
1618 max_pfn_mapped = pfn;
1619
1620 if (!pte_none(pte_page[pteidx]))
1621 continue;
1622
1623 pte = pfn_pte(pfn, PAGE_KERNEL_EXEC);
1624 pte_page[pteidx] = pte;
1625 }
1626 }
1627
1628 for (pteidx = 0; pteidx < ident_pte; pteidx += PTRS_PER_PTE)
1629 set_page_prot(&level1_ident_pgt[pteidx], PAGE_KERNEL_RO);
1630
1631 set_page_prot(pmd, PAGE_KERNEL_RO);
1632}
1633
1634#ifdef CONFIG_X86_64
1635static void convert_pfn_mfn(void *v)
1636{
1637 pte_t *pte = v;
1638 int i;
1639
1640 /* All levels are converted the same way, so just treat them
1641 as ptes. */
1642 for (i = 0; i < PTRS_PER_PTE; i++)
1643 pte[i] = xen_make_pte(pte[i].pte);
1644}
1645
1646/*
1647 * Set up the inital kernel pagetable.
1648 *
1649 * We can construct this by grafting the Xen provided pagetable into
1650 * head_64.S's preconstructed pagetables. We copy the Xen L2's into
1651 * level2_ident_pgt, level2_kernel_pgt and level2_fixmap_pgt. This
1652 * means that only the kernel has a physical mapping to start with -
1653 * but that's enough to get __va working. We need to fill in the rest
1654 * of the physical mapping once some sort of allocator has been set
1655 * up.
1656 */
1657__init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
1658 unsigned long max_pfn)
1659{
1660 pud_t *l3;
1661 pmd_t *l2;
1662
1663 /* Zap identity mapping */
1664 init_level4_pgt[0] = __pgd(0);
1665
1666 /* Pre-constructed entries are in pfn, so convert to mfn */
1667 convert_pfn_mfn(init_level4_pgt);
1668 convert_pfn_mfn(level3_ident_pgt);
1669 convert_pfn_mfn(level3_kernel_pgt);
1670
1671 l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd);
1672 l2 = m2v(l3[pud_index(__START_KERNEL_map)].pud);
1673
1674 memcpy(level2_ident_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD);
1675 memcpy(level2_kernel_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD);
1676
1677 l3 = m2v(pgd[pgd_index(__START_KERNEL_map + PMD_SIZE)].pgd);
1678 l2 = m2v(l3[pud_index(__START_KERNEL_map + PMD_SIZE)].pud);
1679 memcpy(level2_fixmap_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD);
1680
1681 /* Set up identity map */
1682 xen_map_identity_early(level2_ident_pgt, max_pfn);
1683
1684 /* Make pagetable pieces RO */
1685 set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);
1686 set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
1687 set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
1688 set_page_prot(level3_user_vsyscall, PAGE_KERNEL_RO);
1689 set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
1690 set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
1691
1692 /* Pin down new L4 */
1693 pin_pagetable_pfn(MMUEXT_PIN_L4_TABLE,
1694 PFN_DOWN(__pa_symbol(init_level4_pgt)));
1695
1696 /* Unpin Xen-provided one */
1697 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
1698
1699 /* Switch over */
1700 pgd = init_level4_pgt;
1701
1702 /*
1703 * At this stage there can be no user pgd, and no page
1704 * structure to attach it to, so make sure we just set kernel
1705 * pgd.
1706 */
1707 xen_mc_batch();
1708 __xen_write_cr3(true, __pa(pgd));
1709 xen_mc_issue(PARAVIRT_LAZY_CPU);
1710
1711 reserve_early(__pa(xen_start_info->pt_base),
1712 __pa(xen_start_info->pt_base +
1713 xen_start_info->nr_pt_frames * PAGE_SIZE),
1714 "XEN PAGETABLES");
1715
1716 return pgd;
1717}
1718#else /* !CONFIG_X86_64 */
1719static pmd_t level2_kernel_pgt[PTRS_PER_PMD] __page_aligned_bss;
1720
1721__init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
1722 unsigned long max_pfn)
1723{
1724 pmd_t *kernel_pmd;
1725
1726 init_pg_tables_start = __pa(pgd);
1727 init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE;
1728 max_pfn_mapped = PFN_DOWN(init_pg_tables_end + 512*1024);
1729
1730 kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd);
1731 memcpy(level2_kernel_pgt, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD);
1732
1733 xen_map_identity_early(level2_kernel_pgt, max_pfn);
1734
1735 memcpy(swapper_pg_dir, pgd, sizeof(pgd_t) * PTRS_PER_PGD);
1736 set_pgd(&swapper_pg_dir[KERNEL_PGD_BOUNDARY],
1737 __pgd(__pa(level2_kernel_pgt) | _PAGE_PRESENT));
1738
1739 set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
1740 set_page_prot(swapper_pg_dir, PAGE_KERNEL_RO);
1741 set_page_prot(empty_zero_page, PAGE_KERNEL_RO);
1742
1743 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
1744
1745 xen_write_cr3(__pa(swapper_pg_dir));
1746
1747 pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(swapper_pg_dir)));
1748
1749 return swapper_pg_dir;
1750}
1751#endif /* CONFIG_X86_64 */
1752
1753static void xen_set_fixmap(unsigned idx, unsigned long phys, pgprot_t prot)
1754{
1755 pte_t pte;
1756
1757 phys >>= PAGE_SHIFT;
1758
1759 switch (idx) {
1760 case FIX_BTMAP_END ... FIX_BTMAP_BEGIN:
1761#ifdef CONFIG_X86_F00F_BUG
1762 case FIX_F00F_IDT:
1763#endif
1764#ifdef CONFIG_X86_32
1765 case FIX_WP_TEST:
1766 case FIX_VDSO:
1767# ifdef CONFIG_HIGHMEM
1768 case FIX_KMAP_BEGIN ... FIX_KMAP_END:
1769# endif
1770#else
1771 case VSYSCALL_LAST_PAGE ... VSYSCALL_FIRST_PAGE:
1772#endif
1773#ifdef CONFIG_X86_LOCAL_APIC
1774 case FIX_APIC_BASE: /* maps dummy local APIC */
1775#endif
1776 pte = pfn_pte(phys, prot);
1777 break;
1778
1779 default:
1780 pte = mfn_pte(phys, prot);
1781 break;
1782 }
1783
1784 __native_set_fixmap(idx, pte);
1785
1786#ifdef CONFIG_X86_64
1787 /* Replicate changes to map the vsyscall page into the user
1788 pagetable vsyscall mapping. */
1789 if (idx >= VSYSCALL_LAST_PAGE && idx <= VSYSCALL_FIRST_PAGE) {
1790 unsigned long vaddr = __fix_to_virt(idx);
1791 set_pte_vaddr_pud(level3_user_vsyscall, vaddr, pte);
1792 }
1793#endif
1794}
1795
1796__init void xen_post_allocator_init(void)
1797{
1798 pv_mmu_ops.set_pte = xen_set_pte;
1799 pv_mmu_ops.set_pmd = xen_set_pmd;
1800 pv_mmu_ops.set_pud = xen_set_pud;
1801#if PAGETABLE_LEVELS == 4
1802 pv_mmu_ops.set_pgd = xen_set_pgd;
1803#endif
1804
1805 /* This will work as long as patching hasn't happened yet
1806 (which it hasn't) */
1807 pv_mmu_ops.alloc_pte = xen_alloc_pte;
1808 pv_mmu_ops.alloc_pmd = xen_alloc_pmd;
1809 pv_mmu_ops.release_pte = xen_release_pte;
1810 pv_mmu_ops.release_pmd = xen_release_pmd;
1811#if PAGETABLE_LEVELS == 4
1812 pv_mmu_ops.alloc_pud = xen_alloc_pud;
1813 pv_mmu_ops.release_pud = xen_release_pud;
1814#endif
1815
1816#ifdef CONFIG_X86_64
1817 SetPagePinned(virt_to_page(level3_user_vsyscall));
1818#endif
1819 xen_mark_init_mm_pinned();
1820}
1821
1822
1823const struct pv_mmu_ops xen_mmu_ops __initdata = {
1824 .pagetable_setup_start = xen_pagetable_setup_start,
1825 .pagetable_setup_done = xen_pagetable_setup_done,
1826
1827 .read_cr2 = xen_read_cr2,
1828 .write_cr2 = xen_write_cr2,
1829
1830 .read_cr3 = xen_read_cr3,
1831 .write_cr3 = xen_write_cr3,
1832
1833 .flush_tlb_user = xen_flush_tlb,
1834 .flush_tlb_kernel = xen_flush_tlb,
1835 .flush_tlb_single = xen_flush_tlb_single,
1836 .flush_tlb_others = xen_flush_tlb_others,
1837
1838 .pte_update = paravirt_nop,
1839 .pte_update_defer = paravirt_nop,
1840
1841 .pgd_alloc = xen_pgd_alloc,
1842 .pgd_free = xen_pgd_free,
1843
1844 .alloc_pte = xen_alloc_pte_init,
1845 .release_pte = xen_release_pte_init,
1846 .alloc_pmd = xen_alloc_pte_init,
1847 .alloc_pmd_clone = paravirt_nop,
1848 .release_pmd = xen_release_pte_init,
1849
1850#ifdef CONFIG_HIGHPTE
1851 .kmap_atomic_pte = xen_kmap_atomic_pte,
1852#endif
1853
1854#ifdef CONFIG_X86_64
1855 .set_pte = xen_set_pte,
1856#else
1857 .set_pte = xen_set_pte_init,
1858#endif
1859 .set_pte_at = xen_set_pte_at,
1860 .set_pmd = xen_set_pmd_hyper,
1861
1862 .ptep_modify_prot_start = __ptep_modify_prot_start,
1863 .ptep_modify_prot_commit = __ptep_modify_prot_commit,
1864
1865 .pte_val = PV_CALLEE_SAVE(xen_pte_val),
1866 .pgd_val = PV_CALLEE_SAVE(xen_pgd_val),
1867
1868 .make_pte = PV_CALLEE_SAVE(xen_make_pte),
1869 .make_pgd = PV_CALLEE_SAVE(xen_make_pgd),
1870
1871#ifdef CONFIG_X86_PAE
1872 .set_pte_atomic = xen_set_pte_atomic,
1873 .set_pte_present = xen_set_pte_at,
1874 .pte_clear = xen_pte_clear,
1875 .pmd_clear = xen_pmd_clear,
1876#endif /* CONFIG_X86_PAE */
1877 .set_pud = xen_set_pud_hyper,
1878
1879 .make_pmd = PV_CALLEE_SAVE(xen_make_pmd),
1880 .pmd_val = PV_CALLEE_SAVE(xen_pmd_val),
1881
1882#if PAGETABLE_LEVELS == 4
1883 .pud_val = PV_CALLEE_SAVE(xen_pud_val),
1884 .make_pud = PV_CALLEE_SAVE(xen_make_pud),
1885 .set_pgd = xen_set_pgd_hyper,
1886
1887 .alloc_pud = xen_alloc_pte_init,
1888 .release_pud = xen_release_pte_init,
1889#endif /* PAGETABLE_LEVELS == 4 */
1890
1891 .activate_mm = xen_activate_mm,
1892 .dup_mmap = xen_dup_mmap,
1893 .exit_mmap = xen_exit_mmap,
1894
1895 .lazy_mode = {
1896 .enter = paravirt_enter_lazy_mmu,
1897 .leave = xen_leave_lazy,
1898 },
1899
1900 .set_fixmap = xen_set_fixmap,
1901};
1902
1903
1159#ifdef CONFIG_XEN_DEBUG_FS 1904#ifdef CONFIG_XEN_DEBUG_FS
1160 1905
1161static struct dentry *d_mmu_debug; 1906static struct dentry *d_mmu_debug;
diff --git a/arch/x86/xen/mmu.h b/arch/x86/xen/mmu.h
index 98d71659da5a..24d1b44a337d 100644
--- a/arch/x86/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
@@ -54,4 +54,7 @@ pte_t xen_ptep_modify_prot_start(struct mm_struct *mm, unsigned long addr, pte_t
54void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr, 54void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr,
55 pte_t *ptep, pte_t pte); 55 pte_t *ptep, pte_t pte);
56 56
57unsigned long xen_read_cr2_direct(void);
58
59extern const struct pv_mmu_ops xen_mmu_ops;
57#endif /* _XEN_MMU_H */ 60#endif /* _XEN_MMU_H */
diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c
index c738644b5435..8bff7e7c290b 100644
--- a/arch/x86/xen/multicalls.c
+++ b/arch/x86/xen/multicalls.c
@@ -39,6 +39,7 @@ struct mc_buffer {
39 struct multicall_entry entries[MC_BATCH]; 39 struct multicall_entry entries[MC_BATCH];
40#if MC_DEBUG 40#if MC_DEBUG
41 struct multicall_entry debug[MC_BATCH]; 41 struct multicall_entry debug[MC_BATCH];
42 void *caller[MC_BATCH];
42#endif 43#endif
43 unsigned char args[MC_ARGS]; 44 unsigned char args[MC_ARGS];
44 struct callback { 45 struct callback {
@@ -154,11 +155,12 @@ void xen_mc_flush(void)
154 ret, smp_processor_id()); 155 ret, smp_processor_id());
155 dump_stack(); 156 dump_stack();
156 for (i = 0; i < b->mcidx; i++) { 157 for (i = 0; i < b->mcidx; i++) {
157 printk(KERN_DEBUG " call %2d/%d: op=%lu arg=[%lx] result=%ld\n", 158 printk(KERN_DEBUG " call %2d/%d: op=%lu arg=[%lx] result=%ld\t%pF\n",
158 i+1, b->mcidx, 159 i+1, b->mcidx,
159 b->debug[i].op, 160 b->debug[i].op,
160 b->debug[i].args[0], 161 b->debug[i].args[0],
161 b->entries[i].result); 162 b->entries[i].result,
163 b->caller[i]);
162 } 164 }
163 } 165 }
164#endif 166#endif
@@ -168,8 +170,6 @@ void xen_mc_flush(void)
168 } else 170 } else
169 BUG_ON(b->argidx != 0); 171 BUG_ON(b->argidx != 0);
170 172
171 local_irq_restore(flags);
172
173 for (i = 0; i < b->cbidx; i++) { 173 for (i = 0; i < b->cbidx; i++) {
174 struct callback *cb = &b->callbacks[i]; 174 struct callback *cb = &b->callbacks[i];
175 175
@@ -177,7 +177,9 @@ void xen_mc_flush(void)
177 } 177 }
178 b->cbidx = 0; 178 b->cbidx = 0;
179 179
180 BUG_ON(ret); 180 local_irq_restore(flags);
181
182 WARN_ON(ret);
181} 183}
182 184
183struct multicall_space __xen_mc_entry(size_t args) 185struct multicall_space __xen_mc_entry(size_t args)
@@ -197,6 +199,9 @@ struct multicall_space __xen_mc_entry(size_t args)
197 } 199 }
198 200
199 ret.mc = &b->entries[b->mcidx]; 201 ret.mc = &b->entries[b->mcidx];
202#ifdef MC_DEBUG
203 b->caller[b->mcidx] = __builtin_return_address(0);
204#endif
200 b->mcidx++; 205 b->mcidx++;
201 ret.args = &b->args[argidx]; 206 ret.args = &b->args[argidx];
202 b->argidx = argidx + args; 207 b->argidx = argidx + args;
diff --git a/arch/x86/xen/multicalls.h b/arch/x86/xen/multicalls.h
index fa3e10725d98..9e565da5d1f7 100644
--- a/arch/x86/xen/multicalls.h
+++ b/arch/x86/xen/multicalls.h
@@ -41,7 +41,7 @@ static inline void xen_mc_issue(unsigned mode)
41 xen_mc_flush(); 41 xen_mc_flush();
42 42
43 /* restore flags saved in xen_mc_batch */ 43 /* restore flags saved in xen_mc_batch */
44 local_irq_restore(x86_read_percpu(xen_mc_irq_flags)); 44 local_irq_restore(percpu_read(xen_mc_irq_flags));
45} 45}
46 46
47/* Set up a callback to be called when the current batch is flushed */ 47/* Set up a callback to be called when the current batch is flushed */
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index c44e2069c7c7..8d470562ffc9 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -50,11 +50,7 @@ static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id);
50 */ 50 */
51static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id) 51static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id)
52{ 52{
53#ifdef CONFIG_X86_32 53 inc_irq_stat(irq_resched_count);
54 __get_cpu_var(irq_stat).irq_resched_count++;
55#else
56 add_pda(irq_resched_count, 1);
57#endif
58 54
59 return IRQ_HANDLED; 55 return IRQ_HANDLED;
60} 56}
@@ -78,7 +74,7 @@ static __cpuinit void cpu_bringup(void)
78 xen_setup_cpu_clockevents(); 74 xen_setup_cpu_clockevents();
79 75
80 cpu_set(cpu, cpu_online_map); 76 cpu_set(cpu, cpu_online_map);
81 x86_write_percpu(cpu_state, CPU_ONLINE); 77 percpu_write(cpu_state, CPU_ONLINE);
82 wmb(); 78 wmb();
83 79
84 /* We can take interrupts now: we're officially "up". */ 80 /* We can take interrupts now: we're officially "up". */
@@ -174,7 +170,7 @@ static void __init xen_smp_prepare_boot_cpu(void)
174 170
175 /* We've switched to the "real" per-cpu gdt, so make sure the 171 /* We've switched to the "real" per-cpu gdt, so make sure the
176 old memory can be recycled */ 172 old memory can be recycled */
177 make_lowmem_page_readwrite(&per_cpu_var(gdt_page)); 173 make_lowmem_page_readwrite(xen_initial_gdt);
178 174
179 xen_setup_vcpu_info_placement(); 175 xen_setup_vcpu_info_placement();
180} 176}
@@ -223,6 +219,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
223{ 219{
224 struct vcpu_guest_context *ctxt; 220 struct vcpu_guest_context *ctxt;
225 struct desc_struct *gdt; 221 struct desc_struct *gdt;
222 unsigned long gdt_mfn;
226 223
227 if (cpumask_test_and_set_cpu(cpu, xen_cpu_initialized_map)) 224 if (cpumask_test_and_set_cpu(cpu, xen_cpu_initialized_map))
228 return 0; 225 return 0;
@@ -239,6 +236,8 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
239 ctxt->user_regs.ss = __KERNEL_DS; 236 ctxt->user_regs.ss = __KERNEL_DS;
240#ifdef CONFIG_X86_32 237#ifdef CONFIG_X86_32
241 ctxt->user_regs.fs = __KERNEL_PERCPU; 238 ctxt->user_regs.fs = __KERNEL_PERCPU;
239#else
240 ctxt->gs_base_kernel = per_cpu_offset(cpu);
242#endif 241#endif
243 ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle; 242 ctxt->user_regs.eip = (unsigned long)cpu_bringup_and_idle;
244 ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */ 243 ctxt->user_regs.eflags = 0x1000; /* IOPL_RING1 */
@@ -250,9 +249,12 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
250 ctxt->ldt_ents = 0; 249 ctxt->ldt_ents = 0;
251 250
252 BUG_ON((unsigned long)gdt & ~PAGE_MASK); 251 BUG_ON((unsigned long)gdt & ~PAGE_MASK);
252
253 gdt_mfn = arbitrary_virt_to_mfn(gdt);
253 make_lowmem_page_readonly(gdt); 254 make_lowmem_page_readonly(gdt);
255 make_lowmem_page_readonly(mfn_to_virt(gdt_mfn));
254 256
255 ctxt->gdt_frames[0] = virt_to_mfn(gdt); 257 ctxt->gdt_frames[0] = gdt_mfn;
256 ctxt->gdt_ents = GDT_ENTRIES; 258 ctxt->gdt_ents = GDT_ENTRIES;
257 259
258 ctxt->user_regs.cs = __KERNEL_CS; 260 ctxt->user_regs.cs = __KERNEL_CS;
@@ -283,23 +285,14 @@ static int __cpuinit xen_cpu_up(unsigned int cpu)
283 struct task_struct *idle = idle_task(cpu); 285 struct task_struct *idle = idle_task(cpu);
284 int rc; 286 int rc;
285 287
286#ifdef CONFIG_X86_64
287 /* Allocate node local memory for AP pdas */
288 WARN_ON(cpu == 0);
289 if (cpu > 0) {
290 rc = get_local_pda(cpu);
291 if (rc)
292 return rc;
293 }
294#endif
295
296#ifdef CONFIG_X86_32
297 init_gdt(cpu);
298 per_cpu(current_task, cpu) = idle; 288 per_cpu(current_task, cpu) = idle;
289#ifdef CONFIG_X86_32
299 irq_ctx_init(cpu); 290 irq_ctx_init(cpu);
300#else 291#else
301 cpu_pda(cpu)->pcurrent = idle;
302 clear_tsk_thread_flag(idle, TIF_FORK); 292 clear_tsk_thread_flag(idle, TIF_FORK);
293 per_cpu(kernel_stack, cpu) =
294 (unsigned long)task_stack_page(idle) -
295 KERNEL_STACK_OFFSET + THREAD_SIZE;
303#endif 296#endif
304 xen_setup_timer(cpu); 297 xen_setup_timer(cpu);
305 xen_init_lock_cpu(cpu); 298 xen_init_lock_cpu(cpu);
@@ -445,11 +438,7 @@ static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)
445{ 438{
446 irq_enter(); 439 irq_enter();
447 generic_smp_call_function_interrupt(); 440 generic_smp_call_function_interrupt();
448#ifdef CONFIG_X86_32 441 inc_irq_stat(irq_call_count);
449 __get_cpu_var(irq_stat).irq_call_count++;
450#else
451 add_pda(irq_call_count, 1);
452#endif
453 irq_exit(); 442 irq_exit();
454 443
455 return IRQ_HANDLED; 444 return IRQ_HANDLED;
@@ -459,11 +448,7 @@ static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)
459{ 448{
460 irq_enter(); 449 irq_enter();
461 generic_smp_call_function_single_interrupt(); 450 generic_smp_call_function_single_interrupt();
462#ifdef CONFIG_X86_32 451 inc_irq_stat(irq_call_count);
463 __get_cpu_var(irq_stat).irq_call_count++;
464#else
465 add_pda(irq_call_count, 1);
466#endif
467 irq_exit(); 452 irq_exit();
468 453
469 return IRQ_HANDLED; 454 return IRQ_HANDLED;
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index 212ffe012b76..95be7b434724 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -6,6 +6,7 @@
6 6
7#include <asm/xen/hypercall.h> 7#include <asm/xen/hypercall.h>
8#include <asm/xen/page.h> 8#include <asm/xen/page.h>
9#include <asm/fixmap.h>
9 10
10#include "xen-ops.h" 11#include "xen-ops.h"
11#include "mmu.h" 12#include "mmu.h"
diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
new file mode 100644
index 000000000000..79d7362ad6d1
--- /dev/null
+++ b/arch/x86/xen/xen-asm.S
@@ -0,0 +1,142 @@
1/*
2 * Asm versions of Xen pv-ops, suitable for either direct use or
3 * inlining. The inline versions are the same as the direct-use
4 * versions, with the pre- and post-amble chopped off.
5 *
6 * This code is encoded for size rather than absolute efficiency, with
7 * a view to being able to inline as much as possible.
8 *
9 * We only bother with direct forms (ie, vcpu in percpu data) of the
10 * operations here; the indirect forms are better handled in C, since
11 * they're generally too large to inline anyway.
12 */
13
14#include <asm/asm-offsets.h>
15#include <asm/percpu.h>
16#include <asm/processor-flags.h>
17
18#include "xen-asm.h"
19
20/*
21 * Enable events. This clears the event mask and tests the pending
22 * event status with one and operation. If there are pending events,
23 * then enter the hypervisor to get them handled.
24 */
25ENTRY(xen_irq_enable_direct)
26 /* Unmask events */
27 movb $0, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
28
29 /*
30 * Preempt here doesn't matter because that will deal with any
31 * pending interrupts. The pending check may end up being run
32 * on the wrong CPU, but that doesn't hurt.
33 */
34
35 /* Test for pending */
36 testb $0xff, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending
37 jz 1f
38
392: call check_events
401:
41ENDPATCH(xen_irq_enable_direct)
42 ret
43 ENDPROC(xen_irq_enable_direct)
44 RELOC(xen_irq_enable_direct, 2b+1)
45
46
47/*
48 * Disabling events is simply a matter of making the event mask
49 * non-zero.
50 */
51ENTRY(xen_irq_disable_direct)
52 movb $1, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
53ENDPATCH(xen_irq_disable_direct)
54 ret
55 ENDPROC(xen_irq_disable_direct)
56 RELOC(xen_irq_disable_direct, 0)
57
58/*
59 * (xen_)save_fl is used to get the current interrupt enable status.
60 * Callers expect the status to be in X86_EFLAGS_IF, and other bits
61 * may be set in the return value. We take advantage of this by
62 * making sure that X86_EFLAGS_IF has the right value (and other bits
63 * in that byte are 0), but other bits in the return value are
64 * undefined. We need to toggle the state of the bit, because Xen and
65 * x86 use opposite senses (mask vs enable).
66 */
67ENTRY(xen_save_fl_direct)
68 testb $0xff, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
69 setz %ah
70 addb %ah, %ah
71ENDPATCH(xen_save_fl_direct)
72 ret
73 ENDPROC(xen_save_fl_direct)
74 RELOC(xen_save_fl_direct, 0)
75
76
77/*
78 * In principle the caller should be passing us a value return from
79 * xen_save_fl_direct, but for robustness sake we test only the
80 * X86_EFLAGS_IF flag rather than the whole byte. After setting the
81 * interrupt mask state, it checks for unmasked pending events and
82 * enters the hypervisor to get them delivered if so.
83 */
84ENTRY(xen_restore_fl_direct)
85#ifdef CONFIG_X86_64
86 testw $X86_EFLAGS_IF, %di
87#else
88 testb $X86_EFLAGS_IF>>8, %ah
89#endif
90 setz PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_mask
91 /*
92 * Preempt here doesn't matter because that will deal with any
93 * pending interrupts. The pending check may end up being run
94 * on the wrong CPU, but that doesn't hurt.
95 */
96
97 /* check for unmasked and pending */
98 cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending
99 jz 1f
1002: call check_events
1011:
102ENDPATCH(xen_restore_fl_direct)
103 ret
104 ENDPROC(xen_restore_fl_direct)
105 RELOC(xen_restore_fl_direct, 2b+1)
106
107
108/*
109 * Force an event check by making a hypercall, but preserve regs
110 * before making the call.
111 */
112check_events:
113#ifdef CONFIG_X86_32
114 push %eax
115 push %ecx
116 push %edx
117 call xen_force_evtchn_callback
118 pop %edx
119 pop %ecx
120 pop %eax
121#else
122 push %rax
123 push %rcx
124 push %rdx
125 push %rsi
126 push %rdi
127 push %r8
128 push %r9
129 push %r10
130 push %r11
131 call xen_force_evtchn_callback
132 pop %r11
133 pop %r10
134 pop %r9
135 pop %r8
136 pop %rdi
137 pop %rsi
138 pop %rdx
139 pop %rcx
140 pop %rax
141#endif
142 ret
diff --git a/arch/x86/xen/xen-asm.h b/arch/x86/xen/xen-asm.h
new file mode 100644
index 000000000000..465276467a47
--- /dev/null
+++ b/arch/x86/xen/xen-asm.h
@@ -0,0 +1,12 @@
1#ifndef _XEN_XEN_ASM_H
2#define _XEN_XEN_ASM_H
3
4#include <linux/linkage.h>
5
6#define RELOC(x, v) .globl x##_reloc; x##_reloc=v
7#define ENDPATCH(x) .globl x##_end; x##_end=.
8
9/* Pseudo-flag used for virtual NMI, which we don't implement yet */
10#define XEN_EFLAGS_NMI 0x80000000
11
12#endif
diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S
index 42786f59d9c0..88e15deb8b82 100644
--- a/arch/x86/xen/xen-asm_32.S
+++ b/arch/x86/xen/xen-asm_32.S
@@ -1,117 +1,43 @@
1/* 1/*
2 Asm versions of Xen pv-ops, suitable for either direct use or inlining. 2 * Asm versions of Xen pv-ops, suitable for either direct use or
3 The inline versions are the same as the direct-use versions, with the 3 * inlining. The inline versions are the same as the direct-use
4 pre- and post-amble chopped off. 4 * versions, with the pre- and post-amble chopped off.
5 5 *
6 This code is encoded for size rather than absolute efficiency, 6 * This code is encoded for size rather than absolute efficiency, with
7 with a view to being able to inline as much as possible. 7 * a view to being able to inline as much as possible.
8 8 *
9 We only bother with direct forms (ie, vcpu in pda) of the operations 9 * We only bother with direct forms (ie, vcpu in pda) of the
10 here; the indirect forms are better handled in C, since they're 10 * operations here; the indirect forms are better handled in C, since
11 generally too large to inline anyway. 11 * they're generally too large to inline anyway.
12 */ 12 */
13 13
14#include <linux/linkage.h>
15
16#include <asm/asm-offsets.h>
17#include <asm/thread_info.h> 14#include <asm/thread_info.h>
18#include <asm/percpu.h>
19#include <asm/processor-flags.h> 15#include <asm/processor-flags.h>
20#include <asm/segment.h> 16#include <asm/segment.h>
21 17
22#include <xen/interface/xen.h> 18#include <xen/interface/xen.h>
23 19
24#define RELOC(x, v) .globl x##_reloc; x##_reloc=v 20#include "xen-asm.h"
25#define ENDPATCH(x) .globl x##_end; x##_end=.
26
27/* Pseudo-flag used for virtual NMI, which we don't implement yet */
28#define XEN_EFLAGS_NMI 0x80000000
29
30/*
31 Enable events. This clears the event mask and tests the pending
32 event status with one and operation. If there are pending
33 events, then enter the hypervisor to get them handled.
34 */
35ENTRY(xen_irq_enable_direct)
36 /* Unmask events */
37 movb $0, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
38
39 /* Preempt here doesn't matter because that will deal with
40 any pending interrupts. The pending check may end up being
41 run on the wrong CPU, but that doesn't hurt. */
42
43 /* Test for pending */
44 testb $0xff, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_pending
45 jz 1f
46
472: call check_events
481:
49ENDPATCH(xen_irq_enable_direct)
50 ret
51 ENDPROC(xen_irq_enable_direct)
52 RELOC(xen_irq_enable_direct, 2b+1)
53
54
55/*
56 Disabling events is simply a matter of making the event mask
57 non-zero.
58 */
59ENTRY(xen_irq_disable_direct)
60 movb $1, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
61ENDPATCH(xen_irq_disable_direct)
62 ret
63 ENDPROC(xen_irq_disable_direct)
64 RELOC(xen_irq_disable_direct, 0)
65 21
66/* 22/*
67 (xen_)save_fl is used to get the current interrupt enable status. 23 * Force an event check by making a hypercall, but preserve regs
68 Callers expect the status to be in X86_EFLAGS_IF, and other bits 24 * before making the call.
69 may be set in the return value. We take advantage of this by
70 making sure that X86_EFLAGS_IF has the right value (and other bits
71 in that byte are 0), but other bits in the return value are
72 undefined. We need to toggle the state of the bit, because
73 Xen and x86 use opposite senses (mask vs enable).
74 */ 25 */
75ENTRY(xen_save_fl_direct) 26check_events:
76 testb $0xff, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask 27 push %eax
77 setz %ah 28 push %ecx
78 addb %ah,%ah 29 push %edx
79ENDPATCH(xen_save_fl_direct) 30 call xen_force_evtchn_callback
80 ret 31 pop %edx
81 ENDPROC(xen_save_fl_direct) 32 pop %ecx
82 RELOC(xen_save_fl_direct, 0) 33 pop %eax
83
84
85/*
86 In principle the caller should be passing us a value return
87 from xen_save_fl_direct, but for robustness sake we test only
88 the X86_EFLAGS_IF flag rather than the whole byte. After
89 setting the interrupt mask state, it checks for unmasked
90 pending events and enters the hypervisor to get them delivered
91 if so.
92 */
93ENTRY(xen_restore_fl_direct)
94 testb $X86_EFLAGS_IF>>8, %ah
95 setz PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
96 /* Preempt here doesn't matter because that will deal with
97 any pending interrupts. The pending check may end up being
98 run on the wrong CPU, but that doesn't hurt. */
99
100 /* check for unmasked and pending */
101 cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_pending
102 jz 1f
1032: call check_events
1041:
105ENDPATCH(xen_restore_fl_direct)
106 ret 34 ret
107 ENDPROC(xen_restore_fl_direct)
108 RELOC(xen_restore_fl_direct, 2b+1)
109 35
110/* 36/*
111 We can't use sysexit directly, because we're not running in ring0. 37 * We can't use sysexit directly, because we're not running in ring0.
112 But we can easily fake it up using iret. Assuming xen_sysexit 38 * But we can easily fake it up using iret. Assuming xen_sysexit is
113 is jumped to with a standard stack frame, we can just strip it 39 * jumped to with a standard stack frame, we can just strip it back to
114 back to a standard iret frame and use iret. 40 * a standard iret frame and use iret.
115 */ 41 */
116ENTRY(xen_sysexit) 42ENTRY(xen_sysexit)
117 movl PT_EAX(%esp), %eax /* Shouldn't be necessary? */ 43 movl PT_EAX(%esp), %eax /* Shouldn't be necessary? */
@@ -122,33 +48,31 @@ ENTRY(xen_sysexit)
122ENDPROC(xen_sysexit) 48ENDPROC(xen_sysexit)
123 49
124/* 50/*
125 This is run where a normal iret would be run, with the same stack setup: 51 * This is run where a normal iret would be run, with the same stack setup:
126 8: eflags 52 * 8: eflags
127 4: cs 53 * 4: cs
128 esp-> 0: eip 54 * esp-> 0: eip
129 55 *
130 This attempts to make sure that any pending events are dealt 56 * This attempts to make sure that any pending events are dealt with
131 with on return to usermode, but there is a small window in 57 * on return to usermode, but there is a small window in which an
132 which an event can happen just before entering usermode. If 58 * event can happen just before entering usermode. If the nested
133 the nested interrupt ends up setting one of the TIF_WORK_MASK 59 * interrupt ends up setting one of the TIF_WORK_MASK pending work
134 pending work flags, they will not be tested again before 60 * flags, they will not be tested again before returning to
135 returning to usermode. This means that a process can end up 61 * usermode. This means that a process can end up with pending work,
136 with pending work, which will be unprocessed until the process 62 * which will be unprocessed until the process enters and leaves the
137 enters and leaves the kernel again, which could be an 63 * kernel again, which could be an unbounded amount of time. This
138 unbounded amount of time. This means that a pending signal or 64 * means that a pending signal or reschedule event could be
139 reschedule event could be indefinitely delayed. 65 * indefinitely delayed.
140 66 *
141 The fix is to notice a nested interrupt in the critical 67 * The fix is to notice a nested interrupt in the critical window, and
142 window, and if one occurs, then fold the nested interrupt into 68 * if one occurs, then fold the nested interrupt into the current
143 the current interrupt stack frame, and re-process it 69 * interrupt stack frame, and re-process it iteratively rather than
144 iteratively rather than recursively. This means that it will 70 * recursively. This means that it will exit via the normal path, and
145 exit via the normal path, and all pending work will be dealt 71 * all pending work will be dealt with appropriately.
146 with appropriately. 72 *
147 73 * Because the nested interrupt handler needs to deal with the current
148 Because the nested interrupt handler needs to deal with the 74 * stack state in whatever form its in, we keep things simple by only
149 current stack state in whatever form its in, we keep things 75 * using a single register which is pushed/popped on the stack.
150 simple by only using a single register which is pushed/popped
151 on the stack.
152 */ 76 */
153ENTRY(xen_iret) 77ENTRY(xen_iret)
154 /* test eflags for special cases */ 78 /* test eflags for special cases */
@@ -158,13 +82,15 @@ ENTRY(xen_iret)
158 push %eax 82 push %eax
159 ESP_OFFSET=4 # bytes pushed onto stack 83 ESP_OFFSET=4 # bytes pushed onto stack
160 84
161 /* Store vcpu_info pointer for easy access. Do it this 85 /*
162 way to avoid having to reload %fs */ 86 * Store vcpu_info pointer for easy access. Do it this way to
87 * avoid having to reload %fs
88 */
163#ifdef CONFIG_SMP 89#ifdef CONFIG_SMP
164 GET_THREAD_INFO(%eax) 90 GET_THREAD_INFO(%eax)
165 movl TI_cpu(%eax),%eax 91 movl TI_cpu(%eax), %eax
166 movl __per_cpu_offset(,%eax,4),%eax 92 movl __per_cpu_offset(,%eax,4), %eax
167 mov per_cpu__xen_vcpu(%eax),%eax 93 mov per_cpu__xen_vcpu(%eax), %eax
168#else 94#else
169 movl per_cpu__xen_vcpu, %eax 95 movl per_cpu__xen_vcpu, %eax
170#endif 96#endif
@@ -172,37 +98,46 @@ ENTRY(xen_iret)
172 /* check IF state we're restoring */ 98 /* check IF state we're restoring */
173 testb $X86_EFLAGS_IF>>8, 8+1+ESP_OFFSET(%esp) 99 testb $X86_EFLAGS_IF>>8, 8+1+ESP_OFFSET(%esp)
174 100
175 /* Maybe enable events. Once this happens we could get a 101 /*
176 recursive event, so the critical region starts immediately 102 * Maybe enable events. Once this happens we could get a
177 afterwards. However, if that happens we don't end up 103 * recursive event, so the critical region starts immediately
178 resuming the code, so we don't have to be worried about 104 * afterwards. However, if that happens we don't end up
179 being preempted to another CPU. */ 105 * resuming the code, so we don't have to be worried about
106 * being preempted to another CPU.
107 */
180 setz XEN_vcpu_info_mask(%eax) 108 setz XEN_vcpu_info_mask(%eax)
181xen_iret_start_crit: 109xen_iret_start_crit:
182 110
183 /* check for unmasked and pending */ 111 /* check for unmasked and pending */
184 cmpw $0x0001, XEN_vcpu_info_pending(%eax) 112 cmpw $0x0001, XEN_vcpu_info_pending(%eax)
185 113
186 /* If there's something pending, mask events again so we 114 /*
187 can jump back into xen_hypervisor_callback */ 115 * If there's something pending, mask events again so we can
116 * jump back into xen_hypervisor_callback
117 */
188 sete XEN_vcpu_info_mask(%eax) 118 sete XEN_vcpu_info_mask(%eax)
189 119
190 popl %eax 120 popl %eax
191 121
192 /* From this point on the registers are restored and the stack 122 /*
193 updated, so we don't need to worry about it if we're preempted */ 123 * From this point on the registers are restored and the stack
124 * updated, so we don't need to worry about it if we're
125 * preempted
126 */
194iret_restore_end: 127iret_restore_end:
195 128
196 /* Jump to hypervisor_callback after fixing up the stack. 129 /*
197 Events are masked, so jumping out of the critical 130 * Jump to hypervisor_callback after fixing up the stack.
198 region is OK. */ 131 * Events are masked, so jumping out of the critical region is
132 * OK.
133 */
199 je xen_hypervisor_callback 134 je xen_hypervisor_callback
200 135
2011: iret 1361: iret
202xen_iret_end_crit: 137xen_iret_end_crit:
203.section __ex_table,"a" 138.section __ex_table, "a"
204 .align 4 139 .align 4
205 .long 1b,iret_exc 140 .long 1b, iret_exc
206.previous 141.previous
207 142
208hyper_iret: 143hyper_iret:
@@ -212,55 +147,55 @@ hyper_iret:
212 .globl xen_iret_start_crit, xen_iret_end_crit 147 .globl xen_iret_start_crit, xen_iret_end_crit
213 148
214/* 149/*
215 This is called by xen_hypervisor_callback in entry.S when it sees 150 * This is called by xen_hypervisor_callback in entry.S when it sees
216 that the EIP at the time of interrupt was between xen_iret_start_crit 151 * that the EIP at the time of interrupt was between
217 and xen_iret_end_crit. We're passed the EIP in %eax so we can do 152 * xen_iret_start_crit and xen_iret_end_crit. We're passed the EIP in
218 a more refined determination of what to do. 153 * %eax so we can do a more refined determination of what to do.
219 154 *
220 The stack format at this point is: 155 * The stack format at this point is:
221 ---------------- 156 * ----------------
222 ss : (ss/esp may be present if we came from usermode) 157 * ss : (ss/esp may be present if we came from usermode)
223 esp : 158 * esp :
224 eflags } outer exception info 159 * eflags } outer exception info
225 cs } 160 * cs }
226 eip } 161 * eip }
227 ---------------- <- edi (copy dest) 162 * ---------------- <- edi (copy dest)
228 eax : outer eax if it hasn't been restored 163 * eax : outer eax if it hasn't been restored
229 ---------------- 164 * ----------------
230 eflags } nested exception info 165 * eflags } nested exception info
231 cs } (no ss/esp because we're nested 166 * cs } (no ss/esp because we're nested
232 eip } from the same ring) 167 * eip } from the same ring)
233 orig_eax }<- esi (copy src) 168 * orig_eax }<- esi (copy src)
234 - - - - - - - - 169 * - - - - - - - -
235 fs } 170 * fs }
236 es } 171 * es }
237 ds } SAVE_ALL state 172 * ds } SAVE_ALL state
238 eax } 173 * eax }
239 : : 174 * : :
240 ebx }<- esp 175 * ebx }<- esp
241 ---------------- 176 * ----------------
242 177 *
243 In order to deliver the nested exception properly, we need to shift 178 * In order to deliver the nested exception properly, we need to shift
244 everything from the return addr up to the error code so it 179 * everything from the return addr up to the error code so it sits
245 sits just under the outer exception info. This means that when we 180 * just under the outer exception info. This means that when we
246 handle the exception, we do it in the context of the outer exception 181 * handle the exception, we do it in the context of the outer
247 rather than starting a new one. 182 * exception rather than starting a new one.
248 183 *
249 The only caveat is that if the outer eax hasn't been 184 * The only caveat is that if the outer eax hasn't been restored yet
250 restored yet (ie, it's still on stack), we need to insert 185 * (ie, it's still on stack), we need to insert its value into the
251 its value into the SAVE_ALL state before going on, since 186 * SAVE_ALL state before going on, since it's usermode state which we
252 it's usermode state which we eventually need to restore. 187 * eventually need to restore.
253 */ 188 */
254ENTRY(xen_iret_crit_fixup) 189ENTRY(xen_iret_crit_fixup)
255 /* 190 /*
256 Paranoia: Make sure we're really coming from kernel space. 191 * Paranoia: Make sure we're really coming from kernel space.
257 One could imagine a case where userspace jumps into the 192 * One could imagine a case where userspace jumps into the
258 critical range address, but just before the CPU delivers a GP, 193 * critical range address, but just before the CPU delivers a
259 it decides to deliver an interrupt instead. Unlikely? 194 * GP, it decides to deliver an interrupt instead. Unlikely?
260 Definitely. Easy to avoid? Yes. The Intel documents 195 * Definitely. Easy to avoid? Yes. The Intel documents
261 explicitly say that the reported EIP for a bad jump is the 196 * explicitly say that the reported EIP for a bad jump is the
262 jump instruction itself, not the destination, but some virtual 197 * jump instruction itself, not the destination, but some
263 environments get this wrong. 198 * virtual environments get this wrong.
264 */ 199 */
265 movl PT_CS(%esp), %ecx 200 movl PT_CS(%esp), %ecx
266 andl $SEGMENT_RPL_MASK, %ecx 201 andl $SEGMENT_RPL_MASK, %ecx
@@ -270,15 +205,17 @@ ENTRY(xen_iret_crit_fixup)
270 lea PT_ORIG_EAX(%esp), %esi 205 lea PT_ORIG_EAX(%esp), %esi
271 lea PT_EFLAGS(%esp), %edi 206 lea PT_EFLAGS(%esp), %edi
272 207
273 /* If eip is before iret_restore_end then stack 208 /*
274 hasn't been restored yet. */ 209 * If eip is before iret_restore_end then stack
210 * hasn't been restored yet.
211 */
275 cmp $iret_restore_end, %eax 212 cmp $iret_restore_end, %eax
276 jae 1f 213 jae 1f
277 214
278 movl 0+4(%edi),%eax /* copy EAX (just above top of frame) */ 215 movl 0+4(%edi), %eax /* copy EAX (just above top of frame) */
279 movl %eax, PT_EAX(%esp) 216 movl %eax, PT_EAX(%esp)
280 217
281 lea ESP_OFFSET(%edi),%edi /* move dest up over saved regs */ 218 lea ESP_OFFSET(%edi), %edi /* move dest up over saved regs */
282 219
283 /* set up the copy */ 220 /* set up the copy */
2841: std 2211: std
@@ -286,20 +223,6 @@ ENTRY(xen_iret_crit_fixup)
286 rep movsl 223 rep movsl
287 cld 224 cld
288 225
289 lea 4(%edi),%esp /* point esp to new frame */ 226 lea 4(%edi), %esp /* point esp to new frame */
2902: jmp xen_do_upcall 2272: jmp xen_do_upcall
291 228
292
293/*
294 Force an event check by making a hypercall,
295 but preserve regs before making the call.
296 */
297check_events:
298 push %eax
299 push %ecx
300 push %edx
301 call xen_force_evtchn_callback
302 pop %edx
303 pop %ecx
304 pop %eax
305 ret
diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S
index 05794c566e87..02f496a8dbaa 100644
--- a/arch/x86/xen/xen-asm_64.S
+++ b/arch/x86/xen/xen-asm_64.S
@@ -1,174 +1,45 @@
1/* 1/*
2 Asm versions of Xen pv-ops, suitable for either direct use or inlining. 2 * Asm versions of Xen pv-ops, suitable for either direct use or
3 The inline versions are the same as the direct-use versions, with the 3 * inlining. The inline versions are the same as the direct-use
4 pre- and post-amble chopped off. 4 * versions, with the pre- and post-amble chopped off.
5 5 *
6 This code is encoded for size rather than absolute efficiency, 6 * This code is encoded for size rather than absolute efficiency, with
7 with a view to being able to inline as much as possible. 7 * a view to being able to inline as much as possible.
8 8 *
9 We only bother with direct forms (ie, vcpu in pda) of the operations 9 * We only bother with direct forms (ie, vcpu in pda) of the
10 here; the indirect forms are better handled in C, since they're 10 * operations here; the indirect forms are better handled in C, since
11 generally too large to inline anyway. 11 * they're generally too large to inline anyway.
12 */ 12 */
13 13
14#include <linux/linkage.h>
15
16#include <asm/asm-offsets.h>
17#include <asm/processor-flags.h>
18#include <asm/errno.h> 14#include <asm/errno.h>
15#include <asm/percpu.h>
16#include <asm/processor-flags.h>
19#include <asm/segment.h> 17#include <asm/segment.h>
20 18
21#include <xen/interface/xen.h> 19#include <xen/interface/xen.h>
22 20
23#define RELOC(x, v) .globl x##_reloc; x##_reloc=v 21#include "xen-asm.h"
24#define ENDPATCH(x) .globl x##_end; x##_end=.
25
26/* Pseudo-flag used for virtual NMI, which we don't implement yet */
27#define XEN_EFLAGS_NMI 0x80000000
28
29#if 1
30/*
31 x86-64 does not yet support direct access to percpu variables
32 via a segment override, so we just need to make sure this code
33 never gets used
34 */
35#define BUG ud2a
36#define PER_CPU_VAR(var, off) 0xdeadbeef
37#endif
38
39/*
40 Enable events. This clears the event mask and tests the pending
41 event status with one and operation. If there are pending
42 events, then enter the hypervisor to get them handled.
43 */
44ENTRY(xen_irq_enable_direct)
45 BUG
46
47 /* Unmask events */
48 movb $0, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
49
50 /* Preempt here doesn't matter because that will deal with
51 any pending interrupts. The pending check may end up being
52 run on the wrong CPU, but that doesn't hurt. */
53
54 /* Test for pending */
55 testb $0xff, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_pending)
56 jz 1f
57
582: call check_events
591:
60ENDPATCH(xen_irq_enable_direct)
61 ret
62 ENDPROC(xen_irq_enable_direct)
63 RELOC(xen_irq_enable_direct, 2b+1)
64
65/*
66 Disabling events is simply a matter of making the event mask
67 non-zero.
68 */
69ENTRY(xen_irq_disable_direct)
70 BUG
71
72 movb $1, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
73ENDPATCH(xen_irq_disable_direct)
74 ret
75 ENDPROC(xen_irq_disable_direct)
76 RELOC(xen_irq_disable_direct, 0)
77
78/*
79 (xen_)save_fl is used to get the current interrupt enable status.
80 Callers expect the status to be in X86_EFLAGS_IF, and other bits
81 may be set in the return value. We take advantage of this by
82 making sure that X86_EFLAGS_IF has the right value (and other bits
83 in that byte are 0), but other bits in the return value are
84 undefined. We need to toggle the state of the bit, because
85 Xen and x86 use opposite senses (mask vs enable).
86 */
87ENTRY(xen_save_fl_direct)
88 BUG
89
90 testb $0xff, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
91 setz %ah
92 addb %ah,%ah
93ENDPATCH(xen_save_fl_direct)
94 ret
95 ENDPROC(xen_save_fl_direct)
96 RELOC(xen_save_fl_direct, 0)
97
98/*
99 In principle the caller should be passing us a value return
100 from xen_save_fl_direct, but for robustness sake we test only
101 the X86_EFLAGS_IF flag rather than the whole byte. After
102 setting the interrupt mask state, it checks for unmasked
103 pending events and enters the hypervisor to get them delivered
104 if so.
105 */
106ENTRY(xen_restore_fl_direct)
107 BUG
108
109 testb $X86_EFLAGS_IF>>8, %ah
110 setz PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_mask)
111 /* Preempt here doesn't matter because that will deal with
112 any pending interrupts. The pending check may end up being
113 run on the wrong CPU, but that doesn't hurt. */
114
115 /* check for unmasked and pending */
116 cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info, XEN_vcpu_info_pending)
117 jz 1f
1182: call check_events
1191:
120ENDPATCH(xen_restore_fl_direct)
121 ret
122 ENDPROC(xen_restore_fl_direct)
123 RELOC(xen_restore_fl_direct, 2b+1)
124
125
126/*
127 Force an event check by making a hypercall,
128 but preserve regs before making the call.
129 */
130check_events:
131 push %rax
132 push %rcx
133 push %rdx
134 push %rsi
135 push %rdi
136 push %r8
137 push %r9
138 push %r10
139 push %r11
140 call xen_force_evtchn_callback
141 pop %r11
142 pop %r10
143 pop %r9
144 pop %r8
145 pop %rdi
146 pop %rsi
147 pop %rdx
148 pop %rcx
149 pop %rax
150 ret
151 22
152ENTRY(xen_adjust_exception_frame) 23ENTRY(xen_adjust_exception_frame)
153 mov 8+0(%rsp),%rcx 24 mov 8+0(%rsp), %rcx
154 mov 8+8(%rsp),%r11 25 mov 8+8(%rsp), %r11
155 ret $16 26 ret $16
156 27
157hypercall_iret = hypercall_page + __HYPERVISOR_iret * 32 28hypercall_iret = hypercall_page + __HYPERVISOR_iret * 32
158/* 29/*
159 Xen64 iret frame: 30 * Xen64 iret frame:
160 31 *
161 ss 32 * ss
162 rsp 33 * rsp
163 rflags 34 * rflags
164 cs 35 * cs
165 rip <-- standard iret frame 36 * rip <-- standard iret frame
166 37 *
167 flags 38 * flags
168 39 *
169 rcx } 40 * rcx }
170 r11 }<-- pushed by hypercall page 41 * r11 }<-- pushed by hypercall page
171rsp -> rax } 42 * rsp->rax }
172 */ 43 */
173ENTRY(xen_iret) 44ENTRY(xen_iret)
174 pushq $0 45 pushq $0
@@ -177,8 +48,8 @@ ENDPATCH(xen_iret)
177RELOC(xen_iret, 1b+1) 48RELOC(xen_iret, 1b+1)
178 49
179/* 50/*
180 sysexit is not used for 64-bit processes, so it's 51 * sysexit is not used for 64-bit processes, so it's only ever used to
181 only ever used to return to 32-bit compat userspace. 52 * return to 32-bit compat userspace.
182 */ 53 */
183ENTRY(xen_sysexit) 54ENTRY(xen_sysexit)
184 pushq $__USER32_DS 55 pushq $__USER32_DS
@@ -193,13 +64,15 @@ ENDPATCH(xen_sysexit)
193RELOC(xen_sysexit, 1b+1) 64RELOC(xen_sysexit, 1b+1)
194 65
195ENTRY(xen_sysret64) 66ENTRY(xen_sysret64)
196 /* We're already on the usermode stack at this point, but still 67 /*
197 with the kernel gs, so we can easily switch back */ 68 * We're already on the usermode stack at this point, but
198 movq %rsp, %gs:pda_oldrsp 69 * still with the kernel gs, so we can easily switch back
199 movq %gs:pda_kernelstack,%rsp 70 */
71 movq %rsp, PER_CPU_VAR(old_rsp)
72 movq PER_CPU_VAR(kernel_stack), %rsp
200 73
201 pushq $__USER_DS 74 pushq $__USER_DS
202 pushq %gs:pda_oldrsp 75 pushq PER_CPU_VAR(old_rsp)
203 pushq %r11 76 pushq %r11
204 pushq $__USER_CS 77 pushq $__USER_CS
205 pushq %rcx 78 pushq %rcx
@@ -210,13 +83,15 @@ ENDPATCH(xen_sysret64)
210RELOC(xen_sysret64, 1b+1) 83RELOC(xen_sysret64, 1b+1)
211 84
212ENTRY(xen_sysret32) 85ENTRY(xen_sysret32)
213 /* We're already on the usermode stack at this point, but still 86 /*
214 with the kernel gs, so we can easily switch back */ 87 * We're already on the usermode stack at this point, but
215 movq %rsp, %gs:pda_oldrsp 88 * still with the kernel gs, so we can easily switch back
216 movq %gs:pda_kernelstack, %rsp 89 */
90 movq %rsp, PER_CPU_VAR(old_rsp)
91 movq PER_CPU_VAR(kernel_stack), %rsp
217 92
218 pushq $__USER32_DS 93 pushq $__USER32_DS
219 pushq %gs:pda_oldrsp 94 pushq PER_CPU_VAR(old_rsp)
220 pushq %r11 95 pushq %r11
221 pushq $__USER32_CS 96 pushq $__USER32_CS
222 pushq %rcx 97 pushq %rcx
@@ -227,28 +102,27 @@ ENDPATCH(xen_sysret32)
227RELOC(xen_sysret32, 1b+1) 102RELOC(xen_sysret32, 1b+1)
228 103
229/* 104/*
230 Xen handles syscall callbacks much like ordinary exceptions, 105 * Xen handles syscall callbacks much like ordinary exceptions, which
231 which means we have: 106 * means we have:
232 - kernel gs 107 * - kernel gs
233 - kernel rsp 108 * - kernel rsp
234 - an iret-like stack frame on the stack (including rcx and r11): 109 * - an iret-like stack frame on the stack (including rcx and r11):
235 ss 110 * ss
236 rsp 111 * rsp
237 rflags 112 * rflags
238 cs 113 * cs
239 rip 114 * rip
240 r11 115 * r11
241 rsp-> rcx 116 * rsp->rcx
242 117 *
243 In all the entrypoints, we undo all that to make it look 118 * In all the entrypoints, we undo all that to make it look like a
244 like a CPU-generated syscall/sysenter and jump to the normal 119 * CPU-generated syscall/sysenter and jump to the normal entrypoint.
245 entrypoint.
246 */ 120 */
247 121
248.macro undo_xen_syscall 122.macro undo_xen_syscall
249 mov 0*8(%rsp),%rcx 123 mov 0*8(%rsp), %rcx
250 mov 1*8(%rsp),%r11 124 mov 1*8(%rsp), %r11
251 mov 5*8(%rsp),%rsp 125 mov 5*8(%rsp), %rsp
252.endm 126.endm
253 127
254/* Normal 64-bit system call target */ 128/* Normal 64-bit system call target */
@@ -275,7 +149,7 @@ ENDPROC(xen_sysenter_target)
275 149
276ENTRY(xen_syscall32_target) 150ENTRY(xen_syscall32_target)
277ENTRY(xen_sysenter_target) 151ENTRY(xen_sysenter_target)
278 lea 16(%rsp), %rsp /* strip %rcx,%r11 */ 152 lea 16(%rsp), %rsp /* strip %rcx, %r11 */
279 mov $-ENOSYS, %rax 153 mov $-ENOSYS, %rax
280 pushq $VGCF_in_syscall 154 pushq $VGCF_in_syscall
281 jmp hypercall_iret 155 jmp hypercall_iret
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 63d49a523ed3..1a5ff24e29c0 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -8,7 +8,7 @@
8 8
9#include <asm/boot.h> 9#include <asm/boot.h>
10#include <asm/asm.h> 10#include <asm/asm.h>
11#include <asm/page.h> 11#include <asm/page_types.h>
12 12
13#include <xen/interface/elfnote.h> 13#include <xen/interface/elfnote.h>
14#include <asm/xen/interface.h> 14#include <asm/xen/interface.h>
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index c1f8faf0a2c5..2f5ef2632ea2 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -10,9 +10,12 @@
10extern const char xen_hypervisor_callback[]; 10extern const char xen_hypervisor_callback[];
11extern const char xen_failsafe_callback[]; 11extern const char xen_failsafe_callback[];
12 12
13extern void *xen_initial_gdt;
14
13struct trap_info; 15struct trap_info;
14void xen_copy_trap_info(struct trap_info *traps); 16void xen_copy_trap_info(struct trap_info *traps);
15 17
18DECLARE_PER_CPU(struct vcpu_info, xen_vcpu_info);
16DECLARE_PER_CPU(unsigned long, xen_cr3); 19DECLARE_PER_CPU(unsigned long, xen_cr3);
17DECLARE_PER_CPU(unsigned long, xen_current_cr3); 20DECLARE_PER_CPU(unsigned long, xen_current_cr3);
18 21
@@ -22,6 +25,13 @@ extern struct shared_info *HYPERVISOR_shared_info;
22 25
23void xen_setup_mfn_list_list(void); 26void xen_setup_mfn_list_list(void);
24void xen_setup_shared_info(void); 27void xen_setup_shared_info(void);
28void xen_setup_machphys_mapping(void);
29pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn);
30void xen_ident_map_ISA(void);
31void xen_reserve_top(void);
32
33void xen_leave_lazy(void);
34void xen_post_allocator_init(void);
25 35
26char * __init xen_memory_setup(void); 36char * __init xen_memory_setup(void);
27void __init xen_arch_setup(void); 37void __init xen_arch_setup(void);
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
index 6100682b1da2..dd1a7a4a1cea 100644
--- a/arch/xtensa/include/asm/socket.h
+++ b/arch/xtensa/include/asm/socket.h
@@ -65,4 +65,7 @@
65 65
66#define SO_MARK 36 66#define SO_MARK 36
67 67
68#define SO_TIMESTAMPING 37
69#define SCM_TIMESTAMPING SO_TIMESTAMPING
70
68#endif /* _XTENSA_SOCKET_H */ 71#endif /* _XTENSA_SOCKET_H */
diff --git a/arch/xtensa/include/asm/swab.h b/arch/xtensa/include/asm/swab.h
index f50b697eb601..226a39162310 100644
--- a/arch/xtensa/include/asm/swab.h
+++ b/arch/xtensa/include/asm/swab.h
@@ -11,7 +11,7 @@
11#ifndef _XTENSA_SWAB_H 11#ifndef _XTENSA_SWAB_H
12#define _XTENSA_SWAB_H 12#define _XTENSA_SWAB_H
13 13
14#include <asm/types.h> 14#include <linux/types.h>
15#include <linux/compiler.h> 15#include <linux/compiler.h>
16 16
17#define __SWAB_64_THRU_32__ 17#define __SWAB_64_THRU_32__
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c
index 5fbcde59a92d..f3b66fba5b8f 100644
--- a/arch/xtensa/kernel/irq.c
+++ b/arch/xtensa/kernel/irq.c
@@ -99,7 +99,7 @@ int show_interrupts(struct seq_file *p, void *v)
99 seq_printf(p, "%10u ", kstat_irqs(i)); 99 seq_printf(p, "%10u ", kstat_irqs(i));
100#else 100#else
101 for_each_online_cpu(j) 101 for_each_online_cpu(j)
102 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 102 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
103#endif 103#endif
104 seq_printf(p, " %14s", irq_desc[i].chip->typename); 104 seq_printf(p, " %14s", irq_desc[i].chip->typename);
105 seq_printf(p, " %s", action->name); 105 seq_printf(p, " %s", action->name);